From 9480f880c46435e9f813dc8fb018ffb3bfe7e767 Mon Sep 17 00:00:00 2001 From: keni Date: Thu, 26 Feb 2015 08:54:12 -0500 Subject: [PATCH 001/354] Add .gitattribute files. --- .gitattributes | 1 + dat/.gitattributes | 3 +++ doc/.gitattributes | 5 +++++ sys/amiga/.gitattributes | 1 + sys/mac/.gitattributes | 1 + sys/msdos/.gitattributes | 4 ++++ sys/os2/.gitattributes | 1 + sys/share/.gitattributes | 1 + sys/unix/.gitattributes | 1 + sys/unix/hints/.gitattributes | 1 + sys/vms/.gitattributes | 1 + sys/wince/.gitattributes | 3 +++ sys/winnt/.gitattributes | 4 ++++ 13 files changed, 27 insertions(+) create mode 100644 dat/.gitattributes create mode 100644 doc/.gitattributes create mode 100644 sys/amiga/.gitattributes create mode 100644 sys/mac/.gitattributes create mode 100644 sys/msdos/.gitattributes create mode 100644 sys/os2/.gitattributes create mode 100644 sys/share/.gitattributes create mode 100644 sys/unix/.gitattributes create mode 100644 sys/unix/hints/.gitattributes create mode 100644 sys/vms/.gitattributes create mode 100644 sys/wince/.gitattributes create mode 100644 sys/winnt/.gitattributes diff --git a/.gitattributes b/.gitattributes index 72533dbce..894a91c8e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ *.[ch] filter=NHtext merge=NHsubst +*.sh filter=NHtext merge=NHsubst * text=auto *.hqx -text *.sln -text diff --git a/dat/.gitattributes b/dat/.gitattributes new file mode 100644 index 000000000..72aa05edd --- /dev/null +++ b/dat/.gitattributes @@ -0,0 +1,3 @@ +*.def filter=NHtext merge=NHsubst +*.des filter=NHtext merge=NHsubst +*.txt filter=NHtext merge=NHsubst diff --git a/doc/.gitattributes b/doc/.gitattributes new file mode 100644 index 000000000..9ca881076 --- /dev/null +++ b/doc/.gitattributes @@ -0,0 +1,5 @@ +*.mn filter=NHtext merge=NHsubst +*.6 filter=NHtext merge=NHsubst +fixes.* filter=NHtext merge=NHsubst +window.doc filter=NHtext merge=NHsubst + diff --git a/sys/amiga/.gitattributes b/sys/amiga/.gitattributes new file mode 100644 index 000000000..7a28030a9 --- /dev/null +++ b/sys/amiga/.gitattributes @@ -0,0 +1 @@ +*.p filter=NHtext merge=NHsubst diff --git a/sys/mac/.gitattributes b/sys/mac/.gitattributes new file mode 100644 index 000000000..62b9832d7 --- /dev/null +++ b/sys/mac/.gitattributes @@ -0,0 +1 @@ +NHDeflts filter=NHtext merge=NHsubst diff --git a/sys/msdos/.gitattributes b/sys/msdos/.gitattributes new file mode 100644 index 000000000..baef52e46 --- /dev/null +++ b/sys/msdos/.gitattributes @@ -0,0 +1,4 @@ +*.BC filter=NHtext merge=NHsubst +*.bat filter=NHtext merge=NHsubst +Makefile.* filter=NHtext merge=NHsubst +Install.* filter=NHtext merge=NHsubst diff --git a/sys/os2/.gitattributes b/sys/os2/.gitattributes new file mode 100644 index 000000000..8cffb77ae --- /dev/null +++ b/sys/os2/.gitattributes @@ -0,0 +1 @@ +Makefile.* filter=NHtext merge=NHsubst diff --git a/sys/share/.gitattributes b/sys/share/.gitattributes new file mode 100644 index 000000000..8cffb77ae --- /dev/null +++ b/sys/share/.gitattributes @@ -0,0 +1 @@ +Makefile.* filter=NHtext merge=NHsubst diff --git a/sys/unix/.gitattributes b/sys/unix/.gitattributes new file mode 100644 index 000000000..8cffb77ae --- /dev/null +++ b/sys/unix/.gitattributes @@ -0,0 +1 @@ +Makefile.* filter=NHtext merge=NHsubst diff --git a/sys/unix/hints/.gitattributes b/sys/unix/hints/.gitattributes new file mode 100644 index 000000000..a079959f1 --- /dev/null +++ b/sys/unix/hints/.gitattributes @@ -0,0 +1 @@ +* filter=NHtext merge=NHsubst diff --git a/sys/vms/.gitattributes b/sys/vms/.gitattributes new file mode 100644 index 000000000..8cffb77ae --- /dev/null +++ b/sys/vms/.gitattributes @@ -0,0 +1 @@ +Makefile.* filter=NHtext merge=NHsubst diff --git a/sys/wince/.gitattributes b/sys/wince/.gitattributes new file mode 100644 index 000000000..e034edc5e --- /dev/null +++ b/sys/wince/.gitattributes @@ -0,0 +1,3 @@ +*.ce filter=NHtext merge=NHsubst +*.mak filter=NHtext merge=NHsubst +*.bat filter=NHtext merge=NHsubst diff --git a/sys/winnt/.gitattributes b/sys/winnt/.gitattributes new file mode 100644 index 000000000..2a38b029c --- /dev/null +++ b/sys/winnt/.gitattributes @@ -0,0 +1,4 @@ +Install.nt filter=NHtext merge=NHsubst +Makefile.* filter=NHtext merge=NHsubst +*.rc filter=NHtext merge=NHsubst +*.bat filter=NHtext merge=NHsubst From 03140969ee1b066842c59e08921749ac04d28f68 Mon Sep 17 00:00:00 2001 From: keni Date: Thu, 26 Feb 2015 09:19:03 -0500 Subject: [PATCH 002/354] Bulk recovery of file CVS headers and addition of NHDT- headers. --- dat/Arch.des | 3 ++- dat/Barb.des | 3 ++- dat/Caveman.des | 3 ++- dat/Healer.des | 3 ++- dat/Knight.des | 3 ++- dat/Monk.des | 3 ++- dat/Priest.des | 3 ++- dat/Ranger.des | 3 ++- dat/Rogue.des | 3 ++- dat/Samurai.des | 3 ++- dat/Tourist.des | 3 ++- dat/Valkyrie.des | 3 ++- dat/Wizard.des | 3 ++- dat/bigroom.des | 3 ++- dat/castle.des | 3 ++- dat/data.base | 3 ++- dat/dungeon.def | 3 ++- dat/endgame.des | 3 ++- dat/gehennom.des | 3 ++- dat/knox.des | 3 ++- dat/medusa.des | 3 ++- dat/mines.des | 3 ++- dat/oracle.des | 3 ++- dat/quest.txt | 3 ++- dat/sokoban.des | 3 ++- dat/tower.des | 3 ++- dat/yendor.des | 3 ++- doc/Guidebook.mn | 3 ++- doc/dgn_comp.6 | 3 ++- doc/dlb.6 | 3 ++- doc/fixes30.0 | 3 ++- doc/fixes34.1 | 3 ++- doc/fixes34.2 | 3 ++- doc/fixes34.3 | 3 ++- doc/fixes35.0 | 3 ++- doc/lev_comp.6 | 3 ++- doc/makedefs.6 | 3 ++- doc/nethack.6 | 3 ++- doc/recover.6 | 3 ++- doc/window.doc | 3 ++- include/align.h | 3 ++- include/amiconf.h | 3 ++- include/artifact.h | 3 ++- include/artilist.h | 3 ++- include/attrib.h | 3 ++- include/beconf.h | 3 ++- include/botl.h | 3 ++- include/color.h | 3 ++- include/config.h | 3 ++- include/config1.h | 3 ++- include/context.h | 3 ++- include/coord.h | 3 ++- include/decl.h | 3 ++- include/def_os2.h | 3 ++- include/dgn_file.h | 3 ++- include/display.h | 3 ++- include/dlb.h | 3 ++- include/dungeon.h | 3 ++- include/engrave.h | 3 ++- include/extern.h | 3 ++- include/flag.h | 3 ++- include/func_tab.h | 3 ++- include/global.h | 3 ++- include/hack.h | 3 ++- include/lev.h | 3 ++- include/mac-carbon.h | 3 ++- include/mac-qt.h | 3 ++- include/mac-term.h | 3 ++- include/macconf.h | 3 ++- include/macpopup.h | 3 ++- include/mactty.h | 3 ++- include/macwin.h | 3 ++- include/mail.h | 3 ++- include/mextra.h | 3 ++- include/mfndpos.h | 3 ++- include/micro.h | 3 ++- include/mkroom.h | 3 ++- include/monattk.h | 3 ++- include/mondata.h | 3 ++- include/monflag.h | 3 ++- include/monst.h | 3 ++- include/monsym.h | 3 ++- include/mttypriv.h | 3 ++- include/ntconf.h | 3 ++- include/obj.h | 3 ++- include/objclass.h | 3 ++- include/os2conf.h | 3 ++- include/patchlevel.h | 3 ++- include/pcconf.h | 3 ++- include/permonst.h | 3 ++- include/prop.h | 3 ++- include/qt_clust.h | 3 ++- include/qt_kde0.h | 3 ++- include/qt_win.h | 3 ++- include/qtext.h | 3 ++- include/qttableview.h | 3 ++- include/quest.h | 3 ++- include/rect.h | 3 ++- include/region.h | 3 ++- include/rm.h | 3 ++- include/skills.h | 3 ++- include/sp_lev.h | 3 ++- include/spell.h | 3 ++- include/sys.h | 3 ++- include/system.h | 3 ++- include/tcap.h | 3 ++- include/tile2x11.h | 3 ++- include/timeout.h | 3 ++- include/tosconf.h | 3 ++- include/tradstdc.h | 3 ++- include/trampoli.h | 3 ++- include/trap.h | 3 ++- include/unixconf.h | 3 ++- include/vision.h | 3 ++- include/vmsconf.h | 3 ++- include/wceconf.h | 3 ++- include/winGnome.h | 3 ++- include/winX.h | 3 ++- include/winami.h | 3 ++- include/wingem.h | 3 ++- include/winprocs.h | 3 ++- include/wintty.h | 3 ++- include/wintype.h | 3 ++- include/xwindow.h | 3 ++- include/xwindowp.h | 3 ++- include/you.h | 3 ++- include/youprop.h | 3 ++- src/allmain.c | 3 ++- src/alloc.c | 3 ++- src/apply.c | 3 ++- src/artifact.c | 3 ++- src/attrib.c | 3 ++- src/ball.c | 3 ++- src/bones.c | 3 ++- src/botl.c | 3 ++- src/cmd.c | 3 ++- src/dbridge.c | 3 ++- src/decl.c | 3 ++- src/detect.c | 3 ++- src/dig.c | 3 ++- src/display.c | 3 ++- src/dlb.c | 3 ++- src/do.c | 3 ++- src/do_name.c | 3 ++- src/do_wear.c | 3 ++- src/dog.c | 3 ++- src/dogmove.c | 3 ++- src/dokick.c | 3 ++- src/dothrow.c | 3 ++- src/drawing.c | 3 ++- src/dungeon.c | 3 ++- src/eat.c | 3 ++- src/end.c | 3 ++- src/engrave.c | 3 ++- src/exper.c | 3 ++- src/explode.c | 3 ++- src/extralev.c | 3 ++- src/files.c | 3 ++- src/fountain.c | 3 ++- src/hack.c | 3 ++- src/hacklib.c | 3 ++- src/invent.c | 3 ++- src/light.c | 3 ++- src/lock.c | 3 ++- src/mail.c | 3 ++- src/makemon.c | 3 ++- src/mapglyph.c | 3 ++- src/mcastu.c | 3 ++- src/mhitm.c | 3 ++- src/mhitu.c | 3 ++- src/minion.c | 3 ++- src/mklev.c | 3 ++- src/mkmap.c | 3 ++- src/mkmaze.c | 3 ++- src/mkobj.c | 3 ++- src/mkroom.c | 3 ++- src/mon.c | 3 ++- src/mondata.c | 3 ++- src/monmove.c | 3 ++- src/monst.c | 3 ++- src/mplayer.c | 3 ++- src/mthrowu.c | 3 ++- src/muse.c | 3 ++- src/music.c | 3 ++- src/o_init.c | 3 ++- src/objects.c | 3 ++- src/objnam.c | 3 ++- src/options.c | 3 ++- src/pager.c | 3 ++- src/pickup.c | 3 ++- src/pline.c | 3 ++- src/polyself.c | 3 ++- src/potion.c | 3 ++- src/pray.c | 3 ++- src/priest.c | 3 ++- src/quest.c | 3 ++- src/questpgr.c | 3 ++- src/read.c | 3 ++- src/rect.c | 3 ++- src/region.c | 3 ++- src/restore.c | 3 ++- src/rip.c | 3 ++- src/rnd.c | 3 ++- src/role.c | 3 ++- src/rumors.c | 3 ++- src/save.c | 3 ++- src/shk.c | 3 ++- src/shknam.c | 3 ++- src/sit.c | 3 ++- src/sounds.c | 3 ++- src/sp_lev.c | 3 ++- src/spell.c | 3 ++- src/steal.c | 3 ++- src/steed.c | 3 ++- src/sys.c | 3 ++- src/teleport.c | 3 ++- src/timeout.c | 3 ++- src/topten.c | 3 ++- src/track.c | 3 ++- src/trap.c | 3 ++- src/u_init.c | 3 ++- src/uhitm.c | 3 ++- src/vault.c | 3 ++- src/version.c | 3 ++- src/vision.c | 3 ++- src/weapon.c | 3 ++- src/were.c | 3 ++- src/wield.c | 3 ++- src/windows.c | 3 ++- src/wizard.c | 3 ++- src/worm.c | 3 ++- src/worn.c | 3 ++- src/write.c | 3 ++- src/zap.c | 3 ++- sys/amiga/amidos.c | 3 ++- sys/amiga/amidos.p | 3 ++- sys/amiga/amigst.c | 3 ++- sys/amiga/amimenu.c | 3 ++- sys/amiga/amirip.c | 3 ++- sys/amiga/amisnd.c | 3 ++- sys/amiga/amistack.c | 3 ++- sys/amiga/amitty.c | 3 ++- sys/amiga/amiwind.c | 3 ++- sys/amiga/amiwind.p | 3 ++- sys/amiga/cvtsnd.c | 3 ++- sys/amiga/txt2iff.c | 3 ++- sys/amiga/winami.c | 3 ++- sys/amiga/winami.p | 3 ++- sys/amiga/winchar.c | 3 ++- sys/amiga/windefs.h | 3 ++- sys/amiga/winext.h | 3 ++- sys/amiga/winfuncs.c | 3 ++- sys/amiga/winkey.c | 3 ++- sys/amiga/winmenu.c | 3 ++- sys/amiga/winproto.h | 3 ++- sys/amiga/winreq.c | 3 ++- sys/amiga/winstr.c | 3 ++- sys/amiga/xpm2iff.c | 3 ++- sys/atari/tos.c | 3 ++- sys/be/bemain.c | 3 ++- sys/mac/NHDeflts | 3 ++- sys/mac/dprintf.c | 3 ++- sys/mac/maccurs.c | 3 ++- sys/mac/macerrs.c | 3 ++- sys/mac/macfile.c | 3 ++- sys/mac/macmain.c | 3 ++- sys/mac/macmenu.c | 3 ++- sys/mac/macsnd.c | 3 ++- sys/mac/mactopl.c | 3 ++- sys/mac/mactty.c | 3 ++- sys/mac/macunix.c | 3 ++- sys/mac/macwin.c | 3 ++- sys/mac/mgetline.c | 3 ++- sys/mac/mmodal.c | 3 ++- sys/mac/mrecover.c | 3 ++- sys/mac/mttymain.c | 3 ++- sys/msdos/Install.dos | 3 ++- sys/msdos/Makefile.BC | 3 ++- sys/msdos/Makefile.GCC | 3 ++- sys/msdos/Makefile.MSC | 3 ++- sys/msdos/msdos.c | 3 ++- sys/msdos/ovlinit.c | 3 ++- sys/msdos/pckeys.c | 3 ++- sys/msdos/pctiles.c | 3 ++- sys/msdos/pctiles.h | 3 ++- sys/msdos/pcvideo.h | 3 ++- sys/msdos/portio.h | 3 ++- sys/msdos/schema1.BC | 3 ++- sys/msdos/schema2.BC | 3 ++- sys/msdos/setup.bat | 3 ++- sys/msdos/sound.c | 3 ++- sys/msdos/tile2bin.c | 3 ++- sys/msdos/video.c | 3 ++- sys/msdos/vidtxt.c | 3 ++- sys/msdos/vidvga.c | 3 ++- sys/os2/Makefile.os2 | 3 ++- sys/os2/os2.c | 3 ++- sys/share/Makefile.lib | 3 ++- sys/share/ioctl.c | 3 ++- sys/share/nhlan.c | 3 ++- sys/share/pcmain.c | 3 ++- sys/share/pcsys.c | 3 ++- sys/share/pctty.c | 3 ++- sys/share/pcunix.c | 3 ++- sys/share/tclib.c | 3 ++- sys/share/unixtty.c | 3 ++- sys/unix/Makefile.dat | 3 ++- sys/unix/Makefile.doc | 3 ++- sys/unix/Makefile.src | 3 ++- sys/unix/Makefile.top | 3 ++- sys/unix/Makefile.utl | 3 ++- sys/unix/hints/linux | 3 ++- sys/unix/hints/linux-x11 | 3 ++- sys/unix/hints/macosx | 3 ++- sys/unix/hints/macosx.sh | 3 ++- sys/unix/hints/macosx10.5 | 3 ++- sys/unix/hints/macosx10.7 | 3 ++- sys/unix/hints/unix | 3 ++- sys/unix/mkmkfile.sh | 3 ++- sys/unix/nethack.sh | 3 ++- sys/unix/setup.sh | 3 ++- sys/unix/sysconf | 3 ++- sys/unix/unixmain.c | 3 ++- sys/unix/unixres.c | 3 ++- sys/unix/unixunix.c | 3 ++- sys/vms/Makefile.dat | 3 ++- sys/vms/Makefile.doc | 3 ++- sys/vms/Makefile.src | 3 ++- sys/vms/Makefile.top | 3 ++- sys/vms/Makefile.utl | 3 ++- sys/vms/lev_lex.h | 3 ++- sys/vms/oldcrtl.c | 3 ++- sys/vms/vmsfiles.c | 3 ++- sys/vms/vmsmail.c | 3 ++- sys/vms/vmsmain.c | 3 ++- sys/vms/vmsmisc.c | 3 ++- sys/vms/vmstty.c | 3 ++- sys/vms/vmsunix.c | 3 ++- sys/wince/Install.ce | 3 ++- sys/wince/bootstrp.mak | 3 ++- sys/wince/celib.c | 3 ++- sys/wince/cesetup.bat | 3 ++- sys/wince/cesound.c | 6 ++++-- sys/wince/mhaskyn.c | 3 ++- sys/wince/mhaskyn.h | 3 ++- sys/wince/mhcmd.c | 3 ++- sys/wince/mhcolor.c | 3 ++- sys/wince/mhcolor.h | 3 ++- sys/wince/mhdlg.c | 3 ++- sys/wince/mhdlg.h | 3 ++- sys/wince/mhfont.c | 3 ++- sys/wince/mhfont.h | 3 ++- sys/wince/mhinput.c | 3 ++- sys/wince/mhinput.h | 3 ++- sys/wince/mhmain.c | 3 ++- sys/wince/mhmain.h | 3 ++- sys/wince/mhmap.c | 3 ++- sys/wince/mhmap.h | 3 ++- sys/wince/mhmsg.h | 3 ++- sys/wince/mhmsgwnd.c | 3 ++- sys/wince/mhmsgwnd.h | 3 ++- sys/wince/mhrip.c | 3 ++- sys/wince/mhrip.h | 3 ++- sys/wince/mhstatus.c | 3 ++- sys/wince/mhstatus.h | 3 ++- sys/wince/mhtext.c | 3 ++- sys/wince/mhtext.h | 3 ++- sys/wince/mhtxtbuf.c | 3 ++- sys/wince/mhtxtbuf.h | 3 ++- sys/wince/mswproc.c | 3 ++- sys/wince/winMS.h | 3 ++- sys/wince/winhack.c | 3 ++- sys/winnt/Install.nt | 3 ++- sys/winnt/Makefile.bcc | 3 ++- sys/winnt/Makefile.gcc | 3 ++- sys/winnt/Makefile.msc | 3 ++- sys/winnt/console.rc | 6 ++++-- sys/winnt/nh340key.c | 6 ++++-- sys/winnt/nhdefkey.c | 6 ++++-- sys/winnt/nhraykey.c | 6 ++++-- sys/winnt/nhsetup.bat | 3 ++- sys/winnt/ntsound.c | 6 ++++-- sys/winnt/nttty.c | 6 ++++-- sys/winnt/win32api.h | 6 ++++-- sys/winnt/winnt.c | 6 ++++-- util/dgn_comp.l | 3 ++- util/dgn_comp.y | 3 ++- util/dgn_main.c | 3 ++- util/dlb_main.c | 3 ++- util/lev_comp.l | 3 ++- util/lev_comp.y | 3 ++- util/lev_main.c | 3 ++- util/makedefs.c | 3 ++- util/mdgrep.h | 3 ++- util/mdgrep.pl | 5 +++-- util/panic.c | 3 ++- util/recover.c | 3 ++- win/Qt/qt_clust.cpp | 3 ++- win/Qt/qt_win.cpp | 3 ++- win/Qt/qttableview.cpp | 3 ++- win/Qt/tileedit.cpp | 3 ++- win/Qt/tileedit.h | 3 ++- win/X11/Window.c | 3 ++- win/X11/nh32icon | 3 ++- win/X11/nh56icon | 3 ++- win/X11/nh72icon | 3 ++- win/X11/winX.c | 3 ++- win/X11/winmap.c | 3 ++- win/X11/winmenu.c | 3 ++- win/X11/winmesg.c | 3 ++- win/X11/winmisc.c | 3 ++- win/X11/winstat.c | 3 ++- win/X11/wintext.c | 3 ++- win/X11/winval.c | 3 ++- win/chain/wc_chainin.c | 3 ++- win/chain/wc_chainout.c | 3 ++- win/chain/wc_trace.c | 3 ++- win/gem/gr_rect.c | 3 ++- win/gem/tile2img.c | 3 ++- win/gem/wingem.c | 3 ++- win/gem/wingem1.c | 3 ++- win/gem/xpm2img.c | 3 ++- win/gnome/gn_xpms.h | 3 ++- win/gnome/gnaskstr.c | 3 ++- win/gnome/gnaskstr.h | 3 ++- win/gnome/gnbind.c | 3 ++- win/gnome/gnbind.h | 3 ++- win/gnome/gnglyph.c | 3 ++- win/gnome/gnglyph.h | 3 ++- win/gnome/gnmain.c | 3 ++- win/gnome/gnmain.h | 3 ++- win/gnome/gnmap.c | 3 ++- win/gnome/gnmap.h | 3 ++- win/gnome/gnmenu.c | 3 ++- win/gnome/gnmenu.h | 3 ++- win/gnome/gnmesg.c | 3 ++- win/gnome/gnmesg.h | 3 ++- win/gnome/gnomeprv.h | 3 ++- win/gnome/gnopts.c | 3 ++- win/gnome/gnopts.h | 3 ++- win/gnome/gnplayer.c | 3 ++- win/gnome/gnplayer.h | 3 ++- win/gnome/gnsignal.c | 3 ++- win/gnome/gnsignal.h | 3 ++- win/gnome/gnstatus.c | 3 ++- win/gnome/gnstatus.h | 3 ++- win/gnome/gntext.c | 3 ++- win/gnome/gntext.h | 3 ++- win/gnome/gnyesno.c | 3 ++- win/gnome/gnyesno.h | 3 ++- win/macosx/NetHackGuidebook.applescript | 3 ++- win/macosx/NetHackRecover.applescript | 3 ++- win/macosx/NetHackTerm.applescript | 3 ++- win/macosx/recover.pl | 3 ++- win/share/ppmwrite.c | 3 ++- win/share/thintile.c | 3 ++- win/share/tile.doc | 3 ++- win/share/tile.h | 3 ++- win/share/tile2bmp.c | 3 ++- win/share/tilemap.c | 3 ++- win/share/tiletext.c | 3 ++- win/tty/getline.c | 3 ++- win/tty/termcap.c | 3 ++- win/tty/topl.c | 3 ++- win/tty/wintty.c | 3 ++- win/win32/mhaskyn.c | 3 ++- win/win32/mhaskyn.h | 3 ++- win/win32/mhdlg.c | 3 ++- win/win32/mhdlg.h | 3 ++- win/win32/mhfont.c | 3 ++- win/win32/mhfont.h | 3 ++- win/win32/mhinput.c | 3 ++- win/win32/mhinput.h | 3 ++- win/win32/mhmain.c | 3 ++- win/win32/mhmain.h | 3 ++- win/win32/mhmap.c | 3 ++- win/win32/mhmap.h | 3 ++- win/win32/mhmenu.c | 3 ++- win/win32/mhmenu.h | 3 ++- win/win32/mhmsg.h | 3 ++- win/win32/mhmsgwnd.c | 3 ++- win/win32/mhmsgwnd.h | 3 ++- win/win32/mhrip.c | 3 ++- win/win32/mhrip.h | 3 ++- win/win32/mhsplash.c | 3 ++- win/win32/mhstatus.c | 3 ++- win/win32/mhstatus.h | 3 ++- win/win32/mhtext.c | 3 ++- win/win32/mhtext.h | 3 ++- win/win32/mswproc.c | 3 ++- win/win32/winMS.h | 3 ++- win/win32/winhack.c | 3 ++- 492 files changed, 1003 insertions(+), 502 deletions(-) mode change 100755 => 100644 sys/msdos/setup.bat mode change 100755 => 100644 sys/unix/hints/macosx.sh mode change 100755 => 100644 sys/unix/mkmkfile.sh mode change 100755 => 100644 sys/unix/nethack.sh mode change 100755 => 100644 sys/unix/setup.sh mode change 100755 => 100644 sys/wince/cesetup.bat mode change 100755 => 100644 sys/winnt/nhsetup.bat mode change 100755 => 100644 win/macosx/recover.pl diff --git a/dat/Arch.des b/dat/Arch.des index ef9f551d5..3c1ccfaf0 100644 --- a/dat/Arch.des +++ b/dat/Arch.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Arch.des $Date$ $Revision$ +# NetHack 3.5 Arch.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Arch.des $Date: 2009/05/06 10:44:15 $ $Revision: 1.6 $ # SCCS Id: @(#)Arch.des 3.5 1997/01/31 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991 by M. Stephenson diff --git a/dat/Barb.des b/dat/Barb.des index 8f65d8986..29a612015 100644 --- a/dat/Barb.des +++ b/dat/Barb.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Barb.des $Date$ $Revision$ +# NetHack 3.5 Barb.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Barb.des $Date: 2009/05/06 10:44:15 $ $Revision: 1.4 $ # SCCS Id: @(#)Barb.des 3.5 1991/12/22 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991 by M. Stephenson diff --git a/dat/Caveman.des b/dat/Caveman.des index 1dcdbe537..f9617c86f 100644 --- a/dat/Caveman.des +++ b/dat/Caveman.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Caveman.des $Date$ $Revision$ +# NetHack 3.5 Caveman.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Caveman.des $Date: 2009/05/06 10:44:15 $ $Revision: 1.4 $ # SCCS Id: @(#)Caveman.des 3.5 1995/10/07 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991 by M. Stephenson diff --git a/dat/Healer.des b/dat/Healer.des index b394c39c9..3a93adc4f 100644 --- a/dat/Healer.des +++ b/dat/Healer.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Healer.des $Date$ $Revision$ +# NetHack 3.5 Healer.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Healer.des $Date: 2009/05/06 10:44:16 $ $Revision: 1.5 $ # SCCS Id: @(#)Healer.des 3.5 1995/04/16 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991, 1993 by M. Stephenson, P. Winner diff --git a/dat/Knight.des b/dat/Knight.des index 9b166652c..2be72af7d 100644 --- a/dat/Knight.des +++ b/dat/Knight.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Knight.des $Date$ $Revision$ +# NetHack 3.5 Knight.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Knight.des $Date: 2009/05/06 10:44:16 $ $Revision: 1.4 $ # SCCS Id: @(#)Knight.des 3.5 1995/04/16 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991,92 by M. Stephenson diff --git a/dat/Monk.des b/dat/Monk.des index 6c70125bd..fe75301d9 100644 --- a/dat/Monk.des +++ b/dat/Monk.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Monk.des $Date$ $Revision$ +# NetHack 3.5 Monk.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Monk.des $Date: 2009/05/06 10:44:16 $ $Revision: 1.6 $ # SCCS Id: @(#)Monk.des 3.5 2002/04/08 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991-2 by M. Stephenson diff --git a/dat/Priest.des b/dat/Priest.des index 92f7074fe..ea4aef3c5 100644 --- a/dat/Priest.des +++ b/dat/Priest.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Priest.des $Date$ $Revision$ +# NetHack 3.5 Priest.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Priest.des $Date: 2009/05/06 10:44:17 $ $Revision: 1.5 $ # SCCS Id: @(#)Priest.des 3.5 2002/04/08 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991-2 by M. Stephenson diff --git a/dat/Ranger.des b/dat/Ranger.des index 10c88cde2..d36559cb6 100644 --- a/dat/Ranger.des +++ b/dat/Ranger.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Ranger.des $Date$ $Revision$ +# NetHack 3.5 Ranger.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Ranger.des $Date: 2009/05/06 10:44:17 $ $Revision: 1.4 $ # SCCS Id: @(#)Ranger.des 3.5 2001/02/01 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991 by M. Stephenson diff --git a/dat/Rogue.des b/dat/Rogue.des index d6f35cd16..2d2c6a202 100644 --- a/dat/Rogue.des +++ b/dat/Rogue.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Rogue.des $Date$ $Revision$ +# NetHack 3.5 Rogue.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Rogue.des $Date: 2009/05/06 10:44:17 $ $Revision: 1.6 $ # SCCS Id: @(#)Rogue.des 3.5 2002/02/15 # Copyright (c) 1992 by Dean Luick # NetHack may be freely redistributed. See license for details. diff --git a/dat/Samurai.des b/dat/Samurai.des index 73f150566..565a2ed67 100644 --- a/dat/Samurai.des +++ b/dat/Samurai.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Samurai.des $Date$ $Revision$ +# NetHack 3.5 Samurai.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Samurai.des $Date: 2009/05/06 10:44:17 $ $Revision: 1.6 $ # SCCS Id: @(#)Samurai.des 3.5 2002/04/08 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991-92 by M. Stephenson, P. Winner diff --git a/dat/Tourist.des b/dat/Tourist.des index e446fb47c..e9b1658e9 100644 --- a/dat/Tourist.des +++ b/dat/Tourist.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Tourist.des $Date$ $Revision$ +# NetHack 3.5 Tourist.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Tourist.des $Date: 2009/05/06 10:44:17 $ $Revision: 1.4 $ # SCCS Id: @(#)Tourist.des 3.5 1992/09/26 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991,92 by M. Stephenson, P. Winner diff --git a/dat/Valkyrie.des b/dat/Valkyrie.des index 4361ea155..04c401bde 100644 --- a/dat/Valkyrie.des +++ b/dat/Valkyrie.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Valkyrie.des $Date$ $Revision$ +# NetHack 3.5 Valkyrie.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Valkyrie.des $Date: 2009/05/06 10:44:17 $ $Revision: 1.6 $ # SCCS Id: @(#)Valkyrie.des 3.5 2007/08/01 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991-2 by M. Stephenson diff --git a/dat/Wizard.des b/dat/Wizard.des index cdcf9184a..dae831ed4 100644 --- a/dat/Wizard.des +++ b/dat/Wizard.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Wizard.des $Date$ $Revision$ +# NetHack 3.5 Wizard.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Wizard.des $Date: 2009/05/06 10:44:17 $ $Revision: 1.5 $ # SCCS Id: @(#)Wizard.des 3.5 1992/07/11 # Copyright (c) 1992 by David Cohrs # NetHack may be freely redistributed. See license for details. diff --git a/dat/bigroom.des b/dat/bigroom.des index aeaed8bb7..00ea47f32 100644 --- a/dat/bigroom.des +++ b/dat/bigroom.des @@ -1,4 +1,5 @@ -# NetHack 3.5 bigroom.des $Date$ $Revision$ +# NetHack 3.5 bigroom.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 bigroom.des $Date: 2009/05/06 10:44:18 $ $Revision: 1.4 $ # SCCS Id: @(#)bigroom.des 3.5 1990/04/15 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1990 by M. Stephenson diff --git a/dat/castle.des b/dat/castle.des index 95653fa4e..1dd4fda78 100644 --- a/dat/castle.des +++ b/dat/castle.des @@ -1,4 +1,5 @@ -# NetHack 3.5 castle.des $Date$ $Revision$ +# NetHack 3.5 castle.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 castle.des $Date: 2009/05/06 10:44:18 $ $Revision: 1.5 $ # SCCS Id: @(#)castle.des 3.5 2002/05/02 # Copyright (c) 1989 by Jean-Christophe Collet # NetHack may be freely redistributed. See license for details. diff --git a/dat/data.base b/dat/data.base index c832a4780..67fca7aba 100644 --- a/dat/data.base +++ b/dat/data.base @@ -1,4 +1,5 @@ -# NetHack 3.5 data.base $Date$ $Revision$ +# NetHack 3.5 data.base $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 data.base $Date: 2014/10/09 02:04:43 $ $Revision: 1.50 $ # Copyright (c) 1994, 1995, 1996 by the NetHack Development Team # Copyright (c) 1994 by Boudewijn Wayers # NetHack may be freely redistributed. See license for details. diff --git a/dat/dungeon.def b/dat/dungeon.def index 203ece10a..b881884f5 100644 --- a/dat/dungeon.def +++ b/dat/dungeon.def @@ -1,4 +1,5 @@ -# NetHack 3.5 dungeon.def $Date$ $Revision$ +# NetHack 3.5 dungeon.def $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 dungeon.def $Date: 2009/05/06 10:44:21 $ $Revision: 1.6 $ # SCCS Id: @(#)dungeon.def 3.5 2006/03/18 # Copyright (c) 1990-95 by M. Stephenson # NetHack may be freely redistributed. See license for details. diff --git a/dat/endgame.des b/dat/endgame.des index d037a650d..4758ff518 100644 --- a/dat/endgame.des +++ b/dat/endgame.des @@ -1,4 +1,5 @@ -# NetHack 3.5 endgame.des $Date$ $Revision$ +# NetHack 3.5 endgame.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 endgame.des $Date: 2009/05/06 10:44:22 $ $Revision: 1.6 $ # SCCS Id: @(#)endgame.des 3.5 2007/03/02 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1992,1993 by Izchak Miller, David Cohrs, diff --git a/dat/gehennom.des b/dat/gehennom.des index c85fc0931..daba7f532 100644 --- a/dat/gehennom.des +++ b/dat/gehennom.des @@ -1,4 +1,5 @@ -# NetHack 3.5 gehennom.des $Date$ $Revision$ +# NetHack 3.5 gehennom.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 gehennom.des $Date: 2009/05/06 10:44:23 $ $Revision: 1.5 $ # SCCS Id: @(#)gehennom.des 3.5 2005/02/02 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1992 by M. Stephenson and Izchak Miller diff --git a/dat/knox.des b/dat/knox.des index e398fd443..d9d1a2d4d 100644 --- a/dat/knox.des +++ b/dat/knox.des @@ -1,4 +1,5 @@ -# NetHack 3.5 knox.des $Date$ $Revision$ +# NetHack 3.5 knox.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 knox.des $Date: 2009/05/06 10:44:23 $ $Revision: 1.5 $ # SCCS Id: @(#)knox.des 3.5 2006/03/20 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1992 by Izchak Miller diff --git a/dat/medusa.des b/dat/medusa.des index 2e9ec44a2..ae65ff6d5 100644 --- a/dat/medusa.des +++ b/dat/medusa.des @@ -1,4 +1,5 @@ -# NetHack 3.5 medusa.des $Date$ $Revision$ +# NetHack 3.5 medusa.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 medusa.des $Date: 2009/05/06 10:44:23 $ $Revision: 1.5 $ # SCCS Id: @(#)medusa.des 3.5 1996/05/11 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1990, 1991 by M. Stephenson diff --git a/dat/mines.des b/dat/mines.des index a23c80850..8408bbd9d 100644 --- a/dat/mines.des +++ b/dat/mines.des @@ -1,4 +1,5 @@ -# NetHack 3.5 mines.des $Date$ $Revision$ +# NetHack 3.5 mines.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 mines.des $Date: 2009/05/06 10:44:23 $ $Revision: 1.17 $ # SCCS Id: @(#)mines.des 3.5 2002/05/02 # Copyright (c) 1989-95 by Jean-Christophe Collet # Copyright (c) 1991-95 by M. Stephenson diff --git a/dat/oracle.des b/dat/oracle.des index 970117ec2..72da0401f 100644 --- a/dat/oracle.des +++ b/dat/oracle.des @@ -1,4 +1,5 @@ -# NetHack 3.5 oracle.des $Date$ $Revision$ +# NetHack 3.5 oracle.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 oracle.des $Date: 2009/05/06 10:44:23 $ $Revision: 1.4 $ # SCCS Id: @(#)oracle.des 3.5 1995/10/07 # NetHack may be freely redistributed. See license for details. # diff --git a/dat/quest.txt b/dat/quest.txt index c74be18fa..98e8de382 100644 --- a/dat/quest.txt +++ b/dat/quest.txt @@ -1,4 +1,5 @@ -# NetHack 3.5 quest.txt $Date$ $Revision$ +# NetHack 3.5 quest.txt $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 quest.txt $Date: 2009/05/06 10:44:23 $ $Revision: 1.23 $ # SCCS Id: @(#)quest.txt 3.5 2005/12/03 # Copyright (c) 1991 by M. Stephenson # NetHack may be freely redistributed. See license for details. diff --git a/dat/sokoban.des b/dat/sokoban.des index d0e5a1507..21eb63de5 100644 --- a/dat/sokoban.des +++ b/dat/sokoban.des @@ -1,4 +1,5 @@ -# NetHack 3.5 sokoban.des $Date$ $Revision$ +# NetHack 3.5 sokoban.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 sokoban.des $Date: 2009/05/06 10:44:24 $ $Revision: 1.5 $ # SCCS Id: @(#)sokoban.des 3.5 1999/03/15 # Copyright (c) 1998-1999 by Kevin Hugo # NetHack may be freely redistributed. See license for details. diff --git a/dat/tower.des b/dat/tower.des index 6b3894ddb..eb017247d 100644 --- a/dat/tower.des +++ b/dat/tower.des @@ -1,4 +1,5 @@ -# NetHack 3.5 tower.des $Date$ $Revision$ +# NetHack 3.5 tower.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 tower.des $Date: 2009/05/06 10:44:25 $ $Revision: 1.4 $ # SCCS Id: @(#)tower.des 3.5 1990/02/26 # Copyright (c) 1989 by Jean-Christophe Collet # NetHack may be freely redistributed. See license for details. diff --git a/dat/yendor.des b/dat/yendor.des index f29f99513..6bef30231 100644 --- a/dat/yendor.des +++ b/dat/yendor.des @@ -1,4 +1,5 @@ -# NetHack 3.5 yendor.des $Date$ $Revision$ +# NetHack 3.5 yendor.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 yendor.des $Date: 2009/05/06 10:44:25 $ $Revision: 1.5 $ # SCCS Id: @(#)yendor.des 3.5 1996/10/20 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1992 by M. Stephenson and Izchak Miller diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 432c00999..cf8196b3a 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1,4 +1,5 @@ -.\" $Revision$ $Date$ +.\" $NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ +.\" $Revision: 1.130 $ $Date: 2012/05/02 00:38:30 $ .ds h0 "NetHack Guidebook .ds h1 .ds h2 % diff --git a/doc/dgn_comp.6 b/doc/dgn_comp.6 index 3db65ac06..7f30da6b4 100644 --- a/doc/dgn_comp.6 +++ b/doc/dgn_comp.6 @@ -1,5 +1,6 @@ .TH DGN_COMP 6 "12 Dec 1995" -.\" NetHack 3.5 dgn_comp.6 $Date$ $Revision$ +.\" NetHack 3.5 dgn_comp.6 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +.\" NetHack 3.5 dgn_comp.6 $Date: 2009/05/06 10:44:28 $ $Revision: 1.2 $ .UC 4 .SH NAME dgn_comp \- NetHack dungeon compiler diff --git a/doc/dlb.6 b/doc/dlb.6 index e3b762f89..6a41e5458 100644 --- a/doc/dlb.6 +++ b/doc/dlb.6 @@ -1,5 +1,6 @@ .TH DLB 6 "28 Oct 1993" -.\" NetHack 3.5 dlb.6 $Date$ $Revision$ +.\" NetHack 3.5 dlb.6 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +.\" NetHack 3.5 dlb.6 $Date: 2009/05/06 10:44:28 $ $Revision: 1.3 $ .UC 4 .SH NAME dlb \- NetHack data librarian diff --git a/doc/fixes30.0 b/doc/fixes30.0 index 5a2088ae8..26b289b44 100644 --- a/doc/fixes30.0 +++ b/doc/fixes30.0 @@ -1,4 +1,5 @@ -$RCSfile$ $Revision$ $Date$ +$NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ +$RCSfile: fixes30.0,v $ $Revision: 1.2 $ $Date: 2003/05/11 15:09:24 $ [This is a partial list supplied by Ken Arromdee long after the fact] diff --git a/doc/fixes34.1 b/doc/fixes34.1 index d69aeae53..f44271c48 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -1,4 +1,5 @@ -$RCSfile$ $Revision$ $Date$ +$NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ +$RCSfile: fixes34.1,v $ $Revision: 1.331 $ $Date: 2003/02/20 00:19:46 $ General Fixes and Modified Features ----------------------------------- diff --git a/doc/fixes34.2 b/doc/fixes34.2 index 1b9b3ecbb..59214ac25 100644 --- a/doc/fixes34.2 +++ b/doc/fixes34.2 @@ -1,4 +1,5 @@ -$RCSfile$ $Revision$ $Date$ +$NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ +$RCSfile: fixes34.2,v $ $Revision: 1.132 $ $Date: 2003/08/26 15:11:58 $ General Fixes and Modified Features ----------------------------------- diff --git a/doc/fixes34.3 b/doc/fixes34.3 index 9f3487e93..591b2eb75 100644 --- a/doc/fixes34.3 +++ b/doc/fixes34.3 @@ -1,4 +1,5 @@ -$RCSfile$ $Revision$ $Date$ +$NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ +$RCSfile: fixes34.3,v $ $Revision: 1.103 $ $Date: 2003/12/06 14:08:46 $ General Fixes and Modified Features ----------------------------------- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 5aaa60013..6721eb0bb 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1,4 +1,5 @@ -$rcsfile: fixes35.0,v $ $Revision$ $Date$ +$NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ +$rcsfile: fixes35.0,v $ $Revision: 1.445 $ $Date: 2014/11/18 03:10:36 $ General Fixes and Modified Features ----------------------------------- diff --git a/doc/lev_comp.6 b/doc/lev_comp.6 index e5db11c84..2420fa22e 100644 --- a/doc/lev_comp.6 +++ b/doc/lev_comp.6 @@ -1,5 +1,6 @@ .TH LEV_COMP 6 "16 May 1996" -.\" NetHack 3.5 lev_comp.6 $Date$ $Revision$ +.\" NetHack 3.5 lev_comp.6 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +.\" NetHack 3.5 lev_comp.6 $Date: 2009/05/06 10:44:28 $ $Revision: 1.2 $ .UC 4 .SH NAME lev_comp \- NetHack special levels compiler diff --git a/doc/makedefs.6 b/doc/makedefs.6 index 3c42ca26b..9a81780ec 100644 --- a/doc/makedefs.6 +++ b/doc/makedefs.6 @@ -1,5 +1,6 @@ .TH MAKEDEFS 6 "29 Apr 2010" -.\" NetHack 3.5 makedefs.6 $Date$ $Revision$ +.\" NetHack 3.5 makedefs.6 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +.\" NetHack 3.5 makedefs.6 $Date: 2010/05/01 20:57:12 $ $Revision: 1.1 $ .UC 4 .SH NAME makedefs \- NetHack miscellaneous build-time functions diff --git a/doc/nethack.6 b/doc/nethack.6 index a3a1f862c..548e885d0 100644 --- a/doc/nethack.6 +++ b/doc/nethack.6 @@ -1,5 +1,6 @@ .TH NETHACK 6 "6 March 2004" -.\" NetHack 3.5 nethack.6 $Date$ $Revision$ +.\" NetHack 3.5 nethack.6 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +.\" NetHack 3.5 nethack.6 $Date: 2009/05/06 10:44:28 $ $Revision: 1.7 $ .SH NAME nethack \- Exploring The Mazes of Menace .SH SYNOPSIS diff --git a/doc/recover.6 b/doc/recover.6 index d54299c36..b5a2708cc 100644 --- a/doc/recover.6 +++ b/doc/recover.6 @@ -1,5 +1,6 @@ .TH RECOVER 6 "9 January 1993" -.\" NetHack 3.5 recover.6 $Date$ $Revision$ +.\" NetHack 3.5 recover.6 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +.\" NetHack 3.5 recover.6 $Date: 2009/05/06 10:44:29 $ $Revision: 1.3 $ .UC 4 .SH NAME recover \- recover a NetHack game interrupted by disaster diff --git a/doc/window.doc b/doc/window.doc index 5e4842f08..411d73de9 100644 --- a/doc/window.doc +++ b/doc/window.doc @@ -1,4 +1,5 @@ -NetHack 3.5 window.doc $Date$ $Revision$ +NetHack 3.5 window.doc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +NetHack 3.5 window.doc $Date: 2012/01/23 10:41:55 $ $Revision: 1.36 $ Introduction diff --git a/include/align.h b/include/align.h index 7495fe718..7af1eb433 100644 --- a/include/align.h +++ b/include/align.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 align.h $Date$ $Revision$ */ +/* NetHack 3.5 align.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 align.h $Date: 2009/05/06 10:44:33 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)align.h 3.5 1991/12/29 */ /* Copyright (c) Mike Stephenson, Izchak Miller 1991. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/amiconf.h b/include/amiconf.h index b6503add9..9c326653c 100644 --- a/include/amiconf.h +++ b/include/amiconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 amiconf.h $Date$ $Revision$ */ +/* NetHack 3.5 amiconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amiconf.h $Date: 2012/01/10 17:47:16 $ $Revision: 1.8 $ */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1990, 1991, 1992, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/artifact.h b/include/artifact.h index 0fbdc9a42..1cee87887 100644 --- a/include/artifact.h +++ b/include/artifact.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 artifact.h $Date$ $Revision$ */ +/* NetHack 3.5 artifact.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 artifact.h $Date: 2011/04/07 18:10:44 $ $Revision: 1.6 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/artilist.h b/include/artilist.h index 0996b1fe0..2f21d6839 100644 --- a/include/artilist.h +++ b/include/artilist.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 artilist.h $Date$ $Revision$ */ +/* NetHack 3.5 artilist.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 artilist.h $Date: 2011/04/07 18:10:44 $ $Revision: 1.8 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/attrib.h b/include/attrib.h index 7eae006ff..1c93e9cff 100644 --- a/include/attrib.h +++ b/include/attrib.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 attrib.h $Date$ $Revision$ */ +/* NetHack 3.5 attrib.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 attrib.h $Date: 2009/05/06 10:44:34 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)attrib.h 3.5 1990/22/02 */ /* Copyright 1988, Mike Stephenson */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/beconf.h b/include/beconf.h index e1b930e5b..ee3605564 100644 --- a/include/beconf.h +++ b/include/beconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 beconf.h $Date$ $Revision$ */ +/* NetHack 3.5 beconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 beconf.h $Date: 2009/05/06 10:44:34 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)beconf.h 3.5 1998/07/08 */ /* Copyright (c) Dean Luick 1996. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/botl.h b/include/botl.h index 4f0a93616..7a9d8aaa6 100644 --- a/include/botl.h +++ b/include/botl.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 botl.h $Date$ $Revision$ */ +/* NetHack 3.5 botl.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 botl.h $Date: 2012/01/10 17:47:16 $ $Revision: 1.6 $ */ /* Copyright (c) Michael Allison, 2003 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/color.h b/include/color.h index 2a983341f..ab6fe0462 100644 --- a/include/color.h +++ b/include/color.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 color.h $Date$ $Revision$ */ +/* NetHack 3.5 color.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 color.h $Date: 2009/05/06 10:44:34 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)color.h 3.5 1992/02/02 */ /* Copyright (c) Steve Linhart, Eric Raymond, 1989. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/config.h b/include/config.h index 13adba0d4..6db03c2c0 100644 --- a/include/config.h +++ b/include/config.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 config.h $Date$ $Revision$ */ +/* NetHack 3.5 config.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 config.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.37 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/config1.h b/include/config1.h index f0a75ae9f..dee60ce95 100644 --- a/include/config1.h +++ b/include/config1.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 config1.h $Date$ $Revision$ */ +/* NetHack 3.5 config1.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 config1.h $Date: 2011/05/23 03:27:07 $ $Revision: 1.13 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/context.h b/include/context.h index 7e2e7007f..ebfe1ada7 100644 --- a/include/context.h +++ b/include/context.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 context.h $Date$ $Revision$ */ +/* NetHack 3.5 context.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 context.h $Date: 2012/01/10 17:47:16 $ $Revision: 1.15 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/coord.h b/include/coord.h index 3b2e2179d..973ec1d89 100644 --- a/include/coord.h +++ b/include/coord.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 coord.h $Date$ $Revision$ */ +/* NetHack 3.5 coord.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 coord.h $Date: 2012/01/10 17:47:16 $ $Revision: 1.5 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/decl.h b/include/decl.h index e371c977f..3e7e94ac3 100644 --- a/include/decl.h +++ b/include/decl.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 decl.h $Date$ $Revision$ */ +/* NetHack 3.5 decl.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 decl.h $Date: 2011/12/29 20:06:27 $ $Revision: 1.44 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/def_os2.h b/include/def_os2.h index c66425337..2a5b6fa6c 100644 --- a/include/def_os2.h +++ b/include/def_os2.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 def_os2.h $Date$ $Revision$ */ +/* NetHack 3.5 def_os2.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 def_os2.h $Date: 2009/05/06 10:44:37 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)def_os2.h 3.5 1993/01/19 */ /* Copyright (c) Timo Hakulinen, 1990, 1991, 1992, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/dgn_file.h b/include/dgn_file.h index 9ea79526c..b10972394 100644 --- a/include/dgn_file.h +++ b/include/dgn_file.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 dgn_file.h $Date$ $Revision$ */ +/* NetHack 3.5 dgn_file.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dgn_file.h $Date: 2009/05/06 10:44:38 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)dgn_file.h 3.5 1993/01/17 */ /* Copyright (c) 1989 by M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/display.h b/include/display.h index a18a878cc..59135b014 100644 --- a/include/display.h +++ b/include/display.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 display.h $Date$ $Revision$ */ +/* NetHack 3.5 display.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 display.h $Date: 2009/05/06 10:44:38 $ $Revision: 1.14 $ */ /* SCCS Id: @(#)display.h 3.5 2005/06/21 */ /* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */ /* and Dave Cohrs, 1990. */ diff --git a/include/dlb.h b/include/dlb.h index 3c16c97c8..5ab7b10e2 100644 --- a/include/dlb.h +++ b/include/dlb.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 dlb.h $Date$ $Revision$ */ +/* NetHack 3.5 dlb.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dlb.h $Date: 2009/05/06 10:44:38 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)dlb.h 3.5 1997/07/29 */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/dungeon.h b/include/dungeon.h index 707ac6cf7..2aac7f39e 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 dungeon.h $Date$ $Revision$ */ +/* NetHack 3.5 dungeon.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dungeon.h $Date: 2012/04/14 08:31:03 $ $Revision: 1.11 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/engrave.h b/include/engrave.h index 336065b7f..429a5881a 100644 --- a/include/engrave.h +++ b/include/engrave.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 engrave.h $Date$ $Revision$ */ +/* NetHack 3.5 engrave.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 engrave.h $Date: 2009/05/06 10:44:39 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)engrave.h 3.5 1991/07/31 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/extern.h b/include/extern.h index 13600247d..ac5fdb1ec 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 extern.h $Date$ $Revision$ */ +/* NetHack 3.5 extern.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/flag.h b/include/flag.h index 07febf306..f6cc67aa2 100644 --- a/include/flag.h +++ b/include/flag.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 flag.h $Date$ $Revision$ */ +/* NetHack 3.5 flag.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 flag.h $Date: 2012/04/09 02:56:32 $ $Revision: 1.59 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/func_tab.h b/include/func_tab.h index 56e463526..607a0ba99 100644 --- a/include/func_tab.h +++ b/include/func_tab.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 func_tab.h $Date$ $Revision$ */ +/* NetHack 3.5 func_tab.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 func_tab.h $Date: 2009/05/06 10:44:44 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)func_tab.h 3.5 1992/04/03 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/global.h b/include/global.h index 3eb12b86c..7e8acda38 100644 --- a/include/global.h +++ b/include/global.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 global.h $Date$ $Revision$ */ +/* NetHack 3.5 global.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 global.h $Date: 2012/01/29 03:00:14 $ $Revision: 1.31 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/hack.h b/include/hack.h index 2ade6d60d..dc24bf8f9 100644 --- a/include/hack.h +++ b/include/hack.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 hack.h $Date$ $Revision$ */ +/* NetHack 3.5 hack.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 hack.h $Date: 2009/05/06 10:44:46 $ $Revision: 1.49 $ */ /* SCCS Id: @(#)hack.h 3.5 2008/03/19 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/lev.h b/include/lev.h index b0d69de34..e3e05ec9a 100644 --- a/include/lev.h +++ b/include/lev.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 lev.h $Date$ $Revision$ */ +/* NetHack 3.5 lev.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev.h $Date: 2009/05/06 10:44:48 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)lev.h 3.5 2006/07/08 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mac-carbon.h b/include/mac-carbon.h index 99750c9dd..576068a25 100644 --- a/include/mac-carbon.h +++ b/include/mac-carbon.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mac-carbon.h $Date$ $Revision$ */ +/* NetHack 3.5 mac-carbon.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mac-carbon.h $Date: 2009/05/06 10:44:49 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mac-carbon.h 3.5 2003/06/01 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 2003. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mac-qt.h b/include/mac-qt.h index 457dd86b6..eb7f9554e 100644 --- a/include/mac-qt.h +++ b/include/mac-qt.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mac-qt.h $Date$ $Revision$ */ +/* NetHack 3.5 mac-qt.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mac-qt.h $Date: 2009/05/06 10:44:50 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mac-qt.h 3.5 2003/06/01 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 2003. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mac-term.h b/include/mac-term.h index efef9dfec..7bb1257e0 100644 --- a/include/mac-term.h +++ b/include/mac-term.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mac-term.h $Date$ $Revision$ */ +/* NetHack 3.5 mac-term.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mac-term.h $Date: 2009/05/06 10:44:50 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mac-term.h 3.5 2003/06/01 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 2003. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/macconf.h b/include/macconf.h index 817baca1e..c3ad1290c 100644 --- a/include/macconf.h +++ b/include/macconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 macconf.h $Date$ $Revision$ */ +/* NetHack 3.5 macconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macconf.h $Date: 2009/05/06 10:44:51 $ $Revision: 1.8 $ */ /* SCCS Id: @(#)macconf.h 3.5 1999/10/25 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/macpopup.h b/include/macpopup.h index b8a736657..b10f554b0 100644 --- a/include/macpopup.h +++ b/include/macpopup.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 macpopup.h $Date$ $Revision$ */ +/* NetHack 3.5 macpopup.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macpopup.h $Date: 2009/05/06 10:44:51 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)macpopup.h 3.5 1999/10/25 */ /* Copyright (c) Nethack Develpment Team, 1999. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mactty.h b/include/mactty.h index 9c7f1336d..fc90e44f2 100644 --- a/include/mactty.h +++ b/include/mactty.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mactty.h $Date$ $Revision$ */ +/* NetHack 3.5 mactty.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mactty.h $Date: 2009/05/06 10:44:51 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)mactty.h 3.5 1993/03/01 */ /* Copyright (c) Jon W{tte 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/macwin.h b/include/macwin.h index 0c4146c86..9f89eee54 100644 --- a/include/macwin.h +++ b/include/macwin.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 macwin.h $Date$ $Revision$ */ +/* NetHack 3.5 macwin.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macwin.h $Date: 2009/05/06 10:44:52 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)macwin.h 3.5 1996/01/15 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mail.h b/include/mail.h index d663c13b9..8a971477d 100644 --- a/include/mail.h +++ b/include/mail.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mail.h $Date$ $Revision$ */ +/* NetHack 3.5 mail.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mail.h $Date: 2009/05/06 10:44:52 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mail.h 3.5 1991/10/11 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mextra.h b/include/mextra.h index 3caa6ff61..9f857270c 100644 --- a/include/mextra.h +++ b/include/mextra.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mextra.h $Date$ $Revision$ */ +/* NetHack 3.5 mextra.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mextra.h $Date: 2011/04/15 01:55:40 $ $Revision: 1.12 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mfndpos.h b/include/mfndpos.h index 5be92231d..ffbb50d74 100644 --- a/include/mfndpos.h +++ b/include/mfndpos.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mfndpos.h $Date$ $Revision$ */ +/* NetHack 3.5 mfndpos.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mfndpos.h $Date: 2009/05/06 10:44:53 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)mfndpos.h 3.5 2002/04/06 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/micro.h b/include/micro.h index 044bd8e31..2af114cb7 100644 --- a/include/micro.h +++ b/include/micro.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 micro.h $Date$ $Revision$ */ +/* NetHack 3.5 micro.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 micro.h $Date: 2009/05/06 10:44:53 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)micro.h 3.5 1990/02/22 */ /* micro.h - function declarations for various microcomputers */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mkroom.h b/include/mkroom.h index 993f7028f..e9952ddfa 100644 --- a/include/mkroom.h +++ b/include/mkroom.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mkroom.h $Date$ $Revision$ */ +/* NetHack 3.5 mkroom.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mkroom.h $Date: 2012/02/15 01:55:31 $ $Revision: 1.8 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/monattk.h b/include/monattk.h index 609d4e23d..7c228c87d 100644 --- a/include/monattk.h +++ b/include/monattk.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 monattk.h $Date$ $Revision$ */ +/* NetHack 3.5 monattk.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 monattk.h $Date: 2009/05/06 10:44:54 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)monattk.h 3.5 2002/03/24 */ /* NetHack may be freely redistributed. See license for details. */ /* Copyright 1988, M. Stephenson */ diff --git a/include/mondata.h b/include/mondata.h index 423ac655e..3996e439e 100644 --- a/include/mondata.h +++ b/include/mondata.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mondata.h $Date$ $Revision$ */ +/* NetHack 3.5 mondata.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mondata.h $Date: 2009/05/06 10:44:54 $ $Revision: 1.18 $ */ /* SCCS Id: @(#)mondata.h 3.5 2007/04/27 */ /* Copyright (c) 1989 Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/monflag.h b/include/monflag.h index c080e2f5c..103060a41 100644 --- a/include/monflag.h +++ b/include/monflag.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 monflag.h $Date$ $Revision$ */ +/* NetHack 3.5 monflag.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 monflag.h $Date: 2009/05/06 10:44:54 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)monflag.h 3.5 1996/05/04 */ /* Copyright (c) 1989 Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/monst.h b/include/monst.h index 708643dba..c451d374f 100644 --- a/include/monst.h +++ b/include/monst.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 monst.h $Date$ $Revision$ */ +/* NetHack 3.5 monst.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 monst.h $Date: 2009/05/06 10:44:55 $ $Revision: 1.14 $ */ /* SCCS Id: @(#)monst.h 3.5 2006/09/06 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/monsym.h b/include/monsym.h index 792568701..8081d5959 100644 --- a/include/monsym.h +++ b/include/monsym.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 monsym.h $Date$ $Revision$ */ +/* NetHack 3.5 monsym.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 monsym.h $Date: 2009/05/06 10:44:55 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)monsym.h 3.5 2007/04/07 */ /* Monster symbols and creation information rev 1.0 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mttypriv.h b/include/mttypriv.h index 32ed11be7..6e50eccf3 100644 --- a/include/mttypriv.h +++ b/include/mttypriv.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mttypriv.h $Date$ $Revision$ */ +/* NetHack 3.5 mttypriv.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mttypriv.h $Date: 2009/05/06 10:44:55 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mttypriv.h 3.5 1993/03/01 */ /* Copyright (c) Jon W{tte 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/ntconf.h b/include/ntconf.h index c4813d2d1..539833aed 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 ntconf.h $Date$ $Revision$ */ +/* NetHack 3.5 ntconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 ntconf.h $Date: 2012/01/15 19:11:38 $ $Revision: 1.35 $ */ /* SCCS Id: @(#)ntconf.h 3.5 2002/03/10 */ /* Copyright (c) NetHack PC Development Team 1993, 1994. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/obj.h b/include/obj.h index 94e2a82d5..8d302c0ae 100644 --- a/include/obj.h +++ b/include/obj.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 obj.h $Date$ $Revision$ */ +/* NetHack 3.5 obj.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 obj.h $Date: 2012/01/10 17:47:16 $ $Revision: 1.31 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/objclass.h b/include/objclass.h index b6aada93b..46009e4d0 100644 --- a/include/objclass.h +++ b/include/objclass.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 objclass.h $Date$ $Revision$ */ +/* NetHack 3.5 objclass.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 objclass.h $Date: 2009/05/06 10:44:58 $ $Revision: 1.9 $ */ /* SCCS Id: @(#)objclass.h 3.5 1996/06/16 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/os2conf.h b/include/os2conf.h index 0bb959262..eeb4e53aa 100644 --- a/include/os2conf.h +++ b/include/os2conf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 os2conf.h $Date$ $Revision$ */ +/* NetHack 3.5 os2conf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 os2conf.h $Date: 2009/05/06 10:44:58 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)os2conf.h 3.5 2007/01/08 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Timo Hakulinen, 1990, 1991, 1992, 1993, 1996. */ diff --git a/include/patchlevel.h b/include/patchlevel.h index bb398bd4f..2399ca5b0 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 patchlevel.h $Date$ $Revision$ */ +/* NetHack 3.5 patchlevel.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 patchlevel.h $Date: 2012/04/14 08:31:03 $ $Revision: 1.93 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/pcconf.h b/include/pcconf.h index cb8846bda..70a519c00 100644 --- a/include/pcconf.h +++ b/include/pcconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 pcconf.h $Date$ $Revision$ */ +/* NetHack 3.5 pcconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pcconf.h $Date: 2009/05/06 10:45:00 $ $Revision: 1.11 $ */ /* SCCS Id: @(#)pcconf.h 3.5 1995/10/11 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/permonst.h b/include/permonst.h index 12e9f254c..7f48955fb 100644 --- a/include/permonst.h +++ b/include/permonst.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 permonst.h $Date$ $Revision$ */ +/* NetHack 3.5 permonst.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 permonst.h $Date: 2009/05/06 10:45:00 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)permonst.h 3.5 2006/01/04 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/prop.h b/include/prop.h index d0a8a8772..810a730bc 100644 --- a/include/prop.h +++ b/include/prop.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 prop.h $Date$ $Revision$ */ +/* NetHack 3.5 prop.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 prop.h $Date: 2011/10/01 00:25:52 $ $Revision: 1.7 $ */ /* Copyright (c) 1989 Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/qt_clust.h b/include/qt_clust.h index f186c78cc..466e6da8b 100644 --- a/include/qt_clust.h +++ b/include/qt_clust.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 qt_clust.h $Date$ $Revision$ */ +/* NetHack 3.5 qt_clust.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 qt_clust.h $Date: 2009/05/06 10:45:01 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)qt_clust.h 3.5 1999/11/19 */ /* Copyright (c) Warwick Allison, 1999. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/qt_kde0.h b/include/qt_kde0.h index 335c8a8be..6bd8b4452 100644 --- a/include/qt_kde0.h +++ b/include/qt_kde0.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 qt_kde0.h $Date$ $Revision$ */ +/* NetHack 3.5 qt_kde0.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 qt_kde0.h $Date: 2009/05/06 10:45:01 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)qt_kde0.h 3.5 1999/11/19 */ /* Copyright (c) Warwick Allison, 1999. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/qt_win.h b/include/qt_win.h index f430ff25b..98de67688 100644 --- a/include/qt_win.h +++ b/include/qt_win.h @@ -1,4 +1,5 @@ -// NetHack 3.5 qt_win.h $Date$ $Revision$ +// NetHack 3.5 qt_win.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +// NetHack 3.5 qt_win.h $Date: 2012/01/24 04:26:17 $ $Revision: 1.11 $ // Copyright (c) Warwick Allison, 1999. // NetHack may be freely redistributed. See license for details. // diff --git a/include/qtext.h b/include/qtext.h index 8e2486fe0..18eaeaa53 100644 --- a/include/qtext.h +++ b/include/qtext.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 qtext.h $Date$ $Revision$ */ +/* NetHack 3.5 qtext.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 qtext.h $Date: 2009/05/06 10:45:02 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)qtext.h 3.5 1997/02/02 */ /* Copyright (c) Mike Stephenson 1991. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/qttableview.h b/include/qttableview.h index 7aca4271c..07ecea7f6 100644 --- a/include/qttableview.h +++ b/include/qttableview.h @@ -1,5 +1,6 @@ /********************************************************************** -** $Id$ +** $NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ +** $Id: qttableview.h,v 1.2 2002/03/09 03:13:13 jwalz Exp $ ** ** Definition of QtTableView class ** diff --git a/include/quest.h b/include/quest.h index 10cc49ed7..4c2cd4087 100644 --- a/include/quest.h +++ b/include/quest.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 quest.h $Date$ $Revision$ */ +/* NetHack 3.5 quest.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 quest.h $Date: 2009/05/06 10:45:03 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)quest.h 3.5 1992/11/15 */ /* Copyright (c) Mike Stephenson 1991. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/rect.h b/include/rect.h index 4e29fd345..7fa6c2c8f 100644 --- a/include/rect.h +++ b/include/rect.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 rect.h $Date$ $Revision$ */ +/* NetHack 3.5 rect.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 rect.h $Date: 2009/05/06 10:45:03 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)rect.h 3.5 1990/02/22 */ /* Copyright (c) 1990 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/region.h b/include/region.h index a3eab5b2e..9af1176ec 100644 --- a/include/region.h +++ b/include/region.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 region.h $Date$ $Revision$ */ +/* NetHack 3.5 region.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 region.h $Date: 2009/05/06 10:45:04 $ $Revision: 1.9 $ */ /* SCCS Id: @(#)region.h 3.5 2006/06/27 */ /* Copyright (c) 1996 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/rm.h b/include/rm.h index 01a4f418f..589ba619e 100644 --- a/include/rm.h +++ b/include/rm.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 rm.h $Date$ $Revision$ */ +/* NetHack 3.5 rm.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 rm.h $Date: 2012/02/16 23:06:00 $ $Revision: 1.23 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/skills.h b/include/skills.h index c82e06290..d2221e7fb 100644 --- a/include/skills.h +++ b/include/skills.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 skills.h $Date$ $Revision$ */ +/* NetHack 3.5 skills.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 skills.h $Date: 2009/05/06 10:45:05 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)skills.h 3.5 2006/12/14 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/sp_lev.h b/include/sp_lev.h index f58ac6d87..0a1d22173 100644 --- a/include/sp_lev.h +++ b/include/sp_lev.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 sp_lev.h $Date$ $Revision$ */ +/* NetHack 3.5 sp_lev.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sp_lev.h $Date: 2009/05/06 10:45:06 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)sp_lev.h 3.5 2007/08/01 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/spell.h b/include/spell.h index 59a43bd22..6fd12aa8e 100644 --- a/include/spell.h +++ b/include/spell.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 spell.h $Date$ $Revision$ */ +/* NetHack 3.5 spell.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 spell.h $Date: 2009/05/06 10:45:09 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)spell.h 3.5 2006/02/11 */ /* Copyright 1986, M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/sys.h b/include/sys.h index 24d27daa7..227e68781 100644 --- a/include/sys.h +++ b/include/sys.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 sys.h $Date$ $Revision$ */ +/* NetHack 3.5 sys.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sys.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.9 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/system.h b/include/system.h index 5e23feda5..9b7592a67 100644 --- a/include/system.h +++ b/include/system.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 system.h $Date$ $Revision$ */ +/* NetHack 3.5 system.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 system.h $Date: 2009/05/06 10:45:10 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)system.h 3.5 2003/11/30 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/tcap.h b/include/tcap.h index c66e5ab38..35c2da314 100644 --- a/include/tcap.h +++ b/include/tcap.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 tcap.h $Date$ $Revision$ */ +/* NetHack 3.5 tcap.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tcap.h $Date: 2009/05/06 10:45:11 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)tcap.h 3.5 1992/10/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1989. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/tile2x11.h b/include/tile2x11.h index 7e8ed23f6..4aa64f48e 100644 --- a/include/tile2x11.h +++ b/include/tile2x11.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 tile2x11.h $Date$ $Revision$ */ +/* NetHack 3.5 tile2x11.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tile2x11.h $Date: 2009/05/06 10:45:11 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)tile2x11.h 3.5 1995/01/25 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/timeout.h b/include/timeout.h index 1d4171ea7..26d47c17d 100644 --- a/include/timeout.h +++ b/include/timeout.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 timeout.h $Date$ $Revision$ */ +/* NetHack 3.5 timeout.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 timeout.h $Date: 2009/05/06 10:45:12 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)timeout.h 3.5 1999/02/13 */ /* Copyright 1994, Dean Luick */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/tosconf.h b/include/tosconf.h index 3213e28c4..6571945a7 100644 --- a/include/tosconf.h +++ b/include/tosconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 tosconf.h $Date$ $Revision$ */ +/* NetHack 3.5 tosconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tosconf.h $Date: 2009/05/06 10:45:12 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)tosconf.h 3.5 1990/02/22 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/tradstdc.h b/include/tradstdc.h index 1cd0adb82..480ea7878 100644 --- a/include/tradstdc.h +++ b/include/tradstdc.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 tradstdc.h $Date$ $Revision$ */ +/* NetHack 3.5 tradstdc.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tradstdc.h $Date: 2012/01/11 18:23:26 $ $Revision: 1.15 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/trampoli.h b/include/trampoli.h index 8cc04dfea..fa040a330 100644 --- a/include/trampoli.h +++ b/include/trampoli.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 trampoli.h $Date$ $Revision$ */ +/* NetHack 3.5 trampoli.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 trampoli.h $Date: 2009/05/06 10:45:13 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)trampoli.h 3.5 1995/06/01 */ /* Copyright (c) 1989, by Norm Meluch and Stephen Spackman */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/trap.h b/include/trap.h index 2f13bb351..310e118b8 100644 --- a/include/trap.h +++ b/include/trap.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 trap.h $Date$ $Revision$ */ +/* NetHack 3.5 trap.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 trap.h $Date: 2009/05/06 10:45:14 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)trap.h 3.5 2000/08/30 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/unixconf.h b/include/unixconf.h index 6d0642ef7..0ffa2e119 100644 --- a/include/unixconf.h +++ b/include/unixconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 unixconf.h $Date$ $Revision$ */ +/* NetHack 3.5 unixconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 unixconf.h $Date: 2011/04/19 02:02:06 $ $Revision: 1.15 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/vision.h b/include/vision.h index 2e8fc9032..7b731e34a 100644 --- a/include/vision.h +++ b/include/vision.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 vision.h $Date$ $Revision$ */ +/* NetHack 3.5 vision.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vision.h $Date: 2009/05/06 10:45:15 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)vision.h 3.5 2007/05/11 */ /* Copyright (c) Dean Luick, with acknowledgements to Dave Cohrs, 1990. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/vmsconf.h b/include/vmsconf.h index 713cebdba..5aaf9e1fc 100644 --- a/include/vmsconf.h +++ b/include/vmsconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 vmsconf.h $Date$ $Revision$ */ +/* NetHack 3.5 vmsconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vmsconf.h $Date: 2011/09/01 01:46:55 $ $Revision: 1.14 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/wceconf.h b/include/wceconf.h index 1df61faf8..c5fef1547 100644 --- a/include/wceconf.h +++ b/include/wceconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 wceconf.h $Date$ $Revision$ */ +/* NetHack 3.5 wceconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wceconf.h $Date: 2009/10/22 02:59:14 $ $Revision: 1.12 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/winGnome.h b/include/winGnome.h index 7fb166fd3..38d32040e 100644 --- a/include/winGnome.h +++ b/include/winGnome.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 winGnome.h $Date$ $Revision$ */ +/* NetHack 3.5 winGnome.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winGnome.h $Date: 2009/05/06 10:45:16 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)winGnome.h 3.4. 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* Copyright (C) 1998 by Anthony Taylor */ diff --git a/include/winX.h b/include/winX.h index 9ceea5fee..b80c6e245 100644 --- a/include/winX.h +++ b/include/winX.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 winX.h $Date$ $Revision$ */ +/* NetHack 3.5 winX.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winX.h $Date: 2012/01/24 04:26:18 $ $Revision: 1.9 $ */ /* Copyright (c) Dean Luick, 1992 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/winami.h b/include/winami.h index 73df178ba..dc9a98394 100644 --- a/include/winami.h +++ b/include/winami.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 winami.h $Date$ $Revision$ */ +/* NetHack 3.5 winami.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winami.h $Date: 2009/05/06 10:45:17 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)winami.h 3.5 1993/01/17 */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1991. */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1992, 1993. */ diff --git a/include/wingem.h b/include/wingem.h index 7eb57b6ff..d395aea66 100644 --- a/include/wingem.h +++ b/include/wingem.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 wingem.h $Date$ $Revision$ */ +/* NetHack 3.5 wingem.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wingem.h $Date: 2012/01/24 04:26:18 $ $Revision: 1.7 $ */ /* Copyright (c) Christian Bressler, 1999 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/winprocs.h b/include/winprocs.h index d7c5c5f89..72dad2315 100644 --- a/include/winprocs.h +++ b/include/winprocs.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 winprocs.h $Date$ $Revision$ */ +/* NetHack 3.5 winprocs.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winprocs.h $Date: 2012/01/23 10:45:26 $ $Revision: 1.29 $ */ /* Copyright (c) David Cohrs, 1992 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/wintty.h b/include/wintty.h index baff7c2ff..a2ed1e009 100644 --- a/include/wintty.h +++ b/include/wintty.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 wintty.h $Date$ $Revision$ */ +/* NetHack 3.5 wintty.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wintty.h $Date: 2012/01/23 10:45:26 $ $Revision: 1.12 $ */ /* Copyright (c) David Cohrs, 1991,1992 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/wintype.h b/include/wintype.h index 5d31dbfda..960a0d656 100644 --- a/include/wintype.h +++ b/include/wintype.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 wintype.h $Date$ $Revision$ */ +/* NetHack 3.5 wintype.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wintype.h $Date: 2009/05/06 10:45:19 $ $Revision: 1.10 $ */ /* SCCS Id: @(#)wintype.h 3.5 2006/07/08 */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/xwindow.h b/include/xwindow.h index 7a9b134b6..033ea9213 100644 --- a/include/xwindow.h +++ b/include/xwindow.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 xwindow.h $Date$ $Revision$ */ +/* NetHack 3.5 xwindow.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 xwindow.h $Date: 2009/05/06 10:45:19 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)xwindow.h 3.5 1992/03/07 */ /* Copyright (c) Dean Luick, 1992 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/xwindowp.h b/include/xwindowp.h index 0010038b4..0ee10fb49 100644 --- a/include/xwindowp.h +++ b/include/xwindowp.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 xwindowp.h $Date$ $Revision$ */ +/* NetHack 3.5 xwindowp.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 xwindowp.h $Date: 2009/05/06 10:45:19 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)xwindowp.h 3.5 1992/03/07 */ /* Copyright (c) Dean Luick, 1992 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/you.h b/include/you.h index 4b79f7fc5..50798acdb 100644 --- a/include/you.h +++ b/include/you.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 you.h $Date$ $Revision$ */ +/* NetHack 3.5 you.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 you.h $Date: 2012/04/14 08:31:03 $ $Revision: 1.13 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/youprop.h b/include/youprop.h index be82f0af9..04c3349a3 100644 --- a/include/youprop.h +++ b/include/youprop.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 youprop.h $Date$ $Revision$ */ +/* NetHack 3.5 youprop.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 youprop.h $Date: 2011/10/15 03:00:42 $ $Revision: 1.13 $ */ /* Copyright (c) 1989 Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/allmain.c b/src/allmain.c index 1742a302c..51afc75f6 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 allmain.c $Date$ $Revision$ */ +/* NetHack 3.5 allmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 allmain.c $Date: 2012/05/16 01:47:18 $ $Revision: 1.43 $ */ /* SCCS Id: @(#)allmain.c 3.5 2007/03/12 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/alloc.c b/src/alloc.c index 08066565b..dc866063f 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 alloc.c $Date$ $Revision$ */ +/* NetHack 3.5 alloc.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 alloc.c $Date: 2012/01/29 03:00:17 $ $Revision: 1.8 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/apply.c b/src/apply.c index 77608b38e..fb97cc8fa 100644 --- a/src/apply.c +++ b/src/apply.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 apply.c $Date$ $Revision$ */ +/* NetHack 3.5 apply.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 apply.c $Date: 2012/05/01 02:22:32 $ $Revision: 1.168 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/artifact.c b/src/artifact.c index 52ebef02d..088bc9c66 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 artifact.c $Date$ $Revision$ */ +/* NetHack 3.5 artifact.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 artifact.c $Date: 2013/11/07 01:03:16 $ $Revision: 1.77 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/attrib.c b/src/attrib.c index 02c8babcb..0c8ae76a8 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 attrib.c $Date$ $Revision$ */ +/* NetHack 3.5 attrib.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 attrib.c $Date: 2011/10/01 00:25:55 $ $Revision: 1.30 $ */ /* Copyright 1988, 1989, 1990, 1992, M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/ball.c b/src/ball.c index 84972fd4b..78aee97a0 100644 --- a/src/ball.c +++ b/src/ball.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 ball.c $Date$ $Revision$ */ +/* NetHack 3.5 ball.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 ball.c $Date: 2011/08/30 22:13:26 $ $Revision: 1.17 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/bones.c b/src/bones.c index 4b9738d3a..1d3b54eec 100644 --- a/src/bones.c +++ b/src/bones.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 bones.c $Date$ $Revision$ */ +/* NetHack 3.5 bones.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 bones.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.39 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985,1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/botl.c b/src/botl.c index 7ad7224b1..59c6078ac 100644 --- a/src/botl.c +++ b/src/botl.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 botl.c $Date$ $Revision$ */ +/* NetHack 3.5 botl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 botl.c $Date: 2012/01/10 17:47:19 $ $Revision: 1.36 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/cmd.c b/src/cmd.c index 74d5a5db7..eae24508c 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 cmd.c $Date$ $Revision$ */ +/* NetHack 3.5 cmd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 cmd.c $Date: 2013/03/16 01:44:28 $ $Revision: 1.162 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/dbridge.c b/src/dbridge.c index c900be04e..b63d2714c 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dbridge.c $Date$ $Revision$ */ +/* NetHack 3.5 dbridge.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dbridge.c $Date: 2012/02/01 00:49:16 $ $Revision: 1.21 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/decl.c b/src/decl.c index 93036da34..963e55324 100644 --- a/src/decl.c +++ b/src/decl.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 decl.c $Date$ $Revision$ */ +/* NetHack 3.5 decl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 decl.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.37 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/detect.c b/src/detect.c index 6cd342eb7..db280b819 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 detect.c $Date$ $Revision$ */ +/* NetHack 3.5 detect.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 detect.c $Date: 2012/04/16 02:05:40 $ $Revision: 1.47 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/dig.c b/src/dig.c index 5e0b40aca..382676865 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dig.c $Date$ $Revision$ */ +/* NetHack 3.5 dig.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dig.c $Date: 2012/02/16 03:01:37 $ $Revision: 1.67 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/display.c b/src/display.c index b48d06833..8da9af9fe 100644 --- a/src/display.c +++ b/src/display.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 display.c $Date$ $Revision$ */ +/* NetHack 3.5 display.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 display.c $Date: 2011/12/05 03:17:36 $ $Revision: 1.34 $ */ /* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */ /* and Dave Cohrs, 1990. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/dlb.c b/src/dlb.c index 394678ca2..32af6eedc 100644 --- a/src/dlb.c +++ b/src/dlb.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dlb.c $Date$ $Revision$ */ +/* NetHack 3.5 dlb.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dlb.c $Date: 2012/02/16 03:01:37 $ $Revision: 1.10 $ */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/do.c b/src/do.c index fa09f7d53..6ad4985da 100644 --- a/src/do.c +++ b/src/do.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 do.c $Date$ $Revision$ */ +/* NetHack 3.5 do.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 do.c $Date: 2014/11/18 03:10:39 $ $Revision: 1.101 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/do_name.c b/src/do_name.c index 9d19a1997..0c459bd50 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 do_name.c $Date$ $Revision$ */ +/* NetHack 3.5 do_name.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 do_name.c $Date: 2012/01/29 03:00:17 $ $Revision: 1.49 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/do_wear.c b/src/do_wear.c index 42f23491a..efd9a51ff 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 do_wear.c $Date$ $Revision$ */ +/* NetHack 3.5 do_wear.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 do_wear.c $Date: 2012/02/05 04:26:48 $ $Revision: 1.69 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/dog.c b/src/dog.c index 035e5cef7..0a0162e61 100644 --- a/src/dog.c +++ b/src/dog.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dog.c $Date$ $Revision$ */ +/* NetHack 3.5 dog.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dog.c $Date: 2011/04/15 01:55:42 $ $Revision: 1.37 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/dogmove.c b/src/dogmove.c index 58c5a52c7..a56ad1066 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dogmove.c $Date$ $Revision$ */ +/* NetHack 3.5 dogmove.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dogmove.c $Date: 2012/02/10 09:29:28 $ $Revision: 1.35 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/dokick.c b/src/dokick.c index 9e76828e3..424aa6fa1 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dokick.c $Date$ $Revision$ */ +/* NetHack 3.5 dokick.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dokick.c $Date: 2012/05/06 02:29:33 $ $Revision: 1.78 $ */ /* Copyright (c) Izchak Miller, Mike Stephenson, Steve Linhart, 1989. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/dothrow.c b/src/dothrow.c index 9ebd06c9a..ebd7c97e8 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dothrow.c $Date$ $Revision$ */ +/* NetHack 3.5 dothrow.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dothrow.c $Date: 2013/11/05 00:57:55 $ $Revision: 1.89 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/drawing.c b/src/drawing.c index eecd9fe07..2d104be20 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 drawing.c $Date$ $Revision$ */ +/* NetHack 3.5 drawing.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 drawing.c $Date: 2009/05/06 10:46:09 $ $Revision: 1.28 $ */ /* SCCS Id: @(#)drawing.c 3.5 2007/07/30 */ /* Copyright (c) NetHack Development Team 1992. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/dungeon.c b/src/dungeon.c index e9b66e194..d9348183c 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dungeon.c $Date$ $Revision$ */ +/* NetHack 3.5 dungeon.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dungeon.c $Date: 2012/04/14 08:31:05 $ $Revision: 1.34 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/eat.c b/src/eat.c index 8aa7f5da1..5b5d1f38e 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 eat.c $Date$ $Revision$ */ +/* NetHack 3.5 eat.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 eat.c $Date: 2012/02/01 00:49:16 $ $Revision: 1.116 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/end.c b/src/end.c index 23d6ecd50..66d164143 100644 --- a/src/end.c +++ b/src/end.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 end.c $Date$ $Revision$ */ +/* NetHack 3.5 end.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 end.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.79 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/engrave.c b/src/engrave.c index 51b6f7b89..c4bdd4496 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 engrave.c $Date$ $Revision$ */ +/* NetHack 3.5 engrave.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 engrave.c $Date: 2012/12/20 01:48:36 $ $Revision: 1.39 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/exper.c b/src/exper.c index e0b3b8992..568b19e88 100644 --- a/src/exper.c +++ b/src/exper.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 exper.c $Date$ $Revision$ */ +/* NetHack 3.5 exper.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 exper.c $Date: 2009/05/06 10:46:24 $ $Revision: 1.19 $ */ /* SCCS Id: @(#)exper.c 3.5 2005/09/19 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/explode.c b/src/explode.c index a2416dd75..54855f70a 100644 --- a/src/explode.c +++ b/src/explode.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 explode.c $Date$ $Revision$ */ +/* NetHack 3.5 explode.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 explode.c $Date: 2013/11/05 00:57:55 $ $Revision: 1.34 $ */ /* Copyright (C) 1990 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/extralev.c b/src/extralev.c index 5e2e96bf6..597b23e72 100644 --- a/src/extralev.c +++ b/src/extralev.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 extralev.c $Date$ $Revision$ */ +/* NetHack 3.5 extralev.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 extralev.c $Date: 2010/01/10 02:35:19 $ $Revision: 1.5 $ */ /* Copyright 1988, 1989 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/files.c b/src/files.c index c899f259e..4b72c754d 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 files.c $Date$ $Revision$ */ +/* NetHack 3.5 files.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/fountain.c b/src/fountain.c index bb0745002..14fb6707e 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 fountain.c $Date$ $Revision$ */ +/* NetHack 3.5 fountain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 fountain.c $Date: 2011/08/20 00:22:20 $ $Revision: 1.32 $ */ /* Copyright Scott R. Turner, srt@ucla, 10/27/86 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/hack.c b/src/hack.c index 792671075..bcb3da1ad 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 hack.c $Date$ $Revision$ */ +/* NetHack 3.5 hack.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 hack.c $Date: 2013/10/26 21:33:47 $ $Revision: 1.120 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/hacklib.c b/src/hacklib.c index d2985af6f..398b96dd4 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 hacklib.c $Date$ $Revision$ */ +/* NetHack 3.5 hacklib.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 hacklib.c $Date: 2009/05/06 10:46:32 $ $Revision: 1.23 $ */ /* SCCS Id: @(#)hacklib.c 3.5 2007/04/30 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Robert Patrick Rankin, 1991 */ diff --git a/src/invent.c b/src/invent.c index b51151a38..12847bc7f 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 invent.c $Date$ $Revision$ */ +/* NetHack 3.5 invent.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 invent.c $Date: 2013/11/05 00:57:55 $ $Revision: 1.125 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/light.c b/src/light.c index 4f39849ca..8d2b38ad4 100644 --- a/src/light.c +++ b/src/light.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 light.c $Date$ $Revision$ */ +/* NetHack 3.5 light.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 light.c $Date: 2009/05/06 10:46:38 $ $Revision: 1.15 $ */ /* SCCS Id: @(#)light.c 3.5 2009/01/20 */ /* Copyright (c) Dean Luick, 1994 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/lock.c b/src/lock.c index 87b54cca3..45be156f6 100644 --- a/src/lock.c +++ b/src/lock.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 lock.c $Date$ $Revision$ */ +/* NetHack 3.5 lock.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lock.c $Date: 2014/09/20 00:32:01 $ $Revision: 1.39 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mail.c b/src/mail.c index 7221d3864..cc01b97d3 100644 --- a/src/mail.c +++ b/src/mail.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mail.c $Date$ $Revision$ */ +/* NetHack 3.5 mail.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mail.c $Date: 2009/05/06 10:46:41 $ $Revision: 1.12 $ */ /* SCCS Id: @(#)mail.c 3.5 2008/01/30 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/makemon.c b/src/makemon.c index 98cfedb3d..11051eab5 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 makemon.c $Date$ $Revision$ */ +/* NetHack 3.5 makemon.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 makemon.c $Date: 2012/01/29 00:34:33 $ $Revision: 1.69 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mapglyph.c b/src/mapglyph.c index fe8ade7f4..b0dfa2a66 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mapglyph.c $Date$ $Revision$ */ +/* NetHack 3.5 mapglyph.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mapglyph.c $Date: 2009/05/06 10:46:45 $ $Revision: 1.24 $ */ /* SCCS Id: @(#)mapglyph.c 3.5 2006/10/01 */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mcastu.c b/src/mcastu.c index a8bc604b2..a677db12e 100644 --- a/src/mcastu.c +++ b/src/mcastu.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mcastu.c $Date$ $Revision$ */ +/* NetHack 3.5 mcastu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mcastu.c $Date: 2011/12/30 23:14:58 $ $Revision: 1.37 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mhitm.c b/src/mhitm.c index ade47bf26..969a50458 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhitm.c $Date$ $Revision$ */ +/* NetHack 3.5 mhitm.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhitm.c $Date: 2011/04/07 20:59:40 $ $Revision: 1.57 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mhitu.c b/src/mhitu.c index 1d650f23d..0a85b86a7 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhitu.c $Date$ $Revision$ */ +/* NetHack 3.5 mhitu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhitu.c $Date: 2012/02/05 04:26:48 $ $Revision: 1.104 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/minion.c b/src/minion.c index 935719588..f70b426b7 100644 --- a/src/minion.c +++ b/src/minion.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 minion.c $Date$ $Revision$ */ +/* NetHack 3.5 minion.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 minion.c $Date: 2009/05/06 10:46:52 $ $Revision: 1.26 $ */ /* SCCS Id: @(#)minion.c 3.5 2008/11/14 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mklev.c b/src/mklev.c index e75216ef6..8e3b267d1 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mklev.c $Date$ $Revision$ */ +/* NetHack 3.5 mklev.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mklev.c $Date: 2012/02/15 01:55:33 $ $Revision: 1.20 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mkmap.c b/src/mkmap.c index 408cea4a7..c014f7194 100644 --- a/src/mkmap.c +++ b/src/mkmap.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mkmap.c $Date$ $Revision$ */ +/* NetHack 3.5 mkmap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mkmap.c $Date: 2009/05/06 10:46:55 $ $Revision: 1.12 $ */ /* SCCS Id: @(#)mkmap.c 3.5 2008/02/29 */ /* Copyright (c) J. C. Collet, M. Stephenson and D. Cohrs, 1992 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mkmaze.c b/src/mkmaze.c index 2ff7c7413..ccd865db2 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mkmaze.c $Date$ $Revision$ */ +/* NetHack 3.5 mkmaze.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mkmaze.c $Date: 2009/05/06 10:46:56 $ $Revision: 1.18 $ */ /* SCCS Id: @(#)mkmaze.c 3.5 2007/06/18 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mkobj.c b/src/mkobj.c index 01a67f8f7..19e3658df 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mkobj.c $Date$ $Revision$ */ +/* NetHack 3.5 mkobj.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mkobj.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.70 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mkroom.c b/src/mkroom.c index 59b2ddf54..c8bcb2ed0 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mkroom.c $Date$ $Revision$ */ +/* NetHack 3.5 mkroom.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mkroom.c $Date: 2012/01/10 17:47:19 $ $Revision: 1.15 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mon.c b/src/mon.c index ae6394d13..e3880eafe 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mon.c $Date$ $Revision$ */ +/* NetHack 3.5 mon.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mon.c $Date: 2012/05/16 02:15:10 $ $Revision: 1.126 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mondata.c b/src/mondata.c index 029c00d9c..3016b7adf 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mondata.c $Date$ $Revision$ */ +/* NetHack 3.5 mondata.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mondata.c $Date: 2011/10/02 02:18:54 $ $Revision: 1.44 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/monmove.c b/src/monmove.c index 531d8a789..4b6ffc26f 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 monmove.c $Date$ $Revision$ */ +/* NetHack 3.5 monmove.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 monmove.c $Date: 2011/08/30 22:13:27 $ $Revision: 1.46 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/monst.c b/src/monst.c index fb2d3e8db..d774d1f2a 100644 --- a/src/monst.c +++ b/src/monst.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 monst.c $Date$ $Revision$ */ +/* NetHack 3.5 monst.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 monst.c $Date: 2011/09/02 21:44:09 $ $Revision: 1.38 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mplayer.c b/src/mplayer.c index 26cd4f62f..58546c931 100644 --- a/src/mplayer.c +++ b/src/mplayer.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mplayer.c $Date$ $Revision$ */ +/* NetHack 3.5 mplayer.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mplayer.c $Date: 2009/05/06 10:47:09 $ $Revision: 1.11 $ */ /* SCCS Id: @(#)mplayer.c 3.5 2006/12/15 */ /* Copyright (c) Izchak Miller, 1992. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mthrowu.c b/src/mthrowu.c index ea955d6a6..02339c0ad 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mthrowu.c $Date$ $Revision$ */ +/* NetHack 3.5 mthrowu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mthrowu.c $Date: 2011/12/30 23:47:06 $ $Revision: 1.43 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/muse.c b/src/muse.c index a289cf6e8..cc540ebb0 100644 --- a/src/muse.c +++ b/src/muse.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 muse.c $Date$ $Revision$ */ +/* NetHack 3.5 muse.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 muse.c $Date: 2012/04/12 23:26:47 $ $Revision: 1.49 $ */ /* Copyright (C) 1990 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/music.c b/src/music.c index c3f4bf056..4491b8909 100644 --- a/src/music.c +++ b/src/music.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 music.c $Date$ $Revision$ */ +/* NetHack 3.5 music.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 music.c $Date: 2011/12/30 23:47:06 $ $Revision: 1.27 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/o_init.c b/src/o_init.c index 3b65bf9c7..102160635 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 o_init.c $Date$ $Revision$ */ +/* NetHack 3.5 o_init.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 o_init.c $Date: 2011/10/02 21:27:24 $ $Revision: 1.11 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/objects.c b/src/objects.c index c59c2ec59..ec4483a51 100644 --- a/src/objects.c +++ b/src/objects.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 objects.c $Date$ $Revision$ */ +/* NetHack 3.5 objects.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 objects.c $Date: 2011/07/28 04:00:20 $ $Revision: 1.23 $ */ /* Copyright (c) Mike Threepoint, 1989. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/objnam.c b/src/objnam.c index ed3bab967..d29ad6091 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 objnam.c $Date$ $Revision$ */ +/* NetHack 3.5 objnam.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 objnam.c $Date: 2011/10/27 02:24:54 $ $Revision: 1.101 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/options.c b/src/options.c index e7f39283f..18966efb5 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 options.c $Date$ $Revision$ */ +/* NetHack 3.5 options.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 options.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.153 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/pager.c b/src/pager.c index 62e744fd6..b3647c7dd 100644 --- a/src/pager.c +++ b/src/pager.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pager.c $Date$ $Revision$ */ +/* NetHack 3.5 pager.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pager.c $Date: 2012/01/15 09:27:06 $ $Revision: 1.41 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/pickup.c b/src/pickup.c index e73a5576c..0fd429bc3 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pickup.c $Date$ $Revision$ */ +/* NetHack 3.5 pickup.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pickup.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.123 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/pline.c b/src/pline.c index d4cdb9c43..2c1612e49 100644 --- a/src/pline.c +++ b/src/pline.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pline.c $Date$ $Revision$ */ +/* NetHack 3.5 pline.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pline.c $Date: 2013/02/09 01:33:37 $ $Revision: 1.30 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/polyself.c b/src/polyself.c index 7bafe84dd..0e348035a 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 polyself.c $Date$ $Revision$ */ +/* NetHack 3.5 polyself.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 polyself.c $Date: 2013/03/16 01:44:28 $ $Revision: 1.88 $ */ /* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/potion.c b/src/potion.c index ede26f139..582409711 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 potion.c $Date$ $Revision$ */ +/* NetHack 3.5 potion.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 potion.c $Date: 2013/11/05 00:57:55 $ $Revision: 1.91 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/pray.c b/src/pray.c index da8825dd3..a6bd75ba4 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pray.c $Date$ $Revision$ */ +/* NetHack 3.5 pray.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pray.c $Date: 2012/05/07 01:44:38 $ $Revision: 1.62 $ */ /* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/priest.c b/src/priest.c index e5a112d2c..915813af0 100644 --- a/src/priest.c +++ b/src/priest.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 priest.c $Date$ $Revision$ */ +/* NetHack 3.5 priest.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 priest.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.27 $ */ /* Copyright (c) Izchak Miller, Steve Linhart, 1989. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/quest.c b/src/quest.c index 3dfaaf532..c5ef6c819 100644 --- a/src/quest.c +++ b/src/quest.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 quest.c $Date$ $Revision$ */ +/* NetHack 3.5 quest.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 quest.c $Date: 2009/05/06 10:47:33 $ $Revision: 1.10 $ */ /* SCCS Id: @(#)quest.c 3.5 2006/08/05 */ /* Copyright 1991, M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/questpgr.c b/src/questpgr.c index af7489b90..d06270c88 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 questpgr.c $Date$ $Revision$ */ +/* NetHack 3.5 questpgr.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 questpgr.c $Date: 2012/02/02 09:18:14 $ $Revision: 1.14 $ */ /* Copyright 1991, M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/read.c b/src/read.c index 755d09969..3564d6cec 100644 --- a/src/read.c +++ b/src/read.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 read.c $Date$ $Revision$ */ +/* NetHack 3.5 read.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 read.c $Date: 2012/04/06 08:35:00 $ $Revision: 1.78 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/rect.c b/src/rect.c index 5eb5896e8..be120c369 100644 --- a/src/rect.c +++ b/src/rect.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 rect.c $Date$ $Revision$ */ +/* NetHack 3.5 rect.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 rect.c $Date: 2009/05/06 10:47:37 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)rect.c 3.5 1990/02/22 */ /* Copyright (c) 1990 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/region.c b/src/region.c index 914b79e62..562747948 100644 --- a/src/region.c +++ b/src/region.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 region.c $Date$ $Revision$ */ +/* NetHack 3.5 region.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 region.c $Date: 2012/05/07 01:44:38 $ $Revision: 1.26 $ */ /* Copyright (c) 1996 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/restore.c b/src/restore.c index cd2bc4006..2297127c0 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 restore.c $Date$ $Revision$ */ +/* NetHack 3.5 restore.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 restore.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.71 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/rip.c b/src/rip.c index 85d0c4016..526c56388 100644 --- a/src/rip.c +++ b/src/rip.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 rip.c $Date$ $Revision$ */ +/* NetHack 3.5 rip.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 rip.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.11 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/rnd.c b/src/rnd.c index 5f50ecbd0..a2ce45685 100644 --- a/src/rnd.c +++ b/src/rnd.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 rnd.c $Date$ $Revision$ */ +/* NetHack 3.5 rnd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 rnd.c $Date: 2009/05/06 10:47:41 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)rnd.c 3.5 2004/08/27 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/role.c b/src/role.c index 570acf772..8cb7f3f7e 100644 --- a/src/role.c +++ b/src/role.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 role.c $Date$ $Revision$ */ +/* NetHack 3.5 role.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 role.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.18 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/rumors.c b/src/rumors.c index 5993a8ead..e84418e2d 100644 --- a/src/rumors.c +++ b/src/rumors.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 rumors.c $Date$ $Revision$ */ +/* NetHack 3.5 rumors.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 rumors.c $Date: 2012/05/11 22:36:33 $ $Revision: 1.17 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/save.c b/src/save.c index ce1073973..a4055c915 100644 --- a/src/save.c +++ b/src/save.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 save.c $Date$ $Revision$ */ +/* NetHack 3.5 save.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 save.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.53 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/shk.c b/src/shk.c index ef8fed952..944098c3a 100644 --- a/src/shk.c +++ b/src/shk.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 shk.c $Date$ $Revision$ */ +/* NetHack 3.5 shk.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 shk.c $Date: 2012/07/03 22:54:49 $ $Revision: 1.91 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/shknam.c b/src/shknam.c index 83eb902d3..ab2262bb4 100644 --- a/src/shknam.c +++ b/src/shknam.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 shknam.c $Date$ $Revision$ */ +/* NetHack 3.5 shknam.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 shknam.c $Date: 2011/04/15 01:55:42 $ $Revision: 1.24 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/sit.c b/src/sit.c index 5f9ac52aa..154248392 100644 --- a/src/sit.c +++ b/src/sit.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 sit.c $Date$ $Revision$ */ +/* NetHack 3.5 sit.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sit.c $Date: 2012/02/06 04:17:25 $ $Revision: 1.31 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/sounds.c b/src/sounds.c index eaac43337..b599f814e 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 sounds.c $Date$ $Revision$ */ +/* NetHack 3.5 sounds.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sounds.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.39 $ */ /* Copyright (c) 1989 Janet Walz, Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/sp_lev.c b/src/sp_lev.c index 0d89bfc31..5ecf91aa1 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 sp_lev.c $Date$ $Revision$ */ +/* NetHack 3.5 sp_lev.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sp_lev.c $Date: 2011/01/05 01:28:36 $ $Revision: 1.23 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/spell.c b/src/spell.c index 23f136077..e1f6fc55b 100644 --- a/src/spell.c +++ b/src/spell.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 spell.c $Date$ $Revision$ */ +/* NetHack 3.5 spell.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 spell.c $Date: 2011/12/29 22:01:25 $ $Revision: 1.44 $ */ /* Copyright (c) M. Stephenson 1988 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/steal.c b/src/steal.c index 21712a3f2..f762ec18f 100644 --- a/src/steal.c +++ b/src/steal.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 steal.c $Date$ $Revision$ */ +/* NetHack 3.5 steal.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 steal.c $Date: 2012/02/05 04:26:48 $ $Revision: 1.41 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/steed.c b/src/steed.c index afa110b1f..d42c2957d 100644 --- a/src/steed.c +++ b/src/steed.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 steed.c $Date$ $Revision$ */ +/* NetHack 3.5 steed.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 steed.c $Date: 2012/01/04 18:52:36 $ $Revision: 1.36 $ */ /* Copyright (c) Kevin Hugo, 1998-1999. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/sys.c b/src/sys.c index 19aecaade..4550f4ff5 100644 --- a/src/sys.c +++ b/src/sys.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 sys.c $Date$ $Revision$ */ +/* NetHack 3.5 sys.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sys.c $Date: 2012/03/10 02:22:07 $ $Revision: 1.12 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/teleport.c b/src/teleport.c index 000784094..608e38374 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 teleport.c $Date$ $Revision$ */ +/* NetHack 3.5 teleport.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 teleport.c $Date: 2012/01/04 18:52:36 $ $Revision: 1.45 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/timeout.c b/src/timeout.c index d5d177673..80d9a4da6 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 timeout.c $Date$ $Revision$ */ +/* NetHack 3.5 timeout.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 timeout.c $Date: 2012/04/16 00:57:37 $ $Revision: 1.48 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/topten.c b/src/topten.c index a2d205803..58079a6de 100644 --- a/src/topten.c +++ b/src/topten.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 topten.c $Date$ $Revision$ */ +/* NetHack 3.5 topten.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 topten.c $Date: 2012/01/24 04:26:15 $ $Revision: 1.23 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/track.c b/src/track.c index d7a7db4df..db1f38edb 100644 --- a/src/track.c +++ b/src/track.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 track.c $Date$ $Revision$ */ +/* NetHack 3.5 track.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 track.c $Date: 2009/05/06 10:48:00 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)track.c 3.5 87/08/08 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/trap.c b/src/trap.c index 232e4832e..275776926 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 trap.c $Date$ $Revision$ */ +/* NetHack 3.5 trap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 trap.c $Date: 2013/03/14 01:58:21 $ $Revision: 1.179 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/u_init.c b/src/u_init.c index 77cd0c080..4e5927397 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 u_init.c $Date$ $Revision$ */ +/* NetHack 3.5 u_init.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 u_init.c $Date: 2011/10/01 00:25:56 $ $Revision: 1.18 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/uhitm.c b/src/uhitm.c index cbd0cdbec..43fb2c0a1 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 uhitm.c $Date$ $Revision$ */ +/* NetHack 3.5 uhitm.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 uhitm.c $Date: 2012/05/01 02:22:33 $ $Revision: 1.116 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/vault.c b/src/vault.c index af37a0625..5205f6aca 100644 --- a/src/vault.c +++ b/src/vault.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vault.c $Date$ $Revision$ */ +/* NetHack 3.5 vault.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vault.c $Date: 2011/10/13 00:31:10 $ $Revision: 1.28 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/version.c b/src/version.c index 6dbc4e38a..1f58cff1f 100644 --- a/src/version.c +++ b/src/version.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 version.c $Date$ $Revision$ */ +/* NetHack 3.5 version.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 version.c $Date: 2012/01/04 18:52:36 $ $Revision: 1.26 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/vision.c b/src/vision.c index 2f1a62b0c..d835fb554 100644 --- a/src/vision.c +++ b/src/vision.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vision.c $Date$ $Revision$ */ +/* NetHack 3.5 vision.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vision.c $Date: 2009/05/06 10:48:10 $ $Revision: 1.12 $ */ /* SCCS Id: @(#)vision.c 3.5 2007/11/05 */ /* Copyright (c) Dean Luick, with acknowledgements to Dave Cohrs, 1990. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/weapon.c b/src/weapon.c index fa902d6e0..568c2d669 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 weapon.c $Date$ $Revision$ */ +/* NetHack 3.5 weapon.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 weapon.c $Date: 2011/12/18 05:16:28 $ $Revision: 1.38 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/were.c b/src/were.c index 864ee5fed..c2df2e20c 100644 --- a/src/were.c +++ b/src/were.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 were.c $Date$ $Revision$ */ +/* NetHack 3.5 were.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 were.c $Date: 2011/02/28 11:29:27 $ $Revision: 1.14 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/wield.c b/src/wield.c index a34d27c6e..7d7c2d6af 100644 --- a/src/wield.c +++ b/src/wield.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 wield.c $Date$ $Revision$ */ +/* NetHack 3.5 wield.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wield.c $Date: 2009/05/06 10:48:14 $ $Revision: 1.31 $ */ /* SCCS Id: @(#)wield.c 3.5 2009/01/20 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/windows.c b/src/windows.c index fc13631c0..070658bd1 100644 --- a/src/windows.c +++ b/src/windows.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 windows.c $Date$ $Revision$ */ +/* NetHack 3.5 windows.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 windows.c $Date: 2012/01/23 10:45:28 $ $Revision: 1.23 $ */ /* Copyright (c) D. Cohrs, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/wizard.c b/src/wizard.c index 9d7abacdc..4f184fa97 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 wizard.c $Date$ $Revision$ */ +/* NetHack 3.5 wizard.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wizard.c $Date: 2009/05/06 10:48:16 $ $Revision: 1.32 $ */ /* SCCS Id: @(#)wizard.c 3.5 2008/11/14 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/worm.c b/src/worm.c index b8be560a5..36af566fc 100644 --- a/src/worm.c +++ b/src/worm.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 worm.c $Date$ $Revision$ */ +/* NetHack 3.5 worm.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 worm.c $Date: 2009/05/06 10:48:17 $ $Revision: 1.12 $ */ /* SCCS Id: @(#)worm.c 3.5 2009/03/05 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/worn.c b/src/worn.c index f750bf410..4371d789a 100644 --- a/src/worn.c +++ b/src/worn.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 worn.c $Date$ $Revision$ */ +/* NetHack 3.5 worn.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 worn.c $Date: 2013/11/05 00:57:56 $ $Revision: 1.32 $ */ /* SCCS Id: @(#)worn.c 3.5 2009/02/28 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/write.c b/src/write.c index d5f61c67f..6b03ce205 100644 --- a/src/write.c +++ b/src/write.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 write.c $Date$ $Revision$ */ +/* NetHack 3.5 write.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 write.c $Date: 2010/12/28 19:54:41 $ $Revision: 1.9 $ */ /* NetHack may be freely redistributed. See license for details. */ #include "hack.h" diff --git a/src/zap.c b/src/zap.c index e265b898d..5c95dde0d 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 zap.c $Date$ $Revision$ */ +/* NetHack 3.5 zap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 zap.c $Date: 2013/11/05 00:57:56 $ $Revision: 1.183 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/amidos.c b/sys/amiga/amidos.c index 9444c2b95..fd6d329ad 100644 --- a/sys/amiga/amidos.c +++ b/sys/amiga/amidos.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 amidos.c $Date$ $Revision$ */ +/* NetHack 3.5 amidos.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amidos.c $Date: 2009/05/06 10:48:29 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)amidos.c 3.5 2000/01/12 /* Copyright (c) Olaf Seibert, Nijmegen, The Netherlands, 1988,1990. */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1991,1992,1993,1996. */ diff --git a/sys/amiga/amidos.p b/sys/amiga/amidos.p index 87e436221..238e7412c 100644 --- a/sys/amiga/amidos.p +++ b/sys/amiga/amidos.p @@ -1,4 +1,5 @@ -/* NetHack 3.5 amidos.p $Date$ $Revision$ */ +/* NetHack 3.5 amidos.p $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amidos.p $Date: 2009/05/06 10:48:29 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)amidos.p 3.5 1993/01/08 /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1992, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/amigst.c b/sys/amiga/amigst.c index b12230720..0a74acd9e 100644 --- a/sys/amiga/amigst.c +++ b/sys/amiga/amigst.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 amigst.c $Date$ $Revision$ */ +/* NetHack 3.5 amigst.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amigst.c $Date: 2009/05/06 10:48:29 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)amigst.c 3.5 1993/01/08 /* Copyright (c) Gregg Wonderly, Naperville, IL, 1992, 1993 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/amimenu.c b/sys/amiga/amimenu.c index 4314798e7..083ca292f 100644 --- a/sys/amiga/amimenu.c +++ b/sys/amiga/amimenu.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 amimenu.c $Date$ $Revision$ */ +/* NetHack 3.5 amimenu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amimenu.c $Date: 2009/05/06 10:48:29 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)amimenu.c 3.5 1996/02/04 */ /* Copyright (c) Olaf 'Rhialto' Seibert, 1989 */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1992, 1993, 1996 */ diff --git a/sys/amiga/amirip.c b/sys/amiga/amirip.c index a7460258d..00e98b12d 100644 --- a/sys/amiga/amirip.c +++ b/sys/amiga/amirip.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 amirip.c $Date$ $Revision$ */ +/* NetHack 3.5 amirip.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amirip.c $Date: 2012/01/24 04:26:20 $ $Revision: 1.7 $ */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1991,1992,1993,1995,1996. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/amisnd.c b/sys/amiga/amisnd.c index ed33e0331..0868332b2 100644 --- a/sys/amiga/amisnd.c +++ b/sys/amiga/amisnd.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 amisnd.c $Date$ $Revision$ */ +/* NetHack 3.5 amisnd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amisnd.c $Date: 2009/05/06 10:48:30 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)amisnd.c 3.5 2000/01/12*/ /* Copyright (c) 1992, 1993, 1995 by Gregg Wonderly */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/amistack.c b/sys/amiga/amistack.c index 16a8a4b64..c83afd1e2 100644 --- a/sys/amiga/amistack.c +++ b/sys/amiga/amistack.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 amistack.c $Date$ $Revision$ */ +/* NetHack 3.5 amistack.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amistack.c $Date: 2009/05/06 10:48:30 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)amistack.c 3.5 2000/05/03 */ /* Copyright (c) Janne Salmijärvi, Tampere, Finland, 2000 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/amitty.c b/sys/amiga/amitty.c index 74ab9a1c0..7e960aeff 100644 --- a/sys/amiga/amitty.c +++ b/sys/amiga/amitty.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 amitty.c $Date$ $Revision$ */ +/* NetHack 3.5 amitty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amitty.c $Date: 2009/05/06 10:48:30 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)amitty.c 3.5 2000/01/12 /* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1993,1996 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/amiwind.c b/sys/amiga/amiwind.c index 798afc9d6..0d45f5685 100644 --- a/sys/amiga/amiwind.c +++ b/sys/amiga/amiwind.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 amiwind.c $Date$ $Revision$ */ +/* NetHack 3.5 amiwind.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amiwind.c $Date: 2009/05/06 10:48:30 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)amiwind.c 3.5 2000/01/12 /* Copyright (c) Olaf Seibert (KosmoSoft), 1989, 1992 */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1993,1996 */ diff --git a/sys/amiga/amiwind.p b/sys/amiga/amiwind.p index dd3127284..0eab48f94 100644 --- a/sys/amiga/amiwind.p +++ b/sys/amiga/amiwind.p @@ -1,4 +1,5 @@ -/* NetHack 3.5 amiwind.p $Date$ $Revision$ */ +/* NetHack 3.5 amiwind.p $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amiwind.p $Date: 2009/05/06 10:48:31 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)amiwind.p 3.5 1993/01/08 */ /* Copyright (c) Gregg Wonderly, Naperville, IL, 1992, 1993 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/cvtsnd.c b/sys/amiga/cvtsnd.c index 7a9f8cda6..ee82c974a 100644 --- a/sys/amiga/cvtsnd.c +++ b/sys/amiga/cvtsnd.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 cvtsnd.c $Date$ $Revision$ */ +/* NetHack 3.5 cvtsnd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 cvtsnd.c $Date: 2009/05/06 10:48:31 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)cvtsnd.c 3.5 1995/09/10 */ /* Copyright (c) 1995, Andrew Church, Olney, Maryland */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/txt2iff.c b/sys/amiga/txt2iff.c index 3ebbd225b..bd20f3583 100644 --- a/sys/amiga/txt2iff.c +++ b/sys/amiga/txt2iff.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 txt2iff.c $Date$ $Revision$ */ +/* NetHack 3.5 txt2iff.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 txt2iff.c $Date: 2009/05/06 10:48:31 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)txt2iff.c 3.5 1995/07/28 */ /* Copyright (c) 1995 by Gregg Wonderly, Naperville, Illinois */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winami.c b/sys/amiga/winami.c index 10e439e49..4762f0697 100644 --- a/sys/amiga/winami.c +++ b/sys/amiga/winami.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winami.c $Date$ $Revision$ */ +/* NetHack 3.5 winami.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winami.c $Date: 2012/01/10 17:47:21 $ $Revision: 1.13 $ */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993,1996. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winami.p b/sys/amiga/winami.p index 27f3eb8bb..c694628ab 100644 --- a/sys/amiga/winami.p +++ b/sys/amiga/winami.p @@ -1,4 +1,5 @@ -/* NetHack 3.5 winami.p $Date$ $Revision$ */ +/* NetHack 3.5 winami.p $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winami.p $Date: 2009/05/06 10:48:33 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)winami.p 3.5 1993/01/08 */ /* Copyright (c) Gregg Wonderly, Naperville, IL, 1992, 1993 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winchar.c b/sys/amiga/winchar.c index 66ca41275..9c7e573b8 100644 --- a/sys/amiga/winchar.c +++ b/sys/amiga/winchar.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winchar.c $Date$ $Revision$ */ +/* NetHack 3.5 winchar.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winchar.c $Date: 2009/05/06 10:48:33 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)winchar.c 3.5 1993/07/22 */ /* Copyright (c) Olaf Seibert (KosmoSoft), 1989, 1992 */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1993 */ diff --git a/sys/amiga/windefs.h b/sys/amiga/windefs.h index 14f46b561..67fb11564 100644 --- a/sys/amiga/windefs.h +++ b/sys/amiga/windefs.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 windefs.h $Date$ $Revision$ */ +/* NetHack 3.5 windefs.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 windefs.h $Date: 2009/05/06 10:48:34 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)windefs.h 3.5 1993/04/02 */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winext.h b/sys/amiga/winext.h index 109c11703..52ebe22d9 100644 --- a/sys/amiga/winext.h +++ b/sys/amiga/winext.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 winext.h $Date$ $Revision$ */ +/* NetHack 3.5 winext.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winext.h $Date: 2009/05/06 10:48:35 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)winext.h 3.5 2000/01/12 */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winfuncs.c b/sys/amiga/winfuncs.c index d518fea22..21f1937e4 100644 --- a/sys/amiga/winfuncs.c +++ b/sys/amiga/winfuncs.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winfuncs.c $Date$ $Revision$ */ +/* NetHack 3.5 winfuncs.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winfuncs.c $Date: 2012/01/10 17:47:21 $ $Revision: 1.8 $ */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993,1996. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winkey.c b/sys/amiga/winkey.c index 400aee7a7..b14b5ac06 100644 --- a/sys/amiga/winkey.c +++ b/sys/amiga/winkey.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winkey.c $Date$ $Revision$ */ +/* NetHack 3.5 winkey.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winkey.c $Date: 2009/05/06 10:48:37 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)winkey.c 3.5 1993/04/02 */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winmenu.c b/sys/amiga/winmenu.c index da5067f5f..6aba0c290 100644 --- a/sys/amiga/winmenu.c +++ b/sys/amiga/winmenu.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winmenu.c $Date$ $Revision$ */ +/* NetHack 3.5 winmenu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winmenu.c $Date: 2009/05/06 10:48:38 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)winmenu.c 3.5 1996/02/17 */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993,1996. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winproto.h b/sys/amiga/winproto.h index b3abb712c..06dd621c0 100644 --- a/sys/amiga/winproto.h +++ b/sys/amiga/winproto.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 winproto.h $Date$ $Revision$ */ +/* NetHack 3.5 winproto.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winproto.h $Date: 2012/01/24 04:26:20 $ $Revision: 1.4 $ */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winreq.c b/sys/amiga/winreq.c index 6e196657d..e87764434 100644 --- a/sys/amiga/winreq.c +++ b/sys/amiga/winreq.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winreq.c $Date$ $Revision$ */ +/* NetHack 3.5 winreq.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winreq.c $Date: 2009/05/06 10:48:41 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)winreq.c 3.5 1993/04/02 */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winstr.c b/sys/amiga/winstr.c index 9182f932b..f82c39aed 100644 --- a/sys/amiga/winstr.c +++ b/sys/amiga/winstr.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winstr.c $Date$ $Revision$ */ +/* NetHack 3.5 winstr.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winstr.c $Date: 2009/05/06 10:48:42 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)winstr.c 3.5 1993/04/02 */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/xpm2iff.c b/sys/amiga/xpm2iff.c index a5fc976b0..aebe6dcb0 100644 --- a/sys/amiga/xpm2iff.c +++ b/sys/amiga/xpm2iff.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 xpm2iff.c $Date$ $Revision$ */ +/* NetHack 3.5 xpm2iff.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 xpm2iff.c $Date: 2009/05/06 10:48:44 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)xpm2iff.c 3.5 1995/08/04 */ /* Copyright (c) 1995 by Gregg Wonderly, Naperville, Illinois */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/atari/tos.c b/sys/atari/tos.c index 7da8b63b0..9cfc98a39 100644 --- a/sys/atari/tos.c +++ b/sys/atari/tos.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 tos.c $Date$ $Revision$ */ +/* NetHack 3.5 tos.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tos.c $Date: 2009/05/06 10:48:51 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)tos.c 3.5 1990/14/08 /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/be/bemain.c b/sys/be/bemain.c index 1feaa4954..6a3715a9a 100644 --- a/sys/be/bemain.c +++ b/sys/be/bemain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 bemain.c $Date$ $Revision$ */ +/* NetHack 3.5 bemain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 bemain.c $Date: 2009/05/06 10:48:59 $ $Revision: 1.11 $ */ /* SCCS Id: @(#)bemain.c 3.5 2008/01/30 */ /* Copyright (c) Dean Luick, 1996. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/NHDeflts b/sys/mac/NHDeflts index f87b746fd..256105813 100644 --- a/sys/mac/NHDeflts +++ b/sys/mac/NHDeflts @@ -1,4 +1,5 @@ -# NetHack 3.5 NHDeflts $Date$ $Revision$ +# NetHack 3.5 NHDeflts $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 NHDeflts $Date: 2009/05/06 10:49:09 $ $Revision: 1.4 $ # SCCS Id: @(#)NetHack Defaults 3.5 2002/03/15 # Copyright (c) 2002 by Dean Luick, Mark Modrall, and Kevin Hugo # NetHack may be freely redistributed. See license for details. diff --git a/sys/mac/dprintf.c b/sys/mac/dprintf.c index 6a51857d3..c334fd00c 100644 --- a/sys/mac/dprintf.c +++ b/sys/mac/dprintf.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dprintf.c $Date$ $Revision$ */ +/* NetHack 3.5 dprintf.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dprintf.c $Date: 2009/05/06 10:49:10 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)dprintf.c 3.5 1994/01/29 */ /* Copyright (c) Jon W{tte, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/maccurs.c b/sys/mac/maccurs.c index 108718c2e..8e9b9ed46 100644 --- a/sys/mac/maccurs.c +++ b/sys/mac/maccurs.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 maccurs.c $Date$ $Revision$ */ +/* NetHack 3.5 maccurs.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 maccurs.c $Date: 2009/05/06 10:49:10 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)maccurs.c 3.5 1993/01/24 */ /* Copyright (c) Jon W{tte, 1992. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/macerrs.c b/sys/mac/macerrs.c index 7b82733ba..d585f3b5e 100644 --- a/sys/mac/macerrs.c +++ b/sys/mac/macerrs.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 macerrs.c $Date$ $Revision$ */ +/* NetHack 3.5 macerrs.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macerrs.c $Date: 2009/05/06 10:49:10 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)macerrs.c 3.5 1993/01/24 */ /* Copyright (c) Michael Hamel, 1991 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/macfile.c b/sys/mac/macfile.c index 347baa06f..e268ba810 100644 --- a/sys/mac/macfile.c +++ b/sys/mac/macfile.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 macfile.c $Date$ $Revision$ */ +/* NetHack 3.5 macfile.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macfile.c $Date: 2009/05/06 10:49:10 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)macfile.c 3.5 1993/01/24 */ /* Copyright (c) Jon W{tte, Hao-Yang Wang, Jonathan Handler 1992. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/macmain.c b/sys/mac/macmain.c index fbd36eebe..644e8e58f 100644 --- a/sys/mac/macmain.c +++ b/sys/mac/macmain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 macmain.c $Date$ $Revision$ */ +/* NetHack 3.5 macmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macmain.c $Date: 2009/05/06 10:49:11 $ $Revision: 1.15 $ */ /* SCCS Id: @(#)macmain.c 3.5 2008/01/30 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/macmenu.c b/sys/mac/macmenu.c index 0b146aa1a..651ab2242 100644 --- a/sys/mac/macmenu.c +++ b/sys/mac/macmenu.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 macmenu.c $Date$ $Revision$ */ +/* NetHack 3.5 macmenu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macmenu.c $Date: 2009/05/06 10:49:13 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)macmenu.c 3.5 1999/11/24 */ /* Copyright (c) Macintosh NetHack Port Team, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/macsnd.c b/sys/mac/macsnd.c index 319048fda..bb3dfc65e 100644 --- a/sys/mac/macsnd.c +++ b/sys/mac/macsnd.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 macsnd.c $Date$ $Revision$ */ +/* NetHack 3.5 macsnd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macsnd.c $Date: 2009/05/06 10:49:14 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)macsnd.c 3.5 1992/11/28 */ /* Copyright (c) 1992 by Jon Watte */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/mactopl.c b/sys/mac/mactopl.c index a4a92c5f6..938f4cfd4 100644 --- a/sys/mac/mactopl.c +++ b/sys/mac/mactopl.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mactopl.c $Date$ $Revision$ */ +/* NetHack 3.5 mactopl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mactopl.c $Date: 2009/05/06 10:49:14 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mactopl.c 3.5 1991/07/23 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/mactty.c b/sys/mac/mactty.c index 8efda1b03..e6006983c 100644 --- a/sys/mac/mactty.c +++ b/sys/mac/mactty.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mactty.c $Date$ $Revision$ */ +/* NetHack 3.5 mactty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mactty.c $Date: 2009/05/06 10:49:14 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mactty.c 3.5 1993/03/01 */ /* Copyright (c) Jon W{tte 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/macunix.c b/sys/mac/macunix.c index fe5735629..18aae8b9a 100644 --- a/sys/mac/macunix.c +++ b/sys/mac/macunix.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 macunix.c $Date$ $Revision$ */ +/* NetHack 3.5 macunix.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macunix.c $Date: 2009/05/06 10:49:16 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)macunix.c 3.5 1994/11/07 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/macwin.c b/sys/mac/macwin.c index aeed4356f..3c5e92fd9 100644 --- a/sys/mac/macwin.c +++ b/sys/mac/macwin.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 macwin.c $Date$ $Revision$ */ +/* NetHack 3.5 macwin.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macwin.c $Date: 2012/01/10 17:47:23 $ $Revision: 1.22 $ */ /* Copyright (c) Jon W{tte, Hao-Yang Wang, Jonathan Handler 1992. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/mgetline.c b/sys/mac/mgetline.c index e5d396a46..1094bcaab 100644 --- a/sys/mac/mgetline.c +++ b/sys/mac/mgetline.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mgetline.c $Date$ $Revision$ */ +/* NetHack 3.5 mgetline.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mgetline.c $Date: 2009/05/06 10:49:18 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)getline.c 3.5 1990/22/02 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/mmodal.c b/sys/mac/mmodal.c index 5faabd337..c11a79ff8 100644 --- a/sys/mac/mmodal.c +++ b/sys/mac/mmodal.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mmodal.c $Date$ $Revision$ */ +/* NetHack 3.5 mmodal.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mmodal.c $Date: 2009/05/06 10:49:18 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)mmodal.c 3.5 1993/01/24 */ /* Copyright (c) Jon W{tte, Hao-Yang Wang, Jonathan Handler 1992. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/mrecover.c b/sys/mac/mrecover.c index 03ef8b763..e8f8793a9 100644 --- a/sys/mac/mrecover.c +++ b/sys/mac/mrecover.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mrecover.c $Date$ $Revision$ */ +/* NetHack 3.5 mrecover.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mrecover.c $Date: 2009/05/06 10:49:19 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mrecover.c 3.5 1996/07/24 */ /* Copyright (c) David Hairston, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/mttymain.c b/sys/mac/mttymain.c index d4b1f2d37..258d93b7c 100644 --- a/sys/mac/mttymain.c +++ b/sys/mac/mttymain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mttymain.c $Date$ $Revision$ */ +/* NetHack 3.5 mttymain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mttymain.c $Date: 2009/05/06 10:49:20 $ $Revision: 1.8 $ */ /* SCCS Id: @(#)mttymain.c 3.5 1993/02/26 */ /* Copyright (c) Jon W{tte, 1993 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/Install.dos b/sys/msdos/Install.dos index cea810ac0..018884bb7 100644 --- a/sys/msdos/Install.dos +++ b/sys/msdos/Install.dos @@ -7,7 +7,8 @@ NetHack 3.5 on a DOS system ====================================================== (or, How to make PC NetHack 3.5) - Last revision: $Date$ + Last revision: $NHDT-Date$ + Last revision: $Date: 2005/01/02 17:16:53 $ Credit for a runnable full PC NetHack 3.5 goes to the PC Development team of Paul Winner, Kevin Smolkowski, Michael Allison, Yitzhak Sapir, Bill Dyer, diff --git a/sys/msdos/Makefile.BC b/sys/msdos/Makefile.BC index 48b412ae4..f64b99305 100644 --- a/sys/msdos/Makefile.BC +++ b/sys/msdos/Makefile.BC @@ -1,4 +1,5 @@ -# NetHack 3.5 Makefile.BC $Date$ $Revision$ +# NetHack 3.5 Makefile.BC $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.BC $Date: 2012/01/10 17:47:26 $ $Revision: 1.14 $ # Copyright (c) Yitzhak Sapir, 1999-2006. # NetHack may be freely distributed. See license for details. # diff --git a/sys/msdos/Makefile.GCC b/sys/msdos/Makefile.GCC index 3f4039d8e..d2e64da95 100644 --- a/sys/msdos/Makefile.GCC +++ b/sys/msdos/Makefile.GCC @@ -1,4 +1,5 @@ -# NetHack 3.5 Makefile.GCC $Date$ $Revision$ +# NetHack 3.5 Makefile.GCC $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.GCC $Date: 2012/01/10 17:47:26 $ $Revision: 1.25 $ # Copyright (c) NetHack PC Development Team 1996-2006. # PC NetHack 3.5 Makefile for djgpp V2 # diff --git a/sys/msdos/Makefile.MSC b/sys/msdos/Makefile.MSC index c5c4926c4..47e474ee2 100644 --- a/sys/msdos/Makefile.MSC +++ b/sys/msdos/Makefile.MSC @@ -1,4 +1,5 @@ -# NetHack 3.5 Makefile.MSC $Date$ $Revision$ +# NetHack 3.5 Makefile.MSC $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.MSC $Date: 2012/01/22 06:27:07 $ $Revision: 1.18 $ # Copyright (c) NetHack PC Development Team 1997 - 2012. # PC NetHack 3.4x Makefile for MSC V1.52c (16 bit compiler) # diff --git a/sys/msdos/msdos.c b/sys/msdos/msdos.c index 3b194617c..ce713bb9d 100644 --- a/sys/msdos/msdos.c +++ b/sys/msdos/msdos.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 msdos.c $Date$ $Revision$ */ +/* NetHack 3.5 msdos.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 msdos.c $Date: 2012/01/22 06:27:07 $ $Revision: 1.7 $ */ /* Copyright (c) NetHack PC Development Team 1990 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/ovlinit.c b/sys/msdos/ovlinit.c index e3a149fbb..869b7e325 100644 --- a/sys/msdos/ovlinit.c +++ b/sys/msdos/ovlinit.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 ovlinit.c $Date$ $Revision$ */ +/* NetHack 3.5 ovlinit.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 ovlinit.c $Date: 2009/05/06 10:49:38 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)ovlinit.c 3.5 1994/03/20 */ /* Copyright (c) NetHack PC Development Team 1995 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/pckeys.c b/sys/msdos/pckeys.c index 6bd95712d..142618ee7 100644 --- a/sys/msdos/pckeys.c +++ b/sys/msdos/pckeys.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pckeys.c $Date$ $Revision$ */ +/* NetHack 3.5 pckeys.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pckeys.c $Date: 2009/05/06 10:49:39 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)pckeys.c 3.5 1996/05/11 */ /* Copyright (c) NetHack PC Development Team 1996 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/pctiles.c b/sys/msdos/pctiles.c index f79ca4a81..e60c26f7a 100644 --- a/sys/msdos/pctiles.c +++ b/sys/msdos/pctiles.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pctiles.c $Date$ $Revision$ */ +/* NetHack 3.5 pctiles.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pctiles.c $Date: 2009/05/06 10:49:39 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)pctiles.c 3.5 1995/07/31 */ /* Copyright (c) NetHack PC Development Team 1993, 1994 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/pctiles.h b/sys/msdos/pctiles.h index 9c442a8e8..1f88edd4f 100644 --- a/sys/msdos/pctiles.h +++ b/sys/msdos/pctiles.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 pctiles.h $Date$ $Revision$ */ +/* NetHack 3.5 pctiles.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pctiles.h $Date: 2009/05/06 10:49:40 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)pctiles.h 3.5 1994/04/04 */ /* Copyright (c) NetHack PC Development Team 1993, 1994 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/pcvideo.h b/sys/msdos/pcvideo.h index e08d04fdd..5c24bd7c5 100644 --- a/sys/msdos/pcvideo.h +++ b/sys/msdos/pcvideo.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 pcvideo.h $Date$ $Revision$ */ +/* NetHack 3.5 pcvideo.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pcvideo.h $Date: 2009/05/06 10:49:40 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)pcvideo.h 3.5 1994/06/07 */ /* Copyright (c) NetHack PC Development Team 1993, 1994 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/portio.h b/sys/msdos/portio.h index 280e45885..33e5a20b5 100644 --- a/sys/msdos/portio.h +++ b/sys/msdos/portio.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 portio.h $Date$ $Revision$ */ +/* NetHack 3.5 portio.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 portio.h $Date: 2009/05/06 10:49:41 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)portio.h 3.5 1995/08/05 */ /* Copyright (c) NetHack PC Development Team 1995 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/schema1.BC b/sys/msdos/schema1.BC index e7aebf1d7..db07b0783 100644 --- a/sys/msdos/schema1.BC +++ b/sys/msdos/schema1.BC @@ -1,4 +1,5 @@ -/* NetHack 3.5 schema1.BC $Date$ $Revision$ */ +/* NetHack 3.5 schema1.BC $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 schema1.BC $Date: 2009/05/06 10:49:41 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)schema1.BC 3.5 2008/01/30 */ /* Copyright (c) Yitzhak Sapir, 1999 */ /* */ diff --git a/sys/msdos/schema2.BC b/sys/msdos/schema2.BC index 8a1246369..38a7546ea 100644 --- a/sys/msdos/schema2.BC +++ b/sys/msdos/schema2.BC @@ -1,4 +1,5 @@ -/* NetHack 3.5 schema2.BC $Date$ $Revision$ */ +/* NetHack 3.5 schema2.BC $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 schema2.BC $Date: 2009/05/06 10:49:42 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)schema2.BC 3.5 2008/01/30 */ /* Copyright (c) Yitzhak Sapir, 1999 */ /* */ diff --git a/sys/msdos/setup.bat b/sys/msdos/setup.bat old mode 100755 new mode 100644 index 3f53c20cf..03fd94d12 --- a/sys/msdos/setup.bat +++ b/sys/msdos/setup.bat @@ -1,5 +1,6 @@ @echo off -REM NetHack 3.5 setup.bat $Date$ $Revision$ +REM NetHack 3.5 setup.bat $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +REM NetHack 3.5 setup.bat $Date: 2012/01/22 06:27:07 $ $Revision: 1.3 $ REM Copyright (c) NetHack PC Development Team 1990 - 2012 REM NetHack may be freely redistributed. See license for details. diff --git a/sys/msdos/sound.c b/sys/msdos/sound.c index 1f13e551e..ef8914869 100644 --- a/sys/msdos/sound.c +++ b/sys/msdos/sound.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 sound.c $Date$ $Revision$ */ +/* NetHack 3.5 sound.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sound.c $Date: 2009/05/06 10:49:43 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)sound.c 3.5 1996/02/19 */ /* Copyright (c) NetHack PC Development Team 1993,1995 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/tile2bin.c b/sys/msdos/tile2bin.c index 44323c1ee..e54b83908 100644 --- a/sys/msdos/tile2bin.c +++ b/sys/msdos/tile2bin.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 tile2bin.c $Date$ $Revision$ */ +/* NetHack 3.5 tile2bin.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tile2bin.c $Date: 2009/05/06 10:49:47 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)tile2bin.c 3.5 1995/01/26 */ /* Copyright (c) NetHack PC Development Team 1993, 1994, 1995 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/video.c b/sys/msdos/video.c index a9dd7416e..9b4bc1241 100644 --- a/sys/msdos/video.c +++ b/sys/msdos/video.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 video.c $Date$ $Revision$ */ +/* NetHack 3.5 video.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 video.c $Date: 2009/05/06 10:49:49 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)video.c 3.5 2001/04/07 */ /* Copyright (c) NetHack PC Development Team 1993, 1994, 2001 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/vidtxt.c b/sys/msdos/vidtxt.c index 49962257c..2710dc397 100644 --- a/sys/msdos/vidtxt.c +++ b/sys/msdos/vidtxt.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vidtxt.c $Date$ $Revision$ */ +/* NetHack 3.5 vidtxt.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vidtxt.c $Date: 2009/05/06 10:49:49 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)vidtxt.c 3.5 1994/04/04 */ /* Copyright (c) NetHack PC Development Team 1993 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/vidvga.c b/sys/msdos/vidvga.c index 057e6a2a2..e128821f9 100644 --- a/sys/msdos/vidvga.c +++ b/sys/msdos/vidvga.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vidvga.c $Date$ $Revision$ */ +/* NetHack 3.5 vidvga.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vidvga.c $Date: 2009/05/06 10:49:50 $ $Revision: 1.9 $ */ /* SCCS Id: @(#)vidvga.c 3.5 2006/07/08 */ /* Copyright (c) NetHack PC Development Team 1995 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/os2/Makefile.os2 b/sys/os2/Makefile.os2 index 0f60e2307..09ee9ca80 100644 --- a/sys/os2/Makefile.os2 +++ b/sys/os2/Makefile.os2 @@ -1,4 +1,5 @@ -# NetHack 3.5 Makefile.os2 $Date$ $Revision$ +# NetHack 3.5 Makefile.os2 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.os2 $Date: 2012/01/10 17:47:28 $ $Revision: 1.16 $ # OS/2 NetHack 3.5 Makefile for OS/2 versions 1.x and 2.x # Copyright (C) 1990, 1991, 1992, 1993, 1996 Timo Hakulinen # diff --git a/sys/os2/os2.c b/sys/os2/os2.c index 45d6f6924..625b7168c 100644 --- a/sys/os2/os2.c +++ b/sys/os2/os2.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 os2.c $Date$ $Revision$ */ +/* NetHack 3.5 os2.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 os2.c $Date: 2009/05/06 10:50:12 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)os2.c 3.5 1996/02/29 */ /* Copyright (c) Timo Hakulinen, 1990, 1991, 1992, 1993, 1996. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/Makefile.lib b/sys/share/Makefile.lib index a94b37c88..86d72186b 100644 --- a/sys/share/Makefile.lib +++ b/sys/share/Makefile.lib @@ -1,4 +1,5 @@ -# NetHack 3.5 Makefile.lib $Date$ $Revision$ +# NetHack 3.5 Makefile.lib $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.lib $Date: 2009/05/06 10:50:26 $ $Revision: 1.4 $ # SCCS Id: @(#)Makefile.lib 3.5 1990/22/02 # Nethack makefile for Fred fish termlib -- Norman Meluch # diff --git a/sys/share/ioctl.c b/sys/share/ioctl.c index 09c181be0..ee86074ac 100644 --- a/sys/share/ioctl.c +++ b/sys/share/ioctl.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 ioctl.c $Date$ $Revision$ */ +/* NetHack 3.5 ioctl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 ioctl.c $Date: 2011/06/16 15:10:14 $ $Revision: 1.8 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/nhlan.c b/sys/share/nhlan.c index d0e18c7e9..506a41455 100644 --- a/sys/share/nhlan.c +++ b/sys/share/nhlan.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 nhlan.c $Date$ $Revision$ */ +/* NetHack 3.5 nhlan.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 nhlan.c $Date: 2009/05/06 10:50:26 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)nhlan.c 3.5 1999/11/21 */ /* Copyright (c) Michael Allison, 1997 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 6e9fc68ac..f6c2b6b12 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pcmain.c $Date$ $Revision$ */ +/* NetHack 3.5 pcmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pcmain.c $Date: 2012/01/20 03:41:31 $ $Revision: 1.48 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/pcsys.c b/sys/share/pcsys.c index 8ebcd4319..0fc5ee8ed 100644 --- a/sys/share/pcsys.c +++ b/sys/share/pcsys.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pcsys.c $Date$ $Revision$ */ +/* NetHack 3.5 pcsys.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pcsys.c $Date: 2012/01/22 06:33:47 $ $Revision: 1.18 $ */ /* SCCS Id: @(#)pcsys.c 3.5 2002/01/22 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/pctty.c b/sys/share/pctty.c index d5364b5fe..85c364669 100644 --- a/sys/share/pctty.c +++ b/sys/share/pctty.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pctty.c $Date$ $Revision$ */ +/* NetHack 3.5 pctty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pctty.c $Date: 2009/05/06 10:50:30 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)pctty.c 3.5 1990/22/02 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/pcunix.c b/sys/share/pcunix.c index 824149733..24316aac2 100644 --- a/sys/share/pcunix.c +++ b/sys/share/pcunix.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pcunix.c $Date$ $Revision$ */ +/* NetHack 3.5 pcunix.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pcunix.c $Date: 2009/05/06 10:50:30 $ $Revision: 1.27 $ */ /* SCCS Id: @(#)pcunix.c 3.5 1994/11/07 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/tclib.c b/sys/share/tclib.c index a22578367..b6aa91665 100644 --- a/sys/share/tclib.c +++ b/sys/share/tclib.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 tclib.c $Date$ $Revision$ */ +/* NetHack 3.5 tclib.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tclib.c $Date: 2009/05/06 10:50:31 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)tclib.c 3.5 1996/02/25 */ /* Copyright (c) Robert Patrick Rankin, 1995 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/unixtty.c b/sys/share/unixtty.c index f691d5a6f..68c6f104c 100644 --- a/sys/share/unixtty.c +++ b/sys/share/unixtty.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 unixtty.c $Date$ $Revision$ */ +/* NetHack 3.5 unixtty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 unixtty.c $Date: 2012/01/23 07:11:09 $ $Revision: 1.10 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/unix/Makefile.dat b/sys/unix/Makefile.dat index 609672540..ad9cb6e2d 100644 --- a/sys/unix/Makefile.dat +++ b/sys/unix/Makefile.dat @@ -1,5 +1,6 @@ # NetHack Makefile. -# NetHack 3.5 Makefile.dat $Date$ $Revision$ +# NetHack 3.5 Makefile.dat $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.dat $Date: 2012/01/10 17:47:30 $ $Revision: 1.11 $ # Root of source tree: NHSROOT=.. diff --git a/sys/unix/Makefile.doc b/sys/unix/Makefile.doc index 83f493004..606867b75 100644 --- a/sys/unix/Makefile.doc +++ b/sys/unix/Makefile.doc @@ -1,5 +1,6 @@ # NetHack Makefile. -# NetHack 3.5 Makefile.doc $Date$ $Revision$ +# NetHack 3.5 Makefile.doc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.doc $Date: 2010/05/01 23:10:22 $ $Revision: 1.11 $ # Root of source tree: NHSROOT=.. diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index 11d9f86f0..b64a838c9 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -1,5 +1,6 @@ # NetHack Makefile. -# NetHack 3.5 Makefile.src $Date$ $Revision$ +# NetHack 3.5 Makefile.src $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.src $Date: 2012/01/20 03:41:33 $ $Revision: 1.37 $ # Root of source tree: NHSROOT=.. diff --git a/sys/unix/Makefile.top b/sys/unix/Makefile.top index ca32f08c3..6d94d6908 100644 --- a/sys/unix/Makefile.top +++ b/sys/unix/Makefile.top @@ -1,5 +1,6 @@ # NetHack Makefile. -# NetHack 3.5 Makefile.top $Date$ $Revision$ +# NetHack 3.5 Makefile.top $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.top $Date: 2012/01/10 17:47:30 $ $Revision: 1.19 $ # Root of source tree: NHSROOT=. diff --git a/sys/unix/Makefile.utl b/sys/unix/Makefile.utl index def3b67f4..e1c677c2f 100644 --- a/sys/unix/Makefile.utl +++ b/sys/unix/Makefile.utl @@ -1,5 +1,6 @@ # Makefile for NetHack's utility programs. -# NetHack 3.5 Makefile.utl $Date$ $Revision$ +# NetHack 3.5 Makefile.utl $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.utl $Date: 2012/01/10 17:47:30 $ $Revision: 1.18 $ # Root of source tree: NHSROOT=.. diff --git a/sys/unix/hints/linux b/sys/unix/hints/linux index 9ff45ff00..3ae677d00 100644 --- a/sys/unix/hints/linux +++ b/sys/unix/hints/linux @@ -1,5 +1,6 @@ # -# NetHack 3.5 linux $Date$ $Revision$ +# NetHack 3.5 linux $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 linux $Date: 2010/01/15 19:54:37 $ $Revision: 1.8 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # diff --git a/sys/unix/hints/linux-x11 b/sys/unix/hints/linux-x11 index 48d46f940..e0d98badd 100644 --- a/sys/unix/hints/linux-x11 +++ b/sys/unix/hints/linux-x11 @@ -1,5 +1,6 @@ # -# NetHack 3.5 linux-x11 $Date$ $Revision$ +# NetHack 3.5 linux-x11 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 linux-x11 $Date: 2009/12/23 20:02:29 $ $Revision: 1.5 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # diff --git a/sys/unix/hints/macosx b/sys/unix/hints/macosx index 0ef9c342c..8d1f9d327 100644 --- a/sys/unix/hints/macosx +++ b/sys/unix/hints/macosx @@ -1,5 +1,6 @@ # -# NetHack 3.5 macosx $Date$ $Revision$ +# NetHack 3.5 macosx $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 macosx $Date: 2009/12/23 20:02:29 $ $Revision: 1.9 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # diff --git a/sys/unix/hints/macosx.sh b/sys/unix/hints/macosx.sh old mode 100755 new mode 100644 index 3296963b2..a4091204a --- a/sys/unix/hints/macosx.sh +++ b/sys/unix/hints/macosx.sh @@ -1,5 +1,6 @@ #!/bin/sh -# NetHack 3.5 macosx.sh $Date$ $Revision$ +# NetHack 3.5 macosx.sh $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 macosx.sh $Date: 2011/10/17 01:29:17 $ $Revision: 1.5 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # diff --git a/sys/unix/hints/macosx10.5 b/sys/unix/hints/macosx10.5 index c426629db..7ab5c760d 100644 --- a/sys/unix/hints/macosx10.5 +++ b/sys/unix/hints/macosx10.5 @@ -1,5 +1,6 @@ # -# NetHack 3.5 macosx10.5 $Date$ $Revision$ +# NetHack 3.5 macosx10.5 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 macosx10.5 $Date: 2011/10/17 01:29:17 $ $Revision: 1.11 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009. # NetHack may be freely redistributed. See license for details. # diff --git a/sys/unix/hints/macosx10.7 b/sys/unix/hints/macosx10.7 index 76f7b6862..fa3cc1e9c 100644 --- a/sys/unix/hints/macosx10.7 +++ b/sys/unix/hints/macosx10.7 @@ -1,5 +1,6 @@ # -# NetHack 3.5 macosx10.7 $Date$ $Revision$ +# NetHack 3.5 macosx10.7 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 macosx10.7 $Date: 2012/01/18 22:32:24 $ $Revision: 1.4 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009. # NetHack may be freely redistributed. See license for details. # diff --git a/sys/unix/hints/unix b/sys/unix/hints/unix index d6f230e44..bea73b58b 100644 --- a/sys/unix/hints/unix +++ b/sys/unix/hints/unix @@ -1,5 +1,6 @@ # -# NetHack 3.5 unix $Date$ $Revision$ +# NetHack 3.5 unix $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 unix $Date: 2009/12/23 20:02:29 $ $Revision: 1.5 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # diff --git a/sys/unix/mkmkfile.sh b/sys/unix/mkmkfile.sh old mode 100755 new mode 100644 index 9055cd465..179e0bc90 --- a/sys/unix/mkmkfile.sh +++ b/sys/unix/mkmkfile.sh @@ -1,5 +1,6 @@ #!/bin/sh -# NetHack 3.5 mkmkfile.sh $Date$ $Revision$ +# NetHack 3.5 mkmkfile.sh $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 mkmkfile.sh $Date: 2011/12/27 00:34:52 $ $Revision: 1.5 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. diff --git a/sys/unix/nethack.sh b/sys/unix/nethack.sh old mode 100755 new mode 100644 index 00d2c409a..27278079b --- a/sys/unix/nethack.sh +++ b/sys/unix/nethack.sh @@ -1,5 +1,6 @@ #!/bin/sh -# NetHack 3.5 nethack.sh $Date$ $Revision$ +# NetHack 3.5 nethack.sh $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 nethack.sh $Date: 2009/05/06 10:50:54 $ $Revision: 1.9 $ # SCCS Id: @(#)nethack.sh 3.5 2007/12/12 HACKDIR=/usr/games/lib/nethackdir diff --git a/sys/unix/setup.sh b/sys/unix/setup.sh old mode 100755 new mode 100644 index 38f3e9d8d..2c1cbedca --- a/sys/unix/setup.sh +++ b/sys/unix/setup.sh @@ -1,5 +1,6 @@ #!/bin/sh -# NetHack 3.5 setup.sh $Date$ $Revision$ +# NetHack 3.5 setup.sh $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 setup.sh $Date: 2011/12/27 00:34:52 $ $Revision: 1.6 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # diff --git a/sys/unix/sysconf b/sys/unix/sysconf index 99bcab3d8..3eb07ecaa 100644 --- a/sys/unix/sysconf +++ b/sys/unix/sysconf @@ -1,5 +1,6 @@ # -# NetHack 3.5 sysconf $Date$ $Revision$ +# NetHack 3.5 sysconf $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 sysconf $Date: 2012/01/27 20:15:31 $ $Revision: 1.6 $ # # Sample sysconf file. # The sysconf file is only used if NetHack is compiled with SYSCF defined. diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index be3617170..8f743e2ad 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 unixmain.c $Date$ $Revision$ */ +/* NetHack 3.5 unixmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 unixmain.c $Date: 2012/01/27 20:15:31 $ $Revision: 1.42 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/unix/unixres.c b/sys/unix/unixres.c index 645e313ad..6d647103a 100644 --- a/sys/unix/unixres.c +++ b/sys/unix/unixres.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 unixres.c $Date$ $Revision$ */ +/* NetHack 3.5 unixres.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 unixres.c $Date: 2009/05/06 10:50:57 $ $Revision: 1.8 $ */ /* SCCS Id: @(#)unixres.c 3.5 2001/07/08 */ /* Copyright (c) Slash'EM development team, 2001. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/unix/unixunix.c b/sys/unix/unixunix.c index 978dd477a..a6d6d378b 100644 --- a/sys/unix/unixunix.c +++ b/sys/unix/unixunix.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 unixunix.c $Date$ $Revision$ */ +/* NetHack 3.5 unixunix.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 unixunix.c $Date: 2012/01/27 20:15:31 $ $Revision: 1.16 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/vms/Makefile.dat b/sys/vms/Makefile.dat index ec3af0aea..0a6bcf896 100644 --- a/sys/vms/Makefile.dat +++ b/sys/vms/Makefile.dat @@ -1,5 +1,6 @@ # NetHack Makefile (VMS) - data files: special levels and other data. -# NetHack 3.5 Makefile.dat $Date$ $Revision$ +# NetHack 3.5 Makefile.dat $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.dat $Date: 2011/05/23 03:27:10 $ $Revision: 1.5 $ # Copy this file to [.dat]Makefile.; no editing needed. diff --git a/sys/vms/Makefile.doc b/sys/vms/Makefile.doc index 7c7587a82..01e8158e4 100644 --- a/sys/vms/Makefile.doc +++ b/sys/vms/Makefile.doc @@ -1,5 +1,6 @@ # NetHack Makefile (VMS) - for the [Unix] documentation. -# NetHack 3.5 Makefile.doc $Date$ $Revision$ +# NetHack 3.5 Makefile.doc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.doc $Date: 2011/05/23 03:27:10 $ $Revision: 1.5 $ # Copy this file to [.doc]Makefile. and edit it if needed. diff --git a/sys/vms/Makefile.src b/sys/vms/Makefile.src index a50ee357b..38f3ec266 100644 --- a/sys/vms/Makefile.src +++ b/sys/vms/Makefile.src @@ -1,5 +1,6 @@ # NetHack Makefile (VMS) - for building nethack itself. -# NetHack 3.5 Makefile.src $Date$ $Revision$ +# NetHack 3.5 Makefile.src $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.src $Date: 2011/10/11 02:37:18 $ $Revision: 1.23 $ # Copy this file to [.src]Makefile. and then edit it as needed. # The default configuration is for building with DEC C (aka Compaq C). diff --git a/sys/vms/Makefile.top b/sys/vms/Makefile.top index 01e9de1d6..04451124c 100644 --- a/sys/vms/Makefile.top +++ b/sys/vms/Makefile.top @@ -1,5 +1,6 @@ # NetHack Makefile (VMS) - top level for making & installing everything. -# NetHack 3.5 Makefile.top $Date$ $Revision$ +# NetHack 3.5 Makefile.top $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.top $Date: 2011/05/23 03:27:10 $ $Revision: 1.6 $ # Copy this file to Makefile.; edit the appropriate values for # GAMEDIR ("playground" location) and GAMEOWNER (UIC or identifier diff --git a/sys/vms/Makefile.utl b/sys/vms/Makefile.utl index 82eae9f8c..b132dcf9a 100644 --- a/sys/vms/Makefile.utl +++ b/sys/vms/Makefile.utl @@ -1,5 +1,6 @@ # NetHack Makefile (VMS) - for utility programs. -# NetHack 3.5 Makefile.utl $Date$ $Revision$ +# NetHack 3.5 Makefile.utl $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.utl $Date: 2011/05/23 03:27:10 $ $Revision: 1.10 $ # Copy this file to [.util]Makefile. and then edit it as needed. # The default configuration is for building with DEC C (aka Compaq C). diff --git a/sys/vms/lev_lex.h b/sys/vms/lev_lex.h index 0d26fed53..5dbde3521 100644 --- a/sys/vms/lev_lex.h +++ b/sys/vms/lev_lex.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 lev_lex.h $Date$ $Revision$ */ +/* NetHack 3.5 lev_lex.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev_lex.h $Date: 2009/05/06 10:51:24 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)lev_lex.h 3.5 1999/08/08 */ /* "vms/lev_lex.h" copied into "util/stdio.h" for use in *_lex.c only! * This is an awful kludge to allow util/*_lex.c made by SunOS's `lex' diff --git a/sys/vms/oldcrtl.c b/sys/vms/oldcrtl.c index e7bad5663..bb167cde5 100644 --- a/sys/vms/oldcrtl.c +++ b/sys/vms/oldcrtl.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 oldcrtl.c $Date$ $Revision$ */ +/* NetHack 3.5 oldcrtl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 oldcrtl.c $Date: 2009/05/06 10:51:24 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)oldcrtl.c 3.5 1995/06/01 */ /* Pat Rankin May'90 */ /* VMS NetHack support, not needed for vms 4.6,4.7,5.x,or later */ diff --git a/sys/vms/vmsfiles.c b/sys/vms/vmsfiles.c index a714cce84..5eac49b5e 100644 --- a/sys/vms/vmsfiles.c +++ b/sys/vms/vmsfiles.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vmsfiles.c $Date$ $Revision$ */ +/* NetHack 3.5 vmsfiles.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vmsfiles.c $Date: 2009/05/06 10:51:25 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)vmsfiles.c 3.5 2007/10/27 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/vms/vmsmail.c b/sys/vms/vmsmail.c index 2b00ff511..d5358eb7f 100644 --- a/sys/vms/vmsmail.c +++ b/sys/vms/vmsmail.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vmsmail.c $Date$ $Revision$ */ +/* NetHack 3.5 vmsmail.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vmsmail.c $Date: 2009/05/06 10:51:25 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)vmsmail.c 3.5 2006/04/14 */ /* Copyright (c) Robert Patrick Rankin, 1991. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/vms/vmsmain.c b/sys/vms/vmsmain.c index 7992c806c..52c181ade 100644 --- a/sys/vms/vmsmain.c +++ b/sys/vms/vmsmain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vmsmain.c $Date$ $Revision$ */ +/* NetHack 3.5 vmsmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vmsmain.c $Date: 2011/04/23 01:51:01 $ $Revision: 1.22 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ /* main.c - VMS NetHack */ diff --git a/sys/vms/vmsmisc.c b/sys/vms/vmsmisc.c index b5446a0fb..b5b2cf4cd 100644 --- a/sys/vms/vmsmisc.c +++ b/sys/vms/vmsmisc.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vmsmisc.c $Date$ $Revision$ */ +/* NetHack 3.5 vmsmisc.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vmsmisc.c $Date: 2011/09/01 01:47:00 $ $Revision: 1.6 $ */ /* NetHack may be freely redistributed. See license for details. */ #include "config.h" diff --git a/sys/vms/vmstty.c b/sys/vms/vmstty.c index 29d72bae5..548e476b2 100644 --- a/sys/vms/vmstty.c +++ b/sys/vms/vmstty.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vmstty.c $Date$ $Revision$ */ +/* NetHack 3.5 vmstty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vmstty.c $Date: 2011/04/13 01:48:13 $ $Revision: 1.10 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ /* tty.c - (VMS) version */ diff --git a/sys/vms/vmsunix.c b/sys/vms/vmsunix.c index 364c96d66..baa4f75a3 100644 --- a/sys/vms/vmsunix.c +++ b/sys/vms/vmsunix.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vmsunix.c $Date$ $Revision$ */ +/* NetHack 3.5 vmsunix.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vmsunix.c $Date: 2011/09/01 01:47:00 $ $Revision: 1.8 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/Install.ce b/sys/wince/Install.ce index 50fd50477..60c7ee081 100644 --- a/sys/wince/Install.ce +++ b/sys/wince/Install.ce @@ -4,7 +4,8 @@ NetHack may be freely redistributed. See license for details. Instructions for compiling and installing NetHack 3.5 on a Windows CE or PocketPC system ======================================================================== - Last revision: $Date$ + Last revision: $NHDT-Date$ + Last revision: $Date: 2005/01/02 20:55:41 $ Credit for the porting of NetHack to Windows CE goes to Alex Kompel who initially developed and contributed the port. diff --git a/sys/wince/bootstrp.mak b/sys/wince/bootstrp.mak index 9a04417df..4066b63d1 100644 --- a/sys/wince/bootstrp.mak +++ b/sys/wince/bootstrp.mak @@ -1,4 +1,5 @@ -# NetHack 3.5 bootstrp.mak $Date$ $Revision$ +# NetHack 3.5 bootstrp.mak $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 bootstrp.mak $Date: 2012/01/10 17:47:33 $ $Revision: 1.10 $ # Copyright (c) Michael Allison # # NetHack Windows CE bootstrap file for MS Visual C++ V6.x and diff --git a/sys/wince/celib.c b/sys/wince/celib.c index 4c0d0b487..a8e38ccc7 100644 --- a/sys/wince/celib.c +++ b/sys/wince/celib.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 celib.c $Date$ $Revision$ */ +/* NetHack 3.5 celib.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 celib.c $Date: 2009/10/22 02:59:30 $ $Revision: 1.6 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/cesetup.bat b/sys/wince/cesetup.bat old mode 100755 new mode 100644 index 9f7215434..28d3bf6ce --- a/sys/wince/cesetup.bat +++ b/sys/wince/cesetup.bat @@ -1,4 +1,5 @@ -@REM NetHack 3.5 cesetup.bat $Date$ $Revision$ */ +@REM NetHack 3.5 cesetup.bat $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +@REM NetHack 3.5 cesetup.bat $Date: 2009/10/22 02:59:30 $ $Revision: 1.9 $ */ @REM Copyright (c) Alex Kompel, 2002 @REM NetHack may be freely redistributed. See license for details. @REM Win32 nhsetup batch file, see Install.ce for details diff --git a/sys/wince/cesound.c b/sys/wince/cesound.c index 8071abc42..6df289f3d 100644 --- a/sys/wince/cesound.c +++ b/sys/wince/cesound.c @@ -1,5 +1,7 @@ -/* NetHack 3.5 cesound.c $Date$ $Revision$ */ -/* SCCS Id: @(#)cesound.c 3.5 $Date$ */ +/* NetHack 3.5 cesound.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 cesound.c $Date: 2009/05/06 10:52:00 $ $Revision: 1.4 $ */ +/* SCCS Id: @(#)cesound.c 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)cesound.c 3.5 $Date: 2009/05/06 10:52:00 $ */ /* Copyright (c) NetHack PC Development Team 1993 */ /* NetHack may be freely redistributed. See license for details. */ /* */ diff --git a/sys/wince/mhaskyn.c b/sys/wince/mhaskyn.c index a46e0f0ad..fa4dd8629 100644 --- a/sys/wince/mhaskyn.c +++ b/sys/wince/mhaskyn.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhaskyn.c $Date$ $Revision$ */ +/* NetHack 3.5 mhaskyn.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhaskyn.c $Date: 2009/05/06 10:52:00 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mhaskyn.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhaskyn.h b/sys/wince/mhaskyn.h index 0754723fb..e034486a8 100644 --- a/sys/wince/mhaskyn.h +++ b/sys/wince/mhaskyn.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhaskyn.h $Date$ $Revision$ */ +/* NetHack 3.5 mhaskyn.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhaskyn.h $Date: 2009/05/06 10:52:03 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)mhaskyn.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhcmd.c b/sys/wince/mhcmd.c index 8000db9ad..1e8b1c7f2 100644 --- a/sys/wince/mhcmd.c +++ b/sys/wince/mhcmd.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhcmd.c $Date$ $Revision$ */ +/* NetHack 3.5 mhcmd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhcmd.c $Date: 2009/10/22 02:59:30 $ $Revision: 1.8 $ */ /* NetHack may be freely redistributed. See license for details. */ #include "winMS.h" diff --git a/sys/wince/mhcolor.c b/sys/wince/mhcolor.c index a68056fb5..285861da5 100644 --- a/sys/wince/mhcolor.c +++ b/sys/wince/mhcolor.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhcolor.c $Date$ $Revision$ */ +/* NetHack 3.5 mhcolor.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhcolor.c $Date: 2009/05/06 10:52:03 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)mhcolor.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhcolor.h b/sys/wince/mhcolor.h index 392da954b..8ebb7dc50 100644 --- a/sys/wince/mhcolor.h +++ b/sys/wince/mhcolor.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhcolor.h $Date$ $Revision$ */ +/* NetHack 3.5 mhcolor.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhcolor.h $Date: 2009/05/06 10:52:04 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)mhcolor.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhdlg.c b/sys/wince/mhdlg.c index 81017832f..edaca4cc4 100644 --- a/sys/wince/mhdlg.c +++ b/sys/wince/mhdlg.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhdlg.c $Date$ $Revision$ */ +/* NetHack 3.5 mhdlg.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhdlg.c $Date: 2009/10/13 01:55:10 $ $Revision: 1.8 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhdlg.h b/sys/wince/mhdlg.h index 78540b1a5..40ed9154a 100644 --- a/sys/wince/mhdlg.h +++ b/sys/wince/mhdlg.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhdlg.h $Date$ $Revision$ */ +/* NetHack 3.5 mhdlg.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhdlg.h $Date: 2009/05/06 10:52:06 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)mhdlg.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhfont.c b/sys/wince/mhfont.c index 9d30c87da..4b8ec12f6 100644 --- a/sys/wince/mhfont.c +++ b/sys/wince/mhfont.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhfont.c $Date$ $Revision$ */ +/* NetHack 3.5 mhfont.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhfont.c $Date: 2009/05/06 10:52:08 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)mhfont.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhfont.h b/sys/wince/mhfont.h index 7b6aeb1cf..00928b5de 100644 --- a/sys/wince/mhfont.h +++ b/sys/wince/mhfont.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhfont.h $Date$ $Revision$ */ +/* NetHack 3.5 mhfont.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhfont.h $Date: 2009/05/06 10:52:08 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mhfont.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhinput.c b/sys/wince/mhinput.c index 129d790df..29b765470 100644 --- a/sys/wince/mhinput.c +++ b/sys/wince/mhinput.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhinput.c $Date$ $Revision$ */ +/* NetHack 3.5 mhinput.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhinput.c $Date: 2009/05/06 10:52:10 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mhinput.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhinput.h b/sys/wince/mhinput.h index c2d73aa5c..dce815301 100644 --- a/sys/wince/mhinput.h +++ b/sys/wince/mhinput.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhinput.h $Date$ $Revision$ */ +/* NetHack 3.5 mhinput.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhinput.h $Date: 2009/05/06 10:52:10 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mhinput.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhmain.c b/sys/wince/mhmain.c index 28a29c137..ff4e628b3 100644 --- a/sys/wince/mhmain.c +++ b/sys/wince/mhmain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmain.c $Date$ $Revision$ */ +/* NetHack 3.5 mhmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmain.c $Date: 2011/10/11 02:37:20 $ $Revision: 1.14 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhmain.h b/sys/wince/mhmain.h index c8d79dbee..6bca6d674 100644 --- a/sys/wince/mhmain.h +++ b/sys/wince/mhmain.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmain.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmain.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmain.h $Date: 2009/05/06 10:52:13 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mhmain.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhmap.c b/sys/wince/mhmap.c index 156a8f8b0..1fe386490 100644 --- a/sys/wince/mhmap.c +++ b/sys/wince/mhmap.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmap.c $Date$ $Revision$ */ +/* NetHack 3.5 mhmap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmap.c $Date: 2009/10/13 01:55:11 $ $Revision: 1.10 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhmap.h b/sys/wince/mhmap.h index e29aca51f..a418d0f64 100644 --- a/sys/wince/mhmap.h +++ b/sys/wince/mhmap.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmap.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmap.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmap.h $Date: 2009/10/13 01:55:12 $ $Revision: 1.6 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhmsg.h b/sys/wince/mhmsg.h index 6e2629ab4..56f8841d8 100644 --- a/sys/wince/mhmsg.h +++ b/sys/wince/mhmsg.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmsg.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmsg.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmsg.h $Date: 2009/05/06 10:52:21 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)mhmsg.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhmsgwnd.c b/sys/wince/mhmsgwnd.c index ffe3fc10a..6d2804f61 100644 --- a/sys/wince/mhmsgwnd.c +++ b/sys/wince/mhmsgwnd.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmsgwnd.c $Date$ $Revision$ */ +/* NetHack 3.5 mhmsgwnd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmsgwnd.c $Date: 2009/10/13 01:55:12 $ $Revision: 1.7 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhmsgwnd.h b/sys/wince/mhmsgwnd.h index 7638eaa2c..a0e4ee13c 100644 --- a/sys/wince/mhmsgwnd.h +++ b/sys/wince/mhmsgwnd.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmsgwnd.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmsgwnd.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmsgwnd.h $Date: 2009/05/06 10:52:26 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)mhmsgwnd.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhrip.c b/sys/wince/mhrip.c index 5de8f0957..8b6957569 100644 --- a/sys/wince/mhrip.c +++ b/sys/wince/mhrip.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhrip.c $Date$ $Revision$ */ +/* NetHack 3.5 mhrip.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhrip.c $Date: 2009/05/06 10:52:26 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mhrip.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhrip.h b/sys/wince/mhrip.h index bd4b74eee..f5a4d7d44 100644 --- a/sys/wince/mhrip.h +++ b/sys/wince/mhrip.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhrip.h $Date$ $Revision$ */ +/* NetHack 3.5 mhrip.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhrip.h $Date: 2009/05/06 10:52:28 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mhrip.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhstatus.c b/sys/wince/mhstatus.c index 786d2a8c2..6e18ed12a 100644 --- a/sys/wince/mhstatus.c +++ b/sys/wince/mhstatus.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhstatus.c $Date$ $Revision$ */ +/* NetHack 3.5 mhstatus.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhstatus.c $Date: 2009/05/06 10:52:28 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)mhstatus.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhstatus.h b/sys/wince/mhstatus.h index 18df7a9f2..fcd186162 100644 --- a/sys/wince/mhstatus.h +++ b/sys/wince/mhstatus.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhstatus.h $Date$ $Revision$ */ +/* NetHack 3.5 mhstatus.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhstatus.h $Date: 2009/05/06 10:52:29 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)mhstatus.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhtext.c b/sys/wince/mhtext.c index 01581df62..3b61dab66 100644 --- a/sys/wince/mhtext.c +++ b/sys/wince/mhtext.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhtext.c $Date$ $Revision$ */ +/* NetHack 3.5 mhtext.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhtext.c $Date: 2009/10/22 02:59:34 $ $Revision: 1.8 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhtext.h b/sys/wince/mhtext.h index ed12ec815..fdbae63f1 100644 --- a/sys/wince/mhtext.h +++ b/sys/wince/mhtext.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhtext.h $Date$ $Revision$ */ +/* NetHack 3.5 mhtext.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhtext.h $Date: 2009/05/06 10:52:32 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)mhtext.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhtxtbuf.c b/sys/wince/mhtxtbuf.c index 5523d0f02..1be9af440 100644 --- a/sys/wince/mhtxtbuf.c +++ b/sys/wince/mhtxtbuf.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhtxtbuf.c $Date$ $Revision$ */ +/* NetHack 3.5 mhtxtbuf.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhtxtbuf.c $Date: 2009/10/13 01:55:12 $ $Revision: 1.6 $ */ /* Copyright (C) 2003 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhtxtbuf.h b/sys/wince/mhtxtbuf.h index fb38affb8..a61265796 100644 --- a/sys/wince/mhtxtbuf.h +++ b/sys/wince/mhtxtbuf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhtxtbuf.h $Date$ $Revision$ */ +/* NetHack 3.5 mhtxtbuf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhtxtbuf.h $Date: 2009/10/13 01:55:12 $ $Revision: 1.5 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mswproc.c b/sys/wince/mswproc.c index b069d1284..a4e5ede90 100644 --- a/sys/wince/mswproc.c +++ b/sys/wince/mswproc.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mswproc.c $Date$ $Revision$ */ +/* NetHack 3.5 mswproc.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mswproc.c $Date: 2012/01/24 04:26:22 $ $Revision: 1.19 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/winMS.h b/sys/wince/winMS.h index c8df31219..31856e71f 100644 --- a/sys/wince/winMS.h +++ b/sys/wince/winMS.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 winMS.h $Date$ $Revision$ */ +/* NetHack 3.5 winMS.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winMS.h $Date: 2012/01/24 04:26:22 $ $Revision: 1.9 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/winhack.c b/sys/wince/winhack.c index 17ecf17eb..2e25082a0 100644 --- a/sys/wince/winhack.c +++ b/sys/wince/winhack.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winhack.c $Date$ $Revision$ */ +/* NetHack 3.5 winhack.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winhack.c $Date: 2009/10/22 02:59:35 $ $Revision: 1.11 $ */ /* Copyright (C) 2001 by Alex Kompel */ // winhack.cpp : Defines the entry point for the application. // diff --git a/sys/winnt/Install.nt b/sys/winnt/Install.nt index cc7af7962..b4beb8f87 100644 --- a/sys/winnt/Install.nt +++ b/sys/winnt/Install.nt @@ -5,7 +5,8 @@ NetHack 3.5 on a Windows system (Windows XP and Windows 2003 or later only) ============================================================== - Last revision: $Date$ + Last revision: $NHDT-Date$ + Last revision: $Date: 2012/01/15 17:43:54 $ Credit for the porting of NetHack to the Win32 Console Subsystem goes to the NT Porting Team started by Michael Allison. diff --git a/sys/winnt/Makefile.bcc b/sys/winnt/Makefile.bcc index 358feb966..018baecb8 100644 --- a/sys/winnt/Makefile.bcc +++ b/sys/winnt/Makefile.bcc @@ -1,4 +1,5 @@ -# NetHack 3.5 Makefile.bcc $Date$ $Revision$ +# NetHack 3.5 Makefile.bcc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.bcc $Date: 2011/10/11 02:37:22 $ $Revision: 1.46 $ # Copyright (c) NetHack PC Development Team 1993-2010 # # diff --git a/sys/winnt/Makefile.gcc b/sys/winnt/Makefile.gcc index a6e618386..eb436fbf2 100644 --- a/sys/winnt/Makefile.gcc +++ b/sys/winnt/Makefile.gcc @@ -1,4 +1,5 @@ -# NetHack 3.5 Makefile.gcc $Date$ $Revision$ +# NetHack 3.5 Makefile.gcc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.gcc $Date: 2011/10/11 02:37:22 $ $Revision: 1.38 $ # Copyright (c) NetHack PC Development Team 1993-2010 # # NetHack 3.5.x Makefile for MinGW diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index c4d013c0a..4d2b4c066 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -1,4 +1,5 @@ -# NetHack 3.5 Makefile.msc $Date$ $Revision$ +# NetHack 3.5 Makefile.msc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.msc $Date: 2012/04/14 00:38:09 $ $Revision: 1.54 $ # Copyright (c) NetHack PC Development Team 1993-2012 # # NetHack 3.5.x Makefile for MS Visual Studio Visual C++ compiler diff --git a/sys/winnt/console.rc b/sys/winnt/console.rc index 1f3824561..e76d9cdd3 100644 --- a/sys/winnt/console.rc +++ b/sys/winnt/console.rc @@ -1,5 +1,7 @@ -/* NetHack 3.5 console.rc $Date$ $Revision$ */ -/* SCCS Id: @(#)console.rc 3.5 $Date$ */ +/* NetHack 3.5 console.rc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 console.rc $Date: 2009/05/06 10:53:27 $ $Revision: 1.7 $ */ +/* SCCS Id: @(#)console.rc 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)console.rc 3.5 $Date: 2009/05/06 10:53:27 $ */ /* Copyright (c) Yitzhak Sapir, 2002. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/winnt/nh340key.c b/sys/winnt/nh340key.c index e42b9b8ae..1506bbfd7 100644 --- a/sys/winnt/nh340key.c +++ b/sys/winnt/nh340key.c @@ -1,5 +1,7 @@ -/* NetHack 3.5 nh340key.c $Date$ $Revision$ */ -/* SCCS Id: @(#)nh340key.c 3.5 $Date$ */ +/* NetHack 3.5 nh340key.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 nh340key.c $Date: 2009/05/06 10:53:29 $ $Revision: 1.7 $ */ +/* SCCS Id: @(#)nh340key.c 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)nh340key.c 3.5 $Date: 2009/05/06 10:53:29 $ */ /* Copyright (c) NetHack PC Development Team 2003 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/winnt/nhdefkey.c b/sys/winnt/nhdefkey.c index caae7b09c..3f40c0c38 100644 --- a/sys/winnt/nhdefkey.c +++ b/sys/winnt/nhdefkey.c @@ -1,5 +1,7 @@ -/* NetHack 3.5 nhdefkey.c $Date$ $Revision$ */ -/* SCCS Id: @(#)nhdefkey.c 3.5 $Date$ */ +/* NetHack 3.5 nhdefkey.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 nhdefkey.c $Date: 2009/05/06 10:53:29 $ $Revision: 1.10 $ */ +/* SCCS Id: @(#)nhdefkey.c 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)nhdefkey.c 3.5 $Date: 2009/05/06 10:53:29 $ */ /* Copyright (c) NetHack PC Development Team 2003 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/winnt/nhraykey.c b/sys/winnt/nhraykey.c index 73a4ed0ec..9c5d2b7a3 100644 --- a/sys/winnt/nhraykey.c +++ b/sys/winnt/nhraykey.c @@ -1,5 +1,7 @@ -/* NetHack 3.5 nhraykey.c $Date$ $Revision$ */ -/* SCCS Id: @(#)nhraykey.c 3.5 $Date$ */ +/* NetHack 3.5 nhraykey.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 nhraykey.c $Date: 2009/05/06 10:53:31 $ $Revision: 1.8 $ */ +/* SCCS Id: @(#)nhraykey.c 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)nhraykey.c 3.5 $Date: 2009/05/06 10:53:31 $ */ /* Copyright (c) NetHack PC Development Team 2003 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/winnt/nhsetup.bat b/sys/winnt/nhsetup.bat old mode 100755 new mode 100644 index c1324c35d..b4b4757a1 --- a/sys/winnt/nhsetup.bat +++ b/sys/winnt/nhsetup.bat @@ -1,4 +1,5 @@ -@REM NetHack 3.5 nhsetup.bat $Date$ $Revision$ */ +@REM NetHack 3.5 nhsetup.bat $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +@REM NetHack 3.5 nhsetup.bat $Date: 2010/09/05 14:22:16 $ $Revision: 1.21 $ */ @REM Copyright (c) NetHack PC Development Team 1993-2010 @REM NetHack may be freely redistributed. See license for details. @REM Win32 setup batch file, see Install.nt for details diff --git a/sys/winnt/ntsound.c b/sys/winnt/ntsound.c index c3008eb2e..0c2f1763d 100644 --- a/sys/winnt/ntsound.c +++ b/sys/winnt/ntsound.c @@ -1,5 +1,7 @@ -/* NetHack 3.5 ntsound.c $Date$ $Revision$ */ -/* SCCS Id: @(#)ntsound.c 3.5 $Date$ */ +/* NetHack 3.5 ntsound.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 ntsound.c $Date: 2009/05/06 10:53:33 $ $Revision: 1.7 $ */ +/* SCCS Id: @(#)ntsound.c 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)ntsound.c 3.5 $Date: 2009/05/06 10:53:33 $ */ /* Copyright (c) NetHack PC Development Team 1993 */ /* NetHack may be freely redistributed. See license for details. */ /* */ diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 39144e4ae..765d95142 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -1,5 +1,7 @@ -/* NetHack 3.5 nttty.c $Date$ $Revision$ */ -/* SCCS Id: @(#)nttty.c 3.5 $Date$ */ +/* NetHack 3.5 nttty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 nttty.c $Date: 2009/05/06 10:53:34 $ $Revision: 1.54 $ */ +/* SCCS Id: @(#)nttty.c 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)nttty.c 3.5 $Date: 2009/05/06 10:53:34 $ */ /* Copyright (c) NetHack PC Development Team 1993 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/winnt/win32api.h b/sys/winnt/win32api.h index 84d040560..3ea9f0598 100644 --- a/sys/winnt/win32api.h +++ b/sys/winnt/win32api.h @@ -1,5 +1,7 @@ -/* NetHack 3.5 win32api.h $Date$ $Revision$ */ -/* SCCS Id: @(#)win32api.h 3.5 $Date$ */ +/* NetHack 3.5 win32api.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 win32api.h $Date: 2009/05/06 10:53:39 $ $Revision: 1.6 $ */ +/* SCCS Id: @(#)win32api.h 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)win32api.h 3.5 $Date: 2009/05/06 10:53:39 $ */ /* Copyright (c) NetHack PC Development Team 1996 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/winnt/winnt.c b/sys/winnt/winnt.c index 0817e4858..e63db103b 100644 --- a/sys/winnt/winnt.c +++ b/sys/winnt/winnt.c @@ -1,5 +1,7 @@ -/* NetHack 3.5 winnt.c $Date$ $Revision$ */ -/* SCCS Id: @(#)winnt.c 3.5 $Date$ */ +/* NetHack 3.5 winnt.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winnt.c $Date: 2012/01/15 19:11:41 $ $Revision: 1.18 $ */ +/* SCCS Id: @(#)winnt.c 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)winnt.c 3.5 $Date: 2012/01/15 19:11:41 $ */ /* Copyright (c) NetHack PC Development Team 1993, 1994 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/util/dgn_comp.l b/util/dgn_comp.l index 19e1546da..5841d0e7c 100644 --- a/util/dgn_comp.l +++ b/util/dgn_comp.l @@ -1,5 +1,6 @@ %{ -/* NetHack 3.5 dgn_comp.l $Date$ $Revision$ */ +/* NetHack 3.5 dgn_comp.l $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dgn_comp.l $Date: 2009/05/06 10:54:26 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)dgn_lex.c 3.5 2002/03/27 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1990 by M. Stephenson */ diff --git a/util/dgn_comp.y b/util/dgn_comp.y index 83dbf78a5..eec4fa496 100644 --- a/util/dgn_comp.y +++ b/util/dgn_comp.y @@ -1,5 +1,6 @@ %{ -/* NetHack 3.5 dgn_comp.y $Date$ $Revision$ */ +/* NetHack 3.5 dgn_comp.y $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dgn_comp.y $Date: 2009/05/06 10:54:26 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)dgn_comp.c 3.5 1996/06/22 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1990 by M. Stephenson */ diff --git a/util/dgn_main.c b/util/dgn_main.c index 5d1cccb32..2544755c3 100644 --- a/util/dgn_main.c +++ b/util/dgn_main.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dgn_main.c $Date$ $Revision$ */ +/* NetHack 3.5 dgn_main.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dgn_main.c $Date: 2009/05/06 10:54:27 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)dgn_main.c 3.5 1994/09/23 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1990 by M. Stephenson */ diff --git a/util/dlb_main.c b/util/dlb_main.c index 8821139b3..17025570b 100644 --- a/util/dlb_main.c +++ b/util/dlb_main.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dlb_main.c $Date$ $Revision$ */ +/* NetHack 3.5 dlb_main.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dlb_main.c $Date: 2012/01/16 03:56:08 $ $Revision: 1.6 $ */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/util/lev_comp.l b/util/lev_comp.l index e3bd584d7..2b0ad5188 100644 --- a/util/lev_comp.l +++ b/util/lev_comp.l @@ -1,5 +1,6 @@ %{ -/* NetHack 3.5 lev_comp.l $Date$ $Revision$ */ +/* NetHack 3.5 lev_comp.l $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev_comp.l $Date: 2009/05/06 10:54:31 $ $Revision: 1.9 $ */ /* SCCS Id: @(#)lev_lex.c 3.5 2002/03/27 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/util/lev_comp.y b/util/lev_comp.y index 7cb7df25d..c2fe15fb6 100644 --- a/util/lev_comp.y +++ b/util/lev_comp.y @@ -1,5 +1,6 @@ %{ -/* NetHack 3.5 lev_comp.y $Date$ $Revision$ */ +/* NetHack 3.5 lev_comp.y $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev_comp.y $Date: 2009/05/06 10:54:31 $ $Revision: 1.8 $ */ /* SCCS Id: @(#)lev_yacc.c 3.5 2007/08/01 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/util/lev_main.c b/util/lev_main.c index 6cc9d4f35..d192e1e3e 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 lev_main.c $Date$ $Revision$ */ +/* NetHack 3.5 lev_main.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev_main.c $Date: 2012/01/12 04:48:12 $ $Revision: 1.20 $ */ /* SCCS Id: @(#)lev_main.c 3.5 2007/01/17 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/util/makedefs.c b/util/makedefs.c index 1f8752893..d84e1c7ea 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 makedefs.c $Date$ $Revision$ */ +/* NetHack 3.5 makedefs.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 makedefs.c $Date: 2012/01/15 09:27:03 $ $Revision: 1.50 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) M. Stephenson, 1990, 1991. */ /* Copyright (c) Dean Luick, 1990. */ diff --git a/util/mdgrep.h b/util/mdgrep.h index a70e1d645..b2515aa86 100644 --- a/util/mdgrep.h +++ b/util/mdgrep.h @@ -1,5 +1,6 @@ /* - * NetHack 3.5 mdgrep.h $Date$ $Revision$ + * NetHack 3.5 mdgrep.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * NetHack 3.5 mdgrep.h $Date: 2010/05/01 20:57:17 $ $Revision: 1.5 $ * Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008 * NetHack may be freely redistributed. See license for details. * diff --git a/util/mdgrep.pl b/util/mdgrep.pl index d291b1464..10038fdc7 100644 --- a/util/mdgrep.pl +++ b/util/mdgrep.pl @@ -1,5 +1,5 @@ #!perl -# NetHack 3.5 mdgrep.pl $NHDT-Date: 1423877528 2015/02/14 01:32:08 $ $NHDT-Revision: 1.7 $ +# NetHack 3.5 mdgrep.pl $NHDT-Date: 1423877528 2015/02/14 01:32:08 $ $NHDT-Branch$:$NHDT-Revision: 1.7 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland # NetHack may be freely redistributed. See license for details. @@ -56,6 +56,7 @@ $outfile = "mdgrep.h"; sub start_file { ($rev) = ('$NHDT-Revision: 1.7 $') =~ m/: (.*) .$/; my $date = '$NHDT-Date: 1423877529 2015/02/14 01:32:09 $'; + my $branch = '$NHDT-Branch$'; my $revision = '$NHDT-Revision: 1.7 $'; open(OUT, ">$outfile") || die "open $outfile: $!"; # NB: Date and Revision below will be modified when mdgrep.h is written to @@ -63,7 +64,7 @@ sub start_file { # before generating mdgrep.h and committing that file). print OUT < */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnaskstr.c b/win/gnome/gnaskstr.c index 652f1ddb6..eeeba31a2 100644 --- a/win/gnome/gnaskstr.c +++ b/win/gnome/gnaskstr.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnaskstr.c $Date$ $Revision$ */ +/* NetHack 3.5 gnaskstr.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnaskstr.c $Date: 2009/05/06 10:57:24 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnaskstr.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnaskstr.h b/win/gnome/gnaskstr.h index 16aeb7da8..056434adb 100644 --- a/win/gnome/gnaskstr.h +++ b/win/gnome/gnaskstr.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnaskstr.h $Date$ $Revision$ */ +/* NetHack 3.5 gnaskstr.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnaskstr.h $Date: 2009/05/06 10:57:24 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnaskstr.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnbind.c b/win/gnome/gnbind.c index 14b315392..c48535a26 100644 --- a/win/gnome/gnbind.c +++ b/win/gnome/gnbind.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnbind.c $Date$ $Revision$ */ +/* NetHack 3.5 gnbind.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnbind.c $Date: 2012/01/24 04:26:31 $ $Revision: 1.25 $ */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnbind.h b/win/gnome/gnbind.h index dc1bd5986..e7d9ad3c7 100644 --- a/win/gnome/gnbind.h +++ b/win/gnome/gnbind.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnbind.h $Date$ $Revision$ */ +/* NetHack 3.5 gnbind.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnbind.h $Date: 2012/01/24 04:26:31 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)gnbind.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnglyph.c b/win/gnome/gnglyph.c index c22a2f15b..b4c9547ec 100644 --- a/win/gnome/gnglyph.c +++ b/win/gnome/gnglyph.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnglyph.c $Date$ $Revision$ */ +/* NetHack 3.5 gnglyph.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnglyph.c $Date: 2009/05/06 10:57:29 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)gnglyph.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnglyph.h b/win/gnome/gnglyph.h index 9b49eff92..2f7ea032c 100644 --- a/win/gnome/gnglyph.h +++ b/win/gnome/gnglyph.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnglyph.h $Date$ $Revision$ */ +/* NetHack 3.5 gnglyph.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnglyph.h $Date: 2009/05/06 10:57:30 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnglyph.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnmain.c b/win/gnome/gnmain.c index 7f9a24a6b..45c55ef2f 100644 --- a/win/gnome/gnmain.c +++ b/win/gnome/gnmain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnmain.c $Date$ $Revision$ */ +/* NetHack 3.5 gnmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnmain.c $Date: 2009/05/06 10:57:32 $ $Revision: 1.9 $ */ /* SCCS Id: @(#)gnmain.c 3.5 2008/01/30 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnmain.h b/win/gnome/gnmain.h index 8fd78fe3b..92d7f4bd6 100644 --- a/win/gnome/gnmain.h +++ b/win/gnome/gnmain.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnmain.h $Date$ $Revision$ */ +/* NetHack 3.5 gnmain.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnmain.h $Date: 2009/05/06 10:57:32 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gnmain.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnmap.c b/win/gnome/gnmap.c index f5ea9d107..6f40505a3 100644 --- a/win/gnome/gnmap.c +++ b/win/gnome/gnmap.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnmap.c $Date$ $Revision$ */ +/* NetHack 3.5 gnmap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnmap.c $Date: 2009/05/06 10:57:34 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)gnmap.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* Copyright (C) 1998 by Anthony Taylor */ diff --git a/win/gnome/gnmap.h b/win/gnome/gnmap.h index 31ed17c48..7a1fcd9fc 100644 --- a/win/gnome/gnmap.h +++ b/win/gnome/gnmap.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnmap.h $Date$ $Revision$ */ +/* NetHack 3.5 gnmap.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnmap.h $Date: 2009/05/06 10:57:35 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnmap.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnmenu.c b/win/gnome/gnmenu.c index 2b2ecb587..abe5ed6c1 100644 --- a/win/gnome/gnmenu.c +++ b/win/gnome/gnmenu.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnmenu.c $Date$ $Revision$ */ +/* NetHack 3.5 gnmenu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnmenu.c $Date: 2009/05/06 10:57:36 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)gnmenu.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnmenu.h b/win/gnome/gnmenu.h index 88ed6bca9..6d243ad40 100644 --- a/win/gnome/gnmenu.h +++ b/win/gnome/gnmenu.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnmenu.h $Date$ $Revision$ */ +/* NetHack 3.5 gnmenu.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnmenu.h $Date: 2009/05/06 10:57:39 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gnmenu.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnmesg.c b/win/gnome/gnmesg.c index b213fc819..ab75c0cd1 100644 --- a/win/gnome/gnmesg.c +++ b/win/gnome/gnmesg.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnmesg.c $Date$ $Revision$ */ +/* NetHack 3.5 gnmesg.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnmesg.c $Date: 2009/05/06 10:57:39 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnmesg.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnmesg.h b/win/gnome/gnmesg.h index 1c35d96cf..7ea0110e0 100644 --- a/win/gnome/gnmesg.h +++ b/win/gnome/gnmesg.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnmesg.h $Date$ $Revision$ */ +/* NetHack 3.5 gnmesg.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnmesg.h $Date: 2009/05/06 10:57:39 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnmesg.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnomeprv.h b/win/gnome/gnomeprv.h index ff3415b58..4062e87d0 100644 --- a/win/gnome/gnomeprv.h +++ b/win/gnome/gnomeprv.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnomeprv.h $Date$ $Revision$ */ +/* NetHack 3.5 gnomeprv.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnomeprv.h $Date: 2009/05/06 10:57:40 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gnomeprv.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnopts.c b/win/gnome/gnopts.c index bbfe63ab6..9c68be769 100644 --- a/win/gnome/gnopts.c +++ b/win/gnome/gnopts.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnopts.c $Date$ $Revision$ */ +/* NetHack 3.5 gnopts.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnopts.c $Date: 2009/05/06 10:57:40 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gnopts.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnopts.h b/win/gnome/gnopts.h index aad71618b..888ded2ba 100644 --- a/win/gnome/gnopts.h +++ b/win/gnome/gnopts.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnopts.h $Date$ $Revision$ */ +/* NetHack 3.5 gnopts.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnopts.h $Date: 2009/05/06 10:57:42 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnopts.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnplayer.c b/win/gnome/gnplayer.c index c0edf69de..cb0ba24e7 100644 --- a/win/gnome/gnplayer.c +++ b/win/gnome/gnplayer.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnplayer.c $Date$ $Revision$ */ +/* NetHack 3.5 gnplayer.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnplayer.c $Date: 2009/05/06 10:57:42 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)gnplayer.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnplayer.h b/win/gnome/gnplayer.h index 88b25e445..d30f44d28 100644 --- a/win/gnome/gnplayer.h +++ b/win/gnome/gnplayer.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnplayer.h $Date$ $Revision$ */ +/* NetHack 3.5 gnplayer.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnplayer.h $Date: 2009/05/06 10:57:44 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gnplayer.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnsignal.c b/win/gnome/gnsignal.c index 8a8586b71..fc3b2b713 100644 --- a/win/gnome/gnsignal.c +++ b/win/gnome/gnsignal.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnsignal.c $Date$ $Revision$ */ +/* NetHack 3.5 gnsignal.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnsignal.c $Date: 2009/05/06 10:57:45 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)gnsignal.c 3.5 2005/11/19 */ /* Copyright (C) 1998 by Anthony Taylor */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnsignal.h b/win/gnome/gnsignal.h index c1f7b08db..b35f4d0af 100644 --- a/win/gnome/gnsignal.h +++ b/win/gnome/gnsignal.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnsignal.h $Date$ $Revision$ */ +/* NetHack 3.5 gnsignal.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnsignal.h $Date: 2009/05/06 10:57:51 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnsignal.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Anthony Taylor */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnstatus.c b/win/gnome/gnstatus.c index 085d6b150..6e3841cc3 100644 --- a/win/gnome/gnstatus.c +++ b/win/gnome/gnstatus.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnstatus.c $Date$ $Revision$ */ +/* NetHack 3.5 gnstatus.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnstatus.c $Date: 2009/05/06 10:57:54 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gnstatus.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnstatus.h b/win/gnome/gnstatus.h index 7746445f3..f6be02de0 100644 --- a/win/gnome/gnstatus.h +++ b/win/gnome/gnstatus.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnstatus.h $Date$ $Revision$ */ +/* NetHack 3.5 gnstatus.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnstatus.h $Date: 2009/05/06 10:57:57 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnstatus.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gntext.c b/win/gnome/gntext.c index 8bc6b6386..8f5734627 100644 --- a/win/gnome/gntext.c +++ b/win/gnome/gntext.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gntext.c $Date$ $Revision$ */ +/* NetHack 3.5 gntext.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gntext.c $Date: 2009/05/06 10:58:00 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gntext.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gntext.h b/win/gnome/gntext.h index 101c32bb4..934b4d05c 100644 --- a/win/gnome/gntext.h +++ b/win/gnome/gntext.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gntext.h $Date$ $Revision$ */ +/* NetHack 3.5 gntext.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gntext.h $Date: 2009/05/06 10:58:03 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gntext.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnyesno.c b/win/gnome/gnyesno.c index b53db8b9d..793663e44 100644 --- a/win/gnome/gnyesno.c +++ b/win/gnome/gnyesno.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnyesno.c $Date$ $Revision$ */ +/* NetHack 3.5 gnyesno.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnyesno.c $Date: 2009/05/06 10:58:06 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnyesno.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnyesno.h b/win/gnome/gnyesno.h index 2c2deb832..93979bf3c 100644 --- a/win/gnome/gnyesno.h +++ b/win/gnome/gnyesno.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnyesno.h $Date$ $Revision$ */ +/* NetHack 3.5 gnyesno.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnyesno.h $Date: 2009/05/06 10:58:08 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnyesno.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/macosx/NetHackGuidebook.applescript b/win/macosx/NetHackGuidebook.applescript index 0060b6d80..4310b1e43 100644 --- a/win/macosx/NetHackGuidebook.applescript +++ b/win/macosx/NetHackGuidebook.applescript @@ -1,5 +1,6 @@ #!/usr/bin/osascript -# NetHack 3.5.0 NetHackGuidebook.applescript $Date$ $Revision$ +# NetHack 3.5.0 NetHackGuidebook.applescript $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5.0 NetHackGuidebook.applescript $Date: 2011/10/17 01:29:20 $ $Revision: 1.2 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2011 # NetHack may be freely redistributed. See license for details. diff --git a/win/macosx/NetHackRecover.applescript b/win/macosx/NetHackRecover.applescript index 93d792208..50569656e 100644 --- a/win/macosx/NetHackRecover.applescript +++ b/win/macosx/NetHackRecover.applescript @@ -1,5 +1,6 @@ #!/usr/bin/osascript -# NetHack 3.5 NetHackRecover.applescript $Date$ $Revision$ +# NetHack 3.5 NetHackRecover.applescript $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 NetHackRecover.applescript $Date: 2011/10/17 01:29:20 $ $Revision: 1.3 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009 # NetHack may be freely redistributed. See license for details. diff --git a/win/macosx/NetHackTerm.applescript b/win/macosx/NetHackTerm.applescript index 648128096..c8274ebc5 100644 --- a/win/macosx/NetHackTerm.applescript +++ b/win/macosx/NetHackTerm.applescript @@ -1,5 +1,6 @@ #!/usr/bin/osascript -# NetHack 3.5.0 NetHackTerm.applescript $Date$ $Revision$ +# NetHack 3.5.0 NetHackTerm.applescript $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5.0 NetHackTerm.applescript $Date: 2011/10/17 01:29:20 $ $Revision: 1.2 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2011 # NetHack may be freely redistributed. See license for details. diff --git a/win/macosx/recover.pl b/win/macosx/recover.pl old mode 100755 new mode 100644 index 65aa68dfc..95b299cf9 --- a/win/macosx/recover.pl +++ b/win/macosx/recover.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl -# NetHack 3.5 recover.pl $Date$ $Revision$ +# NetHack 3.5 recover.pl $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 recover.pl $Date: 2011/10/17 01:29:20 $ $Revision: 1.3 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009 # NetHack may be freely redistributed. See license for details. diff --git a/win/share/ppmwrite.c b/win/share/ppmwrite.c index c20e02c1e..32b98373f 100644 --- a/win/share/ppmwrite.c +++ b/win/share/ppmwrite.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 ppmwrite.c $Date$ $Revision$ */ +/* NetHack 3.5 ppmwrite.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 ppmwrite.c $Date: 2009/05/06 10:59:00 $ $Revision: 1.2 $ */ /* this produces a raw ppm file, with a 15-character header of * "P6 3-digit-width 3-digit-height 255\n" */ diff --git a/win/share/thintile.c b/win/share/thintile.c index 10ac899ed..def85c5af 100644 --- a/win/share/thintile.c +++ b/win/share/thintile.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 thintile.c $Date$ $Revision$ */ +/* NetHack 3.5 thintile.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 thintile.c $Date: 2012/01/10 17:47:40 $ $Revision: 1.5 $ */ /* Copyright (c) NetHack Development Team 1995 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/share/tile.doc b/win/share/tile.doc index c3b24e68f..7b776813c 100644 --- a/win/share/tile.doc +++ b/win/share/tile.doc @@ -1,4 +1,5 @@ -NetHack 3.5 tile.doc $Date$ $Revision$ +NetHack 3.5 tile.doc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +NetHack 3.5 tile.doc $Date: 2009/05/06 10:59:00 $ $Revision: 1.2 $ Window ports can optionally make use of the tiles (pictures for NetHack symbols) found in this directory. They are distributed in a text format diff --git a/win/share/tile.h b/win/share/tile.h index e2249414f..037f7f95f 100644 --- a/win/share/tile.h +++ b/win/share/tile.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 tile.h $Date$ $Revision$ */ +/* NetHack 3.5 tile.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tile.h $Date: 2009/05/06 21:59:39 $ $Revision: 1.6 $ */ typedef unsigned char pixval; typedef struct pixel_s { diff --git a/win/share/tile2bmp.c b/win/share/tile2bmp.c index 775c2ff68..fde808967 100644 --- a/win/share/tile2bmp.c +++ b/win/share/tile2bmp.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 tile2bmp.c $Date$ $Revision$ */ +/* NetHack 3.5 tile2bmp.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tile2bmp.c $Date: 2009/05/06 10:59:00 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)tile2bmp.c 3.5 2002/03/14 */ /* Copyright (c) NetHack PC Development Team 1995 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/share/tilemap.c b/win/share/tilemap.c index ab118cad1..87423f49c 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 tilemap.c $Date$ $Revision$ */ +/* NetHack 3.5 tilemap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tilemap.c $Date: 2009/05/06 10:59:02 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)tilemap.c 3.5 2000/06/04 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/share/tiletext.c b/win/share/tiletext.c index f17716251..d8a9c41db 100644 --- a/win/share/tiletext.c +++ b/win/share/tiletext.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 tiletext.c $Date$ $Revision$ */ +/* NetHack 3.5 tiletext.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tiletext.c $Date: 2009/05/06 10:59:03 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)tiletext.c 3.5 1999/10/24 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/tty/getline.c b/win/tty/getline.c index 60d97e7fe..6dfa10a6e 100644 --- a/win/tty/getline.c +++ b/win/tty/getline.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 getline.c $Date$ $Revision$ */ +/* NetHack 3.5 getline.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 getline.c $Date: 2011/12/11 01:54:56 $ $Revision: 1.18 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/tty/termcap.c b/win/tty/termcap.c index d3bd5d661..563491c48 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 termcap.c $Date$ $Revision$ */ +/* NetHack 3.5 termcap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 termcap.c $Date: 2009/05/06 10:59:19 $ $Revision: 1.13 $ */ /* SCCS Id: @(#)termcap.c 3.5 2007/12/12 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/tty/topl.c b/win/tty/topl.c index ed735f375..3efb52696 100644 --- a/win/tty/topl.c +++ b/win/tty/topl.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 topl.c $Date$ $Revision$ */ +/* NetHack 3.5 topl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 topl.c $Date: 2012/01/23 06:29:37 $ $Revision: 1.24 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 1d56f49ad..12ec044b3 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 wintty.c $Date$ $Revision$ */ +/* NetHack 3.5 wintty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wintty.c $Date: 2012/01/22 06:27:09 $ $Revision: 1.66 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhaskyn.c b/win/win32/mhaskyn.c index a46e0f0ad..db682be28 100644 --- a/win/win32/mhaskyn.c +++ b/win/win32/mhaskyn.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhaskyn.c $Date$ $Revision$ */ +/* NetHack 3.5 mhaskyn.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhaskyn.c $Date: 2009/05/06 10:59:46 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mhaskyn.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhaskyn.h b/win/win32/mhaskyn.h index cc91a02ec..5b0863b6e 100644 --- a/win/win32/mhaskyn.h +++ b/win/win32/mhaskyn.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhaskyn.h $Date$ $Revision$ */ +/* NetHack 3.5 mhaskyn.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhaskyn.h $Date: 2009/05/06 10:59:46 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mhaskyn.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhdlg.c b/win/win32/mhdlg.c index e2c68833e..dbac91bc5 100644 --- a/win/win32/mhdlg.c +++ b/win/win32/mhdlg.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhdlg.c $Date$ $Revision$ */ +/* NetHack 3.5 mhdlg.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhdlg.c $Date: 2012/01/11 01:45:02 $ $Revision: 1.18 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhdlg.h b/win/win32/mhdlg.h index 608810bc0..2c726ce9a 100644 --- a/win/win32/mhdlg.h +++ b/win/win32/mhdlg.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhdlg.h $Date$ $Revision$ */ +/* NetHack 3.5 mhdlg.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhdlg.h $Date: 2012/01/11 01:15:36 $ $Revision: 1.5 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhfont.c b/win/win32/mhfont.c index 23ae7770e..cfbec944e 100644 --- a/win/win32/mhfont.c +++ b/win/win32/mhfont.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhfont.c $Date$ $Revision$ */ +/* NetHack 3.5 mhfont.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhfont.c $Date: 2009/05/06 10:59:46 $ $Revision: 1.17 $ */ /* SCCS Id: @(#)mhfont.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhfont.h b/win/win32/mhfont.h index 9017da9d7..f097b9e38 100644 --- a/win/win32/mhfont.h +++ b/win/win32/mhfont.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhfont.h $Date$ $Revision$ */ +/* NetHack 3.5 mhfont.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhfont.h $Date: 2009/05/06 10:59:46 $ $Revision: 1.8 $ */ /* SCCS Id: @(#)mhfont.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhinput.c b/win/win32/mhinput.c index 99789fb14..92ea84364 100644 --- a/win/win32/mhinput.c +++ b/win/win32/mhinput.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhinput.c $Date$ $Revision$ */ +/* NetHack 3.5 mhinput.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhinput.c $Date: 2009/05/06 10:59:48 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)mhinput.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhinput.h b/win/win32/mhinput.h index 75ce3639d..d06c7b8f9 100644 --- a/win/win32/mhinput.h +++ b/win/win32/mhinput.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhinput.h $Date$ $Revision$ */ +/* NetHack 3.5 mhinput.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhinput.h $Date: 2009/05/06 10:59:49 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)mhinput.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmain.c b/win/win32/mhmain.c index 8473f498b..b8a2dac10 100644 --- a/win/win32/mhmain.c +++ b/win/win32/mhmain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmain.c $Date$ $Revision$ */ +/* NetHack 3.5 mhmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmain.c $Date: 2012/01/11 01:53:44 $ $Revision: 1.49 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmain.h b/win/win32/mhmain.h index bd5cebd76..7a6593d5e 100644 --- a/win/win32/mhmain.h +++ b/win/win32/mhmain.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmain.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmain.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmain.h $Date: 2009/05/06 10:59:52 $ $Revision: 1.10 $ */ /* SCCS Id: @(#)mhmain.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmap.c b/win/win32/mhmap.c index c4ac00b03..ff1a43fb1 100644 --- a/win/win32/mhmap.c +++ b/win/win32/mhmap.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmap.c $Date$ $Revision$ */ +/* NetHack 3.5 mhmap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmap.c $Date: 2012/01/11 01:45:02 $ $Revision: 1.37 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmap.h b/win/win32/mhmap.h index 23be87fa6..54a614730 100644 --- a/win/win32/mhmap.h +++ b/win/win32/mhmap.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmap.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmap.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmap.h $Date: 2009/05/06 10:59:56 $ $Revision: 1.10 $ */ /* SCCS Id: @(#)mhmap.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmenu.c b/win/win32/mhmenu.c index 181caa446..e39470dc1 100644 --- a/win/win32/mhmenu.c +++ b/win/win32/mhmenu.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmenu.c $Date$ $Revision$ */ +/* NetHack 3.5 mhmenu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmenu.c $Date: 2012/01/11 01:53:44 $ $Revision: 1.36 $ */ /* Copyright (c) Alex Kompel, 2002 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmenu.h b/win/win32/mhmenu.h index 258c457eb..658a94a5b 100644 --- a/win/win32/mhmenu.h +++ b/win/win32/mhmenu.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmenu.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmenu.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmenu.h $Date: 2009/05/06 11:00:00 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mhmenu.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmsg.h b/win/win32/mhmsg.h index 42a012ed2..8030b4391 100644 --- a/win/win32/mhmsg.h +++ b/win/win32/mhmsg.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmsg.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmsg.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmsg.h $Date: 2009/05/06 11:00:00 $ $Revision: 1.9 $ */ /* SCCS Id: @(#)mhmsg.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmsgwnd.c b/win/win32/mhmsgwnd.c index 3266ae071..a1ca24ba3 100644 --- a/win/win32/mhmsgwnd.c +++ b/win/win32/mhmsgwnd.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmsgwnd.c $Date$ $Revision$ */ +/* NetHack 3.5 mhmsgwnd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmsgwnd.c $Date: 2012/01/11 01:45:02 $ $Revision: 1.25 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmsgwnd.h b/win/win32/mhmsgwnd.h index d3513c97c..68ca53baf 100644 --- a/win/win32/mhmsgwnd.h +++ b/win/win32/mhmsgwnd.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmsgwnd.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmsgwnd.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmsgwnd.h $Date: 2009/05/06 11:00:10 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mhmsgwnd.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhrip.c b/win/win32/mhrip.c index bdae4c45f..87ac9d9b8 100644 --- a/win/win32/mhrip.c +++ b/win/win32/mhrip.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhrip.c $Date$ $Revision$ */ +/* NetHack 3.5 mhrip.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhrip.c $Date: 2012/01/11 01:45:02 $ $Revision: 1.13 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhrip.h b/win/win32/mhrip.h index c05542dfd..4c2927c2c 100644 --- a/win/win32/mhrip.h +++ b/win/win32/mhrip.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhrip.h $Date$ $Revision$ */ +/* NetHack 3.5 mhrip.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhrip.h $Date: 2009/05/06 11:00:15 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)mhrip.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhsplash.c b/win/win32/mhsplash.c index 63ec10d88..fe14ff256 100644 --- a/win/win32/mhsplash.c +++ b/win/win32/mhsplash.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhsplash.c $Date$ $Revision$ */ +/* NetHack 3.5 mhsplash.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhsplash.c $Date: 2012/01/11 01:15:37 $ $Revision: 1.17 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhstatus.c b/win/win32/mhstatus.c index 2900e52f9..1ce6043ef 100644 --- a/win/win32/mhstatus.c +++ b/win/win32/mhstatus.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhstatus.c $Date$ $Revision$ */ +/* NetHack 3.5 mhstatus.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhstatus.c $Date: 2012/01/11 01:45:02 $ $Revision: 1.14 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhstatus.h b/win/win32/mhstatus.h index 5455a9505..273db526f 100644 --- a/win/win32/mhstatus.h +++ b/win/win32/mhstatus.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhstatus.h $Date$ $Revision$ */ +/* NetHack 3.5 mhstatus.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhstatus.h $Date: 2009/05/06 11:00:19 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mhstatus.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhtext.c b/win/win32/mhtext.c index 2c16f0c2d..4925b8b72 100644 --- a/win/win32/mhtext.c +++ b/win/win32/mhtext.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhtext.c $Date$ $Revision$ */ +/* NetHack 3.5 mhtext.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhtext.c $Date: 2012/01/11 01:53:44 $ $Revision: 1.17 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhtext.h b/win/win32/mhtext.h index 21439f052..3cda167db 100644 --- a/win/win32/mhtext.h +++ b/win/win32/mhtext.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhtext.h $Date$ $Revision$ */ +/* NetHack 3.5 mhtext.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhtext.h $Date: 2009/05/06 11:00:26 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mhtext.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index 3dd2a5528..11b109067 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mswproc.c $Date$ $Revision$ */ +/* NetHack 3.5 mswproc.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mswproc.c $Date: 2012/01/24 04:26:33 $ $Revision: 1.71 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/winMS.h b/win/win32/winMS.h index 1e1352670..5b08c8a34 100644 --- a/win/win32/winMS.h +++ b/win/win32/winMS.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 winMS.h $Date$ $Revision$ */ +/* NetHack 3.5 winMS.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winMS.h $Date: 2012/01/24 04:26:33 $ $Revision: 1.28 $ */ /* SCCS Id: @(#)winMS.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/winhack.c b/win/win32/winhack.c index 7134ef902..dd0f6c14a 100644 --- a/win/win32/winhack.c +++ b/win/win32/winhack.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winhack.c $Date$ $Revision$ */ +/* NetHack 3.5 winhack.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winhack.c $Date: 2009/05/06 11:00:43 $ $Revision: 1.32 $ */ /* SCCS Id: @(#)winhack.c 3.5 2006/04/01 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ From 971ff1d4f3cc768bf9af430b35f1f5491719707d Mon Sep 17 00:00:00 2001 From: keni Date: Thu, 26 Feb 2015 09:22:52 -0500 Subject: [PATCH 003/354] Fix lost mode bits. --- sys/msdos/setup.bat | 0 sys/unix/hints/macosx.sh | 0 sys/unix/mkmkfile.sh | 0 sys/unix/nethack.sh | 0 sys/unix/setup.sh | 0 sys/wince/cesetup.bat | 0 sys/winnt/nhsetup.bat | 0 win/macosx/recover.pl | 0 8 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 sys/msdos/setup.bat mode change 100644 => 100755 sys/unix/hints/macosx.sh mode change 100644 => 100755 sys/unix/mkmkfile.sh mode change 100644 => 100755 sys/unix/nethack.sh mode change 100644 => 100755 sys/unix/setup.sh mode change 100644 => 100755 sys/wince/cesetup.bat mode change 100644 => 100755 sys/winnt/nhsetup.bat mode change 100644 => 100755 win/macosx/recover.pl diff --git a/sys/msdos/setup.bat b/sys/msdos/setup.bat old mode 100644 new mode 100755 diff --git a/sys/unix/hints/macosx.sh b/sys/unix/hints/macosx.sh old mode 100644 new mode 100755 diff --git a/sys/unix/mkmkfile.sh b/sys/unix/mkmkfile.sh old mode 100644 new mode 100755 diff --git a/sys/unix/nethack.sh b/sys/unix/nethack.sh old mode 100644 new mode 100755 diff --git a/sys/unix/setup.sh b/sys/unix/setup.sh old mode 100644 new mode 100755 diff --git a/sys/wince/cesetup.bat b/sys/wince/cesetup.bat old mode 100644 new mode 100755 diff --git a/sys/winnt/nhsetup.bat b/sys/winnt/nhsetup.bat old mode 100644 new mode 100755 diff --git a/win/macosx/recover.pl b/win/macosx/recover.pl old mode 100644 new mode 100755 From b598c83767743bd92986059907f10b8c0d7185a9 Mon Sep 17 00:00:00 2001 From: keni Date: Thu, 26 Feb 2015 16:35:55 -0500 Subject: [PATCH 004/354] Update .gitignore files. --- doc/.gitignore | 1 + util/.gitignore | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 doc/.gitignore diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 000000000..7bdb35836 --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1 @@ +Guidebook diff --git a/util/.gitignore b/util/.gitignore index 43e9f40df..98b003527 100644 --- a/util/.gitignore +++ b/util/.gitignore @@ -8,3 +8,5 @@ lev_yacc.c tile2x11 lev_comp tileedit +dlb +recover From 0109f9715b2e56377a1d52e3a7212d2f613ca458 Mon Sep 17 00:00:00 2001 From: keni Date: Thu, 26 Feb 2015 17:10:11 -0500 Subject: [PATCH 005/354] A batch of manual header var additions. --- win/Qt/Install.Qt | 2 ++ win/X11/Install.X11 | 2 ++ win/X11/NetHack.ad | 3 +++ win/X11/dialogs.c | 3 +++ win/X11/nethack.rc | 2 ++ win/X11/tile2x11.c | 3 +++ win/share/gifread.c | 4 ++++ win/win32/dgnstuff.mak | 3 +++ win/win32/levstuff.mak | 2 ++ win/win32/mhsplash.h | 4 ++++ win/win32/tiles.mak | 3 +++ 11 files changed, 31 insertions(+) diff --git a/win/Qt/Install.Qt b/win/Qt/Install.Qt index bb204568d..28de2c431 100644 --- a/win/Qt/Install.Qt +++ b/win/Qt/Install.Qt @@ -1,5 +1,7 @@ Installing NetHack with a Qt or KDE interface --------------------------------------------- +$NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$Date: 2004/07/01 18:21:51 $ $Revision: 1.7 $ This document describes the installation of NetHack with a Qt interface on UNIX/X11 or Mac OS X. This code should also work with Qt/Windows, but diff --git a/win/X11/Install.X11 b/win/X11/Install.X11 index f26cbb72f..4473616bc 100644 --- a/win/X11/Install.X11 +++ b/win/X11/Install.X11 @@ -1,3 +1,5 @@ +$NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$Date: 2007/12/13 20:17:11 $ $Revision: 1.6 $ This document describes the installation of NetHack with an X11 interface. diff --git a/win/X11/NetHack.ad b/win/X11/NetHack.ad index f6f43be27..e6bff9721 100644 --- a/win/X11/NetHack.ad +++ b/win/X11/NetHack.ad @@ -1,3 +1,6 @@ +! $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +! $Date: 2003/10/03 02:09:25 $ $Revision: 1.5 $ + ! The display_file, tombstone, and menu windows are all formatted assuming ! a fixed width font. Text windows may or may not be formatted as above. ! The rip window applies if the GRAPHIC_TOMBSTONE option is turned on, and diff --git a/win/X11/dialogs.c b/win/X11/dialogs.c index a887ef0c7..21552921d 100644 --- a/win/X11/dialogs.c +++ b/win/X11/dialogs.c @@ -39,6 +39,9 @@ * + Added workaround for SYSV include problem. * + Changed the default width response text widget to be as wide as the * window itself. Suggestion from David E. Wexelblat, dwex@goblin.org. + * + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2002/03/31 17:11:23 $ $Revision: 1.2 $ */ #ifndef SYSV diff --git a/win/X11/nethack.rc b/win/X11/nethack.rc index e0124f325..18fa2ac8d 100644 --- a/win/X11/nethack.rc +++ b/win/X11/nethack.rc @@ -1,5 +1,7 @@ # # Nethack configuration file. +# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# $Date: 2007/12/13 20:17:11 $ $Revision: 1.2 $ # # Naming this file $(HOME)/.nethackrc (for UNIX) or setting the environment # variable NETHACKOPTIONS to point to its full path name elsewhere tells diff --git a/win/X11/tile2x11.c b/win/X11/tile2x11.c index a2542135d..ebfd3bd9b 100644 --- a/win/X11/tile2x11.c +++ b/win/X11/tile2x11.c @@ -1,6 +1,9 @@ /* * Convert the given input files into an output file that is expected * by nethack. + * + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2002/03/17 20:02:47 $ $Revision: 1.2 $ * * Assumptions: * + Two dimensional byte arrays are in row order and are not padded diff --git a/win/share/gifread.c b/win/share/gifread.c index 9757227ea..824393af9 100644 --- a/win/share/gifread.c +++ b/win/share/gifread.c @@ -12,6 +12,10 @@ /* | provided "as is" without express or implied warranty. | */ /* +-------------------------------------------------------------------+ */ +/* + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2002/01/05 21:06:02 $ $Revision: 1.1 $ + */ #include "config.h" #include "tile.h" diff --git a/win/win32/dgnstuff.mak b/win/win32/dgnstuff.mak index 8e5aa81fa..a23aadfd8 100644 --- a/win/win32/dgnstuff.mak +++ b/win/win32/dgnstuff.mak @@ -1,3 +1,6 @@ +# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# $Date: 2002/01/22 22:54:54 $ $Revision: 1.3 $ + #Set all of these or none of them #YACC = byacc.exe #LEX = flex.exe diff --git a/win/win32/levstuff.mak b/win/win32/levstuff.mak index c7540c4bd..cf749c6ce 100644 --- a/win/win32/levstuff.mak +++ b/win/win32/levstuff.mak @@ -1,3 +1,5 @@ +# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# $Date:2002/01/22 22:54:54 $ $Revision: 1.2 $ #YACC = byacc.exe #LEX = flex.exe #YTABC = y_tab.c diff --git a/win/win32/mhsplash.h b/win/win32/mhsplash.h index da6143c54..7d8ab4eb4 100644 --- a/win/win32/mhsplash.h +++ b/win/win32/mhsplash.h @@ -1,5 +1,9 @@ /* Copyright (C) 2002 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ +/* +$NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$Date: 2003/03/03 23:31:36 $ $Revision: 1.3 $ +*/ #ifndef MSWINSplashWindow_h #define MSWINSplashWindow_h diff --git a/win/win32/tiles.mak b/win/win32/tiles.mak index 26af1eada..0e76e1c53 100644 --- a/win/win32/tiles.mak +++ b/win/win32/tiles.mak @@ -1,3 +1,6 @@ +#$NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +#$Date: 2002/01/18 12:55:00 $ $Revision: 1.1 $ + default: all all: ..\win\win32\tiles.bmp From 7d9ea49e929da5966c62d7724d6673b1355c687a Mon Sep 17 00:00:00 2001 From: keni Date: Thu, 26 Feb 2015 17:43:47 -0500 Subject: [PATCH 006/354] Another batch of manual header var additions --- sys/share/NetHack.cnf | 3 +++ sys/share/random.c | 3 +++ sys/share/uudecode.c | 2 ++ sys/unix/README.linux | 3 +++ sys/unix/depend.awk | 2 ++ sys/vms/install.com | 3 +++ sys/vms/nethack.com | 3 +++ sys/vms/spec_lev.com | 3 +++ sys/vms/vmsbuild.com | 2 ++ sys/wince/mhmenu.h | 4 ++++ sys/wince/winmain.c | 3 +++ sys/winnt/defaults.nh | 3 +++ win/gem/Install.gem | 3 +++ win/gem/bitmfile.c | 4 ++++ win/gem/gr_rect.h | 4 ++++ win/gem/load_img.c | 4 ++++ win/gnome/gnworn.c | 4 ++++ win/gnome/gnworn.h | 4 ++++ 18 files changed, 57 insertions(+) diff --git a/sys/share/NetHack.cnf b/sys/share/NetHack.cnf index 9b30b0b4d..29d8ce910 100644 --- a/sys/share/NetHack.cnf +++ b/sys/share/NetHack.cnf @@ -1,6 +1,9 @@ # NetHack Copyright (c) NetHack PC Development Team 1993 - 2006 # NetHack may be freely redistributed. See license for details. # +# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# $Date: 2006/09/23 04:40:09 $ $Revision: 1.7 $ +# # A '#' at the beginning of a line means the rest of the line is a comment. # # Some options MUST be set in this file, other options can be toggled while diff --git a/sys/share/random.c b/sys/share/random.c index 6905f48aa..ba1937bb4 100644 --- a/sys/share/random.c +++ b/sys/share/random.c @@ -32,6 +32,9 @@ * - remove useless variable `j' from srandom() * - cast result of pointer subtraction to long since ptrdiff_t could * be bigger than that and trigger warnings when assigning to long + * + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2007/12/23 00:59:25 $ $Revision: 1.2 $ */ #include "hack.h" diff --git a/sys/share/uudecode.c b/sys/share/uudecode.c index 8da6e714f..440bcaf14 100644 --- a/sys/share/uudecode.c +++ b/sys/share/uudecode.c @@ -41,6 +41,8 @@ * Modified 08 July 2006 to cast strlen() result to int to suppress a * warning on platforms where size_t > sizeof(int). * + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2006/07/09 16:42:21 $ $Revision: 1.4 $ */ #ifndef lint diff --git a/sys/unix/README.linux b/sys/unix/README.linux index e214f423d..e79359392 100644 --- a/sys/unix/README.linux +++ b/sys/unix/README.linux @@ -1,5 +1,8 @@ NetHack 3.5.0 Linux Elf +$NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$Date: 2005/01/02 17:17:28 $ $Revision: 1.16 $ + This README provides the instructions for using the official Linux binary, system platform requirements, as well as steps used to create that binary. The same steps can be used from the source distribution to create a similar diff --git a/sys/unix/depend.awk b/sys/unix/depend.awk index 47d107325..f78e24484 100644 --- a/sys/unix/depend.awk +++ b/sys/unix/depend.awk @@ -1,5 +1,7 @@ # depend.awk -- awk script used to construct makefile dependencies # for nethack's source files (`make depend' support for Makefile.src). +# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# $Date: 2005/12/15 03:42:52 $ $Revision: 1.3 $ # # usage: # cd src ; nawk -f depend.awk ../include/*.h list-of-.c/.cpp-files diff --git a/sys/vms/install.com b/sys/vms/install.com index aec87fe05..3cf0fc590 100755 --- a/sys/vms/install.com +++ b/sys/vms/install.com @@ -1,5 +1,8 @@ $ ! vms/install.com -- set up nethack 'playground' $ ! +$ ! $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$ ! $Date: 2006/09/23 04:45:56 $ $Revision: 1.4 $ +$ ! $ ! Use vmsbuild.com to create nethack.exe, makedefs, and lev_comp *first*. $ ! $ ! Edit this file to define gamedir & gameuic, or else invoke it with two diff --git a/sys/vms/nethack.com b/sys/vms/nethack.com index 164852f6c..93c76be11 100755 --- a/sys/vms/nethack.com +++ b/sys/vms/nethack.com @@ -1,6 +1,9 @@ $! NetHack.Com -- sample command procedure for invoking NetHack 9-JAN-1993 $ v = 'f$verify(0)' $! +$! $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$! $Date: 2002/01/05 21:06:00 $ $Revision: 1.1 $ +$! $! Possible command line arguments include $! "-uConan-B" !play a barbarian named Conan $! "-u" "Merlin-W" !play a wizard named Merlin (slight variant of above) diff --git a/sys/vms/spec_lev.com b/sys/vms/spec_lev.com index 9076933c2..fc680b572 100755 --- a/sys/vms/spec_lev.com +++ b/sys/vms/spec_lev.com @@ -1,5 +1,8 @@ $ ! sys/vms/spec_lev.com -- preprocess nethack's special level compiler code $ ! +$ ! $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$ ! $Date: 2002/01/05 21:06:00 $ $Revision: 1.1 $ +$ ! $ ! This operation needs to be performed prior to executing vmsbuild.com. $ ! Process the scanning and parsing code for NetHack's special level $ ! and dungeon compilers. *.l and *.y are converted into *'.c and *.h. diff --git a/sys/vms/vmsbuild.com b/sys/vms/vmsbuild.com index 20b4f01f4..b754601a5 100755 --- a/sys/vms/vmsbuild.com +++ b/sys/vms/vmsbuild.com @@ -1,5 +1,7 @@ $ ! vms/vmsbuild.com -- compile and link NetHack 3.5.* [pr] $ version_number = "3.5.0" +$ ! $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$ ! $Date: 2011/05/23 03:27:10 $ $Revision: 1.8 $ $ ! $ ! usage: $ ! $ set default [.src] !or [-.-.src] if starting from [.sys.vms] diff --git a/sys/wince/mhmenu.h b/sys/wince/mhmenu.h index 15c4759ac..e1ec643f5 100644 --- a/sys/wince/mhmenu.h +++ b/sys/wince/mhmenu.h @@ -1,4 +1,8 @@ /* NetHack may be freely redistributed. See license for details. */ +/* + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2002/07/22 03:19:13 $ $Revision: 1.1 $ + */ #ifndef MSWINMenuWindow_h #define MSWINMenuWindow_h diff --git a/sys/wince/winmain.c b/sys/wince/winmain.c index 0bb3d67b9..1d1a29a4b 100644 --- a/sys/wince/winmain.c +++ b/sys/wince/winmain.c @@ -1,4 +1,7 @@ // winmain.cpp : Defines the entry point for the application. +// +// $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +// $Date: 2002/12/18 03:51:34 $ $Revision: 1.2 $ #include "winMS.h" #include diff --git a/sys/winnt/defaults.nh b/sys/winnt/defaults.nh index 425edbf69..9de67ee85 100644 --- a/sys/winnt/defaults.nh +++ b/sys/winnt/defaults.nh @@ -6,6 +6,9 @@ # # To change the configuration, comment out the unwanted lines, and # uncomment the configuration you want. +# +# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# $Date: 2006/09/23 04:40:15 $ $Revision: 1.16 $ # *** OPTIONS *** # diff --git a/win/gem/Install.gem b/win/gem/Install.gem index 3880fe0dc..38c5740dd 100644 --- a/win/gem/Install.gem +++ b/win/gem/Install.gem @@ -1,3 +1,6 @@ +$NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$Date: 2005/01/02 17:20:12 $ $Revision: 1.4 $ + Hi, This is nethack3.5.0 for Atari Gem and tty diff --git a/win/gem/bitmfile.c b/win/gem/bitmfile.c index 13e0073a9..fe6ccf5f4 100644 --- a/win/gem/bitmfile.c +++ b/win/gem/bitmfile.c @@ -7,6 +7,10 @@ * Bieber, Dez. 1994 * * -> Programmcode * \****************************/ +/* + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2002/01/05 21:06:00 $ $Revision: 1.1 $ + */ #include #include diff --git a/win/gem/gr_rect.h b/win/gem/gr_rect.h index 0e4a0bdc8..3927340f6 100644 --- a/win/gem/gr_rect.h +++ b/win/gem/gr_rect.h @@ -1,4 +1,8 @@ /* gr_rect.h */ +/* + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2002/03/20 03:50:49 $ $Revision: 1.1 $ + */ #include /********** structs **********/ typedef struct { diff --git a/win/gem/load_img.c b/win/gem/load_img.c index 16d8fe82c..fe995d6f5 100644 --- a/win/gem/load_img.c +++ b/win/gem/load_img.c @@ -1,3 +1,7 @@ +/* + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2002/03/20 03:45:03 $ $Revision: 1.2 $ + */ #define __TCC_COMPAT__ #include #include diff --git a/win/gnome/gnworn.c b/win/gnome/gnworn.c index dce035a94..20a8aa641 100644 --- a/win/gnome/gnworn.c +++ b/win/gnome/gnworn.c @@ -1,4 +1,8 @@ /* NetHack 3.5 gnworn.c 2009/05/06 10:58:06 1.3 */ +/* + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2012/01/10 17:47:38 $ $Revision: 1.4 $ + */ /* Copyright (C) 2002, Dylan Alex Simon */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnworn.h b/win/gnome/gnworn.h index db5169508..14e1a4fc9 100644 --- a/win/gnome/gnworn.h +++ b/win/gnome/gnworn.h @@ -1,4 +1,8 @@ /* NetHack 3.5 gnworn.h 2009/05/06 10:58:06 1.3 */ +/* + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2012/01/10 17:47:38 $ $Revision: 1.4 $ + */ /* Copyright (C) 2002 by Dylan Alex Simon */ /* NetHack may be freely redistributed. See license for details. */ From 264dc66129eba8a2759884f9f264ccc5cda98f87 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 13 Feb 2015 16:58:59 -0500 Subject: [PATCH 007/354] Make ELBERETH unconditional. --- dat/oracles.txt | 2 +- include/config.h | 2 -- include/extern.h | 2 -- include/you.h | 2 -- src/cmd.c | 2 -- src/engrave.c | 2 -- src/monmove.c | 2 -- src/pray.c | 8 -------- src/u_init.c | 4 ---- util/makedefs.c | 17 ++++------------- 10 files changed, 5 insertions(+), 38 deletions(-) diff --git a/dat/oracles.txt b/dat/oracles.txt index bee2b4b30..d307c7a9f 100644 --- a/dat/oracles.txt +++ b/dat/oracles.txt @@ -96,7 +96,7 @@ The gods are said to be pleased when offerings are given to the priests who attend their temples, and they may grant various favors to those who do so. But beware! To be young and frugal is better than to be old and miserly. ------ ELBERETH +----- The name of Elbereth may strike fear into the hearts of thine enemies, if thou dost write it upon the ground at thy feet. If thou maintainest the utmost calm, thy safety will be aided greatly, but beware lest thy clumsy diff --git a/include/config.h b/include/config.h index 6db03c2c0..b1e69992c 100644 --- a/include/config.h +++ b/include/config.h @@ -427,8 +427,6 @@ typedef unsigned char uchar; #define SEDUCE /* Succubi/incubi seduction, by KAA, suggested by IM */ #define STEED /* Riding steeds */ #define TOURIST /* Tourist players with cameras and Hawaiian shirts */ -/* difficulty */ -#define ELBERETH /* Engraving the E-word repels monsters */ /* I/O */ #define REDO /* support for redoing last command - DGK */ #if !defined(MAC) diff --git a/include/extern.h b/include/extern.h index ac5fdb1ec..216b94e6f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -670,9 +670,7 @@ E void FDECL(cant_reach_floor, (int,int,BOOLEAN_P,BOOLEAN_P)); E const char *FDECL(surface, (int,int)); E const char *FDECL(ceiling, (int,int)); E struct engr *FDECL(engr_at, (XCHAR_P,XCHAR_P)); -#ifdef ELBERETH E int FDECL(sengr_at, (const char *,XCHAR_P,XCHAR_P)); -#endif E void FDECL(u_wipe_engr, (int)); E void FDECL(wipe_engr_at, (XCHAR_P,XCHAR_P,XCHAR_P)); E void FDECL(read_engr_at, (int,int)); diff --git a/include/you.h b/include/you.h index 50798acdb..b316abcf7 100644 --- a/include/you.h +++ b/include/you.h @@ -47,9 +47,7 @@ struct u_event { Bitfield(invoked,1); /* invoked Gate to the Sanctum level */ Bitfield(gehennom_entered,1); /* entered Gehennom via Valley */ -#ifdef ELBERETH Bitfield(uhand_of_elbereth,2); /* became Hand of Elbereth */ -#endif Bitfield(udemigod,1); /* killed the wiz */ Bitfield(uvibrated,1); /* stepped on "vibrating square" */ Bitfield(ascended,1); /* has offered the Amulet */ diff --git a/src/cmd.c b/src/cmd.c index eae24508c..3c8eff341 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1785,7 +1785,6 @@ int final; putstr(en_win, 0, ""); putstr(en_win, 0, final ? "Final Attributes:" : "Current Attributes:"); -#ifdef ELBERETH if (u.uevent.uhand_of_elbereth) { static const char * const hofe_titles[3] = { "the Hand of Elbereth", @@ -1794,7 +1793,6 @@ int final; }; you_are(hofe_titles[u.uevent.uhand_of_elbereth - 1],""); } -#endif /* note: piousness 20 matches MIN_QUEST_ALIGN (quest.h) */ if (u.ualign.record >= 20) you_are("piously aligned",""); diff --git a/src/engrave.c b/src/engrave.c index c4bdd4496..4af701654 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -244,7 +244,6 @@ xchar x, y; return((struct engr *) 0); } -#ifdef ELBERETH /* Decide whether a particular string is engraved at a specified * location; a case-insensitive substring match used. * Ignore headstones, in case the player names herself "Elbereth". @@ -259,7 +258,6 @@ sengr_at(s, x, y) return (ep && ep->engr_type != HEADSTONE && ep->engr_time <= moves && strstri(ep->engr_txt, s) != 0); } -#endif /* ELBERETH */ void u_wipe_engr(cnt) diff --git a/src/monmove.c b/src/monmove.c index 4b6ffc26f..a7e0da3d2 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -122,9 +122,7 @@ struct monst *mtmp; return(FALSE); return (boolean)(sobj_at(SCR_SCARE_MONSTER, x, y) || -#ifdef ELBERETH sengr_at("Elbereth", x, y) || -#endif (IS_ALTAR(levl[x][y].typ) && (mtmp->data->mlet == S_VAMPIRE || is_vampshifter(mtmp)))); diff --git a/src/pray.c b/src/pray.c index a6bd75ba4..602abee59 100644 --- a/src/pray.c +++ b/src/pray.c @@ -11,9 +11,7 @@ STATIC_DCL int NDECL(in_trouble); STATIC_DCL void FDECL(fix_worst_trouble,(int)); STATIC_DCL void FDECL(angrygods,(ALIGNTYP_P)); STATIC_DCL void FDECL(at_your_feet, (const char *)); -#ifdef ELBERETH STATIC_DCL void NDECL(gcrownu); -#endif /*ELBERETH*/ STATIC_DCL void FDECL(pleased,(ALIGNTYP_P)); STATIC_DCL void FDECL(godvoice,(ALIGNTYP_P,const char*)); STATIC_DCL void FDECL(god_zaps_you,(ALIGNTYP_P)); @@ -678,7 +676,6 @@ at_your_feet(str) } } -#ifdef ELBERETH STATIC_OVL void gcrownu() { @@ -830,7 +827,6 @@ gcrownu() add_weapon_skill(1); return; } -#endif /*ELBERETH*/ STATIC_OVL void pleased(g_align) @@ -1052,12 +1048,10 @@ pleased(g_align) } case 7: case 8: -#ifdef ELBERETH if (u.ualign.record >= PIOUS && !u.uevent.uhand_of_elbereth) { gcrownu(); break; } /* else FALLTHRU */ -#endif /*ELBERETH*/ case 6: { struct obj *otmp; int sp_no, trycnt = u.ulevel + 1; @@ -1090,9 +1084,7 @@ pleased(g_align) u.ublesscnt = rnz(350); kick_on_butt = u.uevent.udemigod ? 1 : 0; -#ifdef ELBERETH if (u.uevent.uhand_of_elbereth) kick_on_butt++; -#endif if (kick_on_butt) u.ublesscnt += kick_on_butt * rnz(1000); return; diff --git a/src/u_init.c b/src/u_init.c index 4e5927397..59ba3c23a 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -540,9 +540,7 @@ u_init() u.ublessed = 0; /* not worthy yet */ u.ugangr = 0; /* gods not angry */ u.ugifts = 0; /* no divine gifts bestowed */ -# ifdef ELBERETH u.uevent.uhand_of_elbereth = 0; -# endif u.uevent.uheard_tune = 0; u.uevent.uopened_dbridge = 0; u.uevent.udemigod = 0; /* not a demi-god yet... */ @@ -917,9 +915,7 @@ register struct trobj *trop; || otyp == nocreate2 || otyp == nocreate3 || otyp == nocreate4 -#ifdef ELBERETH || otyp == RIN_LEVITATION -#endif /* 'useless' items */ || otyp == POT_HALLUCINATION || otyp == POT_ACID diff --git a/util/makedefs.c b/util/makedefs.c index d84e1c7ea..dbedfe45b 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -961,8 +961,8 @@ do_rumors() */ #define IGNORED_FEATURES ( 0L \ | (1L << 12) /* GOLDOBJ */ \ - | (1L << 20) /* EXP_ON_BOTL */ \ - | (1L << 21) /* SCORE_ON_BOTL */ \ + | (1L << 19) /* EXP_ON_BOTL */ \ + | (1L << 20) /* SCORE_ON_BOTL */ \ | (1L << 27) /* ZEROCOMP */ \ | (1L << 28) /* RLECOMP */ \ ) @@ -1018,14 +1018,11 @@ make_version() #ifdef INSURANCE | (1L << 18) #endif -#ifdef ELBERETH +#ifdef EXP_ON_BOTL | (1L << 19) #endif -#ifdef EXP_ON_BOTL - | (1L << 20) -#endif #ifdef SCORE_ON_BOTL - | (1L << 21) + | (1L << 20) #endif /* data format (27..31) * External compression methods such as COMPRESS and ZLIB_COMP @@ -1257,9 +1254,6 @@ static const char *build_opts[] = { #ifdef DUNGEON_OVERVIEW "dungeon map overview patch", #endif -#ifdef ELBERETH - "Elbereth", -#endif #ifdef EXP_ON_BOTL "experience points on status line", #endif @@ -1684,9 +1678,6 @@ h_filter(line) skip = FALSE; #ifndef SINKS if (!strcmp(tag, "SINKS")) skip = TRUE; -#endif -#ifndef ELBERETH - if (!strcmp(tag, "ELBERETH")) skip = TRUE; #endif } else if (skip && !strncmp(line, "-----", 5)) skip = FALSE; From 9e657589478f00625b00600079171ce518420858 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 13 Feb 2015 21:23:56 -0500 Subject: [PATCH 008/354] Make STEED unconditional. --- include/config.h | 1 - include/display.h | 4 -- include/extern.h | 2 - include/hack.h | 2 - include/prop.h | 2 - include/rm.h | 4 -- include/skills.h | 4 -- include/you.h | 2 - include/youprop.h | 8 ---- src/allmain.c | 2 - src/apply.c | 42 +++--------------- src/artifact.c | 7 +-- src/attrib.c | 7 +-- src/ball.c | 5 +-- src/cmd.c | 17 +------- src/dig.c | 2 - src/display.c | 4 +- src/do.c | 22 ++-------- src/do_name.c | 10 ----- src/dog.c | 14 ------ src/dogmove.c | 16 ++----- src/dokick.c | 2 - src/dothrow.c | 2 - src/dungeon.c | 2 - src/eat.c | 12 +----- src/engrave.c | 2 - src/explode.c | 4 -- src/hack.c | 78 ++++++---------------------------- src/invent.c | 11 +---- src/lock.c | 12 +----- src/mhitm.c | 10 +---- src/mhitu.c | 12 +----- src/mon.c | 23 ++-------- src/mondata.c | 2 - src/objects.c | 4 -- src/objnam.c | 6 +-- src/pager.c | 2 - src/pickup.c | 4 -- src/pline.c | 7 +-- src/polyself.c | 2 - src/potion.c | 36 +++------------- src/pray.c | 10 +---- src/read.c | 5 +-- src/restore.c | 10 +---- src/save.c | 8 ---- src/shk.c | 18 +++----- src/sit.c | 2 - src/sounds.c | 12 +++--- src/steal.c | 40 ++++++++---------- src/steed.c | 5 --- src/teleport.c | 11 +---- src/timeout.c | 8 ---- src/trap.c | 101 +++----------------------------------------- src/u_init.c | 18 -------- src/uhitm.c | 20 ++------- src/weapon.c | 8 ---- src/wield.c | 16 ++----- src/worn.c | 6 --- src/zap.c | 18 +------- util/makedefs.c | 8 +--- win/gnome/gnmain.c | 2 - win/share/tilemap.c | 3 -- 62 files changed, 98 insertions(+), 641 deletions(-) diff --git a/include/config.h b/include/config.h index b1e69992c..715fc746a 100644 --- a/include/config.h +++ b/include/config.h @@ -425,7 +425,6 @@ typedef unsigned char uchar; /* monsters & objects */ #define KOPS /* Keystone Kops by Scott R. Turner */ #define SEDUCE /* Succubi/incubi seduction, by KAA, suggested by IM */ -#define STEED /* Riding steeds */ #define TOURIST /* Tourist players with cameras and Hawaiian shirts */ /* I/O */ #define REDO /* support for redoing last command - DGK */ diff --git a/include/display.h b/include/display.h index 59135b014..94ee1a15c 100644 --- a/include/display.h +++ b/include/display.h @@ -198,12 +198,8 @@ * Display the hero. It is assumed that all checks necessary to determine * _if_ the hero can be seen have already been done. */ -#ifdef STEED #define maybe_display_usteed (u.usteed && mon_visible(u.usteed)) ? \ ridden_mon_to_glyph(u.usteed) : -#else -#define maybe_display_usteed /* empty */ -#endif #define display_self() \ show_glyph(u.ux, u.uy, \ diff --git a/include/extern.h b/include/extern.h index 216b94e6f..866da61ec 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2205,7 +2205,6 @@ E struct obj *FDECL(findgold, (struct obj *)); /* ### steed.c ### */ -#ifdef STEED E void NDECL(rider_cant_reach); E boolean FDECL(can_saddle, (struct monst *)); E int FDECL(use_saddle, (struct obj *)); @@ -2217,7 +2216,6 @@ E void NDECL(kick_steed); E void FDECL(dismount_steed, (int)); E void FDECL(place_monster, (struct monst *,int,int)); E boolean FDECL(stucksteed, (BOOLEAN_P)); -#endif /* ### teleport.c ### */ diff --git a/include/hack.h b/include/hack.h index dc24bf8f9..c88d8dd56 100644 --- a/include/hack.h +++ b/include/hack.h @@ -38,7 +38,6 @@ #define BY_PAPER 2 #define BY_OTHER 9 -#ifdef STEED /* Macros for why you are no longer riding */ #define DISMOUNT_GENERIC 0 #define DISMOUNT_FELL 1 @@ -47,7 +46,6 @@ #define DISMOUNT_ENGULFED 4 #define DISMOUNT_BONES 5 #define DISMOUNT_BYCHOICE 6 -#endif /* Special returns from mapglyph() */ #define MG_CORPSE 0x01 diff --git a/include/prop.h b/include/prop.h index 810a730bc..2ca7b871d 100644 --- a/include/prop.h +++ b/include/prop.h @@ -114,9 +114,7 @@ struct prop { # define W_RINGR 0x00040000L /* Right ring */ # define W_RING (W_RINGL | W_RINGR) # define W_TOOL 0x00080000L /* Eyewear */ -#ifdef STEED # define W_SADDLE 0x00100000L /* KMH -- For riding monsters */ -#endif # define W_BALL 0x00200000L /* Punishment ball */ # define W_CHAIN 0x00400000L /* Punishment chain */ diff --git a/include/rm.h b/include/rm.h index 589ba619e..fbd7470cf 100644 --- a/include/rm.h +++ b/include/rm.h @@ -593,10 +593,6 @@ extern dlevel_t level; /* structure describing the current level */ !(level.monsters[x][y])->mburied) #define MON_BURIED_AT(x,y) (level.monsters[x][y] != (struct monst *)0 && \ (level.monsters[x][y])->mburied) -#ifndef STEED -#define place_monster(m,x,y) ((m)->mx=(x),(m)->my=(y),\ - level.monsters[(m)->mx][(m)->my]=(m)) -#endif #define place_worm_seg(m,x,y) level.monsters[x][y] = m #define remove_monster(x,y) level.monsters[x][y] = (struct monst *)0 #define m_at(x,y) (MON_AT(x,y) ? level.monsters[x][y] : \ diff --git a/include/skills.h b/include/skills.h index d2221e7fb..df5105e1b 100644 --- a/include/skills.h +++ b/include/skills.h @@ -68,12 +68,8 @@ #define P_BARE_HANDED_COMBAT 36 /* actually weaponless; gloves are ok */ #define P_MARTIAL_ARTS P_BARE_HANDED_COMBAT /* Role distinguishes */ #define P_TWO_WEAPON_COMBAT 37 /* Finally implemented */ -#ifdef STEED #define P_RIDING 38 /* How well you control your steed */ #define P_LAST_H_TO_H P_RIDING -#else -#define P_LAST_H_TO_H P_TWO_WEAPON_COMBAT -#endif #define P_FIRST_H_TO_H P_BARE_HANDED_COMBAT #define P_NUM_SKILLS (P_LAST_H_TO_H+1) diff --git a/include/you.h b/include/you.h index b316abcf7..c010abcb0 100644 --- a/include/you.h +++ b/include/you.h @@ -348,11 +348,9 @@ struct you { long usleep; /* sleeping; monstermove you last started */ int uinvault; struct monst *ustuck; -#ifdef STEED struct monst *usteed; long ugallop; int urideturns; -#endif int umortality; /* how many times you died */ int ugrave_arise; /* you die and become something aside from a ghost */ int weapon_slots; /* unused skill slots */ diff --git a/include/youprop.h b/include/youprop.h index 04c3349a3..a29e20bf8 100644 --- a/include/youprop.h +++ b/include/youprop.h @@ -229,13 +229,9 @@ #define HFlying u.uprops[FLYING].intrinsic #define EFlying u.uprops[FLYING].extrinsic #define BFlying u.uprops[FLYING].blocked -#ifdef STEED # define Flying ((HFlying || EFlying || \ (u.usteed && is_flyer(u.usteed->data))) && \ !BFlying) -#else -# define Flying ((HFlying || EFlying) && !BFlying) -#endif /* May touch surface; does not override any others */ #define Wwalking (u.uprops[WWALKING].extrinsic && \ @@ -245,12 +241,8 @@ #define HSwimming u.uprops[SWIMMING].intrinsic #define ESwimming u.uprops[SWIMMING].extrinsic /* [Tom] */ -#ifdef STEED # define Swimming (HSwimming || ESwimming || \ (u.usteed && is_swimmer(u.usteed->data))) -#else -# define Swimming (HSwimming || ESwimming) -#endif /* Get wet, don't go under water unless if amphibious */ #define HMagical_breathing u.uprops[MAGICAL_BREATHING].intrinsic diff --git a/src/allmain.c b/src/allmain.c index 51afc75f6..447aff1d8 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -118,12 +118,10 @@ boolean resuming; (void) makemon((struct permonst *)0, 0, 0, NO_MM_FLAGS); /* calculate how much time passed. */ -#ifdef STEED if (u.usteed && u.umoved) { /* your speed doesn't augment steed's speed */ moveamt = mcalcmove(u.usteed); } else -#endif { moveamt = youmonst.data->mmove; diff --git a/src/apply.c b/src/apply.c index fb97cc8fa..a5a38dd8a 100644 --- a/src/apply.c +++ b/src/apply.c @@ -302,7 +302,6 @@ use_stethoscope(obj) context.stethoscope_move = moves; context.stethoscope_movement = youmonst.movement; -#ifdef STEED if (u.usteed && u.dz > 0) { if (interference) { pline("%s interferes.", Monnam(u.ustuck)); @@ -311,7 +310,6 @@ use_stethoscope(obj) mstatusline(u.usteed); return res; } else -#endif if (u.uswallow && (u.dx || u.dy || u.dz)) { mstatusline(u.ustuck); return res; @@ -442,11 +440,9 @@ struct obj *obj; for(mtmp = fmon; mtmp; mtmp = nextmon) { nextmon = mtmp->nmon; /* trap might kill mon */ if (DEADMONSTER(mtmp)) continue; -#ifdef STEED /* steed is already at your location, so not affected; this avoids trap issues if you're on a trap location */ if (mtmp == u.usteed) continue; -#endif if (mtmp->mtame) { if (mtmp->mtrapped) { /* no longer in previous trap (affects mintrap) */ @@ -550,13 +546,11 @@ struct obj *obj; if(!get_adjacent_loc((char *)0, (char *)0, u.ux, u.uy, &cc)) return; if((cc.x == u.ux) && (cc.y == u.uy)) { -#ifdef STEED if (u.usteed && u.dz > 0) { mtmp = u.usteed; spotmon = 1; goto got_target; } -#endif pline("Leash yourself? Very funny..."); return; } @@ -567,9 +561,7 @@ struct obj *obj; } spotmon = canspotmon(mtmp); -#ifdef STEED got_target: -#endif if(!mtmp->mtame) { if(!spotmon) @@ -648,10 +640,8 @@ next_to_u() } } } -#ifdef STEED /* no pack mules for the Amulet */ if (u.usteed && mon_has_amulet(u.usteed)) return FALSE; -#endif return(TRUE); } @@ -1388,12 +1378,10 @@ int magic; /* 0=Physical, otherwise skill level */ } else if (!magic && !Jumping) { You_cant("jump very far."); return 0; -#ifdef STEED /* if steed is immobile, can't do physical jump but can do spell one */ } else if (!magic && u.usteed && stucksteed(FALSE)) { /* stucksteed gave " won't move" message */ return 0; -#endif } else if (u.uswallow) { if (magic) { You("bounce around a little."); @@ -1438,23 +1426,19 @@ int magic; /* 0=Physical, otherwise skill level */ const char *bp = body_part(LEG); if (wl == BOTH_SIDES) bp = makeplural(bp); -#ifdef STEED if (u.usteed) pline("%s is in no shape for jumping.", Monnam(u.usteed)); else -#endif - Your("%s%s %s in no shape for jumping.", - (wl == LEFT_SIDE) ? "left " : - (wl == RIGHT_SIDE) ? "right " : "", - bp, (wl == BOTH_SIDES) ? "are" : "is"); + Your("%s%s %s in no shape for jumping.", + (wl == LEFT_SIDE) ? "left " : + (wl == RIGHT_SIDE) ? "right " : "", + bp, (wl == BOTH_SIDES) ? "are" : "is"); return 0; } -#ifdef STEED else if (u.usteed && u.utrap) { pline("%s is stuck in a trap.", Monnam(u.usteed)); return (0); } -#endif pline("Where do you want to jump?"); cc.x = u.ux; @@ -2237,7 +2221,6 @@ struct obj *otmp; trapinfo.time_needed += (tmp > 12) ? 1 : (tmp > 7) ? 2 : 4; /*[fumbling and/or confusion and/or cursed object check(s) should be incorporated here instead of in set_trap]*/ -#ifdef STEED if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) { boolean chance; @@ -2267,7 +2250,6 @@ struct obj *otmp; return; } } -#endif You("begin setting %s%s.", shk_your(buf, otmp), defsyms[trap_to_defsym(what_trap(ttyp))].explanation); @@ -2369,19 +2351,13 @@ struct obj *obj; } else if ((!u.dx && !u.dy) || (u.dz > 0)) { int dam; -#ifdef STEED /* Sometimes you hit your steed by mistake */ if (u.usteed && !rn2(proficient + 2)) { You("whip %s!", mon_nam(u.usteed)); kick_steed(); return 1; } -#endif - if (Levitation -#ifdef STEED - || u.usteed -#endif - ) { + if (Levitation || u.usteed) { /* Have a shot at snaring something on the floor */ otmp = level.objects[u.ux][u.uy]; if (otmp && otmp->otyp == CORPSE && otmp->corpsenm == PM_HORSE) { @@ -3194,11 +3170,9 @@ doapply() case LEASH: use_leash(obj); break; -#ifdef STEED case SADDLE: res = use_saddle(obj); break; -#endif case MAGIC_WHISTLE: use_magic_whistle(obj); break; @@ -3336,11 +3310,7 @@ unfixable_trouble_count(is_horn) if (Stoned) unfixable_trbl++; if (Strangled) unfixable_trbl++; - if (Wounded_legs -#ifdef STEED - && !u.usteed -#endif - ) unfixable_trbl++; + if (Wounded_legs && !u.usteed) unfixable_trbl++; if (Slimed) unfixable_trbl++; /* lycanthropy is not desirable, but it doesn't actually make you feel bad */ diff --git a/src/artifact.c b/src/artifact.c index 088bc9c66..e9351ba92 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -1687,10 +1687,7 @@ long *abil; long wornbits; long wornmask = (W_ARM | W_ARMC | W_ARMH | W_ARMS | W_ARMG | W_ARMF | W_WEP | W_QUIVER | W_SWAPWEP | W_ART | W_ARTI | W_AMUL | - W_RINGL | W_RINGR | W_TOOL | W_BALL | W_CHAIN -#ifdef STEED - | W_SADDLE -#endif + W_RINGL | W_RINGR | W_TOOL | W_BALL | W_CHAIN | W_SADDLE #ifdef TOURIST | W_ARMU #endif @@ -1868,7 +1865,6 @@ int dropflag; /* 0==don't drop, 1==drop all, 2==drop weapon */ /* check primary weapon next so that they're handled together */ if (uwep) (void)untouchable(uwep, dropit); -#ifdef STEED /* in case someone is daft enough to add artifact or silver saddle */ if (u.usteed && (obj = which_armor(u.usteed, W_SADDLE)) != 0) { /* untouchable() calls retouch_object() which expects an object in @@ -1876,7 +1872,6 @@ int dropflag; /* 0==don't drop, 1==drop all, 2==drop weapon */ saddle and we're suppressing drop, so this works as intended */ if (untouchable(obj, FALSE)) dismount_steed(DISMOUNT_THROWN); } -#endif /* * TODO? Force off gloves if either or both rings are going to * become unworn; force off cloak [suit] before suit [shirt]. diff --git a/src/attrib.c b/src/attrib.c index 0c8ae76a8..15377c76c 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -440,11 +440,8 @@ exerper() if(Sick || Vomiting) exercise(A_CON, FALSE); if(Confusion || Hallucination) exercise(A_WIS, FALSE); - if((Wounded_legs -#ifdef STEED - && !u.usteed -#endif - ) || Fumbling || HStun) exercise(A_DEX, FALSE); + if((Wounded_legs && !u.usteed) || Fumbling || HStun) + exercise(A_DEX, FALSE); } } diff --git a/src/ball.c b/src/ball.c index 78aee97a0..b3513f7b5 100644 --- a/src/ball.c +++ b/src/ball.c @@ -692,10 +692,7 @@ xchar x, y; register long side = rn2(3) ? LEFT_SIDE : RIGHT_SIDE; pline(pullmsg, "bear trap"); set_wounded_legs(side, rn1(1000, 500)); -#ifdef STEED - if (!u.usteed) -#endif - { + if (!u.usteed) { Your("%s %s is severely damaged.", (side == LEFT_SIDE) ? "left" : "right", body_part(LEG)); diff --git a/src/cmd.c b/src/cmd.c index 3c8eff341..78981c274 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1528,7 +1528,6 @@ int final; boolean magic = (mode & MAGICENLIGHTENMENT) ? TRUE : FALSE; int cap; char buf[BUFSZ], youtoo[BUFSZ]; -#ifdef STEED boolean Riding = (u.usteed && /* if hero dies while dismounting, u.usteed will still be set; we want to ignore steed in that situation */ @@ -1540,7 +1539,6 @@ int final; (char *)0, (SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION), FALSE); -#endif /*\ * Status (many are abbreviated on bottom line; others are or @@ -1553,7 +1551,6 @@ int final; /* not a traditional status but inherently obvious to player; more detail given below (attributes section) for magic enlightenment */ if (Upolyd) you_are("transformed", ""); -#ifdef STEED /* not a trouble, but we want to display riding status before maybe reporting steed as trapped or hero stuck to cursed saddle */ if (Riding) { @@ -1561,7 +1558,6 @@ int final; you_are(buf, ""); Sprintf(eos(youtoo), "and %s ", steedname); } -#endif /*STEED*/ /* other movement situations that hero should always know */ if (Levitation) { if (Lev_at_will && magic) @@ -1639,14 +1635,12 @@ int final; Sprintf(eos(predicament), " in %s", an(defsyms[trap_to_defsym(t->ttyp)].explanation)); } -#ifdef STEED if (u.usteed) { /* not `Riding' here */ Sprintf(buf, "%s%s ", anchored ? "you and " : "", steedname); *buf = highc(*buf); enl_msg(buf, (anchored ? "are " : "is "), (anchored ? "were " : "was "), predicament, ""); } else -#endif /*STEED*/ you_are(predicament, ""); } /* (u.utrap) */ if (u.uswallow) { @@ -1661,7 +1655,6 @@ int final; a_monnam(u.ustuck)); you_are(buf, ""); } -#ifdef STEED if (Riding) { struct obj *saddle = which_armor(u.usteed, W_SADDLE); @@ -1671,9 +1664,7 @@ int final; you_are(buf, ""); } } -#endif /*STEED*/ if (Wounded_legs) { -#ifdef STEED /* when mounted, Wounded_legs applies to steed rather than to hero; we only report steed's wounded legs in wizard mode */ if (u.usteed) { /* not `Riding' here */ @@ -1684,9 +1675,7 @@ int final; enl_msg(buf, " has", " had", " wounded legs", ""); } # endif - } else -#endif /*STEED*/ - { + } else { Sprintf(buf, "wounded %s", makeplural(body_part(LEG))); you_have(buf, ""); } @@ -2474,9 +2463,7 @@ static const struct func_tab cmdlist[] = { {'r', FALSE, doread}, {'R', FALSE, doremring}, {M('r'), FALSE, dorub}, -#ifdef STEED {M('R'), FALSE, doride}, /* #ride */ -#endif {'s', TRUE, dosearch, "searching"}, {'S', TRUE, dosave}, {M('s'), FALSE, dosit}, @@ -2553,9 +2540,7 @@ struct ext_func_tab extcmdlist[] = { #endif /* DUNGEON_OVERVIEW */ {"pray", "pray to the gods for help", dopray, TRUE}, {"quit", "exit without saving current game", done2, TRUE}, -#ifdef STEED {"ride", "ride (or stop riding) a monster", doride, FALSE}, -#endif {"rub", "rub a lamp or a stone", dorub, FALSE}, {"sit", "sit down", dosit, FALSE}, {"terrain", "show map without obstructions", doterrain, TRUE}, diff --git a/src/dig.c b/src/dig.c index 382676865..ae4571218 100644 --- a/src/dig.c +++ b/src/dig.c @@ -250,13 +250,11 @@ dig(VOID_ARGS) You("fumble and drop %s.", yname(uwep)); dropx(uwep); } else { -#ifdef STEED if (u.usteed) pline("%s and %s %s!", Yobjnam2(uwep, "bounce"), otense(uwep, "hit"), mon_nam(u.usteed)); else -#endif pline("Ouch! %s and %s you!", Yobjnam2(uwep, "bounce"), otense(uwep, "hit")); set_wounded_legs(RIGHT_SIDE, 5 + rnd(5)); diff --git a/src/display.c b/src/display.c index 8da9af9fe..263dd853a 100644 --- a/src/display.c +++ b/src/display.c @@ -1126,11 +1126,9 @@ see_monsters() warn_obj_cnt = new_warn_obj_cnt; } -#ifdef STEED /* when mounted, hero's location gets caught by monster loop */ if (!u.usteed) -#endif - newsym(u.ux, u.uy); + newsym(u.ux, u.uy); } /* diff --git a/src/do.c b/src/do.c index 6ad4985da..1f51c14cc 100644 --- a/src/do.c +++ b/src/do.c @@ -80,11 +80,9 @@ boolean pushing; char whobuf[BUFSZ]; Strcpy(whobuf, "you"); -#ifdef STEED if (u.usteed) Strcpy(whobuf, y_monnam(u.usteed)); -#endif - pline("%s %s %s into the %s.", upstart(whobuf), - vtense(whobuf, "push"), the(xname(otmp)), what); + pline("%s %s %s into the %s.", upstart(whobuf), + vtense(whobuf, "push"), the(xname(otmp)), what); if (flags.verbose && !Blind) pline("Now you can cross it!"); /* no splashing in this case */ @@ -434,14 +432,12 @@ register const char *word; body_part(HAND)); return(FALSE); } -#ifdef STEED if (obj->owornmask & W_SADDLE) { if (*word) You("cannot %s %s you are sitting on.", word, something); return (FALSE); } -#endif return(TRUE); } @@ -801,11 +797,9 @@ dodown() return 1; } -#ifdef STEED if (stucksteed(TRUE)) { return 0; } -#endif /* Levitation might be blocked, but player can still use '>' to turn off controlled levitaiton */ if (HLevitation || ELevitation) { @@ -924,11 +918,9 @@ doup() You_cant("go up here."); return(0); } -#ifdef STEED if (stucksteed(TRUE)) { return(0); } -#endif if(u.ustuck) { You("are %s, and cannot go up.", !u.uswallow ? "being held" : is_animal(u.ustuck->data) ? @@ -1267,12 +1259,10 @@ boolean at_stairs, falling, portal; freeinv(uball); } } -#ifdef STEED /* falling off steed has its own losehp() call */ if (u.usteed) dismount_steed(DISMOUNT_FELL); else -#endif losehp(Maybe_Half_Phys(rnd(3)), at_ladder ? "falling off a ladder" : "tumbling down a flight of stairs", @@ -1305,11 +1295,7 @@ boolean at_stairs, falling, portal; initrack(); - if ((mtmp = m_at(u.ux, u.uy)) != 0 -#ifdef STEED - && mtmp != u.usteed -#endif - ) { + if ((mtmp = m_at(u.ux, u.uy)) != 0 && mtmp != u.usteed) { /* There's a monster at your target destination; it might be one which accompanied you--see mon_arrive(dogmove.c)--or perhaps it was already here. Randomly move you to an adjacent spot @@ -1746,9 +1732,7 @@ heal_legs() context.botl = 1; } -#ifdef STEED if (!u.usteed) -#endif { const char *legs = body_part(LEG); diff --git a/src/do_name.c b/src/do_name.c index 0c459bd50..ea5b64b8b 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -329,20 +329,16 @@ do_mname() cy = cc.y; if (cx == u.ux && cy == u.uy) { -#ifdef STEED if (u.usteed && canspotmon(u.usteed)) mtmp = u.usteed; else { -#endif pline("This %s creature is called %s and cannot be renamed.", ACURR(A_CHA) > 14 ? (flags.female ? "beautiful" : "handsome") : "ugly", plname); return; -#ifdef STEED } -#endif } else mtmp = m_at(cx, cy); @@ -678,9 +674,7 @@ boolean called; do_it = !canspotmon(mtmp) && article != ARTICLE_YOUR && !program_state.gameover && -#ifdef STEED mtmp != u.usteed && -#endif !(u.uswallow && mtmp == u.ustuck) && !(suppress & SUPPRESS_IT); do_saddle = !(suppress & SUPPRESS_SADDLE); @@ -746,11 +740,9 @@ boolean called; Strcat(strcat(buf, adjective), " "); if (do_invis) Strcat(buf, "invisible "); -#ifdef STEED if (do_saddle && (mtmp->misc_worn_check & W_SADDLE) && !Blind && !Hallucination) Strcat(buf, "saddled "); -#endif if (buf[0] != 0) has_adjectives = TRUE; else @@ -898,10 +890,8 @@ struct monst *mtmp; prefix = mtmp->mtame ? ARTICLE_YOUR : ARTICLE_THE; suppression_flag = (has_mname(mtmp) -#ifdef STEED /* "saddled" is redundant when mounted */ || mtmp == u.usteed -#endif ) ? SUPPRESS_SADDLE : 0; return x_monnam(mtmp, prefix, (char *)0, suppression_flag, FALSE); diff --git a/src/dog.c b/src/dog.c index 0a0162e61..fa9d1f99a 100644 --- a/src/dog.c +++ b/src/dog.c @@ -148,9 +148,7 @@ struct monst * makedog() { register struct monst *mtmp; -#ifdef STEED register struct obj *otmp; -#endif const char *petname; int pettype; static int petname_used = 0; @@ -179,7 +177,6 @@ makedog() if(!mtmp) return((struct monst *) 0); /* pets were genocided */ context.startingpet_mid = mtmp->m_id; -#ifdef STEED /* Horses already wear a saddle */ if (pettype == PM_PONY && !!(otmp = mksobj(SADDLE, TRUE, FALSE))) { if (mpickobj(mtmp, otmp)) @@ -190,7 +187,6 @@ makedog() otmp->leashmon = mtmp->m_id; update_mon_intrinsics(mtmp, otmp, TRUE, TRUE); } -#endif if (!petname_used++ && *petname) mtmp = christen_monst(mtmp, petname); @@ -323,10 +319,8 @@ boolean with_you; mtmp->mtrack[0].x = mtmp->mtrack[0].y = 0; mtmp->mtrack[1].x = mtmp->mtrack[1].y = 0; -#ifdef STEED if (mtmp == u.usteed) return; /* don't place steed on the map */ -#endif if (with_you) { /* When a monster accompanies you, sometimes it will arrive at your intended destination and you'll end up next to @@ -575,24 +569,20 @@ boolean pets_only; /* true for ascension or final escape */ only if in range. -3. */ (u.uhave.amulet && mtmp->iswiz)) && ((!mtmp->msleeping && mtmp->mcanmove) -#ifdef STEED /* eg if level teleport or new trap, steed has no control to avoid following */ || (mtmp == u.usteed) -#endif ) /* monster won't follow if it hasn't noticed you yet */ && !(mtmp->mstrategy & STRAT_WAITFORU)) { stay_behind = FALSE; if (mtmp->mtrapped) (void)mintrap(mtmp); /* try to escape */ -#ifdef STEED if (mtmp == u.usteed) { /* make sure steed is eligible to accompany hero */ mtmp->mtrapped = 0; /* escape trap */ mtmp->meating = 0; /* terminate eating */ mdrop_special_objs(mtmp); /* drop Amulet */ } else -#endif if (mtmp->meating || mtmp->mtrapped) { if (canseemon(mtmp)) pline("%s is still %s.", Monnam(mtmp), @@ -612,14 +602,12 @@ boolean pets_only; /* true for ascension or final escape */ : "Its"); m_unleash(mtmp, FALSE); } -#ifdef STEED if (mtmp == u.usteed) { /* can't happen unless someone makes a change which scrambles the stay_behind logic above */ impossible("steed left behind?"); dismount_steed(DISMOUNT_GENERIC); } -#endif continue; } if (mtmp->isshk) @@ -980,9 +968,7 @@ boolean was_dead; /* a life-saved monster might be leashed; don't leave it that way if it's no longer tame */ if (mtmp->mleashed) m_unleash(mtmp, TRUE); -#ifdef STEED if (mtmp == u.usteed) dismount_steed(DISMOUNT_THROWN); -#endif } else if (edog) { /* it's still a pet; start a clean pet-slate now */ edog->revivals++; diff --git a/src/dogmove.c b/src/dogmove.c index a56ad1066..6baa47651 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -354,11 +354,7 @@ register struct edog *edog; stop_occupation(); } else if (monstermoves > edog->hungrytime + 750 || mtmp->mhp < 1) { dog_died: - if (mtmp->mleashed -#ifdef STEED - && mtmp != u.usteed -#endif - ) + if (mtmp->mleashed && mtmp != u.usteed) Your("leash goes slack."); else if (cansee(mtmp->mx, mtmp->my)) pline("%s starves.", Monnam(mtmp)); @@ -453,11 +449,9 @@ int after, udist, whappr; xchar otyp; int appr; -#ifdef STEED /* Steeds don't move on their own will */ if (mtmp == u.usteed) return (-2); -#endif omx = mtmp->mx; omy = mtmp->my; @@ -626,7 +620,6 @@ register int after; /* this is extra fast monster movement */ if (has_edog && dog_hunger(mtmp, edog)) return(2); /* starved */ udist = distu(omx,omy); -#ifdef STEED /* Let steeds eat and maybe throw rider during Conflict */ if (mtmp == u.usteed) { if (Conflict && !resist(mtmp, RING_CLASS, 0, 0)) { @@ -634,10 +627,9 @@ register int after; /* this is extra fast monster movement */ return (1); } udist = 1; - } else -#endif - /* maybe we tamed him while being swallowed --jgm */ - if (!udist) return(0); + } else if (!udist) + /* maybe we tamed him while being swallowed --jgm */ + return(0); nix = omx; /* set before newdogpos */ niy = omy; diff --git a/src/dokick.c b/src/dokick.c index 424aa6fa1..1b122e799 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -716,7 +716,6 @@ dokick() } else if (verysmall(youmonst.data)) { You("are too small to do any kicking."); no_kick = TRUE; -#ifdef STEED } else if (u.usteed) { if (yn_function("Kick your steed?", ynchars, 'y') == 'y') { You("kick %s.", mon_nam(u.usteed)); @@ -725,7 +724,6 @@ dokick() } else { return 0; } -#endif } else if (Wounded_legs) { /* note: jump() has similar code */ long wl = (EWounded_legs & BOTH_SIDES); diff --git a/src/dothrow.c b/src/dothrow.c index ebd7c97e8..953ff1e35 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -1002,13 +1002,11 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */ u.twoweap = twoweap; } else if (u.dz < 0) { (void) toss_up(obj, rn2(5) && !Underwater); -#ifdef STEED } else if (u.dz > 0 && u.usteed && obj->oclass == POTION_CLASS && rn2(6)) { /* alternative to prayer or wand of opening/spell of knock for dealing with cursed saddle: throw holy water > */ potionhit(u.usteed, obj, TRUE); -#endif } else { hitfloor(obj); } diff --git a/src/dungeon.c b/src/dungeon.c index d9348183c..d87faa15e 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -1148,10 +1148,8 @@ int x, y; #ifdef CLIPPING cliparound(u.ux, u.uy); #endif -#ifdef STEED /* ridden steed always shares hero's location */ if (u.usteed) u.usteed->mx = u.ux, u.usteed->my = u.uy; -#endif /* when changing levels, don't leave old position set with stale values from previous level */ if (!on_level(&u.uz, &u.uz0)) u.ux0 = u.ux, u.uy0 = u.uy; diff --git a/src/eat.c b/src/eat.c index 5b5d1f38e..37561967b 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1017,10 +1017,8 @@ register int pm; u.uconduct.polyselfs++; /* you're changing form */ You_cant("resist the temptation to mimic %s.", Hallucination ? "an orange" : "a pile of gold"); -#ifdef STEED /* A pile of gold can't ride. */ if (u.usteed) dismount_steed(DISMOUNT_FELL); -#endif nomul(-tmp); Sprintf(buf, Hallucination ? "You suddenly dread being peeled and mimic %s again!" : @@ -1540,9 +1538,7 @@ struct obj *obj; what = "you lose control of", where = "yourself"; else what = "you slap against the", where = -#ifdef STEED (u.usteed) ? "saddle" : -#endif surface(u.ux,u.uy); pline_The("world spins and %s %s.", what, where); incr_itimeout(&HDeaf, duration); @@ -2337,11 +2333,7 @@ doeat() /* generic "eat" command funtion (see cmd.c) */ } else if (!is_edible(otmp)) { You("cannot eat that!"); return 0; - } else if ((otmp->owornmask & (W_ARMOR|W_TOOL|W_AMUL -#ifdef STEED - |W_SADDLE -#endif - )) != 0) { + } else if ((otmp->owornmask & (W_ARMOR|W_TOOL|W_AMUL|W_SADDLE)) != 0) { /* let them eat rings */ You_cant("eat %s you're wearing.", something); return 0; @@ -2844,9 +2836,7 @@ floorfood(verb,corpsecheck) /* get food from floor or pack */ /* if we can't touch floor objects then use invent food only */ if (!can_reach_floor(TRUE) || -#ifdef STEED (feeding && u.usteed) || /* can't eat off floor while riding */ -#endif (is_pool_or_lava(u.ux, u.uy) && (Wwalking || is_clinger(youmonst.data) || (Flying && !Breathless)))) diff --git a/src/engrave.c b/src/engrave.c index 4af701654..8ba7217ba 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -140,10 +140,8 @@ boolean check_pit; struct trap *t; if (u.uswallow) return FALSE; -#ifdef STEED /* Restricted/unskilled riders can't reach the floor */ if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) return FALSE; -#endif if (check_pit && (t = t_at(u.ux, u.uy)) != 0 && uteetering_at_seen_pit(t) && !Flying) return FALSE; diff --git a/src/explode.c b/src/explode.c index 54855f70a..65dbe82a5 100644 --- a/src/explode.c +++ b/src/explode.c @@ -167,10 +167,8 @@ int expltype; } /* can be both you and mtmp if you're swallowed */ mtmp = m_at(i+x-1, j+y-1); -#ifdef STEED if (!mtmp && i+x-1 == u.ux && j+y-1 == u.uy) mtmp = u.usteed; -#endif if (mtmp) { if (mtmp->mhp < 1) explmask[i][j] = 2; else switch(adtyp) { @@ -275,10 +273,8 @@ int expltype; type, &shopdamage, exploding_wand_typ); mtmp = m_at(i+x-1, j+y-1); -#ifdef STEED if (!mtmp && i+x-1 == u.ux && j+y-1 == u.uy) mtmp = u.usteed; -#endif if (!mtmp) continue; if (do_hallu) { /* replace "gas spore" with a different description diff --git a/src/hack.c b/src/hack.c index bcb3da1ad..fc62e71a4 100644 --- a/src/hack.c +++ b/src/hack.c @@ -118,11 +118,7 @@ moverock() /* Give them a chance to climb over it? */ return -1; } - if (verysmall(youmonst.data) -#ifdef STEED - && !u.usteed -#endif - ) { + if (verysmall(youmonst.data) && !u.usteed) { if (Blind) feel_location(sx, sy); pline("You're too small to push that %s.", xname(otmp)); goto cannot_push; @@ -159,10 +155,7 @@ moverock() } if (flags.verbose) pline("Perhaps that's why %s cannot move it.", -#ifdef STEED - u.usteed ? y_monnam(u.usteed) : -#endif - "you"); + u.usteed ? y_monnam(u.usteed) : "you"); goto cannot_push; } @@ -231,13 +224,11 @@ moverock() /* trap didn't work; skip "disappears" message */ goto dopush; } -#ifdef STEED if (u.usteed) - pline("%s pushes %s and suddenly it disappears!", - upstart(y_monnam(u.usteed)), the(xname(otmp))); + pline("%s pushes %s and suddenly it disappears!", + upstart(y_monnam(u.usteed)), the(xname(otmp))); else -#endif - You("push %s and suddenly it disappears!", + You("push %s and suddenly it disappears!", the(xname(otmp))); if (ttmp->ttyp == TELEP_TRAP) { (void)rloco(otmp); @@ -279,19 +270,15 @@ moverock() static NEARDATA long lastmovetime; #endif dopush: -#ifdef STEED if (!u.usteed) { -#endif if (moves > lastmovetime+2 || moves < lastmovetime) pline("With %s effort you move %s.", throws_rocks(youmonst.data) ? "little" : "great", the(xname(otmp))); exercise(A_STR, TRUE); -#ifdef STEED } else pline("%s moves %s.", upstart(y_monnam(u.usteed)), the(xname(otmp))); -#endif lastmovetime = moves; } @@ -307,24 +294,19 @@ moverock() } } else { nopushmsg: -#ifdef STEED if (u.usteed) pline("%s tries to move %s, but cannot.", upstart(y_monnam(u.usteed)), the(xname(otmp))); else -#endif You("try to move %s, but in vain.", the(xname(otmp))); if (Blind) feel_location(sx, sy); cannot_push: if (throws_rocks(youmonst.data)) { -#ifdef STEED if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) { You("aren't skilled enough to %s %s from %s.", (flags.pickup && !Sokoban) ? "pick up" : "push aside", the(xname(otmp)), y_monnam(u.usteed)); - } else -#endif - { + } else { pline("However, you can easily %s.", (flags.pickup && !Sokoban) ? "pick it up" : "push it aside"); @@ -334,11 +316,7 @@ moverock() break; } - if ( -#ifdef STEED - !u.usteed && -#endif - (((!invent || inv_weight() <= -850) && + if (!u.usteed && (((!invent || inv_weight() <= -850) && (!u.dx || !u.dy || (IS_ROCK(levl[u.ux][sy].typ) && IS_ROCK(levl[sx][u.uy].typ)))) || verysmall(youmonst.data))) { @@ -693,13 +671,10 @@ int mode; You("try to ooze under the door, but can't squeeze your possessions through."); else if (x == ux || y == uy) { if (Blind || Stunned || ACURR(A_DEX) < 10 || Fumbling) { -#ifdef STEED if (u.usteed) { You_cant("lead %s through that closed door.", y_monnam(u.usteed)); - } else -#endif - { + } else { pline("Ouch! You bump into a door."); exercise(A_DEX, FALSE); } @@ -1001,9 +976,7 @@ struct trap *desttrap; /* nonnull if another trap at */ { boolean anchored; const char *predicament, *culprit; -#ifdef STEED char *steedname = !u.usteed ? (char *)0 : y_monnam(u.usteed); -#endif if (!u.utrap) return TRUE; /* sanity check */ @@ -1011,11 +984,9 @@ struct trap *desttrap; /* nonnull if another trap at */ case TT_BEARTRAP: if (flags.verbose) { predicament = "caught in a bear trap"; -#ifdef STEED if (u.usteed) Norep("%s is %s.", upstart(steedname), predicament); else -#endif Norep("You are %s.", predicament); } /* [why does diagonal movement give quickest escape?] */ @@ -1037,41 +1008,33 @@ struct trap *desttrap; /* nonnull if another trap at */ if (--u.utrap) { if (flags.verbose) { predicament = "stuck to the web"; -#ifdef STEED if (u.usteed) - Norep("%s is %s.", upstart(steedname), predicament); + Norep("%s is %s.", upstart(steedname), predicament); else -#endif - Norep("You are %s.", predicament); + Norep("You are %s.", predicament); } } else { -#ifdef STEED if (u.usteed) pline("%s breaks out of the web.", upstart(steedname)); else -#endif You("disentangle yourself."); } break; case TT_LAVA: if (flags.verbose) { predicament = "stuck in the lava"; -#ifdef STEED if (u.usteed) Norep("%s is %s.", upstart(steedname), predicament); else -#endif Norep("You are %s.", predicament); } if (!is_lava(x, y)) { u.utrap--; if ((u.utrap & 0xff) == 0) { u.utrap = 0; -#ifdef STEED if (u.usteed) You("lead %s to the edge of the lava.", steedname); else -#endif You("pull yourself to the edge of the lava."); } } @@ -1106,7 +1069,6 @@ struct trap *desttrap; /* nonnull if another trap at */ predicament = "stuck in the"; culprit = surface(u.ux, u.uy); } -#ifdef STEED if (u.usteed) { if (anchored) Norep("You and %s are %s %s.", steedname, @@ -1115,16 +1077,13 @@ struct trap *desttrap; /* nonnull if another trap at */ Norep("%s is %s %s.", upstart(steedname), predicament, culprit); } else -#endif - Norep("You are %s %s.", predicament, culprit); + Norep("You are %s %s.", predicament, culprit); } } else { -#ifdef STEED if (u.usteed) pline("%s finally %s free.", upstart(steedname), !anchored ? "lurches" : "wrenches the ball"); else -#endif You("finally %s free.", !anchored ? "wriggle" : "wrench the ball"); if (anchored) @@ -1419,12 +1378,10 @@ domove() newsym(x, y); } /* not attacking an animal, so we try to move */ -#ifdef STEED if ((u.dx || u.dy) && u.usteed && stucksteed(FALSE)) { nomul(0); return; } -#endif if(!youmonst.data->mmove) { You("are rooted %s.", Levitation || Is_airlevel(&u.uz) || Is_waterlevel(&u.uz) ? @@ -1456,14 +1413,12 @@ domove() mtmp = m_at(x, y); u.ux += u.dx; u.uy += u.dy; -#ifdef STEED /* Move your steed, too */ if (u.usteed) { u.usteed->mx = u.ux; u.usteed->my = u.uy; exercise_steed(); } -#endif /* * If safepet at destination then move the pet to the hero's @@ -1662,11 +1617,8 @@ invocation_message() struct obj *otmp = carrying(CANDELABRUM_OF_INVOCATION); nomul(0); /* stop running or travelling */ -#ifdef STEED if (u.usteed) Sprintf(buf, "beneath %s", y_monnam(u.usteed)); - else -#endif - if (Levitation || Flying) Strcpy(buf, "beneath you"); + else if (Levitation || Flying) Strcpy(buf, "beneath you"); else Sprintf(buf, "under your %s", makeplural(body_part(FOOT))); You_feel("a strange vibration %s.", buf); @@ -1752,7 +1704,6 @@ boolean newspot; /* true if called by spoteffects */ /* check for entering water or lava */ if (!u.ustuck && !Levitation && !Flying && is_pool_or_lava(u.ux, u.uy)) { -#ifdef STEED if (u.usteed && (is_flyer(u.usteed->data) || is_floater(u.usteed->data) || is_clinger(u.usteed->data))) { /* floating or clinging steed keeps hero safe (is_flyer() test @@ -1770,7 +1721,6 @@ boolean newspot; /* true if called by spoteffects */ return TRUE; } /* not mounted */ -#endif /* STEED */ /* drown(),lava_effects() return true if hero changes location while surviving the problem */ @@ -2266,10 +2216,8 @@ dopickup() if (!can_reach_floor(TRUE)) { if (traphere && uteetering_at_seen_pit(traphere)) You("cannot reach the bottom of the pit."); -#ifdef STEED else if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) rider_cant_reach(); -#endif else if (Blind && !can_reach_floor(TRUE)) You("cannot reach anything here."); else @@ -2578,9 +2526,7 @@ weight_cap() } if (Levitation || Is_airlevel(&u.uz) /* pugh@cornell */ -#ifdef STEED || (u.usteed && strongmonst(u.usteed->data)) -#endif ) carrcap = MAX_CARR_CAP; else { diff --git a/src/invent.c b/src/invent.c index 12847bc7f..c6eea5989 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1252,10 +1252,7 @@ is_worn(otmp) register struct obj *otmp; { return((boolean)(!!(otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL | -#ifdef STEED - W_SADDLE | -#endif - W_WEP | W_SWAPWEP | W_QUIVER)))); + W_SADDLE | W_WEP | W_SWAPWEP | W_QUIVER)))); } /* extra xprname() input that askchain() can't pass through safe_qbuf() */ @@ -2803,11 +2800,7 @@ STATIC_OVL boolean tool_in_use(obj) struct obj *obj; { - if ((obj->owornmask & (W_TOOL -#ifdef STEED - | W_SADDLE -#endif - )) != 0L) return TRUE; + if ((obj->owornmask & (W_TOOL | W_SADDLE)) != 0L) return TRUE; if (obj->oclass != TOOL_CLASS) return FALSE; return (boolean)(obj == uwep || obj->lamplit || (obj->otyp == LEASH && obj->leashmon)); diff --git a/src/lock.c b/src/lock.c index 45be156f6..6e20e20e6 100644 --- a/src/lock.c +++ b/src/lock.c @@ -749,19 +749,11 @@ doclose() /* try to close a door */ } if(door->doormask == D_ISOPEN) { - if(verysmall(youmonst.data) -#ifdef STEED - && !u.usteed -#endif - ) { + if(verysmall(youmonst.data) && !u.usteed) { pline("You're too small to push the door closed."); return res; } - if ( -#ifdef STEED - u.usteed || -#endif - rn2(25) < (ACURRSTR+ACURR(A_DEX)+ACURR(A_CON))/3) { + if ( u.usteed || rn2(25) < (ACURRSTR+ACURR(A_DEX)+ACURR(A_CON))/3) { pline_The("door closes."); door->doormask = D_CLOSED; if (Blind) diff --git a/src/mhitm.c b/src/mhitm.c index 969a50458..a749cfd4d 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -405,12 +405,10 @@ mattackm(magr, mdef) break; case AT_ENGL: -#ifdef STEED if (u.usteed && (mdef == u.usteed)) { strike = 0; break; } -#endif /* Engulfing attacks are directed at the hero if * possible. -dlc */ @@ -956,11 +954,7 @@ mdamagem(magr, mdef, mattk) if (vis) Strcpy(mdef_Monnam, Monnam(mdef)); mdef->mstrategy &= ~STRAT_WAITFORU; (void) rloc(mdef, FALSE); - if (vis && !canspotmon(mdef) -#ifdef STEED - && mdef != u.usteed -#endif - ) + if (vis && !canspotmon(mdef) && mdef != u.usteed) pline("%s suddenly disappears!", mdef_Monnam); } break; @@ -1117,12 +1111,10 @@ mdamagem(magr, mdef, mattk) Strcpy(mdefnambuf, x_monnam(mdef, ARTICLE_THE, (char *)0, 0, FALSE)); otmp = obj; -#ifdef STEED if (u.usteed == mdef && otmp == which_armor(mdef, W_SADDLE)) /* "You can no longer ride ." */ dismount_steed(DISMOUNT_POLY); -#endif obj_extract_self(otmp); if (otmp->owornmask) { mdef->misc_worn_check &= ~otmp->owornmask; diff --git a/src/mhitu.c b/src/mhitu.c index 0a85b86a7..cf5f68bcd 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -323,7 +323,6 @@ mattacku(mtmp) if(u.uinvulnerable) return (0); /* stomachs can't hurt you! */ } -#ifdef STEED else if (u.usteed) { if (mtmp == u.usteed) /* Your steed won't attack you */ @@ -343,7 +342,6 @@ mattacku(mtmp) return (!!(mattackm(u.usteed, mtmp) & MM_DEF_DIED)); } } -#endif if (u.uundetected && !range2 && foundyou && !u.uswallow) { if (!canspotmon(mtmp)) map_invisible(mtmp->mx, mtmp->my); @@ -1145,11 +1143,7 @@ dopois: * still _can_ attack you when you're flying or mounted. * [FIXME: why can't a flying attacker overcome this?] */ - if ( -#ifdef STEED - u.usteed || -#endif - Levitation || Flying) { + if (u.usteed || Levitation || Flying) { pline("%s tries to reach your %s %s!", Monnam(mtmp), sidestr, body_part(LEG)); dmg = 0; @@ -1664,7 +1658,6 @@ gulpmu(mtmp, mattk) /* monster swallows you, or damage if u.uswallow */ place_monster(mtmp, u.ux, u.uy); u.ustuck = mtmp; newsym(mtmp->mx,mtmp->my); -#ifdef STEED if (is_animal(mtmp->data) && u.usteed) { char buf[BUFSZ]; /* Too many quirks presently if hero and steed @@ -1676,8 +1669,7 @@ gulpmu(mtmp, mattk) /* monster swallows you, or damage if u.uswallow */ Monnam(mtmp), buf); dismount_steed(DISMOUNT_ENGULFED); } else -#endif - pline("%s engulfs you!", Monnam(mtmp)); + pline("%s engulfs you!", Monnam(mtmp)); stop_occupation(); reset_occupations(); /* behave as if you had moved */ diff --git a/src/mon.c b/src/mon.c index e3880eafe..917e919c9 100644 --- a/src/mon.c +++ b/src/mon.c @@ -337,12 +337,10 @@ register struct monst *mtmp; !is_flyer(mtmp->data) && !is_floater(mtmp->data); infountain = IS_FOUNTAIN(levl[mtmp->mx][mtmp->my].typ); -#ifdef STEED /* Flying and levitation keeps our steed out of the liquid */ /* (but not water-walking or swimming) */ if (mtmp == u.usteed && (Flying || Levitation)) return (0); -#endif /* Gremlin multiplying won't go on forever since the hit points * keep going down, and when it gets to 1 hit point the clone @@ -449,15 +447,12 @@ struct monst *mon; else if (mon->mspeed == MFAST) mmove = (4 * mmove + 2) / 3; -#ifdef STEED if (mon == u.usteed) { if (u.ugallop && context.mv) { /* average movement is 1.50 times normal */ mmove = ((rn2(2) ? 4 : 5) * mmove) / 3; } - } else -#endif - if (mmove) { + } else if (mmove) { /* vary movement points allocated to slightly reduce predictability; random increment (avg +2) exceeds random decrement (avg +1) by a small amount; normal speed monsters will occasionally get an @@ -958,10 +953,8 @@ struct obj *otmp; (otyp != BELL_OF_OPENING || !is_covetous(mdat))) return FALSE; -#ifdef STEED /* Steeds don't pick up stuff (to avoid shop abuse) */ if (mtmp == u.usteed) return (FALSE); -#endif if (mtmp->isshk) return(TRUE); /* no limit */ if (mtmp->mpeaceful && !mtmp->mtame) return(FALSE); /* otherwise players might find themselves obligated to violate @@ -1313,10 +1306,8 @@ register struct monst *mtmp, *mtmp2; relmon(mtmp, (struct monst **)0); /* finish adding its replacement */ -#ifdef STEED - if (mtmp == u.usteed) ; else /* don't place steed onto the map */ -#endif - place_monster(mtmp2, mtmp2->mx, mtmp2->my); + if (mtmp != u.usteed) /* don't place steed onto the map */ + place_monster(mtmp2, mtmp2->mx, mtmp2->my); if (mtmp2->wormno) /* update level.monsters[wseg->wx][wseg->wy] */ place_wsegs(mtmp2); /* locations to mtmp2 not mtmp. */ if (emits_light(mtmp2->data)) { @@ -1330,9 +1321,7 @@ register struct monst *mtmp, *mtmp2; mtmp2->nmon = fmon; fmon = mtmp2; if (u.ustuck == mtmp) u.ustuck = mtmp2; -#ifdef STEED if (u.usteed == mtmp) u.usteed = mtmp2; -#endif if (mtmp2->isshk) replshk(mtmp,mtmp2); /* discard the old monster */ @@ -1597,11 +1586,9 @@ register struct monst *mtmp; need to do this after life-saving and before m_detach() */ if (mtmp->isgd && !grddead(mtmp)) return; -#ifdef STEED /* Player is thrown from his steed when it dies */ if (mtmp == u.usteed) dismount_steed(DISMOUNT_GENERIC); -#endif mptr = mtmp->data; /* save this for m_detach() */ /* restore chameleon, lycanthropes to true form at death */ @@ -1748,11 +1735,9 @@ mongone(mdef) register struct monst *mdef; { mdef->mhp = 0; /* can skip some inventory bookkeeping */ -#ifdef STEED /* Player is thrown from his steed when it disappears */ if (mdef == u.usteed) dismount_steed(DISMOUNT_GENERIC); -#endif /* drop special items like the Amulet so that a dismissed Kop or nurse can't remove them from the game */ @@ -2121,14 +2106,12 @@ mnexto(mtmp) /* Make monster mtmp next to you (if possible) */ coord mm; boolean couldspot = canspotmon(mtmp); -#ifdef STEED if (mtmp == u.usteed) { /* Keep your steed in sync with you instead */ mtmp->mx = u.ux; mtmp->my = u.uy; return; } -#endif if(!enexto(&mm, u.ux, u.uy, mtmp->data)) return; rloc_to(mtmp, mm.x, mm.y); diff --git a/src/mondata.c b/src/mondata.c index 3016b7adf..2cdf41cef 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -791,9 +791,7 @@ boolean levl_follower(mtmp) struct monst *mtmp; { -#ifdef STEED if (mtmp == u.usteed) return TRUE; -#endif /* Wizard with Amulet won't bother trying to follow across levels */ if (mtmp->iswiz && mon_has_amulet(mtmp)) return FALSE; diff --git a/src/objects.c b/src/objects.c index ec4483a51..86d65a214 100644 --- a/src/objects.c +++ b/src/objects.c @@ -618,12 +618,8 @@ TOOL("crystal ball", "glass orb", TOOL("lenses", (char *)0, 1, 0, 0, 0, 5, 3, 80, GLASS, HI_GLASS), TOOL("blindfold", (char *)0, 1, 0, 0, 0, 50, 2, 20, CLOTH, CLR_BLACK), TOOL("towel", (char *)0, 1, 0, 0, 0, 50, 2, 50, CLOTH, CLR_MAGENTA), -#ifdef STEED TOOL("saddle", (char *)0, 1, 0, 0, 0, 5,200, 150, LEATHER, HI_LEATHER), TOOL("leash", (char *)0, 1, 0, 0, 0, 65, 12, 20, LEATHER, HI_LEATHER), -#else -TOOL("leash", (char *)0, 1, 0, 0, 0, 70, 12, 20, LEATHER, HI_LEATHER), -#endif TOOL("stethoscope", (char *)0, 1, 0, 0, 0, 25, 4, 75, IRON, HI_METAL), TOOL("tinning kit", (char *)0, 1, 0, 0, 1, 15,100, 30, IRON, HI_METAL), TOOL("tin opener", (char *)0, 1, 0, 0, 0, 35, 4, 30, IRON, HI_METAL), diff --git a/src/objnam.c b/src/objnam.c index d29ad6091..94c2f4fb6 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -772,11 +772,7 @@ plus: /* weptools already get this done when we go to the +n code */ if (!is_weptool(obj)) add_erosion_words(obj, prefix); - if(obj->owornmask & (W_TOOL /* blindfold */ -#ifdef STEED - | W_SADDLE -#endif - )) { + if(obj->owornmask & (W_TOOL /* blindfold */ | W_SADDLE)) { Strcat(bp, " (being worn)"); break; } diff --git a/src/pager.c b/src/pager.c index b3647c7dd..69590754d 100644 --- a/src/pager.c +++ b/src/pager.c @@ -65,10 +65,8 @@ char *outbuf; /* being blinded may hide invisibility from self */ (Invis && (senseself() || !Blind)) ? "invisible " : "", race, mons[u.umonnum].mname, plname); -#ifdef STEED if (u.usteed) Sprintf(eos(outbuf), ", mounted on %s", y_monnam(u.usteed)); -#endif return outbuf; } diff --git a/src/pickup.c b/src/pickup.c index 0fd429bc3..bbc9a925d 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1516,11 +1516,9 @@ boolean looting; /* loot vs tip */ const char *verb = looting ? "loot" : "tip"; if (!can_reach_floor(TRUE)) { -#ifdef STEED if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) rider_cant_reach(); /* not skilled enough to reach */ else -#endif cant_reach_floor(x, y, FALSE, TRUE); return FALSE; } else if ((is_pool(x, y) && (looting || !Underwater)) || @@ -1777,7 +1775,6 @@ boolean *prev_loot; { int c = -1; int timepassed = 0; -#ifdef STEED struct obj *otmp; char qbuf[QBUFSZ]; @@ -1816,7 +1813,6 @@ boolean *prev_loot; return (0); } } -#endif /* STEED */ /* 3.4.0 introduced the ability to pick things up from within swallower's stomach */ if (u.uswallow) { int count = passed_info ? *passed_info : 0; diff --git a/src/pline.c b/src/pline.c index 2c1612e49..96b14d049 100644 --- a/src/pline.c +++ b/src/pline.c @@ -401,9 +401,7 @@ register struct monst *mtmp; ", digesting you" : is_animal(u.ustuck->data) ? ", swallowing you" : ", engulfing you"); -#ifdef STEED if (mtmp == u.usteed) Strcat(info, ", carrying you"); -#endif /* avoid "Status of the invisible newt ..., invisible" */ /* and unlike a normal mon_nam, use "saddled" even if it has a name */ @@ -451,10 +449,7 @@ ustatusline() } /* note: "goop" == "glop"; variation is intentional */ } if (Stunned) Strcat(info, ", stunned"); -#ifdef STEED - if (!u.usteed) -#endif - if (Wounded_legs) { + if (!u.usteed && Wounded_legs) { const char *what = body_part(LEG); if ((Wounded_legs & BOTH_SIDES) == BOTH_SIDES) what = makeplural(what); diff --git a/src/polyself.c b/src/polyself.c index 0e348035a..c1b2c99c4 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -691,7 +691,6 @@ int mntmp; if (!sticky && !u.uswallow && u.ustuck && sticks(youmonst.data)) u.ustuck = 0; else if (sticky && !sticks(youmonst.data)) uunstick(); -#ifdef STEED if (u.usteed) { if (touch_petrifies(u.usteed->data) && !Stone_resistance && rnl(3)) { @@ -704,7 +703,6 @@ int mntmp; } if (!can_ride(u.usteed)) dismount_steed(DISMOUNT_POLY); } -#endif if (flags.verbose) { static const char use_thec[] = "Use the command #%s to %s."; diff --git a/src/potion.c b/src/potion.c index 582409711..396dbfa53 100644 --- a/src/potion.c +++ b/src/potion.c @@ -90,11 +90,9 @@ boolean talk; } if (xtime && !old) { if (talk) { -#ifdef STEED if (u.usteed) You("wobble in the saddle."); else -#endif You("%s...", stagger(youmonst.data, "stagger")); } } @@ -676,10 +674,8 @@ peffects(otmp) else { if (Levitation || Is_airlevel(&u.uz)||Is_waterlevel(&u.uz)) You("are motionlessly suspended."); -#ifdef STEED else if (u.usteed) You("are frozen in place!"); -#endif else Your("%s are frozen to the %s!", makeplural(body_part(FOOT)), surface(u.ux, u.uy)); @@ -814,11 +810,8 @@ peffects(otmp) } break; case POT_SPEED: - if(Wounded_legs && !otmp->cursed -#ifdef STEED - && !u.usteed /* heal_legs() would heal steeds legs */ -#endif - ) { + if(Wounded_legs && !otmp->cursed && !u.usteed) { + /* heal_legs() would heal steeds legs */ heal_legs(); unkn++; break; @@ -1143,10 +1136,8 @@ boolean your_fault; register const char *botlnam = bottlename(); boolean isyou = (mon == &youmonst); int distance; -#ifdef STEED struct obj *saddle = (struct obj *)0; boolean hit_saddle = FALSE; -#endif if(isyou) { distance = 0; @@ -1154,7 +1145,6 @@ boolean your_fault; botlnam, body_part(HEAD)); losehp(Maybe_Half_Phys(rnd(2)), "thrown potion", KILLED_BY_AN); } else { -#ifdef STEED /* sometimes it hits the saddle */ if(((mon->misc_worn_check & W_SADDLE) && (saddle = which_armor(mon, W_SADDLE))) && @@ -1163,21 +1153,17 @@ boolean your_fault; ((rnl(10) > 7 && obj->cursed) || (rnl(10) < 4 && obj->blessed) || !rn2(3))))) hit_saddle = TRUE; -#endif distance = distu(mon->mx,mon->my); if (!cansee(mon->mx,mon->my)) pline("Crash!"); else { char *mnam = mon_nam(mon); char buf[BUFSZ]; -#ifdef STEED if(hit_saddle && saddle) { Sprintf(buf, "%s saddle", s_suffix(x_monnam(mon, ARTICLE_THE, (char *)0, (SUPPRESS_IT|SUPPRESS_SADDLE), FALSE))); - } else -#endif - if(has_head(mon->data)) { + } else if(has_head(mon->data)) { Sprintf(buf, "%s %s", s_suffix(mnam), (notonhead ? "body" : "head")); @@ -1187,20 +1173,12 @@ boolean your_fault; pline_The("%s crashes on %s and breaks into shards.", botlnam, buf); } - if(rn2(5) && mon->mhp > 1 -#ifdef STEED - && !hit_saddle -#endif - ) + if(rn2(5) && mon->mhp > 1 && !hit_saddle) mon->mhp--; } /* oil doesn't instantly evaporate; Neither does a saddle hit */ - if (obj->otyp != POT_OIL && -#ifdef STEED - !hit_saddle && -#endif - cansee(mon->mx,mon->my)) + if (obj->otyp != POT_OIL && !hit_saddle && cansee(mon->mx,mon->my)) pline("%s.", Tobjnam(obj, "evaporate")); if (isyou) { @@ -1224,7 +1202,6 @@ boolean your_fault; } break; } -#ifdef STEED } else if (hit_saddle && saddle) { char *mnam, buf[BUFSZ], saddle_glows[BUFSZ]; boolean affected = FALSE; @@ -1245,7 +1222,6 @@ boolean your_fault; } if (useeit && !affected) pline("%s %s wet.", buf, aobjnam(saddle, "get")); -#endif } else { boolean angermon = TRUE; @@ -1777,11 +1753,9 @@ dodip() if (yn(upstart(qtoo)) == 'y') { if (Levitation) { floating_above(pooltype); -#ifdef STEED } else if (u.usteed && !is_swimmer(u.usteed->data) && P_SKILL(P_RIDING) < P_BASIC) { rider_cant_reach(); /* not skilled enough to reach */ -#endif } else { if (obj->otyp == POT_ACID) obj->in_use = 1; (void) get_wet(obj); diff --git a/src/pray.c b/src/pray.c index 602abee59..b5312c25a 100644 --- a/src/pray.c +++ b/src/pray.c @@ -207,12 +207,10 @@ in_trouble() Cursed_obj(uarmf, FUMBLE_BOOTS)) return TROUBLE_FUMBLING; if (worst_cursed_item()) return TROUBLE_CURSED_ITEMS; -#ifdef STEED if (u.usteed) { /* can't voluntarily dismount from a cursed saddle */ otmp = which_armor(u.usteed, W_SADDLE); if (Cursed_obj(otmp, SADDLE)) return TROUBLE_SADDLE; } -#endif if (Blinded > 1 && haseyes(youmonst.data) && (!u.uswallow || @@ -220,11 +218,7 @@ in_trouble() return(TROUBLE_BLIND); for(i=0; i= HUNGRY) return TROUBLE_HUNGRY; if (HStun & TIMEOUT) return TROUBLE_STUNNED; if (HConfusion & TIMEOUT) return TROUBLE_CONFUSED; @@ -483,7 +477,6 @@ decurse: pline ("Looks like you are back in Kansas."); (void) make_hallucinated(0L,FALSE,0L); break; -#ifdef STEED case TROUBLE_SADDLE: otmp = which_armor(u.usteed, W_SADDLE); if (!Blind) { @@ -493,7 +486,6 @@ decurse: } uncurse(otmp); break; -#endif } } diff --git a/src/read.c b/src/read.c index 3564d6cec..40b40f2d9 100644 --- a/src/read.c +++ b/src/read.c @@ -1126,10 +1126,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */ for (i = -bd; i <= bd; i++) for(j = -bd; j <= bd; j++) { if (!isok(u.ux + i, u.uy + j)) continue; if ((mtmp = m_at(u.ux + i, u.uy + j)) != 0 -#ifdef STEED - || (!i && !j && (mtmp = u.usteed) != 0) -#endif - ) { + || (!i && !j && (mtmp = u.usteed) != 0)) { ++candidates; res = maybe_tame(mtmp, sobj); results += res; diff --git a/src/restore.c b/src/restore.c index 2297127c0..dc883c6da 100644 --- a/src/restore.c +++ b/src/restore.c @@ -516,7 +516,7 @@ STATIC_OVL boolean restgamestate(fd, stuckid, steedid) register int fd; -unsigned int *stuckid, *steedid; /* STEED */ +unsigned int *stuckid, *steedid; { struct flag newgameflags; #ifdef SYSFLAGS @@ -652,10 +652,8 @@ unsigned int *stuckid, *steedid; /* STEED */ restore_oracles(fd); if (u.ustuck) mread(fd, (genericptr_t) stuckid, sizeof (*stuckid)); -#ifdef STEED if (u.usteed) mread(fd, (genericptr_t) steedid, sizeof (*steedid)); -#endif mread(fd, (genericptr_t) pl_character, sizeof pl_character); mread(fd, (genericptr_t) pl_fruit, sizeof pl_fruit); @@ -676,7 +674,7 @@ unsigned int *stuckid, *steedid; /* STEED */ */ STATIC_OVL void restlevelstate(stuckid, steedid) -unsigned int stuckid, steedid; /* STEED */ +unsigned int stuckid, steedid; { register struct monst *mtmp; @@ -686,7 +684,6 @@ unsigned int stuckid, steedid; /* STEED */ if (!mtmp) panic("Cannot find the monster ustuck."); u.ustuck = mtmp; } -#ifdef STEED if (steedid) { for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) if (mtmp->m_id == steedid) break; @@ -694,7 +691,6 @@ unsigned int stuckid, steedid; /* STEED */ u.usteed = mtmp; remove_monster(mtmp->mx, mtmp->my); } -#endif } /*ARGSUSED*/ /* fd used in MFLOPPY only */ @@ -793,9 +789,7 @@ register int fd; * place_monster() on other levels */ u.ustuck = (struct monst *)0; -#ifdef STEED u.usteed = (struct monst *)0; -#endif #ifdef MICRO # ifdef AMII_GRAPHICS diff --git a/src/save.c b/src/save.c index a4055c915..f8f5d40b0 100644 --- a/src/save.c +++ b/src/save.c @@ -231,9 +231,7 @@ dosave0() store_savefileinfo(fd); store_plname_in_file(fd); ustuck_id = (u.ustuck ? u.ustuck->m_id : 0); -#ifdef STEED usteed_id = (u.usteed ? u.usteed->m_id : 0); -#endif savelev(fd, ledger_no(&u.uz), WRITE_SAVE | FREE_SAVE); savegamestate(fd, WRITE_SAVE | FREE_SAVE); @@ -248,9 +246,7 @@ dosave0() * may mislead place_monster() on other levels */ u.ustuck = (struct monst *)0; -#ifdef STEED u.usteed = (struct monst *)0; -#endif for(ltmp = (xchar)1; ltmp <= maxledgerno(); ltmp++) { if (ltmp == ledger_no(&uz_save)) continue; @@ -356,10 +352,8 @@ register int fd, mode; save_oracles(fd, mode); if(ustuck_id) bwrite(fd, (genericptr_t) &ustuck_id, sizeof ustuck_id); -#ifdef STEED if(usteed_id) bwrite(fd, (genericptr_t) &usteed_id, sizeof usteed_id); -#endif bwrite(fd, (genericptr_t) pl_character, sizeof pl_character); bwrite(fd, (genericptr_t) pl_fruit, sizeof pl_fruit); savefruitchn(fd, mode); @@ -433,9 +427,7 @@ savestateinlock() store_plname_in_file(fd); ustuck_id = (u.ustuck ? u.ustuck->m_id : 0); -#ifdef STEED usteed_id = (u.usteed ? u.usteed->m_id : 0); -#endif savegamestate(fd, WRITE_SAVE); } bclose(fd); diff --git a/src/shk.c b/src/shk.c index 944098c3a..7a4edcbdc 100644 --- a/src/shk.c +++ b/src/shk.c @@ -619,13 +619,11 @@ char *enterstring; "Leave the %s%s outside.", tool, plur(cnt)); should_block = TRUE; -#ifdef STEED } else if (u.usteed) { - verbalize(NOTANGRY(shkp) ? - "Will you please leave %s outside?" : - "Leave %s outside.", y_monnam(u.usteed)); - should_block = TRUE; -#endif + verbalize(NOTANGRY(shkp) ? + "Will you please leave %s outside?" : + "Leave %s outside.", y_monnam(u.usteed)); + should_block = TRUE; } else { should_block = (Fast && (sobj_at(PICK_AXE, u.ux, u.uy) || sobj_at(DWARVISH_MATTOCK, u.ux, u.uy))); @@ -3512,11 +3510,7 @@ register struct monst *shkp; avoid = FALSE; } else { #define GDIST(x,y) (dist2(x,y,gx,gy)) - if (Invis -#ifdef STEED - || u.usteed -#endif - ) { + if (Invis || u.usteed) { avoid = FALSE; } else { uondoor = (u.ux == eshkp->shd.x && u.uy == eshkp->shd.y); @@ -4285,9 +4279,7 @@ register xchar x, y; && shkp->mcanmove && !shkp->msleeping && (x == sx-1 || x == sx+1 || y == sy-1 || y == sy+1) && (Invis || carrying(PICK_AXE) || carrying(DWARVISH_MATTOCK) -#ifdef STEED || u.usteed -#endif )) { pline("%s%s blocks your way!", shkname(shkp), Invis ? " senses your motion and" : ""); diff --git a/src/sit.c b/src/sit.c index 154248392..4b8e2e7d1 100644 --- a/src/sit.c +++ b/src/sit.c @@ -363,7 +363,6 @@ rndcurse() /* curse a few inventory items at random! */ update_inventory(); } -#ifdef STEED /* treat steed's saddle as extended part of hero's inventory */ if (u.usteed && !rn2(4) && (otmp = which_armor(u.usteed, W_SADDLE)) != 0 && @@ -379,7 +378,6 @@ rndcurse() /* curse a few inventory items at random! */ otmp->bknown = TRUE; } } -#endif /*STEED*/ } void diff --git a/src/sounds.c b/src/sounds.c index b599f814e..27749d8b0 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -974,15 +974,13 @@ dochat() return(0); } -#ifdef STEED if (u.usteed && u.dz > 0) { - if (!u.usteed->mcanmove || u.usteed->msleeping) { - pline("%s seems not to notice you.", Monnam(u.usteed)); - return(1); - } else - return (domonnoise(u.usteed)); + if (!u.usteed->mcanmove || u.usteed->msleeping) { + pline("%s seems not to notice you.", Monnam(u.usteed)); + return(1); + } else + return (domonnoise(u.usteed)); } -#endif if (u.dz) { pline("They won't hear you %s there.", u.dz < 0 ? "up" : "down"); diff --git a/src/steal.c b/src/steal.c index f762ec18f..884b4135c 100644 --- a/src/steal.c +++ b/src/steal.c @@ -50,16 +50,15 @@ register struct monst *mtmp; mtmp->mgold += gold->quan; delobj(gold); newsym(u.ux, u.uy); -#ifdef STEED - if (u.usteed) - who = u.usteed, - whose = s_suffix(y_monnam(who)), - what = makeplural(mbodypart(who, FOOT)); - else -#endif - who = &youmonst, - whose = "your", - what = makeplural(body_part(FOOT)); + if (u.usteed) { + who = u.usteed; + whose = s_suffix(y_monnam(who)); + what = makeplural(mbodypart(who, FOOT)); + } else { + who = &youmonst; + whose = "your"; + what = makeplural(body_part(FOOT)); + } /* [ avoid "between your rear regions" :-] */ if (slithy(who->data)) what = "coils"; /* reduce "rear hooves/claws" to "hooves/claws" */ @@ -137,16 +136,15 @@ register struct monst *mtmp; obj_extract_self(fgold); add_to_minv(mtmp, fgold); newsym(u.ux, u.uy); -#ifdef STEED - if (u.usteed) - who = u.usteed, - whose = s_suffix(y_monnam(who)), - what = makeplural(mbodypart(who, FOOT)); - else -#endif - who = &youmonst, - whose = "your", - what = makeplural(body_part(FOOT)); + if (u.usteed) { + who = u.usteed; + whose = s_suffix(y_monnam(who)); + what = makeplural(mbodypart(who, FOOT)); + } else { + who = &youmonst; + whose = "your"; + what = makeplural(body_part(FOOT)); + } /* [ avoid "between your rear regions" :-] */ if (slithy(who->data)) what = "coils"; /* reduce "rear hooves/claws" to "hooves/claws" */ @@ -639,7 +637,6 @@ boolean verbosely; if (mon->mhp > 0) { mon->misc_worn_check &= ~obj->owornmask; update_mon = TRUE; -#ifdef STEED /* don't charge for an owned saddle on dead steed (provided that the hero is within the same shop at the time) */ } else if (mon->mtame && (obj->owornmask & W_SADDLE) && @@ -647,7 +644,6 @@ boolean verbosely; /* being at a costly_spot guarantees lev->roomno is not 0 */ index(in_rooms(u.ux, u.uy, SHOPBASE), levl[omx][omy].roomno)) { obj->no_charge = 1; -#endif } /* this should be done even if the monster has died */ if (obj->owornmask & W_WEP) setmnotwielded(mon, obj); diff --git a/src/steed.c b/src/steed.c index d42c2957d..afd4579dc 100644 --- a/src/steed.c +++ b/src/steed.c @@ -5,9 +5,6 @@ #include "hack.h" - -#ifdef STEED - /* Monsters that might be ridden */ static NEARDATA const char steeds[] = { S_QUADRUPED, S_UNICORN, S_ANGEL, S_CENTAUR, S_DRAGON, S_JABBERWOCK, '\0' @@ -698,6 +695,4 @@ int x, y; level.monsters[x][y] = mon; } -#endif /* STEED */ - /*steed.c*/ diff --git a/src/teleport.c b/src/teleport.c index 608e38374..158bd752c 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -39,10 +39,7 @@ unsigned gpflags; * oh well. */ if (mtmp != &youmonst && x == u.ux && y == u.uy -#ifdef STEED - && (!u.usteed || mtmp != u.usteed) -#endif - ) + && (!u.usteed || mtmp != u.usteed)) return FALSE; if (mtmp) { @@ -379,10 +376,8 @@ boolean force_it; { register struct obj *otmp; -#ifdef STEED if (mtmp == u.usteed) return (FALSE); -#endif if (mtmp->mleashed) { otmp = get_mleash(mtmp); @@ -454,10 +449,8 @@ struct obj *scroll; char whobuf[BUFSZ]; Strcpy(whobuf, "you"); -#ifdef STEED if (u.usteed) Sprintf(eos(whobuf), " and %s", mon_nam(u.usteed)); -#endif pline("To what position do %s want to be teleported?", whobuf); cc.x = u.ux; @@ -1032,12 +1025,10 @@ boolean suppress_impossible; { register int x, y, trycount; -#ifdef STEED if (mtmp == u.usteed) { tele(); return TRUE; } -#endif if (mtmp->iswiz && mtmp->mx) { /* Wizard, not just arriving */ if (!In_W_tower(u.ux, u.uy, &u.uz)) diff --git a/src/timeout.c b/src/timeout.c index 80d9a4da6..6e2b0f95e 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -236,12 +236,10 @@ nh_timeout() } } -#ifdef STEED if (u.ugallop) { if (--u.ugallop == 0L && u.usteed) pline("%s stops galloping.", Monnam(u.usteed)); } -#endif for(upp = u.uprops; upp < u.uprops+SIZE(u.uprops); upp++) if((upp->intrinsic & TIMEOUT) && !(--upp->intrinsic & TIMEOUT)) { @@ -671,9 +669,7 @@ slip_or_trip() const char *what; char buf[BUFSZ]; boolean on_foot = TRUE; -#ifdef STEED if (u.usteed) on_foot = FALSE; -#endif if (otmp && on_foot && !u.uinwater && is_pool(u.ux, u.uy)) otmp = 0; @@ -707,11 +703,9 @@ slip_or_trip() } } else if (rn2(3) && is_ice(u.ux, u.uy)) { pline("%s %s%s on the ice.", -#ifdef STEED u.usteed ? upstart(x_monnam(u.usteed, (has_mname(u.usteed)) ? ARTICLE_NONE : ARTICLE_THE, (char *)0, SUPPRESS_SADDLE, FALSE)) : -#endif "You", rn2(2) ? "slip" : "slide", on_foot ? "" : "s"); } else { if (on_foot) { @@ -732,7 +726,6 @@ slip_or_trip() break; } } -#ifdef STEED else { switch (rn2(4)) { case 1: @@ -750,7 +743,6 @@ slip_or_trip() } dismount_steed(DISMOUNT_FELL); } -#endif } } diff --git a/src/trap.c b/src/trap.c index 275776926..e14ffec6f 100644 --- a/src/trap.c +++ b/src/trap.c @@ -30,11 +30,9 @@ STATIC_DCL char *FDECL(trapnote, (struct trap *,BOOLEAN_P)); STATIC_DCL void FDECL(join_adjacent_pits, (struct trap *)); #endif STATIC_DCL void FDECL(clear_conjoined_pits, (struct trap *)); -#ifdef STEED STATIC_DCL int FDECL(steedintrap, (struct trap *, struct obj *)); STATIC_DCL boolean FDECL(keep_saddle_with_steedcorpse, (unsigned, struct obj *, struct obj *)); -#endif STATIC_DCL void NDECL(maybe_finish_sokoban); /* mintrap() should take a flags argument, but for time being we use this */ @@ -651,7 +649,6 @@ boolean shatter; return mtmp; } -#ifdef STEED STATIC_OVL boolean keep_saddle_with_steedcorpse(steed_mid, objchn, saddle) unsigned steed_mid; @@ -679,7 +676,6 @@ struct obj *objchn, *saddle; } return FALSE; } -#endif /*STEED*/ void dotrap(trap, trflags) @@ -695,9 +691,7 @@ unsigned trflags; plunged = (trflags & TOOKPLUNGE) != 0, adj_pit = conjoined_pits(trap, t_at(u.ux0,u.uy0), TRUE); int oldumort; -#ifdef STEED int steed_article = ARTICLE_THE; -#endif nomul(0); @@ -736,7 +730,6 @@ unsigned trflags; } } -#ifdef STEED if (u.usteed) { u.usteed->mtrapseen |= (1 << (ttype - 1)); /* suppress article in various steed messages when using its @@ -744,7 +737,6 @@ unsigned trflags; if (has_mname(u.usteed) && !Hallucination) steed_article = ARTICLE_NONE; } -#endif switch(ttype) { case ARROW_TRAP: @@ -761,11 +753,8 @@ unsigned trflags; otmp->quan = 1L; otmp->owt = weight(otmp); otmp->opoisoned = 0; -#ifdef STEED if (u.usteed && !rn2(2) && steedintrap(trap, otmp)) /* nothing */; - else -#endif - if (thitu(8, dmgval(otmp, &youmonst), otmp, "arrow")) { + else if (thitu(8, dmgval(otmp, &youmonst), otmp, "arrow")) { obfree(otmp, (struct obj *)0); } else { place_object(otmp, u.ux, u.uy); @@ -789,11 +778,8 @@ unsigned trflags; otmp->owt = weight(otmp); if (!rn2(6)) otmp->opoisoned = 1; oldumort = u.umortality; -#ifdef STEED if (u.usteed && !rn2(2) && steedintrap(trap, otmp)) /* nothing */; - else -#endif - if (thitu(7, dmgval(otmp, &youmonst), otmp, "little dart")) { + else if (thitu(7, dmgval(otmp, &youmonst), otmp, "little dart")) { if (otmp->opoisoned) poisoned("dart", A_CON, "little dart", /* if damage triggered life-saving, @@ -876,27 +862,20 @@ unsigned trflags; A_Your[trap->madeby_u]); break; } - if( -#ifdef STEED - !u.usteed && -#endif - youmonst.data->msize <= MZ_SMALL) { + if( !u.usteed && youmonst.data->msize <= MZ_SMALL) { pline("%s bear trap closes harmlessly over you.", A_Your[trap->madeby_u]); break; } u.utrap = rn1(4, 4); u.utraptype = TT_BEARTRAP; -#ifdef STEED if (u.usteed) { pline("%s bear trap closes on %s %s!", A_Your[trap->madeby_u], s_suffix(mon_nam(u.usteed)), mbodypart(u.usteed, FOOT)); if (thitm(0, u.usteed, (struct obj *)0, dmg, FALSE)) u.utrap = 0; /* steed died, hero not trapped */ - } else -#endif - { + } else { pline("%s bear trap closes on your %s!", A_Your[trap->madeby_u], body_part(FOOT)); if(u.umonnum == PM_OWLBEAR || u.umonnum == PM_BUGBEAR) @@ -915,9 +894,7 @@ unsigned trflags; pline("A cloud of gas puts you to sleep!"); fall_asleep(-rnd(25), TRUE); } -#ifdef STEED (void) steedintrap(trap, (struct obj *)0); -#endif break; case RUST_TRAP: @@ -1008,7 +985,6 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); } if (!Sokoban) { char verbbuf[BUFSZ]; -#ifdef STEED if (u.usteed) { if ((trflags & RECURSIVETRAP) != 0) Sprintf(verbbuf, "and %s fall", @@ -1018,9 +994,7 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); Sprintf(verbbuf, "lead %s", x_monnam(u.usteed, steed_article, "poor", SUPPRESS_SADDLE, FALSE)); - } else -#endif - if (adj_pit) { + } else if (adj_pit) { You("move into an adjacent pit."); } else { Strcpy(verbbuf, !plunged ? "fall" : @@ -1038,7 +1012,6 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); pline("How pitiful. Isn't that the pits?"); if (ttype == SPIKED_PIT) { const char *predicament = "on a set of sharp iron spikes"; -#ifdef STEED if (u.usteed) { pline("%s %s %s!", upstart(x_monnam(u.usteed, steed_article, @@ -1046,14 +1019,11 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); adj_pit ? "steps" : "lands", predicament); } else -#endif - You("%s %s!", adj_pit ? "step" : "land", predicament); + You("%s %s!", adj_pit ? "step" : "land", predicament); } u.utrap = rn1(6,2); u.utraptype = TT_PIT; -#ifdef STEED if (!steedintrap(trap, (struct obj *)0)) { -#endif if (ttype == SPIKED_PIT) { oldumort = u.umortality; losehp(Maybe_Half_Phys(rnd(adj_pit ? 6 : 10)), @@ -1086,9 +1056,7 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); vision_full_recalc = 1; /* vision limits change */ exercise(A_STR, FALSE); exercise(A_DEX, FALSE); -#ifdef STEED } -#endif break; case HOLE: case TRAPDOOR: @@ -1139,12 +1107,10 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); if (forcetrap) { Strcpy(verbbuf, "are caught by"); -#ifdef STEED } else if (u.usteed) { Sprintf(verbbuf, "lead %s into", x_monnam(u.usteed, steed_article, "poor", SUPPRESS_SADDLE, FALSE)); -#endif } else { Sprintf(verbbuf, "%s into", Levitation ? (const char *)"float" : @@ -1158,7 +1124,6 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); { register int str = ACURR(A_STR); -#ifdef STEED /* If mounted, the steed gets trapped. Use mintrap * to do all the work. If mtrapped is set as a result, * unset it and set utrap instead. In the case of a @@ -1183,7 +1148,6 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); webmsgok = FALSE; /* mintrap printed the messages */ } -#endif if (str <= 3) u.utrap = rn1(6,6); else if (str < 6) u.utrap = rn1(6,4); else if (str < 9) u.utrap = rn1(4,4); @@ -1216,9 +1180,7 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); u.uen = (u.uenmax += 2); break; } else domagictrap(); -#ifdef STEED (void) steedintrap(trap, (struct obj *)0); -#endif break; case ANTI_MAGIC: @@ -1258,13 +1220,11 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); case POLY_TRAP: { char verbbuf[BUFSZ]; seetrap(trap); -#ifdef STEED if (u.usteed) Sprintf(verbbuf, "lead %s", x_monnam(u.usteed, steed_article, (char *)0, SUPPRESS_SADDLE, FALSE)); else -#endif Sprintf(verbbuf,"%s", Levitation ? (const char *)"float" : locomotion(youmonst.data, "step")); @@ -1274,9 +1234,7 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); You_feel("momentarily different."); /* Trap did nothing; don't remove it --KAA */ } else { -#ifdef STEED (void) steedintrap(trap, (struct obj *)0); -#endif deltrap(trap); /* delete trap before polymorph */ newsym(u.ux,u.uy); /* get rid of trap symbol */ You_feel("a change coming over you."); @@ -1285,10 +1243,8 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); break; } case LANDMINE: { -#ifdef STEED unsigned steed_mid = 0; struct obj *saddle = 0; -#endif if ((Levitation || Flying) && !forcetrap) { if (!already_seen && rn2(3)) break; feeltrap(trap); @@ -1303,7 +1259,6 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); already_seen ? a_your[trap->madeby_u] : "", already_seen ? " land mine" : "it"); } else { -#ifdef STEED /* prevent landmine from killing steed, throwing you to * the ground, and you being affected again by the same * mine because it hasn't been deleted yet @@ -1311,26 +1266,21 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); static boolean recursive_mine = FALSE; if (recursive_mine) break; -#endif feeltrap(trap); pline("KAABLAMM!!! You triggered %s land mine!", a_your[trap->madeby_u]); -#ifdef STEED if (u.usteed) steed_mid = u.usteed->m_id; recursive_mine = TRUE; (void) steedintrap(trap, (struct obj *)0); recursive_mine = FALSE; saddle = sobj_at(SADDLE,u.ux, u.uy); -#endif set_wounded_legs(LEFT_SIDE, rn1(35, 41)); set_wounded_legs(RIGHT_SIDE, rn1(35, 41)); exercise(A_DEX, FALSE); } blow_up_landmine(trap); -#ifdef STEED if (steed_mid && saddle && !u.usteed) (void)keep_saddle_with_steedcorpse(steed_mid, fobj, saddle); -#endif newsym(u.ux,u.uy); /* update trap symbol */ losehp(Maybe_Half_Phys(rnd(16)), "land mine", KILLED_BY_AN); /* fall recursively into the pit... */ @@ -1383,7 +1333,6 @@ boolean noprefix; return tnbuf; } -#ifdef STEED STATIC_OVL int steedintrap(trap, otmp) struct trap *trap; @@ -1460,7 +1409,6 @@ struct obj *otmp; } return steedhit ? 1 : 0; } -#endif /*STEED*/ /* some actions common to both player and monsters for triggered landmine */ void @@ -1964,10 +1912,8 @@ register struct monst *mtmp; Sokoban && !trap->madeby_u); const char *fallverb; -#ifdef STEED /* true when called from dotrap, inescapable is not an option */ if (mtmp == u.usteed) inescapable = TRUE; -#endif if (!inescapable && ((mtmp->mtrapseen & (1 << (tt-1))) != 0 || (tt == HOLE && !mindless(mptr)))) { @@ -1983,10 +1929,8 @@ register struct monst *mtmp; in_sight = canseemon(mtmp); see_it = cansee(mtmp->mx, mtmp->my); -#ifdef STEED /* assume hero can tell what's going on for the steed */ if (mtmp == u.usteed) in_sight = TRUE; -#endif switch (tt) { case ARROW_TRAP: if (trap->once && trap->tseen && !rn2(15)) { @@ -2633,7 +2577,6 @@ float_up() You("gain control over your movements."); else You("start to float in the air!"); -#ifdef STEED if (u.usteed && !is_floater(u.usteed->data) && !is_flyer(u.usteed->data)) { if (Lev_at_will) @@ -2643,7 +2586,6 @@ float_up() dismount_steed(DISMOUNT_GENERIC); } } -#endif if (Flying) You("are no longer able to control your flight."); BFlying |= I_SPECIAL; return; @@ -2744,10 +2686,7 @@ long hmask, emask; /* might cancel timeout */ You_feel("heavier."); /* u.uinwater msgs already in spoteffects()/drown() */ else if (!u.uinwater && !no_msg) { -#ifdef STEED - if (!(emask & W_SADDLE)) -#endif - { + if (!(emask & W_SADDLE)) { if (Sokoban && trap) { /* Justification elsewhere for Sokoban traps * is based on air currents. This is @@ -2761,15 +2700,11 @@ long hmask, emask; /* might cancel timeout */ else You("fall over."); losehp(rnd(2), "dangerous winds", KILLED_BY); -#ifdef STEED if (u.usteed) dismount_steed(DISMOUNT_FELL); -#endif selftouch("As you fall, you"); -#ifdef STEED } else if (u.usteed && (is_floater(u.usteed->data) || is_flyer(u.usteed->data))) { You("settle more firmly in the saddle."); -#endif } else if (Hallucination) pline("Bummer! You've %s.", is_pool(u.ux,u.uy) ? "splashed down" : @@ -2834,19 +2769,15 @@ climb_pit() You("%s to the edge of the pit.", (Sokoban && Levitation) ? "struggle against the air currents and float" : -#ifdef STEED u.usteed ? "ride" : -#endif "crawl"); fill_pit(u.ux, u.uy); vision_full_recalc = 1; /* vision limits change */ } else if (u.dz || flags.verbose) { -#ifdef STEED if (u.usteed) Norep("%s is still in a pit.", upstart(y_monnam(u.usteed))); else -#endif Norep((Hallucination && !rn2(5)) ? "You've fallen, and you can't get up." : "You are still in a pit."); @@ -3361,13 +3292,11 @@ drown() return(TRUE); } else pline_The("attempted teleport spell fails."); } -#ifdef STEED if (u.usteed) { dismount_steed(DISMOUNT_GENERIC); if(!is_pool(u.ux,u.uy)) return(TRUE); } -#endif crawl_ok = FALSE; x = y = 0; /* lint suppression */ /* if sleeping, wake up now so that we don't crawl out of water @@ -3603,11 +3532,9 @@ boolean force_failure; } /* untrappable traps are located on the ground. */ if (!can_reach_floor(TRUE)) { -#ifdef STEED if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) rider_cant_reach(); else -#endif You("are unable to reach the %s!", defsyms[trap_to_defsym(ttype)].explanation); return 0; @@ -3627,12 +3554,10 @@ boolean force_failure; if (ttmp2) { pline_The("webbing sticks to you. You're caught too!"); dotrap(ttmp2, NOWEBMSG); -#ifdef STEED if (u.usteed && u.utrap) { /* you, not steed, are trapped */ dismount_steed(DISMOUNT_FELL); } -#endif } } else pline("%s remains entangled.", Monnam(mtmp)); @@ -3937,9 +3862,7 @@ boolean force; useplural ? "are" : "is", the_trap, here ? "here" : "there", useplural ? "them" : "it", -#ifdef STEED u.usteed ? " while mounted" : -#endif ""); trap_skipped = (ttmp != 0); } else { /* deal_with_floor_trap */ @@ -4131,9 +4054,7 @@ boolean *noticed; /* set to true iff hero notices the effect; */ const char *trapdescr, *which; boolean ishero = (mon == &youmonst); -#ifdef STEED if (mon == u.usteed) ishero = TRUE; -#endif t = t_at(ishero ? u.ux : mon->mx, ishero ? u.uy : mon->my); /* if no trap here or it's not a holding trap, we're done */ if (!t || (t->ttyp != BEAR_TRAP && t->ttyp != WEB)) return FALSE; @@ -4148,11 +4069,9 @@ boolean *noticed; /* set to true iff hero notices the effect; */ *noticed = TRUE; /* give message only if trap was the expected type */ if (u.utraptype == TT_BEARTRAP || u.utraptype == TT_WEB) { -#ifdef STEED if (u.usteed) Sprintf(buf, "%s is", noit_Monnam(u.usteed)); else -#endif Strcpy(buf, "You are"); pline("%s released from %s %s.", buf, which, trapdescr); } @@ -4188,9 +4107,7 @@ boolean *noticed; /* set to true iff hero notices the effect; */ unsigned dotrapflags; boolean ishero = (mon == &youmonst), result; -#ifdef STEED if (mon == u.usteed) ishero = TRUE; -#endif t = t_at(ishero ? u.ux : mon->mx, ishero ? u.uy : mon->my); /* if no trap here or it's not a holding trap, we're done */ if (!t || (t->ttyp != BEAR_TRAP && t->ttyp != WEB)) return FALSE; @@ -4199,10 +4116,8 @@ boolean *noticed; /* set to true iff hero notices the effect; */ if (u.utrap) return FALSE; /* already trapped */ *noticed = TRUE; dotrapflags = FORCETRAP; -#ifdef STEED /* dotrap calls mintrap when mounted hero encounters a web */ if (u.usteed) dotrapflags |= NOWEBMSG; -#endif ++force_mintrap; dotrap(t, dotrapflags); --force_mintrap; @@ -4230,9 +4145,7 @@ boolean *noticed; /* set to true iff hero notices the effect; */ struct trap *t; boolean ishero = (mon == &youmonst), result; -#ifdef STEED if (mon == u.usteed) ishero = TRUE; -#endif t = t_at(ishero ? u.ux : mon->mx, ishero ? u.uy : mon->my); /* if no trap here or it's not a falling trap, we're done (note: falling rock traps have a trapdoor in the ceiling) */ diff --git a/src/u_init.c b/src/u_init.c index 59ba3c23a..621f0d44d 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -262,9 +262,7 @@ static const struct def_skill Skill_A[] = { { P_UNICORN_HORN, P_SKILLED }, { P_ATTACK_SPELL, P_BASIC }, { P_HEALING_SPELL, P_BASIC }, { P_DIVINATION_SPELL, P_EXPERT}, { P_MATTER_SPELL, P_BASIC}, -#ifdef STEED { P_RIDING, P_BASIC }, -#endif { P_TWO_WEAPON_COMBAT, P_BASIC }, { P_BARE_HANDED_COMBAT, P_EXPERT }, { P_NONE, 0 } @@ -281,9 +279,7 @@ static const struct def_skill Skill_B[] = { { P_QUARTERSTAFF, P_BASIC }, { P_SPEAR, P_SKILLED }, { P_TRIDENT, P_SKILLED }, { P_BOW, P_BASIC }, { P_ATTACK_SPELL, P_SKILLED }, -#ifdef STEED { P_RIDING, P_BASIC }, -#endif { P_TWO_WEAPON_COMBAT, P_BASIC }, { P_BARE_HANDED_COMBAT, P_MASTER }, { P_NONE, 0 } @@ -332,9 +328,7 @@ static const struct def_skill Skill_K[] = { { P_BOW, P_BASIC }, { P_CROSSBOW, P_SKILLED }, { P_ATTACK_SPELL, P_SKILLED }, { P_HEALING_SPELL, P_SKILLED }, { P_CLERIC_SPELL, P_SKILLED }, -#ifdef STEED { P_RIDING, P_EXPERT }, -#endif { P_TWO_WEAPON_COMBAT, P_SKILLED }, { P_BARE_HANDED_COMBAT, P_EXPERT }, { P_NONE, 0 } @@ -379,9 +373,7 @@ static const struct def_skill Skill_R[] = { { P_DART, P_EXPERT }, { P_SHURIKEN, P_SKILLED }, { P_DIVINATION_SPELL, P_SKILLED }, { P_ESCAPE_SPELL, P_SKILLED }, { P_MATTER_SPELL, P_SKILLED }, -#ifdef STEED { P_RIDING, P_BASIC }, -#endif { P_TWO_WEAPON_COMBAT, P_EXPERT }, { P_BARE_HANDED_COMBAT, P_EXPERT }, { P_NONE, 0 } @@ -401,9 +393,7 @@ static const struct def_skill Skill_Ran[] = { { P_HEALING_SPELL, P_BASIC }, { P_DIVINATION_SPELL, P_EXPERT }, { P_ESCAPE_SPELL, P_BASIC }, -#ifdef STEED { P_RIDING, P_BASIC }, -#endif { P_BARE_HANDED_COMBAT, P_BASIC }, { P_NONE, 0 } }; @@ -418,9 +408,7 @@ static const struct def_skill Skill_S[] = { { P_LANCE, P_SKILLED }, { P_BOW, P_EXPERT }, { P_SHURIKEN, P_EXPERT }, { P_ATTACK_SPELL, P_SKILLED }, { P_CLERIC_SPELL, P_SKILLED }, -#ifdef STEED { P_RIDING, P_SKILLED }, -#endif { P_TWO_WEAPON_COMBAT, P_EXPERT }, { P_MARTIAL_ARTS, P_MASTER }, { P_NONE, 0 } @@ -444,9 +432,7 @@ static const struct def_skill Skill_T[] = { { P_WHIP, P_BASIC }, { P_UNICORN_HORN, P_SKILLED }, { P_DIVINATION_SPELL, P_BASIC }, { P_ENCHANTMENT_SPELL, P_BASIC }, { P_ESCAPE_SPELL, P_SKILLED }, -#ifdef STEED { P_RIDING, P_BASIC }, -#endif { P_TWO_WEAPON_COMBAT, P_SKILLED }, { P_BARE_HANDED_COMBAT, P_SKILLED }, { P_NONE, 0 } @@ -464,9 +450,7 @@ static const struct def_skill Skill_V[] = { { P_TRIDENT, P_BASIC }, { P_LANCE, P_SKILLED }, { P_SLING, P_BASIC }, { P_ATTACK_SPELL, P_BASIC }, { P_ESCAPE_SPELL, P_BASIC }, -#ifdef STEED { P_RIDING, P_SKILLED }, -#endif { P_TWO_WEAPON_COMBAT, P_SKILLED }, { P_BARE_HANDED_COMBAT, P_EXPERT }, { P_NONE, 0 } @@ -484,9 +468,7 @@ static const struct def_skill Skill_W[] = { { P_DIVINATION_SPELL, P_EXPERT }, { P_ENCHANTMENT_SPELL, P_SKILLED }, { P_CLERIC_SPELL, P_SKILLED }, { P_ESCAPE_SPELL, P_EXPERT }, { P_MATTER_SPELL, P_EXPERT }, -#ifdef STEED { P_RIDING, P_BASIC }, -#endif { P_BARE_HANDED_COMBAT, P_BASIC }, { P_NONE, 0 } }; diff --git a/src/uhitm.c b/src/uhitm.c index 43fb2c0a1..16b05fe9c 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -11,9 +11,7 @@ STATIC_DCL boolean FDECL(theft_petrifies, (struct obj *)); STATIC_DCL void FDECL(steal_it, (struct monst *, struct attack *)); STATIC_DCL boolean FDECL(hitum, (struct monst *,struct attack *)); STATIC_DCL boolean FDECL(hmon_hitmon, (struct monst *,struct obj *,int)); -#ifdef STEED STATIC_DCL int FDECL(joust, (struct monst *,struct obj *)); -#endif STATIC_DCL void NDECL(demonpet); STATIC_DCL boolean FDECL(m_slips_free, (struct monst *mtmp,struct attack *mattk)); STATIC_DCL int FDECL(explum, (struct monst *,struct attack *)); @@ -559,9 +557,7 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ boolean hand_to_hand = (thrown == HMON_MELEE || /* not grapnels; applied implies uwep */ (thrown == HMON_APPLIED && is_pole(uwep))); -#ifdef STEED int jousting = 0; -#endif int wtype; struct obj *monwep; char unconventional[BUFSZ]; /* substituted for word "attack" in msg */ @@ -607,11 +603,7 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ /* or strike with a missile in your hand... */ (!thrown && (is_missile(obj) || is_ammo(obj))) || /* or use a pole at short range and not mounted... */ - (!thrown && -#ifdef STEED - !u.usteed && -#endif - is_pole(obj)) || + (!thrown && !u.usteed && is_pole(obj)) || /* or throw a missile without the proper bow... */ (is_ammo(obj) && (thrown != HMON_THROWN || !ammo_and_launcher(obj, uwep)))) { @@ -693,14 +685,12 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ && mon_hates_silver(mon)) { silvermsg = TRUE; silverobj = TRUE; } -#ifdef STEED if (u.usteed && !thrown && tmp > 0 && weapon_type(obj) == P_LANCE && mon != u.ustuck) { jousting = joust(mon, obj); /* exercise skill even for minimal damage hits */ if (jousting) valid_weapon_attack = TRUE; } -#endif if (thrown == HMON_THROWN && (is_ammo(obj) || is_missile(obj))) { if (ammo_and_launcher(obj, uwep)) { @@ -991,7 +981,6 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ } } -#ifdef STEED if (jousting) { tmp += d(2, (obj == uwep) ? 10 : 2); /* [was in dmgval()] */ You("joust %s%s", @@ -1012,11 +1001,8 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ if (DEADMONSTER(mon)) already_killed = TRUE; } hittxt = TRUE; - } else -#endif - - /* VERY small chance of stunning opponent if unarmed. */ - if (unarmed && tmp > 1 && !thrown && !obj && !Upolyd) { + } else if (unarmed && tmp > 1 && !thrown && !obj && !Upolyd) { + /* VERY small chance of stunning opponent if unarmed. */ if (rnd(100) < P_SKILL(P_BARE_HANDED_COMBAT) && !bigmonst(mdat) && !thick_skinned(mdat)) { if (canspotmon(mon)) diff --git a/src/weapon.c b/src/weapon.c index 568c2d669..fc3258c6b 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -43,9 +43,7 @@ STATIC_VAR NEARDATA const short skill_names_indices[P_NUM_SKILLS] = { PN_CLERIC_SPELL, PN_ESCAPE_SPELL, PN_MATTER_SPELL, PN_BARE_HANDED, PN_TWO_WEAPONS, -#ifdef STEED PN_RIDING -#endif }; /* note: entry [0] isn't used */ @@ -1184,7 +1182,6 @@ struct obj *weapon; bonus = ((bonus + 2) * (martial_bonus() ? 2 : 1)) / 2; } -#ifdef STEED /* KMH -- It's harder to hit while you are riding */ if (u.usteed) { switch (P_SKILL(P_RIDING)) { @@ -1196,7 +1193,6 @@ struct obj *weapon; } if (u.twoweap) bonus -= 2; } -#endif return bonus; } @@ -1253,7 +1249,6 @@ struct obj *weapon; bonus = ((bonus + 1) * (martial_bonus() ? 3 : 1)) / 2; } -#ifdef STEED /* KMH -- Riding gives some thrusting damage */ if (u.usteed && type != P_TWO_WEAPON_COMBAT) { switch (P_SKILL(P_RIDING)) { @@ -1264,7 +1259,6 @@ struct obj *weapon; case P_EXPERT: bonus += 2; break; } } -#endif return bonus; } @@ -1326,10 +1320,8 @@ const struct def_skill *class_skill; P_SKILL(P_BARE_HANDED_COMBAT) = P_BASIC; /* Roles that start with a horse know how to ride it */ -#ifdef STEED if (urole.petnum == PM_PONY) P_SKILL(P_RIDING) = P_BASIC; -#endif /* * Make sure we haven't missed setting the max on a skill diff --git a/src/wield.c b/src/wield.c index 7d7c2d6af..32a3e1eb4 100644 --- a/src/wield.c +++ b/src/wield.c @@ -106,10 +106,7 @@ register struct obj *obj; unweapon = (obj->oclass == WEAPON_CLASS) ? is_launcher(obj) || is_ammo(obj) || is_missile(obj) || (is_pole(obj) -#ifdef STEED - && !u.usteed -#endif - ) : !is_weptool(obj); + && !u.usteed) : !is_weptool(obj); } else unweapon = TRUE; /* for "bare hands" message */ update_inventory(); @@ -288,11 +285,7 @@ dowield() return (doswapweapon()); else if (wep == uquiver) setuqwep((struct obj *) 0); - else if (wep->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL -#ifdef STEED - | W_SADDLE -#endif - )) { + else if (wep->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL | W_SADDLE)) { You("cannot wield that!"); return (0); } @@ -392,10 +385,7 @@ dowieldquiver() !is_plural(uwep) ? "That is" : "They are"); return(0); } else if (newquiver->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL -#ifdef STEED - | W_SADDLE -#endif - )) { + | W_SADDLE)) { You("cannot ready that!"); return (0); } else { diff --git a/src/worn.c b/src/worn.c index 4371d789a..bea315bdc 100644 --- a/src/worn.c +++ b/src/worn.c @@ -169,10 +169,8 @@ struct obj *obj; res = W_TOOL; /* WORN_BLINDF */ else if (is_weptool(obj) || otyp == TIN_OPENER) res = W_WEP|W_SWAPWEP; -#ifdef STEED else if (otyp == SADDLE) res = W_SADDLE; -#endif break; case FOOD_CLASS: if (obj->otyp == MEAT_RING) res = W_RINGL|W_RINGR; @@ -382,10 +380,8 @@ boolean on, silently; break; } -#ifdef STEED if (!on && mon == u.usteed && obj->otyp == SADDLE) dismount_steed(DISMOUNT_FELL); -#endif /* if couldn't see it but now can, or vice versa, update display */ if (!silently && (unseen ^ !canseemon(mon))) @@ -837,7 +833,6 @@ boolean polyspot; m_lose_armor(mon, otmp); } } -#ifdef STEED if (!can_saddle(mon)) { if ((otmp = which_armor(mon, W_SADDLE)) != 0) { if (polyspot) bypass_obj(otmp); @@ -861,7 +856,6 @@ boolean polyspot; } dismount_steed(DISMOUNT_FELL); } -#endif return; } diff --git a/src/zap.c b/src/zap.c index 5c95dde0d..41723a566 100644 --- a/src/zap.c +++ b/src/zap.c @@ -26,9 +26,7 @@ STATIC_DCL int FDECL(stone_to_flesh_obj, (struct obj *)); STATIC_DCL boolean FDECL(zap_updown, (struct obj *)); STATIC_DCL void FDECL(zhitu, (int,int,const char *,XCHAR_P,XCHAR_P)); STATIC_DCL void FDECL(revive_egg, (struct obj *)); -#ifdef STEED STATIC_DCL boolean FDECL(zap_steed, (struct obj *)); -#endif STATIC_DCL void FDECL(skiprange, (int,int *,int *)); STATIC_DCL int FDECL(zap_hit, (int,int)); @@ -300,7 +298,6 @@ struct obj *otmp; } else if (openfallingtrap(mtmp, TRUE, &learn_it)) { /* mtmp might now be on the migrating monsters list */ break; -#ifdef STEED } else if ((obj = which_armor(mtmp, W_SADDLE)) != 0) { char buf[BUFSZ]; @@ -316,7 +313,6 @@ struct obj *otmp; } obj_extract_self(obj); mdrop_obj(mtmp, obj, FALSE); -#endif /* STEED */ } break; case SPE_HEALING: @@ -2433,7 +2429,6 @@ long duration; return FALSE; } -#ifdef STEED /* you've zapped a wand downwards while riding * Return TRUE if the steed was hit by the wand. * Return FALSE if the steed was not hit by the wand. @@ -2495,7 +2490,6 @@ struct obj *obj; /* wand or spell */ } return steedhit; } -#endif /* * cancel a monster (possibly the hero). inventory is cancelled only @@ -2772,13 +2766,10 @@ struct obj *obj; boolean disclose = FALSE, was_unkn = !objects[otyp].oc_name_known; exercise(A_WIS, TRUE); -#ifdef STEED if (u.usteed && (objects[otyp].oc_dir != NODIR) && !u.dx && !u.dy && (u.dz > 0) && zap_steed(obj)) { disclose = TRUE; - } else -#endif - if (objects[otyp].oc_dir == IMMEDIATE) { + } else if (objects[otyp].oc_dir == IMMEDIATE) { zapsetup(); /* reset obj_zapped */ if (u.uswallow) { (void) bhitm(u.ustuck, obj); @@ -3769,9 +3760,7 @@ register int dx,dy; if (mon) { if (type == ZT_SPELL(ZT_FIRE)) break; if (type >= 0) mon->mstrategy &= ~STRAT_WAITMASK; -#ifdef STEED buzzmonst: -#endif if (zap_hit(find_mac(mon), spell_type)) { if (mon_reflects(mon, (char *)0)) { if(cansee(mon->mx,mon->my)) { @@ -3838,13 +3827,10 @@ register int dx,dy; } } else if (sx == u.ux && sy == u.uy && range >= 0) { nomul(0); -#ifdef STEED if (u.usteed && !rn2(3) && !mon_reflects(u.usteed, (char *)0)) { mon = u.usteed; goto buzzmonst; - } else -#endif - if (zap_hit((int) u.uac, 0)) { + } else if (zap_hit((int) u.uac, 0)) { range -= 2; pline("%s hits you!", The(fltxt)); if (Reflecting) { diff --git a/util/makedefs.c b/util/makedefs.c index dbedfe45b..c4ac5f3b5 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1005,11 +1005,8 @@ make_version() #ifdef TOURIST | (1L << 10) #endif -#ifdef STEED - | (1L << 11) -#endif #ifdef GOLDOBJ - | (1L << 12) + | (1L << 11) #endif /* flag bits and/or other global variables (15..26) */ #ifdef TEXTCOLOR @@ -1307,9 +1304,6 @@ static const char *build_opts[] = { #ifdef REINCARNATION "rogue level", #endif -#ifdef STEED - "saddles and riding", -#endif #ifdef SCORE_ON_BOTL "score on status line", #endif diff --git a/win/gnome/gnmain.c b/win/gnome/gnmain.c index 45c55ef2f..53273c407 100644 --- a/win/gnome/gnmain.c +++ b/win/gnome/gnmain.c @@ -366,14 +366,12 @@ GnomeUIInfo action_menu[] = { ghack_accelerator_selected, GINT_TO_POINTER(M('j')), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'j',GDK_MOD1_MASK }, -#ifdef STEED { GNOME_APP_UI_ITEM, N_("Ride"), N_("Ride (or stop riding) a monster"), doride, GINT_TO_POINTER(M('r')), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'R',GDK_MOD1_MASK }, -#endif { GNOME_APP_UI_ITEM, N_("Wipe face"), N_("wipe off your face"), diff --git a/win/share/tilemap.c b/win/share/tilemap.c index 87423f49c..9672b6568 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -81,9 +81,6 @@ struct conditionals { { OBJ_GLYPH, LEATHER_JACKET, "T-shirt" }, { OBJ_GLYPH, LOCK_PICK, "credit card" }, { OBJ_GLYPH, MAGIC_LAMP, "expensive camera" }, -#endif -#ifndef STEED - { OBJ_GLYPH, TOWEL, "saddle" }, #endif /* allow slime mold to look like slice of pizza, since we * don't know what a slime mold should look like when renamed anyway From b066b7c170a3d71fd7fe2d292a7f3e19f2103285 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 13 Feb 2015 22:01:44 -0500 Subject: [PATCH 009/354] Make KOPS unconditional. --- include/config.h | 1 - include/monflag.h | 2 -- include/obj.h | 4 ---- src/bones.c | 2 -- src/makemon.c | 2 -- src/mon.c | 4 ---- src/mondata.c | 2 -- src/monst.c | 2 -- src/muse.c | 21 ++++++--------------- src/objects.c | 2 -- src/shk.c | 22 ---------------------- src/sit.c | 2 -- src/sounds.c | 2 -- src/weapon.c | 13 ++----------- util/makedefs.c | 8 +------- win/share/tilemap.c | 9 --------- 16 files changed, 9 insertions(+), 89 deletions(-) diff --git a/include/config.h b/include/config.h index 715fc746a..3e06382b8 100644 --- a/include/config.h +++ b/include/config.h @@ -423,7 +423,6 @@ typedef unsigned char uchar; #define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */ #define REINCARNATION /* Special Rogue-like levels */ /* monsters & objects */ -#define KOPS /* Keystone Kops by Scott R. Turner */ #define SEDUCE /* Succubi/incubi seduction, by KAA, suggested by IM */ #define TOURIST /* Tourist players with cameras and Hawaiian shirts */ /* I/O */ diff --git a/include/monflag.h b/include/monflag.h index 103060a41..bf6875581 100644 --- a/include/monflag.h +++ b/include/monflag.h @@ -29,9 +29,7 @@ #define MS_IMITATE 19 /* imitates others (leocrotta) */ #define MS_ORC MS_GRUNT /* intelligent brutes */ #define MS_HUMANOID 20 /* generic traveling companion */ -#ifdef KOPS #define MS_ARREST 21 /* "Stop in the name of the law!" (Kops) */ -#endif #define MS_SOLDIER 22 /* army and watchmen expressions */ #define MS_GUARD 23 /* "Please drop that gold and follow me." */ #define MS_DJINNI 24 /* "Thank you for freeing me!" */ diff --git a/include/obj.h b/include/obj.h index 8d302c0ae..3d0e5d88d 100644 --- a/include/obj.h +++ b/include/obj.h @@ -312,12 +312,8 @@ struct obj { (obj)->otyp == TOUCHSTONE) /* misc */ -#ifdef KOPS #define is_flimsy(otmp) (objects[(otmp)->otyp].oc_material <= LEATHER || \ (otmp)->otyp == RUBBER_HOSE) -#else -#define is_flimsy(otmp) (objects[(otmp)->otyp].oc_material <= LEATHER) -#endif /* helpers, simple enough to be macros */ #define is_plural(o) ((o)->quan > 1 || \ diff --git a/src/bones.c b/src/bones.c index 1d3b54eec..e6c33a262 100644 --- a/src/bones.c +++ b/src/bones.c @@ -372,9 +372,7 @@ struct obj *corpse; (mptr == &mons[PM_ORACLE] && !fixuporacle(mtmp))) mongone(mtmp); } -#ifdef STEED if (u.usteed) dismount_steed(DISMOUNT_BONES); -#endif dmonsfree(); /* discard dead or gone monsters */ /* mark all fruits as nonexistent; when we come to them we'll mark diff --git a/src/makemon.c b/src/makemon.c index 11051eab5..72f3ae6b9 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -313,14 +313,12 @@ register struct monst *mtmp; } } break; -# ifdef KOPS case S_KOP: /* create Keystone Kops with cream pies to * throw. As suggested by KAA. [MRS] */ if (!rn2(4)) m_initthrow(mtmp, CREAM_PIE, 2); if (!rn2(3)) (void)mongets(mtmp,(rn2(2)) ? CLUB : RUBBER_HOSE); break; -# endif case S_ORC: if(rn2(2)) (void)mongets(mtmp, ORCISH_HELM); switch (mm != PM_ORC_CAPTAIN ? mm : diff --git a/src/mon.c b/src/mon.c index 917e919c9..5be8c8e8a 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1626,7 +1626,6 @@ register struct monst *mtmp; if (tmp == PM_MAIL_DAEMON) mvitals[tmp].mvflags |= G_GENOD; #endif -#ifdef KOPS if (mtmp->data->mlet == S_KOP) { /* Dead Kops may come back. */ switch(rnd(5)) { @@ -1640,7 +1639,6 @@ register struct monst *mtmp; break; } } -#endif if(mtmp->iswiz) wizdead(); if(mtmp->data->msound == MS_NEMESIS) nemdead(); if(glyph_is_invisible(levl[mtmp->mx][mtmp->my].glyph)) @@ -1992,10 +1990,8 @@ int dest; if (!rn2(6) && !(mvitals[mndx].mvflags & G_NOCORPSE) && /* no extra item from swallower or steed */ (x != u.ux || y != u.uy) && -#ifdef KOPS /* no extra item from kops--too easy to abuse */ mdat->mlet != S_KOP && -#endif /* reduced chance of item from cloned monster */ (!mtmp->mcloned || !rn2(mvitals[mndx].died / 5 + 1))) { otmp = mkobj(RANDOM_CLASS, TRUE); diff --git a/src/mondata.c b/src/mondata.c index 2cdf41cef..98c3244f5 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -858,11 +858,9 @@ static const short grownups[][2] = { {PM_ACOLYTE, PM_PRIEST}, {PM_APPRENTICE, PM_WIZARD}, {PM_MANES,PM_LEMURE}, -#ifdef KOPS {PM_KEYSTONE_KOP, PM_KOP_SERGEANT}, {PM_KOP_SERGEANT, PM_KOP_LIEUTENANT}, {PM_KOP_LIEUTENANT, PM_KOP_KAPTAIN}, -#endif {NON_PM,NON_PM} }; diff --git a/src/monst.c b/src/monst.c index d774d1f2a..b85449ca2 100644 --- a/src/monst.c +++ b/src/monst.c @@ -1595,7 +1595,6 @@ struct permonst _mons2[] = { M1_ANIMAL|M1_FLY|M1_CARNIVORE, M2_HOSTILE|M2_STRONG|M2_NASTY|M2_COLLECT, M3_INFRAVISIBLE, HI_LORD), #endif -#ifdef KOPS /* * Kops */ @@ -1627,7 +1626,6 @@ struct permonst _mons2[] = { SIZ(WT_HUMAN, 200, MS_ARREST, MZ_HUMAN), 0, 0, M1_HUMANOID, M2_HUMAN|M2_WANDER|M2_HOSTILE|M2_STRONG|M2_MALE|M2_COLLECT, M3_INFRAVISIBLE, HI_LORD), -#endif /* * Liches */ diff --git a/src/muse.c b/src/muse.c index cc540ebb0..a404071c7 100644 --- a/src/muse.c +++ b/src/muse.c @@ -920,11 +920,8 @@ struct monst *mtmp; int trycnt = 0; if(is_animal(pm) || attacktype(pm, AT_EXPL) || mindless(mtmp->data) - || pm->mlet == S_GHOST -# ifdef KOPS - || pm->mlet == S_KOP -# endif - ) return 0; + || pm->mlet == S_GHOST || pm->mlet == S_KOP) + return 0; try_again: switch (rn2(8 + (difficulty > 3) + (difficulty > 6) + (difficulty > 8))) { @@ -1535,11 +1532,8 @@ struct monst *mtmp; int difficulty = monstr[(monsndx(pm))]; if(is_animal(pm) || attacktype(pm, AT_EXPL) || mindless(mtmp->data) - || pm->mlet == S_GHOST -# ifdef KOPS - || pm->mlet == S_KOP -# endif - ) return 0; + || pm->mlet == S_GHOST || pm->mlet == S_KOP) + return 0; if (difficulty > 7 && !rn2(35)) return WAN_DEATH; switch (rn2(9 - (difficulty < 4) + 4 * (difficulty > 6))) { case 0: { @@ -1943,11 +1937,8 @@ struct monst *mtmp; int difficulty = monstr[(monsndx(pm))]; if(is_animal(pm) || attacktype(pm, AT_EXPL) || mindless(mtmp->data) - || pm->mlet == S_GHOST -# ifdef KOPS - || pm->mlet == S_KOP -# endif - ) return 0; + || pm->mlet == S_GHOST || pm->mlet == S_KOP) + return 0; /* Unlike other rnd_item functions, we only allow _weak_ monsters * to have this item; after all, the item will be used to strengthen * the monster and strong monsters won't use it at all... diff --git a/src/objects.c b/src/objects.c index 86d65a214..1de8dfffe 100644 --- a/src/objects.c +++ b/src/objects.c @@ -242,10 +242,8 @@ WEAPON("war hammer", (char *)0, /* +1 small */ WEAPON("club", (char *)0, 1, 0, 0, 12, 30, 3, 6, 3, 0, B, P_CLUB, WOOD, HI_WOOD), -#ifdef KOPS WEAPON("rubber hose", (char *)0, 1, 0, 0, 0, 20, 3, 4, 3, 0, B, P_WHIP, PLASTIC, CLR_BROWN), -#endif WEAPON("quarterstaff", "staff", 0, 0, 1, 11, 40, 5, 6, 6, 0, B, P_QUARTERSTAFF, WOOD, HI_WOOD), /* two-piece */ diff --git a/src/shk.c b/src/shk.c index 7a4edcbdc..63596950f 100644 --- a/src/shk.c +++ b/src/shk.c @@ -13,11 +13,9 @@ #define PAY_SKIP (-1) #define PAY_BROKE (-2) -#ifdef KOPS STATIC_DCL void FDECL(makekops, (coord *)); STATIC_DCL void FDECL(call_kops, (struct monst *,BOOLEAN_P)); STATIC_DCL void FDECL(kops_gone, (BOOLEAN_P)); -#endif /* KOPS */ #define NOTANGRY(mon) ((mon)->mpeaceful) #define ANGRY(mon) (!NOTANGRY(mon)) @@ -313,7 +311,6 @@ register struct monst *shkp; return(total); } -#ifdef KOPS STATIC_OVL void call_kops(shkp, nearshop) register struct monst *shkp; @@ -364,7 +361,6 @@ register boolean nearshop; makekops(&mm); } } -#endif /* KOPS */ /* x,y is strictly inside shop */ char @@ -420,11 +416,7 @@ boolean newlev; } if (rob_shop(shkp)) { -#ifdef KOPS call_kops(shkp, (!newlev && levl[u.ux0][u.uy0].edge)); -#else - (void) angry_guards(FALSE); -#endif } } @@ -445,12 +437,8 @@ xchar x, y; return; if (rob_shop(shkp)) { -#ifdef KOPS /*[might want to set 2nd arg based on distance from shop doorway]*/ call_kops(shkp, FALSE); -#else - (void) angry_guards(FALSE); -#endif } } @@ -941,11 +929,7 @@ register boolean killkops; (void) mnearto(shkp, x, y, TRUE); level.flags.has_shop = 1; if (killkops) { -#ifdef KOPS kops_gone(TRUE); -#else - You_feel("vaguely apprehensive."); -#endif pacify_guards(); } after_shk_move(shkp); @@ -1065,9 +1049,7 @@ make_happy_shoppers(silentkops) boolean silentkops; { if (!angry_shk_exists()) { -#ifdef KOPS kops_gone(silentkops); -#endif pacify_guards(); } } @@ -3655,7 +3637,6 @@ register int fall; } } -#ifdef KOPS STATIC_OVL void makekops(mm) coord *mm; @@ -3680,7 +3661,6 @@ coord *mm; (void) makemon(&mons[mndx], mm->x, mm->y, NO_MM_FLAGS); } } -#endif /* KOPS */ void pay_for_damage(dmgstr, cant_mollify) @@ -4052,7 +4032,6 @@ struct monst *shkp; pline("%s talks about the problem of shoplifters.",shkname(shkp)); } -#ifdef KOPS STATIC_OVL void kops_gone(silent) register boolean silent; @@ -4071,7 +4050,6 @@ register boolean silent; pline_The("Kop%s (disappointed) vanish%s into thin air.", plur(cnt), cnt == 1 ? "es" : ""); } -#endif /* KOPS */ STATIC_OVL long cost_per_charge(shkp, otmp, altusage) diff --git a/src/sit.c b/src/sit.c index 4b8e2e7d1..c91a96a24 100644 --- a/src/sit.c +++ b/src/sit.c @@ -43,12 +43,10 @@ dosit() register struct trap *trap = t_at(u.ux,u.uy); register int typ = levl[u.ux][u.uy].typ; -#ifdef STEED if (u.usteed) { You("are already sitting on %s.", mon_nam(u.usteed)); return (0); } -#endif if (u.uundetected && is_hider(youmonst.data) && u.umonnum != PM_TRAPPER) u.uundetected = 0; /* no longer on the ceiling */ diff --git a/src/sounds.c b/src/sounds.c index 27749d8b0..bd20178c0 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -834,7 +834,6 @@ register struct monst *mtmp; } } break; -#ifdef KOPS case MS_ARREST: if (mtmp->mpeaceful) verbalize("Just the facts, %s.", @@ -848,7 +847,6 @@ register struct monst *mtmp; verbl_msg = arrest_msg[rn2(3)]; } break; -#endif case MS_BRIBE: if (mtmp->mpeaceful && !mtmp->mtame) { (void) demon_talk(mtmp); diff --git a/src/weapon.c b/src/weapon.c index fc3258c6b..796fba66a 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -370,7 +370,6 @@ static NEARDATA const int rwep[] = ORCISH_ARROW, CROSSBOW_BOLT, SILVER_DAGGER, ELVEN_DAGGER, DAGGER, ORCISH_DAGGER, KNIFE, FLINT, ROCK, LOADSTONE, LUCKSTONE, DART, /* BOOMERANG, */ CREAM_PIE - /* note: CREAM_PIE should NOT be #ifdef KOPS */ }; static NEARDATA const int pwep[] = @@ -389,16 +388,12 @@ register struct monst *mtmp; boolean mweponly; int i; -#ifdef KOPS char mlet = mtmp->data->mlet; -#endif propellor = &zeroobj; Oselect(EGG); /* cockatrice egg */ -#ifdef KOPS if(mlet == S_KOP) /* pies are first choice for Kops */ Oselect(CREAM_PIE); -#endif if(throws_rocks(mtmp->data)) /* ...boulders for giants */ Oselect(BOULDER); @@ -508,12 +503,8 @@ static const NEARDATA short hwep[] = { MORNING_STAR, ELVEN_SHORT_SWORD, DWARVISH_SHORT_SWORD, SHORT_SWORD, ORCISH_SHORT_SWORD, MACE, AXE, DWARVISH_SPEAR, SILVER_SPEAR, ELVEN_SPEAR, SPEAR, ORCISH_SPEAR, FLAIL, BULLWHIP, QUARTERSTAFF, - JAVELIN, AKLYS, CLUB, PICK_AXE, -#ifdef KOPS - RUBBER_HOSE, -#endif /* KOPS */ - WAR_HAMMER, SILVER_DAGGER, ELVEN_DAGGER, DAGGER, ORCISH_DAGGER, - ATHAME, SCALPEL, KNIFE, WORM_TOOTH + JAVELIN, AKLYS, CLUB, PICK_AXE, RUBBER_HOSE, WAR_HAMMER, SILVER_DAGGER, + ELVEN_DAGGER, DAGGER, ORCISH_DAGGER, ATHAME, SCALPEL, KNIFE, WORM_TOOTH }; struct obj * diff --git a/util/makedefs.c b/util/makedefs.c index c4ac5f3b5..57493448b 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -995,11 +995,8 @@ make_version() | (1L << 2) #endif /* monsters (5..9) */ -#ifdef KOPS - | (1L << 6) -#endif #ifdef MAIL - | (1L << 7) + | (1L << 6) #endif /* objects (10..14) */ #ifdef TOURIST @@ -1263,9 +1260,6 @@ static const char *build_opts[] = { #ifdef INSURANCE "insurance files for recovering from crashes", #endif -#ifdef KOPS - "Keystone Kops", -#endif #ifdef HOLD_LOCKFILE_OPEN "exclusive lock on level 0 file", #endif diff --git a/win/share/tilemap.c b/win/share/tilemap.c index 9672b6568..97fc7acc4 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -42,12 +42,6 @@ struct conditionals { { MON_GLYPH, PM_BABY_SILVER_DRAGON, "baby shimmering dragon" }, { MON_GLYPH, PM_SILVER_DRAGON, "shimmering dragon" }, { MON_GLYPH, PM_JABBERWOCK, "vorpal jabberwock" }, -#ifndef KOPS - { MON_GLYPH, PM_JABBERWOCK, "Keystone Kop" }, - { MON_GLYPH, PM_JABBERWOCK, "Kop Sergeant" }, - { MON_GLYPH, PM_JABBERWOCK, "Kop Lieutenant" }, - { MON_GLYPH, PM_JABBERWOCK, "Kop Kaptain" }, -#endif { MON_GLYPH, PM_VAMPIRE_LORD, "vampire mage" }, #ifndef CHARON /* not supported yet */ { MON_GLYPH, PM_CROESUS, "Charon" }, @@ -69,9 +63,6 @@ struct conditionals { { MON_GLYPH, PM_NEANDERTHAL, "High-elf" }, #ifndef TOURIST { MON_GLYPH, PM_ROSHI, "guide" }, -#endif -#ifndef KOPS - { OBJ_GLYPH, CLUB, "rubber hose" }, #endif /* objects commented out in objects.c at present */ { OBJ_GLYPH, SILVER_DRAGON_SCALE_MAIL, "shimmering dragon scale mail" }, From 5ee71d2757b70b18ceaedfb3ce8b2e4747cc006c Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 13 Feb 2015 23:30:38 -0500 Subject: [PATCH 010/354] Make SINKS unconditional. --- dat/oracles.txt | 2 +- include/config.h | 1 - include/extern.h | 2 -- src/cmd.c | 2 -- src/dig.c | 4 ---- src/do.c | 6 ------ src/dogmove.c | 2 -- src/dokick.c | 4 ---- src/drawing.c | 4 ---- src/fountain.c | 2 -- src/hack.c | 6 ------ src/invent.c | 2 -- src/mklev.c | 7 ------- src/mthrowu.c | 5 +---- src/music.c | 2 -- src/objnam.c | 2 -- src/potion.c | 2 -- src/sit.c | 2 -- src/sounds.c | 2 -- src/zap.c | 4 ---- util/lev_main.c | 5 ----- util/makedefs.c | 9 --------- win/share/tilemap.c | 21 ++++----------------- 23 files changed, 6 insertions(+), 92 deletions(-) diff --git a/dat/oracles.txt b/dat/oracles.txt index d307c7a9f..d4d5ae250 100644 --- a/dat/oracles.txt +++ b/dat/oracles.txt @@ -48,7 +48,7 @@ It is well known that wily shopkeepers raise their prices whene'er they espy the garish apparel of the approaching tourist or the countenance of a disfavored patron. They favor the gentle of manner and the fair of face. The boor may expect unprofitable transactions. ------ SINKS +----- The cliche of the kitchen sink swallowing any unfortunate rings that contact its pernicious surface reflecteth greater truth than many homilies, yet even so, few have developed the skill to identify enchanted rings by the diff --git a/include/config.h b/include/config.h index 3e06382b8..5fb8bd9a8 100644 --- a/include/config.h +++ b/include/config.h @@ -418,7 +418,6 @@ typedef unsigned char uchar; /* display features */ #define LOADSYMSETS /* loadable symbol sets; only default symbols w/o this */ /* dungeon features */ -#define SINKS /* Kitchen sinks - Janet Walz */ /* dungeon levels */ #define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */ #define REINCARNATION /* Special Rogue-like levels */ diff --git a/include/extern.h b/include/extern.h index 866da61ec..8ffac991d 100644 --- a/include/extern.h +++ b/include/extern.h @@ -784,10 +784,8 @@ E void FDECL(gush, (int,int,genericptr_t)); E void FDECL(dryup, (XCHAR_P,XCHAR_P, BOOLEAN_P)); E void NDECL(drinkfountain); E void FDECL(dipfountain, (struct obj *)); -#ifdef SINKS E void FDECL(breaksink, (int,int)); E void NDECL(drinksink); -#endif /* ### hack.c ### */ diff --git a/src/cmd.c b/src/cmd.c index 78981c274..2abb73a07 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -876,11 +876,9 @@ wiz_map_levltyp(VOID_ARGS) if (level.flags.nfountains) Sprintf(eos(dsc), " %c:%d", defsyms[S_fountain].sym, (int)level.flags.nfountains); -#ifdef SINKS if (level.flags.nsinks) Sprintf(eos(dsc), " %c:%d", defsyms[S_sink].sym, (int)level.flags.nsinks); -#endif if (level.flags.has_vault) Strcat(dsc, " vault"); if (level.flags.has_shop) Strcat(dsc, " shop"); if (level.flags.has_temple) Strcat(dsc, " temple"); diff --git a/src/dig.c b/src/dig.c index ae4571218..dee64940c 100644 --- a/src/dig.c +++ b/src/dig.c @@ -542,11 +542,9 @@ int ttyp; SET_FOUNTAIN_WARNED(x,y); /* force dryup */ dryup(x, y, madeby_u); return; -#ifdef SINKS } else if (IS_SINK(lev->typ)) { breaksink(x, y); return; -#endif } else if (lev->typ == DRAWBRIDGE_DOWN || (is_drawbridge_wall(x, y) >= 0)) { int bx = x, by = y; @@ -1533,11 +1531,9 @@ char *msg; } else if (is_pool(cc->x,cc->y)) { } else if (IS_GRAVE(ltyp)) { #endif -#ifdef SINKS } else if (IS_SINK(ltyp)) { Strcpy(msg, "A tangled mass of plumbing remains below the sink."); return FALSE; -#endif } else if ((cc->x == xupladder && cc->y == yupladder) || /* "ladder up" */ (cc->x == xdnladder && cc->y == ydnladder)) { /* "ladder down" */ Strcpy(msg, "The ladder is unaffected."); diff --git a/src/do.c b/src/do.c index 1f51c14cc..35b0b9c40 100644 --- a/src/do.c +++ b/src/do.c @@ -8,10 +8,8 @@ #include "hack.h" #include "lev.h" -#ifdef SINKS STATIC_DCL void FDECL(trycall, (struct obj *)); STATIC_DCL void FDECL(dosinkring, (struct obj *)); -#endif /* SINKS */ STATIC_PTR int FDECL(drop, (struct obj *)); STATIC_PTR int NDECL(wipeoff); @@ -244,7 +242,6 @@ doaltarobj(obj) /* obj is an object dropped on an altar */ } } -#ifdef SINKS STATIC_OVL void trycall(obj) @@ -396,7 +393,6 @@ giveback: } else useup(obj); } -#endif /* some common tests when trying to drop or throw items */ boolean @@ -475,13 +471,11 @@ register struct obj *obj; mbodypart(u.ustuck, STOMACH)); } } else { -#ifdef SINKS if((obj->oclass == RING_CLASS || obj->otyp == MEAT_RING) && IS_SINK(levl[u.ux][u.uy].typ)) { dosinkring(obj); return(1); } -#endif if (!can_reach_floor(TRUE)) { /* we might be levitating due to #invoke Heart of Ahriman; if so, levitation would end during call to freeinv() diff --git a/src/dogmove.c b/src/dogmove.c index 6baa47651..795905393 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -1001,9 +1001,7 @@ static struct qmchoices { {PM_HOUSECAT, 0, PM_DOG, M_AP_MONSTER}, {PM_LARGE_CAT, 0, PM_LARGE_DOG, M_AP_MONSTER}, {PM_HOUSECAT, 0, PM_GIANT_RAT, M_AP_MONSTER}, -#ifdef SINKS {0, S_DOG, SINK, M_AP_FURNITURE}, /* sorry, no fire hydrants in NetHack */ -#endif {0, 0, TRIPE_RATION, M_AP_OBJECT}, /* leave this at end */ }; diff --git a/src/dokick.c b/src/dokick.c index 1b122e799..d0b20a604 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -688,9 +688,7 @@ char *buf; else if (IS_THRONE(maploc->typ)) what = "a throne"; else if (IS_FOUNTAIN(maploc->typ)) what = "a fountain"; else if (IS_GRAVE(maploc->typ)) what = "a headstone"; -#ifdef SINKS else if (IS_SINK(maploc->typ)) what = "a sink"; -#endif else if (IS_ALTAR(maploc->typ)) what = "an altar"; else if (IS_DRAWBRIDGE(maploc->typ)) what = "a drawbridge"; else if (maploc->typ == STAIRS) what = "the stairs"; @@ -1054,7 +1052,6 @@ dokick() } goto ouch; } -#ifdef SINKS if(IS_SINK(maploc->typ)) { int gend = poly_gender(); short washerndx = (gend == 1 || (gend == 2 && rn2(2))) ? @@ -1107,7 +1104,6 @@ dokick() } goto ouch; } -#endif if (maploc->typ == STAIRS || maploc->typ == LADDER || IS_STWALL(maploc->typ)) { if(!IS_STWALL(maploc->typ) && maploc->ladder == LA_DOWN) diff --git a/src/drawing.c b/src/drawing.c index 2d104be20..80e82133f 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -169,11 +169,7 @@ const struct symdef defsyms[MAXPCHARS] = { {'_', "altar", C(CLR_GRAY)}, /* altar */ {'|', "grave", C(CLR_GRAY)}, /* grave */ {'\\', "opulent throne",C(HI_GOLD)}, /* throne */ -#ifdef SINKS {'#', "sink", C(CLR_GRAY)}, /* sink */ -#else - {'#', "", C(CLR_GRAY)}, /* sink */ -#endif /*30*/ {'{', "fountain", C(CLR_BLUE)}, /* fountain */ {'}', "water", C(CLR_BLUE)}, /* pool */ {'.', "ice", C(CLR_CYAN)}, /* ice */ diff --git a/src/fountain.c b/src/fountain.c index 14fb6707e..c49efac69 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -504,7 +504,6 @@ register struct obj *obj; dryup(u.ux, u.uy, TRUE); } -#ifdef SINKS void breaksink(x,y) int x, y; @@ -610,6 +609,5 @@ drinksink() rn2(3) ? (rn2(2) ? "cold" : "warm") : "hot"); } } -#endif /* SINKS */ /*fountain.c*/ diff --git a/src/hack.c b/src/hack.c index fc62e71a4..1bbfa1977 100644 --- a/src/hack.c +++ b/src/hack.c @@ -10,9 +10,7 @@ STATIC_DCL void NDECL(maybe_wail); STATIC_DCL int NDECL(moverock); STATIC_DCL int FDECL(still_chewing,(XCHAR_P,XCHAR_P)); -#ifdef SINKS STATIC_DCL void NDECL(dosinkfall); -#endif STATIC_DCL boolean FDECL(findtravelpath, (BOOLEAN_P)); STATIC_DCL boolean FDECL(trapmove, (int,int,struct trap *)); STATIC_DCL void NDECL(switch_terrain); @@ -468,7 +466,6 @@ register xchar ox, oy; newsym(ox, oy); } -#ifdef SINKS static NEARDATA const char fell_on_sink[] = "fell onto a sink"; STATIC_OVL void @@ -549,7 +546,6 @@ dosinkfall() through float_down(), but make sure BFlying is up to date */ float_vs_flight(); } -#endif boolean may_dig(x,y) @@ -1767,10 +1763,8 @@ boolean pick; if (pooleffects(TRUE)) goto spotdone; check_special_room(FALSE); -#ifdef SINKS if(IS_SINK(levl[u.ux][u.uy].typ) && Levitation) dosinkfall(); -#endif if (!in_steed_dismounting) { /* if dismounting, we'll check again later */ boolean pit; diff --git a/src/invent.c b/src/invent.c index c6eea5989..90cb9ff1c 100644 --- a/src/invent.c +++ b/src/invent.c @@ -2364,10 +2364,8 @@ char *buf; cmap = S_ice; /* "ice" */ else if (is_pool(x,y)) dfeature = "pool of water"; -#ifdef SINKS else if (IS_SINK(ltyp)) cmap = S_sink; /* "sink" */ -#endif else if (IS_ALTAR(ltyp)) { Sprintf(altbuf, "%saltar to %s (%s)", ((lev->altarmask & AM_SHRINE) && diff --git a/src/mklev.c b/src/mklev.c index 8e3b267d1..1d895dc2c 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -20,9 +20,7 @@ STATIC_DCL void FDECL(mkfount,(int,struct mkroom *)); -#ifdef SINKS STATIC_DCL void FDECL(mksink,(struct mkroom *)); -#endif STATIC_DCL void FDECL(mkaltar,(struct mkroom *)); STATIC_DCL void FDECL(mkgrave,(struct mkroom *)); STATIC_DCL void NDECL(makevtele); @@ -790,9 +788,7 @@ skip0: if(Is_rogue_level(&u.uz)) goto skip_nonrogue; #endif if(!rn2(10)) mkfount(0,croom); -#ifdef SINKS if(!rn2(60)) mksink(croom); -#endif if(!rn2(60)) mkaltar(croom); x = 80 - (depth(&u.uz) * 2); if (x < 2) x = 2; @@ -1347,7 +1343,6 @@ register struct mkroom *croom; level.flags.nfountains++; } -#ifdef SINKS STATIC_OVL void mksink(croom) register struct mkroom *croom; @@ -1366,8 +1361,6 @@ register struct mkroom *croom; level.flags.nsinks++; } -#endif /* SINKS */ - STATIC_OVL void mkaltar(croom) diff --git a/src/mthrowu.c b/src/mthrowu.c index 02339c0ad..8a9ed6736 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -431,11 +431,8 @@ struct obj *obj; /* missile (or stack providing it) */ /* missile might hit iron bars */ || (levl[bhitpos.x+dx][bhitpos.y+dy].typ == IRONBARS && hits_bars(&singleobj, bhitpos.x, bhitpos.y, !rn2(5), 0)) -#ifdef SINKS /* Thrown objects "sink" */ - || IS_SINK(levl[bhitpos.x][bhitpos.y].typ) -#endif - ) { + || IS_SINK(levl[bhitpos.x][bhitpos.y].typ)) { if (singleobj) /* hits_bars might have destroyed it */ (void) drop_throw(singleobj, 0, bhitpos.x, bhitpos.y); break; diff --git a/src/music.c b/src/music.c index 4491b8909..94f6282d1 100644 --- a/src/music.c +++ b/src/music.c @@ -275,12 +275,10 @@ int force; if (cansee(x,y)) pline_The("fountain falls into a chasm."); goto do_pit; -#ifdef SINKS case SINK : if (cansee(x,y)) pline_The("kitchen sink falls into a chasm."); goto do_pit; -#endif case ALTAR : if (Is_astralevel(&u.uz) || Is_sanctum(&u.uz)) break; diff --git a/src/objnam.c b/src/objnam.c index 94c2f4fb6..e1b00a777 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -2913,7 +2913,6 @@ wiztrap: newsym(x, y); return(&zeroobj); } -# ifdef SINKS if (!BSTRCMPI(bp, p-4, "sink")) { lev->typ = SINK; level.flags.nsinks++; @@ -2921,7 +2920,6 @@ wiztrap: newsym(x, y); return &zeroobj; } -# endif /* ("water" matches "potion of water" rather than terrain) */ if (!BSTRCMPI(bp, p-4, "pool") || !BSTRCMPI(bp, p-4, "moat")) { lev->typ = !BSTRCMPI(bp, p-4, "pool") ? POOL : MOAT; diff --git a/src/potion.c b/src/potion.c index 396dbfa53..7a4014635 100644 --- a/src/potion.c +++ b/src/potion.c @@ -399,7 +399,6 @@ dodrink() return 1; } } -#ifdef SINKS /* Or a kitchen sink? */ if (IS_SINK(levl[u.ux][u.uy].typ) && /* not as low as floor level but similar restrictions apply */ @@ -409,7 +408,6 @@ dodrink() return 1; } } -#endif /* Or are you surrounded by water? */ if (Underwater && !u.uswallow) { diff --git a/src/sit.c b/src/sit.c index c91a96a24..72c94c56b 100644 --- a/src/sit.c +++ b/src/sit.c @@ -126,11 +126,9 @@ dosit() (void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst); if (!rn2(10) && uarmf && uarmf->otyp != WATER_WALKING_BOOTS) (void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst); -#ifdef SINKS } else if(IS_SINK(typ)) { You(sit_message, defsyms[S_sink].explanation); Your("%s gets wet.", humanoid(youmonst.data) ? "rump" : "underside"); -#endif } else if(IS_ALTAR(typ)) { You(sit_message, defsyms[S_altar].explanation); altar_wrath(u.ux, u.uy); diff --git a/src/sounds.c b/src/sounds.c index bd20178c0..efb496372 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -51,7 +51,6 @@ dosounds() }; You_hear1(fountain_msg[rn2(3)+hallu]); } -#ifdef SINK if (level.flags.nsinks && !rn2(300)) { static const char * const sink_msg[3] = { "a slow drip.", @@ -60,7 +59,6 @@ dosounds() }; You_hear1(sink_msg[rn2(2)+hallu]); } -#endif if (level.flags.has_court && !rn2(200)) { static const char * const throne_msg[4] = { "the tones of courtly conversation.", diff --git a/src/zap.c b/src/zap.c index 41723a566..c19557fd0 100644 --- a/src/zap.c +++ b/src/zap.c @@ -3160,10 +3160,8 @@ struct obj **pobj; /* object tossed/used, set to NULL (is_pool(bhitpos.x, bhitpos.y) || is_lava(bhitpos.x, bhitpos.y))) break; -#ifdef SINKS if(IS_SINK(typ) && weapon != FLASHED_LIGHT) break; /* physical objects fall onto sink */ -#endif } /* limit range of ball so hero won't make an invalid move */ if (weapon == THROWN_WEAPON && range > 0 && @@ -3273,10 +3271,8 @@ int dx, dy; } tmp_at(bhitpos.x, bhitpos.y); delay_output(); -#ifdef SINKS if(IS_SINK(levl[bhitpos.x][bhitpos.y].typ)) break; /* boomerang falls on sink */ -#endif /* ct==0, initial position, we want next delta to be same; ct==5, opposite position, repeat delta undoes first one */ if (ct % 5 != 0) i += (counterclockwise ? -1 : 1); diff --git a/util/lev_main.c b/util/lev_main.c index d192e1e3e..fa539f5e2 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -494,12 +494,7 @@ char c; case '{' : return(FOUNTAIN); case '\\' : return(THRONE); case 'K' : -#ifdef SINKS return(SINK); -#else - yywarning("Sinks are not allowed in this version! Ignoring..."); - return(ROOM); -#endif case '}' : return(MOAT); case 'P' : return(POOL); case 'L' : return(LAVAPOOL); diff --git a/util/makedefs.c b/util/makedefs.c index 57493448b..6ddff76c0 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -990,9 +990,6 @@ make_version() /* levels and/or topology (0..4) */ #ifdef REINCARNATION | (1L << 1) -#endif -#ifdef SINKS - | (1L << 2) #endif /* monsters (5..9) */ #ifdef MAIL @@ -1329,9 +1326,6 @@ static const char *build_opts[] = { #ifdef SHELL "shell command", #endif -#ifdef SINKS - "sinks", -#endif #ifdef SUSPEND "suspend command", #endif @@ -1664,9 +1658,6 @@ h_filter(line) if (*line == '#') return TRUE; /* ignore comment lines */ if (sscanf(line, "----- %s", tag) == 1) { skip = FALSE; -#ifndef SINKS - if (!strcmp(tag, "SINKS")) skip = TRUE; -#endif } else if (skip && !strncmp(line, "-----", 5)) skip = FALSE; return skip; diff --git a/win/share/tilemap.c b/win/share/tilemap.c index 97fc7acc4..19872f96a 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 tilemap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tilemap.c $NHDT-Date: 1425082379 2015/02/28 00:12:59 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.12 $ */ /* NetHack 3.5 tilemap.c $Date: 2009/05/06 10:59:02 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)tilemap.c 3.5 2000/06/04 */ /* NetHack may be freely redistributed. See license for details. */ @@ -172,23 +172,10 @@ int set, entry; tilenum = 0; /* set-relative number */ for (i = 0; i < (MAXPCHARS - MAXEXPCHARS); i++) { if (set == OTH_GLYPH && tilenum == entry) { - if (*defsyms[i].explanation) + if (*defsyms[i].explanation) { return defsyms[i].explanation; - else { - /* if SINKS are turned off, this - * string won't be there (and can't be there - * to prevent symbol-identification and - * special-level mimic appearances from - * thinking the items exist) - */ - switch (i) { - case S_sink: - Sprintf(buf, "sink"); - break; - default: - Sprintf(buf, "cmap %d", tilenum); - break; - } + } else { + Sprintf(buf, "cmap %d", tilenum); return buf; } } From 260f7ea8607a2658df6d6182ff95687b5b731d9c Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 13 Feb 2015 23:31:41 -0500 Subject: [PATCH 011/354] Make TOURIST unconditional. --- include/artilist.h | 2 -- include/config.h | 1 - include/decl.h | 2 -- include/extern.h | 2 -- include/prop.h | 6 ---- src/apply.c | 8 ----- src/artifact.c | 6 +--- src/attrib.c | 4 --- src/decl.c | 2 -- src/do_wear.c | 73 ++++++--------------------------------------- src/dogmove.c | 8 ----- src/dokick.c | 5 +--- src/dothrow.c | 4 --- src/invent.c | 19 ++---------- src/lock.c | 23 ++------------ src/mhitu.c | 20 ++----------- src/mkobj.c | 2 -- src/mon.c | 2 -- src/monmove.c | 4 --- src/monst.c | 8 ----- src/mplayer.c | 2 -- src/mthrowu.c | 2 -- src/muse.c | 7 ++--- src/objects.c | 15 ---------- src/objnam.c | 4 --- src/polyself.c | 4 --- src/pray.c | 4 --- src/read.c | 4 --- src/role.c | 6 ---- src/shk.c | 10 ++----- src/sounds.c | 4 --- src/steal.c | 9 +----- src/trap.c | 8 ----- src/u_init.c | 14 --------- src/uhitm.c | 6 ---- src/vault.c | 5 +--- src/worn.c | 18 +---------- src/zap.c | 6 ---- sys/amiga/winami.c | 8 ----- util/makedefs.c | 10 +------ win/Qt/qt_win.cpp | 5 ---- win/gnome/gnworn.c | 11 ------- win/share/tilemap.c | 15 ---------- 43 files changed, 27 insertions(+), 351 deletions(-) diff --git a/include/artilist.h b/include/artilist.h index 2f21d6839..b13a91abd 100644 --- a/include/artilist.h +++ b/include/artilist.h @@ -215,13 +215,11 @@ A("The Tsurugi of Muramasa", TSURUGI, PHYS(0,8), NO_DFNS, NO_CARY, 0, A_LAWFUL, PM_SAMURAI, NON_PM, 4500L ), -#ifdef TOURIST A("The Platinum Yendorian Express Card", CREDIT_CARD, (SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL|SPFX_DEFN), (SPFX_ESP|SPFX_HSPDAM), 0, NO_ATTK, NO_DFNS, CARY(AD_MAGM), CHARGE_OBJ, A_NEUTRAL, PM_TOURIST, NON_PM, 7000L ), -#endif A("The Orb of Fate", CRYSTAL_BALL, (SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL|SPFX_LUCK), diff --git a/include/config.h b/include/config.h index 5fb8bd9a8..c9b17524d 100644 --- a/include/config.h +++ b/include/config.h @@ -423,7 +423,6 @@ typedef unsigned char uchar; #define REINCARNATION /* Special Rogue-like levels */ /* monsters & objects */ #define SEDUCE /* Succubi/incubi seduction, by KAA, suggested by IM */ -#define TOURIST /* Tourist players with cameras and Hawaiian shirts */ /* I/O */ #define REDO /* support for redoing last command - DGK */ #if !defined(MAC) diff --git a/include/decl.h b/include/decl.h index 3e7e94ac3..bfe3052db 100644 --- a/include/decl.h +++ b/include/decl.h @@ -234,9 +234,7 @@ E uchar monsyms[MAXMCLASSES]; /* current class symbols */ #include "obj.h" E NEARDATA struct obj *invent, *uarm, *uarmc, *uarmh, *uarms, *uarmg, *uarmf, -#ifdef TOURIST *uarmu, /* under-wear, so to speak */ -#endif *uskin, *uamul, *uleft, *uright, *ublindf, *uwep, *uswapwep, *uquiver; diff --git a/include/extern.h b/include/extern.h index 8ffac991d..667d598d1 100644 --- a/include/extern.h +++ b/include/extern.h @@ -429,9 +429,7 @@ E int NDECL(Gloves_off); E int NDECL(Boots_off); E int NDECL(Cloak_off); E int NDECL(Shield_off); -#ifdef TOURIST E int NDECL(Shirt_off); -#endif E void NDECL(Amulet_off); E void FDECL(Ring_on, (struct obj *)); E void FDECL(Ring_off, (struct obj *)); diff --git a/include/prop.h b/include/prop.h index 2ca7b871d..89728fa9f 100644 --- a/include/prop.h +++ b/include/prop.h @@ -96,12 +96,8 @@ struct prop { # define W_ARMS 0x00000008L /* Shield */ # define W_ARMG 0x00000010L /* Gloves/gauntlets */ # define W_ARMF 0x00000020L /* Footwear */ -#ifdef TOURIST # define W_ARMU 0x00000040L /* Undershirt */ # define W_ARMOR (W_ARM | W_ARMC | W_ARMH | W_ARMS | W_ARMG | W_ARMF | W_ARMU) -#else -# define W_ARMOR (W_ARM | W_ARMC | W_ARMH | W_ARMS | W_ARMG | W_ARMF) -#endif /* Weapons and artifacts */ # define W_WEP 0x00000100L /* Wielded weapon */ # define W_QUIVER 0x00000200L /* Quiver for (f)iring ammo */ @@ -149,8 +145,6 @@ struct prop { #define WORN_BOOTS W_ARMF #define WORN_AMUL W_AMUL #define WORN_BLINDF W_TOOL -#ifdef TOURIST #define WORN_SHIRT W_ARMU -#endif #endif /* PROP_H */ diff --git a/src/apply.c b/src/apply.c index a5a38dd8a..1ab6153df 100644 --- a/src/apply.c +++ b/src/apply.c @@ -7,9 +7,7 @@ extern boolean notonhead; /* for long worms */ -#ifdef TOURIST STATIC_DCL int FDECL(use_camera, (struct obj *)); -#endif STATIC_DCL int FDECL(use_towel, (struct obj *)); STATIC_DCL boolean FDECL(its_dead, (int,int,int *)); STATIC_DCL int FDECL(use_stethoscope, (struct obj *)); @@ -44,7 +42,6 @@ void FDECL( amii_speaker, ( struct obj *, char *, int ) ); static const char no_elbow_room[] = "don't have enough elbow-room to maneuver."; -#ifdef TOURIST STATIC_OVL int use_camera(obj) struct obj *obj; @@ -82,7 +79,6 @@ use_camera(obj) } return 1; } -#endif STATIC_OVL int use_towel(obj) @@ -3154,9 +3150,7 @@ doapply() use_grease(obj); break; case LOCK_PICK: -#ifdef TOURIST case CREDIT_CARD: -#endif case SKELETON_KEY: res = (pick_lock(obj) != 0); break; @@ -3223,11 +3217,9 @@ doapply() case POT_OIL: light_cocktail(obj); break; -#ifdef TOURIST case EXPENSIVE_CAMERA: res = use_camera(obj); break; -#endif case TOWEL: res = use_towel(obj); break; diff --git a/src/artifact.c b/src/artifact.c index e9351ba92..c9baaf365 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -1687,11 +1687,7 @@ long *abil; long wornbits; long wornmask = (W_ARM | W_ARMC | W_ARMH | W_ARMS | W_ARMG | W_ARMF | W_WEP | W_QUIVER | W_SWAPWEP | W_ART | W_ARTI | W_AMUL | - W_RINGL | W_RINGR | W_TOOL | W_BALL | W_CHAIN | W_SADDLE -#ifdef TOURIST - | W_ARMU -#endif - ); + W_RINGL | W_RINGR | W_TOOL | W_BALL | W_CHAIN | W_SADDLE | W_ARMU); dtyp = abil_to_adtyp(abil); spfx = abil_to_spfx(abil); diff --git a/src/attrib.c b/src/attrib.c index 15377c76c..fbac9949a 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -639,9 +639,7 @@ long frommask; case PM_RANGER: abil = ran_abil; break; case PM_ROGUE: abil = rog_abil; break; case PM_SAMURAI: abil = sam_abil; break; -#ifdef TOURIST case PM_TOURIST: abil = tou_abil; break; -#endif case PM_VALKYRIE: abil = val_abil; break; case PM_WIZARD: abil = wiz_abil; break; default: break; @@ -769,9 +767,7 @@ int oldlevel, newlevel; case PM_RANGER: abil = ran_abil; break; case PM_ROGUE: abil = rog_abil; break; case PM_SAMURAI: abil = sam_abil; break; -#ifdef TOURIST case PM_TOURIST: abil = tou_abil; break; -#endif case PM_VALKYRIE: abil = val_abil; break; case PM_WIZARD: abil = wiz_abil; break; default: abil = 0; break; diff --git a/src/decl.c b/src/decl.c index 963e55324..c9105bee6 100644 --- a/src/decl.c +++ b/src/decl.c @@ -150,9 +150,7 @@ NEARDATA struct obj *invent = (struct obj *)0, *uwep = (struct obj *)0, *uarm = (struct obj *)0, *uswapwep = (struct obj *)0, *uquiver = (struct obj *)0, /* quiver */ -#ifdef TOURIST *uarmu = (struct obj *)0, /* under-wear, so to speak */ -#endif *uskin = (struct obj *)0, /* dragon armor, if a dragon */ *uarmc = (struct obj *)0, *uarmh = (struct obj *)0, *uarms = (struct obj *)0, *uarmg = (struct obj *)0, diff --git a/src/do_wear.c b/src/do_wear.c index efd9a51ff..6b622d7af 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -9,9 +9,7 @@ static NEARDATA const char see_yourself[] = "see yourself"; static NEARDATA const char unknown_type[] = "Unknown type of %s (%d)"; static NEARDATA const char c_armor[] = "armor", c_suit[] = "suit", -#ifdef TOURIST c_shirt[] = "shirt", -#endif c_cloak[] = "cloak", c_gloves[] = "gloves", c_boots[] = "boots", @@ -24,11 +22,8 @@ static NEARDATA const char c_armor[] = "armor", static NEARDATA const long takeoff_order[] = { WORN_BLINDF, W_WEP, WORN_SHIELD, WORN_GLOVES, LEFT_RING, RIGHT_RING, WORN_CLOAK, - WORN_HELMET, WORN_AMUL, WORN_ARMOR, -#ifdef TOURIST - WORN_SHIRT, -#endif - WORN_BOOTS, W_SWAPWEP, W_QUIVER, 0L }; + WORN_HELMET, WORN_AMUL, WORN_ARMOR, WORN_SHIRT, WORN_BOOTS, W_SWAPWEP, + W_QUIVER, 0L }; STATIC_DCL void FDECL(on_msg, (struct obj *)); STATIC_DCL void FDECL(toggle_stealth, (struct obj *,long,BOOLEAN_P)); @@ -40,9 +35,7 @@ STATIC_PTR int NDECL(Helmet_on); STATIC_PTR int NDECL(Gloves_on); STATIC_DCL void FDECL(wielding_corpse, (struct obj *,BOOLEAN_P)); STATIC_PTR int NDECL(Shield_on); -#ifdef TOURIST STATIC_PTR int NDECL(Shirt_on); -#endif STATIC_DCL void NDECL(Amulet_on); STATIC_DCL void FDECL(learnring, (struct obj *,BOOLEAN_P)); STATIC_DCL void FDECL(Ring_off_or_gone, (struct obj *, BOOLEAN_P)); @@ -601,7 +594,6 @@ Shield_off(VOID_ARGS) return 0; } -#ifdef TOURIST STATIC_PTR int Shirt_on(VOID_ARGS) { @@ -631,7 +623,6 @@ Shirt_off(VOID_ARGS) setworn((struct obj *)0, W_ARMU); return 0; } -#endif /*TOURIST*/ /* This must be done in worn.c, because one of the possible intrinsics conferred * is fire resistance, and we have to immediately set HFire_resistance in worn.c @@ -1137,9 +1128,7 @@ struct obj *obj; /* if null, do all worn items; otherwise just obj itself */ if (!obj ? uleft != 0 : (obj == uleft)) (void) Ring_on(uleft); if (!obj ? uamul != 0 : (obj == uamul)) (void) Amulet_on(); -#ifdef TOURIST if (!obj ? uarmu != 0 : (obj == uarmu)) (void) Shirt_on(); -#endif if (!obj ? uarm != 0 : (obj == uarm)) (void) Armor_on(); if (!obj ? uarmc != 0 : (obj == uarmc)) (void) Cloak_on(); if (!obj ? uarmf != 0 : (obj == uarmf)) (void) Boots_on(); @@ -1163,11 +1152,9 @@ register struct obj *otmp; if (otmp == uarm) result = (afternmv == Armor_on || afternmv == Armor_off || what == WORN_ARMOR); -#ifdef TOURIST else if (otmp == uarmu) result = (afternmv == Shirt_on || afternmv == Shirt_off || what == WORN_SHIRT); -#endif else if (otmp == uarmc) result = (afternmv == Cloak_on || afternmv == Cloak_off || what == WORN_CLOAK); @@ -1199,10 +1186,8 @@ struct obj *otmp; /* 'T' (also 'W') sets afternmv, 'A' sets context.takeoff.what */ if (otmp == uarm) result = (afternmv == Armor_off || what == WORN_ARMOR); -#ifdef TOURIST else if (otmp == uarmu) result = (afternmv == Shirt_off || what == WORN_SHIRT); -#endif else if (otmp == uarmc) result = (afternmv == Cloak_off || what == WORN_CLOAK); else if (otmp == uarmf) @@ -1297,11 +1282,9 @@ dotakeoff() } else if (uarm) { armorpieces++; otmp = uarm; -#ifdef TOURIST } else if (uarmu) { armorpieces++; otmp = uarmu; -#endif } if (!armorpieces) { /* assert( GRAY_DRAGON_SCALES > YELLOW_DRAGON_SCALE_MAIL ); */ @@ -1325,21 +1308,16 @@ dotakeoff() /* note: the `uskin' case shouldn't be able to happen here; dragons can't wear any armor so will end up with `armorpieces == 0' above */ if (otmp == uskin || ((otmp == uarm) && uarmc) -#ifdef TOURIST - || ((otmp == uarmu) && (uarmc || uarm)) -#endif - ) { + || ((otmp == uarmu) && (uarmc || uarm))) { char why[BUFSZ], what[BUFSZ]; why[0] = what[0] = '\0'; if (otmp != uskin) { if (uarmc) Strcat(what, cloak_simple_name(uarmc)); -#ifdef TOURIST if ((otmp == uarmu) && uarm) { if (uarmc) Strcat(what, " and "); Strcat(what, suit_simple_name(uarm)); } -#endif Sprintf(why, " without taking off your %s first", what); } You_cant("take that off%s.", why); @@ -1369,12 +1347,10 @@ doremring() MOREACC(ublindf); if(!Accessories) { - pline("Not wearing any accessories.%s", (iflags.cmdassist && - (uarm || uarmc || -#ifdef TOURIST - uarmu || -#endif - uarms || uarmh || uarmg || uarmf)) ? + pline("Not wearing any accessories.%s", + (iflags.cmdassist + && (uarm || uarmc || uarmu || uarms || uarmh || uarmg + || uarmf)) ? " Use 'T' command to take off armor." : ""); return(0); } @@ -1516,9 +1492,7 @@ boolean noisy; const char *which; which = is_cloak(otmp) ? c_cloak : -#ifdef TOURIST is_shirt(otmp) ? c_shirt : -#endif is_suit(otmp) ? c_suit : 0; if (which && cantweararm(youmonst.data) && /* same exception for cloaks as used in m_dowear() */ @@ -1531,12 +1505,7 @@ boolean noisy; return 0; } - if (welded(uwep) && bimanual(uwep) && - (is_suit(otmp) -#ifdef TOURIST - || is_shirt(otmp) -#endif - )) { + if (welded(uwep) && bimanual(uwep) && (is_suit(otmp) || is_shirt(otmp))) { if (noisy) You("cannot do that while holding your %s.", is_sword(uwep) ? c_sword : c_weapon); @@ -1613,7 +1582,6 @@ boolean noisy; err++; } else *mask = W_ARMG; -#ifdef TOURIST } else if (is_shirt(otmp)) { if (uarm || uarmc || uarmu) { if (uarmu) { @@ -1625,7 +1593,6 @@ boolean noisy; err++; } else *mask = W_ARMU; -#endif } else if (is_cloak(otmp)) { if (uarmc) { if (noisy) already_wearing(an(cloak_simple_name(uarmc))); @@ -1711,9 +1678,7 @@ dowear() } else { if(is_cloak(otmp)) (void) Cloak_on(); if (is_shield(otmp)) (void) Shield_on(); -#ifdef TOURIST if (is_shirt(otmp)) (void) Shirt_on(); -#endif on_msg(otmp); } context.takeoff.mask = context.takeoff.what = 0L; @@ -1858,9 +1823,7 @@ find_ac() if(uarmf) uac -= ARM_BONUS(uarmf); if(uarms) uac -= ARM_BONUS(uarms); if(uarmg) uac -= ARM_BONUS(uarmg); -#ifdef TOURIST if(uarmu) uac -= ARM_BONUS(uarmu); -#endif if(uleft && uleft->otyp == RIN_PROTECTION) uac -= uleft->spe; if(uright && uright->otyp == RIN_PROTECTION) uac -= uright->spe; if (HProtection & INTRINSIC) uac -= u.ublessed; @@ -1966,10 +1929,8 @@ struct monst *victim; otmph = (victim == &youmonst) ? uarmc : which_armor(victim, W_ARMC); if (!otmph) otmph = (victim == &youmonst) ? uarm : which_armor(victim, W_ARM); -#ifdef TOURIST if (!otmph) otmph = (victim == &youmonst) ? uarmu : which_armor(victim, W_ARMU); -#endif otmp = (victim == &youmonst) ? uarmh : which_armor(victim, W_ARMH); if(otmp && (!otmph || !rn2(4))) otmph = otmp; @@ -2086,20 +2047,14 @@ register struct obj *otmp; } } /* special suit and shirt checks */ - if (otmp == uarm -#ifdef TOURIST - || otmp == uarmu -#endif - ) { + if (otmp == uarm || otmp == uarmu) { why = 0; /* the item which prevents disrobing */ if (uarmc && uarmc->cursed) { Sprintf(buf, "remove your %s", cloak_simple_name(uarmc)); why = uarmc; -#ifdef TOURIST } else if (otmp == uarmu && uarm && uarm->cursed) { Sprintf(buf, "remove your %s", c_suit); why = uarm; -#endif } else if (welded(uwep) && bimanual(uwep)) { Sprintf(buf, "release your %s", is_sword(uwep) ? c_sword : @@ -2126,9 +2081,7 @@ register struct obj *otmp; else if(otmp == uarmg) context.takeoff.mask |= WORN_GLOVES; else if(otmp == uarmh) context.takeoff.mask |= WORN_HELMET; else if(otmp == uarms) context.takeoff.mask |= WORN_SHIELD; -#ifdef TOURIST else if(otmp == uarmu) context.takeoff.mask |= WORN_SHIRT; -#endif else if(otmp == uleft) context.takeoff.mask |= LEFT_RING; else if(otmp == uright) context.takeoff.mask |= RIGHT_RING; else if(otmp == uamul) context.takeoff.mask |= WORN_AMUL; @@ -2179,11 +2132,9 @@ do_takeoff() } else if (doff->what == WORN_SHIELD) { otmp = uarms; if (!cursed(otmp)) (void) Shield_off(); -#ifdef TOURIST } else if (doff->what == WORN_SHIRT) { otmp = uarmu; if (!cursed(otmp)) (void) Shirt_off(); -#endif } else if (doff->what == WORN_AMUL) { otmp = uamul; if (!cursed(otmp)) Amulet_off(); @@ -2257,13 +2208,11 @@ take_off(VOID_ARGS) otmp = uarmh; } else if (doff->what == WORN_SHIELD) { otmp = uarms; -#ifdef TOURIST } else if (doff->what == WORN_SHIRT) { otmp = uarmu; /* add the time to take off and put back on armor and/or cloak */ if (uarm) doff->delay += 2 * objects[uarm->otyp].oc_delay; if (uarmc) doff->delay += 2 * objects[uarmc->otyp].oc_delay + 1; -#endif } else if (doff->what == WORN_AMUL) { doff->delay = 1; } else if (doff->what == LEFT_RING) { @@ -2399,13 +2348,11 @@ register struct obj *atmp; surface(u.ux,u.uy)); (void) Armor_gone(); useup(otmp); -#ifdef TOURIST } else if (DESTROY_ARM(uarmu)) { if (donning(otmp)) cancel_don(); Your("shirt crumbles into tiny threads and falls apart!"); (void) Shirt_off(); useup(otmp); -#endif } else if (DESTROY_ARM(uarmh)) { if (donning(otmp)) cancel_don(); Your("%s turns to dust and is blown away!", @@ -2484,7 +2431,6 @@ boolean only_if_known_cursed; /* ignore covering unless known to be cursed */ } return TRUE; } -#ifdef TOURIST /* check for shirt covered by suit and/or cloak */ if (obj == uarmu && ((uarm && BLOCKSACCESS(uarm)) || (uarmc && BLOCKSACCESS(uarmc)))) { @@ -2505,7 +2451,6 @@ boolean only_if_known_cursed; /* ignore covering unless known to be cursed */ } return TRUE; } -#endif /* check for ring covered by gloves */ if ((obj == uleft || obj == uright) && uarmg && BLOCKSACCESS(uarmg)) { if (verb) { diff --git a/src/dogmove.c b/src/dogmove.c index 795905393..526f40454 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -26,10 +26,6 @@ struct monst *mon; struct obj *obj, *wep, dummy, *pickaxe, *unihorn, *key; -#ifndef TOURIST -#define CREDIT_CARD STRANGE_OBJECT /* avoids messy conditionalization */ -#endif - #ifndef GOLDOBJ if (mon->mgold) return &zeroobj; /* pet has something to drop */ #endif @@ -111,10 +107,6 @@ struct monst *mon; if (!obj->owornmask && obj != wep) return obj; } -#ifndef TOURIST -#undef CREDIT_CARD -#endif - return (struct obj *)0; /* don't drop anything */ } diff --git a/src/dokick.c b/src/dokick.c index d0b20a604..fb81ab5c4 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -1456,10 +1456,7 @@ boolean shop_floor_obj; const char *result; if (objects[otmp->otyp].oc_material == GLASS -#ifdef TOURIST - || otmp->otyp == EXPENSIVE_CAMERA -#endif - ) { + || otmp->otyp == EXPENSIVE_CAMERA) { if (otmp->otyp == MIRROR) change_luck(-2); result = "crash"; diff --git a/src/dothrow.c b/src/dothrow.c index 953ff1e35..08e21d4f5 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -1775,9 +1775,7 @@ struct obj *obj; obj->oclass != GEM_CLASS) return 1; switch (obj->oclass == POTION_CLASS ? POT_WATER : obj->otyp) { -#ifdef TOURIST case EXPENSIVE_CAMERA: -#endif case POT_WATER: /* really, all potions */ case EGG: case CREAM_PIE: @@ -1806,9 +1804,7 @@ boolean in_view; case LENSES: case MIRROR: case CRYSTAL_BALL: -#ifdef TOURIST case EXPENSIVE_CAMERA: -#endif to_pieces = " into a thousand pieces"; /*FALLTHRU*/ case POT_WATER: /* really, all potions */ diff --git a/src/invent.c b/src/invent.c index 90cb9ff1c..189b63ea9 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1000,12 +1000,8 @@ register const char *let,*word; } else { /* "ugly check" for reading fortune cookies, part 2 */ - if ((!strcmp(word, "read") && - (otmp->otyp == FORTUNE_COOKIE -#ifdef TOURIST - || otmp->otyp == T_SHIRT -#endif - ))) + if ((!strcmp(word, "read") + && (otmp->otyp == FORTUNE_COOKIE || otmp->otyp == T_SHIRT))) allowall = TRUE; } } @@ -1241,10 +1237,7 @@ boolean wearing_armor() { return((boolean)(uarm || uarmc || uarmf || uarmg || uarmh || uarms -#ifdef TOURIST - || uarmu -#endif - )); + || uarmu)); } boolean @@ -2745,16 +2738,10 @@ doprarm() if (!wearing_armor()) { noarmor(TRUE); } else { -#ifdef TOURIST char lets[8]; -#else - char lets[7]; -#endif register int ct = 0; -#ifdef TOURIST if(uarmu) lets[ct++] = obj_to_let(uarmu); -#endif if(uarm) lets[ct++] = obj_to_let(uarm); if(uarmc) lets[ct++] = obj_to_let(uarmc); if(uarmh) lets[ct++] = obj_to_let(uarmh); diff --git a/src/lock.c b/src/lock.c index 6e20e20e6..2ba1d51b7 100644 --- a/src/lock.c +++ b/src/lock.c @@ -61,10 +61,8 @@ lock_action() /* otherwise we're trying to unlock it */ else if (xlock.picktyp == LOCK_PICK) return actions[3]; /* "picking the lock" */ -#ifdef TOURIST else if (xlock.picktyp == CREDIT_CARD) return actions[3]; /* same as lock_pick */ -#endif else if (xlock.door) return actions[0]; /* "unlocking the door" */ else @@ -253,9 +251,7 @@ pick_lock(pick) if (nohands(youmonst.data)) { const char *what = (picktyp == LOCK_PICK) ? "pick" : "key"; -#ifdef TOURIST if (picktyp == CREDIT_CARD) what = "card"; -#endif pline(no_longer, "hold the", what); reset_pick(); return PICKLOCK_LEARNED_SOMETHING; @@ -276,18 +272,13 @@ pick_lock(pick) return PICKLOCK_DID_NOTHING; } else if (u.uswallow) { You_cant("%sunlock %s.", -#ifdef TOURIST (picktyp == CREDIT_CARD) ? "" : -#endif "lock or ", mon_nam(u.ustuck)); return PICKLOCK_DID_NOTHING; } - if((picktyp != LOCK_PICK && -#ifdef TOURIST - picktyp != CREDIT_CARD && -#endif - picktyp != SKELETON_KEY)) { + if((picktyp != LOCK_PICK && picktyp != CREDIT_CARD + && picktyp != SKELETON_KEY)) { impossible("picking lock with object %d?", picktyp); return PICKLOCK_DID_NOTHING; } @@ -344,20 +335,16 @@ pick_lock(pick) You_cant("fix its broken lock with %s.", doname(pick)); return PICKLOCK_LEARNED_SOMETHING; } -#ifdef TOURIST else if (picktyp == CREDIT_CARD && !otmp->olocked) { /* credit cards are only good for unlocking */ You_cant("do that with %s.", an(simple_typename(picktyp))); return PICKLOCK_LEARNED_SOMETHING; } -#endif switch(picktyp) { -#ifdef TOURIST case CREDIT_CARD: ch = ACURR(A_DEX) + 20*Role_if(PM_ROGUE); break; -#endif case LOCK_PICK: ch = 4*ACURR(A_DEX) + 25*Role_if(PM_ROGUE); break; @@ -391,12 +378,10 @@ pick_lock(pick) if (mtmp && canseemon(mtmp) && mtmp->m_ap_type != M_AP_FURNITURE && mtmp->m_ap_type != M_AP_OBJECT) { -#ifdef TOURIST if (picktyp == CREDIT_CARD && (mtmp->isshk || mtmp->data == &mons[PM_ORACLE])) verbalize("No checks, no credit, no problem."); else -#endif pline("I don't think %s would appreciate that.", mon_nam(mtmp)); return PICKLOCK_LEARNED_SOMETHING; } else if (mtmp && mtmp->m_ap_type == M_AP_FURNITURE && @@ -430,13 +415,11 @@ pick_lock(pick) pline("This door is broken."); return PICKLOCK_LEARNED_SOMETHING; default: -#ifdef TOURIST /* credit cards are only good for unlocking */ if(picktyp == CREDIT_CARD && !(door->doormask & D_LOCKED)) { You_cant("lock a door with a credit card."); return PICKLOCK_LEARNED_SOMETHING; } -#endif Sprintf(qbuf,"%s it?", (door->doormask & D_LOCKED) ? "Unlock" : "Lock"); @@ -445,11 +428,9 @@ pick_lock(pick) if(c == 'n') return(0); switch(picktyp) { -#ifdef TOURIST case CREDIT_CARD: ch = 2*ACURR(A_DEX) + 20*Role_if(PM_ROGUE); break; -#endif case LOCK_PICK: ch = 3*ACURR(A_DEX) + 30*Role_if(PM_ROGUE); break; diff --git a/src/mhitu.c b/src/mhitu.c index cf5f68bcd..89cd68968 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -759,10 +759,8 @@ int attk; */ if (uarm) (void)rust_dmg(uarm, xname(uarm), hurt, TRUE, &youmonst); -#ifdef TOURIST else if (uarmu) (void)rust_dmg(uarmu, xname(uarmu), hurt, TRUE, &youmonst); -#endif break; case 2: if (!uarms || !rust_dmg(uarms, xname(uarms), hurt, FALSE, &youmonst)) @@ -803,9 +801,7 @@ struct attack *mattk; { struct obj *obj = (uarmc ? uarmc : uarm); -#ifdef TOURIST if (!obj) obj = uarmu; -#endif if (mattk->adtyp == AD_DRIN) obj = uarmh; /* if your cloak/armor is greased, monster slips off; this @@ -1375,11 +1371,8 @@ dopois: hitmsg(mtmp, mattk); break; } - if(!uwep -#ifdef TOURIST - && !uarmu -#endif - && !uarm && !uarmh && !uarms && !uarmg && !uarmc && !uarmf) { + if(!uwep && !uarmu && !uarm && !uarmh && !uarms && !uarmg && !uarmc + && !uarmf) { boolean goaway = FALSE; pline("%s hits! (I hope you don't mind.)", Monnam(mtmp)); if (Upolyd) { @@ -2331,10 +2324,7 @@ register struct monst *mon; } if (!uarmc && !uarmf && !uarmg && !uarms && !uarmh -#ifdef TOURIST - && !uarmu -#endif - ) + && !uarmu) pline("%s murmurs sweet nothings into your ear.", Blind ? (fem ? "She" : "He") : Monnam(mon)); else @@ -2348,10 +2338,8 @@ register struct monst *mon; mayberem(uarmg, "gloves"); mayberem(uarms, "shield"); mayberem(uarmh, helm_simple_name(uarmh)); -#ifdef TOURIST if(!uarmc && !uarm) mayberem(uarmu, "shirt"); -#endif if (uarm || uarmc) { verbalize("You're such a %s; I wish...", @@ -2515,9 +2503,7 @@ const char *str; (obj == uarmc || obj == uarms) ? "it's in the way" : (obj == uarmf) ? "let me rub your feet" : (obj == uarmg) ? "they're too clumsy" : -#ifdef TOURIST (obj == uarmu) ? "let me massage you" : -#endif /* obj == uarmh */ hairbuf); } diff --git a/src/mkobj.c b/src/mkobj.c index 19e3658df..1edb34977 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -726,9 +726,7 @@ boolean artif; break; case LEASH: otmp->leashmon = 0; break; -#ifdef TOURIST case EXPENSIVE_CAMERA: -#endif case TINNING_KIT: case MAGIC_MARKER: otmp->spe = rn1(70,30); break; diff --git a/src/mon.c b/src/mon.c index 5be8c8e8a..4ed4b168c 100644 --- a/src/mon.c +++ b/src/mon.c @@ -101,9 +101,7 @@ int mndx, mode; case PM_HUNTER: mndx = mode ? PM_RANGER : PM_HUMAN; break; case PM_THUG: mndx = mode ? PM_ROGUE : PM_HUMAN; break; case PM_ROSHI: mndx = mode ? PM_SAMURAI : PM_HUMAN; break; -#ifdef TOURIST case PM_GUIDE: mndx = mode ? PM_TOURIST : PM_HUMAN; break; -#endif case PM_APPRENTICE: mndx = mode ? PM_WIZARD : PM_HUMAN; break; case PM_WARRIOR: mndx = mode ? PM_VALKYRIE : PM_HUMAN; break; default: diff --git a/src/monmove.c b/src/monmove.c index a7e0da3d2..cc18bcd3c 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -46,9 +46,7 @@ monhaskey(mon, for_unlocking) struct monst *mon; boolean for_unlocking; /* true => credit card ok, false => not ok */ { -#ifdef TOURIST if (for_unlocking && m_carrying(mon, CREDIT_CARD)) return TRUE; -#endif return m_carrying(mon, SKELETON_KEY) || m_carrying(mon, LOCK_PICK); } @@ -1463,9 +1461,7 @@ struct monst *mtmp; typ != SLING && !is_cloak(obj) && typ != FEDORA && !is_gloves(obj) && typ != LEATHER_JACKET && -#ifdef TOURIST typ != CREDIT_CARD && !is_shirt(obj) && -#endif !(typ == CORPSE && verysmall(&mons[obj->corpsenm])) && typ != FORTUNE_COOKIE && typ != CANDY_BAR && typ != PANCAKE && typ != LEMBAS_WAFER && diff --git a/src/monst.c b/src/monst.c index b85449ca2..420118eda 100644 --- a/src/monst.c +++ b/src/monst.c @@ -3021,7 +3021,6 @@ struct permonst _mons2[] = { SIZ(WT_HUMAN, 400, MS_HUMANOID, MZ_HUMAN), 0, 0, M1_HUMANOID|M1_OMNIVORE, M2_NOPOLY|M2_HUMAN|M2_STRONG|M2_COLLECT, M3_INFRAVISIBLE, HI_DOMESTIC), -#ifdef TOURIST MON("tourist", S_HUMAN, LVL(10, 12, 10, 1, 0), G_NOGEN, A(ATTK(AT_WEAP, AD_PHYS, 1, 6), ATTK(AT_WEAP, AD_PHYS, 1, 6), @@ -3029,7 +3028,6 @@ struct permonst _mons2[] = { SIZ(WT_HUMAN, 400, MS_HUMANOID, MZ_HUMAN), 0, 0, M1_HUMANOID|M1_OMNIVORE, M2_NOPOLY|M2_HUMAN|M2_STRONG|M2_COLLECT, M3_INFRAVISIBLE, HI_DOMESTIC), -#endif MON("valkyrie", S_HUMAN, LVL(10, 12, 10, 1, -1), G_NOGEN, A(ATTK(AT_WEAP, AD_PHYS, 1, 8), ATTK(AT_WEAP, AD_PHYS, 1, 8), @@ -3165,7 +3163,6 @@ struct permonst _mons2[] = { M2_NOPOLY|M2_HUMAN|M2_PNAME|M2_PEACEFUL|M2_STRONG|M2_MALE| M2_COLLECT|M2_MAGIC, M3_CLOSE|M3_INFRAVISIBLE, HI_LORD), -#ifdef TOURIST MON("Twoflower", S_HUMAN, LVL(20, 12, 10, 20, 0), (G_NOGEN|G_UNIQ), A(ATTK(AT_WEAP, AD_PHYS, 1, 6), ATTK(AT_WEAP, AD_PHYS, 1, 6), @@ -3175,7 +3172,6 @@ struct permonst _mons2[] = { M2_NOPOLY|M2_HUMAN|M2_PNAME|M2_PEACEFUL|M2_STRONG|M2_MALE| M2_COLLECT|M2_MAGIC, M3_CLOSE|M3_INFRAVISIBLE, HI_DOMESTIC), -#endif MON("Norn", S_HUMAN, LVL(20, 12, 0, 80, 0), (G_NOGEN|G_UNIQ), A(ATTK(AT_WEAP, AD_PHYS, 1, 8), ATTK(AT_WEAP, AD_PHYS, 1, 6), @@ -3313,11 +3309,9 @@ struct permonst _mons2[] = { M2_NOPOLY|M2_HUMAN|M2_PNAME|M2_HOSTILE|M2_STRONG|M2_STALK| M2_NASTY|M2_MALE|M2_COLLECT|M2_MAGIC, M3_WANTSARTI|M3_WAITFORU|M3_INFRAVISIBLE, HI_LORD), -#ifdef TOURIST /* * Note: the Master of Thieves was defined above. */ -#endif MON("Lord Surtur", S_GIANT, LVL(15, 12, 2, 50, 12), (G_NOGEN|G_UNIQ), A(ATTK(AT_WEAP, AD_PHYS, 2,10), ATTK(AT_WEAP, AD_PHYS, 2,10), @@ -3438,7 +3432,6 @@ struct permonst _mons2[] = { M1_HUMANOID|M1_OMNIVORE, M2_NOPOLY|M2_HUMAN|M2_PEACEFUL|M2_STRONG|M2_COLLECT, M3_INFRAVISIBLE, HI_DOMESTIC), -#ifdef TOURIST MON("guide", S_HUMAN, LVL(5, 12, 10, 20, 0), G_NOGEN, A(ATTK(AT_WEAP, AD_PHYS, 1, 6), ATTK(AT_MAGC, AD_SPEL, 0, 0), @@ -3447,7 +3440,6 @@ struct permonst _mons2[] = { M1_HUMANOID|M1_OMNIVORE, M2_NOPOLY|M2_HUMAN|M2_PEACEFUL | M2_STRONG|M2_COLLECT|M2_MAGIC, M3_INFRAVISIBLE, HI_DOMESTIC), -#endif MON("warrior", S_HUMAN, LVL(5, 12, 10, 10, -1), G_NOGEN, A(ATTK(AT_WEAP, AD_PHYS, 1, 8), ATTK(AT_WEAP, AD_PHYS, 1, 8), diff --git a/src/mplayer.c b/src/mplayer.c index 58546c931..c2b7f23f8 100644 --- a/src/mplayer.c +++ b/src/mplayer.c @@ -203,11 +203,9 @@ register boolean special; case PM_SAMURAI: if (rn2(2)) weapon = KATANA; break; -#ifdef TOURIST case PM_TOURIST: /* Defaults are just fine */ break; -#endif case PM_VALKYRIE: if (rn2(2)) weapon = WAR_HAMMER; if (rn2(2)) armor = rnd_class(PLATE_MAIL, CHAIN_MAIL); diff --git a/src/mthrowu.c b/src/mthrowu.c index 8a9ed6736..e61814321 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -814,9 +814,7 @@ int whodidit; /* 1==hero, 0=other, -1==just check whether it'll pass thru */ case TOOL_CLASS: hits = (obj_type != SKELETON_KEY && obj_type != LOCK_PICK && -#ifdef TOURIST obj_type != CREDIT_CARD && -#endif obj_type != TALLOW_CANDLE && obj_type != WAX_CANDLE && obj_type != LENSES && diff --git a/src/muse.c b/src/muse.c index a404071c7..ec4bc55ab 100644 --- a/src/muse.c +++ b/src/muse.c @@ -988,11 +988,8 @@ struct monst *mtmp; return FALSE; if (u.uswallow) return FALSE; if (in_your_sanctuary(mtmp, 0, 0)) return FALSE; - if (dmgtype(mtmp->data, AD_HEAL) && !uwep -#ifdef TOURIST - && !uarmu -#endif - && !uarm && !uarmh && !uarms && !uarmg && !uarmc && !uarmf) + if (dmgtype(mtmp->data, AD_HEAL) && !uwep && !uarmu && !uarm && !uarmh + && !uarms && !uarmg && !uarmc && !uarmf) return FALSE; if (!ranged_stuff) return FALSE; diff --git a/src/objects.c b/src/objects.c index 1de8dfffe..4c015595d 100644 --- a/src/objects.c +++ b/src/objects.c @@ -367,13 +367,8 @@ ARMOR("plate mail", (char *)0, 1, 0, 1, 0, 44, 5, 450, 600, 3, 2, ARM_SUIT, IRON, HI_METAL), ARMOR("crystal plate mail", (char *)0, 1, 0, 1, 0, 10, 5, 450, 820, 3, 2, ARM_SUIT, GLASS, CLR_WHITE), -#ifdef TOURIST ARMOR("bronze plate mail", (char *)0, 1, 0, 1, 0, 25, 5, 450, 400, 4, 1, ARM_SUIT, COPPER, HI_COPPER), -#else -ARMOR("bronze plate mail", (char *)0, - 1, 0, 1, 0, 35, 5, 450, 400, 4, 1, ARM_SUIT, COPPER, HI_COPPER), -#endif ARMOR("splint mail", (char *)0, 1, 0, 1, 0, 62, 5, 400, 80, 4, 1, ARM_SUIT, IRON, HI_METAL), ARMOR("banded mail", (char *)0, @@ -399,13 +394,11 @@ ARMOR("leather armor", (char *)0, ARMOR("leather jacket", (char *)0, 1, 0, 0, 0, 12, 0, 30, 10, 9, 0, ARM_SUIT, LEATHER, CLR_BLACK), -#ifdef TOURIST /* shirts */ ARMOR("Hawaiian shirt", (char *)0, 1, 0, 0, 0, 8, 0, 5, 3, 10, 0, ARM_SHIRT, CLOTH, CLR_MAGENTA), ARMOR("T-shirt", (char *)0, 1, 0, 0, 0, 2, 0, 5, 2, 10, 0, ARM_SHIRT, CLOTH, CLR_WHITE), -#endif /* cloaks */ /* 'cope' is not a spelling mistake... leave it be */ @@ -591,12 +584,8 @@ CONTAINER("bag of tricks", "bag", 0, 1, 1, 20, 15, 100, CLOTH, HI_CLOTH), /* lock opening tools */ TOOL("skeleton key", "key", 0, 0, 0, 0, 80, 3, 10, IRON, HI_METAL), -#ifdef TOURIST TOOL("lock pick", (char *)0, 1, 0, 0, 0, 60, 4, 20, IRON, HI_METAL), TOOL("credit card", (char *)0, 1, 0, 0, 0, 15, 1, 10, PLASTIC, CLR_WHITE), -#else -TOOL("lock pick", (char *)0, 1, 0, 0, 0, 75, 4, 20, IRON, HI_METAL), -#endif /* light sources */ TOOL("tallow candle", "candle", 0, 1, 0, 0, 20, 2, 10, WAX, CLR_WHITE), TOOL("wax candle", "candle", 0, 1, 0, 0, 5, 2, 20, WAX, CLR_WHITE), @@ -604,13 +593,9 @@ TOOL("brass lantern", (char *)0,1, 0, 0, 0, 30, 30, 12, COPPER, CLR_YELLOW), TOOL("oil lamp", "lamp", 0, 0, 0, 0, 45, 20, 10, COPPER, CLR_YELLOW), TOOL("magic lamp", "lamp", 0, 0, 1, 0, 15, 20, 50, COPPER, CLR_YELLOW), /* other tools */ -#ifdef TOURIST TOOL("expensive camera", (char *)0, 1, 0, 0, 1, 15, 12, 200, PLASTIC, CLR_BLACK), TOOL("mirror", "looking glass", 0, 0, 0, 0, 45, 13, 10, GLASS, HI_SILVER), -#else -TOOL("mirror", "looking glass", 0, 0, 0, 0, 60, 13, 10, GLASS, HI_SILVER), -#endif TOOL("crystal ball", "glass orb", 0, 0, 1, 1, 15,150, 60, GLASS, HI_GLASS), TOOL("lenses", (char *)0, 1, 0, 0, 0, 5, 3, 80, GLASS, HI_GLASS), diff --git a/src/objnam.c b/src/objnam.c index e1b00a777..624ed92ff 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -2182,9 +2182,7 @@ STATIC_OVL NEARDATA const struct o_range o_ranges[] = { { "boots", ARMOR_CLASS, LOW_BOOTS, LEVITATION_BOOTS }, { "shoes", ARMOR_CLASS, LOW_BOOTS, IRON_SHOES }, { "cloak", ARMOR_CLASS, MUMMY_WRAPPING, CLOAK_OF_DISPLACEMENT }, -#ifdef TOURIST { "shirt", ARMOR_CLASS, HAWAIIAN_SHIRT, T_SHIRT }, -#endif { "dragon scales", ARMOR_CLASS, GRAY_DRAGON_SCALES, YELLOW_DRAGON_SCALES }, { "dragon scale mail", @@ -2218,10 +2216,8 @@ struct alt_spellings { { "amulet of poison resistance", AMULET_VERSUS_POISON }, { "potion of sleep", POT_SLEEPING }, { "stone", ROCK }, -#ifdef TOURIST { "camera", EXPENSIVE_CAMERA }, { "tee shirt", T_SHIRT }, -#endif { "can", TIN }, { "can opener", TIN_OPENER }, { "kelp", KELP_FROND }, diff --git a/src/polyself.c b/src/polyself.c index c1b2c99c4..3effba8b2 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -821,12 +821,10 @@ break_armor() useup(otmp); } } -#ifdef TOURIST if (uarmu) { Your("shirt rips to shreds!"); useup(uarmu); } -#endif } else if (sliparm(youmonst.data)) { if (((otmp = uarm) != 0) && (racial_exception(&youmonst, otmp) < 1)) { if (donning(otmp)) cancel_don(); @@ -841,7 +839,6 @@ break_armor() (void) Cloak_off(); dropx(otmp); } -#ifdef TOURIST if ((otmp = uarmu) != 0) { if (is_whirly(youmonst.data)) You("seep right through your shirt!"); @@ -849,7 +846,6 @@ break_armor() setworn((struct obj *)0, otmp->owornmask & W_ARMU); dropx(otmp); } -#endif } if (has_horns(youmonst.data)) { if ((otmp = uarmh) != 0) { diff --git a/src/pray.c b/src/pray.c index b5312c25a..0e3730e20 100644 --- a/src/pray.c +++ b/src/pray.c @@ -256,10 +256,8 @@ worst_cursed_item() otmp = uarmh; } else if (uarmf && uarmf->cursed) { /* boots */ otmp = uarmf; -#ifdef TOURIST } else if (uarmu && uarmu->cursed) { /* shirt */ otmp = uarmu; -#endif } else if (uamul && uamul->cursed) { /* amulet */ otmp = uamul; } else if (uleft && uleft->cursed) { /* left ring */ @@ -551,9 +549,7 @@ aligntyp resp_god; if (uarm && !(EReflecting & W_ARM) && !(EDisint_resistance & W_ARM) && !uarmc) (void) destroy_arm(uarm); -#ifdef TOURIST if (uarmu && !uarm && !uarmc) (void) destroy_arm(uarmu); -#endif if (!Disint_resistance) fry_by_god(resp_god, TRUE); else { diff --git a/src/read.c b/src/read.c index 40b40f2d9..6f4c7c478 100644 --- a/src/read.c +++ b/src/read.c @@ -72,7 +72,6 @@ doread() if (!Blind) u.uconduct.literate++; useup(scroll); return(1); -#ifdef TOURIST } else if (scroll->otyp == T_SHIRT) { static const char *shirt_msgs[] = { /* Scott Bigham */ "I explored the Dungeons of Doom and all I got was this lousy T-shirt!", @@ -117,7 +116,6 @@ doread() scroll->o_id ^ (unsigned)ubirthday); pline("\"%s\"", buf); return 1; -#endif /* TOURIST */ } else if (scroll->oclass != SCROLL_CLASS && scroll->oclass != SPBOOK_CLASS) { pline(silly_thing_to, "read"); @@ -364,9 +362,7 @@ int curse_bless; break; case MAGIC_MARKER: case TINNING_KIT: -#ifdef TOURIST case EXPENSIVE_CAMERA: -#endif if (is_cursed) stripspe(obj); else if (rechrg && obj->otyp == MAGIC_MARKER) { /* previously recharged */ obj->recharged = 1; /* override increment done above */ diff --git a/src/role.c b/src/role.c index 8cb7f3f7e..59624c528 100644 --- a/src/role.c +++ b/src/role.c @@ -299,7 +299,6 @@ const struct Role roles[] = { { 1, 0, 0, 1, 0, 1 },11, /* Energy */ 10, 10, 0, 0, 8, A_INT, SPE_CLAIRVOYANCE, -4 }, -#ifdef TOURIST { {"Tourist", 0}, { {"Rambler", 0}, {"Sightseer", 0}, @@ -325,7 +324,6 @@ const struct Role roles[] = { { 1, 0, 0, 1, 0, 1 },14, /* Energy */ 0, 5, 1, 2, 10, A_INT, SPE_CHARM_MONSTER, -4 }, -#endif { {"Valkyrie", 0}, { {"Stripling", 0}, {"Skirmisher", 0}, @@ -1705,10 +1703,8 @@ struct monst *mtmp; case PM_SAMURAI: return (mtmp && mtmp->data == &mons[PM_SHOPKEEPER] ? "Irasshaimase" : "Konnichi wa"); /* Japanese */ -#ifdef TOURIST case PM_TOURIST: return ("Aloha"); /* Hawaiian */ -#endif case PM_VALKYRIE: return ( #ifdef MAIL @@ -1728,10 +1724,8 @@ Goodbye() return ("Fare thee well"); /* Olde English */ case PM_SAMURAI: return ("Sayonara"); /* Japanese */ -#ifdef TOURIST case PM_TOURIST: return ("Aloha"); /* Hawaiian */ -#endif case PM_VALKYRIE: return ("Farvel"); /* Norse */ default: diff --git a/src/shk.c b/src/shk.c index 63596950f..5a397abf5 100644 --- a/src/shk.c +++ b/src/shk.c @@ -1951,11 +1951,9 @@ register struct monst *shkp; /* if angry, impose a surcharge */ } if (uarmh && uarmh->otyp == DUNCE_CAP) multiplier *= 4L, divisor *= 3L; -#ifdef TOURIST else if ((Role_if(PM_TOURIST) && u.ulevel < (MAXULEV/2)) || (uarmu && !uarm && !uarmc)) /* touristy shirt visible */ multiplier *= 4L, divisor *= 3L; -#endif if (ACURR(A_CHA) > 18) divisor *= 2L; else if (ACURR(A_CHA) == 18) multiplier *= 2L, divisor *= 3L; @@ -2116,11 +2114,9 @@ register struct monst *shkp; if (uarmh && uarmh->otyp == DUNCE_CAP) divisor *= 3L; -#ifdef TOURIST else if ((Role_if(PM_TOURIST) && u.ulevel < (MAXULEV/2)) || (uarmu && !uarm && !uarmc)) /* touristy shirt visible */ divisor *= 3L; -#endif else divisor *= 2L; @@ -4092,11 +4088,9 @@ boolean altusage; /* some items have an "alternate" use with different cost */ if (otmp->spe > 1) tmp /= 4L; } else if (otmp->oclass == SPBOOK_CLASS) { tmp -= tmp / 5L; - } else if (otmp->otyp == CAN_OF_GREASE || - otmp->otyp == TINNING_KIT -#ifdef TOURIST + } else if (otmp->otyp == CAN_OF_GREASE + || otmp->otyp == TINNING_KIT || otmp->otyp == EXPENSIVE_CAMERA -#endif ) { tmp /= 10L; } else if (otmp->otyp == POT_OIL) { diff --git a/src/sounds.c b/src/sounds.c index efb496372..2a7df5823 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -796,11 +796,9 @@ register struct monst *mtmp; case PM_ARCHEOLOGIST: pline_msg = "describes a recent article in \"Spelunker Today\" magazine."; break; -#ifdef TOURIST case PM_TOURIST: verbl_msg = "Aloha."; break; -#endif default: pline_msg = "discusses dungeon exploration."; break; @@ -871,10 +869,8 @@ register struct monst *mtmp; verbl_msg = Role_if(PM_HEALER) ? "Doc, I can't help you unless you cooperate." : "Please undress so I can examine you."; -#ifdef TOURIST else if (uarmu) verbl_msg = "Take off your shirt, please."; -#endif else verbl_msg = "Relax, this won't hurt a bit."; break; case MS_GUARD: diff --git a/src/steal.c b/src/steal.c index 884b4135c..f98cd693e 100644 --- a/src/steal.c +++ b/src/steal.c @@ -13,10 +13,7 @@ STATIC_OVL const char * equipname(otmp) register struct obj *otmp; { - return ( -#ifdef TOURIST - (otmp == uarmu) ? "shirt" : -#endif + return ((otmp == uarmu) ? "shirt" : (otmp == uarmf) ? "boots" : (otmp == uarms) ? "shield" : (otmp == uarmg) ? "gloves" : @@ -231,9 +228,7 @@ boolean unchain_ball; /* whether to unpunish or just unwield */ else if (obj == uarmg) (void) Gloves_off(); else if (obj == uarmh) (void) Helmet_off(); else if (obj == uarms) (void) Shield_off(); -#ifdef TOURIST else if (obj == uarmu) (void) Shirt_off(); -#endif /* catchall -- should never happen */ else setworn((struct obj *)0, obj->owornmask & W_ARMOR); } else if (obj->owornmask & W_AMUL) { @@ -342,11 +337,9 @@ nothing_to_steal: if (otmp == uarmg && uwep) otmp = uwep; /* can't steal armor while wearing cloak - so steal the cloak. */ else if(otmp == uarm && uarmc) otmp = uarmc; -#ifdef TOURIST /* can't steal shirt while wearing cloak or suit */ else if(otmp == uarmu && uarmc) otmp = uarmc; else if(otmp == uarmu && uarm) otmp = uarm; -#endif gotobj: if(otmp->o_id == stealoid) return(0); diff --git a/src/trap.c b/src/trap.c index e14ffec6f..cde767106 100644 --- a/src/trap.c +++ b/src/trap.c @@ -78,11 +78,9 @@ struct monst *victim; (void) burn_dmg(item, xname(item)); return TRUE; } -#ifdef TOURIST item = (victim == &youmonst) ? uarmu : which_armor(victim, W_ARMU); if (item) (void) burn_dmg(item, "shirt"); -#endif return TRUE; case 2: item = (victim == &youmonst) ? uarms : which_armor(victim, W_ARMS); @@ -953,10 +951,8 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); 1, TRUE, &youmonst); else if (uarm) (void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst); -#ifdef TOURIST else if (uarmu) (void) rust_dmg(uarmu, "shirt", 1, TRUE, &youmonst); -#endif } update_inventory(); break; @@ -2090,10 +2086,8 @@ glovecheck: target = which_armor(mtmp, W_ARMG); 1, TRUE, mtmp); else if ((target = which_armor(mtmp, W_ARM)) != 0) (void) rust_dmg(target, "armor", 1, TRUE, mtmp); -#ifdef TOURIST else if ((target = which_armor(mtmp, W_ARMU)) != 0) (void) rust_dmg(target, "shirt", 1, TRUE, mtmp); -#endif } if (mptr == &mons[PM_IRON_GOLEM]) { @@ -3172,9 +3166,7 @@ boolean *lostsome; obj == uamul || obj == uleft || obj == uright || obj == ublindf || obj == uarm || obj == uarmc || obj == uarmg || obj == uarmf || -#ifdef TOURIST obj == uarmu || -#endif (obj->cursed && (obj == uarmh || obj == uarms)) || welded(obj))) otmp = obj; diff --git a/src/u_init.c b/src/u_init.c index 621f0d44d..16956b976 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -138,7 +138,6 @@ static struct trobj Samurai[] = { { SPLINT_MAIL, 0, ARMOR_CLASS, 1, UNDEF_BLESS }, { 0, 0, 0, 0, 0 } }; -#ifdef TOURIST static struct trobj Tourist[] = { #define T_DARTS 0 { DART, 2, WEAPON_CLASS, 25, UNDEF_BLESS }, /* quan is variable */ @@ -150,7 +149,6 @@ static struct trobj Tourist[] = { { CREDIT_CARD, 0, TOOL_CLASS, 1, 0 }, { 0, 0, 0, 0, 0 } }; -#endif static struct trobj Valkyrie[] = { { LONG_SWORD, 1, WEAPON_CLASS, 1, UNDEF_BLESS }, { DAGGER, 0, WEAPON_CLASS, 1, UNDEF_BLESS }, @@ -200,7 +198,6 @@ static struct trobj Xtra_food[] = { { UNDEF_TYP, UNDEF_SPE, FOOD_CLASS, 2, 0 }, { 0, 0, 0, 0, 0 } }; -#ifdef TOURIST static struct trobj Leash[] = { { LEASH, 0, TOOL_CLASS, 1, 0 }, { 0, 0, 0, 0, 0 } @@ -209,7 +206,6 @@ static struct trobj Towel[] = { { TOWEL, 0, TOOL_CLASS, 1, 0 }, { 0, 0, 0, 0, 0 } }; -#endif /* TOURIST */ static struct trobj Wishing[] = { { WAN_WISHING, 3, WAND_CLASS, 1, 0 }, { 0, 0, 0, 0, 0 } @@ -414,7 +410,6 @@ static const struct def_skill Skill_S[] = { { P_NONE, 0 } }; -#ifdef TOURIST static const struct def_skill Skill_T[] = { { P_DAGGER, P_EXPERT }, { P_KNIFE, P_SKILLED }, { P_AXE, P_BASIC }, { P_PICK_AXE, P_BASIC }, @@ -437,7 +432,6 @@ static const struct def_skill Skill_T[] = { { P_BARE_HANDED_COMBAT, P_SKILLED }, { P_NONE, 0 } }; -#endif /* TOURIST */ static const struct def_skill Skill_V[] = { { P_DAGGER, P_EXPERT }, { P_AXE, P_EXPERT }, @@ -512,9 +506,7 @@ u_init() #if 0 /* documentation of more zero values as desirable */ u.usick_cause[0] = 0; u.uluck = u.moreluck = 0; -# ifdef TOURIST uarmu = 0; -# endif uarm = uarmc = uarmh = uarms = uarmg = uarmf = 0; uwep = uball = uchain = uleft = uright = 0; uswapwep = uquiver = 0; @@ -676,7 +668,6 @@ u_init() knows_class(ARMOR_CLASS); skill_init(Skill_S); break; -#ifdef TOURIST case PM_TOURIST: Tourist[T_DARTS].trquan = rn1(20, 21); #ifndef GOLDOBJ @@ -691,7 +682,6 @@ u_init() else if(!rn2(25)) ini_inv(Magicmarker); skill_init(Skill_T); break; -#endif case PM_VALKYRIE: ini_inv(Valkyrie); if(!rn2(6)) ini_inv(Lamp); @@ -840,9 +830,7 @@ int otyp; case PM_RANGER: skills = Skill_Ran; break; case PM_ROGUE: skills = Skill_R; break; case PM_SAMURAI: skills = Skill_S; break; -#ifdef TOURIST case PM_TOURIST: skills = Skill_T; break; -#endif case PM_VALKYRIE: skills = Skill_V; break; case PM_WIZARD: skills = Skill_W; break; default: skills = 0; break; /* lint suppression */ @@ -1001,10 +989,8 @@ register struct trobj *trop; setworn(obj, W_ARMH); else if (is_gloves(obj) && !uarmg) setworn(obj, W_ARMG); -#ifdef TOURIST else if (is_shirt(obj) && !uarmu) setworn(obj, W_ARMU); -#endif else if (is_cloak(obj) && !uarmc) setworn(obj, W_ARMC); else if (is_boots(obj) && !uarmf) diff --git a/src/uhitm.c b/src/uhitm.c index 16b05fe9c..0057e573d 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -67,10 +67,8 @@ int attk; } if ((target = which_armor(mdef, W_ARM)) != (struct obj *)0) { (void)rust_dmg(target, xname(target), hurt, TRUE, mdef); -#ifdef TOURIST } else if ((target = which_armor(mdef, W_ARMU)) != (struct obj *)0) { (void)rust_dmg(target, xname(target), hurt, TRUE, mdef); -#endif } break; case 2: @@ -745,7 +743,6 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ } tmp = 1; break; -#ifdef TOURIST case EXPENSIVE_CAMERA: You("succeed in destroying %s. Congratulations!", ysimple_name(obj)); @@ -753,7 +750,6 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ return(TRUE); /*NOTREACHED*/ break; -#endif case CORPSE: /* fixed by polder@cs.vu.nl */ if (touch_petrifies(&mons[obj->corpsenm])) { tmp = 1; @@ -1152,9 +1148,7 @@ struct attack *mattk; /* grabbing attacks the body */ obj = which_armor(mdef, W_ARMC); /* cloak */ if (!obj) obj = which_armor(mdef, W_ARM); /* suit */ -#ifdef TOURIST if (!obj) obj = which_armor(mdef, W_ARMU); /* shirt */ -#endif } /* if monster's cloak/armor is greased, your grab slips off; this diff --git a/src/vault.c b/src/vault.c index 5205f6aca..487cb8e7c 100644 --- a/src/vault.c +++ b/src/vault.c @@ -350,10 +350,7 @@ fnd: } if (!strcmpi(buf, "Croesus") || !strcmpi(buf, "Kroisos") -#ifdef TOURIST - || !strcmpi(buf, "Creosote") -#endif - ) { + || !strcmpi(buf, "Creosote")) { if (!mvitals[PM_CROESUS].died) { verbalize("Oh, yes, of course. Sorry to have disturbed you."); mongone(guard); diff --git a/src/worn.c b/src/worn.c index bea315bdc..32bfe1003 100644 --- a/src/worn.c +++ b/src/worn.c @@ -20,9 +20,7 @@ const struct worn { { W_ARMS, &uarms }, { W_ARMG, &uarmg }, { W_ARMF, &uarmf }, -#ifdef TOURIST { W_ARMU, &uarmu }, -#endif { W_RINGL, &uleft }, { W_RINGR, &uright }, { W_WEP, &uwep }, @@ -155,9 +153,7 @@ struct obj *obj; case ARM_GLOVES: res = W_ARMG; break; /* WORN_GLOVES */ case ARM_BOOTS: res = W_ARMF; break; /* WORN_BOOTS */ case ARM_CLOAK: res = W_ARMC; break; /* WORN_CLOAK */ -#ifdef TOURIST case ARM_SHIRT: res = W_ARMU; break; /* WORN_SHIRT */ -#endif } break; case WEAPON_CLASS: @@ -438,11 +434,9 @@ boolean creation; return; m_dowear_type(mon, W_AMUL, creation, FALSE); -#ifdef TOURIST /* can't put on shirt if already wearing suit */ if (!cantweararm(mon->data) && !(mon->misc_worn_check & W_ARM)) m_dowear_type(mon, W_ARMU, creation, FALSE); -#endif /* treating small as a special case allows hobbits, gnomes, and kobolds to wear cloaks */ if (!cantweararm(mon->data) || mon->data->msize == MZ_SMALL) @@ -491,11 +485,9 @@ boolean racialexception; continue; best = obj; goto outer_break; /* no such thing as better amulets */ -#ifdef TOURIST case W_ARMU: if (!is_shirt(obj)) continue; break; -#endif case W_ARMC: if (!is_cloak(obj)) continue; break; @@ -542,11 +534,7 @@ outer_break: best->otyp == DUNCE_CAP) && !best->cursed); /* if wearing a cloak, account for the time spent removing and re-wearing it when putting on a suit or shirt */ - if ((flag == W_ARM -#ifdef TOURIST - || flag == W_ARMU -#endif - ) && (mon->misc_worn_check & W_ARMC)) + if ((flag == W_ARM || flag == W_ARMU) && (mon->misc_worn_check & W_ARMC)) m_delay += 2; /* when upgrading a piece of armor, account for time spent taking off current one */ @@ -741,7 +729,6 @@ boolean polyspot; m_useup(mon, otmp); } } -#ifdef TOURIST if ((otmp = which_armor(mon, W_ARMU)) != 0) { if (vis) pline("%s shirt rips to shreds!", s_suffix(Monnam(mon))); @@ -749,7 +736,6 @@ boolean polyspot; You_hear("a ripping sound."); m_useup(mon, otmp); } -#endif } else if (sliparm(mdat)) { if ((otmp = which_armor(mon, W_ARM)) != 0) { if (vis) @@ -772,7 +758,6 @@ boolean polyspot; if (polyspot) bypass_obj(otmp); m_lose_armor(mon, otmp); } -#ifdef TOURIST if ((otmp = which_armor(mon, W_ARMU)) != 0) { if (vis) { if (sliparm(mon->data)) @@ -785,7 +770,6 @@ boolean polyspot; if (polyspot) bypass_obj(otmp); m_lose_armor(mon, otmp); } -#endif } if (handless_or_tiny) { /* [caller needs to handle weapon checks] */ diff --git a/src/zap.c b/src/zap.c index c19557fd0..752b03796 100644 --- a/src/zap.c +++ b/src/zap.c @@ -2282,10 +2282,8 @@ boolean ordinary; case WAN_LIGHT: /* (broken wand) */ /* assert( !ordinary ); */ damage = d(obj->spe, 25); -#ifdef TOURIST case EXPENSIVE_CAMERA: if (!damage) damage = 5; -#endif damage = lightdamage(obj, ordinary, damage); damage += rnd(25); if (flashburn((long)damage)) learn_it = TRUE; @@ -3371,10 +3369,8 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */ tmp = MAGIC_COOKIE; if ((otmp2 = which_armor(mon, W_ARMC)) != 0) m_useup(mon, otmp2); -#ifdef TOURIST if ((otmp2 = which_armor(mon, W_ARMU)) != 0) m_useup(mon, otmp2); -#endif } type = -1; /* no saving throw wanted */ break; /* not ordinary damage */ @@ -3502,9 +3498,7 @@ xchar sx, sy; /* no shield or suit, you're dead; wipe out cloak and/or shirt in case of life-saving or bones */ if (uarmc) (void) destroy_arm(uarmc); -#ifdef TOURIST if (uarmu) (void) destroy_arm(uarmu); -#endif } else if (nonliving(youmonst.data) || is_demon(youmonst.data)) { shieldeff(sx, sy); You("seem unaffected."); diff --git a/sys/amiga/winami.c b/sys/amiga/winami.c index 4762f0697..c702af237 100644 --- a/sys/amiga/winami.c +++ b/sys/amiga/winami.c @@ -579,11 +579,7 @@ amii_player_selection() { flags.initrole = randrole(); #if 0 /* OBSOLETE */ -#ifdef TOURIST strcpy( pl_character, roles[ rnd( 11 ) ] ); -#else - strcpy( pl_character, roles[ rnd( 10 ) ] ); -#endif #endif aredone = 1; amii_clear_nhwindow( WIN_BASE ); @@ -608,11 +604,7 @@ amii_player_selection() case 1: /* Random Character */ flags.initrole = randrole(); #if 0 /* OBSOLETE */ -#ifdef TOURIST strcpy( pl_character, roles[ rnd( 11 ) ] ); -#else - strcpy( pl_character, roles[ rnd( 10 ) ] ); -#endif #endif amii_clear_nhwindow( WIN_BASE ); CloseShWindow( cwin ); diff --git a/util/makedefs.c b/util/makedefs.c index 6ddff76c0..1de90dc6c 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -996,11 +996,8 @@ make_version() | (1L << 6) #endif /* objects (10..14) */ -#ifdef TOURIST - | (1L << 10) -#endif #ifdef GOLDOBJ - | (1L << 11) + | (1L << 10) #endif /* flag bits and/or other global variables (15..26) */ #ifdef TEXTCOLOR @@ -1339,9 +1336,6 @@ static const char *build_opts[] = { #ifdef TIMED_DELAY "timed wait for display effects", #endif -#ifdef TOURIST - "tourists", -#endif #ifdef USER_SOUNDS # ifdef USER_SOUNDS_REGEX "user sounds via regular expressions", @@ -2515,11 +2509,9 @@ do_objs() if (!strncmp(objnam, "THE_", 4)) objnam += 4; -#ifdef TOURIST /* fudge _platinum_ YENDORIAN EXPRESS CARD */ if (!strncmp(objnam, "PLATINUM_", 9)) objnam += 9; -#endif Fprintf(ofp,"#define\tART_%s\t%d\n", limit(objnam, 1), i); } diff --git a/win/Qt/qt_win.cpp b/win/Qt/qt_win.cpp index 7d3341506..ac2141fcc 100644 --- a/win/Qt/qt_win.cpp +++ b/win/Qt/qt_win.cpp @@ -3498,13 +3498,8 @@ void NetHackQtInvUsageWindow::paintEvent(QPaintEvent*) drawWorn(painter,uarms,0,1); // Shield drawWorn(painter,uarmg,0,2); // Gloves - repeated drawWorn(painter,uarmg,2,2); // Gloves - repeated -#ifdef TOURIST drawWorn(painter,uarmf,1,5); // Shoes (feet) drawWorn(painter,uarmu,1,4); // Undershirt -#else - drawWorn(painter,0 ,1,5,FALSE); - drawWorn(painter,uarmf,1,4); // Shoes (feet) -#endif drawWorn(painter,uleft,0,3); // RingL drawWorn(painter,uright,2,3); // RingR diff --git a/win/gnome/gnworn.c b/win/gnome/gnworn.c index 20a8aa641..ee5e704b5 100644 --- a/win/gnome/gnworn.c +++ b/win/gnome/gnworn.c @@ -14,7 +14,6 @@ #define WORN_WIDTH 3 #define WORN_HEIGHT 6 -#ifdef TOURIST #define WORN_OBJECT_LIST /* struct obj *[WORN_HEIGHT][WORN_WIDTH] = */ { \ { uquiver, uarmh, u.twoweap ? NULL : uswapwep }, \ { u.twoweap ? uswapwep : NULL, ublindf, uwep }, \ @@ -23,16 +22,6 @@ { uarmu, uarm, uskin }, \ { uball, uarmf, uchain } \ } -#else -#define WORN_OBJECT_LIST /* struct obj *[WORN_HEIGHT][WORN_WIDTH] = */ { \ - { uquiver, uarmh, u.twoweap ? NULL : uswapwep }, \ - { u.twoweap ? uswapwep : NULL, ublindf, uwep }, \ - { uleft, uamul, uright }, \ - { uarms, uarmc, uarmg }, \ - { NULL, uarm, uskin }, \ - { uball, uarmf, uchain } \ -} -#endif static GtkWidget *worn_contents[WORN_HEIGHT][WORN_WIDTH]; static struct obj *last_worn_objects[WORN_HEIGHT][WORN_WIDTH]; diff --git a/win/share/tilemap.c b/win/share/tilemap.c index 19872f96a..06c966113 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -48,31 +48,16 @@ struct conditionals { #endif #ifndef MAIL { MON_GLYPH, PM_FAMINE, "mail daemon" }, -#endif -#ifndef TOURIST - { MON_GLYPH, PM_SAMURAI, "tourist" }, #endif /* commented out in monst.c at present */ { MON_GLYPH, PM_SHAMAN_KARNOV, "Earendil" }, { MON_GLYPH, PM_SHAMAN_KARNOV, "Elwing" }, -#ifndef TOURIST - { MON_GLYPH, PM_LORD_SATO, "Twoflower" }, -#endif /* commented out in monst.c at present */ { MON_GLYPH, PM_CHROMATIC_DRAGON, "Goblin King" }, { MON_GLYPH, PM_NEANDERTHAL, "High-elf" }, -#ifndef TOURIST - { MON_GLYPH, PM_ROSHI, "guide" }, -#endif /* objects commented out in objects.c at present */ { OBJ_GLYPH, SILVER_DRAGON_SCALE_MAIL, "shimmering dragon scale mail" }, { OBJ_GLYPH, SILVER_DRAGON_SCALES, "shimmering dragon scales" }, -#ifndef TOURIST - { OBJ_GLYPH, LEATHER_JACKET, "Hawaiian shirt" }, - { OBJ_GLYPH, LEATHER_JACKET, "T-shirt" }, - { OBJ_GLYPH, LOCK_PICK, "credit card" }, - { OBJ_GLYPH, MAGIC_LAMP, "expensive camera" }, -#endif /* allow slime mold to look like slice of pizza, since we * don't know what a slime mold should look like when renamed anyway */ From 1edadd1d482e73cd71ab783a9ed08f4a243e0094 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 13 Feb 2015 23:46:47 -0500 Subject: [PATCH 012/354] Make REINCARNATION unconditional. There is a lot of code affected by this, and Pat Rankin correctly observes that it would be better to store roguelike as a level flag rather than just using Is_rogue_level. A note for the future. --- dat/dungeon.def | 4 ++-- include/config.h | 1 - include/decl.h | 4 ---- include/dungeon.h | 2 -- include/extern.h | 6 ------ src/detect.c | 2 -- src/do.c | 4 ---- src/do_name.c | 2 -- src/dogmove.c | 2 -- src/drawing.c | 20 ++++---------------- src/dungeon.c | 8 -------- src/extralev.c | 3 --- src/files.c | 15 +++------------ src/hack.c | 2 -- src/lock.c | 2 -- src/makemon.c | 18 ------------------ src/mapglyph.c | 14 +++++--------- src/mhitu.c | 2 -- src/mklev.c | 22 ---------------------- src/mkobj.c | 4 ---- src/mon.c | 7 ------- src/monmove.c | 8 +------- src/muse.c | 2 -- src/options.c | 33 ++++++--------------------------- src/read.c | 9 ++------- src/restore.c | 2 -- src/vision.c | 12 ++---------- src/zap.c | 2 -- sys/amiga/winfuncs.c | 10 +--------- sys/msdos/pckeys.c | 16 ++++------------ sys/msdos/vidvga.c | 10 ---------- sys/share/pcmain.c | 2 -- sys/wince/mhmain.c | 2 -- sys/wince/mhmap.c | 6 +----- sys/wince/mswproc.c | 2 -- util/makedefs.c | 13 ++----------- win/Qt/qt_win.cpp | 9 +-------- win/X11/winmap.c | 11 ++--------- win/gem/wingem.c | 8 +------- win/win32/mhmain.c | 2 -- win/win32/mhmap.c | 6 +----- win/win32/mswproc.c | 2 -- 42 files changed, 38 insertions(+), 273 deletions(-) diff --git a/dat/dungeon.def b/dat/dungeon.def index b881884f5..bccd31b85 100644 --- a/dat/dungeon.def +++ b/dat/dungeon.def @@ -19,8 +19,8 @@ DUNGEON: "The Dungeons of Doom" "D" (25, 5) ALIGNMENT: unaligned BRANCH: "The Gnomish Mines" @ (2, 3) -%REINCARNATION LEVEL: "rogue" "R" @ (15, 4) -%REINCARNATION LEVELDESC: roguelike +LEVEL: "rogue" "R" @ (15, 4) +LEVELDESC: roguelike LEVEL: "oracle" "O" @ (5, 5) LEVALIGN: neutral CHAINBRANCH: "Sokoban" "oracle" + (1, 0) up diff --git a/include/config.h b/include/config.h index c9b17524d..bcc8e9903 100644 --- a/include/config.h +++ b/include/config.h @@ -420,7 +420,6 @@ typedef unsigned char uchar; /* dungeon features */ /* dungeon levels */ #define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */ -#define REINCARNATION /* Special Rogue-like levels */ /* monsters & objects */ #define SEDUCE /* Succubi/incubi seduction, by KAA, suggested by IM */ /* I/O */ diff --git a/include/decl.h b/include/decl.h index bfe3052db..8276c6022 100644 --- a/include/decl.h +++ b/include/decl.h @@ -46,9 +46,7 @@ E NEARDATA int in_doagain; E struct dgn_topology { /* special dungeon levels for speed */ d_level d_oracle_level; d_level d_bigroom_level; /* unused */ -#ifdef REINCARNATION d_level d_rogue_level; -#endif d_level d_medusa_level; d_level d_stronghold_level; d_level d_valley_level; @@ -75,9 +73,7 @@ E struct dgn_topology { /* special dungeon levels for speed */ /* macros for accesing the dungeon levels by their old names */ #define oracle_level (dungeon_topology.d_oracle_level) #define bigroom_level (dungeon_topology.d_bigroom_level) -#ifdef REINCARNATION #define rogue_level (dungeon_topology.d_rogue_level) -#endif #define medusa_level (dungeon_topology.d_medusa_level) #define stronghold_level (dungeon_topology.d_stronghold_level) #define valley_level (dungeon_topology.d_valley_level) diff --git a/include/dungeon.h b/include/dungeon.h index 2aac7f39e..d80d22a7d 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -232,9 +232,7 @@ typedef struct mapseen { Bitfield(valley, 1); Bitfield(msanctum, 1); Bitfield(ludios, 1); -# ifdef REINCARNATION Bitfield(roguelevel, 1); -# endif } flags; /* custom naming */ char *custom; diff --git a/include/extern.h b/include/extern.h index 667d598d1..6f0ad015f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -399,9 +399,7 @@ E char *FDECL(distant_monnam, (struct monst *,int,char *)); E const char *NDECL(rndmonnam); E const char *FDECL(hcolor, (const char *)); E const char *NDECL(rndcolor); -#ifdef REINCARNATION E const char *NDECL(roguename); -#endif E struct obj *FDECL(realloc_obj, (struct obj *, int, genericptr_t, int, const char *)); E char *FDECL(coyotename, (struct monst *,char *)); @@ -519,9 +517,7 @@ E int FDECL(def_char_to_monclass, (CHAR_P)); #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C) E void FDECL(switch_symbols, (int)); E void FDECL(assign_graphics, (int)); -#ifdef REINCARNATION E void NDECL(init_r_symbols); -#endif E void NDECL(init_symbols); E void NDECL(init_showsyms); E void NDECL(init_l_symbols); @@ -702,11 +698,9 @@ E void FDECL(explode_oil, (struct obj *,int,int)); /* ### extralev.c ### */ -#ifdef REINCARNATION E void NDECL(makeroguerooms); E void FDECL(corr, (int,int)); E void NDECL(makerogueghost); -#endif /* ### files.c ### */ diff --git a/src/detect.c b/src/detect.c index db280b819..93db6c77c 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1059,12 +1059,10 @@ struct rm *lev; { int newmask = lev->doormask & ~WM_MASK; -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) /* rogue didn't have doors, only doorways */ newmask = D_NODOOR; else -#endif /* newly exposed door is closed */ if (!(newmask & D_LOCKED)) newmask |= D_CLOSED; diff --git a/src/do.c b/src/do.c index 35b0b9c40..e0fe5a5c3 100644 --- a/src/do.c +++ b/src/do.c @@ -1143,10 +1143,8 @@ boolean at_stairs, falling, portal; #endif } -#ifdef REINCARNATION if (Is_rogue_level(newlevel) || Is_rogue_level(&u.uz)) assign_graphics(Is_rogue_level(newlevel) ? ROGUESET : PRIMARY); -#endif #ifdef USE_TILES substitute_tiles(newlevel); #endif @@ -1411,10 +1409,8 @@ boolean at_stairs, falling, portal; } } } else { -#ifdef REINCARNATION if (new && Is_rogue_level(&u.uz)) You("enter what seems to be an older, more primitive world."); -#endif /* main dungeon message from your quest leader */ if (!In_quest(&u.uz0) && at_dgn_entrance("The Quest") && !(u.uevent.qcompleted || u.uevent.qexpelled || diff --git a/src/do_name.c b/src/do_name.c index ea5b64b8b..4face203e 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -1057,7 +1057,6 @@ const char *mname; return FALSE; } -#ifdef REINCARNATION const char * roguename() /* Name of a Rogue player */ { @@ -1075,7 +1074,6 @@ roguename() /* Name of a Rogue player */ return rn2(3) ? (rn2(2) ? "Michael Toy" : "Kenneth Arnold") : "Glenn Wichman"; } -#endif /* REINCARNATION */ static NEARDATA const char * const hcolors[] = { "ultraviolet", "infrared", "bluish-orange", diff --git a/src/dogmove.c b/src/dogmove.c index 526f40454..4300fb8de 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -673,9 +673,7 @@ register int after; /* this is extra fast monster movement */ } if (is_giant(mtmp->data)) allowflags |= BUSTDOOR; if (tunnels(mtmp->data) -#ifdef REINCARNATION && !Is_rogue_level(&u.uz) /* same restriction as m_move() */ -#endif ) allowflags |= ALLOW_DIG; cnt = mfndpos(mtmp, poss, info, allowflags); diff --git a/src/drawing.c b/src/drawing.c index 80e82133f..3d94d8803 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -27,9 +27,7 @@ int currentgraphics = 0; nhsym showsyms[SYM_MAX] = DUMMY; /* symbols to be displayed */ nhsym l_syms[SYM_MAX] = DUMMY; /* loaded symbols */ -#ifdef REINCARNATION nhsym r_syms[SYM_MAX] = DUMMY; /* rogue symbols */ -#endif nhsym warnsyms[WARNCOUNT] = DUMMY; /* the current warning display symbols */ const char invisexplain[] = "remembered, unseen, creature"; @@ -234,7 +232,6 @@ const struct symdef defsyms[MAXPCHARS] = { {'/', "", C(CLR_ORANGE)}, /* explosion bottom right */ }; -#ifdef REINCARNATION /* default rogue level symbols */ static const uchar def_r_oc_syms[MAXOCLASSES] = { /* 0*/ '\0', @@ -256,7 +253,6 @@ static const uchar def_r_oc_syms[MAXOCLASSES] = { CHAIN_SYM, VENOM_SYM }; -#endif #undef C @@ -306,10 +302,10 @@ def_char_to_monclass(ch) * Sets the current display symbols, the * loadable symbols to the default NetHack * symbols, including the r_syms rogue level - * symbols if REINCARNATION is defined. - * This would typically be done immediately - * after execution begins. Any previously - * loaded external symbol sets are discarded. + * symbols. This would typically be done + * immediately after execution begins. Any + * previously loaded external symbol sets are + * discarded. * * switch_symbols(arg) * Called to swap in new current display symbols @@ -350,9 +346,7 @@ init_symbols() { init_l_symbols(); init_showsyms(); -#ifdef REINCARNATION init_r_symbols(); -#endif } void @@ -410,7 +404,6 @@ init_l_symbols() #endif } -#ifdef REINCARNATION void init_r_symbols() { @@ -448,7 +441,6 @@ init_r_symbols() */ # endif } -#endif /*REINCARNATION*/ void assign_graphics(whichset) @@ -457,7 +449,6 @@ int whichset; register int i; switch(whichset) { -# ifdef REINCARNATION case ROGUESET: /* Adjust graphics display characters on Rogue levels */ @@ -469,7 +460,6 @@ int whichset; # endif currentgraphics = ROGUESET; break; -# endif case PRIMARY: default: @@ -518,7 +508,6 @@ int val; l_syms[symp->idx] = val; } -# ifdef REINCARNATION void update_r_symset(symp, val) struct symparse *symp; @@ -526,7 +515,6 @@ int val; { r_syms[symp->idx] = val; } -# endif /* REINCARNATION */ void clear_symsetentry(which_set, name_too) diff --git a/src/dungeon.c b/src/dungeon.c index d87faa15e..c08d195af 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -680,9 +680,7 @@ struct level_map { { "medusa", &medusa_level }, { "oracle", &oracle_level }, { "orcus", &orcus_level }, -#ifdef REINCARNATION { "rogue", &rogue_level }, -#endif { "sanctum", &sanctum_level }, { "valley", &valley_level }, { "water", &water_level }, @@ -2086,9 +2084,7 @@ mapseen *mptr; if (mptr->flags.unreachable || mptr->flags.forgot) return FALSE; /* level is of interest if it has an auto-generated annotation */ if (mptr->flags.oracle || mptr->flags.bigroom || -# ifdef REINCARNATION mptr->flags.roguelevel || -# endif mptr->flags.castle || mptr->flags.valley || mptr->flags.msanctum) return TRUE; /* when in Sokoban, list all sokoban levels visited; when not in it, @@ -2151,9 +2147,7 @@ recalc_mapseen() mptr->flags.bigroom = Is_bigroom(&u.uz); else if (mptr->flags.forgot) mptr->flags.bigroom = 0; -# ifdef REINCARNATION mptr->flags.roguelevel = Is_rogue_level(&u.uz); -# endif mptr->flags.oracle = 0; /* recalculated during room traversal below */ mptr->flags.castletune = 0; /* flags.castle, flags.valley, flags.msanctum retain previous value */ @@ -2650,10 +2644,8 @@ boolean printdun; mptr->flags.sokosolved ? "Solved" : "Unsolved"); } else if (mptr->flags.bigroom) { Sprintf(buf, "%sA very big room.", PREFIX); -# ifdef REINCARNATION } else if (mptr->flags.roguelevel) { Sprintf(buf, "%sA primitive area.", PREFIX); -# endif } else if (on_level(&mptr->lev, &qstart_level)) { Sprintf(buf, "%sHome%s.", PREFIX, mptr->flags.unreachable ? " (no way back...)" : ""); diff --git a/src/extralev.c b/src/extralev.c index 597b23e72..821e5794f 100644 --- a/src/extralev.c +++ b/src/extralev.c @@ -9,8 +9,6 @@ #include "hack.h" -#ifdef REINCARNATION - struct rogueroom { xchar rlx, rly; xchar dx, dy; @@ -336,6 +334,5 @@ makerogueghost() ghostobj->known = TRUE; } } -#endif /* REINCARNATION */ /*extralev.c*/ diff --git a/src/files.c b/src/files.c index 4b72c754d..f667b8093 100644 --- a/src/files.c +++ b/src/files.c @@ -2752,11 +2752,8 @@ int which_set; /* matches desired one */ chosen_symset_start = TRUE; /* these init_*() functions clear symset fields too */ -# ifdef REINCARNATION if (which_set == ROGUESET) init_r_symbols(); - else -# endif - if (which_set == PRIMARY) init_l_symbols(); + else if (which_set == PRIMARY) init_l_symbols(); } break; case 1: @@ -2808,11 +2805,8 @@ int which_set; if (chosen_symset_start) chosen_symset_end = FALSE; chosen_symset_start = FALSE; -# ifdef REINCARNATION if (which_set == ROGUESET) init_r_symbols(); - else -# endif - if (which_set == PRIMARY) init_l_symbols(); + else if (which_set == PRIMARY) init_l_symbols(); } } break; @@ -2822,12 +2816,9 @@ int which_set; if (chosen_symset_start) { if (which_set == PRIMARY) { update_l_symset(symp, val); - } -# ifdef REINCARNATION - else if (which_set == ROGUESET) { + } else if (which_set == ROGUESET) { update_r_symset(symp, val); } -# endif } } } diff --git a/src/hack.c b/src/hack.c index 1bbfa1977..545c4c4aa 100644 --- a/src/hack.c +++ b/src/hack.c @@ -2356,11 +2356,9 @@ int x, y; struct rm *lev_p = &levl[x][y]; if (!IS_DOOR(lev_p->typ)) return FALSE; -#ifdef REINCARNATION /* all rogue level doors are doorless but disallow diagonal access, so we treat them as if their non-existant doors were actually present */ if (Is_rogue_level(&u.uz)) return FALSE; -#endif return !(lev_p->doormask & ~(D_NODOOR|D_BROKEN)); } diff --git a/src/lock.c b/src/lock.c index 2ba1d51b7..73dc8c159 100644 --- a/src/lock.c +++ b/src/lock.c @@ -831,7 +831,6 @@ int x, y; switch(otmp->otyp) { case WAN_LOCKING: case SPE_WIZARD_LOCK: -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) { boolean vis = cansee(x,y); /* Can't have real locking in Rogue, so just hide doorway */ @@ -849,7 +848,6 @@ int x, y; newsym(x,y); return TRUE; } -#endif if (obstructed(x,y,mysterywand)) return FALSE; /* Don't allow doors to close over traps. This is for pits */ /* & trap doors, but is it ever OK for anything else? */ diff --git a/src/makemon.c b/src/makemon.c index 72f3ae6b9..44fcb79a0 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -5,9 +5,7 @@ #include "hack.h" -#ifdef REINCARNATION #include -#endif STATIC_VAR NEARDATA struct monst zeromonst; @@ -160,9 +158,7 @@ register struct monst *mtmp; register int mm = monsndx(ptr); struct obj *otmp; -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) return; -#endif /* * first a few special cases: * @@ -481,9 +477,7 @@ register struct monst *mtmp; register int cnt; register struct obj *otmp; register struct permonst *ptr = mtmp->data; -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) return; -#endif /* * Soldiers get armour & rations - armour approximates their ac. * Nymphs may get mirror or potion of object detection. @@ -1279,9 +1273,7 @@ rndmonst() if (rndmonst_state.choice_count < 0) { /* need to recalculate */ int zlevel, minmlev, maxmlev; boolean elemlevel; -#ifdef REINCARNATION boolean upper; -#endif rndmonst_state.choice_count = 0; /* look for first common monster */ @@ -1301,9 +1293,7 @@ rndmonst() minmlev = zlevel / 6; /* determine the level of the strongest monster to make. */ maxmlev = (zlevel + u.ulevel) / 2; -#ifdef REINCARNATION upper = Is_rogue_level(&u.uz); -#endif elemlevel = In_endgame(&u.uz) && !Is_astralevel(&u.uz); /* @@ -1315,9 +1305,7 @@ rndmonst() rndmonst_state.mchoices[mndx] = 0; if (tooweak(mndx, minmlev) || toostrong(mndx, maxmlev)) continue; -#ifdef REINCARNATION if (upper && !isupper(def_monsyms[(int)(ptr->mlet)].sym)) continue; -#endif if (elemlevel && wrong_elem_type(ptr)) continue; if (uncommon(mndx)) continue; if (Inhell && (ptr->geno & G_NOHELL)) continue; @@ -1825,15 +1813,9 @@ register struct monst *mtmp; levl[mx-1][my].typ == TDWALL || levl[mx-1][my].typ == CROSSWALL|| levl[mx-1][my].typ == TUWALL )) -#ifdef REINCARNATION appear = Is_rogue_level(&u.uz) ? S_hwall : S_hcdoor; else appear = Is_rogue_level(&u.uz) ? S_vwall : S_vcdoor; -#else - appear = S_hcdoor; - else - appear = S_vcdoor; -#endif if(!mtmp->minvis || See_invisible) block_point(mx,my); /* vision */ } else if (level.flags.is_maze_lev && !In_sokoban(&u.uz) && rn2(2)) { diff --git a/src/mapglyph.c b/src/mapglyph.c index b0dfa2a66..f1adae27a 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -34,9 +34,9 @@ int explcolors[] = { #define pet_color(n) color = iflags.use_color ? mons[n].mcolor : NO_COLOR #define warn_color(n) color = iflags.use_color ? def_warnsyms[n].color : NO_COLOR #define explode_color(n) color = iflags.use_color ? explcolors[n] : NO_COLOR -# if defined(REINCARNATION) && defined(LOADSYMSETS) -# define ROGUE_COLOR -# endif +#ifdef LOADSYMSETS +# define ROGUE_COLOR +#endif #else /* no text color */ @@ -236,14 +236,10 @@ unsigned *ospecial; ch = showsyms[idx]; #ifdef TEXTCOLOR /* Turn off color if no color defined, or rogue level w/o PC graphics. */ -# ifdef REINCARNATION -# ifdef ROGUE_COLOR +# ifdef ROGUE_COLOR if (!has_color(color) || (Is_rogue_level(&u.uz) && !has_rogue_color)) -# else - if (!has_color(color) || Is_rogue_level(&u.uz)) -# endif # else - if (!has_color(color)) + if (!has_color(color) || Is_rogue_level(&u.uz)) # endif color = NO_COLOR; #endif diff --git a/src/mhitu.c b/src/mhitu.c index 89cd68968..ad68b2d31 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -654,9 +654,7 @@ mattacku(mtmp) break; case AT_WEAP: if(range2) { -#ifdef REINCARNATION if (!Is_rogue_level(&u.uz)) -#endif thrwmu(mtmp); } else { int hittmp = 0; diff --git a/src/mklev.c b/src/mklev.c index 1d895dc2c..1bba98d61 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -400,11 +400,9 @@ register int type; levl[x][y].doormask = (shdoor ? D_ISOPEN : D_NODOOR); #endif -#ifdef REINCARNATION /* also done in roguecorr(); doing it here first prevents making mimics in place of trapped doors on rogue level */ if (Is_rogue_level(&u.uz)) levl[x][y].doormask = D_NODOOR; -#endif if(levl[x][y].doormask & D_TRAPPED) { struct monst *mtmp; @@ -627,11 +625,7 @@ makelevel() register s_level *slev = Is_special(&u.uz); /* check for special levels */ -#ifdef REINCARNATION if (slev && !Is_rogue_level(&u.uz)) -#else - if (slev) -#endif { makemaz(slev->proto); return; @@ -663,12 +657,10 @@ makelevel() /* otherwise, fall through - it's a "regular" level. */ -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) { makeroguerooms(); makerogueghost(); } else -#endif makerooms(); sort_rooms(); @@ -694,9 +686,7 @@ makelevel() branchp = Is_branchlev(&u.uz); /* possible dungeon branch */ room_threshold = branchp ? 4 : 3; /* minimum number of rooms needed to allow a random special room */ -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) goto skip0; -#endif makecorridors(); make_niches(); @@ -753,9 +743,7 @@ makelevel() !(mvitals[PM_COCKATRICE].mvflags & G_GONE)) mkroom(COCKNEST); } -#ifdef REINCARNATION skip0: -#endif /* Place multi-dungeon branch. */ place_branch(branchp, 0, 0); @@ -784,9 +772,7 @@ skip0: mktrap(0,0,croom,(coord*)0); if (!goldseen && !rn2(3)) (void) mkgold(0L, somex(croom), somey(croom)); -#ifdef REINCARNATION if(Is_rogue_level(&u.uz)) goto skip_nonrogue; -#endif if(!rn2(10)) mkfount(0,croom); if(!rn2(60)) mksink(croom); if(!rn2(60)) mkaltar(croom); @@ -822,9 +808,7 @@ skip0: } } -#ifdef REINCARNATION skip_nonrogue: -#endif if(!rn2(3)) { (void) mkobj_at(0, somex(croom), somey(croom), TRUE); tryct = 0; @@ -863,9 +847,7 @@ mineralize() /* determine if it is even allowed; almost all special levels are excluded */ if (In_hell(&u.uz) || In_V_tower(&u.uz) || -#ifdef REINCARNATION Is_rogue_level(&u.uz) || -#endif level.flags.arboreal || ((sp = Is_special(&u.uz)) != 0 && !Is_oracle_level(&u.uz) && (!In_mines(&u.uz) || sp->flags.town) @@ -983,10 +965,8 @@ register struct mkroom *croom; if ((int) levl[lowx][lowy].roomno == roomno || croom->irregular) return; #ifdef SPECIALIZATION -# ifdef REINCARNATION if (Is_rogue_level(&u.uz)) do_ordinary = TRUE; /* vision routine helper */ -# endif if ((rtype != OROOM) || do_ordinary) #endif { @@ -1207,7 +1187,6 @@ coord *tm; if (num > 0 && num < TRAPNUM) { kind = num; -#ifdef REINCARNATION } else if (Is_rogue_level(&u.uz)) { switch (rn2(7)) { default: kind = BEAR_TRAP; break; /* 0 */ @@ -1218,7 +1197,6 @@ coord *tm; case 5: kind = SLP_GAS_TRAP; break; case 6: kind = RUST_TRAP; break; } -#endif } else if (Inhell && !rn2(5)) { /* bias the frequency of fire traps in Gehennom */ kind = FIRE_TRAP; diff --git a/src/mkobj.c b/src/mkobj.c index 1edb34977..698018e9f 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -52,7 +52,6 @@ const struct icp boxiprobs[] = { { 1, AMULET_CLASS} }; -#ifdef REINCARNATION const struct icp rogueprobs[] = { {12, WEAPON_CLASS}, {12, ARMOR_CLASS}, @@ -62,7 +61,6 @@ const struct icp rogueprobs[] = { { 5, WAND_CLASS}, { 5, RING_CLASS} }; -#endif const struct icp hellprobs[] = { {20, WEAPON_CLASS}, @@ -222,10 +220,8 @@ boolean artif; if(oclass == RANDOM_CLASS) { const struct icp *iprobs = -#ifdef REINCARNATION (Is_rogue_level(&u.uz)) ? (const struct icp *)rogueprobs : -#endif Inhell ? (const struct icp *)hellprobs : (const struct icp *)mkobjprobs; diff --git a/src/mon.c b/src/mon.c index 4ed4b168c..2befc3e5b 100644 --- a/src/mon.c +++ b/src/mon.c @@ -28,14 +28,9 @@ STATIC_DCL boolean FDECL(validvamp, (struct monst *,int *,int)); #endif STATIC_DCL struct permonst *FDECL(accept_newcham_form, (int)); -#ifdef REINCARNATION #define LEVEL_SPECIFIC_NOCORPSE(mdat) \ (Is_rogue_level(&u.uz) || \ (level.flags.graveyard && is_undead(mdat) && rn2(3))) -#else -#define LEVEL_SPECIFIC_NOCORPSE(mdat) \ - (level.flags.graveyard && is_undead(mdat) && rn2(3)) -#endif #if 0 /* part of the original warning code which was replaced in 3.3.1 */ @@ -1048,9 +1043,7 @@ nexttry: /* eels prefer the water, but if there is no water nearby, if (nx != x && ny != y && (nodiag || (IS_DOOR(nowtyp) && (levl[x][y].doormask & ~D_BROKEN)) || (IS_DOOR(ntyp) && (levl[nx][ny].doormask & ~D_BROKEN)) || -#ifdef REINCARNATION ((IS_DOOR(nowtyp) || IS_DOOR(ntyp)) && Is_rogue_level(&u.uz)) || -#endif /* mustn't pass between adjacent long worm segments, but can attack that way */ (m_at(x, ny) && m_at(nx, y) && worm_cross(x, y, nx, ny) && diff --git a/src/monmove.c b/src/monmove.c index cc18bcd3c..dd7315346 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -680,9 +680,7 @@ register int after; /* Not necessary if m_move called from this file, but necessary in * other calls of m_move (ex. leprechauns dodging) */ -#ifdef REINCARNATION if (!Is_rogue_level(&u.uz)) -#endif can_tunnel = tunnels(ptr); can_open = !(nohands(ptr) || verysmall(ptr)); can_unlock = ((can_open && monhaskey(mtmp, TRUE)) || @@ -804,11 +802,7 @@ not_special: } } - if ((!mtmp->mpeaceful || !rn2(10)) -#ifdef REINCARNATION - && (!Is_rogue_level(&u.uz)) -#endif - ) { + if ((!mtmp->mpeaceful || !rn2(10)) && (!Is_rogue_level(&u.uz))) { boolean in_line = lined_up(mtmp) && (distmin(mtmp->mx, mtmp->my, mtmp->mux, mtmp->muy) <= (throws_rocks(youmonst.data) ? 20 : ACURRSTR/2+1) diff --git a/src/muse.c b/src/muse.c index ec4bc55ab..855a91887 100644 --- a/src/muse.c +++ b/src/muse.c @@ -1080,9 +1080,7 @@ struct monst *mtmp; unsolid(mtmp->data) || !rn2(10)) && dist2(mtmp->mx,mtmp->my,mtmp->mux,mtmp->muy) <= 2 && mtmp->mcansee && haseyes(mtmp->data) -#ifdef REINCARNATION && !Is_rogue_level(&u.uz) -#endif && (!In_endgame(&u.uz) || Is_earthlevel(&u.uz))) { m.offensive = obj; m.has_offense = MUSE_SCR_EARTH; diff --git a/src/options.c b/src/options.c index 18966efb5..8504a2c3e 100644 --- a/src/options.c +++ b/src/options.c @@ -369,14 +369,10 @@ static struct Comp_Opt DISP_IN_GAME}, #endif { "roguesymset", "load a set of rogue display symbols from the symbols file", 70, -#ifdef REINCARNATION -# ifdef LOADSYMSETS +#ifdef LOADSYMSETS SET_IN_GAME }, -# else - DISP_IN_GAME}, -# endif #else - SET_IN_FILE}, + DISP_IN_GAME}, #endif { "suppress_alert", "suppress alerts about version-specific features", 8, SET_IN_GAME }, @@ -1417,7 +1413,6 @@ boolean tinitial, tfrom_file; fullname = "roguesymset"; if (match_optname(opts, fullname, 7, TRUE)) { -#if defined(REINCARNATION) && defined(LOADSYMSETS) if (duplicate) complain_about_duplicate(opts,1); if (negated) bad_negation(fullname, FALSE); else if ((op = string_for_opt(opts, FALSE)) != 0) { @@ -1434,7 +1429,6 @@ boolean tinitial, tfrom_file; need_redraw = TRUE; } } -#endif return; } @@ -2594,10 +2588,8 @@ goodfruit: wait_synch(); } else { switch_symbols(TRUE); -# ifdef REINCARNATION if (!initial && Is_rogue_level(&u.uz)) assign_graphics(ROGUESET); -# endif } } # endif /*LOADSYMSETS*/ @@ -3449,16 +3441,10 @@ boolean setinitial,setfromfile; #endif int chosen = -2, which_set; -#ifdef REINCARNATION if (rogueflag) which_set = ROGUESET; else -#endif which_set = PRIMARY; -#ifndef REINCARNATION - if (rogueflag) return TRUE; -#endif - #ifdef LOADSYMSETS /* clear symset[].name as a flag to read_sym_file() to build list */ symset_name = symset[which_set].name; @@ -3587,12 +3573,10 @@ boolean setinitial,setfromfile; symset[which_set].name = symset_name; /* Set default symbols and clear the handling value */ -# ifdef REINCARNATION if(rogueflag) init_r_symbols(); else -# endif - init_l_symbols(); + init_l_symbols(); if (symset[which_set].name) { if (read_sym_file(which_set)) @@ -3605,13 +3589,10 @@ boolean setinitial,setfromfile; if (ready_to_switch) switch_symbols(TRUE); -# ifdef REINCARNATION if (Is_rogue_level(&u.uz)) { if (rogueflag) assign_graphics(ROGUESET); - } else -# endif - if (!rogueflag) assign_graphics(PRIMARY); + } else if (!rogueflag) assign_graphics(PRIMARY); need_redraw = TRUE; #endif /*LOADSYMSETS*/ return TRUE; @@ -3832,17 +3813,15 @@ char *buf; } else if (!strcmp(optname, "race")) Sprintf(buf, "%s", rolestring(flags.initrace, races, noun)); -#ifdef REINCARNATION else if (!strcmp(optname, "roguesymset")) { Sprintf(buf, "%s", -# ifdef LOADSYMSETS +#ifdef LOADSYMSETS symset[ROGUESET].name ? symset[ROGUESET].name : -# endif +#endif "default"); if (currentgraphics == ROGUESET && symset[ROGUESET].name) Strcat(buf, ", active"); -#endif } else if (!strcmp(optname, "role")) Sprintf(buf, "%s", rolestring(flags.initrole, roles, name.m)); diff --git a/src/read.c b/src/read.c index 6f4c7c478..bbdd11a09 100644 --- a/src/read.c +++ b/src/read.c @@ -1322,11 +1322,8 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */ break; case SCR_EARTH: /* TODO: handle steeds */ - if ( -#ifdef REINCARNATION - !Is_rogue_level(&u.uz) && -#endif - (!In_endgame(&u.uz) || Is_earthlevel(&u.uz))) { + if (!Is_rogue_level(&u.uz) + && (!In_endgame(&u.uz) || Is_earthlevel(&u.uz))) { register int x, y; /* Identify the scroll */ @@ -1606,7 +1603,6 @@ do_it: if (Punished && !on && !Blind) move_bc(1, 0, uball->ox, uball->oy, uchain->ox, uchain->oy); -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) { /* Can't use do_clear_area because MAX_RADIUS is too small */ /* rogue lighting must light the entire room */ @@ -1621,7 +1617,6 @@ do_it: } /* hallways remain dark on the rogue level */ } else -#endif do_clear_area(u.ux,u.uy, (obj && obj->oclass==SCROLL_CLASS && obj->blessed) ? 9 : 5, set_lit, (genericptr_t)(on ? &is_lit : (char *)0)); diff --git a/src/restore.c b/src/restore.c index dc883c6da..64e8710d6 100644 --- a/src/restore.c +++ b/src/restore.c @@ -857,9 +857,7 @@ register int fd; if (!wizard && !discover) (void) delete_savefile(); -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) assign_graphics(ROGUESET); -#endif #ifdef USE_TILES substitute_tiles(&u.uz); #endif diff --git a/src/vision.c b/src/vision.c index d835fb554..f00306b8c 100644 --- a/src/vision.c +++ b/src/vision.c @@ -103,9 +103,7 @@ STATIC_DCL void NDECL(view_init); STATIC_DCL void FDECL(view_from,(int,int,char **,char *,char *,int, void (*)(int,int,genericptr_t),genericptr_t)); STATIC_DCL void FDECL(get_unused_cs, (char ***,char **,char **)); -#ifdef REINCARNATION STATIC_DCL void FDECL(rogue_vision, (char **,char *,char *)); -#endif /* Macro definitions that I can't find anywhere. */ #define sign(z) ((z) < 0 ? -1 : ((z) ? 1 : 0 )) @@ -285,7 +283,6 @@ get_unused_cs(rows, rmin, rmax) } -#ifdef REINCARNATION /* * rogue_vision() * @@ -349,7 +346,6 @@ rogue_vision(next, rmin, rmax) } } } -#endif /* REINCARNATION */ /*#define EXTEND_SPINE*/ /* possibly better looking wall-angle */ @@ -568,13 +564,9 @@ vision_recalc(control) /* skip the normal update loop */ goto skip; - } -#ifdef REINCARNATION - else if (Is_rogue_level(&u.uz)) { + } else if (Is_rogue_level(&u.uz)) { rogue_vision(next_array,next_rmin,next_rmax); - } -#endif - else { + } else { int has_night_vision = 1; /* hero has night vision */ if (Underwater && !Is_waterlevel(&u.uz)) { diff --git a/src/zap.c b/src/zap.c index 752b03796..173bee625 100644 --- a/src/zap.c +++ b/src/zap.c @@ -4162,10 +4162,8 @@ short exploding_wand_typ; if (see_it) pline("%s %s reveals a secret door.", yourzap ? "Your" : "The", zapverb); -#ifdef REINCARNATION else if (Is_rogue_level(&u.uz)) You_feel("a draft."); /* new open doorway */ -#endif } /* regular door absorbs remaining zap range, possibly gets destroyed */ diff --git a/sys/amiga/winfuncs.c b/sys/amiga/winfuncs.c index 21f1937e4..cb9e3a504 100644 --- a/sys/amiga/winfuncs.c +++ b/sys/amiga/winfuncs.c @@ -2081,12 +2081,7 @@ if(u.uz.dlevel != x){ } } #endif - if( - WINVERS_AMIV -#ifdef REINCARNATION - && !Is_rogue_level(&u.uz) -#endif - ) + if(WINVERS_AMIV && !Is_rogue_level(&u.uz)) { amii_curs(win,x,y); amiga_print_glyph(win,0,glyph); @@ -2095,7 +2090,6 @@ if(u.uz.dlevel != x){ { /* map glyph to character and color */ (void) mapglyph(glyph, &och, &color, &special, x, y); - /* XXX next if should be ifdef REINCARNATION */ ch = (uchar)och; if( WINVERS_AMIV ){ /* implies Rogue level here */ amii_curs(win,x,y); @@ -2106,10 +2100,8 @@ if(u.uz.dlevel != x){ #ifdef TEXTCOLOR /* Turn off color if rogue level. */ -# ifdef REINCARNATION if (Is_rogue_level(&u.uz)) color = NO_COLOR; -# endif amiga_print_glyph(win,color,ch); #else diff --git a/sys/msdos/pckeys.c b/sys/msdos/pckeys.c index 142618ee7..6551f7df5 100644 --- a/sys/msdos/pckeys.c +++ b/sys/msdos/pckeys.c @@ -56,24 +56,16 @@ unsigned char shift; vga_userpan(0); break; case 0x3E: /* F4 = toggle overview mode */ - if (iflags.tile_view && - !opening_dialog -#ifdef REINCARNATION - && !Is_rogue_level(&u.uz) -#endif - ) { + if (iflags.tile_view && !opening_dialog + && !Is_rogue_level(&u.uz)) { iflags.traditional_view = FALSE; vga_overview(iflags.over_view ? FALSE : TRUE); vga_refresh(); } break; case 0x3F: /* F5 = toggle traditional mode */ - if (iflags.tile_view && - !opening_dialog -#ifdef REINCARNATION - && !Is_rogue_level(&u.uz) -#endif - ) { + if (iflags.tile_view && !opening_dialog + && !Is_rogue_level(&u.uz)) { iflags.over_view = FALSE; vga_traditional(iflags.traditional_view ? FALSE : TRUE); vga_refresh(); diff --git a/sys/msdos/vidvga.c b/sys/msdos/vidvga.c index e128821f9..0784cf007 100644 --- a/sys/msdos/vidvga.c +++ b/sys/msdos/vidvga.c @@ -1171,14 +1171,9 @@ vga_DrawCursor() unsigned char first,second; /* char on[2] = {0xFF,0xFF}; */ /* char off[2] = {0x00,0x00}; */ -#ifdef REINCARNATION boolean isrogue = Is_rogue_level(&u.uz); boolean singlebyte = (isrogue || iflags.over_view || iflags.traditional_view || !inmap); -#else - boolean singlebyte = (iflags.over_view - || iflags.traditional_view || !inmap); -#endif int curtyp; if (!cursor_type && inmap) return; /* CURSOR_INVIS - nothing to do */ @@ -1376,14 +1371,9 @@ vga_HideCursor() int i,pixx,pixy,x,y; char __far *tmp1; char __far *tmp2; -#ifdef REINCARNATION boolean isrogue = Is_rogue_level(&u.uz); boolean singlebyte = (isrogue || iflags.over_view || iflags.traditional_view || !inmap); -#else - boolean singlebyte = (iflags.over_view - || iflags.traditional_view || !inmap); -#endif int curtyp; if (inmap && !cursor_type) return; /* CURSOR_INVIS - nothing to do */ diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index f6c2b6b12..0923f735f 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -309,11 +309,9 @@ char *argv[]; if (!symset[PRIMARY].name) { load_symset("IBMGraphics_2", PRIMARY); } -# ifdef REINCARNATION if (!symset[ROGUESET].name) { load_symset("RogueEpyx", ROGUESET); } -# endif # endif #endif /*LOADSYMSETS*/ diff --git a/sys/wince/mhmain.c b/sys/wince/mhmain.c index ff4e628b3..943ab111f 100644 --- a/sys/wince/mhmain.c +++ b/sys/wince/mhmain.c @@ -1053,9 +1053,7 @@ void mswin_select_map_mode(int mode) #endif /* override for Rogue level */ -#ifdef REINCARNATION if( Is_rogue_level(&u.uz) && !IS_MAP_ASCII(mode) ) return; -#endif /* set map mode menu mark */ if( IS_MAP_ASCII(mode) ) { diff --git a/sys/wince/mhmap.c b/sys/wince/mhmap.c index 1fe386490..f2b611f9c 100644 --- a/sys/wince/mhmap.c +++ b/sys/wince/mhmap.c @@ -569,12 +569,8 @@ void onPaint(HWND hWnd) paint_rt.right = min(data->xPos + (ps.rcPaint.right - data->map_orig.x)/data->xScrTile+1, COLNO); paint_rt.bottom = min(data->yPos + (ps.rcPaint.bottom - data->map_orig.y)/data->yScrTile+1, ROWNO); - if( data->bAsciiMode -#ifdef REINCARNATION - || Is_rogue_level(&u.uz) + if(data->bAsciiMode || Is_rogue_level(&u.uz)) { /* You enter a VERY primitive world! */ -#endif - ) { HGDIOBJ oldFont; oldFont = SelectObject(hDC, data->hMapFont); diff --git a/sys/wince/mswproc.c b/sys/wince/mswproc.c index a4e5ede90..84c2b092c 100644 --- a/sys/wince/mswproc.c +++ b/sys/wince/mswproc.c @@ -793,14 +793,12 @@ void mswin_clear_nhwindow(winid wid) (wid < MAXWINDOWS) && (GetNHApp()->windowlist[wid].win != NULL)) { -#ifdef REINCARNATION if( GetNHApp()->windowlist[wid].type == NHW_MAP ) { if( Is_rogue_level(&u.uz) ) mswin_map_mode(mswin_hwnd_from_winid(WIN_MAP), ROGUE_LEVEL_MAP_MODE); else mswin_map_mode(mswin_hwnd_from_winid(WIN_MAP), iflags.wc_map_mode); } -#endif SendMessage( GetNHApp()->windowlist[wid].win, diff --git a/util/makedefs.c b/util/makedefs.c index 1de90dc6c..5cf318416 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -988,9 +988,6 @@ make_version() */ version.feature_set = (unsigned long)(0L /* levels and/or topology (0..4) */ -#ifdef REINCARNATION - | (1L << 1) -#endif /* monsters (5..9) */ #ifdef MAIL | (1L << 6) @@ -1289,9 +1286,6 @@ static const char *build_opts[] = { #ifdef SELECTSAVED "restore saved games via menu", #endif -#ifdef REINCARNATION - "rogue level", -#endif #ifdef SCORE_ON_BOTL "score on status line", #endif @@ -1823,12 +1817,9 @@ static struct deflist { const char *defname; boolean true_or_false; } deflist[] = { -#ifdef REINCARNATION { "REINCARNATION", TRUE }, -#else - { "REINCARNATION", FALSE }, -#endif - { 0, 0 } }; + { 0, 0 } +}; static int check_control(s) diff --git a/win/Qt/qt_win.cpp b/win/Qt/qt_win.cpp index ac2141fcc..af412e25a 100644 --- a/win/Qt/qt_win.cpp +++ b/win/Qt/qt_win.cpp @@ -1644,12 +1644,7 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event) painter.begin(this); - if ( -#ifdef REINCARNATION - Is_rogue_level(&u.uz) || -#endif - iflags.wc_ascii_map - ) + if (Is_rogue_level(&u.uz) || iflags.wc_ascii_map) { // You enter a VERY primitive world! @@ -1730,7 +1725,6 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event) } if (garea.contains(cursor)) { -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) { #ifdef TEXTCOLOR painter.setPen( white ); @@ -1738,7 +1732,6 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event) painter.setPen( green ); // REALLY primitive #endif } else -#endif { int hp100; if (u.mtimedone) { diff --git a/win/X11/winmap.c b/win/X11/winmap.c index cc48a5478..dd92ad680 100644 --- a/win/X11/winmap.c +++ b/win/X11/winmap.c @@ -839,10 +839,7 @@ display_map_window(wp) register int row; struct map_info_t *map_info = wp->map_information; - if (( -#ifdef REINCARNATION - Is_rogue_level(&u.uz) ? map_info->is_tile : -#endif + if ((Is_rogue_level(&u.uz) ? map_info->is_tile : (map_info->is_tile != iflags.wc_tiled_map)) && map_info->tile_map.image_width) { /* changed map display mode, re-display the full map */ @@ -850,11 +847,7 @@ display_map_window(wp) sizeof(map_info->t_start)); (void) memset((genericptr_t) map_info->t_stop, (char) COLNO-1, sizeof(map_info->t_stop)); - map_info->is_tile = iflags.wc_tiled_map -#ifdef REINCARNATION - && !Is_rogue_level(&u.uz) -#endif - ; + map_info->is_tile = iflags.wc_tiled_map && !Is_rogue_level(&u.uz); XClearWindow(XtDisplay(wp->w), XtWindow(wp->w)); set_map_size(wp, COLNO, ROWNO); check_cursor_visibility(wp); diff --git a/win/gem/wingem.c b/win/gem/wingem.c index 63fda6914..87d175231 100644 --- a/win/gem/wingem.c +++ b/win/gem/wingem.c @@ -911,9 +911,7 @@ int x, y; void mar_print_gl_char(winid,xchar,xchar,int); -#ifdef REINCARNATION extern int mar_set_rogue(int); -#endif extern void mar_add_pet_sign(winid,int,int); @@ -926,9 +924,7 @@ Gem_print_glyph(window, x, y, glyph) /* Move the cursor. */ Gem_curs(window, x,y); -# ifdef REINCARNATION - mar_set_rogue(Is_rogue_level(&u.uz) ? TRUE : FALSE); -# endif + mar_set_rogue(Is_rogue_level(&u.uz) ? TRUE : FALSE); x--; /* MAR -- because x ranges from 1 to COLNO */ if(mar_set_tile_mode(-1)){ @@ -960,9 +956,7 @@ void mar_print_gl_char(window, x, y, glyph) #ifdef TEXTCOLOR /* Turn off color if rogue level. */ -# ifdef REINCARNATION if (Is_rogue_level(&u.uz)) color = NO_COLOR; -# endif #endif /* TEXTCOLOR */ mar_print_char(window,x,y,ch,color); diff --git a/win/win32/mhmain.c b/win/win32/mhmain.c index b8a2dac10..6092f5cd5 100644 --- a/win/win32/mhmain.c +++ b/win/win32/mhmain.c @@ -1043,9 +1043,7 @@ void mswin_select_map_mode(int mode) data = (PNHMainWindow)GetWindowLongPtr(GetNHApp()->hMainWnd, GWLP_USERDATA); /* override for Rogue level */ -#ifdef REINCARNATION if( Is_rogue_level(&u.uz) && !IS_MAP_ASCII(mode) ) return; -#endif /* set map mode menu mark */ if( IS_MAP_ASCII(mode) ) { diff --git a/win/win32/mhmap.c b/win/win32/mhmap.c index ff1a43fb1..bd3c60a17 100644 --- a/win/win32/mhmap.c +++ b/win/win32/mhmap.c @@ -603,12 +603,8 @@ void onPaint(HWND hWnd) paint_rt.right = min(data->xPos + (ps.rcPaint.right - data->map_orig.x)/data->xScrTile+1, COLNO); paint_rt.bottom = min(data->yPos + (ps.rcPaint.bottom - data->map_orig.y)/data->yScrTile+1, ROWNO); - if( data->bAsciiMode -#ifdef REINCARNATION - || Is_rogue_level(&u.uz) + if( data->bAsciiMode || Is_rogue_level(&u.uz) ) { /* You enter a VERY primitive world! */ -#endif - ) { HGDIOBJ oldFont; oldFont = SelectObject(hDC, data->hMapFont); diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index 11b109067..39776d87b 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -802,14 +802,12 @@ void mswin_clear_nhwindow(winid wid) (wid < MAXWINDOWS) && (GetNHApp()->windowlist[wid].win != NULL)) { -#ifdef REINCARNATION if( GetNHApp()->windowlist[wid].type == NHW_MAP ) { if( Is_rogue_level(&u.uz) ) mswin_map_mode(mswin_hwnd_from_winid(WIN_MAP), ROGUE_LEVEL_MAP_MODE); else mswin_map_mode(mswin_hwnd_from_winid(WIN_MAP), iflags.wc_map_mode); } -#endif SendMessage( GetNHApp()->windowlist[wid].win, From ad82ca80f318ac88ccaf36efef7fd13ad81a0b31 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 13 Feb 2015 23:58:46 -0500 Subject: [PATCH 013/354] Make DUNGEON_OVERVIEW unconditional. --- include/config.h | 1 - include/dungeon.h | 2 -- include/extern.h | 2 -- include/rm.h | 4 ---- src/bones.c | 4 ---- src/cmd.c | 18 ------------------ src/decl.c | 2 -- src/display.c | 8 +------- src/do.c | 6 ------ src/dungeon.c | 14 -------------- src/hack.c | 2 -- src/lock.c | 17 ++++------------- src/mklev.c | 2 -- src/priest.c | 2 -- src/quest.c | 2 -- src/read.c | 4 ---- src/restore.c | 2 -- src/save.c | 2 -- src/vision.c | 2 -- util/makedefs.c | 3 --- 20 files changed, 5 insertions(+), 94 deletions(-) diff --git a/include/config.h b/include/config.h index bcc8e9903..abdeb4187 100644 --- a/include/config.h +++ b/include/config.h @@ -450,7 +450,6 @@ typedef unsigned char uchar; /*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */ #define STATUS_VIA_WINDOWPORT /* re-work of the status line updating process */ #define STATUS_HILITES /* support hilites of status fields */ -#define DUNGEON_OVERVIEW /* dungeon overview by Hojita Discordia */ /* #define WINCHAIN*/ /* stacked window systems */ /* End of Section 5 */ diff --git a/include/dungeon.h b/include/dungeon.h index d80d22a7d..f2bf75ef6 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -169,7 +169,6 @@ struct linfo { #endif /* MFLOPPY */ }; -#ifdef DUNGEON_OVERVIEW /* types and structures for dungeon map recording * * It is designed to eliminate the need for an external notes file for some of @@ -245,5 +244,4 @@ typedef struct mapseen { struct cemetery *final_resting_place; /* same as level.bonesinfo */ } mapseen; -#endif /* DUNGEON_OVERVIEW */ #endif /* DUNGEON_H */ diff --git a/include/extern.h b/include/extern.h index 6f0ad015f..186d5c9ff 100644 --- a/include/extern.h +++ b/include/extern.h @@ -581,7 +581,6 @@ E schar FDECL(lev_by_name, (const char *)); #ifdef WIZARD E schar FDECL(print_dungeon, (BOOLEAN_P,schar *,xchar *)); #endif -#ifdef DUNGEON_OVERVIEW E int NDECL(donamelevel); E int NDECL(dooverview); E void FDECL(show_overview, (int,int)); @@ -592,7 +591,6 @@ E void FDECL(mapseen_temple, (struct monst *)); E void FDECL(room_discovered, (int)); E void FDECL(recbranch_mapseen, (d_level *, d_level *)); E void FDECL(remdun_mapseen, (int)); -#endif /* DUNGEON_OVERVIEW */ /* ### eat.c ### */ diff --git a/include/rm.h b/include/rm.h index fbd7470cf..8747407f9 100644 --- a/include/rm.h +++ b/include/rm.h @@ -506,11 +506,9 @@ struct cemetery { char how[100 + 1]; /* [DTHSZ+1] */ /* date+time in string of digits rather than binary */ char when[4+2+2 + 2+2+2 + 1]; /* "YYYYMMDDhhmmss\0" */ -#ifdef DUNGEON_OVERVIEW /* final resting place spot */ schar frpx, frpy; boolean bonesknown; -#endif }; struct levelflags { @@ -564,9 +562,7 @@ typedef struct } dlevel_t; -#ifdef DUNGEON_OVERVIEW extern schar lastseentyp[COLNO][ROWNO]; /* last seen/touched dungeon typ */ -#endif /* DUNGEON_OVERVIEW */ extern dlevel_t level; /* structure describing the current level */ diff --git a/src/bones.c b/src/bones.c index e6c33a262..8a36ea11d 100644 --- a/src/bones.c +++ b/src/bones.c @@ -457,9 +457,7 @@ struct obj *corpse; levl[x][y].seenv = 0; levl[x][y].waslit = 0; levl[x][y].glyph = cmap_to_glyph(S_stone); -#ifdef DUNGEON_OVERVIEW lastseentyp[x][y] = 0; -#endif } /* Attach bones info to the current level before saving. */ @@ -476,11 +474,9 @@ struct obj *corpse; aligns[1 - u.ualign.type].filecode); formatkiller(newbones->how, sizeof newbones->how, how); Strcpy(newbones->when, yyyymmddhhmmss(when)); -#ifdef DUNGEON_OVERVIEW /* final resting place, used to decide when bones are discovered */ newbones->frpx = u.ux, newbones->frpy = u.uy; newbones->bonesknown = FALSE; -#endif /* if current character died on a bones level, the cememtery list will have multiple entries, most recent (this dead hero) first */ newbones->next = level.bonesinfo; diff --git a/src/cmd.c b/src/cmd.c index 2abb73a07..00e139001 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -123,9 +123,7 @@ STATIC_PTR int NDECL(doprev_message); STATIC_PTR int NDECL(timed_occupation); STATIC_PTR int NDECL(doextcmd); STATIC_PTR int NDECL(domonability); -#ifdef DUNGEON_OVERVIEW STATIC_PTR int NDECL(dooverview_or_wiz_where); -#endif /* DUNGEON_OVERVIEW */ STATIC_PTR int NDECL(dotravel); STATIC_PTR int NDECL(doterrain); # ifdef WIZARD @@ -537,7 +535,6 @@ enter_explore_mode(VOID_ARGS) return 0; } -#ifdef DUNGEON_OVERVIEW STATIC_PTR int dooverview_or_wiz_where(VOID_ARGS) { @@ -549,7 +546,6 @@ dooverview_or_wiz_where(VOID_ARGS) return 0; } -#endif /* DUNGEON_OVERVIEW */ #ifdef WIZARD /* ^W command - wish for something */ @@ -2392,14 +2388,8 @@ static const struct func_tab cmdlist[] = { {C('i'), TRUE, wiz_identify}, #endif {C('l'), TRUE, doredraw}, /* if number_pad is set */ -#ifndef DUNGEON_OVERVIEW -#ifdef WIZARD - {C('o'), TRUE, wiz_where}, -#endif -#else {C('n'), TRUE, donamelevel}, /* if number_pad is set */ {C('o'), TRUE, dooverview_or_wiz_where}, /* depending on wizard status */ -#endif /* DUNGEON_OVERVIEW */ {C('p'), TRUE, doprev_message}, {C('r'), TRUE, doredraw}, {C('t'), TRUE, dotele}, @@ -2412,9 +2402,7 @@ static const struct func_tab cmdlist[] = { {'a', FALSE, doapply}, {'A', FALSE, doddoremarm}, {M('a'), TRUE, doorganize}, -#ifdef DUNGEON_OVERVIEW {M('A'), TRUE, donamelevel}, /* #annotate */ -#endif /* 'b', 'B' : go sw */ {'c', FALSE, doclose}, {'C', TRUE, docallcmd}, @@ -2449,9 +2437,7 @@ static const struct func_tab cmdlist[] = { {'o', FALSE, doopen}, {'O', TRUE, doset}, {M('o'), FALSE, dosacrifice}, -#ifdef DUNGEON_OVERVIEW {M('O'), TRUE, dooverview}, /* #overview */ -#endif {'p', FALSE, dopay}, {'P', FALSE, doputon}, {M('p'), TRUE, dopray}, @@ -2517,9 +2503,7 @@ static const struct func_tab cmdlist[] = { struct ext_func_tab extcmdlist[] = { {"adjust", "adjust inventory letters", doorganize, TRUE}, -#ifdef DUNGEON_OVERVIEW {"annotate", "name current level", donamelevel, TRUE}, -#endif /* DUNGEON_OVERVIEW */ {"chat", "talk to someone", dotalk, TRUE}, /* converse? */ {"conduct", "list voluntary challenges you have maintained", doconduct, TRUE}, @@ -2533,9 +2517,7 @@ struct ext_func_tab extcmdlist[] = { {"monster", "use a monster's special ability", domonability, TRUE}, {"name", "name a monster or an object", docallcmd, TRUE}, {"offer", "offer a sacrifice to the gods", dosacrifice, FALSE}, -#ifdef DUNGEON_OVERVIEW {"overview", "show an overview of the dungeon", dooverview, TRUE}, -#endif /* DUNGEON_OVERVIEW */ {"pray", "pray to the gods for help", dopray, TRUE}, {"quit", "exit without saving current game", done2, TRUE}, {"ride", "ride (or stop riding) a monster", doride, FALSE}, diff --git a/src/decl.c b/src/decl.c index c9105bee6..d4892f9d4 100644 --- a/src/decl.c +++ b/src/decl.c @@ -142,9 +142,7 @@ NEARDATA struct you u = DUMMY; NEARDATA time_t ubirthday = DUMMY; -#ifdef DUNGEON_OVERVIEW schar lastseentyp[COLNO][ROWNO] = {DUMMY}; /* last seen/touched dungeon typ */ -#endif /* DUNGEON_OVERVIEW */ NEARDATA struct obj *invent = (struct obj *)0, *uwep = (struct obj *)0, *uarm = (struct obj *)0, diff --git a/src/display.c b/src/display.c index 263dd853a..48b9f0b65 100644 --- a/src/display.c +++ b/src/display.c @@ -137,11 +137,7 @@ STATIC_DCL void FDECL(set_seenv, (struct rm *, int, int, int, int)); STATIC_DCL void FDECL(t_warn, (struct rm *)); STATIC_DCL int FDECL(wall_angle, (struct rm *)); -#ifdef DUNGEON_OVERVIEW -# define remember_topology(x,y) (lastseentyp[x][y] = levl[x][y].typ) -#else -# define remember_topology(x,y) /*empty*/ -#endif +#define remember_topology(x,y) (lastseentyp[x][y] = levl[x][y].typ) #ifdef INVISIBLE_OBJECTS /* @@ -420,10 +416,8 @@ display_monster(x, y, mon, sightflags, worm_tail) levl[x][y].glyph = glyph; if (!sensed) { show_glyph(x,y, glyph); -#ifdef DUNGEON_OVERVIEW /* override real topology with mimic's fake one */ lastseentyp[x][y] = cmap_to_type(sym); -#endif } break; } diff --git a/src/do.c b/src/do.c index e0fe5a5c3..4e5876e6b 100644 --- a/src/do.c +++ b/src/do.c @@ -1107,9 +1107,7 @@ boolean at_stairs, falling, portal; keepdogs(FALSE); if (u.uswallow) /* idem */ u.uswldtim = u.uswallow = 0; -#ifdef DUNGEON_OVERVIEW recalc_mapseen(); /* recalculate map overview before we leave the level */ -#endif /* DUNGEON_OVERVIEW */ /* * We no longer see anything on the level. Make sure that this * follows u.uswallow set to null since uswallow overrides all @@ -1136,11 +1134,9 @@ boolean at_stairs, falling, portal; /* discard unreachable levels; keep #0 */ for (l_idx = maxledgerno(); l_idx > 0; --l_idx) delete_levelfile(l_idx); -#ifdef DUNGEON_OVERVIEW /* mark #overview data for all dungeon branches as uninteresting */ for (l_idx = 0; l_idx < n_dgns; ++l_idx) remdun_mapseen(l_idx); -#endif } if (Is_rogue_level(newlevel) || Is_rogue_level(&u.uz)) @@ -1148,13 +1144,11 @@ boolean at_stairs, falling, portal; #ifdef USE_TILES substitute_tiles(newlevel); #endif -#ifdef DUNGEON_OVERVIEW /* record this level transition as a potential seen branch unless using * some non-standard means of transportation (level teleport). */ if ((at_stairs || falling || portal) && (u.uz.dnum != newlevel->dnum)) recbranch_mapseen(&u.uz, newlevel); -#endif /* DUNGEON_OVERVIEW */ assign_level(&u.uz0, &u.uz); assign_level(&u.uz, newlevel); assign_level(&u.utolev, newlevel); diff --git a/src/dungeon.c b/src/dungeon.c index c08d195af..ed186796b 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -59,7 +59,6 @@ STATIC_DCL const char *FDECL(br_string, (int)); STATIC_DCL void FDECL(print_branch, (winid, int, int, int, BOOLEAN_P, struct lchoice *)); #endif -#ifdef DUNGEON_OVERVIEW mapseen *mapseenchn = (struct mapseen *)0; STATIC_DCL mapseen *FDECL(load_mapseen, (int)); STATIC_DCL void FDECL(save_mapseen, (int, mapseen *)); @@ -72,7 +71,6 @@ STATIC_DCL const char *FDECL(br_string2, (branch *)); STATIC_DCL const char *FDECL(endgamelevelname, (char *,int)); STATIC_DCL const char *FDECL(shop_string, (int)); STATIC_DCL char *FDECL(tunesuffix, (mapseen *,char *)); -#endif /* DUNGEON_OVERVIEW */ #ifdef DEBUG #define DD dungeons[i] @@ -135,9 +133,7 @@ save_dungeon(fd, perform_write, free_data) boolean perform_write, free_data; { branch *curr, *next; -#ifdef DUNGEON_OVERVIEW mapseen *curr_ms, *next_ms; -#endif int count; if (perform_write) { @@ -159,14 +155,12 @@ save_dungeon(fd, perform_write, free_data) (unsigned)count * sizeof (struct linfo)); bwrite(fd, (genericptr_t) &inv_pos, sizeof inv_pos); -#ifdef DUNGEON_OVERVIEW for (count = 0, curr_ms = mapseenchn; curr_ms; curr_ms = curr_ms->next) count++; bwrite(fd, (genericptr_t) &count, sizeof(count)); for (curr_ms = mapseenchn; curr_ms; curr_ms = curr_ms->next) save_mapseen(fd, curr_ms); -#endif /* DUNGEON_OVERVIEW */ } if (free_data) { @@ -175,7 +169,6 @@ save_dungeon(fd, perform_write, free_data) free((genericptr_t) curr); } branches = 0; -#ifdef DUNGEON_OVERVIEW for (curr_ms = mapseenchn; curr_ms; curr_ms = next_ms) { next_ms = curr_ms->next; if (curr_ms->custom) @@ -183,7 +176,6 @@ save_dungeon(fd, perform_write, free_data) free((genericptr_t) curr_ms); } mapseenchn = 0; -#endif /* DUNGEON_OVERVIEW */ } } @@ -194,9 +186,7 @@ restore_dungeon(fd) { branch *curr, *last; int count, i; -#ifdef DUNGEON_OVERVIEW mapseen *curr_ms, *last_ms; -#endif mread(fd, (genericptr_t) &n_dgns, sizeof(n_dgns)); mread(fd, (genericptr_t) dungeons, sizeof(dungeon) * (unsigned)n_dgns); @@ -223,7 +213,6 @@ restore_dungeon(fd) mread(fd, (genericptr_t) level_info, (unsigned)count*sizeof(struct linfo)); mread(fd, (genericptr_t) &inv_pos, sizeof inv_pos); -#ifdef DUNGEON_OVERVIEW mread(fd, (genericptr_t) &count, sizeof(count)); last_ms = (mapseen *) 0; for (i = 0; i < count; i++) { @@ -235,7 +224,6 @@ restore_dungeon(fd) mapseenchn = curr_ms; last_ms = curr_ms; } -#endif /* DUNGEON_OVERVIEW */ } static void @@ -1835,7 +1823,6 @@ xchar *rdgn; } #endif /* WIZARD */ -#ifdef DUNGEON_OVERVIEW /* Record that the player knows about a branch from a level. This function * will determine whether or not it was a "real" branch that was taken. * This function should not be called for a transition done via level @@ -2711,6 +2698,5 @@ boolean printdun; } } } -#endif /* DUNGEON_OVERVIEW */ /*dungeon.c*/ diff --git a/src/hack.c b/src/hack.c index 545c4c4aa..66e0962e6 100644 --- a/src/hack.c +++ b/src/hack.c @@ -2115,9 +2115,7 @@ register boolean newlev; rt = 0; break; } -#ifdef DUNGEON_OVERVIEW if (msg_given) room_discovered(roomno); -#endif if (rt != 0) { rooms[roomno].rtype = OROOM; diff --git a/src/lock.c b/src/lock.c index 73dc8c159..67a11a545 100644 --- a/src/lock.c +++ b/src/lock.c @@ -561,16 +561,12 @@ doopen() /* try to open a door */ portcullis = (is_drawbridge_wall(cc.x, cc.y) >= 0); if (Blind) { int oldglyph = door->glyph; -#ifdef DUNGEON_OVERVIEW schar oldlastseentyp = lastseentyp[cc.x][cc.y]; -#endif feel_location(cc.x, cc.y); if (door->glyph != oldglyph -#ifdef DUNGEON_OVERVIEW - || lastseentyp[cc.x][cc.y] != oldlastseentyp -#endif - ) res = 1; /* learned something */ + || lastseentyp[cc.x][cc.y] != oldlastseentyp) + res = 1; /* learned something */ } if (portcullis || !IS_DOOR(door->typ)) { @@ -693,16 +689,11 @@ doclose() /* try to close a door */ portcullis = (is_drawbridge_wall(x, y) >= 0); if (Blind) { int oldglyph = door->glyph; -#ifdef DUNGEON_OVERVIEW schar oldlastseentyp = lastseentyp[x][y]; -#endif feel_location(x, y); - if (door->glyph != oldglyph -#ifdef DUNGEON_OVERVIEW - || lastseentyp[x][y] != oldlastseentyp -#endif - ) res = 1; /* learned something */ + if (door->glyph != oldglyph || lastseentyp[x][y] != oldlastseentyp) + res = 1; /* learned something */ } if (portcullis || !IS_DOOR(door->typ)) { diff --git a/src/mklev.c b/src/mklev.c index 1bba98d61..acb4daac4 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -912,9 +912,7 @@ mklev() struct mkroom *croom; int ridx; -#ifdef DUNGEON_OVERVIEW init_mapseen(&u.uz); -#endif if(getbones()) return; in_mklev = TRUE; diff --git a/src/priest.c b/src/priest.c index 915813af0..5e3b2ea10 100644 --- a/src/priest.c +++ b/src/priest.c @@ -445,11 +445,9 @@ int roomno; if (*this_time <= *other_time) *other_time = *this_time - 1L; } } -#ifdef DUNGEON_OVERVIEW /* recognize the Valley of the Dead and Moloch's Sanctum once hero has encountered the temple priest on those levels */ mapseen_temple(priest); -#endif } else { /* untended */ diff --git a/src/quest.c b/src/quest.c index c5ef6c819..566d7f029 100644 --- a/src/quest.c +++ b/src/quest.c @@ -174,9 +174,7 @@ boolean seal; if (seal) { /* remove the portal to the quest - sealing it off */ int reexpelled = u.uevent.qexpelled; u.uevent.qexpelled = 1; -#ifdef DUNGEON_OVERVIEW remdun_mapseen(quest_dnum); -#endif /* Delete the near portal now; the far (main dungeon side) portal will be deleted as part of arrival on that level. If monster movement is in progress, any who haven't moved diff --git a/src/read.c b/src/read.c index bbdd11a09..6e3147714 100644 --- a/src/read.c +++ b/src/read.c @@ -570,9 +570,7 @@ forget_map(howmuch) levl[zx][zy].seenv = 0; levl[zx][zy].waslit = 0; levl[zx][zy].glyph = cmap_to_glyph(S_stone); -#ifdef DUNGEON_OVERVIEW lastseentyp[zx][zy] = STONE; -#endif } } @@ -633,9 +631,7 @@ forget_levels(percent) count = ((count * percent) + 50) / 100; for (i = 0; i < count; i++) { level_info[indices[i]].flags |= FORGOTTEN; -#ifdef DUNGEON_OVERVIEW forget_mapseen(indices[i]); -#endif } } diff --git a/src/restore.c b/src/restore.c index 64e8710d6..30af7762c 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1015,9 +1015,7 @@ boolean ghostly; } restcemetery(fd, &level.bonesinfo); rest_levl(fd, (boolean)((sfrestinfo.sfi1 & SFI1_RLECOMP) == SFI1_RLECOMP)); -#ifdef DUNGEON_OVERVIEW mread(fd, (genericptr_t)lastseentyp, sizeof(lastseentyp)); -#endif mread(fd, (genericptr_t)&omoves, sizeof(omoves)); elapsed = monstermoves - omoves; mread(fd, (genericptr_t)&upstair, sizeof(stairway)); diff --git a/src/save.c b/src/save.c index f8f5d40b0..e66a5c9eb 100644 --- a/src/save.c +++ b/src/save.c @@ -511,9 +511,7 @@ int mode; #endif savecemetery(fd, mode, &level.bonesinfo); savelevl(fd, (boolean)((sfsaveinfo.sfi1 & SFI1_RLECOMP) == SFI1_RLECOMP)); -#ifdef DUNGEON_OVERVIEW bwrite(fd,(genericptr_t) lastseentyp,sizeof(lastseentyp)); -#endif bwrite(fd,(genericptr_t) &monstermoves,sizeof(monstermoves)); bwrite(fd,(genericptr_t) &upstair,sizeof(stairway)); bwrite(fd,(genericptr_t) &dnstair,sizeof(stairway)); diff --git a/src/vision.c b/src/vision.c index f00306b8c..a6585de14 100644 --- a/src/vision.c +++ b/src/vision.c @@ -803,9 +803,7 @@ skip: viz_rmin = next_rmin; viz_rmax = next_rmax; -#ifdef DUNGEON_OVERVIEW recalc_mapseen(); -#endif } diff --git a/util/makedefs.c b/util/makedefs.c index 5cf318416..4ddb7f449 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1236,9 +1236,6 @@ static const char *build_opts[] = { #ifdef WIZARD "debug mode", #endif -#ifdef DUNGEON_OVERVIEW - "dungeon map overview patch", -#endif #ifdef EXP_ON_BOTL "experience points on status line", #endif From 4f59f5c6fdb334d29abf0a4a02148024937b7f61 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sat, 14 Feb 2015 00:31:17 -0500 Subject: [PATCH 014/354] Make WIZARD unconditional. --- include/config.h | 12 +++------ include/decl.h | 2 -- include/extern.h | 22 +--------------- include/flag.h | 2 -- include/trampoli.h | 2 -- include/vmsconf.h | 11 +------- src/allmain.c | 6 ----- src/attrib.c | 2 -- src/bones.c | 25 ++---------------- src/cmd.c | 62 +++------------------------------------------ src/do.c | 4 --- src/dungeon.c | 22 +++------------- src/eat.c | 4 --- src/end.c | 20 +++------------ src/engrave.c | 2 -- src/exper.c | 2 -- src/files.c | 13 +--------- src/fountain.c | 2 -- src/invent.c | 6 ----- src/light.c | 4 --- src/makemon.c | 8 ++---- src/mklev.c | 12 +-------- src/mkmaze.c | 2 -- src/mkobj.c | 4 --- src/mkroom.c | 15 +++-------- src/mon.c | 6 ----- src/monmove.c | 2 -- src/objnam.c | 12 --------- src/options.c | 34 +------------------------ src/pager.c | 6 ----- src/pline.c | 4 --- src/pray.c | 2 -- src/quest.c | 2 -- src/questpgr.c | 2 -- src/read.c | 8 ------ src/rect.c | 2 -- src/restore.c | 4 --- src/rumors.c | 2 -- src/save.c | 4 --- src/shknam.c | 2 -- src/sp_lev.c | 4 --- src/steed.c | 4 --- src/sys.c | 4 --- src/teleport.c | 58 +++++------------------------------------- src/timeout.c | 8 ------ src/u_init.c | 2 -- src/weapon.c | 11 +------- sys/be/bemain.c | 6 ----- sys/mac/macmain.c | 4 --- sys/mac/macmenu.c | 15 ++--------- sys/share/pcmain.c | 10 -------- sys/unix/unixmain.c | 11 +------- sys/unix/unixunix.c | 2 -- sys/vms/vmsmain.c | 17 +++---------- sys/vms/vmsunix.c | 2 -- sys/wince/mhcmd.c | 4 --- sys/wince/winhack.c | 2 -- sys/winnt/nttty.c | 2 +- sys/winnt/winnt.c | 2 -- util/makedefs.c | 3 --- util/mdgrep.h | 4 --- util/mdgrep.pl | 2 +- 62 files changed, 42 insertions(+), 493 deletions(-) diff --git a/include/config.h b/include/config.h index abdeb4187..c89f778e3 100644 --- a/include/config.h +++ b/include/config.h @@ -172,16 +172,12 @@ * GDBPATH (the path to the system gdb(1) program) */ -#ifndef WIZARD /* allow for compile-time or Makefile changes */ -# ifndef KR1ED -# define WIZARD "wizard" /* the person allowed to use the -D option */ +#ifndef WIZARD_NAME /* allow for compile-time or Makefile changes */ +# define WIZARD_NAME "wizard" +#endif + /* #define SYSCF */ /* use a global configuration */ /* #define SYSCF_FILE "sysconf" */ /* global configuration is in a file */ -# else -# define WIZARD -# define WIZARD_NAME "wizard" -# endif -#endif #ifndef GDBPATH # define GDBPATH "/usr/bin/gdb" diff --git a/include/decl.h b/include/decl.h index 8276c6022..ddc814f4d 100644 --- a/include/decl.h +++ b/include/decl.h @@ -151,9 +151,7 @@ E NEARDATA struct sinfo { #ifdef PANICLOG int in_paniclog; #endif -#ifdef WIZARD int wizkit_wishing; -#endif } program_state; E boolean restoring; diff --git a/include/extern.h b/include/extern.h index 186d5c9ff..fd4bc6520 100644 --- a/include/extern.h +++ b/include/extern.h @@ -172,7 +172,6 @@ E int NDECL(domonability); E int NDECL(doprev_message); E int NDECL(timed_occupation); E int NDECL(doattributes); -# ifdef WIZARD E int NDECL(wiz_detect); E int NDECL(wiz_genesis); E int NDECL(wiz_identify); @@ -180,7 +179,6 @@ E int NDECL(wiz_level_tele); E int NDECL(wiz_map); E int NDECL(wiz_where); E int NDECL(wiz_wish); -# endif /* WIZARD */ #endif /* USE_TRAMPOLI */ E void NDECL(reset_occupations); E void FDECL(set_occupation, (int (*)(void),const char *,int)); @@ -189,9 +187,7 @@ E char NDECL(pgetchar); E void FDECL(pushch, (CHAR_P)); E void FDECL(savech, (CHAR_P)); #endif -#ifdef WIZARD E void NDECL(add_debug_extended_commands); -#endif /* WIZARD */ E void FDECL(reset_commands, (BOOLEAN_P)); E void FDECL(rhack, (char *)); E int NDECL(doextlist); @@ -215,9 +211,7 @@ E void FDECL(hangup, (int)); E void NDECL(end_of_input); #endif E char NDECL(readchar); -#ifdef WIZARD E void NDECL(sanity_check); -#endif E char FDECL(yn_function, (const char *, const char *, CHAR_P)); E boolean FDECL(paranoid_query, (BOOLEAN_P,const char *)); @@ -578,9 +572,7 @@ E int FDECL(induced_align, (int)); E boolean FDECL(Invocation_lev, (d_level *)); E xchar NDECL(level_difficulty); E schar FDECL(lev_by_name, (const char *)); -#ifdef WIZARD E schar FDECL(print_dungeon, (BOOLEAN_P,schar *,xchar *)); -#endif E int NDECL(donamelevel); E int NDECL(dooverview); E void FDECL(show_overview, (int,int)); @@ -726,7 +718,7 @@ E void FDECL(set_savefile_name, (BOOLEAN_P)); #ifdef INSURANCE E void FDECL(save_savefile_name, (int)); #endif -#if defined(WIZARD) && !defined(MICRO) +#ifndef MICRO E void NDECL(set_error_savefile); #endif E int NDECL(create_savefile); @@ -742,9 +734,7 @@ E boolean FDECL(can_read_file, (const char *)); #endif E boolean FDECL(read_config_file, (const char *, int)); E void FDECL(check_recordfile, (const char *)); -#if defined(WIZARD) E void NDECL(read_wizkit); -#endif #ifdef LOADSYMSETS E int FDECL(read_sym_file, (int)); E int FDECL(parse_sym_line, (char *,int)); @@ -987,9 +977,7 @@ E void FDECL(obj_adjust_light_radius, (struct obj *,int)); E int FDECL(candle_light_range, (struct obj *)); E int FDECL(arti_light_radius, (struct obj *)); E const char *FDECL(arti_light_description, (struct obj *)); -#ifdef WIZARD E int NDECL(wiz_light_sources); -#endif /* ### lock.c ### */ @@ -1260,9 +1248,7 @@ E void FDECL(dealloc_obj, (struct obj *)); E void FDECL(obj_ice_effects, (int, int, BOOLEAN_P)); E long FDECL(peek_at_iced_corpse_age, (struct obj *)); E int FDECL(hornoplenty, (struct obj *,BOOLEAN_P)); -#ifdef WIZARD E void NDECL(obj_sanity_check); -#endif /* ### mkroom.c ### */ @@ -1896,9 +1882,7 @@ E void FDECL(do_genocide, (int)); E void FDECL(punish, (struct obj *)); E void NDECL(unpunish); E boolean FDECL(cant_revive, (int *,BOOLEAN_P,struct obj *)); -#ifdef WIZARD E boolean NDECL(create_particular); -#endif /* ### rect.c ### */ @@ -2000,9 +1984,7 @@ E void FDECL(outoracle, (BOOLEAN_P, BOOLEAN_P)); E void FDECL(save_oracles, (int,int)); E void FDECL(restore_oracles, (int)); E int FDECL(doconsult, (struct monst *)); -#ifdef WIZARD E void NDECL(rumor_check); -#endif /* ### save.c ### */ @@ -2263,10 +2245,8 @@ E boolean FDECL(obj_is_local, (struct obj *)); E void FDECL(save_timers, (int,int,int)); E void FDECL(restore_timers, (int,int,BOOLEAN_P,long)); E void FDECL(relink_timers, (BOOLEAN_P)); -#ifdef WIZARD E int NDECL(wiz_timeout_queue); E void NDECL(timer_sanity_check); -#endif /* ### topten.c ### */ diff --git a/include/flag.h b/include/flag.h index f6cc67aa2..1f53bdec6 100644 --- a/include/flag.h +++ b/include/flag.h @@ -174,10 +174,8 @@ struct instance_flags { coord travelcc; /* coordinates for travel_cache */ boolean window_inited; /* true if init_nhwindows() completed */ boolean vision_inited; /* true if vision is ready */ -#ifdef WIZARD boolean sanity_check; /* run sanity checks */ boolean mon_polycontrol; /* debug: control monster polymorphs */ -#endif /* stuff that is related to options and/or user or platform preferences */ unsigned msg_history; /* hint: # of top lines to save */ int menu_headings; /* ATR for menu headings */ diff --git a/include/trampoli.h b/include/trampoli.h index fa040a330..076b16d2f 100644 --- a/include/trampoli.h +++ b/include/trampoli.h @@ -28,7 +28,6 @@ #define doprev_message() doprev_message_() #define timed_occupation() timed_occupation_() #define wiz_attributes() wiz_attributes_() -#ifdef WIZARD #define wiz_detect() wiz_detect_() #define wiz_genesis() wiz_genesis_() #define wiz_identify() wiz_identify_() @@ -36,7 +35,6 @@ #define wiz_map() wiz_map_() #define wiz_where() wiz_where_() #define wiz_wish() wiz_wish_() -#endif /* ### display.c ### */ #define doredraw() doredraw_() diff --git a/include/vmsconf.h b/include/vmsconf.h index 5aaf9e1fc..d675588e2 100644 --- a/include/vmsconf.h +++ b/include/vmsconf.h @@ -30,20 +30,11 @@ #ifdef HACKDIR # undef HACKDIR #endif -#ifdef WIZARD -# undef WIZARD -#endif #ifdef WIZARD_NAME # undef WIZARD_NAME #endif #define HACKDIR Local_HACKDIR -#ifndef KR1ED -# define WIZARD Local_WIZARD -# define WIZARD_NAME WIZARD -#else -# define WIZARD 1 -# define WIZARD_NAME Local_WIZARD -#endif +#define WIZARD_NAME Local_WIZARD #ifndef SYSCF # define SYSCF #endif diff --git a/src/allmain.c b/src/allmain.c index 447aff1d8..d56f11bda 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -35,9 +35,7 @@ boolean resuming; monstr_init(); /* monster strengths */ objects_init(); -#ifdef WIZARD if (wizard) add_debug_extended_commands(); -#endif /* if a save file created in normal mode is now being restored in explore mode, treat it as normal restore followed by 'X' command @@ -384,10 +382,8 @@ boolean resuming; continue; } -#ifdef WIZARD if (iflags.sanity_check) sanity_check(); -#endif #ifdef CLIPPING /* just before rhack */ @@ -525,9 +521,7 @@ newgame() mklev(); u_on_upstairs(); -#ifdef WIZARD if (wizard) obj_delivery(FALSE); /* finish wizkit */ -#endif vision_reset(); /* set up internals for level (after mklev) */ check_special_room(FALSE); diff --git a/src/attrib.c b/src/attrib.c index fbac9949a..b2d5738b8 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -698,7 +698,6 @@ int propidx; /* special cases can have negative values */ /* * Restrict the source of the attributes just to debug mode for now */ -#ifdef WIZARD if (wizard) { static NEARDATA const char because_of[] = " because of %s"; @@ -745,7 +744,6 @@ int propidx; /* special cases can have negative values */ } } /*wizard*/ -#endif return buf; } diff --git a/src/bones.c b/src/bones.c index 8a36ea11d..5607355ee 100644 --- a/src/bones.c +++ b/src/bones.c @@ -312,10 +312,7 @@ can_make_bones() if(depth(&u.uz) <= 0 || /* bulletproofing for endgame */ (!rn2(1 + (depth(&u.uz)>>2)) /* fewer ghosts on low levels */ -#ifdef WIZARD - && !wizard -#endif - )) return FALSE; + && !wizard)) return FALSE; /* don't let multiple restarts generate multiple copies of objects * in bones files */ if (discover) return FALSE; @@ -344,23 +341,19 @@ struct obj *corpse; fd = open_bonesfile(&u.uz, &bonesid); if (fd >= 0) { (void) close(fd); -#ifdef WIZARD if (wizard) { if (yn("Bones file already exists. Replace it?") == 'y') { if (delete_bonesfile(&u.uz)) goto make_bones; else pline("Cannot unlink old bones."); } } -#endif /* compression can change the file's name, so must wait until after any attempt to delete this file */ compress_bonesfile(); return; } -#ifdef WIZARD make_bones: -#endif unleash_all(); /* in case these characters are not in their home bases */ for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { @@ -488,10 +481,8 @@ struct obj *corpse; fd = create_bonesfile(&u.uz, &bonesid, whynot); if(fd < 0) { -#ifdef WIZARD if(wizard) pline1(whynot); -#endif /* bones file creation problems are silent to the player. * Keep it that way, but place a clue into the paniclog. */ @@ -520,10 +511,8 @@ struct obj *corpse; savefruitchn(fd, COUNT_SAVE); bflush(fd); if (bytes_counted > freediskspace(bones)) { /* not enough room */ -# ifdef WIZARD if (wizard) pline("Insufficient space to create bones file."); -# endif (void) close(fd); cancel_bonesfile(); return; @@ -556,23 +545,18 @@ getbones() /* wizard check added by GAN 02/05/87 */ if(rn2(3) /* only once in three times do we find bones */ -#ifdef WIZARD && !wizard -#endif ) return(0); if(no_bones_level(&u.uz)) return(0); fd = open_bonesfile(&u.uz, &bonesid); if (fd < 0) return(0); if (validate(fd, bones) != 0) { -#ifdef WIZARD if (!wizard) -#endif pline("Discarding unuseable bones; no need to panic..."); ok = FALSE; } else { ok = TRUE; -#ifdef WIZARD if(wizard) { if(yn("Get bones?") == 'n') { (void) close(fd); @@ -580,7 +564,6 @@ getbones() return(0); } } -#endif mread(fd, (genericptr_t) &c, sizeof c); /* length incl. '\0' */ mread(fd, (genericptr_t) oldbonesid, (unsigned) c); /* DD.nnn */ if (strcmp(bonesid, oldbonesid) != 0) { @@ -588,12 +571,10 @@ getbones() Sprintf(errbuf, "This is bones level '%s', not '%s'!", oldbonesid, bonesid); -#ifdef WIZARD if (wizard) { pline1(errbuf); ok = FALSE; /* won't die of trickery */ } -#endif trickery(errbuf); } else { register struct monst *mtmp; @@ -610,7 +591,7 @@ getbones() for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (has_mname(mtmp)) sanitize_name(MNAME(mtmp)); if (mtmp->mhpmax == DEFUNCT_MONSTER) { -#if defined(DEBUG) && defined(WIZARD) +#if defined(DEBUG) if (wizard) pline("Removing defunct monster %s from bones.", mtmp->data->mname); @@ -627,14 +608,12 @@ getbones() (void) close(fd); sanitize_engravings(); -#ifdef WIZARD if(wizard) { if(yn("Unlink bones?") == 'n') { compress_bonesfile(); return(ok); } } -#endif if (!delete_bonesfile(&u.uz)) { /* When N games try to simultaneously restore the same * bones file, N-1 of them will fail to delete it diff --git a/src/cmd.c b/src/cmd.c index 00e139001..f07abb78c 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -126,7 +126,6 @@ STATIC_PTR int NDECL(domonability); STATIC_PTR int NDECL(dooverview_or_wiz_where); STATIC_PTR int NDECL(dotravel); STATIC_PTR int NDECL(doterrain); -# ifdef WIZARD STATIC_PTR int NDECL(wiz_wish); STATIC_PTR int NDECL(wiz_identify); STATIC_PTR int NDECL(wiz_map); @@ -164,7 +163,6 @@ STATIC_DCL int NDECL(wiz_port_debug); # endif STATIC_PTR int NDECL(wiz_rumor_check); STATIC_DCL char FDECL(cmd_from_func, (int NDECL((*)))); -# endif /* WIZARD */ STATIC_PTR int NDECL(doattributes); STATIC_PTR int NDECL(doconduct); /**/ @@ -514,9 +512,7 @@ int enter_explore_mode(VOID_ARGS) { if (wizard) { -#ifdef WIZARD You("are in debug mode."); -#endif } else if (discover) { You("are already in explore mode."); } else { @@ -538,16 +534,11 @@ enter_explore_mode(VOID_ARGS) STATIC_PTR int dooverview_or_wiz_where(VOID_ARGS) { -#ifdef WIZARD if (wizard) return wiz_where(); - else -#endif - dooverview(); + else dooverview(); return 0; } -#ifdef WIZARD - /* ^W command - wish for something */ STATIC_PTR int wiz_wish(VOID_ARGS) /* Unlimited wishes for debug mode by Paul Polderman */ @@ -1063,7 +1054,6 @@ wiz_rumor_check(VOID_ARGS) rumor_check(); return 0; } -#endif /* WIZARD */ /* #terrain command */ STATIC_PTR int @@ -1091,7 +1081,6 @@ doterrain(VOID_ARGS) add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE, "full map without monsters, objects, and traps", MENU_UNSELECTED); -#ifdef WIZARD if (wizard) { any.a_int = 3; add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE, @@ -1102,7 +1091,6 @@ doterrain(VOID_ARGS) "legend of base-36 levl[][].typ codes", MENU_UNSELECTED); } -#endif end_menu(men, "View which?"); n = select_menu(men, PICK_ONE, &sel); @@ -1121,10 +1109,8 @@ doterrain(VOID_ARGS) switch (which) { case 1: reveal_terrain(FALSE); break; /* known map */ case 2: reveal_terrain(TRUE); break; /* full map */ -#ifdef WIZARD case 3: wiz_map_levltyp(); break; /* map internals */ case 4: wiz_levltyp_legend(); break; /* internal details */ -#endif default: break; } return 0; /* no time elapses */ @@ -1584,9 +1570,7 @@ int final; you_are("buried", ""); } else { Strcpy(buf, "being strangled"); -#ifdef WIZARD if (wizard) Sprintf(eos(buf), " (%ld)", (Strangled & TIMEOUT)); -#endif you_are(buf, from_what(STRANGLED)); } } @@ -1639,9 +1623,7 @@ int final; } /* (u.utrap) */ if (u.uswallow) { Sprintf(buf, "swallowed by %s", a_monnam(u.ustuck)); -#ifdef WIZARD if (wizard) Sprintf(eos(buf), " (%u)", u.uswldtim); -#endif you_are(buf, ""); } else if (u.ustuck) { Sprintf(buf, "%s %s", @@ -1662,13 +1644,11 @@ int final; /* when mounted, Wounded_legs applies to steed rather than to hero; we only report steed's wounded legs in wizard mode */ if (u.usteed) { /* not `Riding' here */ -# ifdef WIZARD if (wizard) { Strcpy(buf, steedname); *buf = highc(*buf); enl_msg(buf, " has", " had", " wounded legs", ""); } -# endif } else { Sprintf(buf, "wounded %s", makeplural(body_part(LEG))); you_have(buf, ""); @@ -1685,9 +1665,7 @@ int final; if (Sleepy) { if (magic || cause_known(SLEEPY)) { Strcpy(buf, from_what(SLEEPY)); -#ifdef WIZARD if (wizard) Sprintf(eos(buf), " (%ld)", (HSleepy & TIMEOUT)); -#endif enl_msg("You ", "fall", "fell", " asleep uncontrollably", buf); } } @@ -1788,12 +1766,10 @@ int final; else if (u.ualign.record >= -3) you_have("strayed",""); else if (u.ualign.record >= -8) you_have("sinned",""); else you_have("transgressed",""); -#ifdef WIZARD if (wizard) { Sprintf(buf, " %d", u.ualign.record); enl_msg("Your alignment ", "is", "was", buf, ""); } -#endif /*** Resistances to troubles ***/ if (Invulnerable) you_are("invulnerable",from_what(INVULNERABLE)); @@ -1977,9 +1953,7 @@ int final; if (Upolyd) { if (u.umonnum == u.ulycn) Strcpy(buf, "in beast form"); else Sprintf(buf, "polymorphed into %s", an(youmonst.data->mname)); -#ifdef WIZARD if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone); -#endif you_are(buf,""); if (lays_eggs(youmonst.data) && flags.female) you_can("lay eggs", ""); @@ -2000,14 +1974,9 @@ int final; Sprintf(buf, "%s%slucky", ltmp >= 10 ? "extremely " : ltmp >= 5 ? "very " : "", Luck < 0 ? "un" : ""); -#ifdef WIZARD if (wizard) Sprintf(eos(buf), " (%d)", Luck); -#endif you_are(buf,""); - } -#ifdef WIZARD - else if (wizard) enl_msg("Your luck ", "is", "was", " zero",""); -#endif + } else if (wizard) enl_msg("Your luck ", "is", "was", " zero",""); if (u.moreluck > 0) you_have("extra luck",""); else if (u.moreluck < 0) you_have("reduced luck",""); if (carrying(LUCKSTONE) || stone_luck(TRUE)) { @@ -2021,9 +1990,7 @@ int final; if (u.ugangr) { Sprintf(buf, " %sangry with you", u.ugangr > 6 ? "extremely " : u.ugangr > 3 ? "very " : ""); -#ifdef WIZARD if (wizard) Sprintf(eos(buf), " (%d)", u.ugangr); -#endif enl_msg(u_gname(), " is", " was", buf,""); } else /* @@ -2039,9 +2006,7 @@ int final; #else Sprintf(buf, "%ssafely pray", can_pray(FALSE) ? "" : "not "); #endif -#ifdef WIZARD if (wizard) Sprintf(eos(buf), " (%d)", u.ublesscnt); -#endif you_can(buf,""); } if (wizard) { @@ -2301,25 +2266,21 @@ int final; if (!u.uconduct.weaphit) you_have_never("hit with a wielded weapon"); -#ifdef WIZARD else if (wizard) { Sprintf(buf, "used a wielded weapon %ld time%s", u.uconduct.weaphit, plur(u.uconduct.weaphit)); you_have_X(buf); } -#endif if (!u.uconduct.killer) you_have_been("a pacifist"); if (!u.uconduct.literate) you_have_been("illiterate"); -#ifdef WIZARD else if (wizard) { Sprintf(buf, "read items or engraved %ld time%s", u.uconduct.literate, plur(u.uconduct.literate)); you_have_X(buf); } -#endif ngenocided = num_genocides(); if (ngenocided == 0) { @@ -2332,23 +2293,19 @@ int final; if (!u.uconduct.polypiles) you_have_never("polymorphed an object"); -#ifdef WIZARD else if (wizard) { Sprintf(buf, "polymorphed %ld item%s", u.uconduct.polypiles, plur(u.uconduct.polypiles)); you_have_X(buf); } -#endif if (!u.uconduct.polyselfs) you_have_never("changed form"); -#ifdef WIZARD else if (wizard) { Sprintf(buf, "changed form %ld time%s", u.uconduct.polyselfs, plur(u.uconduct.polyselfs)); you_have_X(buf); } -#endif if (!u.uconduct.wishes) you_have_X("used no wishes"); @@ -2381,22 +2338,18 @@ int final; static const struct func_tab cmdlist[] = { {C('d'), FALSE, dokick}, /* "D" is for door!...? Msg is in dokick.c */ -#ifdef WIZARD {C('e'), TRUE, wiz_detect}, {C('f'), TRUE, wiz_map}, {C('g'), TRUE, wiz_genesis}, {C('i'), TRUE, wiz_identify}, -#endif {C('l'), TRUE, doredraw}, /* if number_pad is set */ {C('n'), TRUE, donamelevel}, /* if number_pad is set */ {C('o'), TRUE, dooverview_or_wiz_where}, /* depending on wizard status */ {C('p'), TRUE, doprev_message}, {C('r'), TRUE, doredraw}, {C('t'), TRUE, dotele}, -#ifdef WIZARD {C('v'), TRUE, wiz_level_tele}, {C('w'), TRUE, wiz_wish}, -#endif {C('x'), TRUE, doattributes}, {C('z'), TRUE, dosuspend_core}, {'a', FALSE, doapply}, @@ -2532,7 +2485,6 @@ struct ext_func_tab extcmdlist[] = { doextversion, TRUE}, {"wipe", "wipe off your face", dowipe, FALSE}, {"?", "get this list of extended commands", doextlist, TRUE}, -#if defined(WIZARD) /* * There must be a blank entry here for every entry in the table * below. @@ -2559,11 +2511,9 @@ struct ext_func_tab extcmdlist[] = { #endif {(char *)0, (char *)0, donull, TRUE}, /* wizrumorcheck */ {(char *)0, (char *)0, donull, TRUE}, /* wmode */ -#endif {(char *)0, (char *)0, donull, TRUE} /* sentinel */ }; -#ifdef WIZARD /* there must be a placeholder in the table above for every entry here */ static const struct ext_func_tab debug_extcmdlist[] = { {"levelchange", "change experience level", wiz_level_change, TRUE}, @@ -2882,8 +2832,6 @@ wiz_migrate_mons() } #endif -#endif /* WIZARD */ - #define unctrl(c) ((c) <= C('z') ? (0x60 | (c)) : (c)) #define unmeta(c) (0x7f & (c)) @@ -3371,11 +3319,7 @@ const char *msg; sym = highc(sym); ctrl = (sym - 'A') + 1; if ((explain = dowhatdoes_core(ctrl, buf2)) - && (!index(wiz_only_list, sym) -#ifdef WIZARD - || wizard -#endif - )) { + && (!index(wiz_only_list, sym) || wizard)) { Sprintf(buf, "Are you trying to use ^%c%s?", sym, index(wiz_only_list, sym) ? "" : " as specified in the Guidebook"); diff --git a/src/do.c b/src/do.c index 4e5876e6b..c225000ef 100644 --- a/src/do.c +++ b/src/do.c @@ -1029,9 +1029,7 @@ boolean at_stairs, falling, portal; newlevel->dlevel = dunlevs_in_dungeon(newlevel); if (newdungeon && In_endgame(newlevel)) { /* 1st Endgame Level !!! */ if (!u.uhave.amulet) return; /* must have the Amulet */ -#ifdef WIZARD if (!wizard) /* wizard ^V can bypass Earth level */ -#endif assign_level(newlevel, &earth_level); /* (redundant) */ } new_ledger = ledger_no(newlevel); @@ -1297,12 +1295,10 @@ boolean at_stairs, falling, portal; mnexto(mtmp); if ((mtmp = m_at(u.ux, u.uy)) != 0) { -#ifdef WIZARD /* there was an unconditional impossible("mnearto failed") here, but it's not impossible and we're prepared to cope with the situation, so only say something when debugging */ if (wizard) pline("(monster in hero's way)"); -#endif if (!rloc(mtmp, TRUE)) /* no room to move it; send it away, to return later */ migrate_to_level(mtmp, ledger_no(&u.uz), diff --git a/src/dungeon.c b/src/dungeon.c index ed186796b..ed6b726de 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -50,14 +50,12 @@ STATIC_DCL void FDECL(init_level, (int,int,struct proto_dungeon *)); STATIC_DCL int FDECL(possible_places, (int, boolean *, struct proto_dungeon *)); STATIC_DCL xchar FDECL(pick_level, (boolean *, int)); STATIC_DCL boolean FDECL(place_level, (int, struct proto_dungeon *)); -#ifdef WIZARD STATIC_DCL boolean FDECL(unplaced_floater, (struct dungeon *)); STATIC_DCL boolean FDECL(unreachable_level, (d_level *,BOOLEAN_P)); STATIC_DCL void FDECL(tport_menu, (winid,char *,struct lchoice *, d_level *,BOOLEAN_P)); STATIC_DCL const char *FDECL(br_string, (int)); STATIC_DCL void FDECL(print_branch, (winid, int, int, int, BOOLEAN_P, struct lchoice *)); -#endif mapseen *mapseenchn = (struct mapseen *)0; STATIC_DCL mapseen *FDECL(load_mapseen, (int)); @@ -521,10 +519,7 @@ init_level(dgn, proto_index, pd) struct tmplevel *tlevel = &pd->tmplevel[proto_index]; pd->final_lev[proto_index] = (s_level *) 0; /* no "real" level */ -#ifdef WIZARD - if (!wizard) -#endif - if (tlevel->chance <= rn2(100)) return; + if (!wizard && tlevel->chance <= rn2(100)) return; pd->final_lev[proto_index] = new_level = (s_level *) alloc(sizeof(s_level)); @@ -742,10 +737,8 @@ init_dungeons() /* initialize the "dungeon" structs */ for (i = 0; i < n_dgns; i++) { Fread((genericptr_t)&pd.tmpdungeon[i], sizeof(struct tmpdungeon), 1, dgn_file); -#ifdef WIZARD - if(!wizard) -#endif - if(pd.tmpdungeon[i].chance && (pd.tmpdungeon[i].chance <= rn2(100))) { + if(!wizard && pd.tmpdungeon[i].chance + && (pd.tmpdungeon[i].chance <= rn2(100))) { int j; /* skip over any levels or branches */ @@ -1542,9 +1535,7 @@ const char *nam; (u.uz.dnum == medusa_level.dnum && dlev.dnum == valley_level.dnum)) && ( /* either wizard mode or else seen and not forgotten */ -#ifdef WIZARD wizard || -#endif (level_info[idx].flags & (FORGOTTEN|VISITED)) == VISITED)) { lev = depth(&slev->dlevel); } @@ -1558,9 +1549,7 @@ const char *nam; idxtoo = (idx >> 8) & 0x00FF; idx &= 0x00FF; if ( /* either wizard mode, or else _both_ sides of branch seen */ -#ifdef WIZARD wizard || -#endif ((level_info[idx].flags & (FORGOTTEN|VISITED)) == VISITED && (level_info[idxtoo].flags & (FORGOTTEN|VISITED)) == VISITED)) { if (ledger_to_dnum(idxtoo) == u.uz.dnum) idx = idxtoo; @@ -1573,8 +1562,6 @@ const char *nam; return lev; } -#ifdef WIZARD - STATIC_OVL boolean unplaced_floater(dptr) struct dungeon *dptr; @@ -1821,7 +1808,6 @@ xchar *rdgn; destroy_nhwindow(win); return 0; } -#endif /* WIZARD */ /* Record that the player knows about a branch from a level. This function * will determine whether or not it was a "real" branch that was taken. @@ -2560,7 +2546,6 @@ boolean printdun; */ Sprintf(buf, "%sLevel %d:", TAB, i); -#ifdef WIZARD /* wizmode prints out proto dungeon names for clarity */ if (wizard) { s_level *slev; @@ -2568,7 +2553,6 @@ boolean printdun; if ((slev = Is_special(&mptr->lev)) != 0) Sprintf(eos(buf), " [%s]", slev->proto); } -#endif /* [perhaps print custom annotation on its own line when it's long] */ if (mptr->custom) Sprintf(eos(buf), " (%s)", mptr->custom); diff --git a/src/eat.c b/src/eat.c index 37561967b..196fb9e49 100644 --- a/src/eat.c +++ b/src/eat.c @@ -8,11 +8,7 @@ /* #define DEBUG */ /* uncomment to enable new eat code debugging */ #ifdef DEBUG -# ifdef WIZARD #define debugpline if (wizard) pline -# else -#define debugpline pline -# endif #endif STATIC_PTR int NDECL(eatmdone); diff --git a/src/end.c b/src/end.c index 66d164143..c9fe47cb2 100644 --- a/src/end.c +++ b/src/end.c @@ -323,7 +323,7 @@ done2() } return 0; } -#if defined(WIZARD) && (defined(UNIX) || defined(VMS) || defined(LATTICE)) +#if (defined(UNIX) || defined(VMS) || defined(LATTICE)) if(wizard) { int c; # ifdef VMS @@ -510,7 +510,7 @@ panic VA_DECL(const char *, str) !program_state.something_worth_saving ? "Program initialization has failed." : "Suddenly, the dungeon collapses."); -#if defined(WIZARD) && !defined(MICRO) +#ifndef MICRO # if defined(NOTIFY_NETHACK_BUGS) if (!wizard) raw_printf("Report the following error to \"%s\" or at \"%s\".", @@ -531,11 +531,7 @@ panic VA_DECL(const char *, str) free(tmp); } else raw_printf("Report error to \"%s\"%s.", -# ifdef WIZARD_NAME /*(KR1ED)*/ WIZARD_NAME, -# else - WIZARD, -# endif !program_state.something_worth_saving ? "" : " and it may be possible to rebuild."); } @@ -560,7 +556,7 @@ panic VA_DECL(const char *, str) #ifdef WIN32 interject(INTERJECT_PANIC); #endif -#if defined(WIZARD) && (defined(UNIX) || defined(VMS) || defined(LATTICE) || defined(WIN32)) +#if defined(UNIX) || defined(VMS) || defined(LATTICE) || defined(WIN32) if (wizard) NH_abort(); /* generate core dump */ #endif @@ -846,12 +842,10 @@ int how; paniclog("trickery", killer.name); killer.name[0] = 0; } -#ifdef WIZARD if (wizard) { You("are a very tricky wizard, it seems."); return; } -#endif } /* pbuf: holds Sprintf'd output for raw_print and putstr @@ -885,11 +879,7 @@ int how; return; } } - if (( -#ifdef WIZARD - wizard || -#endif - discover) && (how <= GENOCIDED)) { + if ((wizard || discover) && (how <= GENOCIDED)) { if (paranoid_query(ParanoidDie, "Die?")) goto die; pline("OK, so you don't %s.", (how == CHOKING) ? "choke" : "die"); @@ -1047,9 +1037,7 @@ die: } if (bones_ok) { -#ifdef WIZARD if (!wizard || paranoid_query(ParanoidBones, "Save bones?")) -#endif savebones(how, endtime, corpse); /* corpse may be invalid pointer now so ensure that it isn't used again */ diff --git a/src/engrave.c b/src/engrave.c index 8ba7217ba..ebfcd0829 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -836,12 +836,10 @@ doengrave() break; case VENOM_CLASS: -#ifdef WIZARD if (wizard) { pline("Writing a poison pen letter??"); break; } -#endif case ILLOBJ_CLASS: impossible("You're engraving with an illegal object!"); break; diff --git a/src/exper.c b/src/exper.c index 568b19e88..5b1d73927 100644 --- a/src/exper.c +++ b/src/exper.c @@ -171,13 +171,11 @@ const char *drainer; /* cause of death, if drain should be fatal */ { register int num; -#ifdef WIZARD /* override life-drain resistance when handling an explicit wizard mode request to reduce level; never fatal though */ if (drainer && !strcmp(drainer, "#levelchange")) drainer = 0; else -#endif if (resists_drli(&youmonst)) return; if (u.ulevel > 1) { diff --git a/src/files.c b/src/files.c index f667b8093..03b4d5ea3 100644 --- a/src/files.c +++ b/src/files.c @@ -124,12 +124,10 @@ boolean nethack_thinks_it_is_open; /* Does NetHack think it's open? */ # endif #endif /*HOLD_LOCKFILE_OPEN*/ -#ifdef WIZARD #define WIZKIT_MAX 128 static char wizkit[WIZKIT_MAX]; STATIC_DCL FILE *NDECL(fopen_wizkit_file); STATIC_DCL void FDECL(wizkit_addinv, (struct obj *)); -#endif #ifdef AMIGA extern char PATH[]; /* see sys/amiga/amidos.c */ @@ -790,10 +788,8 @@ d_level *lev; #else ret = rename(tempname, fq_bones); #endif -#ifdef WIZARD if (wizard && ret != 0) pline("couldn't rename %s to %s.", tempname, fq_bones); -#endif } @@ -899,7 +895,7 @@ int fd; #endif -#if defined(WIZARD) && !defined(MICRO) +#ifndef MICRO /* change pre-existing savefile name to indicate an error savefile */ void set_error_savefile() @@ -1298,9 +1294,7 @@ boolean uncomp; (void) signal(SIGQUIT, SIG_IGN); (void) wait((int *)&i); (void) signal(SIGINT, (SIG_RET_TYPE) done1); -# ifdef WIZARD if (wizard) (void) signal(SIGQUIT, SIG_DFL); -# endif #else /* I don't think we can really cope with external compression * without signals, so we'll declare that compress failed and @@ -2246,10 +2240,8 @@ int src; #ifdef LOADSYMSETS switch_symbols(TRUE); #endif -#ifdef WIZARD } else if (match_varname(buf, "WIZKIT", 6)) { (void) strncpy(wizkit, bufp, WIZKIT_MAX-1); -#endif #ifdef AMIGA } else if (match_varname(buf, "FONT", 4)) { char *t; @@ -2435,7 +2427,6 @@ OR: Forbid multiline stuff for alternate config sources. return rv; } -#ifdef WIZARD STATIC_OVL FILE * fopen_wizkit_file() { @@ -2569,8 +2560,6 @@ read_wizkit() return; } -#endif /*WIZARD*/ - #ifdef LOADSYMSETS extern struct symsetentry *symset_list; /* options.c */ extern struct symparse loadsyms[]; /* drawing.c */ diff --git a/src/fountain.c b/src/fountain.c index c49efac69..764ffb5a3 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -182,12 +182,10 @@ boolean isyou; if(!mtmp) pline_The("flow reduces to a trickle."); return; } -#ifdef WIZARD if (isyou && wizard) { if (yn("Dry up fountain?") == 'n') return; } -#endif /* replace the fountain with ordinary floor */ levl[x][y].typ = ROOM; levl[x][y].looted = 0; diff --git a/src/invent.c b/src/invent.c index 189b63ea9..5778135d9 100644 --- a/src/invent.c +++ b/src/invent.c @@ -33,7 +33,6 @@ STATIC_DCL char FDECL(obj_to_let,(struct obj *)); static int lastinvnr = 51; /* 0 ... 51 (never saved&restored) */ -#ifdef WIZARD /* wizards can wish for venom, which will become an invisible inventory * item without this. putting it in inv_order would mean venom would * suddenly become a choice for all the inventory-class commands, which @@ -42,7 +41,6 @@ static int lastinvnr = 51; /* 0 ... 51 (never saved&restored) */ * around on a bones level for normal players to find. */ static char venom_inv[] = { VENOM_CLASS, 0 }; /* (constant) */ -#endif void assigninvlet(otmp) @@ -1916,7 +1914,6 @@ long* out_cnt; } start_menu(win); -#ifdef WIZARD if (wizard && iflags.override_ID) { char prompt[BUFSZ]; any.a_char = -1; @@ -1927,7 +1924,6 @@ long* out_cnt; add_menu(win, NO_GLYPH, &any,' ', iflags.override_ID, ATR_NONE, prompt, MENU_UNSELECTED); } -#endif nextclass: classcount = 0; any = zeroany; /* set all bits to zero */ @@ -1950,12 +1946,10 @@ nextclass: } if (flags.sortpack) { if (*++invlet) goto nextclass; -#ifdef WIZARD if (--invlet != venom_inv) { invlet = venom_inv; goto nextclass; } -#endif } end_menu(win, (char *) 0); diff --git a/src/light.c b/src/light.c index 8d2b38ad4..244126021 100644 --- a/src/light.c +++ b/src/light.c @@ -633,8 +633,6 @@ struct obj *obj; return "strangely"; } -#ifdef WIZARD - int wiz_light_sources() { @@ -674,6 +672,4 @@ wiz_light_sources() return 0; } -#endif /* WIZARD */ - /*light.c*/ diff --git a/src/makemon.c b/src/makemon.c index 44fcb79a0..0f2d0c41c 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -779,7 +779,7 @@ boolean ghostly; mvitals[mndx].born++; if ((int) mvitals[mndx].born >= lim && !(mons[mndx].geno & G_NOGEN) && !(mvitals[mndx].mvflags & G_EXTINCT)) { -#if defined(DEBUG) && defined(WIZARD) +#ifdef DEBUG if (wizard) pline("Automatically extinguished %s.", makeplural(mons[mndx].mname)); #endif @@ -925,7 +925,7 @@ register int mmflags; /* if you are to make a specific monster and it has already been genocided, return */ if (mvitals[mndx].mvflags & G_GENOD) return((struct monst *) 0); -#if defined(WIZARD) && defined(DEBUG) +#ifdef DEBUG if (wizard && (mvitals[mndx].mvflags & G_EXTINCT)) pline("Explicitly creating extinct monster %s.", mons[mndx].mname); @@ -1186,12 +1186,9 @@ boolean neverask; int x, y; struct monst *mon; boolean known = FALSE; -#ifdef WIZARD boolean ask = (wizard && !neverask); -#endif while (cnt--) { -#ifdef WIZARD if (ask) { if (create_particular()) { known = TRUE; @@ -1199,7 +1196,6 @@ boolean neverask; } else ask = FALSE; /* ESC will shut off prompting */ } -#endif x = u.ux, y = u.uy; /* if in water, try to encourage an aquatic monster by finding and then specifying another wet location */ diff --git a/src/mklev.c b/src/mklev.c index acb4daac4..43bccaf40 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -7,11 +7,7 @@ /* #define DEBUG */ /* uncomment to enable code debugging */ #ifdef DEBUG -# ifdef WIZARD #define debugpline if (wizard) pline -# else -#define debugpline pline -# endif #endif /* for UNIX, Rand #def'd to (long)lrand48() or (long)random() */ @@ -720,9 +716,7 @@ makelevel() { register int u_depth = depth(&u.uz); -#ifdef WIZARD if(wizard && nh_getenv("SHOPTYPE")) mkroom(SHOPBASE); else -#endif if (u_depth > 1 && u_depth < depth(&medusa_level) && nroom >= room_threshold && @@ -1561,11 +1555,7 @@ xchar x, y; } /* Already set or 2/3 chance of deferring until a later level. */ - if (source->dnum < n_dgns || (rn2(3) -#ifdef WIZARD - && !wizard -#endif - )) return; + if (source->dnum < n_dgns || (rn2(3) && !wizard)) return; if (! (u.uz.dnum == oracle_level.dnum /* in main dungeon */ && !at_dgn_entrance("The Quest") /* but not Quest's entry */ diff --git a/src/mkmaze.c b/src/mkmaze.c index ccd865db2..7f4536869 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -509,7 +509,6 @@ register const char *s; } else Strcpy(protofile, ""); -#ifdef WIZARD /* SPLEVTYPE format is "level-choice,level-choice"... */ if (wizard && *protofile && sp && sp->rndlevs) { char *ep = getenv("SPLEVTYPE"); /* not nh_getenv */ @@ -531,7 +530,6 @@ register const char *s; } } } -#endif if(*protofile) { Strcat(protofile, LEV_EXT); diff --git a/src/mkobj.c b/src/mkobj.c index 698018e9f..253fd1293 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -10,14 +10,12 @@ STATIC_DCL void FDECL(maybe_adjust_light, (struct obj *,int)); STATIC_DCL void FDECL(obj_timer_checks,(struct obj *, XCHAR_P, XCHAR_P, int)); STATIC_DCL void FDECL(container_weight, (struct obj *)); STATIC_DCL struct obj *FDECL(save_mtraits, (struct obj *, struct monst *)); -#ifdef WIZARD STATIC_DCL void FDECL(objlist_sanity, (struct obj *,int,const char *)); STATIC_DCL void FDECL(mon_obj_sanity, (struct monst *,const char *)); STATIC_DCL const char *FDECL(where_name, (struct obj *)); STATIC_DCL void FDECL(insane_object, (struct obj *,const char *,const char *,struct monst *)); STATIC_DCL void FDECL(check_contained, (struct obj *,const char *)); -#endif /*#define DEBUG_EFFECTS*/ /* show some messages for debugging */ @@ -1950,7 +1948,6 @@ boolean tipping; /* caller emptying entire contents; affects shop handling */ return objcount; } -#ifdef WIZARD /* support for wizard-mode's `sanity_check' option */ static const char NEARDATA /* pline formats for insane_object() */ @@ -2144,6 +2141,5 @@ check_contained(container, mesg) } } } -#endif /* WIZARD */ /*mkobj.c*/ diff --git a/src/mkroom.c b/src/mkroom.c index c8bcb2ed0..7f94076e7 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -67,7 +67,6 @@ mkshop() { register struct mkroom *sroom; int i = -1; -#ifdef WIZARD char *ep = (char *)0; /* (init == lint suppression) */ /* first determine shoptype */ @@ -129,7 +128,6 @@ mkshop() } #ifndef MAC gottype: -#endif #endif for(sroom = &rooms[0]; ; sroom++){ if(sroom->hx < 0) return; @@ -140,11 +138,8 @@ gottype: if(sroom->rtype != OROOM) continue; if(has_dnstairs(sroom) || has_upstairs(sroom)) continue; - if( -#ifdef WIZARD - (wizard && ep && sroom->doorct != 0) || -#endif - sroom->doorct == 1) break; + if( (wizard && ep && sroom->doorct != 0) || sroom->doorct == 1) + break; } if (!sroom->rlit) { int x, y; @@ -200,11 +195,7 @@ register boolean strict; continue; } else if(has_upstairs(sroom) || has_dnstairs(sroom)) continue; - if(sroom->doorct == 1 || !rn2(5) -#ifdef WIZARD - || wizard -#endif - ) + if(sroom->doorct == 1 || !rn2(5) || wizard) return sroom; } return (struct mkroom *)0; diff --git a/src/mon.c b/src/mon.c index 2befc3e5b..d65eb1cf9 100644 --- a/src/mon.c +++ b/src/mon.c @@ -23,9 +23,7 @@ STATIC_DCL void FDECL(dealloc_mextra, (struct mextra *)); STATIC_DCL int FDECL(pickvampshape, (struct monst *)); STATIC_DCL boolean FDECL(isspecmon, (struct monst *)); STATIC_DCL boolean FDECL(validspecmon, (struct monst *,int)); -#ifdef WIZARD STATIC_DCL boolean FDECL(validvamp, (struct monst *,int *,int)); -#endif STATIC_DCL struct permonst *FDECL(accept_newcham_form, (int)); #define LEVEL_SPECIFIC_NOCORPSE(mdat) \ @@ -2599,7 +2597,6 @@ int mndx; return TRUE; /* potential new form is ok */ } -#ifdef WIZARD /* prevent wizard mode user from specifying invalid vampshifter shape */ STATIC_OVL boolean validvamp(mon, mndx_p, monclass) @@ -2638,7 +2635,6 @@ int *mndx_p, monclass; } return (*mndx_p != NON_PM); } -#endif /*WIZARD*/ int select_newcham_form(mon) @@ -2689,7 +2685,6 @@ struct monst *mon; } break; } -#ifdef WIZARD /* for debugging: allow control of polymorphed monster */ if (wizard && iflags.mon_polycontrol) { char pprompt[BUFSZ], buf[BUFSZ]; @@ -2731,7 +2726,6 @@ struct monst *mon; if (is_vampshifter(mon) && !validvamp(mon, &mndx, monclass)) mndx = pickvampshape(mon); /* don't resort to arbitrary */ } -#endif /*WIZARD*/ /* if no form was specified above, pick one at random now */ if (mndx == NON_PM) { diff --git a/src/monmove.c b/src/monmove.c index dd7315346..490f7faa0 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -1462,9 +1462,7 @@ struct monst *mtmp; typ != LUMP_OF_ROYAL_JELLY && obj->oclass != AMULET_CLASS && obj->oclass != RING_CLASS && -#ifdef WIZARD obj->oclass != VENOM_CLASS && -#endif typ != SACK && typ != BAG_OF_HOLDING && typ != BAG_OF_TRICKS && !Is_candle(obj) && typ != OILSKIN_SACK && typ != LEASH && diff --git a/src/objnam.c b/src/objnam.c index 624ed92ff..824398123 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1690,9 +1690,7 @@ static const char *const as_is[] = { "boots", "shoes", "gloves", "lenses", "scales", "gauntlets", -#ifdef WIZARD "iron bars", -#endif /* both singular and plural are spelled the same */ "deer", "fish", "tuna", "yaki", "-hai", "krill", "manes", "ninja", "sheep", "ronin", "roshi", "shito", "tengu", @@ -2188,9 +2186,7 @@ STATIC_OVL NEARDATA const struct o_range o_ranges[] = { { "dragon scale mail", ARMOR_CLASS, GRAY_DRAGON_SCALE_MAIL, YELLOW_DRAGON_SCALE_MAIL }, { "sword", WEAPON_CLASS, SHORT_SWORD, KATANA }, -#ifdef WIZARD { "venom", VENOM_CLASS, BLINDING_VENOM, ACID_VENOM }, -#endif { "gray stone", GEM_CLASS, LUCKSTONE, FLINT }, { "grey stone", GEM_CLASS, LUCKSTONE, FLINT }, }; @@ -2652,7 +2648,6 @@ struct obj *no_wish; } } -#ifdef WIZARD /* Wishing in wizard mode can create traps and furniture. * Part I: distinguish between trap and object for the two * types of traps which have corresponding objects: bear trap @@ -2692,7 +2687,6 @@ struct obj *no_wish; the object name and getting a disarmed trap object] */ } } -#endif retry: /* "grey stone" check must be before general "stone" */ @@ -2862,7 +2856,6 @@ srch: goto typfnd; } } -#ifdef WIZARD /* Let wizards wish for traps and furniture. * Must come after objects check so wizards can still wish for * trap objects like beartraps. @@ -2979,7 +2972,6 @@ wiztrap: return &zeroobj; } } -#endif /* WIZARD */ if(!oclass) return((struct obj *)0); any: @@ -3035,16 +3027,12 @@ typfnd: || typ == ROCK || is_missile(otmp))))) otmp->quan = (long) cnt; -#ifdef WIZARD if (oclass == VENOM_CLASS) otmp->spe = 1; -#endif if (spesgn == 0) { spe = otmp->spe; -#ifdef WIZARD } else if (wizard) { ; /* no alteration to spe */ -#endif } else if (oclass == ARMOR_CLASS || oclass == WEAPON_CLASS || is_weptool(otmp) || (oclass==RING_CLASS && objects[typ].oc_charged)) { diff --git a/src/options.c b/src/options.c index 8504a2c3e..9083ae63e 100644 --- a/src/options.c +++ b/src/options.c @@ -138,12 +138,8 @@ static struct Bool_Opt #else {"mail", (boolean *)0, TRUE, SET_IN_FILE}, #endif -#ifdef WIZARD /* for menu debugging only*/ {"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME}, -#else - {"menu_tab_sep", (boolean *)0, FALSE, SET_IN_FILE}, -#endif {"mouse_support", &iflags.wc_mouse_support, TRUE, DISP_IN_GAME}, /*WC*/ #ifdef NEWS {"news", &iflags.news, TRUE, DISP_IN_GAME}, @@ -177,11 +173,7 @@ static struct Bool_Opt DISP_IN_GAME}, #endif {"safe_pet", &flags.safe_dog, TRUE, SET_IN_GAME}, -#ifdef WIZARD {"sanity_check", &iflags.sanity_check, FALSE, SET_IN_GAME}, -#else - {"sanity_check", (boolean *)0, FALSE, SET_IN_FILE}, -#endif {"selectsaved", &iflags.wc2_selectsaved, TRUE, DISP_IN_GAME}, /*WC*/ #ifdef EXP_ON_BOTL {"showexp", &flags.showexp, FALSE, SET_IN_GAME}, @@ -339,12 +331,7 @@ static struct Comp_Opt MAXOCLASSES, SET_IN_GAME }, { "pile_limit", "threshold for \"there are many objects here\"", 24, SET_IN_GAME }, - { "playmode", -#ifdef WIZARD - "normal play, non-scoring explore mode, or debug mode", -#else - "normal play or non-scoring explore mode", -#endif + { "playmode", "normal play, non-scoring explore mode, or debug mode", 8, DISP_IN_GAME }, { "player_selection", "choose character via dialog or prompts", 12, DISP_IN_GAME }, @@ -1112,17 +1099,9 @@ STATIC_VAR const struct paranoia_opts { { PARANOID_QUIT, "quit", 1, "explore", 1, "yes vs y to quit or to enter explore mode" }, { PARANOID_DIE, "die", 1, "death", 2, -#ifdef WIZARD "yes vs y to die (explore mode or debug mode)" }, -#else - "yes vs y to die (explore mode only)" }, -#endif { PARANOID_BONES, "bones", 1, 0, 0, -#ifdef WIZARD "yes vs y to save bones data when dying in debug mode" }, -#else - "(only applicable for debug mode)" }, -#endif { PARANOID_HIT, "attack", 1, "hit", 1, "yes vs y to attack a peaceful monster" }, { PARANOID_PRAY, "pray", 1, 0, 0, @@ -2045,12 +2024,7 @@ goodfruit: wizard = FALSE, discover = TRUE; } else if (!strncmpi(op, "debug", 5) || !strncmpi(op, "wizard", 6)) { -#ifdef WIZARD wizard = TRUE, discover = FALSE; -#else - raw_printf("\"%s\":%s -- debug mode not available.", - fullname, op); -#endif } else { raw_printf("Invalid value for \"%s\":%s.", fullname, op); } @@ -2868,10 +2842,8 @@ doset() ((boolopt[i].optflags == DISP_IN_GAME && pass == 0) || (boolopt[i].optflags == SET_IN_GAME && pass == 1))) { if (bool_p == &flags.female) continue; /* obsolete */ -#ifdef WIZARD if (bool_p == &iflags.sanity_check && !wizard) continue; if (bool_p == &iflags.menu_tab_sep && !wizard) continue; -#endif if (is_wc_option(boolopt[i].name) && !wc_supported(boolopt[i].name)) continue; if (is_wc2_option(boolopt[i].name) && @@ -4162,10 +4134,8 @@ option_help() /* Boolean options */ for (i = 0; boolopt[i].name; i++) { if (boolopt[i].addr) { -#ifdef WIZARD if (boolopt[i].addr == &iflags.sanity_check && !wizard) continue; if (boolopt[i].addr == &iflags.menu_tab_sep && !wizard) continue; -#endif next_opt(datawin, boolopt[i].name); } } @@ -4756,11 +4726,9 @@ void set_playmode() { if (wizard) { -#ifdef WIZARD if (authorize_wizard_mode()) Strcpy(plname, "wizard"); else -#endif wizard = FALSE; /* not allowed or not available */ /* force explore mode if we didn't make it into wizard mode */ discover = !wizard; diff --git a/src/pager.c b/src/pager.c index 69590754d..4d734e5ef 100644 --- a/src/pager.c +++ b/src/pager.c @@ -936,9 +936,7 @@ static const char *help_menu_items[] = { #else #define WIZHLP_SLOT 11 #endif -#ifdef WIZARD "List of wizard-mode commands.", -#endif "", (char *)0 }; @@ -957,10 +955,8 @@ help_menu(sel) any = zeroany; /* zero all bits */ start_menu(tmpwin); -#ifdef WIZARD if (!wizard) help_menu_items[WIZHLP_SLOT] = "", help_menu_items[WIZHLP_SLOT+1] = (char *)0; -#endif for (i = 0; help_menu_items[i]; i++) #ifdef PORT_HELP /* port-specific line has a %s in it for the PORT_ID */ @@ -1010,10 +1006,8 @@ dohelp() case PORT_HELP_ID: port_help(); break; #endif default: -#ifdef WIZARD /* handle slot 11 or 12 */ display_file(DEBUGHELP, TRUE); -#endif break; } } diff --git a/src/pline.c b/src/pline.c index 96b14d049..bd80a040f 100644 --- a/src/pline.c +++ b/src/pline.c @@ -50,9 +50,7 @@ pline VA_DECL(const char *, line) #ifdef HANGUPHANDLING if (program_state.done_hup) return; #endif -#ifdef WIZARD if (program_state.wizkit_wishing) return; -#endif if (index(line, '%')) { Vsprintf(pbuf,line,VA_ARGS); @@ -341,7 +339,6 @@ register struct monst *mtmp; info[0] = 0; if (mtmp->mtame) { Strcat(info, ", tame"); -#ifdef WIZARD if (wizard) { Sprintf(eos(info), " (%d", mtmp->mtame); if (!mtmp->isminion) @@ -349,7 +346,6 @@ register struct monst *mtmp; EDOG(mtmp)->hungrytime, EDOG(mtmp)->apport); Strcat(info, ")"); } -#endif } else if (mtmp->mpeaceful) Strcat(info, ", peaceful"); if (mtmp->cham >= LOW_PM && mtmp->data != &mons[mtmp->cham]) diff --git a/src/pray.c b/src/pray.c index 0e3730e20..a91782c72 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1645,7 +1645,6 @@ dopray() /* set up p_type and p_alignment */ if (!can_pray(TRUE)) return 0; -#ifdef WIZARD if (wizard && p_type >= 0) { if (yn("Force the gods to be pleased?") == 'y') { u.ublesscnt = 0; @@ -1655,7 +1654,6 @@ dopray() if(p_type < 2) p_type = 3; } } -#endif nomul(-3); nomovemsg = "You finish your prayer."; afternmv = prayer_done; diff --git a/src/quest.c b/src/quest.c index 566d7f029..e6f8cbc83 100644 --- a/src/quest.c +++ b/src/quest.c @@ -129,7 +129,6 @@ boolean talk; int purity; aligntyp original_alignment = u.ualignbase[A_ORIGINAL]; -#ifdef WIZARD if (wizard && talk) { if (u.ualign.type != original_alignment) { You("are currently %s instead of %s.", @@ -143,7 +142,6 @@ boolean talk; u.ualign.record = MIN_QUEST_ALIGN; } } -#endif purity = (u.ualign.record >= MIN_QUEST_ALIGN && u.ualign.type == original_alignment && u.ualignbase[A_CURRENT] == original_alignment) ? 1 : diff --git a/src/questpgr.c b/src/questpgr.c index d06270c88..9f717754f 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -461,10 +461,8 @@ boolean skip_pager(common) boolean common; { -#ifdef WIZARD /* WIZKIT: suppress plot feedback if starting with quest artifact */ if (program_state.wizkit_wishing) return TRUE; -#endif if (!(common ? qt_list.common : qt_list.chrole)) { panic("%s: no %s quest text data available", common ? "com_pager" : "qt_pager", diff --git a/src/read.c b/src/read.c index 6e3147714..b60ffa66e 100644 --- a/src/read.c +++ b/src/read.c @@ -1687,7 +1687,6 @@ do_class_genocide() else if (immunecnt || class == S_invisible) You("aren't permitted to genocide such monsters."); else -#ifdef WIZARD /* to aid in topology testing; remove pesky monsters */ if (wizard && buf[0] == '*') { register struct monst *mtmp, *mtmp2; @@ -1701,7 +1700,6 @@ do_class_genocide() pline("Eliminated %d monster%s.", gonecnt, plur(gonecnt)); return; } else -#endif pline("That %s does not represent any monster.", strlen(buf) == 1 ? "symbol" : "response"); continue; @@ -2023,7 +2021,6 @@ struct obj *from_obj; return FALSE; } -#ifdef WIZARD /* * Make a new monster with the type controlled by the user. * @@ -2063,12 +2060,10 @@ create_particular() makehostile = TRUE; } /* decide whether a valid monster was chosen */ -#ifdef WIZARD if (wizard && (!strcmp(bufp, "*") || !strcmp(bufp, "random"))) { randmonst = TRUE; break; } -#endif which = name_to_mon(bufp); if (which >= LOW_PM) break; /* got one */ monclass = name_to_monclass(bufp, &which); @@ -2089,12 +2084,10 @@ create_particular() if (!randmonst) { firstchoice = which; if (cant_revive(&which, FALSE, (struct obj *)0)) { -#ifdef WIZARD /* intentionally redundant... */ /* wizard mode can override handling of special monsters */ Sprintf(buf, "Creating %s instead; force %s?", mons[which].mname, mons[firstchoice].mname); if (yn(buf) == 'y') which = firstchoice; -#endif } whichpm = &mons[which]; } @@ -2127,6 +2120,5 @@ create_particular() } return madeany; } -#endif /* WIZARD */ /*read.c*/ diff --git a/src/rect.c b/src/rect.c index be120c369..a3d6228c7 100644 --- a/src/rect.c +++ b/src/rect.c @@ -137,9 +137,7 @@ add_rect(r) NhRect *r; { if (rect_cnt >= MAXRECT) { -#ifdef WIZARD if (wizard) pline("MAXRECT may be too small."); -#endif return; } /* Check that this NhRect is not included in another one */ diff --git a/src/restore.c b/src/restore.c index 30af7762c..e888b4dcd 100644 --- a/src/restore.c +++ b/src/restore.c @@ -531,9 +531,7 @@ unsigned int *stuckid, *steedid; /* for wizard mode, issue a reminder; for others, treat it as an attempt to cheat and refuse to restore this file */ pline("Saved game was not yours."); -#ifdef WIZARD if (!wizard) -#endif return FALSE; } mread(fd, (genericptr_t) &context, sizeof(struct context_info)); @@ -1008,9 +1006,7 @@ boolean ghostly; hpid, pid); else Sprintf(trickbuf, "This is level %d, not %d!", dlvl, lev); -#ifdef WIZARD if (wizard) pline1(trickbuf); -#endif trickery(trickbuf); } restcemetery(fd, &level.bonesinfo); diff --git a/src/rumors.c b/src/rumors.c index e84418e2d..7df89e8f4 100644 --- a/src/rumors.c +++ b/src/rumors.c @@ -172,7 +172,6 @@ boolean exclude_cookie; return rumor_buf; } -#ifdef WIZARD /* * test that the true/false rumor boundaries are valid. */ @@ -266,7 +265,6 @@ rumor_check() true_rumor_size = -1; /* don't try to open it again */ } } -#endif void outrumor(truth, mechanism) diff --git a/src/save.c b/src/save.c index e66a5c9eb..dc0f94078 100644 --- a/src/save.c +++ b/src/save.c @@ -1391,12 +1391,10 @@ int lev; if (!swapout_oldest()) return FALSE; } -# ifdef WIZARD if (wizard) { pline("Swapping in `%s'.", from); wait_synch(); } -# endif copyfile(from, to); (void) unlink(from); level_info[lev].where = ACTIVE; @@ -1423,12 +1421,10 @@ swapout_oldest() { Sprintf(to, "%s%s", permbones, alllevels); set_levelfile_name(from, oldest); set_levelfile_name(to, oldest); -# ifdef WIZARD if (wizard) { pline("Swapping out `%s'.", from); wait_synch(); } -# endif copyfile(from, to); (void) unlink(from); level_info[oldest].where = SWAPPED; diff --git a/src/shknam.c b/src/shknam.c index ab2262bb4..77bdf2f3c 100644 --- a/src/shknam.c +++ b/src/shknam.c @@ -510,7 +510,6 @@ struct mkroom *sroom; else if(sy == sroom->hy+1) sy--; else { shk_failed: #ifdef DEBUG -# ifdef WIZARD /* Said to happen sometimes, but I have never seen it. */ /* Supposedly fixed by fdoor change in mklev.c */ if(wizard) { @@ -527,7 +526,6 @@ struct mkroom *sroom; } display_nhwindow(WIN_MESSAGE, FALSE); } -# endif #endif return(-1); } diff --git a/src/sp_lev.c b/src/sp_lev.c index 5ecf91aa1..f27637b9b 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -15,11 +15,7 @@ /* #define DEBUG */ /* uncomment to enable code debugging */ #ifdef DEBUG -# ifdef WIZARD #define debugpline if (wizard) pline -# else -#define debugpline pline -# endif #endif #include "sp_lev.h" diff --git a/src/steed.c b/src/steed.c index afd4579dc..a18b418b9 100644 --- a/src/steed.c +++ b/src/steed.c @@ -177,10 +177,8 @@ doride() if (u.usteed) { dismount_steed(DISMOUNT_BYCHOICE); } else if (getdir((char *)0) && isok(u.ux+u.dx, u.uy+u.dy)) { -#ifdef WIZARD if (wizard && yn("Force the mount to succeed?") == 'y') forcemount = TRUE; -#endif return (mount_steed(m_at(u.ux+u.dx, u.uy+u.dy), forcemount)); } else { return 0; @@ -225,11 +223,9 @@ mount_steed(mtmp, force) */ if (Wounded_legs) { Your("%s are in no shape for riding.", makeplural(body_part(LEG))); -#ifdef WIZARD if (force && wizard && yn("Heal your legs?") == 'y') HWounded_legs = EWounded_legs = 0; else -#endif return (FALSE); } diff --git a/src/sys.c b/src/sys.c index 4550f4ff5..2f6c5fd87 100644 --- a/src/sys.c +++ b/src/sys.c @@ -8,10 +8,6 @@ /* for KR1ED config, WIZARD is 0 or 1 and WIZARD_NAME is a string; for usual config, WIZARD is the string; forcing WIZARD_NAME to match it eliminates conditional testing for which one to use in string ops */ -#ifndef KR1ED -# undef WIZARD_NAME -# define WIZARD_NAME WIZARD -#endif struct sysopt sysopt; diff --git a/src/teleport.c b/src/teleport.c index 158bd752c..ab8bb063e 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -418,14 +418,10 @@ struct obj *scroll; /* Disable teleportation in stronghold && Vlad's Tower */ if (level.flags.noteleport) { -#ifdef WIZARD if (!wizard) { -#endif pline("A mysterious force prevents you from teleporting!"); return TRUE; -#ifdef WIZARD } -#endif } /* don't show trap if "Sorry..." */ @@ -433,15 +429,11 @@ struct obj *scroll; if ((u.uhave.amulet || On_W_tower_level(&u.uz)) && !rn2(3)) { You_feel("disoriented for a moment."); -#ifdef WIZARD if (wizard && yn("Override?") != 'y') -#endif return FALSE; } if ((Teleport_control && !Stunned) -#ifdef WIZARD || wizard -#endif ) { if (unconscious()) { pline("Being unconscious, you cannot control your teleport."); @@ -519,40 +511,29 @@ dotele() castit = TRUE; break; } -#ifdef WIZARD if (!wizard) { -#endif if (!castit) { if (!Teleportation) You("don't know that spell."); else You("are not able to teleport at will."); return(0); } -#ifdef WIZARD } -#endif } if (u.uhunger <= 100 || ACURR(A_STR) < 6) { -#ifdef WIZARD if (!wizard) { -#endif You("lack the strength %s.", castit ? "for a teleport spell" : "to teleport"); return 1; -#ifdef WIZARD } -#endif } energy = objects[SPE_TELEPORT_AWAY].oc_level * 7 / 2 - 2; if (u.uen <= energy) { -#ifdef WIZARD if (wizard) energy = u.uen; - else -#endif - { + else { You("lack the energy %s.", castit ? "for a teleport spell" : "to teleport"); return 1; @@ -567,10 +548,7 @@ dotele() exercise(A_WIS, TRUE); if (spelleffects(sp_no, TRUE)) return(1); - else -#ifdef WIZARD - if (!wizard) -#endif + else if (!wizard) return(0); } else { u.uen -= energy; @@ -601,29 +579,19 @@ level_tele() boolean force_dest = FALSE; if ((u.uhave.amulet || In_endgame(&u.uz) || In_sokoban(&u.uz)) -#ifdef WIZARD - && !wizard -#endif - ) { + && !wizard) { You_feel("very disoriented for a moment."); return; } - if ((Teleport_control && !Stunned) -#ifdef WIZARD - || wizard -#endif - ) { + if ((Teleport_control && !Stunned) || wizard) { char qbuf[BUFSZ]; int trycnt = 0; Strcpy(qbuf, "To what level do you want to teleport?"); do { if (++trycnt == 2) { -#ifdef WIZARD if (wizard) Strcat(qbuf, " [type a number or ? for a menu]"); - else -#endif - Strcat(qbuf, " [type a number]"); + else Strcat(qbuf, " [type a number]"); } getlin(qbuf, buf); if (!strcmp(buf,"\033")) { /* cancelled */ @@ -638,7 +606,6 @@ level_tele() pline("Oops..."); goto random_levtport; } -#ifdef WIZARD if (wizard && !strcmp(buf,"?")) { schar destlev = 0; xchar destdnum = 0; @@ -661,9 +628,7 @@ level_tele() } } force_dest = TRUE; - } else -#endif /*WIZARD*/ - if ((newlev = lev_by_name(buf)) == 0) newlev = atoi(buf); + } else if ((newlev = lev_by_name(buf)) == 0) newlev = atoi(buf); } while (!newlev && !digit(buf[0]) && (buf[0] != '-' || !digit(buf[1])) && trycnt < 10); @@ -721,7 +686,6 @@ level_tele() You1(shudder_for_moment); return; } -#ifdef WIZARD if (In_endgame(&u.uz)) { /* must already be wizard */ int llimit = dunlevs_in_dungeon(&u.uz); @@ -734,7 +698,6 @@ level_tele() schedule_goto(&newlevel, FALSE, FALSE, 0, (char *)0, (char *)0); return; } -#endif killer.name[0] = 0; /* still alive, so far... */ @@ -800,18 +763,13 @@ level_tele() } else if (u.uz.dnum == medusa_level.dnum && newlev >= dungeons[u.uz.dnum].depth_start + dunlevs_in_dungeon(&u.uz)) { -#ifdef WIZARD if (!(wizard && force_dest)) -#endif find_hell(&newlevel); } else { /* if invocation did not yet occur, teleporting into * the last level of Gehennom is forbidden. */ -#ifdef WIZARD - if (!wizard) -#endif - if (Inhell && !u.uevent.invoked && + if (!wizard && Inhell && !u.uevent.invoked && newlev >= (dungeons[u.uz.dnum].depth_start + dunlevs_in_dungeon(&u.uz) - 1)) { newlev = dungeons[u.uz.dnum].depth_start + @@ -825,9 +783,7 @@ level_tele() * we must translate newlev to a number relative to the * current dungeon. */ -#ifdef WIZARD if (!(wizard && force_dest)) -#endif get_level(&newlevel, newlev); } schedule_goto(&newlevel, FALSE, FALSE, 0, (char *)0, (char *)0); diff --git a/src/timeout.c b/src/timeout.c index 6e2b0f95e..481b16ae7 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -1336,10 +1336,8 @@ do_storms() * Check whether object has a timer of type timer_type. */ -#ifdef WIZARD STATIC_DCL const char *FDECL(kind_name, (SHORT_P)); STATIC_DCL void FDECL(print_queue, (winid, timer_element *)); -#endif STATIC_DCL void FDECL(insert_timer, (timer_element *)); STATIC_DCL timer_element *FDECL(remove_timer, (timer_element **, SHORT_P, ANY_P *)); @@ -1377,9 +1375,6 @@ static const ttable timeout_funcs[NUM_TIME_FUNCS] = { }; #undef TTAB - -#if defined(WIZARD) - STATIC_OVL const char * kind_name(kind) short kind; @@ -1460,9 +1455,6 @@ timer_sanity_check() } } -#endif /* WIZARD */ - - /* * Pick off timeout elements from the global queue and call their functions. * Do this until their time is less than or equal to the move count. diff --git a/src/u_init.c b/src/u_init.c index 16956b976..09930dd11 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -775,10 +775,8 @@ u_init() if (discover) ini_inv(Wishing); -#ifdef WIZARD if (wizard) read_wizkit(); -#endif #ifndef GOLDOBJ u.ugold0 += hidden_gold(); /* in case sack has gold in it */ diff --git a/src/weapon.c b/src/weapon.c index 796fba66a..746d1b5cd 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -821,9 +821,7 @@ boolean speedy; { return !P_RESTRICTED(skill) && P_SKILL(skill) < P_MAX_SKILL(skill) && ( -#ifdef WIZARD (wizard && speedy) || -#endif (P_ADVANCE(skill) >= (unsigned) practice_needed_to_advance(P_SKILL(skill)) && u.skills_advanced < P_SKILL_LIMIT @@ -896,10 +894,8 @@ enhance_weapon_skill() winid win; boolean speedy = FALSE; -#ifdef WIZARD if (wizard && yn("Advance skills without practice?") == 'y') speedy = TRUE; -#endif do { /* find longest available skill name, count those that can advance */ @@ -972,7 +968,6 @@ enhance_weapon_skill() prefix = (to_advance + eventually_advance + maxxed_cnt > 0) ? " " : ""; (void) skill_level_name(i, sklnambuf); -#ifdef WIZARD if (wizard) { if (!iflags.menu_tab_sep) Sprintf(buf, " %s%-*s %-12s %5d(%4d)", @@ -984,9 +979,7 @@ enhance_weapon_skill() prefix, P_NAME(i), sklnambuf, P_ADVANCE(i), practice_needed_to_advance(P_SKILL(i))); - } else -#endif - { + } else { if (!iflags.menu_tab_sep) Sprintf(buf, " %s %-*s [%s]", prefix, longest, P_NAME(i), sklnambuf); @@ -1001,11 +994,9 @@ enhance_weapon_skill() Strcpy(buf, (to_advance > 0) ? "Pick a skill to advance:" : "Current skills:"); -#ifdef WIZARD if (wizard && !speedy) Sprintf(eos(buf), " (%d slot%s available)", u.weapon_slots, plur(u.weapon_slots)); -#endif end_menu(win, buf); n = select_menu(win, to_advance ? PICK_ONE : PICK_NONE, &selected); destroy_nhwindow(win); diff --git a/sys/be/bemain.c b/sys/be/bemain.c index 6a3715a9a..e053718cf 100644 --- a/sys/be/bemain.c +++ b/sys/be/bemain.c @@ -161,10 +161,8 @@ static void process_options(int argc, char **argv) argc--; switch (argv[0][1]) { case 'D': -#ifdef WIZARD wizard = TRUE, discover = FALSE; break; -#endif /* otherwise fall thru to discover */ case 'X': discover = TRUE, wizard = FALSE; @@ -253,12 +251,8 @@ void getlock(void) boolean authorize_wizard_mode() { -#ifdef WIZARD /* other ports validate user name or character name here */ return TRUE; -#else - return FALSE; -#endif } #ifndef __begui__ diff --git a/sys/mac/macmain.c b/sys/mac/macmain.c index 644e8e58f..de48cd2f6 100644 --- a/sys/mac/macmain.c +++ b/sys/mac/macmain.c @@ -284,12 +284,8 @@ finder_file_request(void) boolean authorize_wizard_mode() { -#ifdef WIZARD /* other ports validate user name or character name here */ return TRUE; -#else - return FALSE; -#endif } /*macmain.c*/ diff --git a/sys/mac/macmenu.c b/sys/mac/macmenu.c index 651ab2242..b12bec9c9 100644 --- a/sys/mac/macmenu.c +++ b/sys/mac/macmenu.c @@ -619,9 +619,7 @@ void mac_askname () fatal("\pCannot create mode menu"); AppendMenu(askmenu[RSRC_ASK_MODE], "\pNormal"); AppendMenu(askmenu[RSRC_ASK_MODE], "\pExplore"); -#ifdef WIZARD AppendMenu(askmenu[RSRC_ASK_MODE], "\pDebug"); -#endif InsertMenu(askmenu[RSRC_ASK_MODE], hierMenu); currmode = 0; @@ -708,9 +706,7 @@ void mac_askname () /* Adjust the mode popup menu */ CheckMenuItem(askmenu[RSRC_ASK_MODE], 1, currmode == 0); CheckMenuItem(askmenu[RSRC_ASK_MODE], 2, currmode == 1); -#ifdef WIZARD CheckMenuItem(askmenu[RSRC_ASK_MODE], 3, currmode == 2); -#endif /* Wait for an action on an item */ ModalDialog(filter, &item); @@ -773,22 +769,17 @@ void mac_askname () DisposeUserItemUPP(redraw); /* Process the mode */ -#ifdef WIZARD - wizard = -#endif - discover = 0; + wizard = discover = 0; switch (currmode) { case 0: /* Normal */ break; case 1: /* Explore */ discover = 1; break; -#ifdef WIZARD case 2: /* Debug */ wizard = 1; - strcpy(plname, WIZARD); + strcpy(plname, WIZARD_NAME); break; -#endif default: /* Quit */ ExitToShell(); } @@ -935,7 +926,6 @@ AdjustMenus(short dimMenubar) if (newMenubar != mbarRegular) ; /* we've already found its state */ -#ifdef WIZARD else if (wizard) { newMenubar = mbarSpecial; @@ -947,7 +937,6 @@ AdjustMenus(short dimMenubar) SetMenuItemText(MHND_FILE, menuFilePlayMode, "\pDebug"); } } -#endif else if (discover) { diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 0923f735f..55188619b 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -702,21 +702,11 @@ port_help() # endif /* MSDOS || WIN32 */ #endif /* PORT_HELP */ -/* for KR1ED config, WIZARD is 0 or 1 and WIZARD_NAME is a string; - for usual config, WIZARD is the string; forcing WIZARD_NAME to match it - eliminates conditional testing for which one to use in string ops */ -#ifndef KR1ED -# undef WIZARD_NAME -# define WIZARD_NAME WIZARD -#endif - /* validate wizard mode if player has requested access to it */ boolean authorize_wizard_mode() { -#ifdef WIZARD if (!strcmp(plname, WIZARD_NAME)) return TRUE; -#endif return FALSE; } diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index 8f743e2ad..f7cb9b26c 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -224,13 +224,10 @@ char *argv[]; or holds a generic user name like "player" or "games" */ plnamesuffix(); -#ifdef WIZARD if (wizard) { /* use character name rather than lock letter for file names */ locknum = 0; - } else -#endif - { + } else { /* suppress interrupts while processing lock file */ (void) signal(SIGQUIT,SIG_IGN); (void) signal(SIGINT,SIG_IGN); @@ -560,12 +557,10 @@ port_help() boolean authorize_wizard_mode() { -#ifdef WIZARD struct passwd *pw = get_unix_pw(); if (pw && sysopt.wizards && sysopt.wizards[0]) { if(check_user_string(sysopt.wizards)) return TRUE; } -#endif /* WIZARD */ wiz_error_flag = TRUE; /* not being allowed into wizard mode */ return FALSE; } @@ -574,16 +569,12 @@ static void wd_message() { if (wiz_error_flag) { -#ifdef WIZARD if (sysopt.wizards && sysopt.wizards[0]) { char *tmp = build_english_list(sysopt.wizards); pline("Only user%s %s may access debug (wizard) mode.", index(sysopt.wizards, ' ')?"s":"", tmp); free(tmp); } else -#else - pline("Debug mode is not available."); -#endif pline("Entering explore/discovery mode instead."); wizard = 0, discover = 1; /* (paranoia) */ } else if (discover) diff --git a/sys/unix/unixunix.c b/sys/unix/unixunix.c index a6d6d378b..202dd85de 100644 --- a/sys/unix/unixunix.c +++ b/sys/unix/unixunix.c @@ -311,9 +311,7 @@ int wt; #endif #ifndef NO_SIGNAL (void) signal(SIGINT, (SIG_RET_TYPE) done1); -# ifdef WIZARD if(wizard) (void) signal(SIGQUIT,SIG_DFL); -# endif #endif if(wt) { raw_print(""); diff --git a/sys/vms/vmsmain.c b/sys/vms/vmsmain.c index 52c181ade..a34224005 100644 --- a/sys/vms/vmsmain.c +++ b/sys/vms/vmsmain.c @@ -136,13 +136,10 @@ char *argv[]; or holds a generic user name like "player" or "games" */ plnamesuffix(); -#ifdef WIZARD if (wizard) { /* use character name rather than lock letter for file names */ locknum = 0; - } else -#endif - { + } else { /* suppress interrupts while processing lock file */ (void) signal(SIGQUIT, SIG_IGN); (void) signal(SIGINT, SIG_IGN); @@ -416,12 +413,10 @@ genericptr_t sigargs, mechargs; /* [0] is argc, [1..argc] are the real args */ || (condition >= SS$_ASTFLT && condition <= SS$_TBIT) || (condition >= SS$_ARTRES && condition <= SS$_INHCHME)) { program_state.done_hup = TRUE; /* pretend hangup has been attempted */ -# if defined(WIZARD) && !defined(BETA) +# ifndef BETA if (wizard) -# endif /*WIZARD && !BETA*/ -# if defined(WIZARD) || defined(BETA) +# endif /* !BETA */ abort(); /* enter the debugger */ -# endif /*WIZARD || BETA*/ } return SS$_RESIGNAL; } @@ -454,9 +449,7 @@ port_help() boolean authorize_wizard_mode() { -#ifdef WIZARD if (!strcmpi(nh_getenv("USER"), WIZARD_NAME)) return TRUE; -#endif wiz_error_flag = TRUE; /* not being allowed into wizard mode */ return FALSE; } @@ -465,12 +458,8 @@ static void wd_message() { if (wiz_error_flag) { -#ifdef WIZARD pline("Only user \"%s\" may access debug (wizard) mode.", WIZARD_NAME); -#else - pline("Debug mode is not available."); -#endif pline("Entering explore/discovery mode instead."); wizard = 0, discover = 1; /* (paranoia) */ } else if (discover) diff --git a/sys/vms/vmsunix.c b/sys/vms/vmsunix.c index baa4f75a3..90e2bd855 100644 --- a/sys/vms/vmsunix.c +++ b/sys/vms/vmsunix.c @@ -367,9 +367,7 @@ hack_resume(screen_manip) boolean screen_manip; { (void) signal(SIGINT, (SIG_RET_TYPE) done1); -# ifdef WIZARD if (wizard) (void) signal(SIGQUIT,SIG_DFL); -# endif if (screen_manip) resume_nhwindows(); /* setup terminal modes, redraw screen, &c */ } diff --git a/sys/wince/mhcmd.c b/sys/wince/mhcmd.c index 1e8b1c7f2..29d13be0b 100644 --- a/sys/wince/mhcmd.c +++ b/sys/wince/mhcmd.c @@ -296,7 +296,6 @@ NHCmdPadCell cells_layout_lookup[NH_CMDPAD_CELLNUM] = { -1, "X", "X", 13, NH_CELL_LAYOUT_MENU, 1 , 0 } }; -#ifdef WIZARD /* wizard mode layout */ NHCmdPadCell cells_layout_wizard[NH_CMDPAD_CELLNUM] = { @@ -313,7 +312,6 @@ NHCmdPadCell cells_layout_wizard[NH_CMDPAD_CELLNUM] = { -1, "", "", -NH_CMDPAD_FONT_NORMAL, NH_CELL_REG, 1, (void*)-1 }, { -1, "X", "X", 13, NH_CELL_LAYOUT_MENU, 1 , 0 } }; -#endif #else /* !WIN_CE_SMARTPHONE */ @@ -557,13 +555,11 @@ void register_command_window_class() nhcmdlayout_init(plt, cells_layout_lookup); nhcmdset_add(nhcmdset_current, plt); -#ifdef WIZARD if( wizard ) { plt = nhcmdlayout_create("Wizard Mode", NH_CMDPAD_ROWS, NH_CMDPAD_COLS); nhcmdlayout_init(plt, cells_layout_wizard); nhcmdset_add(nhcmdset_current, plt); } -#endif #else /* ! WIN_CE_SMARTPHONE */ plt = nhcmdlayout_create("lowercase", NH_CMDPAD_ROWS, NH_CMDPAD_COLS); diff --git a/sys/wince/winhack.c b/sys/wince/winhack.c index 2e25082a0..25a0a80cd 100644 --- a/sys/wince/winhack.c +++ b/sys/wince/winhack.c @@ -340,10 +340,8 @@ register char *s; void win32_abort() { -#ifdef WIZARD if (wizard) DebugBreak(); -#endif abort(); } diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 765d95142..a0f9d95fe 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -417,7 +417,7 @@ int *x, *y, *mod; static void really_move_cursor() { -#if defined(PORT_DEBUG) && defined(WIZARD) +#ifdef PORT_DEBUG char oldtitle[BUFSZ], newtitle[BUFSZ]; if (display_cursor_info && wizard) { oldtitle[0] = '\0'; diff --git a/sys/winnt/winnt.c b/sys/winnt/winnt.c index e63db103b..c36175424 100644 --- a/sys/winnt/winnt.c +++ b/sys/winnt/winnt.c @@ -236,7 +236,6 @@ extern void NDECL(backsp); void win32_abort() { -#ifdef WIZARD if (wizard) { # ifdef WIN32CON int c, ci, ct; @@ -263,7 +262,6 @@ void win32_abort() DebugBreak(); # endif } -#endif abort(); } diff --git a/util/makedefs.c b/util/makedefs.c index 4ddb7f449..ad2186887 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1233,9 +1233,6 @@ static const char *build_opts[] = { #ifdef DLB "data librarian", #endif -#ifdef WIZARD - "debug mode", -#endif #ifdef EXP_ON_BOTL "experience points on status line", #endif diff --git a/util/mdgrep.h b/util/mdgrep.h index b2515aa86..823c269d3 100644 --- a/util/mdgrep.h +++ b/util/mdgrep.h @@ -257,11 +257,7 @@ static struct grep_var grep_vars[]={ #else {"WIN_CE_SMARTPHONE", 0}, #endif -#if defined(WIZARD) {"WIZARD", 1}, -#else - {"WIZARD", 0}, -#endif #if defined(X11_GRAPHICS) {"X11_GRAPHICS", 1}, #else diff --git a/util/mdgrep.pl b/util/mdgrep.pl index 10038fdc7..27e78fe47 100644 --- a/util/mdgrep.pl +++ b/util/mdgrep.pl @@ -18,7 +18,7 @@ # Game Features: @feature = qw/ZEROCOMP USE_TILES ASCIIGRAPH CLIPPING TEXTCOLOR - COMPRESS ZLIB_COMP RANDOM SECURE USER_SOUNDS WIZARD + COMPRESS ZLIB_COMP RANDOM SECURE USER_SOUNDS SAFERHANGUP MFLOPPY NOCWD_ASSUMPTIONS VAR_PLAYGROUND DLB SHELL SUSPEND NOSAVEONHANGUP HANGUPHANDLING BSD_JOB_CONTROL MAIL POSIX_JOB_CONTROL INSURANCE From ac108cd365b2193f24b5c797aac3203ca83977cd Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sat, 14 Feb 2015 01:31:22 -0500 Subject: [PATCH 015/354] Make GOLDOBJ unconditional. --- include/config.h | 1 - include/decl.h | 2 - include/extern.h | 25 ----- include/monst.h | 3 - include/you.h | 4 - src/apply.c | 17 ---- src/bones.c | 10 -- src/botl.c | 16 +--- src/decl.c | 2 - src/detect.c | 39 +------- src/do.c | 28 ------ src/dog.c | 9 -- src/dogmove.c | 3 - src/dokick.c | 8 -- src/dothrow.c | 29 ------ src/eat.c | 5 - src/end.c | 9 -- src/fountain.c | 9 -- src/hack.c | 16 +--- src/invent.c | 221 ------------------------------------------- src/makemon.c | 19 ---- src/mhitm.c | 9 -- src/mhitu.c | 22 ----- src/minion.c | 17 ---- src/mkobj.c | 8 -- src/mon.c | 18 ---- src/monmove.c | 29 +----- src/mplayer.c | 4 - src/objnam.c | 8 -- src/options.c | 5 - src/pickup.c | 128 ------------------------- src/priest.c | 27 ------ src/read.c | 2 - src/restore.c | 42 -------- src/rip.c | 4 - src/rumors.c | 9 -- src/save.c | 18 ---- src/shk.c | 91 ------------------ src/shknam.c | 4 - src/sit.c | 14 --- src/sounds.c | 4 - src/steal.c | 98 +------------------ src/trap.c | 23 ----- src/u_init.c | 22 ----- src/uhitm.c | 8 -- src/vault.c | 37 -------- src/wield.c | 7 -- src/zap.c | 7 -- sys/amiga/amirip.c | 7 +- sys/wince/mhstatus.c | 4 - util/makedefs.c | 7 -- win/Qt/qt_win.cpp | 8 -- win/X11/winstat.c | 4 - win/X11/wintext.c | 4 - win/gem/wingem.c | 4 - win/gnome/gnbind.c | 7 +- win/gnome/gnstatus.c | 15 --- win/win32/mswproc.c | 4 - 58 files changed, 8 insertions(+), 1196 deletions(-) diff --git a/include/config.h b/include/config.h index c89f778e3..1af4b0560 100644 --- a/include/config.h +++ b/include/config.h @@ -443,7 +443,6 @@ typedef unsigned char uchar; * bugs left here. */ -/*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */ #define STATUS_VIA_WINDOWPORT /* re-work of the status line updating process */ #define STATUS_HILITES /* support hilites of status fields */ /* #define WINCHAIN*/ /* stacked window systems */ diff --git a/include/decl.h b/include/decl.h index ddc814f4d..1e882705f 100644 --- a/include/decl.h +++ b/include/decl.h @@ -180,9 +180,7 @@ E NEARDATA struct kinfo { char name[BUFSZ]; /* actual killer name */ } killer; -#ifdef GOLDOBJ E long done_money; -#endif E const char *configfile; E NEARDATA char plname[PL_NSIZ]; E NEARDATA char dogname[]; diff --git a/include/extern.h b/include/extern.h index fd4bc6520..492718730 100644 --- a/include/extern.h +++ b/include/extern.h @@ -803,9 +803,7 @@ E int FDECL(calc_capacity, (int)); E int NDECL(max_capacity); E boolean FDECL(check_capacity, (const char *)); E int FDECL(inv_cnt, (BOOLEAN_P)); -#ifdef GOLDOBJ E long FDECL(money_cnt, (struct obj *)); -#endif /* ### hacklib.c ### */ @@ -900,11 +898,6 @@ E boolean FDECL(obj_here, (struct obj *,int,int)); E boolean NDECL(wearing_armor); E boolean FDECL(is_worn, (struct obj *)); E struct obj *FDECL(g_at, (int,int)); -#ifndef GOLDOBJ -E struct obj *FDECL(mkgoldobj, (long)); -E struct obj *FDECL(insert_gold_into_invent, (BOOLEAN_P)); -E void NDECL(remove_gold_from_invent); -#endif E struct obj *FDECL(getobj, (const char *,const char *)); E int FDECL(ggetobj, (const char *,int (*)(OBJ_P),int,BOOLEAN_P,unsigned *)); E int FDECL(askchain, (struct obj **,const char *,int,int (*)(OBJ_P), @@ -1076,9 +1069,7 @@ E void FDECL(freemcorpsenm, (struct monst *)); E void FDECL(set_mimic_sym, (struct monst *)); E int FDECL(mbirth_limit, (int)); E void FDECL(mimic_hit_msg, (struct monst *, SHORT_P)); -#ifdef GOLDOBJ E void FDECL(mkmonmoney, (struct monst *, long)); -#endif E int FDECL(bagotricks, (struct obj *,BOOLEAN_P,int *)); E boolean FDECL(propagate, (int, BOOLEAN_P,BOOLEAN_P)); E boolean FDECL(usmellmon, (struct permonst *)); @@ -1679,13 +1670,8 @@ E void NDECL(getlock); /* ### pickup.c ### */ -#ifdef GOLDOBJ E int FDECL(collect_obj_classes, (char *,struct obj *,BOOLEAN_P,boolean FDECL((*),(OBJ_P)), int *)); -#else -E int FDECL(collect_obj_classes, - (char *,struct obj *,BOOLEAN_P,BOOLEAN_P,boolean FDECL((*),(OBJ_P)), int *)); -#endif E boolean FDECL(rider_corpse_revival, (struct obj *,BOOLEAN_P)); E void FDECL(add_valid_menu_class, (int)); E boolean FDECL(allow_all, (struct obj *)); @@ -1926,9 +1912,6 @@ E int FDECL(validate, (int,const char *)); E void NDECL(reset_restpref); E void FDECL(set_restpref, (const char *)); E void FDECL(set_savepref, (const char *)); -#ifndef GOLDOBJ -E void FDECL(put_gold_back, (struct monst *)); -#endif /* ### rip.c ### */ @@ -2019,10 +2002,8 @@ E void FDECL(store_savefileinfo, (int)); /* ### shk.c ### */ -#ifdef GOLDOBJ E long FDECL(money2mon, (struct monst *, long)); E void FDECL(money2u, (struct monst *, long)); -#endif E void FDECL(shkgone, (struct monst *)); E void FDECL(set_residency, (struct monst *,BOOLEAN_P)); E void FDECL(replshk, (struct monst *,struct monst *)); @@ -2155,11 +2136,7 @@ E void FDECL(initialspell, (struct obj *)); #ifdef USE_TRAMPOLI E int NDECL(stealarm); #endif -#ifdef GOLDOBJ E long FDECL(somegold, (long)); -#else -E long NDECL(somegold); -#endif E void FDECL(stealgold, (struct monst *)); E void FDECL(remove_worn_item, (struct obj *,BOOLEAN_P)); E int FDECL(steal, (struct monst *, char *)); @@ -2169,9 +2146,7 @@ E void FDECL(maybe_absorb_item, (struct monst *,struct obj *,int,int)); E void FDECL(mdrop_obj, (struct monst *,struct obj *,BOOLEAN_P)); E void FDECL(mdrop_special_objs, (struct monst *)); E void FDECL(relobj, (struct monst *,int,BOOLEAN_P)); -#ifdef GOLDOBJ E struct obj *FDECL(findgold, (struct obj *)); -#endif /* ### steed.c ### */ diff --git a/include/monst.h b/include/monst.h index c451d374f..39e62f3e4 100644 --- a/include/monst.h +++ b/include/monst.h @@ -135,9 +135,6 @@ struct monst { long mtrapseen; /* bitmap of traps we've been trapped in */ long mlstmv; /* for catching up with lost time */ long mspare1; -#ifndef GOLDOBJ -#define mgold mspare1 -#endif struct obj *minvent; struct obj *mw; diff --git a/include/you.h b/include/you.h index c010abcb0..0c343b3c4 100644 --- a/include/you.h +++ b/include/you.h @@ -339,10 +339,6 @@ struct you { int ublessed, ublesscnt; /* blessing/duration from #pray */ long umoney0; long uspare1; -#ifndef GOLDOBJ -#define ugold uspare1 -#define ugold0 umoney0 -#endif long uexp, urexp; long ucleansed; /* to record moves when player was cleansed */ long usleep; /* sleeping; monstermove you last started */ diff --git a/src/apply.c b/src/apply.c index 1ab6153df..e92e6199f 100644 --- a/src/apply.c +++ b/src/apply.c @@ -2026,9 +2026,6 @@ struct obj *tstone; static const char scritch[] = "\"scritch, scritch\""; static const char allowall[3] = { COIN_CLASS, ALL_CLASSES, 0 }; static const char coins_gems[3] = { COIN_CLASS, GEM_CLASS, 0 }; -#ifndef GOLDOBJ - struct obj goldobj; -#endif /* in case it was acquired while blinded */ if (!Blind) tstone->dknown = 1; @@ -2039,17 +2036,6 @@ struct obj *tstone; Sprintf(stonebuf, "rub on the stone%s", plur(tstone->quan)); if ((obj = getobj(choices, stonebuf)) == 0) return; -#ifndef GOLDOBJ - if (obj->oclass == COIN_CLASS) { - u.ugold += obj->quan; /* keep botl up to date */ - goldobj = *obj; - goldobj.oextra = (struct oextra *)0; /* dealloc_obj(obj) will invalidate - the target of this copied ptr - here, so clear it out */ - dealloc_obj(obj); - obj = &goldobj; - } -#endif if (obj == tstone && obj->quan == 1L) { You_cant("rub %s on itself.", the(xname(obj))); @@ -2066,9 +2052,6 @@ struct obj *tstone; else pline("A sharp crack shatters %s%s.", (obj->quan > 1L) ? "one of " : "", the(xname(obj))); -#ifndef GOLDOBJ - /* assert(obj != &goldobj); */ -#endif useup(obj); return; } diff --git a/src/bones.c b/src/bones.c index 5607355ee..66a4d43f5 100644 --- a/src/bones.c +++ b/src/bones.c @@ -229,16 +229,6 @@ int x, y; else place_object(otmp, x, y); } -#ifndef GOLDOBJ - if(u.ugold) { - long ugold = u.ugold; - - if (mtmp) mtmp->mgold = ugold; - else if (cont) (void) add_to_container(cont, mkgoldobj(ugold)); - else (void)mkgold(ugold, x, y); - u.ugold = ugold; /* undo mkgoldobj()'s removal */ - } -#endif if (cont) cont->owt = weight(cont); } diff --git a/src/botl.c b/src/botl.c index 59c6078ac..ab02ae35b 100644 --- a/src/botl.c +++ b/src/botl.c @@ -159,13 +159,8 @@ botl_score() long deepest = deepest_lev_reached(FALSE); long utotal; -#ifndef GOLDOBJ - utotal = u.ugold + hidden_gold(); - if ((utotal -= u.ugold0) < 0L) utotal = 0L; -#else utotal = money_cnt(invent) + hidden_gold(); if ((utotal -= u.umoney0) < 0L) utotal = 0L; -#endif utotal += u.urexp + (50 * (deepest - 1)) + (deepest > 30 ? 10000 : deepest > 20 ? 1000*(deepest - 20) : 0); if (utotal < u.urexp) utotal = LONG_MAX; /* wrap around */ @@ -268,11 +263,7 @@ bot2() Sprintf(nb = eos(newbot2), "%s:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", encglyph(objnum_to_glyph(GOLD_PIECE)), -#ifndef GOLDOBJ - u.ugold, -#else money_cnt(invent), -#endif hp, hpmax, u.uen, u.uenmax, u.uac); if (Upolyd) @@ -709,12 +700,7 @@ bot() /* Gold */ - blstats[idx][BL_GOLD].a.a_long = -#ifndef GOLDOBJ - u.ugold; -#else - money_cnt(invent); -#endif + blstats[idx][BL_GOLD].a.a_long = money_cnt(invent); /* * The tty port needs to display the current symbol for gold * as a field header, so to accomodate that we pass gold with diff --git a/src/decl.c b/src/decl.c index d4892f9d4..47043d0cd 100644 --- a/src/decl.c +++ b/src/decl.c @@ -49,9 +49,7 @@ NEARDATA int doorindex = 0; NEARDATA char *save_cm = 0; NEARDATA struct kinfo killer = DUMMY; -#ifdef GOLDOBJ NEARDATA long done_money = 0; -#endif const char *nomovemsg = 0; NEARDATA char plname[PL_NSIZ] = DUMMY; /* player name */ NEARDATA char pl_character[PL_CSIZ] = DUMMY; diff --git a/src/detect.c b/src/detect.c index 93db6c77c..ecc4d3878 100644 --- a/src/detect.c +++ b/src/detect.c @@ -91,12 +91,7 @@ unsigned material; /* there's some object shown here */ if (oclass == ALL_CLASSES) { return((boolean)( !(level.objects[x][y] || /* stale if nothing here */ - ((mtmp = m_at(x,y)) != 0 && - ( -#ifndef GOLDOBJ - mtmp->mgold || -#endif - mtmp->minvent))))); + ((mtmp = m_at(x,y)) != 0 && ( mtmp->minvent))))); } else { if (material && objects[glyph_to_obj(glyph)].oc_material == material) { /* the object shown here is of interest because material matches */ @@ -115,19 +110,10 @@ unsigned material; for (otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere) if (o_in(otmp, oclass)) return FALSE; /* didn't find it; perhaps a monster is carrying it */ -#ifndef GOLDOBJ - if ((mtmp = m_at(x,y)) != 0) { - if (oclass == COIN_CLASS && mtmp->mgold) - return FALSE; - else for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) - if (o_in(otmp, oclass)) return FALSE; - } -#else if ((mtmp = m_at(x,y)) != 0) { for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) if (o_in(otmp, oclass)) return FALSE; } -#endif /* detection indicates removal of this object from the map */ return TRUE; } @@ -176,11 +162,7 @@ register struct obj *sobj; /* look for gold carried by monsters (might be in a container) */ for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (DEADMONSTER(mtmp)) continue; /* probably not needed in this case but... */ -#ifndef GOLDOBJ - if (mtmp->mgold || monsndx(mtmp->data) == PM_GOLD_GOLEM) { -#else if (findgold(mtmp->minvent) || monsndx(mtmp->data) == PM_GOLD_GOLEM) { -#endif known = TRUE; goto outgoldmap; /* skip further searching */ } else for (obj = mtmp->minvent; obj; obj = obj->nobj) @@ -212,12 +194,7 @@ register struct obj *sobj; if (youmonst.data == &mons[PM_GOLD_GOLEM]) { Sprintf(buf, "You feel like a million %s!", currency(2L)); - } else if (hidden_gold() || -#ifndef GOLDOBJ - u.ugold) -#else - money_cnt(invent)) -#endif + } else if (hidden_gold() || money_cnt(invent)) Strcpy(buf, "You feel worried about your future financial situation."); else @@ -254,11 +231,7 @@ outgoldmap: } for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (DEADMONSTER(mtmp)) continue; /* probably overkill here */ -#ifndef GOLDOBJ - if (mtmp->mgold || monsndx(mtmp->data) == PM_GOLD_GOLEM) { -#else if (findgold(mtmp->minvent) || monsndx(mtmp->data) == PM_GOLD_GOLEM) { -#endif struct obj gold; gold = zeroobj; /* ensure oextra is cleared too */ gold.otyp = GOLD_PIECE; @@ -460,11 +433,7 @@ int class; /* an object class, 0 for all */ } if ((is_cursed && mtmp->m_ap_type == M_AP_OBJECT && (!class || class == objects[mtmp->mappearance].oc_class)) || -#ifndef GOLDOBJ - (mtmp->mgold && (!class || class == COIN_CLASS))) { -#else (findgold(mtmp->minvent) && (!class || class == COIN_CLASS))) { -#endif ct++; break; } @@ -546,11 +515,7 @@ int class; /* an object class, 0 for all */ temp.oy = mtmp->my; temp.corpsenm = PM_TENGU; /* if mimicing a corpse */ map_object(&temp, 1); -#ifndef GOLDOBJ - } else if (mtmp->mgold && (!class || class == COIN_CLASS)) { -#else } else if (findgold(mtmp->minvent) && (!class || class == COIN_CLASS)) { -#endif struct obj gold; gold = zeroobj; /* ensure oextra is cleared too */ gold.otyp = GOLD_PIECE; diff --git a/src/do.c b/src/do.c index c225000ef..981981293 100644 --- a/src/do.c +++ b/src/do.c @@ -28,11 +28,7 @@ static NEARDATA const char drop_types[] = int dodrop() { -#ifndef GOLDOBJ - int result, i = (invent || u.ugold) ? 0 : (SIZE(drop_types) - 1); -#else int result, i = (invent) ? 0 : (SIZE(drop_types) - 1); -#endif if (*u.ushops) sellobj_state(SELL_DELIBERATE); result = drop(getobj(&drop_types[i], "drop")); @@ -484,13 +480,9 @@ register struct obj *obj; if (levhack) ELevitation = W_ART; /* other than W_ARTI */ if(flags.verbose) You("drop %s.", doname(obj)); -#ifndef GOLDOBJ - if (obj->oclass != COIN_CLASS || obj == invent) freeinv(obj); -#else /* Ensure update when we drop gold objects */ if (obj->oclass == COIN_CLASS) context.botl = 1; freeinv(obj); -#endif hitfloor(obj); if (levhack) float_down(I_SPECIAL|TIMEOUT, W_ARTI|W_ART); return(1); @@ -509,13 +501,9 @@ void dropx(obj) register struct obj *obj; { -#ifndef GOLDOBJ - if (obj->oclass != COIN_CLASS || obj == invent) freeinv(obj); -#else /* Ensure update when we drop gold objects */ if (obj->oclass == COIN_CLASS) context.botl = 1; freeinv(obj); -#endif if (!u.uswallow) { if (ship_object(obj, u.ux, u.uy, FALSE)) return; if (IS_ALTAR(levl[u.ux][u.uy].typ)) @@ -653,17 +641,10 @@ int retry; int n, i, n_dropped = 0; long cnt; struct obj *otmp, *otmp2; -#ifndef GOLDOBJ - struct obj *u_gold = 0; -#endif menu_item *pick_list; boolean all_categories = TRUE; boolean drop_everything = FALSE; -#ifndef GOLDOBJ - /* put gold where inventory traversal will see it */ - if (u.ugold) u_gold = insert_gold_into_invent(TRUE); -#endif if (retry) { all_categories = (retry == -2); } else if (flags.menu_style == MENU_FULL) { @@ -749,11 +730,6 @@ int retry; /* same kludge as getobj(), for canletgo()'s use */ otmp->corpsenm = (int) cnt; /* don't split */ } else { -#ifndef GOLDOBJ - if (otmp->oclass == COIN_CLASS) - (void) splitobj(otmp, otmp->quan - cnt); - else -#endif otmp = splitobj(otmp, cnt); } } @@ -765,10 +741,6 @@ int retry; } drop_done: -#ifndef GOLDOBJ - /* if we put gold into inventory above, take it back out now */ - if (u_gold) remove_gold_from_invent(); -#endif return n_dropped; } diff --git a/src/dog.c b/src/dog.c index fa9d1f99a..ff7dd525d 100644 --- a/src/dog.c +++ b/src/dog.c @@ -443,15 +443,6 @@ boolean with_you; } corpse = mkcorpstat(CORPSE, (struct monst *)0, mtmp->data, xlocale, ylocale, CORPSTAT_NONE); -#ifndef GOLDOBJ - if (mtmp->mgold) { - if (xlocale == 0 && ylocale == 0 && corpse) { - (void) get_obj_location(corpse, &xlocale, &ylocale, 0); - (void) mkgold(mtmp->mgold, xlocale, ylocale); - } - mtmp->mgold = 0L; - } -#endif mongone(mtmp); } } diff --git a/src/dogmove.c b/src/dogmove.c index 4300fb8de..0b6e7a6f8 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -26,9 +26,6 @@ struct monst *mon; struct obj *obj, *wep, dummy, *pickaxe, *unihorn, *key; -#ifndef GOLDOBJ - if (mon->mgold) return &zeroobj; /* pet has something to drop */ -#endif dummy = zeroobj; dummy.otyp = GOLD_PIECE; /* not STRANGE_OBJECT or tools of interest */ dummy.oartifact = 1; /* so real artifact won't override "don't keep it" */ diff --git a/src/dokick.c b/src/dokick.c index fb81ab5c4..b17379e07 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -322,11 +322,7 @@ register struct obj *gold; verbalize("Thank you for your contribution."); else verbalize("Thanks, scum!"); } else if (mtmp->isgd) { -#ifndef GOLDOBJ - umoney = u.ugold; -#else umoney = money_cnt(invent); -#endif /* Some of these are iffy, because a hostile guard won't become peaceful and resume leading hero out of the vault. If he did do that, player @@ -352,11 +348,7 @@ register struct obj *gold; goldreqd = 750L; if (goldreqd) { -#ifndef GOLDOBJ - umoney = u.ugold; -#else umoney = money_cnt(invent); -#endif if (value > goldreqd + (umoney + u.ulevel * rn2(5)) / ACURR(A_CHA)) mtmp->mpeaceful = TRUE; diff --git a/src/dothrow.c b/src/dothrow.c index 08e21d4f5..aedb4fc40 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -45,18 +45,6 @@ int shotlimit; boolean twoweap, weakmultishot; /* ask "in what direction?" */ -#ifndef GOLDOBJ - if (!getdir((char *)0)) { - if (obj->oclass == COIN_CLASS) { - u.ugold += obj->quan; - context.botl = 1; - dealloc_obj(obj); - } - return(0); - } - - if(obj->oclass == COIN_CLASS) return(throw_gold(obj)); -#else if (!getdir((char *)0)) { /* obj might need to be merged back into the singular gold object */ freeinv(obj); @@ -73,7 +61,6 @@ int shotlimit; possibly using a sling. */ if(obj->oclass == COIN_CLASS && obj != uquiver) return(throw_gold(obj)); -#endif if(!canletgo(obj,"throw")) return(0); @@ -1833,34 +1820,18 @@ throw_gold(obj) struct obj *obj; { int range, odx, ody; -#ifndef GOLDOBJ - long zorks = obj->quan; -#endif register struct monst *mon; if(!u.dx && !u.dy && !u.dz) { -#ifndef GOLDOBJ - u.ugold += obj->quan; - context.botl = 1; - dealloc_obj(obj); -#endif You("cannot throw gold at yourself."); return(0); } -#ifdef GOLDOBJ freeinv(obj); -#endif if(u.uswallow) { pline(is_animal(u.ustuck->data) ? "%s in the %s's entrails." : "%s into %s.", -#ifndef GOLDOBJ - "The gold disappears", mon_nam(u.ustuck)); - u.ustuck->mgold += zorks; - dealloc_obj(obj); -#else "The money disappears", mon_nam(u.ustuck)); add_to_minv(u.ustuck, obj); -#endif return(1); } diff --git a/src/eat.c b/src/eat.c index 196fb9e49..7259e6424 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1985,13 +1985,8 @@ eatspecial() /* called after eating non-food */ context.victual.o_id = 0; context.victual.eating = 0; if (otmp->oclass == COIN_CLASS) { -#ifdef GOLDOBJ if (carried(otmp)) useupall(otmp); -#else - if (otmp->where == OBJ_FREE) - dealloc_obj(otmp); -#endif else useupf(otmp, otmp->quan); vault_gd_watching(GD_EATGOLD); diff --git a/src/end.c b/src/end.c index c9fe47cb2..f7e7f5ec3 100644 --- a/src/end.c +++ b/src/end.c @@ -998,13 +998,8 @@ die: { int deepest = deepest_lev_reached(FALSE); -#ifndef GOLDOBJ - umoney = u.ugold; - tmp = u.ugold0; -#else umoney = money_cnt(invent); tmp = u.umoney0; -#endif umoney += hidden_gold(); /* accumulate gold from containers */ tmp = umoney - tmp; /* net gain */ @@ -1046,11 +1041,7 @@ die: /* update gold for the rip output, which can't use hidden_gold() (containers will be gone by then if bones just got saved...) */ -#ifndef GOLDOBJ - u.ugold = umoney; -#else done_money = umoney; -#endif /* clean up unneeded windows */ if (have_windows) { diff --git a/src/fountain.c b/src/fountain.c index 764ffb5a3..f167c09d4 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -452,14 +452,6 @@ register struct obj *obj; break; case 28: /* Strange feeling */ pline("An urge to take a bath overwhelms you."); -#ifndef GOLDOBJ - if (u.ugold > 10) { - u.ugold -= somegold() / 10; - You("lost some of your gold in the fountain!"); - CLEAR_FOUNTAIN_LOOTED(u.ux,u.uy); - exercise(A_WIS, FALSE); - } -#else { long money = money_cnt(invent); struct obj *otmp; @@ -479,7 +471,6 @@ register struct obj *obj; exercise(A_WIS, FALSE); } } -#endif break; case 29: /* You see coins */ diff --git a/src/hack.c b/src/hack.c index 66e0962e6..fafff35b6 100644 --- a/src/hack.c +++ b/src/hack.c @@ -2540,22 +2540,10 @@ inv_weight() register struct obj *otmp = invent; register int wt = 0; -#ifndef GOLDOBJ - /* when putting stuff into containers, gold is inserted at the head - of invent for easier manipulation by askchain & co, but it's also - retained in u.ugold in order to keep the status line accurate; we - mustn't add its weight in twice under that circumstance */ - wt = (otmp && otmp->oclass == COIN_CLASS) ? 0 : - (int)((u.ugold + 50L) / 100L); -#endif while (otmp) { -#ifndef GOLDOBJ - if (otmp->otyp != BOULDER || !throws_rocks(youmonst.data)) -#else if (otmp->oclass == COIN_CLASS) wt += (int)(((long)otmp->quan + 50L) / 100L); else if (otmp->otyp != BOULDER || !throws_rocks(youmonst.data)) -#endif wt += otmp->owt; otmp = otmp->nobj; } @@ -2609,7 +2597,7 @@ const char *str; int inv_cnt(incl_gold) -boolean incl_gold; /* only meaningful for GOLDOBJ config */ +boolean incl_gold; { register struct obj *otmp = invent; register int ct = 0; @@ -2621,7 +2609,6 @@ boolean incl_gold; /* only meaningful for GOLDOBJ config */ return(ct); } -#ifdef GOLDOBJ /* Counts the money in an object chain. */ /* Intended use is for your or some monsters inventory, */ /* now that u.gold/m.gold is gone.*/ @@ -2637,6 +2624,5 @@ struct obj *otmp; } return 0L; } -#endif /* GOLDOBJ */ /*hack.c*/ diff --git a/src/invent.c b/src/invent.c index 5778135d9..7a7a83734 100644 --- a/src/invent.c +++ b/src/invent.c @@ -168,9 +168,7 @@ struct obj **potmp, **pobj; / (otmp->quan + obj->quan); otmp->quan += obj->quan; -#ifdef GOLDOBJ /* temporary special case for gold objects!!!! */ -#endif if (otmp->oclass == COIN_CLASS) otmp->owt = weight(otmp); else otmp->owt += obj->owt; if(!has_oname(otmp) && has_oname(obj)) @@ -238,11 +236,7 @@ addinv_core1(obj) struct obj *obj; { if (obj->oclass == COIN_CLASS) { -#ifndef GOLDOBJ - u.ugold += obj->quan; -#else context.botl = 1; -#endif } else if (obj->otyp == AMULET_OF_YENDOR) { if (u.uhave.amulet) impossible("already have amulet?"); u.uhave.amulet = 1; @@ -305,11 +299,6 @@ struct obj *obj; obj->was_thrown = 0; /* not meaningful for invent */ addinv_core1(obj); -#ifndef GOLDOBJ - /* if handed gold, we're done */ - if (obj->oclass == COIN_CLASS) - return obj; -#endif /* merge with quiver in preference to any other inventory slot in case quiver and wielded weapon are both eligible; adding @@ -488,10 +477,6 @@ freeinv_core(obj) struct obj *obj; { if (obj->oclass == COIN_CLASS) { -#ifndef GOLDOBJ - u.ugold -= obj->quan; - obj->in_use = FALSE; -#endif context.botl = 1; return; } else if (obj->otyp == AMULET_OF_YENDOR) { @@ -679,60 +664,6 @@ register int x, y; return((struct obj *)0); } -#ifndef GOLDOBJ -/* Make a gold object from the hero's gold. */ -struct obj * -mkgoldobj(q) -register long q; -{ - register struct obj *otmp; - - otmp = mksobj(GOLD_PIECE, FALSE, FALSE); - u.ugold -= q; - otmp->quan = q; - otmp->owt = weight(otmp); - context.botl = 1; - return(otmp); -} - -/* used for container apply/#loot and multi-item Drop */ -struct obj * -insert_gold_into_invent(keep_on_status_line) -boolean keep_on_status_line; -{ - struct obj *u_gold = 0; - - if (u.ugold) { - u_gold = mkgoldobj(u.ugold); - if (keep_on_status_line) { - u_gold->in_use = 1; /* in case of panic/hangup save */ - u.ugold = u_gold->quan; /* put back on status line */ - } /* else mkgoldobj() left status $:0 */ - assigninvlet(u_gold); /* should yield '$' */ - u_gold->where = OBJ_INVENT; - u_gold->nobj = invent; - invent = u_gold; - } - return u_gold; -} - -/* undo insert_gold_into_invent; gold might have been used up though */ -void -remove_gold_from_invent() -{ - struct obj *u_gold = invent; /* we expect gold to be first */ - - if (u_gold && u_gold->otyp != GOLD_PIECE) - u_gold = carrying(GOLD_PIECE); - - if (u_gold) { - extract_nobj(u_gold, &invent); - if (!u_gold->in_use) u.ugold += u_gold->quan; - dealloc_obj(u_gold); - } -} -#endif /* !GOLDOBJ */ - STATIC_OVL void compactify(buf) register char *buf; @@ -802,10 +733,8 @@ const char *action; * struct obj *xxx: object to do something with. * (struct obj *) 0 error return: no object. * &zeroobj explicitly no object (as in w-). -#ifdef GOLDOBJ !!!! test if gold can be used in unusual ways (eaten etc.) !!!! may be able to remove "usegold" -#endif */ struct obj * getobj(let,word) @@ -819,10 +748,6 @@ register const char *let,*word; register char *bp = buf; xchar allowcnt = 0; /* 0, 1 or 2 */ struct obj *firstobj = invent; -#ifndef GOLDOBJ - struct obj *u_gold = 0; - boolean allowgold = FALSE; /* can't use gold because they don't have any */ -#endif boolean usegold = FALSE; /* can't use gold because its illegal */ boolean allowall = FALSE; boolean allownone = FALSE; @@ -833,22 +758,13 @@ register const char *let,*word; long dummymask; if(*let == ALLOW_COUNT) let++, allowcnt = 1; -#ifndef GOLDOBJ - if(*let == COIN_CLASS) let++, - usegold = TRUE, allowgold = (u.ugold ? TRUE : FALSE); -#else if(*let == COIN_CLASS) let++, usegold = TRUE; -#endif /* Equivalent of an "ugly check" for gold */ if (usegold && !strcmp(word, "eat") && (!metallivorous(youmonst.data) || youmonst.data == &mons[PM_RUST_MONSTER])) -#ifndef GOLDOBJ - usegold = allowgold = FALSE; -#else usegold = FALSE; -#endif if(*let == ALL_CLASSES) let++, allowall = TRUE; if(*let == ALLOW_NONE) let++, allownone = TRUE; @@ -866,17 +782,6 @@ register const char *let,*word; useboulder = TRUE; if(allownone) *bp++ = '-'; -#ifndef GOLDOBJ - if(allowgold) { - *bp++ = def_oc_syms[COIN_CLASS].sym; - if (firstobj && firstobj->otyp == GOLD_PIECE) { - /* gold has been inserted into inventory; skip it during - inventory letter collection */ - u_gold = firstobj; - firstobj = u_gold->nobj; - } - } -#endif if(bp > buf && bp[-1] == '-') *bp++ = ' '; ap = altlets; @@ -891,9 +796,7 @@ register const char *let,*word; } if (!*let || index(let, otmp->oclass) -#ifdef GOLDOBJ || (usegold && otmp->invlet == GOLD_SYM) -#endif || (useboulder && otmp->otyp == BOULDER) ) { register int otyp = otmp->otyp; @@ -1010,11 +913,7 @@ register const char *let,*word; compactify(bp); *ap = '\0'; -#ifndef GOLDOBJ - if(!foo && !allowall && !allowgold && !allownone) { -#else if(!foo && !allowall && !allownone) { -#endif You("don't have anything %sto %s.", foox ? "else " : "", word); return((struct obj *)0); @@ -1070,11 +969,6 @@ register const char *let,*word; if (!usegold) { You("cannot %s gold.", word); return(struct obj *)0; -#ifndef GOLDOBJ - } else if (!allowgold) { - You("are not carrying any gold."); - return(struct obj *)0; -#endif } /* Historic note: early Nethack had a bug which was * first reported for Larn, where trying to drop 2^32-n @@ -1089,15 +983,6 @@ register const char *let,*word; return (struct obj *)0; } -#ifndef GOLDOBJ - if(!(allowcnt == 2 && cnt < u.ugold)) - cnt = u.ugold; - if (!u_gold) - u_gold = mkgoldobj(cnt); - else if (cnt < u_gold->quan) - u_gold = splitobj(u_gold, cnt); - return u_gold; -#endif } if(ilet == '?' || ilet == '*') { char *allowed_choices = (ilet == '?') ? lets : (char *)0; @@ -1124,9 +1009,7 @@ register const char *let,*word; /* permit counts for throwing gold, but don't accept * counts for other things since the throw code will * split off a single item anyway */ -#ifdef GOLDOBJ if (ilet != def_oc_syms[COIN_CLASS].sym) -#endif allowcnt = 1; if(cnt == 0 && prezero) return((struct obj *)0); if(cnt > 1) { @@ -1134,9 +1017,7 @@ register const char *let,*word; continue; } } -#ifdef GOLDOBJ context.botl = 1; /* May have changed the amount of money */ -#endif #ifdef REDO savech(ilet); #endif @@ -1159,9 +1040,7 @@ register const char *let,*word; break; } if(!allowall && let && !index(let,otmp->oclass) -#ifdef GOLDOBJ && !(usegold && otmp->oclass == COIN_CLASS) -#endif ) { silly_thing(word, otmp); return((struct obj *)0); @@ -1289,25 +1168,14 @@ unsigned *resultflags; boolean FDECL((*filter),(OBJ_P)) = (boolean FDECL((*),(OBJ_P))) 0; boolean takeoff, ident, allflag, m_seen; int itemcount; -#ifndef GOLDOBJ - int oletct, iletct, allowgold, unpaid, oc_of_sym; -#else int oletct, iletct, unpaid, oc_of_sym; -#endif char sym, *ip, olets[MAXOCLASSES+5], ilets[MAXOCLASSES+5]; char extra_removeables[3+1]; /* uwep,uswapwep,uquiver */ char buf[BUFSZ], qbuf[QBUFSZ]; if (resultflags) *resultflags = 0; -#ifndef GOLDOBJ - allowgold = (u.ugold && !strcmp(word, "drop")) ? 1 : 0; -#endif takeoff = ident = allflag = m_seen = FALSE; -#ifndef GOLDOBJ - if(!invent && !allowgold){ -#else if(!invent){ -#endif You("have nothing to %s.", word); return(0); } @@ -1322,9 +1190,6 @@ unsigned *resultflags; iletct = collect_obj_classes(ilets, invent, FALSE, -#ifndef GOLDOBJ - (allowgold != 0), -#endif filter, &itemcount); unpaid = count_unpaid(invent); @@ -1397,15 +1262,7 @@ unsigned *resultflags; } if (oc_of_sym == COIN_CLASS && !combo) { -#ifndef GOLDOBJ - if (allowgold == 1) - (*fn)(mkgoldobj(u.ugold)); - else if (!u.ugold) - You("have no gold."); - allowgold = 2; -#else context.botl = 1; -#endif } else if (sym == 'a') { allflag = TRUE; } else if (sym == 'A') { @@ -1442,16 +1299,10 @@ unsigned *resultflags; return (allflag || (!oletct && ckfn != ckunpaid)) ? -2 : -3; else if (flags.menu_style != MENU_TRADITIONAL && combo && !allflag) return 0; -#ifndef GOLDOBJ - else if (allowgold == 2 && !oletct) - return 1; /* you dropped gold (or at least tried to) */ - else { -#else else /*!!!! if (allowgold == 2 && !oletct) !!!! return 1; you dropped gold (or at least tried to) !!!! test gold dropping else*/ { -#endif int cnt = askchain(&invent, olets, allflag, fn, ckfn, mx, word); /* * askchain() has already finished the job in this case @@ -1728,10 +1579,6 @@ STATIC_OVL char obj_to_let(obj) /* should of course only be called for things in invent */ register struct obj *obj; { -#ifndef GOLDOBJ - if (obj->oclass == COIN_CLASS) - return GOLD_SYM; -#endif if (!flags.invlet_constant) { obj->invlet = NOINVSYM; reassign(); @@ -1787,11 +1634,6 @@ long quan; /* if non-0, print this quantity, not obj->quan */ Sprintf(li, "%c - %-45s %6ld %s", (dot && use_invlet ? obj->invlet : let), (txt ? txt : doname(obj)), cost, currency(cost)); -#ifndef GOLDOBJ - } else if (obj && obj->oclass == COIN_CLASS) { - Sprintf(li, "%ld gold piece%s%s", obj->quan, plur(obj->quan), - (dot ? "." : "")); -#endif } else { /* ordinary inventory display or pickup message */ Sprintf(li, "%c - %s%s", @@ -1885,11 +1727,7 @@ long* out_cnt; to here is short circuited away. */ if (!invent && !(flags.perm_invent && !lets && !want_reply)) { -#ifndef GOLDOBJ - pline("Not carrying anything%s.", u.ugold ? " except gold" : ""); -#else pline("Not carrying anything."); -#endif return 0; } @@ -2219,11 +2057,7 @@ dotypeinv() boolean traditional = TRUE; const char *prompt = "What type of object do you want an inventory of?"; -#ifndef GOLDOBJ - if (!invent && !u.ugold && !billx) { -#else if (!invent && !billx) { -#endif You("aren't carrying anything."); return 0; } @@ -2245,9 +2079,6 @@ dotypeinv() types[0] = 0; class_count = collect_obj_classes(types, invent, FALSE, -#ifndef GOLDOBJ - (u.ugold != 0), -#endif (boolean FDECL((*),(OBJ_P))) 0, &itemcount); if (unpaid_count) { Strcat(types, "u"); @@ -2592,10 +2423,8 @@ mergable(otmp, obj) /* returns TRUE if obj & otmp can be merged */ { int objnamelth = 0, otmpnamelth = 0; if (obj->otyp != otmp->otyp) return FALSE; -#ifdef GOLDOBJ /* coins of the same kind will always merge */ if (obj->oclass == COIN_CLASS) return TRUE; -#endif if (obj->unpaid != otmp->unpaid || obj->spe != otmp->spe || obj->dknown != otmp->dknown || (obj->bknown != otmp->bknown && !Role_if(PM_PRIEST)) || @@ -2676,18 +2505,11 @@ doprgold() { /* the messages used to refer to "carrying gold", but that didn't take containers into account */ -#ifndef GOLDOBJ - if(!u.ugold) - Your("wallet is empty."); - else - Your("wallet contains %ld gold piece%s.", u.ugold, plur(u.ugold)); -#else long umoney = money_cnt(invent); if(!umoney) Your("wallet is empty."); else Your("wallet contains %ld %s.", umoney, currency(umoney)); -#endif shopper_financial_report(); return 0; } @@ -2915,17 +2737,13 @@ reassign() register struct obj *obj; for(obj = invent, i = 0; obj; obj = obj->nobj, i++) { -#ifdef GOLDOBJ if (obj->oclass == COIN_CLASS && obj->invlet == GOLD_SYM) --i; /* keep $ instead of using up i'th letter */ else -#endif if (i < 52) obj->invlet = (i < 26) ? ('a'+i) : ('A'+i-26); -#ifdef GOLDOBJ else if (obj->oclass == COIN_CLASS) obj->invlet = GOLD_SYM; -#endif else obj->invlet = NOINVSYM; } @@ -2969,7 +2787,6 @@ doorganize() /* inventory organizer by Del Lamb */ const char *adj_type; if (!invent) { - /* (we don't need any !GOLDOBJ check for "except gold" here) */ You("aren't carrying anything to adjust."); return 0; } @@ -3178,20 +2995,12 @@ int dflags; char *title; { struct obj *ret; -#ifndef GOLDOBJ - struct obj m_gold; -#endif char tmp[QBUFSZ]; int n; menu_item *selected = 0; int do_all = (dflags & MINV_ALL) != 0, incl_hero = (do_all && u.uswallow && mon == u.ustuck), -#ifndef GOLDOBJ - do_gold = (do_all && mon->mgold), - have_inv = (mon->minvent || do_gold), -#else have_inv = (mon->minvent != 0), -#endif have_any = (have_inv || incl_hero); Sprintf(tmp,"%s %s:", s_suffix(noit_Monnam(mon)), @@ -3203,34 +3012,12 @@ char *title; */ youmonst.data = mon->data; -#ifndef GOLDOBJ - if (do_gold) { - /* - * Make temporary gold object and insert at the head of - * the mon's inventory. We can get away with using a - * stack variable object because monsters don't carry - * gold in their inventory, so it won't merge. - */ - m_gold = zeroobj; - m_gold.otyp = GOLD_PIECE; m_gold.oclass = COIN_CLASS; - m_gold.quan = mon->mgold; m_gold.dknown = 1; - m_gold.where = OBJ_FREE; - /* we had better not merge and free this object... */ - if (add_to_minv(mon, &m_gold)) - panic("display_minventory: static object freed."); - } - -#endif n = query_objlist(title ? title : tmp, mon->minvent, INVORDER_SORT | (incl_hero ? INCLUDE_HERO : 0), &selected, (dflags & MINV_NOLET) ? PICK_NONE : PICK_ONE, do_all ? allow_all : worn_wield_only); -#ifndef GOLDOBJ - if (do_gold) obj_extract_self(&m_gold); -#endif - set_uasmon(); } else { invdisp_nothing(title ? title : tmp, "(none)"); @@ -3240,14 +3027,6 @@ char *title; if (n > 0) { ret = selected[0].item.a_obj; free((genericptr_t)selected); -#ifndef GOLDOBJ - /* - * Unfortunately, we can't return a pointer to our temporary - * gold object. We'll have to work out a scheme where this - * can happen. Maybe even put gold in the inventory list... - */ - if (ret == &m_gold) ret = (struct obj *) 0; -#endif } else ret = (struct obj *) 0; return ret; diff --git a/src/makemon.c b/src/makemon.c index 0f2d0c41c..9b63c72ec 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -454,7 +454,6 @@ register struct monst *mtmp; (void) mongets(mtmp, rnd_offensive_item(mtmp)); } -#ifdef GOLDOBJ /* * Makes up money for monster's inventory. * This will change with silver & copper coins @@ -468,7 +467,6 @@ long amount; gold->quan = amount; add_to_minv(mtmp, gold); } -#endif STATIC_OVL void m_initinv(mtmp) @@ -555,11 +553,7 @@ register struct monst *mtmp; rn2(3) ? CLOAK_OF_PROTECTION : CLOAK_OF_MAGIC_RESISTANCE); (void) mongets(mtmp, SMALL_SHIELD); -#ifndef GOLDOBJ - mtmp->mgold = (long)rn1(10,20); -#else mkmonmoney(mtmp,(long)rn1(10,20)); -#endif } else if (quest_mon_represents_role(ptr,PM_MONK)) { (void) mongets(mtmp, rn2(11) ? ROBE : CLOAK_OF_MAGIC_RESISTANCE); @@ -613,11 +607,7 @@ register struct monst *mtmp; } break; case S_LEPRECHAUN: -#ifndef GOLDOBJ - mtmp->mgold = (long) d(level_difficulty(), 30); -#else mkmonmoney(mtmp, (long) d(level_difficulty(), 30)); -#endif break; case S_DEMON: /* moved here from m_initweap() because these don't @@ -640,14 +630,8 @@ register struct monst *mtmp; (void) mongets(mtmp, rnd_defensive_item(mtmp)); if ((int) mtmp->m_lev > rn2(100)) (void) mongets(mtmp, rnd_misc_item(mtmp)); -#ifndef GOLDOBJ - if (likes_gold(ptr) && !mtmp->mgold && !rn2(5)) - mtmp->mgold = - (long) d(level_difficulty(), mtmp->minvent ? 5 : 10); -#else if (likes_gold(ptr) && !findgold(mtmp->minvent) && !rn2(5)) mkmonmoney(mtmp, (long) d(level_difficulty(), mtmp->minvent ? 5 : 10)); -#endif } /* Note: for long worms, always call cutworm (cutworm calls clone_mon) */ @@ -691,9 +675,6 @@ xchar x, y; /* clone's preferred location or 0 (near mon) */ m2->mcloned = 1; m2->minvent = (struct obj *) 0; /* objects don't clone */ m2->mleashed = FALSE; -#ifndef GOLDOBJ - m2->mgold = 0L; -#endif /* Max HP the same, but current HP halved for both. The caller * might want to override this by halving the max HP also. * When current HP is odd, the original keeps the extra point. diff --git a/src/mhitm.c b/src/mhitm.c index a749cfd4d..0e8bf7d1c 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1050,14 +1050,6 @@ mdamagem(magr, mdef, mattk) break; case AD_SGLD: tmp = 0; -#ifndef GOLDOBJ - if (magr->mcan || !mdef->mgold) break; - /* technically incorrect; no check for stealing gold from - * between mdef's feet... - */ - magr->mgold += mdef->mgold; - mdef->mgold = 0; -#else if (magr->mcan) break; /* technically incorrect; no check for stealing gold from * between mdef's feet... @@ -1068,7 +1060,6 @@ mdamagem(magr, mdef, mattk) obj_extract_self(gold); add_to_minv(magr, gold); } -#endif mdef->mstrategy &= ~STRAT_WAITFORU; if (vis) { Strcpy(buf, Monnam(magr)); diff --git a/src/mhitu.c b/src/mhitu.c index ad68b2d31..511513f39 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -2430,27 +2430,6 @@ register struct monst *mon; pline("%s tries to take your money, but fails...", noit_Monnam(mon)); else { -#ifndef GOLDOBJ - long cost; - - if (u.ugold > (long)LARGEST_INT - 10L) - cost = (long) rnd(LARGEST_INT) + 500L; - else - cost = (long) rnd((int)u.ugold + 10) + 500L; - if (mon->mpeaceful) { - cost /= 5L; - if (!cost) cost = 1L; - } - if (cost > u.ugold) cost = u.ugold; - if (!cost) verbalize("It's on the house!"); - else { - pline("%s takes %ld %s for services rendered!", - noit_Monnam(mon), cost, currency(cost)); - u.ugold -= cost; - mon->mgold += cost; - context.botl = 1; - } -#else long cost; long umoney = money_cnt(invent); @@ -2470,7 +2449,6 @@ register struct monst *mon; money2mon(mon, cost); context.botl = 1; } -#endif } if (!rn2(25)) mon->mcan = 1; /* monster is worn out */ if (!tele_restrict(mon)) (void) rloc(mon, FALSE); diff --git a/src/minion.c b/src/minion.c index f70b426b7..814bb21b5 100644 --- a/src/minion.c +++ b/src/minion.c @@ -236,11 +236,7 @@ register struct monst *mtmp; if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE); return(1); } -#ifndef GOLDOBJ - cash = u.ugold; -#else cash = money_cnt(invent); -#endif demand = (cash * (rnd(80) + 20 * Athome)) / (100 * (1 + (sgn(u.ualign.type) == sgn(mtmp->data->maligntyp)))); @@ -281,9 +277,7 @@ struct monst *mtmp; { char buf[BUFSZ]; long offer; -#ifdef GOLDOBJ long umoney = money_cnt(invent); -#endif getlin("How much will you offer?", buf); if (sscanf(buf, "%ld", &offer) != 1) offer = 0L; @@ -297,16 +291,6 @@ struct monst *mtmp; } else if (offer == 0L) { You("refuse."); return 0L; -#ifndef GOLDOBJ - } else if (offer >= u.ugold) { - You("give %s all your gold.", mon_nam(mtmp)); - offer = u.ugold; - } else { - You("give %s %ld %s.", mon_nam(mtmp), offer, currency(offer)); - } - u.ugold -= offer; - mtmp->mgold += offer; -#else } else if (offer >= umoney) { You("give %s all your gold.", mon_nam(mtmp)); offer = umoney; @@ -314,7 +298,6 @@ struct monst *mtmp; You("give %s %ld %s.", mon_nam(mtmp), offer, currency(offer)); } (void) money2mon(mtmp, offer); -#endif context.botl = 1; return(offer); } diff --git a/src/mkobj.c b/src/mkobj.c index 253fd1293..47b6668e7 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -1037,9 +1037,7 @@ register struct obj *otmp; { int old_light = 0; -#ifdef GOLDOBJ if (otmp->oclass == COIN_CLASS) return; -#endif if (otmp->lamplit) old_light = arti_light_radius(otmp); otmp->cursed = 0; otmp->blessed = 1; @@ -1074,9 +1072,7 @@ register struct obj *otmp; { int old_light = 0; -#ifdef GOLDOBJ if (otmp->oclass == COIN_CLASS) return; -#endif if (otmp->lamplit) old_light = arti_light_radius(otmp); otmp->blessed = 0; otmp->cursed = 1; @@ -1351,10 +1347,6 @@ struct monst *mtmp; mtmp2->data = (struct permonst *)0; mtmp2->minvent = (struct obj *)0; if (mtmp->mextra) copy_mextra(mtmp2, mtmp); -#ifndef GOLDOBJ - /* not a pointer but is discarded along with minvent */ - mtmp2->mgold = 0L; -#endif } return obj; } diff --git a/src/mon.c b/src/mon.c index d65eb1cf9..0de59cf8a 100644 --- a/src/mon.c +++ b/src/mon.c @@ -826,13 +826,8 @@ mpickgold(mtmp) if ((gold = g_at(mtmp->mx, mtmp->my)) != 0) { mat_idx = objects[gold->otyp].oc_material; -#ifndef GOLDOBJ - mtmp->mgold += gold->quan; - delobj(gold); -#else obj_extract_self(gold); add_to_minv(mtmp, gold); -#endif if (cansee(mtmp->mx, mtmp->my) ) { if (flags.verbose && !mtmp->isgd) pline("%s picks up some %s.", Monnam(mtmp), @@ -1731,9 +1726,6 @@ register struct monst *mdef; mdrop_special_objs(mdef); /* release rest of monster's inventory--it is removed from game */ discard_minvent(mdef); -#ifndef GOLDOBJ - mdef->mgold = 0L; -#endif m_detach(mdef, mdef->data); } @@ -1789,16 +1781,6 @@ register struct monst *mdef; oldminvent = obj->nobj; (void) add_to_container(otmp, obj); } -#ifndef GOLDOBJ - if (mdef->mgold) { - struct obj *au; - au = mksobj(GOLD_PIECE, FALSE, FALSE); - au->quan = mdef->mgold; - au->owt = weight(au); - (void) add_to_container(otmp, au); - mdef->mgold = 0; - } -#endif /* Archeologists should not break unique statues */ if (mdef->data->geno & G_UNIQ) otmp->spe = 1; diff --git a/src/monmove.c b/src/monmove.c index 490f7faa0..316018e52 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -477,13 +477,8 @@ toofar: if(!nearby || mtmp->mflee || scared || mtmp->mconf || mtmp->mstun || (mtmp->minvis && !rn2(3)) || -#ifndef GOLDOBJ - (mdat->mlet == S_LEPRECHAUN && - !u.ugold && (mtmp->mgold || rn2(2))) || -#else (mdat->mlet == S_LEPRECHAUN && !findgold(invent) && (findgold(mtmp->minvent) || rn2(2))) || -#endif (is_wanderer(mdat) && !rn2(4)) || (Conflict && !mtmp->iswiz) || (!mtmp->mcansee && !rn2(4)) || mtmp->mpeaceful) { /* Possibly cast an undirected spell if not attacking you */ @@ -765,9 +760,7 @@ not_special: if (mtmp->mconf || (u.uswallow && mtmp == u.ustuck)) appr = 0; else { -#ifdef GOLDOBJ struct obj *lepgold, *ygold; -#endif boolean should_see = (couldsee(omx, omy) && (levl[gx][gy].lit || !levl[omx][omy].lit) && @@ -783,12 +776,8 @@ not_special: appr = 0; if(monsndx(ptr) == PM_LEPRECHAUN && (appr == 1) && -#ifndef GOLDOBJ - (mtmp->mgold > u.ugold)) -#else ( (lepgold = findgold(mtmp->minvent)) && (lepgold->quan > ((ygold = findgold(invent)) ? ygold->quan : 0L)) )) -#endif appr = -1; if (!should_see && can_track(ptr)) { @@ -1320,9 +1309,7 @@ register struct monst *mtmp; { boolean notseen, gotu; register int disp, mx = mtmp->mux, my = mtmp->muy; -#ifdef GOLDOBJ long umoney = money_cnt(invent); -#endif /* * do cheapest and/or most likely tests first @@ -1340,13 +1327,7 @@ register struct monst *mtmp; if (notseen || Underwater) { /* Xorns can smell quantities of valuable metal like that in solid gold coins, treat as seen */ - if ((mtmp->data == &mons[PM_XORN]) && -#ifndef GOLDOBJ - u.ugold -#else - umoney -#endif - && !Underwater) + if ((mtmp->data == &mons[PM_XORN]) && umoney && !Underwater) disp = 0; else disp = 1; @@ -1433,22 +1414,14 @@ struct monst *mtmp; struct obj *chain, *obj; if (mtmp == &youmonst) { -#ifndef GOLDOBJ - if (u.ugold > 100L) return TRUE; -#endif chain = invent; } else { -#ifndef GOLDOBJ - if (mtmp->mgold > 100L) return TRUE; -#endif chain = mtmp->minvent; } for (obj = chain; obj; obj = obj->nobj) { int typ = obj->otyp; -#ifdef GOLDOBJ if (typ == COIN_CLASS && obj->quan > 100L) return TRUE; -#endif if (obj->oclass != GEM_CLASS && !(typ >= ARROW && typ <= BOOMERANG) && !(typ >= DAGGER && typ <= CRYSKNIFE) && diff --git a/src/mplayer.c b/src/mplayer.c index c2b7f23f8..e1cc0f812 100644 --- a/src/mplayer.c +++ b/src/mplayer.c @@ -260,11 +260,7 @@ register boolean special; (void)mongets(mtmp, rnd_class(DILITHIUM_CRYSTAL, JADE)); /* To get the gold "right" would mean a player can double his */ /* gold supply by killing one mplayer. Not good. */ -#ifndef GOLDOBJ - mtmp->mgold = rn2(1000); -#else mkmonmoney(mtmp, rn2(1000)); -#endif quan = rn2(10); while(quan--) (void) mpickobj(mtmp, mkobj(RANDOM_CLASS, FALSE)); diff --git a/src/objnam.c b/src/objnam.c index 824398123..321d7ff29 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -930,10 +930,8 @@ boolean not_fully_identified(otmp) register struct obj *otmp; { -#ifdef GOLDOBJ /* gold doesn't have any interesting attributes [yet?] */ if (otmp->oclass == COIN_CLASS) return FALSE; /* always fully ID'd */ -#endif /* check fundamental ID hallmarks first */ if (!otmp->known || !otmp->dknown || #ifdef MAIL @@ -2592,15 +2590,9 @@ struct obj *no_wish; !strcmpi(bp, "coin") || *bp == GOLD_SYM) { if (cnt > 5000 && !wizard) cnt = 5000; else if (cnt < 1) cnt = 1; -#ifndef GOLDOBJ - pline("%d gold piece%s.", cnt, plur(cnt)); - u.ugold += (long) cnt; - otmp = &zeroobj; /* readobjnam()'s return value for gold */ -#else otmp = mksobj(GOLD_PIECE, FALSE, FALSE); otmp->quan = (long) cnt; otmp->owt = weight(otmp); -#endif context.botl = 1; return otmp; } diff --git a/src/options.c b/src/options.c index 9083ae63e..dc8cbcfc2 100644 --- a/src/options.c +++ b/src/options.c @@ -909,12 +909,7 @@ char *op; char *sp, buf[BUFSZ]; num = 0; -#ifndef GOLDOBJ - if (!index(op, GOLD_SYM)) - buf[num++] = COIN_CLASS; -#else /* !!!! probably unnecessary with gold as normal inventory */ -#endif for (sp = op; *sp; sp++) { oc_sym = def_char_to_objclass(*sp); diff --git a/src/pickup.c b/src/pickup.c index bbc9a925d..30188e5f2 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -12,13 +12,8 @@ #define CONTAINED_SYM '>' /* from invent.c */ STATIC_DCL void FDECL(simple_look, (struct obj *,BOOLEAN_P)); -#ifndef GOLDOBJ -STATIC_DCL boolean FDECL(query_classes, (char *,boolean *,boolean *, - const char *,struct obj *,BOOLEAN_P,BOOLEAN_P,int *)); -#else STATIC_DCL boolean FDECL(query_classes, (char *,boolean *,boolean *, const char *,struct obj *,BOOLEAN_P,int *)); -#endif STATIC_DCL boolean FDECL(fatal_corpse_mistake, (struct obj *,BOOLEAN_P)); STATIC_DCL void FDECL(check_here, (BOOLEAN_P)); STATIC_DCL boolean FDECL(n_or_more, (struct obj *)); @@ -101,15 +96,6 @@ boolean here; /* flag for type of obj list linkage */ } } -#ifndef GOLDOBJ -int -collect_obj_classes(ilets, otmp, here, incl_gold, filter, itemcount) -char ilets[]; -register struct obj *otmp; -boolean here, incl_gold; -boolean FDECL((*filter),(OBJ_P)); -int *itemcount; -#else int collect_obj_classes(ilets, otmp, here, filter, itemcount) char ilets[]; @@ -117,16 +103,11 @@ register struct obj *otmp; boolean here; boolean FDECL((*filter),(OBJ_P)); int *itemcount; -#endif { register int iletct = 0; register char c; *itemcount = 0; -#ifndef GOLDOBJ - if (incl_gold) - ilets[iletct++] = def_oc_syms[COIN_CLASS].sym; -#endif ilets[iletct] = '\0'; /* terminate ilets so that index() will work */ while (otmp) { c = def_oc_syms[(int)otmp->oclass].sym; @@ -151,17 +132,6 @@ int *itemcount; * "?/a" or "a?/" or "/a?",&c picks all '?' even though no '/' * (ie, treated as if it had just been "?a"). */ -#ifndef GOLDOBJ -STATIC_OVL boolean -query_classes(oclasses, one_at_a_time, everything, action, objs, - here, incl_gold, menu_on_demand) -char oclasses[]; -boolean *one_at_a_time, *everything; -const char *action; -struct obj *objs; -boolean here, incl_gold; -int *menu_on_demand; -#else STATIC_OVL boolean query_classes(oclasses, one_at_a_time, everything, action, objs, here, menu_on_demand) @@ -171,7 +141,6 @@ const char *action; struct obj *objs; boolean here; int *menu_on_demand; -#endif { char ilets[20], inbuf[BUFSZ]; int iletct, oclassct; @@ -183,9 +152,6 @@ int *menu_on_demand; oclasses[oclassct = 0] = '\0'; *one_at_a_time = *everything = m_seen = FALSE; iletct = collect_obj_classes(ilets, objs, here, -#ifndef GOLDOBJ - incl_gold, -#endif (boolean FDECL((*),(OBJ_P))) 0, &itemcount); if (iletct == 0) { return FALSE; @@ -578,9 +544,6 @@ menu_pickup: if (!query_classes(oclasses, &selective, &all_of_a_type, "pick up", objchain, traverse_how == BY_NEXTHERE, -#ifndef GOLDOBJ - FALSE, -#endif &via_menu)) { if (!via_menu) return (0); n = query_objlist("Pick up what?", @@ -1096,11 +1059,7 @@ int *wt_before, *wt_after; savequan = obj->quan; saveowt = obj->owt; -#ifndef GOLDOBJ - umoney = u.ugold; -#else umoney = money_cnt(invent); -#endif iw = max_capacity(); if (count != savequan) { @@ -1324,53 +1283,6 @@ boolean telekinesis; /* not picking it up directly by hand */ return 0; } else if (obj->oartifact && !touch_artifact(obj,&youmonst)) { return 0; -#ifndef GOLDOBJ - } else if (obj->oclass == COIN_CLASS) { - /* Special consideration for gold pieces... */ - long iw = (long)max_capacity() - GOLD_WT(u.ugold); - long gold_capacity = GOLD_CAPACITY(iw, u.ugold); - const char *where = (obj->ox == u.ux && obj->oy == u.uy) ? - "here" : "there"; - - if (gold_capacity <= 0L) { - pline( - "There %s %ld gold piece%s %s, but you cannot carry any more.", - otense(obj, "are"), - obj->quan, plur(obj->quan), where); - return 0; - } else if (gold_capacity < count) { - You("can only %s %s of the %ld gold pieces lying %s.", - telekinesis ? "acquire" : "carry", - gold_capacity == 1L ? "one" : "some", obj->quan, where); - pline("%s %ld gold piece%s.", - nearloadmsg, gold_capacity, plur(gold_capacity)); - u.ugold += gold_capacity; - obj->quan -= gold_capacity; - costly_gold(obj->ox, obj->oy, gold_capacity); - } else { - u.ugold += count; - if (count == obj->quan) - /* costly_gold() can trigger --More-- prompt, so - take gold off map before messages in order to - prevent hangup save there from duplicating it */ - obj_extract_self(obj); /* remove from floor */ - else - obj->quan -= count; - if ((nearload = near_capacity()) != 0) - pline("%s %ld gold piece%s.", - nearload < MOD_ENCUMBER ? - moderateloadmsg : nearloadmsg, - count, plur(count)); - else - prinv((char *) 0, obj, count); - costly_gold(obj->ox, obj->oy, count); - if (obj->where == OBJ_FREE) - delobj(obj); - } - context.botl = 1; - if (context.run) nomul(0); - return 1; -#endif } else if (obj->otyp == CORPSE) { if (fatal_corpse_mistake(obj, telekinesis) || rider_corpse_revival(obj, telekinesis)) @@ -1395,10 +1307,8 @@ boolean telekinesis; /* not picking it up directly by hand */ if ((res = lift_object(obj, (struct obj *)0, &count, telekinesis)) <= 0) return res; -#ifdef GOLDOBJ /* Whats left of the special case for gold :-) */ if (obj->oclass == COIN_CLASS) context.botl = 1; -#endif if (obj->quan != count && obj->otyp != LOADSTONE) obj = splitobj(obj, count); @@ -1417,8 +1327,6 @@ boolean telekinesis; /* not picking it up directly by hand */ * and putting it in the hero's inventory. Take care of billing. Return a * pointer to the object where otmp ends up. This may be different * from otmp because of merging. - * - * Gold never reaches this routine unless GOLDOBJ is defined. */ struct obj * pick_obj(otmp) @@ -1703,12 +1611,6 @@ reverse_loot() return FALSE; } -#ifndef GOLDOBJ - if (u.ugold) { - contribution = ((long)rnd(5) * u.ugold + 4L) / 5L; - goldob = mkgoldobj(contribution); - } -#else /* find a money object to mess with */ for (goldob = invent; goldob; goldob = goldob->nobj) if (goldob->oclass == COIN_CLASS) { @@ -1717,7 +1619,6 @@ reverse_loot() goldob = splitobj(goldob, contribution); break; } -#endif if (!goldob) return FALSE; if (!IS_THRONE(levl[x][y].typ)) { @@ -1738,9 +1639,7 @@ reverse_loot() if (coffers) { verbalize("Thank you for your contribution to reduce the debt."); -#ifdef GOLDOBJ freeinv(goldob); -#endif (void)add_to_container(coffers, goldob); coffers->owt = weight(coffers); coffers->cknown = 0; @@ -1749,13 +1648,8 @@ reverse_loot() (void)boxlock(coffers, &boxdummy); } } else if ((mon = makemon(courtmon(), x, y, NO_MM_FLAGS)) != 0) { -#ifndef GOLDOBJ - mon->mgold += goldob->quan; - delobj(goldob); -#else freeinv(goldob); add_to_minv(mon, goldob); -#endif pline("The exchequer accepts your contribution."); } else { You("drop %s.", doname(goldob)); @@ -2048,9 +1942,6 @@ register struct obj *obj; otmp, count); if (is_gold) { -#ifndef GOLDOBJ - dealloc_obj(obj); -#endif bot(); /* update character's gold piece count immediately */ } return 1; @@ -2167,9 +2058,6 @@ struct obj **objp; int held; { struct obj *curr, *otmp, *obj = *objp; -#ifndef GOLDOBJ - struct obj *u_gold = (struct obj *)0; -#endif boolean quantum_cat, cursed_mbag, loot_out, loot_in, loot_in_first, stash_one, inokay, outokay, outmaybe; @@ -2233,9 +2121,6 @@ int held; } inokay = (invent != 0 && !(invent == current_container && !current_container->nobj)); -#ifndef GOLDOBJ - if (u.ugold) inokay = TRUE; -#endif outokay = Has_contents(current_container); if (!outokay) /* preformat the empty-container message */ Sprintf(emptymsg, "%s is %sempty.", @@ -2330,11 +2215,6 @@ int held; } } -#ifndef GOLDOBJ - /* if putting in, place gold where inventory traversal will see it */ - if ((loot_in || stash_one) && u.ugold) - u_gold = insert_gold_into_invent(TRUE); -#endif if ((loot_in || stash_one) && (!invent || (invent == current_container && !invent->nobj))) { You("don't have anything%s to %s.", @@ -2370,11 +2250,6 @@ int held; /* putting something in might have triggered magic bag explosion */ if (!current_container) loot_out = FALSE; -#ifndef GOLDOBJ - /* if we put gold into inventory above, take it back out now */ - if (u_gold) remove_gold_from_invent(); -#endif - /* out after in */ if (loot_out && loot_in_first) { if (!Has_contents(current_container)) { @@ -2432,9 +2307,6 @@ boolean put_in; if (query_classes(selection, &one_by_one, &allflag, action, *objlist, FALSE, -#ifndef GOLDOBJ - put_in ? (boolean)(u.ugold != 0L) : FALSE, -#endif &menu_on_request)) { if (askchain(objlist, (one_by_one ? (char *)0 : selection), allflag, actionfunc, checkfunc, 0, action)) diff --git a/src/priest.c b/src/priest.c index 5e3b2ea10..1ef7ea286 100644 --- a/src/priest.c +++ b/src/priest.c @@ -539,20 +539,6 @@ register struct monst *priest; priest->mpeaceful = 0; return; } -#ifndef GOLDOBJ - if(!u.ugold) { - if(coaligned && !strayed) { - if (priest->mgold > 0L) { - /* Note: two bits is actually 25 cents. Hmm. */ - pline("%s gives you %s for an ale.", Monnam(priest), - (priest->mgold == 1L) ? "one bit" : "two bits"); - if (priest->mgold > 1L) - u.ugold = 2L; - else - u.ugold = 1L; - priest->mgold -= u.ugold; - context.botl = 1; -#else if(!money_cnt(invent)) { if(coaligned && !strayed) { long pmoney = money_cnt(priest->minvent); @@ -561,7 +547,6 @@ register struct monst *priest; pline("%s gives you %s for an ale.", Monnam(priest), (pmoney == 1L) ? "one bit" : "two bits"); money2u(priest, pmoney > 1L ? 2 : 1); -#endif } else pline("%s preaches the virtues of poverty.", Monnam(priest)); exercise(A_WIS, TRUE); @@ -577,11 +562,7 @@ register struct monst *priest; verbalize("Thou shalt regret thine action!"); if(coaligned) adjalign(-1); } else if(offer < (u.ulevel * 200)) { -#ifndef GOLDOBJ - if(u.ugold > (offer * 2L)) verbalize("Cheapskate."); -#else if(money_cnt(invent) > (offer * 2L)) verbalize("Cheapskate."); -#endif else { verbalize("I thank thee for thy contribution."); /* give player some token */ @@ -589,11 +570,7 @@ register struct monst *priest; } } else if(offer < (u.ulevel * 400)) { verbalize("Thou art indeed a pious individual."); -#ifndef GOLDOBJ - if(u.ugold < (offer * 2L)) { -#else if(money_cnt(invent) < (offer * 2L)) { -#endif if (coaligned && u.ualign.record <= ALGN_SINNED) adjalign(1); verbalize("I bestow upon thee a blessing."); @@ -614,11 +591,7 @@ register struct monst *priest; } else u.ublessed++; } else { verbalize("Thy selfless generosity is deeply appreciated."); -#ifndef GOLDOBJ - if(u.ugold < (offer * 2L) && coaligned) { -#else if(money_cnt(invent) < (offer * 2L) && coaligned) { -#endif if(strayed && (moves - u.ucleansed) > 5000L) { u.ualign.record = 0; /* cleanse thee */ u.ucleansed = moves; diff --git a/src/read.c b/src/read.c index b60ffa66e..9be9f9390 100644 --- a/src/read.c +++ b/src/read.c @@ -992,10 +992,8 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */ } else { for (obj = invent; obj; obj = obj->nobj) { long wornmask; -#ifdef GOLDOBJ /* gold isn't subject to cursing and blessing */ if (obj->oclass == COIN_CLASS) continue; -#endif wornmask = (obj->owornmask & ~(W_BALL|W_ART|W_ARTI)); if (wornmask && !sblessed) { /* handle a couple of special cases; we don't diff --git a/src/restore.c b/src/restore.c index e888b4dcd..b4d4bb7fb 100644 --- a/src/restore.c +++ b/src/restore.c @@ -146,17 +146,6 @@ boolean quietly; for (otmp = invent; otmp; otmp = otmp2) { otmp2 = otmp->nobj; -#ifndef GOLDOBJ - if (otmp->oclass == COIN_CLASS) { - /* in_use gold is created by some menu operations */ - if (!otmp->in_use) { - impossible("inven_inuse: !in_use gold in inventory"); - } - extract_nobj(otmp, &invent); - otmp->in_use = FALSE; - dealloc_obj(otmp); - } else -#endif /* GOLDOBJ */ if (otmp->in_use) { if (!quietly) pline("Finishing off %s...", xname(otmp)); useup(otmp); @@ -441,9 +430,6 @@ boolean ghostly; /* restore monster back pointer */ for (obj = mtmp->minvent; obj; obj = obj->nobj) obj->ocarry = mtmp; -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - put_gold_back(mtmp); -#endif } if (mtmp->mw) { struct obj *obj; @@ -598,9 +584,6 @@ unsigned int *stuckid, *steedid; restore_timers(fd, RANGE_GLOBAL, FALSE, 0L); restore_light_sources(fd); invent = restobjchn(fd, FALSE, FALSE); -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - put_gold_back(&youmonst); -#endif /* tmp_bc only gets set here if the ball & chain were orphaned because you were swallowed; otherwise they will be on the floor or in your inventory */ @@ -1571,29 +1554,4 @@ register unsigned int len; } } -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ -/* used to make save & bones files be compatible with GOLDOBJ config; - takes all of the gold objects out of the invent or mtmp->minvent - chain and puts it into either u.ugold or mtmp->mgold */ -void -put_gold_back(mon) -struct monst *mon; -{ - struct obj *goldobj; - boolean is_hero = (mon == &youmonst); - - /* there could be two gold objects in invent if a hangup save was - performed while gold was in invent for Drop or container access */ - while ((goldobj = (is_hero ? carrying(GOLD_PIECE) : - m_carrying(mon, GOLD_PIECE))) != 0) { - extract_nobj(goldobj, is_hero ? &invent : &mon->minvent); - if (!goldobj->in_use) { - if (is_hero) u.ugold += goldobj->quan; - else mon->mgold += goldobj->quan; - } - dealloc_obj(goldobj); - } -} -#endif /*GOLDOBJ*/ - /*restore.c*/ diff --git a/src/rip.c b/src/rip.c index 526c56388..8b3d849a3 100644 --- a/src/rip.c +++ b/src/rip.c @@ -107,11 +107,7 @@ time_t when; center(NAME_LINE, buf); /* Put $ on stone */ -#ifndef GOLDOBJ - Sprintf(buf, "%ld Au", u.ugold); -#else Sprintf(buf, "%ld Au", done_money); -#endif buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */ center(GOLD_LINE, buf); diff --git a/src/rumors.c b/src/rumors.c index 7df89e8f4..081b81d8d 100644 --- a/src/rumors.c +++ b/src/rumors.c @@ -427,11 +427,7 @@ register struct monst *oracl; char qbuf[QBUFSZ]; multi = 0; -#ifndef GOLDOBJ - umoney = u.ugold; -#else umoney = money_cnt(invent); -#endif if (!oracl) { There("is no one here to consult."); @@ -468,12 +464,7 @@ register struct monst *oracl; u_pay = (umoney < (long)major_cost) ? (int)umoney : major_cost; break; } -#ifndef GOLDOBJ - u.ugold -= (long)u_pay; - oracl->mgold += (long)u_pay; -#else money2mon(oracl, (long)u_pay); -#endif context.botl = 1; add_xpts = 0; /* first oracle of each type gives experience points */ if (u_pay == minor_cost) { diff --git a/src/save.c b/src/save.c index dc0f94078..88db771e2 100644 --- a/src/save.c +++ b/src/save.c @@ -306,9 +306,6 @@ register int fd, mode; bwrite(fd, (genericptr_t) &flags, sizeof(struct flag)); #ifdef SYSFLAGS bwrite(fd, (genericptr_t) &sysflags, sizeof(struct sysflag)); -#endif -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - if (u.ugold) (void)insert_gold_into_invent(FALSE); #endif bwrite(fd, (genericptr_t) &u, sizeof(struct you)); bwrite(fd, yyyymmddhhmmss(ubirthday), 14); @@ -319,9 +316,6 @@ register int fd, mode; save_light_sources(fd, mode, RANGE_GLOBAL); saveobjchn(fd, invent, mode); -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - if (!release_data(mode)) remove_gold_from_invent(); -#endif if (BALL_IN_MON) { /* prevent loss of ball & chain when swallowed */ uball->nobj = uchain; @@ -1123,22 +1117,10 @@ register struct monst *mtmp; if (perform_bwrite(mode)) { mtmp->mnum = monsndx(mtmp->data); if (mtmp->ispriest) forget_temple_entry(mtmp); /* EPRI() */ -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - if (mtmp->mgold) { - struct obj *goldobj = mksobj(GOLD_PIECE, FALSE, FALSE); - - goldobj->quan = mtmp->mgold; - mtmp->mgold = 0L; - add_to_minv(mtmp, goldobj); - } -#endif savemon(fd, mtmp); } if (mtmp->minvent) saveobjchn(fd,mtmp->minvent,mode); -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - if (!release_data(mode)) put_gold_back(mtmp); -#endif if (release_data(mode)) dealloc_monst(mtmp); mtmp = mtmp2; diff --git a/src/shk.c b/src/shk.c index 5a397abf5..0fe0e94db 100644 --- a/src/shk.c +++ b/src/shk.c @@ -78,7 +78,6 @@ STATIC_DCL const char *FDECL(cad, (BOOLEAN_P)); */ -#ifdef GOLDOBJ /* Transfer money from inventory to monster when paying shopkeepers, priests, oracle, succubus, & other demons. @@ -153,8 +152,6 @@ long amount; } } -#endif /* GOLDOBJ */ - STATIC_OVL struct monst * next_shkp(shkp, withbill) register struct monst *shkp; @@ -903,13 +900,8 @@ register struct monst *shkp; long robbed = ESHK(shkp)->robbed; long balance = ((tmp <= 0L) ? tmp : check_credit(tmp, shkp)); -#ifndef GOLDOBJ - u.ugold -= balance; - shkp->mgold += balance; -#else if (balance > 0) money2mon(shkp, balance); else if (balance < 0) money2u(shkp, -balance); -#endif context.botl = 1; if(robbed) { robbed -= tmp; @@ -1235,11 +1227,7 @@ proceed: } if(shkp != resident && NOTANGRY(shkp)) { -#ifdef GOLDOBJ umoney = money_cnt(invent); -#else - umoney = u.ugold; -#endif if(!ltmp) You("do not owe %s anything.", mon_nam(shkp)); else if(!umoney) { @@ -1268,11 +1256,7 @@ proceed: /* ltmp is still eshkp->robbed here */ if (!eshkp->billct && !eshkp->debit) { -#ifdef GOLDOBJ umoney = money_cnt(invent); -#else - umoney = u.ugold; -#endif if(!ltmp && NOTANGRY(shkp)) { You("do not owe %s anything.", shkname(shkp)); if (!umoney) @@ -1325,9 +1309,7 @@ proceed: long dtmp = eshkp->debit; long loan = eshkp->loan; char sbuf[BUFSZ]; -#ifdef GOLDOBJ umoney = money_cnt(invent); -#endif Sprintf(sbuf, "You owe %s %ld %s ", shkname(shkp), dtmp, currency(dtmp)); if(loan) { @@ -1337,11 +1319,7 @@ proceed: "for gold picked up and the use of merchandise."); } else Strcat(sbuf, "for the use of merchandise."); pline1(sbuf); -#ifndef GOLDOBJ - if (u.ugold + eshkp->credit < dtmp) { -#else if (umoney + eshkp->credit < dtmp) { -#endif pline("But you don't%s have enough gold%s.", stashed_gold ? " seem to" : "", eshkp->credit ? " or credit" : ""); @@ -1353,12 +1331,7 @@ proceed: eshkp->loan = 0L; Your("debt is covered by your credit."); } else if (!eshkp->credit) { -#ifndef GOLDOBJ - u.ugold -= dtmp; - shkp->mgold += dtmp; -#else money2mon(shkp, dtmp); -#endif eshkp->debit = 0L; eshkp->loan = 0L; You("pay that debt."); @@ -1366,12 +1339,7 @@ proceed: } else { dtmp -= eshkp->credit; eshkp->credit = 0L; -#ifndef GOLDOBJ - u.ugold -= dtmp; - shkp->mgold += dtmp; -#else money2mon(shkp, dtmp); -#endif eshkp->debit = 0L; eshkp->loan = 0L; pline("That debt is partially offset by your credit."); @@ -1384,22 +1352,14 @@ proceed: /* now check items on bill */ if (eshkp->billct) { register boolean itemize; -#ifndef GOLDOBJ - if (!u.ugold && !eshkp->credit) { -#else umoney = money_cnt(invent); if (!umoney && !eshkp->credit) { -#endif You("%shave no money or credit%s.", stashed_gold ? "seem to " : "", paid ? " left" : ""); return(0); } -#ifndef GOLDOBJ - if ((u.ugold + eshkp->credit) < cheapest_item(shkp)) { -#else if ((umoney + eshkp->credit) < cheapest_item(shkp)) { -#endif You("don't have enough money to buy%s the item%s you picked.", eshkp->billct > 1 ? " any of" : "", plur(eshkp->billct)); if(stashed_gold) @@ -1483,11 +1443,7 @@ boolean itemize; { register struct obj *obj = *obj_p; long ltmp, quan, save_quan; -#ifdef GOLDOBJ long umoney = money_cnt(invent); -#else - long umoney = u.ugold; -#endif int buy; boolean stashed_gold = (hidden_gold() > 0L), consumed = (which == 0); @@ -1672,9 +1628,7 @@ int numsk; int croaked; { long loss = 0L; -#ifdef GOLDOBJ long umoney; -#endif struct eshk *eshkp = ESHK(shkp); boolean take = FALSE, taken = FALSE; unsigned save_minvis = shkp->minvis; @@ -1721,12 +1675,8 @@ int croaked; } if (eshkp->following || ANGRY(shkp) || take) { -#ifndef GOLDOBJ - if (!invent && !u.ugold) goto skip; -#else if (!invent) goto skip; umoney = money_cnt(invent); -#endif takes[0] = '\0'; if (!shkp->mcanmove || shkp->msleeping) Strcat(takes, "wakes up and "); @@ -1734,18 +1684,10 @@ int croaked; Strcat(takes, "comes and "); Strcat(takes, "takes"); -#ifndef GOLDOBJ - if (loss > u.ugold || !loss || roomno == eshkp->shoproom) { - eshkp->robbed -= u.ugold; - if (eshkp->robbed < 0L) eshkp->robbed = 0L; - shkp->mgold += u.ugold; - u.ugold = 0L; -#else if (loss > umoney || !loss || roomno == eshkp->shoproom) { eshkp->robbed -= umoney; if (eshkp->robbed < 0L) eshkp->robbed = 0L; if (umoney > 0) money2mon(shkp, umoney); -#endif context.botl = 1; pline("%s %s all your possessions.", shkname(shkp), takes); @@ -1753,12 +1695,7 @@ int croaked; /* where to put player's invent (after disclosure) */ set_repo_loc(shkp); } else { -#ifndef GOLDOBJ - shkp->mgold += loss; - u.ugold -= loss; -#else money2mon(shkp, loss); -#endif context.botl = 1; pline("%s %s the %ld %s %sowed %s.", Monnam(shkp), takes, @@ -1827,14 +1764,9 @@ finish_paybill() unleash_all(); /* if hero has any gold left, take it into shopkeeper's possession */ if (shkp) { -#ifdef GOLDOBJ long umoney = money_cnt(invent); if (umoney) money2mon(shkp, umoney); -#else - shkp->mgold += u.ugold; - u.ugold = 0L; -#endif } /* transfer rest of the character's inventory to the shop floor */ drop_upon_death((struct monst *)0, (struct obj *)0, ox, oy); @@ -2837,11 +2769,7 @@ xchar x, y; return; } -#ifndef GOLDOBJ - shkmoney = shkp->mgold; -#else shkmoney = money_cnt(shkp->minvent); -#endif if (!shkmoney) { char c, qbuf[BUFSZ]; long tmpcr = ((offer * 9L) / 10L) + (offer <= 1L); @@ -3779,11 +3707,7 @@ boolean cant_mollify; } if((um_dist(x, y, 1) && !uinshp) || cant_mollify || -#ifndef GOLDOBJ - (u.ugold + ESHK(shkp)->credit) < cost_of_damage -#else (money_cnt(invent) + ESHK(shkp)->credit) < cost_of_damage -#endif || !rn2(50)) { getcad: if (muteshk(shkp)) { @@ -3807,12 +3731,7 @@ boolean cant_mollify; currency(cost_of_damage), !animal ? "\"" : ""); if(yn(qbuf) != 'n') { cost_of_damage = check_credit(cost_of_damage, shkp); -#ifndef GOLDOBJ - u.ugold -= cost_of_damage; - shkp->mgold += cost_of_damage; -#else money2mon(shkp, cost_of_damage); -#endif context.botl = 1; pline("Mollified, %s accepts your restitution.", shkname(shkp)); @@ -3967,9 +3886,7 @@ shk_chat(shkp) struct monst *shkp; { struct eshk *eshk; -#ifdef GOLDOBJ long shkmoney; -#endif if (!shkp->isshk) { /* The monster type is shopkeeper, but this monster is not actually a shk, which could happen if someone @@ -4010,17 +3927,9 @@ struct monst *shkp; shkname(shkp), eshk->credit, currency(eshk->credit)); else if (eshk->robbed) pline("%s complains about a recent robbery.", shkname(shkp)); -#ifndef GOLDOBJ - else if (shkp->mgold < 50) -#else else if ((shkmoney = money_cnt(shkp->minvent)) < 50) -#endif pline("%s complains that business is bad.", shkname(shkp)); -#ifndef GOLDOBJ - else if (shkp->mgold > 4000) -#else else if (shkmoney > 4000) -#endif pline("%s says that business is good.", shkname(shkp)); else if (is_izchak(shkp, FALSE)) pline(Izchak_speaks[rn2(SIZE(Izchak_speaks))],shkname(shkp)); diff --git a/src/shknam.c b/src/shknam.c index 77bdf2f3c..645fc6b58 100644 --- a/src/shknam.c +++ b/src/shknam.c @@ -552,11 +552,7 @@ struct mkroom *sroom; eshkp->billct = eshkp->visitct = 0; eshkp->bill_p = (struct bill_x *)0; eshkp->customer[0] = '\0'; -#ifndef GOLDOBJ - shk->mgold = 1000L + 30L*(long)rnd(100); /* initial capital */ -#else mkmonmoney(shk, 1000L + 30L*(long)rnd(100)); /* initial capital */ -#endif if (shp->shknms == shkrings) (void) mongets(shk, TOUCHSTONE); nameshk(shk, shp->shknms); diff --git a/src/sit.c b/src/sit.c index 72c94c56b..aa3a16605 100644 --- a/src/sit.c +++ b/src/sit.c @@ -9,15 +9,6 @@ void take_gold() { -#ifndef GOLDOBJ - if (u.ugold <= 0) { - You_feel("a strange sensation."); - } else { - You("notice you have no gold!"); - u.ugold = 0; - context.botl = 1; - } -#else struct obj *otmp, *nobj; int lost_money = 0; for (otmp = invent; otmp; otmp = nobj) { @@ -33,7 +24,6 @@ take_gold() You("notice you have no money!"); context.botl = 1; } -#endif } int @@ -324,10 +314,8 @@ rndcurse() /* curse a few inventory items at random! */ } for (otmp = invent; otmp; otmp = otmp->nobj) { -#ifdef GOLDOBJ /* gold isn't subject to being cursed or blessed */ if (otmp->oclass == COIN_CLASS) continue; -#endif nobj++; } if (nobj) { @@ -335,10 +323,8 @@ rndcurse() /* curse a few inventory items at random! */ cnt > 0; cnt--) { onum = rnd(nobj); for (otmp = invent; otmp; otmp = otmp->nobj) { -#ifdef GOLDOBJ /* as above */ if (otmp->oclass == COIN_CLASS) continue; -#endif if (--onum == 0) break; /* found the target */ } /* the !otmp case should never happen; picking an already diff --git a/src/sounds.c b/src/sounds.c index 2a7df5823..593c3ecd6 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -874,11 +874,7 @@ register struct monst *mtmp; else verbl_msg = "Relax, this won't hurt a bit."; break; case MS_GUARD: -#ifndef GOLDOBJ - if (u.ugold) -#else if (money_cnt(invent)) -#endif verbl_msg = "Please drop that gold and follow me."; else verbl_msg = "Please follow me."; diff --git a/src/steal.c b/src/steal.c index f98cd693e..0812a79df 100644 --- a/src/steal.c +++ b/src/steal.c @@ -22,66 +22,6 @@ register struct obj *otmp; "armor"); } -#ifndef GOLDOBJ -long /* actually returns something that fits in an int */ -somegold() -{ -#ifdef LINT /* long conv. ok */ - return(0L); -#else - return (long)( (u.ugold < 100) ? u.ugold : - (u.ugold > 10000) ? rnd(10000) : rnd((int) u.ugold) ); -#endif -} - -void -stealgold(mtmp) -register struct monst *mtmp; -{ - register struct obj *gold = g_at(u.ux, u.uy); - register long tmp; - struct monst *who; - const char *whose, *what; - - if (gold && (!u.ugold || gold->quan > u.ugold || !rn2(5))) { - mtmp->mgold += gold->quan; - delobj(gold); - newsym(u.ux, u.uy); - if (u.usteed) { - who = u.usteed; - whose = s_suffix(y_monnam(who)); - what = makeplural(mbodypart(who, FOOT)); - } else { - who = &youmonst; - whose = "your"; - what = makeplural(body_part(FOOT)); - } - /* [ avoid "between your rear regions" :-] */ - if (slithy(who->data)) what = "coils"; - /* reduce "rear hooves/claws" to "hooves/claws" */ - if (!strncmp(what, "rear ", 5)) what += 5; - pline("%s quickly snatches some gold from %s %s %s!", - Monnam(mtmp), - (Levitation || Flying) ? "beneath" : "between", - whose, what); - if(!u.ugold || !rn2(5)) { - if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE); - /* do not set mtmp->mavenge here; gold on the floor is fair game */ - monflee(mtmp, 0, FALSE, FALSE); - } - } else if(u.ugold) { - u.ugold -= (tmp = somegold()); - Your("purse feels lighter."); - mtmp->mgold += tmp; - if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE); - mtmp->mavenge = 1; - monflee(mtmp, 0, FALSE, FALSE); - context.botl = 1; - } -} - -#else /* !GOLDOBJ */ - long /* actually returns something that fits in an int */ somegold(umoney) long umoney; @@ -167,7 +107,6 @@ register struct monst *mtmp; context.botl = 1; } } -#endif /* GOLDOBJ */ /* steal armor after you finish taking it off */ unsigned int stealoid; /* object to be stolen */ @@ -257,7 +196,7 @@ boolean unchain_ball; /* whether to unpunish or just unwield */ /* Returns 1 when something was stolen (or at least, when N should flee now) * Returns -1 if the monster died in the attempt * Avoid stealing the object stealoid - * GOLDOBJ: nymphs and monkeys won't steal coins + * Nymphs and monkeys won't steal coins */ int steal(mtmp, objnambuf) @@ -304,9 +243,7 @@ nothing_to_steal: tmp = 0; for(otmp = invent; otmp; otmp = otmp->nobj) if ((!uarm || otmp != uarmc) && otmp != uskin -#ifdef GOLDOBJ && otmp->oclass != COIN_CLASS -#endif #ifdef INVISIBLE_OBJECTS && (!otmp->oinvis || perceives(mtmp->data)) #endif @@ -317,9 +254,7 @@ nothing_to_steal: tmp = rn2(tmp); for(otmp = invent; otmp; otmp = otmp->nobj) if ((!uarm || otmp != uarmc) && otmp != uskin -#ifdef GOLDOBJ && otmp->oclass != COIN_CLASS -#endif #ifdef INVISIBLE_OBJECTS && (!otmp->oinvis || perceives(mtmp->data)) #endif @@ -494,13 +429,6 @@ register struct obj *otmp; or kicking code shouldn't continue to track and place it */ if (otmp == thrownobj) thrownobj = 0; else if (otmp == kickedobj) kickedobj = 0; -#ifndef GOLDOBJ - if (otmp->oclass == COIN_CLASS) { - mtmp->mgold += otmp->quan; - obfree(otmp, (struct obj *)0); - freed_otmp = 1; - } else { -#endif boolean snuff_otmp = FALSE; /* don't want hidden light source inside the monster; assumes that engulfers won't have external inventories; whirly monsters cause @@ -523,9 +451,6 @@ register struct obj *otmp; freed_otmp = add_to_minv(mtmp, otmp); /* and we had to defer this until object is in mtmp's inventory */ if (snuff_otmp) snuff_light_source(mtmp->mx, mtmp->my); -#ifndef GOLDOBJ - } -#endif return freed_otmp; } @@ -686,35 +611,14 @@ boolean is_pet; /* If true, pet should keep wielded/worn items */ /* vault guard's gold goes away rather than be dropped... */ if (mtmp->isgd && -#ifdef GOLDOBJ (otmp = findgold(mtmp->minvent)) != 0 -#else - mtmp->mgold != 0L -#endif ) { if (canspotmon(mtmp)) pline("%s gold %s.", s_suffix(Monnam(mtmp)), canseemon(mtmp) ? "vanishes" : "seems to vanish"); -#ifdef GOLDOBJ obfree(otmp, (struct obj *)0); -#else - mtmp->mgold = 0L; -#endif } /* isgd && has gold */ -#ifndef GOLDOBJ - /* handle gold first since droppables() would get stuck on it */ - if (mtmp->mgold) { - long g = mtmp->mgold; - - (void) mkgold(g, omx, omy); - if (is_pet && cansee(omx, omy) && flags.verbose) - pline("%s drops %ld gold piece%s.", Monnam(mtmp), - g, plur(g)); - mtmp->mgold = 0L; - } -#endif - while ((otmp = (is_pet ? droppables(mtmp) : mtmp->minvent)) != 0) { obj_extract_self(otmp); mdrop_obj(mtmp, otmp, is_pet && flags.verbose); diff --git a/src/trap.c b/src/trap.c index cde767106..636598789 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3176,30 +3176,7 @@ boolean *lostsome; /* else continue */ } } -#ifndef GOLDOBJ - if (!otmp) { - /* Nothing available left to drop; try gold */ - if (u.ugold) { - pline("In desperation, you drop your purse."); - /* Hack: gold is not in the inventory, so make a gold object - * and put it at the head of the inventory list. - */ - obj = mkgoldobj(u.ugold); /* removes from u.ugold */ - obj->in_use = TRUE; - u.ugold = obj->quan; /* put the gold back */ - assigninvlet(obj); /* might end up as NOINVSYM */ - obj->nobj = invent; - invent = obj; - *lostsome = TRUE; - dropx(obj); - continue; /* Try again */ - } - /* We can't even drop gold! */ - return (FALSE); - } -#else if (!otmp) return (FALSE); /* nothing to drop! */ -#endif if (otmp->owornmask) remove_worn_item(otmp, FALSE); *lostsome = TRUE; dropx(otmp); diff --git a/src/u_init.c b/src/u_init.c index 09930dd11..bfe54671c 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -210,12 +210,10 @@ static struct trobj Wishing[] = { { WAN_WISHING, 3, WAND_CLASS, 1, 0 }, { 0, 0, 0, 0, 0 } }; -#ifdef GOLDOBJ static struct trobj Money[] = { { GOLD_PIECE, 0 , COIN_CLASS, 1, 0 }, { 0, 0, 0, 0, 0 } }; -#endif /* race-based substitutions for initial inventory; the weaker cloak for elven rangers is intentional--they shoot better */ @@ -597,11 +595,7 @@ u_init() skill_init(Skill_C); break; case PM_HEALER: -#ifndef GOLDOBJ - u.ugold = u.ugold0 = rn1(1000, 1001); -#else u.umoney0 = rn1(1000, 1001); -#endif ini_inv(Healer); if(!rn2(25)) ini_inv(Lamp); knows_object(POT_FULL_HEALING); @@ -650,11 +644,7 @@ u_init() break; case PM_ROGUE: Rogue[R_DAGGERS].trquan = rn1(10, 6); -#ifndef GOLDOBJ - u.ugold = u.ugold0 = 0; -#else u.umoney0 = 0; -#endif ini_inv(Rogue); if(!rn2(5)) ini_inv(Blindfold); knows_object(SACK); @@ -670,11 +660,7 @@ u_init() break; case PM_TOURIST: Tourist[T_DARTS].trquan = rn1(20, 21); -#ifndef GOLDOBJ - u.ugold = u.ugold0 = rnd(1000); -#else u.umoney0 = rnd(1000); -#endif ini_inv(Tourist); if(!rn2(25)) ini_inv(Tinopener); else if(!rn2(25)) ini_inv(Leash); @@ -778,12 +764,8 @@ u_init() if (wizard) read_wizkit(); -#ifndef GOLDOBJ - u.ugold0 += hidden_gold(); /* in case sack has gold in it */ -#else if (u.umoney0) ini_inv(Money); u.umoney0 += hidden_gold(); /* in case sack has gold in it */ -#endif find_ac(); /* get initial ac value */ init_attr(75); /* init attribute values */ @@ -939,12 +921,10 @@ register struct trobj *trop; nocreate4 = otyp; } -#ifdef GOLDOBJ if (trop->trclass == COIN_CLASS) { /* no "blessed" or "identified" money */ obj->quan = u.umoney0; } else { -#endif if (objects[otyp].oc_uses_known) obj->known = 1; obj->dknown = obj->bknown = obj->rknown = 1; if (Is_container(obj) || obj->otyp == STATUE) { @@ -966,9 +946,7 @@ register struct trobj *trop; obj->spe = trop->trspe; if (trop->trbless != UNDEF_BLESS) obj->blessed = trop->trbless; -#ifdef GOLDOBJ } -#endif /* defined after setting otyp+quan + blessedness */ obj->owt = weight(obj); obj = addinv(obj); diff --git a/src/uhitm.c b/src/uhitm.c index 0057e573d..04ec05c11 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1461,13 +1461,6 @@ register struct attack *mattk; tmp = 0; break; case AD_SGLD: -#ifndef GOLDOBJ - if (mdef->mgold) { - u.ugold += mdef->mgold; - mdef->mgold = 0; - Your("purse feels heavier."); - } -#else /* This you as a leprechaun, so steal real gold only, no lesser coins */ { @@ -1484,7 +1477,6 @@ register struct attack *mattk; } } } -#endif exercise(A_DEX, TRUE); tmp = 0; break; diff --git a/src/vault.c b/src/vault.c index 487cb8e7c..87c13b31a 100644 --- a/src/vault.c +++ b/src/vault.c @@ -366,11 +366,7 @@ fnd: return; } verbalize("I don't know you."); -#ifndef GOLDOBJ - umoney = u.ugold; -#else umoney = money_cnt(invent); -#endif if (Deaf) { ; } else if (!umoney && !hidden_gold()) { @@ -513,12 +509,8 @@ register struct monst *grd; grd_in_vault = *in_rooms(grd->mx, grd->my, VAULT)? TRUE : FALSE; boolean disappear_msg_seen = FALSE, semi_dead = (grd->mhp <= 0); -#ifndef GOLDOBJ - register boolean u_carry_gold = ((u.ugold + hidden_gold()) > 0L); -#else long umoney = money_cnt(invent); register boolean u_carry_gold = ((umoney + hidden_gold()) > 0L); -#endif boolean see_guard, newspot = FALSE; if(!on_level(&(egrd->gdlevel), &u.uz)) return(-1); @@ -560,15 +552,9 @@ register struct monst *grd; if(egrd->warncnt == 3 && !Deaf) verbalize("I repeat, %sfollow me!", u_carry_gold ? ( -#ifndef GOLDOBJ - !u.ugold ? - "drop that hidden gold and " : - "drop that gold and ") : ""); -#else !umoney ? "drop that hidden money and " : "drop that money and ") : ""); -#endif if(egrd->warncnt == 7) { m = grd->mx; n = grd->my; @@ -654,13 +640,8 @@ letknow: if (m == u.ux && n == u.uy) { struct obj *gold = g_at(m,n); /* Grab the gold from between the hero's feet. */ -#ifndef GOLDOBJ - grd->mgold += gold->quan; - delobj(gold); -#else obj_extract_self(gold); add_to_minv(grd, gold); -#endif newsym(m,n); } else if (m == x && n == y) { mpickgold(grd); /* does a newsym */ @@ -828,30 +809,17 @@ void paygd() { register struct monst *grd = findgd(); -#ifndef GOLDOBJ - struct obj *gold; -#else long umoney = money_cnt(invent); struct obj *coins, *nextcoins; -#endif int gx,gy; char buf[BUFSZ]; -#ifndef GOLDOBJ - if (!u.ugold || !grd) return; -#else if (!umoney || !grd) return; -#endif if (u.uinvault) { Your("%ld %s goes into the Magic Memory Vault.", -#ifndef GOLDOBJ - u.ugold, - currency(u.ugold)); -#else umoney, currency(umoney)); -#endif gx = u.ux; gy = u.uy; } else { @@ -868,10 +836,6 @@ paygd() plname, mons[u.umonster].mname); make_grave(gx, gy, buf); } -#ifndef GOLDOBJ - place_object(gold = mkgoldobj(u.ugold), gx, gy); - stackobj(gold); -#else for (coins = invent; coins; coins = nextcoins) { nextcoins = coins->nobj; if (objects[coins->otyp].oc_class == COIN_CLASS) { @@ -880,7 +844,6 @@ paygd() stackobj(coins); } } -#endif mongone(grd); } diff --git a/src/wield.c b/src/wield.c index 32a3e1eb4..dbb5d271f 100644 --- a/src/wield.c +++ b/src/wield.c @@ -238,17 +238,10 @@ register struct obj *obj; static NEARDATA const char wield_objs[] = { ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, TOOL_CLASS, 0 }; -#ifdef GOLDOBJ static NEARDATA const char ready_objs[] = { COIN_CLASS, ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, 0 }; static NEARDATA const char bullets[] = /* (note: different from dothrow.c) */ { COIN_CLASS, ALL_CLASSES, ALLOW_NONE, GEM_CLASS, WEAPON_CLASS, 0 }; -#else -static NEARDATA const char ready_objs[] = - { ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, 0 }; -static NEARDATA const char bullets[] = /* (note: different from dothrow.c) */ - { ALL_CLASSES, ALLOW_NONE, GEM_CLASS, WEAPON_CLASS, 0 }; -#endif int dowield() diff --git a/src/zap.c b/src/zap.c index 173bee625..c4d98c33c 100644 --- a/src/zap.c +++ b/src/zap.c @@ -436,11 +436,7 @@ struct monst *mtmp; mstatusline(mtmp); if (notonhead) return; /* don't show minvent for long worm tail */ -#ifndef GOLDOBJ - if (mtmp->minvent || mtmp->mgold) { -#else if (mtmp->minvent) { -#endif for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) { otmp->dknown = 1; /* treat as "seen" */ if (Is_container(otmp) || otmp->otyp == STATUE) { @@ -3661,9 +3657,6 @@ const char *fltxt; obfree(otmp, (struct obj *)0); } } -#ifndef GOLDOBJ - mon->mgold = 0L; -#endif #undef oresist_disintegration diff --git a/sys/amiga/amirip.c b/sys/amiga/amirip.c index 00e98b12d..5b625ba6d 100644 --- a/sys/amiga/amirip.c +++ b/sys/amiga/amirip.c @@ -183,12 +183,7 @@ time_t when; tomb_text(buf); /* Put $ on stone */ - Sprintf(buf, "%ld Au", -#ifndef GOLDOBJ - u.ugold); -#else - done_money); -#endif + Sprintf(buf, "%ld Au", done_money); buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */ tomb_text(buf); diff --git a/sys/wince/mhstatus.c b/sys/wince/mhstatus.c index 6e18ed12a..dd86e2d6e 100644 --- a/sys/wince/mhstatus.c +++ b/sys/wince/mhstatus.c @@ -233,11 +233,7 @@ void FormatStatusString(char* text, int format) (void) describe_level(nb=eos(nb)); Sprintf(nb = eos(nb), "%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", showsyms[COIN_CLASS + SYM_OFF_O], -#ifndef GOLDOBJ - u.ugold, -#else money_cnt(invent), -#endif hp, hpmax, u.uen, u.uenmax, u.uac); if (Upolyd) diff --git a/util/makedefs.c b/util/makedefs.c index ad2186887..9102945ce 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -960,7 +960,6 @@ do_rumors() * */ #define IGNORED_FEATURES ( 0L \ - | (1L << 12) /* GOLDOBJ */ \ | (1L << 19) /* EXP_ON_BOTL */ \ | (1L << 20) /* SCORE_ON_BOTL */ \ | (1L << 27) /* ZEROCOMP */ \ @@ -993,9 +992,6 @@ make_version() | (1L << 6) #endif /* objects (10..14) */ -#ifdef GOLDOBJ - | (1L << 10) -#endif /* flag bits and/or other global variables (15..26) */ #ifdef TEXTCOLOR | (1L << 17) @@ -1239,9 +1235,6 @@ static const char *build_opts[] = { #ifdef MFLOPPY "floppy drive support", #endif -#ifdef GOLDOBJ - "gold object in inventories", -#endif #ifdef INSURANCE "insurance files for recovering from crashes", #endif diff --git a/win/Qt/qt_win.cpp b/win/Qt/qt_win.cpp index af412e25a..16ff7873b 100644 --- a/win/Qt/qt_win.cpp +++ b/win/Qt/qt_win.cpp @@ -2550,11 +2550,7 @@ void NetHackQtStatusWindow::updateStats() dlevel.setLabel(buf,(long)depth(&u.uz)); } -#ifndef GOLDOBJ - gold.setLabel("Au:", u.ugold); -#else gold.setLabel("Au:", money_cnt(invent)); -#endif if (u.mtimedone) { // You're a monster! @@ -3296,11 +3292,7 @@ static char** rip_line=0; Sprintf(rip_line[NAME_LINE], "%s", plname); /* Put $ on stone */ -#ifndef GOLDOBJ - Sprintf(rip_line[GOLD_LINE], "%ld Au", u.ugold); -#else Sprintf(rip_line[GOLD_LINE], "%ld Au", done_money); -#endif /* Put together death description */ formatkiller(buf, sizeof buf, how); diff --git a/win/X11/winstat.c b/win/X11/winstat.c index 42462cbc3..ab65a168c 100644 --- a/win/X11/winstat.c +++ b/win/X11/winstat.c @@ -600,11 +600,7 @@ update_fancy_status(wp) case F_NAME: val = (long) 0L; break; /* special */ case F_DLEVEL: val = (long) 0L; break; /* special */ -#ifndef GOLDOBJ - case F_GOLD: val = (long) u.ugold; break; -#else case F_GOLD: val = money_cnt(invent); break; -#endif case F_HP: val = (long) (u.mtimedone ? (u.mh > 0 ? u.mh : 0): (u.uhp > 0 ? u.uhp : 0)); break; diff --git a/win/X11/wintext.c b/win/X11/wintext.c index 9b337d3b2..795b765a7 100644 --- a/win/X11/wintext.c +++ b/win/X11/wintext.c @@ -469,11 +469,7 @@ calculate_rip_text(int how, time_t when) /* Put $ on stone */ Sprintf(rip_line[GOLD_LINE], "%ld Au", -#ifndef GOLDOBJ - u.ugold); -#else done_money); -#endif /* Put together death description */ formatkiller(buf, sizeof buf, how); diff --git a/win/gem/wingem.c b/win/gem/wingem.c index 87d175231..ccc076bdf 100644 --- a/win/gem/wingem.c +++ b/win/gem/wingem.c @@ -1088,11 +1088,7 @@ time_t when; Sprintf(rip_line[NAME_LINE], "%s", plname); /* Put $ on stone */ Sprintf(rip_line[GOLD_LINE], "%ld Au", -#ifndef GOLDOBJ - u.ugold); -#else done_money); -#endif /* Put together death description */ formatkiller(buf, sizeof buf, how); diff --git a/win/gnome/gnbind.c b/win/gnome/gnbind.c index c48535a26..b001de04f 100644 --- a/win/gnome/gnbind.c +++ b/win/gnome/gnbind.c @@ -1183,12 +1183,7 @@ void gnome_outrip(winid wid, int how, time_t when) Strcat(ripString, buf); /* Put $ on stone */ - Sprintf(buf, "%ld Au\n", -#ifndef GOLDOBJ - u.ugold); -#else - done_money); -#endif + Sprintf(buf, "%ld Au\n", done_money); Strcat(ripString, buf); /* Put together death description */ diff --git a/win/gnome/gnstatus.c b/win/gnome/gnstatus.c index 6e3841cc3..37e1d7bf6 100644 --- a/win/gnome/gnstatus.c +++ b/win/gnome/gnstatus.c @@ -434,9 +434,7 @@ void ghack_status_window_update_stats() const char* hung; const char* enc; static int firstTime=TRUE; -#ifdef GOLDOBJ long umoney; -#endif /* First, fill in the player name and the dungeon level */ strcpy(buf, plname); @@ -565,30 +563,17 @@ void ghack_status_window_update_stats() gtk_label_set( GTK_LABEL( chaLabel), buf); /* Now do the non-pixmaped stats (gold and such) */ -#ifndef GOLDOBJ - sprintf(buf,"Au:%ld", u.ugold); - if (lastAu < u.ugold && firstTime==FALSE) { -#else umoney = money_cnt(invent); sprintf(buf,"Au:%ld", umoney); if (lastAu < umoney && firstTime==FALSE) { -#endif /* Ok, this changed so add it to the highlighing list */ ghack_highlight_widget( goldLabel, normalStyle, greenStyle); } -#ifndef GOLDOBJ - else if (lastAu > u.ugold && firstTime==FALSE) { -#else else if (lastAu > umoney && firstTime==FALSE) { -#endif /* Ok, this changed so add it to the highlighing list */ ghack_highlight_widget( goldLabel, normalStyle, redStyle); } -#ifndef GOLDOBJ - lastAu = u.ugold; -#else lastAu = umoney; -#endif gtk_label_set( GTK_LABEL( goldLabel), buf); if (u.mtimedone) { diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index 39776d87b..7d2177286 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -1796,11 +1796,7 @@ void mswin_outrip(winid wid, int how, time_t when) putstr(wid, 0, buf); /* Put $ on stone */ -#ifndef GOLDOBJ - Sprintf(buf, "%ld Au", u.ugold); -#else Sprintf(buf, "%ld Au", done_money); -#endif buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */ putstr(wid, 0, buf); From 612852f7de8a1d621ca29335edadef77a1a05369 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 9 Feb 2015 20:56:44 +0200 Subject: [PATCH 016/354] Apply paxed's DEBUG patch to remove DEBUG/D_DEBUG. Move debugging output into couple preprocessor defines, which are no-op without DEBUG. To show debugging output from a certain source files, use sysconf: DEBUGFILES=dungeon.c questpgr.c Also fix couple debug lines which did not compile. This also includes fixes due to Derek Ray to depugpline to work better on other platforms. --- include/global.h | 2 + include/hack.h | 28 +++++++++++-- include/sys.h | 1 + src/apply.c | 4 +- src/attrib.c | 46 ++++++---------------- src/bones.c | 4 +- src/cmd.c | 21 +++++----- src/dbridge.c | 100 ++++++++++++----------------------------------- src/dig.c | 36 +++++------------ src/dungeon.c | 2 + src/eat.c | 70 --------------------------------- src/files.c | 3 ++ src/hack.c | 2 +- src/light.c | 12 ++---- src/makemon.c | 24 +++--------- src/mklev.c | 11 +----- src/mkmaze.c | 8 +--- src/mkobj.c | 16 ++------ src/mon.c | 4 +- src/pickup.c | 4 +- src/questpgr.c | 11 +++--- src/restore.c | 4 +- src/rnd.c | 20 ++++------ src/save.c | 4 +- src/shk.c | 6 +-- src/sp_lev.c | 11 ------ src/steal.c | 2 +- src/sys.c | 1 + src/teleport.c | 4 +- src/zap.c | 8 +--- sys/unix/sysconf | 5 +++ win/tty/wintty.c | 2 +- 32 files changed, 136 insertions(+), 340 deletions(-) diff --git a/include/global.h b/include/global.h index 7e8acda38..985066520 100644 --- a/include/global.h +++ b/include/global.h @@ -11,6 +11,8 @@ #define BETA /* development or beta testing [MRS] */ +#define DEBUG + /* * Files expected to exist in the playground directory. */ diff --git a/include/hack.h b/include/hack.h index c88d8dd56..0ace170e5 100644 --- a/include/hack.h +++ b/include/hack.h @@ -11,9 +11,31 @@ #include "config.h" #endif -/* For debugging beta code. */ -#ifdef BETA -#define Dpline pline +#ifdef DEBUG +/* due to strstr(), mon.c matches makemon.c */ +# define showdebug() (sysopt.debugfiles && \ + ((sysopt.debugfiles[0] == '*') || \ + (strstr( __FILE__ , sysopt.debugfiles)))) + +/* GCC understands this syntax */ +# ifdef __GNUC__ +/* ... but whines about it anyway without these pragmas. */ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wvariadic-macros" +# define debugpline(args...) \ + do { if (showdebug()) pline( args ); } while(0); +# pragma GCC diagnostic pop +# endif + +/* and Visual Studio understands this one */ +# ifdef _MSC_VER +# define debugpline(...) \ + do { if (showdebug()) pline(__VA_ARGS__); } while(0); +# endif + +#else +# define showdebug() (0) +# define debugpline(...) #endif #define TELL 1 diff --git a/include/sys.h b/include/sys.h index 227e68781..ac39239ee 100644 --- a/include/sys.h +++ b/include/sys.h @@ -15,6 +15,7 @@ struct sysopt { char *recover; /* how to run recover - may be overridden by win port */ char *wizards; char *shellers; /* like wizards, for ! command (-DSHELL) */ + char *debugfiles; /* files to show debugplines in. '*' is all. */ int maxplayers; /* record file */ int persmax; diff --git a/src/apply.c b/src/apply.c index e92e6199f..d2377b51e 100644 --- a/src/apply.c +++ b/src/apply.c @@ -1773,9 +1773,7 @@ long timeout; char monnambuf[BUFSZ], carriedby[BUFSZ]; if (!figurine) { -#ifdef DEBUG - pline("null figurine in fig_transform()"); -#endif + debugpline("null figurine in fig_transform()"); return; } silent = (timeout != monstermoves); /* happened while away */ diff --git a/src/attrib.c b/src/attrib.c index b2d5738b8..8bba3d61c 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -8,8 +8,6 @@ #include "hack.h" #include -/* #define DEBUG */ /* uncomment for debugging info */ - /* part of the output on gain or loss of attribute */ static const char * const plusattr[] = { @@ -349,9 +347,7 @@ exercise(i, inc_or_dec) int i; boolean inc_or_dec; { -#ifdef DEBUG - pline("Exercise:"); -#endif + debugpline("Exercise:"); if (i == A_INT || i == A_CHA) return; /* can't exercise these */ /* no physical exercise while polymorphed; the body's temporary */ @@ -368,12 +364,10 @@ boolean inc_or_dec; * Note: *YES* ACURR is the right one to use. */ AEXE(i) += (inc_or_dec) ? (rn2(19) > ACURR(i)) : -rn2(2); -#ifdef DEBUG - pline("%s, %s AEXE = %d", + debugpline("%s, %s AEXE = %d", (i == A_STR) ? "Str" : (i == A_WIS) ? "Wis" : (i == A_DEX) ? "Dex" : "Con", (inc_or_dec) ? "inc" : "dec", AEXE(i)); -#endif } if (moves > 0 && (i == A_STR || i == A_CON)) (void)encumber_msg(); } @@ -398,9 +392,7 @@ exerper() (u.uhunger > 50) ? HUNGRY : (u.uhunger > 0) ? WEAK : FAINTING; -#ifdef DEBUG - pline("exerper: Hunger checks"); -#endif + debugpline("exerper: Hunger checks"); switch (hs) { case SATIATED: exercise(A_DEX, FALSE); if (Role_if(PM_MONK)) @@ -416,9 +408,7 @@ exerper() } /* Encumberance Checks */ -#ifdef DEBUG - pline("exerper: Encumber checks"); -#endif + debugpline("exerper: Encumber checks"); switch (near_capacity()) { case MOD_ENCUMBER: exercise(A_STR, TRUE); break; case HVY_ENCUMBER: exercise(A_STR, TRUE); @@ -431,9 +421,7 @@ exerper() /* status checks */ if(!(moves % 5)) { -#ifdef DEBUG - pline("exerper: Status checks"); -#endif + debugpline("exerper: Status checks"); if ((HClairvoyant & (INTRINSIC|TIMEOUT)) && !BClairvoyant) exercise(A_WIS, TRUE); if (HRegeneration) exercise(A_STR, TRUE); @@ -464,15 +452,11 @@ exerchk() /* Check out the periodic accumulations */ exerper(); -#ifdef DEBUG if(moves >= context.next_attrib_check) - pline("exerchk: ready to test. multi = %d.", multi); -#endif + debugpline("exerchk: ready to test. multi = %d.", multi); /* Are we ready for a test? */ if(moves >= context.next_attrib_check && !multi) { -#ifdef DEBUG - pline("exerchk: testing."); -#endif + debugpline("exerchk: testing."); /* * Law of diminishing returns (Part II): * @@ -499,13 +483,11 @@ exerchk() exercise/abuse gradually wears off without impact then */ if (Upolyd && i != A_WIS) goto nextattrib; -#ifdef DEBUG - pline("exerchk: testing %s (%d).", + debugpline("exerchk: testing %s (%d).", (i == A_STR) ? "Str" : (i == A_INT) ? "Int?" : (i == A_WIS) ? "Wis" : (i == A_DEX) ? "Dex" : (i == A_CON) ? "Con" : (i == A_CHA) ? "Cha?" : "???", ax); -#endif /* * Law of diminishing returns (Part III): * @@ -515,13 +497,9 @@ exerchk() if (rn2(AVAL) > ((i != A_WIS) ? (abs(ax) * 2 / 3) : abs(ax))) goto nextattrib; -#ifdef DEBUG - pline("exerchk: changing %d.", i); -#endif + debugpline("exerchk: changing %d.", i); if(adjattrib(i, mod_val, -1)) { -#ifdef DEBUG - pline("exerchk: changed %d.", i); -#endif + debugpline("exerchk: changed %d.", i); /* if you actually changed an attrib - zero accumulation */ AEXE(i) = ax = 0; /* then print an explanation */ @@ -535,9 +513,7 @@ exerchk() AEXE(i) = (abs(ax) / 2) * mod_val; } context.next_attrib_check += rn1(200,800); -#ifdef DEBUG - pline("exerchk: next check at %ld.", context.next_attrib_check); -#endif + debugpline("exerchk: next check at %ld.", context.next_attrib_check); } } diff --git a/src/bones.c b/src/bones.c index 66a4d43f5..926b9079e 100644 --- a/src/bones.c +++ b/src/bones.c @@ -581,11 +581,9 @@ getbones() for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (has_mname(mtmp)) sanitize_name(MNAME(mtmp)); if (mtmp->mhpmax == DEFUNCT_MONSTER) { -#if defined(DEBUG) if (wizard) - pline("Removing defunct monster %s from bones.", + debugpline("Removing defunct monster %s from bones.", mtmp->data->mname); -#endif mongone(mtmp); } else /* to correctly reset named artifacts on the level */ diff --git a/src/cmd.c b/src/cmd.c index f07abb78c..1477eabdc 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -5,7 +5,6 @@ #include "hack.h" #include "func_tab.h" -/* #define DEBUG */ /* uncomment for debugging */ #ifdef ALTMETA STATIC_VAR boolean alt_esc = FALSE; @@ -30,12 +29,8 @@ extern const char *enc_stat[]; /* encumbrance status from botl.c */ #define CMD_CLICKLOOK (char)0x8F #ifdef DEBUG -/* - * only one "wiz_debug_cmd" routine should be available (in whatever - * module you are trying to debug) or things are going to get rather - * hard to link :-) - */ -extern int NDECL(wiz_debug_cmd); +extern int NDECL(wiz_debug_cmd_bury); +extern int NDECL(wiz_debug_cmd_traveldisplay); #endif #ifdef DUMB /* stuff commented out in extern.h, but needed here */ @@ -389,11 +384,11 @@ extcmd_via_menu() /* here after # - now show pick-list of possible commands */ Sprintf(fmtstr, "%%-%ds", biggest + 15); } if (++i > MAX_EXT_CMD) { -# if defined(DEBUG) || defined(BETA) +# if defined(BETA) impossible( "Exceeded %d extended commands in doextcmd() menu; 'extmenu' disabled.", MAX_EXT_CMD); -# endif /* DEBUG || BETA */ +# endif /* BETA */ iflags.extmenu = 0; return -1; } @@ -454,7 +449,7 @@ extcmd_via_menu() /* here after # - now show pick-list of possible commands */ if (n == 1) { if (matchlevel > (QBUFSZ - 2)) { free((genericptr_t)pick_list); -# if defined(DEBUG) || defined(BETA) +# if defined(BETA) impossible("Too many chars (%d) entered in extcmd_via_menu()", matchlevel); # endif @@ -2507,7 +2502,8 @@ struct ext_func_tab extcmdlist[] = { {(char *)0, (char *)0, donull, TRUE}, /* vision */ {(char *)0, (char *)0, donull, TRUE}, /* wizsmell */ #ifdef DEBUG - {(char *)0, (char *)0, donull, TRUE}, /* wizdebug */ + {(char *)0, (char *)0, donull, TRUE}, /* wizdebug_traveldisplay */ + {(char *)0, (char *)0, donull, TRUE}, /* wizdebug_bury */ #endif {(char *)0, (char *)0, donull, TRUE}, /* wizrumorcheck */ {(char *)0, (char *)0, donull, TRUE}, /* wmode */ @@ -2534,7 +2530,8 @@ static const struct ext_func_tab debug_extcmdlist[] = { {"vision", "show vision array", wiz_show_vision, TRUE}, {"wizsmell", "smell monster", wiz_smell, TRUE}, #ifdef DEBUG - {"wizdebug", "wizard debug command", wiz_debug_cmd, TRUE}, + {"wizdebug_traveldisplay", "wizard debug: toggle travel display", wiz_debug_cmd_traveldisplay, TRUE}, + {"wizdebug_bury", "wizard debug: bury objs under and around you", wiz_debug_cmd_bury, TRUE}, #endif {"wizrumorcheck", "verify rumor boundaries", wiz_rumor_check, TRUE}, {"wmode", "show wall modes", wiz_show_wmodes, TRUE}, diff --git a/src/dbridge.c b/src/dbridge.c index b63d2714c..316b2707f 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -26,9 +26,6 @@ STATIC_DCL void FDECL(m_to_e, (struct monst *, int, int, struct entity *)); STATIC_DCL void FDECL(u_to_e, (struct entity *)); STATIC_DCL void FDECL(set_entity, (int, int, struct entity *)); STATIC_DCL const char *FDECL(e_nam, (struct entity *)); -#ifdef D_DEBUG -static const char *FDECL(Enam, (struct entity *)); /* unused */ -#endif STATIC_DCL const char *FDECL(E_phrase, (struct entity *, const char *)); STATIC_DCL boolean FDECL(e_survives_at, (struct entity *, int, int)); STATIC_DCL void FDECL(e_died, (struct entity *, int, int)); @@ -253,8 +250,8 @@ int x, y; (occupants[entitycnt].ex == x) && (occupants[entitycnt].ey == y)) break; + debugpline("entitycnt = %d", entitycnt); #ifdef D_DEBUG - pline("entitycnt = %d", entitycnt); wait_synch(); #endif return((entitycnt == ENTITIES)? @@ -319,19 +316,6 @@ struct entity *etmp; return(is_u(etmp)? "you" : mon_nam(etmp->emon)); } -#ifdef D_DEBUG -/* - * Enam is another unused utility routine: E_phrase is preferable. - */ - -static const char * -Enam(etmp) -struct entity *etmp; -{ - return(is_u(etmp)? "You" : Monnam(etmp->emon)); -} -#endif /* D_DEBUG */ - /* * Generates capitalized entity name, makes 2nd -> 3rd person conversion on * verb, where necessary. @@ -465,10 +449,8 @@ boolean chunks; { int misses; -#ifdef D_DEBUG if (chunks) - pline("Do chunks miss?"); -#endif + debugpline("Do chunks miss?"); if (automiss(etmp)) return(TRUE); @@ -488,9 +470,7 @@ boolean chunks; if (is_db_wall(etmp->ex, etmp->ey)) misses -= 3; /* less airspace */ -#ifdef D_DEBUG - pline("Miss chance = %d (out of 8)", misses); -#endif + debugpline("Miss chance = %d (out of 8)", misses); return((boolean)((misses >= rnd(8))? TRUE : FALSE)); } @@ -519,9 +499,7 @@ struct entity *etmp; if (is_db_wall(etmp->ex, etmp->ey)) tmp -= 2; /* less room to maneuver */ -#ifdef D_DEBUG - pline("%s to jump (%d chances in 10)", E_phrase(etmp, "try"), tmp); -#endif + debugpline("%s to jump (%d chances in 10)", E_phrase(etmp, "try"), tmp); return((boolean)((tmp >= rnd(10))? TRUE : FALSE)); } @@ -554,17 +532,13 @@ struct entity *etmp; if (at_portcullis) pline_The("portcullis misses %s!", e_nam(etmp)); -#ifdef D_DEBUG else - pline_The("drawbridge misses %s!", + debugpline("The drawbridge misses %s!", e_nam(etmp)); -#endif if (e_survives_at(etmp, oldx, oldy)) return; else { -#ifdef D_DEBUG - pline("Mon can't survive here"); -#endif + debugpline("Mon can't survive here"); if (at_portcullis) must_jump = TRUE; else @@ -583,9 +557,7 @@ struct entity *etmp; if (at_portcullis) { if (e_jumps(etmp)) { relocates = TRUE; -#ifdef D_DEBUG - pline("Jump succeeds!"); -#endif + debugpline("Jump succeeds!"); } else { if (e_inview) pline("%s crushed by the falling portcullis!", @@ -598,9 +570,7 @@ struct entity *etmp; } } else { /* tries to jump off bridge to original square */ relocates = !e_jumps(etmp); -#ifdef D_DEBUG - pline("Jump %s!", (relocates)? "fails" : "succeeds"); -#endif + debugpline("Jump %s!", (relocates)? "fails" : "succeeds"); } } @@ -610,17 +580,13 @@ struct entity *etmp; * would be inaccessible (i.e. etmp started on drawbridge square) or * unnecessary (i.e. etmp started here) in such a situation. */ -#ifdef D_DEBUG - pline("Doing relocation."); -#endif + debugpline("Doing relocation."); newx = oldx; newy = oldy; (void)find_drawbridge(&newx, &newy); if ((newx == oldx) && (newy == oldy)) get_wall_for_db(&newx, &newy); -#ifdef D_DEBUG - pline("Checking new square for occupancy."); -#endif + debugpline("Checking new square for occupancy."); if (relocates && (e_at(newx, newy))) { /* @@ -631,30 +597,24 @@ struct entity *etmp; struct entity *other; other = e_at(newx, newy); -#ifdef D_DEBUG - pline("New square is occupied by %s", e_nam(other)); -#endif + debugpline("New square is occupied by %s", e_nam(other)); if (e_survives_at(other, newx, newy) && automiss(other)) { relocates = FALSE; /* "other" won't budge */ -#ifdef D_DEBUG - pline("%s suicide.", E_phrase(etmp, "commit")); -#endif + debugpline("%s suicide.", E_phrase(etmp, "commit")); } else { -#ifdef D_DEBUG - pline("Handling %s", e_nam(other)); -#endif + debugpline("Handling %s", e_nam(other)); while ((e_at(newx, newy) != 0) && (e_at(newx, newy) != etmp)) do_entity(other); + debugpline("Checking existence of %s", e_nam(etmp)); #ifdef D_DEBUG - pline("Checking existence of %s", e_nam(etmp)); wait_synch(); #endif if (e_at(oldx, oldy) != etmp) { -#ifdef D_DEBUG - pline("%s moved or died in recursion somewhere", + debugpline("%s moved or died in recursion somewhere", E_phrase(etmp, "have")); +#ifdef D_DEBUG wait_synch(); #endif return; @@ -662,9 +622,7 @@ struct entity *etmp; } } if (relocates && !e_at(newx, newy)) {/* if e_at() entity = worm tail */ -#ifdef D_DEBUG - pline("Moving %s", e_nam(etmp)); -#endif + debugpline("Moving %s", e_nam(etmp)); if (!is_u(etmp)) { remove_monster(etmp->ex, etmp->ey); place_monster(etmp->emon, newx, newy); @@ -677,13 +635,13 @@ struct entity *etmp; etmp->ey = newy; e_inview = e_canseemon(etmp); } + debugpline("Final disposition of %s", e_nam(etmp)); #ifdef D_DEBUG - pline("Final disposition of %s", e_nam(etmp)); wait_synch(); #endif if (is_db_wall(etmp->ex, etmp->ey)) { + debugpline("%s in portcullis chamber", E_phrase(etmp, "are")); #ifdef D_DEBUG - pline("%s in portcullis chamber", E_phrase(etmp, "are")); wait_synch(); #endif if (e_inview) { @@ -703,13 +661,9 @@ struct entity *etmp; e_died(etmp, 0, CRUSHING); /* no message */ return; } -#ifdef D_DEBUG - pline("%s in here", E_phrase(etmp, "survive")); -#endif + debugpline("%s in here", E_phrase(etmp, "survive")); } else { -#ifdef D_DEBUG - pline("%s on drawbridge square", E_phrase(etmp, "are")); -#endif + debugpline("%s on drawbridge square", E_phrase(etmp, "are")); if (is_pool(etmp->ex, etmp->ey) && !e_inview) if (!Deaf) You_hear("a splash."); @@ -720,9 +674,7 @@ struct entity *etmp; E_phrase(etmp, "fall")); return; } -#ifdef D_DEBUG - pline("%s cannot survive on the drawbridge square",Enam(etmp)); -#endif + debugpline("%s cannot survive on the drawbridge square",E_phrase(etmp, NULL)); if (is_pool(etmp->ex, etmp->ey) || is_lava(etmp->ex, etmp->ey)) if (e_inview && !is_u(etmp)) { /* drown() will supply msgs if nec. */ @@ -938,9 +890,7 @@ int x,y; if (etmp1->edata) { e_inview = e_canseemon(etmp1); if (e_missed(etmp1, TRUE)) { -#ifdef D_DEBUG - pline("%s spared!", E_phrase(etmp1, "are")); -#endif + debugpline("%s spared!", E_phrase(etmp1, "are")); /* if there is water or lava here, fall in now */ if (is_u(etmp1)) spoteffects(FALSE); @@ -957,11 +907,9 @@ int x,y; } else { if (!Deaf && !is_u(etmp1) && !is_pool(x,y)) You_hear("a crushing sound."); -#ifdef D_DEBUG else - pline("%s from shrapnel", + debugpline("%s from shrapnel", E_phrase(etmp1, "die")); -#endif } killer.format = KILLED_BY_AN; Strcpy(killer.name, "collapsing drawbridge"); diff --git a/src/dig.c b/src/dig.c index dee64940c..00a60aaba 100644 --- a/src/dig.c +++ b/src/dig.c @@ -5,8 +5,6 @@ #include "hack.h" -/* #define DEBUG */ /* turn on for diagnostics */ - static NEARDATA boolean did_dig_msg; STATIC_DCL boolean NDECL(rm_waslit); @@ -1692,9 +1690,7 @@ bury_an_obj(otmp) struct obj *otmp2; boolean under_ice; -#ifdef DEBUG - pline("bury_an_obj: %s", xname(otmp)); -#endif + debugpline("bury_an_obj: %s", xname(otmp)); if (otmp == uball) { unpunish(); u.utrap = rn1(50,20); @@ -1756,10 +1752,8 @@ int x, y; { struct obj *otmp, *otmp2; -#ifdef DEBUG if(level.objects[x][y] != (struct obj *)0) - pline("bury_objs: at %d, %d", x, y); -#endif + debugpline("bury_objs: at %d, %d", x, y); for (otmp = level.objects[x][y]; otmp; otmp = otmp2) otmp2 = bury_an_obj(otmp); @@ -1776,9 +1770,7 @@ int x, y; struct obj *otmp, *otmp2, *bball; coord cc; -#ifdef DEBUG - pline("unearth_objs: at %d, %d", x, y); -#endif + debugpline("unearth_objs: at %d, %d", x, y); cc.x = x; cc.y = y; bball = buried_ball(&cc); for (otmp = level.buriedobjlist; otmp; otmp = otmp2) { @@ -1887,9 +1879,7 @@ void bury_monst(mtmp) struct monst *mtmp; { -#ifdef DEBUG - pline("bury_monst: %s", mon_nam(mtmp)); -#endif + debugpline("bury_monst: %s", mon_nam(mtmp)); if(canseemon(mtmp)) { if(is_flyer(mtmp->data) || is_floater(mtmp->data)) { pline_The("%s opens up, but %s is not swallowed!", @@ -1908,9 +1898,7 @@ struct monst *mtmp; void bury_you() { -#ifdef DEBUG - pline("bury_you"); -#endif + debugpline("bury_you"); if (!Levitation && !Flying) { if(u.uswallow) You_feel("a sensation like falling into a trap!"); @@ -1927,9 +1915,7 @@ bury_you() void unearth_you() { -#ifdef DEBUG - pline("unearth_you"); -#endif + debugpline("unearth_you"); u.uburied = FALSE; under_ground(0); if(!uamul || uamul->otyp != AMULET_OF_STRANGULATION) @@ -1940,9 +1926,7 @@ unearth_you() void escape_tomb() { -#ifdef DEBUG - pline("escape_tomb"); -#endif + debugpline("escape_tomb"); if ((Teleportation || can_teleport(youmonst.data)) && (Teleport_control || rn2(3) < Luck+2)) { You("attempt a teleport spell."); @@ -1974,9 +1958,7 @@ bury_obj(otmp) struct obj *otmp; { -#ifdef DEBUG - pline("bury_obj"); -#endif + debugpline("bury_obj"); if(cansee(otmp->ox, otmp->oy)) pline_The("objects on the %s tumble into a hole!", surface(otmp->ox, otmp->oy)); @@ -1987,7 +1969,7 @@ struct obj *otmp; #ifdef DEBUG int -wiz_debug_cmd() /* in this case, bury everything at your loc and around */ +wiz_debug_cmd_bury() /* in this case, bury everything at your loc and around */ { int x, y; diff --git a/src/dungeon.c b/src/dungeon.c index ed6b726de..4c8e6beeb 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -81,6 +81,8 @@ dumpit() s_level *x; branch *br; + if (!showdebug()) return; + for(i = 0; i < n_dgns; i++) { fprintf(stderr, "\n#%d \"%s\" (%s):\n", i, DD.dname, DD.proto); diff --git a/src/eat.c b/src/eat.c index 7259e6424..67e4b88b9 100644 --- a/src/eat.c +++ b/src/eat.c @@ -5,12 +5,6 @@ #include "hack.h" -/* #define DEBUG */ /* uncomment to enable new eat code debugging */ - -#ifdef DEBUG -#define debugpline if (wizard) pline -#endif - STATIC_PTR int NDECL(eatmdone); STATIC_PTR int NDECL(eatfood); STATIC_PTR void FDECL(costly_tin, (int)); @@ -290,15 +284,11 @@ recalc_wt() { struct obj *piece = context.victual.piece; -#ifdef DEBUG debugpline("Old weight = %d", piece->owt); debugpline("Used time = %d, Req'd time = %d", context.victual.usedtime, context.victual.reqtime); -#endif piece->owt = weight(piece); -#ifdef DEBUG debugpline("New weight = %d", piece->owt); -#endif } void @@ -308,9 +298,7 @@ reset_eat() /* called when eating interrupted by an event */ * the round is spent eating. */ if(context.victual.eating && !context.victual.doreset) { -#ifdef DEBUG debugpline("reset_eat..."); -#endif context.victual.doreset = TRUE; } return; @@ -325,9 +313,7 @@ register struct obj *otmp; (void) splitobj(otmp, otmp->quan - 1L); else otmp = splitobj(otmp, 1L); -#ifdef DEBUG debugpline("split object,"); -#endif } if (!otmp->oeaten) { @@ -388,9 +374,7 @@ struct obj *old_obj, *new_obj; STATIC_OVL void do_reset_eat() { -#ifdef DEBUG debugpline("do_reset_eat..."); -#endif if (context.victual.piece) { context.victual.o_id = 0; context.victual.piece = touchfood(context.victual.piece); @@ -731,57 +715,39 @@ register struct permonst *ptr; switch (type) { case FIRE_RES: res = (ptr->mconveys & MR_FIRE) != 0; -#ifdef DEBUG if (res) debugpline("can get fire resistance"); -#endif break; case SLEEP_RES: res = (ptr->mconveys & MR_SLEEP) != 0; -#ifdef DEBUG if (res) debugpline("can get sleep resistance"); -#endif break; case COLD_RES: res = (ptr->mconveys & MR_COLD) != 0; -#ifdef DEBUG if (res) debugpline("can get cold resistance"); -#endif break; case DISINT_RES: res = (ptr->mconveys & MR_DISINT) != 0; -#ifdef DEBUG if (res) debugpline("can get disintegration resistance"); -#endif break; case SHOCK_RES: /* shock (electricity) resistance */ res = (ptr->mconveys & MR_ELEC) != 0; -#ifdef DEBUG if (res) debugpline("can get shock resistance"); -#endif break; case POISON_RES: res = (ptr->mconveys & MR_POISON) != 0; -#ifdef DEBUG if (res) debugpline("can get poison resistance"); -#endif break; case TELEPORT: res = can_teleport(ptr); -#ifdef DEBUG if (res) debugpline("can get teleport"); -#endif break; case TELEPORT_CONTROL: res = control_teleport(ptr); -#ifdef DEBUG if (res) debugpline("can get teleport control"); -#endif break; case TELEPAT: res = telepathic(ptr); -#ifdef DEBUG if (res) debugpline("can get telepathy"); -#endif break; default: /* res stays 0 */ @@ -800,9 +766,7 @@ register struct permonst *ptr; { register int chance; -#ifdef DEBUG debugpline("Attempting to give intrinsic %d", type); -#endif /* some intrinsics are easier to get than others */ switch (type) { case POISON_RES: @@ -831,9 +795,7 @@ register struct permonst *ptr; switch (type) { case FIRE_RES: -#ifdef DEBUG debugpline("Trying to give fire resistance"); -#endif if(!(HFire_resistance & FROMOUTSIDE)) { You(Hallucination ? "be chillin'." : "feel a momentary chill."); @@ -841,27 +803,21 @@ register struct permonst *ptr; } break; case SLEEP_RES: -#ifdef DEBUG debugpline("Trying to give sleep resistance"); -#endif if(!(HSleep_resistance & FROMOUTSIDE)) { You_feel("wide awake."); HSleep_resistance |= FROMOUTSIDE; } break; case COLD_RES: -#ifdef DEBUG debugpline("Trying to give cold resistance"); -#endif if(!(HCold_resistance & FROMOUTSIDE)) { You_feel("full of hot air."); HCold_resistance |= FROMOUTSIDE; } break; case DISINT_RES: -#ifdef DEBUG debugpline("Trying to give disintegration resistance"); -#endif if(!(HDisint_resistance & FROMOUTSIDE)) { You_feel(Hallucination ? "totally together, man." : @@ -870,9 +826,7 @@ register struct permonst *ptr; } break; case SHOCK_RES: /* shock (electricity) resistance */ -#ifdef DEBUG debugpline("Trying to give shock resistance"); -#endif if(!(HShock_resistance & FROMOUTSIDE)) { if (Hallucination) You_feel("grounded in reality."); @@ -882,9 +836,7 @@ register struct permonst *ptr; } break; case POISON_RES: -#ifdef DEBUG debugpline("Trying to give poison resistance"); -#endif if(!(HPoison_resistance & FROMOUTSIDE)) { You_feel(Poison_resistance ? "especially healthy." : "healthy."); @@ -892,9 +844,7 @@ register struct permonst *ptr; } break; case TELEPORT: -#ifdef DEBUG debugpline("Trying to give teleport"); -#endif if(!(HTeleportation & FROMOUTSIDE)) { You_feel(Hallucination ? "diffuse." : "very jumpy."); @@ -902,9 +852,7 @@ register struct permonst *ptr; } break; case TELEPORT_CONTROL: -#ifdef DEBUG debugpline("Trying to give teleport control"); -#endif if(!(HTeleport_control & FROMOUTSIDE)) { You_feel(Hallucination ? "centered in your personal space." : @@ -913,9 +861,7 @@ register struct permonst *ptr; } break; case TELEPAT: -#ifdef DEBUG debugpline("Trying to give telepathy"); -#endif if(!(HTelepat & FROMOUTSIDE)) { You_feel(Hallucination ? "in touch with the cosmos." : @@ -926,9 +872,7 @@ register struct permonst *ptr; } break; default: -#ifdef DEBUG debugpline("Tried to give an impossible intrinsic"); -#endif break; } } @@ -1059,9 +1003,7 @@ register int pm; case PM_DISENCHANTER: /* picks an intrinsic at random and removes it; there's no feedback if hero already lacks the chosen ability */ -#ifdef DEBUG debugpline("using attrcurse to strip an intrinsic"); -#endif attrcurse(); break; case PM_MIND_FLAYER: @@ -1101,9 +1043,7 @@ register int pm; if (conveys_STR) { count = 1; tmp = -1; /* use -1 as fake prop index for STR */ -#ifdef DEBUG debugpline("\"Intrinsic\" strength, %d", tmp); -#endif } for (i = 1; i <= LAST_PROP; i++) { if (!intrinsic_possible(i, ptr)) continue; @@ -1113,9 +1053,7 @@ register int pm; of keeping the old choice (note that 1 in 1 and 0 in 1 are what we want for the first candidate) */ if (!rn2(count)) { -#ifdef DEBUG debugpline("Intrinsic %d replacing %d", i, tmp); -#endif tmp = i; } } @@ -1659,13 +1597,11 @@ start_eating(otmp) /* called as you start to eat */ { const char *old_nomovemsg, *save_nomovemsg; -#ifdef DEBUG debugpline("start_eating: %lx (victual = %lx)", otmp, context.victual.piece); debugpline("reqtime = %d", context.victual.reqtime); debugpline("(original reqtime = %d)", objects[otmp->otyp].oc_delay); debugpline("nmod = %d", context.victual.nmod); debugpline("oeaten = %d", otmp->oeaten); -#endif context.victual.fullwarn = context.victual.doreset = FALSE; context.victual.eating = TRUE; @@ -2505,15 +2441,11 @@ doeat() /* generic "eat" command funtion (see cmd.c) */ if (otmp->otyp == CORPSE) basenutrit = mons[otmp->corpsenm].cnutrit; else basenutrit = objects[otmp->otyp].oc_nutrition; -#ifdef DEBUG debugpline("before rounddiv: context.victual.reqtime == %d", context.victual.reqtime); debugpline("oeaten == %d, basenutrit == %d", otmp->oeaten, basenutrit); -#endif context.victual.reqtime = (basenutrit == 0 ? 0 : rounddiv(context.victual.reqtime * (long)otmp->oeaten, basenutrit)); -#ifdef DEBUG debugpline("after rounddiv: context.victual.reqtime == %d", context.victual.reqtime); -#endif /* calculate the modulo value (nutrit. units per round eating) * note: this isn't exact - you actually lose a little nutrition * due to this method. @@ -2615,9 +2547,7 @@ register int num; { /* See comments in newuhs() for discussion on force_save_hs */ boolean iseating = (occupation == eatfood) || force_save_hs; -#ifdef DEBUG debugpline("lesshungry(%d)", num); -#endif u.uhunger += num; if(u.uhunger >= 2000) { if (!iseating || context.victual.canchoke) { diff --git a/src/files.c b/src/files.c index 03b4d5ea3..f45db8bce 100644 --- a/src/files.c +++ b/src/files.c @@ -2107,6 +2107,9 @@ int src; } else if (src == SET_IN_SYS && match_varname(buf, "SHELLERS", 8)) { if (sysopt.shellers) free(sysopt.shellers); sysopt.shellers = dupstr(bufp); + } else if (src == SET_IN_SYS && match_varname(buf, "DEBUGFILES", 5)) { + if (sysopt.debugfiles) free(sysopt.debugfiles); + sysopt.debugfiles = dupstr(bufp); } else if (src == SET_IN_SYS && match_varname(buf, "SUPPORT", 7)) { if (sysopt.support) free(sysopt.support); sysopt.support = dupstr(bufp); diff --git a/src/hack.c b/src/hack.c index fafff35b6..1edfb9f4e 100644 --- a/src/hack.c +++ b/src/hack.c @@ -767,7 +767,7 @@ int mode; static boolean trav_debug = FALSE; int -wiz_debug_cmd() /* in this case, toggle display of travel debug info */ +wiz_debug_cmd_traveldisplay() /* in this case, toggle display of travel debug info */ { trav_debug = !trav_debug; return 0; diff --git a/src/light.c b/src/light.c index 244126021..f7d43eeee 100644 --- a/src/light.c +++ b/src/light.c @@ -393,18 +393,14 @@ write_ls(fd, ls) otmp = ls->id.a_obj; ls->id = zeroany; ls->id.a_uint = otmp->o_id; -#ifdef DEBUG - if (find_oid((unsigned)ls->id) != otmp) - panic("write_ls: can't find obj #%u!", ls->id.a_uint); -#endif + if (find_oid((unsigned)ls->id.a_uint) != otmp) + debugpline("write_ls: can't find obj #%u!", ls->id.a_uint); } else { /* ls->type == LS_MONSTER */ mtmp = (struct monst *)ls->id.a_monst; ls->id = zeroany; ls->id.a_uint = mtmp->m_id; -#ifdef DEBUG - if (find_mid((unsigned)ls->id, FM_EVERYWHERE) != mtmp) - panic("write_ls: can't find mon #%u!", ls->x_id); -#endif + if (find_mid((unsigned)ls->id.a_uint, FM_EVERYWHERE) != mtmp) + debugpline("write_ls: can't find mon #%u!", ls->id.a_uint); } ls->flags |= LSF_NEEDS_FIXUP; bwrite(fd, (genericptr_t)ls, sizeof(light_source)); diff --git a/src/makemon.c b/src/makemon.c index 9b63c72ec..afaa0140a 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -93,9 +93,7 @@ register int x, y, n; int cnttmp,cntdiv; cnttmp = cnt; -# ifdef DEBUG - pline("init group call x=%d,y=%d,n=%d,cnt=%d.", x, y, n, cnt); -# endif + debugpline("init group call x=%d,y=%d,n=%d,cnt=%d.", x, y, n, cnt); cntdiv = ((u.ulevel < 3) ? 4 : (u.ulevel < 5) ? 2 : 1); #endif /* Tuning: cut down on swarming at low character levels [mrs] */ @@ -760,10 +758,8 @@ boolean ghostly; mvitals[mndx].born++; if ((int) mvitals[mndx].born >= lim && !(mons[mndx].geno & G_NOGEN) && !(mvitals[mndx].mvflags & G_EXTINCT)) { -#ifdef DEBUG - if (wizard) pline("Automatically extinguished %s.", + if (wizard) debugpline("Automatically extinguished %s.", makeplural(mons[mndx].mname)); -#endif mvitals[mndx].mvflags |= G_EXTINCT; reset_rndmonst(mndx); } @@ -906,11 +902,9 @@ register int mmflags; /* if you are to make a specific monster and it has already been genocided, return */ if (mvitals[mndx].mvflags & G_GENOD) return((struct monst *) 0); -#ifdef DEBUG if (wizard && (mvitals[mndx].mvflags & G_EXTINCT)) - pline("Explicitly creating extinct monster %s.", + debugpline("Explicitly creating extinct monster %s.", mons[mndx].mname); -#endif } else { /* make a random (common) monster that can survive here. * (the special levels ask for random monsters at specific @@ -922,9 +916,7 @@ register int mmflags; do { if(!(ptr = rndmonst())) { -#ifdef DEBUG - pline("Warning: no monster."); -#endif + debugpline("Warning: no monster."); return((struct monst *) 0); /* no more monsters! */ } fakemon.data = ptr; /* set up for goodpos */ @@ -1260,9 +1252,7 @@ rndmonst() } if (mndx == SPECIAL_PM) { /* evidently they've all been exterminated */ -#ifdef DEBUG - pline("rndmonst: no common mons!"); -#endif + debugpline("rndmonst: no common mons!"); return (struct permonst *)0; } /* else `mndx' now ready for use below */ zlevel = level_difficulty(); @@ -1300,9 +1290,7 @@ rndmonst() if (rndmonst_state.choice_count <= 0) { /* maybe no common mons left, or all are too weak or too strong */ -#ifdef DEBUG - Norep("rndmonst: choice_count=%d", rndmonst_state.choice_count); -#endif + debugpline("rndmonst: choice_count=%d", rndmonst_state.choice_count); return (struct permonst *)0; } diff --git a/src/mklev.c b/src/mklev.c index 43bccaf40..2d4899984 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -4,11 +4,6 @@ /* NetHack may be freely redistributed. See license for details. */ #include "hack.h" -/* #define DEBUG */ /* uncomment to enable code debugging */ - -#ifdef DEBUG -#define debugpline if (wizard) pline -#endif /* for UNIX, Rand #def'd to (long)lrand48() or (long)random() */ /* croom->lx etc are schar (width <= int), so % arith ensures that */ @@ -689,9 +684,7 @@ makelevel() /* make a secret treasure vault, not connected to the rest */ if(do_vault()) { xchar w,h; -#ifdef DEBUG debugpline("trying to make a vault..."); -#endif w = 1; h = 1; if (check_room(&vault_x, &w, &vault_y, &h, TRUE)) { @@ -1567,9 +1560,7 @@ xchar x, y; *source = u.uz; insert_branch(br, TRUE); -#ifdef DEBUG - pline("Made knox portal."); -#endif + debugpline("Made knox portal."); place_branch(br, x, y); } diff --git a/src/mkmaze.c b/src/mkmaze.c index 7f4536869..0cfdbe35a 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -587,12 +587,10 @@ register const char *s; int x_range = x_maze_max - x_maze_min - 2*INVPOS_X_MARGIN - 1, y_range = y_maze_max - y_maze_min - 2*INVPOS_Y_MARGIN - 1; -#ifdef DEBUG if (x_range <= INVPOS_X_MARGIN || y_range <= INVPOS_Y_MARGIN || (x_range * y_range) <= (INVPOS_DISTANCE * INVPOS_DISTANCE)) - panic("inv_pos: maze is too small! (%d x %d)", + debugpline("inv_pos: maze is too small! (%d x %d)", x_maze_max, y_maze_max); -#endif inv_pos.x = inv_pos.y = 0; /*{occupied() => invocation_pos()}*/ do { x = rn1(x_range, x_maze_min + INVPOS_X_MARGIN + 1); @@ -879,10 +877,8 @@ register xchar x, y, todnum, todlevel; impossible("portal on top of portal??"); return; } -#ifdef DEBUG - pline("mkportal: at (%d,%d), to %s, level %d", + debugpline("mkportal: at (%d,%d), to %s, level %d", x, y, dungeons[todnum].dname, todlevel); -#endif ttmp->dst.dnum = todnum; ttmp->dst.dlevel = todlevel; return; diff --git a/src/mkobj.c b/src/mkobj.c index 47b6668e7..08bb41bfb 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -17,8 +17,6 @@ STATIC_DCL void FDECL(insane_object, (struct obj *,const char *,const char *,struct monst *)); STATIC_DCL void FDECL(check_contained, (struct obj *,const char *)); -/*#define DEBUG_EFFECTS*/ /* show some messages for debugging */ - struct icp { int iprob; /* probability of an item type */ char iclass; /* item class */ @@ -1526,12 +1524,10 @@ struct obj *otmp; /* Adjust the age; must be same as obj_timer_checks() for off ice*/ age = monstermoves - otmp->age; retval += age * (ROT_ICE_ADJUSTMENT-1) / ROT_ICE_ADJUSTMENT; -#ifdef DEBUG_EFFECTS - pline_The("%s age has ice modifications:otmp->age = %ld, returning %ld.", + debugpline("The %s age has ice modifications:otmp->age = %ld, returning %ld.", s_suffix(doname(otmp)),otmp->age, retval); - pline("Effective age of corpse: %ld.", + debugpline("Effective age of corpse: %ld.", monstermoves - retval); -#endif } return retval; } @@ -1560,9 +1556,7 @@ int force; /* 0 = no force so do checks, <0 = force off, >0 force on */ /* mark the corpse as being on ice */ otmp->on_ice = 1; -#ifdef DEBUG_EFFECTS - pline("%s is now on ice at %d,%d.", The(xname(otmp)),x,y); -#endif + debugpline("%s is now on ice at %d,%d.", The(xname(otmp)),x,y); /* Adjust the time remaining */ tleft *= ROT_ICE_ADJUSTMENT; restart_timer = TRUE; @@ -1588,9 +1582,7 @@ int force; /* 0 = no force so do checks, <0 = force off, >0 force on */ long age; otmp->on_ice = 0; -#ifdef DEBUG_EFFECTS - pline("%s is no longer on ice at %d,%d.", The(xname(otmp)),x,y); -#endif + debugpline("%s is no longer on ice at %d,%d.", The(xname(otmp)),x,y); /* Adjust the remaining time */ tleft /= ROT_ICE_ADJUSTMENT; restart_timer = TRUE; diff --git a/src/mon.c b/src/mon.c index 0de59cf8a..d3841462e 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1278,10 +1278,8 @@ register struct monst *mtmp, *mtmp2; /* transfer the monster's inventory */ for (otmp = mtmp2->minvent; otmp; otmp = otmp->nobj) { -#ifdef DEBUG if (otmp->where != OBJ_MINVENT || otmp->ocarry != mtmp) - panic("replmon: minvent inconsistency"); -#endif + debugpline("replmon: minvent inconsistency"); otmp->ocarry = mtmp2; } mtmp->minvent = 0; diff --git a/src/pickup.c b/src/pickup.c index 30188e5f2..ee0d91dc7 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -903,9 +903,7 @@ int how; /* type of query */ (*pick_list)->item.a_int = curr->oclass; return 1; } else { -#ifdef DEBUG - impossible("query_category: no single object match"); -#endif + debugpline("query_category: no single object match"); } return 0; } diff --git a/src/questpgr.c b/src/questpgr.c index 9f717754f..e85877840 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -12,8 +12,6 @@ #define QTEXT_FILE "quest.dat" -/* #define DEBUG */ /* uncomment for debugging */ - /* from sp_lev.c, for deliver_splev_message() */ extern char *lev_message; @@ -46,6 +44,8 @@ dump_qtlist() /* dump the character msg list to check appearance */ struct qtmsg *msg; long size; + if (!showdebug()) return; + for (msg = qt_list.chrole; msg->msgnum > 0; msg++) { pline("msgnum %d: delivery %c", msg->msgnum, msg->delivery); @@ -54,7 +54,10 @@ dump_qtlist() /* dump the character msg list to check appearance */ deliver_by_window(msg, NHW_TEXT); } } -#endif /* DEBUG */ +#else +static void +dump_qtlist() { } +#endif /* !DEBUG */ static void Fread(ptr, size, nitems, stream) @@ -133,9 +136,7 @@ load_qtlist() if (!qt_list.common || !qt_list.chrole) impossible("load_qtlist: cannot load quest text."); -#ifdef DEBUG dump_qtlist(); -#endif return; /* no ***DON'T*** close the msg_file */ } diff --git a/src/restore.c b/src/restore.c index b4d4bb7fb..af974d147 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1153,9 +1153,7 @@ register int fd; ++msgcount; } if (msgcount) putmsghistory((char *)0, TRUE); -#ifdef DEBUG_MSGCOUNT - pline("Read %d messages from savefile.", msgcount); -#endif + debugpline("Read %d messages from savefile.", msgcount); } /* Clear all structures for object and monster ID mapping. */ diff --git a/src/rnd.c b/src/rnd.c index a2ce45685..662d1a275 100644 --- a/src/rnd.c +++ b/src/rnd.c @@ -5,10 +5,6 @@ #include "hack.h" -#if defined(BETA) && !defined(DEBUG) && !defined(NODEBUG) -#define DEBUG -#endif - /* "Rand()"s definition is determined by [OS]conf.h */ #if defined(LINT) && defined(UNIX) /* rand() is long... */ extern int NDECL(rand); @@ -26,9 +22,9 @@ int rn2(x) /* 0 <= rn2(x) < x */ register int x; { -#ifdef DEBUG +#ifdef BETA if (x <= 0) { - impossible("rn2(%d) attempted", x); + debugpline("rn2(%d) attempted", x); return(0); } x = RND(x); @@ -44,9 +40,9 @@ register int x; /* good luck approaches 0, bad luck approaches (x-1) */ { register int i, adjustment; -#ifdef DEBUG +#ifdef BETA if (x <= 0) { - impossible("rnl(%d) attempted", x); + debugpline("rnl(%d) attempted", x); return(0); } #endif @@ -83,9 +79,9 @@ int rnd(x) /* 1 <= rnd(x) <= x */ register int x; { -#ifdef DEBUG +#ifdef BETA if (x <= 0) { - impossible("rnd(%d) attempted", x); + debugpline("rnd(%d) attempted", x); return(1); } x = RND(x)+1; @@ -101,9 +97,9 @@ register int n, x; { register int tmp = n; -#ifdef DEBUG +#ifdef BETA if (x < 0 || n < 0 || (x == 0 && n != 0)) { - impossible("d(%d,%d) attempted", n, x); + debugpline("d(%d,%d) attempted", n, x); return(1); } #endif diff --git a/src/save.c b/src/save.c index 88db771e2..1fa51dfaa 100644 --- a/src/save.c +++ b/src/save.c @@ -1210,9 +1210,7 @@ int fd, mode; } bwrite(fd, (genericptr_t) &minusone, sizeof(int)); } -#ifdef DEBUG_MSGCOUNT - pline("Stored %d messages into savefile.", msgcount); -#endif + debugpline("Stored %d messages into savefile.", msgcount); /* note: we don't attempt to handle release_data() here */ } diff --git a/src/shk.c b/src/shk.c index 0fe0e94db..12f22eb40 100644 --- a/src/shk.c +++ b/src/shk.c @@ -5,8 +5,6 @@ #include "hack.h" -/*#define DEBUG*/ - #define PAY_SOME 2 #define PAY_BUY 1 #define PAY_CANT 0 /* too poor */ @@ -1207,9 +1205,7 @@ dopay() } if(!shkp) { -#ifdef DEBUG - pline("dopay: null shkp."); -#endif + debugpline("dopay: null shkp."); return(0); } proceed: diff --git a/src/sp_lev.c b/src/sp_lev.c index f27637b9b..6be2c9713 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -12,11 +12,6 @@ #include "hack.h" #include "dlb.h" -/* #define DEBUG */ /* uncomment to enable code debugging */ - -#ifdef DEBUG -#define debugpline if (wizard) pline -#endif #include "sp_lev.h" @@ -329,10 +324,8 @@ chk: lev = &levl[x][y]; for (; y <= ymax; y++) { if (lev++->typ) { -#ifdef DEBUG if(!vault) debugpline("strange area [%d,%d] in check_room.",x,y); -#endif if (!rn2(3)) return FALSE; if (x < *lowx) *lowx = x + xlim + 1; @@ -405,9 +398,7 @@ xchar rtype, rlit; r1 = rnd_rect(); /* Get a random rectangle */ if (!r1) { /* No more free rectangles ! */ -#ifdef DEBUG debugpline("No more rects..."); -#endif return FALSE; } hx = r1->hx; @@ -1320,10 +1311,8 @@ schar ftyp, btyp; if (xx <= 0 || yy <= 0 || tx <= 0 || ty <= 0 || xx > COLNO-1 || tx > COLNO-1 || yy > ROWNO-1 || ty > ROWNO-1) { -#ifdef DEBUG debugpline("dig_corridor: bad coords : (%d,%d) (%d,%d).", xx,yy,tx,ty); -#endif return FALSE; } if (tx > xx) dx = 1; diff --git a/src/steal.c b/src/steal.c index 0812a79df..bf7238b01 100644 --- a/src/steal.c +++ b/src/steal.c @@ -424,12 +424,12 @@ register struct monst *mtmp; register struct obj *otmp; { int freed_otmp; + boolean snuff_otmp = FALSE; /* if monster is acquiring a thrown or kicked object, the throwing or kicking code shouldn't continue to track and place it */ if (otmp == thrownobj) thrownobj = 0; else if (otmp == kickedobj) kickedobj = 0; - boolean snuff_otmp = FALSE; /* don't want hidden light source inside the monster; assumes that engulfers won't have external inventories; whirly monsters cause the light to be extinguished rather than letting it shine thru */ diff --git a/src/sys.c b/src/sys.c index 2f6c5fd87..b559c1450 100644 --- a/src/sys.c +++ b/src/sys.c @@ -20,6 +20,7 @@ sys_early_init(){ #else sysopt.wizards = WIZARD_NAME; #endif + sysopt.debugfiles = NULL; sysopt.shellers = NULL; sysopt.maxplayers = 0; /* XXX eventually replace MAX_NR_OF_PLAYERS */ diff --git a/src/teleport.c b/src/teleport.c index ab8bb063e..cd179c1f1 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -121,9 +121,7 @@ unsigned entflags; struct monst fakemon; /* dummy monster */ if (!mdat) { -#ifdef DEBUG - pline("enexto() called with mdat==0"); -#endif + debugpline("enexto() called with mdat==0"); /* default to player's original monster type */ mdat = &mons[u.umonster]; } diff --git a/src/zap.c b/src/zap.c index c4d98c33c..97fa65a15 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1717,9 +1717,7 @@ struct obj *obj, *otmp; if (context.bypasses) return 0; else { -#ifdef DEBUG - pline("%s for a moment.", Tobjnam(obj, "pulsate")); -#endif + debugpline("%s for a moment.", Tobjnam(obj, "pulsate")); obj->bypass = 0; } } @@ -3418,9 +3416,7 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */ resist(mon, type < ZT_SPELL(0) ? WAND_CLASS : '\0', 0, NOTELL)) tmp /= 2; if (tmp < 0) tmp = 0; /* don't allow negative damage */ -#ifdef WIZ_PATCH_DEBUG - pline("zapped monster hp = %d (= %d - %d)", mon->mhp-tmp,mon->mhp,tmp); -#endif + debugpline("zapped monster hp = %d (= %d - %d)", mon->mhp-tmp,mon->mhp,tmp); mon->mhp -= tmp; return(tmp); } diff --git a/sys/unix/sysconf b/sys/unix/sysconf index 3eb07ecaa..74e7fb1ae 100644 --- a/sys/unix/sysconf +++ b/sys/unix/sysconf @@ -14,6 +14,11 @@ WIZARDS=root games # Uses the same syntax as the WIZARDS option above. #SHELLERS= +# Show debugging information originating from these source files. +# Use '*' for all, or list source files separated by spaces. +# Only available if game has been compiled with DEBUG. +#DEBUGFILES=* + # Limit the number of simultaneous games (see also nethack.sh). MAXPLAYERS=10 diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 12ec044b3..d4c921501 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1946,7 +1946,7 @@ register int x, y; /* not xchar: perhaps xchar is unsigned and case NHW_TEXT: s = "[text window]"; break; case NHW_BASE: s = "[base window]"; break; } - impossible("bad curs positioning win %d %s (%d,%d)", window, s, x, y); + debugpline("bad curs positioning win %d %s (%d,%d)", window, s, x, y); return; } #endif From 6e9fa71b0523a8de55730dd85eb3742dc0fd0fe4 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 27 Feb 2015 19:05:01 -0500 Subject: [PATCH 017/354] Make SEDUCE unconditional. --- include/config.h | 1 - include/extern.h | 2 -- include/monattk.h | 1 - include/sys.h | 6 +----- src/mhitm.c | 2 -- src/mhitu.c | 23 ++++------------------- src/monst.c | 10 ++-------- src/sounds.c | 2 -- src/sys.c | 2 -- src/uhitm.c | 2 -- src/zap.c | 2 -- util/makedefs.c | 3 --- 12 files changed, 7 insertions(+), 49 deletions(-) diff --git a/include/config.h b/include/config.h index 1af4b0560..3084be864 100644 --- a/include/config.h +++ b/include/config.h @@ -417,7 +417,6 @@ typedef unsigned char uchar; /* dungeon levels */ #define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */ /* monsters & objects */ -#define SEDUCE /* Succubi/incubi seduction, by KAA, suggested by IM */ /* I/O */ #define REDO /* support for redoing last command - DGK */ #if !defined(MAC) diff --git a/include/extern.h b/include/extern.h index 492718730..9f03e8151 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1112,9 +1112,7 @@ E boolean NDECL(gulp_blnd_check); E int FDECL(gazemu, (struct monst *,struct attack *)); E void FDECL(mdamageu, (struct monst *,int)); E int FDECL(could_seduce, (struct monst *,struct monst *,struct attack *)); -#ifdef SEDUCE E int FDECL(doseduce, (struct monst *)); -#endif /* ### minion.c ### */ diff --git a/include/monattk.h b/include/monattk.h index 7c228c87d..1bd7ff616 100644 --- a/include/monattk.h +++ b/include/monattk.h @@ -72,7 +72,6 @@ #define AD_DISE 33 /* confers diseases */ #define AD_DCAY 34 /* decays organics (brown Pudding) */ #define AD_SSEX 35 /* Succubus seduction (extended) */ - /* If no SEDUCE then same as AD_SEDU */ #define AD_HALU 36 /* causes hallucination */ #define AD_DETH 37 /* for Death only */ #define AD_PEST 38 /* for Pestilence only */ diff --git a/include/sys.h b/include/sys.h index ac39239ee..713e33a55 100644 --- a/include/sys.h +++ b/include/sys.h @@ -35,11 +35,7 @@ struct sysopt { }; E struct sysopt sysopt; -#ifdef SEDUCE -# define SYSOPT_SEDUCE sysopt.seduce -#else -# define SYSOPT_SEDUCE 0 -#endif +#define SYSOPT_SEDUCE sysopt.seduce #endif /* SYS_H */ diff --git a/src/mhitm.c b/src/mhitm.c index 0e8bf7d1c..24e5c7f1c 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1083,9 +1083,7 @@ mdamagem(magr, mdef, mattk) /* Automatic kill if drained past level 0 */ } break; -#ifdef SEDUCE case AD_SSEX: -#endif case AD_SITM: /* for now these are the same */ case AD_SEDU: if (magr->mcan) break; diff --git a/src/mhitu.c b/src/mhitu.c index 511513f39..6f298ff63 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -12,9 +12,7 @@ STATIC_DCL void FDECL(urustm, (struct monst *, struct obj *)); STATIC_DCL boolean FDECL(u_slip_free, (struct monst *,struct attack *)); STATIC_DCL int FDECL(passiveum, (struct permonst *,struct monst *,struct attack *)); -#ifdef SEDUCE STATIC_DCL void FDECL(mayberem, (struct obj *, const char *)); -#endif STATIC_DCL boolean FDECL(diseasemu, (struct permonst *)); STATIC_DCL int FDECL(hitmu, (struct monst *,struct attack *)); @@ -1256,7 +1254,6 @@ dopois: if(!mtmp->mcan) stealgold(mtmp); break; -#ifdef SEDUCE case AD_SSEX: if(SYSOPT_SEDUCE){ if(could_seduce(mtmp, &youmonst, mattk) == 1 @@ -1266,7 +1263,6 @@ dopois: break; } /* else FALLTHRU */ -#endif case AD_SITM: /* for now these are the same */ case AD_SEDU: if (is_animal(mtmp->data)) { @@ -1274,10 +1270,7 @@ dopois: if (mtmp->mcan) break; /* Continue below */ } else if (dmgtype(youmonst.data, AD_SEDU) -#ifdef SEDUCE - || (SYSOPT_SEDUCE && dmgtype(youmonst.data, AD_SSEX)) -#endif - ) { + || (SYSOPT_SEDUCE && dmgtype(youmonst.data, AD_SSEX))) { pline("%s %s.", Monnam(mtmp), mtmp->minvent ? "brags about the goods some dungeon explorer provided" : "makes some remarks about how difficult theft is lately"); @@ -2198,19 +2191,13 @@ struct attack *mattk; gendef = gender(mdef); } - if(agrinvis && !defperc -#ifdef SEDUCE - && (!SYSOPT_SEDUCE || ( mattk && mattk->adtyp != AD_SSEX)) -#endif - ) + if(agrinvis && !defperc && + (!SYSOPT_SEDUCE || ( mattk && mattk->adtyp != AD_SSEX))) return 0; if(pagr->mlet != S_NYMPH && ((pagr != &mons[PM_INCUBUS] && pagr != &mons[PM_SUCCUBUS]) -#ifdef SEDUCE - || (SYSOPT_SEDUCE && mattk && mattk->adtyp != AD_SSEX) -#endif - )) + || (SYSOPT_SEDUCE && mattk && mattk->adtyp != AD_SSEX))) return 0; if(genagr == 1 - gendef) @@ -2219,7 +2206,6 @@ struct attack *mattk; return (pagr->mlet == S_NYMPH) ? 2 : 0; } -#ifdef SEDUCE /* Returns 1 if monster teleported */ int doseduce(mon) @@ -2485,7 +2471,6 @@ const char *str; } remove_worn_item(obj, TRUE); } -#endif /* SEDUCE */ STATIC_OVL int passiveum(olduasmon,mtmp,mattk) diff --git a/src/monst.c b/src/monst.c index 420118eda..d6b843b6c 100644 --- a/src/monst.c +++ b/src/monst.c @@ -2554,14 +2554,9 @@ struct permonst _mons2[] = { #define SEDUCTION_ATTACKS_NO \ A(ATTK(AT_CLAW, AD_PHYS, 1, 3), ATTK(AT_CLAW, AD_PHYS, 1, 3), \ ATTK(AT_BITE, AD_DRLI, 2, 6), NO_ATTK, NO_ATTK, NO_ATTK) -#ifdef SEDUCE -# define SEDUCTION_ATTACKS SEDUCTION_ATTACKS_YES -#else -# define SEDUCTION_ATTACKS SEDUCTION_ATTACKS_NO -#endif MON("succubus", S_DEMON, LVL(6, 12, 0, 70, -9), (G_NOCORPSE|1), - SEDUCTION_ATTACKS, + SEDUCTION_ATTACKS_YES, SIZ(WT_HUMAN, 400, MS_SEDUCE, MZ_HUMAN), MR_FIRE|MR_POISON, 0, M1_HUMANOID|M1_FLY|M1_POIS, M2_DEMON|M2_STALK|M2_HOSTILE|M2_NASTY|M2_FEMALE, @@ -2577,12 +2572,11 @@ struct permonst _mons2[] = { CLR_BROWN), MON("incubus", S_DEMON, LVL(6, 12, 0, 70, -9), (G_NOCORPSE|1), - SEDUCTION_ATTACKS, + SEDUCTION_ATTACKS_YES, SIZ(WT_HUMAN, 400, MS_SEDUCE, MZ_HUMAN), MR_FIRE|MR_POISON, 0, M1_HUMANOID|M1_FLY|M1_POIS, M2_DEMON|M2_STALK|M2_HOSTILE|M2_NASTY|M2_MALE, M3_INFRAVISIBLE|M3_INFRAVISION, CLR_GRAY), -#undef SEDUCTION_ATTACKS /* Used by AD&D for a type of demon, originally one of the Furies */ /* and spelled this way */ MON("erinys", S_DEMON, diff --git a/src/sounds.c b/src/sounds.c index 593c3ecd6..d57904778 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -807,7 +807,6 @@ register struct monst *mtmp; case MS_SEDUCE: { int swval; -#ifdef SEDUCE if (SYSOPT_SEDUCE) { if (ptr->mlet != S_NYMPH && could_seduce(mtmp, &youmonst, (struct attack *)0) == 1) { @@ -816,7 +815,6 @@ register struct monst *mtmp; } swval = ((poly_gender() != (int) mtmp->female) ? rn2(3) : 0); } else -#endif swval = ((poly_gender() == 0) ? rn2(3) : 0); switch(swval){ case 2: diff --git a/src/sys.c b/src/sys.c index b559c1450..5f17a0a91 100644 --- a/src/sys.c +++ b/src/sys.c @@ -54,10 +54,8 @@ sys_early_init(){ # endif #endif -#ifdef SEDUCE sysopt.seduce = 1; /* if it's compiled in, default to on */ sysopt_seduce_set(sysopt.seduce); -#endif } diff --git a/src/uhitm.c b/src/uhitm.c index 04ec05c11..bbb3a7fb4 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1452,9 +1452,7 @@ register struct attack *mattk; minstapetrify(mdef, TRUE); tmp = 0; break; -#ifdef SEDUCE case AD_SSEX: -#endif case AD_SEDU: case AD_SITM: steal_it(mdef, mattk); diff --git a/src/zap.c b/src/zap.c index 97fa65a15..cbc533041 100644 --- a/src/zap.c +++ b/src/zap.c @@ -584,9 +584,7 @@ coord *cc; /* most cancelled monsters return to normal, but some need to stay cancelled */ if (!dmgtype(mtmp2->data, AD_SEDU) -#ifdef SEDUCE && (!SYSOPT_SEDUCE || !dmgtype(mtmp2->data, AD_SSEX)) -#endif ) mtmp2->mcan = 0; mtmp2->mcansee = 1; /* set like in makemon */ mtmp2->mblinded = 0; diff --git a/util/makedefs.c b/util/makedefs.c index 9102945ce..32107d0ab 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1298,9 +1298,6 @@ static const char *build_opts[] = { # endif # endif #endif -#ifdef SEDUCE - "seduction", -#endif #ifdef SHELL "shell command", #endif From b138d380eafedf59cf3d5a7bcdf0926ebfd9c6c0 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 27 Feb 2015 19:06:01 -0500 Subject: [PATCH 018/354] Make BARGETHROUGH unconditional. --- include/config.h | 1 - include/extern.h | 6 ------ include/mfndpos.h | 2 -- include/mondata.h | 2 -- include/monflag.h | 1 - src/dogmove.c | 20 -------------------- src/mhitm.c | 2 -- src/mon.c | 12 ------------ src/monmove.c | 12 ------------ util/makedefs.c | 3 --- 10 files changed, 61 deletions(-) diff --git a/include/config.h b/include/config.h index 3084be864..399217b6f 100644 --- a/include/config.h +++ b/include/config.h @@ -425,7 +425,6 @@ typedef unsigned char uchar; # endif #endif #define AUTOPICKUP_EXCEPTIONS /* exceptions to autopickup */ -#define BARGETHROUGH /* allow some monsters to move others out of their way */ #ifdef REDO # define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ diff --git a/include/extern.h b/include/extern.h index 9f03e8151..e4cccef6f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -520,9 +520,7 @@ E void FDECL(clear_symsetentry, (int,BOOLEAN_P)); E void FDECL(update_l_symset, (struct symparse *,int)); E void FDECL(update_r_symset, (struct symparse *,int)); #endif -#ifdef BARGETHROUGH E boolean FDECL(cursed_object_at, (int, int)); -#endif /* ### dungeon.c ### */ @@ -1090,9 +1088,7 @@ E int FDECL(buzzmu, (struct monst *,struct attack *)); E int FDECL(fightm, (struct monst *)); E int FDECL(mattackm, (struct monst *,struct monst *)); E boolean FDECL(engulf_target, (struct monst *,struct monst *)); -#ifdef BARGETHROUGH E int FDECL(mdisplacem, (struct monst *,struct monst *,BOOLEAN_P)); -#endif E void FDECL(paralyze_monst, (struct monst *,int)); E int FDECL(sleep_monst, (struct monst *,int,int)); E void FDECL(slept_monst, (struct monst *)); @@ -1374,11 +1370,9 @@ E boolean FDECL(accessible, (int,int)); E void FDECL(set_apparxy, (struct monst *)); E boolean FDECL(can_ooze, (struct monst *)); E boolean FDECL(can_fog, (struct monst *)); -#ifdef BARGETHROUGH E boolean FDECL(should_displace, (struct monst *,coord *,long *,int, XCHAR_P,XCHAR_P)); E boolean FDECL(undesirable_disp, (struct monst *,XCHAR_P,XCHAR_P)); -#endif /* ### monst.c ### */ diff --git a/include/mfndpos.h b/include/mfndpos.h index ffbb50d74..00406798d 100644 --- a/include/mfndpos.h +++ b/include/mfndpos.h @@ -7,9 +7,7 @@ #ifndef MFNDPOS_H #define MFNDPOS_H -#ifdef BARGETHROUGH #define ALLOW_MDISP 0x00001000L /* can displace a monster out of its way */ -#endif #define ALLOW_TRAPS 0x00020000L /* can enter traps */ #define ALLOW_U 0x00040000L /* can attack you */ #define ALLOW_M 0x00080000L /* can attack other monsters */ diff --git a/include/mondata.h b/include/mondata.h index 3996e439e..e5c7332ea 100644 --- a/include/mondata.h +++ b/include/mondata.h @@ -131,9 +131,7 @@ #define is_covetous(ptr) ((ptr->mflags3 & M3_COVETOUS)) #define infravision(ptr) ((ptr->mflags3 & M3_INFRAVISION)) #define infravisible(ptr) ((ptr->mflags3 & M3_INFRAVISIBLE)) -#ifdef BARGETHROUGH #define is_displacer(ptr) (((ptr)->mflags3 & M3_DISPLACES) != 0L) -#endif #define is_mplayer(ptr) (((ptr) >= &mons[PM_ARCHEOLOGIST]) && \ ((ptr) <= &mons[PM_WIZARD])) #define is_rider(ptr) ((ptr) == &mons[PM_DEATH] || \ diff --git a/include/monflag.h b/include/monflag.h index bf6875581..df703dc3d 100644 --- a/include/monflag.h +++ b/include/monflag.h @@ -161,7 +161,6 @@ #define M3_INFRAVISION 0x0100 /* has infravision */ #define M3_INFRAVISIBLE 0x0200 /* visible by infravision */ -/* define the bit even if BARGETHROUGH is not defined for savefile compat. */ #define M3_DISPLACES 0x0400 /* moves monsters out of its way */ #define MZ_TINY 0 /* < 2' */ diff --git a/src/dogmove.c b/src/dogmove.c index 0b6e7a6f8..604c52267 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -109,19 +109,11 @@ struct monst *mon; static NEARDATA const char nofetch[] = { BALL_CLASS, CHAIN_CLASS, ROCK_CLASS, 0 }; -#ifndef BARGETHROUGH -STATIC_OVL boolean FDECL(cursed_object_at, (int, int)); -#endif /* not BARGETHROUGH */ - STATIC_VAR xchar gtyp, gx, gy; /* type and position of dog's current goal */ STATIC_PTR void FDECL(wantdoor, (int, int, genericptr_t)); -#ifdef BARGETHROUGH boolean -#else -STATIC_OVL boolean -#endif cursed_object_at(x, y) int x, y; { @@ -584,9 +576,7 @@ register int after; /* this is extra fast monster movement */ struct obj *obj = (struct obj *) 0; xchar otyp; boolean has_edog, cursemsg[9], do_eat = FALSE; -#ifdef BARGETHROUGH boolean better_with_displacing = FALSE; -#endif xchar nix, niy; /* position mtmp is (considering) moving to */ register int nx, ny; /* temporary coordinates */ xchar cnt, uncursedcnt, chcnt; @@ -642,9 +632,7 @@ register int after; /* this is extra fast monster movement */ if (passes_walls(mtmp->data)) allowflags |= (ALLOW_ROCK | ALLOW_WALL); if (passes_bars(mtmp->data)) allowflags |= ALLOW_BARS; if (throws_rocks(mtmp->data)) allowflags |= ALLOW_ROCK; -#ifdef BARGETHROUGH if (is_displacer(mtmp->data)) allowflags |= ALLOW_MDISP; -#endif if (Conflict && !resist(mtmp, RING_CLASS, 0, 0)) { allowflags |= ALLOW_U; if (!has_edog) { @@ -681,19 +669,13 @@ register int after; /* this is extra fast monster movement */ uncursedcnt = 0; for (i = 0; i < cnt; i++) { nx = poss[i].x; ny = poss[i].y; -#ifdef BARGETHROUGH if (MON_AT(nx,ny) && !((info[i] & ALLOW_M) || info[i] & ALLOW_MDISP)) continue; -#else - if (MON_AT(nx,ny) && !(info[i] & ALLOW_M)) continue; -#endif if (cursed_object_at(nx, ny)) continue; uncursedcnt++; } -#ifdef BARGETHROUGH better_with_displacing = should_displace(mtmp,poss,info,cnt,gx,gy); -#endif chcnt = 0; chi = -1; @@ -747,7 +729,6 @@ register int after; /* this is extra fast monster movement */ } return 0; } -#ifdef BARGETHROUGH if ((info[i] & ALLOW_MDISP) && MON_AT(nx, ny) && better_with_displacing && !undesirable_disp(mtmp,nx,ny)) { @@ -757,7 +738,6 @@ register int after; /* this is extra fast monster movement */ if (mstatus & MM_DEF_DIED) return 2; return 0; } -#endif /* BARGETHROUGH */ { /* Dog avoids harmful traps, but perhaps it has to pass one * in order to follow player. (Non-harmful traps do not diff --git a/src/mhitm.c b/src/mhitm.c index 24e5c7f1c..47a14915f 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -168,7 +168,6 @@ fightm(mtmp) /* have monsters fight each other */ return 0; } -#ifdef BARGETHROUGH /* * mdisplacem() -- attacker moves defender out of the way; * returns same results as mattackm(). @@ -244,7 +243,6 @@ boolean quietly; return MM_HIT; } -#endif /* BARGETHROUGH */ /* * mattackm() -- a monster attacks another monster. diff --git a/src/mon.c b/src/mon.c index d3841462e..4823ae1c7 100644 --- a/src/mon.c +++ b/src/mon.c @@ -14,9 +14,7 @@ STATIC_DCL boolean FDECL(restrap,(struct monst *)); STATIC_DCL long FDECL(mm_aggression, (struct monst *,struct monst *)); -#ifdef BARGETHROUGH STATIC_DCL long FDECL(mm_displacement, (struct monst *,struct monst *)); -#endif STATIC_DCL int NDECL(pick_animal); STATIC_DCL void FDECL(kill_eggs, (struct obj *)); STATIC_DCL void FDECL(dealloc_mextra, (struct mextra *)); @@ -1083,13 +1081,6 @@ nexttry: /* eels prefer the water, but if there is no water nearby, struct monst *mtmp2 = m_at(nx, ny); long mmflag = flag | mm_aggression(mon, mtmp2); -#ifndef BARGETHROUGH - if (!(mmflag & ALLOW_M)) continue; - info[cnt] |= ALLOW_M; - if (mtmp2->mtame) { - if (!(mmflag & ALLOW_TM)) continue; - info[cnt] |= ALLOW_TM; -#else /* BARGETHROUGH */ if (mmflag & ALLOW_M) { info[cnt] |= ALLOW_M; if (mtmp2->mtame) { @@ -1100,7 +1091,6 @@ nexttry: /* eels prefer the water, but if there is no water nearby, mmflag = flag | mm_displacement(mon, mtmp2); if (!(mmflag & ALLOW_MDISP)) continue; info[cnt] |= ALLOW_MDISP; -#endif /* BARGETHROUGH */ } } /* Note: ALLOW_SANCT only prevents movement, not */ @@ -1206,7 +1196,6 @@ struct monst *magr, /* monster that is currently deciding where to move */ return 0L; } -#ifdef BARGETHROUGH /* Monster displacing another monster out of the way */ STATIC_OVL long mm_displacement(magr, mdef) @@ -1232,7 +1221,6 @@ struct monst *magr, /* monster that is currently deciding where to move */ return ALLOW_MDISP; return 0L; } -#endif /* BARGETHROUGH */ boolean monnear(mon, x, y) diff --git a/src/monmove.c b/src/monmove.c index 316018e52..81eb563d3 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -579,7 +579,6 @@ register struct monst *mtmp; return(FALSE); } -#ifdef BARGETHROUGH /* * should_displace() * @@ -623,7 +622,6 @@ xchar gx, gy; return TRUE; return FALSE; } -#endif /* BARGETHROUGH */ /* Return values: * 0: did not move, but can still attack and do other stuff. @@ -644,9 +642,7 @@ register int after; boolean can_open=0, can_unlock=0, doorbuster=0; boolean uses_items=0, setlikes=0; boolean avoid=FALSE; -#ifdef BARGETHROUGH boolean better_with_displacing = FALSE; -#endif struct permonst *ptr; struct monst *mtoo; schar mmoved = 0; /* not strictly nec.: chi >= 0 will do */ @@ -956,19 +952,15 @@ not_special: for(i = 0; i < cnt; i++) if(!(info[i] & NOTONL)) avoid=TRUE; } -#ifdef BARGETHROUGH better_with_displacing = should_displace(mtmp,poss,info,cnt,gx,gy); -#endif for(i=0; i < cnt; i++) { if (avoid && (info[i] & NOTONL)) continue; nx = poss[i].x; ny = poss[i].y; -#ifdef BARGETHROUGH if (MON_AT(nx,ny) && (info[i] & ALLOW_MDISP) && !(info[i] & ALLOW_M) && !better_with_displacing) continue; -#endif if (appr != 0) { mtrk = &mtmp->mtrack[0]; for(j=0; j < jcnt; mtrk++, j++) @@ -1064,7 +1056,6 @@ not_special: return 3; } -#ifdef BARGETHROUGH if((info[chi] & ALLOW_MDISP)) { struct monst *mtmp2; int mstatus; @@ -1075,7 +1066,6 @@ not_special: if (mstatus & MM_HIT) return 1; return 3; } -#endif /* BARGETHROUGH */ if (!m_in_out_region(mtmp,nix,niy)) return 3; @@ -1369,7 +1359,6 @@ found_you: mtmp->muy = my; } -#ifdef BARGETHROUGH /* * mon-to-mon displacement is a deliberate "get out of my way" act, * not an accidental bump, so we don't consider mstun or mconf in @@ -1401,7 +1390,6 @@ xchar x,y; return FALSE; } -#endif /* BARGETHROUGH */ /* * Inventory prevents passage under door. diff --git a/util/makedefs.c b/util/makedefs.c index 32107d0ab..b0d9f2078 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1247,9 +1247,6 @@ static const char *build_opts[] = { #ifdef MAIL "mail daemon", #endif -#ifdef BARGETHROUGH - "monsters moving monsters", -#endif #ifdef GNUDOS "MSDOS protected mode", #endif From 74e741bbbce1bba9eb57dc1b034d18de9c65df71 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 27 Feb 2015 19:06:17 -0500 Subject: [PATCH 019/354] Make AUTOPICKUP_EXCEPTIONS unconditional. --- include/config.h | 3 +-- include/decl.h | 4 +--- include/extern.h | 6 +----- include/flag.h | 4 +--- include/wceconf.h | 4 +--- src/files.c | 4 +--- src/options.c | 16 +--------------- src/pickup.c | 8 +------- src/save.c | 4 +--- util/makedefs.c | 5 +---- 10 files changed, 10 insertions(+), 48 deletions(-) diff --git a/include/config.h b/include/config.h index 399217b6f..282b6949b 100644 --- a/include/config.h +++ b/include/config.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 config.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 config.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.48 $ */ /* NetHack 3.5 config.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.37 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -424,7 +424,6 @@ typedef unsigned char uchar; # define CLIPPING /* allow smaller screens -- ERS */ # endif #endif -#define AUTOPICKUP_EXCEPTIONS /* exceptions to autopickup */ #ifdef REDO # define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ diff --git a/include/decl.h b/include/decl.h index 1e882705f..4733b5317 100644 --- a/include/decl.h +++ b/include/decl.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 decl.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 decl.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.50 $ */ /* NetHack 3.5 decl.h $Date: 2011/12/29 20:06:27 $ $Revision: 1.44 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -381,13 +381,11 @@ E char *fqn_prefix_names[PREFIX_COUNT]; E NEARDATA struct savefile_info sfcap, sfrestinfo, sfsaveinfo; -#ifdef AUTOPICKUP_EXCEPTIONS struct autopickup_exception { char *pattern; boolean grab; struct autopickup_exception *next; }; -#endif /* AUTOPICKUP_EXCEPTIONS */ #ifdef PANICTRACE E char *ARGV0; diff --git a/include/extern.h b/include/extern.h index e4cccef6f..be15406c2 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 extern.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 extern.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.390 $ */ /* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1587,10 +1587,8 @@ E void FDECL(set_duplicate_opt_detection, (int)); E void FDECL(set_wc_option_mod_status, (unsigned long, int)); E void FDECL(set_wc2_option_mod_status, (unsigned long, int)); E void FDECL(set_option_mod_status, (const char *,int)); -#ifdef AUTOPICKUP_EXCEPTIONS E int FDECL(add_autopickup_exception, (const char *)); E void NDECL(free_autopickup_exceptions); -#endif /* AUTOPICKUP_EXCEPTIONS */ #ifdef LOADSYMSETS E int FDECL(load_symset, (const char *,int)); E void FDECL(parsesymbols, (char *)); @@ -1687,9 +1685,7 @@ E boolean FDECL(container_gone, (int (*)(OBJ_P))); E int FDECL(use_container, (struct obj **,int)); E int FDECL(loot_mon, (struct monst *,int *,boolean *)); E int NDECL(dotip); -#ifdef AUTOPICKUP_EXCEPTIONS E boolean FDECL(is_autopickup_exception, (struct obj *, BOOLEAN_P)); -#endif /* AUTOPICKUP_EXCEPTIONS */ /* ### pline.c ### */ diff --git a/include/flag.h b/include/flag.h index 1f53bdec6..2b5d2c3ee 100644 --- a/include/flag.h +++ b/include/flag.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 flag.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 flag.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.60 $ */ /* NetHack 3.5 flag.h $Date: 2012/04/09 02:56:32 $ $Revision: 1.59 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -297,11 +297,9 @@ struct instance_flags { boolean cmdassist; /* provide detailed assistance for some commands */ boolean clicklook; /* allow right-clicking for look */ boolean obsolete; /* obsolete options can point at this, it isn't used */ -#ifdef AUTOPICKUP_EXCEPTIONS struct autopickup_exception *autopickup_exceptions[2]; #define AP_LEAVE 0 #define AP_GRAB 1 -#endif #ifdef WIN32CON #define MAX_ALTKEYHANDLER 25 char altkeyhandler[MAX_ALTKEYHANDLER]; diff --git a/include/wceconf.h b/include/wceconf.h index c5fef1547..808334768 100644 --- a/include/wceconf.h +++ b/include/wceconf.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 wceconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wceconf.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.12 $ */ /* NetHack 3.5 wceconf.h $Date: 2009/10/22 02:59:14 $ $Revision: 1.12 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ @@ -44,8 +44,6 @@ #define USER_SOUNDS -#define AUTOPICKUP_EXCEPTIONS - /* * ----------------------------------------------------------------- * The remaining code shouldn't need modification. diff --git a/src/files.c b/src/files.c index f45db8bce..5d8b2bf2e 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 files.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 files.c $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.127 $ */ /* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2020,10 +2020,8 @@ int src; parseoptions(bufp, TRUE, TRUE); if (plname[0]) /* If a name was given */ plnamesuffix(); /* set the character class */ -#ifdef AUTOPICKUP_EXCEPTIONS } else if (match_varname(buf, "AUTOPICKUP_EXCEPTION", 5)) { add_autopickup_exception(bufp); -#endif #ifdef NOCWD_ASSUMPTIONS } else if (match_varname(buf, "HACKDIR", 4)) { adjust_prefix(bufp, HACKPREFIX); diff --git a/src/options.c b/src/options.c index dc8cbcfc2..ecb259159 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 options.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 options.c $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.156 $ */ /* NetHack 3.5 options.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.153 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -501,10 +501,8 @@ STATIC_OVL boolean FDECL(is_wc_option, (const char *)); STATIC_OVL boolean FDECL(wc_supported, (const char *)); STATIC_OVL boolean FDECL(is_wc2_option, (const char *)); STATIC_OVL boolean FDECL(wc2_supported, (const char *)); -#ifdef AUTOPICKUP_EXCEPTIONS STATIC_DCL void FDECL(remove_autopickup_exception, (struct autopickup_exception *)); STATIC_OVL int FDECL(count_ape_maps, (int *, int *)); -#endif /* check whether a user-supplied option string is a proper leading substring of a particular option name; option string might have @@ -2923,12 +2921,10 @@ doset() add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, MENU_UNSELECTED); # endif #endif -#ifdef AUTOPICKUP_EXCEPTIONS any.a_int = -1; Sprintf(buf, "autopickup exceptions (%d currently set)", count_ape_maps((int *)0, (int *)0)); add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, MENU_UNSELECTED); -#endif /* AUTOPICKUP_EXCEPTIONS */ #ifdef PREFIXES_IN_USE any = zeroany; add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", MENU_UNSELECTED); @@ -2948,12 +2944,10 @@ doset() */ for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx) { opt_indx = pick_list[pick_idx].item.a_int - 1; -#ifdef AUTOPICKUP_EXCEPTIONS if (opt_indx == -2) { /* -3 due to -1 offset for select_menu() */ (void)special_handling("autopickup_exception", setinitial, fromfile); } else -#endif #ifdef STATUS_VIA_WINDOWPORT # ifdef STATUS_HILITES if (opt_indx == -3) { /* -3 due to -1 offset for select_menu() */ @@ -3020,9 +3014,7 @@ boolean setinitial,setfromfile; /* Special handling of menustyle, pickup_burden, pickup_types, * disclose, runmode, msg_window, menu_headings, and number_pad options. -#ifdef AUTOPICKUP_EXCEPTIONS * Also takes care of interactive autopickup_exception_handling changes. -#endif */ if (!strcmp("menustyle", optname)) { const char *style_name; @@ -3296,7 +3288,6 @@ boolean setinitial,setfromfile; } destroy_nhwindow(tmpwin); } else if (!strcmp("autopickup_exception", optname)) { -#ifdef AUTOPICKUP_EXCEPTIONS int pick_cnt, pick_idx, opt_idx, pass; int totalapes = 0, numapes[2] = {0,0}; menu_item *pick_list = (menu_item *)0; @@ -3392,7 +3383,6 @@ boolean setinitial,setfromfile; destroy_nhwindow(tmpwin); if (pick_cnt >= 0) goto ape_again; } -#endif /* AUTOPICKUP_EXCEPTIONS */ } else if (!strcmp("symset", optname) || !strcmp("roguesymset", optname)) { menu_item *symset_pick = (menu_item *)0; @@ -3897,12 +3887,10 @@ dotogglepickup() if (flags.pickup) { oc_to_str(flags.pickup_types, ocl); Sprintf(buf, "ON, for %s objects%s", ocl[0] ? ocl : "all", -#ifdef AUTOPICKUP_EXCEPTIONS (iflags.autopickup_exceptions[AP_LEAVE] || iflags.autopickup_exceptions[AP_GRAB]) ? ((count_ape_maps((int *)0, (int *)0) == 1) ? ", with one exception" : ", with some exceptions") : -#endif ""); } else { Strcpy(buf, "OFF"); @@ -3911,7 +3899,6 @@ dotogglepickup() return 0; } -#ifdef AUTOPICKUP_EXCEPTIONS int add_autopickup_exception(mapping) const char *mapping; @@ -4004,7 +3991,6 @@ free_autopickup_exceptions() } } } -#endif /* AUTOPICKUP_EXCEPTIONS */ #ifdef LOADSYMSETS /* bundle some common usage into one easy-to-use routine */ diff --git a/src/pickup.c b/src/pickup.c index ee0d91dc7..2c1564f84 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 pickup.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pickup.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.126 $ */ /* NetHack 3.5 pickup.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.123 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -612,7 +612,6 @@ end_query: return (n_tried > 0); } -#ifdef AUTOPICKUP_EXCEPTIONS boolean is_autopickup_exception(obj, grab) struct obj *obj; @@ -631,7 +630,6 @@ boolean grab; /* forced pickup, rather than forced leave behind? */ } return FALSE; } -#endif /* AUTOPICKUP_EXCEPTIONS */ /* * Pick from the given list using flags.pickup_types. Return the number @@ -655,12 +653,10 @@ menu_item **pick_list; /* list of objects and counts to pick up */ /* first count the number of eligible items */ for (n = 0, curr = olist; curr; curr = FOLLOW(curr, follow)) { pickit = (!*otypes || index(otypes, curr->oclass)); -#ifdef AUTOPICKUP_EXCEPTIONS /* check for "always pick up */ if (!pickit) pickit = is_autopickup_exception(curr, TRUE); /* then for "never pick up */ if (pickit) pickit = !is_autopickup_exception(curr, FALSE); -#endif /* pickup_thrown overrides pickup_types and exceptions */ if (!pickit) pickit = (flags.pickup_thrown && curr->was_thrown); /* finally, do we count this object? */ @@ -671,10 +667,8 @@ menu_item **pick_list; /* list of objects and counts to pick up */ *pick_list = pi = (menu_item *) alloc(sizeof(menu_item) * n); for (n = 0, curr = olist; curr; curr = FOLLOW(curr, follow)) { pickit = (!*otypes || index(otypes, curr->oclass)); -#ifdef AUTOPICKUP_EXCEPTIONS if (!pickit) pickit = is_autopickup_exception(curr, TRUE); if (pickit) pickit = !is_autopickup_exception(curr, FALSE); -#endif if (!pickit) pickit = (flags.pickup_thrown && curr->was_thrown); if (pickit) { pi[n].item.a_obj = curr; diff --git a/src/save.c b/src/save.c index 1fa51dfaa..d7828655a 100644 --- a/src/save.c +++ b/src/save.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 save.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 save.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.59 $ */ /* NetHack 3.5 save.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.53 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1345,9 +1345,7 @@ freedynamicdata() if (iflags.wc_font_menu) free(iflags.wc_font_menu); if (iflags.wc_font_status) free(iflags.wc_font_status); if (iflags.wc_tile_file) free(iflags.wc_tile_file); -#ifdef AUTOPICKUP_EXCEPTIONS free_autopickup_exceptions(); -#endif #endif /* FREE_ALL_MEMORY */ #ifdef STATUS_VIA_WINDOWPORT status_finish(); diff --git a/util/makedefs.c b/util/makedefs.c index b0d9f2078..c61b561d1 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 makedefs.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 makedefs.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.61 $ */ /* NetHack 3.5 makedefs.c $Date: 2012/01/15 09:27:03 $ $Revision: 1.50 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) M. Stephenson, 1990, 1991. */ @@ -1208,9 +1208,6 @@ static const char *build_opts[] = { #ifdef ANSI_DEFAULT "ANSI default terminal", #endif -#ifdef AUTOPICKUP_EXCEPTIONS - "autopickup exceptions", -#endif #ifdef TEXTCOLOR "color", #endif From d218bedbf7757ccc59499cab6cdce594186a3b99 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sat, 14 Feb 2015 14:15:27 -0500 Subject: [PATCH 020/354] Make LOADSYMSETS unconditional. There are some bugs here, but this functionality should make it into the release in some form. --- include/config.h | 1 - include/extern.h | 6 ------ include/rm.h | 4 ---- src/drawing.c | 8 -------- src/files.c | 12 ------------ src/mapglyph.c | 38 +------------------------------------- src/options.c | 32 -------------------------------- sys/share/pcmain.c | 10 ++-------- sys/share/unixtty.c | 2 -- sys/unix/unixmain.c | 4 ---- sys/vms/vmsmain.c | 4 ---- 11 files changed, 3 insertions(+), 118 deletions(-) diff --git a/include/config.h b/include/config.h index 282b6949b..db5070a3a 100644 --- a/include/config.h +++ b/include/config.h @@ -412,7 +412,6 @@ typedef unsigned char uchar; */ /* display features */ -#define LOADSYMSETS /* loadable symbol sets; only default symbols w/o this */ /* dungeon features */ /* dungeon levels */ #define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */ diff --git a/include/extern.h b/include/extern.h index be15406c2..836b64d5f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -515,11 +515,9 @@ E void NDECL(init_r_symbols); E void NDECL(init_symbols); E void NDECL(init_showsyms); E void NDECL(init_l_symbols); -#ifdef LOADSYMSETS E void FDECL(clear_symsetentry, (int,BOOLEAN_P)); E void FDECL(update_l_symset, (struct symparse *,int)); E void FDECL(update_r_symset, (struct symparse *,int)); -#endif E boolean FDECL(cursed_object_at, (int, int)); /* ### dungeon.c ### */ @@ -733,11 +731,9 @@ E boolean FDECL(can_read_file, (const char *)); E boolean FDECL(read_config_file, (const char *, int)); E void FDECL(check_recordfile, (const char *)); E void NDECL(read_wizkit); -#ifdef LOADSYMSETS E int FDECL(read_sym_file, (int)); E int FDECL(parse_sym_line, (char *,int)); E int FDECL(sym_val, (const char *)); -#endif E void FDECL(paniclog, (const char *, const char *)); E int FDECL(validate_prefix_locations, (char *)); #ifdef SELECTSAVED @@ -1589,11 +1585,9 @@ E void FDECL(set_wc2_option_mod_status, (unsigned long, int)); E void FDECL(set_option_mod_status, (const char *,int)); E int FDECL(add_autopickup_exception, (const char *)); E void NDECL(free_autopickup_exceptions); -#ifdef LOADSYMSETS E int FDECL(load_symset, (const char *,int)); E void FDECL(parsesymbols, (char *)); E struct symparse *FDECL(match_sym, (char *)); -#endif E void NDECL(set_playmode); /* ### pager.c ### */ diff --git a/include/rm.h b/include/rm.h index 8747407f9..2fa3da6b6 100644 --- a/include/rm.h +++ b/include/rm.h @@ -278,12 +278,8 @@ extern const struct symdef def_warnsyms[WARNCOUNT]; extern int currentgraphics; /* from drawing.c */ extern nhsym showsyms[]; -#ifdef LOADSYMSETS extern struct symsetentry symset[NUM_GRAPHICS]; /* from drawing.c */ #define SYMHANDLING(ht) (symset[currentgraphics].handling == (ht)) -#else -#define SYMHANDLING(ht) ((ht) == H_UNK) -#endif /* * The 5 possible states of doors diff --git a/src/drawing.c b/src/drawing.c index 3d94d8803..7fb0d461a 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -19,9 +19,7 @@ #define C(n) #endif -#ifdef LOADSYMSETS struct symsetentry symset[NUM_GRAPHICS]; -#endif int currentgraphics = 0; @@ -399,9 +397,7 @@ init_l_symbols() l_syms[i + SYM_OFF_X] = DEF_INVISIBLE; } -#ifdef LOADSYMSETS clear_symsetentry(PRIMARY, FALSE); -#endif } void @@ -433,13 +429,11 @@ init_r_symbols() r_syms[i + SYM_OFF_X] = DEF_INVISIBLE; } -# ifdef LOADSYMSETS clear_symsetentry(ROGUESET, FALSE); symset[ROGUESET].nocolor = 1; /* default on Rogue level is no color * but some symbol sets can * override that */ -# endif } void @@ -499,7 +493,6 @@ int nondefault; init_symbols(); } -#ifdef LOADSYMSETS void update_l_symset(symp, val) struct symparse *symp; @@ -755,7 +748,6 @@ struct symparse loadsyms[] = { {SYM_OTH, SYM_INVISIBLE + SYM_OFF_X, "S_invisible"}, {0,0,(const char *)0} /* fence post */ }; -#endif /*LOADSYMSETS*/ /*drawing.c*/ diff --git a/src/files.c b/src/files.c index 5d8b2bf2e..cb7363399 100644 --- a/src/files.c +++ b/src/files.c @@ -190,10 +190,8 @@ STATIC_DCL FILE *FDECL(fopen_config_file, (const char *, int)); STATIC_DCL int FDECL(get_uchars, (FILE *,char *,char *,uchar *,BOOLEAN_P,int,const char *)); int FDECL(parse_config_line, (FILE *,char *,int)); -#ifdef LOADSYMSETS STATIC_DCL FILE *NDECL(fopen_sym_file); STATIC_DCL void FDECL(set_symhandling, (char *,int)); -#endif #ifdef NOCWD_ASSUMPTIONS STATIC_DCL void FDECL(adjust_prefix, (char *, int)); #endif @@ -2202,10 +2200,6 @@ int src; WARNCOUNT, "WARNINGS"); assign_warnings(translate); } else if (match_varname(buf, "SYMBOLS", 4)) { - /* This part is not ifdef LOADSYMSETS because we want to be able - * to silently ignore its presence in a config file if that is - * not defined. - */ char *op, symbuf[BUFSZ]; boolean morelines; do { @@ -2224,10 +2218,8 @@ int src; /* strip trailing space now that '\' is gone */ while (--op >= bufp && isspace(*op)) *op = '\0'; } -#ifdef LOADSYMSETS /* parse here */ parsesymbols(bufp); -#endif if (morelines) do { *symbuf = '\0'; @@ -2238,9 +2230,7 @@ int src; bufp = symbuf; } while (*bufp == '#'); } while (morelines); -#ifdef LOADSYMSETS switch_symbols(TRUE); -#endif } else if (match_varname(buf, "WIZKIT", 6)) { (void) strncpy(wizkit, bufp, WIZKIT_MAX-1); #ifdef AMIGA @@ -2561,7 +2551,6 @@ read_wizkit() return; } -#ifdef LOADSYMSETS extern struct symsetentry *symset_list; /* options.c */ extern struct symparse loadsyms[]; /* drawing.c */ extern const char *known_handling[]; /* drawing.c */ @@ -2897,7 +2886,6 @@ const char *cp; } return cval; } -#endif /*LOADSYMSETS*/ /* ---------- END CONFIG FILE HANDLING ----------- */ diff --git a/src/mapglyph.c b/src/mapglyph.c index f1adae27a..c00d6f8ad 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -34,9 +34,6 @@ int explcolors[] = { #define pet_color(n) color = iflags.use_color ? mons[n].mcolor : NO_COLOR #define warn_color(n) color = iflags.use_color ? def_warnsyms[n].color : NO_COLOR #define explode_color(n) color = iflags.use_color ? explcolors[n] : NO_COLOR -#ifdef LOADSYMSETS -# define ROGUE_COLOR -#endif #else /* no text color */ @@ -66,17 +63,13 @@ int *ochar; unsigned *ospecial; { register int offset, idx; -#if defined(TEXTCOLOR) || defined(ROGUE_COLOR) int color = NO_COLOR; -#endif nhsym ch; unsigned special = 0; /* condense multiple tests in macro version down to single */ boolean has_rogue_ibm_graphics = HAS_ROGUE_IBM_GRAPHICS; -#ifdef ROGUE_COLOR boolean has_rogue_color = (has_rogue_ibm_graphics && (symset[currentgraphics].nocolor == 0)); -#endif /* * Map the glyph back to a character and color. @@ -86,45 +79,36 @@ unsigned *ospecial; */ if ((offset = (glyph - GLYPH_STATUE_OFF)) >= 0) { /* a statue */ idx = mons[offset].mlet + SYM_OFF_M; -# ifdef ROGUE_COLOR if (has_rogue_color) color = CLR_RED; else -# endif obj_color(STATUE); special |= MG_STATUE; } else if ((offset = (glyph - GLYPH_WARNING_OFF)) >= 0) { /* a warning flash */ idx = offset + SYM_OFF_W; -# ifdef ROGUE_COLOR if (has_rogue_color) color = NO_COLOR; else -# endif warn_color(offset); } else if ((offset = (glyph - GLYPH_SWALLOW_OFF)) >= 0) { /* swallow */ /* see swallow_to_glyph() in display.c */ idx = (S_sw_tl + (offset & 0x7)) + SYM_OFF_P; -#ifdef ROGUE_COLOR if (has_rogue_color && iflags.use_color) color = NO_COLOR; else -#endif mon_color(offset >> 3); } else if ((offset = (glyph - GLYPH_ZAP_OFF)) >= 0) { /* zap beam */ /* see zapdir_to_glyph() in display.c */ idx = (S_vbeam + (offset & 0x3)) + SYM_OFF_P; -#ifdef ROGUE_COLOR if (has_rogue_color && iflags.use_color) color = NO_COLOR; else -#endif zap_color((offset >> 2)); } else if ((offset = (glyph - GLYPH_EXPLODE_OFF)) >= 0) { /* explosion */ idx = ((offset % MAXEXPCHARS) + S_explode1) + SYM_OFF_P; explode_color(offset / MAXEXPCHARS); } else if ((offset = (glyph - GLYPH_CMAP_OFF)) >= 0) { /* cmap */ idx = offset + SYM_OFF_P; -#ifdef ROGUE_COLOR if (has_rogue_color && iflags.use_color) { if (offset >= S_vwall && offset <= S_hcdoor) color = CLR_BROWN; @@ -137,7 +121,6 @@ unsigned *ospecial; else color = NO_COLOR; } else -#endif #ifdef TEXTCOLOR /* provide a visible difference if normal and lit corridor * use the same symbol */ @@ -151,7 +134,6 @@ unsigned *ospecial; idx = objects[offset].oc_class + SYM_OFF_O; if (offset == BOULDER && iflags.bouldersym) idx = SYM_BOULDER + SYM_OFF_X; -#ifdef ROGUE_COLOR if (has_rogue_color && iflags.use_color) { switch(objects[offset].oc_class) { case COIN_CLASS: color = CLR_YELLOW; break; @@ -159,70 +141,56 @@ unsigned *ospecial; default: color = CLR_BRIGHT_BLUE; break; } } else -#endif obj_color(offset); } else if ((offset = (glyph - GLYPH_RIDDEN_OFF)) >= 0) { /* mon ridden */ idx = mons[offset].mlet + SYM_OFF_M; -#ifdef ROGUE_COLOR if (has_rogue_color) /* This currently implies that the hero is here -- monsters */ /* don't ride (yet...). Should we set it to yellow like in */ /* the monster case below? There is no equivalent in rogue. */ color = NO_COLOR; /* no need to check iflags.use_color */ else -#endif mon_color(offset); special |= MG_RIDDEN; } else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) { /* a corpse */ idx = objects[CORPSE].oc_class + SYM_OFF_O; -#ifdef ROGUE_COLOR if (has_rogue_color && iflags.use_color) color = CLR_RED; else -#endif mon_color(offset); special |= MG_CORPSE; } else if ((offset = (glyph - GLYPH_DETECT_OFF)) >= 0) { /* mon detect */ idx = mons[offset].mlet + SYM_OFF_M; -#ifdef ROGUE_COLOR if (has_rogue_color) color = NO_COLOR; /* no need to check iflags.use_color */ else -#endif mon_color(offset); /* Disabled for now; anyone want to get reverse video to work? */ /* is_reverse = TRUE; */ special |= MG_DETECT; } else if ((offset = (glyph - GLYPH_INVIS_OFF)) >= 0) { /* invisible */ idx = SYM_INVISIBLE + SYM_OFF_X; -#ifdef ROGUE_COLOR if (has_rogue_color) color = NO_COLOR; /* no need to check iflags.use_color */ else -#endif invis_color(offset); special |= MG_INVIS; } else if ((offset = (glyph - GLYPH_PET_OFF)) >= 0) { /* a pet */ idx = mons[offset].mlet + SYM_OFF_M; -#ifdef ROGUE_COLOR if (has_rogue_color) color = NO_COLOR; /* no need to check iflags.use_color */ else -#endif pet_color(offset); special |= MG_PET; } else { /* a monster */ idx = mons[glyph].mlet + SYM_OFF_M; -#ifdef ROGUE_COLOR if (has_rogue_color && iflags.use_color) { if (x == u.ux && y == u.uy) /* actually player should be yellow-on-gray if in a corridor */ color = CLR_YELLOW; else color = NO_COLOR; - } else -#endif - { + } else { mon_color(glyph); /* special case the hero for `showrace' option */ #ifdef TEXTCOLOR @@ -236,11 +204,7 @@ unsigned *ospecial; ch = showsyms[idx]; #ifdef TEXTCOLOR /* Turn off color if no color defined, or rogue level w/o PC graphics. */ -# ifdef ROGUE_COLOR if (!has_color(color) || (Is_rogue_level(&u.uz) && !has_rogue_color)) -# else - if (!has_color(color) || Is_rogue_level(&u.uz)) -# endif color = NO_COLOR; #endif diff --git a/src/options.c b/src/options.c index ecb259159..51bda6c59 100644 --- a/src/options.c +++ b/src/options.c @@ -350,17 +350,9 @@ static struct Comp_Opt { "soundcard", "type of sound card to use", 20, SET_IN_FILE }, #endif { "symset", "load a set of display symbols from the symbols file", 70, -#ifdef LOADSYMSETS SET_IN_GAME }, -#else - DISP_IN_GAME}, -#endif { "roguesymset", "load a set of rogue display symbols from the symbols file", 70, -#ifdef LOADSYMSETS SET_IN_GAME }, -#else - DISP_IN_GAME}, -#endif { "suppress_alert", "suppress alerts about version-specific features", 8, SET_IN_GAME }, { "tile_width", "width of tiles", 20, DISP_IN_GAME}, /*WC*/ @@ -654,11 +646,9 @@ initoptions_init() */ /* this detects the IBM-compatible console on most 386 boxes */ if ((opts = nh_getenv("TERM")) && !strncmp(opts, "AT", 2)) { -#ifdef LOADSYMSETS if (!symset[PRIMARY].name) load_symset("IBMGraphics", PRIMARY); if (!symset[ROGUESET].name) load_symset("RogueIBM", ROGUESET); switch_symbols(TRUE); -#endif # ifdef TEXTCOLOR iflags.use_color = TRUE; # endif @@ -670,10 +660,8 @@ initoptions_init() if ((opts = nh_getenv("TERM")) && !strncmpi(opts, "vt", 2) && AS && AE && index(AS, '\016') && index(AE, '\017')) { -# ifdef LOADSYMSETS if (!symset[PRIMARY].name) load_symset("DECGraphics", PRIMARY); switch_symbols(TRUE); -# endif /*LOADSYMSETS*/ } # endif #endif /* UNIX || VMS */ @@ -1406,7 +1394,6 @@ boolean tinitial, tfrom_file; fullname = "symset"; if (match_optname(opts, fullname, 6, TRUE)) { -#ifdef LOADSYMSETS if (duplicate) complain_about_duplicate(opts,1); if (negated) bad_negation(fullname, FALSE); else if ((op = string_for_opt(opts, FALSE)) != 0) { @@ -1422,7 +1409,6 @@ boolean tinitial, tfrom_file; need_redraw = TRUE; } } -#endif return; } @@ -2505,7 +2491,6 @@ goodfruit: fullname = "DECgraphics"; if (match_optname(opts, fullname, 10, TRUE)) { boolean badflag = FALSE; -# ifdef LOADSYMSETS if (duplicate) complain_about_duplicate(opts,1); if (!negated) { /* There is no rogue level DECgraphics-specific set */ @@ -2525,14 +2510,12 @@ goodfruit: wait_synch(); } } -# endif /*LOADSYMSETS*/ return; } fullname = "IBMgraphics"; if (match_optname(opts, fullname, 10, TRUE)) { const char *sym_name = fullname; boolean badflag = FALSE; -# ifdef LOADSYMSETS if (duplicate) complain_about_duplicate(opts,1); if (!negated) { for (i = PRIMARY; i <= ROGUESET; ++i) { @@ -2559,7 +2542,6 @@ goodfruit: assign_graphics(ROGUESET); } } -# endif /*LOADSYMSETS*/ return; } #endif @@ -2567,7 +2549,6 @@ goodfruit: fullname = "MACgraphics"; if (match_optname(opts, fullname, 11, TRUE)) { boolean badflag = FALSE; -# ifdef LOADSYMSETS if (duplicate) complain_about_duplicate(opts,1); if (!negated) { if (symset[PRIMARY]).name badflag = TRUE; @@ -2589,7 +2570,6 @@ goodfruit: assign_graphics(ROGUESET); } } -# endif /*LOADSYMSETS*/ return; } #endif @@ -2997,10 +2977,8 @@ doset() return 0; } -#ifdef LOADSYMSETS struct symsetentry *symset_list = 0; /* files.c will populate this with list of available sets */ -#endif STATIC_OVL boolean special_handling(optname, setinitial, setfromfile) @@ -3390,19 +3368,16 @@ boolean setinitial,setfromfile; rogueflag = (*optname == 'r'), ready_to_switch = FALSE, nothing_to_do = FALSE; -#ifdef LOADSYMSETS int res; char *symset_name, fmtstr[20]; struct symsetentry *sl; int setcount = 0; -#endif int chosen = -2, which_set; if (rogueflag) which_set = ROGUESET; else which_set = PRIMARY; -#ifdef LOADSYMSETS /* clear symset[].name as a flag to read_sym_file() to build list */ symset_name = symset[which_set].name; symset[which_set].name = (char *)0; @@ -3551,7 +3526,6 @@ boolean setinitial,setfromfile; assign_graphics(ROGUESET); } else if (!rogueflag) assign_graphics(PRIMARY); need_redraw = TRUE; -#endif /*LOADSYMSETS*/ return TRUE; } else { @@ -3772,10 +3746,8 @@ char *buf; Sprintf(buf, "%s", rolestring(flags.initrace, races, noun)); else if (!strcmp(optname, "roguesymset")) { Sprintf(buf, "%s", -#ifdef LOADSYMSETS symset[ROGUESET].name ? symset[ROGUESET].name : -#endif "default"); if (currentgraphics == ROGUESET && symset[ROGUESET].name) Strcat(buf, ", active"); @@ -3813,10 +3785,8 @@ char *buf; } else if (!strcmp(optname, "symset")) { Sprintf(buf, "%s", -#ifdef LOADSYMSETS symset[PRIMARY].name ? symset[PRIMARY].name : -#endif "default"); if (currentgraphics == PRIMARY && symset[PRIMARY].name) Strcat(buf, ", active"); @@ -3992,7 +3962,6 @@ free_autopickup_exceptions() } } -#ifdef LOADSYMSETS /* bundle some common usage into one easy-to-use routine */ int load_symset(s, which_set) @@ -4070,7 +4039,6 @@ char *buf; } return (struct symparse *)0; } -#endif /*LOADSYMSETS*/ /* data for option_help() */ static const char *opt_intro[] = { diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 55188619b..6635c56ad 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -303,8 +303,7 @@ char *argv[]; process_options(argc, argv); #endif -#ifdef LOADSYMSETS -# if defined(MSDOS) || defined(WIN32) +#if defined(MSDOS) || defined(WIN32) /* Player didn't specify any symbol set so use IBM defaults */ if (!symset[PRIMARY].name) { load_symset("IBMGraphics_2", PRIMARY); @@ -312,8 +311,7 @@ char *argv[]; if (!symset[ROGUESET].name) { load_symset("RogueEpyx", ROGUESET); } -# endif -#endif /*LOADSYMSETS*/ +#endif #ifdef MSDOS init_nhwindows(&argc,argv); @@ -536,20 +534,16 @@ char *argv[]; case 'I': case 'i': if (!strncmpi(argv[0]+1, "IBM", 3)) { -# ifdef LOADSYMSETS load_symset("IBMGraphics", PRIMARY); load_symset("RogueIBM", ROGUESET); switch_symbols(TRUE); -# endif } break; /* case 'D': */ case 'd': if (!strncmpi(argv[0]+1, "DEC", 3)) { -# ifdef LOADSYMSETS load_symset("DECGraphics", PRIMARY); switch_symbols(TRUE); -# endif } break; #endif diff --git a/sys/share/unixtty.c b/sys/share/unixtty.c index 68c6f104c..678ab565d 100644 --- a/sys/share/unixtty.c +++ b/sys/share/unixtty.c @@ -364,11 +364,9 @@ init_sco_cons() if (!strcmp(windowprocs.name, "tty") && sco_flag_console) { atexit(sco_mapon); sco_mapoff(); -# ifdef LOADSYMSETS load_symset("IBMGraphics", PRIMARY); load_symset("RogueIBM", ROGUESET); switch_symbols(TRUE); -# endif # ifdef TEXTCOLOR if (has_colors()) iflags.use_color = TRUE; diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index f7cb9b26c..c470dc6e0 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -357,20 +357,16 @@ char *argv[]; case 'I': case 'i': if (!strncmpi(argv[0]+1, "IBM", 3)) { -#ifdef LOADSYMSETS load_symset("IBMGraphics", PRIMARY); load_symset("RogueIBM", ROGUESET); switch_symbols(TRUE); -#endif } break; /* case 'D': */ case 'd': if (!strncmpi(argv[0]+1, "DEC", 3)) { -#ifdef LOADSYMSETS load_symset("DECGraphics", PRIMARY); switch_symbols(TRUE); -#endif } break; case 'p': /* profession (role) */ diff --git a/sys/vms/vmsmain.c b/sys/vms/vmsmain.c index a34224005..abeff040e 100644 --- a/sys/vms/vmsmain.c +++ b/sys/vms/vmsmain.c @@ -266,20 +266,16 @@ char *argv[]; case 'I': case 'i': if (!strncmpi(argv[0]+1, "IBM", 3)) { -#ifdef LOADSYMSETS load_symset("IBMGraphics", PRIMARY); load_symset("RogueIBM", ROGUESET); switch_symbols(TRUE); -#endif } break; /* case 'D': */ case 'd': if (!strncmpi(argv[0]+1, "DEC", 3)) { -#ifdef LOADSYMSETS load_symset("DECGraphics", PRIMARY); switch_symbols(TRUE); -#endif } break; case 'p': /* profession (role) */ From 0001534d040b793eb79af669d308f7543c562b20 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 27 Feb 2015 19:24:28 -0500 Subject: [PATCH 021/354] Make REDO unconditional. --- include/config.h | 5 +---- include/decl.h | 2 -- include/extern.h | 2 -- include/global.h | 6 ------ include/ntconf.h | 5 ----- include/os2conf.h | 5 ----- include/pcconf.h | 5 ----- include/unixconf.h | 3 --- include/vmsconf.h | 3 --- include/wceconf.h | 5 ----- src/allmain.c | 8 +------- src/cmd.c | 24 +++--------------------- src/decl.c | 2 -- src/invent.c | 12 ------------ src/o_init.c | 2 -- sys/share/pcsys.c | 2 +- util/makedefs.c | 3 --- win/tty/getline.c | 8 +------- 18 files changed, 7 insertions(+), 95 deletions(-) diff --git a/include/config.h b/include/config.h index db5070a3a..5cf035b54 100644 --- a/include/config.h +++ b/include/config.h @@ -417,16 +417,13 @@ typedef unsigned char uchar; #define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */ /* monsters & objects */ /* I/O */ -#define REDO /* support for redoing last command - DGK */ #if !defined(MAC) # if !defined(NOCLIPPING) # define CLIPPING /* allow smaller screens -- ERS */ # endif #endif -#ifdef REDO -# define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ -#endif +#define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ #define EXP_ON_BOTL /* Show experience on bottom line */ /* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson@ucivax) */ diff --git a/include/decl.h b/include/decl.h index 4733b5317..92f1e8240 100644 --- a/include/decl.h +++ b/include/decl.h @@ -39,9 +39,7 @@ E NEARDATA int warn_obj_cnt; /* count of monsters meeting criteria */ E int x_maze_max, y_maze_max; E int otg_temp; -#ifdef REDO E NEARDATA int in_doagain; -#endif E struct dgn_topology { /* special dungeon levels for speed */ d_level d_oracle_level; diff --git a/include/extern.h b/include/extern.h index 836b64d5f..bfd361326 100644 --- a/include/extern.h +++ b/include/extern.h @@ -182,11 +182,9 @@ E int NDECL(wiz_wish); #endif /* USE_TRAMPOLI */ E void NDECL(reset_occupations); E void FDECL(set_occupation, (int (*)(void),const char *,int)); -#ifdef REDO E char NDECL(pgetchar); E void FDECL(pushch, (CHAR_P)); E void FDECL(savech, (CHAR_P)); -#endif E void NDECL(add_debug_extended_commands); E void FDECL(reset_commands, (BOOLEAN_P)); E void FDECL(rhack, (char *)); diff --git a/include/global.h b/include/global.h index 985066520..e3292e243 100644 --- a/include/global.h +++ b/include/global.h @@ -134,12 +134,6 @@ typedef char nhptext; */ #define LARGEST_INT 32767 - -#ifdef REDO -#define Getchar pgetchar -#endif - - #include "coord.h" /* * Automatic inclusions for the subsidiary files. diff --git a/include/ntconf.h b/include/ntconf.h index 539833aed..4ad1a6e73 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -229,11 +229,6 @@ int _RTLENTRY _EXPFUNC read (int __handle, void _FAR *__buf, unsigned __len); #define ALLOCA_HACK /* used in util/panic.c */ #endif -#ifndef REDO -#undef Getchar -#define Getchar nhgetch -#endif - extern int FDECL(set_win32_option, (const char *, const char *)); #ifdef WIN32CON #define LEFTBUTTON FROM_LEFT_1ST_BUTTON_PRESSED diff --git a/include/os2conf.h b/include/os2conf.h index eeb4e53aa..1c24c10fd 100644 --- a/include/os2conf.h +++ b/include/os2conf.h @@ -100,11 +100,6 @@ #define sethanguphandler(foo) (void)signal(SIGHUP, (SIG_RET_TYPE)foo) #endif -#ifndef REDO -# undef Getchar -# define Getchar nhgetch -#endif - void hangup(int i); #endif /* OS2CONF_H */ #endif /* OS2 */ diff --git a/include/pcconf.h b/include/pcconf.h index 70a519c00..77a496dac 100644 --- a/include/pcconf.h +++ b/include/pcconf.h @@ -249,11 +249,6 @@ #include -#ifndef REDO -# undef Getchar -# define Getchar nhgetch -#endif - #ifdef MSDOS # define TEXTCOLOR /* */ # define PORT_HELP "msdoshlp.txt" /* msdos port specific help file */ diff --git a/include/unixconf.h b/include/unixconf.h index 0ffa2e119..c85611c2a 100644 --- a/include/unixconf.h +++ b/include/unixconf.h @@ -281,9 +281,6 @@ #define HLOCK "perm" /* an empty file used for locking purposes */ -#ifndef REDO -#define Getchar nhgetch -#endif #define tgetch getchar #ifndef NOSHELL diff --git a/include/vmsconf.h b/include/vmsconf.h index d675588e2..f3045bed7 100644 --- a/include/vmsconf.h +++ b/include/vmsconf.h @@ -234,9 +234,6 @@ typedef __mode_t mode_t; # define O_TRUNC 0x400 #endif -#ifndef REDO -# define Getchar nhgetch -#endif #define tgetch vms_getchar #include "system.h" diff --git a/include/wceconf.h b/include/wceconf.h index 808334768..52ad4d1f1 100644 --- a/include/wceconf.h +++ b/include/wceconf.h @@ -185,11 +185,6 @@ extern void NDECL(toggle_mouse_support); #define ALLOCA_HACK /* used in util/panic.c */ #endif -#ifndef REDO -#undef Getchar -#define Getchar nhgetch -#endif - #ifdef _MSC_VER #if 0 #pragma warning(disable:4018) /* signed/unsigned mismatch */ diff --git a/src/allmain.c b/src/allmain.c index d56f11bda..2bb1c4240 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -246,11 +246,9 @@ boolean resuming; if (!next_to_u()) { check_leash(old_ux, old_uy); } -#ifdef REDO /* clear doagain keystrokes */ pushch(0); savech(0); -#endif } } /* delayed change may not be valid anymore */ @@ -355,12 +353,10 @@ boolean resuming; #if defined(MICRO) || defined(WIN32) abort_lev = 0; if (kbhit()) { - if ((ch = Getchar()) == ABORT) + if ((ch = pgetchar()) == ABORT) abort_lev++; -# ifdef REDO else pushch(ch); -# endif /* REDO */ } if (!abort_lev && (*occupation)() == 0) #else @@ -439,10 +435,8 @@ stop_occupation() You("stop %s.", occtxt); occupation = 0; context.botl = 1; /* in case u.uhs changed */ -#ifdef REDO nomul(0); pushch(0); -#endif } } diff --git a/src/cmd.c b/src/cmd.c index 1477eabdc..f7e858e01 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -236,7 +236,6 @@ int xtime; return; } -#ifdef REDO STATIC_DCL char NDECL(popch); @@ -298,7 +297,6 @@ char ch; } return; } -#endif /* REDO */ STATIC_PTR int doextcmd(VOID_ARGS) /* here after # - now read a full-word command */ @@ -2950,7 +2948,6 @@ register char *cmd; context.move = FALSE; return; } -#ifdef REDO if (*cmd == DOAGAIN && !in_doagain && saveq[0]) { in_doagain = TRUE; stail = 0; @@ -2960,9 +2957,6 @@ register char *cmd; } /* Special case of *cmd == ' ' handled better below */ if(!*cmd || *cmd == (char)0377) -#else - if(!*cmd || *cmd == (char)0377 || (!flags.rest_on_space && *cmd == ' ')) -#endif { nhbell(); context.move = FALSE; @@ -3253,11 +3247,9 @@ const char *s; int is_mov; retry: -#ifdef REDO if (in_doagain || *readchar_queue) dirsym = readchar(); else -#endif dirsym = yn_function((s && *s != '^') ? s : "In what direction?", (char *)0, '\0'); /* remove the prompt string so caller won't have to */ @@ -3267,9 +3259,7 @@ const char *s; docrt(); /* redraw */ goto retry; } -#ifdef REDO savech(dirsym); -#endif if (dirsym == '.' || dirsym == 's') { u.dx = u.dy = u.dz = 0; @@ -3554,14 +3544,12 @@ parse() if (foo == '\033') { /* esc cancels count (TH) */ clear_nhwindow(WIN_MESSAGE); multi = last_multi = 0; -# ifdef REDO } else if (foo == DOAGAIN || in_doagain) { multi = last_multi; } else { last_multi = multi; savech(0); /* reset input queue */ savech((char)foo); -# endif } if (multi) { @@ -3589,9 +3577,7 @@ parse() if (foo == 'g' || foo == 'G' || foo == 'm' || foo == 'M' || foo == 'F' || (Cmd.num_pad && (foo == '5' || foo == '-'))) { foo = readchar(); -#ifdef REDO savech((char)foo); -#endif in_line[1] = foo; in_line[2] = 0; } @@ -3658,11 +3644,7 @@ readchar() if ( *readchar_queue ) sym = *readchar_queue++; else -#ifdef REDO - sym = in_doagain ? Getchar() : nh_poskey(&x, &y, &mod); -#else - sym = Getchar(); -#endif + sym = in_doagain ? pgetchar() : nh_poskey(&x, &y, &mod); #ifdef NR_OF_EOFS if (sym == EOF) { @@ -3674,7 +3656,7 @@ readchar() */ do { clearerr(stdin); /* omit if clearerr is undefined */ - sym = Getchar(); + sym = pgetchar(); } while (--cnt && sym == EOF); } #endif /* NR_OF_EOFS */ @@ -3687,7 +3669,7 @@ readchar() #ifdef ALTMETA } else if (sym == '\033' && alt_esc) { /* iflags.altmeta: treat two character ``ESC c'' as single `M-c' */ - sym = *readchar_queue ? *readchar_queue++ : Getchar(); + sym = *readchar_queue ? *readchar_queue++ : pgetchar(); if (sym == EOF || sym == 0) sym = '\033'; else if (sym != '\033') diff --git a/src/decl.c b/src/decl.c index 47043d0cd..f7601bda0 100644 --- a/src/decl.c +++ b/src/decl.c @@ -31,9 +31,7 @@ int x_maze_max = (COLNO-1) & ~1, int otg_temp; /* used by object_to_glyph() [otg] */ -#ifdef REDO NEARDATA int in_doagain = 0; -#endif /* * The following structure will be initialized at startup time with diff --git a/src/invent.c b/src/invent.c index 7a7a83734..e3cd20247 100644 --- a/src/invent.c +++ b/src/invent.c @@ -928,11 +928,9 @@ register const char *let,*word; Sprintf(qbuf, "What do you want to %s? [%s or ?*]", word, buf); } -#ifdef REDO if (in_doagain) ilet = readchar(); else -#endif ilet = yn_function(qbuf, (char *)0, '\0'); if (digit(ilet) && !allowcnt) { pline("No count allowed with this command."); @@ -940,9 +938,7 @@ register const char *let,*word; } if (ilet == '0') prezero = TRUE; while (digit(ilet)) { -#ifdef REDO if (ilet != '?' && ilet != '*') savech(ilet); -#endif /* accumulate unless cnt has overflowed */ if (allowcnt < 3) { prevcnt = cnt; @@ -1018,23 +1014,17 @@ register const char *let,*word; } } context.botl = 1; /* May have changed the amount of money */ -#ifdef REDO savech(ilet); -#endif for (otmp = invent; otmp; otmp = otmp->nobj) if (otmp->invlet == ilet) break; if(!otmp) { You("don't have that object."); -#ifdef REDO if (in_doagain) return((struct obj *) 0); -#endif continue; } else if (cnt < 0 || otmp->quan < cnt) { You("don't have that many! You have only %ld.", otmp->quan); -#ifdef REDO if (in_doagain) return((struct obj *) 0); -#endif continue; } break; @@ -2102,9 +2092,7 @@ dotypeinv() if(class_count > 1) { c = yn_function(prompt, types, '\0'); -#ifdef REDO savech(c); -#endif if(c == '\0') { clear_nhwindow(WIN_MESSAGE); return 0; diff --git a/src/o_init.c b/src/o_init.c index 102160635..4ae8892e9 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -568,9 +568,7 @@ doclassdisco() } /* get the class (via its symbol character) */ c = yn_function(prompt, discosyms, '\0'); -#ifdef REDO savech(c); -#endif if (!c) clear_nhwindow(WIN_MESSAGE); } else { diff --git a/sys/share/pcsys.c b/sys/share/pcsys.c index 0fc5ee8ed..16d36bbb7 100644 --- a/sys/share/pcsys.c +++ b/sys/share/pcsys.c @@ -407,7 +407,7 @@ const char *str; #else msmsg("Hit %s.", str); #endif - while (Getchar() != '\n') ; + while (pgetchar() != '\n') ; return; } diff --git a/util/makedefs.c b/util/makedefs.c index c61b561d1..9ea0d3898 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1261,9 +1261,6 @@ static const char *build_opts[] = { # endif # endif #endif -#ifdef REDO - "redo command", -#endif #ifdef SELECTSAVED "restore saved games via menu", #endif diff --git a/win/tty/getline.c b/win/tty/getline.c index 6dfa10a6e..2dd90ae3f 100644 --- a/win/tty/getline.c +++ b/win/tty/getline.c @@ -82,7 +82,7 @@ getlin_hook_proc hook; #else Strcat(strcat(strcpy(toplines, query), " "), obufp); #endif - c = Getchar(); + c = pgetchar(); if (c == '\033' || c == EOF) { obufp[0] = '\033'; obufp[1] = '\0'; @@ -271,26 +271,20 @@ tty_get_ext_cmd() if (iflags.extmenu) return extcmd_via_menu(); /* maybe a runtime option? */ /* hooked_tty_getlin("#", buf, flags.cmd_comp ? ext_cmd_getlin_hook : (getlin_hook_proc) 0); */ -#ifdef REDO hooked_tty_getlin("#", buf, in_doagain ? (getlin_hook_proc)0 : ext_cmd_getlin_hook); -#else - hooked_tty_getlin("#", buf, ext_cmd_getlin_hook); -#endif (void) mungspaces(buf); if (buf[0] == 0 || buf[0] == '\033') return -1; for (i = 0; extcmdlist[i].ef_txt != (char *)0; i++) if (!strcmpi(buf, extcmdlist[i].ef_txt)) break; -#ifdef REDO if (!in_doagain) { int j; for (j = 0; buf[j]; j++) savech(buf[j]); savech('\n'); } -#endif if (extcmdlist[i].ef_txt == (char *)0) { pline("%s: unknown extended command.", buf); From 7c09285a8c344022ab813d71b8861c2d4553f99a Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 27 Feb 2015 19:24:43 -0500 Subject: [PATCH 022/354] Make EXP_ON_BOTL unconditional. --- include/config.h | 3 +-- src/botl.c | 4 +--- src/options.c | 8 +------- sys/wince/mhstatus.c | 4 +--- util/makedefs.c | 13 +++---------- win/X11/winstat.c | 15 +-------------- win/gnome/gnstatus.c | 4 +--- 7 files changed, 9 insertions(+), 42 deletions(-) diff --git a/include/config.h b/include/config.h index 5cf035b54..3bddda18b 100644 --- a/include/config.h +++ b/include/config.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 config.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.48 $ */ +/* NetHack 3.5 config.h $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.51 $ */ /* NetHack 3.5 config.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.37 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -425,7 +425,6 @@ typedef unsigned char uchar; #define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ -#define EXP_ON_BOTL /* Show experience on bottom line */ /* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson@ucivax) */ /* diff --git a/src/botl.c b/src/botl.c index ab02ae35b..76d16a8ff 100644 --- a/src/botl.c +++ b/src/botl.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 botl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 botl.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.38 $ */ /* NetHack 3.5 botl.c $Date: 2012/01/10 17:47:19 $ $Revision: 1.36 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -268,10 +268,8 @@ bot2() if (Upolyd) Sprintf(nb = eos(nb), " HD:%d", mons[u.umonnum].mlevel); -#ifdef EXP_ON_BOTL else if(flags.showexp) Sprintf(nb = eos(nb), " Xp:%u/%-1ld", u.ulevel,u.uexp); -#endif else Sprintf(nb = eos(nb), " Exp:%u", u.ulevel); diff --git a/src/options.c b/src/options.c index 51bda6c59..97378888a 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 options.c $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.156 $ */ +/* NetHack 3.5 options.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.158 $ */ /* NetHack 3.5 options.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.153 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -175,11 +175,7 @@ static struct Bool_Opt {"safe_pet", &flags.safe_dog, TRUE, SET_IN_GAME}, {"sanity_check", &iflags.sanity_check, FALSE, SET_IN_GAME}, {"selectsaved", &iflags.wc2_selectsaved, TRUE, DISP_IN_GAME}, /*WC*/ -#ifdef EXP_ON_BOTL {"showexp", &flags.showexp, FALSE, SET_IN_GAME}, -#else - {"showexp", (boolean *)0, FALSE, SET_IN_FILE}, -#endif {"showrace", &flags.showrace, FALSE, SET_IN_GAME}, #ifdef SCORE_ON_BOTL {"showscore", &flags.showscore, FALSE, SET_IN_GAME}, @@ -2618,9 +2614,7 @@ goodfruit: if (initial) return; if ((boolopt[i].addr) == &flags.time -#ifdef EXP_ON_BOTL || (boolopt[i].addr) == &flags.showexp -#endif #ifdef SCORE_ON_BOTL || (boolopt[i].addr) == &flags.showscore #endif diff --git a/sys/wince/mhstatus.c b/sys/wince/mhstatus.c index dd86e2d6e..397f2dcb8 100644 --- a/sys/wince/mhstatus.c +++ b/sys/wince/mhstatus.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mhstatus.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhstatus.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.8 $ */ /* NetHack 3.5 mhstatus.c $Date: 2009/05/06 10:52:28 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)mhstatus.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ @@ -238,10 +238,8 @@ void FormatStatusString(char* text, int format) if (Upolyd) Sprintf(nb = eos(nb), " HD:%d", mons[u.umonnum].mlevel); -#ifdef EXP_ON_BOTL else if(flags.showexp) Sprintf(nb = eos(nb), " Xp:%u/%-1ld", u.ulevel,u.uexp); -#endif else Sprintf(nb = eos(nb), " Exp:%u", u.ulevel); if( format==NHSTAT_LINES_4 ) strcat(text, "\r\n"); diff --git a/util/makedefs.c b/util/makedefs.c index 9ea0d3898..ba3ee79f3 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 makedefs.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.61 $ */ +/* NetHack 3.5 makedefs.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.63 $ */ /* NetHack 3.5 makedefs.c $Date: 2012/01/15 09:27:03 $ $Revision: 1.50 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) M. Stephenson, 1990, 1991. */ @@ -960,8 +960,7 @@ do_rumors() * */ #define IGNORED_FEATURES ( 0L \ - | (1L << 19) /* EXP_ON_BOTL */ \ - | (1L << 20) /* SCORE_ON_BOTL */ \ + | (1L << 19) /* SCORE_ON_BOTL */ \ | (1L << 27) /* ZEROCOMP */ \ | (1L << 28) /* RLECOMP */ \ ) @@ -999,11 +998,8 @@ make_version() #ifdef INSURANCE | (1L << 18) #endif -#ifdef EXP_ON_BOTL - | (1L << 19) -#endif #ifdef SCORE_ON_BOTL - | (1L << 20) + | (1L << 19) #endif /* data format (27..31) * External compression methods such as COMPRESS and ZLIB_COMP @@ -1226,9 +1222,6 @@ static const char *build_opts[] = { #ifdef DLB "data librarian", #endif -#ifdef EXP_ON_BOTL - "experience points on status line", -#endif #ifdef MFLOPPY "floppy drive support", #endif diff --git a/win/X11/winstat.c b/win/X11/winstat.c index ab65a168c..ae2a3ce83 100644 --- a/win/X11/winstat.c +++ b/win/X11/winstat.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 winstat.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winstat.c $NHDT-Date: 1425083083 2015/02/28 00:24:43 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.5 $ */ /* NetHack 3.5 winstat.c $Date: 2009/05/06 10:55:59 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)winstat.c 3.5 1996/04/05 */ /* Copyright (c) Dean Luick, 1992 */ @@ -427,7 +427,6 @@ update_val(attr_rec, new_value) /* special case: exp can be enabled & disabled */ else if (attr_rec == &shown_stats[F_EXP]) { static boolean flagexp = TRUE; -#ifdef EXP_ON_BOTL if (flags.showexp && !flagexp) { set_name(attr_rec->w, shown_stats[F_EXP].name); @@ -439,14 +438,6 @@ update_val(attr_rec, new_value) flagexp = flags.showexp; } if (!flagexp) return; -#else - if (flagexp) { - set_name(attr_rec->w, ""); - set_value(attr_rec->w, ""); - flagexp = FALSE; - } - return; /* don't show it at all */ -#endif } /* special case: score can be enabled & disabled */ @@ -612,11 +603,7 @@ update_fancy_status(wp) case F_LEVEL: val = (long) (u.mtimedone ? mons[u.umonnum].mlevel : u.ulevel); break; -#ifdef EXP_ON_BOTL case F_EXP: val = flags.showexp ? u.uexp : 0L; break; -#else - case F_EXP: val = 0L; break; -#endif case F_ALIGN: val = (long) u.ualign.type; break; case F_TIME: val = flags.time ? (long) moves : 0L; break; #ifdef SCORE_ON_BOTL diff --git a/win/gnome/gnstatus.c b/win/gnome/gnstatus.c index 37e1d7bf6..5109f5bb7 100644 --- a/win/gnome/gnstatus.c +++ b/win/gnome/gnstatus.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 gnstatus.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnstatus.c $NHDT-Date: 1425083083 2015/02/28 00:24:43 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.6 $ */ /* NetHack 3.5 gnstatus.c $Date: 2009/05/06 10:57:54 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gnstatus.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ @@ -655,7 +655,6 @@ void ghack_status_window_update_stats() lastAC = u.uac; gtk_label_set( GTK_LABEL( acLabel), buf); -#ifdef EXP_ON_BOTL if (flags.showexp) { sprintf(buf,"Exp:%ld", u.uexp); if (lastExp < u.uexp && firstTime==FALSE) { @@ -669,7 +668,6 @@ void ghack_status_window_update_stats() lastExp = u.uexp; gtk_label_set( GTK_LABEL( expLabel), buf); } else -#endif { gtk_label_set( GTK_LABEL( expLabel), ""); } From a3faa9340340745b8b6886d46fc2a68972343117 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sat, 14 Feb 2015 15:02:50 -0500 Subject: [PATCH 023/354] Remove experimental Unicode support. This reverts commit 7f0f43e6f98bccab20db7ab3cb509fdbe60a7b2b and some related subsequent commits. This compiles, but I have not done extensive testing. Conflicts: include/config.h include/decl.h include/extern.h include/global.h include/tradstdc.h include/wintty.h src/drawing.c src/files.c src/hacklib.c src/mapglyph.c src/options.c sys/winnt/nttty.c win/tty/getline.c win/tty/topl.c win/tty/wintty.c --- dat/symbols | 132 ----------------- include/config.h | 4 - include/decl.h | 2 +- include/extern.h | 16 +-- include/flag.h | 2 - include/global.h | 33 +---- include/ntconf.h | 5 - include/rm.h | 22 +-- include/tradstdc.h | 9 -- include/wintty.h | 17 +-- src/decl.c | 3 +- src/drawing.c | 6 +- src/files.c | 90 +----------- src/hacklib.c | 188 ------------------------- src/mapglyph.c | 17 ++- src/options.c | 40 +++--- src/pager.c | 2 +- src/pline.c | 6 +- sys/winnt/nttty.c | 84 ++--------- win/tty/getline.c | 62 +++----- win/tty/topl.c | 167 ++++++++-------------- win/tty/wintty.c | 342 +++++---------------------------------------- 22 files changed, 189 insertions(+), 1060 deletions(-) diff --git a/dat/symbols b/dat/symbols index 8f396582b..108d761d1 100644 --- a/dat/symbols +++ b/dat/symbols @@ -201,10 +201,6 @@ start: RogueEpyx S_food: \x05 # club (as in cards) S_potion: \xad # upside down '!' S_scroll: \x0e # musical note -# S_armor: \x5b -# S_ring: \x3d -# S_amulet: \x0c -# S_tool: \x28 S_wand: \xe7 # greek tau S_coin: \x0f # yes it's the same as gems S_gem: \x0f # fancy '*' @@ -397,131 +393,3 @@ start: NHAccess S_explode9: \047 finish -start: Unicode_US - Description: Unicode symbols similar to code page 437 - Restrictions: Unicode - S_vwall: U+2502 # box drawings light vertical - S_hwall: U+2500 # box drawings light horizontal - S_tlcorn: U+250C # box drawings light down and right - S_trcorn: U+2510 # box drawings light down and left - S_blcorn: U+2514 # box drawings light up and right - S_brcorn: U+2518 # box drawings light up and left - S_crwall: U+253C # box drawings light up and left - S_tuwall: U+2534 # box drawings light up and horizontal - S_tdwall: U+252C # box drawings light down and horizontal - S_tlwall: U+2524 # box drawings light vertical and left - S_trwall: U+251C # box drawings light vertical and right - S_ndoor: U+2556 # box drawings down double and left single - S_vodoor: U+25A0 # black square - S_hodoor: U+25A0 # black square - S_bars: U+2261 # identical to - S_tree: U+00B1 # plus-minus sign - S_room: U+00B7 # middle dot - S_corr: U+2591 # light shade - S_litcorr: U+2592 # medium shade - S_fountain: U+2320 # top half integral - S_pool: U+2248 # almost equal to - S_ice: U+00B7 # middle dot - S_lava: U+2248 # almost equal to - S_vodbridge: U+00B7 # middle dot - S_hodbridge: U+00B7 # middle dot - S_water: U+2248 # almost equal to - S_vbeam: U+2502 # box drawings light vertical - S_hbeam: U+2500 # box drawings light horizontal - S_sw_ml: U+2502 # box drawings light vertical - S_sw_mr: U+2502 # box drawings light vertical - S_explode4: U+2502 # box drawings light vertical - S_explode6: U+2502 # box drawings light vertical -finish - -start: Unicode_non_US - Description: If default OEM CP for non-Unicode programs is not 437 or 850 - Restrictions: Unicode - S_vwall: U+2502 # box drawings light vertical - S_hwall: U+2500 # box drawings light horizontal - S_tlcorn: U+250C # box drawings light down and right - S_trcorn: U+2510 # box drawings light down and left - S_blcorn: U+2514 # box drawings light up and right - S_brcorn: U+2518 # box drawings light up and left - S_crwall: U+253C # box drawings light up and left - S_tuwall: U+2534 # box drawings light up and horizontal - S_tdwall: U+252C # box drawings light down and horizontal - S_tlwall: U+2524 # box drawings light vertical and left - S_trwall: U+251C # box drawings light vertical and right - S_vodoor: U+25A0 # black square - S_hodoor: U+25A0 # black square - S_corr: U+2591 # light shade - S_litcorr: U+2592 # medium shade - S_vbeam: U+2502 # box drawings light vertical - S_hbeam: U+2500 # box drawings light horizontal - S_sw_ml: U+2502 # box drawings light vertical - S_sw_mr: U+2502 # box drawings light vertical - S_explode4: U+2502 # box drawings light vertical - S_explode6: U+2502 # box drawings light vertical - S_coin: U+20AC # euro -finish - -start: UnicodeRogueEpyx - Description: Unicode Rogue level symbols - Restrictions: Unicode - Restrictions: Rogue - Color: Yes - S_weapon: U+2191 # up arrow - S_armor: U+25d9 # Vert rect with o - S_ring: U+2642 # circle with arrow - S_amulet: U+2640 # "female" symbol - S_food: U+2663 # club (as in cards) - S_potion: U+00a1 # upside down '!' - S_scroll: U+266a # musical note - S_wand: U+03c4 # greek tau - S_coin: U+263c # yes it's the same as gems - S_gem: U+263c # fancy '*' - S_rock: U+0060 # grave accent - S_ball: U+0030 # digit 0 - S_chain: U+005f # low line - S_venom: U+002e # full stop - S_book: U+002b # + sign - S_vwall: U+2551 # all walls now use - S_hwall: U+2550 # double line graphics - S_tlcorn: U+2554 # box drawing double down and right - S_trcorn: U+2557 # box drawing double down and left - S_blcorn: U+255a # box drawing double up and right - S_brcorn: U+255d # box drawing double up and left - S_crwall: U+256c # box drawing double vertical and horizontal - S_tuwall: U+2569 # box drawing double up and horizontal - S_tdwall: U+2566 # box drawing double down and horizontal - S_tlwall: U+2563 # box drawing double vertical and left - S_trwall: U+2560 # box drawing double vertical and right - S_ndoor: U+256c # box drawing double vertical and horizontal - S_vodoor: U+256c # box drawing double vertical and horizontal - S_hodoor: U+256c # box drawing double vertical and horizontal - S_room: U+00b7 # centered dot - S_corr: U+2592 # medium shade - S_litcorr: U+2593 # dark shade - S_upstair: U+001e # Greek Xi - S_dnstair: U+001f - S_arrow_trap: U+2666 # diamond (cards) - S_dart_trap: U+2666 - S_falling_rock_trap: U+2666 - S_squeaky_board: U+2666 - S_bear_trap: U+2666 - S_land_mine: U+2666 - S_rolling_boulder_trap: U+2666 - S_sleeping_gas_trap: U+2666 - S_rust_trap: U+2666 - S_fire_trap: U+2666 - S_pit: U+2666 - S_spiked_pit: U+2666 - S_hole: U+2666 - S_trap_door: U+2666 - S_teleportation_trap: U+2666 - S_level_teleporter: U+2666 - S_magic_portal: U+2666 - S_web: U+2666 - S_statue_trap: U+2666 - S_magic_trap: U+2666 - S_anti_magic_trap: U+2666 - S_polymorph_trap: U+2666 - S_human: U+263a # face -finish - diff --git a/include/config.h b/include/config.h index 3bddda18b..c13b2dd01 100644 --- a/include/config.h +++ b/include/config.h @@ -315,10 +315,6 @@ */ #endif /* CHDIR */ -/* - * Enable some UNICODE support. - */ -/*#define UNICODE_SUPPORT */ /* master on/off for any unicode support */ /* diff --git a/include/decl.h b/include/decl.h index 92f1e8240..f9d4a7b7c 100644 --- a/include/decl.h +++ b/include/decl.h @@ -320,7 +320,6 @@ E NEARDATA winid WIN_MESSAGE; E NEARDATA winid WIN_STATUS; #endif E NEARDATA winid WIN_MAP, WIN_INVEN; -E nhwchar toplines[]; /* pline (et al) for a single string argument (suppress compiler warning) */ #define pline1(cstr) pline("%s", cstr) @@ -331,6 +330,7 @@ E nhwchar toplines[]; #define Sprintf1(buf, cstr) Sprintf(buf, "%s", cstr) #define panic1(cstr) panic("%s", cstr) +E char toplines[]; #ifndef TCAP_H E struct tc_gbl_data { /* also declared in tcap.h */ char *tc_AS, *tc_AE; /* graphics start and end (tty font swapping) */ diff --git a/include/extern.h b/include/extern.h index bfd361326..c3004a0a0 100644 --- a/include/extern.h +++ b/include/extern.h @@ -731,7 +731,6 @@ E void FDECL(check_recordfile, (const char *)); E void NDECL(read_wizkit); E int FDECL(read_sym_file, (int)); E int FDECL(parse_sym_line, (char *,int)); -E int FDECL(sym_val, (const char *)); E void FDECL(paniclog, (const char *, const char *)); E int FDECL(validate_prefix_locations, (char *)); #ifdef SELECTSAVED @@ -846,20 +845,6 @@ E int NDECL(phase_of_the_moon); E boolean NDECL(friday_13th); E int NDECL(night); E int NDECL(midnight); -#ifdef UNICODE_WIDEWINPORT -E nhwchar *FDECL(nhwstrncpy, (nhwchar *,const char *,size_t)); -E nhwchar *FDECL(nhwncpy, (nhwchar *,const nhwchar *,size_t)); -E nhwchar *FDECL(nhwcpy, (nhwchar *,const nhwchar *)); -E nhwchar *FDECL(nhwstrcpy, (nhwchar *,const char *)); -E char *FDECL(strnhwcpy, (char *,const nhwchar *)); -E nhwchar *FDECL(nhwstrcat, (nhwchar *,const char *)); -E nhwchar *FDECL(nhwcat, (nhwchar *,const nhwchar *)); -E nhwchar *FDECL(nhwindex, (const nhwchar *,int)); -E size_t FDECL(nhwlen, (const nhwchar *)); -E int FDECL(nhwcmp, (const nhwchar *,const nhwchar *)); -E int FDECL(nhwncmp, (const nhwchar *,const nhwchar *,int)); -E int FDECL(nhwstrcmp, (const nhwchar *,const char *)); -#endif /* ### invent.c ### */ @@ -1587,6 +1572,7 @@ E int FDECL(load_symset, (const char *,int)); E void FDECL(parsesymbols, (char *)); E struct symparse *FDECL(match_sym, (char *)); E void NDECL(set_playmode); +E int FDECL(sym_val, (char *)); /* ### pager.c ### */ diff --git a/include/flag.h b/include/flag.h index 2b5d2c3ee..de2b63e84 100644 --- a/include/flag.h +++ b/include/flag.h @@ -198,8 +198,6 @@ struct instance_flags { boolean rlecomp; /* run-length comp of levels when writing savefile */ uchar num_pad_mode; boolean echo; /* 1 to echo characters */ - boolean unicodecapable; /* unicode support is possible on platform */ - boolean unicodedisp; /* unicode support is turned on */ #if 0 boolean DECgraphics; /* use DEC VT-xxx extended character set */ boolean IBMgraphics; /* use IBM extended character set */ diff --git a/include/global.h b/include/global.h index e3292e243..6179409bb 100644 --- a/include/global.h +++ b/include/global.h @@ -65,41 +65,10 @@ typedef xchar boolean; /* 0 or 1 */ #endif /* - * UNICODE_SUPPORT - * Unicode/wide character related support. + * type nhsym: loadable symbols go into this type */ -#ifdef UNICODE_SUPPORT -# define UNICODE_DRAWING /* store drawing symbols in wchar_t data type */ -# define UNICODE_WIDEWINPORT /* store and render wide chars in window port */ -/*# define UNICODE_PLAYERTEXT*/ /* not implemented - player input in wide chars */ -#include -#include -#else -# undef UNICODE_DRAWING -# undef UNICODE_WIDEWINPORT -# undef UNICODE_PLAYERTEXT -#endif - -#if defined(UNICODE_DRAWING) -typedef wchar_t nhsym; /* nhsym is wide char */ -#else typedef uchar nhsym; -#endif -#if defined(UNICODE_WIDEWINPORT) -typedef wchar_t nhwchar; /* nhwchar (window port char) is wide char */ -#else -typedef char nhwchar; -#endif - -#if 0 -/* Not Implemented presently */ -#if defined(UNICODE_PLAYERTEXT) -typedef wchar_t nhptext; /* player input is wide char */ -#else -typedef char nhptext; -#endif -#endif #ifndef STRNCMPI # ifndef __SASC_60 /* SAS/C already shifts to stricmp */ diff --git a/include/ntconf.h b/include/ntconf.h index 4ad1a6e73..95a506635 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -193,11 +193,6 @@ extern void NDECL(toggle_mouse_support); extern void FDECL(map_subkeyvalue, (char *)); extern void NDECL(load_keyboard_handler); extern void NDECL(raw_clear_screen); -# ifdef UNICODE_WIDEWINPORT -extern void FDECL(xputc, (NHWCHAR_P)); -# else -extern void FDECL(xputc, (int)); -# endif #endif #include diff --git a/include/rm.h b/include/rm.h index 2fa3da6b6..c007f6a4f 100644 --- a/include/rm.h +++ b/include/rm.h @@ -227,13 +227,6 @@ struct symdef { #endif }; -/* - * Graphics sets for display symbols - */ -#define PRIMARY 0 /* primary graphics */ -#define ROGUESET 1 /* rogue graphics */ -#define NUM_GRAPHICS 2 - struct symparse { unsigned range; #define SYM_CONTROL 1 /* start/finish markers */ @@ -260,18 +253,25 @@ struct symsetentry { Bitfield(nocolor,1); /* don't use color if set */ Bitfield(primary,1); /* restricted for use as primary set */ Bitfield(rogue,1); /* restricted for use as rogue lev set */ - Bitfield(unicode,1); /* restricted for use as a unicode set */ /* 5 free bits */ }; +/* + * Graphics sets for display symbols + */ +#define DEFAULT_GRAPHICS 0 /* regular characters: '-', '+', &c */ +#define PRIMARY 0 /* primary graphics set */ +#define ROGUESET 1 /* rogue graphics set */ +#define NUM_GRAPHICS 2 + /* * special symbol set handling types ( for invoking callbacks, etc.) * Must match the order of the known_handlers strings * in drawing.c */ -#define H_UNK 0 -#define H_IBM 1 -#define H_DEC 2 +#define H_UNK 0 +#define H_IBM 1 +#define H_DEC 2 extern const struct symdef defsyms[MAXPCHARS]; /* defaults */ extern const struct symdef def_warnsyms[WARNCOUNT]; diff --git a/include/tradstdc.h b/include/tradstdc.h index 480ea7878..dc75bc393 100644 --- a/include/tradstdc.h +++ b/include/tradstdc.h @@ -257,7 +257,6 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */ # define BOOLEAN_P boolean # endif # define ALIGNTYP_P aligntyp -# define NHWCHAR_P nhwchar #else # ifdef WIDENED_PROTOTYPES # define CHAR_P int @@ -267,14 +266,6 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */ # define SHORT_P int # define BOOLEAN_P int # define ALIGNTYP_P int -# if defined(UNICODE_WIDEWINPORT) && defined(WCHAR_MAX) -# if WCHAR_MAX >= INT_MAX -# define NHWCHAR_P nhwchar -# endif -# endif -# ifndef NHWCHAR_P -# define NHWCHAR_P int -# endif # else /* Neither widened nor unwidened prototypes. Argument list expansion * by FDECL/VDECL always empty; all xxx_P vanish so defs aren't needed. */ diff --git a/include/wintty.h b/include/wintty.h index a2ed1e009..507804a9f 100644 --- a/include/wintty.h +++ b/include/wintty.h @@ -35,8 +35,8 @@ struct WinDesc { /* maxcol is also used by WIN_MESSAGE for */ /* tracking the ^P command */ short *datlen; /* allocation size for *data */ - nhwchar **data; /* window data [row][column] */ - nhwchar *morestr; /* string to display instead of default */ + char **data; /* window data [row][column] */ + char *morestr; /* string to display instead of default */ tty_menu_item *mlist; /* menu information (MENU) */ tty_menu_item **plist; /* menu page pointers (MENU) */ short plist_size; /* size of allocated plist (MENU) */ @@ -88,7 +88,7 @@ extern struct WinDesc *wins[MAXWIN]; extern struct DisplayDesc *ttyDisplay; /* the tty display descriptor */ extern char morc; /* last character typed to xwaitforspace */ -extern nhwchar defmorestr[]; /* default --more-- prompt */ +extern char defmorestr[]; /* default --more-- prompt */ /* port specific external function references */ @@ -109,9 +109,7 @@ E void NDECL(tty_shutdown); * actually would be expanded. So here, we have to make an exception. */ E void FDECL(xputc, (int)); #else -# ifndef WIN32CON E void FDECL(xputc, (CHAR_P)); -# endif #endif E void FDECL(xputs, (const char *)); #if defined(SCREEN_VGA) || defined(SCREEN_8514) @@ -154,10 +152,10 @@ E int FDECL(has_color,(int color)); /* ### topl.c ### */ -E void FDECL(addtopl, (const nhwchar *)); +E void FDECL(addtopl, (const char *)); E void NDECL(more); -E void FDECL(update_topl, (const nhwchar *)); -E void FDECL(putsyms, (const nhwchar *)); +E void FDECL(update_topl, (const char *)); +E void FDECL(putsyms, (const char*)); /* ### wintty.c ### */ #ifdef CLIPPING @@ -167,9 +165,6 @@ E void FDECL(docorner, (int, int)); E void NDECL(end_glyphout); E void FDECL(g_putch, (int)); E void FDECL(win_tty_init, (int)); -#ifdef UNICODE_WIDEWINPORT -E void FDECL(u_putch, (nhwchar)); -#endif /* external declarations */ E void FDECL(tty_init_nhwindows, (int *, char **)); diff --git a/src/decl.c b/src/decl.c index f7601bda0..6c83f0f14 100644 --- a/src/decl.c +++ b/src/decl.c @@ -262,8 +262,7 @@ NEARDATA winid WIN_MESSAGE = WIN_ERR; NEARDATA winid WIN_STATUS = WIN_ERR; #endif NEARDATA winid WIN_MAP = WIN_ERR, WIN_INVEN = WIN_ERR; -nhwchar toplines[TBUFSZ]; - +char toplines[TBUFSZ]; /* Windowing stuff that's really tty oriented, but present for all ports */ struct tc_gbl_data tc_gbl_data = { 0,0, 0,0 }; /* AS,AE, LI,CO */ diff --git a/src/drawing.c b/src/drawing.c index 7fb0d461a..a5cc10d46 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -24,8 +24,8 @@ struct symsetentry symset[NUM_GRAPHICS]; int currentgraphics = 0; nhsym showsyms[SYM_MAX] = DUMMY; /* symbols to be displayed */ -nhsym l_syms[SYM_MAX] = DUMMY; /* loaded symbols */ -nhsym r_syms[SYM_MAX] = DUMMY; /* rogue symbols */ +nhsym l_syms[SYM_MAX] = DUMMY; /* loaded symbols */ +nhsym r_syms[SYM_MAX] = DUMMY; /* rogue symbols */ nhsym warnsyms[WARNCOUNT] = DUMMY; /* the current warning display symbols */ const char invisexplain[] = "remembered, unseen, creature"; @@ -525,7 +525,6 @@ boolean name_too; /* initialize restriction bits */ symset[which_set].primary = 0; symset[which_set].rogue = 0; - symset[which_set].unicode = 0; if (name_too) { if (symset[which_set].name) @@ -563,7 +562,6 @@ const char *known_handling[] = { const char *known_restrictions[] = { "primary", "rogue", - "unicode", (const char *)0, }; diff --git a/src/files.c b/src/files.c index cb7363399..7ba180547 100644 --- a/src/files.c +++ b/src/files.c @@ -2607,7 +2607,7 @@ parse_sym_line(buf, which_set) char *buf; int which_set; { - int val; + int val, i; struct symparse *symp = (struct symparse *)0; char *bufp, *commentp, *altp; @@ -2657,7 +2657,6 @@ int which_set; return 0; if (!symset[which_set].name) { - int i; /* A null symset name indicates that we're just building a pick-list of possible symset values from the file, so only do that */ @@ -2682,7 +2681,6 @@ int which_set; /* initialize restriction bits */ tmpsp->primary = 0; tmpsp->rogue = 0; - tmpsp->unicode = 0; break; case 2: /* handler type identified */ @@ -2705,17 +2703,14 @@ int which_set; case 5: /* restrictions: xxxx*/ tmpsp = symset_list; /* most recent symset */ - i = 0; - while (known_restrictions[i]) { + for (i = 0; known_restrictions[i]; ++i) { if (!strcmpi(known_restrictions[i], bufp)) { switch(i) { case 0: tmpsp->primary = 1; break; case 1: tmpsp->rogue = 1; break; - case 2: tmpsp->unicode = 1; break; } break; /* while loop */ } - i++; } break; } @@ -2732,7 +2727,7 @@ int which_set; chosen_symset_start = TRUE; /* these init_*() functions clear symset fields too */ if (which_set == ROGUESET) init_r_symbols(); - else if (which_set == PRIMARY) init_l_symbols(); + else if (which_set == PRIMARY) init_l_symbols(); } break; case 1: @@ -2771,23 +2766,12 @@ int which_set; break; case 1: symset[which_set].rogue = 1; break; - case 2: symset[which_set].unicode = 1; - break; } break; /* while loop */ } n++; } - /* Don't allow unicode set if code can't handle it */ - if (symset[which_set].unicode && - !iflags.unicodedisp) { - if (chosen_symset_start) - chosen_symset_end = FALSE; - chosen_symset_start = FALSE; - if (which_set == ROGUESET) init_r_symbols(); - else if (which_set == PRIMARY) init_l_symbols(); - } - } + } break; } } else { /* !SYM_CONTROL */ @@ -2821,72 +2805,6 @@ int which_set; } } -/* - * Produces a single integer value. - */ -int -sym_val(cp) -const char *cp; -{ - unsigned int cval = 0; - int meta = 0, dcount = 0; - const char *dp, *hex = "00112233445566778899aAbBcCdDeEfF"; - - while (*cp) - { - if (*cp == '\\' && index("mM", cp[1])) { - meta = 1; - cp += 2; - } - if ((*cp == 'U' || *cp == 'u') && cp[1] == '+' && index(hex, cp[2])) - { - dcount = 0; - cp++; - for (++cp; *cp && (dp = index(hex, *cp)) && (dcount++ < 4); cp++) - cval = (unsigned int)((cval * 16) + - ((unsigned int)(dp - hex) / 2)); - } - else if (*cp == '\\' && index("0123456789xXoO", cp[1])) - { - dcount = 0; - cp++; - if (*cp == 'x' || *cp == 'X') - for (++cp; *cp && (dp = index(hex, *cp)) && (dcount++ < 4); cp++) - cval = (unsigned int)((cval * 16) + - ((unsigned int)(dp - hex) / 2)); - else if (*cp == 'o' || *cp == 'O') - for (++cp; *cp && (index("01234567",*cp)) && (dcount++ < 5); cp++) - cval = (cval * 8) + (unsigned int)(*cp - '0'); - else - for (; *cp && (index("0123456789",*cp)) && (dcount++ < 5); cp++) - cval = (cval * 10) + (unsigned int)(*cp - '0'); - } - else if (*cp == '\\') /* C-style character escapes */ - { - switch (*++cp) - { - case '\\': cval = '\\'; break; - case 'n': cval = '\n'; break; - case 't': cval = '\t'; break; - case 'b': cval = '\b'; break; - case 'r': cval = '\r'; break; - default: cval = (unsigned int)*cp; - } - cp++; - } - else if (*cp == '^') /* expand control-character syntax */ - { - cval = (unsigned int)(*++cp & 0x1f); - cp++; - } - else - cval = (unsigned int)*cp++; - if (meta) - cval |= 0x80; - } - return cval; -} - /* ---------- END CONFIG FILE HANDLING ----------- */ /* ---------- BEGIN SCOREBOARD CREATION ----------- */ diff --git a/src/hacklib.c b/src/hacklib.c index 398b96dd4..4565f6d65 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -768,192 +768,4 @@ midnight() return(getlt()->tm_hour == 0); } -#ifdef UNICODE_WIDEWINPORT -nhwchar * -nhwstrncpy(dest, strSource, cnt) -nhwchar *dest; -const char *strSource; -size_t cnt; -{ - nhwchar *d = dest; - const char *s = strSource; - size_t dcnt = 0; - - while(*s && dcnt < cnt) { - *d++ = (nhwchar)*s++; - dcnt++; - } - if (dcnt < cnt) *d = 0; - return dest; -} - -nhwchar * -nhwncpy(dest, src, cnt) -nhwchar *dest; -const nhwchar *src; -size_t cnt; -{ - nhwchar *d = dest; - const nhwchar *s = src; - size_t dcnt = 0; - - while(*s && dcnt < cnt) { - *d++ = *s++; - dcnt++; - } - if (dcnt < cnt) *d = 0; - return dest; -} - -nhwchar * -nhwcpy(dest, src) -nhwchar *dest; -const nhwchar *src; -{ - nhwchar *d = dest; - const nhwchar *s = src; - - while(*s) { - *d++ = *s++; - } - *d = 0; - return dest; -} - -nhwchar * -nhwstrcpy(dest, strSource) -nhwchar *dest; -const char *strSource; -{ - nhwchar *d = dest; - const char *s = strSource; - - while(*s) { - *d++ = *s++; - } - *d = 0; - return dest; -} - -char * -strnhwcpy(strDest, src) -char *strDest; -const nhwchar *src; -{ - char *d = strDest; - const nhwchar *s = src; - - while(*s) { - *d++ = (char)*s++; - } - *d = 0; - return strDest; -} - -nhwchar * -nhwstrcat(dest, strSource) -nhwchar *dest; -const char *strSource; -{ - nhwchar *d = dest; - const char *s = strSource; - - while(*d) d++; - while(*s) { - *d++ = *s++; - } - *d = 0; - return dest; -} - -nhwchar * -nhwcat(dest, src) -nhwchar *dest; -const nhwchar *src; -{ - nhwchar *d = dest; - const nhwchar *s = src; - - while(*d) d++; - while(*s) { - *d++ = *s++; - } - *d = 0; - return dest; -} - -nhwchar * -nhwindex(ss, c) -const nhwchar *ss; -int c; -{ - const nhwchar *s = ss; - - while (*s) { - if (*s == c) return (nhwchar *)s; - s++; - } - if (*s == c) return (nhwchar *)s; - return (nhwchar *)0; -} - -size_t nhwlen(src) -const nhwchar *src; -{ - register size_t dl = 0; - - while(*src++) dl++; - return dl; -} - -int -nhwcmp(s1, s2) /* case sensitive comparison */ -register const nhwchar *s1, *s2; -{ - register nhwchar t1, t2; - - for (;;) { - if (!*s2) return (*s1 != 0); /* s1 >= s2 */ - else if (!*s1) return -1; /* s1 < s2 */ - t1 = *s1++; - t2 = *s2++; - if (t1 != t2) return (t1 > t2) ? 1 : -1; - } - return 0; /* s1 == s2 */ -} - -int -nhwncmp(s1, s2, n) /* case sensitive counted nhwchar (wide string) comparison */ - register const nhwchar *s1, *s2; - register int n; /*(should probably be size_t, which is usually unsigned)*/ -{ - register nhwchar t1, t2; - - while (n--) { - if (!*s2) return (*s1 != 0); /* s1 >= s2 */ - else if (!*s1) return -1; /* s1 < s2 */ - t1 = *s1++; - t2 = *s2++; - if (t1 != t2) return (t1 > t2) ? 1 : -1; - } - return 0; /* s1 == s2 */ -} - -int -nhwstrcmp(s1, s2) -register const nhwchar *s1; -const char *s2; -{ - register nhwchar t1, t2; - - for (;;) { - if (!*s2) return (*s1 != 0); /* s1 >= s2 */ - else if (!*s1) return -1; /* s1 < s2 */ - t1 = *s1++; - t2 = (nhwchar)*s2++; - if (t1 != t2) return (t1 > t2) ? 1 : -1; - } - return 0; /* s1 == s2 */ -} -#endif /*hacklib.c*/ diff --git a/src/mapglyph.c b/src/mapglyph.c index c00d6f8ad..e44265d3a 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -225,7 +225,6 @@ int glyph; return encbuf; } -#ifndef UNICODE_WIDEWINPORT /* * This differs from putstr() because the str parameter can * contain a sequence of characters representing: @@ -267,12 +266,25 @@ genl_putmixed(window, attr, str) gv = (int)((gv * 16) + ((int)(dp - hex) / 2)); so = mapglyph(gv, &ch, &oc, &os, 0, 0); *put++ = showsyms[so]; - continue; } else { /* possible forgery - leave it the way it is */ cp = save_cp; } break; +# if 0 + case 'S': /* symbol offset */ + dcount = 0; + for (++cp; *cp && (dp = index(hex, *cp)) && (dcount++ < 4); cp++) + rndchk = (int)((rndchk * 16) + ((int)(dp - hex) / 2)); + + if (rndchk == context.rndencode) { + dcount = 0; + for (; *cp && (dp = index(hex, *cp)) && (dcount++ < 2); cp++) + so = (int)((so * 16) + ((int)(dp - hex) / 2)); + } + *put++ = showsyms[so]; + break; +# endif case '\\': break; } @@ -283,5 +295,4 @@ genl_putmixed(window, attr, str) /* now send it to the normal putstr */ putstr(window, attr, buf); } -#endif /*!UNICODE_WIDEWINPORT*/ /*mapglyph.c*/ diff --git a/src/options.c b/src/options.c index 97378888a..1c63c5ed5 100644 --- a/src/options.c +++ b/src/options.c @@ -198,9 +198,6 @@ static struct Bool_Opt {"tombstone",&flags.tombstone, TRUE, SET_IN_GAME}, {"toptenwin",&iflags.toptenwin, FALSE, SET_IN_GAME}, {"travel", &flags.travelcmd, TRUE, SET_IN_GAME}, -#ifdef UNICODE_SUPPORT - {"unicode", &iflags.unicodedisp, FALSE, SET_IN_GAME}, -#endif #ifdef WIN32CON {"use_inverse", &iflags.wc_inverse, TRUE, SET_IN_GAME}, /*WC*/ #else @@ -605,9 +602,6 @@ initoptions_init() iflags.msg_history = 20; #ifdef TTY_GRAPHICS iflags.prevmsg_window = 's'; -# if defined(UNIX) && defined(UNICODE_WIDEWINPORT) - iflags.unicodecapable = TRUE; -# endif #endif iflags.menu_headings = ATR_INVERSE; @@ -2514,7 +2508,7 @@ goodfruit: boolean badflag = FALSE; if (duplicate) complain_about_duplicate(opts,1); if (!negated) { - for (i = PRIMARY; i <= ROGUESET; ++i) { + for (i = 0; i < NUM_GRAPHICS; ++i) { if (symset[i].name) badflag = TRUE; else { @@ -3359,7 +3353,7 @@ boolean setinitial,setfromfile; || !strcmp("roguesymset", optname)) { menu_item *symset_pick = (menu_item *)0; boolean primaryflag = (*optname == 's'), - rogueflag = (*optname == 'r'), + rogueflag = (*optname == 'r'), ready_to_switch = FALSE, nothing_to_do = FALSE; int res; @@ -3384,8 +3378,7 @@ boolean setinitial,setfromfile; sl = symset_list; while (sl) { /* check restrictions */ - if ((!rogueflag && sl->rogue) || - (!iflags.unicodedisp && sl->unicode) || + if ((!rogueflag && sl->rogue) || (!primaryflag && sl->primary)) { sl = sl->next; continue; @@ -3398,8 +3391,8 @@ boolean setinitial,setfromfile; } if (!setcount) { pline("There are no appropriate %ssymbol sets available.", - (rogueflag) ? "rogue level " : - (primaryflag) ? "primary " : + (rogueflag) ? "rogue level " : + (primaryflag) ? "primary " : ""); return TRUE; } @@ -3415,7 +3408,6 @@ boolean setinitial,setfromfile; while (sl) { /* check restrictions */ if ((!rogueflag && sl->rogue) || - (!iflags.unicodedisp && sl->unicode) || (!primaryflag && sl->primary)) { sl = sl->next; continue; @@ -3502,7 +3494,7 @@ boolean setinitial,setfromfile; if(rogueflag) init_r_symbols(); else - init_l_symbols(); + init_l_symbols(); if (symset[which_set].name) { if (read_sym_file(which_set)) @@ -3568,14 +3560,9 @@ char *buf; #endif #ifdef BACKWARD_COMPAT else if (!strcmp(optname, "boulder")) - Sprintf(buf, -# ifdef UNICODE_DRAWING - "\\x%04X", -# else - "%c", -# endif - iflags.bouldersym ? iflags.bouldersym : - showsyms[(int)objects[BOULDER].oc_class + SYM_OFF_O]); + Sprintf(buf, "%c", iflags.bouldersym ? + iflags.bouldersym : + showsyms[(int)objects[BOULDER].oc_class + SYM_OFF_O]); #endif else if (!strcmp(optname, "catname")) Sprintf(buf, "%s", catname[0] ? catname : none); @@ -4034,6 +4021,15 @@ char *buf; return (struct symparse *)0; } +int sym_val(strval) +char *strval; +{ + char buf[QBUFSZ]; + buf[0] = '\0'; + escapes(strval, buf); + return (int)*buf; +} + /* data for option_help() */ static const char *opt_intro[] = { "", diff --git a/src/pager.c b/src/pager.c index 4d734e5ef..4e8008c1b 100644 --- a/src/pager.c +++ b/src/pager.c @@ -571,7 +571,7 @@ do_look(mode, click_cc) for (i = 0; i < MAXMCLASSES; i++) { if (sym == ((from_screen || clicklook) ? showsyms[i + SYM_OFF_M] : def_monsyms[i].sym) && - def_monsyms[i].explain) { + def_monsyms[i].explain) { need_to_look = TRUE; if (!found) { Sprintf(out_str, "%s %s", diff --git a/src/pline.c b/src/pline.c index bd80a040f..3ee998684 100644 --- a/src/pline.c +++ b/src/pline.c @@ -76,11 +76,7 @@ pline VA_DECL(const char *, line) return; } #ifndef MAC -# ifdef UNICODE_WIDEWINPORT - if (no_repeat && !nhwstrcmp(toplines, line)) -# else - if (no_repeat && !strcmp(toplines, line)) -# endif + if (no_repeat && !strcmp(line, toplines)) return; #endif /* MAC */ if (vision_full_recalc) vision_recalc(0); diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index a0f9d95fe..9b9b186bc 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -64,6 +64,9 @@ int GUILaunched; extern int redirect_stdout; static BOOL FDECL(CtrlHandler, (DWORD)); +/* Flag for whether unicode is supported */ +static boolean has_unicode; + #ifdef PORT_DEBUG static boolean display_cursor_info = FALSE; #endif @@ -146,12 +149,6 @@ static void NDECL(init_ttycolor); # endif static void NDECL(really_move_cursor); -#ifdef UNICODE_WIDEWINPORT -void FDECL(xputc_core,(NHWCHAR_P)); -#else -void FDECL(xputc_core,(int)); -#endif - #define MAX_OVERRIDES 256 unsigned char key_overrides[MAX_OVERRIDES]; @@ -199,14 +196,11 @@ const char *s; void setftty() { - static int cp = 0; - if (!cp) cp = GetConsoleOutputCP(); - /* SetConsoleOutputCP(1250); */ #ifdef CHANGE_COLOR if (altered_palette) adjust_palette(); #endif start_screen(); - iflags.unicodecapable = ((GetVersion() & 0x80000000) == 0); + has_unicode = ((GetVersion() & 0x80000000) == 0); } void @@ -457,61 +451,24 @@ int x,y; ttyDisplay->cury = y; } -#ifdef UNICODE_WIDEWINPORT -#define T(x) L##x -#else -#define T(x) x -#endif - void -xputc_core(ich) -#ifdef UNICODE_WIDEWINPORT -nhwchar ich; -#else -int ich; -#endif +xputc_core(ch) +char ch; { - static uchar c[2] = {0,0}; - char ch = (char)ich; - -#if 0 - /*EURO symbol*/ - if (ich == 0x20AC) { - if (!c[0]) { - wchar_t t[2]={0x20ac, 0x0000}; - int cp = GetConsoleOutputCP(); - (void) WideCharToMultiByte(cp, - 0, - t, 1, - c, 2, - (LPCSTR)0, - (LPBOOL)0); - } - ich = (nhwchar)c[0]; - } -#endif -#ifdef UNICODE_WIDEWINPORT - switch(ich) { -#else switch(ch) { -#endif - case T('\n'): + case '\n': cursor.Y++; /* fall through */ - case T('\r'): + case '\r': cursor.X = 1; break; - case T('\b'): + case '\b': cursor.X--; break; default: WriteConsoleOutputAttribute(hConOut,&attr,1, cursor,&acount); - if (iflags.unicodedisp) { -#ifdef UNICODE_WIDEWINPORT - WriteConsoleOutputCharacterW(hConOut,&ich,1, - cursor,&ccount); -#else + if (has_unicode) { /* Avoid bug in ANSI API on WinNT */ WCHAR c2[2]; int rc; @@ -522,7 +479,6 @@ int ich; c2, 2); WriteConsoleOutputCharacterW(hConOut,c2,rc, cursor,&ccount); -#endif } else { WriteConsoleOutputCharacterA(hConOut,&ch,1, @@ -534,11 +490,7 @@ int ich; void xputc(ch) -#ifdef UNICODE_WIDEWINPORT -nhwchar ch; -#else -int ch; -#endif +char ch; { cursor.X = ttyDisplay->curx; cursor.Y = ttyDisplay->cury; @@ -569,8 +521,8 @@ const char *s; * for win32. It is used for glyphs only, not text. */ void -g_putch(in_sym) -int in_sym; +g_putch(in_ch) +int in_ch; { /* CP437 to Unicode mapping according to the Unicode Consortium */ static const WCHAR cp437[] = @@ -608,18 +560,12 @@ int in_sym; 0x2261, 0x00b1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00f7, 0x2248, 0x00b0, 0x2219, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x25a0, 0x00a0 }; - uchar ch = (uchar)in_sym; + unsigned char ch = (unsigned char)in_ch; cursor.X = ttyDisplay->curx; cursor.Y = ttyDisplay->cury; WriteConsoleOutputAttribute(hConOut,&attr,1,cursor,&acount); -#ifdef UNICODE_DRAWING - if (symset[currentgraphics].name && - symset[currentgraphics].unicode && iflags.unicodedisp) - WriteConsoleOutputCharacterW(hConOut,(LPCWSTR)&in_sym,1,cursor,&ccount); - else -#endif - if (SYMHANDLING(H_IBM)) + if (has_unicode) WriteConsoleOutputCharacterW(hConOut,&cp437[ch],1,cursor,&ccount); else WriteConsoleOutputCharacterA(hConOut,&ch,1,cursor,&ccount); diff --git a/win/tty/getline.c b/win/tty/getline.c index 2dd90ae3f..4a2d8c251 100644 --- a/win/tty/getline.c +++ b/win/tty/getline.c @@ -24,25 +24,6 @@ extern int NDECL(extcmd_via_menu); /* cmd.c */ extern char erase_char, kill_char; /* from appropriate tty.c file */ -/* cloned from topl.c, but not identical - */ -#ifdef UNICODE_WIDEWINPORT - /* nhwchar is wchar; data from core needs narrow-to-wide conversion; - data going back to core needs wide-to-narrow conversion; data - used within tty routines typically needs wide-to-wide awareness */ -STATIC_VAR nhwchar getl_wbuf[BUFSZ]; -STATIC_VAR char getl_nbuf[BUFSZ]; -#define T(x) L##x -#define Waddtopl(str) addtopl(nhwstrcpy(getl_wbuf,str)) -#define Wputsyms(str) putsyms(nhwstrcpy(getl_wbuf,str)) -#define NWstrcpy(wdst,src) nhwstrcpy(wdst,src) /* narrow-to-wide */ -#else /*!UNICODE_WIDEWINPORT*/ - /* nhwchar is char; no conversions needed */ -#define T(x) x -#define Waddtopl(str) addtopl(str) -#define Wputsyms(str) putsyms(str) -#endif /*?UNICODE_WIDEWINPORT*/ - /* * Read a line closed with '\n' into the array char bufp[BUFSZ]. * (The '\n' is not stored. The string is closed with a '\0'.) @@ -76,12 +57,7 @@ getlin_hook_proc hook; *obufp = 0; for(;;) { (void) fflush(stdout); -#ifdef UNICODE_WIDEWINPORT - Strcat(strcat(strcpy(getl_nbuf, query), " "), obufp); - (void)NWstrcpy(toplines, getl_nbuf); -#else Strcat(strcat(strcpy(toplines, query), " "), obufp); -#endif c = pgetchar(); if (c == '\033' || c == EOF) { obufp[0] = '\033'; @@ -100,10 +76,10 @@ getlin_hook_proc hook; ttyDisplay->inread = sav; tty_clear_nhwindow(WIN_MESSAGE); cw->maxcol = cw->maxrow; - Waddtopl(query); - Waddtopl(T(" ")); + addtopl(query); + addtopl(" "); *bufp = 0; - Waddtopl(obufp); + addtopl(obufp); } else { if (!doprev) (void) tty_doprev_message();/* need two initially */ @@ -115,10 +91,10 @@ getlin_hook_proc hook; tty_clear_nhwindow(WIN_MESSAGE); cw->maxcol = cw->maxrow; doprev = 0; - Waddtopl(query); - Waddtopl(T(" ")); + addtopl(query); + addtopl(" "); *bufp = 0; - Waddtopl(obufp); + addtopl(obufp); } if(c == erase_char || c == '\b') { if(bufp != obufp) { @@ -128,11 +104,11 @@ getlin_hook_proc hook; #endif /* NEWAUTOCOMP */ bufp--; #ifndef NEWAUTOCOMP - putsyms(T("\b \b"));/* putsym converts \b */ + putsyms("\b \b");/* putsym converts \b */ #else /* NEWAUTOCOMP */ - putsyms(T("\b")); - for (i = bufp; *i; ++i) putsyms(T(" ")); - for (; i > bufp; --i) putsyms(T("\b")); + putsyms("\b"); + for (i = bufp; *i; ++i) putsyms(" "); + for (; i > bufp; --i) putsyms("\b"); *bufp = 0; #endif /* NEWAUTOCOMP */ } else tty_nhbell(); @@ -155,21 +131,21 @@ getlin_hook_proc hook; #endif /* NEWAUTOCOMP */ *bufp = c; bufp[1] = 0; - Wputsyms(bufp); + putsyms(bufp); bufp++; if (hook && (*hook)(obufp)) { - Wputsyms(bufp); + putsyms(bufp); #ifndef NEWAUTOCOMP bufp = eos(bufp); #else /* NEWAUTOCOMP */ /* pointer and cursor left where they were */ - for (i = bufp; *i; ++i) putsyms(T("\b")); + for (i = bufp; *i; ++i) putsyms("\b"); } else if (i > bufp) { char *s = i; /* erase rest of prior guess */ - for (; i > bufp; --i) putsyms(T(" ")); - for (; s > bufp; --s) putsyms(T("\b")); + for (; i > bufp; --i) putsyms(" "); + for (; s > bufp; --s) putsyms("\b"); #endif /* NEWAUTOCOMP */ } } else if(c == kill_char || c == '\177') { /* Robert Viduya */ @@ -177,11 +153,11 @@ getlin_hook_proc hook; #ifndef NEWAUTOCOMP while(bufp != obufp) { bufp--; - putsyms(T("\b \b")); + putsyms("\b \b"); } #else /* NEWAUTOCOMP */ - for (; *bufp; ++bufp) putsyms(T(" ")); - for (; bufp != obufp; --bufp) putsyms(T("\b \b")); + for (; *bufp; ++bufp) putsyms(" "); + for (; bufp != obufp; --bufp) putsyms("\b \b"); *bufp = 0; #endif /* NEWAUTOCOMP */ } else @@ -192,8 +168,6 @@ getlin_hook_proc hook; clear_nhwindow(WIN_MESSAGE); /* clean up after ourselves */ } -#undef T - void xwaitforspace(s) register const char *s; /* chars allowed besides return */ diff --git a/win/tty/topl.c b/win/tty/topl.c index 3efb52696..db307b73a 100644 --- a/win/tty/topl.c +++ b/win/tty/topl.c @@ -1,5 +1,4 @@ -/* NetHack 3.5 topl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ -/* NetHack 3.5 topl.c $Date: 2012/01/23 06:29:37 $ $Revision: 1.24 $ */ +/* NetHack 3.5 topl.c $NHDT-Date: 1425081315 2015/02/27 23:55:15 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.24 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -15,44 +14,8 @@ #define C(c) (0x1f & (c)) #endif -/* use caution with this stuff; it's very easy to get things mixed up... - */ -#ifdef UNICODE_WIDEWINPORT - /* nhwchar is wchar; data from core needs narrow-to-wide conversion; - data going back to core needs wide-to-narrow conversion; data - used within tty routines typically needs wide-to-wide awareness */ -STATIC_VAR nhwchar topl_wbuf[BUFSZ]; -STATIC_VAR char topl_nbuf[BUFSZ]; -#define T(x) L##x -#define DoGputch(x) ((x) >= 0x80) -#define Waddtopl(str) addtopl(nhwstrcpy(topl_wbuf,str)) -#define Wputstr(win,atr,wstr) putstr(win,atr,strnhwcpy(topl_nbuf,wstr)) -#define Windex(wstr,wchr) nhwindex(wstr,wchr) -#define Wstrlen(wstr) (int)nhwlen(wstr) -#define NWstrcpy(wdst,src) nhwstrcpy(wdst,src) /* narrow-to-wide */ -#define WNstrcpy(dst,wsrc) strnhwcpy(dst,wsrc) /* wide-to-narrow */ -#define WWstrcpy(wdst,wsrc) nhwcpy(wdst,wsrc) /* wide-to-wide */ -#define WWstrcat(wdst,wsrc) nhwcat(wdst,wsrc) -#define WWstrncpy(wdst,wsrc,ln nhwncpy(wdst,wsrc,ln) -#define WWstrncmp(wst1,wst2,ln) nhwncmp(wst1,wst2,ln) -#else /*!UNICODE_WIDEWINPORT*/ - /* nhwchar is char; no conversions needed */ -#define T(x) x -#define DoGputch(x) ((x) & 0x80) -#define Waddtopl(str) addtopl(str) -#define Wputstr(win,atr,str) putstr(win,atr,str) -#define Windex(wstr,wchr) index(wstr,wchr) -#define Wstrlen(wstr) (int)strlen(wstr) -#define NWstrcpy(wdst,src) strcpy(wdst,src) -#define WNstrcpy(dst,wsrc) strcpy(dst,wsrc) -#define WWstrcpy(wdst,wsrc) strcpy(wdst,wsrc) -#define WWstrcat(wdst,wsrc) strcat(wdst,wsrc) -#define WWstrncpy(wdst,wsrc,ln) strncpy(wdst,wsrc,ln) -#define WWstrncmp(wst1,wst2,ln) strncmp(wst1,wst2,ln) -#endif /*?UNICODE_WIDEWINPORT*/ - -STATIC_DCL void FDECL(redotoplin, (const nhwchar*)); -STATIC_DCL void FDECL(topl_putsym, (NHWCHAR_P)); +STATIC_DCL void FDECL(redotoplin, (const char*)); +STATIC_DCL void FDECL(topl_putsym, (CHAR_P)); STATIC_DCL void NDECL(remember_topl); STATIC_DCL void FDECL(removetopl, (int)); STATIC_DCL void FDECL(msghistory_snapshot, (BOOLEAN_P)); @@ -62,9 +25,9 @@ int tty_doprev_message() { register struct WinDesc *cw = wins[WIN_MESSAGE]; + winid prevmsg_win; int i; - if ((iflags.prevmsg_window != 's') && !ttyDisplay->inread) { /* not single */ if(iflags.prevmsg_window == 'f') { /* full */ prevmsg_win = create_nhwindow(NHW_MENU); @@ -73,11 +36,11 @@ tty_doprev_message() cw->maxcol = cw->maxrow; i = cw->maxcol; do { - if (cw->data[i] && *cw->data[i]) - Wputstr(prevmsg_win, 0, cw->data[i]); + if(cw->data[i] && strcmp(cw->data[i], "") ) + putstr(prevmsg_win, 0, cw->data[i]); i = (i + 1) % cw->rows; } while (i != cw->maxcol); - Wputstr(prevmsg_win, 0, toplines); + putstr(prevmsg_win, 0, toplines); display_nhwindow(prevmsg_win, TRUE); destroy_nhwindow(prevmsg_win); } else if (iflags.prevmsg_window == 'c') { /* combination */ @@ -104,12 +67,11 @@ tty_doprev_message() cw->maxcol = cw->maxrow; i = cw->maxcol; do { - if (cw->data[i] && *cw->data[i]) - Wputstr(prevmsg_win, 0, cw->data[i]); + if(cw->data[i] && strcmp(cw->data[i], "") ) + putstr(prevmsg_win, 0, cw->data[i]); i = (i + 1) % cw->rows; } while (i != cw->maxcol); - - Wputstr(prevmsg_win, 0, toplines); + putstr(prevmsg_win, 0, toplines); display_nhwindow(prevmsg_win, TRUE); destroy_nhwindow(prevmsg_win); } @@ -121,11 +83,11 @@ tty_doprev_message() prevmsg_win = create_nhwindow(NHW_MENU); putstr(prevmsg_win, 0, "Message History"); putstr(prevmsg_win, 0, ""); - Wputstr(prevmsg_win, 0, toplines); + putstr(prevmsg_win, 0, toplines); cw->maxcol=cw->maxrow-1; if(cw->maxcol < 0) cw->maxcol = cw->rows-1; do { - Wputstr(prevmsg_win, 0, cw->data[cw->maxcol]); + putstr(prevmsg_win, 0, cw->data[cw->maxcol]); cw->maxcol--; if (cw->maxcol < 0) cw->maxcol = cw->rows-1; if (!cw->data[cw->maxcol]) @@ -156,19 +118,19 @@ tty_doprev_message() } STATIC_OVL void -redotoplin(symstr) - const nhwchar *symstr; +redotoplin(str) + const char *str; { int otoplin = ttyDisplay->toplin; home(); - if (DoGputch(*symstr)) { + if(*str & 0x80) { /* kludge for the / command, the only time we ever want a */ /* graphics character on the top line */ - g_putch((int)*symstr++); + g_putch((int)*str++); ttyDisplay->curx++; } end_glyphout(); /* in case message printed during graphics output */ - putsyms(symstr); + putsyms(str); cl_end(); ttyDisplay->toplin = 1; if(ttyDisplay->cury && otoplin != 3) @@ -180,25 +142,25 @@ remember_topl() { register struct WinDesc *cw = wins[WIN_MESSAGE]; int idx = cw->maxrow; - unsigned len; + unsigned len = strlen(toplines) + 1; if ((cw->flags & WIN_LOCKHISTORY) || !*toplines) return; - len = Wstrlen(toplines) + 1; + if (len > (unsigned)cw->datlen[idx]) { if (cw->data[idx]) free(cw->data[idx]); len += (8 - (len & 7)); /* pad up to next multiple of 8 */ - cw->data[idx] = (nhwchar *)alloc(sizeof(nhwchar) * len); + cw->data[idx] = (char *)alloc(len); cw->datlen[idx] = (short)len; } - (void)WWstrcpy(cw->data[idx], toplines); + Strcpy(cw->data[idx], toplines); *toplines = '\0'; cw->maxcol = cw->maxrow = (idx + 1) % cw->rows; } void addtopl(s) -const nhwchar *s; +const char *s; { register struct WinDesc *cw = wins[WIN_MESSAGE]; @@ -219,8 +181,7 @@ more() if(ttyDisplay->toplin) { tty_curs(BASE_WINDOW, cw->curx+1, cw->cury); - if(cw->curx >= CO - 8) - topl_putsym(T('\n')); + if(cw->curx >= CO - 8) topl_putsym('\n'); } if(flags.standout) @@ -249,22 +210,22 @@ more() void update_topl(bp) - register const nhwchar *bp; + register const char *bp; { - register nhwchar *tl, *otl; + register char *tl, *otl; register int n0; int notdied = 1; struct WinDesc *cw = wins[WIN_MESSAGE]; /* If there is room on the line, print message on same line */ /* But messages like "You die..." deserve their own line */ - n0 = Wstrlen(bp); + n0 = strlen(bp); if ((ttyDisplay->toplin == 1 || (cw->flags & WIN_STOP)) && cw->cury == 0 && - n0 + Wstrlen(toplines) + 3 < CO-8 && /* room for --More-- */ - (notdied = WWstrncmp(bp, T("You die"), 7))) { - (void)WWstrcat(toplines, T(" ")); - (void)WWstrcat(toplines, bp); + n0 + (int)strlen(toplines) + 3 < CO-8 && /* room for --More-- */ + (notdied = strncmp(bp, "You die", 7))) { + Strcat(toplines, " "); + Strcat(toplines, bp); cw->curx += 2; if(!(cw->flags & WIN_STOP)) addtopl(bp); @@ -277,7 +238,7 @@ update_topl(bp) } } remember_topl(); - (void)WWstrncpy(toplines, bp, TBUFSZ); + (void) strncpy(toplines, bp, TBUFSZ); toplines[TBUFSZ - 1] = 0; for(tl = toplines; n0 >= CO; ){ @@ -285,11 +246,11 @@ update_topl(bp) for(tl+=CO-1; tl != otl && !isspace(*tl); --tl) ; if(tl == otl) { /* Eek! A huge token. Try splitting after it. */ - tl = Windex(otl, T(' ')); + tl = index(otl, ' '); if (!tl) break; /* No choice but to spit it out whole. */ } - *tl++ = T('\n'); - n0 = Wstrlen(tl); + *tl++ = '\n'; + n0 = strlen(tl); } if(!notdied) cw->flags &= ~WIN_STOP; if(!(cw->flags & WIN_STOP)) redotoplin(toplines); @@ -298,21 +259,21 @@ update_topl(bp) STATIC_OVL void topl_putsym(c) - nhwchar c; + char c; { register struct WinDesc *cw = wins[WIN_MESSAGE]; if(cw == (struct WinDesc *) 0) panic("Putsym window MESSAGE nonexistant"); switch(c) { - case T('\b'): + case '\b': if(ttyDisplay->curx == 0 && ttyDisplay->cury > 0) tty_curs(BASE_WINDOW, CO, (int)ttyDisplay->cury-1); backsp(); ttyDisplay->curx--; cw->curx = ttyDisplay->curx; return; - case T('\n'): + case '\n': cl_end(); ttyDisplay->curx = 0; ttyDisplay->cury++; @@ -323,7 +284,7 @@ topl_putsym(c) break; default: if(ttyDisplay->curx == CO-1) - topl_putsym(T('\n')); /* 1 <= curx <= CO; avoid CO */ + topl_putsym('\n'); /* 1 <= curx <= CO; avoid CO */ #ifdef WIN32CON (void) putchar(c); #endif @@ -337,11 +298,11 @@ topl_putsym(c) } void -putsyms(symstr) - const nhwchar *symstr; +putsyms(str) + const char *str; { - while(*symstr) - topl_putsym(*symstr++); + while(*str) + topl_putsym(*str++); } STATIC_OVL void @@ -349,8 +310,7 @@ removetopl(n) register int n; { /* assume addtopl() has been done, so ttyDisplay->toplin is already set */ - while (n-- > 0) - putsyms(T("\b \b")); + while (n-- > 0) putsyms("\b \b"); } extern char erase_char; /* from xxxtty.c; don't need kill_char */ @@ -413,7 +373,7 @@ char def; ttyDisplay->inread = sav; tty_clear_nhwindow(WIN_MESSAGE); cw->maxcol = cw->maxrow; - Waddtopl(prompt); + addtopl(prompt); } else { if(!doprev) (void) tty_doprev_message(); /* need two initially */ @@ -429,7 +389,7 @@ char def; tty_clear_nhwindow(WIN_MESSAGE); cw->maxcol = cw->maxrow; doprev = 0; - Waddtopl(prompt); + addtopl(prompt); q = '\0'; /* force another loop iteration */ continue; } @@ -450,14 +410,13 @@ char def; tty_nhbell(); q = (char)0; } else if (q == '#' || digit_ok) { - char z; - nhwchar digit_string[2]; + char z, digit_string[2]; int n_len = 0; long value = 0; - addtopl(T("#")), n_len++; - digit_string[1] = (nhwchar)0; + addtopl("#"), n_len++; + digit_string[1] = '\0'; if (q != '#') { - digit_string[0] = (nhwchar)q; + digit_string[0] = q; addtopl(digit_string), n_len++; value = q - '0'; q = '#'; @@ -467,7 +426,7 @@ char def; if (digit(z)) { value = (10 * value) + (z - '0'); if (value < 0) break; /* overflow: try again */ - digit_string[0] = (nhwchar)z; + digit_string[0] = z; addtopl(digit_string), n_len++; } else if (z == 'y' || index(quitchars, z)) { if (z == '\033') value = -1; /* abort */ @@ -492,7 +451,7 @@ char def; if (q != '#') { Sprintf(rtmp, "%c", q); - Waddtopl(rtmp); + addtopl(rtmp); } clean_up: ttyDisplay->inread--; @@ -505,7 +464,7 @@ char def; } /* shared by tty_getmsghistory() and tty_putmsghistory() */ -static nhwchar **snapshot_mesgs = 0; +static char **snapshot_mesgs = 0; /* collect currently available message history data into a sequential array; optionally, purge that data from the active circular buffer set as we go */ @@ -513,7 +472,7 @@ STATIC_OVL void msghistory_snapshot(purge) boolean purge; /* clear message history buffer as we copy it */ { - nhwchar *mesg; + char *mesg; int i, inidx, outidx; struct WinDesc *cw; @@ -528,24 +487,24 @@ boolean purge; /* clear message history buffer as we copy it */ history updating to take place because that could clobber them */ if (!purge) cw->flags |= WIN_LOCKHISTORY; - snapshot_mesgs = (nhwchar **)alloc((cw->rows + 1) * sizeof (nhwchar *)); + snapshot_mesgs = (char **)alloc((cw->rows + 1) * sizeof (char *)); outidx = 0; inidx = cw->maxrow; for (i = 0; i < cw->rows; ++i) { - snapshot_mesgs[i] = (nhwchar *)0; + snapshot_mesgs[i] = (char *)0; mesg = cw->data[inidx]; if (mesg && *mesg) { snapshot_mesgs[outidx++] = mesg; if (purge) { /* we're taking this pointer away; subsequest history updates will eventually allocate a new one to replace it */ - cw->data[inidx] = (nhwchar *)0; + cw->data[inidx] = (char *)0; cw->datlen[inidx] = 0; } } inidx = (inidx + 1) % cw->rows; } - snapshot_mesgs[cw->rows] = (nhwchar *)0; /* sentinel */ + snapshot_mesgs[cw->rows] = (char *)0; /* sentinel */ /* for a destructive snapshot, history is now completely empty */ if (purge) cw->maxcol = cw->maxrow = 0; @@ -565,7 +524,7 @@ boolean purged; /* True: took history's pointers, False: just cloned them */ free((genericptr_t)snapshot_mesgs[i]); } - free((genericptr_t)snapshot_mesgs), snapshot_mesgs = (nhwchar **)0; + free((genericptr_t)snapshot_mesgs), snapshot_mesgs = (char **)0; /* history can resume being updated at will now... */ if (!purged) wins[WIN_MESSAGE]->flags &= ~WIN_LOCKHISTORY; @@ -587,7 +546,7 @@ tty_getmsghistory(init) boolean init; { static int nxtidx; - nhwchar *nextmesg; + char *nextmesg; char *result = 0; if (init) { @@ -598,11 +557,7 @@ boolean init; if (snapshot_mesgs) { nextmesg = snapshot_mesgs[nxtidx++]; if (nextmesg) { -#ifdef UNICODE_WIDEWINPORT - result = WNstrcpy(topl_nbuf, nextmesg); /* wide-to-narrow */ -#else result = (char *)nextmesg; -#endif } else { free_msghistory_snapshot(FALSE); } @@ -648,12 +603,12 @@ boolean restoring_msghist; if (msg) { /* move most recent message to history, make this become most recent */ remember_topl(); - (void)NWstrcpy(toplines, msg); /* narrow-to-wide */ + Strcpy(toplines, msg); } else if (snapshot_mesgs) { /* done putting arbitrary messages in; put the snapshot ones back */ for (idx = 0; snapshot_mesgs[idx]; ++idx) { remember_topl(); - (void)WWstrcpy(toplines, snapshot_mesgs[idx]); /* wide-to-wide */ + Strcpy(toplines, snapshot_mesgs[idx]); } /* now release the snapshot */ free_msghistory_snapshot(TRUE); diff --git a/win/tty/wintty.c b/win/tty/wintty.c index d4c921501..a526897b7 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -43,11 +43,6 @@ extern char mapped_menu_cmds[]; /* from options.c */ /* this is only needed until tty_status_* routines are written */ extern NEARDATA winid WIN_STATUS; -#ifdef UNICODE_WIDEWINPORT -void FDECL(tty_putmixed,(winid,int,const char *)); -void FDECL(tty_putstr_core,(winid,int,const nhwchar *)); -#endif - /* Interface definition, for windows.c */ struct window_procs tty_procs = { "tty", @@ -75,11 +70,7 @@ struct window_procs tty_procs = { tty_destroy_nhwindow, tty_curs, tty_putstr, -#ifdef UNICODE_WIDEWINPORT - tty_putmixed, -#else genl_putmixed, -#endif tty_display_file, tty_start_menu, tty_add_menu, @@ -151,12 +142,7 @@ static char obuf[BUFSIZ]; /* BUFSIZ is defined in stdio.h */ #endif static char winpanicstr[] = "Bad window id %d"; -#ifdef UNICODE_WIDEWINPORT -nhwchar defmorestr[] = L"--More--"; -#else -nhwchar defmorestr[] = "--More--"; -#endif -nhwchar emptysym[1] = {0}; +char defmorestr[] = "--More--"; #ifdef CLIPPING # if defined(USE_TILES) && defined(MSDOS) @@ -196,11 +182,8 @@ STATIC_DCL void FDECL(process_menu_window, (winid,struct WinDesc *)); STATIC_DCL void FDECL(process_text_window, (winid,struct WinDesc *)); STATIC_DCL tty_menu_item *FDECL(reverse, (tty_menu_item *)); STATIC_DCL const char * FDECL(compress_str, (const char *)); -STATIC_DCL void FDECL(tty_putsym, (winid, int, int, NHWCHAR_P)); +STATIC_DCL void FDECL(tty_putsym, (winid, int, int, CHAR_P)); STATIC_DCL char *FDECL(copy_of, (const char *)); -#ifdef UNICODE_WIDEWINPORT -STATIC_DCL nhwchar *FDECL(nhwchar_copy_of, (const nhwchar *)); -#endif STATIC_DCL void FDECL(bail, (const char *)); /* __attribute__((noreturn)) */ /* @@ -295,11 +278,7 @@ if(wc_tracelogf) for(i=WIN_INVEN; i < MAXWIN; i++) if(wins[i] && wins[i]->active) { /* cop-out */ -#ifdef UNICODE_WIDEWINPORT - addtopl(L"Press Return to continue: "); -#else addtopl("Press Return to continue: "); -#endif break; } (void) fflush(stdout); @@ -1120,24 +1099,24 @@ tty_create_nhwindow(type) if(newwin->maxrow) { newwin->data = - (nhwchar **) alloc(sizeof(nhwchar *) * (unsigned)newwin->maxrow); + (char **) alloc(sizeof(char *) * (unsigned)newwin->maxrow); newwin->datlen = (short *) alloc(sizeof(short) * (unsigned)newwin->maxrow); if(newwin->maxcol) { for (i = 0; i < newwin->maxrow; i++) { - newwin->data[i] = (nhwchar *) alloc(sizeof(nhwchar) * (unsigned)newwin->maxcol); + newwin->data[i] = (char *) alloc((unsigned)newwin->maxcol); newwin->datlen[i] = newwin->maxcol; } } else { for (i = 0; i < newwin->maxrow; i++) { - newwin->data[i] = (nhwchar *) 0; + newwin->data[i] = (char *) 0; newwin->datlen[i] = 0; } } if(newwin->type == NHW_MESSAGE) newwin->maxrow = 0; } else { - newwin->data = (nhwchar **)0; + newwin->data = (char **)0; newwin->datlen = (short *)0; } @@ -1175,12 +1154,12 @@ free_window_info(cw, free_data) for(i=0; imaxrow; i++) if(cw->data[i]) { free((genericptr_t)cw->data[i]); - cw->data[i] = (nhwchar *)0; + cw->data[i] = (char *)0; if (cw->datlen) cw->datlen[i] = 0; } if (free_data) { free((genericptr_t)cw->data); - cw->data = (nhwchar **)0; + cw->data = (char **)0; if (cw->datlen) free((genericptr_t)cw->datlen); cw->datlen = (short *)0; cw->rows = 0; @@ -1254,25 +1233,15 @@ dmore(cw, s) register struct WinDesc *cw; const char *s; /* valid responses */ { -#ifdef UNICODE_WIDEWINPORT - char buf[BUFSZ]; -#endif - const nhwchar *prompt = cw->morestr ? cw->morestr : defmorestr; - + const char *prompt = cw->morestr ? cw->morestr : defmorestr; int offset = (cw->type == NHW_TEXT) ? 1 : 2; tty_curs(BASE_WINDOW, (int)ttyDisplay->curx + offset, (int)ttyDisplay->cury); if(flags.standout) standoutbeg(); -#ifdef UNICODE_WIDEWINPORT - strnhwcpy(buf, prompt); - xputs(buf); - ttyDisplay->curx += strlen(buf); -#else xputs(prompt); ttyDisplay->curx += strlen(prompt); -#endif if(flags.standout) standoutend(); @@ -1387,13 +1356,13 @@ struct WinDesc *cw; long count; int n, curr_page, page_lines; boolean finished, counting, reset_count; - char *cp, *rp, resp[QBUFSZ], gacc[QBUFSZ]; - nhwchar *msave, *morestr; + char *cp, *rp, resp[QBUFSZ], gacc[QBUFSZ], + *msave, *morestr; curr_page = page_lines = 0; page_start = page_end = 0; msave = cw->morestr; /* save the morestr */ - cw->morestr = morestr = (nhwchar*) alloc(sizeof(nhwchar) * (unsigned) QBUFSZ); + cw->morestr = morestr = (char*) alloc((unsigned) QBUFSZ); counting = FALSE; count = 0L; reset_count = TRUE; @@ -1510,41 +1479,20 @@ struct WinDesc *cw; Strcat(resp, gacc); /* group accelerators */ Strcat(resp, mapped_menu_cmds); - if (cw->npages > 1) { -#ifdef UNICODE_WIDEWINPORT - char buf[BUFSZ]; - Sprintf(buf, "(%d of %d)", - curr_page + 1, (int) cw->npages); - (void)nhwstrcpy(cw->morestr, buf); -#else + if (cw->npages > 1) Sprintf(cw->morestr, "(%d of %d)", curr_page + 1, (int) cw->npages); -#endif - } else if (msave) { -#ifdef UNICODE_WIDEWINPORT - (void)nhwcpy(cw->morestr, msave); -#else + else if (msave) Strcpy(cw->morestr, msave); -#endif - } else { -#ifdef UNICODE_WIDEWINPORT - (void)nhwcpy(cw->morestr, defmorestr); -#else + else Strcpy(cw->morestr, defmorestr); -#endif - } + tty_curs(window, 1, page_lines); cl_end(); dmore(cw, resp); } else { /* just put the cursor back... */ - tty_curs(window, -#ifdef UNICODE_WIDEWINPORT - (int) nhwlen(cw->morestr) + 2, -#else - (int) strlen(cw->morestr) + 2, -#endif - page_lines); + tty_curs(window, (int) strlen(cw->morestr) + 2, page_lines); xwaitforspace(resp); } @@ -1708,7 +1656,7 @@ winid window; struct WinDesc *cw; { int i, n, attr; - register nhwchar *cp; + register char *cp; for (n = 0, i = 0; i < cw->maxrow; i++) { if (!cw->offx && (n + cw->offy == ttyDisplay->rows - 1)) { @@ -1746,11 +1694,7 @@ struct WinDesc *cw; *cp && (int) ttyDisplay->curx < (int) ttyDisplay->cols; cp++, ttyDisplay->curx++) #endif -#ifdef UNICODE_WIDEWINPORT - u_putch(*cp); -#else (void) putchar(*cp); -#endif term_end_attr(attr); } } @@ -1996,7 +1940,7 @@ STATIC_OVL void tty_putsym(window, x, y, ch) winid window; int x, y; - nhwchar ch; + char ch; { register struct WinDesc *cw = 0; @@ -2008,11 +1952,7 @@ tty_putsym(window, x, y, ch) case NHW_MAP: case NHW_BASE: tty_curs(window, x, y); -#ifdef UNICODE_WIDEWINPORT - u_putch(ch); -#else (void) putchar(ch); -#endif ttyDisplay->curx++; cw->curx++; break; @@ -2055,14 +1995,9 @@ tty_putstr(window, attr, str) const char *str; { register struct WinDesc *cw = 0; -#ifdef UNICODE_WIDEWINPORT - nhwchar symbuf[BUFSZ]; - register const nhwchar *symstr = symbuf; -#else - register const nhwchar *nb; - register nhwchar *ob; + register char *ob; + register const char *nb; register int i, j, n0; -#endif /* Assume there's a real problem if the window is missing -- * probably a panic message @@ -2077,52 +2012,21 @@ tty_putstr(window, attr, str) return; if(cw->type != NHW_MESSAGE) str = compress_str(str); -#if defined(USER_SOUNDS) && defined(WIN32CON) - else - play_sound_for_message(str); -#endif - -#ifdef UNICODE_WIDEWINPORT - nhwstrcpy(symbuf, str); - tty_putstr_core(window, attr, symstr); -} - -void -tty_putstr_core(window, attr, symstr) - winid window; - int attr; - const nhwchar *symstr; -{ - register struct WinDesc *cw = wins[window]; - register const nhwchar *nb; - register nhwchar *ob; - register int i, j, n0; -#endif ttyDisplay->lastwin = window; switch(cw->type) { case NHW_MESSAGE: /* really do this later */ -#ifdef UNICODE_WIDEWINPORT - update_topl(symstr); -#else - update_topl(str); +#if defined(USER_SOUNDS) && defined(WIN32CON) + play_sound_for_message(str); #endif + update_topl(str); break; case NHW_STATUS: ob = &cw->data[cw->cury][j = cw->curx]; if(context.botlx) *ob = 0; -#ifdef UNICODE_WIDEWINPORT - if(!cw->cury && (int)nhwlen(symstr) >= CO) { - /* the characters before "St:" are unnecessary */ - nb = nhwindex(symstr, L':'); - if(nb && nb > symstr+2) - symstr = nb - 2; - } - nb = symstr; -#else if(!cw->cury && (int)strlen(str) >= CO) { /* the characters before "St:" are unnecessary */ nb = index(str, ':'); @@ -2130,8 +2034,6 @@ tty_putstr_core(window, attr, symstr) str = nb - 2; } nb = str; -#endif - for(i = cw->curx+1, n0 = cw->cols; i < n0; i++, nb++) { if(!*nb) { if(*ob || context.botlx) { @@ -2146,31 +2048,19 @@ tty_putstr_core(window, attr, symstr) if(*ob) ob++; } -#ifdef UNICODE_WIDEWINPORT - (void) nhwncpy(&cw->data[cw->cury][j], symstr, cw->cols - j - 1); -#else (void) strncpy(&cw->data[cw->cury][j], str, cw->cols - j - 1); -#endif - cw->data[cw->cury][cw->cols-1] = (nhwchar)0; /* null terminate */ + cw->data[cw->cury][cw->cols-1] = '\0'; /* null terminate */ cw->cury = (cw->cury+1) % 2; cw->curx = 0; break; case NHW_MAP: tty_curs(window, cw->curx+1, cw->cury); term_start_attr(attr); -#ifdef UNICODE_WIDEWINPORT - while(*symstr && (int) ttyDisplay->curx < (int) ttyDisplay->cols-1) { - u_putch(*symstr); - symstr++; - ttyDisplay->curx++; - } -#else while(*str && (int) ttyDisplay->curx < (int) ttyDisplay->cols-1) { (void) putchar(*str); str++; ttyDisplay->curx++; } -#endif cw->curx = 0; cw->cury++; term_end_attr(attr); @@ -2178,23 +2068,14 @@ tty_putstr_core(window, attr, symstr) case NHW_BASE: tty_curs(window, cw->curx+1, cw->cury); term_start_attr(attr); -#ifdef UNICODE_WIDEWINPORT - while (*symstr) { -#else while (*str) { -#endif if ((int) ttyDisplay->curx >= (int) ttyDisplay->cols-1) { cw->curx = 0; cw->cury++; tty_curs(window, cw->curx+1, cw->cury); } -#ifdef UNICODE_WIDEWINPORT - u_putch(*symstr); - symstr++; -#else (void) putchar(*str); str++; -#endif ttyDisplay->curx++; } cw->curx = 0; @@ -2221,10 +2102,10 @@ tty_putstr_core(window, attr, symstr) } /* always grows one at a time, but alloc 12 at a time */ if(cw->cury >= cw->rows) { - nhwchar **tmp; + char **tmp; cw->rows += 12; - tmp = (nhwchar **) alloc(sizeof(nhwchar *) * (unsigned)cw->rows); + tmp = (char **) alloc(sizeof(char *) * (unsigned)cw->rows); for(i=0; imaxrow; i++) tmp[i] = cw->data[i]; if(cw->data) @@ -2236,19 +2117,10 @@ tty_putstr_core(window, attr, symstr) } if(cw->data[cw->cury]) free((genericptr_t)cw->data[cw->cury]); -#ifdef UNICODE_WIDEWINPORT - n0 = nhwlen(symstr) + 1; -#else n0 = strlen(str) + 1; -#endif - - ob = cw->data[cw->cury] = (nhwchar *)alloc(sizeof(nhwchar) * ((unsigned)n0 + 1)); - *ob++ = (nhwchar)(attr + 1); /* avoid nuls, for convenience */ -#ifdef UNICODE_WIDEWINPORT - (void)nhwcpy(ob, symstr); -#else + ob = cw->data[cw->cury] = (char *)alloc((unsigned)n0 + 1); + *ob++ = (char)(attr + 1); /* avoid nuls, for convenience */ Strcpy(ob, str); -#endif if(n0 > cw->maxcol) cw->maxcol = n0; @@ -2256,19 +2128,11 @@ tty_putstr_core(window, attr, symstr) cw->maxrow = cw->cury; if(n0 > CO) { /* attempt to break the line */ -#ifdef UNICODE_WIDEWINPORT - for(i = CO-1; i && symstr[i] != L' ' && symstr[i] != L'\n';) -#else for(i = CO-1; i && str[i] != ' ' && str[i] != '\n';) -#endif i--; if(i) { - cw->data[cw->cury-1][++i] = (nhwchar)0; -#ifdef UNICODE_WIDEWINPORT - tty_putstr_core(window, attr, &symstr[i]); -#else + cw->data[cw->cury-1][++i] = '\0'; tty_putstr(window, attr, &str[i]); -#endif } } @@ -2276,60 +2140,6 @@ tty_putstr_core(window, attr, symstr) } } -#ifdef UNICODE_WIDEWINPORT -/* - * This differs from putstr() because the str parameter can - * contain a sequence of characters representing: - * \GXXXXNNNN a glyph value, encoded by encglyph(). - * - */ -void -tty_putmixed(window, attr, str) - winid window; - int attr; - const char *str; -{ - nhwchar wbuf[BUFSZ]; - const char *cp = str; - nhwchar *put = wbuf; - while (*cp) { - if (*cp == '\\') { - int rndchk = 0, so = 0, gv = 0, ch, oc, dcount; - unsigned os; - const char *dp, *hex = "00112233445566778899aAbBcCdDeEfF"; - const char *save_cp = cp; - - cp++; - switch(*cp) { - case 'G': /* glyph value \GXXXXNNNN*/ - dcount = 0; - for (++cp; *cp && (dp = index(hex, *cp)) && (dcount++ < 4); cp++) - rndchk = (int)((rndchk * 16) + ((int)(dp - hex) / 2)); - - if (rndchk == context.rndencode) { - dcount = 0; - for (; *cp && (dp = index(hex, *cp)) && (dcount++ < 4); cp++) - gv = (int)((gv * 16) + ((int)(dp - hex) / 2)); - so = mapglyph(gv, &ch, &oc, &os, 0, 0); - *put++ = (nhwchar)showsyms[so]; - continue; - } else { - /* possible forgery - leave it the way it is */ - cp = save_cp; - } - break; - case '\\': - break; - } - } - *put++ = (nhwchar)*cp++; - } - *put = (nhwchar)0; - /* now send it to tty_putstr_core() */ - tty_putstr_core(window, attr, wbuf); -} -#endif /*UNICODE_WIDEWINPORT*/ - void tty_display_file(fname, complain) const char *fname; @@ -2515,7 +2325,7 @@ tty_end_menu(window, prompt) /* Reverse the list so that items are in correct order. */ cw->mlist = reverse(cw->mlist); - /* Put the prompt at the beginning of the menu. */ + /* Put the promt at the beginning of the menu. */ if (prompt) { anything any; @@ -2567,19 +2377,10 @@ tty_end_menu(window, prompt) /* produce the largest demo string */ Sprintf(buf, "(%d of %d) ", cw->npages, cw->npages); len = strlen(buf); -#ifdef UNICODE_WIDEWINPORT - cw->morestr = nhwchar_copy_of(emptysym); -#else cw->morestr = copy_of(""); -#endif } else { -#ifdef UNICODE_WIDEWINPORT - cw->morestr = nhwchar_copy_of(L"(end) "); - len = nhwlen(cw->morestr); -#else cw->morestr = copy_of("(end) "); len = strlen(cw->morestr); -#endif } if (len > (int)ttyDisplay->cols) { @@ -2699,11 +2500,7 @@ tty_wait_synch() } else { tty_display_nhwindow(WIN_MAP, FALSE); if(ttyDisplay->inmore) { -#ifdef UNICODE_WIDEWINPORT - addtopl(L"--More--"); -#else addtopl("--More--"); -#endif (void) fflush(stdout); } else if(ttyDisplay->inread > program_state.gameover) { /* this can only happen if we were reading and got interrupted */ @@ -2775,58 +2572,6 @@ end_glyphout() #endif } -#ifdef UNICODE_WIDEWINPORT -/* - * Parts of u_putch() were contributed by Adam Wozniak, 2005. - */ -void -u_putch(sym) -nhwchar sym; -{ - unsigned long unicode = sym; - if (!iflags.unicodedisp) - putchar((char)sym); - else { -#if defined(UNIX) || defined(VMS) - /* send utf8 to display */ - if (unicode < 0x80) { - (void) putchar(unicode); - } else if (unicode < 0x00000800) { - (void) putchar(0xC0 | (unicode >> 6)); - (void) putchar(0x80 | (unicode & 0x3F)); - } else if (unicode < 0x00010000) { - (void) putchar(0xE0 | (unicode >> 12)); - (void) putchar(0x80 | ((unicode >> 6) & 0x3F)); - (void) putchar(0x80 | (unicode & 0x3F)); - } else if (unicode < 0x00200000) { - (void) putchar(0xF0 | (unicode >> 18)); - (void) putchar(0x80 | ((unicode >> 12) & 0x3F)); - (void) putchar(0x80 | ((unicode >> 6) & 0x3F)); - (void) putchar(0x80 | (unicode & 0x3F)); - } else if (unicode < 0x04000000) { - (void) putchar(0xF8 | (unicode >> 24)); - (void) putchar(0x80 | ((unicode >> 18) & 0x3F)); - (void) putchar(0x80 | ((unicode >> 12) & 0x3F)); - (void) putchar(0x80 | ((unicode >> 6) & 0x3F)); - (void) putchar(0x80 | (unicode & 0x3F)); - } else { - (void) putchar(0xFC | (unicode >> 30)); - (void) putchar(0x80 | ((unicode >> 24) & 0x3F)); - (void) putchar(0x80 | ((unicode >> 18) & 0x3F)); - (void) putchar(0x80 | ((unicode >> 12) & 0x3F)); - (void) putchar(0x80 | ((unicode >> 6) & 0x3F)); - (void) putchar(0x80 | (unicode & 0x3F)); - } -#else - /* it is assumed that whatever is being substituted for - putchar() can handle unicode characters directly at - this point (nttty's xputc() for example) */ - (void) putchar(sym); -#endif - } -} -#endif /*UNICODE_WIDEWINPORT*/ - #ifndef WIN32 void g_putch(in_ch) @@ -2835,11 +2580,6 @@ int in_ch; register char ch = (char)in_ch; # if defined(ASCIIGRAPH) && !defined(NO_TERMS) -# if defined(UNICODE_WIDEWINPORT) && defined(UNICODE_DRAWING) - if (iflags.unicodedisp && symset[currentgraphics].name) { - u_putch(in_ch); - } else -# endif if (SYMHANDLING(H_IBM) || iflags.eight_bit_tty) { /* IBM-compatible displays don't need other stuff */ (void) putchar(ch); @@ -2923,9 +2663,9 @@ tty_print_glyph(window, x, y, glyph) xchar x, y; int glyph; { - int ch, idx; + int ch; boolean reverse_on = FALSE; - int color; + int color; unsigned special; #ifdef CLIPPING @@ -2935,7 +2675,7 @@ tty_print_glyph(window, x, y, glyph) } #endif /* map glyph to character and color */ - idx = mapglyph(glyph, &ch, &color, &special, x, y); + (void)mapglyph(glyph, &ch, &color, &special, x, y); /* Move the cursor. */ tty_curs(window, x,y); @@ -2968,11 +2708,6 @@ tty_print_glyph(window, x, y, glyph) if (iflags.grmode && iflags.tile_view) xputg(glyph,ch,special); else -#endif -#if defined(UNICODE_WIDEWINPORT) && defined(UNICODE_DRAWING) - if (iflags.unicodedisp && symset[currentgraphics].name) - g_putch(showsyms[idx]); /* use the unicode symset */ - else #endif g_putch(ch); /* print the character */ @@ -3127,15 +2862,6 @@ copy_of(s) return strcpy((char *) alloc((unsigned) (strlen(s) + 1)), s); } -# ifdef UNICODE_WIDEWINPORT -STATIC_OVL nhwchar * -nhwchar_copy_of(s) - const nhwchar *s; -{ - if (!s) s = emptysym; - return nhwcpy((nhwchar *) alloc(sizeof(nhwchar) * (unsigned) (nhwlen(s) + 1)), s); -} -# endif /*UNICODE_WIDEWINPORT*/ #endif /* TTY_GRAPHICS */ /*wintty.c*/ From 17ea9ff9ab8fdd5a7488d3a1171be9eefde0031a Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Mon, 16 Feb 2015 02:09:57 -0500 Subject: [PATCH 024/354] Fix some warnings on the unconditionals branch. --- src/eat.c | 2 +- src/questpgr.c | 6 ++++++ util/makedefs.c | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/eat.c b/src/eat.c index 67e4b88b9..320fa2351 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1597,7 +1597,7 @@ start_eating(otmp) /* called as you start to eat */ { const char *old_nomovemsg, *save_nomovemsg; - debugpline("start_eating: %lx (victual = %lx)", otmp, context.victual.piece); + debugpline("start_eating: %p (victual = %p)", otmp, context.victual.piece); debugpline("reqtime = %d", context.victual.reqtime); debugpline("(original reqtime = %d)", objects[otmp->otyp].oc_delay); debugpline("nmod = %d", context.victual.nmod); diff --git a/src/questpgr.c b/src/questpgr.c index e85877840..d1bd4b250 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -12,6 +12,10 @@ #define QTEXT_FILE "quest.dat" +#ifdef TTY_GRAPHICS +#include "wintty.h" +#endif + /* from sp_lev.c, for deliver_splev_message() */ extern char *lev_message; @@ -49,7 +53,9 @@ dump_qtlist() /* dump the character msg list to check appearance */ for (msg = qt_list.chrole; msg->msgnum > 0; msg++) { pline("msgnum %d: delivery %c", msg->msgnum, msg->delivery); +#ifdef TTY_GRAPHICS more(); +#endif (void) dlb_fseek(msg_file, msg->offset, SEEK_SET); deliver_by_window(msg, NHW_TEXT); } diff --git a/util/makedefs.c b/util/makedefs.c index ba3ee79f3..6914af250 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -2256,7 +2256,7 @@ put_qt_hdrs() qt_hdr.n_hdr, ofp); #ifdef DEBUG for(i = 0; i < qt_hdr.n_hdr; i++) - Fprintf(stderr, "%c @ %ld, ", qt_hdr.id[i], qt_hdr.offset[i]); + Fprintf(stderr, "%s @ %ld, ", qt_hdr.id[i], qt_hdr.offset[i]); Fprintf(stderr, "\n"); #endif @@ -2267,7 +2267,7 @@ put_qt_hdrs() for(i = 0; i < qt_hdr.n_hdr; i++) { #ifdef DEBUG - Fprintf(stderr, "%ld: %c header info.\n", ftell(ofp), + Fprintf(stderr, "%ld: %s header info.\n", ftell(ofp), qt_hdr.id[i]); #endif (void) fwrite((genericptr_t)&(msg_hdr[i].n_msg), sizeof(int), From 5ee52039ca191a20ac9c68f732de6ffa2ca3b155 Mon Sep 17 00:00:00 2001 From: "Derek S. Ray" Date: Tue, 17 Feb 2015 13:42:59 -0500 Subject: [PATCH 025/354] Remove unused size from questpgr.c --- src/questpgr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/questpgr.c b/src/questpgr.c index d1bd4b250..7f51965f7 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -46,7 +46,6 @@ static void dump_qtlist() /* dump the character msg list to check appearance */ { struct qtmsg *msg; - long size; if (!showdebug()) return; From 4dddb97301f42d7d42b160667d8f29b0370cb5d5 Mon Sep 17 00:00:00 2001 From: "Derek S. Ray" Date: Tue, 17 Feb 2015 13:58:27 -0500 Subject: [PATCH 026/354] remove and transfer INVISIBLE_OBJECTS to branch --- include/display.h | 8 ++++++-- include/extern.h | 3 --- include/obj.h | 6 +----- src/apply.c | 3 --- src/display.c | 24 ------------------------ src/do_wear.c | 6 ------ src/invent.c | 6 ------ src/mkobj.c | 3 --- src/mon.c | 8 -------- src/objnam.c | 18 ------------------ src/pickup.c | 3 --- src/potion.c | 22 ---------------------- src/steal.c | 22 +++++----------------- src/weapon.c | 5 ----- src/zap.c | 8 -------- 15 files changed, 12 insertions(+), 133 deletions(-) diff --git a/include/display.h b/include/display.h index 94ee1a15c..5be06d08a 100644 --- a/include/display.h +++ b/include/display.h @@ -16,9 +16,13 @@ #include "mondata.h" /* for mindless() */ #endif -#ifndef INVISIBLE_OBJECTS +/* + * vobj_at() + * + * Returns the head of the list of objects that the player can see + * at location (x,y). + */ #define vobj_at(x,y) (level.objects[x][y]) -#endif /* * sensemon() diff --git a/include/extern.h b/include/extern.h index c3004a0a0..39a42641c 100644 --- a/include/extern.h +++ b/include/extern.h @@ -295,9 +295,6 @@ E void FDECL(bury_obj, (struct obj *)); /* ### display.c ### */ -#ifdef INVISIBLE_OBJECTS -E struct obj * FDECL(vobj_at, (XCHAR_P,XCHAR_P)); -#endif /* INVISIBLE_OBJECTS */ E void FDECL(magic_map_background, (XCHAR_P,XCHAR_P,int)); E void FDECL(map_background, (XCHAR_P,XCHAR_P,int)); E void FDECL(map_trap, (struct trap *,int)); diff --git a/include/obj.h b/include/obj.h index 3d0e5d88d..dc522b338 100644 --- a/include/obj.h +++ b/include/obj.h @@ -94,11 +94,7 @@ struct obj { Bitfield(recharged,3); /* number of times it's been recharged */ #define on_ice recharged /* corpse on ice */ Bitfield(lamplit,1); /* a light-source -- can be lit */ -#ifdef INVISIBLE_OBJECTS - Bitfield(oinvis,1); /* invisible */ -#else - Bitfield(oreserved1,1); -#endif + Bitfield(oreserved1,1); /* was the placeholder for invisible objects, free for use */ Bitfield(greased,1); /* covered with grease */ Bitfield(nomerge,1); /* set temporarily to prevent merging */ Bitfield(was_thrown,1); /* thrown by hero since last picked up */ diff --git a/src/apply.c b/src/apply.c index d2377b51e..2ac4088dd 100644 --- a/src/apply.c +++ b/src/apply.c @@ -715,9 +715,6 @@ struct obj *obj; if(!getdir((char *)0)) return 0; invis_mirror = Invis; -#ifdef INVISIBLE_OBJECTS - if (obj->oinvis) invis_mirror = TRUE; -#endif useeit = !Blind && (!invis_mirror || See_invisible); uvisage = (ACURR(A_CHA) > 14) ? (poly_gender() == 1 ? "beautiful" : "handsome") : "ugly"; diff --git a/src/display.c b/src/display.c index 48b9f0b65..23dcef3a0 100644 --- a/src/display.c +++ b/src/display.c @@ -139,30 +139,6 @@ STATIC_DCL int FDECL(wall_angle, (struct rm *)); #define remember_topology(x,y) (lastseentyp[x][y] = levl[x][y].typ) -#ifdef INVISIBLE_OBJECTS -/* - * vobj_at() - * - * Returns a pointer to an object if the hero can see an object at the - * given location. This takes care of invisible objects. NOTE, this - * assumes that the hero is not blind and on top of the object pile. - * It does NOT take into account that the location is out of sight, or, - * say, one can see blessed, etc. - */ -struct obj * -vobj_at(x,y) - xchar x,y; -{ - register struct obj *obj = level.objects[x][y]; - - while (obj) { - if (!obj->oinvis || See_invisible) return obj; - obj = obj->nexthere; - } - return ((struct obj *) 0); -} -#endif /* else vobj_at() is defined in display.h */ - /* * magic_map_background() * diff --git a/src/do_wear.c b/src/do_wear.c index 6b622d7af..414f5a522 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -854,9 +854,6 @@ register struct obj *obj; /* can now see invisible monsters */ set_mimic_blocking(); /* do special mimic handling */ see_monsters(); -#ifdef INVISIBLE_OBJECTS - see_objects(); -#endif if (Invis && !oldprop && !HSee_invisible && !Blind) { newsym(u.ux,u.uy); @@ -966,9 +963,6 @@ boolean gone; if (!See_invisible) { set_mimic_blocking(); /* do special mimic handling */ see_monsters(); -#ifdef INVISIBLE_OBJECTS - see_objects(); -#endif } if (Invisible && !Blind) { diff --git a/src/invent.c b/src/invent.c index e3cd20247..62295915c 100644 --- a/src/invent.c +++ b/src/invent.c @@ -2315,9 +2315,6 @@ boolean picked_some; /* only one object */ if (dfeature) pline1(fbuf); read_engr_at(u.ux, u.uy); /* Eric Backus */ -#ifdef INVISIBLE_OBJECTS - if (otmp->oinvis && !See_invisible) verb = "feel"; -#endif You("%s here %s.", verb, doname(otmp)); iflags.last_msg = PLNMSG_ONE_ITEM_HERE; if (otmp->otyp == CORPSE) feel_cockatrice(otmp, FALSE); @@ -2421,9 +2418,6 @@ mergable(otmp, obj) /* returns TRUE if obj & otmp can be merged */ obj->obroken != otmp->obroken || obj->otrapped != otmp->otrapped || obj->lamplit != otmp->lamplit || -#ifdef INVISIBLE_OBJECTS - obj->oinvis != otmp->oinvis || -#endif obj->greased != otmp->greased || obj->oeroded != otmp->oeroded || obj->oeroded2 != otmp->oeroded2 || diff --git a/src/mkobj.c b/src/mkobj.c index 08bb41bfb..5c7cffb7c 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -606,9 +606,6 @@ boolean artif; otmp->known = 1; otmp->lknown = 0; otmp->cknown = 0; -#ifdef INVISIBLE_OBJECTS - otmp->oinvis = !rn2(1250); -#endif otmp->corpsenm = NON_PM; if (init) switch (let) { diff --git a/src/mon.c b/src/mon.c index 4823ae1c7..f617dad4c 100644 --- a/src/mon.c +++ b/src/mon.c @@ -303,11 +303,6 @@ unsigned corpseflags; */ if (Blind && !sensemon(mtmp)) obj->dknown = 0; -#ifdef INVISIBLE_OBJECTS - /* Invisible monster ==> invisible corpse */ - obj->oinvis = mtmp->minvis; -#endif - stackobj(obj); newsym(x, y); return obj; @@ -858,9 +853,6 @@ mpickstuff(mtmp, str) if (!touch_artifact(otmp,mtmp)) continue; if (!can_carry(mtmp,otmp)) continue; if (is_pool(mtmp->mx,mtmp->my)) continue; -#ifdef INVISIBLE_OBJECTS - if (otmp->oinvis && !perceives(mtmp->data)) continue; -#endif if (cansee(mtmp->mx,mtmp->my) && flags.verbose) pline("%s picks up %s.", Monnam(mtmp), (distu(mtmp->mx, mtmp->my) <= 5) ? diff --git a/src/objnam.c b/src/objnam.c index 321d7ff29..84c3599f4 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -683,10 +683,6 @@ register struct obj *obj; } else Strcpy(prefix, "a "); -#ifdef INVISIBLE_OBJECTS - if (obj->oinvis) Strcat(prefix,"invisible "); -#endif - /* "empty" goes at the beginning, but item count goes at the end */ if (cknown && (Is_container(obj) || obj->otyp == STATUE) && !Has_contents(obj)) @@ -2241,9 +2237,6 @@ struct obj *no_wish; int cnt, spe, spesgn, typ, very, rechrg; int blessed, uncursed, iscursed, ispoisoned, isgreased; int eroded, eroded2, erodeproof; -#ifdef INVISIBLE_OBJECTS - int isinvisible; -#endif int halfeaten, mntmp, contents; int islit, unlabeled, ishistoric, isdiluted, trapped; int tmp, tinv, tvariety; @@ -2271,9 +2264,6 @@ struct obj *no_wish; cnt = spe = spesgn = typ = very = rechrg = blessed = uncursed = iscursed = -#ifdef INVISIBLE_OBJECTS - isinvisible = -#endif ispoisoned = isgreased = eroded = eroded2 = erodeproof = halfeaten = islit = unlabeled = ishistoric = isdiluted = trapped = 0; @@ -2324,10 +2314,6 @@ struct obj *no_wish; iscursed = 1; } else if (!strncmpi(bp, "uncursed ", l=9)) { uncursed = 1; -#ifdef INVISIBLE_OBJECTS - } else if (!strncmpi(bp, "invisible ", l=10)) { - isinvisible = 1; -#endif } else if (!strncmpi(bp, "rustproof ", l=10) || !strncmpi(bp, "erodeproof ", l=11) || !strncmpi(bp, "corrodeproof ", l=13) || @@ -3137,10 +3123,6 @@ typfnd: curse(otmp); } -#ifdef INVISIBLE_OBJECTS - if (isinvisible) otmp->oinvis = 1; -#endif - /* set eroded */ if (is_damageable(otmp) || otmp->otyp == CRYSKNIFE) { if (eroded && (is_flammable(otmp) || is_rustprone(otmp))) diff --git a/src/pickup.c b/src/pickup.c index 2c1564f84..fea45dce3 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1266,9 +1266,6 @@ boolean telekinesis; /* not picking it up directly by hand */ /* In case of auto-pickup, where we haven't had a chance to look at it yet; affects docall(SCR_SCARE_MONSTER). */ if (!Blind) -#ifdef INVISIBLE_OBJECTS - if (!obj->oinvis || See_invisible) -#endif obj->dknown = 1; if (obj == uchain) { /* do not pick up attached chain */ diff --git a/src/potion.c b/src/potion.c index 7a4014635..7542ea451 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1909,28 +1909,6 @@ dodip() return 1; } -#ifdef INVISIBLE_OBJECTS - if (potion->otyp == POT_INVISIBILITY && !obj->oinvis) { - obj->oinvis = TRUE; - if (!Blind) { - if (!See_invisible) pline("Where did %s go?", - the(xname(obj))); - else You("notice a little haziness around %s.", - the(xname(obj))); - } - goto poof; - } else if (potion->otyp == POT_SEE_INVISIBLE && obj->oinvis) { - obj->oinvis = FALSE; - if (!Blind) { - if (!See_invisible) pline("So that's where %s went!", - the(xname(obj))); - else pline_The("haziness around %s disappears.", - the(xname(obj))); - } - goto poof; - } -#endif - if(is_poisonable(obj)) { if(potion->otyp == POT_SICKNESS && !obj->opoisoned) { char buf[BUFSZ]; diff --git a/src/steal.c b/src/steal.c index bf7238b01..c73878310 100644 --- a/src/steal.c +++ b/src/steal.c @@ -242,26 +242,14 @@ nothing_to_steal: retry: tmp = 0; for(otmp = invent; otmp; otmp = otmp->nobj) - if ((!uarm || otmp != uarmc) && otmp != uskin - && otmp->oclass != COIN_CLASS -#ifdef INVISIBLE_OBJECTS - && (!otmp->oinvis || perceives(mtmp->data)) -#endif - ) - tmp += ((otmp->owornmask & - (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1); + if ((!uarm || otmp != uarmc) && otmp != uskin && otmp->oclass != COIN_CLASS) + tmp += ((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1); if (!tmp) goto nothing_to_steal; tmp = rn2(tmp); for(otmp = invent; otmp; otmp = otmp->nobj) - if ((!uarm || otmp != uarmc) && otmp != uskin - && otmp->oclass != COIN_CLASS -#ifdef INVISIBLE_OBJECTS - && (!otmp->oinvis || perceives(mtmp->data)) -#endif - ) - if((tmp -= ((otmp->owornmask & - (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1)) < 0) - break; + if ((!uarm || otmp != uarmc) && otmp != uskin && otmp->oclass != COIN_CLASS) + if((tmp -= ((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1)) < 0) + break; if(!otmp) { impossible("Steal fails!"); return(0); diff --git a/src/weapon.c b/src/weapon.c index 746d1b5cd..5f611ddcf 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -183,11 +183,6 @@ struct monst *mon; if (is_pick(otmp) && (passes_walls(ptr) && thick_skinned(ptr))) tmp += 2; -#ifdef INVISIBLE_OBJECTS - /* Invisible weapons against monsters who can't see invisible */ - if (otmp->oinvis && !perceives(ptr)) tmp += 3; -#endif - /* Check specially named weapon "to hit" bonuses */ if (otmp->oartifact) tmp += spec_abon(otmp, mon); diff --git a/src/zap.c b/src/zap.c index cbc533041..dfdf95d4c 100644 --- a/src/zap.c +++ b/src/zap.c @@ -979,10 +979,6 @@ register struct obj *obj; } unbless(obj); uncurse(obj); -#ifdef INVISIBLE_OBJECTS - /*[this will be insufficient if it ever reduces obj's shop value]*/ - if (obj->oinvis) obj->oinvis = 0; -#endif return; } @@ -1833,10 +1829,6 @@ struct obj *obj, *otmp; (void) rloco(obj); break; case WAN_MAKE_INVISIBLE: -#ifdef INVISIBLE_OBJECTS - obj->oinvis = TRUE; - newsym(obj->ox,obj->oy); /* make object disappear */ -#endif break; case WAN_UNDEAD_TURNING: case SPE_TURN_UNDEAD: From b7537e0fbff5e4e89269cd017cd41e49ae80ddaa Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 25 Feb 2015 22:29:17 +0200 Subject: [PATCH 027/354] Add new parameters to makedefs: --debug and --make "makedefs --debug --make q" is equivalent to "makedefs -q" with DEBUG defined. --- doc/makedefs.6 | 8 ++++++++ util/makedefs.c | 38 +++++++++++++++++++------------------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/doc/makedefs.6 b/doc/makedefs.6 index 9a81780ec..7b850108c 100644 --- a/doc/makedefs.6 +++ b/doc/makedefs.6 @@ -118,6 +118,14 @@ and .IR vis_tab.h . .SH LONG COMMANDS .TP +.BI --debug +Show debugging output. +.br +.TP +.B --make \fR[\fIcommand\fR] +Execute a short command. Command is given without preceding dash. +.br +.TP .BI --input " file" Specify the input .I file diff --git a/util/makedefs.c b/util/makedefs.c index 6914af250..ad37677bc 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -6,7 +6,6 @@ /* NetHack may be freely redistributed. See license for details. */ #define MAKEDEFS_C /* use to conditionally include file sections */ -/* #define DEBUG */ /* uncomment for debugging info */ #include "config.h" #include "permonst.h" @@ -385,6 +384,7 @@ getfp(template, tag, mode) return rv; } +static boolean debug = FALSE; static FILE *inputfp; static FILE *outputfp; @@ -431,6 +431,15 @@ do_ext_makedefs(int argc, char **argv){ Fprintf(stdout, "%s", version_string(buf, delim)); exit(EXIT_SUCCESS); } + IS_OPTION("debug"){ + debug = TRUE; + CONTINUE; + } + IS_OPTION("make"){ + CONSUME; + do_makedefs(argv[0]); + exit(EXIT_SUCCESS); + } IS_OPTION("input"){ CONSUME; if(!strcmp(argv[0], "-")){ @@ -2246,36 +2255,30 @@ put_qt_hdrs() /* * The main header record. */ -#ifdef DEBUG - Fprintf(stderr, "%ld: header info.\n", ftell(ofp)); -#endif + if (debug) Fprintf(stderr, "%ld: header info.\n", ftell(ofp)); (void) fwrite((genericptr_t)&(qt_hdr.n_hdr), sizeof(int), 1, ofp); (void) fwrite((genericptr_t)&(qt_hdr.id[0][0]), sizeof(char)*LEN_HDR, qt_hdr.n_hdr, ofp); (void) fwrite((genericptr_t)&(qt_hdr.offset[0]), sizeof(long), qt_hdr.n_hdr, ofp); -#ifdef DEBUG - for(i = 0; i < qt_hdr.n_hdr; i++) + if (debug) { + for(i = 0; i < qt_hdr.n_hdr; i++) Fprintf(stderr, "%s @ %ld, ", qt_hdr.id[i], qt_hdr.offset[i]); - - Fprintf(stderr, "\n"); -#endif + Fprintf(stderr, "\n"); + } /* * The individual class headers. */ for(i = 0; i < qt_hdr.n_hdr; i++) { -#ifdef DEBUG - Fprintf(stderr, "%ld: %s header info.\n", ftell(ofp), - qt_hdr.id[i]); -#endif + if (debug) Fprintf(stderr, "%ld: %s header info.\n", ftell(ofp), + qt_hdr.id[i]); (void) fwrite((genericptr_t)&(msg_hdr[i].n_msg), sizeof(int), 1, ofp); (void) fwrite((genericptr_t)&(msg_hdr[i].qt_msg[0]), sizeof(struct qtmsg), msg_hdr[i].n_msg, ofp); -#ifdef DEBUG - { int j; + if (debug) { int j; for(j = 0; j < msg_hdr[i].n_msg; j++) { Fprintf(stderr, "msg %d @ %ld (%ld)", msg_hdr[i].qt_msg[j].msgnum, @@ -2287,7 +2290,6 @@ put_qt_hdrs() Fprintf(stderr, "\n"); } } -#endif } } @@ -2340,9 +2342,7 @@ do_questtxt() /* we have summary text; replace raw %E record with it */ Strcpy(in_line, summary_p); /* (guaranteed to fit) */ } else if(qt_comment(in_line)) continue; -#ifdef DEBUG - Fprintf(stderr, "%ld: %s", ftell(stdout), in_line); -#endif + if (debug) Fprintf(stderr, "%ld: %s", ftell(stdout), in_line); (void) fputs(xcrypt(in_line), ofp); } Fclose(ifp); From 91b96e2331ae480e566cbcdc84b3e2b3a12743c0 Mon Sep 17 00:00:00 2001 From: keni Date: Sat, 28 Feb 2015 17:52:19 -0500 Subject: [PATCH 028/354] Change NHtext to double the speed of "git checkout" --- DEVEL/hooksdir/NHtext | 82 +++++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/DEVEL/hooksdir/NHtext b/DEVEL/hooksdir/NHtext index e9ee8c28c..03550e513 100755 --- a/DEVEL/hooksdir/NHtext +++ b/DEVEL/hooksdir/NHtext @@ -5,30 +5,32 @@ # clean/smudge filter for handling substitutions use strict; -my $debug = 0; # save trace to file -my $debug2 = 0; # annotate output when running from command line +#my $debug = 0; # save trace to file +#my $debug2 = 0; # annotate output when running from command line -my $sink = ($^O eq "MSWin32")? "NUL" :"/dev/null"; -my $dbgfile = ($^O eq "MSWin32") ? "$ENV{TEMP}.$$" : "/tmp/trace.$$"; -open TRACE, ">>", ($debug==0)? $sink : $dbgfile; -print TRACE "START CLIENT ARGV:\n"; -print TRACE "[0] $0\n"; -my $x1; -for(my $x=0;$x $ENV{$k}\n"; -} -print TRACE "CWD: " . `pwd`; -print TRACE "END\n"; +#my $sink = ($^O eq "MSWin32")? "NUL" :"/dev/null"; +#my $dbgfile = ($^O eq "MSWin32") ? "$ENV{TEMP}.$$" : "/tmp/trace.$$"; +#open TRACE, ">>", ($debug==0)? $sink : $dbgfile; # pick up the prefix for substitutions in this repo -my $PREFIX = `git config --local --get nethack.substprefix`; -chomp($PREFIX); +#my $PREFIX = `git config --local --get nethack.substprefix`; +#chomp($PREFIX); +sub git_config { + my($section, $var) = @_; + local($_); + open(CONFIG, "<", "$ENV{GIT_DIR}/config") or die "Missing .git/config: $!"; + while(){ + m/^\[$section]/ && do { + while(){ + m/^\s+$var\s+=\s+(.*)/ && do { + return $1; + }; + } + }; + } + die "Missing config var: [$section] $var\n"; +} +my $PREFIX = &git_config('nethack','substprefix'); my $submode = 0; # ok to make non-cleaning changes to file my $mode; @@ -37,7 +39,7 @@ if($ARGV[0] eq "--clean"){ $mode = "c"; if(0 == 0+$ENV{NHMODE}){ $submode = 1; # do NOT add extra changes to the file - print TRACE "SKIPPING\n"; +# print TRACE "SKIPPING\n"; } } elsif($ARGV[0] eq "--smudge"){ $mode = "s"; @@ -51,27 +53,30 @@ if($ARGV[0] eq "--clean"){ #XXX #git check-attr -a $ARGV[1] -# process stdin to stdout +# Process stdin to stdout. +# For speed we read in the entire file then do the substitutions. -while(){ - print TRACE "IN: $_"; - # $1 - var and value (including trailing space but not $) - # $2 - var - # $4 - value or undef -# s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\N{DOLLAR SIGN}]+))?)\$/&handlevar($2,$4)/eg; - s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\x24]+))?)\$/&handlevar($2,$4)/eg; - if($debug2){ - chomp; - print "XX: |$_|\n"; - } else { - print; - } - print TRACE "OT: X${_}X\n"; +local($_) = ''; +my $len; +while(1){ + # On at least some systems we only get 64K. + my $len = sysread(STDIN, $_, 999999, length($_)); + last if($len == 0); + die "read failed: $!" unless defined($len); } +# $1 - var and value (including trailing space but not $) +# $2 - var +# $4 - value or undef +# s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\N{DOLLAR SIGN}]+))?)\$/&handlevar($2,$4)/eg; +s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\x24]+))?)\$/&handlevar($2,$4)/ego; + +die "write failed: $!" unless defined syswrite(STDOUT, $_); +exit 0; + sub handlevar { my($var, $val) = @_; - print "HIT '$var' '$val'\n" if($debug2); +# print "HIT '$var' '$val'\n" if($debug2); my $subname = "PREFIX::$var"; if(defined &$subname){ @@ -147,4 +152,3 @@ sub Revision { return $val; } -__END__ From 7754afd9fa5c28d11fa9db3fd9ad528fc8f28b43 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 1 Mar 2015 10:16:00 +0200 Subject: [PATCH 029/354] Remove last mention of DUNGEON_OVERVIEW --- src/display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/display.c b/src/display.c index 23dcef3a0..0e8b042a6 100644 --- a/src/display.c +++ b/src/display.c @@ -168,7 +168,7 @@ magic_map_background(x, y, show) lev->glyph = glyph; if (show) show_glyph(x,y, glyph); - remember_topology(x,y); /* DUNGEON_OVERVIEW */ + remember_topology(x,y); } /* @@ -325,7 +325,7 @@ unmap_object(x, y) else \ map_background(x,y,show); \ \ - remember_topology(x,y); /* DUNGEON_OVERVIEW */ \ + remember_topology(x,y); \ } void From 7cbd2fd592349f7ada742c8b708d3daffe76e4e2 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 1 Mar 2015 10:26:24 +0200 Subject: [PATCH 030/354] Remove last mention of EXP_ON_BOTL --- dat/opthelp | 3 +-- win/Qt/qt_win.cpp | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/dat/opthelp b/dat/opthelp index f6759e04d..836e33d87 100644 --- a/dat/opthelp +++ b/dat/opthelp @@ -30,6 +30,7 @@ pushweapon when wielding a new weapon, put your previously rawio allow the use of raw I/O [FALSE] rest_on_space count the space bar as a rest character [FALSE] safe_pet prevent you from (knowingly) attacking your pet(s) [TRUE] +showexp display your accumulated experience points [FALSE] showrace show yourself by your race rather than by role [FALSE] silent don't use your terminal's bell sound [TRUE] sortpack group similar kinds of objects in inventory [TRUE] @@ -61,8 +62,6 @@ news print any news from game administrator on startup [TRUE] Boolean option if MFLOPPY was set at compile time: checkspace check free disk space before writing files to disk [TRUE] -Boolean option if EXP_ON_BOTL was set at compile time: -showexp display your accumulated experience points [FALSE] Boolean option if SCORE_ON_BOTL was set at compile time: showscore display your approximate accumulated score [FALSE] diff --git a/win/Qt/qt_win.cpp b/win/Qt/qt_win.cpp index 16ff7873b..110f34756 100644 --- a/win/Qt/qt_win.cpp +++ b/win/Qt/qt_win.cpp @@ -2567,11 +2567,9 @@ void NetHackQtStatusWindow::updateStats() Sprintf(buf, "/%d", u.uenmax); power.setLabel("Pow:",u.uen,buf); ac.setLabel("AC:",(long)u.uac); -#ifdef EXP_ON_BOTL if (::flags.showexp) { exp.setLabel("Exp:",(long)u.uexp); } else -#endif { exp.setLabel(""); } From 6c4c53bfd23691503d69307a5793500d3256eead Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 1 Mar 2015 12:03:51 +0200 Subject: [PATCH 031/354] Remove mention of compile-time AUTOPICKUP_EXCEPTIONS --- doc/Guidebook.mn | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index cf8196b3a..f04f3b309 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1882,8 +1882,7 @@ the character position in the current font to be used in displaying each entry. Such a sequence can be continued to multiple lines by putting a `\e' at the end of each line to be continued. .pg -If your copy of the game included the compile time AUTOPICKUP_EXCEPTIONS -option, then any line starting with ``AUTOPICKUP_EXCEPTION='' is taken +Any line starting with ``AUTOPICKUP_EXCEPTION='' is taken as defining an exception to the .op pickup_types option. @@ -2234,8 +2233,7 @@ or match an autopickup exception. Default is on. .lp pickup_types Specify the object types to be picked up when .op autopickup -is on. Default is all types. If your copy of the game has the -compile time option AUTOPICKUP_EXCEPTIONS included, you may be able to use +is on. Default is all types. You can use .op autopickup_exception configuration file lines to further refine .op autopickup @@ -2540,9 +2538,7 @@ Cannot be set with the `O' command. .hn 2 Configuring autopickup exceptions .pg -There is a compile time option called AUTOPICKUP_EXCEPTIONS. -If your copy of the game was built with that option defined, you can -further refine the behavior of the +You can further refine the behavior of the .op autopickup option beyond what is available through the .op pickup_types From d7c9abe0f8432fb77a17ed6f451835d542d16d79 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 1 Mar 2015 14:33:03 +0200 Subject: [PATCH 032/354] Remove useless dungeon.def mangling --- util/makedefs.c | 51 +------------------------------------------------ 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/util/makedefs.c b/util/makedefs.c index ad37677bc..b8a40199f 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -169,8 +169,6 @@ static char *FDECL(bannerc_string, (char *,const char *)); static char *FDECL(xcrypt, (const char *)); static unsigned long FDECL(read_rumors_file, (const char *,int *,long *,unsigned long)); -static int FDECL(check_control, (char *)); -static char *FDECL(without_control, (char *)); static boolean FDECL(d_filter, (char *)); static boolean FDECL(h_filter, (char *)); static boolean FDECL(ranged_attk,(struct permonst*)); @@ -1788,38 +1786,6 @@ dead_data: perror(in_line); /* report the problem */ return; } - -static struct deflist { - - const char *defname; - boolean true_or_false; -} deflist[] = { - { "REINCARNATION", TRUE }, - { 0, 0 } -}; - -static int -check_control(s) - char *s; -{ - int i; - - if(s[0] != '%') return(-1); - - for(i = 0; deflist[i].defname; i++) - if(!strncmp(deflist[i].defname, s+1, strlen(deflist[i].defname))) - return(i); - - return(-1); -} - -static char * -without_control(s) - char *s; -{ - return(s + 1 + strlen(deflist[check_control(in_line)].defname)); -} - void do_dungeon() { @@ -1850,22 +1816,7 @@ do_dungeon() rcnt++; if(in_line[0] == '#') continue; /* discard comments */ -recheck: - if(in_line[0] == '%') { - int i = check_control(in_line); - if(i >= 0) { - if(!deflist[i].true_or_false) { - while (fgets(in_line, sizeof in_line, ifp) != 0) - if(check_control(in_line) != i) goto recheck; - } else - (void) fputs(without_control(in_line),ofp); - } else { - Fprintf(stderr, "Unknown control option '%s' in file %s at line %d.\n", - in_line, DGN_I_FILE, rcnt); - exit(EXIT_FAILURE); - } - } else - (void) fputs(in_line,ofp); + (void) fputs(in_line,ofp); } Fclose(ifp); Fclose(ofp); From a609bda9964ecf6ce99bb4fb093e9324c53a3286 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 1 Mar 2015 09:28:09 -0500 Subject: [PATCH 033/354] catch up fixes with some recent changes; also add 'community patch' section --- doc/fixes35.0 | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 6721eb0bb..3cc0e61dd 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -987,7 +987,6 @@ allow digging an adjacent pit with wand of digging while trapped in a pit #terrain command to show unobstructed view of map (w/o mons, objs, traps) digging can activate or disarm some types of traps some monsters can eat tins in addition to corpses to cure some ailments -add Roderick Schertler's pickup_thrown patch add ability to sort the list when viewing known spells with '+' command describe magic cancellation from worn armor in enlightment/end-of-game feedback disclose half physical and/or spell damage in enlightment/end-of-game feedback @@ -1001,7 +1000,6 @@ new config file keyword: SYMBOLS for overriding character symbol values by name opening magic frees from bear traps and webs, activates trap doors closing magic activates bear traps and webs locking converts a hole into a trap door; striking does the opposite -add Malcolm Ryan's Statue Glyphs patch lembas and cram never rot unless cursed multiple squeaks for squeaky boards include time, user ID, and play mode in paniclog entries @@ -1045,15 +1043,6 @@ chatting to a gecko or shopkeeper while hallucinating gives alternate message mimic posing as door might steal hero's key when [un]locking is attempted polymorphing into a dragon while wearing dragon scale mail will cause that mail to revert to dragon scales -adopt/adapt/improve the Paranoid_Quit patch; default is paranoid_confirm:pray - paranoid_confirm:Confirm when requiring "yes" instead of y to confirm, - also require explicit "no" to reject - paranoid_confirm:quit yes vs y to quit or to enter explore mode - paranoid_confirm:die yes vs y to die in explore or wizard mode - paranoid_confirm:bones yes vs y to save bones when dying in wizard mode - paranoid_confirm:attack yes vs y to attack a peaceful monster - paranoid_confirm:pray y to confirm #pray; supersedes prayconfirm - paranoid_confirm:Remove always pick from inventory for 'R' and 'T' flexibility for specifying "detect " vs " detection" when wishing when a sokoban puzzle has been completed (last pit or hole filled in), stop assessing luck penalties and lift most movement restrictions @@ -1088,6 +1077,22 @@ smartphone: fixed F command to prompt for direction unix,vms: altmeta option to handle terminals which send "ESC c" for Alt+c +NetHack Community Patches (or Variation) Included +------------------------------------------------- +Roderick Schertler's pickup_thrown patch +Malcolm Ryan's Statue Glyphs patch +adopt/adapt/improve the Paranoid_Quit patch; default is paranoid_confirm:pray + paranoid_confirm:Confirm when requiring "yes" instead of y to confirm, + also require explicit "no" to reject + paranoid_confirm:quit yes vs y to quit or to enter explore mode + paranoid_confirm:die yes vs y to die in explore or wizard mode + paranoid_confirm:bones yes vs y to save bones when dying in wizard mode + paranoid_confirm:attack yes vs y to attack a peaceful monster + paranoid_confirm:pray y to confirm #pray; supersedes prayconfirm + paranoid_confirm:Remove always pick from inventory for 'R' and 'T' +adopt/adapt/improve Dungeon Overview + + Code Cleanup and Reorganization ------------------------------- removed OVLx section dividers previously used for TRAMPOLINE overlay system @@ -1106,3 +1111,17 @@ drawing symbols for DECGraphics, IBMGraphics, MACgraphics are now stored in an new hints-based configuration system allow documentation to be specialized to the options in the game binary add param to winsys ini routines to allow cleaner shifting during startup +make STEED unconditional +make EXP_ON_BOTL unconditional +make REDO unconditional +make AUTOPICKUP_EXCEPTIONS unconditional +make SEDUCE compile-time unconditional but still removable through SYSCF +clean up some DEBUG conditional code +make GOLDOBJ unconditional +make WIZARD unconditional +make SINKS +make REINCARNATION +make TOURIST unconditional +make KOPS unconditional +make ELBERETH unconditional + From 774e6c2f6f36f5d059cd3f53a642bf8da57a83fc Mon Sep 17 00:00:00 2001 From: keni Date: Sun, 1 Mar 2015 20:26:29 -0500 Subject: [PATCH 034/354] Switch NHtext from "git branch" to "git symbolic-ref" to avoid corner cases. --- DEVEL/hooksdir/NHtext | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/DEVEL/hooksdir/NHtext b/DEVEL/hooksdir/NHtext index 03550e513..861b9e6b1 100755 --- a/DEVEL/hooksdir/NHtext +++ b/DEVEL/hooksdir/NHtext @@ -12,9 +12,6 @@ use strict; #my $dbgfile = ($^O eq "MSWin32") ? "$ENV{TEMP}.$$" : "/tmp/trace.$$"; #open TRACE, ">>", ($debug==0)? $sink : $dbgfile; -# pick up the prefix for substitutions in this repo -#my $PREFIX = `git config --local --get nethack.substprefix`; -#chomp($PREFIX); sub git_config { my($section, $var) = @_; local($_); @@ -30,6 +27,7 @@ sub git_config { } die "Missing config var: [$section] $var\n"; } +# pick up the prefix for substitutions in this repo my $PREFIX = &git_config('nethack','substprefix'); my $submode = 0; # ok to make non-cleaning changes to file @@ -119,16 +117,17 @@ sub Date { #sub Author { #} -# NB: the standard-ish Revision line isn't enough - you need Branch/Revision - +# NB: the standard-ish Revision line isn't enough - you need Branch:Revision - # but we split it into 2 so we can use the standard processing code on Revision # and just slip Branch in. sub Branch { my($val, $mode, $submode) = @_; if($mode eq "c"){ if($submode==0){ - $val = `git branch --no-color --contains`; + $val = `git symbolic-ref -q --short HEAD`; $val =~ s/[\n\r]*$//; $val =~ s/^\*\s*//; + $val = "(unknown)" unless($val =~ m/^[[:print:]]+$/); } } # if($mode eq "s"){ From 6fd30ab1ce94ec47a34f446b92f38587f055216c Mon Sep 17 00:00:00 2001 From: keni Date: Sun, 1 Mar 2015 20:32:28 -0500 Subject: [PATCH 035/354] Manually fix botched NHDT-Branch expansions. --- include/config.h | 2 +- include/decl.h | 2 +- include/extern.h | 2 +- include/flag.h | 2 +- include/wceconf.h | 2 +- src/botl.c | 2 +- src/files.c | 2 +- src/options.c | 2 +- src/pickup.c | 2 +- src/save.c | 2 +- sys/wince/mhstatus.c | 2 +- util/makedefs.c | 2 +- win/X11/winstat.c | 2 +- win/gnome/gnstatus.c | 2 +- win/share/tilemap.c | 2 +- win/tty/topl.c | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/config.h b/include/config.h index c13b2dd01..d8b067fc7 100644 --- a/include/config.h +++ b/include/config.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 config.h $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.51 $ */ +/* NetHack 3.5 config.h $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.51 $ */ /* NetHack 3.5 config.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.37 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/decl.h b/include/decl.h index f9d4a7b7c..4591226e4 100644 --- a/include/decl.h +++ b/include/decl.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 decl.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.50 $ */ +/* NetHack 3.5 decl.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.50 $ */ /* NetHack 3.5 decl.h $Date: 2011/12/29 20:06:27 $ $Revision: 1.44 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/extern.h b/include/extern.h index 39a42641c..cdeee5478 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 extern.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.390 $ */ +/* NetHack 3.5 extern.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.390 $ */ /* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/flag.h b/include/flag.h index de2b63e84..a34abe839 100644 --- a/include/flag.h +++ b/include/flag.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 flag.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.60 $ */ +/* NetHack 3.5 flag.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.60 $ */ /* NetHack 3.5 flag.h $Date: 2012/04/09 02:56:32 $ $Revision: 1.59 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/wceconf.h b/include/wceconf.h index 52ad4d1f1..d2d11d404 100644 --- a/include/wceconf.h +++ b/include/wceconf.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 wceconf.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.12 $ */ +/* NetHack 3.5 wceconf.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */ /* NetHack 3.5 wceconf.h $Date: 2009/10/22 02:59:14 $ $Revision: 1.12 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/botl.c b/src/botl.c index 76d16a8ff..6006df8ce 100644 --- a/src/botl.c +++ b/src/botl.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 botl.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.38 $ */ +/* NetHack 3.5 botl.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.38 $ */ /* NetHack 3.5 botl.c $Date: 2012/01/10 17:47:19 $ $Revision: 1.36 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/files.c b/src/files.c index 7ba180547..71fd0c217 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 files.c $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.127 $ */ +/* NetHack 3.5 files.c $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.127 $ */ /* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/options.c b/src/options.c index 1c63c5ed5..54ad99efc 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 options.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.158 $ */ +/* NetHack 3.5 options.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.158 $ */ /* NetHack 3.5 options.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.153 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/pickup.c b/src/pickup.c index fea45dce3..d044cf46f 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 pickup.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.126 $ */ +/* NetHack 3.5 pickup.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.126 $ */ /* NetHack 3.5 pickup.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.123 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/save.c b/src/save.c index d7828655a..b220f945d 100644 --- a/src/save.c +++ b/src/save.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 save.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.59 $ */ +/* NetHack 3.5 save.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.59 $ */ /* NetHack 3.5 save.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.53 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhstatus.c b/sys/wince/mhstatus.c index 397f2dcb8..a9a6b2855 100644 --- a/sys/wince/mhstatus.c +++ b/sys/wince/mhstatus.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mhstatus.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.8 $ */ +/* NetHack 3.5 mhstatus.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */ /* NetHack 3.5 mhstatus.c $Date: 2009/05/06 10:52:28 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)mhstatus.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ diff --git a/util/makedefs.c b/util/makedefs.c index b8a40199f..f4ca9febb 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 makedefs.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.63 $ */ +/* NetHack 3.5 makedefs.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.63 $ */ /* NetHack 3.5 makedefs.c $Date: 2012/01/15 09:27:03 $ $Revision: 1.50 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) M. Stephenson, 1990, 1991. */ diff --git a/win/X11/winstat.c b/win/X11/winstat.c index ae2a3ce83..3267e26be 100644 --- a/win/X11/winstat.c +++ b/win/X11/winstat.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 winstat.c $NHDT-Date: 1425083083 2015/02/28 00:24:43 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.5 $ */ +/* NetHack 3.5 winstat.c $NHDT-Date: 1425083083 2015/02/28 00:24:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.5 $ */ /* NetHack 3.5 winstat.c $Date: 2009/05/06 10:55:59 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)winstat.c 3.5 1996/04/05 */ /* Copyright (c) Dean Luick, 1992 */ diff --git a/win/gnome/gnstatus.c b/win/gnome/gnstatus.c index 5109f5bb7..2f1cea075 100644 --- a/win/gnome/gnstatus.c +++ b/win/gnome/gnstatus.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 gnstatus.c $NHDT-Date: 1425083083 2015/02/28 00:24:43 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.6 $ */ +/* NetHack 3.5 gnstatus.c $NHDT-Date: 1425083083 2015/02/28 00:24:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.6 $ */ /* NetHack 3.5 gnstatus.c $Date: 2009/05/06 10:57:54 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gnstatus.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ diff --git a/win/share/tilemap.c b/win/share/tilemap.c index 06c966113..bb8273f47 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 tilemap.c $NHDT-Date: 1425082379 2015/02/28 00:12:59 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.12 $ */ +/* NetHack 3.5 tilemap.c $NHDT-Date: 1425082379 2015/02/28 00:12:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */ /* NetHack 3.5 tilemap.c $Date: 2009/05/06 10:59:02 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)tilemap.c 3.5 2000/06/04 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/tty/topl.c b/win/tty/topl.c index db307b73a..cc4df15d5 100644 --- a/win/tty/topl.c +++ b/win/tty/topl.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 topl.c $NHDT-Date: 1425081315 2015/02/27 23:55:15 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.24 $ */ +/* NetHack 3.5 topl.c $NHDT-Date: 1425081315 2015/02/27 23:55:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ From 5ffd5a3000c6d90c26402ac2a79f588bb35b8a6a Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Mon, 23 Feb 2015 14:59:24 -0500 Subject: [PATCH 036/354] Factor out a new `is_moat` function. The fact that Juiblex's swamp is MOAT but not moat is weird and should probably be looked at at some point. --- include/extern.h | 1 + src/dbridge.c | 23 ++++++++++++++++++++--- src/dig.c | 19 +++++++++---------- src/zap.c | 7 ++++--- 4 files changed, 34 insertions(+), 16 deletions(-) diff --git a/include/extern.h b/include/extern.h index cdeee5478..0f7fb0d3f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -219,6 +219,7 @@ E boolean FDECL(is_pool, (int,int)); E boolean FDECL(is_lava, (int,int)); E boolean FDECL(is_pool_or_lava, (int,int)); E boolean FDECL(is_ice, (int,int)); +E boolean FDECL(is_moat, (int,int)); E int FDECL(is_drawbridge_wall, (int,int)); E boolean FDECL(is_db_wall, (int,int)); E boolean FDECL(find_drawbridge, (int *,int*)); diff --git a/src/dbridge.c b/src/dbridge.c index 316b2707f..a82805377 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -42,9 +42,11 @@ int x,y; if (!isok(x,y)) return FALSE; ltyp = levl[x][y].typ; - if (ltyp == POOL || ltyp == MOAT || ltyp == WATER) return TRUE; - if (ltyp == DRAWBRIDGE_UP && - (levl[x][y].drawbridgemask & DB_UNDER) == DB_MOAT) return TRUE; + /* The ltyp == MOAT is not redundant with is_moat, because the + * Juiblex level does not have moats, although it has MOATs. There + * is probably a better way to express this. */ + if (ltyp == POOL || ltyp == MOAT || ltyp == WATER || is_moat(x, y)) + return TRUE; return FALSE; } @@ -86,6 +88,21 @@ int x,y; return FALSE; } +boolean +is_moat(x,y) +int x, y; +{ + schar ltyp; + + if (!isok(x, y)) return FALSE; + ltyp = levl[x][y].typ; + if (!Is_juiblex_level(&u.uz) && + (ltyp == MOAT || (ltyp == DRAWBRIDGE_UP && + (levl[x][y].drawbridgemask & DB_UNDER) == DB_MOAT))) + return TRUE; + return FALSE; +} + /* * We want to know whether a wall (or a door) is the portcullis (passageway) * of an eventual drawbridge. diff --git a/src/dig.c b/src/dig.c index 00a60aaba..39791dde0 100644 --- a/src/dig.c +++ b/src/dig.c @@ -486,16 +486,15 @@ boolean fill_if_any; /* force filling if it exists at all */ for (x1 = lo_x; x1 <= hi_x; x1++) for (y1 = lo_y; y1 <= hi_y; y1++) - if (levl[x1][y1].typ == POOL) - pool_cnt++; - else if (levl[x1][y1].typ == MOAT || - (levl[x1][y1].typ == DRAWBRIDGE_UP && - (levl[x1][y1].drawbridgemask & DB_UNDER) == DB_MOAT)) - moat_cnt++; - else if (levl[x1][y1].typ == LAVAPOOL || - (levl[x1][y1].typ == DRAWBRIDGE_UP && - (levl[x1][y1].drawbridgemask & DB_UNDER) == DB_LAVA)) - lava_cnt++; + if (is_moat(x1, y1)) + moat_cnt++; + else if (is_pool(x1, y1)) + /* This must come after is_moat since moats are pools + * but not vice-versa. */ + pool_cnt++; + else if (is_lava(x1, y1)) + lava_cnt++; + if (!fill_if_any) pool_cnt /= 3; /* not as much liquid as the others */ if ((lava_cnt > moat_cnt + pool_cnt && rn2(lava_cnt + 1)) || diff --git a/src/zap.c b/src/zap.c index dfdf95d4c..03cbc6c52 100644 --- a/src/zap.c +++ b/src/zap.c @@ -4017,7 +4017,7 @@ short exploding_wand_typ; case ZT_COLD: if (is_pool(x,y) || is_lava(x,y)) { boolean lava = is_lava(x,y); - const char *moat = waterbody_name(x, y); + boolean moat = is_moat(x,y); if (lev->typ == WATER) { /* For now, don't let WATER freeze. */ @@ -4041,8 +4041,9 @@ short exploding_wand_typ; if (see_it) { if(lava) Norep("The lava cools and solidifies."); - else if(strcmp(moat, "moat") == 0) - Norep("The %s is bridged with ice!", moat); + else if(moat) + Norep("The %s is bridged with ice!", + waterbody_name(x,y)); else Norep("The water freezes."); newsym(x,y); From 9c4b0113aa7f2472fc87b0ae19b7d235396df9cf Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Mon, 23 Feb 2015 15:08:30 -0500 Subject: [PATCH 037/354] Remove the `victim` argument to `rust_dmg()`. The argument can be calculated from `otmp`. --- include/extern.h | 2 +- src/dokick.c | 2 +- src/mhitu.c | 14 +++++++------- src/sit.c | 4 ++-- src/trap.c | 33 +++++++++++++++++---------------- src/uhitm.c | 22 +++++++++++----------- 6 files changed, 39 insertions(+), 38 deletions(-) diff --git a/include/extern.h b/include/extern.h index 0f7fb0d3f..120f7d506 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2203,7 +2203,7 @@ E coord *FDECL(gettrack, (int,int)); /* ### trap.c ### */ E boolean FDECL(burnarmor,(struct monst *)); -E boolean FDECL(rust_dmg, (struct obj *,const char *,int,BOOLEAN_P,struct monst *)); +E boolean FDECL(rust_dmg, (struct obj *,const char *,int,BOOLEAN_P)); E void FDECL(grease_protect, (struct obj *,const char *,struct monst *)); E struct trap *FDECL(maketrap, (int,int,int)); E void FDECL(fall_through, (BOOLEAN_P)); diff --git a/src/dokick.c b/src/dokick.c index b17379e07..06ff075e6 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -983,7 +983,7 @@ dokick() if(!rn2(3)) goto ouch; /* make metal boots rust */ if(uarmf && rn2(3)) - if (!rust_dmg(uarmf, "metal boots", 1, FALSE, &youmonst)) { + if (!rust_dmg(uarmf, "metal boots", 1, FALSE)) { Your("boots get wet."); /* could cause short-lived fumbling here */ } diff --git a/src/mhitu.c b/src/mhitu.c index 6f298ff63..416edaa5b 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -740,12 +740,12 @@ int attk; while (1) { switch(rn2(5)) { case 0: - if (!uarmh || !rust_dmg(uarmh, xname(uarmh), hurt, FALSE, &youmonst)) + if (!uarmh || !rust_dmg(uarmh, xname(uarmh), hurt, FALSE)) continue; break; case 1: if (uarmc) { - (void)rust_dmg(uarmc, xname(uarmc), hurt, TRUE, &youmonst); + (void)rust_dmg(uarmc, xname(uarmc), hurt, TRUE); break; } /* Note the difference between break and continue; @@ -754,20 +754,20 @@ int attk; * something else did. */ if (uarm) - (void)rust_dmg(uarm, xname(uarm), hurt, TRUE, &youmonst); + (void)rust_dmg(uarm, xname(uarm), hurt, TRUE); else if (uarmu) - (void)rust_dmg(uarmu, xname(uarmu), hurt, TRUE, &youmonst); + (void)rust_dmg(uarmu, xname(uarmu), hurt, TRUE); break; case 2: - if (!uarms || !rust_dmg(uarms, xname(uarms), hurt, FALSE, &youmonst)) + if (!uarms || !rust_dmg(uarms, xname(uarms), hurt, FALSE)) continue; break; case 3: - if (!uarmg || !rust_dmg(uarmg, xname(uarmg), hurt, FALSE, &youmonst)) + if (!uarmg || !rust_dmg(uarmg, xname(uarmg), hurt, FALSE)) continue; break; case 4: - if (!uarmf || !rust_dmg(uarmf, xname(uarmf), hurt, FALSE, &youmonst)) + if (!uarmf || !rust_dmg(uarmf, xname(uarmf), hurt, FALSE)) continue; break; } diff --git a/src/sit.c b/src/sit.c index aa3a16605..e5e77aa42 100644 --- a/src/sit.c +++ b/src/sit.c @@ -113,9 +113,9 @@ dosit() in_water: You("sit in the water."); if (!rn2(10) && uarm) - (void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst); + (void) rust_dmg(uarm, "armor", 1, TRUE); if (!rn2(10) && uarmf && uarmf->otyp != WATER_WALKING_BOOTS) - (void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst); + (void) rust_dmg(uarm, "armor", 1, TRUE); } else if(IS_SINK(typ)) { You(sit_message, defsyms[S_sink].explanation); Your("%s gets wet.", humanoid(youmonst.data) ? "rump" : "underside"); diff --git a/src/trap.c b/src/trap.c index 636598789..d819724a5 100644 --- a/src/trap.c +++ b/src/trap.c @@ -55,7 +55,7 @@ struct monst *victim; int mat_idx; if (!victim) return 0; -#define burn_dmg(obj,descr) rust_dmg(obj, descr, 0, FALSE, victim) +#define burn_dmg(obj,descr) rust_dmg(obj, descr, 0, FALSE) while (1) { switch (rn2(5)) { case 0: @@ -107,20 +107,21 @@ struct monst *victim; * returned only for rustable items. */ boolean -rust_dmg(otmp, ostr, type, print, victim) +rust_dmg(otmp, ostr, type, print) register struct obj *otmp; register const char *ostr; int type; boolean print; -struct monst *victim; { static NEARDATA const char * const action[] = { "smoulder", "rust", "rot", "corrode" }; static NEARDATA const char * const msg[] = { "burnt", "rusted", "rotten", "corroded" }; boolean vulnerable = FALSE; boolean grprot = FALSE; boolean is_primary = TRUE; - boolean vismon = (victim != &youmonst) && canseemon(victim); int erosion; + struct monst *victim = + carried(otmp) ? &youmonst : mcarried(otmp) ? otmp->ocarry : NULL; + boolean vismon = (victim != &youmonst) && canseemon(victim); if (!otmp) return(FALSE); switch(type) { @@ -920,17 +921,17 @@ unsigned trflags; pline("%s you on the %s!", A_gush_of_water_hits, body_part(HEAD)); (void) rust_dmg(uarmh, helm_simple_name(uarmh), - 1, TRUE, &youmonst); + 1, TRUE); break; case 1: pline("%s your left %s!", A_gush_of_water_hits, body_part(ARM)); - if (rust_dmg(uarms, "shield", 1, TRUE, &youmonst)) + if (rust_dmg(uarms, "shield", 1, TRUE)) break; if (u.twoweap || (uwep && bimanual(uwep))) (void) erode_obj(u.twoweap ? uswapwep : uwep, 1, TRUE, FALSE); -glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); +glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE); /* Not "metal gauntlets" since it gets called * even if it's leather for the message */ @@ -948,11 +949,11 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); (void) snuff_lit(otmp); if (uarmc) (void) rust_dmg(uarmc, cloak_simple_name(uarmc), - 1, TRUE, &youmonst); + 1, TRUE); else if (uarm) - (void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst); + (void) rust_dmg(uarm, "armor", 1, TRUE); else if (uarmu) - (void) rust_dmg(uarmu, "shirt", 1, TRUE, &youmonst); + (void) rust_dmg(uarmu, "shirt", 1, TRUE); } update_inventory(); break; @@ -2051,20 +2052,20 @@ register struct monst *mtmp; mon_nam(mtmp), mbodypart(mtmp, HEAD)); target = which_armor(mtmp, W_ARMH); (void) rust_dmg(target, helm_simple_name(target), - 1, TRUE, mtmp); + 1, TRUE); break; case 1: if (in_sight) pline("%s %s's left %s!", A_gush_of_water_hits, mon_nam(mtmp), mbodypart(mtmp, ARM)); target = which_armor(mtmp, W_ARMS); - if (rust_dmg(target, "shield", 1, TRUE, mtmp)) + if (rust_dmg(target, "shield", 1, TRUE)) break; target = MON_WEP(mtmp); if (target && bimanual(target)) (void) erode_obj(target, 1, TRUE, FALSE); glovecheck: target = which_armor(mtmp, W_ARMG); - (void) rust_dmg(target, "gauntlets", 1, TRUE, mtmp); + (void) rust_dmg(target, "gauntlets", 1, TRUE); break; case 2: if (in_sight) @@ -2083,11 +2084,11 @@ glovecheck: target = which_armor(mtmp, W_ARMG); if ((target = which_armor(mtmp, W_ARMC)) != 0) (void) rust_dmg(target, cloak_simple_name(target), - 1, TRUE, mtmp); + 1, TRUE); else if ((target = which_armor(mtmp, W_ARM)) != 0) - (void) rust_dmg(target, "armor", 1, TRUE, mtmp); + (void) rust_dmg(target, "armor", 1, TRUE); else if ((target = which_armor(mtmp, W_ARMU)) != 0) - (void) rust_dmg(target, "shirt", 1, TRUE, mtmp); + (void) rust_dmg(target, "shirt", 1, TRUE); } if (mptr == &mons[PM_IRON_GOLEM]) { diff --git a/src/uhitm.c b/src/uhitm.c index bbb3a7fb4..1ccb8a2cb 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -56,34 +56,34 @@ int attk; switch(rn2(5)) { case 0: target = which_armor(mdef, W_ARMH); - if (!target || !rust_dmg(target, xname(target), hurt, FALSE, mdef)) + if (!target || !rust_dmg(target, xname(target), hurt, FALSE)) continue; break; case 1: target = which_armor(mdef, W_ARMC); if (target) { - (void)rust_dmg(target, xname(target), hurt, TRUE, mdef); + (void)rust_dmg(target, xname(target), hurt, TRUE); break; } if ((target = which_armor(mdef, W_ARM)) != (struct obj *)0) { - (void)rust_dmg(target, xname(target), hurt, TRUE, mdef); + (void)rust_dmg(target, xname(target), hurt, TRUE); } else if ((target = which_armor(mdef, W_ARMU)) != (struct obj *)0) { - (void)rust_dmg(target, xname(target), hurt, TRUE, mdef); + (void)rust_dmg(target, xname(target), hurt, TRUE); } break; case 2: target = which_armor(mdef, W_ARMS); - if (!target || !rust_dmg(target, xname(target), hurt, FALSE, mdef)) + if (!target || !rust_dmg(target, xname(target), hurt, FALSE)) continue; break; case 3: target = which_armor(mdef, W_ARMG); - if (!target || !rust_dmg(target, xname(target), hurt, FALSE, mdef)) + if (!target || !rust_dmg(target, xname(target), hurt, FALSE)) continue; break; case 4: target = which_armor(mdef, W_ARMF); - if (!target || !rust_dmg(target, xname(target), hurt, FALSE, mdef)) + if (!target || !rust_dmg(target, xname(target), hurt, FALSE)) continue; break; } @@ -2231,7 +2231,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf && !rn2(6)) - (void)rust_dmg(uarmf, xname(uarmf), 0, TRUE, &youmonst); + (void)rust_dmg(uarmf, xname(uarmf), 0, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2251,7 +2251,7 @@ boolean wep_was_destroyed; if (mhit) { if (aatyp == AT_KICK) { if (uarmf && !rn2(6)) - (void)rust_dmg(uarmf, xname(uarmf), 3, TRUE, &youmonst); + (void)rust_dmg(uarmf, xname(uarmf), 3, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2284,7 +2284,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf) - (void)rust_dmg(uarmf, xname(uarmf), 1, TRUE, &youmonst); + (void)rust_dmg(uarmf, xname(uarmf), 1, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2294,7 +2294,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf) - (void)rust_dmg(uarmf, xname(uarmf), 3, TRUE, &youmonst); + (void)rust_dmg(uarmf, xname(uarmf), 3, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); From d588210a776c6bd7d28cfe6ce8ffb0cf87aeb7fb Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Mon, 2 Mar 2015 12:36:33 -0500 Subject: [PATCH 038/354] Cover a couple of corner cases with `rust_dmg()`. --- doc/fixes35.0 | 3 + include/extern.h | 2 +- include/obj.h | 6 ++ src/trap.c | 139 +++++++++++++++++++++++++++++------------------ 4 files changed, 96 insertions(+), 54 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 3cc0e61dd..4fd81cff5 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -858,6 +858,9 @@ fix "object_is_local" panic when saving bones after hero is killed by explosion if lava burns up the player's water walking boots, the player falls in the messages for lava burning items up are always printed fix used-up magic trap trying to hit steed. +messages are now printed when objects on the ground are eroded +object erosion now always identifies rust/rot/fire/corrodeproof objects +grease protects from all types of erosion Platform- and/or Interface-Specific Fixes diff --git a/include/extern.h b/include/extern.h index 120f7d506..87427dd3a 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2204,7 +2204,7 @@ E coord *FDECL(gettrack, (int,int)); E boolean FDECL(burnarmor,(struct monst *)); E boolean FDECL(rust_dmg, (struct obj *,const char *,int,BOOLEAN_P)); -E void FDECL(grease_protect, (struct obj *,const char *,struct monst *)); +E boolean FDECL(grease_protect, (struct obj *,const char *,struct monst *)); E struct trap *FDECL(maketrap, (int,int,int)); E void FDECL(fall_through, (BOOLEAN_P)); E struct monst *FDECL(animate_statue, (struct obj *,XCHAR_P,XCHAR_P,int,int *)); diff --git a/include/obj.h b/include/obj.h index dc522b338..12b1fce35 100644 --- a/include/obj.h +++ b/include/obj.h @@ -319,6 +319,12 @@ struct obj { #define CONTAINED_TOO 0x1 #define BURIED_TOO 0x2 +/* object erosion types */ +#define ERODE_BURN 0 +#define ERODE_RUST 1 +#define ERODE_ROT 2 +#define ERODE_CORRODE 3 + /* * Notes for adding new oextra structures: * diff --git a/src/trap.c b/src/trap.c index d819724a5..1220105f5 100644 --- a/src/trap.c +++ b/src/trap.c @@ -101,10 +101,9 @@ struct monst *victim; #undef burn_dmg } -/* Generic rust-armor function. Returns TRUE if a message was printed; - * "print", if set, means to print a message (and thus to return TRUE) even - * if the item could not be rusted; otherwise a message is printed and TRUE is - * returned only for rustable items. +/* Generic erode-item function. Returns TRUE if any change in state + * occurred. "print", if set, means to print a message even if no change + * occurs. */ boolean rust_dmg(otmp, ostr, type, print) @@ -119,69 +118,95 @@ boolean print; boolean grprot = FALSE; boolean is_primary = TRUE; int erosion; - struct monst *victim = - carried(otmp) ? &youmonst : mcarried(otmp) ? otmp->ocarry : NULL; - boolean vismon = (victim != &youmonst) && canseemon(victim); + struct monst *victim; + boolean vismon; + boolean visobj; if (!otmp) return(FALSE); + + victim = carried(otmp) ? &youmonst : mcarried(otmp) ? + otmp->ocarry : NULL; + vismon = victim && (victim != &youmonst) && canseemon(victim); + /* Is bhitpos correct here? Ugh. */ + visobj = !victim && cansee(bhitpos.x, bhitpos.y); + switch(type) { - case 0: vulnerable = is_flammable(otmp); - break; - case 1: vulnerable = is_rustprone(otmp); - grprot = TRUE; - break; - case 2: vulnerable = is_rottable(otmp); - is_primary = FALSE; - break; - case 3: vulnerable = is_corrodeable(otmp); - grprot = TRUE; - is_primary = FALSE; - break; + case ERODE_BURN: + vulnerable = is_flammable(otmp); + break; + case ERODE_RUST: + vulnerable = is_rustprone(otmp); + grprot = TRUE; + break; + case ERODE_ROT: + vulnerable = is_rottable(otmp); + is_primary = FALSE; + break; + case ERODE_CORRODE: + vulnerable = is_corrodeable(otmp); + grprot = TRUE; + is_primary = FALSE; + break; + default: + impossible("Invalid erosion type in rust_dmg"); + return FALSE; } erosion = is_primary ? otmp->oeroded : otmp->oeroded2; - if (!print && (!vulnerable || otmp->oerodeproof || erosion == MAX_ERODE)) - return FALSE; + if (!ostr) + ostr = cxname(otmp); - if (!vulnerable) { - if (flags.verbose) { + if (grprot && otmp->greased) { + return grease_protect(otmp, ostr, victim); + } else if (!vulnerable || (otmp->oerodeproof && otmp->rknown)) { + if (print && flags.verbose) { if (victim == &youmonst) Your("%s %s not affected.", ostr, vtense(ostr, "are")); else if (vismon) pline("%s's %s %s not affected.", Monnam(victim), ostr, vtense(ostr, "are")); } - } else if (erosion < MAX_ERODE) { - if (grprot && otmp->greased) { - grease_protect(otmp,ostr,victim); - } else if (otmp->oerodeproof || (otmp->blessed && !rnl(4))) { - if (flags.verbose) { - if (victim == &youmonst) - pline("Somehow, your %s %s not affected.", - ostr, vtense(ostr, "are")); - else if (vismon) - pline("Somehow, %s's %s %s not affected.", - mon_nam(victim), ostr, vtense(ostr, "are")); - } - } else { + return FALSE; + } else if (otmp->oerodeproof || otmp->blessed && !rnl(4)) { + if (flags.verbose && (print || otmp->oerodeproof)) { if (victim == &youmonst) - Your("%s %s%s!", ostr, - vtense(ostr, action[type]), - erosion+1 == MAX_ERODE ? " completely" : - erosion ? " further" : ""); + pline("Somehow, your %s %s not affected.", + ostr, vtense(ostr, "are")); else if (vismon) - pline("%s's %s %s%s!", Monnam(victim), ostr, - vtense(ostr, action[type]), - erosion+1 == MAX_ERODE ? " completely" : - erosion ? " further" : ""); - if (is_primary) - otmp->oeroded++; - else - otmp->oeroded2++; - update_inventory(); - } + pline("Somehow, %s's %s %s not affected.", + mon_nam(victim), ostr, vtense(ostr, "are")); + else if (visobj) + pline("Somehow, the %s %s not affected." ostr, + vtense(ostr, "are")); + } + /* We assume here that if the object is protected because it + * is blessed, it still shows some minor signs of wear, and + * the hero can distinguish this from an object that is + * actually proof against damage. */ + if (otmp->oerodeproof) + otmp->rknown = TRUE; + return FALSE; + } else if (erosion < MAX_ERODE) { + const char *adverb = (erosion + 1 == MAX_ERODE) ? + " complete" : erosion ? " further" : ""; + + if (victim == &youmonst) + Your("%s %s%s!", ostr, vtense(ostr, action[type]), adverb); + else if (vismon) + pline("%s's %s %s%s!", Monnam(victim), ostr, + vtense(ostr, action[type]), adverb); + else if (visobj) + pline("The %s %s%s!", ostr, vtense(ostr, action[type]), adverb); + + if (is_primary) + otmp->oeroded++; + else + otmp->oeroded2++; + + update_inventory(); + return TRUE; } else { - if (flags.verbose) { + if (flags.verbose && print) { if (victim == &youmonst) Your("%s %s completely %s.", ostr, vtense(ostr, Blind ? "feel" : "look"), @@ -190,12 +215,18 @@ boolean print; pline("%s's %s %s completely %s.", Monnam(victim), ostr, vtense(ostr, "look"), msg[type]); + else if (visobj) + pline("The %s %s completely %s.", ostr, + vtense(ostr, "look"), msg[type]); } + return FALSE; } - return(TRUE); } -void +/* Protect an item from erosion with grease. Returns TRUE if the grease + * wears off. + */ +boolean grease_protect(otmp,ostr,victim) register struct obj *otmp; register const char *ostr; @@ -219,7 +250,9 @@ struct monst *victim; pline_The("grease dissolves."); update_inventory(); } + return TRUE; } + return FALSE; } struct trap * From 7e0d552b068f56e0c6a1698ae24dee9dca8ec87f Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Mon, 23 Feb 2015 17:21:11 -0500 Subject: [PATCH 039/354] A lot more cleanup to rust and water. --- doc/fixes35.0 | 1 + include/extern.h | 8 +- src/do.c | 3 +- src/do_wear.c | 14 --- src/dokick.c | 2 +- src/fountain.c | 2 +- src/mhitm.c | 10 +- src/mhitu.c | 70 +----------- src/mon.c | 6 +- src/objnam.c | 2 +- src/sit.c | 4 +- src/trap.c | 279 ++++++++++++++++++++++++----------------------- src/uhitm.c | 43 +++----- src/worn.c | 25 ++++- src/zap.c | 4 +- 15 files changed, 206 insertions(+), 267 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 4fd81cff5..48da8da36 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -861,6 +861,7 @@ fix used-up magic trap trying to hit steed. messages are now printed when objects on the ground are eroded object erosion now always identifies rust/rot/fire/corrodeproof objects grease protects from all types of erosion +all sources of erosion now affect objects the same way Platform- and/or Interface-Specific Fixes diff --git a/include/extern.h b/include/extern.h index 87427dd3a..87d3adee7 100644 --- a/include/extern.h +++ b/include/extern.h @@ -434,7 +434,6 @@ E int NDECL(doputon); E void NDECL(find_ac); E void NDECL(glibr); E struct obj *FDECL(some_armor,(struct monst *)); -E void FDECL(erode_armor, (struct monst *,BOOLEAN_P)); E struct obj *FDECL(stuck_ring, (struct obj *,int)); E struct obj *NDECL(unchanger); E void NDECL(reset_remarm); @@ -2203,7 +2202,7 @@ E coord *FDECL(gettrack, (int,int)); /* ### trap.c ### */ E boolean FDECL(burnarmor,(struct monst *)); -E boolean FDECL(rust_dmg, (struct obj *,const char *,int,BOOLEAN_P)); +E boolean FDECL(rust_dmg, (struct obj *,const char *,int,BOOLEAN_P,BOOLEAN_P)); E boolean FDECL(grease_protect, (struct obj *,const char *,struct monst *)); E struct trap *FDECL(maketrap, (int,int,int)); E void FDECL(fall_through, (BOOLEAN_P)); @@ -2223,7 +2222,8 @@ E void FDECL(fill_pit, (int,int)); E int FDECL(float_down, (long, long)); E void NDECL(climb_pit); E int FDECL(fire_damage, (struct obj *,BOOLEAN_P,BOOLEAN_P,XCHAR_P,XCHAR_P)); -E void FDECL(water_damage, (struct obj **,BOOLEAN_P,BOOLEAN_P)); +E int FDECL(water_damage, (struct obj *,const char*,BOOLEAN_P)); +E void FDECL(water_damage_chain, (struct obj *,BOOLEAN_P)); E boolean NDECL(drown); E void FDECL(drain_en, (int)); E int NDECL(dountrap); @@ -2253,7 +2253,7 @@ E void NDECL(u_init); /* ### uhitm.c ### */ -E void FDECL(hurtmarmor,(struct monst *,int)); +E void FDECL(erode_armor,(struct monst *,int)); E boolean FDECL(attack_checks, (struct monst *,struct obj *)); E void FDECL(check_caitiff, (struct monst *)); E int FDECL(find_roll_to_hit, (struct monst *,UCHAR_P,struct obj *,int *,int *)); diff --git a/src/do.c b/src/do.c index 981981293..319317bf5 100644 --- a/src/do.c +++ b/src/do.c @@ -201,8 +201,7 @@ const char *verb; map_background(x, y, 0); newsym(x, y); } - water_damage(&obj, FALSE, FALSE); - if (!obj) return TRUE; + return water_damage(obj, NULL, FALSE) == 3; } else if (u.ux == x && u.uy == y && (t = t_at(x,y)) != 0 && uteetering_at_seen_pit(t)) { if (Blind && !Deaf) diff --git a/src/do_wear.c b/src/do_wear.c index 414f5a522..9925ceaf0 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -1937,20 +1937,6 @@ struct monst *victim; return(otmph); } -/* erode some arbitrary armor worn by the victim */ -void -erode_armor(victim, acid_dmg) -struct monst *victim; -boolean acid_dmg; -{ - struct obj *otmph = some_armor(victim); - - if (otmph && (otmph != uarmf)) { - (void) erode_obj(otmph, acid_dmg ? 3 : 1, FALSE, FALSE); - if (carried(otmph)) update_inventory(); - } -} - /* used for praying to check and fix levitation trouble */ struct obj * stuck_ring(ring, otyp) diff --git a/src/dokick.c b/src/dokick.c index 06ff075e6..c399f6bbc 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -983,7 +983,7 @@ dokick() if(!rn2(3)) goto ouch; /* make metal boots rust */ if(uarmf && rn2(3)) - if (!rust_dmg(uarmf, "metal boots", 1, FALSE)) { + if (!water_damage(uarmf, "metal boots", TRUE)) { Your("boots get wet."); /* could cause short-lived fumbling here */ } diff --git a/src/fountain.c b/src/fountain.c index f167c09d4..cc8aeb7bf 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -136,7 +136,7 @@ genericptr_t poolcnt; levl[x][y].typ = POOL; /* No kelp! */ del_engr_at(x, y); - water_damage(&level.objects[x][y], FALSE, TRUE); + water_damage_chain(level.objects[x][y], TRUE); if ((mtmp = m_at(x, y)) != 0) (void) minliquid(mtmp); diff --git a/src/mhitm.c b/src/mhitm.c index 47a14915f..ae66279e7 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -883,7 +883,7 @@ mdamagem(magr, mdef, mattk) pline("%s is covered in acid!", Monnam(mdef)); pline("It burns %s!", mon_nam(mdef)); } - if (!rn2(30)) erode_armor(mdef, TRUE); + if (!rn2(30)) erode_armor(mdef, ERODE_CORRODE); if (!rn2(6)) (void) erode_obj(MON_WEP(mdef), 3, TRUE, FALSE); break; case AD_RUST: @@ -897,13 +897,13 @@ mdamagem(magr, mdef, mattk) return (MM_DEF_DIED | (grow_up(magr,mdef) ? 0 : MM_AGR_DIED)); } - hurtmarmor(mdef, AD_RUST); + erode_armor(mdef, ERODE_RUST); mdef->mstrategy &= ~STRAT_WAITFORU; tmp = 0; break; case AD_CORR: if (magr->mcan) break; - hurtmarmor(mdef, AD_CORR); + erode_armor(mdef, ERODE_CORRODE); mdef->mstrategy &= ~STRAT_WAITFORU; tmp = 0; break; @@ -919,7 +919,7 @@ mdamagem(magr, mdef, mattk) return (MM_DEF_DIED | (grow_up(magr,mdef) ? 0 : MM_AGR_DIED)); } - hurtmarmor(mdef, AD_DCAY); + erode_armor(mdef, ERODE_CORRODE); mdef->mstrategy &= ~STRAT_WAITFORU; tmp = 0; break; @@ -1361,7 +1361,7 @@ int mdead; tmp = 0; } } else tmp = 0; - if (!rn2(30)) erode_armor(magr, TRUE); + if (!rn2(30)) erode_armor(magr, ERODE_CORRODE); if (!rn2(6)) (void)erode_obj(MON_WEP(magr), 3, TRUE, FALSE); goto assess_dmg; case AD_ENCH: /* KMH -- remove enchantment (disenchanter) */ diff --git a/src/mhitu.c b/src/mhitu.c index 416edaa5b..cc9b6f1be 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -22,7 +22,6 @@ STATIC_DCL void FDECL(missmu,(struct monst *,BOOLEAN_P,struct attack *)); STATIC_DCL void FDECL(mswings,(struct monst *,struct obj *)); STATIC_DCL void FDECL(wildmiss, (struct monst *,struct attack *)); -STATIC_DCL void FDECL(hurtarmor,(int)); STATIC_DCL void FDECL(hitmsg,(struct monst *,struct attack *)); /* See comment in mhitm.c. If we use this a lot it probably should be */ @@ -714,67 +713,6 @@ mattacku(mtmp) return(0); } -/* - * helper function for some compilers that have trouble with hitmu - */ - -STATIC_OVL void -hurtarmor(attk) -int attk; -{ - int hurt; - - switch(attk) { - /* 0 is burning, which we should never be called with */ - case AD_RUST: hurt = 1; break; - case AD_CORR: hurt = 3; break; - default: hurt = 2; break; - } - - /* What the following code does: it keeps looping until it - * finds a target for the rust monster. - * Head, feet, etc... not covered by metal, or covered by - * rusty metal, are not targets. However, your body always - * is, no matter what covers it. - */ - while (1) { - switch(rn2(5)) { - case 0: - if (!uarmh || !rust_dmg(uarmh, xname(uarmh), hurt, FALSE)) - continue; - break; - case 1: - if (uarmc) { - (void)rust_dmg(uarmc, xname(uarmc), hurt, TRUE); - break; - } - /* Note the difference between break and continue; - * break means it was hit and didn't rust; continue - * means it wasn't a target and though it didn't rust - * something else did. - */ - if (uarm) - (void)rust_dmg(uarm, xname(uarm), hurt, TRUE); - else if (uarmu) - (void)rust_dmg(uarmu, xname(uarmu), hurt, TRUE); - break; - case 2: - if (!uarms || !rust_dmg(uarms, xname(uarms), hurt, FALSE)) - continue; - break; - case 3: - if (!uarmg || !rust_dmg(uarmg, xname(uarmg), hurt, FALSE)) - continue; - break; - case 4: - if (!uarmf || !rust_dmg(uarmf, xname(uarmf), hurt, FALSE)) - continue; - break; - } - break; /* Out of while loop */ - } -} - STATIC_OVL boolean diseasemu(mdat) struct permonst *mdat; @@ -1336,12 +1274,12 @@ dopois: rehumanize(); break; } - hurtarmor(AD_RUST); + erode_armor(&youmonst, ERODE_RUST); break; case AD_CORR: hitmsg(mtmp, mattk); if (mtmp->mcan) break; - hurtarmor(AD_CORR); + erode_armor(&youmonst, ERODE_CORRODE); break; case AD_DCAY: hitmsg(mtmp, mattk); @@ -1353,7 +1291,7 @@ dopois: rehumanize(); break; } - hurtarmor(AD_DCAY); + erode_armor(&youmonst, ERODE_ROT); break; case AD_HEAL: /* a cancelled nurse is just an ordinary monster, @@ -2503,7 +2441,7 @@ register struct attack *mattk; tmp = 0; } } else tmp = 0; - if (!rn2(30)) erode_armor(mtmp, TRUE); + if (!rn2(30)) erode_armor(mtmp, ERODE_CORRODE); if (!rn2(6)) (void)erode_obj(MON_WEP(mtmp), 3, TRUE, FALSE); goto assess_dmg; case AD_STON: /* cockatrice */ diff --git a/src/mon.c b/src/mon.c index f617dad4c..1c2009a0b 100644 --- a/src/mon.c +++ b/src/mon.c @@ -333,7 +333,7 @@ register struct monst *mtmp; if (mtmp->data == &mons[PM_GREMLIN] && (inpool || infountain) && rn2(3)) { if (split_mon(mtmp, (struct monst *)0)) dryup(mtmp->mx, mtmp->my, FALSE); - if (inpool) water_damage(&mtmp->minvent, FALSE, FALSE); + if (inpool) water_damage_chain(mtmp->minvent, FALSE); return (0); } else if (mtmp->data == &mons[PM_IRON_GOLEM] && inpool && !rn2(5)) { int dam = d(2,6); @@ -345,7 +345,7 @@ register struct monst *mtmp; mondead(mtmp); if (mtmp->mhp < 1) return (1); } - water_damage(&mtmp->minvent, FALSE, FALSE); + water_damage_chain(mtmp->minvent, FALSE); return (0); } @@ -398,7 +398,7 @@ register struct monst *mtmp; } mondead(mtmp); if (mtmp->mhp > 0) { - water_damage(&mtmp->minvent, FALSE, FALSE); + water_damage_chain(mtmp->minvent, FALSE); (void) rloc(mtmp, FALSE); return 0; } diff --git a/src/objnam.c b/src/objnam.c index 84c3599f4..fe692b226 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -2893,7 +2893,7 @@ wiztrap: del_engr_at(x, y); pline("A %s.", (lev->typ == POOL) ? "pool" : "moat"); /* Must manually make kelp! */ - water_damage(&level.objects[x][y], FALSE, TRUE); + water_damage_chain(level.objects[x][y], TRUE); newsym(x, y); return &zeroobj; } diff --git a/src/sit.c b/src/sit.c index e5e77aa42..19cd63471 100644 --- a/src/sit.c +++ b/src/sit.c @@ -113,9 +113,9 @@ dosit() in_water: You("sit in the water."); if (!rn2(10) && uarm) - (void) rust_dmg(uarm, "armor", 1, TRUE); + (void) water_damage(uarm, "armor", TRUE); if (!rn2(10) && uarmf && uarmf->otyp != WATER_WALKING_BOOTS) - (void) rust_dmg(uarm, "armor", 1, TRUE); + (void) water_damage(uarm, "armor", TRUE); } else if(IS_SINK(typ)) { You(sit_message, defsyms[S_sink].explanation); Your("%s gets wet.", humanoid(youmonst.data) ? "rump" : "underside"); diff --git a/src/trap.c b/src/trap.c index 1220105f5..f6266791f 100644 --- a/src/trap.c +++ b/src/trap.c @@ -55,7 +55,7 @@ struct monst *victim; int mat_idx; if (!victim) return 0; -#define burn_dmg(obj,descr) rust_dmg(obj, descr, 0, FALSE) +#define burn_dmg(obj,descr) rust_dmg(obj, descr, ERODE_BURN, TRUE, FALSE) while (1) { switch (rn2(5)) { case 0: @@ -102,20 +102,21 @@ struct monst *victim; } /* Generic erode-item function. Returns TRUE if any change in state - * occurred. "print", if set, means to print a message even if no change - * occurs. + * occurred, or if grease protected the item. + * "check_grease", if FALSE, means that grease is not checked for + * "print", if set, means to print a message even if no change occurs. */ boolean -rust_dmg(otmp, ostr, type, print) +rust_dmg(otmp, ostr, type, check_grease, print) register struct obj *otmp; register const char *ostr; int type; +boolean check_grease; boolean print; { static NEARDATA const char * const action[] = { "smoulder", "rust", "rot", "corrode" }; static NEARDATA const char * const msg[] = { "burnt", "rusted", "rotten", "corroded" }; boolean vulnerable = FALSE; - boolean grprot = FALSE; boolean is_primary = TRUE; int erosion; struct monst *victim; @@ -133,18 +134,18 @@ boolean print; switch(type) { case ERODE_BURN: vulnerable = is_flammable(otmp); + check_grease = FALSE; break; case ERODE_RUST: vulnerable = is_rustprone(otmp); - grprot = TRUE; break; case ERODE_ROT: vulnerable = is_rottable(otmp); + check_grease = FALSE; is_primary = FALSE; break; case ERODE_CORRODE: vulnerable = is_corrodeable(otmp); - grprot = TRUE; is_primary = FALSE; break; default: @@ -156,8 +157,9 @@ boolean print; if (!ostr) ostr = cxname(otmp); - if (grprot && otmp->greased) { - return grease_protect(otmp, ostr, victim); + if (check_grease && otmp->greased) { + grease_protect(otmp, ostr, victim); + return TRUE; } else if (!vulnerable || (otmp->oerodeproof && otmp->rknown)) { if (print && flags.verbose) { if (victim == &youmonst) @@ -167,7 +169,7 @@ boolean print; vtense(ostr, "are")); } return FALSE; - } else if (otmp->oerodeproof || otmp->blessed && !rnl(4)) { + } else if (otmp->oerodeproof || (otmp->blessed && !rnl(4))) { if (flags.verbose && (print || otmp->oerodeproof)) { if (victim == &youmonst) pline("Somehow, your %s %s not affected.", @@ -176,7 +178,7 @@ boolean print; pline("Somehow, %s's %s %s not affected.", mon_nam(victim), ostr, vtense(ostr, "are")); else if (visobj) - pline("Somehow, the %s %s not affected." ostr, + pline("Somehow, the %s %s not affected.", ostr, vtense(ostr, "are")); } /* We assume here that if the object is protected because it @@ -188,7 +190,7 @@ boolean print; return FALSE; } else if (erosion < MAX_ERODE) { const char *adverb = (erosion + 1 == MAX_ERODE) ? - " complete" : erosion ? " further" : ""; + " completely" : erosion ? " further" : ""; if (victim == &youmonst) Your("%s %s%s!", ostr, vtense(ostr, action[type]), adverb); @@ -931,18 +933,6 @@ unsigned trflags; case RUST_TRAP: seetrap(trap); - if (u.umonnum == PM_IRON_GOLEM) { - int dam = u.mhmax; - - pline("%s you!", A_gush_of_water_hits); - You("are covered with rust!"); - losehp(Maybe_Half_Phys(dam), "rusting away", KILLED_BY); - break; - } else if (u.umonnum == PM_GREMLIN && rn2(3)) { - pline("%s you!", A_gush_of_water_hits); - (void)split_mon(&youmonst, (struct monst *)0); - break; - } /* Unlike monsters, traps cannot aim their rust attacks at * you, so instead of looping through and taking either the @@ -953,18 +943,18 @@ unsigned trflags; case 0: pline("%s you on the %s!", A_gush_of_water_hits, body_part(HEAD)); - (void) rust_dmg(uarmh, helm_simple_name(uarmh), - 1, TRUE); + (void) water_damage(uarmh, helm_simple_name(uarmh), + TRUE); break; case 1: pline("%s your left %s!", A_gush_of_water_hits, body_part(ARM)); - if (rust_dmg(uarms, "shield", 1, TRUE)) + if (water_damage(uarms, "shield", TRUE)) break; if (u.twoweap || (uwep && bimanual(uwep))) (void) erode_obj(u.twoweap ? uswapwep : uwep, 1, TRUE, FALSE); -glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE); +glovecheck: (void) water_damage(uarmg, "gauntlets", TRUE); /* Not "metal gauntlets" since it gets called * even if it's leather for the message */ @@ -981,14 +971,26 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE); (otmp != uswapwep || !u.twoweap)) (void) snuff_lit(otmp); if (uarmc) - (void) rust_dmg(uarmc, cloak_simple_name(uarmc), - 1, TRUE); + (void) water_damage(uarmc, cloak_simple_name(uarmc), + TRUE); else if (uarm) - (void) rust_dmg(uarm, "armor", 1, TRUE); + (void) water_damage(uarm, "armor", TRUE); else if (uarmu) - (void) rust_dmg(uarmu, "shirt", 1, TRUE); + (void) water_damage(uarmu, "shirt", TRUE); } update_inventory(); + + if (u.umonnum == PM_IRON_GOLEM) { + int dam = u.mhmax; + + pline("%s you!", A_gush_of_water_hits); + You("are covered with rust!"); + losehp(Maybe_Half_Phys(dam), "rusting away", KILLED_BY); + } else if (u.umonnum == PM_GREMLIN && rn2(3)) { + pline("%s you!", A_gush_of_water_hits); + (void)split_mon(&youmonst, (struct monst *)0); + } + break; case FIRE_TRAP: @@ -2084,21 +2086,21 @@ register struct monst *mtmp; pline("%s %s on the %s!", A_gush_of_water_hits, mon_nam(mtmp), mbodypart(mtmp, HEAD)); target = which_armor(mtmp, W_ARMH); - (void) rust_dmg(target, helm_simple_name(target), - 1, TRUE); + (void) water_damage(target, helm_simple_name(target), + TRUE); break; case 1: if (in_sight) pline("%s %s's left %s!", A_gush_of_water_hits, mon_nam(mtmp), mbodypart(mtmp, ARM)); target = which_armor(mtmp, W_ARMS); - if (rust_dmg(target, "shield", 1, TRUE)) + if (water_damage(target, "shield", TRUE)) break; target = MON_WEP(mtmp); if (target && bimanual(target)) (void) erode_obj(target, 1, TRUE, FALSE); glovecheck: target = which_armor(mtmp, W_ARMG); - (void) rust_dmg(target, "gauntlets", 1, TRUE); + (void) water_damage(target, "gauntlets", TRUE); break; case 2: if (in_sight) @@ -2115,13 +2117,13 @@ glovecheck: target = which_armor(mtmp, W_ARMG); (otmp->owornmask & (W_WEP|W_SWAPWEP)) == 0) (void) snuff_lit(otmp); if ((target = which_armor(mtmp, W_ARMC)) != 0) - (void) rust_dmg(target, - cloak_simple_name(target), - 1, TRUE); + (void) water_damage(target, + cloak_simple_name(target), + TRUE); else if ((target = which_armor(mtmp, W_ARM)) != 0) - (void) rust_dmg(target, "armor", 1, TRUE); + (void) water_damage(target, "armor", TRUE); else if ((target = which_armor(mtmp, W_ARMU)) != 0) - (void) rust_dmg(target, "shirt", 1, TRUE); + (void) water_damage(target, "shirt", TRUE); } if (mptr == &mons[PM_IRON_GOLEM]) { @@ -3067,107 +3069,112 @@ xchar x, y; return retval; } -void -water_damage(objp, force, here) -struct obj **objp; -boolean force, here; +/* returns: + * 0 if obj is unaffected + * 1 if obj is protected by grease + * 2 if obj is changed but survived + * 3 if obj is destroyed + */ +int +water_damage(obj, ostr, force) +struct obj *obj; +const char *ostr; +boolean force; { - register struct obj *obj = *objp, *otmp; boolean loose_obj = (obj && obj->where == OBJ_FREE), exploded = FALSE; - if (loose_obj && (obj->nobj || obj->nexthere)) { - /* [this should actually be a panic()] */ - impossible("water_damage: loose object has%s%s%s list%s?", - obj->nobj ? " nobj" : "", - (obj->nobj && obj->nexthere) ? " and" : "", - obj->nexthere ? " nexthere" : "", - (obj->nobj && obj->nexthere) ? "s" : ""); - } + (void) snuff_lit(obj); - /* Scrolls, spellbooks, potions, weapons and - pieces of armor may get affected by the water. - - [FIXME? The item transformations here lack shop price/billing - handling [costly_alteration()], which is okay as long as shops - don't contain any pools. However, that's probably not a valid - assumption; a broken fountain might spill new pools far enough - to put one inside a nearby shop, particularly if dug walls in - Minetown haven't been repaired yet. Note that water_damage() - might be getting called right now because we're in the midst - of creating such a pool, not just because one has already been - created and we've walked into it while carrying unpaid stuff.] - */ - for (; obj; obj = otmp) { - otmp = here ? obj->nexthere : obj->nobj; - - (void) snuff_lit(obj); - - if(obj->otyp == CAN_OF_GREASE && obj->spe > 0) { - continue; - } else if(obj->greased) { - if (force || !rn2(2)) obj->greased = 0; - } else if(Is_container(obj) && !Is_box(obj) && - (obj->otyp != OILSKIN_SACK || (obj->cursed && !rn2(3)))) { - water_damage(&obj->cobj, force, FALSE); - } else if (!force && (Luck + 5) > rn2(20)) { - /* chance per item of sustaining damage: - * max luck: 10% - * avg luck (Luck==0): 75% - * awful luck (Luck<-4): 100% - */ - continue; - } else if (obj->oclass == SCROLL_CLASS) { + if(obj->otyp == CAN_OF_GREASE && obj->spe > 0) { + return 0; + } else if(obj->greased) { + if (!rn2(2)) obj->greased = 0; + if (carried(obj)) update_inventory(); + return 1; + } else if(Is_container(obj) && !Is_box(obj) && + (obj->otyp != OILSKIN_SACK || (obj->cursed && !rn2(3)))) { + water_damage_chain(obj->cobj, FALSE); + return 0; + } else if (!force && (Luck + 5) > rn2(20)) { + /* chance per item of sustaining damage: + * max luck: 10% + * avg luck (Luck==0): 75% + * awful luck (Luck<-4): 100% + */ + return 0; + } else if (obj->oclass == SCROLL_CLASS) { #ifdef MAIL - if (obj->otyp == SCR_MAIL) continue; + if (obj->otyp == SCR_MAIL) return 0; #endif - obj->otyp = SCR_BLANK_PAPER; - obj->dknown = 0; - obj->spe = 0; - } else if (obj->oclass == SPBOOK_CLASS) { - if (obj->otyp == SPE_BOOK_OF_THE_DEAD) { - pline("Steam rises from %s.", the(xname(obj))); - continue; - } - obj->otyp = SPE_BLANK_PAPER; - obj->dknown = 0; - } else if (obj->oclass == POTION_CLASS) { - if (obj->otyp == POT_ACID) { - char *bufp, buf[BUFSZ]; - boolean one = (obj->quan == 1L); + obj->otyp = SCR_BLANK_PAPER; + obj->dknown = 0; + obj->spe = 0; + if (carried(obj)) + update_inventory(); + return 2; + } else if (obj->oclass == SPBOOK_CLASS) { + if (obj->otyp == SPE_BOOK_OF_THE_DEAD) { + pline("Steam rises from %s.", the(xname(obj))); + return 0; + } + obj->otyp = SPE_BLANK_PAPER; + obj->dknown = 0; + if (carried(obj)) + update_inventory(); + return 2; + } else if (obj->oclass == POTION_CLASS) { + if (obj->otyp == POT_ACID) { + char *bufp, buf[BUFSZ]; + boolean one = (obj->quan == 1L); + boolean update = carried(obj); - bufp = strcpy(buf, "potion"); - if (!one) bufp = makeplural(bufp); - /* [should we damage player/monster?] */ - pline("%s %s %s!", /* "A potion explodes!" */ - !exploded ? (one ? "A" : "Some") : - (one ? "Another" : "More"), - bufp, vtense(bufp, "explode")); - exploded = TRUE; - /* let caller know that obj has gone away - [when obj is part of a list, delobj()'s - obj_extract_self() takes care of this; - for loose_obj, obj should always equal - *objp and otmp should always be null] */ - if (loose_obj && obj == *objp) *objp = otmp; - delobj(obj); - continue; - } else if (obj->odiluted) { - obj->otyp = POT_WATER; - obj->dknown = 0; - obj->blessed = obj->cursed = 0; - obj->odiluted = 0; - } else if (obj->otyp != POT_WATER) - obj->odiluted++; - } else if (is_rustprone(obj) && obj->oeroded < MAX_ERODE && - !(obj->oerodeproof || (obj->blessed && !rnl(4)))) { - /* all metal stuff and armor except (body armor - protected by oilskin cloak) */ - if(obj->oclass != ARMOR_CLASS || obj != uarm || - !uarmc || uarmc->otyp != OILSKIN_CLOAK || - (uarmc->cursed && !rn2(3))) - obj->oeroded++; - } - } + bufp = strcpy(buf, "potion"); + if (!one) bufp = makeplural(bufp); + /* [should we damage player/monster?] */ + pline("%s %s %s!", /* "A potion explodes!" */ + !exploded ? (one ? "A" : "Some") : + (one ? "Another" : "More"), + bufp, vtense(bufp, "explode")); + exploded = TRUE; + /* let caller know that obj has gone away + [when obj is part of a list, delobj()'s + obj_extract_self() takes care of this; + for loose_obj, obj should always equal + *objp and otmp should always be null] */ + delobj(obj); + if (update) + update_inventory(); + return 3; + } else if (obj->odiluted) { + obj->otyp = POT_WATER; + obj->dknown = 0; + obj->blessed = obj->cursed = 0; + obj->odiluted = 0; + if (carried(obj)) + update_inventory(); + return 2; + } else if (obj->otyp != POT_WATER) { + obj->odiluted++; + if (carried(obj)) + update_inventory(); + return 2; + } + } else { + return rust_dmg(obj, ostr, ERODE_RUST, FALSE, FALSE) ? 2 : 0; + } + return 0; +} + +void +water_damage_chain(obj,here) +struct obj *obj; +boolean here; +{ + struct obj *otmp; + for (; obj; obj = otmp) { + otmp = here ? obj->nexthere : obj->nobj; + water_damage(obj, NULL, FALSE); + } } /* @@ -3246,7 +3253,7 @@ drown() Hallucination ? "the Titanic" : "a rock"); } - water_damage(&invent, FALSE, FALSE); + water_damage_chain(invent, FALSE); if (u.umonnum == PM_GREMLIN && rn2(3)) (void)split_mon(&youmonst, (struct monst *)0); diff --git a/src/uhitm.c b/src/uhitm.c index 1ccb8a2cb..a0f90d3de 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -30,22 +30,13 @@ static boolean override_confirmation = FALSE; #define PROJECTILE(obj) ((obj) && is_ammo(obj)) -/* modified from hurtarmor() in mhitu.c */ -/* This is not static because it is also used for monsters rusting monsters */ void -hurtmarmor(mdef, attk) +erode_armor(mdef, hurt) struct monst *mdef; -int attk; +int hurt; { - int hurt; struct obj *target; - switch(attk) { - /* 0 is burning, which we should never be called with */ - case AD_RUST: hurt = 1; break; - case AD_CORR: hurt = 3; break; - default: hurt = 2; break; - } /* What the following code does: it keeps looping until it * finds a target for the rust monster. * Head, feet, etc... not covered by metal, or covered by @@ -56,34 +47,34 @@ int attk; switch(rn2(5)) { case 0: target = which_armor(mdef, W_ARMH); - if (!target || !rust_dmg(target, xname(target), hurt, FALSE)) + if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE)) continue; break; case 1: target = which_armor(mdef, W_ARMC); if (target) { - (void)rust_dmg(target, xname(target), hurt, TRUE); + (void)rust_dmg(target, xname(target), hurt, TRUE, TRUE); break; } if ((target = which_armor(mdef, W_ARM)) != (struct obj *)0) { - (void)rust_dmg(target, xname(target), hurt, TRUE); + (void)rust_dmg(target, xname(target), hurt, TRUE, TRUE); } else if ((target = which_armor(mdef, W_ARMU)) != (struct obj *)0) { - (void)rust_dmg(target, xname(target), hurt, TRUE); + (void)rust_dmg(target, xname(target), hurt, TRUE, TRUE); } break; case 2: target = which_armor(mdef, W_ARMS); - if (!target || !rust_dmg(target, xname(target), hurt, FALSE)) + if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE)) continue; break; case 3: target = which_armor(mdef, W_ARMG); - if (!target || !rust_dmg(target, xname(target), hurt, FALSE)) + if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE)) continue; break; case 4: target = which_armor(mdef, W_ARMF); - if (!target || !rust_dmg(target, xname(target), hurt, FALSE)) + if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE)) continue; break; } @@ -1536,11 +1527,11 @@ register struct attack *mattk; pline("%s falls to pieces!", Monnam(mdef)); xkilled(mdef,0); } - hurtmarmor(mdef, AD_RUST); + erode_armor(mdef, ERODE_RUST); tmp = 0; break; case AD_CORR: - hurtmarmor(mdef, AD_CORR); + erode_armor(mdef, ERODE_CORRODE); tmp = 0; break; case AD_DCAY: @@ -1549,7 +1540,7 @@ register struct attack *mattk; pline("%s falls to pieces!", Monnam(mdef)); xkilled(mdef,0); } - hurtmarmor(mdef, AD_DCAY); + erode_armor(mdef, ERODE_ROT); tmp = 0; break; case AD_DREN: @@ -2231,7 +2222,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf && !rn2(6)) - (void)rust_dmg(uarmf, xname(uarmf), 0, TRUE); + (void)rust_dmg(uarmf, xname(uarmf), ERODE_BURN, TRUE, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2246,12 +2237,12 @@ boolean wep_was_destroyed; if (!Acid_resistance) mdamageu(mon, tmp); - if(!rn2(30)) erode_armor(&youmonst, TRUE); + if(!rn2(30)) erode_armor(&youmonst, ERODE_CORRODE); } if (mhit) { if (aatyp == AT_KICK) { if (uarmf && !rn2(6)) - (void)rust_dmg(uarmf, xname(uarmf), 3, TRUE); + (void)rust_dmg(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2284,7 +2275,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf) - (void)rust_dmg(uarmf, xname(uarmf), 1, TRUE); + (void)rust_dmg(uarmf, xname(uarmf), ERODE_RUST, TRUE, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2294,7 +2285,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf) - (void)rust_dmg(uarmf, xname(uarmf), 3, TRUE); + (void)rust_dmg(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); diff --git a/src/worn.c b/src/worn.c index 32bfe1003..a542f3be4 100644 --- a/src/worn.c +++ b/src/worn.c @@ -583,11 +583,28 @@ which_armor(mon, flag) struct monst *mon; long flag; { - register struct obj *obj; + if (mon == &youmonst) { + switch (flag) { + case W_ARM: return uarm; + case W_ARMC: return uarmc; + case W_ARMH: return uarmh; + case W_ARMS: return uarms; + case W_ARMG: return uarmg; + case W_ARMF: return uarmf; +#ifdef TOURIST + case W_ARMU: return uarmu; +#endif + default: + impossible("bad flag in which_armor"); + return 0; + } + } else { + register struct obj *obj; - for(obj = mon->minvent; obj; obj = obj->nobj) - if (obj->owornmask & flag) return obj; - return((struct obj *)0); + for(obj = mon->minvent; obj; obj = obj->nobj) + if (obj->owornmask & flag) return obj; + return((struct obj *)0); + } } /* remove an item of armor and then drop it */ diff --git a/src/zap.c b/src/zap.c index 03cbc6c52..2fb2396de 100644 --- a/src/zap.c +++ b/src/zap.c @@ -3396,7 +3396,7 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */ } tmp = d(nd,6); if (!rn2(6)) (void) erode_obj(MON_WEP(mon), 3, TRUE, FALSE); - if (!rn2(6)) erode_armor(mon, TRUE); + if (!rn2(6)) erode_armor(mon, ERODE_CORRODE); break; } if (sho_shieldeff) shieldeff(mon->mx, mon->my); @@ -3525,7 +3525,7 @@ xchar sx, sy; (void) erode_obj(uwep, 3, TRUE, FALSE); if (u.twoweap && !rn2(3)) (void) erode_obj(uswapwep, 3, TRUE, FALSE); - if (!rn2(6)) erode_armor(&youmonst, TRUE); + if (!rn2(6)) erode_armor(&youmonst, ERODE_CORRODE); break; } From 3a049cf66e0c8587c278aa90e0d9da19db587583 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Tue, 24 Feb 2015 15:20:01 -0500 Subject: [PATCH 040/354] Eliminate `erode_obj()` and other erosion. Now all erosion that isn't fire-based goes through `rust_dmg()` --- doc/fixes35.0 | 4 +- include/extern.h | 3 +- src/mhitm.c | 23 +++++---- src/mhitu.c | 25 +--------- src/potion.c | 2 +- src/spell.c | 16 +----- src/trap.c | 57 ++++++++++++++++----- src/uhitm.c | 8 +-- src/wield.c | 125 ----------------------------------------------- src/zap.c | 6 +-- 10 files changed, 73 insertions(+), 196 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 48da8da36..9dc59fa66 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -859,9 +859,11 @@ if lava burns up the player's water walking boots, the player falls in the messages for lava burning items up are always printed fix used-up magic trap trying to hit steed. messages are now printed when objects on the ground are eroded -object erosion now always identifies rust/rot/fire/corrodeproof objects +object erosion now always identifies fooproof objects grease protects from all types of erosion all sources of erosion now affect objects the same way +passive attacks no longer erode armor covered by other armor +dipping a fooproof item into acid no longer forgets that it's fooproof Platform- and/or Interface-Specific Fixes diff --git a/include/extern.h b/include/extern.h index 87d3adee7..6ca49b411 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1070,6 +1070,7 @@ E int FDECL(sleep_monst, (struct monst *,int,int)); E void FDECL(slept_monst, (struct monst *)); E void FDECL(xdrainenergym, (struct monst *,BOOLEAN_P)); E long FDECL(attk_protection, (int)); +E void FDECL(rustm, (struct monst *,struct obj *)); /* ### mhitu.c ### */ @@ -2222,6 +2223,7 @@ E void FDECL(fill_pit, (int,int)); E int FDECL(float_down, (long, long)); E void NDECL(climb_pit); E int FDECL(fire_damage, (struct obj *,BOOLEAN_P,BOOLEAN_P,XCHAR_P,XCHAR_P)); +E void acid_damage(struct obj *); E int FDECL(water_damage, (struct obj *,const char*,BOOLEAN_P)); E void FDECL(water_damage_chain, (struct obj *,BOOLEAN_P)); E boolean NDECL(drown); @@ -2516,7 +2518,6 @@ E void NDECL(uwepgone); E void NDECL(uswapwepgone); E void NDECL(uqwepgone); E void NDECL(untwoweapon); -E boolean FDECL(erode_obj, (struct obj *,int,BOOLEAN_P,BOOLEAN_P)); E int FDECL(chwepon, (struct obj *,int)); E int FDECL(welded, (struct obj *)); E void FDECL(weldmsg, (struct obj *)); diff --git a/src/mhitm.c b/src/mhitm.c index ae66279e7..31c9dba11 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -16,7 +16,6 @@ static const char brief_feeling[] = "have a %s feeling for a moment, then it passes."; STATIC_DCL char *FDECL(mon_nam_too, (char *,struct monst *,struct monst *)); -STATIC_DCL void FDECL(mrustm, (struct monst *, struct monst *, struct obj *)); STATIC_DCL int FDECL(hitmm, (struct monst *,struct monst *,struct attack *)); STATIC_DCL int FDECL(gazemm, (struct monst *,struct monst *,struct attack *)); STATIC_DCL int FDECL(gulpmm, (struct monst *,struct monst *,struct attack *)); @@ -796,7 +795,7 @@ mdamagem(magr, mdef, mattk) (grow_up(magr,mdef) ? 0 : MM_AGR_DIED)); } if (tmp) - mrustm(magr, mdef, otmp); + rustm(mdef, otmp); } } else if (pa == &mons[PM_PURPLE_WORM] && pd == &mons[PM_SHRIEKER]) { @@ -884,7 +883,7 @@ mdamagem(magr, mdef, mattk) pline("It burns %s!", mon_nam(mdef)); } if (!rn2(30)) erode_armor(mdef, ERODE_CORRODE); - if (!rn2(6)) (void) erode_obj(MON_WEP(mdef), 3, TRUE, FALSE); + if (!rn2(6)) acid_damage(MON_WEP(mdef)); break; case AD_RUST: if (magr->mcan) break; @@ -1287,24 +1286,24 @@ struct monst *mon; } } -STATIC_OVL void -mrustm(magr, mdef, obj) -register struct monst *magr, *mdef; +void +rustm(mdef, obj) +register struct monst *mdef; register struct obj *obj; { int dmgtyp; - if (!magr || !mdef || !obj) return; /* just in case */ + if (!mdef || !obj) return; /* just in case */ /* AD_ACID is handled in passivemm */ if (dmgtype(mdef->data, AD_CORR)) - dmgtyp = 3; + dmgtyp = ERODE_CORRODE; else if (dmgtype(mdef->data, AD_RUST)) - dmgtyp = 1; + dmgtyp = ERODE_RUST; else if (dmgtype(mdef->data, AD_FIRE)) - dmgtyp = 0; + dmgtyp = ERODE_BURN; else return; - (void) erode_obj(obj, dmgtyp, FALSE, FALSE); + (void) rust_dmg(obj, 0, dmgtyp, TRUE, TRUE); } STATIC_OVL void @@ -1362,7 +1361,7 @@ int mdead; } } else tmp = 0; if (!rn2(30)) erode_armor(magr, ERODE_CORRODE); - if (!rn2(6)) (void)erode_obj(MON_WEP(magr), 3, TRUE, FALSE); + if (!rn2(6)) acid_damage(MON_WEP(magr)); goto assess_dmg; case AD_ENCH: /* KMH -- remove enchantment (disenchanter) */ if (mhit && !mdef->mcan && otmp) { diff --git a/src/mhitu.c b/src/mhitu.c index cc9b6f1be..6aa4225f7 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -8,7 +8,6 @@ STATIC_VAR NEARDATA struct obj *otmp; -STATIC_DCL void FDECL(urustm, (struct monst *, struct obj *)); STATIC_DCL boolean FDECL(u_slip_free, (struct monst *,struct attack *)); STATIC_DCL int FDECL(passiveum, (struct permonst *,struct monst *,struct attack *)); @@ -920,7 +919,7 @@ hitmu(mtmp, mattk) if (cloneu()) You("divide as %s hits you!", mon_nam(mtmp)); } - urustm(mtmp, otmp); + rustm(&youmonst, otmp); } else if (mattk->aatyp != AT_TUCH || dmg != 0 || mtmp != u.ustuck) hitmsg(mtmp, mattk); @@ -2079,26 +2078,6 @@ register int n; } } -STATIC_OVL void -urustm(mon, obj) -register struct monst *mon; -register struct obj *obj; -{ - int dmgtyp; - - if (!mon || !obj) return; /* just in case */ - /* AD_ACID is handled in passiveum */ - if (dmgtype(youmonst.data, AD_CORR)) - dmgtyp = 3; - else if (dmgtype(youmonst.data, AD_RUST)) - dmgtyp = 1; - else if (dmgtype(youmonst.data, AD_FIRE)) - dmgtyp = 0; - else - return; - (void) erode_obj(obj, dmgtyp, FALSE, FALSE); -} - int could_seduce(magr,mdef,mattk) struct monst *magr, *mdef; @@ -2442,7 +2421,7 @@ register struct attack *mattk; } } else tmp = 0; if (!rn2(30)) erode_armor(mtmp, ERODE_CORRODE); - if (!rn2(6)) (void)erode_obj(MON_WEP(mtmp), 3, TRUE, FALSE); + if (!rn2(6)) acid_damage(MON_WEP(mtmp)); goto assess_dmg; case AD_STON: /* cockatrice */ { diff --git a/src/potion.c b/src/potion.c index 7542ea451..483544c2b 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1931,7 +1931,7 @@ dodip() } if (potion->otyp == POT_ACID) { - if (erode_obj(obj, 3, FALSE, TRUE)) + if (rust_dmg(obj, 0, ERODE_CORRODE, TRUE, FALSE)) goto poof; } diff --git a/src/spell.c b/src/spell.c index e1f6fc55b..5d499bf73 100644 --- a/src/spell.c +++ b/src/spell.c @@ -144,21 +144,7 @@ cursed_book(bp) case 5: pline_The("book was coated with contact poison!"); if (uarmg) { - if (uarmg->oerodeproof || !is_corrodeable(uarmg)) { - Your("gloves seem unaffected."); - } else if (uarmg->oeroded2 < MAX_ERODE) { - if (uarmg->greased) { - grease_protect(uarmg, "gloves", &youmonst); - } else { - Your("gloves corrode%s!", - uarmg->oeroded2+1 == MAX_ERODE ? - " completely" : uarmg->oeroded2 ? - " further" : ""); - uarmg->oeroded2++; - } - } else - Your("gloves %s completely corroded.", - Blind ? "feel" : "look"); + rust_dmg(uarmg, "gloves", ERODE_CORRODE, TRUE, TRUE); break; } /* temp disable in_use; death should not destroy the book */ diff --git a/src/trap.c b/src/trap.c index f6266791f..f78b7ad66 100644 --- a/src/trap.c +++ b/src/trap.c @@ -103,6 +103,8 @@ struct monst *victim; /* Generic erode-item function. Returns TRUE if any change in state * occurred, or if grease protected the item. + * "ostr", if non-null, is an alternate string to print instead of the + * object's name. * "check_grease", if FALSE, means that grease is not checked for * "print", if set, means to print a message even if no change occurs. */ @@ -165,8 +167,8 @@ boolean print; if (victim == &youmonst) Your("%s %s not affected.", ostr, vtense(ostr, "are")); else if (vismon) - pline("%s's %s %s not affected.", Monnam(victim), ostr, - vtense(ostr, "are")); + pline("%s %s %s not affected.", s_suffix(Monnam(victim)), + ostr, vtense(ostr, "are")); } return FALSE; } else if (otmp->oerodeproof || (otmp->blessed && !rnl(4))) { @@ -175,8 +177,9 @@ boolean print; pline("Somehow, your %s %s not affected.", ostr, vtense(ostr, "are")); else if (vismon) - pline("Somehow, %s's %s %s not affected.", - mon_nam(victim), ostr, vtense(ostr, "are")); + pline("Somehow, %s %s %s not affected.", + s_suffix(mon_nam(victim)), ostr, + vtense(ostr, "are")); else if (visobj) pline("Somehow, the %s %s not affected.", ostr, vtense(ostr, "are")); @@ -214,8 +217,8 @@ boolean print; vtense(ostr, Blind ? "feel" : "look"), msg[type]); else if (vismon) - pline("%s's %s %s completely %s.", - Monnam(victim), ostr, + pline("%s %s %s completely %s.", + s_suffix(Monnam(victim)), ostr, vtense(ostr, "look"), msg[type]); else if (visobj) pline("The %s %s completely %s.", ostr, @@ -952,8 +955,8 @@ unsigned trflags; if (water_damage(uarms, "shield", TRUE)) break; if (u.twoweap || (uwep && bimanual(uwep))) - (void) erode_obj(u.twoweap ? uswapwep : uwep, - 1, TRUE, FALSE); + (void) water_damage(u.twoweap ? uswapwep : uwep, 0, + TRUE); glovecheck: (void) water_damage(uarmg, "gauntlets", TRUE); /* Not "metal gauntlets" since it gets called * even if it's leather for the message @@ -962,7 +965,7 @@ glovecheck: (void) water_damage(uarmg, "gauntlets", TRUE); case 2: pline("%s your right %s!", A_gush_of_water_hits, body_part(ARM)); - (void) erode_obj(uwep, 1, TRUE, FALSE); + (void) water_damage(uwep, 0, TRUE); goto glovecheck; default: pline("%s you!", A_gush_of_water_hits); @@ -2098,7 +2101,7 @@ register struct monst *mtmp; break; target = MON_WEP(mtmp); if (target && bimanual(target)) - (void) erode_obj(target, 1, TRUE, FALSE); + (void) water_damage(target, 0, TRUE); glovecheck: target = which_armor(mtmp, W_ARMG); (void) water_damage(target, "gauntlets", TRUE); break; @@ -2106,7 +2109,7 @@ glovecheck: target = which_armor(mtmp, W_ARMG); if (in_sight) pline("%s %s's right %s!", A_gush_of_water_hits, mon_nam(mtmp), mbodypart(mtmp, ARM)); - (void) erode_obj(MON_WEP(mtmp), 1, TRUE, FALSE); + (void) water_damage(MON_WEP(mtmp), 0, TRUE); goto glovecheck; default: if (in_sight) @@ -3069,6 +3072,38 @@ xchar x, y; return retval; } +void +acid_damage(obj) +struct obj *obj; +{ + /* Scrolls but not spellbooks can be erased by acid. */ + struct monst *victim = + carried(obj) ? &youmonst : mcarried(obj) ? obj->ocarry : NULL; + boolean vismon = victim && (victim != &youmonst) && canseemon(victim); + + if (obj->greased) + grease_protect(obj, NULL, victim); + else if (obj->oclass == SCROLL_CLASS && obj->otyp != SCR_BLANK_PAPER) { + if (obj->otyp != SCR_BLANK_PAPER +#ifdef MAIL + && obj->otyp != SCR_MAIL +#endif + ) { + if (!Blind) { + if (victim == &youmonst) + pline("Your %s.", aobjnam(obj, "fade")); + else if (vismon) + pline("%s %s.", s_suffix(Monnam(victim)), + aobjnam(obj, "fade")); + } + } + obj->otyp = SCR_BLANK_PAPER; + obj->spe = 0; + obj->dknown = 0; + } else + rust_dmg(obj, NULL, ERODE_CORRODE, TRUE, TRUE); +} + /* returns: * 0 if obj is unaffected * 1 if obj is protected by grease diff --git a/src/uhitm.c b/src/uhitm.c index a0f90d3de..51f38eee0 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -2446,22 +2446,22 @@ struct attack *mattk; /* null means we find one internally */ case AD_FIRE: if(!rn2(6) && !mon->mcan) { - (void) erode_obj(obj, 0, FALSE, FALSE); + (void) rust_dmg(obj, 0, ERODE_BURN, FALSE, FALSE); } break; case AD_ACID: if(!rn2(6)) { - (void) erode_obj(obj, 3, FALSE, FALSE); + (void) rust_dmg(obj, 0, ERODE_CORRODE, FALSE, FALSE); } break; case AD_RUST: if(!mon->mcan) { - (void) erode_obj(obj, 1, FALSE, FALSE); + (void) rust_dmg(obj, 0, ERODE_RUST, FALSE, FALSE); } break; case AD_CORR: if(!mon->mcan) { - (void) erode_obj(obj, 3, FALSE, FALSE); + (void) rust_dmg(obj, 0, ERODE_CORRODE, FALSE, FALSE); } break; case AD_ENCH: diff --git a/src/wield.c b/src/wield.c index dbb5d271f..9e1447bff 100644 --- a/src/wield.c +++ b/src/wield.c @@ -597,131 +597,6 @@ untwoweapon() return; } -/* Maybe rust (or corrode, burn, rot) object. - * Returns TRUE if something happened. */ -boolean -erode_obj(target, type, fade_scrolls, for_dip) -struct obj *target; /* object (e.g. weapon or armor) to erode */ -int type; -boolean fade_scrolls; -boolean for_dip; -{ - static NEARDATA const char * const action[] = { "smoulder", "rust", "rot", "corrode" }; - static NEARDATA const char * const msg[] = { "burnt", "rusty", "rotten", "corroded" }; - boolean vulnerable = FALSE; - boolean grprot = FALSE; - boolean is_primary = TRUE; - int erosion; - int dmgtyp = AD_ACID; - struct monst *victim; - boolean vismon, visobj, chill; - boolean ret = FALSE; - boolean already_affected = FALSE; - - if (!target) - return FALSE; - victim = carried(target) ? &youmonst : - mcarried(target) ? target->ocarry : (struct monst *)0; - vismon = victim && (victim != &youmonst) && canseemon(victim); - visobj = !victim && cansee(bhitpos.x, bhitpos.y); /* assume thrown */ - - switch(type) { - case 0: vulnerable = is_flammable(target); - dmgtyp = AD_FIRE; - break; - case 1: vulnerable = is_rustprone(target); - dmgtyp = AD_RUST; - grprot = TRUE; - if (target->lamplit) { - already_affected = snuff_lit(target); - if (already_affected) ret = TRUE; - } - break; - case 2: vulnerable = is_rottable(target); - dmgtyp = AD_DCAY; - is_primary = FALSE; - break; - case 3: vulnerable = is_corrodeable(target); - dmgtyp = AD_ACID; - grprot = TRUE; - is_primary = FALSE; - break; - } - erosion = is_primary ? target->oeroded : target->oeroded2; - - if (target->greased && grprot) { - grease_protect(target,(char *)0,victim); - ret = TRUE; - } else if (target->oclass == SCROLL_CLASS && (type == 1 || type == 3)) { - if(fade_scrolls && target->otyp != SCR_BLANK_PAPER -#ifdef MAIL - && target->otyp != SCR_MAIL -#endif - ) - { - if (!Blind) { - if ((victim == &youmonst) || vismon || visobj) - pline("%s.", Yobjnam2(target, "fade")); - } - target->otyp = SCR_BLANK_PAPER; - target->spe = 0; - ret = TRUE; - } - } else if (target->oartifact && arti_immune(target, dmgtyp)) { - if (flags.verbose && (dmgtyp != AD_FIRE)) { - if (victim == &youmonst) - pline("%s.", Yobjnam2(target, "sizzle")); - } - /* no damage to object */ - } else if (target->oartifact && (type == 1) && - /* cold and fire provide partial protection against rust */ - ((chill = arti_immune(target, AD_COLD)) != 0 || - arti_immune(target, AD_FIRE)) && - /* once rusted, the chance for further rusting goes up */ - rn2(2 * (MAX_ERODE + 1 - erosion))) { - if (flags.verbose && target->oclass == WEAPON_CLASS) { - if (victim == &youmonst || vismon || visobj) - pline("%s some water.", - Yobjnam2(target, chill ? "freeze" : "boil")); - } - /* no damage to object */ - } else if (target->oerodeproof || !vulnerable) { - /* no message if dipping or not carried */ - if (for_dip) { - /* assumes that for_dip implies player action */ - if (!Blind) target->rknown = 0; - } else if (victim == &youmonst || vismon) { - if (flags.verbose || (vulnerable && !target->rknown)) - pline("%s not %s.", Yobjnam2(target, "are"), - already_affected ? "harmed" : "affected"); - if (vulnerable) target->rknown = 1; - } - } else if (erosion < MAX_ERODE) { - if (victim == &youmonst || vismon || visobj) { - pline("%s%s!", Yobjnam2(target, action[type]), - erosion+1 == MAX_ERODE ? " completely" : - erosion ? " further" : ""); - target->rknown = 1; /* it's obviously not erode-proof */ - } - if (is_primary) - target->oeroded++; - else - target->oeroded2++; - ret = TRUE; - } else { - if (flags.verbose && !for_dip) { - if (victim == &youmonst) - pline("%s completely %s.", - Yobjnam2(target, Blind ? "feel" : "look"), msg[type]); - else if (vismon || visobj) - pline("%s completely %s.", - Yobjnam2(target, "look"), msg[type]); - } - } - - return ret; -} - int chwepon(otmp, amount) register struct obj *otmp; diff --git a/src/zap.c b/src/zap.c index 2fb2396de..95b9760a3 100644 --- a/src/zap.c +++ b/src/zap.c @@ -3395,7 +3395,7 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */ break; } tmp = d(nd,6); - if (!rn2(6)) (void) erode_obj(MON_WEP(mon), 3, TRUE, FALSE); + if (!rn2(6)) acid_damage(MON_WEP(mon)); if (!rn2(6)) erode_armor(mon, ERODE_CORRODE); break; } @@ -3522,9 +3522,9 @@ xchar sx, sy; } /* using two weapons at once makes both of them more vulnerable */ if (!rn2(u.twoweap ? 3 : 6)) - (void) erode_obj(uwep, 3, TRUE, FALSE); + acid_damage(uwep); if (u.twoweap && !rn2(3)) - (void) erode_obj(uswapwep, 3, TRUE, FALSE); + acid_damage(uswapwep); if (!rn2(6)) erode_armor(&youmonst, ERODE_CORRODE); break; } From 57dcad377405dc480bd29b453dca8c362722e838 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Tue, 24 Feb 2015 15:21:30 -0500 Subject: [PATCH 041/354] Rename `rust_dmg()` to `erode_obj()`. --- include/extern.h | 2 +- src/mhitm.c | 2 +- src/potion.c | 2 +- src/spell.c | 2 +- src/trap.c | 10 +++++----- src/uhitm.c | 30 +++++++++++++++--------------- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/extern.h b/include/extern.h index 6ca49b411..f9fc3be0c 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2203,7 +2203,7 @@ E coord *FDECL(gettrack, (int,int)); /* ### trap.c ### */ E boolean FDECL(burnarmor,(struct monst *)); -E boolean FDECL(rust_dmg, (struct obj *,const char *,int,BOOLEAN_P,BOOLEAN_P)); +E boolean FDECL(erode_obj, (struct obj *,const char *,int,BOOLEAN_P,BOOLEAN_P)); E boolean FDECL(grease_protect, (struct obj *,const char *,struct monst *)); E struct trap *FDECL(maketrap, (int,int,int)); E void FDECL(fall_through, (BOOLEAN_P)); diff --git a/src/mhitm.c b/src/mhitm.c index 31c9dba11..88770c523 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1303,7 +1303,7 @@ register struct obj *obj; dmgtyp = ERODE_BURN; else return; - (void) rust_dmg(obj, 0, dmgtyp, TRUE, TRUE); + (void) erode_obj(obj, 0, dmgtyp, TRUE, TRUE); } STATIC_OVL void diff --git a/src/potion.c b/src/potion.c index 483544c2b..782fa7ace 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1931,7 +1931,7 @@ dodip() } if (potion->otyp == POT_ACID) { - if (rust_dmg(obj, 0, ERODE_CORRODE, TRUE, FALSE)) + if (erode_obj(obj, 0, ERODE_CORRODE, TRUE, FALSE)) goto poof; } diff --git a/src/spell.c b/src/spell.c index 5d499bf73..597d4e606 100644 --- a/src/spell.c +++ b/src/spell.c @@ -144,7 +144,7 @@ cursed_book(bp) case 5: pline_The("book was coated with contact poison!"); if (uarmg) { - rust_dmg(uarmg, "gloves", ERODE_CORRODE, TRUE, TRUE); + erode_obj(uarmg, "gloves", ERODE_CORRODE, TRUE, TRUE); break; } /* temp disable in_use; death should not destroy the book */ diff --git a/src/trap.c b/src/trap.c index f78b7ad66..d535fc230 100644 --- a/src/trap.c +++ b/src/trap.c @@ -55,7 +55,7 @@ struct monst *victim; int mat_idx; if (!victim) return 0; -#define burn_dmg(obj,descr) rust_dmg(obj, descr, ERODE_BURN, TRUE, FALSE) +#define burn_dmg(obj,descr) erode_obj(obj, descr, ERODE_BURN, TRUE, FALSE) while (1) { switch (rn2(5)) { case 0: @@ -109,7 +109,7 @@ struct monst *victim; * "print", if set, means to print a message even if no change occurs. */ boolean -rust_dmg(otmp, ostr, type, check_grease, print) +erode_obj(otmp, ostr, type, check_grease, print) register struct obj *otmp; register const char *ostr; int type; @@ -151,7 +151,7 @@ boolean print; is_primary = FALSE; break; default: - impossible("Invalid erosion type in rust_dmg"); + impossible("Invalid erosion type in erode_obj"); return FALSE; } erosion = is_primary ? otmp->oeroded : otmp->oeroded2; @@ -3101,7 +3101,7 @@ struct obj *obj; obj->spe = 0; obj->dknown = 0; } else - rust_dmg(obj, NULL, ERODE_CORRODE, TRUE, TRUE); + erode_obj(obj, NULL, ERODE_CORRODE, TRUE, TRUE); } /* returns: @@ -3195,7 +3195,7 @@ boolean force; return 2; } } else { - return rust_dmg(obj, ostr, ERODE_RUST, FALSE, FALSE) ? 2 : 0; + return erode_obj(obj, ostr, ERODE_RUST, FALSE, FALSE) ? 2 : 0; } return 0; } diff --git a/src/uhitm.c b/src/uhitm.c index 51f38eee0..b594fd863 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -47,34 +47,34 @@ int hurt; switch(rn2(5)) { case 0: target = which_armor(mdef, W_ARMH); - if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE)) + if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE)) continue; break; case 1: target = which_armor(mdef, W_ARMC); if (target) { - (void)rust_dmg(target, xname(target), hurt, TRUE, TRUE); + (void)erode_obj(target, xname(target), hurt, TRUE, TRUE); break; } if ((target = which_armor(mdef, W_ARM)) != (struct obj *)0) { - (void)rust_dmg(target, xname(target), hurt, TRUE, TRUE); + (void)erode_obj(target, xname(target), hurt, TRUE, TRUE); } else if ((target = which_armor(mdef, W_ARMU)) != (struct obj *)0) { - (void)rust_dmg(target, xname(target), hurt, TRUE, TRUE); + (void)erode_obj(target, xname(target), hurt, TRUE, TRUE); } break; case 2: target = which_armor(mdef, W_ARMS); - if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE)) + if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE)) continue; break; case 3: target = which_armor(mdef, W_ARMG); - if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE)) + if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE)) continue; break; case 4: target = which_armor(mdef, W_ARMF); - if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE)) + if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE)) continue; break; } @@ -2222,7 +2222,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf && !rn2(6)) - (void)rust_dmg(uarmf, xname(uarmf), ERODE_BURN, TRUE, TRUE); + (void)erode_obj(uarmf, xname(uarmf), ERODE_BURN, TRUE, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2242,7 +2242,7 @@ boolean wep_was_destroyed; if (mhit) { if (aatyp == AT_KICK) { if (uarmf && !rn2(6)) - (void)rust_dmg(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE); + (void)erode_obj(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2275,7 +2275,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf) - (void)rust_dmg(uarmf, xname(uarmf), ERODE_RUST, TRUE, TRUE); + (void)erode_obj(uarmf, xname(uarmf), ERODE_RUST, TRUE, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2285,7 +2285,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf) - (void)rust_dmg(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE); + (void)erode_obj(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2446,22 +2446,22 @@ struct attack *mattk; /* null means we find one internally */ case AD_FIRE: if(!rn2(6) && !mon->mcan) { - (void) rust_dmg(obj, 0, ERODE_BURN, FALSE, FALSE); + (void) erode_obj(obj, 0, ERODE_BURN, FALSE, FALSE); } break; case AD_ACID: if(!rn2(6)) { - (void) rust_dmg(obj, 0, ERODE_CORRODE, FALSE, FALSE); + (void) erode_obj(obj, 0, ERODE_CORRODE, FALSE, FALSE); } break; case AD_RUST: if(!mon->mcan) { - (void) rust_dmg(obj, 0, ERODE_RUST, FALSE, FALSE); + (void) erode_obj(obj, 0, ERODE_RUST, FALSE, FALSE); } break; case AD_CORR: if(!mon->mcan) { - (void) rust_dmg(obj, 0, ERODE_CORRODE, FALSE, FALSE); + (void) erode_obj(obj, 0, ERODE_CORRODE, FALSE, FALSE); } break; case AD_ENCH: From 3acd3c4a0058e72a29bc5b8e2a9b6877d23a0f1e Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Tue, 24 Feb 2015 15:26:09 -0500 Subject: [PATCH 042/354] Fold `get_wet()` into `water_damage()`. This now ensures that dipping into water works like other sources of water damage. There is a potentially significant gameplay change here: dipping a container into uncursed water will wet all its contents. If this is a problem, then we should add another parameter to water_damage which will suppress this behaviour for dipping. --- doc/fixes35.0 | 2 +- include/extern.h | 1 - src/fountain.c | 2 +- src/potion.c | 96 +----------------------------------------------- src/trap.c | 3 +- 5 files changed, 6 insertions(+), 98 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 9dc59fa66..d3f6b1a90 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -864,7 +864,7 @@ grease protects from all types of erosion all sources of erosion now affect objects the same way passive attacks no longer erode armor covered by other armor dipping a fooproof item into acid no longer forgets that it's fooproof - +dipping a container into uncursed water now gets its contents wet Platform- and/or Interface-Specific Fixes ----------------------------------------- diff --git a/include/extern.h b/include/extern.h index f9fc3be0c..4da79874d 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1726,7 +1726,6 @@ E void FDECL(healup, (int,int,BOOLEAN_P,BOOLEAN_P)); E void FDECL(strange_feeling, (struct obj *,const char *)); E void FDECL(potionhit, (struct monst *,struct obj *,BOOLEAN_P)); E void FDECL(potionbreathe, (struct obj *)); -E boolean FDECL(get_wet, (struct obj *)); E int NDECL(dodip); E void FDECL(mongrantswish, (struct monst **)); E void FDECL(djinni_from_bottle, (struct obj *)); diff --git a/src/fountain.c b/src/fountain.c index cc8aeb7bf..7de917ad9 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -402,7 +402,7 @@ register struct obj *obj; if(in_town(u.ux, u.uy)) (void) angry_guards(FALSE); return; - } else if (get_wet(obj)) { + } else if (water_damage(obj, NULL, TRUE)) { if (obj->otyp == POT_ACID) { /* Acid and water don't mix */ useup(obj); return; diff --git a/src/potion.c b/src/potion.c index 782fa7ace..4c57eaecb 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1088,7 +1088,7 @@ const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */ } else { /* dipping into uncursed water; carried() check skips steed saddle */ if (carried(targobj)) { - if (get_wet(targobj)) + if (water_damage(targobj, 0, TRUE)) res = TRUE; } } @@ -1626,98 +1626,6 @@ register struct obj *o1, *o2; return 0; } - -boolean -get_wet(obj) -register struct obj *obj; -/* returns TRUE if something happened (potion should be used up) */ -{ - if (snuff_lit(obj)) return(TRUE); - - if (obj->greased) { - grease_protect(obj,(char *)0,&youmonst); - return(FALSE); - } - - /* (Rusting shop goods ought to be charged for.) */ - switch (obj->oclass) { - case POTION_CLASS: - if (obj->otyp == POT_WATER) return FALSE; - /* KMH -- Water into acid causes an explosion */ - if (obj->otyp == POT_ACID) { - pline("It boils vigorously!"); - You("are caught in the explosion!"); - losehp(Maybe_Half_Phys(rnd(10)), "elementary chemistry", - KILLED_BY); - makeknown(obj->otyp); - update_inventory(); - return (TRUE); - } - pline("%s%s.", Yobjnam2(obj,"dilute"), - obj->odiluted ? " further" : ""); - costly_alteration(obj, COST_DILUTE); - if (obj->odiluted) { - obj->odiluted = 0; - obj->blessed = FALSE; - obj->cursed = FALSE; - obj->otyp = POT_WATER; - } else - obj->odiluted++; - update_inventory(); - return TRUE; - case SCROLL_CLASS: - if (obj->otyp != SCR_BLANK_PAPER -#ifdef MAIL - && obj->otyp != SCR_MAIL -#endif - ) { - if (!Blind) - pline_The("scroll%s %s.", - plur(obj->quan), otense(obj, "fade")); - costly_alteration(obj, COST_ERASE); - obj->otyp = SCR_BLANK_PAPER; - obj->spe = 0; - update_inventory(); - return TRUE; - } else break; - case SPBOOK_CLASS: - if (obj->otyp != SPE_BLANK_PAPER) { - - if (obj->otyp == SPE_BOOK_OF_THE_DEAD) { - pline( - "%s suddenly heats up; steam rises and it remains dry.", - The(xname(obj))); - } else { - if (!Blind) - pline_The("spellbook%s %s.", - plur(obj->quan), - otense(obj, "fade")); - costly_alteration(obj, COST_ERASE); - obj->otyp = SPE_BLANK_PAPER; - update_inventory(); - } - return TRUE; - } - break; - case WEAPON_CLASS: - /* Just "fall through" to generic rustprone check for now. */ - /* fall through */ - default: - if (!obj->oerodeproof && is_rustprone(obj) && - (obj->oeroded < MAX_ERODE) && !rn2(2)) { - pline("%s some%s.", - Yobjnam2(obj, "rust"), - obj->oeroded ? " more" : "what"); - obj->oeroded++; - update_inventory(); - return TRUE; - } - break; - } - pline("%s wet.", Yobjnam2(obj, "get")); - return FALSE; -} - int dodip() { @@ -1756,7 +1664,7 @@ dodip() rider_cant_reach(); /* not skilled enough to reach */ } else { if (obj->otyp == POT_ACID) obj->in_use = 1; - (void) get_wet(obj); + (void) water_damage(obj, 0, TRUE); if (obj->in_use) useup(obj); } return 1; diff --git a/src/trap.c b/src/trap.c index d535fc230..6a5cb3755 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3118,7 +3118,8 @@ boolean force; { boolean loose_obj = (obj && obj->where == OBJ_FREE), exploded = FALSE; - (void) snuff_lit(obj); + if (snuff_lit(obj)) + return 2; if(obj->otyp == CAN_OF_GREASE && obj->spe > 0) { return 0; From 777328bd5c7de7c19eaf8513fd3f6ed629a00d99 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sun, 1 Mar 2015 11:54:40 -0500 Subject: [PATCH 043/354] Merge fire-based erosion to common codepaths. This finally eliminates all direct increases of `oeroded` and `oeroded2` and moves them all to go via `erode_obj()`. They are still manipulated directly in a few places, but not to erode objects. This now merges the `fire_damage()` function to a common codepath, used for items on lava and burning oil, but fire needs more work. There is still a duplication between `destroy_item()` and `fire_damage()`; the two codepaths should eventually be merged in some manner so that there is only one codepath to say "an object was affected by fire". This path might require some parameters, such as whether the fire will just erode objects or burn them outright, but that can happen another day. --- include/extern.h | 5 +- include/hack.h | 3 + include/obj.h | 13 +++ src/do.c | 4 +- src/dokick.c | 3 +- src/fountain.c | 2 +- src/mhitm.c | 2 +- src/mkobj.c | 2 +- src/mon.c | 4 +- src/potion.c | 30 +---- src/spell.c | 3 +- src/trap.c | 294 +++++++++++++++++++++++++++-------------------- src/uhitm.c | 38 +++--- 13 files changed, 226 insertions(+), 177 deletions(-) diff --git a/include/extern.h b/include/extern.h index 4da79874d..0bd3aab7b 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2202,7 +2202,7 @@ E coord *FDECL(gettrack, (int,int)); /* ### trap.c ### */ E boolean FDECL(burnarmor,(struct monst *)); -E boolean FDECL(erode_obj, (struct obj *,const char *,int,BOOLEAN_P,BOOLEAN_P)); +E int FDECL(erode_obj, (struct obj *,const char *,int,int)); E boolean FDECL(grease_protect, (struct obj *,const char *,struct monst *)); E struct trap *FDECL(maketrap, (int,int,int)); E void FDECL(fall_through, (BOOLEAN_P)); @@ -2221,7 +2221,8 @@ E void NDECL(float_up); E void FDECL(fill_pit, (int,int)); E int FDECL(float_down, (long, long)); E void NDECL(climb_pit); -E int FDECL(fire_damage, (struct obj *,BOOLEAN_P,BOOLEAN_P,XCHAR_P,XCHAR_P)); +E boolean FDECL(fire_damage, (struct obj *,BOOLEAN_P,XCHAR_P,XCHAR_P)); +E int FDECL(fire_damage_chain, (struct obj *,BOOLEAN_P,BOOLEAN_P,XCHAR_P,XCHAR_P)); E void acid_damage(struct obj *); E int FDECL(water_damage, (struct obj *,const char*,BOOLEAN_P)); E void FDECL(water_damage_chain, (struct obj *,BOOLEAN_P)); diff --git a/include/hack.h b/include/hack.h index 0ace170e5..7c6af5b18 100644 --- a/include/hack.h +++ b/include/hack.h @@ -99,6 +99,9 @@ #define COST_BITE 13 /* start eating food */ #define COST_OPEN 14 /* open tin */ #define COST_BRKLCK 15 /* break box/chest's lock */ +#define COST_RUST 16 /* rust damage */ +#define COST_ROT 17 /* rotting attack */ +#define COST_CORRODE 18 /* acid damage */ /* bitmask flags for corpse_xname(); PFX_THE takes precedence over ARTICLE, NO_PFX takes precedence over both */ diff --git a/include/obj.h b/include/obj.h index 12b1fce35..fe43d0878 100644 --- a/include/obj.h +++ b/include/obj.h @@ -325,6 +325,19 @@ struct obj { #define ERODE_ROT 2 #define ERODE_CORRODE 3 +/* erosion flags for erode_obj() */ +#define EF_NONE 0 +#define EF_GREASE 0x1 /* check for a greased object */ +#define EF_DESTROY 0x2 /* potentially destroy the object */ +#define EF_VERBOSE 0x4 /* print extra messages */ +#define EF_PAY 0x8 /* it's the player's fault */ + +/* erosion return values for erode_obj(), water_damage() */ +#define ER_NOTHING 0 /* nothing happened */ +#define ER_GREASED 1 /* protected by grease */ +#define ER_DAMAGED 2 /* object was damaged in some way */ +#define ER_DESTROYED 3 /* object was destroyed */ + /* * Notes for adding new oextra structures: * diff --git a/src/do.c b/src/do.c index 319317bf5..30cfb77f1 100644 --- a/src/do.c +++ b/src/do.c @@ -184,7 +184,7 @@ const char *verb; newsym(x,y); return TRUE; } else if (is_lava(x, y)) { - return fire_damage(obj, FALSE, FALSE, x, y); + return fire_damage(obj, FALSE, x, y); } else if (is_pool(x, y)) { /* Reasonably bulky objects (arbitrary) splash when dropped. * If you're floating above the water even small things make @@ -201,7 +201,7 @@ const char *verb; map_background(x, y, 0); newsym(x, y); } - return water_damage(obj, NULL, FALSE) == 3; + return water_damage(obj, NULL, FALSE) == ER_DESTROYED; } else if (u.ux == x && u.uy == y && (t = t_at(x,y)) != 0 && uteetering_at_seen_pit(t)) { if (Blind && !Deaf) diff --git a/src/dokick.c b/src/dokick.c index c399f6bbc..645eb5cf2 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -983,7 +983,8 @@ dokick() if(!rn2(3)) goto ouch; /* make metal boots rust */ if(uarmf && rn2(3)) - if (!water_damage(uarmf, "metal boots", TRUE)) { + if (water_damage(uarmf, "metal boots", TRUE) == + ER_NOTHING) { Your("boots get wet."); /* could cause short-lived fumbling here */ } diff --git a/src/fountain.c b/src/fountain.c index 7de917ad9..482b0ed76 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -402,7 +402,7 @@ register struct obj *obj; if(in_town(u.ux, u.uy)) (void) angry_guards(FALSE); return; - } else if (water_damage(obj, NULL, TRUE)) { + } else if (water_damage(obj, NULL, TRUE) != ER_NOTHING) { if (obj->otyp == POT_ACID) { /* Acid and water don't mix */ useup(obj); return; diff --git a/src/mhitm.c b/src/mhitm.c index 88770c523..6ec4b9833 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1303,7 +1303,7 @@ register struct obj *obj; dmgtyp = ERODE_BURN; else return; - (void) erode_obj(obj, 0, dmgtyp, TRUE, TRUE); + (void) erode_obj(obj, NULL, dmgtyp, EF_GREASE | EF_VERBOSE); } STATIC_OVL void diff --git a/src/mkobj.c b/src/mkobj.c index 5c7cffb7c..ddfa363d4 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -502,7 +502,7 @@ static const char * const alteration_verbs[] = { "cancel", "drain", "uncharge", "unbless", "uncurse", "disenchant", "degrade", "dilute", "erase", "burn", "neutralize", "destroy", "splatter", "bite", "open", - "break the lock on", + "break the lock on", "rust", "rot", "tarnish" }; /* possibly bill for an object which the player has just modified */ diff --git a/src/mon.c b/src/mon.c index 1c2009a0b..f229cd399 100644 --- a/src/mon.c +++ b/src/mon.c @@ -373,8 +373,8 @@ register struct monst *mtmp; pline("%s burns slightly.", Monnam(mtmp)); } if (mtmp->mhp > 0) { - (void) fire_damage(mtmp->minvent, FALSE, FALSE, - mtmp->mx, mtmp->my); + (void) fire_damage_chain(mtmp->minvent, FALSE, FALSE, mtmp->mx, + mtmp->my); (void) rloc(mtmp, FALSE); return 0; } diff --git a/src/potion.c b/src/potion.c index 4c57eaecb..d4bfcdad3 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1088,7 +1088,7 @@ const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */ } else { /* dipping into uncursed water; carried() check skips steed saddle */ if (carried(targobj)) { - if (water_damage(targobj, 0, TRUE)) + if (water_damage(targobj, 0, TRUE) != ER_NOTHING) res = TRUE; } } @@ -1839,38 +1839,14 @@ dodip() } if (potion->otyp == POT_ACID) { - if (erode_obj(obj, 0, ERODE_CORRODE, TRUE, FALSE)) + if (erode_obj(obj, 0, ERODE_CORRODE, EF_GREASE) != ER_NOTHING) goto poof; } if (potion->otyp == POT_OIL) { boolean wisx = FALSE; if (potion->lamplit) { /* burning */ - int omat = objects[obj->otyp].oc_material; - /* the code here should be merged with fire_damage */ - if (catch_lit(obj)) { - /* catch_lit does all the work if true */ - } else if (obj->oerodeproof || obj_resists(obj, 5, 95) || - !is_flammable(obj) || obj->oclass == FOOD_CLASS) { - pline("%s %s to burn for a moment but %s unharmed.", - Yname2(obj), otense(obj, "seem"), otense(obj, "are")); - } else { - if ((omat == PLASTIC || omat == PAPER) && !obj->oartifact) - obj->oeroded = MAX_ERODE; - pline_The("burning oil %s %s%c", - obj->oeroded == MAX_ERODE ? "destroys" : "damages", - yname(obj), - obj->oeroded == MAX_ERODE ? '!' : '.'); - costly_alteration(obj, COST_BURN); - if (obj->oeroded == MAX_ERODE) { - if (obj->owornmask) remove_worn_item(obj, TRUE); - obj_extract_self(obj); - obfree(obj, (struct obj *)0); - obj = (struct obj *) 0; - } else { - obj->oeroded++; - } - } + fire_damage(obj, TRUE, u.ux, u.uy); } else if (potion->cursed) { pline_The("potion spills and covers your %s with oil.", makeplural(body_part(FINGER))); diff --git a/src/spell.c b/src/spell.c index 597d4e606..53b8626f0 100644 --- a/src/spell.c +++ b/src/spell.c @@ -144,7 +144,8 @@ cursed_book(bp) case 5: pline_The("book was coated with contact poison!"); if (uarmg) { - erode_obj(uarmg, "gloves", ERODE_CORRODE, TRUE, TRUE); + erode_obj(uarmg, "gloves", ERODE_CORRODE, + EF_GREASE | EF_VERBOSE); break; } /* temp disable in_use; death should not destroy the book */ diff --git a/src/trap.c b/src/trap.c index 6a5cb3755..77b1f92c4 100644 --- a/src/trap.c +++ b/src/trap.c @@ -55,7 +55,7 @@ struct monst *victim; int mat_idx; if (!victim) return 0; -#define burn_dmg(obj,descr) erode_obj(obj, descr, ERODE_BURN, TRUE, FALSE) +#define burn_dmg(obj,descr) erode_obj(obj, descr, ERODE_BURN, EF_GREASE) while (1) { switch (rn2(5)) { case 0: @@ -101,31 +101,34 @@ struct monst *victim; #undef burn_dmg } -/* Generic erode-item function. Returns TRUE if any change in state - * occurred, or if grease protected the item. +/* Generic erode-item function. * "ostr", if non-null, is an alternate string to print instead of the * object's name. - * "check_grease", if FALSE, means that grease is not checked for - * "print", if set, means to print a message even if no change occurs. + * "type" is an ERODE_* value for the erosion type + * "flags" is an or-ed list of EF_* flags + * + * Returns an erosion return value (ER_*) */ -boolean -erode_obj(otmp, ostr, type, check_grease, print) +int +erode_obj(otmp, ostr, type, ef_flags) register struct obj *otmp; register const char *ostr; int type; -boolean check_grease; -boolean print; +int ef_flags; { static NEARDATA const char * const action[] = { "smoulder", "rust", "rot", "corrode" }; static NEARDATA const char * const msg[] = { "burnt", "rusted", "rotten", "corroded" }; boolean vulnerable = FALSE; boolean is_primary = TRUE; + boolean check_grease = ef_flags & EF_GREASE; + boolean print = ef_flags & EF_VERBOSE; int erosion; struct monst *victim; boolean vismon; boolean visobj; + int cost_type; - if (!otmp) return(FALSE); + if (!otmp) return ER_NOTHING; victim = carried(otmp) ? &youmonst : mcarried(otmp) ? otmp->ocarry : NULL; @@ -137,22 +140,26 @@ boolean print; case ERODE_BURN: vulnerable = is_flammable(otmp); check_grease = FALSE; + cost_type = COST_BURN; break; case ERODE_RUST: vulnerable = is_rustprone(otmp); + cost_type = COST_RUST; break; case ERODE_ROT: vulnerable = is_rottable(otmp); check_grease = FALSE; is_primary = FALSE; + cost_type = COST_ROT; break; case ERODE_CORRODE: vulnerable = is_corrodeable(otmp); is_primary = FALSE; + cost_type = COST_CORRODE; break; default: impossible("Invalid erosion type in erode_obj"); - return FALSE; + return ER_NOTHING; } erosion = is_primary ? otmp->oeroded : otmp->oeroded2; @@ -161,7 +168,7 @@ boolean print; if (check_grease && otmp->greased) { grease_protect(otmp, ostr, victim); - return TRUE; + return ER_GREASED; } else if (!vulnerable || (otmp->oerodeproof && otmp->rknown)) { if (print && flags.verbose) { if (victim == &youmonst) @@ -170,7 +177,7 @@ boolean print; pline("%s %s %s not affected.", s_suffix(Monnam(victim)), ostr, vtense(ostr, "are")); } - return FALSE; + return ER_NOTHING; } else if (otmp->oerodeproof || (otmp->blessed && !rnl(4))) { if (flags.verbose && (print || otmp->oerodeproof)) { if (victim == &youmonst) @@ -188,9 +195,13 @@ boolean print; * is blessed, it still shows some minor signs of wear, and * the hero can distinguish this from an object that is * actually proof against damage. */ - if (otmp->oerodeproof) + if (otmp->oerodeproof) { otmp->rknown = TRUE; - return FALSE; + if (victim == &youmonst) + update_inventory(); + } + + return ER_NOTHING; } else if (erosion < MAX_ERODE) { const char *adverb = (erosion + 1 == MAX_ERODE) ? " completely" : erosion ? " further" : ""; @@ -198,19 +209,39 @@ boolean print; if (victim == &youmonst) Your("%s %s%s!", ostr, vtense(ostr, action[type]), adverb); else if (vismon) - pline("%s's %s %s%s!", Monnam(victim), ostr, + pline("%s %s %s%s!", s_suffix(Monnam(victim)), ostr, vtense(ostr, action[type]), adverb); else if (visobj) pline("The %s %s%s!", ostr, vtense(ostr, action[type]), adverb); + if (ef_flags & EF_PAY) + costly_alteration(otmp, cost_type); + if (is_primary) otmp->oeroded++; else otmp->oeroded2++; - update_inventory(); - return TRUE; - } else { + if (victim == &youmonst) + update_inventory(); + + return ER_DAMAGED; + } else if (ef_flags & EF_DESTROY) { + if (victim == &youmonst) + Your("%s %s away!", ostr, vtense(ostr, action[type])); + else if (vismon) + pline("%s %s %s away!", s_suffix(Monnam(victim)), ostr, + vtense(ostr, action[type])); + else if (visobj) + pline("The %s %s away!", ostr, vtense(ostr, action[type])); + + if (ef_flags & EF_PAY) + costly_alteration(otmp, cost_type); + + setnotworn(otmp); + delobj(otmp); + return ER_DESTROYED; + } else { if (flags.verbose && print) { if (victim == &youmonst) Your("%s %s completely %s.", ostr, @@ -224,7 +255,7 @@ boolean print; pline("The %s %s completely %s.", ostr, vtense(ostr, "look"), msg[type]); } - return FALSE; + return ER_NOTHING; } } @@ -952,7 +983,7 @@ unsigned trflags; case 1: pline("%s your left %s!", A_gush_of_water_hits, body_part(ARM)); - if (water_damage(uarms, "shield", TRUE)) + if (water_damage(uarms, "shield", TRUE) != ER_NOTHING) break; if (u.twoweap || (uwep && bimanual(uwep))) (void) water_damage(u.twoweap ? uswapwep : uwep, 0, @@ -2097,7 +2128,7 @@ register struct monst *mtmp; pline("%s %s's left %s!", A_gush_of_water_hits, mon_nam(mtmp), mbodypart(mtmp, ARM)); target = which_armor(mtmp, W_ARMS); - if (water_damage(target, "shield", TRUE)) + if (water_damage(target, "shield", TRUE) != ER_NOTHING) break; target = MON_WEP(mtmp); if (target && bimanual(target)) @@ -2972,104 +3003,118 @@ domagictrap() } } -/* - * Scrolls, spellbooks, potions, and flammable items - * may get affected by the fire. +/* Set an item on fire. + * "force" means not to roll a luck-based protection check for the + * item. + * "x" and "y" are the coordinates to dump the contents of a + * container, if it burns up. * - * Return number of objects destroyed. --ALI + * Return whether the object was destroyed. */ -int -fire_damage(chain, force, here, x, y) -struct obj *chain; -boolean force, here; +boolean +fire_damage(obj, force, x, y) +struct obj *obj; +boolean force; xchar x, y; { int chance; - struct obj *obj, *otmp, *nobj, *ncobj; + struct obj *otmp, *ncobj; int retval = 0; int in_sight = !Blind && couldsee(x, y); /* Don't care if it's lit */ int dindx; + /* object might light in a controlled manner */ + if (catch_lit(obj)) + return FALSE; + + if (Is_container(obj)) { + switch (obj->otyp) { + case ICE_BOX: + return FALSE; /* Immune */ + case CHEST: + chance = 40; + break; + case LARGE_BOX: + chance = 30; + break; + default: + chance = 20; + break; + } + if ((!force && (Luck + 5) > rn2(chance)) || + (is_flammable(obj) && obj->oerodeproof)) + return FALSE; + /* Container is burnt up - dump contents out */ + if (in_sight) pline("%s catches fire and burns.", Yname2(obj)); + if (Has_contents(obj)) { + if (in_sight) pline("Its contents fall out."); + for (otmp = obj->cobj; otmp; otmp = ncobj) { + ncobj = otmp->nobj; + obj_extract_self(otmp); + if (!flooreffects(otmp, x, y, "")) + place_object(otmp, x, y); + } + } + setnotworn(obj); + delobj(obj); + return TRUE; + } else if (!force && (Luck + 5) > rn2(20)) { + /* chance per item of sustaining damage: + * max luck (Luck==13): 10% + * avg luck (Luck==0): 75% + * awful luck (Luck<-4): 100% + */ + return FALSE; + } else if (obj->oclass == SCROLL_CLASS || obj->oclass == SPBOOK_CLASS) { + if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL) + return FALSE; + if (obj->otyp == SPE_BOOK_OF_THE_DEAD) { + if (in_sight) pline("Smoke rises from %s.", the(xname(obj))); + return FALSE; + } + dindx = (obj->oclass == SCROLL_CLASS) ? 3 : 4; + if (in_sight) + pline("%s %s.", Yname2(obj), + destroy_strings[dindx][(obj->quan > 1L)]); + setnotworn(obj); + delobj(obj); + return TRUE; + } else if (obj->oclass == POTION_CLASS) { + dindx = (obj->otyp != POT_OIL) ? 1 : 2; + if (in_sight) + pline("%s %s.", Yname2(obj), + destroy_strings[dindx][(obj->quan > 1L)]); + setnotworn(obj); + delobj(obj); + return TRUE; + } else if (erode_obj(obj, NULL, ERODE_BURN, EF_DESTROY) == ER_DESTROYED) { + return TRUE; + } + return FALSE; +} + +/* + * Apply fire_damage() to an entire chain. + * + * Return number of objects destroyed. --ALI + */ +int +fire_damage_chain(chain, force, here, x, y) +struct obj *chain; +boolean force, here; +xchar x, y; +{ + struct obj *obj, *nobj; + int num = 0; for (obj = chain; obj; obj = nobj) { nobj = here ? obj->nexthere : obj->nobj; - - /* object might light in a controlled manner */ - if (catch_lit(obj)) - continue; - - if (Is_container(obj)) { - switch (obj->otyp) { - case ICE_BOX: - continue; /* Immune */ - /*NOTREACHED*/ - break; - case CHEST: - chance = 40; - break; - case LARGE_BOX: - chance = 30; - break; - default: - chance = 20; - break; - } - if ((!force && (Luck + 5) > rn2(chance)) || - (is_flammable(obj) && obj->oerodeproof)) - continue; - /* Container is burnt up - dump contents out */ - if (in_sight) pline("%s catches fire and burns.", Yname2(obj)); - if (Has_contents(obj)) { - if (in_sight) pline("Its contents fall out."); - for (otmp = obj->cobj; otmp; otmp = ncobj) { - ncobj = otmp->nobj; - obj_extract_self(otmp); - if (!flooreffects(otmp, x, y, "")) - place_object(otmp, x, y); - } - } - delobj(obj); - retval++; - } else if (!force && (Luck + 5) > rn2(20)) { - /* chance per item of sustaining damage: - * max luck (Luck==13): 10% - * avg luck (Luck==0): 75% - * awful luck (Luck<-4): 100% - */ - continue; - } else if (obj->oclass == SCROLL_CLASS || obj->oclass == SPBOOK_CLASS) { - if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL) - continue; - if (obj->otyp == SPE_BOOK_OF_THE_DEAD) { - if (in_sight) pline("Smoke rises from %s.", the(xname(obj))); - continue; - } - dindx = (obj->oclass == SCROLL_CLASS) ? 3 : 4; - if (in_sight) - pline("%s %s.", Yname2(obj), - destroy_strings[dindx][(obj->quan > 1L)]); - delobj(obj); - retval++; - } else if (obj->oclass == POTION_CLASS) { - dindx = (obj->otyp != POT_OIL) ? 1 : 2; - if (in_sight) - pline("%s %s.", Yname2(obj), - destroy_strings[dindx][(obj->quan > 1L)]); - delobj(obj); - retval++; - } else if (is_flammable(obj) && obj->oeroded < MAX_ERODE && - !(obj->oerodeproof || (obj->blessed && !rnl(4)))) { - if (in_sight) { - pline("%s %s%s.", Yname2(obj), otense(obj, "burn"), - obj->oeroded+1 == MAX_ERODE ? " completely" : - obj->oeroded ? " further" : ""); - } - obj->oeroded++; - } + if (fire_damage(obj, force, x, y)) + ++num; } - if (retval && !in_sight) + if (num && (Blind && !couldsee(x, y))) You("smell smoke."); - return retval; + return num; } void @@ -3101,14 +3146,14 @@ struct obj *obj; obj->spe = 0; obj->dknown = 0; } else - erode_obj(obj, NULL, ERODE_CORRODE, TRUE, TRUE); + erode_obj(obj, NULL, ERODE_CORRODE, EF_GREASE | EF_VERBOSE); } -/* returns: - * 0 if obj is unaffected - * 1 if obj is protected by grease - * 2 if obj is changed but survived - * 3 if obj is destroyed +/* Get an object wet and damage it appropriately. + * "ostr", if present, is used instead of the object name in some + * messages. + * "force" means not to roll luck to protect some objects. + * Returns an erosion return value (ER_*) */ int water_damage(obj, ostr, force) @@ -3119,25 +3164,25 @@ boolean force; boolean loose_obj = (obj && obj->where == OBJ_FREE), exploded = FALSE; if (snuff_lit(obj)) - return 2; + return ER_DAMAGED; if(obj->otyp == CAN_OF_GREASE && obj->spe > 0) { - return 0; + return ER_NOTHING; } else if(obj->greased) { if (!rn2(2)) obj->greased = 0; if (carried(obj)) update_inventory(); - return 1; + return ER_GREASED; } else if(Is_container(obj) && !Is_box(obj) && (obj->otyp != OILSKIN_SACK || (obj->cursed && !rn2(3)))) { water_damage_chain(obj->cobj, FALSE); - return 0; + return ER_NOTHING; } else if (!force && (Luck + 5) > rn2(20)) { /* chance per item of sustaining damage: * max luck: 10% * avg luck (Luck==0): 75% * awful luck (Luck<-4): 100% */ - return 0; + return ER_NOTHING; } else if (obj->oclass == SCROLL_CLASS) { #ifdef MAIL if (obj->otyp == SCR_MAIL) return 0; @@ -3147,7 +3192,7 @@ boolean force; obj->spe = 0; if (carried(obj)) update_inventory(); - return 2; + return ER_DAMAGED; } else if (obj->oclass == SPBOOK_CLASS) { if (obj->otyp == SPE_BOOK_OF_THE_DEAD) { pline("Steam rises from %s.", the(xname(obj))); @@ -3157,7 +3202,7 @@ boolean force; obj->dknown = 0; if (carried(obj)) update_inventory(); - return 2; + return ER_DAMAGED; } else if (obj->oclass == POTION_CLASS) { if (obj->otyp == POT_ACID) { char *bufp, buf[BUFSZ]; @@ -3177,10 +3222,11 @@ boolean force; obj_extract_self() takes care of this; for loose_obj, obj should always equal *objp and otmp should always be null] */ + setnotworn(obj); delobj(obj); if (update) update_inventory(); - return 3; + return ER_DESTROYED; } else if (obj->odiluted) { obj->otyp = POT_WATER; obj->dknown = 0; @@ -3188,17 +3234,17 @@ boolean force; obj->odiluted = 0; if (carried(obj)) update_inventory(); - return 2; + return ER_DAMAGED; } else if (obj->otyp != POT_WATER) { obj->odiluted++; if (carried(obj)) update_inventory(); - return 2; + return ER_DAMAGED; } } else { - return erode_obj(obj, ostr, ERODE_RUST, FALSE, FALSE) ? 2 : 0; + return erode_obj(obj, ostr, ERODE_RUST, EF_NONE); } - return 0; + return ER_NOTHING; } void diff --git a/src/uhitm.c b/src/uhitm.c index b594fd863..21de567e5 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -47,34 +47,38 @@ int hurt; switch(rn2(5)) { case 0: target = which_armor(mdef, W_ARMH); - if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE)) + if (!target || + erode_obj(target, xname(target), hurt, EF_GREASE) == ER_NOTHING) continue; break; case 1: target = which_armor(mdef, W_ARMC); if (target) { - (void)erode_obj(target, xname(target), hurt, TRUE, TRUE); + (void)erode_obj(target, xname(target), hurt, EF_GREASE | EF_VERBOSE); break; } if ((target = which_armor(mdef, W_ARM)) != (struct obj *)0) { - (void)erode_obj(target, xname(target), hurt, TRUE, TRUE); + (void)erode_obj(target, xname(target), hurt, EF_GREASE | EF_VERBOSE); } else if ((target = which_armor(mdef, W_ARMU)) != (struct obj *)0) { - (void)erode_obj(target, xname(target), hurt, TRUE, TRUE); + (void)erode_obj(target, xname(target), hurt, EF_GREASE | EF_VERBOSE); } break; case 2: target = which_armor(mdef, W_ARMS); - if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE)) + if (!target || + erode_obj(target, xname(target), hurt, EF_GREASE) == ER_NOTHING) continue; break; case 3: target = which_armor(mdef, W_ARMG); - if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE)) + if (!target || + erode_obj(target, xname(target), hurt, EF_GREASE) == ER_NOTHING) continue; break; case 4: target = which_armor(mdef, W_ARMF); - if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE)) + if (!target || + erode_obj(target, xname(target), hurt, EF_GREASE) == ER_NOTHING) continue; break; } @@ -2222,7 +2226,8 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf && !rn2(6)) - (void)erode_obj(uarmf, xname(uarmf), ERODE_BURN, TRUE, TRUE); + (void)erode_obj(uarmf, xname(uarmf), ERODE_BURN, + EF_GREASE | EF_VERBOSE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2242,7 +2247,8 @@ boolean wep_was_destroyed; if (mhit) { if (aatyp == AT_KICK) { if (uarmf && !rn2(6)) - (void)erode_obj(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE); + (void)erode_obj(uarmf, xname(uarmf), ERODE_CORRODE, + EF_GREASE | EF_VERBOSE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2275,7 +2281,8 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf) - (void)erode_obj(uarmf, xname(uarmf), ERODE_RUST, TRUE, TRUE); + (void)erode_obj(uarmf, xname(uarmf), ERODE_RUST, + EF_GREASE | EF_VERBOSE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2285,7 +2292,8 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf) - (void)erode_obj(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE); + (void)erode_obj(uarmf, xname(uarmf), ERODE_CORRODE, + EF_GREASE | EF_VERBOSE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2446,22 +2454,22 @@ struct attack *mattk; /* null means we find one internally */ case AD_FIRE: if(!rn2(6) && !mon->mcan) { - (void) erode_obj(obj, 0, ERODE_BURN, FALSE, FALSE); + (void) erode_obj(obj, NULL, ERODE_BURN, EF_NONE); } break; case AD_ACID: if(!rn2(6)) { - (void) erode_obj(obj, 0, ERODE_CORRODE, FALSE, FALSE); + (void) erode_obj(obj, NULL, ERODE_CORRODE, EF_NONE); } break; case AD_RUST: if(!mon->mcan) { - (void) erode_obj(obj, 0, ERODE_RUST, FALSE, FALSE); + (void) erode_obj(obj, NULL, ERODE_RUST, EF_NONE); } break; case AD_CORR: if(!mon->mcan) { - (void) erode_obj(obj, 0, ERODE_CORRODE, FALSE, FALSE); + (void) erode_obj(obj, NULL, ERODE_CORRODE, EF_NONE); } break; case AD_ENCH: From bd62873ee25a50c9bef3fbf95fcc39c2c0240efd Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sun, 1 Mar 2015 12:02:38 -0500 Subject: [PATCH 044/354] Print lava item destructions only if surviving. This partially reverts commit 72c2ae233d35076adece2e8d02a7f8839e4a5aa8 in order to prevent players from using hangups during the destruction messages to save themselves. --- src/trap.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/trap.c b/src/trap.c index 77b1f92c4..7efe8db00 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 trap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 trap.c $NHDT-Date: 1425318721 2015/03/02 17:52:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.194 $ */ /* NetHack 3.5 trap.c $Date: 2013/03/14 01:58:21 $ $Revision: 1.179 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -4737,6 +4737,9 @@ lava_effects() } else You("fall into the lava!"); + usurvive = Lifesaved || discover; + if (wizard) usurvive = TRUE; + /* prevent remove_worn_item() -> Boots_off(WATER_WALKING_BOOTS) -> spoteffects() -> lava_effects() recursion which would successfully delete (via useupall) the no-longer-worn boots; @@ -4748,16 +4751,18 @@ lava_effects() obj2 = obj->nobj; /* above, we set in_use for objects which are to be destroyed */ if (obj->otyp == SPE_BOOK_OF_THE_DEAD && !Blind) { - pline("%s glows a strange %s, but remains intact.", - The(xname(obj)), hcolor("dark red")); + if (usurvive) + pline("%s glows a strange %s, but remains intact.", + The(xname(obj)), hcolor("dark red")); } else if (obj->in_use) { if (obj->owornmask) { - pline("%s into flame!", Yobjnam2(obj, "burst")); + if (usurvive) + pline("%s into flame!", Yobjnam2(obj, "burst")); remove_worn_item(obj, TRUE); } useupall(obj); } - } + } iflags.in_lava_effects--; From d829b92f0e58d18c78c8b857d2eaae6a05f58351 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 2 Mar 2015 20:10:18 +0200 Subject: [PATCH 045/354] Sanitize petnames and fruit to prevent escape codes --- doc/fixes35.0 | 1 + src/options.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index d3f6b1a90..1e31bf65a 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -865,6 +865,7 @@ all sources of erosion now affect objects the same way passive attacks no longer erode armor covered by other armor dipping a fooproof item into acid no longer forgets that it's fooproof dipping a container into uncursed water now gets its contents wet +sanitize petnames and fruit to prevent escape codes Platform- and/or Interface-Specific Fixes ----------------------------------------- diff --git a/src/options.c b/src/options.c index 54ad99efc..229c2df91 100644 --- a/src/options.c +++ b/src/options.c @@ -1300,6 +1300,7 @@ boolean tinitial, tfrom_file; if (negated) bad_negation(fullname, FALSE); else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) nmcpy(catname, op, PL_PSIZ); + sanitize_name(catname); return; } @@ -1309,6 +1310,7 @@ boolean tinitial, tfrom_file; if (negated) bad_negation(fullname, FALSE); else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) nmcpy(dogname, op, PL_PSIZ); + sanitize_name(dogname); return; } @@ -1318,6 +1320,7 @@ boolean tinitial, tfrom_file; if (negated) bad_negation(fullname, FALSE); else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) nmcpy(horsename, op, PL_PSIZ); + sanitize_name(horsename); return; } @@ -1662,6 +1665,7 @@ boolean tinitial, tfrom_file; } goodfruit: nmcpy(pl_fruit, op, PL_FSIZ); + sanitize_name(pl_fruit); /* OBJ_NAME(objects[SLIME_MOLD]) won't work after initialization */ if (!*pl_fruit) nmcpy(pl_fruit, "slime mold", PL_FSIZ); From 748d9ea55b74c92d17226b3b36f91c73170238ae Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 2 Mar 2015 20:21:34 +0200 Subject: [PATCH 046/354] Fix segfault when MD termcap is not defined --- win/tty/termcap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/win/tty/termcap.c b/win/tty/termcap.c index 563491c48..b06a9abfe 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -847,6 +847,7 @@ init_hilite() hilites[CLR_GRAY] = hilites[NO_COLOR] = (char *)0; if (tgetnum("Co") < 8 + || (MD == NULL) || (strlen(MD) == 0) || ((setf = tgetstr("AF", (char **)0)) == (char *)0 && (setf = tgetstr("Sf", (char **)0)) == (char *)0)) return; From f64e530bff1bc35146e1eb947db6b7127f9e0259 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Mon, 2 Mar 2015 13:11:24 -0500 Subject: [PATCH 047/354] Make a few fixes to code that was confusing indent --- src/dog.c | 18 +++++++----------- src/end.c | 2 +- src/mon.c | 3 ++- sys/msdos/pctiles.c | 4 ++-- sys/msdos/vidvga.c | 9 +++++---- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/dog.c b/src/dog.c index ff7dd525d..d8ab09e4f 100644 --- a/src/dog.c +++ b/src/dog.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 dog.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dog.c $NHDT-Date: 1425319883 2015/03/02 18:11:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.39 $ */ /* NetHack 3.5 dog.c $Date: 2011/04/15 01:55:42 $ $Revision: 1.37 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -295,16 +295,12 @@ boolean with_you; num_segs = mtmp->wormno; /* baby long worms have no tail so don't use is_longworm() */ - if ((mtmp->data == &mons[PM_LONG_WORM]) && -#ifdef DCC30_BUG - (mtmp->wormno = get_wormno(), mtmp->wormno != 0)) -#else - (mtmp->wormno = get_wormno()) != 0) -#endif - { - initworm(mtmp, num_segs); - /* tail segs are not yet initialized or displayed */ - } else mtmp->wormno = 0; + if (mtmp->data == &mons[PM_LONG_WORM]) { + mtmp->wormno = get_wormno(); + if (mtmp->wormno) + initworm(mtmp, num_segs); + } else + mtmp->wormno = 0; /* some monsters might need to do something special upon arrival _after_ the current level has been fully set up; see dochug() */ diff --git a/src/end.c b/src/end.c index f7e7f5ec3..995ef8ec7 100644 --- a/src/end.c +++ b/src/end.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 end.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 end.c $NHDT-Date: 1425319883 2015/03/02 18:11:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.81 $ */ /* NetHack 3.5 end.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.79 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mon.c b/src/mon.c index f229cd399..82457199a 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mon.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mon.c $NHDT-Date: 1425319883 2015/03/02 18:11:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.137 $ */ /* NetHack 3.5 mon.c $Date: 2012/05/16 02:15:10 $ $Revision: 1.126 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -32,6 +32,7 @@ STATIC_DCL struct permonst *FDECL(accept_newcham_form, (int)); /* part of the original warning code which was replaced in 3.3.1 */ const char *warnings[] = { "white", "pink", "red", "ruby", "purple", "black" +}; #endif /* 0 */ STATIC_DCL struct obj *FDECL(make_corpse,(struct monst *, unsigned)); diff --git a/sys/msdos/pctiles.c b/sys/msdos/pctiles.c index e60c26f7a..fb294067a 100644 --- a/sys/msdos/pctiles.c +++ b/sys/msdos/pctiles.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 pctiles.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pctiles.c $NHDT-Date: 1425319883 2015/03/02 18:11:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.5 $ */ /* NetHack 3.5 pctiles.c $Date: 2009/05/06 10:49:39 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)pctiles.c 3.5 1995/07/31 */ /* Copyright (c) NetHack PC Development Team 1993, 1994 */ @@ -241,7 +241,7 @@ char (*pta)[TILE_X]; long fpos; fpos = ((long)(tilenum) * (long)(TILE_Y * TILE_X) + - (long)TIBHEADER_SIZE; + (long)TIBHEADER_SIZE); if (fseek(tilefile,fpos,SEEK_SET)) { return 1; } else { diff --git a/sys/msdos/vidvga.c b/sys/msdos/vidvga.c index 0784cf007..e93810fea 100644 --- a/sys/msdos/vidvga.c +++ b/sys/msdos/vidvga.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 vidvga.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vidvga.c $NHDT-Date: 1425319884 2015/03/02 18:11:24 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */ /* NetHack 3.5 vidvga.c $Date: 2009/05/06 10:49:50 $ $Revision: 1.9 $ */ /* SCCS Id: @(#)vidvga.c 3.5 2006/07/08 */ /* Copyright (c) NetHack PC Development Team 1995 */ @@ -627,12 +627,13 @@ boolean left; for (y = 0; y < ROWNO; ++y) { for (x = i; x < j; x += 2) { t = map[y][x].glyph; - if (!ReadPlanarTileFile(glyph2tile[t], &planecell)) + if (!ReadPlanarTileFile(glyph2tile[t], &planecell)) { if (map[y][x].special) decal_planar(planecell, map[y][x].special); vga_DisplayCell(planecell, x - clipx, y + TOP_MAP_ROW); - else + } else { pline("vga_shiftmap: Error reading tile (%d,%d)", - t, glyph2tile[t]); + t, glyph2tile[t]); + } } } } From 9da976f004e2ec22921772a802623fc31a4ccdd2 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 2 Mar 2015 20:34:25 +0200 Subject: [PATCH 048/354] Fix TTY crashing when a location has more than 32k items --- include/wintty.h | 12 ++++++------ win/tty/wintty.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/wintty.h b/include/wintty.h index 507804a9f..76007ed3f 100644 --- a/include/wintty.h +++ b/include/wintty.h @@ -29,9 +29,9 @@ struct WinDesc { xchar type; /* type of window */ boolean active; /* true if window is active */ short offx, offy; /* offset from topleft of display */ - short rows, cols; /* dimensions */ - short curx, cury; /* current cursor position */ - short maxrow, maxcol; /* the maximum size used -- for MENU wins */ + long rows, cols; /* dimensions */ + long curx, cury; /* current cursor position */ + long maxrow, maxcol; /* the maximum size used -- for MENU wins */ /* maxcol is also used by WIN_MESSAGE for */ /* tracking the ^P command */ short *datlen; /* allocation size for *data */ @@ -39,9 +39,9 @@ struct WinDesc { char *morestr; /* string to display instead of default */ tty_menu_item *mlist; /* menu information (MENU) */ tty_menu_item **plist; /* menu page pointers (MENU) */ - short plist_size; /* size of allocated plist (MENU) */ - short npages; /* number of pages in menu (MENU) */ - short nitems; /* total number of items (MENU) */ + long plist_size; /* size of allocated plist (MENU) */ + long npages; /* number of pages in menu (MENU) */ + long nitems; /* total number of items (MENU) */ short how; /* menu mode - pick 1 or N (MENU) */ char menu_ch; /* menu char (MENU) */ }; diff --git a/win/tty/wintty.c b/win/tty/wintty.c index a526897b7..67b0243d4 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1997,7 +1997,7 @@ tty_putstr(window, attr, str) register struct WinDesc *cw = 0; register char *ob; register const char *nb; - register int i, j, n0; + register long i, j, n0; /* Assume there's a real problem if the window is missing -- * probably a panic message @@ -2375,7 +2375,7 @@ tty_end_menu(window, prompt) if (cw->npages > 1) { char buf[QBUFSZ]; /* produce the largest demo string */ - Sprintf(buf, "(%d of %d) ", cw->npages, cw->npages); + Sprintf(buf, "(%ld of %ld) ", cw->npages, cw->npages); len = strlen(buf); cw->morestr = copy_of(""); } else { From 23f213bc63bada1a4ae39c98988721cbe4717d74 Mon Sep 17 00:00:00 2001 From: keni Date: Mon, 2 Mar 2015 16:32:29 -0500 Subject: [PATCH 049/354] Fix NHtext when GIT_DIR is not defined. --- DEVEL/hooksdir/NHtext | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DEVEL/hooksdir/NHtext b/DEVEL/hooksdir/NHtext index 861b9e6b1..0cc065db3 100755 --- a/DEVEL/hooksdir/NHtext +++ b/DEVEL/hooksdir/NHtext @@ -15,6 +15,13 @@ use strict; sub git_config { my($section, $var) = @_; local($_); + # Sigh. Without GIT_DIR we have to do it the slow way, and sometimes we don't + # have GIT_DIR. + if(0 == length($ENV{GIT_DIR})){ + my $raw = `git config --local --get $section.$var`; + chomp($raw); + return $raw + } open(CONFIG, "<", "$ENV{GIT_DIR}/config") or die "Missing .git/config: $!"; while(){ m/^\[$section]/ && do { From 4a0935114ccf390d7e9e20d1decdfad63e247902 Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 3 Mar 2015 20:13:51 -0500 Subject: [PATCH 050/354] Updated README On 3/1/2015 10:37 AM, coppro wrote: > >> Sun SPARC based machine running SunOS 4.x, Solaris 2.x, or > Solaris 7 > > By release time, I should have access to a BSD flavour installed on a SPARC > machine. Would out be helpful for me to do cursory tests? On 3/1/2015 10:41 AM, lorimer wrote: > I have access to a Borland environment too, so I'll be > borrowing that at some point. [Just not soon.] I didn't include the above, just in case they don't happen. The README can, of course, be updated again once they have been tried. --- README | 162 +++++++++++++++++++++++---------------------------------- 1 file changed, 64 insertions(+), 98 deletions(-) diff --git a/README b/README index e38bf2e83..1d4b8063d 100644 --- a/README +++ b/README @@ -1,18 +1,27 @@ - NetHack 3.5.0 -- General information + NetHack 3.6.0 -- General information -NetHack 3.5 is an enhancement to the dungeon exploration game NetHack. +NetHack 3.6 is an enhancement to the dungeon exploration game NetHack. It is a distant descendent of Rogue and Hack, and a direct descendent of -NetHack 3.4. +NetHack 3.4. In order to avoid confusion with interim development code +that was posted online in 2014 by others, there is no NetHack 3.5 release. -NetHack 3.5.0 has many new features. - * List new features here +NetHack 3.6.0 contains some code reorganization, new features, and bugfixes. -A fuller list of changes for this release can be found in the file -doc/fixes35.0 in the source distribution. The text in there was written -for the development team's own use and is provided "as is", so please do -not ask us to further explain the entries in that file. +The file doc/fixes36.0 in the source disribution has a full list of each. +The text in there was written for the development team's own use and is +provided "as is", so please do not ask us to further explain the entries +in that file. Some entries might be considered "spoilers", particularly +in the "new features" section. + +Here are some additional general notes that are not considered spoilers: + * Some code paths and long-established game features have been made + part of the base build and no longer conditional on compile settings. + * Save files and bones files should be compatible across platforms and + machine architectures. + * The following treasured NetHack community patches, or a variation of + them, have been rolled in to the base NetHack source tree: menucolors, + pickup thrown, statue glyphs, . -If you are a developer, please see the file DEVEL/Developer.txt. - - - - - - - - - - - Please read items (1), (2) and (3) BEFORE doing anything with your new code. @@ -21,64 +30,28 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. directory as the 'Top' directory. It makes no difference what you call it. -2. If there is no flaw in the packaging, many sub-directories will be - automatically created, and files will be deposited in them: +2. Having unpacked, you should have a file called 'Files' in your Top + directory. - a. A 'dat' directory, which contains a variety of data files. - b. A 'doc' directory, which contains various documentation. - c. An 'include' directory, which contains *.h files. - d. A 'src' directory, which contains game *.c files used by all versions. - e. A 'util' directory, which contains files for utility programs. - f. A 'sys' directory, which contains subdirectories for files that - are operating-system specific. - g. A 'sys/share' subdirectory, which contains files shared by some OSs. - h. A 'sys/share/sounds' subsubdirectory, which contains sound files - shared by some OSs. - i. A 'sys/amiga' subdirectory, which contains files specific to AmigaDOS. - j. A 'sys/atari' subdirectory, which contains files specific to TOS. - k. A 'sys/be' subdirectory, which contains files specific to Be OS. - l. A 'sys/mac' subdirectory, which contains files specific to MacOS. - m. A 'sys/msdos' subdirectory, which contains files specific to MS-DOS. - n. A 'sys/os2' subdirectory, which contains files specific to OS/2. - o. A 'sys/unix' subdirectory, which contains files specific to UNIX. - p. A 'sys/vms' subdirectory, which contains files specific to VMS. - q. A 'sys/wince' subdirectory, which contains files specific to Windows CE. - r. A 'sys/wince/ceinc' subdirectory; header files for Windows CE - s. A 'sys/wince/ceinc/sys' subdirectory; ditto - t. A 'sys/winnt' subdirectory, which contains files specific to Windows NT. - u. A 'win' directory, which contains subdirectories for files that - are windowing-system specific (but not operating-system specific). - v. A 'win/share' subdirectory, which contains files shared by some - windowing systems. - w. A 'win/Qt' subdirectory, which contains files specific to Qt. - x. A 'win/X11' subdirectory, which contains files specific to X11. - y. A 'win/gem' subdirectory, which contains files specific to GEM. - z. A 'win/gnome' subdirectory, which contains files specific to GNOME. - A. A 'win/tty' subdirectory, which contains files specific to ttys. - B. A 'win/win32' subdirectory, which contains files specific to the - Windows Win32 API. - C. A 'DEVEL' directory, which contains files for NetHack developers. - - The names of these directories should not be changed unless you are - ready to go through the makefiles and the makedefs program and change - all the directory references in them. - -3. Having unpacked, you should have a file called 'Files' in your Top - directory. This file contains the list of all the files you now SHOULD + This file contains the list of all the files you now SHOULD have in each directory. Please check the files in each directory against this list to make sure that you have a complete set. -4. Before you do anything else, please read carefully the file called + This file also contains a list of what files are created during + the build process. + + The names of the directories listed should not be changed unless you + are ready to go through the makefiles and the makedefs program and change + all the directory references in them. + +3. Before you do anything else, please read carefully the file called "license" in the 'dat' subdirectory. It is expected that you comply with the terms of that license, and we are very serious about it. -5. If everything is in order, you can now turn to trying to get the program +4. If everything is in order, you can now turn to trying to get the program to compile and run on your particular system. It is worth mentioning that the default configuration is SysV/Sun/Solaris2.x (simply because - the code was housed on such a system). It is also worth mentioning - here that NetHack 3.5 is a huge program. If you intend to run it on a - small machine, you'll have to make hard choices among the options - available in config.h. + the code was housed on such a system). The files sys/*/Install.* were written to guide you in configuring the program for your operating system. The files win/*/Install.* are @@ -86,21 +59,21 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. for particular windowing environments. Reading them, and the man pages, should answer most of your questions. - At the time of this release, NetHack 3.5 is known to run/compile on: + At the time of this release, NetHack 3.6 has been tested to run/compile on: - Intel 80386 or greater (or clone) boxes running Linux, BSDI, or - Windows NT/XP/2000/2003/2008 - Intel Pentium or better (or clone) running BeOS 4.5 + Intel Pentium or better (or clone) running Linux, BSDI, or + Windows (XP through 8.1) + Intel 80386 or greater (or clone) boxes running Linux, or BSDI Sun SPARC based machine running SunOS 4.x, Solaris 2.x, or Solaris 7 + Mac OS X 10.9 should be added to the list. - - Previous versions of NetHack were tested on the following systems, - and with a little work we expect that NetHack 3.5 will work on them - as well: + Previous versions of NetHack were tested and known to run on the + following systems, but it is unknown if they can still build and + execute NetHack 3.6: Apple Macintosh running MacOS 7.5 or higher, LinuxPPC, BeOS 4.0 Atari ST/TT/Falcon running TOS (or MultiTOS) with GCC - AT&T 3B1 running System V (3.51) + AT&T 3B1 running System V (3.61) AT&T 3B2/600 & 3B2/622 running System V R3.2.1 AT&T 3B2/1000 Model 80 running System V R3.2.2 AT&T 3B4000 running System V @@ -116,14 +89,18 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. Gould NP1 running UTX 3/2 HP 9000s300 running HP-UX HP 9000s700 running HP-UX 9.x, 10.x, 11.x + H/PC Pro devices running Windows CE 2.11 and higher. IBM PC/RT and RS/6000 running AIX 3.x IBM PS/2 and AT compatibles running OS/2 - 2.0 and up with GCC emx IBM PS/2 and AT compatibles running OS/2 1.1 - 2.0 (and probably Warp) with Microsoft 6.0, and OS/2 2.0 and up with IBM CSet++ 2.0. Intel 80386 or greater (or clone) running 386BSD Intel 80386 or greater (or clone) boxes running MS-DOS with DPMI. + Intel x86 running version of Windows prior to XP. Mips M2000 running RiscOS 4.1 NeXT running Mach (using BSD configuration) + Palm Size PC 1.1 devices running Windows CE 2.11 + Pocket PC devices running Windows CE 3.0 and higher Pyramid 9820x running OSx 4.4c SGI Iris running IRIX Stardent Vistra 800 running SysV R4.0 @@ -135,54 +112,43 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. Unless otherwise mentioned, the compiler used was the OS-vendor's C compiler. - NetHack 3.5 may also run on the following, but a cross-compiler hosted - on another platform, such as win32, would be required to build from - source. - - Pocket PC devices running Windows CE 3.0 and higher - H/PC Pro devices running Windows CE 2.11 and higher. - Palm Size PC 1.1 devices running Windows CE 2.11 - - The sources necessary to build an 80286 DOS "real mode" overlaid version - are still included in the source distribution, so if someone has access - to a real-mode compiler and lots of spare time on their hands, you may - be able to get things working. Of course you do so at your own risk. - - - - - - - - - - - - If you have problems building the game, or you find bugs in it, we recommend filing a bug report from our "Contact Us" web page at: http://www.nethack.org/ +A public repository of the latest NetHack code that we've made +available can be obtained via git here: + + When sending correspondence, please observe the following: o Please be sure to include your machine type, OS, and patchlevel. -o Never send us binary files (e.g. save files or bones files). Whichever - platform you are using, only a small minority of the development team has - access to it, and you will rapidly annoy the others. If you have found - a bug and think that your save file would aid in solving the problem, - send us a description in words of the problem, your machine type, your - operating system, and the version of NetHack. Tell us that you have a - save file, but do not actually send it. - In the rare case that we think your save file would be helpful, you will - be contacted by a member of the development team with the address of a - specific person to send the save file to. +o Please avoid sending us binary files (e.g. save files or bones files). + If you have found a bug and think that your save file would aid in solving + the problem, send us a description in words of the problem, your machine + type, your operating system, and the version of NetHack. Tell us that you + have a save file, but do not actually send it. + You may then be contacted by a member of the development team with the + address of a specific person to send the save file to. o Though we make an effort to reply to each bug report, it may take some time before you receive feedback. This is especially true during the period immediately after a new release, when we get the most bug reports. o We don't give hints for playing the game. -o Don't bother to ask when the next version will be out. You will not get - a reply. +o Don't bother to ask when the next version will be out, or expect a + stock answer. -If you don't have access to the world wide web, or if you want to submit -a patch for the NetHack source code via email directly, you can direct it -to this address: +If you want to submit a patch for the NetHack source code via email directly, +you can direct it to this address: nethack-bugs (at) nethack.org If a feature is not accepted you are free, of course, to post the patches to the net yourself and let the marketplace decide their worth. All of this amounts to the following: If you decide to apply a free-lanced -patch to your 3.5 code, you are on your own. In our own patches, we will -assume that your code is synchronized with ours. +patch to your 3.6 code, you are welcome to do so, of course, but we won't +be able to provide support or receive bug reports for it. + +In our own patches, we will assume that your code is synchronized with ours. -- Good luck, and happy Hacking -- From e37d4224b3decfc78937b09ab6a88865f4fc6ba8 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 5 Mar 2015 14:03:56 +0200 Subject: [PATCH 051/354] Fix data.base entries -"bat" overrode later "combat" entry. -"gelatinous cube" and "jack boot" have their own entries. -"vampire bat" matched twice; use the bat entry. -dagger attribution started with spaces instead of tabs. --- dat/data.base | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dat/data.base b/dat/data.base index 67fca7aba..0c9f493b0 100644 --- a/dat/data.base +++ b/dat/data.base @@ -429,6 +429,7 @@ barbed devil Barbed devils lack any real special abilities, though they are quite difficult to kill. # takes "bat or bird" when specifying 'B' +~combat *bat bat or bird A bat, flitting in the darkness outside, took the wrong turn @@ -511,7 +512,6 @@ blind io own. Several were currently hovering above the table. [ The Colour of Magic, by Terry Pratchett ] * blob -gelatinous cube ooze * ooze *pudding @@ -548,6 +548,7 @@ candelabrum* Because it is Saint Peter's holy day. (Enter all the Friars to sing the dirge) [ Doctor Faustus and Other Plays, by Christopher Marlowe ] +~*jack*boot* *boot* In Fantasyland these are remarkable in that they seldom or never wear out and are suitable for riding or walking in @@ -1101,7 +1102,7 @@ cyclops Proceeding from the heat-oppressed brain? I see thee yet, in form as palpable As this which now I draw. - [ Macbeth, by William Shakespeare ] + [ Macbeth, by William Shakespeare ] dark one ... But he ruled rather by force and fear, if they might avail; and those who perceived his shadow spreading over the @@ -5157,7 +5158,7 @@ valkyrie Nations, by Herbert Robinson and Knox Wilson ] vampire -vampire bat +~vampire bat vampire lord The Oxford English Dictionary is quite unequivocal: _vampire_ - "a preternatural being of a malignant nature (in From 40851d2e6931288010bf83ae336d7d5e739dc3d0 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 5 Mar 2015 14:21:21 +0200 Subject: [PATCH 052/354] Add database entry for shuriken --- dat/data.base | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dat/data.base b/dat/data.base index 0c9f493b0..31d9360be 100644 --- a/dat/data.base +++ b/dat/data.base @@ -4503,6 +4503,14 @@ shrieker its fetid bulk looming overhead... The monster was some kind of great dark worm, but that was about all they were sure of. [ The Adventurers, Epic IV, by Thomas A. Miller ] +shuriken + You know, that's what I hate most about fighting against magic: + you never know what they're trying to do to you until it hits. + The sorceress knew what hit her, however. Two of the shuriken + got past whatever defenses she had. One caught her just below + the throat, the other in the middle of her chest. It wouldn't + kill her, but she wouldn't be fighting anyone for a while. + [ Jhereg, Steven Brust ] skeleton A skeleton is a magically animated undead creature. Unlike shades, only a humanoid creature can be used to create a From c427f450ca73b5b2ba77beae7910425d8ce20c45 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 5 Mar 2015 14:22:19 +0200 Subject: [PATCH 053/354] Fix shuriken attribution --- dat/data.base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dat/data.base b/dat/data.base index 31d9360be..1da1c54dd 100644 --- a/dat/data.base +++ b/dat/data.base @@ -4510,7 +4510,7 @@ shuriken got past whatever defenses she had. One caught her just below the throat, the other in the middle of her chest. It wouldn't kill her, but she wouldn't be fighting anyone for a while. - [ Jhereg, Steven Brust ] + [ Jhereg, by Steven Brust ] skeleton A skeleton is a magically animated undead creature. Unlike shades, only a humanoid creature can be used to create a From cc25d29490b79690cfc0c1b1b713a33d928c51f8 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 5 Mar 2015 14:23:23 +0200 Subject: [PATCH 054/354] Make shuriken entry also match throwing star. --- dat/data.base | 1 + 1 file changed, 1 insertion(+) diff --git a/dat/data.base b/dat/data.base index 1da1c54dd..409d5eba4 100644 --- a/dat/data.base +++ b/dat/data.base @@ -4503,6 +4503,7 @@ shrieker its fetid bulk looming overhead... The monster was some kind of great dark worm, but that was about all they were sure of. [ The Adventurers, Epic IV, by Thomas A. Miller ] +throwing star shuriken You know, that's what I hate most about fighting against magic: you never know what they're trying to do to you until it hits. From 4cc13161631fb50e0ee35c8c4a957846eeda18f0 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 5 Mar 2015 16:15:40 +0200 Subject: [PATCH 055/354] Add database entry for fedora --- dat/data.base | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dat/data.base b/dat/data.base index 409d5eba4..9fa99e08f 100644 --- a/dat/data.base +++ b/dat/data.base @@ -1571,6 +1571,12 @@ eyes of the overworld Usually, there is nothing to be seen. However, the wearer is also able to look back and see the area around herself, much like looking on a map. Why anyone would want to ... +fedora + Some hats can only be worn if you're willing to be jaunty, to set + them at an angle and to walk beneath them with a spring in your + stride as if you're only a step away from dancing. They demand a + lot of you. + [ Anansi Boys, by Neil Gaiman ] figurine* Then it appeared in Paris at just about the time that Paris was full of Carlists who had to get out of Spain. One of From 44c0534a97028dfc86634c1a7868bbdce8793658 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 5 Mar 2015 16:34:16 +0200 Subject: [PATCH 056/354] Add database entry for land mine --- dat/data.base | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dat/data.base b/dat/data.base index 9fa99e08f..6bca23177 100644 --- a/dat/data.base +++ b/dat/data.base @@ -2774,6 +2774,12 @@ lance evil plight. [ Don Quixote of La Mancha, by Miquel de Cervantes Saavedra ] +land mine + Your heart is intact, your brain is not badly damaged, but the rest + of your injuries are comparable to stepping on a land mine. You'd + never walk again, and you'd be in great pain. You would come to + wish you had not survived. + [ Steel Beach, by John Varley ] *lantern While pretending to be a fancy safety lamp, it is in fact battery powered. A discreet little switch is marked "on/off" From e9a03fd09427f361fa91804885975ece696628a8 Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 5 Mar 2015 20:45:17 -0500 Subject: [PATCH 057/354] Fix some README mistakes that Janet spotted --- README | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/README b/README index 1d4b8063d..a2ee7cf40 100644 --- a/README +++ b/README @@ -7,7 +7,7 @@ that was posted online in 2014 by others, there is no NetHack 3.5 release. NetHack 3.6.0 contains some code reorganization, new features, and bugfixes. -The file doc/fixes36.0 in the source disribution has a full list of each. +The file doc/fixes36.0 in the source distribution has a full list of each. The text in there was written for the development team's own use and is provided "as is", so please do not ask us to further explain the entries in that file. Some entries might be considered "spoilers", particularly @@ -17,7 +17,7 @@ Here are some additional general notes that are not considered spoilers: * Some code paths and long-established game features have been made part of the base build and no longer conditional on compile settings. * Save files and bones files should be compatible across platforms and - machine architectures. + machine architectures . * The following treasured NetHack community patches, or a variation of them, have been rolled in to the base NetHack source tree: menucolors, pickup thrown, statue glyphs, . @@ -64,8 +64,7 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. Intel Pentium or better (or clone) running Linux, BSDI, or Windows (XP through 8.1) Intel 80386 or greater (or clone) boxes running Linux, or BSDI - Sun SPARC based machine running SunOS 4.x, Solaris 2.x, or Solaris 7 - Mac OS X 10.9 should be added to the list. + Mac OS X 10.9 Previous versions of NetHack were tested and known to run on the following systems, but it is unknown if they can still build and @@ -73,7 +72,7 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. Apple Macintosh running MacOS 7.5 or higher, LinuxPPC, BeOS 4.0 Atari ST/TT/Falcon running TOS (or MultiTOS) with GCC - AT&T 3B1 running System V (3.61) + AT&T 3B1 running System V (3.51) AT&T 3B2/600 & 3B2/622 running System V R3.2.1 AT&T 3B2/1000 Model 80 running System V R3.2.2 AT&T 3B4000 running System V @@ -96,7 +95,7 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. Warp) with Microsoft 6.0, and OS/2 2.0 and up with IBM CSet++ 2.0. Intel 80386 or greater (or clone) running 386BSD Intel 80386 or greater (or clone) boxes running MS-DOS with DPMI. - Intel x86 running version of Windows prior to XP. + Intel x86 running a version of Windows prior to XP. Mips M2000 running RiscOS 4.1 NeXT running Mach (using BSD configuration) Palm Size PC 1.1 devices running Windows CE 2.11 @@ -107,8 +106,15 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. Stride 460 running UniStride 2.1 Sun-3s, -4s, and -386is running SunOS 3.x Sun-3s and -386is running SunOS 4.x + Sun SPARC based machine running SunOS 4.x, Solaris 2.x, or Solaris 7 Valid Logic Systems SCALD-System + Previous versions, using a cross-compiler hosted on another platform, such as + win32, could also build the following from source: + Pocket PC devices running Windows CE 3.0 and higher + H/PC Pro devices running Windows CE 2.11 and higher + Palm Size PC 1.1 devices running Windows CE 2.11 + Unless otherwise mentioned, the compiler used was the OS-vendor's C compiler. @@ -135,8 +141,8 @@ o Though we make an effort to reply to each bug report, it may take some time before you receive feedback. This is especially true during the period immediately after a new release, when we get the most bug reports. o We don't give hints for playing the game. -o Don't bother to ask when the next version will be out, or expect a - stock answer. +o Don't bother to ask when the next version will be out or you can expect + to receive a stock answer. If you want to submit a patch for the NetHack source code via email directly, you can direct it to this address: From f2ab8f336b859701208784f9ef9a80142bdcf37c Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 6 Mar 2015 21:01:02 +0200 Subject: [PATCH 058/354] You_hear already checks deafness --- src/dig.c | 2 +- src/lock.c | 4 ++-- src/mon.c | 10 +++++----- src/music.c | 2 +- src/pray.c | 3 +-- src/trap.c | 9 +++------ src/zap.c | 14 ++++++-------- 7 files changed, 19 insertions(+), 25 deletions(-) diff --git a/src/dig.c b/src/dig.c index 39791dde0..1c053ec73 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1245,7 +1245,7 @@ register struct monst *mtmp; if (IS_WALL(here->typ)) { /* KMH -- Okay on arboreal levels (room walls are still stone) */ - if (!Deaf && flags.verbose && !rn2(5)) + if (flags.verbose && !rn2(5)) You_hear("crashing rock."); if (*in_rooms(mtmp->mx, mtmp->my, SHOPBASE)) add_damage(mtmp->mx, mtmp->my, 0L); diff --git a/src/lock.c b/src/lock.c index 67a11a545..91e0f0728 100644 --- a/src/lock.c +++ b/src/lock.c @@ -888,7 +888,7 @@ int x, y; else if (flags.verbose) { if (cansee(x,y)) pline("KABOOM!! You see a door explode."); - else if (!Deaf) + else You_hear("a distant explosion."); } door->doormask = D_NODOOR; @@ -901,7 +901,7 @@ int x, y; if (flags.verbose) { if (cansee(x,y)) pline_The("door crashes open!"); - else if (!Deaf) + else You_hear("a crashing sound."); } unblock_point(x,y); diff --git a/src/mon.c b/src/mon.c index 82457199a..49f6282dc 100644 --- a/src/mon.c +++ b/src/mon.c @@ -638,7 +638,7 @@ meatmetal(mtmp) if (cansee(mtmp->mx,mtmp->my) && flags.verbose) pline("%s eats %s!", Monnam(mtmp), distant_name(otmp,doname)); - else if (!Deaf && flags.verbose) + else if (flags.verbose) You_hear("a crunching sound."); mtmp->meating = otmp->owt/2 + 1; /* Heal up to the object's weight in hp */ @@ -758,7 +758,7 @@ meatobj(mtmp) /* for gelatinous cubes */ if (cansee(mtmp->mx,mtmp->my) && flags.verbose) pline("%s eats %s!", Monnam(mtmp), distant_name(otmp, doname)); - else if (!Deaf && flags.verbose) + else if (flags.verbose) You_hear("a slurping sound."); /* Heal up to the object's weight in hp */ if (mtmp->mhp < mtmp->mhpmax) { @@ -803,7 +803,7 @@ meatobj(mtmp) /* for gelatinous cubes */ if (ecount > 0) { if (cansee(mtmp->mx, mtmp->my) && flags.verbose && buf[0]) pline1(buf); - else if (!Deaf && flags.verbose) + else if (flags.verbose) You_hear("%s slurping sound%s.", ecount == 1 ? "a" : "several", ecount == 1 ? "" : "s"); @@ -1642,7 +1642,7 @@ boolean was_swallowed; /* digestion */ s_suffix(mdat->mname)); losehp(Maybe_Half_Phys(tmp), killer.name, KILLED_BY_AN); } else { - if (!Deaf) You_hear("an explosion."); + You_hear("an explosion."); magr->mhp -= tmp; if (magr->mhp < 1) mondied(magr); if (magr->mhp < 1) { /* maybe lifesaved */ @@ -3106,7 +3106,7 @@ register boolean silent; else if(!Blind) You_see("%sangry guard%s approaching!", sct == 1 ? "an " : "", sct > 1 ? "s" : ""); - } else if(!Deaf) + } else You_hear("the shrill sound of a guard's whistle."); } return(TRUE); diff --git a/src/music.c b/src/music.c index 94f6282d1..0912d78cc 100644 --- a/src/music.c +++ b/src/music.c @@ -334,7 +334,7 @@ do_pit: chasm = maketrap(x,y,PIT); if (!m_already_trapped) { /* suppress messages */ if(cansee(x,y)) pline("%s falls into a chasm!", Monnam(mtmp)); - else if (!Deaf && humanoid(mtmp->data)) + else if (humanoid(mtmp->data)) You_hear("a scream!"); } /* Falling is okay for falling down diff --git a/src/pray.c b/src/pray.c index a91782c72..d2b24c00a 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1386,8 +1386,7 @@ verbalize("In return for thy service, I grant thee the gift of Immortality!"); if (otmp->otyp == FAKE_AMULET_OF_YENDOR) { if (!highaltar && !otmp->known) goto too_soon; - if (!Deaf) - You_hear("a nearby thunderclap."); + You_hear("a nearby thunderclap."); if (!otmp->known) { You("realize you have made a %s.", Hallucination ? "boo-boo" : "mistake"); diff --git a/src/trap.c b/src/trap.c index 7efe8db00..911aafdc5 100644 --- a/src/trap.c +++ b/src/trap.c @@ -2062,10 +2062,9 @@ register struct monst *mtmp; pline("%s stops momentarily and appears to cringe.", Monnam(mtmp)); } - } else if (!Deaf) { + } else You_hear("a distant %s squeak.", trapnote(trap,1)); - } /* wake up nearby monsters */ wake_nearto(mtmp->mx, mtmp->my, 40); break; @@ -2080,9 +2079,8 @@ register struct monst *mtmp; Monnam(mtmp), a_your[trap->madeby_u]); seetrap(trap); } else { - if((mptr == &mons[PM_OWLBEAR] + if(mptr == &mons[PM_OWLBEAR] || mptr == &mons[PM_BUGBEAR]) - && !Deaf) You_hear("the roaring of an angry bear!"); } } else if (force_mintrap) { @@ -2923,9 +2921,8 @@ domagictrap() if (!Blind) Your1(vision_clears); } else if (!Blind) { You_see("a flash of light!"); - } else if (!Deaf) { + } else You_hear("a deafening roar!"); - } incr_itimeout(&HDeaf, rn1(20,30)); while(cnt--) (void) makemon((struct permonst *) 0, u.ux, u.uy, NO_MM_FLAGS); diff --git a/src/zap.c b/src/zap.c index 95b9760a3..38b883115 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1790,7 +1790,7 @@ struct obj *obj, *otmp; if (obj->otyp == BOULDER) { if (cansee(obj->ox, obj->oy)) pline_The("boulder falls apart."); - else if (!Deaf) + else You_hear("a crumbling sound."); fracture_rock(obj); } @@ -1801,9 +1801,8 @@ struct obj *obj, *otmp; pline_The("%s shatters.", rndmonnam()); else pline_The("statue shatters."); - } else if (!Deaf) { + } else You_hear("a crumbling sound."); - } } } else { if (context.mon_moving ? @@ -3025,7 +3024,7 @@ struct obj **pobj; /* object tossed/used, set to NULL if (!Blind) pline("%s %s%s.", Yname2(obj), otense(obj, "skip"), skipcount ? " again" : ""); - else if (!Deaf) You_hear("%s skip.", yname(obj)); + else You_hear("%s skip.", yname(obj)); skipcount++; } else if (skiprange_start > skiprange_end + 1) { --skiprange_start; @@ -4047,7 +4046,7 @@ short exploding_wand_typ; else Norep("The water freezes."); newsym(x,y); - } else if(!Deaf && !lava) + } else if(!lava) You_hear("a crackling sound."); if (x == u.ux && y == u.uy) { @@ -4214,9 +4213,8 @@ short exploding_wand_typ; newsym(x, y); } else if (sense_txt) { You1(sense_txt); - } else if (hear_txt) { - if (!Deaf) You_hear1(hear_txt); - } + } else if (hear_txt) + You_hear1(hear_txt); if (picking_at(x, y)) { stop_occupation(); reset_pick(); From 1609081320968a41e1f96713e3f844cefcbb8797 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 7 Mar 2015 15:11:41 +0200 Subject: [PATCH 059/354] Implement fcntl(2) file locking If you run a server, then you know of the somewhat annoying perm_lock errors that creep up, requiring your attention before anyone else can start a game. This patch properly implements fcntl(2) locking on systems that can handle it (*nix systems), that results in the lock being automatically released on program termination, whether abnormal or not. Original patch by Drew Streib, update by Edoardo Spadolini --- include/unixconf.h | 6 +++++ src/files.c | 60 ++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 62 insertions(+), 4 deletions(-) diff --git a/include/unixconf.h b/include/unixconf.h index c85611c2a..9feefd2c8 100644 --- a/include/unixconf.h +++ b/include/unixconf.h @@ -217,6 +217,12 @@ #define FCMASK 0660 /* file creation mask */ +/* fcntl(2) is a POSIX-portable call for manipulating file descriptors. + * Comment out the USE_FCNTL if for some reason you have a strange + * OS/filesystem combination for which fcntl(2) does not work. */ +#ifdef POSIX_TYPES +# define USE_FCNTL +#endif /* * The remainder of the file should not need to be changed. diff --git a/src/files.c b/src/files.c index 71fd0c217..2cae9fb7f 100644 --- a/src/files.c +++ b/src/files.c @@ -12,7 +12,7 @@ #include -#if !defined(MAC) && !defined(O_WRONLY) && !defined(AZTEC_C) +#if (!defined(MAC) && !defined(O_WRONLY) && !defined(AZTEC_C)) || defined(USE_FCNTL) #include #endif @@ -185,7 +185,9 @@ STATIC_DCL void FDECL(docompress_file, (const char *,BOOLEAN_P)); #if defined(ZLIB_COMP) STATIC_DCL boolean FDECL(make_compressed_name, (const char *, char *)); #endif +#ifndef USE_FCNTL STATIC_DCL char *FDECL(make_lockname, (const char *,char *)); +#endif STATIC_DCL FILE *FDECL(fopen_config_file, (const char *, int)); STATIC_DCL int FDECL(get_uchars, (FILE *,char *,char *,uchar *,BOOLEAN_P,int,const char *)); @@ -1537,12 +1539,16 @@ boolean uncomp; static int nesting = 0; -#ifdef NO_FILE_LINKS /* implies UNIX */ +#if defined(NO_FILE_LINKS) || defined(USE_FCNTL) /* implies UNIX */ static int lockfd; /* for lock_file() to pass to unlock_file() */ #endif +#ifdef USE_FCNTL +struct flock sflock; /* for unlocking, same as above */ +#endif #define HUP if (!program_state.done_hup) +#ifndef USE_FCNTL STATIC_OVL char * make_lockname(filename, lockname) const char *filename; @@ -1574,6 +1580,7 @@ char *lockname; return (char*)0; #endif } +#endif /* !USE_FCNTL */ /* lock a file */ boolean @@ -1585,8 +1592,10 @@ int retryct; #if defined(PRAGMA_UNUSED) && !(defined(UNIX) || defined(VMS)) && !(defined(AMIGA) || defined(WIN32) || defined(MSDOS)) # pragma unused(retryct) #endif +#ifndef USE_FCNTL char locknambuf[BUFSZ]; const char *lockname; +#endif nesting++; if (nesting > 1) { @@ -1594,18 +1603,50 @@ int retryct; return TRUE; } +#ifndef USE_FCNTL lockname = make_lockname(filename, locknambuf); - filename = fqname(filename, whichprefix, 0); #ifndef NO_FILE_LINKS /* LOCKDIR should be subsumed by LOCKPREFIX */ lockname = fqname(lockname, LOCKPREFIX, 2); #endif +#endif + filename = fqname(filename, whichprefix, 0); +#ifdef USE_FCNTL + lockfd = open(filename,O_RDWR); + if (lockfd == -1) { + HUP raw_printf("Cannot open file %s. This is a program bug.", + filename); + } + sflock.l_type = F_WRLCK; + sflock.l_whence = SEEK_SET; + sflock.l_start = 0; + sflock.l_len = 0; +#endif #if defined(UNIX) || defined(VMS) +# ifdef USE_FCNTL + while (fcntl(lockfd,F_SETLK,&sflock) == -1) { +# else # ifdef NO_FILE_LINKS while ((lockfd = open(lockname, O_RDWR|O_CREAT|O_EXCL, 0666)) == -1) { # else while (link(filename, lockname) == -1) { # endif +# endif + +#ifdef USE_FCNTL + if (retryct--) { + HUP raw_printf( + "Waiting for release of fcntl lock on %s. (%d retries left).", + filename, retryct); + sleep(1); + } else { + HUP (void) raw_print("I give up. Sorry."); + HUP raw_printf("Some other process has an unnatural grip on %s.", + filename); + nesting--; + return FALSE; + } +#else register int errnosv = errno; switch (errnosv) { /* George Barbanis */ @@ -1660,11 +1701,12 @@ int retryct; nesting--; return FALSE; } +#endif /* USE_FCNTL */ } #endif /* UNIX || VMS */ -#if defined(AMIGA) || defined(WIN32) || defined(MSDOS) +#if (defined(AMIGA) || defined(WIN32) || defined(MSDOS)) && !defined(USE_FCNTL) # ifdef AMIGA #define OPENFAILURE(fd) (!fd) lockptr = 0; @@ -1711,10 +1753,19 @@ void unlock_file(filename) const char *filename; { +#ifndef USE_FCNTL char locknambuf[BUFSZ]; const char *lockname; +#endif if (nesting == 1) { +#ifdef USE_FCNTL + sflock.l_type = F_UNLCK; + if (fcntl(lockfd,F_SETLK,&sflock) == -1) { + HUP raw_printf("Can't remove fcntl lock on %s.", filename); + (void) close(lockfd); + } +#else lockname = make_lockname(filename, locknambuf); #ifndef NO_FILE_LINKS /* LOCKDIR should be subsumed by LOCKPREFIX */ lockname = fqname(lockname, LOCKPREFIX, 2); @@ -1734,6 +1785,7 @@ const char *filename; DeleteFile(lockname); lockptr = 0; #endif /* AMIGA || WIN32 || MSDOS */ +#endif /* USE_FCNTL */ } nesting--; From a66b498dda0bafffcafc81ee377670207c106b0b Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 8 Mar 2015 10:40:26 +0200 Subject: [PATCH 060/354] TTY: Do not cut off statuslines at 80 characters Show as much of the status line as possible, instead of chopping it at COLNO - this prevents possible game-influencing status effects (Ill, Burdened, etc) from being hidden. --- win/tty/wintty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 67b0243d4..19af943b9 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1061,7 +1061,7 @@ tty_create_nhwindow(type) #endif newwin->offy = min((int)ttyDisplay->rows-2, ROWNO+1); newwin->rows = newwin->maxrow = 2; - newwin->cols = newwin->maxcol = min(ttyDisplay->cols, COLNO); + newwin->cols = newwin->maxcol = ttyDisplay->cols; break; case NHW_MAP: /* map window, ROWNO lines long, full width, below message window */ From 8c048e60861d41a6da6b12378556af18fa36fe09 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 8 Mar 2015 15:11:01 +0200 Subject: [PATCH 061/354] TTY: Prevent accidental escapes from string entries On NAO, one of the major complaints was accidental escaping from wishing prompt when using cursor keys. The users were trying to go "back" on the entry to fix a typo, but lost the wish instead. This prevents escaping out of a text prompt if there is any text entered into the prompt; pressing escape clears the prompt. --- win/tty/getline.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/win/tty/getline.c b/win/tty/getline.c index 4a2d8c251..1e4e6c43f 100644 --- a/win/tty/getline.c +++ b/win/tty/getline.c @@ -60,9 +60,19 @@ getlin_hook_proc hook; Strcat(strcat(strcpy(toplines, query), " "), obufp); c = pgetchar(); if (c == '\033' || c == EOF) { - obufp[0] = '\033'; - obufp[1] = '\0'; - break; + if (c == '\033' && obufp[0] != '\0') { + obufp[0] = '\0'; + bufp = obufp; + tty_clear_nhwindow(WIN_MESSAGE); + cw->maxcol = cw->maxrow; + addtopl(query); + addtopl(" "); + addtopl(obufp); + } else { + obufp[0] = '\033'; + obufp[1] = '\0'; + break; + } } if (ttyDisplay->intr) { ttyDisplay->intr--; From 8e31929ef56c00cae8b19ff5dde02b880c35b1a1 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 9 Mar 2015 18:42:53 +0200 Subject: [PATCH 062/354] Define for generic usernames which prompt for name Instead of hard-coding the "play", "player", etc. usernames which will prompt the user for their name, allow defining the names in config.h --- include/config.h | 5 +++++ src/role.c | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/config.h b/include/config.h index d8b067fc7..930bd549c 100644 --- a/include/config.h +++ b/include/config.h @@ -316,6 +316,11 @@ #endif /* CHDIR */ +/* If GENERIC_USERNAMES is defined, and the user name is found + * in that list, prompt for username instead. + * A public server should probably disable this. */ +#define GENERIC_USERNAMES "play player game games nethack nethacker" + /* * Section 3: Definitions that may vary with system type. diff --git a/src/role.c b/src/role.c index 59624c528..2e2cbabae 100644 --- a/src/role.c +++ b/src/role.c @@ -1332,12 +1332,15 @@ plnamesuffix() char *sptr, *eptr; int i; +#ifdef GENERIC_USERNAMES /* some generic user names will be ignored in favor of prompting */ i = (int)strlen(plname); - if ((i >= 4 && !strncmpi(plname, "player", i)) || /* play[er] */ - (i >= 4 && !strncmpi(plname, "games", i)) || /* game[s] */ - (i >= 7 && !strncmpi(plname, "nethacker", i))) /* nethack[er] */ + eptr = GENERIC_USERNAMES; + sptr = strstri(eptr, plname); + if (sptr && ((sptr == eptr && (sptr[i] == ' ' || sptr[i] == '\0')) + || sptr[i] == ' ' || sptr[i] == '\0')) *plname = '\0'; /* call askname() */ +#endif do { if (!*plname) askname(); /* fill plname[] if necessary */ From c0a5b49e62e889f13bfe32f2f23a3b7d9a2aa9c3 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 9 Mar 2015 21:08:42 +0200 Subject: [PATCH 063/354] Use a menu to loot multiple containers When looting a location with multiple containers, show a menu for user to pick the containers to loot instead of asking a yes/no question for each container. --- src/pickup.c | 108 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 77 insertions(+), 31 deletions(-) diff --git a/src/pickup.c b/src/pickup.c index d044cf46f..0b6abf06d 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1451,6 +1451,36 @@ int x, y; return FALSE; } +int +do_loot_cont(cobjp) +struct obj **cobjp; +{ + struct obj *cobj = *cobjp; + if (!cobj) return 0; + if (cobj->olocked) { + pline("%s locked.", cobj->lknown ? "It is" : + "Hmmm, it turns out to be"); + cobj->lknown = 1; + return 0; + } + cobj->lknown = 1; + + if (cobj->otyp == BAG_OF_TRICKS) { + int tmp; + You("carefully open the bag..."); + pline("It develops a huge set of teeth and bites you!"); + tmp = rnd(10); + losehp(Maybe_Half_Phys(tmp), "carnivorous bag", KILLED_BY_AN); + makeknown(BAG_OF_TRICKS); + return 1; + } + + You("%sopen %s...", + (!cobj->cknown || !cobj->lknown) ? "carefully " : "", + the(xname(cobj))); + return use_container(cobjp, 0); +} + int doloot() /* loot a container on the floor or loot saddle from mon. */ { @@ -1486,46 +1516,62 @@ lootcont: if (container_at(cc.x, cc.y, FALSE)) { boolean any = FALSE; + int num_conts = 0; if (!able_to_loot(cc.x, cc.y, TRUE)) return 0; - for (cobj = level.objects[cc.x][cc.y]; cobj; cobj = nobj) { - nobj = cobj->nexthere; - if (Is_container(cobj)) { - c = ynq(safe_qbuf(qbuf, "There is ", " here, loot it?", - cobj, doname, ansimpleoname, "a container")); - if (c == 'q') return (timepassed); - if (c == 'n') continue; - any = TRUE; + for (cobj = level.objects[cc.x][cc.y]; cobj; cobj = cobj->nexthere) + if (Is_container(cobj)) num_conts++; - if (cobj->olocked) { - pline("%s locked.", cobj->lknown ? "It is" : - "Hmmm, it turns out to be"); - cobj->lknown = 1; - continue; + if (num_conts > 1) { + /* use a menu to loot many containers */ + int n, i; + winid win; + anything any; + menu_item *pick_list = NULL; + + any.a_void = 0; + win = create_nhwindow(NHW_MENU); + start_menu(win); + + for (cobj = level.objects[cc.x][cc.y]; cobj; cobj = cobj->nexthere) + if (Is_container(cobj)) { + any.a_obj = cobj; + add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE, doname(cobj), MENU_UNSELECTED); } - cobj->lknown = 1; + end_menu(win, "Loot which containers?"); + n = select_menu(win, PICK_ANY, &pick_list); + destroy_nhwindow(win); - if (cobj->otyp == BAG_OF_TRICKS) { - int tmp; - You("carefully open the bag..."); - pline("It develops a huge set of teeth and bites you!"); - tmp = rnd(10); - losehp(Maybe_Half_Phys(tmp), "carnivorous bag", KILLED_BY_AN); - makeknown(BAG_OF_TRICKS); - timepassed = 1; - continue; + if (n > 0) { + for (i = 0; i < n; i++) { + timepassed |= do_loot_cont(&pick_list[i].item.a_obj); + if (multi < 0 || !pick_list[i].item.a_obj) { + free((genericptr_t) pick_list); + return 1; + } } - - You("%sopen %s...", - (!cobj->cknown || !cobj->lknown) ? "carefully " : "", - the(xname(cobj))); - timepassed |= use_container(&cobj, 0); - /* might have triggered chest trap or magic bag explosion */ - if (multi < 0 || !cobj) return 1; } + if (pick_list) free((genericptr_t) pick_list); + if (n != 0) c = 'y'; + } else { + for (cobj = level.objects[cc.x][cc.y]; cobj; cobj = nobj) { + nobj = cobj->nexthere; + + if (Is_container(cobj)) { + c = ynq(safe_qbuf(qbuf, "There is ", " here, loot it?", + cobj, doname, ansimpleoname, "a container")); + if (c == 'q') return (timepassed); + if (c == 'n') continue; + any = TRUE; + + timepassed |= do_loot_cont(&cobj); + /* might have triggered chest trap or magic bag explosion */ + if (multi < 0 || !cobj) return 1; + } + } + if (any) c = 'y'; } - if (any) c = 'y'; } else if (IS_GRAVE(levl[cc.x][cc.y].typ)) { You("need to dig up the grave to effectively loot it..."); } From fa186c01562f760be72cb857fb7512fbba45f7fc Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 9 Mar 2015 22:22:32 +0200 Subject: [PATCH 064/354] Comment typofix --- src/fountain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fountain.c b/src/fountain.c index 482b0ed76..e87748e0a 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -456,7 +456,7 @@ register struct obj *obj; long money = money_cnt(invent); struct obj *otmp; if (money > 10) { - /* Amount to loose. Might get rounded up as fountains don't pay change... */ + /* Amount to lose. Might get rounded up as fountains don't pay change... */ money = somegold(money) / 10; for (otmp = invent; otmp && money > 0; otmp = otmp->nobj) if (otmp->oclass == COIN_CLASS) { int denomination = objects[otmp->otyp].oc_cost; From 560898d3d46657020a1e051f0432fb26973c66d4 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 9 Mar 2015 22:53:43 +0200 Subject: [PATCH 065/354] Change command X to twoweapon toggle Explore mode is now an extended command #exploremode. There's no sense that a command used max. once per game, and in normal games not at all, takes up a key. So, analogous to the 'x' command (swap weapons), 'X' now toggles two-weapon combat. --- dat/cmdhelp | 2 +- dat/help | 2 +- dat/hh | 2 +- doc/Guidebook.mn | 7 ++++--- src/cmd.c | 3 ++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dat/cmdhelp b/dat/cmdhelp index 811c9bdda..d7487750f 100644 --- a/dat/cmdhelp +++ b/dat/cmdhelp @@ -69,7 +69,7 @@ V Show long version and game history w Wield (put in use) a weapon W Wear a piece of armor x Swap wielded and secondary weapons -X Enter explore (discovery) mode (only if defined) +X Toggle two-weapon combat y Go northwest 1 space Y Go northwest until you are on top of something ^Y Go northwest until you are near something diff --git a/dat/help b/dat/help index 7f9ee92ab..07971cec2 100644 --- a/dat/help +++ b/dat/help @@ -147,7 +147,7 @@ Commands: w Wield weapon. w- means wield nothing, use bare hands. W Wear armor. x Swap wielded and secondary weapons. - X Switch the game to explore (discovery) mode. + X Toggle two-weapon combat. ^X Show your attributes. z Zap a wand. (Use y instead of z if number_pad is -1.) Z Cast a spell. (Use Y instead of Z if number_pad is -1.) diff --git a/dat/hh b/dat/hh index 1887547c7..b16b1c91c 100644 --- a/dat/hh +++ b/dat/hh @@ -32,7 +32,6 @@ O options set options \ known display list of what's been discovered v version display version number V history display game history -X explore switch the game to explore (discovery) mode ^A again redo the previous command (^A denotes the keystroke CTRL-A) ^R redraw redraw the screen ^P prevmsg repeat previous message (subsequent ^P's repeat earlier ones) @@ -70,6 +69,7 @@ T takeoff take off some armor w wield wield a weapon (w- wield nothing) W wear put on some armor x xchange swap wielded and secondary weapons +X twoweapon toggle two-weapon combat z zap zap a wand (use y instead of z if number_pad is -1) Z Zap cast a spell (use Y instead of Z if number_pad is -1) < up go up the stairs diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index f04f3b309..86094fe26 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -708,7 +708,8 @@ The latter is used as your secondary weapon when engaging in two-weapon combat. Note that if one of these slots is empty, the exchange still takes place. .lp X -Enter explore (discovery) mode, explained in its own section later. +Toggle two-weapon combat, if your character can do it. Also available +via the ``#twoweapon'' extended command .lp "" Since using this command by accident would be troublesome, you are asked to confirm your intent before switching to explore mode. By default @@ -2980,8 +2981,8 @@ with the .op -X command-line switch or with the .op playmode:explore -option. The other is to issue the `X' command while already -playing the game. Starting a new game in explore mode provides your +option. The other is to issue the ``#exploremode'' extended command while +already playing the game. Starting a new game in explore mode provides your character with a wand of wishing in initial inventory; switching via `X' during play does not. The other benefits of explore mode are left for the trepid reader to discover. diff --git a/src/cmd.c b/src/cmd.c index f7e858e01..5d9bcfc27 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -2411,7 +2411,7 @@ static const struct func_tab cmdlist[] = { {'W', FALSE, dowear}, {M('w'), FALSE, dowipe}, {'x', FALSE, doswapweapon}, - {'X', TRUE, enter_explore_mode}, + {'X', FALSE, dotwoweapon}, /* 'y', 'Y' : go nw */ {'z', FALSE, dozap}, {'Z', TRUE, docast}, @@ -2456,6 +2456,7 @@ struct ext_func_tab extcmdlist[] = { {"dip", "dip an object into something", dodip, FALSE}, {"enhance", "advance or check weapon and spell skills", enhance_weapon_skill, TRUE}, + {"exploremode", "enter explore mode", enter_explore_mode, TRUE}, {"force", "force a lock", doforce, FALSE}, {"invoke", "invoke an object's powers", doinvoke, TRUE}, {"jump", "jump to a location", dojump, FALSE}, From fa04eff2821fe4c9f9c6587bf85160f57c8d7203 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 9 Mar 2015 21:08:26 -0400 Subject: [PATCH 066/354] fix a segfault in mapglyph reported by Pasi earlier today Changes to be committed: modified: src/pager.c Steps to reproduce the reported segfault: Use / command, answer n, press space and enter In do_look() variable glyph is only set to a proper value if using the screen (from_screen) or the mouse (clicklook). On the code path that triggered the segfault, glyph was being passed to mapglyph with a random arbitrary value. If glyph had been initialized at the start of do_look(), it would have prevented the segfault, but would have always displayed a giant ant or something silly instead of the correct thing. Don't use glyph except under from_screen || clicklook. --- src/pager.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pager.c b/src/pager.c index 4e8008c1b..721119060 100644 --- a/src/pager.c +++ b/src/pager.c @@ -574,9 +574,14 @@ do_look(mode, click_cc) def_monsyms[i].explain) { need_to_look = TRUE; if (!found) { - Sprintf(out_str, "%s %s", + if (from_screen || clicklook) + Sprintf(out_str, "%s %s", encglyph(glyph), - an(def_monsyms[i].explain)); + an(def_monsyms[i].explain)); + else + Sprintf(out_str, "%c %s", + sym, + an(def_monsyms[i].explain)); firstmatch = def_monsyms[i].explain; found++; } else { From 7113829de0759d099854ad9626864faf45709244 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 9 Mar 2015 22:05:48 -0400 Subject: [PATCH 067/354] more do_look() glyph usage without it being set properly Changes to be committed: modified: src/pager.c When the previous occurrence that triggered a segfault was fixed, I didn't check for more of them. It turns out there were more instances. This also removes some dead code. --- src/pager.c | 76 ++++++++++++++++------------------------------------- 1 file changed, 23 insertions(+), 53 deletions(-) diff --git a/src/pager.c b/src/pager.c index 721119060..377eda642 100644 --- a/src/pager.c +++ b/src/pager.c @@ -453,7 +453,7 @@ do_look(mode, click_cc) { boolean quick = (mode == 1); /* use cursor && don't search for "more info" */ boolean clicklook = (mode == 2); /* right mouse-click method */ - char out_str[BUFSZ], look_buf[BUFSZ]; + char out_str[BUFSZ], look_buf[BUFSZ], prefix[BUFSZ]; const char *x_str, *firstmatch = 0; struct permonst *pm = 0; int glyph; /* glyph at selected position */ @@ -532,36 +532,14 @@ do_look(mode, click_cc) glyph = glyph_at(cc.x,cc.y); /* Convert the glyph at the selected position to a symbol. */ -#if 0 - if (glyph_is_cmap(glyph)) { - sym = showsyms[glyph_to_cmap(glyph)]; - } else if (glyph_is_trap(glyph)) { - sym = showsyms[trap_to_defsym(glyph_to_trap(glyph))]; - } else if (glyph_is_statue(glyph)) { - sym = showsyms[(int)mons[glyph_to_mon(glyph)].mlet + SYM_OFF_M]; - } else if (glyph_is_object(glyph)) { - sym = showsyms[(int)objects[glyph_to_obj(glyph)].oc_class + SYM_OFF_O]; - if (sym == '`' && iflags.bouldersym && (int)glyph_to_obj(glyph) == BOULDER) - sym = iflags.bouldersym; - } else if (glyph_is_monster(glyph)) { - /* takes care of pets, detected, ridden, and regular mons */ - sym = showsyms[(int)mons[glyph_to_mon(glyph)].mlet + SYM_OFF_M]; - } else if (glyph_is_swallow(glyph)) { - sym = showsyms[glyph_to_swallow(glyph)+S_sw_tl]; - } else if (glyph_is_invisible(glyph)) { - sym = DEF_INVISIBLE; - } else if (glyph_is_warning(glyph)) { - sym = glyph_to_warning(glyph); - sym = showsyms[sym + SYM_OFF_W]; - } else { - impossible("do_look: bad glyph %d at (%d,%d)", - glyph, (int)cc.x, (int)cc.y); - sym = ' '; - } -#endif so = mapglyph(glyph, &sym, &oc, &os, cc.x, cc.y); } + if (from_screen || clicklook) + Sprintf(prefix, "%s ", encglyph(glyph)); + else + Sprintf(prefix, "%s ", sym); + /* * Check all the possibilities, saving all explanations in a buffer. * When all have been checked then the string is printed. @@ -574,14 +552,8 @@ do_look(mode, click_cc) def_monsyms[i].explain) { need_to_look = TRUE; if (!found) { - if (from_screen || clicklook) - Sprintf(out_str, "%s %s", - encglyph(glyph), - an(def_monsyms[i].explain)); - else - Sprintf(out_str, "%c %s", - sym, - an(def_monsyms[i].explain)); + Sprintf(out_str, "%s%s", + prefix, an(def_monsyms[i].explain)); firstmatch = def_monsyms[i].explain; found++; } else { @@ -605,8 +577,8 @@ do_look(mode, click_cc) */ if (u.uswallow && (from_screen || clicklook) && is_swallow_sym(sym)) { if (!found) { - Sprintf(out_str, "%s %s", - encglyph(glyph), mon_interior); + Sprintf(out_str, "%s%s", + prefix, mon_interior); firstmatch = mon_interior; } else { found += append_str(out_str, mon_interior); @@ -624,9 +596,8 @@ do_look(mode, click_cc) continue; } if (!found) { - Sprintf(out_str, "%s %s", - encglyph(glyph), - an(def_oc_syms[i].explain)); + Sprintf(out_str, "%s%s", + prefix, an(def_oc_syms[i].explain)); firstmatch = def_oc_syms[i].explain; found++; } else { @@ -637,8 +608,8 @@ do_look(mode, click_cc) if (sym == DEF_INVISIBLE) { if (!found) { - Sprintf(out_str, "%s %s", - encglyph(glyph), + Sprintf(out_str, "%s%s", + prefix, an(invisexplain)); firstmatch = invisexplain; found++; @@ -662,12 +633,11 @@ do_look(mode, click_cc) if (!found) { if (is_cmap_trap(i)) { - Sprintf(out_str, "%s a trap", - encglyph(glyph)); + Sprintf(out_str, "%sa trap", prefix); hit_trap = TRUE; } else { - Sprintf(out_str, "%s %s", - encglyph(glyph), + Sprintf(out_str, "%s%s", + prefix, article == 2 ? the(x_str) : article == 1 ? an(x_str) : x_str); } @@ -692,8 +662,8 @@ do_look(mode, click_cc) if (sym == ((from_screen || clicklook) ? warnsyms[i] : def_warnsyms[i].sym)) { if (!found) { - Sprintf(out_str, "%s %s", - encglyph(glyph), def_warnsyms[i].explanation); + Sprintf(out_str, "%s%s", + prefix, def_warnsyms[i].explanation); firstmatch = def_warnsyms[i].explanation; found++; } else { @@ -711,8 +681,8 @@ do_look(mode, click_cc) if (skipped_venom && found < 2) { x_str = def_oc_syms[VENOM_CLASS].explain; if (!found) { - Sprintf(out_str, "%s %s", - encglyph(glyph), an(x_str)); + Sprintf(out_str, "%s%s", + prefix, an(x_str)); firstmatch = x_str; found++; } else { @@ -724,8 +694,8 @@ do_look(mode, click_cc) if (iflags.bouldersym && sym == iflags.bouldersym) { if (!found) { firstmatch = "boulder"; - Sprintf(out_str, "%s %s", - encglyph(glyph), an(firstmatch)); + Sprintf(out_str, "%s%s", + prefix, an(firstmatch)); found++; } else { found += append_str(out_str, "boulder"); From 67aab26a834493978f61ee91085dbbe5d717f57f Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 9 Mar 2015 22:11:49 -0400 Subject: [PATCH 068/354] typo in format string on previous commit --- src/pager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pager.c b/src/pager.c index 377eda642..459a6daf4 100644 --- a/src/pager.c +++ b/src/pager.c @@ -538,7 +538,7 @@ do_look(mode, click_cc) if (from_screen || clicklook) Sprintf(prefix, "%s ", encglyph(glyph)); else - Sprintf(prefix, "%s ", sym); + Sprintf(prefix, "%c ", sym); /* * Check all the possibilities, saving all explanations in a buffer. From f0a335da2a039a0aed69671830df89819b47d0ab Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 10 Mar 2015 17:30:24 +0200 Subject: [PATCH 069/354] Fix GENERIC_USERNAMES thinko --- src/role.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/role.c b/src/role.c index 2e2cbabae..9e09d448a 100644 --- a/src/role.c +++ b/src/role.c @@ -1337,8 +1337,9 @@ plnamesuffix() i = (int)strlen(plname); eptr = GENERIC_USERNAMES; sptr = strstri(eptr, plname); - if (sptr && ((sptr == eptr && (sptr[i] == ' ' || sptr[i] == '\0')) - || sptr[i] == ' ' || sptr[i] == '\0')) + if (sptr + && (sptr == eptr || sptr[-1] == ' ') + && (sptr[i] == ' ' || sptr[i] == '\0')) *plname = '\0'; /* call askname() */ #endif From d5abd07dad434e60b6cef622c6f894ede458cb96 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 10 Mar 2015 19:48:04 +0200 Subject: [PATCH 070/354] Add boolean option "bones" Setting bones off prevents saving and loading bones files. --- doc/Guidebook.mn | 2 ++ include/flag.h | 1 + include/patchlevel.h | 2 +- src/bones.c | 2 ++ src/options.c | 1 + 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 86094fe26..8ce5dbaad 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1927,6 +1927,8 @@ quality of the weapon; you are free to manually fill your quiver or quiver sack or make ready with the `Q' command instead. If no weapon is found or the option is false, the `t' (throw) command is executed instead. (default false) +.lp bones +Allow saving and loading bones files. (default true) .lp boulder Set the character used to display boulders (default is rock class symbol). .lp catname diff --git a/include/flag.h b/include/flag.h index a34abe839..aaff7431c 100644 --- a/include/flag.h +++ b/include/flag.h @@ -21,6 +21,7 @@ struct flag { boolean autoquiver; /* Automatically fill quiver */ boolean beginner; boolean biff; /* enable checking for mail */ + boolean bones; /* allow saving/loading bones */ boolean confirm; /* confirm before hitting tame monsters */ boolean debug; /* in debugging mode */ #define wizard flags.debug diff --git a/include/patchlevel.h b/include/patchlevel.h index 2399ca5b0..00411a2c2 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -14,7 +14,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 55 +#define EDITLEVEL 56 #define COPYRIGHT_BANNER_A \ "NetHack, Copyright 1985-2012" diff --git a/src/bones.c b/src/bones.c index 926b9079e..269152578 100644 --- a/src/bones.c +++ b/src/bones.c @@ -287,6 +287,7 @@ can_make_bones() { register struct trap *ttmp; + if (!flags.bones) return FALSE; if (ledger_no(&u.uz) <= 0 || ledger_no(&u.uz) > maxledgerno()) return FALSE; if (no_bones_level(&u.uz)) @@ -533,6 +534,7 @@ getbones() if(discover) /* save bones files for real games */ return(0); + if (!flags.bones) return (0); /* wizard check added by GAN 02/05/87 */ if(rn2(3) /* only once in three times do we find bones */ && !wizard diff --git a/src/options.c b/src/options.c index 229c2df91..98ab3724b 100644 --- a/src/options.c +++ b/src/options.c @@ -85,6 +85,7 @@ static struct Bool_Opt #else {"BIOS", (boolean *)0, FALSE, SET_IN_FILE}, #endif + {"bones", &flags.bones, TRUE, SET_IN_FILE}, #ifdef INSURANCE {"checkpoint", &flags.ins_chkpt, TRUE, SET_IN_GAME}, #else From 7c65f47dfd5fc6232f1c243dd0e0b7b8283cd6dd Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 10 Mar 2015 14:25:54 -0400 Subject: [PATCH 071/354] One VS Makefile for Nethack that works with VS2010-VS2015 --- sys/winnt/Makefile.msc | 164 ++++++++++++++++++++++++++++++++++------- 1 file changed, 136 insertions(+), 28 deletions(-) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 4d2b4c066..847aa3797 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -1,13 +1,17 @@ -# NetHack 3.5 Makefile.msc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ -# NetHack 3.5 Makefile.msc $Date: 2012/04/14 00:38:09 $ $Revision: 1.54 $ -# Copyright (c) NetHack PC Development Team 1993-2012 +# NetHack 3.5 Makefile.msc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +# Copyright (c) NetHack PC Development Team 1993-2015 # -# NetHack 3.5.x Makefile for MS Visual Studio Visual C++ compiler +#============================================================================== +# Build Tools Environment +# +# NetHack 3.6.x Makefile for MS Visual Studio Visual C++ compiler # -# Win32 Compilers Tested: -# - Microsoft Visual Studio 2010 Express +# Visual Studio Compilers Tested: # - Microsoft Visual Studio 2010 Express, with the Platform SDK +# - Microsoft Visual Studio 2013 Express +# - Microsoft Visual Studio 2015 Express (pre-release) # +#============================================================================== # This is used for building two versions of NetHack: # A tty port utilizing the Win32 Console I/O subsystem, Console # NetHack; @@ -21,18 +25,71 @@ # .y yacc (such as bison) # .l lex (such as flex) # -# -# If you have any questions read the sys/winnt/Install.nt file included -# with the distribution. +# If you have any questions read the sys/winnt/Install.nt file included +# with the distribution. #============================================================================== -# Do not delete the following line. +#============================================================================== +# This section is used to determine the version of Visual Studio we are using. +# We set VSVER to 0000 to flag any version that is too old or untested. +# +!IF "$(_NMAKE_VER)" == "14.00.22310.1" +VSVER=2015 +!ELSEIF "$(_NMAKE_VER)" == "12.00.21005.1" +VSVER=2013 +!ELSEIF "$(_NMAKE_VER)" == "10.00.40219.01" +VSVER=2010 +!ELSE +VSVER=0000 #untested version +!ENDIF +# +#============================================================================== +# BUILD DECISIONS SECTION +# +# 1. 32-bit or 64-bit? +# +!IF ($(VSVER) >= 2013) +# Set your desired target to x86 (32-bit) or x64 (64-bit) here by +# uncommenting the appropriate target size. +# +# 64 bit +#TARGET_CPU=x64 +# +# 32 bit +TARGET_CPU=x86 +!ELSE +# For VS2010 use "setenv /x86" or "setenv /x64" before invoking make process +# DO NOT DELETE THE FOLLOWING LINE !include - +!ENDIF +# +#--------------------------------------------------------------- +# 2. Graphical version or command line version? +# # Graphical interface -# Set to Y for a graphical version +# Uncomment below to set to Y for a graphical version #GRAPHICAL = Y +# +#--------------------------------------------------------------- +# 3. Where do you want the game to be built (which folder)? +# + +GAMEDIR = ..\binary # Game directory + +# This marks the end of the BUILD DECISIONS section. +#============================================================================== +# +#=============================================== +#======= End of Modification Section =========== +#=============================================== +# +################################################ +# # +# Nothing below here should have to be changed.# +# # +################################################ + # Set the gamedir according to your preference. # If not present prior to compilation it gets created. @@ -42,8 +99,6 @@ GAME = NetHackW # Game Name GAME = NetHack # Game Name !ENDIF -GAMEDIR = ..\binary # Game directory - # # Source directories. Makedefs hardcodes these, don't change them. # @@ -65,6 +120,66 @@ WSHR = ..\win\share # Tile support files OBJ = o +cc=cl +link=link +rc=Rc + +# +#============================================= +# Visual Studio versions >= 2013 specific stuff +#============================================= + +!IF "$(TARGET_CPU)" == "" +TARGET_CPU=x86 +!ENDIF + +# Common compiler flags: +# -c - compile without linking +# -W3 - Set warning level to level 3 (-W4 for 64-bit compilations) +# -Zi - generate debugging information +# -Od - disable all optimizations +# -Ox - use maximum optimizations +# -Zd - generate only public symbols and line numbers for debugging +# -GS - enable security checks +# +ccommon=-c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -c +lflags=/INCREMENTAL:NO /NOLOGO + +!IF "$(TARGET_CPU)" == "x86" +cflags = $(ccommon) -D_X86_=1 -DWIN32 -D_WIN32 -W3 +scall = -Gz + +!ELSEIF "$(TARGET_CPU)" == "x64" +cflags = $(ccommon) -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 +cflags = $(cflags) -W4 +scall = +!ENDIF + +# declarations for use on Intel x86 systems +!IF "$(TARGET_CPU)" == "x86" +DLLENTRY = @12 +!ENDIF + +# declarations for use on AMD64 systems +!IF "$(TARGET_CPU)" == "x64" +DLLENTRY = +!ENDIF + +# for Windows applications +conlflags = $(lflags) -subsystem:console,$(EXEVER) +guilflags = $(lflags) -subsystem:windows,$(EXEVER) +dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll + +# basic subsystem specific libraries, less the C Run-Time +baselibs = kernel32.lib $(optlibs) $(winsocklibs) advapi32.lib +winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib + +# for Windows applications that use the C Run-Time libraries +conlibs = $(baselibs) +guilibs = $(winlibs) +# +# End of VS2013 and greater stuff +#============================================= # #========================================== @@ -134,15 +249,6 @@ PRECOMPHEAD = N # set to Y if you want to use precomp. headers #ZLIB = zlib.lib -#=============================================== -#======= End of Modification Section =========== -#=============================================== -################################################ -# # -# Nothing below here should have to be changed.# -# # -################################################ - !IF "$(GRAPHICAL)" == "Y" WINPORT = $(O)tile.o $(O)mhaskyn.o $(O)mhdlg.o \ $(O)mhfont.o $(O)mhinput.o $(O)mhmain.o $(O)mhmap.o \ @@ -420,7 +526,7 @@ OBJS = $(VOBJ01) $(VOBJ02) $(VOBJ03) $(VOBJ04) $(VOBJ05) \ $(VOBJ11) $(VOBJ12) $(VOBJ13) $(VOBJ14) $(VOBJ15) \ $(VOBJ16) $(VOBJ17) $(VOBJ18) $(VOBJ19) $(VOBJ20) \ $(VOBJ21) $(VOBJ22) $(VOBJ23) $(VOBJ24) $(VOBJ25) \ - $(VOBJ26) $(VOBJ27) + $(VOBJ26) $(VOBJ27) $(VOBJ28) $(VOBJ29) WINPOBJ = $(WINPORT) @@ -483,10 +589,10 @@ GAMEFILE = $(GAMEDIR)\$(GAME).exe # # The default make target (so just typing 'nmake' is useful). # -default : $(GAMEFILE) +default : install # -# The main target. +# The game target. # $(GAME): $(O)obj.tag $(O)utility.tag envchk $(GAMEFILE) @@ -920,10 +1026,12 @@ $(O)obj.tag: #========================================== envchk: +! IF ($(VSVER) < 2010) + @echo Your Visual Studio version is too old or untested ($(_NMAKE_VER)) +!ERROR Your Visual Studio version is too old or untested ($(_NMAKE_VER)) +! ENDIF ! IF "$(TARGET_CPU)"=="x64" @echo Windows x64 64-bit build -! ELSEIF "$(TARGET_CPU)"=="IA64" - @echo Windows x64 64-bit build ! ELSE @echo Windows x86 32-bit build ! ENDIF From 1287999b1c7e6ce4228aecc8f0fd604c681be408 Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 10 Mar 2015 18:00:49 -0400 Subject: [PATCH 072/354] do_look() in post-3.4.3 code fixes entry --- doc/fixes35.0 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 1e31bf65a..b6ddc30d1 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -866,6 +866,8 @@ passive attacks no longer erode armor covered by other armor dipping a fooproof item into acid no longer forgets that it's fooproof dipping a container into uncursed water now gets its contents wet sanitize petnames and fruit to prevent escape codes +do_look() in post-3.4.3 used glyph prior to setting it in pager.c + Platform- and/or Interface-Specific Fixes ----------------------------------------- From 64b3c6460a3d9877bfdd156c52aec0fe50e79348 Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 10 Mar 2015 18:34:01 -0400 Subject: [PATCH 073/354] catch up on some fixes entries --- doc/fixes35.0 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index b6ddc30d1..f6519a6f7 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -866,6 +866,12 @@ passive attacks no longer erode armor covered by other armor dipping a fooproof item into acid no longer forgets that it's fooproof dipping a container into uncursed water now gets its contents wet sanitize petnames and fruit to prevent escape codes +data.base "bat" overrode later "combat" entry +data.base "gelatinous cube" and "jack boot" have their own entries +data.base "vampire bat" matched twice; use the bat entry +data.base dagger attribution started with spaces instead of tabs +remove 'if (Deaf)' guards preceding You_hear which already checks deafness +tse a menu to loot multiple containers do_look() in post-3.4.3 used glyph prior to setting it in pager.c @@ -883,6 +889,10 @@ tty: when loading user's run-time configuration, explicitly negating one of to regular ASCII and left the earlier option inaccurately set to "on" tty: various bugfixes for very wide and/or tall screens tty+GOLDOBJ: dropping or looting by menu wouldn't honor a count for gold +tty: fix crashing when a location has more than 32k items +tty: fix segfault when MD termcap is not defined +tty: do not cut off statuslines at 80 characters for wider term +tty: prevent accidental escapes from string entries unix: remove use of parentheses in nethack man page usage that confused a man page conversion tool unix: new -wwindowtype option @@ -890,6 +900,7 @@ unix: don't clobber old level files if 2nd hangup/disconnect occurs while reconnected user is responding to the "destroy old game?" prompt unix/Qt: saved games were not found if nethack was built with prefixes in use unix,vms: allow digits after first character in name at "Who are you?" prompt +unix: implement fcntl(2) locking on systems that can handle it vms: the DLB configuration could fail to build if a file without a dot in its name happened to match a logical name Windows: starting a game with nethack.exe (tty) and saving, then restoring @@ -1065,6 +1076,10 @@ dipping multiple potions in another potion may only dip part of their stack make being inside a stinking cloud (when not immune or resistant) become a major trouble which is fixable by prayer introduce some variation in monster movement rates +Add database entry for shuriken and make it match throwing star +Add database entry for fedora +Add database entry for land mine +change command X to twoweapon toggle Platform- and/or Interface-Specific New Features @@ -1133,4 +1148,5 @@ make REINCARNATION make TOURIST unconditional make KOPS unconditional make ELBERETH unconditional +allow defining of generic usernames in config.h instead of hard-coding in role.c From 3243b332a3b25fcab04ee462977af6e0ad586d19 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 11 Mar 2015 17:16:05 +0200 Subject: [PATCH 074/354] getpos improvements: automatic description Pressing '@' will move the cursor on top of the hero. Pressing '#' will toggle automatic description mode, where the feature under the cursor is automatically described when the cursor is moved. --- doc/fixes35.0 | 3 + src/do_name.c | 43 ++++- src/pager.c | 427 ++++++++++++++++++++++++++------------------------ 3 files changed, 271 insertions(+), 202 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index f6519a6f7..89646e389 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1080,6 +1080,9 @@ Add database entry for shuriken and make it match throwing star Add database entry for fedora Add database entry for land mine change command X to twoweapon toggle +pressing @ when cursor positioning moves cursor on top of hero +pressing # when cursor positioning toggles automatic description of features + under the cursor Platform- and/or Interface-Specific New Features diff --git a/src/do_name.c b/src/do_name.c index 4face203e..ce538adb4 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -40,6 +40,8 @@ const char *goal; putstr(tmpwin, 0, sbuf); putstr(tmpwin, 0, "Use [HJKL] to move the cursor 8 units at a time."); putstr(tmpwin, 0, "Or enter a background symbol (ex. <)."); + putstr(tmpwin, 0, "Use @ to move the cursor on yourself."); + putstr(tmpwin, 0, "Use # to toggle automatic description."); /* disgusting hack; the alternate selection characters work for any getpos call, but they only matter for dowhatis (and doquickwhatis) */ doing_what_is = (goal == what_is_an_unknown_object); @@ -63,6 +65,8 @@ const char *goal; int cx, cy, i, c; int sidx, tx, ty; boolean msg_given = TRUE; /* clear message window by default */ + boolean auto_msg = FALSE; + boolean show_goal_msg = FALSE; static const char pick_chars[] = ".,;:"; const char *cp; @@ -82,7 +86,32 @@ const char *goal; lock_mouse_cursor(TRUE); #endif for (;;) { + + if (show_goal_msg) { + pline("Move cursor to %s:", goal); + curs(WIN_MAP, cx, cy); + flush_screen(0); + show_goal_msg = FALSE; + } else if (auto_msg && !msg_given) { + coord cc; + int sym = 0; + char tmpbuf[BUFSZ]; + char *firstmatch = NULL; + cc.x = cx; + cc.y = cy; + if (do_screen_description(cc, TRUE, sym, tmpbuf, &firstmatch)) { + /* there may be an encoded glyph */ + putmixed(WIN_MESSAGE, 0, tmpbuf); + curs(WIN_MAP, cx, cy); + flush_screen(0); + } + } + c = nh_poskey(&tx, &ty, &sidx); + + if (auto_msg) + msg_given = FALSE; + if (c == '\033') { cx = cy = -10; msg_given = TRUE; /* force clear */ @@ -142,8 +171,20 @@ const char *goal; else /* ^R */ docrt(); /* redraw */ /* update message window to reflect that we're still targetting */ - pline("Move cursor to %s:", goal); + show_goal_msg = TRUE; msg_given = TRUE; + } else if (c == '#') { + auto_msg = !auto_msg; + pline("Automatic description %sis %s.", + flags.verbose ? "of features under cursor " : "", + auto_msg ? "on" : "off"); + if (!auto_msg) show_goal_msg = TRUE; + msg_given = TRUE; + goto nxtc; + } else if (c == '@') { + cx = u.ux; + cy = u.uy; + goto nxtc; } else { if (!index(quitchars, c)) { char matching[MAXPCHARS]; diff --git a/src/pager.c b/src/pager.c index 459a6daf4..af36ba6e0 100644 --- a/src/pager.c +++ b/src/pager.c @@ -437,6 +437,229 @@ bad_data_file: impossible("'data' file in wrong format"); (void) dlb_fclose(fp); } +int +do_screen_description(cc, looked, sym, out_str, firstmatch) +coord cc; +boolean looked; +int sym; +char *out_str; +const char **firstmatch; +{ + boolean need_to_look = FALSE; + int glyph; + char look_buf[BUFSZ], prefix[BUFSZ]; + int found = 0; /* count of matching syms found */ + int i; + int skipped_venom = 0; + boolean hit_trap; + const char *x_str; + static const char *mon_interior = "the interior of a monster"; + struct permonst *pm = NULL; + + if (looked) { + int oc, so; + unsigned os; + + glyph = glyph_at(cc.x,cc.y); + + /* Convert the glyph at the selected position to a symbol. */ + so = mapglyph(glyph, &sym, &oc, &os, cc.x, cc.y); + } + + if (looked) + Sprintf(prefix, "%s ", encglyph(glyph)); + else + Sprintf(prefix, "%c ", sym); + + /* + * Check all the possibilities, saving all explanations in a buffer. + * When all have been checked then the string is printed. + */ + + /* Check for monsters */ + for (i = 0; i < MAXMCLASSES; i++) { + if (sym == ((looked) ? + showsyms[i + SYM_OFF_M] : def_monsyms[i].sym) && + def_monsyms[i].explain) { + need_to_look = TRUE; + if (!found) { + Sprintf(out_str, "%s%s", + prefix, an(def_monsyms[i].explain)); + *firstmatch = def_monsyms[i].explain; + found++; + } else { + found += append_str(out_str, an(def_monsyms[i].explain)); + } + } + } + /* handle '@' as a special case if it refers to you and you're + playing a character which isn't normally displayed by that + symbol; firstmatch is assumed to already be set for '@' */ + if (((looked) ? + (sym == showsyms[S_HUMAN + SYM_OFF_M] && cc.x == u.ux && cc.y == u.uy) : + (sym == def_monsyms[S_HUMAN].sym && !flags.showrace)) && + !(Race_if(PM_HUMAN) || Race_if(PM_ELF)) && !Upolyd) + found += append_str(out_str, "you"); /* tack on "or you" */ + + /* + * Special case: if identifying from the screen, and we're swallowed, + * and looking at something other than our own symbol, then just say + * "the interior of a monster". + */ + if (u.uswallow && (looked) && is_swallow_sym(sym)) { + if (!found) { + Sprintf(out_str, "%s%s", + prefix, mon_interior); + *firstmatch = mon_interior; + } else { + found += append_str(out_str, mon_interior); + } + need_to_look = TRUE; + } + + /* Now check for objects */ + for (i = 1; i < MAXOCLASSES; i++) { + if (sym == ((looked) ? + showsyms[i + SYM_OFF_O] : def_oc_syms[i].sym)) { + need_to_look = TRUE; + if ((looked) && i == VENOM_CLASS) { + skipped_venom++; + continue; + } + if (!found) { + Sprintf(out_str, "%s%s", + prefix, an(def_oc_syms[i].explain)); + *firstmatch = def_oc_syms[i].explain; + found++; + } else { + found += append_str(out_str, an(def_oc_syms[i].explain)); + } + } + } + + if (sym == DEF_INVISIBLE) { + if (!found) { + Sprintf(out_str, "%s%s", + prefix, + an(invisexplain)); + *firstmatch = invisexplain; + found++; + } else { + found += append_str(out_str, an(invisexplain)); + } + } + +#define is_cmap_trap(i) ((i) >= S_arrow_trap && (i) <= S_polymorph_trap) +#define is_cmap_drawbridge(i) ((i) >= S_vodbridge && (i) <= S_hcdbridge) + + /* Now check for graphics symbols */ + for (hit_trap = FALSE, i = 0; i < MAXPCHARS; i++) { + x_str = defsyms[i].explanation; + if (sym == ((looked) ? + showsyms[i] : defsyms[i].sym) && *x_str) { + /* avoid "an air", "a water", or "a floor of a room" */ + int article = (i == S_room) ? 2 : /* 2=>"the" */ + !(strcmp(x_str, "air") == 0 || /* 1=>"an" */ + strcmp(x_str, "water") == 0); /* 0=>(none)*/ + + if (!found) { + if (is_cmap_trap(i)) { + Sprintf(out_str, "%sa trap", prefix); + hit_trap = TRUE; + } else { + Sprintf(out_str, "%s%s", + prefix, + article == 2 ? the(x_str) : + article == 1 ? an(x_str) : x_str); + } + *firstmatch = x_str; + found++; + } else if (!u.uswallow && !(hit_trap && is_cmap_trap(i)) && + !(found >= 3 && is_cmap_drawbridge(i))) { + found += append_str(out_str, + article == 2 ? the(x_str) : + article == 1 ? an(x_str) : x_str); + if (is_cmap_trap(i)) hit_trap = TRUE; + } + + if (i == S_altar || is_cmap_trap(i)) + need_to_look = TRUE; + } + } + + /* Now check for warning symbols */ + for (i = 1; i < WARNCOUNT; i++) { + x_str = def_warnsyms[i].explanation; + if (sym == ((looked) ? + warnsyms[i] : def_warnsyms[i].sym)) { + if (!found) { + Sprintf(out_str, "%s%s", + prefix, def_warnsyms[i].explanation); + *firstmatch = def_warnsyms[i].explanation; + found++; + } else { + found += append_str(out_str, def_warnsyms[i].explanation); + } + /* Kludge: warning trumps boulders on the display. + Reveal the boulder too or player can get confused */ + if ((looked) && sobj_at(BOULDER, cc.x, cc.y)) + Strcat(out_str, " co-located with a boulder"); + break; /* out of for loop*/ + } + } + + /* if we ignored venom and list turned out to be short, put it back */ + if (skipped_venom && found < 2) { + x_str = def_oc_syms[VENOM_CLASS].explain; + if (!found) { + Sprintf(out_str, "%s%s", + prefix, an(x_str)); + *firstmatch = x_str; + found++; + } else { + found += append_str(out_str, an(x_str)); + } + } + + /* handle optional boulder symbol as a special case */ + if (iflags.bouldersym && sym == iflags.bouldersym) { + if (!found) { + *firstmatch = "boulder"; + Sprintf(out_str, "%s%s", + prefix, an(*firstmatch)); + found++; + } else { + found += append_str(out_str, "boulder"); + } + } + + /* + * If we are looking at the screen, follow multiple possibilities or + * an ambiguous explanation by something more detailed. + */ + if (looked) { + if (found > 1 || need_to_look) { + char monbuf[BUFSZ]; + char temp_buf[BUFSZ]; + + pm = lookat(cc.x, cc.y, look_buf, monbuf); + *firstmatch = look_buf; + if (*(*firstmatch)) { + Sprintf(temp_buf, " (%s)", *firstmatch); + (void)strncat(out_str, temp_buf, BUFSZ-strlen(out_str)-1); + found = 1; /* we have something to look up */ + } + if (monbuf[0]) { + Sprintf(temp_buf, " [seen: %s]", monbuf); + (void)strncat(out_str, temp_buf, BUFSZ-strlen(out_str)-1); + } + } + } + + return found; +} + + /* getpos() return values */ #define LOOK_TRADITIONAL 0 /* '.' -- ask about "more info?" */ #define LOOK_QUICK 1 /* ',' -- skip "more info?" */ @@ -453,19 +676,15 @@ do_look(mode, click_cc) { boolean quick = (mode == 1); /* use cursor && don't search for "more info" */ boolean clicklook = (mode == 2); /* right mouse-click method */ - char out_str[BUFSZ], look_buf[BUFSZ], prefix[BUFSZ]; - const char *x_str, *firstmatch = 0; + char out_str[BUFSZ]; + const char *firstmatch = 0; struct permonst *pm = 0; - int glyph; /* glyph at selected position */ int i, ans = 0; int sym; /* typed symbol or converted glyph */ int found; /* count of matching syms found */ coord cc; /* screen pos of unknown glyph */ boolean save_verbose; /* saved value of flags.verbose */ boolean from_screen; /* question from the screen */ - boolean need_to_look; /* need to get explan. from glyph */ - boolean hit_trap; /* true if found trap explanation */ - int skipped_venom; /* non-zero if we ignored "splash of venom" */ static const char *mon_interior = "the interior of a monster"; if (!clicklook) { @@ -506,9 +725,7 @@ do_look(mode, click_cc) */ do { /* Reset some variables. */ - need_to_look = FALSE; pm = (struct permonst *)0; - skipped_venom = 0; found = 0; out_str[0] = '\0'; @@ -529,201 +746,9 @@ do_look(mode, click_cc) } flags.verbose = FALSE; /* only print long question once */ } - glyph = glyph_at(cc.x,cc.y); - - /* Convert the glyph at the selected position to a symbol. */ - so = mapglyph(glyph, &sym, &oc, &os, cc.x, cc.y); } - if (from_screen || clicklook) - Sprintf(prefix, "%s ", encglyph(glyph)); - else - Sprintf(prefix, "%c ", sym); - - /* - * Check all the possibilities, saving all explanations in a buffer. - * When all have been checked then the string is printed. - */ - - /* Check for monsters */ - for (i = 0; i < MAXMCLASSES; i++) { - if (sym == ((from_screen || clicklook) ? - showsyms[i + SYM_OFF_M] : def_monsyms[i].sym) && - def_monsyms[i].explain) { - need_to_look = TRUE; - if (!found) { - Sprintf(out_str, "%s%s", - prefix, an(def_monsyms[i].explain)); - firstmatch = def_monsyms[i].explain; - found++; - } else { - found += append_str(out_str, an(def_monsyms[i].explain)); - } - } - } - /* handle '@' as a special case if it refers to you and you're - playing a character which isn't normally displayed by that - symbol; firstmatch is assumed to already be set for '@' */ - if (((from_screen || clicklook) ? - (sym == showsyms[S_HUMAN + SYM_OFF_M] && cc.x == u.ux && cc.y == u.uy) : - (sym == def_monsyms[S_HUMAN].sym && !flags.showrace)) && - !(Race_if(PM_HUMAN) || Race_if(PM_ELF)) && !Upolyd) - found += append_str(out_str, "you"); /* tack on "or you" */ - - /* - * Special case: if identifying from the screen, and we're swallowed, - * and looking at something other than our own symbol, then just say - * "the interior of a monster". - */ - if (u.uswallow && (from_screen || clicklook) && is_swallow_sym(sym)) { - if (!found) { - Sprintf(out_str, "%s%s", - prefix, mon_interior); - firstmatch = mon_interior; - } else { - found += append_str(out_str, mon_interior); - } - need_to_look = TRUE; - } - - /* Now check for objects */ - for (i = 1; i < MAXOCLASSES; i++) { - if (sym == ((from_screen || clicklook) ? - showsyms[i + SYM_OFF_O] : def_oc_syms[i].sym)) { - need_to_look = TRUE; - if ((from_screen || clicklook) && i == VENOM_CLASS) { - skipped_venom++; - continue; - } - if (!found) { - Sprintf(out_str, "%s%s", - prefix, an(def_oc_syms[i].explain)); - firstmatch = def_oc_syms[i].explain; - found++; - } else { - found += append_str(out_str, an(def_oc_syms[i].explain)); - } - } - } - - if (sym == DEF_INVISIBLE) { - if (!found) { - Sprintf(out_str, "%s%s", - prefix, - an(invisexplain)); - firstmatch = invisexplain; - found++; - } else { - found += append_str(out_str, an(invisexplain)); - } - } - -#define is_cmap_trap(i) ((i) >= S_arrow_trap && (i) <= S_polymorph_trap) -#define is_cmap_drawbridge(i) ((i) >= S_vodbridge && (i) <= S_hcdbridge) - - /* Now check for graphics symbols */ - for (hit_trap = FALSE, i = 0; i < MAXPCHARS; i++) { - x_str = defsyms[i].explanation; - if (sym == ((from_screen || clicklook) ? - showsyms[i] : defsyms[i].sym) && *x_str) { - /* avoid "an air", "a water", or "a floor of a room" */ - int article = (i == S_room) ? 2 : /* 2=>"the" */ - !(strcmp(x_str, "air") == 0 || /* 1=>"an" */ - strcmp(x_str, "water") == 0); /* 0=>(none)*/ - - if (!found) { - if (is_cmap_trap(i)) { - Sprintf(out_str, "%sa trap", prefix); - hit_trap = TRUE; - } else { - Sprintf(out_str, "%s%s", - prefix, - article == 2 ? the(x_str) : - article == 1 ? an(x_str) : x_str); - } - firstmatch = x_str; - found++; - } else if (!u.uswallow && !(hit_trap && is_cmap_trap(i)) && - !(found >= 3 && is_cmap_drawbridge(i))) { - found += append_str(out_str, - article == 2 ? the(x_str) : - article == 1 ? an(x_str) : x_str); - if (is_cmap_trap(i)) hit_trap = TRUE; - } - - if (i == S_altar || is_cmap_trap(i)) - need_to_look = TRUE; - } - } - - /* Now check for warning symbols */ - for (i = 1; i < WARNCOUNT; i++) { - x_str = def_warnsyms[i].explanation; - if (sym == ((from_screen || clicklook) ? - warnsyms[i] : def_warnsyms[i].sym)) { - if (!found) { - Sprintf(out_str, "%s%s", - prefix, def_warnsyms[i].explanation); - firstmatch = def_warnsyms[i].explanation; - found++; - } else { - found += append_str(out_str, def_warnsyms[i].explanation); - } - /* Kludge: warning trumps boulders on the display. - Reveal the boulder too or player can get confused */ - if ((from_screen || clicklook) && sobj_at(BOULDER, cc.x, cc.y)) - Strcat(out_str, " co-located with a boulder"); - break; /* out of for loop*/ - } - } - - /* if we ignored venom and list turned out to be short, put it back */ - if (skipped_venom && found < 2) { - x_str = def_oc_syms[VENOM_CLASS].explain; - if (!found) { - Sprintf(out_str, "%s%s", - prefix, an(x_str)); - firstmatch = x_str; - found++; - } else { - found += append_str(out_str, an(x_str)); - } - } - - /* handle optional boulder symbol as a special case */ - if (iflags.bouldersym && sym == iflags.bouldersym) { - if (!found) { - firstmatch = "boulder"; - Sprintf(out_str, "%s%s", - prefix, an(firstmatch)); - found++; - } else { - found += append_str(out_str, "boulder"); - } - } - - /* - * If we are looking at the screen, follow multiple possibilities or - * an ambiguous explanation by something more detailed. - */ - if (from_screen || clicklook) { - if (found > 1 || need_to_look) { - char monbuf[BUFSZ]; - char temp_buf[BUFSZ]; - - pm = lookat(cc.x, cc.y, look_buf, monbuf); - firstmatch = look_buf; - if (*firstmatch) { - Sprintf(temp_buf, " (%s)", firstmatch); - (void)strncat(out_str, temp_buf, BUFSZ-strlen(out_str)-1); - found = 1; /* we have something to look up */ - } - if (monbuf[0]) { - Sprintf(temp_buf, " [seen: %s]", monbuf); - (void)strncat(out_str, temp_buf, BUFSZ-strlen(out_str)-1); - } - } - } + found = do_screen_description(cc, (from_screen||clicklook), sym, out_str, &firstmatch); /* Finally, print out our explanation. */ if (found) { From a335f8306f29739dd1ea1172e9d973bb12fd326e Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 11 Mar 2015 19:56:34 +0200 Subject: [PATCH 075/354] Add MAX_STATUENAME_RANK sysconf setting MAX_STATUENAME_RANK tells how many score file entries to use for random statue names. --- doc/Guidebook.mn | 4 ++++ include/sys.h | 1 + src/files.c | 7 +++++++ src/sys.c | 1 + src/topten.c | 2 +- sys/unix/sysconf | 3 +++ 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 8ce5dbaad..4c499ac96 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2945,6 +2945,10 @@ Minimum number of points to get an entry in the score file. PERS_IS_UID 0 or 1 to use user names or numeric userids, respectively, to identify unique people for the score file. +.lp +MAX_STATUENAME_RANK +Maximum number of score file entries to use for random statue names +(default is 10). .hn 1 Scoring .pg diff --git a/include/sys.h b/include/sys.h index 713e33a55..8358021a2 100644 --- a/include/sys.h +++ b/include/sys.h @@ -22,6 +22,7 @@ struct sysopt { int pers_is_uid; int entrymax; int pointsmin; + int tt_oname_maxrank; #ifdef PANICTRACE /* panic options */ char *gdbpath; diff --git a/src/files.c b/src/files.c index 2cae9fb7f..d4c216276 100644 --- a/src/files.c +++ b/src/files.c @@ -2209,6 +2209,13 @@ int src; return 0; } sysopt.pointsmin = n; + } else if (src == SET_IN_SYS && match_varname(buf, "MAX_STATUENAME_RANK", 10)) { + n = atoi(bufp); + if (n < 1) { + raw_printf("Illegal value in MAX_STATUENAME_RANK (minimum is 1)."); + return 0; + } + sysopt.tt_oname_maxrank = n; # ifdef PANICTRACE } else if (src == SET_IN_SYS && match_varname(buf, "PANICTRACE_LIBC", 15)) { diff --git a/src/sys.c b/src/sys.c index 5f17a0a91..14e0aa642 100644 --- a/src/sys.c +++ b/src/sys.c @@ -29,6 +29,7 @@ sys_early_init(){ sysopt.entrymax = ENTRYMAX; sysopt.pointsmin = POINTSMIN; sysopt.pers_is_uid = PERS_IS_UID; + sysopt.tt_oname_maxrank = 10; /* sanity checks */ if(PERSMAX<1) sysopt.persmax = 1; diff --git a/src/topten.c b/src/topten.c index 58079a6de..db2e6fccb 100644 --- a/src/topten.c +++ b/src/topten.c @@ -975,7 +975,7 @@ struct obj *otmp; } tt = &tt_buf; - rank = rnd(10); + rank = rnd(sysopt.tt_oname_maxrank); pickentry: for(i = rank; i; i--) { readentry(rfile, tt); diff --git a/sys/unix/sysconf b/sys/unix/sysconf index 74e7fb1ae..cff28b04f 100644 --- a/sys/unix/sysconf +++ b/sys/unix/sysconf @@ -45,6 +45,9 @@ MAXPLAYERS=10 # numeric (1) user id. #PERS_IS_UID=1 +# Maximum number of score file entries to use for random statue names +#MAX_STATUENAME_RANK=10 + # Try to get more info in case of a program bug or crash. Using GDB can # get more information and works on more systems but requires gdb be available; # using LIBC only works if NetHack is linked with a libc that supports the From a46b7a3cf3de519c6175e781e9e98495c7765cde Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 11 Mar 2015 21:56:12 +0200 Subject: [PATCH 076/354] TTY: Implement the menu_search command When in a menu that allows selecting entries, press ':' to enter any text. Entries that match the text (via pmatch) will be toggled. --- doc/Guidebook.mn | 2 +- doc/fixes35.0 | 1 + win/tty/wintty.c | 86 ++++++++++++++++++++++++++++++++++++------------ 3 files changed, 67 insertions(+), 22 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 4c499ac96..82fa2d195 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2104,7 +2104,7 @@ Implemented by the Amiga, Gem and tty ports. Default '<'. .lp menu_search Menu character accelerator to search for a menu item. -Implemented by the Amiga, Gem and X11 ports. +Implemented by the Amiga, Gem, X11 and tty ports. Default ':'. .lp menu_select_all Menu character accelerator to select all items in a menu. diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 89646e389..2da27738f 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1097,6 +1097,7 @@ win32tty: support for 'selectsaved' option for menu of existing save files to choose from at game startup tty: add window port routines for saving/restoring message history tty: enhanced role, race, &c selection at start of new game +tty: implement : (menu_search) command smartphone: added "Type Cmd" command that allows to type arbitrary commands using phone keypad smartphone: added Q(quiver) command to "Attack" layout diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 19af943b9..a201218e7 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -201,6 +201,7 @@ static const char default_menu_cmds[] = { MENU_SELECT_PAGE, MENU_UNSELECT_PAGE, MENU_INVERT_PAGE, + MENU_SEARCH, 0 /* null terminator */ }; @@ -1228,6 +1229,42 @@ tty_clear_nhwindow(window) cw->curx = cw->cury = 0; } + +boolean +toggle_menu_curr(window, curr, lineno, in_view, counting, count) +winid window; +tty_menu_item *curr; +int lineno; +boolean in_view, counting; +long count; +{ + if (curr->selected) { + if (counting && count > 0) { + curr->count = count; + if (in_view) set_item_state(window, lineno, curr); + return TRUE; + } else { /* change state */ + curr->selected = FALSE; + curr->count = -1L; + if (in_view) set_item_state(window, lineno, curr); + return TRUE; + } + } else { /* !selected */ + if (counting && count > 0) { + curr->count = count; + curr->selected = TRUE; + if (in_view) set_item_state(window, lineno, curr); + return TRUE; + } else if (!counting) { + curr->selected = TRUE; + if (in_view) set_item_state(window, lineno, curr); + return TRUE; + } + /* do nothing counting&&count==0 */ + } + return FALSE; +} + STATIC_OVL void dmore(cw, s) register struct WinDesc *cw; @@ -1600,6 +1637,33 @@ struct WinDesc *cw; if (cw->how == PICK_ANY) invert_all(window, page_start, page_end, 0); break; + case MENU_SEARCH: + if (cw->how == PICK_NONE) { + tty_nhbell(); + break; + } else { + char searchbuf[BUFSZ], tmpbuf[BUFSZ]; + boolean on_curr_page = FALSE; + int lineno = 0; + tty_getlin("Search for:", tmpbuf); + if (!tmpbuf || tmpbuf[0] == '\033') break; + Sprintf(searchbuf, "*%s*", tmpbuf); + for (curr = cw->mlist; curr; curr = curr->next) { + if (on_curr_page) lineno++; + if (curr == page_start) + on_curr_page = TRUE; + else if (curr == page_end) + on_curr_page = FALSE; + if (curr->identifier.a_void && pmatch(searchbuf, curr->str)) { + toggle_menu_curr(window, curr, lineno, on_curr_page, counting, count); + if (cw->how == PICK_ONE) { + finished = TRUE; + break; + } + } + } + } + break; default: if (cw->how == PICK_NONE || !index(resp, morc)) { /* unacceptable input received */ @@ -1618,27 +1682,7 @@ struct WinDesc *cw; curr != page_end; n++, curr = curr->next) if (morc == curr->selector) { - if (curr->selected) { - if (counting && count > 0) { - curr->count = count; - set_item_state(window, n, curr); - } else { /* change state */ - curr->selected = FALSE; - curr->count = -1L; - set_item_state(window, n, curr); - } - } else { /* !selected */ - if (counting && count > 0) { - curr->count = count; - curr->selected = TRUE; - set_item_state(window, n, curr); - } else if (!counting) { - curr->selected = TRUE; - set_item_state(window, n, curr); - } - /* do nothing counting&&count==0 */ - } - + toggle_menu_curr(window, curr, n, TRUE, counting, count); if (cw->how == PICK_ONE) finished = TRUE; break; /* from `for' loop */ } From b889a4b938c9535f6012139a70ee926b44cc0971 Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 11 Mar 2015 21:57:36 -0400 Subject: [PATCH 077/354] from ais523 list: charge for boulder filling pit --- doc/fixes35.0 | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 2da27738f..4ad731e36 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -873,6 +873,7 @@ data.base dagger attribution started with spaces instead of tabs remove 'if (Deaf)' guards preceding You_hear which already checks deafness tse a menu to loot multiple containers do_look() in post-3.4.3 used glyph prior to setting it in pager.c +charge for a boulder that fills a pit in shop Platform- and/or Interface-Specific Fixes From a46ad54b1dff32e3b789d7a4cdeefc9b5d790bd0 Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 11 Mar 2015 23:04:02 -0400 Subject: [PATCH 078/354] charge for a boulder that fills a pit in shop Changes to be committed: modified: src/do.c From the email sent by ais523 earlier: > You aren't charged for digging a pit below an unpaid boulder > (causing the boulder to fill the pit). --- src/do.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/do.c b/src/do.c index 30cfb77f1..3069a4047 100644 --- a/src/do.c +++ b/src/do.c @@ -179,7 +179,7 @@ const char *verb; } } deltrap(t); - obfree(obj, (struct obj *)0); + useupf(obj, 1L); bury_objs(x, y); newsym(x,y); return TRUE; From 400d842a8febb7c4e450424f372c78b832cc8547 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 12 Mar 2015 17:57:13 +0200 Subject: [PATCH 079/354] Fix warnings --- include/extern.h | 1 + src/do_name.c | 2 +- src/pager.c | 10 +++------- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/include/extern.h b/include/extern.h index 0bd3aab7b..f382c4f7a 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1582,6 +1582,7 @@ E int NDECL(dowhatdoes); E char *FDECL(dowhatdoes_core,(CHAR_P, char *)); E int NDECL(dohelp); E int NDECL(dohistory); +E int FDECL(do_screen_description, (coord, BOOLEAN_P, int, char *, const char **)); E int FDECL(do_look, (int, coord *)); /* ### pcmain.c ### */ diff --git a/src/do_name.c b/src/do_name.c index ce538adb4..f1960b6ff 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -96,7 +96,7 @@ const char *goal; coord cc; int sym = 0; char tmpbuf[BUFSZ]; - char *firstmatch = NULL; + const char *firstmatch = NULL; cc.x = cx; cc.y = cy; if (do_screen_description(cc, TRUE, sym, tmpbuf, &firstmatch)) { diff --git a/src/pager.c b/src/pager.c index af36ba6e0..bb1c82e72 100644 --- a/src/pager.c +++ b/src/pager.c @@ -454,16 +454,15 @@ const char **firstmatch; boolean hit_trap; const char *x_str; static const char *mon_interior = "the interior of a monster"; - struct permonst *pm = NULL; if (looked) { - int oc, so; + int oc; unsigned os; glyph = glyph_at(cc.x,cc.y); /* Convert the glyph at the selected position to a symbol. */ - so = mapglyph(glyph, &sym, &oc, &os, cc.x, cc.y); + (void) mapglyph(glyph, &sym, &oc, &os, cc.x, cc.y); } if (looked) @@ -642,7 +641,7 @@ const char **firstmatch; char monbuf[BUFSZ]; char temp_buf[BUFSZ]; - pm = lookat(cc.x, cc.y, look_buf, monbuf); + (void) lookat(cc.x, cc.y, look_buf, monbuf); *firstmatch = look_buf; if (*(*firstmatch)) { Sprintf(temp_buf, " (%s)", *firstmatch); @@ -685,7 +684,6 @@ do_look(mode, click_cc) coord cc; /* screen pos of unknown glyph */ boolean save_verbose; /* saved value of flags.verbose */ boolean from_screen; /* question from the screen */ - static const char *mon_interior = "the interior of a monster"; if (!clicklook) { if (quick) { @@ -730,8 +728,6 @@ do_look(mode, click_cc) out_str[0] = '\0'; if (from_screen || clicklook) { - int oc, so; - unsigned os; if (from_screen) { if (flags.verbose) pline("Please move the cursor to %s.", From f8aced5480b42527d2e6bed7586501ae31b6ab0e Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 12 Mar 2015 21:35:04 +0200 Subject: [PATCH 080/354] Add Extended Logfile --- doc/fixes35.0 | 1 + include/config.h | 1 + include/decl.h | 4 ++ include/dungeon.h | 2 + include/extern.h | 1 + include/obj.h | 1 + include/you.h | 22 +++++++++ src/allmain.c | 7 +++ src/do.c | 1 + src/dungeon.c | 2 + src/end.c | 1 + src/invent.c | 13 +++++ src/mon.c | 2 + src/pray.c | 1 + src/restore.c | 6 +++ src/save.c | 1 + src/sp_lev.c | 12 +++++ src/topten.c | 107 ++++++++++++++++++++++++++++++++++++++++++ sys/unix/Makefile.top | 8 ++-- 19 files changed, 189 insertions(+), 4 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 4ad731e36..10b4a8f68 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1120,6 +1120,7 @@ adopt/adapt/improve the Paranoid_Quit patch; default is paranoid_confirm:pray paranoid_confirm:pray y to confirm #pray; supersedes prayconfirm paranoid_confirm:Remove always pick from inventory for 'R' and 'T' adopt/adapt/improve Dungeon Overview +Aardvark Joe's Extended Logfile Code Cleanup and Reorganization diff --git a/include/config.h b/include/config.h index 930bd549c..d8c96af14 100644 --- a/include/config.h +++ b/include/config.h @@ -187,6 +187,7 @@ #endif #define LOGFILE "logfile" /* larger file for debugging purposes */ +#define XLOGFILE "xlogfile" /* even larger logfile */ #define NEWS "news" /* the file containing the latest hack news */ #define PANICLOG "paniclog" /* log of panic and impossible events */ diff --git a/include/decl.h b/include/decl.h index 4591226e4..2071277dc 100644 --- a/include/decl.h +++ b/include/decl.h @@ -67,6 +67,8 @@ E struct dgn_topology { /* special dungeon levels for speed */ xchar d_mines_dnum, d_quest_dnum; d_level d_qstart_level, d_qlocate_level, d_nemesis_level; d_level d_knox_level; + d_level d_mineend_level; + d_level d_sokoend_level; } dungeon_topology; /* macros for accesing the dungeon levels by their old names */ #define oracle_level (dungeon_topology.d_oracle_level) @@ -97,6 +99,8 @@ E struct dgn_topology { /* special dungeon levels for speed */ #define qlocate_level (dungeon_topology.d_qlocate_level) #define nemesis_level (dungeon_topology.d_nemesis_level) #define knox_level (dungeon_topology.d_knox_level) +#define mineend_level (dungeon_topology.d_mineend_level) +#define sokoend_level (dungeon_topology.d_sokoend_level) E NEARDATA stairway dnstair, upstair; /* stairs up and down */ #define xdnstair (dnstair.sx) diff --git a/include/dungeon.h b/include/dungeon.h index f2bf75ef6..3607649b0 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -122,6 +122,8 @@ typedef struct branch { #define Is_qlocate(x) (on_level(x, &qlocate_level)) #define Is_nemesis(x) (on_level(x, &nemesis_level)) #define Is_knox(x) (on_level(x, &knox_level)) +#define Is_mineend_level(x) (on_level(x, &mineend_level)) +#define Is_sokoend_level(x) (on_level(x, &sokoend_level)) #define In_sokoban(x) ((x)->dnum == sokoban_dnum) #define Inhell In_hell(&u.uz) /* now gehennom */ diff --git a/include/extern.h b/include/extern.h index f382c4f7a..7e222778f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -26,6 +26,7 @@ E void NDECL(stop_occupation); E void NDECL(display_gamewindows); E void NDECL(newgame); E void FDECL(welcome, (BOOLEAN_P)); +E time_t NDECL(get_realtime); /* ### apply.c ### */ diff --git a/include/obj.h b/include/obj.h index fe43d0878..f4fd78007 100644 --- a/include/obj.h +++ b/include/obj.h @@ -109,6 +109,7 @@ struct obj { #define leashmon corpsenm /* gets m_id of attached pet */ #define spestudied corpsenm /* # of times a spellbook has been studied */ #define fromsink corpsenm /* a potion from a sink */ +#define record_achieve_special corpsenm unsigned oeaten; /* nutrition left in food, if partly eaten */ long age; /* creation date */ long owornmask; diff --git a/include/you.h b/include/you.h index 0c343b3c4..81aba0ba4 100644 --- a/include/you.h +++ b/include/you.h @@ -53,6 +53,26 @@ struct u_event { Bitfield(ascended,1); /* has offered the Amulet */ }; +struct u_achieve { + Bitfield(amulet,1); /* touched Amulet */ + Bitfield(bell,1); /* touched Bell */ + Bitfield(book,1); /* touched Book */ + Bitfield(menorah,1); /* touched Candelabrum */ + Bitfield(enter_gehennom,1); /* entered Gehennom (or Valley) by any means */ + Bitfield(ascended,1); /* not quite the same as u.uevent.ascended */ + Bitfield(mines_luckstone,1); /* got a luckstone at end of mines */ + Bitfield(finish_sokoban,1); /* obtained the sokoban prize */ + + Bitfield(killed_medusa,1); +}; + +struct u_realtime { + time_t realtime; /* actual playing time up until the last restore */ + time_t restored; /* time the game was started or restored */ + time_t endtime; +}; + + /* KMH, conduct -- * These are voluntary challenges. Each field denotes the number of * times a challenge has been violated. @@ -306,6 +326,8 @@ struct you { /* 1 free bit! */ unsigned udg_cnt; /* how long you have been demigod */ + struct u_achieve uachieve; /* achievements */ + struct u_realtime urealtime; struct u_event uevent; /* certain events have happened */ struct u_have uhave; /* you're carrying special objects */ struct u_conduct uconduct; /* KMH, conduct */ diff --git a/src/allmain.c b/src/allmain.c index 2bb1c4240..eb1f2b69b 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -533,6 +533,13 @@ newgame() #endif program_state.something_worth_saving++; /* useful data now exists */ + u.urealtime.realtime = (time_t)0L; +#if defined(BSD) && !defined(POSIX_TYPES) + (void) time((long *)&u.urealtime.restored); +#else + (void) time(&u.urealtime.restored); +#endif + /* Success! */ welcome(TRUE); return; diff --git a/src/do.c b/src/do.c index 3069a4047..44b2a23bb 100644 --- a/src/do.c +++ b/src/do.c @@ -1316,6 +1316,7 @@ boolean at_stairs, falling, portal; #endif You_hear("groans and moans everywhere."); } else pline("It is hot here. You smell smoke..."); + u.uachieve.enter_gehennom = 1; } /* in case we've managed to bypass the Valley's stairway down */ if (Inhell && !Is_valley(&u.uz)) u.uevent.gehennom_entered = 1; diff --git a/src/dungeon.c b/src/dungeon.c index 4c8e6beeb..fd253750f 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -672,6 +672,8 @@ struct level_map { { "wizard1", &wiz1_level }, { "wizard2", &wiz2_level }, { "wizard3", &wiz3_level }, + { "minend", &mineend_level }, + { "soko1", &sokoend_level }, { X_START, &qstart_level }, { X_LOCATE, &qlocate_level }, { X_GOAL, &nemesis_level }, diff --git a/src/end.c b/src/end.c index 995ef8ec7..111fd1b3a 100644 --- a/src/end.c +++ b/src/end.c @@ -911,6 +911,7 @@ die: topten figure it out separately and possibly getting different time or even day if player is slow responding to --More-- */ endtime = getnow(); + u.urealtime.realtime += (endtime - u.urealtime.restored); /* Sometimes you die on the first move. Life's not fair. * On those rare occasions you get hosed immediately, go out diff --git a/src/invent.c b/src/invent.c index 62295915c..24213c7e3 100644 --- a/src/invent.c +++ b/src/invent.c @@ -240,15 +240,19 @@ struct obj *obj; } else if (obj->otyp == AMULET_OF_YENDOR) { if (u.uhave.amulet) impossible("already have amulet?"); u.uhave.amulet = 1; + u.uachieve.amulet = 1; } else if (obj->otyp == CANDELABRUM_OF_INVOCATION) { if (u.uhave.menorah) impossible("already have candelabrum?"); u.uhave.menorah = 1; + u.uachieve.menorah = 1; } else if (obj->otyp == BELL_OF_OPENING) { if (u.uhave.bell) impossible("already have silver bell?"); u.uhave.bell = 1; + u.uachieve.bell = 1; } else if (obj->otyp == SPE_BOOK_OF_THE_DEAD) { if (u.uhave.book) impossible("already have the book?"); u.uhave.book = 1; + u.uachieve.book = 1; } else if (obj->oartifact) { if (is_quest_artifact(obj)) { if (u.uhave.questart) @@ -258,6 +262,15 @@ struct obj *obj; } set_artifact_intrinsic(obj, 1, W_ART); } + if(obj->otyp == LUCKSTONE && obj->record_achieve_special) { + u.uachieve.mines_luckstone = 1; + obj->record_achieve_special = 0; + } else if((obj->otyp == AMULET_OF_REFLECTION || + obj->otyp == BAG_OF_HOLDING) && + obj->record_achieve_special) { + u.uachieve.finish_sokoban = 1; + obj->record_achieve_special = 0; + } } /* diff --git a/src/mon.c b/src/mon.c index 49f6282dc..b848e7586 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1604,6 +1604,8 @@ register struct monst *mtmp; } if(mtmp->iswiz) wizdead(); if(mtmp->data->msound == MS_NEMESIS) nemdead(); + if(mtmp->data == &mons[PM_MEDUSA]) + u.uachieve.killed_medusa = 1; if(glyph_is_invisible(levl[mtmp->mx][mtmp->my].glyph)) unmap_object(mtmp->mx, mtmp->my); m_detach(mtmp, mptr); diff --git a/src/pray.c b/src/pray.c index d2b24c00a..ffdee9b49 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1373,6 +1373,7 @@ dosacrifice() done(ESCAPED); } else { /* super big win */ adjalign(10); + u.uachieve.ascended = 1; pline("An invisible choir sings, and you are bathed in radiance..."); godvoice(altaralign, "Congratulations, mortal!"); display_nhwindow(WIN_MESSAGE, FALSE); diff --git a/src/restore.c b/src/restore.c index af974d147..f7707f5ed 100644 --- a/src/restore.c +++ b/src/restore.c @@ -554,6 +554,12 @@ unsigned int *stuckid, *steedid; mread(fd, (genericptr_t) timebuf, 14); timebuf[14] = '\0'; ubirthday = time_from_yyyymmddhhmmss(timebuf); +#if defined(BSD) && !defined(POSIX_TYPES) + (void) time((long *)&u.urealtime.restored); +#else + (void) time(&u.urealtime.restored); +#endif + set_uasmon(); #ifdef CLIPPING diff --git a/src/save.c b/src/save.c index b220f945d..1c9dea6e6 100644 --- a/src/save.c +++ b/src/save.c @@ -307,6 +307,7 @@ register int fd, mode; #ifdef SYSFLAGS bwrite(fd, (genericptr_t) &sysflags, sizeof(struct sysflag)); #endif + u.urealtime.realtime += (getnow() - u.urealtime.restored); bwrite(fd, (genericptr_t) &u, sizeof(struct you)); bwrite(fd, yyyymmddhhmmss(ubirthday), 14); save_killers(fd, mode); diff --git a/src/sp_lev.c b/src/sp_lev.c index 6be2c9713..623504855 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -1062,6 +1062,18 @@ struct mkroom *croom; mongone(was); } + /* Nasty hack here: try to determine if this is the Mines or Sokoban + * "prize" and then set record_achieve_special (maps to corpsenm) + * for the object. That field will later be checked to find out if + * the player obtained the prize. */ + if(otmp->otyp == LUCKSTONE && Is_mineend_level(&u.uz)) { + otmp->record_achieve_special = 1; + } else if((otmp->otyp == AMULET_OF_REFLECTION || + otmp->otyp == BAG_OF_HOLDING) && + Is_sokoend_level(&u.uz)) { + otmp->record_achieve_special = 1; + } + stackobj(otmp); } /* if (rn2(100) < o->chance) */ diff --git a/src/topten.c b/src/topten.c index db2e6fccb..cc4aefbe1 100644 --- a/src/topten.c +++ b/src/topten.c @@ -65,6 +65,9 @@ STATIC_DCL void FDECL(outentry, (int,struct toptenentry *,BOOLEAN_P)); STATIC_DCL void FDECL(discardexcess, (FILE *)); STATIC_DCL void FDECL(readentry, (FILE *,struct toptenentry *)); STATIC_DCL void FDECL(writeentry, (FILE *,struct toptenentry *)); +STATIC_DCL void FDECL(writexlentry, (FILE*, struct toptenentry *)); +STATIC_DCL long FDECL(encodeconduct, (void)); +STATIC_DCL long FDECL(encodeachieve, (void)); STATIC_DCL void FDECL(free_ttlist, (struct toptenentry *)); STATIC_DCL int FDECL(classmon, (char *,BOOLEAN_P)); STATIC_DCL int FDECL(score_wanted, @@ -292,6 +295,95 @@ struct toptenentry *tt; #endif } +#define XLOG_SEP "\t" /* xlogfile field separator. */ +/* as tab is never used in eg. plname or death, no need to mangle those. */ +STATIC_OVL void +writexlentry(rfile,tt) +FILE *rfile; +struct toptenentry *tt; +{ + char buf[DTHSZ+1]; + (void)fprintf(rfile, + "version=%d.%d.%d" + XLOG_SEP "points=%ld" + XLOG_SEP "deathdnum=%d" + XLOG_SEP "deathlev=%d" + XLOG_SEP "maxlvl=%d" + XLOG_SEP "hp=%d" + XLOG_SEP "maxhp=%d" + XLOG_SEP "deaths=%d" + XLOG_SEP "deathdate=%d" + XLOG_SEP "birthdate=%d" + XLOG_SEP "uid=%d", + tt->ver_major, tt->ver_minor, tt->patchlevel, + tt->points, tt->deathdnum, tt->deathlev, + tt->maxlvl, tt->hp, tt->maxhp, tt->deaths, + tt->deathdate, tt->birthdate, tt->uid); + (void)fprintf(rfile, + XLOG_SEP "role=%s" + XLOG_SEP "race=%s" + XLOG_SEP "gender=%s" + XLOG_SEP "align=%s", + tt->plrole, tt->plrace, tt->plgend, tt->plalign); + (void)fprintf(rfile, XLOG_SEP "name=%s", plname); + (void)fprintf(rfile, XLOG_SEP "death=%s", tt->death); + (void)fprintf(rfile, XLOG_SEP "conduct=0x%lx", encodeconduct()); + (void)fprintf(rfile, XLOG_SEP "turns=%ld", moves); + (void)fprintf(rfile, XLOG_SEP "achieve=0x%lx", encodeachieve()); + (void)fprintf(rfile, XLOG_SEP "realtime=%ld", (long)u.urealtime.realtime); + (void)fprintf(rfile, XLOG_SEP "starttime=%ld", (long)ubirthday); + (void)fprintf(rfile, XLOG_SEP "endtime=%ld", (long)u.urealtime.endtime); + (void)fprintf(rfile, XLOG_SEP "gender0=%s", genders[flags.initgend].filecode); + (void)fprintf(rfile, XLOG_SEP "align0=%s", + aligns[1 - u.ualignbase[A_ORIGINAL]].filecode); + fprintf(rfile, "\n"); +} +#undef XLOG_SEP + +long +encodeconduct(void) +{ + long e = 0L; + + if(!u.uconduct.food) e |= 1L << 0; + if(!u.uconduct.unvegan) e |= 1L << 1; + if(!u.uconduct.unvegetarian) e |= 1L << 2; + if(!u.uconduct.gnostic) e |= 1L << 3; + if(!u.uconduct.weaphit) e |= 1L << 4; + if(!u.uconduct.killer) e |= 1L << 5; + if(!u.uconduct.literate) e |= 1L << 6; + if(!u.uconduct.polypiles) e |= 1L << 7; + if(!u.uconduct.polyselfs) e |= 1L << 8; + if(!u.uconduct.wishes) e |= 1L << 9; + if(!u.uconduct.wisharti) e |= 1L << 10; + if(!num_genocides()) e |= 1L << 11; + + return e; +} + +long +encodeachieve(void) +{ + long r = 0L; + + if(u.uachieve.bell) r |= 1L << 0; + if(u.uachieve.enter_gehennom) r |= 1L << 1; + if(u.uachieve.menorah) r |= 1L << 2; + if(u.uachieve.book) r |= 1L << 3; + if(u.uevent.invoked) r |= 1L << 4; + if(u.uachieve.amulet) r |= 1L << 5; + if(In_endgame(&u.uz)) r |= 1L << 6; + if(Is_astralevel(&u.uz)) r |= 1L << 7; + if(u.uachieve.ascended) r |= 1L << 8; + if(u.uachieve.mines_luckstone) r |= 1L << 9; + if(u.uachieve.finish_sokoban) r |= 1L << 10; + if(u.uachieve.killed_medusa) r |= 1L << 11; + + return r; +} + + + STATIC_OVL void free_ttlist(tt) struct toptenentry *tt; @@ -322,6 +414,9 @@ time_t when; #ifdef LOGFILE FILE *lfile; #endif /* LOGFILE */ +#ifdef XLOGFILE + FILE *xlfile; +#endif /* XLOGFILE */ /* Under DICE 3.0, this crashes the system consistently, apparently due to * corruption of *rfile somewhere. Until I figure this out, just cut out @@ -380,6 +475,7 @@ time_t when; t0->birthdate = yyyymmdd(ubirthday); t0->deathdate = yyyymmdd(when); t0->tt_next = 0; + u.urealtime.endtime = when; #ifdef UPDATE_RECORD_IN_PLACE t0->fpos = -1L; #endif @@ -395,6 +491,17 @@ time_t when; unlock_file(LOGFILE); } #endif /* LOGFILE */ +#ifdef XLOGFILE + if (lock_file(XLOGFILE, SCOREPREFIX, 10)) { + if(!(xlfile = fopen_datafile(XLOGFILE, "a", SCOREPREFIX))) { + HUP raw_print("Cannot open extended log file!"); + } else { + writexlentry(xlfile, t0); + (void) fclose(xlfile); + } + unlock_file(XLOGFILE); + } +#endif /* XLOGFILE */ if (wizard || discover) { if (how != PANICKED) HUP { diff --git a/sys/unix/Makefile.top b/sys/unix/Makefile.top index 6d94d6908..f9e474a5b 100644 --- a/sys/unix/Makefile.top +++ b/sys/unix/Makefile.top @@ -264,10 +264,10 @@ install: rootcheck $(GAME) recover $(VARDAT) dungeon spec_levs # set up the game files ( $(MAKE) dofiles ) # set up some additional files - touch $(VARDIR)/perm $(VARDIR)/record $(VARDIR)/logfile - -( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile ; \ - $(CHGRP) $(GAMEGRP) perm record logfile ; \ - chmod $(VARFILEPERM) perm record logfile ) + touch $(VARDIR)/perm $(VARDIR)/record $(VARDIR)/logfile $(VARDIR)/xlogfile + -( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile xlogfile ; \ + $(CHGRP) $(GAMEGRP) perm record logfile xlogfile ; \ + chmod $(VARFILEPERM) perm record logfile xlogfile ) true; $(POSTINSTALL) # and a reminder @echo You may also want to reinstall the man pages via the doc Makefile. From 1e76ed28ae611ea272295e745e4e3bf07560cac7 Mon Sep 17 00:00:00 2001 From: "Derek S. Ray" Date: Thu, 12 Mar 2015 22:47:44 -0400 Subject: [PATCH 081/354] Initial version of simple recipes file --- DEVEL/git_recipes.txt | 115 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 DEVEL/git_recipes.txt diff --git a/DEVEL/git_recipes.txt b/DEVEL/git_recipes.txt new file mode 100644 index 000000000..49c7a7cca --- /dev/null +++ b/DEVEL/git_recipes.txt @@ -0,0 +1,115 @@ +Git has a messy learning curve. This file is an attempt to serve as a quick +reference for basic tasks while you get up to speed. + +------------------------ + +git checkout [-f] (branch) + +Switch your local repository to be at the most recent commit of (branch). +Including -f will discard changes made in the working directory. + + +git status [-uall | -uno] + +Shows all changed files in your local repository and also a list of the ones +you have staged for commit. +Including -uall will also show you all untracked files in all subdirectories. +Including -uno will show you _no_ untracked files. + + +git log [-NUM] +git log +git log [--pretty=one] +git log (branch) + +For a full explanation of all the arguments you can pass to 'log', please see +the manual; there are a lot and these are just a few of the common ones. For +our purposes, git log will show you all the commits according to criteria +you specify: + +-NUM: The last NUM commits in this branch + : all commits between commit1 and commit2 +-pretty=one: format output as a single line for each entry +(branch): show the commits from (branch) instead of the current one + + +git add (filename) + +Adds the changes you've made in (filename) to the pre-commit staging area. +(also referred to as the 'index') + + +git commit [-a] [-m "text"] + +Commits all staged changes (in the index) to this branch in your local repo +from your current position. +Including -a will 'git add' all eligible files before doing so. +Including -m will use "text" as the commit message instead of opening an +editor window for you to create one. + + +git push [--all] [-u origin (branch)] + +Sends all your commits for the current branch to the centralized repo. +Including --all will send the commits for _all_ branches. +Specifying -u is only needed the first time you push (branch) that you +created; it establishes the connection between local and remote for that +branch. + + +git reset [--hard] (filename) + +Without any parameters, unstages the changes for (filename) from the index; +does not change the working tree. This is the equivalent of the command +git reset --mixed (filename); git reset --soft (filename) has no effect. + +With --hard, unstages (filename) from the index and reverts (filename) in +the working tree to the most recent commit. + +*** WARNING *** --hard _will_ throw away your changes. + + +[DSR: I'm hesitant about including this command because you can trash stuff +with it. But at the same time, for people who are adapting to a commit not +also automatically being a send, it's nice for them to know how to undo one in +case they do something wrong. thoughts?] + +git reset [--soft | --mixed | --hard] HEAD~1 + +*** WARNING *** Never, EVER do this to a commit that you have already pushed; +you will be rewriting history on other people's machines and this will +generally turn out very poorly. + +With --soft, undoes the most recent 'git commit' action, but leaves the +changes in the index and in the working directory. + +With --mixed, does everything --soft does but also unstages the changes from +the index. If you don't specify one of the three, reset will assume this. + +With --hard, does everything --mixed does but also reverts the working tree to +the prior commit. + +*** WARNING *** --hard will effectively delete a commit and "lose" the changes. + + +git fetch [-a] + +Retrieve commits from the remote repository to your machine. +Including -a will get commits for all branches. + + +git pull + +Incorporate any fetched commits for the current branch into your repository +and update your position accordingly. + + +git merge (branch) [--no-commit] + +Merges all the changes from (branch) since it last diverged from a common +ancestor into your current branch. + +With --no-commit, does not automatically create a merge entry in the log but +leaves all the merged files in your working directory; to complete the merge +you must commit them manually later (likely after you have edited them). + From 75e6fc27dbb4344942fb143b8b631e5604790e91 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 13 Mar 2015 01:02:09 -0400 Subject: [PATCH 082/354] abuse wisdom in keeping with Rider eating msg The death message for eating a Rider is "unwisely tried to eat...", but it doesn't abuse Wisdom (potentially relevant if you lifesave) --- doc/fixes35.0 | 1 + src/eat.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 4ad731e36..3ac75e94e 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -874,6 +874,7 @@ remove 'if (Deaf)' guards preceding You_hear which already checks deafness tse a menu to loot multiple containers do_look() in post-3.4.3 used glyph prior to setting it in pager.c charge for a boulder that fills a pit in shop +abuse wisdom in keeping with Rider eating message Platform- and/or Interface-Specific Fixes diff --git a/src/eat.c b/src/eat.c index 320fa2351..793925fb7 100644 --- a/src/eat.c +++ b/src/eat.c @@ -659,6 +659,8 @@ register int pm; mons[pm].mname); killer.format = NO_KILLER_PREFIX; done(DIED); + /* life-saving needed to reach here */ + exercise(A_WIS, FALSE); /* It so happens that since we know these monsters */ /* cannot appear in tins, context.victual.piece will always */ /* be what we want, which is not generally true. */ From da83545660f955fa55230c431b48f5583e5de411 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 13 Mar 2015 07:33:32 -0400 Subject: [PATCH 083/354] "swallowed whole" was preceded by "You bite into" Another reported by ais523: The death message "swallowed %s whole" is preceded by "You bite into %s."; these contradict. --- doc/fixes35.0 | 2 ++ src/uhitm.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 3ac75e94e..614bbe57f 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -875,6 +875,8 @@ tse a menu to loot multiple containers do_look() in post-3.4.3 used glyph prior to setting it in pager.c charge for a boulder that fills a pit in shop abuse wisdom in keeping with Rider eating message +message inconsistency: death message "swallowed whole" was preceded + by "You bite into" Platform- and/or Interface-Specific Fixes diff --git a/src/uhitm.c b/src/uhitm.c index 21de567e5..80f38addf 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1822,7 +1822,7 @@ register struct attack *mattk; const char *mname = pd->mname; if (!type_is_pname(pd)) mname = an(mname); - You("bite into %s.", mon_nam(mdef)); + You("englut %s.", mon_nam(mdef)); Sprintf(kbuf, "swallowing %s whole", mname); instapetrify(kbuf); } else { From ece3385900822518c00610c05c4dfa3163201e00 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 13 Mar 2015 22:27:09 -0400 Subject: [PATCH 084/354] fix messaging in obstructed() in lock.c From ais523's recent list of bugs: If a long worm tail is blocking the door, and you're blind and not telepathic, attempting to close the door marks the position of its head. From an email received in late September 2014 before the git conversion: > I was trying to close a door, not noticing that there was a garter > snake there, and this message resulted: > The garter snake stands in the way! > I haven't tried it with any other monsters without feet, but > "stands in the way" appears to be the wrong way to describe > this situation... Both of the above were found in the same function in lock.c --- doc/fixes35.0 | 1 + src/lock.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 614bbe57f..ad8117820 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -877,6 +877,7 @@ charge for a boulder that fills a pit in shop abuse wisdom in keeping with Rider eating message message inconsistency: death message "swallowed whole" was preceded by "You bite into" +improve the messaging when a monster you can't see is causing an obstruction Platform- and/or Interface-Specific Fixes diff --git a/src/lock.c b/src/lock.c index 91e0f0728..b57d9eb85 100644 --- a/src/lock.c +++ b/src/lock.c @@ -627,13 +627,16 @@ register int x, y; boolean quietly; { register struct monst *mtmp = m_at(x, y); + boolean is_worm_tail = ((mtmp->mx != x) || (mtmp->my != y)); if(mtmp && mtmp->m_ap_type != M_AP_FURNITURE) { if (mtmp->m_ap_type == M_AP_OBJECT) goto objhere; - if (!quietly) pline("%s stands in the way!", !canspotmon(mtmp) ? - "Some creature" : Monnam(mtmp)); + if (!quietly) pline("%s %s in the way!", + is_worm_tail ? "Something" : + !canspotmon(mtmp) ? "Some creature" : Monnam(mtmp), + slithy(mtmp->data) ? "is situated" : "stands"); if (!canspotmon(mtmp)) - map_invisible(mtmp->mx, mtmp->my); + map_invisible(x, y); return(TRUE); } if (OBJ_AT(x, y)) { From f799bffbb2901b28e6ccd982db9e4d8e6fb56193 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 14 Mar 2015 09:43:07 -0400 Subject: [PATCH 085/354] Additional obstruction messaging fixup --- src/lock.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/lock.c b/src/lock.c index b57d9eb85..3de76fe66 100644 --- a/src/lock.c +++ b/src/lock.c @@ -627,14 +627,21 @@ register int x, y; boolean quietly; { register struct monst *mtmp = m_at(x, y); - boolean is_worm_tail = ((mtmp->mx != x) || (mtmp->my != y)); if(mtmp && mtmp->m_ap_type != M_AP_FURNITURE) { if (mtmp->m_ap_type == M_AP_OBJECT) goto objhere; - if (!quietly) pline("%s %s in the way!", - is_worm_tail ? "Something" : - !canspotmon(mtmp) ? "Some creature" : Monnam(mtmp), - slithy(mtmp->data) ? "is situated" : "stands"); + if (!quietly) { + if ((mtmp->mx != x) || (mtmp->my != y)) { + /* worm tail */ + pline("%s%s blocks the way!", + !canspotmon(mtmp) ? Something : + s_suffix(Monnam(mtmp)), + !canspotmon(mtmp) ? "" : " tail"); + } else { + pline("%s blocks the way!", + !canspotmon(mtmp) ? "Some creature" : Monnam(mtmp)); + } + } if (!canspotmon(mtmp)) map_invisible(x, y); return(TRUE); From 3bbbb01c53d7dca5bb36cba84425374aedf945c4 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 15 Mar 2015 09:53:34 +0200 Subject: [PATCH 086/354] Death talks in CAPITAL LETTERS --- include/extern.h | 1 + src/hacklib.c | 12 ++++++++++++ src/sounds.c | 10 +++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/extern.h b/include/extern.h index f382c4f7a..0a1dabe77 100644 --- a/include/extern.h +++ b/include/extern.h @@ -800,6 +800,7 @@ E boolean FDECL(letter, (CHAR_P)); E char FDECL(highc, (CHAR_P)); E char FDECL(lowc, (CHAR_P)); E char *FDECL(lcase, (char *)); +E char *FDECL(ucase, (char *)); E char *FDECL(upstart, (char *)); E char *FDECL(mungspaces, (char *)); E char *FDECL(eos, (char *)); diff --git a/src/hacklib.c b/src/hacklib.c index 4565f6d65..fd4273074 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -17,6 +17,7 @@ NetHack, except that rounddiv may call panic(). char highc (char) char lowc (char) char * lcase (char *) + char * ucase (char *) char * upstart (char *) char * mungspaces (char *) char * eos (char *) @@ -99,6 +100,17 @@ lcase(s) /* convert a string into all lowercase */ return s; } +char * +ucase(s) /* convert a string into all uppercase */ + char *s; +{ + register char *p; + + for (p = s; *p; p++) + if ('a' <= *p && *p <= 'z') *p &= ~040; + return s; +} + char * upstart(s) /* convert first character of a string to uppercase */ char *s; diff --git a/src/sounds.c b/src/sounds.c index d57904778..3b2ee2f56 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -901,7 +901,15 @@ register struct monst *mtmp; if (pline_msg) pline("%s %s", Monnam(mtmp), pline_msg); else if (mtmp->mcan && verbl_msg_mcan) verbalize1(verbl_msg_mcan); - else if (verbl_msg) verbalize1(verbl_msg); + else if (verbl_msg) { + if (ptr == &mons[PM_DEATH]) { /* Death talks in CAPITAL LETTERS */ + char tmpbuf[BUFSZ]; + Sprintf(tmpbuf, "%s", verbl_msg); + verbalize1(ucase(tmpbuf)); + } else { + verbalize1(verbl_msg); + } + } return(1); } From 6e0a3dda2ee1f25ec9235dcbd97280bc0752e833 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 15 Mar 2015 12:36:45 -0400 Subject: [PATCH 087/354] catch up on half-physical damage docs This is catching up on some things that were changed in development years ago that Dave C. suggested be documented. For the record: -The things that were evaluated and ruled out are now documented in include/youprop.h so they don't come up again. - The things that were evaluated and deemed to be susceptible to the intrinsic and thus led to a modification in the code are listed below in this commit message. Modifications: - A crystal ball exploding on being applied - Artifacts' blasting - Being a fish out of water - Being hit by Mjollnir on the return - Being thwacked by an iron ball chained to you - Boiling/freezing potions - Broken wands - Bumping head on ceiling by cursed levitation - Burning (un)holy water - Chest/door/tin traps - Dipping a lit lamp into a potion of oil - Exploding rings and wands (under all circumstances) - Exploding spellbooks - Falling downstairs - Falling into a (spiked) pit - Falling off or failing to mount a steed - Falling on a sink while levitating - Getting squished in a pit under a boulder - Hitting your foot with a bullwhip - Hitting yourself with your pick-axe - Hooking yourself with a grappling hook - iron-ball-pulling yourself out of a bear trap - Jumping/Newton's-Thirding into something solid - Kicking something that makes you go "Ouch!" - Land mine explosion - Sitting in a spiked pit - Stinking cloud damage - Thrown potion (bottle) - Zapping yourself with a wand, horn or spell - Jumping yourself out of a bear trap --- doc/fixes35.0 | 2 ++ include/youprop.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index ad8117820..5efe01fbe 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -4,6 +4,8 @@ $rcsfile: fixes35.0,v $ $Revision: 1.445 $ $Date: 2014/11/18 03:10:36 $ General Fixes and Modified Features ----------------------------------- change the dreaded "Stop eating?" to "Continue eating?" with default "no" +fix half-physical damage intrinsic protection from a number of + events and circumstances setmangry should not be called when a monster enters a bones region bad capitalization of msg when charging for something that catches light missing opthelp for use_inverse diff --git a/include/youprop.h b/include/youprop.h index a29e20bf8..1dfe3a9e9 100644 --- a/include/youprop.h +++ b/include/youprop.h @@ -286,7 +286,35 @@ * 2. it doesn't leave a mark. Marks include destruction of, or * damage to, an internal organ (including the brain), * lacerations, bruises, crushed body parts, bleeding. + * + * The following were evaluated and determined _NOT_ to be + * susceptable to Half_physical_damage protection: + * Being caught in a fireball [fire damage] + * Sitting in lava [lava damage] + * Thrown potion (acid) [acid damage] + * Splattered burning oil from thrown potion [fire damage] + * Mixing water and acid [acid damage] + * Molten lava (entering or being splashed) [lava damage] + * boiling water from a sink [fire damage] + * Fire traps [fire damage] + * Scrolls of fire (confused and otherwise) [fire damage] + * Alchemical explosion [not physical] + * System shock [shock damage] + * Bag of holding explosion [magical] + * Being undead-turned by your god [magical] + * Level-drain [magical] + * Magical explosion of a magic trap [magical] + * Sitting on a throne with a bad effect [magical] + * Contaminated water from a sink [poison/sickness] + * Contact-poisoned spellbooks [poison/sickness] + * Eating acidic/poisonous/mildly-old corpses [poison/sickness] + * Eating a poisoned weapon while polyselfed [poison/sickness] + * Engulfing a zombie or mummy (AT_ENGL in hmonas) [poison/sickness] + * Quaffed potions of sickness, lit oil, acid [poison/sickness] + * Pyrolisks' fiery gaze [fire damage] + * Any passive attack [most don't qualify] */ + #define HHalf_physical_damage u.uprops[HALF_PHDAM].intrinsic #define EHalf_physical_damage u.uprops[HALF_PHDAM].extrinsic #define Half_physical_damage (HHalf_physical_damage || EHalf_physical_damage) From 5fa4a1c82f77d70e708f4e32b2d3f8164ce135be Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 15 Mar 2015 12:59:34 -0400 Subject: [PATCH 088/354] withdraw fixes35.0 part of prior commit There was actually a fixes35.0 entry further down that covered off that particular entry already which I missed first time around. > many instances of physical damage were not taking Half_physical_damage > into account when reducing your hitpoints --- doc/fixes35.0 | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 5efe01fbe..ad8117820 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -4,8 +4,6 @@ $rcsfile: fixes35.0,v $ $Revision: 1.445 $ $Date: 2014/11/18 03:10:36 $ General Fixes and Modified Features ----------------------------------- change the dreaded "Stop eating?" to "Continue eating?" with default "no" -fix half-physical damage intrinsic protection from a number of - events and circumstances setmangry should not be called when a monster enters a bones region bad capitalization of msg when charging for something that catches light missing opthelp for use_inverse From de8e1a5a9d20be654e5cab1c35b1afea364be81d Mon Sep 17 00:00:00 2001 From: "Derek S. Ray" Date: Sun, 15 Mar 2015 14:28:01 -0400 Subject: [PATCH 089/354] Some few updates/additions; clean up formatting --- DEVEL/git_recipes.txt | 87 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 70 insertions(+), 17 deletions(-) diff --git a/DEVEL/git_recipes.txt b/DEVEL/git_recipes.txt index 49c7a7cca..71ce0e5dc 100644 --- a/DEVEL/git_recipes.txt +++ b/DEVEL/git_recipes.txt @@ -3,13 +3,13 @@ reference for basic tasks while you get up to speed. ------------------------ -git checkout [-f] (branch) +[*] git checkout [-f] (branch) Switch your local repository to be at the most recent commit of (branch). Including -f will discard changes made in the working directory. -git status [-uall | -uno] +[*] git status [-uall | -uno] Shows all changed files in your local repository and also a list of the ones you have staged for commit. @@ -17,10 +17,10 @@ Including -uall will also show you all untracked files in all subdirectories. Including -uno will show you _no_ untracked files. -git log [-NUM] -git log -git log [--pretty=one] -git log (branch) +[*] git log [-NUM] +[*] git log +[*] git log [--pretty=one] +[*] git log (branch) For a full explanation of all the arguments you can pass to 'log', please see the manual; there are a lot and these are just a few of the common ones. For @@ -33,13 +33,13 @@ you specify: (branch): show the commits from (branch) instead of the current one -git add (filename) +[*] git add (filename) Adds the changes you've made in (filename) to the pre-commit staging area. (also referred to as the 'index') -git commit [-a] [-m "text"] +[*] git commit [-a] [-m "text"] Commits all staged changes (in the index) to this branch in your local repo from your current position. @@ -48,7 +48,7 @@ Including -m will use "text" as the commit message instead of opening an editor window for you to create one. -git push [--all] [-u origin (branch)] +[*] git push [--all] [-u origin (branch)] Sends all your commits for the current branch to the centralized repo. Including --all will send the commits for _all_ branches. @@ -57,11 +57,11 @@ created; it establishes the connection between local and remote for that branch. -git reset [--hard] (filename) +[*] git reset [--hard] (filename) Without any parameters, unstages the changes for (filename) from the index; does not change the working tree. This is the equivalent of the command -git reset --mixed (filename); git reset --soft (filename) has no effect. +[*] git reset --mixed (filename); git reset --soft (filename) has no effect. With --hard, unstages (filename) from the index and reverts (filename) in the working tree to the most recent commit. @@ -74,7 +74,7 @@ with it. But at the same time, for people who are adapting to a commit not also automatically being a send, it's nice for them to know how to undo one in case they do something wrong. thoughts?] -git reset [--soft | --mixed | --hard] HEAD~1 +[*] git reset [--soft | --mixed | --hard] HEAD~1 *** WARNING *** Never, EVER do this to a commit that you have already pushed; you will be rewriting history on other people's machines and this will @@ -90,26 +90,79 @@ With --hard, does everything --mixed does but also reverts the working tree to the prior commit. *** WARNING *** --hard will effectively delete a commit and "lose" the changes. +[/end area-of-concern] -git fetch [-a] +[*] git fetch [-a] Retrieve commits from the remote repository to your machine. Including -a will get commits for all branches. +Does NOT merge them into your local repository. -git pull +[*] git pull Incorporate any fetched commits for the current branch into your repository -and update your position accordingly. +and update your position accordingly. This will create a merge commit (noting +that you merged a branch into itself). -git merge (branch) [--no-commit] +[*] git rebase [no-arguments version ONLY] + +Incorporate fetched commits for the current branch into your repository, and +replay any local commits and changes afterwards on top. + +Quality picture-pages ASCII art: + + E---F---G---H (remote changes) + / + / +(branch 'frog') A---B---C---D---E'---F' (your local changes) + +After 'git fetch' and 'git rebase', it will look like this: + + --- (remote HEAD) + | + V +(branch 'frog') A---B---C---D---E---F---G---H---E'---F' + ^ ^ + | | + -------- (to be pushed) + + +[*] git branch (branch) + +Creates a new branch from the current commit you're pointed to. +Does not automatically checkout (switch to) the branch. + + +[*] git checkout -b (branch) + +Creates a new branch from the current commit you're pointed to, and +automatically checks out that branch. + + +[*] git branch --list | [--all | -a] | [--remotes | -r] + +Lists all branches matching . +With --all instead, lists all branches (including remotely tracked ones). +With --remotes instead, lists only remote branches. + + +[*] git merge (branch) [--no-commit] Merges all the changes from (branch) since it last diverged from a common ancestor into your current branch. With --no-commit, does not automatically create a merge entry in the log but leaves all the merged files in your working directory; to complete the merge -you must commit them manually later (likely after you have edited them). +you must commit them manually later (likely after you have edited them). This +more accurately mimics the merge behavior of svn [and cvs?] + + +======================================= +Typical workflows for common activities +======================================= + +{To be added in near future: DSR 3/15} From 14525ed0c67ad95993113c56fb3e821539f04c5a Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 15 Mar 2015 18:02:26 -0700 Subject: [PATCH 090/354] DEBUG/debugpline() fixup * Replace variadic debugpline() with fixed argument debugpline0(str), debugpline1(fmt,arg), and so on so that C99 support isn't required; * showdebug() becomes a function rather than a macro and handles a bit more; * two debugpline() calls in light.c have been changed to impossible(); * DEBUGFILES macro (in sys.c) can substitute for SYSCF's DEBUGFILES setting in !SYSCF configuration (I hope that's temporary). --- include/extern.h | 5 ++- include/hack.h | 40 +++++++++-------------- src/apply.c | 4 +-- src/attrib.c | 25 +++++++------- src/bones.c | 4 +-- src/dbridge.c | 51 +++++++++++++++-------------- src/dig.c | 18 +++++------ src/dungeon.c | 4 +-- src/eat.c | 84 +++++++++++++++++++++++++----------------------- src/files.c | 53 +++++++++++++++++++++++++++++- src/light.c | 6 ++-- src/makemon.c | 17 +++++----- src/mklev.c | 6 ++-- src/mkmaze.c | 6 ++-- src/mkobj.c | 15 +++++---- src/mon.c | 4 +-- src/pickup.c | 4 +-- src/questpgr.c | 4 +-- src/restore.c | 4 +-- src/rnd.c | 10 +++--- src/save.c | 4 +-- src/shk.c | 4 +-- src/sp_lev.c | 12 +++---- src/sys.c | 20 ++++++++---- src/teleport.c | 4 +-- src/zap.c | 12 ++++--- win/tty/wintty.c | 4 +-- 27 files changed, 243 insertions(+), 181 deletions(-) diff --git a/include/extern.h b/include/extern.h index 0a1dabe77..cd8843762 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 extern.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.390 $ */ +/* NetHack 3.5 extern.h $NHDT-Date: 1426465429 2015/03/16 00:23:49 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.406 $ */ /* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -741,6 +741,9 @@ E boolean NDECL(recover_savefile); #ifdef HOLD_LOCKFILE_OPEN E void NDECL(really_close); #endif +#ifdef DEBUG +E boolean FDECL(showdebug, (const char *)); +#endif /* ### fountain.c ### */ diff --git a/include/hack.h b/include/hack.h index 7c6af5b18..c85f95d8d 100644 --- a/include/hack.h +++ b/include/hack.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 hack.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 hack.h $NHDT-Date: 1426465431 2015/03/16 00:23:51 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.52 $ */ /* NetHack 3.5 hack.h $Date: 2009/05/06 10:44:46 $ $Revision: 1.49 $ */ /* SCCS Id: @(#)hack.h 3.5 2008/03/19 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ @@ -11,32 +11,22 @@ #include "config.h" #endif +/* [DEBUG shouldn't be defined unless you know what you're doing...] */ #ifdef DEBUG -/* due to strstr(), mon.c matches makemon.c */ -# define showdebug() (sysopt.debugfiles && \ - ((sysopt.debugfiles[0] == '*') || \ - (strstr( __FILE__ , sysopt.debugfiles)))) - -/* GCC understands this syntax */ -# ifdef __GNUC__ -/* ... but whines about it anyway without these pragmas. */ -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wvariadic-macros" -# define debugpline(args...) \ - do { if (showdebug()) pline( args ); } while(0); -# pragma GCC diagnostic pop -# endif - -/* and Visual Studio understands this one */ -# ifdef _MSC_VER -# define debugpline(...) \ - do { if (showdebug()) pline(__VA_ARGS__); } while(0); -# endif - +# define ifdebug(stmt) do { if (showdebug(__FILE__)) stmt; } while (0) +/* these don't require compiler support for C99 variadic macros */ +# define debugpline0(str) ifdebug(pline(str)) +# define debugpline1(fmt,arg) ifdebug(pline(fmt,arg)) +# define debugpline2(fmt,a1,a2) ifdebug(pline(fmt,a1,a2)) +# define debugpline3(fmt,a1,a2,a3) ifdebug(pline(fmt,a1,a2,a3)) +# define debugpline4(fmt,a1,a2,a3,a4) ifdebug(pline(fmt,a1,a2,a3,a4)) #else -# define showdebug() (0) -# define debugpline(...) -#endif +# define debugpline0(str) /*empty*/ +# define debugpline1(fmt,arg) /*empty*/ +# define debugpline2(fmt,a1,a2) /*empty*/ +# define debugpline3(fmt,a1,a2,a3) /*empty*/ +# define debugpline4(fmt,a1,a2,a3,a4) /*empty*/ +#endif /*DEBUG*/ #define TELL 1 #define NOTELL 0 diff --git a/src/apply.c b/src/apply.c index 2ac4088dd..fd3193fb3 100644 --- a/src/apply.c +++ b/src/apply.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 apply.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 apply.c $NHDT-Date: 1426465431 2015/03/16 00:23:51 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.173 $ */ /* NetHack 3.5 apply.c $Date: 2012/05/01 02:22:32 $ $Revision: 1.168 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1770,7 +1770,7 @@ long timeout; char monnambuf[BUFSZ], carriedby[BUFSZ]; if (!figurine) { - debugpline("null figurine in fig_transform()"); + debugpline0("null figurine in fig_transform()"); return; } silent = (timeout != monstermoves); /* happened while away */ diff --git a/src/attrib.c b/src/attrib.c index 8bba3d61c..b9ce67596 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 attrib.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 attrib.c $NHDT-Date: 1426465433 2015/03/16 00:23:53 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.34 $ */ /* NetHack 3.5 attrib.c $Date: 2011/10/01 00:25:55 $ $Revision: 1.30 $ */ /* Copyright 1988, 1989, 1990, 1992, M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ @@ -347,7 +347,7 @@ exercise(i, inc_or_dec) int i; boolean inc_or_dec; { - debugpline("Exercise:"); + debugpline0("Exercise:"); if (i == A_INT || i == A_CHA) return; /* can't exercise these */ /* no physical exercise while polymorphed; the body's temporary */ @@ -364,7 +364,7 @@ boolean inc_or_dec; * Note: *YES* ACURR is the right one to use. */ AEXE(i) += (inc_or_dec) ? (rn2(19) > ACURR(i)) : -rn2(2); - debugpline("%s, %s AEXE = %d", + debugpline3("%s, %s AEXE = %d", (i == A_STR) ? "Str" : (i == A_WIS) ? "Wis" : (i == A_DEX) ? "Dex" : "Con", (inc_or_dec) ? "inc" : "dec", AEXE(i)); @@ -392,7 +392,7 @@ exerper() (u.uhunger > 50) ? HUNGRY : (u.uhunger > 0) ? WEAK : FAINTING; - debugpline("exerper: Hunger checks"); + debugpline0("exerper: Hunger checks"); switch (hs) { case SATIATED: exercise(A_DEX, FALSE); if (Role_if(PM_MONK)) @@ -408,7 +408,7 @@ exerper() } /* Encumberance Checks */ - debugpline("exerper: Encumber checks"); + debugpline0("exerper: Encumber checks"); switch (near_capacity()) { case MOD_ENCUMBER: exercise(A_STR, TRUE); break; case HVY_ENCUMBER: exercise(A_STR, TRUE); @@ -421,7 +421,7 @@ exerper() /* status checks */ if(!(moves % 5)) { - debugpline("exerper: Status checks"); + debugpline0("exerper: Status checks"); if ((HClairvoyant & (INTRINSIC|TIMEOUT)) && !BClairvoyant) exercise(A_WIS, TRUE); if (HRegeneration) exercise(A_STR, TRUE); @@ -453,10 +453,10 @@ exerchk() exerper(); if(moves >= context.next_attrib_check) - debugpline("exerchk: ready to test. multi = %d.", multi); + debugpline1("exerchk: ready to test. multi = %d.", multi); /* Are we ready for a test? */ if(moves >= context.next_attrib_check && !multi) { - debugpline("exerchk: testing."); + debugpline0("exerchk: testing."); /* * Law of diminishing returns (Part II): * @@ -483,7 +483,7 @@ exerchk() exercise/abuse gradually wears off without impact then */ if (Upolyd && i != A_WIS) goto nextattrib; - debugpline("exerchk: testing %s (%d).", + debugpline2("exerchk: testing %s (%d).", (i == A_STR) ? "Str" : (i == A_INT) ? "Int?" : (i == A_WIS) ? "Wis" : (i == A_DEX) ? "Dex" : (i == A_CON) ? "Con" : (i == A_CHA) ? "Cha?" : "???", @@ -497,9 +497,9 @@ exerchk() if (rn2(AVAL) > ((i != A_WIS) ? (abs(ax) * 2 / 3) : abs(ax))) goto nextattrib; - debugpline("exerchk: changing %d.", i); + debugpline1("exerchk: changing %d.", i); if(adjattrib(i, mod_val, -1)) { - debugpline("exerchk: changed %d.", i); + debugpline1("exerchk: changed %d.", i); /* if you actually changed an attrib - zero accumulation */ AEXE(i) = ax = 0; /* then print an explanation */ @@ -513,7 +513,8 @@ exerchk() AEXE(i) = (abs(ax) / 2) * mod_val; } context.next_attrib_check += rn1(200,800); - debugpline("exerchk: next check at %ld.", context.next_attrib_check); + debugpline1("exerchk: next check at %ld.", + context.next_attrib_check); } } diff --git a/src/bones.c b/src/bones.c index 269152578..9024354a2 100644 --- a/src/bones.c +++ b/src/bones.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 bones.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 bones.c $NHDT-Date: 1426465433 2015/03/16 00:23:53 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.45 $ */ /* NetHack 3.5 bones.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.39 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985,1993. */ /* NetHack may be freely redistributed. See license for details. */ @@ -584,7 +584,7 @@ getbones() if (has_mname(mtmp)) sanitize_name(MNAME(mtmp)); if (mtmp->mhpmax == DEFUNCT_MONSTER) { if (wizard) - debugpline("Removing defunct monster %s from bones.", + debugpline1("Removing defunct monster %s from bones.", mtmp->data->mname); mongone(mtmp); } else diff --git a/src/dbridge.c b/src/dbridge.c index a82805377..8c4b90031 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 dbridge.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dbridge.c $NHDT-Date: 1426465433 2015/03/16 00:23:53 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.23 $ */ /* NetHack 3.5 dbridge.c $Date: 2012/02/01 00:49:16 $ $Revision: 1.21 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -267,7 +267,7 @@ int x, y; (occupants[entitycnt].ex == x) && (occupants[entitycnt].ey == y)) break; - debugpline("entitycnt = %d", entitycnt); + debugpline1("entitycnt = %d", entitycnt); #ifdef D_DEBUG wait_synch(); #endif @@ -467,7 +467,7 @@ boolean chunks; int misses; if (chunks) - debugpline("Do chunks miss?"); + debugpline0("Do chunks miss?"); if (automiss(etmp)) return(TRUE); @@ -487,7 +487,7 @@ boolean chunks; if (is_db_wall(etmp->ex, etmp->ey)) misses -= 3; /* less airspace */ - debugpline("Miss chance = %d (out of 8)", misses); + debugpline1("Miss chance = %d (out of 8)", misses); return((boolean)((misses >= rnd(8))? TRUE : FALSE)); } @@ -516,7 +516,8 @@ struct entity *etmp; if (is_db_wall(etmp->ex, etmp->ey)) tmp -= 2; /* less room to maneuver */ - debugpline("%s to jump (%d chances in 10)", E_phrase(etmp, "try"), tmp); + debugpline2("%s to jump (%d chances in 10)", + E_phrase(etmp, "try"), tmp); return((boolean)((tmp >= rnd(10))? TRUE : FALSE)); } @@ -550,12 +551,11 @@ struct entity *etmp; pline_The("portcullis misses %s!", e_nam(etmp)); else - debugpline("The drawbridge misses %s!", - e_nam(etmp)); + debugpline1("The drawbridge misses %s!", e_nam(etmp)); if (e_survives_at(etmp, oldx, oldy)) return; else { - debugpline("Mon can't survive here"); + debugpline0("Mon can't survive here"); if (at_portcullis) must_jump = TRUE; else @@ -574,7 +574,7 @@ struct entity *etmp; if (at_portcullis) { if (e_jumps(etmp)) { relocates = TRUE; - debugpline("Jump succeeds!"); + debugpline0("Jump succeeds!"); } else { if (e_inview) pline("%s crushed by the falling portcullis!", @@ -587,7 +587,7 @@ struct entity *etmp; } } else { /* tries to jump off bridge to original square */ relocates = !e_jumps(etmp); - debugpline("Jump %s!", (relocates)? "fails" : "succeeds"); + debugpline1("Jump %s!", (relocates)? "fails" : "succeeds"); } } @@ -597,13 +597,13 @@ struct entity *etmp; * would be inaccessible (i.e. etmp started on drawbridge square) or * unnecessary (i.e. etmp started here) in such a situation. */ - debugpline("Doing relocation."); + debugpline0("Doing relocation."); newx = oldx; newy = oldy; (void)find_drawbridge(&newx, &newy); if ((newx == oldx) && (newy == oldy)) get_wall_for_db(&newx, &newy); - debugpline("Checking new square for occupancy."); + debugpline0("Checking new square for occupancy."); if (relocates && (e_at(newx, newy))) { /* @@ -614,22 +614,22 @@ struct entity *etmp; struct entity *other; other = e_at(newx, newy); - debugpline("New square is occupied by %s", e_nam(other)); + debugpline1("New square is occupied by %s", e_nam(other)); if (e_survives_at(other, newx, newy) && automiss(other)) { relocates = FALSE; /* "other" won't budge */ - debugpline("%s suicide.", E_phrase(etmp, "commit")); + debugpline1("%s suicide.", E_phrase(etmp, "commit")); } else { - debugpline("Handling %s", e_nam(other)); + debugpline1("Handling %s", e_nam(other)); while ((e_at(newx, newy) != 0) && (e_at(newx, newy) != etmp)) do_entity(other); - debugpline("Checking existence of %s", e_nam(etmp)); + debugpline1("Checking existence of %s", e_nam(etmp)); #ifdef D_DEBUG wait_synch(); #endif if (e_at(oldx, oldy) != etmp) { - debugpline("%s moved or died in recursion somewhere", + debugpline1("%s moved or died in recursion somewhere", E_phrase(etmp, "have")); #ifdef D_DEBUG wait_synch(); @@ -639,7 +639,7 @@ struct entity *etmp; } } if (relocates && !e_at(newx, newy)) {/* if e_at() entity = worm tail */ - debugpline("Moving %s", e_nam(etmp)); + debugpline1("Moving %s", e_nam(etmp)); if (!is_u(etmp)) { remove_monster(etmp->ex, etmp->ey); place_monster(etmp->emon, newx, newy); @@ -652,12 +652,12 @@ struct entity *etmp; etmp->ey = newy; e_inview = e_canseemon(etmp); } - debugpline("Final disposition of %s", e_nam(etmp)); + debugpline1("Final disposition of %s", e_nam(etmp)); #ifdef D_DEBUG wait_synch(); #endif if (is_db_wall(etmp->ex, etmp->ey)) { - debugpline("%s in portcullis chamber", E_phrase(etmp, "are")); + debugpline1("%s in portcullis chamber", E_phrase(etmp, "are")); #ifdef D_DEBUG wait_synch(); #endif @@ -678,9 +678,9 @@ struct entity *etmp; e_died(etmp, 0, CRUSHING); /* no message */ return; } - debugpline("%s in here", E_phrase(etmp, "survive")); + debugpline1("%s in here", E_phrase(etmp, "survive")); } else { - debugpline("%s on drawbridge square", E_phrase(etmp, "are")); + debugpline1("%s on drawbridge square", E_phrase(etmp, "are")); if (is_pool(etmp->ex, etmp->ey) && !e_inview) if (!Deaf) You_hear("a splash."); @@ -691,7 +691,8 @@ struct entity *etmp; E_phrase(etmp, "fall")); return; } - debugpline("%s cannot survive on the drawbridge square",E_phrase(etmp, NULL)); + debugpline1("%s cannot survive on the drawbridge square", + E_phrase(etmp, NULL)); if (is_pool(etmp->ex, etmp->ey) || is_lava(etmp->ex, etmp->ey)) if (e_inview && !is_u(etmp)) { /* drown() will supply msgs if nec. */ @@ -907,7 +908,7 @@ int x,y; if (etmp1->edata) { e_inview = e_canseemon(etmp1); if (e_missed(etmp1, TRUE)) { - debugpline("%s spared!", E_phrase(etmp1, "are")); + debugpline1("%s spared!", E_phrase(etmp1, "are")); /* if there is water or lava here, fall in now */ if (is_u(etmp1)) spoteffects(FALSE); @@ -925,7 +926,7 @@ int x,y; if (!Deaf && !is_u(etmp1) && !is_pool(x,y)) You_hear("a crushing sound."); else - debugpline("%s from shrapnel", + debugpline1("%s from shrapnel", E_phrase(etmp1, "die")); } killer.format = KILLED_BY_AN; diff --git a/src/dig.c b/src/dig.c index 1c053ec73..fa25f76a0 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 dig.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dig.c $NHDT-Date: 1426465434 2015/03/16 00:23:54 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.73 $ */ /* NetHack 3.5 dig.c $Date: 2012/02/16 03:01:37 $ $Revision: 1.67 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1689,7 +1689,7 @@ bury_an_obj(otmp) struct obj *otmp2; boolean under_ice; - debugpline("bury_an_obj: %s", xname(otmp)); + debugpline1("bury_an_obj: %s", xname(otmp)); if (otmp == uball) { unpunish(); u.utrap = rn1(50,20); @@ -1752,7 +1752,7 @@ int x, y; struct obj *otmp, *otmp2; if(level.objects[x][y] != (struct obj *)0) - debugpline("bury_objs: at %d, %d", x, y); + debugpline2("bury_objs: at <%d,%d>", x, y); for (otmp = level.objects[x][y]; otmp; otmp = otmp2) otmp2 = bury_an_obj(otmp); @@ -1769,7 +1769,7 @@ int x, y; struct obj *otmp, *otmp2, *bball; coord cc; - debugpline("unearth_objs: at %d, %d", x, y); + debugpline2("unearth_objs: at <%d,%d>", x, y); cc.x = x; cc.y = y; bball = buried_ball(&cc); for (otmp = level.buriedobjlist; otmp; otmp = otmp2) { @@ -1878,7 +1878,7 @@ void bury_monst(mtmp) struct monst *mtmp; { - debugpline("bury_monst: %s", mon_nam(mtmp)); + debugpline1("bury_monst: %s", mon_nam(mtmp)); if(canseemon(mtmp)) { if(is_flyer(mtmp->data) || is_floater(mtmp->data)) { pline_The("%s opens up, but %s is not swallowed!", @@ -1897,7 +1897,7 @@ struct monst *mtmp; void bury_you() { - debugpline("bury_you"); + debugpline0("bury_you"); if (!Levitation && !Flying) { if(u.uswallow) You_feel("a sensation like falling into a trap!"); @@ -1914,7 +1914,7 @@ bury_you() void unearth_you() { - debugpline("unearth_you"); + debugpline0("unearth_you"); u.uburied = FALSE; under_ground(0); if(!uamul || uamul->otyp != AMULET_OF_STRANGULATION) @@ -1925,7 +1925,7 @@ unearth_you() void escape_tomb() { - debugpline("escape_tomb"); + debugpline0("escape_tomb"); if ((Teleportation || can_teleport(youmonst.data)) && (Teleport_control || rn2(3) < Luck+2)) { You("attempt a teleport spell."); @@ -1957,7 +1957,7 @@ bury_obj(otmp) struct obj *otmp; { - debugpline("bury_obj"); + debugpline0("bury_obj"); if(cansee(otmp->ox, otmp->oy)) pline_The("objects on the %s tumble into a hole!", surface(otmp->ox, otmp->oy)); diff --git a/src/dungeon.c b/src/dungeon.c index 4c8e6beeb..ed87652f1 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 dungeon.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dungeon.c $NHDT-Date: 1426465434 2015/03/16 00:23:54 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.39 $ */ /* NetHack 3.5 dungeon.c $Date: 2012/04/14 08:31:05 $ $Revision: 1.34 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -81,7 +81,7 @@ dumpit() s_level *x; branch *br; - if (!showdebug()) return; + if (!showdebug(__FILE__)) return; for(i = 0; i < n_dgns; i++) { fprintf(stderr, "\n#%d \"%s\" (%s):\n", i, diff --git a/src/eat.c b/src/eat.c index 793925fb7..983f6bcec 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 eat.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 eat.c $NHDT-Date: 1426465435 2015/03/16 00:23:55 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.123 $ */ /* NetHack 3.5 eat.c $Date: 2012/02/01 00:49:16 $ $Revision: 1.116 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -284,11 +284,11 @@ recalc_wt() { struct obj *piece = context.victual.piece; - debugpline("Old weight = %d", piece->owt); - debugpline("Used time = %d, Req'd time = %d", - context.victual.usedtime, context.victual.reqtime); + debugpline1("Old weight = %d", piece->owt); + debugpline2("Used time = %d, Req'd time = %d", + context.victual.usedtime, context.victual.reqtime); piece->owt = weight(piece); - debugpline("New weight = %d", piece->owt); + debugpline1("New weight = %d", piece->owt); } void @@ -298,7 +298,7 @@ reset_eat() /* called when eating interrupted by an event */ * the round is spent eating. */ if(context.victual.eating && !context.victual.doreset) { - debugpline("reset_eat..."); + debugpline0("reset_eat..."); context.victual.doreset = TRUE; } return; @@ -313,7 +313,7 @@ register struct obj *otmp; (void) splitobj(otmp, otmp->quan - 1L); else otmp = splitobj(otmp, 1L); - debugpline("split object,"); + debugpline0("split object,"); } if (!otmp->oeaten) { @@ -374,7 +374,7 @@ struct obj *old_obj, *new_obj; STATIC_OVL void do_reset_eat() { - debugpline("do_reset_eat..."); + debugpline0("do_reset_eat..."); if (context.victual.piece) { context.victual.o_id = 0; context.victual.piece = touchfood(context.victual.piece); @@ -717,39 +717,39 @@ register struct permonst *ptr; switch (type) { case FIRE_RES: res = (ptr->mconveys & MR_FIRE) != 0; - if (res) debugpline("can get fire resistance"); + if (res) debugpline0("can get fire resistance"); break; case SLEEP_RES: res = (ptr->mconveys & MR_SLEEP) != 0; - if (res) debugpline("can get sleep resistance"); + if (res) debugpline0("can get sleep resistance"); break; case COLD_RES: res = (ptr->mconveys & MR_COLD) != 0; - if (res) debugpline("can get cold resistance"); + if (res) debugpline0("can get cold resistance"); break; case DISINT_RES: res = (ptr->mconveys & MR_DISINT) != 0; - if (res) debugpline("can get disintegration resistance"); + if (res) debugpline0("can get disintegration resistance"); break; case SHOCK_RES: /* shock (electricity) resistance */ res = (ptr->mconveys & MR_ELEC) != 0; - if (res) debugpline("can get shock resistance"); + if (res) debugpline0("can get shock resistance"); break; case POISON_RES: res = (ptr->mconveys & MR_POISON) != 0; - if (res) debugpline("can get poison resistance"); + if (res) debugpline0("can get poison resistance"); break; case TELEPORT: res = can_teleport(ptr); - if (res) debugpline("can get teleport"); + if (res) debugpline0("can get teleport"); break; case TELEPORT_CONTROL: res = control_teleport(ptr); - if (res) debugpline("can get teleport control"); + if (res) debugpline0("can get teleport control"); break; case TELEPAT: res = telepathic(ptr); - if (res) debugpline("can get telepathy"); + if (res) debugpline0("can get telepathy"); break; default: /* res stays 0 */ @@ -768,7 +768,7 @@ register struct permonst *ptr; { register int chance; - debugpline("Attempting to give intrinsic %d", type); + debugpline1("Attempting to give intrinsic %d", type); /* some intrinsics are easier to get than others */ switch (type) { case POISON_RES: @@ -797,7 +797,7 @@ register struct permonst *ptr; switch (type) { case FIRE_RES: - debugpline("Trying to give fire resistance"); + debugpline0("Trying to give fire resistance"); if(!(HFire_resistance & FROMOUTSIDE)) { You(Hallucination ? "be chillin'." : "feel a momentary chill."); @@ -805,21 +805,21 @@ register struct permonst *ptr; } break; case SLEEP_RES: - debugpline("Trying to give sleep resistance"); + debugpline0("Trying to give sleep resistance"); if(!(HSleep_resistance & FROMOUTSIDE)) { You_feel("wide awake."); HSleep_resistance |= FROMOUTSIDE; } break; case COLD_RES: - debugpline("Trying to give cold resistance"); + debugpline0("Trying to give cold resistance"); if(!(HCold_resistance & FROMOUTSIDE)) { You_feel("full of hot air."); HCold_resistance |= FROMOUTSIDE; } break; case DISINT_RES: - debugpline("Trying to give disintegration resistance"); + debugpline0("Trying to give disintegration resistance"); if(!(HDisint_resistance & FROMOUTSIDE)) { You_feel(Hallucination ? "totally together, man." : @@ -828,7 +828,7 @@ register struct permonst *ptr; } break; case SHOCK_RES: /* shock (electricity) resistance */ - debugpline("Trying to give shock resistance"); + debugpline0("Trying to give shock resistance"); if(!(HShock_resistance & FROMOUTSIDE)) { if (Hallucination) You_feel("grounded in reality."); @@ -838,7 +838,7 @@ register struct permonst *ptr; } break; case POISON_RES: - debugpline("Trying to give poison resistance"); + debugpline0("Trying to give poison resistance"); if(!(HPoison_resistance & FROMOUTSIDE)) { You_feel(Poison_resistance ? "especially healthy." : "healthy."); @@ -846,7 +846,7 @@ register struct permonst *ptr; } break; case TELEPORT: - debugpline("Trying to give teleport"); + debugpline0("Trying to give teleport"); if(!(HTeleportation & FROMOUTSIDE)) { You_feel(Hallucination ? "diffuse." : "very jumpy."); @@ -854,7 +854,7 @@ register struct permonst *ptr; } break; case TELEPORT_CONTROL: - debugpline("Trying to give teleport control"); + debugpline0("Trying to give teleport control"); if(!(HTeleport_control & FROMOUTSIDE)) { You_feel(Hallucination ? "centered in your personal space." : @@ -863,7 +863,7 @@ register struct permonst *ptr; } break; case TELEPAT: - debugpline("Trying to give telepathy"); + debugpline0("Trying to give telepathy"); if(!(HTelepat & FROMOUTSIDE)) { You_feel(Hallucination ? "in touch with the cosmos." : @@ -874,7 +874,7 @@ register struct permonst *ptr; } break; default: - debugpline("Tried to give an impossible intrinsic"); + debugpline0("Tried to give an impossible intrinsic"); break; } } @@ -1005,7 +1005,7 @@ register int pm; case PM_DISENCHANTER: /* picks an intrinsic at random and removes it; there's no feedback if hero already lacks the chosen ability */ - debugpline("using attrcurse to strip an intrinsic"); + debugpline0("using attrcurse to strip an intrinsic"); attrcurse(); break; case PM_MIND_FLAYER: @@ -1045,7 +1045,7 @@ register int pm; if (conveys_STR) { count = 1; tmp = -1; /* use -1 as fake prop index for STR */ - debugpline("\"Intrinsic\" strength, %d", tmp); + debugpline1("\"Intrinsic\" strength, %d", tmp); } for (i = 1; i <= LAST_PROP; i++) { if (!intrinsic_possible(i, ptr)) continue; @@ -1055,7 +1055,7 @@ register int pm; of keeping the old choice (note that 1 in 1 and 0 in 1 are what we want for the first candidate) */ if (!rn2(count)) { - debugpline("Intrinsic %d replacing %d", i, tmp); + debugpline2("Intrinsic %d replacing %d", i, tmp); tmp = i; } } @@ -1599,11 +1599,12 @@ start_eating(otmp) /* called as you start to eat */ { const char *old_nomovemsg, *save_nomovemsg; - debugpline("start_eating: %p (victual = %p)", otmp, context.victual.piece); - debugpline("reqtime = %d", context.victual.reqtime); - debugpline("(original reqtime = %d)", objects[otmp->otyp].oc_delay); - debugpline("nmod = %d", context.victual.nmod); - debugpline("oeaten = %d", otmp->oeaten); + debugpline2("start_eating: %lx (victual = %lx)", + (unsigned long)otmp, (unsigned long)context.victual.piece); + debugpline1("reqtime = %d", context.victual.reqtime); + debugpline1("(original reqtime = %d)", objects[otmp->otyp].oc_delay); + debugpline1("nmod = %d", context.victual.nmod); + debugpline1("oeaten = %d", otmp->oeaten); context.victual.fullwarn = context.victual.doreset = FALSE; context.victual.eating = TRUE; @@ -2443,11 +2444,14 @@ doeat() /* generic "eat" command funtion (see cmd.c) */ if (otmp->otyp == CORPSE) basenutrit = mons[otmp->corpsenm].cnutrit; else basenutrit = objects[otmp->otyp].oc_nutrition; - debugpline("before rounddiv: context.victual.reqtime == %d", context.victual.reqtime); - debugpline("oeaten == %d, basenutrit == %d", otmp->oeaten, basenutrit); + debugpline1("before rounddiv: context.victual.reqtime == %d", + context.victual.reqtime); + debugpline2("oeaten == %d, basenutrit == %d", + otmp->oeaten, basenutrit); context.victual.reqtime = (basenutrit == 0 ? 0 : rounddiv(context.victual.reqtime * (long)otmp->oeaten, basenutrit)); - debugpline("after rounddiv: context.victual.reqtime == %d", context.victual.reqtime); + debugpline1("after rounddiv: context.victual.reqtime == %d", + context.victual.reqtime); /* calculate the modulo value (nutrit. units per round eating) * note: this isn't exact - you actually lose a little nutrition * due to this method. @@ -2549,7 +2553,7 @@ register int num; { /* See comments in newuhs() for discussion on force_save_hs */ boolean iseating = (occupation == eatfood) || force_save_hs; - debugpline("lesshungry(%d)", num); + debugpline1("lesshungry(%d)", num); u.uhunger += num; if(u.uhunger >= 2000) { if (!iseating || context.victual.canchoke) { diff --git a/src/files.c b/src/files.c index d4c216276..9e9cea746 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 files.c $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.127 $ */ +/* NetHack 3.5 files.c $NHDT-Date: 1426465435 2015/03/16 00:23:55 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.133 $ */ /* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3195,4 +3195,55 @@ int ifd, ofd; /* ---------- END INTERNAL RECOVER ----------- */ #endif /*SELF_RECOVER*/ +#ifdef DEBUG +/* used by debugpline() to decide whether to issue a message + from a partiular source file; caller passes __FILE__ and we check + whether it is in the source file list supplied by SYSCF's DEBUGFILES */ +boolean +showdebug(filename) +const char *filename; +{ + const char *debugfiles, *p; + + if (!filename || !*filename) return FALSE; /* sanity precaution */ + + debugfiles = sysopt.debugfiles; + /* usual case: sysopt.debugfiles will be empty */ + if (!debugfiles || !*debugfiles) return FALSE; + + /* strip filename's path if present */ +# ifdef UNIX + if ((p = rindex(filename, '/')) != 0) filename = p + 1; +# endif +# ifdef VMS + filename = vms_basename(filename); + /* vms_basename strips off 'type' suffix as well as path and version; + we want to put suffix back (".c" assumed); since it always returns + a pointer to a static buffer, we can safely modify its result */ + Strcat((char *)filename, ".c"); +# endif + + /* + * Wildcard match will only work if there's a single pattern (which + * might be a single file name without any wildcarding) rather than + * a space-separated list. + * [to NOT do: We could step through the space-separated list and + * attempt a wildcard match against each element, but that would be + * overkill for the intended usage.] + */ + if (pmatch(debugfiles, filename)) + return TRUE; + + /* check whether filename is an element of the list */ + if ((p = strstr(debugfiles, filename)) != 0) { + int l = (int)strlen(filename); + + if ((p == debugfiles || p[-1] == ' ' || p[-1] == '/') + && (p[l] == ' ' || p[l] == '\0')) + return TRUE; + } + return FALSE; +} +#endif /*DEBUG*/ + /*files.c*/ diff --git a/src/light.c b/src/light.c index f7d43eeee..52efe9759 100644 --- a/src/light.c +++ b/src/light.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 light.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 light.c $NHDT-Date: 1426465436 2015/03/16 00:23:56 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.17 $ */ /* NetHack 3.5 light.c $Date: 2009/05/06 10:46:38 $ $Revision: 1.15 $ */ /* SCCS Id: @(#)light.c 3.5 2009/01/20 */ /* Copyright (c) Dean Luick, 1994 */ @@ -394,13 +394,13 @@ write_ls(fd, ls) ls->id = zeroany; ls->id.a_uint = otmp->o_id; if (find_oid((unsigned)ls->id.a_uint) != otmp) - debugpline("write_ls: can't find obj #%u!", ls->id.a_uint); + impossible("write_ls: can't find obj #%u!", ls->id.a_uint); } else { /* ls->type == LS_MONSTER */ mtmp = (struct monst *)ls->id.a_monst; ls->id = zeroany; ls->id.a_uint = mtmp->m_id; if (find_mid((unsigned)ls->id.a_uint, FM_EVERYWHERE) != mtmp) - debugpline("write_ls: can't find mon #%u!", ls->id.a_uint); + impossible("write_ls: can't find mon #%u!", ls->id.a_uint); } ls->flags |= LSF_NEEDS_FIXUP; bwrite(fd, (genericptr_t)ls, sizeof(light_source)); diff --git a/src/makemon.c b/src/makemon.c index afaa0140a..6ce548ea0 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 makemon.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 makemon.c $NHDT-Date: 1426465436 2015/03/16 00:23:56 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.74 $ */ /* NetHack 3.5 makemon.c $Date: 2012/01/29 00:34:33 $ $Revision: 1.69 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -93,7 +93,7 @@ register int x, y, n; int cnttmp,cntdiv; cnttmp = cnt; - debugpline("init group call x=%d,y=%d,n=%d,cnt=%d.", x, y, n, cnt); + debugpline4("init group call <%d,%d>, n=%d, cnt=%d.", x, y, n, cnt); cntdiv = ((u.ulevel < 3) ? 4 : (u.ulevel < 5) ? 2 : 1); #endif /* Tuning: cut down on swarming at low character levels [mrs] */ @@ -758,7 +758,7 @@ boolean ghostly; mvitals[mndx].born++; if ((int) mvitals[mndx].born >= lim && !(mons[mndx].geno & G_NOGEN) && !(mvitals[mndx].mvflags & G_EXTINCT)) { - if (wizard) debugpline("Automatically extinguished %s.", + if (wizard) debugpline1("Automatically extinguished %s.", makeplural(mons[mndx].mname)); mvitals[mndx].mvflags |= G_EXTINCT; reset_rndmonst(mndx); @@ -903,8 +903,8 @@ register int mmflags; already been genocided, return */ if (mvitals[mndx].mvflags & G_GENOD) return((struct monst *) 0); if (wizard && (mvitals[mndx].mvflags & G_EXTINCT)) - debugpline("Explicitly creating extinct monster %s.", - mons[mndx].mname); + debugpline1("Explicitly creating extinct monster %s.", + mons[mndx].mname); } else { /* make a random (common) monster that can survive here. * (the special levels ask for random monsters at specific @@ -916,7 +916,7 @@ register int mmflags; do { if(!(ptr = rndmonst())) { - debugpline("Warning: no monster."); + debugpline0("Warning: no monster."); return((struct monst *) 0); /* no more monsters! */ } fakemon.data = ptr; /* set up for goodpos */ @@ -1252,7 +1252,7 @@ rndmonst() } if (mndx == SPECIAL_PM) { /* evidently they've all been exterminated */ - debugpline("rndmonst: no common mons!"); + debugpline0("rndmonst: no common mons!"); return (struct permonst *)0; } /* else `mndx' now ready for use below */ zlevel = level_difficulty(); @@ -1290,7 +1290,8 @@ rndmonst() if (rndmonst_state.choice_count <= 0) { /* maybe no common mons left, or all are too weak or too strong */ - debugpline("rndmonst: choice_count=%d", rndmonst_state.choice_count); + debugpline1("rndmonst: choice_count=%d", + rndmonst_state.choice_count); return (struct permonst *)0; } diff --git a/src/mklev.c b/src/mklev.c index 2d4899984..4412d68aa 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mklev.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mklev.c $NHDT-Date: 1426465436 2015/03/16 00:23:56 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.25 $ */ /* NetHack 3.5 mklev.c $Date: 2012/02/15 01:55:33 $ $Revision: 1.20 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -684,7 +684,7 @@ makelevel() /* make a secret treasure vault, not connected to the rest */ if(do_vault()) { xchar w,h; - debugpline("trying to make a vault..."); + debugpline0("trying to make a vault..."); w = 1; h = 1; if (check_room(&vault_x, &w, &vault_y, &h, TRUE)) { @@ -1560,7 +1560,7 @@ xchar x, y; *source = u.uz; insert_branch(br, TRUE); - debugpline("Made knox portal."); + debugpline0("Made knox portal."); place_branch(br, x, y); } diff --git a/src/mkmaze.c b/src/mkmaze.c index 0cfdbe35a..87a3a870b 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mkmaze.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mkmaze.c $NHDT-Date: 1426465437 2015/03/16 00:23:57 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.20 $ */ /* NetHack 3.5 mkmaze.c $Date: 2009/05/06 10:46:56 $ $Revision: 1.18 $ */ /* SCCS Id: @(#)mkmaze.c 3.5 2007/06/18 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ @@ -589,7 +589,7 @@ register const char *s; if (x_range <= INVPOS_X_MARGIN || y_range <= INVPOS_Y_MARGIN || (x_range * y_range) <= (INVPOS_DISTANCE * INVPOS_DISTANCE)) - debugpline("inv_pos: maze is too small! (%d x %d)", + debugpline2("inv_pos: maze is too small! (%d x %d)", x_maze_max, y_maze_max); inv_pos.x = inv_pos.y = 0; /*{occupied() => invocation_pos()}*/ do { @@ -877,7 +877,7 @@ register xchar x, y, todnum, todlevel; impossible("portal on top of portal??"); return; } - debugpline("mkportal: at (%d,%d), to %s, level %d", + debugpline4("mkportal: at <%d,%d>, to %s, level %d", x, y, dungeons[todnum].dname, todlevel); ttmp->dst.dnum = todnum; ttmp->dst.dlevel = todlevel; diff --git a/src/mkobj.c b/src/mkobj.c index ddfa363d4..4092401cd 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mkobj.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mkobj.c $NHDT-Date: 1426465437 2015/03/16 00:23:57 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.77 $ */ /* NetHack 3.5 mkobj.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.70 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1521,10 +1521,9 @@ struct obj *otmp; /* Adjust the age; must be same as obj_timer_checks() for off ice*/ age = monstermoves - otmp->age; retval += age * (ROT_ICE_ADJUSTMENT-1) / ROT_ICE_ADJUSTMENT; - debugpline("The %s age has ice modifications:otmp->age = %ld, returning %ld.", - s_suffix(doname(otmp)),otmp->age, retval); - debugpline("Effective age of corpse: %ld.", - monstermoves - retval); + debugpline3("The %s age has ice modifications: otmp->age = %ld, returning %ld.", + s_suffix(doname(otmp)), otmp->age, retval); + debugpline1("Effective age of corpse: %ld.", monstermoves - retval); } return retval; } @@ -1553,7 +1552,8 @@ int force; /* 0 = no force so do checks, <0 = force off, >0 force on */ /* mark the corpse as being on ice */ otmp->on_ice = 1; - debugpline("%s is now on ice at %d,%d.", The(xname(otmp)),x,y); + debugpline3("%s is now on ice at <%d,%d>.", + The(xname(otmp)), x, y); /* Adjust the time remaining */ tleft *= ROT_ICE_ADJUSTMENT; restart_timer = TRUE; @@ -1579,7 +1579,8 @@ int force; /* 0 = no force so do checks, <0 = force off, >0 force on */ long age; otmp->on_ice = 0; - debugpline("%s is no longer on ice at %d,%d.", The(xname(otmp)),x,y); + debugpline3("%s is no longer on ice at <%d,%d>.", + The(xname(otmp)), x, y); /* Adjust the remaining time */ tleft /= ROT_ICE_ADJUSTMENT; restart_timer = TRUE; diff --git a/src/mon.c b/src/mon.c index 49f6282dc..fb0a75a57 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mon.c $NHDT-Date: 1425319883 2015/03/02 18:11:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.137 $ */ +/* NetHack 3.5 mon.c $NHDT-Date: 1426465438 2015/03/16 00:23:58 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.139 $ */ /* NetHack 3.5 mon.c $Date: 2012/05/16 02:15:10 $ $Revision: 1.126 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1260,7 +1260,7 @@ register struct monst *mtmp, *mtmp2; /* transfer the monster's inventory */ for (otmp = mtmp2->minvent; otmp; otmp = otmp->nobj) { if (otmp->where != OBJ_MINVENT || otmp->ocarry != mtmp) - debugpline("replmon: minvent inconsistency"); + debugpline0("replmon: minvent inconsistency"); otmp->ocarry = mtmp2; } mtmp->minvent = 0; diff --git a/src/pickup.c b/src/pickup.c index 0b6abf06d..7b3096c59 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 pickup.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.126 $ */ +/* NetHack 3.5 pickup.c $NHDT-Date: 1426465438 2015/03/16 00:23:58 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.130 $ */ /* NetHack 3.5 pickup.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.123 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -897,7 +897,7 @@ int how; /* type of query */ (*pick_list)->item.a_int = curr->oclass; return 1; } else { - debugpline("query_category: no single object match"); + debugpline0("query_category: no single object match"); } return 0; } diff --git a/src/questpgr.c b/src/questpgr.c index 7f51965f7..62e1ae4e4 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 questpgr.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 questpgr.c $NHDT-Date: 1426465439 2015/03/16 00:23:59 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.18 $ */ /* NetHack 3.5 questpgr.c $Date: 2012/02/02 09:18:14 $ $Revision: 1.14 $ */ /* Copyright 1991, M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ @@ -47,7 +47,7 @@ dump_qtlist() /* dump the character msg list to check appearance */ { struct qtmsg *msg; - if (!showdebug()) return; + if (!showdebug(__FILE__)) return; for (msg = qt_list.chrole; msg->msgnum > 0; msg++) { pline("msgnum %d: delivery %c", diff --git a/src/restore.c b/src/restore.c index af974d147..24a0f777c 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 restore.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 restore.c $NHDT-Date: 1426465439 2015/03/16 00:23:59 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.77 $ */ /* NetHack 3.5 restore.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.71 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1153,7 +1153,7 @@ register int fd; ++msgcount; } if (msgcount) putmsghistory((char *)0, TRUE); - debugpline("Read %d messages from savefile.", msgcount); + debugpline1("Read %d messages from savefile.", msgcount); } /* Clear all structures for object and monster ID mapping. */ diff --git a/src/rnd.c b/src/rnd.c index 662d1a275..fc7147d50 100644 --- a/src/rnd.c +++ b/src/rnd.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 rnd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 rnd.c $NHDT-Date: 1426465440 2015/03/16 00:24:00 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.8 $ */ /* NetHack 3.5 rnd.c $Date: 2009/05/06 10:47:41 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)rnd.c 3.5 2004/08/27 */ /* NetHack may be freely redistributed. See license for details. */ @@ -24,7 +24,7 @@ register int x; { #ifdef BETA if (x <= 0) { - debugpline("rn2(%d) attempted", x); + debugpline1("rn2(%d) attempted", x); return(0); } x = RND(x); @@ -42,7 +42,7 @@ register int x; /* good luck approaches 0, bad luck approaches (x-1) */ #ifdef BETA if (x <= 0) { - debugpline("rnl(%d) attempted", x); + debugpline1("rnl(%d) attempted", x); return(0); } #endif @@ -81,7 +81,7 @@ register int x; { #ifdef BETA if (x <= 0) { - debugpline("rnd(%d) attempted", x); + debugpline1("rnd(%d) attempted", x); return(1); } x = RND(x)+1; @@ -99,7 +99,7 @@ register int n, x; #ifdef BETA if (x < 0 || n < 0 || (x == 0 && n != 0)) { - debugpline("d(%d,%d) attempted", n, x); + debugpline2("d(%d,%d) attempted", n, x); return(1); } #endif diff --git a/src/save.c b/src/save.c index b220f945d..165c792db 100644 --- a/src/save.c +++ b/src/save.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 save.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.59 $ */ +/* NetHack 3.5 save.c $NHDT-Date: 1426465440 2015/03/16 00:24:00 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.61 $ */ /* NetHack 3.5 save.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.53 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1210,7 +1210,7 @@ int fd, mode; } bwrite(fd, (genericptr_t) &minusone, sizeof(int)); } - debugpline("Stored %d messages into savefile.", msgcount); + debugpline1("Stored %d messages into savefile.", msgcount); /* note: we don't attempt to handle release_data() here */ } diff --git a/src/shk.c b/src/shk.c index 12f22eb40..ffc827482 100644 --- a/src/shk.c +++ b/src/shk.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 shk.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 shk.c $NHDT-Date: 1426465441 2015/03/16 00:24:01 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.96 $ */ /* NetHack 3.5 shk.c $Date: 2012/07/03 22:54:49 $ $Revision: 1.91 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1205,7 +1205,7 @@ dopay() } if(!shkp) { - debugpline("dopay: null shkp."); + debugpline0("dopay: null shkp."); return(0); } proceed: diff --git a/src/sp_lev.c b/src/sp_lev.c index 6be2c9713..41a747da9 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 sp_lev.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sp_lev.c $NHDT-Date: 1426465441 2015/03/16 00:24:01 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.25 $ */ /* NetHack 3.5 sp_lev.c $Date: 2011/01/05 01:28:36 $ $Revision: 1.23 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -324,8 +324,8 @@ chk: lev = &levl[x][y]; for (; y <= ymax; y++) { if (lev++->typ) { - if(!vault) - debugpline("strange area [%d,%d] in check_room.",x,y); + if (!vault) + debugpline2("strange area [%d,%d] in check_room.", x, y); if (!rn2(3)) return FALSE; if (x < *lowx) *lowx = x + xlim + 1; @@ -398,7 +398,7 @@ xchar rtype, rlit; r1 = rnd_rect(); /* Get a random rectangle */ if (!r1) { /* No more free rectangles ! */ - debugpline("No more rects..."); + debugpline0("No more rects..."); return FALSE; } hx = r1->hx; @@ -1311,8 +1311,8 @@ schar ftyp, btyp; if (xx <= 0 || yy <= 0 || tx <= 0 || ty <= 0 || xx > COLNO-1 || tx > COLNO-1 || yy > ROWNO-1 || ty > ROWNO-1) { - debugpline("dig_corridor: bad coords : (%d,%d) (%d,%d).", - xx,yy,tx,ty); + debugpline4("dig_corridor: bad coords <%d,%d> <%d,%d>.", + xx, yy, tx, ty); return FALSE; } if (tx > xx) dx = 1; diff --git a/src/sys.c b/src/sys.c index 14e0aa642..0392d6554 100644 --- a/src/sys.c +++ b/src/sys.c @@ -1,26 +1,34 @@ -/* NetHack 3.5 sys.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sys.c $NHDT-Date: 1426465442 2015/03/16 00:24:02 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.16 $ */ /* NetHack 3.5 sys.c $Date: 2012/03/10 02:22:07 $ $Revision: 1.12 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ #include "hack.h" -/* for KR1ED config, WIZARD is 0 or 1 and WIZARD_NAME is a string; - for usual config, WIZARD is the string; forcing WIZARD_NAME to match it - eliminates conditional testing for which one to use in string ops */ +#ifndef SYSCF +/* !SYSCF configurations need '#define DEBUGFILES "foo.c bar.c"' + to enable debugging feedback for source files foo.c and bar.c; + to activate debugpline(), set an appropriate value and uncomment */ +/* # define DEBUGFILES "*" */ +#endif struct sysopt sysopt; void -sys_early_init(){ +sys_early_init() +{ sysopt.support = NULL; sysopt.recover = NULL; #ifdef SYSCF sysopt.wizards = NULL; #else - sysopt.wizards = WIZARD_NAME; + sysopt.wizards = dupstr(WIZARD_NAME); #endif +#if defined(SYSCF) || !defined(DEBUGFILES) sysopt.debugfiles = NULL; +#else + sysopt.debugfiles = dupstr(DEBUGFILES); +#endif sysopt.shellers = NULL; sysopt.maxplayers = 0; /* XXX eventually replace MAX_NR_OF_PLAYERS */ diff --git a/src/teleport.c b/src/teleport.c index cd179c1f1..bf5e323a7 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 teleport.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 teleport.c $NHDT-Date: 1426465443 2015/03/16 00:24:03 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.48 $ */ /* NetHack 3.5 teleport.c $Date: 2012/01/04 18:52:36 $ $Revision: 1.45 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -121,7 +121,7 @@ unsigned entflags; struct monst fakemon; /* dummy monster */ if (!mdat) { - debugpline("enexto() called with mdat==0"); + debugpline0("enexto() called with null mdat"); /* default to player's original monster type */ mdat = &mons[u.umonster]; } diff --git a/src/zap.c b/src/zap.c index 38b883115..5f39fc30e 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 zap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 zap.c $NHDT-Date: 1426465444 2015/03/16 00:24:04 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.195 $ */ /* NetHack 3.5 zap.c $Date: 2013/11/05 00:57:56 $ $Revision: 1.183 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1708,10 +1708,11 @@ struct obj *obj, *otmp; * as a safeguard against any stray occurrence left in an obj * struct someplace, although that should never happen. */ - if (context.bypasses) + if (context.bypasses) { return 0; - else { - debugpline("%s for a moment.", Tobjnam(obj, "pulsate")); + } else { + debugpline1("%s for a moment.", + Tobjnam(obj, "pulsate")); obj->bypass = 0; } } @@ -3405,7 +3406,8 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */ resist(mon, type < ZT_SPELL(0) ? WAND_CLASS : '\0', 0, NOTELL)) tmp /= 2; if (tmp < 0) tmp = 0; /* don't allow negative damage */ - debugpline("zapped monster hp = %d (= %d - %d)", mon->mhp-tmp,mon->mhp,tmp); + debugpline3("zapped monster hp = %d (= %d - %d)", + mon->mhp-tmp, mon->mhp, tmp); mon->mhp -= tmp; return(tmp); } diff --git a/win/tty/wintty.c b/win/tty/wintty.c index a201218e7..553553744 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 wintty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wintty.c $NHDT-Date: 1426465444 2015/03/16 00:24:04 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.71 $ */ /* NetHack 3.5 wintty.c $Date: 2012/01/22 06:27:09 $ $Revision: 1.66 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -1934,7 +1934,7 @@ register int x, y; /* not xchar: perhaps xchar is unsigned and case NHW_TEXT: s = "[text window]"; break; case NHW_BASE: s = "[base window]"; break; } - debugpline("bad curs positioning win %d %s (%d,%d)", window, s, x, y); + debugpline4("bad curs positioning win %d %s (%d,%d)", window, s, x, y); return; } #endif From a983a58b6af0aab41ce9d0af4d2287206f1dad48 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 16 Mar 2015 02:03:40 -0700 Subject: [PATCH 091/354] free 'sysopt' strings upon termination --- include/extern.h | 4 +++- include/sys.h | 9 +++------ src/save.c | 3 ++- src/sys.c | 20 +++++++++++++++++++- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/include/extern.h b/include/extern.h index cd8843762..d901d3641 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 extern.h $NHDT-Date: 1426465429 2015/03/16 00:23:49 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.406 $ */ +/* NetHack 3.5 extern.h $NHDT-Date: 1426496453 2015/03/16 09:00:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.407 $ */ /* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2065,6 +2065,8 @@ E void FDECL(play_sound_for_message, (const char *)); /* ### sys.c ### */ +E void NDECL(sys_early_init); +E void NDECL(sysopt_release); E void FDECL(sysopt_seduce_set,(int)); /* ### sys/msdos/sound.c ### */ diff --git a/include/sys.h b/include/sys.h index 8358021a2..940e95a11 100644 --- a/include/sys.h +++ b/include/sys.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 sys.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sys.h $NHDT-Date: 1426496454 2015/03/16 09:00:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */ /* NetHack 3.5 sys.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.9 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -6,10 +6,6 @@ #ifndef SYS_H #define SYS_H -#define E extern - -E void NDECL(sys_early_init); - struct sysopt { char *support; /* local support contact */ char *recover; /* how to run recover - may be overridden by win port */ @@ -34,7 +30,8 @@ struct sysopt { #endif int seduce; }; -E struct sysopt sysopt; + +extern struct sysopt sysopt; #define SYSOPT_SEDUCE sysopt.seduce diff --git a/src/save.c b/src/save.c index 165c792db..802d560a9 100644 --- a/src/save.c +++ b/src/save.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 save.c $NHDT-Date: 1426465440 2015/03/16 00:24:00 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.61 $ */ +/* NetHack 3.5 save.c $NHDT-Date: 1426496455 2015/03/16 09:00:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.62 $ */ /* NetHack 3.5 save.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.53 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1350,6 +1350,7 @@ freedynamicdata() #ifdef STATUS_VIA_WINDOWPORT status_finish(); #endif + sysopt_release(); /* SYSCF strings */ return; } diff --git a/src/sys.c b/src/sys.c index 0392d6554..52489135e 100644 --- a/src/sys.c +++ b/src/sys.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 sys.c $NHDT-Date: 1426465442 2015/03/16 00:24:02 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.16 $ */ +/* NetHack 3.5 sys.c $NHDT-Date: 1426496455 2015/03/16 09:00:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.17 $ */ /* NetHack 3.5 sys.c $Date: 2012/03/10 02:22:07 $ $Revision: 1.12 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -67,6 +67,24 @@ sys_early_init() sysopt_seduce_set(sysopt.seduce); } +void +sysopt_release() +{ + if (sysopt.support) + free(sysopt.support), sysopt.support = NULL; + if (sysopt.recover) + free(sysopt.recover), sysopt.recover = NULL; + if (sysopt.wizards) + free(sysopt.wizards), sysopt.wizards = NULL; + if (sysopt.debugfiles) + free(sysopt.debugfiles), sysopt.debugfiles = NULL; +#ifdef PANICTRACE + if (sysopt.gdbpath) + free(sysopt.gdbpath), sysopt.gdbpath = NULL; + if (sysopt.greppath) + free (sysopt.greppath), sysopt.greppath = NULL; +#endif +} extern struct attack sa_yes[NATTK]; extern struct attack sa_no[NATTK]; From 0d0711fe178cc82174fef221c1280933d9bd97f0 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 16 Mar 2015 02:29:10 -0700 Subject: [PATCH 092/354] fix #H3724 - gold pile stacking bug Bug report included a pointer to a fix; this patch is a superset. Gold pieces dropped on an altar by the player got their bknown flag set, which is incorrect since bless/curse doesn't apply to coins. If a monster (in reported case, a slain temple priest) dropped gold there too then the two stacks wouldn't merge. For the normal !GOLDOBJ config, the problem goes away as soon as the gold gets picked up. I didn't test for GOLDOBJ but think two inventory slots containing gold can result. The superset part is to not break agnostic conduct by dropping gold on an altar since no information is revealed when doing that. [This was one of the very last patches checked into the old cvs repository, where the somewhat out of date message above was accidentally omitted.] --- doc/fixes35.0 | 1 + src/do.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index ad8117820..250b09d85 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -855,6 +855,7 @@ fix "object lost" panic (or even crash) when dropping multiple items while levitating and a lit potion of oil explodes and destroys some inventory fix "object_is_local" panic when saving bones after hero is killed by explosion produced by dropped or thrown lit potion of oil +gold dropped on altar by hero wouldn't stack with gold dropped there by monster if lava burns up the player's water walking boots, the player falls in the messages for lava burning items up are always printed fix used-up magic trap trying to hit steed. diff --git a/src/do.c b/src/do.c index 3069a4047..41e25a1b0 100644 --- a/src/do.c +++ b/src/do.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 do.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 do.c $NHDT-Date: 1426497723 2015/03/16 09:22:03 $ $NHDT-Branch: H3724 $:$NHDT-Revision: 1.109 $ */ /* NetHack 3.5 do.c $Date: 2014/11/18 03:10:39 $ $Revision: 1.101 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -222,10 +222,15 @@ doaltarobj(obj) /* obj is an object dropped on an altar */ if (Blind) return; - /* KMH, conduct */ - u.uconduct.gnostic++; + if (obj->oclass != COIN_CLASS) { + /* KMH, conduct */ + u.uconduct.gnostic++; + } else { + /* coins don't have bless/curse status */ + obj->blessed = obj->cursed = 0; + } - if ((obj->blessed || obj->cursed) && obj->oclass != COIN_CLASS) { + if (obj->blessed || obj->cursed) { There("is %s flash as %s %s the altar.", an(hcolor(obj->blessed ? NH_AMBER : NH_BLACK)), doname(obj), otense(obj, "hit")); @@ -233,7 +238,7 @@ doaltarobj(obj) /* obj is an object dropped on an altar */ } else { pline("%s %s on the altar.", Doname2(obj), otense(obj, "land")); - obj->bknown = 1; + if (obj->oclass != COIN_CLASS) obj->bknown = 1; } } From c24dcf76b2efb51a00aa5d3d53383bb6cf1bfdc7 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 16 Mar 2015 06:04:43 -0400 Subject: [PATCH 093/354] dungeoneers update March 16, 2015 --- dat/history | 75 +++++++++++++++++++++---------------------- doc/Guidebook.mn | 81 ++++++++++++++++++++++++----------------------- doc/Guidebook.tex | 81 ++++++++++++++++++++++++----------------------- 3 files changed, 120 insertions(+), 117 deletions(-) diff --git a/dat/history b/dat/history index 662ec57ae..b97c99039 100644 --- a/dat/history +++ b/dat/history @@ -159,41 +159,42 @@ particularly intriguing modification to help out with the game. The Gods of the Dungeon sometimes make note of the names of the worst of these miscreants in this, the list of Dungeoneers: - Adam Aronow Izchak Miller Mike Passaretti - Alex Kompel J. Ali Harlow Mike Stephenson - Andreas Dorn Janet Walz Norm Meluch - Andy Church Janne Salmijarvi Olaf Seibert - Andy Swanson Jean-Christophe Collet Pasi Kallinen - Ari Huttunen Jochen Erwied Pat Rankin - Barton House John Kallen Paul Winner - Benson I. Margulies John Rupley Pierre Martineau - Bill Dyer John S. Bien Ralf Brown - Boudewijn Waijers Johnny Lee Ray Chason - Bruce Cox Jon W{tte Richard Addison - Bruce Holloway Jonathan Handler Richard Beigel - Bruce Mewborne Joshua Delahunty Richard P. Hughey - Carl Schelin Keizo Yamamoto Rob Menke - Chris Russo Ken Arnold Robin Johnson - David Cohrs Ken Arromdee Roderick Schertler - David Damerell Ken Lorber Roland McGrath - David Gentzel Ken Washikita Ron Van Iwaarden - David Hairston Kevin Darcy Ronnen Miller - Dean Luick Kevin Hugo Ross Brown - Del Lamb Kevin Sitze Sascha Wostmann - Deron Meranda Kevin Smolkowski Scott Bigham - Dion Nicolaas Kevin Sweet Scott R. Turner - Dylan O'Donnell Lars Huttar Stephen Spackman - Eric Backus Leon Arnott Stephen White - Eric Hendrickson Malcolm Ryan Steve Creps - Eric R. Smith Mark Gooderum Steve Linhart - Eric S. Raymond Mark Modrall Steve VanDevender - Erik Andersen Marvin Bressler Teemu Suikki - Frederick Roeber Matthew Day Tim Lennan - Gil Neiger Merlyn LeRoy Timo Hakulinen - Greg Laskin Michael Allison Tom Almy - Greg Olson Michael Feir Tom West - Gregg Wonderly Michael Hamel Warren Cheung - Hao-yang Wang Michael Sokolov Warwick Allison - Helge Hafting Mike Engber Yitzhak Sapir - Irina Rempt-Drijfhout Mike Gallop + Adam Aronow Izchak Miller Mike Stephenson + Alex Kompel J. Ali Harlow Norm Meluch + Andreas Dorn Janet Walz Olaf Seibert + Andy Church Janne Salmijarvi Pasi Kallinen + Andy Swanson Jean-Christophe Collet Pat Rankin + Ari Huttunen Jochen Erwied Paul Winner + Barton House John Kallen Pierre Martineau + Benson I. Margulies John Rupley Ralf Brown + Bill Dyer John S. Bien Ray Chason + Boudewijn Waijers Johnny Lee Richard Addison + Bruce Cox Jon W{tte Richard Beigel + Bruce Holloway Jonathan Handler Richard P. Hughey + Bruce Mewborne Joshua Delahunty Rob Menke + Carl Schelin Keizo Yamamoto Robin Johnson + Chris Russo Ken Arnold Roderick Schertler + David Cohrs Ken Arromdee Roland McGrath + David Damerell Ken Lorber Ron Van Iwaarden + David Gentzel Ken Washikita Ronnen Miller + David Hairston Kevin Darcy Ross Brown + Dean Luick Kevin Hugo Sascha Wostmann + Del Lamb Kevin Sitze Scott Bigham + Derek S. Ray Kevin Smolkowski Scott R. Turner + Deron Meranda Kevin Sweet Sean Hunt + Dion Nicolaas Lars Huttar Stephen Spackman + Dylan O'Donnell Leon Arnott Stephen White + Eric Backus Malcolm Ryan Steve Creps + Eric Hendrickson Mark Gooderum Steve Linhart + Eric R. Smith Mark Modrall Steve VanDevender + Eric S. Raymond Marvin Bressler Teemu Suikki + Erik Andersen Matthew Day Tim Lennan + Frederick Roeber Merlyn LeRoy Timo Hakulinen + Gil Neiger Michael Allison Tom Almy + Greg Laskin Michael Feir Tom West + Greg Olson Michael Hamel Warren Cheung + Gregg Wonderly Michael Sokolov Warwick Allison + Hao-yang Wang Mike Engber Yitzhak Sapir + Helge Hafting Mike Gallop + Irina Rempt-Drijfhout Mike Passaretti diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 82fa2d195..0b2e5cf3b 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -3,10 +3,10 @@ .ds h0 "NetHack Guidebook .ds h1 .ds h2 % -.ds vr "NetHack 3.5 +.ds vr "NetHack 3.6 .ds f0 "\*(vr .ds f1 -.ds f2 "April 7, 2012 +.ds f2 "March 16, 2015 .\" labeled paragraph start (should be part of tmac.n, but I don't want to .\" make changes to that file) .\" .PS word @@ -58,7 +58,7 @@ A Guide to the Mazes of Menace (Guidebook for NetHack) .au Eric S. Raymond -(Extensively edited and expanded for 3.5) +(Edited and expanded for 3.6) .hn 1 Introduction @@ -3205,43 +3205,44 @@ in this, the list of Dungeoneers: center; c c c. .\"TABLE_START -Adam Aronow Izchak Miller Mike Passaretti -Alex Kompel J. Ali Harlow Mike Stephenson -Andreas Dorn Janet Walz Norm Meluch -Andy Church Janne Salmijarvi Olaf Seibert -Andy Swanson Jean-Christophe Collet Pasi Kallinen -Ari Huttunen Jochen Erwied Pat Rankin -Barton House John Kallen Paul Winner -Benson I. Margulies John Rupley Pierre Martineau -Bill Dyer John S. Bien Ralf Brown -Boudewijn Waijers Johnny Lee Ray Chason -Bruce Cox Jon W{tte Richard Addison -Bruce Holloway Jonathan Handler Richard Beigel -Bruce Mewborne Joshua Delahunty Richard P. Hughey -Carl Schelin Keizo Yamamoto Rob Menke -Chris Russo Ken Arnold Robin Johnson -David Cohrs Ken Arromdee Roderick Schertler -David Damerell Ken Lorber Roland McGrath -David Gentzel Ken Washikita Ron Van Iwaarden -David Hairston Kevin Darcy Ronnen Miller -Dean Luick Kevin Hugo Ross Brown -Del Lamb Kevin Sitze Sascha Wostmann -Deron Meranda Kevin Smolkowski Scott Bigham -Dion Nicolaas Kevin Sweet Scott R. Turner -Dylan O'Donnell Lars Huttar Stephen Spackman -Eric Backus Leon Arnott Stephen White -Eric Hendrickson Malcolm Ryan Steve Creps -Eric R. Smith Mark Gooderum Steve Linhart -Eric S. Raymond Mark Modrall Steve VanDevender -Erik Andersen Marvin Bressler Teemu Suikki -Frederick Roeber Matthew Day Tim Lennan -Gil Neiger Merlyn LeRoy Timo Hakulinen -Greg Laskin Michael Allison Tom Almy -Greg Olson Michael Feir Tom West -Gregg Wonderly Michael Hamel Warren Cheung -Hao-yang Wang Michael Sokolov Warwick Allison -Helge Hafting Mike Engber Yitzhak Sapir -Irina Rempt-Drijfhout Mike Gallop +Adam Aronow Izchak Miller Mike Stephenson +Alex Kompel J. Ali Harlow Norm Meluch +Andreas Dorn Janet Walz Olaf Seibert +Andy Church Janne Salmijarvi Pasi Kallinen +Andy Swanson Jean-Christophe Collet Pat Rankin +Ari Huttunen Jochen Erwied Paul Winner +Barton House John Kallen Pierre Martineau +Benson I. Margulies John Rupley Ralf Brown +Bill Dyer John S. Bien Ray Chason +Boudewijn Waijers Johnny Lee Richard Addison +Bruce Cox Jon W{tte Richard Beigel +Bruce Holloway Jonathan Handler Richard P. Hughey +Bruce Mewborne Joshua Delahunty Rob Menke +Carl Schelin Keizo Yamamoto Robin Johnson +Chris Russo Ken Arnold Roderick Schertler +David Cohrs Ken Arromdee Roland McGrath +David Damerell Ken Lorber Ron Van Iwaarden +David Gentzel Ken Washikita Ronnen Miller +David Hairston Kevin Darcy Ross Brown +Dean Luick Kevin Hugo Sascha Wostmann +Del Lamb Kevin Sitze Scott Bigham +Derek S. Ray Kevin Smolkowski Scott R. Turner +Deron Meranda Kevin Sweet Sean Hunt +Dion Nicolaas Lars Huttar Stephen Spackman +Dylan O'Donnell Leon Arnott Stephen White +Eric Backus Malcolm Ryan Steve Creps +Eric Hendrickson Mark Gooderum Steve Linhart +Eric R. Smith Mark Modrall Steve VanDevender +Eric S. Raymond Marvin Bressler Teemu Suikki +Erik Andersen Matthew Day Tim Lennan +Frederick Roeber Merlyn LeRoy Timo Hakulinen +Gil Neiger Michael Allison Tom Almy +Greg Laskin Michael Feir Tom West +Greg Olson Michael Hamel Warren Cheung +Gregg Wonderly Michael Sokolov Warwick Allison +Hao-yang Wang Mike Engber Yitzhak Sapir +Helge Hafting Mike Gallop +Irina Rempt-Drijfhout Mike Passaretti .\"TABLE_END Do not delete this line. .TE diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index d8e361648..c1cf2015e 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -33,7 +33,7 @@ \begin{document} % % input file: guidebook.mn -% $Revision: 1.121 $ $Date: 2012/04/09 02:56:37 $ +% $Revision: 1.122 $ $Date: 2015/03/16 06:00:00 $ % %.ds h0 " %.ds h1 %.ds h2 \% @@ -45,8 +45,8 @@ %.au \author{Eric S. Raymond\\ -(Extensively edited and expanded for 3.5)} -\date{April 7, 2012} +(Edited and expanded for 3.6)} +\date{March 16, 2015} \maketitle @@ -3801,43 +3801,44 @@ in this, the list of Dungeoneers: \begin{center} \begin{tabular}{lll} %TABLE_START -Adam Aronow & Izchak Miller & Mike Passaretti\\ -Alex Kompel & J. Ali Harlow & Mike Stephenson\\ -Andreas Dorn & Janet Walz & Norm Meluch\\ -Andy Church & Janne Salmij\"{a}rvi & Olaf Seibert\\ -Andy Swanson & Jean-Christophe Collet & Pasi Kallinen\\ -Ari Huttunen & Jochen Erwied & Pat Rankin\\ -Barton House & John Kallen & Paul Winner\\ -Benson I. Margulies & John Rupley & Pierre Martineau\\ -Bill Dyer & John S. Bien & Ralf Brown\\ -Boudewijn Waijers & Johnny Lee & Ray Chason\\ -Bruce Cox & Jon W\{tte & Richard Addison\\ -Bruce Holloway & Jonathan Handler & Richard Beigel\\ -Bruce Mewborne & Joshua Delahunty & Richard P. Hughey\\ -Carl Schelin & Keizo Yamamoto & Rob Menke\\ -Chris Russo & Ken Arnold & Robin Johnson\\ -David Cohrs & Ken Arromdee & Roderick Schertler\\ -David Damerell & Ken Lorber & Roland McGrath\\ -David Gentzel & Ken Washikita & Ron Van Iwaarden\\ -David Hairston & Kevin Darcy & Ronnen Miller\\ -Dean Luick & Kevin Hugo & Ross Brown\\ -Del Lamb & Kevin Sitze & Sascha Wostmann\\ -Deron Meranda & Kevin Smolkowski & Scott Bigham\\ -Dion Nicolaas & Kevin Sweet & Scott R. Turner\\ -Dylan O'Donnell & Lars Huttar & Stephen Spackman\\ -Eric Backus & Leon Arnott & Stephen White\\ -Eric Hendrickson & Malcolm Ryan & Steve Creps\\ -Eric R. Smith & Mark Gooderum & Steve Linhart\\ -Eric S. Raymond & Mark Modrall & Steve VanDevender\\ -Erik Andersen & Marvin Bressler & Teemu Suikki\\ -Frederick Roeber & Matthew Day & Tim Lennan\\ -Gil Neiger & Merlyn LeRoy & Timo Hakulinen\\ -Greg Laskin & Michael Allison & Tom Almy\\ -Greg Olson & Michael Feir & Tom West\\ -Gregg Wonderly & Michael Hamel & Warren Cheung\\ -Hao-yang Wang & Michael Sokolov & Warwick Allison\\ -Helge Hafting & Mike Engber & Yitzhak Sapir\\ -Irina Rempt-Drijfhout & Mike Gallop +Adam Aronow & Izchak Miller & Mike Stephenson\\ +Alex Kompel & J. Ali Harlow & Norm Meluch\\ +Andreas Dorn & Janet Walz & Olaf Seibert\\ +Andy Church & Janne Salmij\"{a}rvi & Pasi Kallinen\\ +Andy Swanson & Jean-Christophe Collet & Pat Rankin\\ +Ari Huttunen & Jochen Erwied & Paul Winner\\ +Barton House & John Kallen & Pierre Martineau\\ +Benson I. Margulies & John Rupley & Ralf Brown\\ +Bill Dyer & John S. Bien & Ray Chason\\ +Boudewijn Waijers & Johnny Lee & Richard Addison\\ +Bruce Cox & Jon W\{tte & Richard Beigel\\ +Bruce Holloway & Jonathan Handler & Richard P. Hughey\\ +Bruce Mewborne & Joshua Delahunty & Rob Menke\\ +Carl Schelin & Keizo Yamamoto & Robin Johnson\\ +Chris Russo & Ken Arnold & Roderick Schertler\\ +David Cohrs & Ken Arromdee & Roland McGrath\\ +David Damerell & Ken Lorber & Ron Van Iwaarden\\ +David Gentzel & Ken Washikita & Ronnen Miller\\ +David Hairston & Kevin Darcy & Ross Brown\\ +Dean Luick & Kevin Hugo & Sascha Wostmann\\ +Del Lamb & Kevin Sitze & Scott Bigham\\ +Derek S. Ray & Kevin Smolkowski & Scott R. Turner\\ +Deron Meranda & Kevin Sweet & Sean Hunt\\ +Dion Nicolaas & Lars Huttar & Stephen Spackman\\ +Dylan O'Donnell & Leon Arnott & Stephen White\\ +Eric Backus & Malcolm Ryan & Steve Creps\\ +Eric Hendrickson & Mark Gooderum & Steve Linhart\\ +Eric R. Smith & Mark Modrall & Steve VanDevender\\ +Eric S. Raymond & Marvin Bressler & Teemu Suikki\\ +Erik Andersen & Matthew Day & Tim Lennan\\ +Frederick Roeber & Merlyn LeRoy & Timo Hakulinen\\ +Gil Neiger & Michael Allison & Tom Almy\\ +Greg Laskin & Michael Feir & Tom West\\ +Greg Olson & Michael Hamel & Warren Cheung\\ +Gregg Wonderly & Michael Sokolov & Warwick Allison\\ +Hao-yang Wang & Mike Engber & Yitzhak Sapir\\ +Helge Hafting & Mike Gallop\\ +Irina Rempt-Drijfhout & Mike Passaretti %TABLE_END Do not delete this line. \end{tabular} \end{center} From 4914e256bf342f3e886e84562670c5583c84649a Mon Sep 17 00:00:00 2001 From: "Derek S. Ray" Date: Mon, 16 Mar 2015 17:26:31 -0400 Subject: [PATCH 094/354] finally remember to add the 'nh-' versions --- DEVEL/git_recipes.txt | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/DEVEL/git_recipes.txt b/DEVEL/git_recipes.txt index 71ce0e5dc..88af7f927 100644 --- a/DEVEL/git_recipes.txt +++ b/DEVEL/git_recipes.txt @@ -34,12 +34,17 @@ you specify: [*] git add (filename) +[*] git nhadd (filename) Adds the changes you've made in (filename) to the pre-commit staging area. (also referred to as the 'index') +"nhadd" is the preferred syntax and will automatically update the source file +headers with the latest date, branch, and version. + [*] git commit [-a] [-m "text"] +[*] git nhcommit [-a] [-m "text"] Commits all staged changes (in the index) to this branch in your local repo from your current position. @@ -47,6 +52,9 @@ Including -a will 'git add' all eligible files before doing so. Including -m will use "text" as the commit message instead of opening an editor window for you to create one. +"nhcommit" is the preferred syntax and will automatically update the source file +headers with the latest date, branch, and version. + [*] git push [--all] [-u origin (branch)] @@ -61,7 +69,7 @@ branch. Without any parameters, unstages the changes for (filename) from the index; does not change the working tree. This is the equivalent of the command -[*] git reset --mixed (filename); git reset --soft (filename) has no effect. +git reset --mixed (filename); git reset --soft (filename) has no effect. With --hard, unstages (filename) from the index and reverts (filename) in the working tree to the most recent commit. @@ -160,6 +168,20 @@ you must commit them manually later (likely after you have edited them). This more accurately mimics the merge behavior of svn [and cvs?] +[*] git stash [save | apply | list] + +save: Takes all changes in your working directory and 'stashes' them in a temporary +holding area. Convenient if the command you're trying to run won't go unless +you have a clean working dir; also convenient to move experimental changes +between branches without needing to commit them. + +apply: Replays the named stash onto your current working directory as though +it were a patch. Does not delete the stash from the list. + +list: Lists all of your stashed code blobs. + + + ======================================= Typical workflows for common activities ======================================= From 562fa952ce95695272467ef8f00277735ba93820 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 16 Mar 2015 15:28:01 -0700 Subject: [PATCH 095/354] allow DEBUGFILES to be overridden via getenv() If getenv("DEBUGFILES") yields a value then it takes precedence over sysconf.DEBUGFILES or sys.c's #define DEBUGFILES. (It probably should only be controlled via environment since it is not a system-wide attribute, but I haven't taken out the SYSCF handling for it.) --- include/sys.h | 7 ++++++- src/files.c | 21 +++++++++++++++++++-- src/sys.c | 5 ++++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/include/sys.h b/include/sys.h index 940e95a11..b97f7ca80 100644 --- a/include/sys.h +++ b/include/sys.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 sys.h $NHDT-Date: 1426496454 2015/03/16 09:00:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */ +/* NetHack 3.5 sys.h $NHDT-Date: 1426544796 2015/03/16 22:26:36 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ */ /* NetHack 3.5 sys.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.9 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -12,6 +12,11 @@ struct sysopt { char *wizards; char *shellers; /* like wizards, for ! command (-DSHELL) */ char *debugfiles; /* files to show debugplines in. '*' is all. */ + int env_dbgfl; /* 1: debugfiles comes from getenv("DEBUGFILES") + * so sysconf's DEBUGFILES shouldn't override it; + * 0: getenv() hasn't been attempted yet; + * -1: getenv() didn't find a value for DEBUGFILES. + */ int maxplayers; /* record file */ int persmax; diff --git a/src/files.c b/src/files.c index 9e9cea746..a6f17b906 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 files.c $NHDT-Date: 1426465435 2015/03/16 00:23:55 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.133 $ */ +/* NetHack 3.5 files.c $NHDT-Date: 1426544796 2015/03/16 22:26:36 $ $NHDT-Branch: master $:$NHDT-Revision: 1.134 $ */ /* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2157,7 +2157,11 @@ int src; sysopt.shellers = dupstr(bufp); } else if (src == SET_IN_SYS && match_varname(buf, "DEBUGFILES", 5)) { if (sysopt.debugfiles) free(sysopt.debugfiles); - sysopt.debugfiles = dupstr(bufp); + /* if showdebug() has already been called (perhaps we've added + some debugpline() calls to option processing) and has found + a value for getenv("DEBUGFILES"), don't override that */ + if (sysopt.env_dbgfl == 0) + sysopt.debugfiles = dupstr(bufp); } else if (src == SET_IN_SYS && match_varname(buf, "SUPPORT", 7)) { if (sysopt.support) free(sysopt.support); sysopt.support = dupstr(bufp); @@ -3207,6 +3211,19 @@ const char *filename; if (!filename || !*filename) return FALSE; /* sanity precaution */ + if (sysopt.env_dbgfl == 0) { + /* check once for DEBUGFILES in the environment; + if found, it supersedes the sysconf value + [note: getenv() rather than nh_getenv() since a long value + is valid and doesn't pose any sort of overflow risk here] */ + if ((p = getenv("DEBUGFILES")) != 0) { + if (sysopt.debugfiles) free(sysopt.debugfiles); + sysopt.debugfiles = dupstr(p); + sysopt.env_dbgfl = 1; + } else + sysopt.env_dbgfl = -1; + } + debugfiles = sysopt.debugfiles; /* usual case: sysopt.debugfiles will be empty */ if (!debugfiles || !*debugfiles) return FALSE; diff --git a/src/sys.c b/src/sys.c index 52489135e..35e46b7c8 100644 --- a/src/sys.c +++ b/src/sys.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 sys.c $NHDT-Date: 1426496455 2015/03/16 09:00:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.17 $ */ +/* NetHack 3.5 sys.c $NHDT-Date: 1426544797 2015/03/16 22:26:37 $ $NHDT-Branch: master $:$NHDT-Revision: 1.18 $ */ /* NetHack 3.5 sys.c $Date: 2012/03/10 02:22:07 $ $Revision: 1.12 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -10,6 +10,8 @@ to enable debugging feedback for source files foo.c and bar.c; to activate debugpline(), set an appropriate value and uncomment */ /* # define DEBUGFILES "*" */ +/* note: DEBUGFILES value here or in sysconf.DEBUGFILES can be overridden + at runtime by setting up a value for "DEBUGFILES" in the environment */ #endif struct sysopt sysopt; @@ -29,6 +31,7 @@ sys_early_init() #else sysopt.debugfiles = dupstr(DEBUGFILES); #endif + sysopt.env_dbgfl = 0; /* haven't checked getenv("DEBUGFILES") yet */ sysopt.shellers = NULL; sysopt.maxplayers = 0; /* XXX eventually replace MAX_NR_OF_PLAYERS */ From ad03a7fb7a40ac908a03cc8ba16d14138d13c2ba Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 16 Mar 2015 19:22:49 -0700 Subject: [PATCH 096/354] some lint cleanup --- src/do_name.c | 15 ++++++++------- src/pickup.c | 8 ++++---- src/role.c | 20 +++++++++++--------- src/trap.c | 10 ++-------- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/src/do_name.c b/src/do_name.c index f1960b6ff..37daffbc4 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 do_name.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 do_name.c $NHDT-Date: 1426558927 2015/03/17 02:22:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.53 $ */ /* NetHack 3.5 do_name.c $Date: 2012/01/29 03:00:17 $ $Revision: 1.49 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -56,8 +56,8 @@ const char *goal; } int -getpos(cc, force, goal) -coord *cc; +getpos(ccp, force, goal) +coord *ccp; boolean force; const char *goal; { @@ -75,8 +75,8 @@ const char *goal; pline("(For instructions type a ?)"); msg_given = TRUE; } - cx = cc->x; - cy = cc->y; + cx = ccp->x; + cy = ccp->y; #ifdef CLIPPING cliparound(cx, cy); #endif @@ -97,6 +97,7 @@ const char *goal; int sym = 0; char tmpbuf[BUFSZ]; const char *firstmatch = NULL; + cc.x = cx; cc.y = cy; if (do_screen_description(cc, TRUE, sym, tmpbuf, &firstmatch)) { @@ -250,8 +251,8 @@ const char *goal; lock_mouse_cursor(FALSE); #endif if (msg_given) clear_nhwindow(WIN_MESSAGE); - cc->x = cx; - cc->y = cy; + ccp->x = cx; + ccp->y = cy; return result; } diff --git a/src/pickup.c b/src/pickup.c index 7b3096c59..3eba9874f 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 pickup.c $NHDT-Date: 1426465438 2015/03/16 00:23:58 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.130 $ */ +/* NetHack 3.5 pickup.c $NHDT-Date: 1426558927 2015/03/17 02:22:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.131 $ */ /* NetHack 3.5 pickup.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.123 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1515,7 +1515,7 @@ doloot() /* loot a container on the floor or loot saddle from mon. */ lootcont: if (container_at(cc.x, cc.y, FALSE)) { - boolean any = FALSE; + boolean anyfound = FALSE; int num_conts = 0; if (!able_to_loot(cc.x, cc.y, TRUE)) return 0; @@ -1563,14 +1563,14 @@ lootcont: cobj, doname, ansimpleoname, "a container")); if (c == 'q') return (timepassed); if (c == 'n') continue; - any = TRUE; + anyfound = TRUE; timepassed |= do_loot_cont(&cobj); /* might have triggered chest trap or magic bag explosion */ if (multi < 0 || !cobj) return 1; } } - if (any) c = 'y'; + if (anyfound) c = 'y'; } } else if (IS_GRAVE(levl[cc.x][cc.y].typ)) { You("need to dig up the grave to effectively loot it..."); diff --git a/src/role.c b/src/role.c index 9e09d448a..bf4d66de7 100644 --- a/src/role.c +++ b/src/role.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 role.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 role.c $NHDT-Date: 1426558928 2015/03/17 02:22:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.21 $ */ /* NetHack 3.5 role.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.18 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1333,14 +1333,16 @@ plnamesuffix() int i; #ifdef GENERIC_USERNAMES - /* some generic user names will be ignored in favor of prompting */ - i = (int)strlen(plname); - eptr = GENERIC_USERNAMES; - sptr = strstri(eptr, plname); - if (sptr - && (sptr == eptr || sptr[-1] == ' ') - && (sptr[i] == ' ' || sptr[i] == '\0')) - *plname = '\0'; /* call askname() */ + { + /* some generic user names will be ignored in favor of prompting */ + const char *uptr = GENERIC_USERNAMES; + + i = (int)strlen(plname); + if ((sptr = strstri(uptr, plname)) != 0 + && (sptr == uptr || sptr[-1] == ' ') + && (sptr[i] == ' ' || sptr[i] == '\0')) + *plname = '\0'; /* call askname() */ + } #endif do { diff --git a/src/trap.c b/src/trap.c index 911aafdc5..36c1ee632 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 trap.c $NHDT-Date: 1425318721 2015/03/02 17:52:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.194 $ */ +/* NetHack 3.5 trap.c $NHDT-Date: 1426558928 2015/03/17 02:22:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.195 $ */ /* NetHack 3.5 trap.c $Date: 2013/03/14 01:58:21 $ $Revision: 1.179 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3016,7 +3016,6 @@ xchar x, y; { int chance; struct obj *otmp, *ncobj; - int retval = 0; int in_sight = !Blind && couldsee(x, y); /* Don't care if it's lit */ int dindx; @@ -3158,7 +3157,7 @@ struct obj *obj; const char *ostr; boolean force; { - boolean loose_obj = (obj && obj->where == OBJ_FREE), exploded = FALSE; + boolean exploded = FALSE; if (snuff_lit(obj)) return ER_DAMAGED; @@ -3214,11 +3213,6 @@ boolean force; (one ? "Another" : "More"), bufp, vtense(bufp, "explode")); exploded = TRUE; - /* let caller know that obj has gone away - [when obj is part of a list, delobj()'s - obj_extract_self() takes care of this; - for loose_obj, obj should always equal - *objp and otmp should always be null] */ setnotworn(obj); delobj(obj); if (update) From ea46c93b884118444c96088e467c1dec83390eb1 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 13 Feb 2015 11:37:49 -0500 Subject: [PATCH 097/354] +x .sh files in unix dir; ignore Makefiles --- .gitignore | 2 ++ sys/unix/mkmkfile.sh | 0 sys/unix/nethack.sh | 0 sys/unix/setup.sh | 0 4 files changed, 2 insertions(+) mode change 100644 => 100755 sys/unix/mkmkfile.sh mode change 100644 => 100755 sys/unix/nethack.sh mode change 100644 => 100755 sys/unix/setup.sh diff --git a/.gitignore b/.gitignore index 21b5cfc05..6a161df64 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,5 @@ _$* core # CVS default ignores end .*.swp +# We generate makefiles by shell script +Makefile diff --git a/sys/unix/mkmkfile.sh b/sys/unix/mkmkfile.sh old mode 100644 new mode 100755 diff --git a/sys/unix/nethack.sh b/sys/unix/nethack.sh old mode 100644 new mode 100755 diff --git a/sys/unix/setup.sh b/sys/unix/setup.sh old mode 100644 new mode 100755 From 041045a890ac3896824cb22f54b55d5af017880b Mon Sep 17 00:00:00 2001 From: keni Date: Fri, 13 Feb 2015 17:37:06 -0500 Subject: [PATCH 098/354] Typo --- dat/data.base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dat/data.base b/dat/data.base index 3b5651174..c832a4780 100644 --- a/dat/data.base +++ b/dat/data.base @@ -3931,7 +3931,7 @@ poseido*n Jack: This does what again, exactly? Egg: Huge buzz! [drinks] Oh good! See things no one else can see, do things no one else can do. - [ Big in Trouble in Little China, directed by + [ Big Trouble in Little China, directed by John Carpenter, written by Gary Goldman & David Z. Weinstein, adaptation by W. D. Richter ] pray* From 4c496d089eed4311ab1065b091debcd159e1ff1e Mon Sep 17 00:00:00 2001 From: Derek Date: Fri, 13 Feb 2015 13:26:05 -0500 Subject: [PATCH 099/354] Exclude all the Win32 build artifacts (Studio and otherwise) Squashed commit of the following: commit e37c7626f035a29321c9ac12cca83a0af2132abb commit 86ebb3e66aedb6b5a31d61d57c39cf84c12d2276 commit 6cd677c8fca4102f223fb1708d00a65c2ded6658 Author: Derek Date: Fri Feb 13 13:24:29 2015 -0500 --- .gitignore | 14 ++++++++++++++ dat/.gitignore | 3 +++ include/.gitignore | 8 ++++++-- src/.gitignore | 1 + win/share/.gitignore | 1 + win/win32/.gitignore | 4 ++++ 6 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 win/share/.gitignore create mode 100644 win/win32/.gitignore diff --git a/.gitignore b/.gitignore index 6a161df64..db3e64482 100644 --- a/.gitignore +++ b/.gitignore @@ -27,5 +27,19 @@ _$* core # CVS default ignores end .*.swp + # We generate makefiles by shell script Makefile + +# Win32-specific ignores +binary/ +build/ +Nethack.sln +Nethack.sdf +Nethack.opensdf +Makefile.bcc +Makefile.gcc +*.pdb +*.ilk +# Win32-specific ignores end + diff --git a/dat/.gitignore b/dat/.gitignore index e5bd4aba6..88e516283 100644 --- a/dat/.gitignore +++ b/dat/.gitignore @@ -14,3 +14,6 @@ dungeon nethack.png nhsplash.xpm nhdat +dlb.lst +guioptions +porthelp diff --git a/include/.gitignore b/include/.gitignore index 5bae20a5f..b9bd5d8ab 100644 --- a/include/.gitignore +++ b/include/.gitignore @@ -1,3 +1,7 @@ .cvsignore -date.h onames.h pm.h vis_tab.h -dgn_comp.h lev_comp.h +date.h +onames.h +pm.h +vis_tab.h +dgn_comp.h +lev_comp.h diff --git a/src/.gitignore b/src/.gitignore index 602f782b0..04325af79 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -6,3 +6,4 @@ tile.c Sysunix nethack *.o +tiles.bmp diff --git a/win/share/.gitignore b/win/share/.gitignore new file mode 100644 index 000000000..10969bb60 --- /dev/null +++ b/win/share/.gitignore @@ -0,0 +1 @@ +tiletxt.c diff --git a/win/win32/.gitignore b/win/win32/.gitignore new file mode 100644 index 000000000..c40993f47 --- /dev/null +++ b/win/win32/.gitignore @@ -0,0 +1,4 @@ +# Build-generated stuff that we don't want +*.bmp +*.ico + From 793c8577b9cadc5c85b36fedb57d3c8c435d712b Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 13 Feb 2015 22:32:33 +0200 Subject: [PATCH 100/354] Typofix. --- src/cmd.c | 2 +- sys/unix/sysconf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd.c b/src/cmd.c index 064d85a88..74d5a5db7 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1276,7 +1276,7 @@ int final; /* ENL_GAMEINPROGRESS:0, ENL_GAVEOVERALIVE, ENL_GAMEOVERDEAD */ *tmpbuf = highc(*tmpbuf); /* same adjustment as bottom line */ /* as in background_enlighenment, when poly'd we need to use the saved gender in u.mfemale rather than the current you-as-monster gender */ - Sprintf(buf, "%s the %s's atttributes:", tmpbuf, + Sprintf(buf, "%s the %s's attributes:", tmpbuf, ((Upolyd ? u.mfemale : flags.female) && urole.name.f) ? urole.name.f : urole.name.m); diff --git a/sys/unix/sysconf b/sys/unix/sysconf index 34efdcb8a..99bcab3d8 100644 --- a/sys/unix/sysconf +++ b/sys/unix/sysconf @@ -29,7 +29,7 @@ MAXPLAYERS=10 # Record (high score) file options. # CAUTION: changing these after people have started playing games can # lead to lost high scores! -# Maximum entries for one persion. +# Maximum entries for one person. #PERSMAX=10 # Maximum entries in the record file. #ENTRYMAX=100 From 8ac52b247ab35cfcb6a984adc9df8ff6675557f4 Mon Sep 17 00:00:00 2001 From: keni Date: Fri, 13 Feb 2015 17:54:15 -0500 Subject: [PATCH 101/354] Set up mdgrep for git instead of cvs. --- util/.gitattributes | 2 ++ util/mdgrep.pl | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 util/.gitattributes diff --git a/util/.gitattributes b/util/.gitattributes new file mode 100644 index 000000000..15e23d268 --- /dev/null +++ b/util/.gitattributes @@ -0,0 +1,2 @@ +*.pl filter=NHtext merge=NHsubst +*.[ly] filter=NHtext merge=NHsubst diff --git a/util/mdgrep.pl b/util/mdgrep.pl index ba6bbb92a..c75cc3591 100644 --- a/util/mdgrep.pl +++ b/util/mdgrep.pl @@ -1,5 +1,5 @@ #!perl -# NetHack 3.5 mdgrep.pl $Date$ $Revision$ +# NetHack 3.5 mdgrep.pl $NHDT-Date$ $NHDT-Revision$ # Copyright (c) Kenneth Lorber, Kensington, Maryland # NetHack may be freely redistributed. See license for details. @@ -54,13 +54,13 @@ $outfile = "mdgrep.h"; sub start_file { - ($rev) = ('$Revision$') =~ m/: (.*) .$/; - my $date = '$Date$'; - my $revision = '$Revision$'; + ($rev) = ('$NHDT-Revision$') =~ m/: (.*) .$/; + my $date = '$NHDT-Date$'; + my $revision = '$NHDT-Revision$'; open(OUT, ">$outfile") || die "open $outfile: $!"; # NB: Date and Revision below will be modified when mdgrep.h is written to -# cvs - this is correct (but it means you must commit changes to mdgrep.pl -# before generating mdgrep.h and committing that file. +# git - this is correct (but it means you must commit changes to mdgrep.pl +# before generating mdgrep.h and committing that file). print OUT < Date: Fri, 13 Feb 2015 20:32:09 -0500 Subject: [PATCH 102/354] Convert mdgrep from cvs to git. --- util/mdgrep.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/mdgrep.pl b/util/mdgrep.pl index c75cc3591..d291b1464 100644 --- a/util/mdgrep.pl +++ b/util/mdgrep.pl @@ -1,5 +1,5 @@ #!perl -# NetHack 3.5 mdgrep.pl $NHDT-Date$ $NHDT-Revision$ +# NetHack 3.5 mdgrep.pl $NHDT-Date: 1423877528 2015/02/14 01:32:08 $ $NHDT-Revision: 1.7 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland # NetHack may be freely redistributed. See license for details. @@ -54,9 +54,9 @@ $outfile = "mdgrep.h"; sub start_file { - ($rev) = ('$NHDT-Revision$') =~ m/: (.*) .$/; - my $date = '$NHDT-Date$'; - my $revision = '$NHDT-Revision$'; + ($rev) = ('$NHDT-Revision: 1.7 $') =~ m/: (.*) .$/; + my $date = '$NHDT-Date: 1423877529 2015/02/14 01:32:09 $'; + my $revision = '$NHDT-Revision: 1.7 $'; open(OUT, ">$outfile") || die "open $outfile: $!"; # NB: Date and Revision below will be modified when mdgrep.h is written to # git - this is correct (but it means you must commit changes to mdgrep.pl From 9554626288dd54a955dd3bda34c07f80adbb707e Mon Sep 17 00:00:00 2001 From: keni Date: Mon, 16 Feb 2015 08:53:52 -0500 Subject: [PATCH 103/354] Fix bug: NHtext adds a space to a substitution value. Add support for debugging from the command line. --- DEVEL/hooksdir/NHtext | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/DEVEL/hooksdir/NHtext b/DEVEL/hooksdir/NHtext index 487a6f669..e9ee8c28c 100755 --- a/DEVEL/hooksdir/NHtext +++ b/DEVEL/hooksdir/NHtext @@ -5,7 +5,8 @@ # clean/smudge filter for handling substitutions use strict; -my $debug = 0; +my $debug = 0; # save trace to file +my $debug2 = 0; # annotate output when running from command line my $sink = ($^O eq "MSWin32")? "NUL" :"/dev/null"; my $dbgfile = ($^O eq "MSWin32") ? "$ENV{TEMP}.$$" : "/tmp/trace.$$"; @@ -54,21 +55,28 @@ if($ARGV[0] eq "--clean"){ while(){ print TRACE "IN: $_"; - # $1 - var and value (not including trailing $) + # $1 - var and value (including trailing space but not $) # $2 - var # $4 - value or undef -# s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\N{DOLLAR SIGN}]+))?)\s*\$/&handlevar($2,$4)/eg; - s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\x24]+))?)\s*\$/&handlevar($2,$4)/eg; - print; - print TRACE "OT: $_"; +# s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\N{DOLLAR SIGN}]+))?)\$/&handlevar($2,$4)/eg; + s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\x24]+))?)\$/&handlevar($2,$4)/eg; + if($debug2){ + chomp; + print "XX: |$_|\n"; + } else { + print; + } + print TRACE "OT: X${_}X\n"; } sub handlevar { my($var, $val) = @_; + print "HIT '$var' '$val'\n" if($debug2); my $subname = "PREFIX::$var"; if(defined &$subname){ no strict; + $val =~ s/\s+$//; $val = &$subname($val,$mode,$submode); } else { warn "No handler for \$$PREFIX-$var\n"; @@ -96,9 +104,8 @@ sub Date { $val = "$now " . strftime("%Y/%m/%d %H:%M:%S", gmtime($now)); } } - if($mode eq "s"){ - $val =~ s/\s*$//; # XXX why do I need this? - } +# if($mode eq "s"){ +# } return $val; } @@ -115,14 +122,12 @@ sub Branch { if($mode eq "c"){ if($submode==0){ $val = `git branch --no-color --contains`; - chomp($val); #XXX + $val =~ s/[\n\r]*$//; $val =~ s/^\*\s*//; } } - if($mode eq "s"){ -#XXX do we need this now? - $val =~ s/\s*$//; # XXX why do I need this? - } +# if($mode eq "s"){ +# } return $val; } @@ -132,13 +137,13 @@ sub Revision { if($submode==0){ my $file = $ARGV[1]; my @val = `git log --follow --oneline $file`; - $val = sprintf("1.%d",0+$#val); + my $ver = 0+$#val; + $ver = 0 if($ver < 0); + $val = "1.$ver"; } } - if($mode eq "s"){ -#XXX do we need this here? - $val =~ s/\s*$//; # XXX why do I need this? - } +# if($mode eq "s"){ +# } return $val; } From e1e55c31c799ae2c2512376faa68ae7502f0ed08 Mon Sep 17 00:00:00 2001 From: "Derek S. Ray" Date: Sun, 15 Feb 2015 14:45:36 -0500 Subject: [PATCH 104/354] more win32-specific pieces --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index db3e64482..302497de0 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,10 @@ Nethack.sdf Nethack.opensdf Makefile.bcc Makefile.gcc +Makefile-orig +Makefile.bcc-orig +Makefile.gcc-orig +*.suo *.pdb *.ilk # Win32-specific ignores end From 01756b33fa0853e97451063755bdc1fac0849c6a Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Mon, 16 Feb 2015 00:23:48 -0500 Subject: [PATCH 105/354] Fix a few compiler (clang) warnings. --- include/decl.h | 2 +- src/botl.c | 2 +- sys/share/unixtty.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/decl.h b/include/decl.h index 2e58cc8b2..e31d76bdb 100644 --- a/include/decl.h +++ b/include/decl.h @@ -341,7 +341,7 @@ E nhwchar toplines[]; #define verbalize1(cstr) verbalize("%s", cstr) #define You_hear1(cstr) You_hear("%s", cstr) #define Sprintf1(buf, cstr) Sprintf(buf, "%s", cstr) -#define panic1(cstr) panic(cstr) +#define panic1(cstr) panic("%s", cstr) #ifndef TCAP_H E struct tc_gbl_data { /* also declared in tcap.h */ diff --git a/src/botl.c b/src/botl.c index d67a8a98b..7ad7224b1 100644 --- a/src/botl.c +++ b/src/botl.c @@ -1353,7 +1353,7 @@ genl_status_init() vals[i] = (char *)alloc(MAXCO); *vals[i] = '\0'; activefields[i] = FALSE; - fieldfmt[i] = FALSE; + fieldfmt[i] = (const char *)0; } /* Use a window for the genl version; backward port compatibility */ WIN_STATUS = create_nhwindow(NHW_STATUS); diff --git a/sys/share/unixtty.c b/sys/share/unixtty.c index c277890ee..f691d5a6f 100644 --- a/sys/share/unixtty.c +++ b/sys/share/unixtty.c @@ -380,6 +380,7 @@ init_sco_cons() #ifdef __linux__ /* via Jesse Thilo and Ben Gertzfield */ # include +# include int linux_flag_console = 0; From 07cf4e9657494fa832b3b053130dbb0114a45e47 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Mon, 16 Feb 2015 00:24:05 -0500 Subject: [PATCH 106/354] Replace && with & in blindness timeout check. Caught by clang. --- src/region.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/region.c b/src/region.c index 6c779098b..914b79e62 100644 --- a/src/region.c +++ b/src/region.c @@ -1052,7 +1052,7 @@ region_safety() pline_The("gas cloud has dissipated."); } /* maybe cure blindness too */ - if ((Blinded && TIMEOUT) == 1L) make_blinded(0L, TRUE); + if ((Blinded & TIMEOUT) == 1L) make_blinded(0L, TRUE); } /*region.c*/ From b6ccaf3d547c93f99cf3f2c7e9b4c5374370d7e4 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 17 Feb 2015 16:54:38 +0200 Subject: [PATCH 107/354] Fix the X11 hints file. --- sys/unix/hints/linux-x11 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/unix/hints/linux-x11 b/sys/unix/hints/linux-x11 index 5bd20c9a4..48d46f940 100644 --- a/sys/unix/hints/linux-x11 +++ b/sys/unix/hints/linux-x11 @@ -9,10 +9,10 @@ # for Ubuntu dapper. -HACKDIR=$(PREFIX)/games/lib/$(GAME)dir -SHELLDIR = $(PREFIX)/games #PREFIX=/usr PREFIX=$(wildcard ~)/nh/install +HACKDIR=$(PREFIX)/games/lib/$(GAME)dir +SHELLDIR = $(PREFIX)/games CFLAGS=-O -I../include -DNOTPARMDECL $(CFLAGS1) $(CFLAGS3) CFLAGS1=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\" @@ -31,6 +31,8 @@ VARDATND = x11tiles NetHack.ad pet_mark.xbm CHOWN=true CHGRP=true VARDIRPERM = 0755 +VARFILEPERM = 0600 +GAMEPERM = 0755 POSTINSTALL= bdftopcf win/X11/nh10.bdf > $(HACKDIR)/nh10.pcf; (cd $(HACKDIR); mkfontdir) From e95bd8ec5bfaf5715449b18137952cde042aaa9b Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Wed, 18 Feb 2015 21:48:34 -0500 Subject: [PATCH 108/354] Fix warning with verbalize1 --- src/mail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mail.c b/src/mail.c index 3b76078fa..7221d3864 100644 --- a/src/mail.c +++ b/src/mail.c @@ -310,7 +310,7 @@ md_rush(md,tx,ty) if (fx == tx && fy == ty) break; if ((mon = m_at(fx,fy)) != 0) /* save monster at this position */ - verbalize(md_exclamations()); + verbalize1(md_exclamations()); else if (fx == u.ux && fy == u.uy) verbalize("Excuse me."); From 9644ec781ac19b333d08dcced9cf13583e475865 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Wed, 18 Feb 2015 23:05:37 -0500 Subject: [PATCH 109/354] Destroy water walking boots on lava first. This avoids a player being left standing on lava if their boots are burned up and they survive the damage. This change is originally due to Steve Melenchuk, fixed up by Derrick Sund. --- src/trap.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/trap.c b/src/trap.c index e0e4b38af..9522fe0fd 100644 --- a/src/trap.c +++ b/src/trap.c @@ -4708,14 +4708,24 @@ lava_effects() !obj_resists(obj, 0, 0)) /* for invocation items */ obj->in_use = TRUE; + /* Check whether we should burn away boots *first* so we know whether to + * make the player sink into the lava. Assumption: water walking only comes + * from boots. */ + if (Wwalking && uarmf && is_organic(uarmf) && !uarmf->oerodeproof) { + obj = uarmf; + pline("Your %s into flame!", aobjnam(obj, "burst")); + setequip(os_armf, NULL, em_silent); + useupall(obj); + } + if (!Fire_resistance) { - if(Wwalking) { + if(Wwalking) { pline_The("lava here burns you!"); if (usurvive) { losehp(dmg, lava_killer, KILLED_BY); /* lava damage */ goto burn_stuff; } - } else + } else You("fall into the lava!"); usurvive = Lifesaved || discover; From c6628bcbff1255757074aa16fbc47408a68ef7cb Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Wed, 18 Feb 2015 23:19:23 -0500 Subject: [PATCH 110/354] Clean up the lava code a little. --- src/trap.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/src/trap.c b/src/trap.c index 9522fe0fd..184f04304 100644 --- a/src/trap.c +++ b/src/trap.c @@ -4713,9 +4713,11 @@ lava_effects() * from boots. */ if (Wwalking && uarmf && is_organic(uarmf) && !uarmf->oerodeproof) { obj = uarmf; - pline("Your %s into flame!", aobjnam(obj, "burst")); - setequip(os_armf, NULL, em_silent); - useupall(obj); + pline("%s into flame!", Yobjnam2(obj, "burst")); + iflags.in_lava_effects++; /* (see above) */ + (void) Boots_off(); + useup(obj); + iflags.in_lava_effects--; } if (!Fire_resistance) { @@ -4773,22 +4775,7 @@ lava_effects() } You("find yourself back on solid %s.", surface(u.ux, u.uy)); return(TRUE); - } /* !Fire_resistance */ - - /* just want to burn boots, not all armor; destroy_item doesn't work on - armor anyway */ -burn_stuff: - if (uarmf && !uarmf->oerodeproof && is_organic(uarmf) && - objects[uarmf->otyp].oc_oprop != FIRE_RES) { - /* save uarmf value because Boots_off() sets uarmf to null */ - obj = uarmf; - pline("%s into flame!", Yobjnam2(obj, "burst")); - iflags.in_lava_effects++; /* (see above) */ - (void) Boots_off(); - useup(obj); - iflags.in_lava_effects--; - } - if (!Wwalking) { + } else if (!Wwalking && (!u.utrap || u.utraptype != TT_LAVA)) { boil_away = !Fire_resistance; /* if not fire resistant, sink_into_lava() will quickly be fatal; hero needs to escape immediately */ @@ -4801,6 +4788,8 @@ burn_stuff: losehp(!boil_away ? 1 : (u.uhp / 2), lava_killer, KILLED_BY); /* lava damage */ } + +burn_stuff: destroy_item(SCROLL_CLASS, AD_FIRE); destroy_item(SPBOOK_CLASS, AD_FIRE); destroy_item(POTION_CLASS, AD_FIRE); From 38964dc56cadb89c7755bbeb625f16eb35207275 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Wed, 18 Feb 2015 23:24:41 -0500 Subject: [PATCH 111/354] Clean up lava messages a little. This change has two parts. First, the Book of the Dead now has a special message in lava. This was originally added by Steve Melenchuk (aka Grunt) as a precaution against the Book burning up. While I'm pretty sure that the Book can't burn up in the current codepath, the message is a nice touch and it doesn't help to add a safety check. Second, always print the inventory destruction messages. The reason for this is fairly subtle, but relates to the timing. By not printing the messages when dying, the visible effect to the player is that if they have lifesaving, the items burn up before they die, but if they do not, they burn up after they die---the fact that they do burn up is visible in the dump or bonesfile. --- src/trap.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/trap.c b/src/trap.c index 184f04304..e33b57730 100644 --- a/src/trap.c +++ b/src/trap.c @@ -4730,11 +4730,6 @@ lava_effects() } else You("fall into the lava!"); - usurvive = Lifesaved || discover; -#ifdef WIZARD - if (wizard) usurvive = TRUE; -#endif - /* prevent remove_worn_item() -> Boots_off(WATER_WALKING_BOOTS) -> spoteffects() -> lava_effects() recursion which would successfully delete (via useupall) the no-longer-worn boots; @@ -4745,15 +4740,17 @@ lava_effects() for(obj = invent; obj; obj = obj2) { obj2 = obj->nobj; /* above, we set in_use for objects which are to be destroyed */ - if (obj->in_use) { + if (obj->otyp == SPE_BOOK_OF_THE_DEAD && !Blind) { + pline("%s glows a strange %s, but remains intact.", + The(xname(obj)), hcolor("dark red")); + } else if (obj->in_use) { if (obj->owornmask) { - if (usurvive) - pline("%s into flame!", Yobjnam2(obj, "burst")); + pline("%s into flame!", Yobjnam2(obj, "burst")); remove_worn_item(obj, TRUE); } useupall(obj); } - } + } iflags.in_lava_effects--; From 0fcd4c00938448eedbe988b9fb967aad92aba40f Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Wed, 18 Feb 2015 23:51:08 -0500 Subject: [PATCH 112/354] Remove the 'nul' variable. --- include/decl.h | 1 - src/decl.c | 1 - src/dig.c | 2 +- src/eat.c | 2 +- src/hack.c | 2 +- src/mthrowu.c | 2 +- src/read.c | 16 ++++++++-------- src/save.c | 6 +----- 8 files changed, 13 insertions(+), 19 deletions(-) diff --git a/include/decl.h b/include/decl.h index e31d76bdb..e371c977f 100644 --- a/include/decl.h +++ b/include/decl.h @@ -196,7 +196,6 @@ E NEARDATA char horsename[]; E char preferred_pet; E const char *occtxt; /* defined when occupation != NULL */ E const char *nomovemsg; -E const char nul[]; E char lock[]; E const schar xdir[], ydir[], zdir[]; diff --git a/src/decl.c b/src/decl.c index 775a06f4c..93036da34 100644 --- a/src/decl.c +++ b/src/decl.c @@ -52,7 +52,6 @@ NEARDATA struct kinfo killer = DUMMY; NEARDATA long done_money = 0; #endif const char *nomovemsg = 0; -const char nul[40] = DUMMY; /* contains zeros */ NEARDATA char plname[PL_NSIZ] = DUMMY; /* player name */ NEARDATA char pl_character[PL_CSIZ] = DUMMY; NEARDATA char pl_race = '\0'; diff --git a/src/dig.c b/src/dig.c index 94ee98a18..5e0b40aca 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1855,7 +1855,7 @@ long timeout; /* unused */ char *cname = corpse_xname(obj, (const char *)0, CXN_NO_PFX); Your("%s%s %s away%c", - obj == uwep ? "wielded " : nul, cname, + obj == uwep ? "wielded " : "", cname, otense(obj, "rot"), obj == uwep ? '!' : '.'); } if (obj == uwep) { diff --git a/src/eat.c b/src/eat.c index 00173e583..8aa7f5da1 100644 --- a/src/eat.c +++ b/src/eat.c @@ -691,7 +691,7 @@ register int pm; if (!Slimed && !Unchanging && !slimeproof(youmonst.data)) { You("don't feel very well."); make_slimed(10L, (char*) 0); - delayed_killer(SLIMED, KILLED_BY_AN, nul); + delayed_killer(SLIMED, KILLED_BY_AN, ""); } /* Fall through */ default: diff --git a/src/hack.c b/src/hack.c index 728e75774..792671075 100644 --- a/src/hack.c +++ b/src/hack.c @@ -207,7 +207,7 @@ moverock() pline("%s%s and %s a %s in the %s!", Tobjnam(otmp, (ttmp->ttyp == TRAPDOOR) ? "trigger" : "fall"), - (ttmp->ttyp == TRAPDOOR) ? nul : " into", + (ttmp->ttyp == TRAPDOOR) ? "" : " into", otense(otmp, "plug"), (ttmp->ttyp == TRAPDOOR) ? "trap door" : "hole", surface(rx, ry)); diff --git a/src/mthrowu.c b/src/mthrowu.c index 258dd4755..ea955d6a6 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -412,7 +412,7 @@ struct obj *obj; /* missile (or stack providing it) */ if (!Stoned && !Stone_resistance && !(poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM))) { - make_stoned(5L, (char *)0, KILLED_BY, nul); + make_stoned(5L, (char *)0, KILLED_BY, ""); } } stop_occupation(); diff --git a/src/read.c b/src/read.c index 686a837b1..755d09969 100644 --- a/src/read.c +++ b/src/read.c @@ -228,7 +228,7 @@ register const char *color; pline("%s%s%s for a moment.", Yobjnam2(otmp, Blind ? "vibrate" : "glow"), Blind ? "" : " ", - Blind ? nul : hcolor(color)); + Blind ? "" : hcolor(color)); } /* Is the object chargeable? For purposes of inventory display; it is */ @@ -806,8 +806,8 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */ pline("%s violently %s%s%s for a while, then %s.", Yname2(otmp), otense(otmp, Blind ? "vibrate" : "glow"), - (!Blind && !same_color) ? " " : nul, - (Blind || same_color) ? nul : + (!Blind && !same_color) ? " " : "", + (Blind || same_color) ? "" : hcolor(scursed ? NH_BLACK : NH_SILVER), otense(otmp, "evaporate")); remove_worn_item(otmp, FALSE); @@ -836,10 +836,10 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */ } pline("%s %s%s%s%s for a %s.", Yname2(otmp), - s == 0 ? "violently " : nul, + s == 0 ? "violently " : "", otense(otmp, Blind ? "vibrate" : "glow"), - (!Blind && !same_color) ? " " : nul, - (Blind || same_color) ? nul : + (!Blind && !same_color) ? " " : "", + (Blind || same_color) ? "" : hcolor(scursed ? NH_BLACK : NH_SILVER), (s * s > 1) ? "while" : "moment"); /* [this cost handling will need updating if shop pricing is @@ -914,11 +914,11 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */ Your("%s begin to %s%s.", makeplural(body_part(HAND)), Blind ? "tingle" : "glow ", - Blind ? nul : hcolor(NH_PURPLE)); + Blind ? "" : hcolor(NH_PURPLE)); make_confused(HConfusion + rnd(100),FALSE); } else { pline("A %s%s surrounds your %s.", - Blind ? nul : hcolor(NH_RED), + Blind ? "" : hcolor(NH_RED), Blind ? "faint buzz" : " glow", body_part(HEAD)); make_confused(0L,TRUE); diff --git a/src/save.c b/src/save.c index 51ab3fc36..ce1073973 100644 --- a/src/save.c +++ b/src/save.c @@ -73,11 +73,7 @@ static struct save_procs { #endif }; -#ifdef GCC_WARN -static long nulls[10]; -#else -#define nulls nul -#endif +static long nulls[sizeof(struct trap) + sizeof(struct fruit)]; #if defined(UNIX) || defined(VMS) || defined(__EMX__) || defined(WIN32) #define HUP if (!program_state.done_hup) From b777aff2840389aa36c7b172e3918755565adea5 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 20 Feb 2015 12:59:06 -0500 Subject: [PATCH 113/354] Add fixes notes for the recent lava changes. --- doc/fixes35.0 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index f3e1636c7..5c98db414 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -854,6 +854,8 @@ fix "object lost" panic (or even crash) when dropping multiple items while levitating and a lit potion of oil explodes and destroys some inventory fix "object_is_local" panic when saving bones after hero is killed by explosion produced by dropped or thrown lit potion of oil +if lava burns up the player's water walking boots, the player falls in +the messages for lava burning items up are always printed Platform- and/or Interface-Specific Fixes From 98785f5d44cc0445e6d973027af315310ec6316d Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 20 Feb 2015 20:26:46 +0200 Subject: [PATCH 114/354] Add a missing break Stepping on a magic trap while riding could delete the trap and make the deleted trap hit the steed. --- doc/fixes35.0 | 1 + src/trap.c | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 5c98db414..5aaa60013 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -856,6 +856,7 @@ fix "object_is_local" panic when saving bones after hero is killed by explosion produced by dropped or thrown lit potion of oil if lava burns up the player's water walking boots, the player falls in the messages for lava burning items up are always printed +fix used-up magic trap trying to hit steed. Platform- and/or Interface-Specific Fixes diff --git a/src/trap.c b/src/trap.c index e33b57730..232e4832e 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1213,6 +1213,7 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); losehp(rnd(10), "magical explosion", KILLED_BY_AN); Your("body absorbs some of the magical energy!"); u.uen = (u.uenmax += 2); + break; } else domagictrap(); #ifdef STEED (void) steedintrap(trap, (struct obj *)0); From 55a9ad84deead40e7f448cefd8a5c6d99be1404b Mon Sep 17 00:00:00 2001 From: keni Date: Thu, 26 Feb 2015 08:54:12 -0500 Subject: [PATCH 115/354] Add .gitattribute files. --- .gitattributes | 1 + dat/.gitattributes | 3 +++ doc/.gitattributes | 5 +++++ sys/amiga/.gitattributes | 1 + sys/mac/.gitattributes | 1 + sys/msdos/.gitattributes | 4 ++++ sys/os2/.gitattributes | 1 + sys/share/.gitattributes | 1 + sys/unix/.gitattributes | 1 + sys/unix/hints/.gitattributes | 1 + sys/vms/.gitattributes | 1 + sys/wince/.gitattributes | 3 +++ sys/winnt/.gitattributes | 4 ++++ 13 files changed, 27 insertions(+) create mode 100644 dat/.gitattributes create mode 100644 doc/.gitattributes create mode 100644 sys/amiga/.gitattributes create mode 100644 sys/mac/.gitattributes create mode 100644 sys/msdos/.gitattributes create mode 100644 sys/os2/.gitattributes create mode 100644 sys/share/.gitattributes create mode 100644 sys/unix/.gitattributes create mode 100644 sys/unix/hints/.gitattributes create mode 100644 sys/vms/.gitattributes create mode 100644 sys/wince/.gitattributes create mode 100644 sys/winnt/.gitattributes diff --git a/.gitattributes b/.gitattributes index 72533dbce..894a91c8e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ *.[ch] filter=NHtext merge=NHsubst +*.sh filter=NHtext merge=NHsubst * text=auto *.hqx -text *.sln -text diff --git a/dat/.gitattributes b/dat/.gitattributes new file mode 100644 index 000000000..72aa05edd --- /dev/null +++ b/dat/.gitattributes @@ -0,0 +1,3 @@ +*.def filter=NHtext merge=NHsubst +*.des filter=NHtext merge=NHsubst +*.txt filter=NHtext merge=NHsubst diff --git a/doc/.gitattributes b/doc/.gitattributes new file mode 100644 index 000000000..9ca881076 --- /dev/null +++ b/doc/.gitattributes @@ -0,0 +1,5 @@ +*.mn filter=NHtext merge=NHsubst +*.6 filter=NHtext merge=NHsubst +fixes.* filter=NHtext merge=NHsubst +window.doc filter=NHtext merge=NHsubst + diff --git a/sys/amiga/.gitattributes b/sys/amiga/.gitattributes new file mode 100644 index 000000000..7a28030a9 --- /dev/null +++ b/sys/amiga/.gitattributes @@ -0,0 +1 @@ +*.p filter=NHtext merge=NHsubst diff --git a/sys/mac/.gitattributes b/sys/mac/.gitattributes new file mode 100644 index 000000000..62b9832d7 --- /dev/null +++ b/sys/mac/.gitattributes @@ -0,0 +1 @@ +NHDeflts filter=NHtext merge=NHsubst diff --git a/sys/msdos/.gitattributes b/sys/msdos/.gitattributes new file mode 100644 index 000000000..baef52e46 --- /dev/null +++ b/sys/msdos/.gitattributes @@ -0,0 +1,4 @@ +*.BC filter=NHtext merge=NHsubst +*.bat filter=NHtext merge=NHsubst +Makefile.* filter=NHtext merge=NHsubst +Install.* filter=NHtext merge=NHsubst diff --git a/sys/os2/.gitattributes b/sys/os2/.gitattributes new file mode 100644 index 000000000..8cffb77ae --- /dev/null +++ b/sys/os2/.gitattributes @@ -0,0 +1 @@ +Makefile.* filter=NHtext merge=NHsubst diff --git a/sys/share/.gitattributes b/sys/share/.gitattributes new file mode 100644 index 000000000..8cffb77ae --- /dev/null +++ b/sys/share/.gitattributes @@ -0,0 +1 @@ +Makefile.* filter=NHtext merge=NHsubst diff --git a/sys/unix/.gitattributes b/sys/unix/.gitattributes new file mode 100644 index 000000000..8cffb77ae --- /dev/null +++ b/sys/unix/.gitattributes @@ -0,0 +1 @@ +Makefile.* filter=NHtext merge=NHsubst diff --git a/sys/unix/hints/.gitattributes b/sys/unix/hints/.gitattributes new file mode 100644 index 000000000..a079959f1 --- /dev/null +++ b/sys/unix/hints/.gitattributes @@ -0,0 +1 @@ +* filter=NHtext merge=NHsubst diff --git a/sys/vms/.gitattributes b/sys/vms/.gitattributes new file mode 100644 index 000000000..8cffb77ae --- /dev/null +++ b/sys/vms/.gitattributes @@ -0,0 +1 @@ +Makefile.* filter=NHtext merge=NHsubst diff --git a/sys/wince/.gitattributes b/sys/wince/.gitattributes new file mode 100644 index 000000000..e034edc5e --- /dev/null +++ b/sys/wince/.gitattributes @@ -0,0 +1,3 @@ +*.ce filter=NHtext merge=NHsubst +*.mak filter=NHtext merge=NHsubst +*.bat filter=NHtext merge=NHsubst diff --git a/sys/winnt/.gitattributes b/sys/winnt/.gitattributes new file mode 100644 index 000000000..2a38b029c --- /dev/null +++ b/sys/winnt/.gitattributes @@ -0,0 +1,4 @@ +Install.nt filter=NHtext merge=NHsubst +Makefile.* filter=NHtext merge=NHsubst +*.rc filter=NHtext merge=NHsubst +*.bat filter=NHtext merge=NHsubst From 25cd007c484413dcee3d2753319eecc18fee8be2 Mon Sep 17 00:00:00 2001 From: keni Date: Thu, 26 Feb 2015 09:19:03 -0500 Subject: [PATCH 116/354] Bulk recovery of file CVS headers and addition of NHDT- headers. --- dat/Arch.des | 3 ++- dat/Barb.des | 3 ++- dat/Caveman.des | 3 ++- dat/Healer.des | 3 ++- dat/Knight.des | 3 ++- dat/Monk.des | 3 ++- dat/Priest.des | 3 ++- dat/Ranger.des | 3 ++- dat/Rogue.des | 3 ++- dat/Samurai.des | 3 ++- dat/Tourist.des | 3 ++- dat/Valkyrie.des | 3 ++- dat/Wizard.des | 3 ++- dat/bigroom.des | 3 ++- dat/castle.des | 3 ++- dat/data.base | 3 ++- dat/dungeon.def | 3 ++- dat/endgame.des | 3 ++- dat/gehennom.des | 3 ++- dat/knox.des | 3 ++- dat/medusa.des | 3 ++- dat/mines.des | 3 ++- dat/oracle.des | 3 ++- dat/quest.txt | 3 ++- dat/sokoban.des | 3 ++- dat/tower.des | 3 ++- dat/yendor.des | 3 ++- doc/Guidebook.mn | 3 ++- doc/dgn_comp.6 | 3 ++- doc/dlb.6 | 3 ++- doc/fixes30.0 | 3 ++- doc/fixes34.1 | 3 ++- doc/fixes34.2 | 3 ++- doc/fixes34.3 | 3 ++- doc/fixes35.0 | 3 ++- doc/lev_comp.6 | 3 ++- doc/makedefs.6 | 3 ++- doc/nethack.6 | 3 ++- doc/recover.6 | 3 ++- doc/window.doc | 3 ++- include/align.h | 3 ++- include/amiconf.h | 3 ++- include/artifact.h | 3 ++- include/artilist.h | 3 ++- include/attrib.h | 3 ++- include/beconf.h | 3 ++- include/botl.h | 3 ++- include/color.h | 3 ++- include/config.h | 3 ++- include/config1.h | 3 ++- include/context.h | 3 ++- include/coord.h | 3 ++- include/decl.h | 3 ++- include/def_os2.h | 3 ++- include/dgn_file.h | 3 ++- include/display.h | 3 ++- include/dlb.h | 3 ++- include/dungeon.h | 3 ++- include/engrave.h | 3 ++- include/extern.h | 3 ++- include/flag.h | 3 ++- include/func_tab.h | 3 ++- include/global.h | 3 ++- include/hack.h | 3 ++- include/lev.h | 3 ++- include/mac-carbon.h | 3 ++- include/mac-qt.h | 3 ++- include/mac-term.h | 3 ++- include/macconf.h | 3 ++- include/macpopup.h | 3 ++- include/mactty.h | 3 ++- include/macwin.h | 3 ++- include/mail.h | 3 ++- include/mextra.h | 3 ++- include/mfndpos.h | 3 ++- include/micro.h | 3 ++- include/mkroom.h | 3 ++- include/monattk.h | 3 ++- include/mondata.h | 3 ++- include/monflag.h | 3 ++- include/monst.h | 3 ++- include/monsym.h | 3 ++- include/mttypriv.h | 3 ++- include/ntconf.h | 3 ++- include/obj.h | 3 ++- include/objclass.h | 3 ++- include/os2conf.h | 3 ++- include/patchlevel.h | 3 ++- include/pcconf.h | 3 ++- include/permonst.h | 3 ++- include/prop.h | 3 ++- include/qt_clust.h | 3 ++- include/qt_kde0.h | 3 ++- include/qt_win.h | 3 ++- include/qtext.h | 3 ++- include/qttableview.h | 3 ++- include/quest.h | 3 ++- include/rect.h | 3 ++- include/region.h | 3 ++- include/rm.h | 3 ++- include/skills.h | 3 ++- include/sp_lev.h | 3 ++- include/spell.h | 3 ++- include/sys.h | 3 ++- include/system.h | 3 ++- include/tcap.h | 3 ++- include/tile2x11.h | 3 ++- include/timeout.h | 3 ++- include/tosconf.h | 3 ++- include/tradstdc.h | 3 ++- include/trampoli.h | 3 ++- include/trap.h | 3 ++- include/unixconf.h | 3 ++- include/vision.h | 3 ++- include/vmsconf.h | 3 ++- include/wceconf.h | 3 ++- include/winGnome.h | 3 ++- include/winX.h | 3 ++- include/winami.h | 3 ++- include/wingem.h | 3 ++- include/winprocs.h | 3 ++- include/wintty.h | 3 ++- include/wintype.h | 3 ++- include/xwindow.h | 3 ++- include/xwindowp.h | 3 ++- include/you.h | 3 ++- include/youprop.h | 3 ++- src/allmain.c | 3 ++- src/alloc.c | 3 ++- src/apply.c | 3 ++- src/artifact.c | 3 ++- src/attrib.c | 3 ++- src/ball.c | 3 ++- src/bones.c | 3 ++- src/botl.c | 3 ++- src/cmd.c | 3 ++- src/dbridge.c | 3 ++- src/decl.c | 3 ++- src/detect.c | 3 ++- src/dig.c | 3 ++- src/display.c | 3 ++- src/dlb.c | 3 ++- src/do.c | 3 ++- src/do_name.c | 3 ++- src/do_wear.c | 3 ++- src/dog.c | 3 ++- src/dogmove.c | 3 ++- src/dokick.c | 3 ++- src/dothrow.c | 3 ++- src/drawing.c | 3 ++- src/dungeon.c | 3 ++- src/eat.c | 3 ++- src/end.c | 3 ++- src/engrave.c | 3 ++- src/exper.c | 3 ++- src/explode.c | 3 ++- src/extralev.c | 3 ++- src/files.c | 3 ++- src/fountain.c | 3 ++- src/hack.c | 3 ++- src/hacklib.c | 3 ++- src/invent.c | 3 ++- src/light.c | 3 ++- src/lock.c | 3 ++- src/mail.c | 3 ++- src/makemon.c | 3 ++- src/mapglyph.c | 3 ++- src/mcastu.c | 3 ++- src/mhitm.c | 3 ++- src/mhitu.c | 3 ++- src/minion.c | 3 ++- src/mklev.c | 3 ++- src/mkmap.c | 3 ++- src/mkmaze.c | 3 ++- src/mkobj.c | 3 ++- src/mkroom.c | 3 ++- src/mon.c | 3 ++- src/mondata.c | 3 ++- src/monmove.c | 3 ++- src/monst.c | 3 ++- src/mplayer.c | 3 ++- src/mthrowu.c | 3 ++- src/muse.c | 3 ++- src/music.c | 3 ++- src/o_init.c | 3 ++- src/objects.c | 3 ++- src/objnam.c | 3 ++- src/options.c | 3 ++- src/pager.c | 3 ++- src/pickup.c | 3 ++- src/pline.c | 3 ++- src/polyself.c | 3 ++- src/potion.c | 3 ++- src/pray.c | 3 ++- src/priest.c | 3 ++- src/quest.c | 3 ++- src/questpgr.c | 3 ++- src/read.c | 3 ++- src/rect.c | 3 ++- src/region.c | 3 ++- src/restore.c | 3 ++- src/rip.c | 3 ++- src/rnd.c | 3 ++- src/role.c | 3 ++- src/rumors.c | 3 ++- src/save.c | 3 ++- src/shk.c | 3 ++- src/shknam.c | 3 ++- src/sit.c | 3 ++- src/sounds.c | 3 ++- src/sp_lev.c | 3 ++- src/spell.c | 3 ++- src/steal.c | 3 ++- src/steed.c | 3 ++- src/sys.c | 3 ++- src/teleport.c | 3 ++- src/timeout.c | 3 ++- src/topten.c | 3 ++- src/track.c | 3 ++- src/trap.c | 3 ++- src/u_init.c | 3 ++- src/uhitm.c | 3 ++- src/vault.c | 3 ++- src/version.c | 3 ++- src/vision.c | 3 ++- src/weapon.c | 3 ++- src/were.c | 3 ++- src/wield.c | 3 ++- src/windows.c | 3 ++- src/wizard.c | 3 ++- src/worm.c | 3 ++- src/worn.c | 3 ++- src/write.c | 3 ++- src/zap.c | 3 ++- sys/amiga/amidos.c | 3 ++- sys/amiga/amidos.p | 3 ++- sys/amiga/amigst.c | 3 ++- sys/amiga/amimenu.c | 3 ++- sys/amiga/amirip.c | 3 ++- sys/amiga/amisnd.c | 3 ++- sys/amiga/amistack.c | 3 ++- sys/amiga/amitty.c | 3 ++- sys/amiga/amiwind.c | 3 ++- sys/amiga/amiwind.p | 3 ++- sys/amiga/cvtsnd.c | 3 ++- sys/amiga/txt2iff.c | 3 ++- sys/amiga/winami.c | 3 ++- sys/amiga/winami.p | 3 ++- sys/amiga/winchar.c | 3 ++- sys/amiga/windefs.h | 3 ++- sys/amiga/winext.h | 3 ++- sys/amiga/winfuncs.c | 3 ++- sys/amiga/winkey.c | 3 ++- sys/amiga/winmenu.c | 3 ++- sys/amiga/winproto.h | 3 ++- sys/amiga/winreq.c | 3 ++- sys/amiga/winstr.c | 3 ++- sys/amiga/xpm2iff.c | 3 ++- sys/atari/tos.c | 3 ++- sys/be/bemain.c | 3 ++- sys/mac/NHDeflts | 3 ++- sys/mac/dprintf.c | 3 ++- sys/mac/maccurs.c | 3 ++- sys/mac/macerrs.c | 3 ++- sys/mac/macfile.c | 3 ++- sys/mac/macmain.c | 3 ++- sys/mac/macmenu.c | 3 ++- sys/mac/macsnd.c | 3 ++- sys/mac/mactopl.c | 3 ++- sys/mac/mactty.c | 3 ++- sys/mac/macunix.c | 3 ++- sys/mac/macwin.c | 3 ++- sys/mac/mgetline.c | 3 ++- sys/mac/mmodal.c | 3 ++- sys/mac/mrecover.c | 3 ++- sys/mac/mttymain.c | 3 ++- sys/msdos/Install.dos | 3 ++- sys/msdos/Makefile.BC | 3 ++- sys/msdos/Makefile.GCC | 3 ++- sys/msdos/Makefile.MSC | 3 ++- sys/msdos/msdos.c | 3 ++- sys/msdos/ovlinit.c | 3 ++- sys/msdos/pckeys.c | 3 ++- sys/msdos/pctiles.c | 3 ++- sys/msdos/pctiles.h | 3 ++- sys/msdos/pcvideo.h | 3 ++- sys/msdos/portio.h | 3 ++- sys/msdos/schema1.BC | 3 ++- sys/msdos/schema2.BC | 3 ++- sys/msdos/setup.bat | 3 ++- sys/msdos/sound.c | 3 ++- sys/msdos/tile2bin.c | 3 ++- sys/msdos/video.c | 3 ++- sys/msdos/vidtxt.c | 3 ++- sys/msdos/vidvga.c | 3 ++- sys/os2/Makefile.os2 | 3 ++- sys/os2/os2.c | 3 ++- sys/share/Makefile.lib | 3 ++- sys/share/ioctl.c | 3 ++- sys/share/nhlan.c | 3 ++- sys/share/pcmain.c | 3 ++- sys/share/pcsys.c | 3 ++- sys/share/pctty.c | 3 ++- sys/share/pcunix.c | 3 ++- sys/share/tclib.c | 3 ++- sys/share/unixtty.c | 3 ++- sys/unix/Makefile.dat | 3 ++- sys/unix/Makefile.doc | 3 ++- sys/unix/Makefile.src | 3 ++- sys/unix/Makefile.top | 3 ++- sys/unix/Makefile.utl | 3 ++- sys/unix/hints/linux | 3 ++- sys/unix/hints/linux-x11 | 3 ++- sys/unix/hints/macosx | 3 ++- sys/unix/hints/macosx.sh | 3 ++- sys/unix/hints/macosx10.5 | 3 ++- sys/unix/hints/macosx10.7 | 3 ++- sys/unix/hints/unix | 3 ++- sys/unix/mkmkfile.sh | 3 ++- sys/unix/nethack.sh | 3 ++- sys/unix/setup.sh | 3 ++- sys/unix/sysconf | 3 ++- sys/unix/unixmain.c | 3 ++- sys/unix/unixres.c | 3 ++- sys/unix/unixunix.c | 3 ++- sys/vms/Makefile.dat | 3 ++- sys/vms/Makefile.doc | 3 ++- sys/vms/Makefile.src | 3 ++- sys/vms/Makefile.top | 3 ++- sys/vms/Makefile.utl | 3 ++- sys/vms/lev_lex.h | 3 ++- sys/vms/oldcrtl.c | 3 ++- sys/vms/vmsfiles.c | 3 ++- sys/vms/vmsmail.c | 3 ++- sys/vms/vmsmain.c | 3 ++- sys/vms/vmsmisc.c | 3 ++- sys/vms/vmstty.c | 3 ++- sys/vms/vmsunix.c | 3 ++- sys/wince/Install.ce | 3 ++- sys/wince/bootstrp.mak | 3 ++- sys/wince/celib.c | 3 ++- sys/wince/cesetup.bat | 3 ++- sys/wince/cesound.c | 6 ++++-- sys/wince/mhaskyn.c | 3 ++- sys/wince/mhaskyn.h | 3 ++- sys/wince/mhcmd.c | 3 ++- sys/wince/mhcolor.c | 3 ++- sys/wince/mhcolor.h | 3 ++- sys/wince/mhdlg.c | 3 ++- sys/wince/mhdlg.h | 3 ++- sys/wince/mhfont.c | 3 ++- sys/wince/mhfont.h | 3 ++- sys/wince/mhinput.c | 3 ++- sys/wince/mhinput.h | 3 ++- sys/wince/mhmain.c | 3 ++- sys/wince/mhmain.h | 3 ++- sys/wince/mhmap.c | 3 ++- sys/wince/mhmap.h | 3 ++- sys/wince/mhmsg.h | 3 ++- sys/wince/mhmsgwnd.c | 3 ++- sys/wince/mhmsgwnd.h | 3 ++- sys/wince/mhrip.c | 3 ++- sys/wince/mhrip.h | 3 ++- sys/wince/mhstatus.c | 3 ++- sys/wince/mhstatus.h | 3 ++- sys/wince/mhtext.c | 3 ++- sys/wince/mhtext.h | 3 ++- sys/wince/mhtxtbuf.c | 3 ++- sys/wince/mhtxtbuf.h | 3 ++- sys/wince/mswproc.c | 3 ++- sys/wince/winMS.h | 3 ++- sys/wince/winhack.c | 3 ++- sys/winnt/Install.nt | 3 ++- sys/winnt/Makefile.bcc | 3 ++- sys/winnt/Makefile.gcc | 3 ++- sys/winnt/Makefile.msc | 3 ++- sys/winnt/console.rc | 6 ++++-- sys/winnt/nh340key.c | 6 ++++-- sys/winnt/nhdefkey.c | 6 ++++-- sys/winnt/nhraykey.c | 6 ++++-- sys/winnt/nhsetup.bat | 3 ++- sys/winnt/ntsound.c | 6 ++++-- sys/winnt/nttty.c | 6 ++++-- sys/winnt/win32api.h | 6 ++++-- sys/winnt/winnt.c | 6 ++++-- util/dgn_comp.l | 3 ++- util/dgn_comp.y | 3 ++- util/dgn_main.c | 3 ++- util/dlb_main.c | 3 ++- util/lev_comp.l | 3 ++- util/lev_comp.y | 3 ++- util/lev_main.c | 3 ++- util/makedefs.c | 3 ++- util/mdgrep.h | 3 ++- util/mdgrep.pl | 5 +++-- util/panic.c | 3 ++- util/recover.c | 3 ++- win/Qt/qt_clust.cpp | 3 ++- win/Qt/qt_win.cpp | 3 ++- win/Qt/qttableview.cpp | 3 ++- win/Qt/tileedit.cpp | 3 ++- win/Qt/tileedit.h | 3 ++- win/X11/Window.c | 3 ++- win/X11/nh32icon | 3 ++- win/X11/nh56icon | 3 ++- win/X11/nh72icon | 3 ++- win/X11/winX.c | 3 ++- win/X11/winmap.c | 3 ++- win/X11/winmenu.c | 3 ++- win/X11/winmesg.c | 3 ++- win/X11/winmisc.c | 3 ++- win/X11/winstat.c | 3 ++- win/X11/wintext.c | 3 ++- win/X11/winval.c | 3 ++- win/chain/wc_chainin.c | 3 ++- win/chain/wc_chainout.c | 3 ++- win/chain/wc_trace.c | 3 ++- win/gem/gr_rect.c | 3 ++- win/gem/tile2img.c | 3 ++- win/gem/wingem.c | 3 ++- win/gem/wingem1.c | 3 ++- win/gem/xpm2img.c | 3 ++- win/gnome/gn_xpms.h | 3 ++- win/gnome/gnaskstr.c | 3 ++- win/gnome/gnaskstr.h | 3 ++- win/gnome/gnbind.c | 3 ++- win/gnome/gnbind.h | 3 ++- win/gnome/gnglyph.c | 3 ++- win/gnome/gnglyph.h | 3 ++- win/gnome/gnmain.c | 3 ++- win/gnome/gnmain.h | 3 ++- win/gnome/gnmap.c | 3 ++- win/gnome/gnmap.h | 3 ++- win/gnome/gnmenu.c | 3 ++- win/gnome/gnmenu.h | 3 ++- win/gnome/gnmesg.c | 3 ++- win/gnome/gnmesg.h | 3 ++- win/gnome/gnomeprv.h | 3 ++- win/gnome/gnopts.c | 3 ++- win/gnome/gnopts.h | 3 ++- win/gnome/gnplayer.c | 3 ++- win/gnome/gnplayer.h | 3 ++- win/gnome/gnsignal.c | 3 ++- win/gnome/gnsignal.h | 3 ++- win/gnome/gnstatus.c | 3 ++- win/gnome/gnstatus.h | 3 ++- win/gnome/gntext.c | 3 ++- win/gnome/gntext.h | 3 ++- win/gnome/gnyesno.c | 3 ++- win/gnome/gnyesno.h | 3 ++- win/macosx/NetHackGuidebook.applescript | 3 ++- win/macosx/NetHackRecover.applescript | 3 ++- win/macosx/NetHackTerm.applescript | 3 ++- win/macosx/recover.pl | 3 ++- win/share/ppmwrite.c | 3 ++- win/share/thintile.c | 3 ++- win/share/tile.doc | 3 ++- win/share/tile.h | 3 ++- win/share/tile2bmp.c | 3 ++- win/share/tilemap.c | 3 ++- win/share/tiletext.c | 3 ++- win/tty/getline.c | 3 ++- win/tty/termcap.c | 3 ++- win/tty/topl.c | 3 ++- win/tty/wintty.c | 3 ++- win/win32/mhaskyn.c | 3 ++- win/win32/mhaskyn.h | 3 ++- win/win32/mhdlg.c | 3 ++- win/win32/mhdlg.h | 3 ++- win/win32/mhfont.c | 3 ++- win/win32/mhfont.h | 3 ++- win/win32/mhinput.c | 3 ++- win/win32/mhinput.h | 3 ++- win/win32/mhmain.c | 3 ++- win/win32/mhmain.h | 3 ++- win/win32/mhmap.c | 3 ++- win/win32/mhmap.h | 3 ++- win/win32/mhmenu.c | 3 ++- win/win32/mhmenu.h | 3 ++- win/win32/mhmsg.h | 3 ++- win/win32/mhmsgwnd.c | 3 ++- win/win32/mhmsgwnd.h | 3 ++- win/win32/mhrip.c | 3 ++- win/win32/mhrip.h | 3 ++- win/win32/mhsplash.c | 3 ++- win/win32/mhstatus.c | 3 ++- win/win32/mhstatus.h | 3 ++- win/win32/mhtext.c | 3 ++- win/win32/mhtext.h | 3 ++- win/win32/mswproc.c | 3 ++- win/win32/winMS.h | 3 ++- win/win32/winhack.c | 3 ++- 492 files changed, 1003 insertions(+), 502 deletions(-) mode change 100755 => 100644 sys/msdos/setup.bat mode change 100755 => 100644 sys/unix/hints/macosx.sh mode change 100755 => 100644 sys/unix/mkmkfile.sh mode change 100755 => 100644 sys/unix/nethack.sh mode change 100755 => 100644 sys/unix/setup.sh mode change 100755 => 100644 sys/wince/cesetup.bat mode change 100755 => 100644 sys/winnt/nhsetup.bat mode change 100755 => 100644 win/macosx/recover.pl diff --git a/dat/Arch.des b/dat/Arch.des index ef9f551d5..3c1ccfaf0 100644 --- a/dat/Arch.des +++ b/dat/Arch.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Arch.des $Date$ $Revision$ +# NetHack 3.5 Arch.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Arch.des $Date: 2009/05/06 10:44:15 $ $Revision: 1.6 $ # SCCS Id: @(#)Arch.des 3.5 1997/01/31 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991 by M. Stephenson diff --git a/dat/Barb.des b/dat/Barb.des index 8f65d8986..29a612015 100644 --- a/dat/Barb.des +++ b/dat/Barb.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Barb.des $Date$ $Revision$ +# NetHack 3.5 Barb.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Barb.des $Date: 2009/05/06 10:44:15 $ $Revision: 1.4 $ # SCCS Id: @(#)Barb.des 3.5 1991/12/22 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991 by M. Stephenson diff --git a/dat/Caveman.des b/dat/Caveman.des index 1dcdbe537..f9617c86f 100644 --- a/dat/Caveman.des +++ b/dat/Caveman.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Caveman.des $Date$ $Revision$ +# NetHack 3.5 Caveman.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Caveman.des $Date: 2009/05/06 10:44:15 $ $Revision: 1.4 $ # SCCS Id: @(#)Caveman.des 3.5 1995/10/07 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991 by M. Stephenson diff --git a/dat/Healer.des b/dat/Healer.des index b394c39c9..3a93adc4f 100644 --- a/dat/Healer.des +++ b/dat/Healer.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Healer.des $Date$ $Revision$ +# NetHack 3.5 Healer.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Healer.des $Date: 2009/05/06 10:44:16 $ $Revision: 1.5 $ # SCCS Id: @(#)Healer.des 3.5 1995/04/16 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991, 1993 by M. Stephenson, P. Winner diff --git a/dat/Knight.des b/dat/Knight.des index 9b166652c..2be72af7d 100644 --- a/dat/Knight.des +++ b/dat/Knight.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Knight.des $Date$ $Revision$ +# NetHack 3.5 Knight.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Knight.des $Date: 2009/05/06 10:44:16 $ $Revision: 1.4 $ # SCCS Id: @(#)Knight.des 3.5 1995/04/16 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991,92 by M. Stephenson diff --git a/dat/Monk.des b/dat/Monk.des index 6c70125bd..fe75301d9 100644 --- a/dat/Monk.des +++ b/dat/Monk.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Monk.des $Date$ $Revision$ +# NetHack 3.5 Monk.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Monk.des $Date: 2009/05/06 10:44:16 $ $Revision: 1.6 $ # SCCS Id: @(#)Monk.des 3.5 2002/04/08 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991-2 by M. Stephenson diff --git a/dat/Priest.des b/dat/Priest.des index 92f7074fe..ea4aef3c5 100644 --- a/dat/Priest.des +++ b/dat/Priest.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Priest.des $Date$ $Revision$ +# NetHack 3.5 Priest.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Priest.des $Date: 2009/05/06 10:44:17 $ $Revision: 1.5 $ # SCCS Id: @(#)Priest.des 3.5 2002/04/08 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991-2 by M. Stephenson diff --git a/dat/Ranger.des b/dat/Ranger.des index 10c88cde2..d36559cb6 100644 --- a/dat/Ranger.des +++ b/dat/Ranger.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Ranger.des $Date$ $Revision$ +# NetHack 3.5 Ranger.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Ranger.des $Date: 2009/05/06 10:44:17 $ $Revision: 1.4 $ # SCCS Id: @(#)Ranger.des 3.5 2001/02/01 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991 by M. Stephenson diff --git a/dat/Rogue.des b/dat/Rogue.des index d6f35cd16..2d2c6a202 100644 --- a/dat/Rogue.des +++ b/dat/Rogue.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Rogue.des $Date$ $Revision$ +# NetHack 3.5 Rogue.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Rogue.des $Date: 2009/05/06 10:44:17 $ $Revision: 1.6 $ # SCCS Id: @(#)Rogue.des 3.5 2002/02/15 # Copyright (c) 1992 by Dean Luick # NetHack may be freely redistributed. See license for details. diff --git a/dat/Samurai.des b/dat/Samurai.des index 73f150566..565a2ed67 100644 --- a/dat/Samurai.des +++ b/dat/Samurai.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Samurai.des $Date$ $Revision$ +# NetHack 3.5 Samurai.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Samurai.des $Date: 2009/05/06 10:44:17 $ $Revision: 1.6 $ # SCCS Id: @(#)Samurai.des 3.5 2002/04/08 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991-92 by M. Stephenson, P. Winner diff --git a/dat/Tourist.des b/dat/Tourist.des index e446fb47c..e9b1658e9 100644 --- a/dat/Tourist.des +++ b/dat/Tourist.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Tourist.des $Date$ $Revision$ +# NetHack 3.5 Tourist.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Tourist.des $Date: 2009/05/06 10:44:17 $ $Revision: 1.4 $ # SCCS Id: @(#)Tourist.des 3.5 1992/09/26 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991,92 by M. Stephenson, P. Winner diff --git a/dat/Valkyrie.des b/dat/Valkyrie.des index 4361ea155..04c401bde 100644 --- a/dat/Valkyrie.des +++ b/dat/Valkyrie.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Valkyrie.des $Date$ $Revision$ +# NetHack 3.5 Valkyrie.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Valkyrie.des $Date: 2009/05/06 10:44:17 $ $Revision: 1.6 $ # SCCS Id: @(#)Valkyrie.des 3.5 2007/08/01 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991-2 by M. Stephenson diff --git a/dat/Wizard.des b/dat/Wizard.des index cdcf9184a..dae831ed4 100644 --- a/dat/Wizard.des +++ b/dat/Wizard.des @@ -1,4 +1,5 @@ -# NetHack 3.5 Wizard.des $Date$ $Revision$ +# NetHack 3.5 Wizard.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Wizard.des $Date: 2009/05/06 10:44:17 $ $Revision: 1.5 $ # SCCS Id: @(#)Wizard.des 3.5 1992/07/11 # Copyright (c) 1992 by David Cohrs # NetHack may be freely redistributed. See license for details. diff --git a/dat/bigroom.des b/dat/bigroom.des index aeaed8bb7..00ea47f32 100644 --- a/dat/bigroom.des +++ b/dat/bigroom.des @@ -1,4 +1,5 @@ -# NetHack 3.5 bigroom.des $Date$ $Revision$ +# NetHack 3.5 bigroom.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 bigroom.des $Date: 2009/05/06 10:44:18 $ $Revision: 1.4 $ # SCCS Id: @(#)bigroom.des 3.5 1990/04/15 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1990 by M. Stephenson diff --git a/dat/castle.des b/dat/castle.des index 95653fa4e..1dd4fda78 100644 --- a/dat/castle.des +++ b/dat/castle.des @@ -1,4 +1,5 @@ -# NetHack 3.5 castle.des $Date$ $Revision$ +# NetHack 3.5 castle.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 castle.des $Date: 2009/05/06 10:44:18 $ $Revision: 1.5 $ # SCCS Id: @(#)castle.des 3.5 2002/05/02 # Copyright (c) 1989 by Jean-Christophe Collet # NetHack may be freely redistributed. See license for details. diff --git a/dat/data.base b/dat/data.base index c832a4780..67fca7aba 100644 --- a/dat/data.base +++ b/dat/data.base @@ -1,4 +1,5 @@ -# NetHack 3.5 data.base $Date$ $Revision$ +# NetHack 3.5 data.base $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 data.base $Date: 2014/10/09 02:04:43 $ $Revision: 1.50 $ # Copyright (c) 1994, 1995, 1996 by the NetHack Development Team # Copyright (c) 1994 by Boudewijn Wayers # NetHack may be freely redistributed. See license for details. diff --git a/dat/dungeon.def b/dat/dungeon.def index 203ece10a..b881884f5 100644 --- a/dat/dungeon.def +++ b/dat/dungeon.def @@ -1,4 +1,5 @@ -# NetHack 3.5 dungeon.def $Date$ $Revision$ +# NetHack 3.5 dungeon.def $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 dungeon.def $Date: 2009/05/06 10:44:21 $ $Revision: 1.6 $ # SCCS Id: @(#)dungeon.def 3.5 2006/03/18 # Copyright (c) 1990-95 by M. Stephenson # NetHack may be freely redistributed. See license for details. diff --git a/dat/endgame.des b/dat/endgame.des index d037a650d..4758ff518 100644 --- a/dat/endgame.des +++ b/dat/endgame.des @@ -1,4 +1,5 @@ -# NetHack 3.5 endgame.des $Date$ $Revision$ +# NetHack 3.5 endgame.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 endgame.des $Date: 2009/05/06 10:44:22 $ $Revision: 1.6 $ # SCCS Id: @(#)endgame.des 3.5 2007/03/02 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1992,1993 by Izchak Miller, David Cohrs, diff --git a/dat/gehennom.des b/dat/gehennom.des index c85fc0931..daba7f532 100644 --- a/dat/gehennom.des +++ b/dat/gehennom.des @@ -1,4 +1,5 @@ -# NetHack 3.5 gehennom.des $Date$ $Revision$ +# NetHack 3.5 gehennom.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 gehennom.des $Date: 2009/05/06 10:44:23 $ $Revision: 1.5 $ # SCCS Id: @(#)gehennom.des 3.5 2005/02/02 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1992 by M. Stephenson and Izchak Miller diff --git a/dat/knox.des b/dat/knox.des index e398fd443..d9d1a2d4d 100644 --- a/dat/knox.des +++ b/dat/knox.des @@ -1,4 +1,5 @@ -# NetHack 3.5 knox.des $Date$ $Revision$ +# NetHack 3.5 knox.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 knox.des $Date: 2009/05/06 10:44:23 $ $Revision: 1.5 $ # SCCS Id: @(#)knox.des 3.5 2006/03/20 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1992 by Izchak Miller diff --git a/dat/medusa.des b/dat/medusa.des index 2e9ec44a2..ae65ff6d5 100644 --- a/dat/medusa.des +++ b/dat/medusa.des @@ -1,4 +1,5 @@ -# NetHack 3.5 medusa.des $Date$ $Revision$ +# NetHack 3.5 medusa.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 medusa.des $Date: 2009/05/06 10:44:23 $ $Revision: 1.5 $ # SCCS Id: @(#)medusa.des 3.5 1996/05/11 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1990, 1991 by M. Stephenson diff --git a/dat/mines.des b/dat/mines.des index a23c80850..8408bbd9d 100644 --- a/dat/mines.des +++ b/dat/mines.des @@ -1,4 +1,5 @@ -# NetHack 3.5 mines.des $Date$ $Revision$ +# NetHack 3.5 mines.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 mines.des $Date: 2009/05/06 10:44:23 $ $Revision: 1.17 $ # SCCS Id: @(#)mines.des 3.5 2002/05/02 # Copyright (c) 1989-95 by Jean-Christophe Collet # Copyright (c) 1991-95 by M. Stephenson diff --git a/dat/oracle.des b/dat/oracle.des index 970117ec2..72da0401f 100644 --- a/dat/oracle.des +++ b/dat/oracle.des @@ -1,4 +1,5 @@ -# NetHack 3.5 oracle.des $Date$ $Revision$ +# NetHack 3.5 oracle.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 oracle.des $Date: 2009/05/06 10:44:23 $ $Revision: 1.4 $ # SCCS Id: @(#)oracle.des 3.5 1995/10/07 # NetHack may be freely redistributed. See license for details. # diff --git a/dat/quest.txt b/dat/quest.txt index c74be18fa..98e8de382 100644 --- a/dat/quest.txt +++ b/dat/quest.txt @@ -1,4 +1,5 @@ -# NetHack 3.5 quest.txt $Date$ $Revision$ +# NetHack 3.5 quest.txt $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 quest.txt $Date: 2009/05/06 10:44:23 $ $Revision: 1.23 $ # SCCS Id: @(#)quest.txt 3.5 2005/12/03 # Copyright (c) 1991 by M. Stephenson # NetHack may be freely redistributed. See license for details. diff --git a/dat/sokoban.des b/dat/sokoban.des index d0e5a1507..21eb63de5 100644 --- a/dat/sokoban.des +++ b/dat/sokoban.des @@ -1,4 +1,5 @@ -# NetHack 3.5 sokoban.des $Date$ $Revision$ +# NetHack 3.5 sokoban.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 sokoban.des $Date: 2009/05/06 10:44:24 $ $Revision: 1.5 $ # SCCS Id: @(#)sokoban.des 3.5 1999/03/15 # Copyright (c) 1998-1999 by Kevin Hugo # NetHack may be freely redistributed. See license for details. diff --git a/dat/tower.des b/dat/tower.des index 6b3894ddb..eb017247d 100644 --- a/dat/tower.des +++ b/dat/tower.des @@ -1,4 +1,5 @@ -# NetHack 3.5 tower.des $Date$ $Revision$ +# NetHack 3.5 tower.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 tower.des $Date: 2009/05/06 10:44:25 $ $Revision: 1.4 $ # SCCS Id: @(#)tower.des 3.5 1990/02/26 # Copyright (c) 1989 by Jean-Christophe Collet # NetHack may be freely redistributed. See license for details. diff --git a/dat/yendor.des b/dat/yendor.des index f29f99513..6bef30231 100644 --- a/dat/yendor.des +++ b/dat/yendor.des @@ -1,4 +1,5 @@ -# NetHack 3.5 yendor.des $Date$ $Revision$ +# NetHack 3.5 yendor.des $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 yendor.des $Date: 2009/05/06 10:44:25 $ $Revision: 1.5 $ # SCCS Id: @(#)yendor.des 3.5 1996/10/20 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1992 by M. Stephenson and Izchak Miller diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 432c00999..cf8196b3a 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1,4 +1,5 @@ -.\" $Revision$ $Date$ +.\" $NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ +.\" $Revision: 1.130 $ $Date: 2012/05/02 00:38:30 $ .ds h0 "NetHack Guidebook .ds h1 .ds h2 % diff --git a/doc/dgn_comp.6 b/doc/dgn_comp.6 index 3db65ac06..7f30da6b4 100644 --- a/doc/dgn_comp.6 +++ b/doc/dgn_comp.6 @@ -1,5 +1,6 @@ .TH DGN_COMP 6 "12 Dec 1995" -.\" NetHack 3.5 dgn_comp.6 $Date$ $Revision$ +.\" NetHack 3.5 dgn_comp.6 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +.\" NetHack 3.5 dgn_comp.6 $Date: 2009/05/06 10:44:28 $ $Revision: 1.2 $ .UC 4 .SH NAME dgn_comp \- NetHack dungeon compiler diff --git a/doc/dlb.6 b/doc/dlb.6 index e3b762f89..6a41e5458 100644 --- a/doc/dlb.6 +++ b/doc/dlb.6 @@ -1,5 +1,6 @@ .TH DLB 6 "28 Oct 1993" -.\" NetHack 3.5 dlb.6 $Date$ $Revision$ +.\" NetHack 3.5 dlb.6 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +.\" NetHack 3.5 dlb.6 $Date: 2009/05/06 10:44:28 $ $Revision: 1.3 $ .UC 4 .SH NAME dlb \- NetHack data librarian diff --git a/doc/fixes30.0 b/doc/fixes30.0 index 5a2088ae8..26b289b44 100644 --- a/doc/fixes30.0 +++ b/doc/fixes30.0 @@ -1,4 +1,5 @@ -$RCSfile$ $Revision$ $Date$ +$NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ +$RCSfile: fixes30.0,v $ $Revision: 1.2 $ $Date: 2003/05/11 15:09:24 $ [This is a partial list supplied by Ken Arromdee long after the fact] diff --git a/doc/fixes34.1 b/doc/fixes34.1 index d69aeae53..f44271c48 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -1,4 +1,5 @@ -$RCSfile$ $Revision$ $Date$ +$NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ +$RCSfile: fixes34.1,v $ $Revision: 1.331 $ $Date: 2003/02/20 00:19:46 $ General Fixes and Modified Features ----------------------------------- diff --git a/doc/fixes34.2 b/doc/fixes34.2 index 1b9b3ecbb..59214ac25 100644 --- a/doc/fixes34.2 +++ b/doc/fixes34.2 @@ -1,4 +1,5 @@ -$RCSfile$ $Revision$ $Date$ +$NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ +$RCSfile: fixes34.2,v $ $Revision: 1.132 $ $Date: 2003/08/26 15:11:58 $ General Fixes and Modified Features ----------------------------------- diff --git a/doc/fixes34.3 b/doc/fixes34.3 index 9f3487e93..591b2eb75 100644 --- a/doc/fixes34.3 +++ b/doc/fixes34.3 @@ -1,4 +1,5 @@ -$RCSfile$ $Revision$ $Date$ +$NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ +$RCSfile: fixes34.3,v $ $Revision: 1.103 $ $Date: 2003/12/06 14:08:46 $ General Fixes and Modified Features ----------------------------------- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 5aaa60013..6721eb0bb 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1,4 +1,5 @@ -$rcsfile: fixes35.0,v $ $Revision$ $Date$ +$NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ +$rcsfile: fixes35.0,v $ $Revision: 1.445 $ $Date: 2014/11/18 03:10:36 $ General Fixes and Modified Features ----------------------------------- diff --git a/doc/lev_comp.6 b/doc/lev_comp.6 index e5db11c84..2420fa22e 100644 --- a/doc/lev_comp.6 +++ b/doc/lev_comp.6 @@ -1,5 +1,6 @@ .TH LEV_COMP 6 "16 May 1996" -.\" NetHack 3.5 lev_comp.6 $Date$ $Revision$ +.\" NetHack 3.5 lev_comp.6 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +.\" NetHack 3.5 lev_comp.6 $Date: 2009/05/06 10:44:28 $ $Revision: 1.2 $ .UC 4 .SH NAME lev_comp \- NetHack special levels compiler diff --git a/doc/makedefs.6 b/doc/makedefs.6 index 3c42ca26b..9a81780ec 100644 --- a/doc/makedefs.6 +++ b/doc/makedefs.6 @@ -1,5 +1,6 @@ .TH MAKEDEFS 6 "29 Apr 2010" -.\" NetHack 3.5 makedefs.6 $Date$ $Revision$ +.\" NetHack 3.5 makedefs.6 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +.\" NetHack 3.5 makedefs.6 $Date: 2010/05/01 20:57:12 $ $Revision: 1.1 $ .UC 4 .SH NAME makedefs \- NetHack miscellaneous build-time functions diff --git a/doc/nethack.6 b/doc/nethack.6 index a3a1f862c..548e885d0 100644 --- a/doc/nethack.6 +++ b/doc/nethack.6 @@ -1,5 +1,6 @@ .TH NETHACK 6 "6 March 2004" -.\" NetHack 3.5 nethack.6 $Date$ $Revision$ +.\" NetHack 3.5 nethack.6 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +.\" NetHack 3.5 nethack.6 $Date: 2009/05/06 10:44:28 $ $Revision: 1.7 $ .SH NAME nethack \- Exploring The Mazes of Menace .SH SYNOPSIS diff --git a/doc/recover.6 b/doc/recover.6 index d54299c36..b5a2708cc 100644 --- a/doc/recover.6 +++ b/doc/recover.6 @@ -1,5 +1,6 @@ .TH RECOVER 6 "9 January 1993" -.\" NetHack 3.5 recover.6 $Date$ $Revision$ +.\" NetHack 3.5 recover.6 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +.\" NetHack 3.5 recover.6 $Date: 2009/05/06 10:44:29 $ $Revision: 1.3 $ .UC 4 .SH NAME recover \- recover a NetHack game interrupted by disaster diff --git a/doc/window.doc b/doc/window.doc index 5e4842f08..411d73de9 100644 --- a/doc/window.doc +++ b/doc/window.doc @@ -1,4 +1,5 @@ -NetHack 3.5 window.doc $Date$ $Revision$ +NetHack 3.5 window.doc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +NetHack 3.5 window.doc $Date: 2012/01/23 10:41:55 $ $Revision: 1.36 $ Introduction diff --git a/include/align.h b/include/align.h index 7495fe718..7af1eb433 100644 --- a/include/align.h +++ b/include/align.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 align.h $Date$ $Revision$ */ +/* NetHack 3.5 align.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 align.h $Date: 2009/05/06 10:44:33 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)align.h 3.5 1991/12/29 */ /* Copyright (c) Mike Stephenson, Izchak Miller 1991. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/amiconf.h b/include/amiconf.h index b6503add9..9c326653c 100644 --- a/include/amiconf.h +++ b/include/amiconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 amiconf.h $Date$ $Revision$ */ +/* NetHack 3.5 amiconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amiconf.h $Date: 2012/01/10 17:47:16 $ $Revision: 1.8 $ */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1990, 1991, 1992, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/artifact.h b/include/artifact.h index 0fbdc9a42..1cee87887 100644 --- a/include/artifact.h +++ b/include/artifact.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 artifact.h $Date$ $Revision$ */ +/* NetHack 3.5 artifact.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 artifact.h $Date: 2011/04/07 18:10:44 $ $Revision: 1.6 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/artilist.h b/include/artilist.h index 0996b1fe0..2f21d6839 100644 --- a/include/artilist.h +++ b/include/artilist.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 artilist.h $Date$ $Revision$ */ +/* NetHack 3.5 artilist.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 artilist.h $Date: 2011/04/07 18:10:44 $ $Revision: 1.8 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/attrib.h b/include/attrib.h index 7eae006ff..1c93e9cff 100644 --- a/include/attrib.h +++ b/include/attrib.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 attrib.h $Date$ $Revision$ */ +/* NetHack 3.5 attrib.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 attrib.h $Date: 2009/05/06 10:44:34 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)attrib.h 3.5 1990/22/02 */ /* Copyright 1988, Mike Stephenson */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/beconf.h b/include/beconf.h index e1b930e5b..ee3605564 100644 --- a/include/beconf.h +++ b/include/beconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 beconf.h $Date$ $Revision$ */ +/* NetHack 3.5 beconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 beconf.h $Date: 2009/05/06 10:44:34 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)beconf.h 3.5 1998/07/08 */ /* Copyright (c) Dean Luick 1996. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/botl.h b/include/botl.h index 4f0a93616..7a9d8aaa6 100644 --- a/include/botl.h +++ b/include/botl.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 botl.h $Date$ $Revision$ */ +/* NetHack 3.5 botl.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 botl.h $Date: 2012/01/10 17:47:16 $ $Revision: 1.6 $ */ /* Copyright (c) Michael Allison, 2003 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/color.h b/include/color.h index 2a983341f..ab6fe0462 100644 --- a/include/color.h +++ b/include/color.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 color.h $Date$ $Revision$ */ +/* NetHack 3.5 color.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 color.h $Date: 2009/05/06 10:44:34 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)color.h 3.5 1992/02/02 */ /* Copyright (c) Steve Linhart, Eric Raymond, 1989. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/config.h b/include/config.h index 13adba0d4..6db03c2c0 100644 --- a/include/config.h +++ b/include/config.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 config.h $Date$ $Revision$ */ +/* NetHack 3.5 config.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 config.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.37 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/config1.h b/include/config1.h index f0a75ae9f..dee60ce95 100644 --- a/include/config1.h +++ b/include/config1.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 config1.h $Date$ $Revision$ */ +/* NetHack 3.5 config1.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 config1.h $Date: 2011/05/23 03:27:07 $ $Revision: 1.13 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/context.h b/include/context.h index 7e2e7007f..ebfe1ada7 100644 --- a/include/context.h +++ b/include/context.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 context.h $Date$ $Revision$ */ +/* NetHack 3.5 context.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 context.h $Date: 2012/01/10 17:47:16 $ $Revision: 1.15 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/coord.h b/include/coord.h index 3b2e2179d..973ec1d89 100644 --- a/include/coord.h +++ b/include/coord.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 coord.h $Date$ $Revision$ */ +/* NetHack 3.5 coord.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 coord.h $Date: 2012/01/10 17:47:16 $ $Revision: 1.5 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/decl.h b/include/decl.h index e371c977f..3e7e94ac3 100644 --- a/include/decl.h +++ b/include/decl.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 decl.h $Date$ $Revision$ */ +/* NetHack 3.5 decl.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 decl.h $Date: 2011/12/29 20:06:27 $ $Revision: 1.44 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/def_os2.h b/include/def_os2.h index c66425337..2a5b6fa6c 100644 --- a/include/def_os2.h +++ b/include/def_os2.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 def_os2.h $Date$ $Revision$ */ +/* NetHack 3.5 def_os2.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 def_os2.h $Date: 2009/05/06 10:44:37 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)def_os2.h 3.5 1993/01/19 */ /* Copyright (c) Timo Hakulinen, 1990, 1991, 1992, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/dgn_file.h b/include/dgn_file.h index 9ea79526c..b10972394 100644 --- a/include/dgn_file.h +++ b/include/dgn_file.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 dgn_file.h $Date$ $Revision$ */ +/* NetHack 3.5 dgn_file.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dgn_file.h $Date: 2009/05/06 10:44:38 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)dgn_file.h 3.5 1993/01/17 */ /* Copyright (c) 1989 by M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/display.h b/include/display.h index a18a878cc..59135b014 100644 --- a/include/display.h +++ b/include/display.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 display.h $Date$ $Revision$ */ +/* NetHack 3.5 display.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 display.h $Date: 2009/05/06 10:44:38 $ $Revision: 1.14 $ */ /* SCCS Id: @(#)display.h 3.5 2005/06/21 */ /* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */ /* and Dave Cohrs, 1990. */ diff --git a/include/dlb.h b/include/dlb.h index 3c16c97c8..5ab7b10e2 100644 --- a/include/dlb.h +++ b/include/dlb.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 dlb.h $Date$ $Revision$ */ +/* NetHack 3.5 dlb.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dlb.h $Date: 2009/05/06 10:44:38 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)dlb.h 3.5 1997/07/29 */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/dungeon.h b/include/dungeon.h index 707ac6cf7..2aac7f39e 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 dungeon.h $Date$ $Revision$ */ +/* NetHack 3.5 dungeon.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dungeon.h $Date: 2012/04/14 08:31:03 $ $Revision: 1.11 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/engrave.h b/include/engrave.h index 336065b7f..429a5881a 100644 --- a/include/engrave.h +++ b/include/engrave.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 engrave.h $Date$ $Revision$ */ +/* NetHack 3.5 engrave.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 engrave.h $Date: 2009/05/06 10:44:39 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)engrave.h 3.5 1991/07/31 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/extern.h b/include/extern.h index 13600247d..ac5fdb1ec 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 extern.h $Date$ $Revision$ */ +/* NetHack 3.5 extern.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/flag.h b/include/flag.h index 07febf306..f6cc67aa2 100644 --- a/include/flag.h +++ b/include/flag.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 flag.h $Date$ $Revision$ */ +/* NetHack 3.5 flag.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 flag.h $Date: 2012/04/09 02:56:32 $ $Revision: 1.59 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/func_tab.h b/include/func_tab.h index 56e463526..607a0ba99 100644 --- a/include/func_tab.h +++ b/include/func_tab.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 func_tab.h $Date$ $Revision$ */ +/* NetHack 3.5 func_tab.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 func_tab.h $Date: 2009/05/06 10:44:44 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)func_tab.h 3.5 1992/04/03 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/global.h b/include/global.h index 3eb12b86c..7e8acda38 100644 --- a/include/global.h +++ b/include/global.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 global.h $Date$ $Revision$ */ +/* NetHack 3.5 global.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 global.h $Date: 2012/01/29 03:00:14 $ $Revision: 1.31 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/hack.h b/include/hack.h index 2ade6d60d..dc24bf8f9 100644 --- a/include/hack.h +++ b/include/hack.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 hack.h $Date$ $Revision$ */ +/* NetHack 3.5 hack.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 hack.h $Date: 2009/05/06 10:44:46 $ $Revision: 1.49 $ */ /* SCCS Id: @(#)hack.h 3.5 2008/03/19 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/lev.h b/include/lev.h index b0d69de34..e3e05ec9a 100644 --- a/include/lev.h +++ b/include/lev.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 lev.h $Date$ $Revision$ */ +/* NetHack 3.5 lev.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev.h $Date: 2009/05/06 10:44:48 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)lev.h 3.5 2006/07/08 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mac-carbon.h b/include/mac-carbon.h index 99750c9dd..576068a25 100644 --- a/include/mac-carbon.h +++ b/include/mac-carbon.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mac-carbon.h $Date$ $Revision$ */ +/* NetHack 3.5 mac-carbon.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mac-carbon.h $Date: 2009/05/06 10:44:49 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mac-carbon.h 3.5 2003/06/01 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 2003. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mac-qt.h b/include/mac-qt.h index 457dd86b6..eb7f9554e 100644 --- a/include/mac-qt.h +++ b/include/mac-qt.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mac-qt.h $Date$ $Revision$ */ +/* NetHack 3.5 mac-qt.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mac-qt.h $Date: 2009/05/06 10:44:50 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mac-qt.h 3.5 2003/06/01 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 2003. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mac-term.h b/include/mac-term.h index efef9dfec..7bb1257e0 100644 --- a/include/mac-term.h +++ b/include/mac-term.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mac-term.h $Date$ $Revision$ */ +/* NetHack 3.5 mac-term.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mac-term.h $Date: 2009/05/06 10:44:50 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mac-term.h 3.5 2003/06/01 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 2003. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/macconf.h b/include/macconf.h index 817baca1e..c3ad1290c 100644 --- a/include/macconf.h +++ b/include/macconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 macconf.h $Date$ $Revision$ */ +/* NetHack 3.5 macconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macconf.h $Date: 2009/05/06 10:44:51 $ $Revision: 1.8 $ */ /* SCCS Id: @(#)macconf.h 3.5 1999/10/25 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/macpopup.h b/include/macpopup.h index b8a736657..b10f554b0 100644 --- a/include/macpopup.h +++ b/include/macpopup.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 macpopup.h $Date$ $Revision$ */ +/* NetHack 3.5 macpopup.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macpopup.h $Date: 2009/05/06 10:44:51 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)macpopup.h 3.5 1999/10/25 */ /* Copyright (c) Nethack Develpment Team, 1999. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mactty.h b/include/mactty.h index 9c7f1336d..fc90e44f2 100644 --- a/include/mactty.h +++ b/include/mactty.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mactty.h $Date$ $Revision$ */ +/* NetHack 3.5 mactty.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mactty.h $Date: 2009/05/06 10:44:51 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)mactty.h 3.5 1993/03/01 */ /* Copyright (c) Jon W{tte 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/macwin.h b/include/macwin.h index 0c4146c86..9f89eee54 100644 --- a/include/macwin.h +++ b/include/macwin.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 macwin.h $Date$ $Revision$ */ +/* NetHack 3.5 macwin.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macwin.h $Date: 2009/05/06 10:44:52 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)macwin.h 3.5 1996/01/15 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mail.h b/include/mail.h index d663c13b9..8a971477d 100644 --- a/include/mail.h +++ b/include/mail.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mail.h $Date$ $Revision$ */ +/* NetHack 3.5 mail.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mail.h $Date: 2009/05/06 10:44:52 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mail.h 3.5 1991/10/11 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mextra.h b/include/mextra.h index 3caa6ff61..9f857270c 100644 --- a/include/mextra.h +++ b/include/mextra.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mextra.h $Date$ $Revision$ */ +/* NetHack 3.5 mextra.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mextra.h $Date: 2011/04/15 01:55:40 $ $Revision: 1.12 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mfndpos.h b/include/mfndpos.h index 5be92231d..ffbb50d74 100644 --- a/include/mfndpos.h +++ b/include/mfndpos.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mfndpos.h $Date$ $Revision$ */ +/* NetHack 3.5 mfndpos.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mfndpos.h $Date: 2009/05/06 10:44:53 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)mfndpos.h 3.5 2002/04/06 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/micro.h b/include/micro.h index 044bd8e31..2af114cb7 100644 --- a/include/micro.h +++ b/include/micro.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 micro.h $Date$ $Revision$ */ +/* NetHack 3.5 micro.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 micro.h $Date: 2009/05/06 10:44:53 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)micro.h 3.5 1990/02/22 */ /* micro.h - function declarations for various microcomputers */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mkroom.h b/include/mkroom.h index 993f7028f..e9952ddfa 100644 --- a/include/mkroom.h +++ b/include/mkroom.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mkroom.h $Date$ $Revision$ */ +/* NetHack 3.5 mkroom.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mkroom.h $Date: 2012/02/15 01:55:31 $ $Revision: 1.8 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/monattk.h b/include/monattk.h index 609d4e23d..7c228c87d 100644 --- a/include/monattk.h +++ b/include/monattk.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 monattk.h $Date$ $Revision$ */ +/* NetHack 3.5 monattk.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 monattk.h $Date: 2009/05/06 10:44:54 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)monattk.h 3.5 2002/03/24 */ /* NetHack may be freely redistributed. See license for details. */ /* Copyright 1988, M. Stephenson */ diff --git a/include/mondata.h b/include/mondata.h index 423ac655e..3996e439e 100644 --- a/include/mondata.h +++ b/include/mondata.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mondata.h $Date$ $Revision$ */ +/* NetHack 3.5 mondata.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mondata.h $Date: 2009/05/06 10:44:54 $ $Revision: 1.18 $ */ /* SCCS Id: @(#)mondata.h 3.5 2007/04/27 */ /* Copyright (c) 1989 Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/monflag.h b/include/monflag.h index c080e2f5c..103060a41 100644 --- a/include/monflag.h +++ b/include/monflag.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 monflag.h $Date$ $Revision$ */ +/* NetHack 3.5 monflag.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 monflag.h $Date: 2009/05/06 10:44:54 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)monflag.h 3.5 1996/05/04 */ /* Copyright (c) 1989 Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/monst.h b/include/monst.h index 708643dba..c451d374f 100644 --- a/include/monst.h +++ b/include/monst.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 monst.h $Date$ $Revision$ */ +/* NetHack 3.5 monst.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 monst.h $Date: 2009/05/06 10:44:55 $ $Revision: 1.14 $ */ /* SCCS Id: @(#)monst.h 3.5 2006/09/06 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/monsym.h b/include/monsym.h index 792568701..8081d5959 100644 --- a/include/monsym.h +++ b/include/monsym.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 monsym.h $Date$ $Revision$ */ +/* NetHack 3.5 monsym.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 monsym.h $Date: 2009/05/06 10:44:55 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)monsym.h 3.5 2007/04/07 */ /* Monster symbols and creation information rev 1.0 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/mttypriv.h b/include/mttypriv.h index 32ed11be7..6e50eccf3 100644 --- a/include/mttypriv.h +++ b/include/mttypriv.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mttypriv.h $Date$ $Revision$ */ +/* NetHack 3.5 mttypriv.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mttypriv.h $Date: 2009/05/06 10:44:55 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mttypriv.h 3.5 1993/03/01 */ /* Copyright (c) Jon W{tte 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/ntconf.h b/include/ntconf.h index c4813d2d1..539833aed 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 ntconf.h $Date$ $Revision$ */ +/* NetHack 3.5 ntconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 ntconf.h $Date: 2012/01/15 19:11:38 $ $Revision: 1.35 $ */ /* SCCS Id: @(#)ntconf.h 3.5 2002/03/10 */ /* Copyright (c) NetHack PC Development Team 1993, 1994. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/obj.h b/include/obj.h index 94e2a82d5..8d302c0ae 100644 --- a/include/obj.h +++ b/include/obj.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 obj.h $Date$ $Revision$ */ +/* NetHack 3.5 obj.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 obj.h $Date: 2012/01/10 17:47:16 $ $Revision: 1.31 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/objclass.h b/include/objclass.h index b6aada93b..46009e4d0 100644 --- a/include/objclass.h +++ b/include/objclass.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 objclass.h $Date$ $Revision$ */ +/* NetHack 3.5 objclass.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 objclass.h $Date: 2009/05/06 10:44:58 $ $Revision: 1.9 $ */ /* SCCS Id: @(#)objclass.h 3.5 1996/06/16 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/os2conf.h b/include/os2conf.h index 0bb959262..eeb4e53aa 100644 --- a/include/os2conf.h +++ b/include/os2conf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 os2conf.h $Date$ $Revision$ */ +/* NetHack 3.5 os2conf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 os2conf.h $Date: 2009/05/06 10:44:58 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)os2conf.h 3.5 2007/01/08 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Timo Hakulinen, 1990, 1991, 1992, 1993, 1996. */ diff --git a/include/patchlevel.h b/include/patchlevel.h index bb398bd4f..2399ca5b0 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 patchlevel.h $Date$ $Revision$ */ +/* NetHack 3.5 patchlevel.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 patchlevel.h $Date: 2012/04/14 08:31:03 $ $Revision: 1.93 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/pcconf.h b/include/pcconf.h index cb8846bda..70a519c00 100644 --- a/include/pcconf.h +++ b/include/pcconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 pcconf.h $Date$ $Revision$ */ +/* NetHack 3.5 pcconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pcconf.h $Date: 2009/05/06 10:45:00 $ $Revision: 1.11 $ */ /* SCCS Id: @(#)pcconf.h 3.5 1995/10/11 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/permonst.h b/include/permonst.h index 12e9f254c..7f48955fb 100644 --- a/include/permonst.h +++ b/include/permonst.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 permonst.h $Date$ $Revision$ */ +/* NetHack 3.5 permonst.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 permonst.h $Date: 2009/05/06 10:45:00 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)permonst.h 3.5 2006/01/04 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/prop.h b/include/prop.h index d0a8a8772..810a730bc 100644 --- a/include/prop.h +++ b/include/prop.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 prop.h $Date$ $Revision$ */ +/* NetHack 3.5 prop.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 prop.h $Date: 2011/10/01 00:25:52 $ $Revision: 1.7 $ */ /* Copyright (c) 1989 Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/qt_clust.h b/include/qt_clust.h index f186c78cc..466e6da8b 100644 --- a/include/qt_clust.h +++ b/include/qt_clust.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 qt_clust.h $Date$ $Revision$ */ +/* NetHack 3.5 qt_clust.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 qt_clust.h $Date: 2009/05/06 10:45:01 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)qt_clust.h 3.5 1999/11/19 */ /* Copyright (c) Warwick Allison, 1999. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/qt_kde0.h b/include/qt_kde0.h index 335c8a8be..6bd8b4452 100644 --- a/include/qt_kde0.h +++ b/include/qt_kde0.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 qt_kde0.h $Date$ $Revision$ */ +/* NetHack 3.5 qt_kde0.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 qt_kde0.h $Date: 2009/05/06 10:45:01 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)qt_kde0.h 3.5 1999/11/19 */ /* Copyright (c) Warwick Allison, 1999. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/qt_win.h b/include/qt_win.h index f430ff25b..98de67688 100644 --- a/include/qt_win.h +++ b/include/qt_win.h @@ -1,4 +1,5 @@ -// NetHack 3.5 qt_win.h $Date$ $Revision$ +// NetHack 3.5 qt_win.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +// NetHack 3.5 qt_win.h $Date: 2012/01/24 04:26:17 $ $Revision: 1.11 $ // Copyright (c) Warwick Allison, 1999. // NetHack may be freely redistributed. See license for details. // diff --git a/include/qtext.h b/include/qtext.h index 8e2486fe0..18eaeaa53 100644 --- a/include/qtext.h +++ b/include/qtext.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 qtext.h $Date$ $Revision$ */ +/* NetHack 3.5 qtext.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 qtext.h $Date: 2009/05/06 10:45:02 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)qtext.h 3.5 1997/02/02 */ /* Copyright (c) Mike Stephenson 1991. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/qttableview.h b/include/qttableview.h index 7aca4271c..07ecea7f6 100644 --- a/include/qttableview.h +++ b/include/qttableview.h @@ -1,5 +1,6 @@ /********************************************************************** -** $Id$ +** $NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ +** $Id: qttableview.h,v 1.2 2002/03/09 03:13:13 jwalz Exp $ ** ** Definition of QtTableView class ** diff --git a/include/quest.h b/include/quest.h index 10cc49ed7..4c2cd4087 100644 --- a/include/quest.h +++ b/include/quest.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 quest.h $Date$ $Revision$ */ +/* NetHack 3.5 quest.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 quest.h $Date: 2009/05/06 10:45:03 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)quest.h 3.5 1992/11/15 */ /* Copyright (c) Mike Stephenson 1991. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/rect.h b/include/rect.h index 4e29fd345..7fa6c2c8f 100644 --- a/include/rect.h +++ b/include/rect.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 rect.h $Date$ $Revision$ */ +/* NetHack 3.5 rect.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 rect.h $Date: 2009/05/06 10:45:03 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)rect.h 3.5 1990/02/22 */ /* Copyright (c) 1990 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/region.h b/include/region.h index a3eab5b2e..9af1176ec 100644 --- a/include/region.h +++ b/include/region.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 region.h $Date$ $Revision$ */ +/* NetHack 3.5 region.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 region.h $Date: 2009/05/06 10:45:04 $ $Revision: 1.9 $ */ /* SCCS Id: @(#)region.h 3.5 2006/06/27 */ /* Copyright (c) 1996 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/rm.h b/include/rm.h index 01a4f418f..589ba619e 100644 --- a/include/rm.h +++ b/include/rm.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 rm.h $Date$ $Revision$ */ +/* NetHack 3.5 rm.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 rm.h $Date: 2012/02/16 23:06:00 $ $Revision: 1.23 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/skills.h b/include/skills.h index c82e06290..d2221e7fb 100644 --- a/include/skills.h +++ b/include/skills.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 skills.h $Date$ $Revision$ */ +/* NetHack 3.5 skills.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 skills.h $Date: 2009/05/06 10:45:05 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)skills.h 3.5 2006/12/14 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/sp_lev.h b/include/sp_lev.h index f58ac6d87..0a1d22173 100644 --- a/include/sp_lev.h +++ b/include/sp_lev.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 sp_lev.h $Date$ $Revision$ */ +/* NetHack 3.5 sp_lev.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sp_lev.h $Date: 2009/05/06 10:45:06 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)sp_lev.h 3.5 2007/08/01 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/spell.h b/include/spell.h index 59a43bd22..6fd12aa8e 100644 --- a/include/spell.h +++ b/include/spell.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 spell.h $Date$ $Revision$ */ +/* NetHack 3.5 spell.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 spell.h $Date: 2009/05/06 10:45:09 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)spell.h 3.5 2006/02/11 */ /* Copyright 1986, M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/sys.h b/include/sys.h index 24d27daa7..227e68781 100644 --- a/include/sys.h +++ b/include/sys.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 sys.h $Date$ $Revision$ */ +/* NetHack 3.5 sys.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sys.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.9 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/system.h b/include/system.h index 5e23feda5..9b7592a67 100644 --- a/include/system.h +++ b/include/system.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 system.h $Date$ $Revision$ */ +/* NetHack 3.5 system.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 system.h $Date: 2009/05/06 10:45:10 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)system.h 3.5 2003/11/30 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/tcap.h b/include/tcap.h index c66e5ab38..35c2da314 100644 --- a/include/tcap.h +++ b/include/tcap.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 tcap.h $Date$ $Revision$ */ +/* NetHack 3.5 tcap.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tcap.h $Date: 2009/05/06 10:45:11 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)tcap.h 3.5 1992/10/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1989. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/tile2x11.h b/include/tile2x11.h index 7e8ed23f6..4aa64f48e 100644 --- a/include/tile2x11.h +++ b/include/tile2x11.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 tile2x11.h $Date$ $Revision$ */ +/* NetHack 3.5 tile2x11.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tile2x11.h $Date: 2009/05/06 10:45:11 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)tile2x11.h 3.5 1995/01/25 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/timeout.h b/include/timeout.h index 1d4171ea7..26d47c17d 100644 --- a/include/timeout.h +++ b/include/timeout.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 timeout.h $Date$ $Revision$ */ +/* NetHack 3.5 timeout.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 timeout.h $Date: 2009/05/06 10:45:12 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)timeout.h 3.5 1999/02/13 */ /* Copyright 1994, Dean Luick */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/tosconf.h b/include/tosconf.h index 3213e28c4..6571945a7 100644 --- a/include/tosconf.h +++ b/include/tosconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 tosconf.h $Date$ $Revision$ */ +/* NetHack 3.5 tosconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tosconf.h $Date: 2009/05/06 10:45:12 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)tosconf.h 3.5 1990/02/22 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/tradstdc.h b/include/tradstdc.h index 1cd0adb82..480ea7878 100644 --- a/include/tradstdc.h +++ b/include/tradstdc.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 tradstdc.h $Date$ $Revision$ */ +/* NetHack 3.5 tradstdc.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tradstdc.h $Date: 2012/01/11 18:23:26 $ $Revision: 1.15 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/trampoli.h b/include/trampoli.h index 8cc04dfea..fa040a330 100644 --- a/include/trampoli.h +++ b/include/trampoli.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 trampoli.h $Date$ $Revision$ */ +/* NetHack 3.5 trampoli.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 trampoli.h $Date: 2009/05/06 10:45:13 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)trampoli.h 3.5 1995/06/01 */ /* Copyright (c) 1989, by Norm Meluch and Stephen Spackman */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/trap.h b/include/trap.h index 2f13bb351..310e118b8 100644 --- a/include/trap.h +++ b/include/trap.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 trap.h $Date$ $Revision$ */ +/* NetHack 3.5 trap.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 trap.h $Date: 2009/05/06 10:45:14 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)trap.h 3.5 2000/08/30 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/unixconf.h b/include/unixconf.h index 6d0642ef7..0ffa2e119 100644 --- a/include/unixconf.h +++ b/include/unixconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 unixconf.h $Date$ $Revision$ */ +/* NetHack 3.5 unixconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 unixconf.h $Date: 2011/04/19 02:02:06 $ $Revision: 1.15 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/vision.h b/include/vision.h index 2e8fc9032..7b731e34a 100644 --- a/include/vision.h +++ b/include/vision.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 vision.h $Date$ $Revision$ */ +/* NetHack 3.5 vision.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vision.h $Date: 2009/05/06 10:45:15 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)vision.h 3.5 2007/05/11 */ /* Copyright (c) Dean Luick, with acknowledgements to Dave Cohrs, 1990. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/vmsconf.h b/include/vmsconf.h index 713cebdba..5aaf9e1fc 100644 --- a/include/vmsconf.h +++ b/include/vmsconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 vmsconf.h $Date$ $Revision$ */ +/* NetHack 3.5 vmsconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vmsconf.h $Date: 2011/09/01 01:46:55 $ $Revision: 1.14 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/wceconf.h b/include/wceconf.h index 1df61faf8..c5fef1547 100644 --- a/include/wceconf.h +++ b/include/wceconf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 wceconf.h $Date$ $Revision$ */ +/* NetHack 3.5 wceconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wceconf.h $Date: 2009/10/22 02:59:14 $ $Revision: 1.12 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/winGnome.h b/include/winGnome.h index 7fb166fd3..38d32040e 100644 --- a/include/winGnome.h +++ b/include/winGnome.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 winGnome.h $Date$ $Revision$ */ +/* NetHack 3.5 winGnome.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winGnome.h $Date: 2009/05/06 10:45:16 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)winGnome.h 3.4. 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* Copyright (C) 1998 by Anthony Taylor */ diff --git a/include/winX.h b/include/winX.h index 9ceea5fee..b80c6e245 100644 --- a/include/winX.h +++ b/include/winX.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 winX.h $Date$ $Revision$ */ +/* NetHack 3.5 winX.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winX.h $Date: 2012/01/24 04:26:18 $ $Revision: 1.9 $ */ /* Copyright (c) Dean Luick, 1992 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/winami.h b/include/winami.h index 73df178ba..dc9a98394 100644 --- a/include/winami.h +++ b/include/winami.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 winami.h $Date$ $Revision$ */ +/* NetHack 3.5 winami.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winami.h $Date: 2009/05/06 10:45:17 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)winami.h 3.5 1993/01/17 */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1991. */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1992, 1993. */ diff --git a/include/wingem.h b/include/wingem.h index 7eb57b6ff..d395aea66 100644 --- a/include/wingem.h +++ b/include/wingem.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 wingem.h $Date$ $Revision$ */ +/* NetHack 3.5 wingem.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wingem.h $Date: 2012/01/24 04:26:18 $ $Revision: 1.7 $ */ /* Copyright (c) Christian Bressler, 1999 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/winprocs.h b/include/winprocs.h index d7c5c5f89..72dad2315 100644 --- a/include/winprocs.h +++ b/include/winprocs.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 winprocs.h $Date$ $Revision$ */ +/* NetHack 3.5 winprocs.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winprocs.h $Date: 2012/01/23 10:45:26 $ $Revision: 1.29 $ */ /* Copyright (c) David Cohrs, 1992 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/wintty.h b/include/wintty.h index baff7c2ff..a2ed1e009 100644 --- a/include/wintty.h +++ b/include/wintty.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 wintty.h $Date$ $Revision$ */ +/* NetHack 3.5 wintty.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wintty.h $Date: 2012/01/23 10:45:26 $ $Revision: 1.12 $ */ /* Copyright (c) David Cohrs, 1991,1992 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/wintype.h b/include/wintype.h index 5d31dbfda..960a0d656 100644 --- a/include/wintype.h +++ b/include/wintype.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 wintype.h $Date$ $Revision$ */ +/* NetHack 3.5 wintype.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wintype.h $Date: 2009/05/06 10:45:19 $ $Revision: 1.10 $ */ /* SCCS Id: @(#)wintype.h 3.5 2006/07/08 */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/xwindow.h b/include/xwindow.h index 7a9b134b6..033ea9213 100644 --- a/include/xwindow.h +++ b/include/xwindow.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 xwindow.h $Date$ $Revision$ */ +/* NetHack 3.5 xwindow.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 xwindow.h $Date: 2009/05/06 10:45:19 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)xwindow.h 3.5 1992/03/07 */ /* Copyright (c) Dean Luick, 1992 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/xwindowp.h b/include/xwindowp.h index 0010038b4..0ee10fb49 100644 --- a/include/xwindowp.h +++ b/include/xwindowp.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 xwindowp.h $Date$ $Revision$ */ +/* NetHack 3.5 xwindowp.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 xwindowp.h $Date: 2009/05/06 10:45:19 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)xwindowp.h 3.5 1992/03/07 */ /* Copyright (c) Dean Luick, 1992 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/you.h b/include/you.h index 4b79f7fc5..50798acdb 100644 --- a/include/you.h +++ b/include/you.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 you.h $Date$ $Revision$ */ +/* NetHack 3.5 you.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 you.h $Date: 2012/04/14 08:31:03 $ $Revision: 1.13 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/youprop.h b/include/youprop.h index be82f0af9..04c3349a3 100644 --- a/include/youprop.h +++ b/include/youprop.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 youprop.h $Date$ $Revision$ */ +/* NetHack 3.5 youprop.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 youprop.h $Date: 2011/10/15 03:00:42 $ $Revision: 1.13 $ */ /* Copyright (c) 1989 Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/allmain.c b/src/allmain.c index 1742a302c..51afc75f6 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 allmain.c $Date$ $Revision$ */ +/* NetHack 3.5 allmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 allmain.c $Date: 2012/05/16 01:47:18 $ $Revision: 1.43 $ */ /* SCCS Id: @(#)allmain.c 3.5 2007/03/12 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/alloc.c b/src/alloc.c index 08066565b..dc866063f 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 alloc.c $Date$ $Revision$ */ +/* NetHack 3.5 alloc.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 alloc.c $Date: 2012/01/29 03:00:17 $ $Revision: 1.8 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/apply.c b/src/apply.c index 77608b38e..fb97cc8fa 100644 --- a/src/apply.c +++ b/src/apply.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 apply.c $Date$ $Revision$ */ +/* NetHack 3.5 apply.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 apply.c $Date: 2012/05/01 02:22:32 $ $Revision: 1.168 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/artifact.c b/src/artifact.c index 52ebef02d..088bc9c66 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 artifact.c $Date$ $Revision$ */ +/* NetHack 3.5 artifact.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 artifact.c $Date: 2013/11/07 01:03:16 $ $Revision: 1.77 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/attrib.c b/src/attrib.c index 02c8babcb..0c8ae76a8 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 attrib.c $Date$ $Revision$ */ +/* NetHack 3.5 attrib.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 attrib.c $Date: 2011/10/01 00:25:55 $ $Revision: 1.30 $ */ /* Copyright 1988, 1989, 1990, 1992, M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/ball.c b/src/ball.c index 84972fd4b..78aee97a0 100644 --- a/src/ball.c +++ b/src/ball.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 ball.c $Date$ $Revision$ */ +/* NetHack 3.5 ball.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 ball.c $Date: 2011/08/30 22:13:26 $ $Revision: 1.17 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/bones.c b/src/bones.c index 4b9738d3a..1d3b54eec 100644 --- a/src/bones.c +++ b/src/bones.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 bones.c $Date$ $Revision$ */ +/* NetHack 3.5 bones.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 bones.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.39 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985,1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/botl.c b/src/botl.c index 7ad7224b1..59c6078ac 100644 --- a/src/botl.c +++ b/src/botl.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 botl.c $Date$ $Revision$ */ +/* NetHack 3.5 botl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 botl.c $Date: 2012/01/10 17:47:19 $ $Revision: 1.36 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/cmd.c b/src/cmd.c index 74d5a5db7..eae24508c 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 cmd.c $Date$ $Revision$ */ +/* NetHack 3.5 cmd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 cmd.c $Date: 2013/03/16 01:44:28 $ $Revision: 1.162 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/dbridge.c b/src/dbridge.c index c900be04e..b63d2714c 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dbridge.c $Date$ $Revision$ */ +/* NetHack 3.5 dbridge.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dbridge.c $Date: 2012/02/01 00:49:16 $ $Revision: 1.21 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/decl.c b/src/decl.c index 93036da34..963e55324 100644 --- a/src/decl.c +++ b/src/decl.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 decl.c $Date$ $Revision$ */ +/* NetHack 3.5 decl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 decl.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.37 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/detect.c b/src/detect.c index 6cd342eb7..db280b819 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 detect.c $Date$ $Revision$ */ +/* NetHack 3.5 detect.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 detect.c $Date: 2012/04/16 02:05:40 $ $Revision: 1.47 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/dig.c b/src/dig.c index 5e0b40aca..382676865 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dig.c $Date$ $Revision$ */ +/* NetHack 3.5 dig.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dig.c $Date: 2012/02/16 03:01:37 $ $Revision: 1.67 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/display.c b/src/display.c index b48d06833..8da9af9fe 100644 --- a/src/display.c +++ b/src/display.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 display.c $Date$ $Revision$ */ +/* NetHack 3.5 display.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 display.c $Date: 2011/12/05 03:17:36 $ $Revision: 1.34 $ */ /* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */ /* and Dave Cohrs, 1990. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/dlb.c b/src/dlb.c index 394678ca2..32af6eedc 100644 --- a/src/dlb.c +++ b/src/dlb.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dlb.c $Date$ $Revision$ */ +/* NetHack 3.5 dlb.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dlb.c $Date: 2012/02/16 03:01:37 $ $Revision: 1.10 $ */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/do.c b/src/do.c index fa09f7d53..6ad4985da 100644 --- a/src/do.c +++ b/src/do.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 do.c $Date$ $Revision$ */ +/* NetHack 3.5 do.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 do.c $Date: 2014/11/18 03:10:39 $ $Revision: 1.101 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/do_name.c b/src/do_name.c index 9d19a1997..0c459bd50 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 do_name.c $Date$ $Revision$ */ +/* NetHack 3.5 do_name.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 do_name.c $Date: 2012/01/29 03:00:17 $ $Revision: 1.49 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/do_wear.c b/src/do_wear.c index 42f23491a..efd9a51ff 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 do_wear.c $Date$ $Revision$ */ +/* NetHack 3.5 do_wear.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 do_wear.c $Date: 2012/02/05 04:26:48 $ $Revision: 1.69 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/dog.c b/src/dog.c index 035e5cef7..0a0162e61 100644 --- a/src/dog.c +++ b/src/dog.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dog.c $Date$ $Revision$ */ +/* NetHack 3.5 dog.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dog.c $Date: 2011/04/15 01:55:42 $ $Revision: 1.37 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/dogmove.c b/src/dogmove.c index 58c5a52c7..a56ad1066 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dogmove.c $Date$ $Revision$ */ +/* NetHack 3.5 dogmove.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dogmove.c $Date: 2012/02/10 09:29:28 $ $Revision: 1.35 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/dokick.c b/src/dokick.c index 9e76828e3..424aa6fa1 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dokick.c $Date$ $Revision$ */ +/* NetHack 3.5 dokick.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dokick.c $Date: 2012/05/06 02:29:33 $ $Revision: 1.78 $ */ /* Copyright (c) Izchak Miller, Mike Stephenson, Steve Linhart, 1989. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/dothrow.c b/src/dothrow.c index 9ebd06c9a..ebd7c97e8 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dothrow.c $Date$ $Revision$ */ +/* NetHack 3.5 dothrow.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dothrow.c $Date: 2013/11/05 00:57:55 $ $Revision: 1.89 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/drawing.c b/src/drawing.c index eecd9fe07..2d104be20 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 drawing.c $Date$ $Revision$ */ +/* NetHack 3.5 drawing.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 drawing.c $Date: 2009/05/06 10:46:09 $ $Revision: 1.28 $ */ /* SCCS Id: @(#)drawing.c 3.5 2007/07/30 */ /* Copyright (c) NetHack Development Team 1992. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/dungeon.c b/src/dungeon.c index e9b66e194..d9348183c 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dungeon.c $Date$ $Revision$ */ +/* NetHack 3.5 dungeon.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dungeon.c $Date: 2012/04/14 08:31:05 $ $Revision: 1.34 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/eat.c b/src/eat.c index 8aa7f5da1..5b5d1f38e 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 eat.c $Date$ $Revision$ */ +/* NetHack 3.5 eat.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 eat.c $Date: 2012/02/01 00:49:16 $ $Revision: 1.116 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/end.c b/src/end.c index 23d6ecd50..66d164143 100644 --- a/src/end.c +++ b/src/end.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 end.c $Date$ $Revision$ */ +/* NetHack 3.5 end.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 end.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.79 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/engrave.c b/src/engrave.c index 51b6f7b89..c4bdd4496 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 engrave.c $Date$ $Revision$ */ +/* NetHack 3.5 engrave.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 engrave.c $Date: 2012/12/20 01:48:36 $ $Revision: 1.39 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/exper.c b/src/exper.c index e0b3b8992..568b19e88 100644 --- a/src/exper.c +++ b/src/exper.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 exper.c $Date$ $Revision$ */ +/* NetHack 3.5 exper.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 exper.c $Date: 2009/05/06 10:46:24 $ $Revision: 1.19 $ */ /* SCCS Id: @(#)exper.c 3.5 2005/09/19 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/explode.c b/src/explode.c index a2416dd75..54855f70a 100644 --- a/src/explode.c +++ b/src/explode.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 explode.c $Date$ $Revision$ */ +/* NetHack 3.5 explode.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 explode.c $Date: 2013/11/05 00:57:55 $ $Revision: 1.34 $ */ /* Copyright (C) 1990 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/extralev.c b/src/extralev.c index 5e2e96bf6..597b23e72 100644 --- a/src/extralev.c +++ b/src/extralev.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 extralev.c $Date$ $Revision$ */ +/* NetHack 3.5 extralev.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 extralev.c $Date: 2010/01/10 02:35:19 $ $Revision: 1.5 $ */ /* Copyright 1988, 1989 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/files.c b/src/files.c index c899f259e..4b72c754d 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 files.c $Date$ $Revision$ */ +/* NetHack 3.5 files.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/fountain.c b/src/fountain.c index bb0745002..14fb6707e 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 fountain.c $Date$ $Revision$ */ +/* NetHack 3.5 fountain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 fountain.c $Date: 2011/08/20 00:22:20 $ $Revision: 1.32 $ */ /* Copyright Scott R. Turner, srt@ucla, 10/27/86 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/hack.c b/src/hack.c index 792671075..bcb3da1ad 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 hack.c $Date$ $Revision$ */ +/* NetHack 3.5 hack.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 hack.c $Date: 2013/10/26 21:33:47 $ $Revision: 1.120 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/hacklib.c b/src/hacklib.c index d2985af6f..398b96dd4 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 hacklib.c $Date$ $Revision$ */ +/* NetHack 3.5 hacklib.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 hacklib.c $Date: 2009/05/06 10:46:32 $ $Revision: 1.23 $ */ /* SCCS Id: @(#)hacklib.c 3.5 2007/04/30 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Robert Patrick Rankin, 1991 */ diff --git a/src/invent.c b/src/invent.c index b51151a38..12847bc7f 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 invent.c $Date$ $Revision$ */ +/* NetHack 3.5 invent.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 invent.c $Date: 2013/11/05 00:57:55 $ $Revision: 1.125 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/light.c b/src/light.c index 4f39849ca..8d2b38ad4 100644 --- a/src/light.c +++ b/src/light.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 light.c $Date$ $Revision$ */ +/* NetHack 3.5 light.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 light.c $Date: 2009/05/06 10:46:38 $ $Revision: 1.15 $ */ /* SCCS Id: @(#)light.c 3.5 2009/01/20 */ /* Copyright (c) Dean Luick, 1994 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/lock.c b/src/lock.c index 87b54cca3..45be156f6 100644 --- a/src/lock.c +++ b/src/lock.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 lock.c $Date$ $Revision$ */ +/* NetHack 3.5 lock.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lock.c $Date: 2014/09/20 00:32:01 $ $Revision: 1.39 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mail.c b/src/mail.c index 7221d3864..cc01b97d3 100644 --- a/src/mail.c +++ b/src/mail.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mail.c $Date$ $Revision$ */ +/* NetHack 3.5 mail.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mail.c $Date: 2009/05/06 10:46:41 $ $Revision: 1.12 $ */ /* SCCS Id: @(#)mail.c 3.5 2008/01/30 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/makemon.c b/src/makemon.c index 98cfedb3d..11051eab5 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 makemon.c $Date$ $Revision$ */ +/* NetHack 3.5 makemon.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 makemon.c $Date: 2012/01/29 00:34:33 $ $Revision: 1.69 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mapglyph.c b/src/mapglyph.c index fe8ade7f4..b0dfa2a66 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mapglyph.c $Date$ $Revision$ */ +/* NetHack 3.5 mapglyph.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mapglyph.c $Date: 2009/05/06 10:46:45 $ $Revision: 1.24 $ */ /* SCCS Id: @(#)mapglyph.c 3.5 2006/10/01 */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mcastu.c b/src/mcastu.c index a8bc604b2..a677db12e 100644 --- a/src/mcastu.c +++ b/src/mcastu.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mcastu.c $Date$ $Revision$ */ +/* NetHack 3.5 mcastu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mcastu.c $Date: 2011/12/30 23:14:58 $ $Revision: 1.37 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mhitm.c b/src/mhitm.c index ade47bf26..969a50458 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhitm.c $Date$ $Revision$ */ +/* NetHack 3.5 mhitm.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhitm.c $Date: 2011/04/07 20:59:40 $ $Revision: 1.57 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mhitu.c b/src/mhitu.c index 1d650f23d..0a85b86a7 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhitu.c $Date$ $Revision$ */ +/* NetHack 3.5 mhitu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhitu.c $Date: 2012/02/05 04:26:48 $ $Revision: 1.104 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/minion.c b/src/minion.c index 935719588..f70b426b7 100644 --- a/src/minion.c +++ b/src/minion.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 minion.c $Date$ $Revision$ */ +/* NetHack 3.5 minion.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 minion.c $Date: 2009/05/06 10:46:52 $ $Revision: 1.26 $ */ /* SCCS Id: @(#)minion.c 3.5 2008/11/14 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mklev.c b/src/mklev.c index e75216ef6..8e3b267d1 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mklev.c $Date$ $Revision$ */ +/* NetHack 3.5 mklev.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mklev.c $Date: 2012/02/15 01:55:33 $ $Revision: 1.20 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mkmap.c b/src/mkmap.c index 408cea4a7..c014f7194 100644 --- a/src/mkmap.c +++ b/src/mkmap.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mkmap.c $Date$ $Revision$ */ +/* NetHack 3.5 mkmap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mkmap.c $Date: 2009/05/06 10:46:55 $ $Revision: 1.12 $ */ /* SCCS Id: @(#)mkmap.c 3.5 2008/02/29 */ /* Copyright (c) J. C. Collet, M. Stephenson and D. Cohrs, 1992 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mkmaze.c b/src/mkmaze.c index 2ff7c7413..ccd865db2 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mkmaze.c $Date$ $Revision$ */ +/* NetHack 3.5 mkmaze.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mkmaze.c $Date: 2009/05/06 10:46:56 $ $Revision: 1.18 $ */ /* SCCS Id: @(#)mkmaze.c 3.5 2007/06/18 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mkobj.c b/src/mkobj.c index 01a67f8f7..19e3658df 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mkobj.c $Date$ $Revision$ */ +/* NetHack 3.5 mkobj.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mkobj.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.70 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mkroom.c b/src/mkroom.c index 59b2ddf54..c8bcb2ed0 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mkroom.c $Date$ $Revision$ */ +/* NetHack 3.5 mkroom.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mkroom.c $Date: 2012/01/10 17:47:19 $ $Revision: 1.15 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mon.c b/src/mon.c index ae6394d13..e3880eafe 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mon.c $Date$ $Revision$ */ +/* NetHack 3.5 mon.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mon.c $Date: 2012/05/16 02:15:10 $ $Revision: 1.126 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mondata.c b/src/mondata.c index 029c00d9c..3016b7adf 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mondata.c $Date$ $Revision$ */ +/* NetHack 3.5 mondata.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mondata.c $Date: 2011/10/02 02:18:54 $ $Revision: 1.44 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/monmove.c b/src/monmove.c index 531d8a789..4b6ffc26f 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 monmove.c $Date$ $Revision$ */ +/* NetHack 3.5 monmove.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 monmove.c $Date: 2011/08/30 22:13:27 $ $Revision: 1.46 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/monst.c b/src/monst.c index fb2d3e8db..d774d1f2a 100644 --- a/src/monst.c +++ b/src/monst.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 monst.c $Date$ $Revision$ */ +/* NetHack 3.5 monst.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 monst.c $Date: 2011/09/02 21:44:09 $ $Revision: 1.38 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mplayer.c b/src/mplayer.c index 26cd4f62f..58546c931 100644 --- a/src/mplayer.c +++ b/src/mplayer.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mplayer.c $Date$ $Revision$ */ +/* NetHack 3.5 mplayer.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mplayer.c $Date: 2009/05/06 10:47:09 $ $Revision: 1.11 $ */ /* SCCS Id: @(#)mplayer.c 3.5 2006/12/15 */ /* Copyright (c) Izchak Miller, 1992. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mthrowu.c b/src/mthrowu.c index ea955d6a6..02339c0ad 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mthrowu.c $Date$ $Revision$ */ +/* NetHack 3.5 mthrowu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mthrowu.c $Date: 2011/12/30 23:47:06 $ $Revision: 1.43 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/muse.c b/src/muse.c index a289cf6e8..cc540ebb0 100644 --- a/src/muse.c +++ b/src/muse.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 muse.c $Date$ $Revision$ */ +/* NetHack 3.5 muse.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 muse.c $Date: 2012/04/12 23:26:47 $ $Revision: 1.49 $ */ /* Copyright (C) 1990 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/music.c b/src/music.c index c3f4bf056..4491b8909 100644 --- a/src/music.c +++ b/src/music.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 music.c $Date$ $Revision$ */ +/* NetHack 3.5 music.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 music.c $Date: 2011/12/30 23:47:06 $ $Revision: 1.27 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/o_init.c b/src/o_init.c index 3b65bf9c7..102160635 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 o_init.c $Date$ $Revision$ */ +/* NetHack 3.5 o_init.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 o_init.c $Date: 2011/10/02 21:27:24 $ $Revision: 1.11 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/objects.c b/src/objects.c index c59c2ec59..ec4483a51 100644 --- a/src/objects.c +++ b/src/objects.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 objects.c $Date$ $Revision$ */ +/* NetHack 3.5 objects.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 objects.c $Date: 2011/07/28 04:00:20 $ $Revision: 1.23 $ */ /* Copyright (c) Mike Threepoint, 1989. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/objnam.c b/src/objnam.c index ed3bab967..d29ad6091 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 objnam.c $Date$ $Revision$ */ +/* NetHack 3.5 objnam.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 objnam.c $Date: 2011/10/27 02:24:54 $ $Revision: 1.101 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/options.c b/src/options.c index e7f39283f..18966efb5 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 options.c $Date$ $Revision$ */ +/* NetHack 3.5 options.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 options.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.153 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/pager.c b/src/pager.c index 62e744fd6..b3647c7dd 100644 --- a/src/pager.c +++ b/src/pager.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pager.c $Date$ $Revision$ */ +/* NetHack 3.5 pager.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pager.c $Date: 2012/01/15 09:27:06 $ $Revision: 1.41 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/pickup.c b/src/pickup.c index e73a5576c..0fd429bc3 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pickup.c $Date$ $Revision$ */ +/* NetHack 3.5 pickup.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pickup.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.123 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/pline.c b/src/pline.c index d4cdb9c43..2c1612e49 100644 --- a/src/pline.c +++ b/src/pline.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pline.c $Date$ $Revision$ */ +/* NetHack 3.5 pline.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pline.c $Date: 2013/02/09 01:33:37 $ $Revision: 1.30 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/polyself.c b/src/polyself.c index 7bafe84dd..0e348035a 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 polyself.c $Date$ $Revision$ */ +/* NetHack 3.5 polyself.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 polyself.c $Date: 2013/03/16 01:44:28 $ $Revision: 1.88 $ */ /* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/potion.c b/src/potion.c index ede26f139..582409711 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 potion.c $Date$ $Revision$ */ +/* NetHack 3.5 potion.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 potion.c $Date: 2013/11/05 00:57:55 $ $Revision: 1.91 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/pray.c b/src/pray.c index da8825dd3..a6bd75ba4 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pray.c $Date$ $Revision$ */ +/* NetHack 3.5 pray.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pray.c $Date: 2012/05/07 01:44:38 $ $Revision: 1.62 $ */ /* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/priest.c b/src/priest.c index e5a112d2c..915813af0 100644 --- a/src/priest.c +++ b/src/priest.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 priest.c $Date$ $Revision$ */ +/* NetHack 3.5 priest.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 priest.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.27 $ */ /* Copyright (c) Izchak Miller, Steve Linhart, 1989. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/quest.c b/src/quest.c index 3dfaaf532..c5ef6c819 100644 --- a/src/quest.c +++ b/src/quest.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 quest.c $Date$ $Revision$ */ +/* NetHack 3.5 quest.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 quest.c $Date: 2009/05/06 10:47:33 $ $Revision: 1.10 $ */ /* SCCS Id: @(#)quest.c 3.5 2006/08/05 */ /* Copyright 1991, M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/questpgr.c b/src/questpgr.c index af7489b90..d06270c88 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 questpgr.c $Date$ $Revision$ */ +/* NetHack 3.5 questpgr.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 questpgr.c $Date: 2012/02/02 09:18:14 $ $Revision: 1.14 $ */ /* Copyright 1991, M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/read.c b/src/read.c index 755d09969..3564d6cec 100644 --- a/src/read.c +++ b/src/read.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 read.c $Date$ $Revision$ */ +/* NetHack 3.5 read.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 read.c $Date: 2012/04/06 08:35:00 $ $Revision: 1.78 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/rect.c b/src/rect.c index 5eb5896e8..be120c369 100644 --- a/src/rect.c +++ b/src/rect.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 rect.c $Date$ $Revision$ */ +/* NetHack 3.5 rect.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 rect.c $Date: 2009/05/06 10:47:37 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)rect.c 3.5 1990/02/22 */ /* Copyright (c) 1990 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/region.c b/src/region.c index 914b79e62..562747948 100644 --- a/src/region.c +++ b/src/region.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 region.c $Date$ $Revision$ */ +/* NetHack 3.5 region.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 region.c $Date: 2012/05/07 01:44:38 $ $Revision: 1.26 $ */ /* Copyright (c) 1996 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/restore.c b/src/restore.c index cd2bc4006..2297127c0 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 restore.c $Date$ $Revision$ */ +/* NetHack 3.5 restore.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 restore.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.71 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/rip.c b/src/rip.c index 85d0c4016..526c56388 100644 --- a/src/rip.c +++ b/src/rip.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 rip.c $Date$ $Revision$ */ +/* NetHack 3.5 rip.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 rip.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.11 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/rnd.c b/src/rnd.c index 5f50ecbd0..a2ce45685 100644 --- a/src/rnd.c +++ b/src/rnd.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 rnd.c $Date$ $Revision$ */ +/* NetHack 3.5 rnd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 rnd.c $Date: 2009/05/06 10:47:41 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)rnd.c 3.5 2004/08/27 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/role.c b/src/role.c index 570acf772..8cb7f3f7e 100644 --- a/src/role.c +++ b/src/role.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 role.c $Date$ $Revision$ */ +/* NetHack 3.5 role.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 role.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.18 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/rumors.c b/src/rumors.c index 5993a8ead..e84418e2d 100644 --- a/src/rumors.c +++ b/src/rumors.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 rumors.c $Date$ $Revision$ */ +/* NetHack 3.5 rumors.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 rumors.c $Date: 2012/05/11 22:36:33 $ $Revision: 1.17 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/save.c b/src/save.c index ce1073973..a4055c915 100644 --- a/src/save.c +++ b/src/save.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 save.c $Date$ $Revision$ */ +/* NetHack 3.5 save.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 save.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.53 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/shk.c b/src/shk.c index ef8fed952..944098c3a 100644 --- a/src/shk.c +++ b/src/shk.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 shk.c $Date$ $Revision$ */ +/* NetHack 3.5 shk.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 shk.c $Date: 2012/07/03 22:54:49 $ $Revision: 1.91 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/shknam.c b/src/shknam.c index 83eb902d3..ab2262bb4 100644 --- a/src/shknam.c +++ b/src/shknam.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 shknam.c $Date$ $Revision$ */ +/* NetHack 3.5 shknam.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 shknam.c $Date: 2011/04/15 01:55:42 $ $Revision: 1.24 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/sit.c b/src/sit.c index 5f9ac52aa..154248392 100644 --- a/src/sit.c +++ b/src/sit.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 sit.c $Date$ $Revision$ */ +/* NetHack 3.5 sit.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sit.c $Date: 2012/02/06 04:17:25 $ $Revision: 1.31 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/sounds.c b/src/sounds.c index eaac43337..b599f814e 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 sounds.c $Date$ $Revision$ */ +/* NetHack 3.5 sounds.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sounds.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.39 $ */ /* Copyright (c) 1989 Janet Walz, Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/sp_lev.c b/src/sp_lev.c index 0d89bfc31..5ecf91aa1 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 sp_lev.c $Date$ $Revision$ */ +/* NetHack 3.5 sp_lev.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sp_lev.c $Date: 2011/01/05 01:28:36 $ $Revision: 1.23 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/spell.c b/src/spell.c index 23f136077..e1f6fc55b 100644 --- a/src/spell.c +++ b/src/spell.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 spell.c $Date$ $Revision$ */ +/* NetHack 3.5 spell.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 spell.c $Date: 2011/12/29 22:01:25 $ $Revision: 1.44 $ */ /* Copyright (c) M. Stephenson 1988 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/steal.c b/src/steal.c index 21712a3f2..f762ec18f 100644 --- a/src/steal.c +++ b/src/steal.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 steal.c $Date$ $Revision$ */ +/* NetHack 3.5 steal.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 steal.c $Date: 2012/02/05 04:26:48 $ $Revision: 1.41 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/steed.c b/src/steed.c index afa110b1f..d42c2957d 100644 --- a/src/steed.c +++ b/src/steed.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 steed.c $Date$ $Revision$ */ +/* NetHack 3.5 steed.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 steed.c $Date: 2012/01/04 18:52:36 $ $Revision: 1.36 $ */ /* Copyright (c) Kevin Hugo, 1998-1999. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/sys.c b/src/sys.c index 19aecaade..4550f4ff5 100644 --- a/src/sys.c +++ b/src/sys.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 sys.c $Date$ $Revision$ */ +/* NetHack 3.5 sys.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sys.c $Date: 2012/03/10 02:22:07 $ $Revision: 1.12 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/teleport.c b/src/teleport.c index 000784094..608e38374 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 teleport.c $Date$ $Revision$ */ +/* NetHack 3.5 teleport.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 teleport.c $Date: 2012/01/04 18:52:36 $ $Revision: 1.45 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/timeout.c b/src/timeout.c index d5d177673..80d9a4da6 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 timeout.c $Date$ $Revision$ */ +/* NetHack 3.5 timeout.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 timeout.c $Date: 2012/04/16 00:57:37 $ $Revision: 1.48 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/topten.c b/src/topten.c index a2d205803..58079a6de 100644 --- a/src/topten.c +++ b/src/topten.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 topten.c $Date$ $Revision$ */ +/* NetHack 3.5 topten.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 topten.c $Date: 2012/01/24 04:26:15 $ $Revision: 1.23 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/track.c b/src/track.c index d7a7db4df..db1f38edb 100644 --- a/src/track.c +++ b/src/track.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 track.c $Date$ $Revision$ */ +/* NetHack 3.5 track.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 track.c $Date: 2009/05/06 10:48:00 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)track.c 3.5 87/08/08 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/trap.c b/src/trap.c index 232e4832e..275776926 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 trap.c $Date$ $Revision$ */ +/* NetHack 3.5 trap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 trap.c $Date: 2013/03/14 01:58:21 $ $Revision: 1.179 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/u_init.c b/src/u_init.c index 77cd0c080..4e5927397 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 u_init.c $Date$ $Revision$ */ +/* NetHack 3.5 u_init.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 u_init.c $Date: 2011/10/01 00:25:56 $ $Revision: 1.18 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/uhitm.c b/src/uhitm.c index cbd0cdbec..43fb2c0a1 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 uhitm.c $Date$ $Revision$ */ +/* NetHack 3.5 uhitm.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 uhitm.c $Date: 2012/05/01 02:22:33 $ $Revision: 1.116 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/vault.c b/src/vault.c index af37a0625..5205f6aca 100644 --- a/src/vault.c +++ b/src/vault.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vault.c $Date$ $Revision$ */ +/* NetHack 3.5 vault.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vault.c $Date: 2011/10/13 00:31:10 $ $Revision: 1.28 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/version.c b/src/version.c index 6dbc4e38a..1f58cff1f 100644 --- a/src/version.c +++ b/src/version.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 version.c $Date$ $Revision$ */ +/* NetHack 3.5 version.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 version.c $Date: 2012/01/04 18:52:36 $ $Revision: 1.26 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/vision.c b/src/vision.c index 2f1a62b0c..d835fb554 100644 --- a/src/vision.c +++ b/src/vision.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vision.c $Date$ $Revision$ */ +/* NetHack 3.5 vision.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vision.c $Date: 2009/05/06 10:48:10 $ $Revision: 1.12 $ */ /* SCCS Id: @(#)vision.c 3.5 2007/11/05 */ /* Copyright (c) Dean Luick, with acknowledgements to Dave Cohrs, 1990. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/weapon.c b/src/weapon.c index fa902d6e0..568c2d669 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 weapon.c $Date$ $Revision$ */ +/* NetHack 3.5 weapon.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 weapon.c $Date: 2011/12/18 05:16:28 $ $Revision: 1.38 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/were.c b/src/were.c index 864ee5fed..c2df2e20c 100644 --- a/src/were.c +++ b/src/were.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 were.c $Date$ $Revision$ */ +/* NetHack 3.5 were.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 were.c $Date: 2011/02/28 11:29:27 $ $Revision: 1.14 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/wield.c b/src/wield.c index a34d27c6e..7d7c2d6af 100644 --- a/src/wield.c +++ b/src/wield.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 wield.c $Date$ $Revision$ */ +/* NetHack 3.5 wield.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wield.c $Date: 2009/05/06 10:48:14 $ $Revision: 1.31 $ */ /* SCCS Id: @(#)wield.c 3.5 2009/01/20 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/windows.c b/src/windows.c index fc13631c0..070658bd1 100644 --- a/src/windows.c +++ b/src/windows.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 windows.c $Date$ $Revision$ */ +/* NetHack 3.5 windows.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 windows.c $Date: 2012/01/23 10:45:28 $ $Revision: 1.23 $ */ /* Copyright (c) D. Cohrs, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/wizard.c b/src/wizard.c index 9d7abacdc..4f184fa97 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 wizard.c $Date$ $Revision$ */ +/* NetHack 3.5 wizard.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wizard.c $Date: 2009/05/06 10:48:16 $ $Revision: 1.32 $ */ /* SCCS Id: @(#)wizard.c 3.5 2008/11/14 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/worm.c b/src/worm.c index b8be560a5..36af566fc 100644 --- a/src/worm.c +++ b/src/worm.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 worm.c $Date$ $Revision$ */ +/* NetHack 3.5 worm.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 worm.c $Date: 2009/05/06 10:48:17 $ $Revision: 1.12 $ */ /* SCCS Id: @(#)worm.c 3.5 2009/03/05 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/worn.c b/src/worn.c index f750bf410..4371d789a 100644 --- a/src/worn.c +++ b/src/worn.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 worn.c $Date$ $Revision$ */ +/* NetHack 3.5 worn.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 worn.c $Date: 2013/11/05 00:57:56 $ $Revision: 1.32 $ */ /* SCCS Id: @(#)worn.c 3.5 2009/02/28 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/write.c b/src/write.c index d5f61c67f..6b03ce205 100644 --- a/src/write.c +++ b/src/write.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 write.c $Date$ $Revision$ */ +/* NetHack 3.5 write.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 write.c $Date: 2010/12/28 19:54:41 $ $Revision: 1.9 $ */ /* NetHack may be freely redistributed. See license for details. */ #include "hack.h" diff --git a/src/zap.c b/src/zap.c index e265b898d..5c95dde0d 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 zap.c $Date$ $Revision$ */ +/* NetHack 3.5 zap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 zap.c $Date: 2013/11/05 00:57:56 $ $Revision: 1.183 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/amidos.c b/sys/amiga/amidos.c index 9444c2b95..fd6d329ad 100644 --- a/sys/amiga/amidos.c +++ b/sys/amiga/amidos.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 amidos.c $Date$ $Revision$ */ +/* NetHack 3.5 amidos.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amidos.c $Date: 2009/05/06 10:48:29 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)amidos.c 3.5 2000/01/12 /* Copyright (c) Olaf Seibert, Nijmegen, The Netherlands, 1988,1990. */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1991,1992,1993,1996. */ diff --git a/sys/amiga/amidos.p b/sys/amiga/amidos.p index 87e436221..238e7412c 100644 --- a/sys/amiga/amidos.p +++ b/sys/amiga/amidos.p @@ -1,4 +1,5 @@ -/* NetHack 3.5 amidos.p $Date$ $Revision$ */ +/* NetHack 3.5 amidos.p $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amidos.p $Date: 2009/05/06 10:48:29 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)amidos.p 3.5 1993/01/08 /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1992, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/amigst.c b/sys/amiga/amigst.c index b12230720..0a74acd9e 100644 --- a/sys/amiga/amigst.c +++ b/sys/amiga/amigst.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 amigst.c $Date$ $Revision$ */ +/* NetHack 3.5 amigst.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amigst.c $Date: 2009/05/06 10:48:29 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)amigst.c 3.5 1993/01/08 /* Copyright (c) Gregg Wonderly, Naperville, IL, 1992, 1993 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/amimenu.c b/sys/amiga/amimenu.c index 4314798e7..083ca292f 100644 --- a/sys/amiga/amimenu.c +++ b/sys/amiga/amimenu.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 amimenu.c $Date$ $Revision$ */ +/* NetHack 3.5 amimenu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amimenu.c $Date: 2009/05/06 10:48:29 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)amimenu.c 3.5 1996/02/04 */ /* Copyright (c) Olaf 'Rhialto' Seibert, 1989 */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1992, 1993, 1996 */ diff --git a/sys/amiga/amirip.c b/sys/amiga/amirip.c index a7460258d..00e98b12d 100644 --- a/sys/amiga/amirip.c +++ b/sys/amiga/amirip.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 amirip.c $Date$ $Revision$ */ +/* NetHack 3.5 amirip.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amirip.c $Date: 2012/01/24 04:26:20 $ $Revision: 1.7 $ */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1991,1992,1993,1995,1996. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/amisnd.c b/sys/amiga/amisnd.c index ed33e0331..0868332b2 100644 --- a/sys/amiga/amisnd.c +++ b/sys/amiga/amisnd.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 amisnd.c $Date$ $Revision$ */ +/* NetHack 3.5 amisnd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amisnd.c $Date: 2009/05/06 10:48:30 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)amisnd.c 3.5 2000/01/12*/ /* Copyright (c) 1992, 1993, 1995 by Gregg Wonderly */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/amistack.c b/sys/amiga/amistack.c index 16a8a4b64..c83afd1e2 100644 --- a/sys/amiga/amistack.c +++ b/sys/amiga/amistack.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 amistack.c $Date$ $Revision$ */ +/* NetHack 3.5 amistack.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amistack.c $Date: 2009/05/06 10:48:30 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)amistack.c 3.5 2000/05/03 */ /* Copyright (c) Janne Salmijärvi, Tampere, Finland, 2000 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/amitty.c b/sys/amiga/amitty.c index 74ab9a1c0..7e960aeff 100644 --- a/sys/amiga/amitty.c +++ b/sys/amiga/amitty.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 amitty.c $Date$ $Revision$ */ +/* NetHack 3.5 amitty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amitty.c $Date: 2009/05/06 10:48:30 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)amitty.c 3.5 2000/01/12 /* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1993,1996 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/amiwind.c b/sys/amiga/amiwind.c index 798afc9d6..0d45f5685 100644 --- a/sys/amiga/amiwind.c +++ b/sys/amiga/amiwind.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 amiwind.c $Date$ $Revision$ */ +/* NetHack 3.5 amiwind.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amiwind.c $Date: 2009/05/06 10:48:30 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)amiwind.c 3.5 2000/01/12 /* Copyright (c) Olaf Seibert (KosmoSoft), 1989, 1992 */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1993,1996 */ diff --git a/sys/amiga/amiwind.p b/sys/amiga/amiwind.p index dd3127284..0eab48f94 100644 --- a/sys/amiga/amiwind.p +++ b/sys/amiga/amiwind.p @@ -1,4 +1,5 @@ -/* NetHack 3.5 amiwind.p $Date$ $Revision$ */ +/* NetHack 3.5 amiwind.p $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 amiwind.p $Date: 2009/05/06 10:48:31 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)amiwind.p 3.5 1993/01/08 */ /* Copyright (c) Gregg Wonderly, Naperville, IL, 1992, 1993 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/cvtsnd.c b/sys/amiga/cvtsnd.c index 7a9f8cda6..ee82c974a 100644 --- a/sys/amiga/cvtsnd.c +++ b/sys/amiga/cvtsnd.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 cvtsnd.c $Date$ $Revision$ */ +/* NetHack 3.5 cvtsnd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 cvtsnd.c $Date: 2009/05/06 10:48:31 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)cvtsnd.c 3.5 1995/09/10 */ /* Copyright (c) 1995, Andrew Church, Olney, Maryland */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/txt2iff.c b/sys/amiga/txt2iff.c index 3ebbd225b..bd20f3583 100644 --- a/sys/amiga/txt2iff.c +++ b/sys/amiga/txt2iff.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 txt2iff.c $Date$ $Revision$ */ +/* NetHack 3.5 txt2iff.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 txt2iff.c $Date: 2009/05/06 10:48:31 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)txt2iff.c 3.5 1995/07/28 */ /* Copyright (c) 1995 by Gregg Wonderly, Naperville, Illinois */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winami.c b/sys/amiga/winami.c index 10e439e49..4762f0697 100644 --- a/sys/amiga/winami.c +++ b/sys/amiga/winami.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winami.c $Date$ $Revision$ */ +/* NetHack 3.5 winami.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winami.c $Date: 2012/01/10 17:47:21 $ $Revision: 1.13 $ */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993,1996. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winami.p b/sys/amiga/winami.p index 27f3eb8bb..c694628ab 100644 --- a/sys/amiga/winami.p +++ b/sys/amiga/winami.p @@ -1,4 +1,5 @@ -/* NetHack 3.5 winami.p $Date$ $Revision$ */ +/* NetHack 3.5 winami.p $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winami.p $Date: 2009/05/06 10:48:33 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)winami.p 3.5 1993/01/08 */ /* Copyright (c) Gregg Wonderly, Naperville, IL, 1992, 1993 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winchar.c b/sys/amiga/winchar.c index 66ca41275..9c7e573b8 100644 --- a/sys/amiga/winchar.c +++ b/sys/amiga/winchar.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winchar.c $Date$ $Revision$ */ +/* NetHack 3.5 winchar.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winchar.c $Date: 2009/05/06 10:48:33 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)winchar.c 3.5 1993/07/22 */ /* Copyright (c) Olaf Seibert (KosmoSoft), 1989, 1992 */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1993 */ diff --git a/sys/amiga/windefs.h b/sys/amiga/windefs.h index 14f46b561..67fb11564 100644 --- a/sys/amiga/windefs.h +++ b/sys/amiga/windefs.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 windefs.h $Date$ $Revision$ */ +/* NetHack 3.5 windefs.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 windefs.h $Date: 2009/05/06 10:48:34 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)windefs.h 3.5 1993/04/02 */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winext.h b/sys/amiga/winext.h index 109c11703..52ebe22d9 100644 --- a/sys/amiga/winext.h +++ b/sys/amiga/winext.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 winext.h $Date$ $Revision$ */ +/* NetHack 3.5 winext.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winext.h $Date: 2009/05/06 10:48:35 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)winext.h 3.5 2000/01/12 */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winfuncs.c b/sys/amiga/winfuncs.c index d518fea22..21f1937e4 100644 --- a/sys/amiga/winfuncs.c +++ b/sys/amiga/winfuncs.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winfuncs.c $Date$ $Revision$ */ +/* NetHack 3.5 winfuncs.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winfuncs.c $Date: 2012/01/10 17:47:21 $ $Revision: 1.8 $ */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993,1996. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winkey.c b/sys/amiga/winkey.c index 400aee7a7..b14b5ac06 100644 --- a/sys/amiga/winkey.c +++ b/sys/amiga/winkey.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winkey.c $Date$ $Revision$ */ +/* NetHack 3.5 winkey.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winkey.c $Date: 2009/05/06 10:48:37 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)winkey.c 3.5 1993/04/02 */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winmenu.c b/sys/amiga/winmenu.c index da5067f5f..6aba0c290 100644 --- a/sys/amiga/winmenu.c +++ b/sys/amiga/winmenu.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winmenu.c $Date$ $Revision$ */ +/* NetHack 3.5 winmenu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winmenu.c $Date: 2009/05/06 10:48:38 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)winmenu.c 3.5 1996/02/17 */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993,1996. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winproto.h b/sys/amiga/winproto.h index b3abb712c..06dd621c0 100644 --- a/sys/amiga/winproto.h +++ b/sys/amiga/winproto.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 winproto.h $Date$ $Revision$ */ +/* NetHack 3.5 winproto.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winproto.h $Date: 2012/01/24 04:26:20 $ $Revision: 1.4 $ */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winreq.c b/sys/amiga/winreq.c index 6e196657d..e87764434 100644 --- a/sys/amiga/winreq.c +++ b/sys/amiga/winreq.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winreq.c $Date$ $Revision$ */ +/* NetHack 3.5 winreq.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winreq.c $Date: 2009/05/06 10:48:41 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)winreq.c 3.5 1993/04/02 */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/winstr.c b/sys/amiga/winstr.c index 9182f932b..f82c39aed 100644 --- a/sys/amiga/winstr.c +++ b/sys/amiga/winstr.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winstr.c $Date$ $Revision$ */ +/* NetHack 3.5 winstr.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winstr.c $Date: 2009/05/06 10:48:42 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)winstr.c 3.5 1993/04/02 */ /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/amiga/xpm2iff.c b/sys/amiga/xpm2iff.c index a5fc976b0..aebe6dcb0 100644 --- a/sys/amiga/xpm2iff.c +++ b/sys/amiga/xpm2iff.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 xpm2iff.c $Date$ $Revision$ */ +/* NetHack 3.5 xpm2iff.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 xpm2iff.c $Date: 2009/05/06 10:48:44 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)xpm2iff.c 3.5 1995/08/04 */ /* Copyright (c) 1995 by Gregg Wonderly, Naperville, Illinois */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/atari/tos.c b/sys/atari/tos.c index 7da8b63b0..9cfc98a39 100644 --- a/sys/atari/tos.c +++ b/sys/atari/tos.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 tos.c $Date$ $Revision$ */ +/* NetHack 3.5 tos.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tos.c $Date: 2009/05/06 10:48:51 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)tos.c 3.5 1990/14/08 /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/be/bemain.c b/sys/be/bemain.c index 1feaa4954..6a3715a9a 100644 --- a/sys/be/bemain.c +++ b/sys/be/bemain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 bemain.c $Date$ $Revision$ */ +/* NetHack 3.5 bemain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 bemain.c $Date: 2009/05/06 10:48:59 $ $Revision: 1.11 $ */ /* SCCS Id: @(#)bemain.c 3.5 2008/01/30 */ /* Copyright (c) Dean Luick, 1996. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/NHDeflts b/sys/mac/NHDeflts index f87b746fd..256105813 100644 --- a/sys/mac/NHDeflts +++ b/sys/mac/NHDeflts @@ -1,4 +1,5 @@ -# NetHack 3.5 NHDeflts $Date$ $Revision$ +# NetHack 3.5 NHDeflts $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 NHDeflts $Date: 2009/05/06 10:49:09 $ $Revision: 1.4 $ # SCCS Id: @(#)NetHack Defaults 3.5 2002/03/15 # Copyright (c) 2002 by Dean Luick, Mark Modrall, and Kevin Hugo # NetHack may be freely redistributed. See license for details. diff --git a/sys/mac/dprintf.c b/sys/mac/dprintf.c index 6a51857d3..c334fd00c 100644 --- a/sys/mac/dprintf.c +++ b/sys/mac/dprintf.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dprintf.c $Date$ $Revision$ */ +/* NetHack 3.5 dprintf.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dprintf.c $Date: 2009/05/06 10:49:10 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)dprintf.c 3.5 1994/01/29 */ /* Copyright (c) Jon W{tte, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/maccurs.c b/sys/mac/maccurs.c index 108718c2e..8e9b9ed46 100644 --- a/sys/mac/maccurs.c +++ b/sys/mac/maccurs.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 maccurs.c $Date$ $Revision$ */ +/* NetHack 3.5 maccurs.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 maccurs.c $Date: 2009/05/06 10:49:10 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)maccurs.c 3.5 1993/01/24 */ /* Copyright (c) Jon W{tte, 1992. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/macerrs.c b/sys/mac/macerrs.c index 7b82733ba..d585f3b5e 100644 --- a/sys/mac/macerrs.c +++ b/sys/mac/macerrs.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 macerrs.c $Date$ $Revision$ */ +/* NetHack 3.5 macerrs.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macerrs.c $Date: 2009/05/06 10:49:10 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)macerrs.c 3.5 1993/01/24 */ /* Copyright (c) Michael Hamel, 1991 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/macfile.c b/sys/mac/macfile.c index 347baa06f..e268ba810 100644 --- a/sys/mac/macfile.c +++ b/sys/mac/macfile.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 macfile.c $Date$ $Revision$ */ +/* NetHack 3.5 macfile.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macfile.c $Date: 2009/05/06 10:49:10 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)macfile.c 3.5 1993/01/24 */ /* Copyright (c) Jon W{tte, Hao-Yang Wang, Jonathan Handler 1992. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/macmain.c b/sys/mac/macmain.c index fbd36eebe..644e8e58f 100644 --- a/sys/mac/macmain.c +++ b/sys/mac/macmain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 macmain.c $Date$ $Revision$ */ +/* NetHack 3.5 macmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macmain.c $Date: 2009/05/06 10:49:11 $ $Revision: 1.15 $ */ /* SCCS Id: @(#)macmain.c 3.5 2008/01/30 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/macmenu.c b/sys/mac/macmenu.c index 0b146aa1a..651ab2242 100644 --- a/sys/mac/macmenu.c +++ b/sys/mac/macmenu.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 macmenu.c $Date$ $Revision$ */ +/* NetHack 3.5 macmenu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macmenu.c $Date: 2009/05/06 10:49:13 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)macmenu.c 3.5 1999/11/24 */ /* Copyright (c) Macintosh NetHack Port Team, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/macsnd.c b/sys/mac/macsnd.c index 319048fda..bb3dfc65e 100644 --- a/sys/mac/macsnd.c +++ b/sys/mac/macsnd.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 macsnd.c $Date$ $Revision$ */ +/* NetHack 3.5 macsnd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macsnd.c $Date: 2009/05/06 10:49:14 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)macsnd.c 3.5 1992/11/28 */ /* Copyright (c) 1992 by Jon Watte */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/mactopl.c b/sys/mac/mactopl.c index a4a92c5f6..938f4cfd4 100644 --- a/sys/mac/mactopl.c +++ b/sys/mac/mactopl.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mactopl.c $Date$ $Revision$ */ +/* NetHack 3.5 mactopl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mactopl.c $Date: 2009/05/06 10:49:14 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mactopl.c 3.5 1991/07/23 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/mactty.c b/sys/mac/mactty.c index 8efda1b03..e6006983c 100644 --- a/sys/mac/mactty.c +++ b/sys/mac/mactty.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mactty.c $Date$ $Revision$ */ +/* NetHack 3.5 mactty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mactty.c $Date: 2009/05/06 10:49:14 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mactty.c 3.5 1993/03/01 */ /* Copyright (c) Jon W{tte 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/macunix.c b/sys/mac/macunix.c index fe5735629..18aae8b9a 100644 --- a/sys/mac/macunix.c +++ b/sys/mac/macunix.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 macunix.c $Date$ $Revision$ */ +/* NetHack 3.5 macunix.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macunix.c $Date: 2009/05/06 10:49:16 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)macunix.c 3.5 1994/11/07 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/macwin.c b/sys/mac/macwin.c index aeed4356f..3c5e92fd9 100644 --- a/sys/mac/macwin.c +++ b/sys/mac/macwin.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 macwin.c $Date$ $Revision$ */ +/* NetHack 3.5 macwin.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 macwin.c $Date: 2012/01/10 17:47:23 $ $Revision: 1.22 $ */ /* Copyright (c) Jon W{tte, Hao-Yang Wang, Jonathan Handler 1992. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/mgetline.c b/sys/mac/mgetline.c index e5d396a46..1094bcaab 100644 --- a/sys/mac/mgetline.c +++ b/sys/mac/mgetline.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mgetline.c $Date$ $Revision$ */ +/* NetHack 3.5 mgetline.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mgetline.c $Date: 2009/05/06 10:49:18 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)getline.c 3.5 1990/22/02 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/mmodal.c b/sys/mac/mmodal.c index 5faabd337..c11a79ff8 100644 --- a/sys/mac/mmodal.c +++ b/sys/mac/mmodal.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mmodal.c $Date$ $Revision$ */ +/* NetHack 3.5 mmodal.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mmodal.c $Date: 2009/05/06 10:49:18 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)mmodal.c 3.5 1993/01/24 */ /* Copyright (c) Jon W{tte, Hao-Yang Wang, Jonathan Handler 1992. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/mrecover.c b/sys/mac/mrecover.c index 03ef8b763..e8f8793a9 100644 --- a/sys/mac/mrecover.c +++ b/sys/mac/mrecover.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mrecover.c $Date$ $Revision$ */ +/* NetHack 3.5 mrecover.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mrecover.c $Date: 2009/05/06 10:49:19 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mrecover.c 3.5 1996/07/24 */ /* Copyright (c) David Hairston, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/mac/mttymain.c b/sys/mac/mttymain.c index d4b1f2d37..258d93b7c 100644 --- a/sys/mac/mttymain.c +++ b/sys/mac/mttymain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mttymain.c $Date$ $Revision$ */ +/* NetHack 3.5 mttymain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mttymain.c $Date: 2009/05/06 10:49:20 $ $Revision: 1.8 $ */ /* SCCS Id: @(#)mttymain.c 3.5 1993/02/26 */ /* Copyright (c) Jon W{tte, 1993 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/Install.dos b/sys/msdos/Install.dos index cea810ac0..018884bb7 100644 --- a/sys/msdos/Install.dos +++ b/sys/msdos/Install.dos @@ -7,7 +7,8 @@ NetHack 3.5 on a DOS system ====================================================== (or, How to make PC NetHack 3.5) - Last revision: $Date$ + Last revision: $NHDT-Date$ + Last revision: $Date: 2005/01/02 17:16:53 $ Credit for a runnable full PC NetHack 3.5 goes to the PC Development team of Paul Winner, Kevin Smolkowski, Michael Allison, Yitzhak Sapir, Bill Dyer, diff --git a/sys/msdos/Makefile.BC b/sys/msdos/Makefile.BC index 48b412ae4..f64b99305 100644 --- a/sys/msdos/Makefile.BC +++ b/sys/msdos/Makefile.BC @@ -1,4 +1,5 @@ -# NetHack 3.5 Makefile.BC $Date$ $Revision$ +# NetHack 3.5 Makefile.BC $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.BC $Date: 2012/01/10 17:47:26 $ $Revision: 1.14 $ # Copyright (c) Yitzhak Sapir, 1999-2006. # NetHack may be freely distributed. See license for details. # diff --git a/sys/msdos/Makefile.GCC b/sys/msdos/Makefile.GCC index 3f4039d8e..d2e64da95 100644 --- a/sys/msdos/Makefile.GCC +++ b/sys/msdos/Makefile.GCC @@ -1,4 +1,5 @@ -# NetHack 3.5 Makefile.GCC $Date$ $Revision$ +# NetHack 3.5 Makefile.GCC $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.GCC $Date: 2012/01/10 17:47:26 $ $Revision: 1.25 $ # Copyright (c) NetHack PC Development Team 1996-2006. # PC NetHack 3.5 Makefile for djgpp V2 # diff --git a/sys/msdos/Makefile.MSC b/sys/msdos/Makefile.MSC index c5c4926c4..47e474ee2 100644 --- a/sys/msdos/Makefile.MSC +++ b/sys/msdos/Makefile.MSC @@ -1,4 +1,5 @@ -# NetHack 3.5 Makefile.MSC $Date$ $Revision$ +# NetHack 3.5 Makefile.MSC $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.MSC $Date: 2012/01/22 06:27:07 $ $Revision: 1.18 $ # Copyright (c) NetHack PC Development Team 1997 - 2012. # PC NetHack 3.4x Makefile for MSC V1.52c (16 bit compiler) # diff --git a/sys/msdos/msdos.c b/sys/msdos/msdos.c index 3b194617c..ce713bb9d 100644 --- a/sys/msdos/msdos.c +++ b/sys/msdos/msdos.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 msdos.c $Date$ $Revision$ */ +/* NetHack 3.5 msdos.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 msdos.c $Date: 2012/01/22 06:27:07 $ $Revision: 1.7 $ */ /* Copyright (c) NetHack PC Development Team 1990 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/ovlinit.c b/sys/msdos/ovlinit.c index e3a149fbb..869b7e325 100644 --- a/sys/msdos/ovlinit.c +++ b/sys/msdos/ovlinit.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 ovlinit.c $Date$ $Revision$ */ +/* NetHack 3.5 ovlinit.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 ovlinit.c $Date: 2009/05/06 10:49:38 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)ovlinit.c 3.5 1994/03/20 */ /* Copyright (c) NetHack PC Development Team 1995 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/pckeys.c b/sys/msdos/pckeys.c index 6bd95712d..142618ee7 100644 --- a/sys/msdos/pckeys.c +++ b/sys/msdos/pckeys.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pckeys.c $Date$ $Revision$ */ +/* NetHack 3.5 pckeys.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pckeys.c $Date: 2009/05/06 10:49:39 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)pckeys.c 3.5 1996/05/11 */ /* Copyright (c) NetHack PC Development Team 1996 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/pctiles.c b/sys/msdos/pctiles.c index f79ca4a81..e60c26f7a 100644 --- a/sys/msdos/pctiles.c +++ b/sys/msdos/pctiles.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pctiles.c $Date$ $Revision$ */ +/* NetHack 3.5 pctiles.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pctiles.c $Date: 2009/05/06 10:49:39 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)pctiles.c 3.5 1995/07/31 */ /* Copyright (c) NetHack PC Development Team 1993, 1994 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/pctiles.h b/sys/msdos/pctiles.h index 9c442a8e8..1f88edd4f 100644 --- a/sys/msdos/pctiles.h +++ b/sys/msdos/pctiles.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 pctiles.h $Date$ $Revision$ */ +/* NetHack 3.5 pctiles.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pctiles.h $Date: 2009/05/06 10:49:40 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)pctiles.h 3.5 1994/04/04 */ /* Copyright (c) NetHack PC Development Team 1993, 1994 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/pcvideo.h b/sys/msdos/pcvideo.h index e08d04fdd..5c24bd7c5 100644 --- a/sys/msdos/pcvideo.h +++ b/sys/msdos/pcvideo.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 pcvideo.h $Date$ $Revision$ */ +/* NetHack 3.5 pcvideo.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pcvideo.h $Date: 2009/05/06 10:49:40 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)pcvideo.h 3.5 1994/06/07 */ /* Copyright (c) NetHack PC Development Team 1993, 1994 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/portio.h b/sys/msdos/portio.h index 280e45885..33e5a20b5 100644 --- a/sys/msdos/portio.h +++ b/sys/msdos/portio.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 portio.h $Date$ $Revision$ */ +/* NetHack 3.5 portio.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 portio.h $Date: 2009/05/06 10:49:41 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)portio.h 3.5 1995/08/05 */ /* Copyright (c) NetHack PC Development Team 1995 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/schema1.BC b/sys/msdos/schema1.BC index e7aebf1d7..db07b0783 100644 --- a/sys/msdos/schema1.BC +++ b/sys/msdos/schema1.BC @@ -1,4 +1,5 @@ -/* NetHack 3.5 schema1.BC $Date$ $Revision$ */ +/* NetHack 3.5 schema1.BC $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 schema1.BC $Date: 2009/05/06 10:49:41 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)schema1.BC 3.5 2008/01/30 */ /* Copyright (c) Yitzhak Sapir, 1999 */ /* */ diff --git a/sys/msdos/schema2.BC b/sys/msdos/schema2.BC index 8a1246369..38a7546ea 100644 --- a/sys/msdos/schema2.BC +++ b/sys/msdos/schema2.BC @@ -1,4 +1,5 @@ -/* NetHack 3.5 schema2.BC $Date$ $Revision$ */ +/* NetHack 3.5 schema2.BC $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 schema2.BC $Date: 2009/05/06 10:49:42 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)schema2.BC 3.5 2008/01/30 */ /* Copyright (c) Yitzhak Sapir, 1999 */ /* */ diff --git a/sys/msdos/setup.bat b/sys/msdos/setup.bat old mode 100755 new mode 100644 index 3f53c20cf..03fd94d12 --- a/sys/msdos/setup.bat +++ b/sys/msdos/setup.bat @@ -1,5 +1,6 @@ @echo off -REM NetHack 3.5 setup.bat $Date$ $Revision$ +REM NetHack 3.5 setup.bat $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +REM NetHack 3.5 setup.bat $Date: 2012/01/22 06:27:07 $ $Revision: 1.3 $ REM Copyright (c) NetHack PC Development Team 1990 - 2012 REM NetHack may be freely redistributed. See license for details. diff --git a/sys/msdos/sound.c b/sys/msdos/sound.c index 1f13e551e..ef8914869 100644 --- a/sys/msdos/sound.c +++ b/sys/msdos/sound.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 sound.c $Date$ $Revision$ */ +/* NetHack 3.5 sound.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sound.c $Date: 2009/05/06 10:49:43 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)sound.c 3.5 1996/02/19 */ /* Copyright (c) NetHack PC Development Team 1993,1995 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/tile2bin.c b/sys/msdos/tile2bin.c index 44323c1ee..e54b83908 100644 --- a/sys/msdos/tile2bin.c +++ b/sys/msdos/tile2bin.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 tile2bin.c $Date$ $Revision$ */ +/* NetHack 3.5 tile2bin.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tile2bin.c $Date: 2009/05/06 10:49:47 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)tile2bin.c 3.5 1995/01/26 */ /* Copyright (c) NetHack PC Development Team 1993, 1994, 1995 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/video.c b/sys/msdos/video.c index a9dd7416e..9b4bc1241 100644 --- a/sys/msdos/video.c +++ b/sys/msdos/video.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 video.c $Date$ $Revision$ */ +/* NetHack 3.5 video.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 video.c $Date: 2009/05/06 10:49:49 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)video.c 3.5 2001/04/07 */ /* Copyright (c) NetHack PC Development Team 1993, 1994, 2001 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/vidtxt.c b/sys/msdos/vidtxt.c index 49962257c..2710dc397 100644 --- a/sys/msdos/vidtxt.c +++ b/sys/msdos/vidtxt.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vidtxt.c $Date$ $Revision$ */ +/* NetHack 3.5 vidtxt.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vidtxt.c $Date: 2009/05/06 10:49:49 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)vidtxt.c 3.5 1994/04/04 */ /* Copyright (c) NetHack PC Development Team 1993 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/msdos/vidvga.c b/sys/msdos/vidvga.c index 057e6a2a2..e128821f9 100644 --- a/sys/msdos/vidvga.c +++ b/sys/msdos/vidvga.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vidvga.c $Date$ $Revision$ */ +/* NetHack 3.5 vidvga.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vidvga.c $Date: 2009/05/06 10:49:50 $ $Revision: 1.9 $ */ /* SCCS Id: @(#)vidvga.c 3.5 2006/07/08 */ /* Copyright (c) NetHack PC Development Team 1995 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/os2/Makefile.os2 b/sys/os2/Makefile.os2 index 0f60e2307..09ee9ca80 100644 --- a/sys/os2/Makefile.os2 +++ b/sys/os2/Makefile.os2 @@ -1,4 +1,5 @@ -# NetHack 3.5 Makefile.os2 $Date$ $Revision$ +# NetHack 3.5 Makefile.os2 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.os2 $Date: 2012/01/10 17:47:28 $ $Revision: 1.16 $ # OS/2 NetHack 3.5 Makefile for OS/2 versions 1.x and 2.x # Copyright (C) 1990, 1991, 1992, 1993, 1996 Timo Hakulinen # diff --git a/sys/os2/os2.c b/sys/os2/os2.c index 45d6f6924..625b7168c 100644 --- a/sys/os2/os2.c +++ b/sys/os2/os2.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 os2.c $Date$ $Revision$ */ +/* NetHack 3.5 os2.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 os2.c $Date: 2009/05/06 10:50:12 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)os2.c 3.5 1996/02/29 */ /* Copyright (c) Timo Hakulinen, 1990, 1991, 1992, 1993, 1996. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/Makefile.lib b/sys/share/Makefile.lib index a94b37c88..86d72186b 100644 --- a/sys/share/Makefile.lib +++ b/sys/share/Makefile.lib @@ -1,4 +1,5 @@ -# NetHack 3.5 Makefile.lib $Date$ $Revision$ +# NetHack 3.5 Makefile.lib $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.lib $Date: 2009/05/06 10:50:26 $ $Revision: 1.4 $ # SCCS Id: @(#)Makefile.lib 3.5 1990/22/02 # Nethack makefile for Fred fish termlib -- Norman Meluch # diff --git a/sys/share/ioctl.c b/sys/share/ioctl.c index 09c181be0..ee86074ac 100644 --- a/sys/share/ioctl.c +++ b/sys/share/ioctl.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 ioctl.c $Date$ $Revision$ */ +/* NetHack 3.5 ioctl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 ioctl.c $Date: 2011/06/16 15:10:14 $ $Revision: 1.8 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/nhlan.c b/sys/share/nhlan.c index d0e18c7e9..506a41455 100644 --- a/sys/share/nhlan.c +++ b/sys/share/nhlan.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 nhlan.c $Date$ $Revision$ */ +/* NetHack 3.5 nhlan.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 nhlan.c $Date: 2009/05/06 10:50:26 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)nhlan.c 3.5 1999/11/21 */ /* Copyright (c) Michael Allison, 1997 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 6e9fc68ac..f6c2b6b12 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pcmain.c $Date$ $Revision$ */ +/* NetHack 3.5 pcmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pcmain.c $Date: 2012/01/20 03:41:31 $ $Revision: 1.48 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/pcsys.c b/sys/share/pcsys.c index 8ebcd4319..0fc5ee8ed 100644 --- a/sys/share/pcsys.c +++ b/sys/share/pcsys.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pcsys.c $Date$ $Revision$ */ +/* NetHack 3.5 pcsys.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pcsys.c $Date: 2012/01/22 06:33:47 $ $Revision: 1.18 $ */ /* SCCS Id: @(#)pcsys.c 3.5 2002/01/22 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/pctty.c b/sys/share/pctty.c index d5364b5fe..85c364669 100644 --- a/sys/share/pctty.c +++ b/sys/share/pctty.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pctty.c $Date$ $Revision$ */ +/* NetHack 3.5 pctty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pctty.c $Date: 2009/05/06 10:50:30 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)pctty.c 3.5 1990/22/02 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/pcunix.c b/sys/share/pcunix.c index 824149733..24316aac2 100644 --- a/sys/share/pcunix.c +++ b/sys/share/pcunix.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 pcunix.c $Date$ $Revision$ */ +/* NetHack 3.5 pcunix.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pcunix.c $Date: 2009/05/06 10:50:30 $ $Revision: 1.27 $ */ /* SCCS Id: @(#)pcunix.c 3.5 1994/11/07 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/tclib.c b/sys/share/tclib.c index a22578367..b6aa91665 100644 --- a/sys/share/tclib.c +++ b/sys/share/tclib.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 tclib.c $Date$ $Revision$ */ +/* NetHack 3.5 tclib.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tclib.c $Date: 2009/05/06 10:50:31 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)tclib.c 3.5 1996/02/25 */ /* Copyright (c) Robert Patrick Rankin, 1995 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/share/unixtty.c b/sys/share/unixtty.c index f691d5a6f..68c6f104c 100644 --- a/sys/share/unixtty.c +++ b/sys/share/unixtty.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 unixtty.c $Date$ $Revision$ */ +/* NetHack 3.5 unixtty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 unixtty.c $Date: 2012/01/23 07:11:09 $ $Revision: 1.10 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/unix/Makefile.dat b/sys/unix/Makefile.dat index 609672540..ad9cb6e2d 100644 --- a/sys/unix/Makefile.dat +++ b/sys/unix/Makefile.dat @@ -1,5 +1,6 @@ # NetHack Makefile. -# NetHack 3.5 Makefile.dat $Date$ $Revision$ +# NetHack 3.5 Makefile.dat $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.dat $Date: 2012/01/10 17:47:30 $ $Revision: 1.11 $ # Root of source tree: NHSROOT=.. diff --git a/sys/unix/Makefile.doc b/sys/unix/Makefile.doc index 83f493004..606867b75 100644 --- a/sys/unix/Makefile.doc +++ b/sys/unix/Makefile.doc @@ -1,5 +1,6 @@ # NetHack Makefile. -# NetHack 3.5 Makefile.doc $Date$ $Revision$ +# NetHack 3.5 Makefile.doc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.doc $Date: 2010/05/01 23:10:22 $ $Revision: 1.11 $ # Root of source tree: NHSROOT=.. diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index 11d9f86f0..b64a838c9 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -1,5 +1,6 @@ # NetHack Makefile. -# NetHack 3.5 Makefile.src $Date$ $Revision$ +# NetHack 3.5 Makefile.src $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.src $Date: 2012/01/20 03:41:33 $ $Revision: 1.37 $ # Root of source tree: NHSROOT=.. diff --git a/sys/unix/Makefile.top b/sys/unix/Makefile.top index ca32f08c3..6d94d6908 100644 --- a/sys/unix/Makefile.top +++ b/sys/unix/Makefile.top @@ -1,5 +1,6 @@ # NetHack Makefile. -# NetHack 3.5 Makefile.top $Date$ $Revision$ +# NetHack 3.5 Makefile.top $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.top $Date: 2012/01/10 17:47:30 $ $Revision: 1.19 $ # Root of source tree: NHSROOT=. diff --git a/sys/unix/Makefile.utl b/sys/unix/Makefile.utl index def3b67f4..e1c677c2f 100644 --- a/sys/unix/Makefile.utl +++ b/sys/unix/Makefile.utl @@ -1,5 +1,6 @@ # Makefile for NetHack's utility programs. -# NetHack 3.5 Makefile.utl $Date$ $Revision$ +# NetHack 3.5 Makefile.utl $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.utl $Date: 2012/01/10 17:47:30 $ $Revision: 1.18 $ # Root of source tree: NHSROOT=.. diff --git a/sys/unix/hints/linux b/sys/unix/hints/linux index 9ff45ff00..3ae677d00 100644 --- a/sys/unix/hints/linux +++ b/sys/unix/hints/linux @@ -1,5 +1,6 @@ # -# NetHack 3.5 linux $Date$ $Revision$ +# NetHack 3.5 linux $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 linux $Date: 2010/01/15 19:54:37 $ $Revision: 1.8 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # diff --git a/sys/unix/hints/linux-x11 b/sys/unix/hints/linux-x11 index 48d46f940..e0d98badd 100644 --- a/sys/unix/hints/linux-x11 +++ b/sys/unix/hints/linux-x11 @@ -1,5 +1,6 @@ # -# NetHack 3.5 linux-x11 $Date$ $Revision$ +# NetHack 3.5 linux-x11 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 linux-x11 $Date: 2009/12/23 20:02:29 $ $Revision: 1.5 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # diff --git a/sys/unix/hints/macosx b/sys/unix/hints/macosx index 0ef9c342c..8d1f9d327 100644 --- a/sys/unix/hints/macosx +++ b/sys/unix/hints/macosx @@ -1,5 +1,6 @@ # -# NetHack 3.5 macosx $Date$ $Revision$ +# NetHack 3.5 macosx $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 macosx $Date: 2009/12/23 20:02:29 $ $Revision: 1.9 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # diff --git a/sys/unix/hints/macosx.sh b/sys/unix/hints/macosx.sh old mode 100755 new mode 100644 index 3296963b2..a4091204a --- a/sys/unix/hints/macosx.sh +++ b/sys/unix/hints/macosx.sh @@ -1,5 +1,6 @@ #!/bin/sh -# NetHack 3.5 macosx.sh $Date$ $Revision$ +# NetHack 3.5 macosx.sh $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 macosx.sh $Date: 2011/10/17 01:29:17 $ $Revision: 1.5 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # diff --git a/sys/unix/hints/macosx10.5 b/sys/unix/hints/macosx10.5 index c426629db..7ab5c760d 100644 --- a/sys/unix/hints/macosx10.5 +++ b/sys/unix/hints/macosx10.5 @@ -1,5 +1,6 @@ # -# NetHack 3.5 macosx10.5 $Date$ $Revision$ +# NetHack 3.5 macosx10.5 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 macosx10.5 $Date: 2011/10/17 01:29:17 $ $Revision: 1.11 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009. # NetHack may be freely redistributed. See license for details. # diff --git a/sys/unix/hints/macosx10.7 b/sys/unix/hints/macosx10.7 index 76f7b6862..fa3cc1e9c 100644 --- a/sys/unix/hints/macosx10.7 +++ b/sys/unix/hints/macosx10.7 @@ -1,5 +1,6 @@ # -# NetHack 3.5 macosx10.7 $Date$ $Revision$ +# NetHack 3.5 macosx10.7 $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 macosx10.7 $Date: 2012/01/18 22:32:24 $ $Revision: 1.4 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009. # NetHack may be freely redistributed. See license for details. # diff --git a/sys/unix/hints/unix b/sys/unix/hints/unix index d6f230e44..bea73b58b 100644 --- a/sys/unix/hints/unix +++ b/sys/unix/hints/unix @@ -1,5 +1,6 @@ # -# NetHack 3.5 unix $Date$ $Revision$ +# NetHack 3.5 unix $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 unix $Date: 2009/12/23 20:02:29 $ $Revision: 1.5 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # diff --git a/sys/unix/mkmkfile.sh b/sys/unix/mkmkfile.sh old mode 100755 new mode 100644 index 9055cd465..179e0bc90 --- a/sys/unix/mkmkfile.sh +++ b/sys/unix/mkmkfile.sh @@ -1,5 +1,6 @@ #!/bin/sh -# NetHack 3.5 mkmkfile.sh $Date$ $Revision$ +# NetHack 3.5 mkmkfile.sh $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 mkmkfile.sh $Date: 2011/12/27 00:34:52 $ $Revision: 1.5 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. diff --git a/sys/unix/nethack.sh b/sys/unix/nethack.sh old mode 100755 new mode 100644 index 00d2c409a..27278079b --- a/sys/unix/nethack.sh +++ b/sys/unix/nethack.sh @@ -1,5 +1,6 @@ #!/bin/sh -# NetHack 3.5 nethack.sh $Date$ $Revision$ +# NetHack 3.5 nethack.sh $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 nethack.sh $Date: 2009/05/06 10:50:54 $ $Revision: 1.9 $ # SCCS Id: @(#)nethack.sh 3.5 2007/12/12 HACKDIR=/usr/games/lib/nethackdir diff --git a/sys/unix/setup.sh b/sys/unix/setup.sh old mode 100755 new mode 100644 index 38f3e9d8d..2c1cbedca --- a/sys/unix/setup.sh +++ b/sys/unix/setup.sh @@ -1,5 +1,6 @@ #!/bin/sh -# NetHack 3.5 setup.sh $Date$ $Revision$ +# NetHack 3.5 setup.sh $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 setup.sh $Date: 2011/12/27 00:34:52 $ $Revision: 1.6 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. # diff --git a/sys/unix/sysconf b/sys/unix/sysconf index 99bcab3d8..3eb07ecaa 100644 --- a/sys/unix/sysconf +++ b/sys/unix/sysconf @@ -1,5 +1,6 @@ # -# NetHack 3.5 sysconf $Date$ $Revision$ +# NetHack 3.5 sysconf $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 sysconf $Date: 2012/01/27 20:15:31 $ $Revision: 1.6 $ # # Sample sysconf file. # The sysconf file is only used if NetHack is compiled with SYSCF defined. diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index be3617170..8f743e2ad 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 unixmain.c $Date$ $Revision$ */ +/* NetHack 3.5 unixmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 unixmain.c $Date: 2012/01/27 20:15:31 $ $Revision: 1.42 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/unix/unixres.c b/sys/unix/unixres.c index 645e313ad..6d647103a 100644 --- a/sys/unix/unixres.c +++ b/sys/unix/unixres.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 unixres.c $Date$ $Revision$ */ +/* NetHack 3.5 unixres.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 unixres.c $Date: 2009/05/06 10:50:57 $ $Revision: 1.8 $ */ /* SCCS Id: @(#)unixres.c 3.5 2001/07/08 */ /* Copyright (c) Slash'EM development team, 2001. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/unix/unixunix.c b/sys/unix/unixunix.c index 978dd477a..a6d6d378b 100644 --- a/sys/unix/unixunix.c +++ b/sys/unix/unixunix.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 unixunix.c $Date$ $Revision$ */ +/* NetHack 3.5 unixunix.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 unixunix.c $Date: 2012/01/27 20:15:31 $ $Revision: 1.16 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/vms/Makefile.dat b/sys/vms/Makefile.dat index ec3af0aea..0a6bcf896 100644 --- a/sys/vms/Makefile.dat +++ b/sys/vms/Makefile.dat @@ -1,5 +1,6 @@ # NetHack Makefile (VMS) - data files: special levels and other data. -# NetHack 3.5 Makefile.dat $Date$ $Revision$ +# NetHack 3.5 Makefile.dat $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.dat $Date: 2011/05/23 03:27:10 $ $Revision: 1.5 $ # Copy this file to [.dat]Makefile.; no editing needed. diff --git a/sys/vms/Makefile.doc b/sys/vms/Makefile.doc index 7c7587a82..01e8158e4 100644 --- a/sys/vms/Makefile.doc +++ b/sys/vms/Makefile.doc @@ -1,5 +1,6 @@ # NetHack Makefile (VMS) - for the [Unix] documentation. -# NetHack 3.5 Makefile.doc $Date$ $Revision$ +# NetHack 3.5 Makefile.doc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.doc $Date: 2011/05/23 03:27:10 $ $Revision: 1.5 $ # Copy this file to [.doc]Makefile. and edit it if needed. diff --git a/sys/vms/Makefile.src b/sys/vms/Makefile.src index a50ee357b..38f3ec266 100644 --- a/sys/vms/Makefile.src +++ b/sys/vms/Makefile.src @@ -1,5 +1,6 @@ # NetHack Makefile (VMS) - for building nethack itself. -# NetHack 3.5 Makefile.src $Date$ $Revision$ +# NetHack 3.5 Makefile.src $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.src $Date: 2011/10/11 02:37:18 $ $Revision: 1.23 $ # Copy this file to [.src]Makefile. and then edit it as needed. # The default configuration is for building with DEC C (aka Compaq C). diff --git a/sys/vms/Makefile.top b/sys/vms/Makefile.top index 01e9de1d6..04451124c 100644 --- a/sys/vms/Makefile.top +++ b/sys/vms/Makefile.top @@ -1,5 +1,6 @@ # NetHack Makefile (VMS) - top level for making & installing everything. -# NetHack 3.5 Makefile.top $Date$ $Revision$ +# NetHack 3.5 Makefile.top $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.top $Date: 2011/05/23 03:27:10 $ $Revision: 1.6 $ # Copy this file to Makefile.; edit the appropriate values for # GAMEDIR ("playground" location) and GAMEOWNER (UIC or identifier diff --git a/sys/vms/Makefile.utl b/sys/vms/Makefile.utl index 82eae9f8c..b132dcf9a 100644 --- a/sys/vms/Makefile.utl +++ b/sys/vms/Makefile.utl @@ -1,5 +1,6 @@ # NetHack Makefile (VMS) - for utility programs. -# NetHack 3.5 Makefile.utl $Date$ $Revision$ +# NetHack 3.5 Makefile.utl $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.utl $Date: 2011/05/23 03:27:10 $ $Revision: 1.10 $ # Copy this file to [.util]Makefile. and then edit it as needed. # The default configuration is for building with DEC C (aka Compaq C). diff --git a/sys/vms/lev_lex.h b/sys/vms/lev_lex.h index 0d26fed53..5dbde3521 100644 --- a/sys/vms/lev_lex.h +++ b/sys/vms/lev_lex.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 lev_lex.h $Date$ $Revision$ */ +/* NetHack 3.5 lev_lex.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev_lex.h $Date: 2009/05/06 10:51:24 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)lev_lex.h 3.5 1999/08/08 */ /* "vms/lev_lex.h" copied into "util/stdio.h" for use in *_lex.c only! * This is an awful kludge to allow util/*_lex.c made by SunOS's `lex' diff --git a/sys/vms/oldcrtl.c b/sys/vms/oldcrtl.c index e7bad5663..bb167cde5 100644 --- a/sys/vms/oldcrtl.c +++ b/sys/vms/oldcrtl.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 oldcrtl.c $Date$ $Revision$ */ +/* NetHack 3.5 oldcrtl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 oldcrtl.c $Date: 2009/05/06 10:51:24 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)oldcrtl.c 3.5 1995/06/01 */ /* Pat Rankin May'90 */ /* VMS NetHack support, not needed for vms 4.6,4.7,5.x,or later */ diff --git a/sys/vms/vmsfiles.c b/sys/vms/vmsfiles.c index a714cce84..5eac49b5e 100644 --- a/sys/vms/vmsfiles.c +++ b/sys/vms/vmsfiles.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vmsfiles.c $Date$ $Revision$ */ +/* NetHack 3.5 vmsfiles.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vmsfiles.c $Date: 2009/05/06 10:51:25 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)vmsfiles.c 3.5 2007/10/27 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/vms/vmsmail.c b/sys/vms/vmsmail.c index 2b00ff511..d5358eb7f 100644 --- a/sys/vms/vmsmail.c +++ b/sys/vms/vmsmail.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vmsmail.c $Date$ $Revision$ */ +/* NetHack 3.5 vmsmail.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vmsmail.c $Date: 2009/05/06 10:51:25 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)vmsmail.c 3.5 2006/04/14 */ /* Copyright (c) Robert Patrick Rankin, 1991. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/vms/vmsmain.c b/sys/vms/vmsmain.c index 7992c806c..52c181ade 100644 --- a/sys/vms/vmsmain.c +++ b/sys/vms/vmsmain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vmsmain.c $Date$ $Revision$ */ +/* NetHack 3.5 vmsmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vmsmain.c $Date: 2011/04/23 01:51:01 $ $Revision: 1.22 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ /* main.c - VMS NetHack */ diff --git a/sys/vms/vmsmisc.c b/sys/vms/vmsmisc.c index b5446a0fb..b5b2cf4cd 100644 --- a/sys/vms/vmsmisc.c +++ b/sys/vms/vmsmisc.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vmsmisc.c $Date$ $Revision$ */ +/* NetHack 3.5 vmsmisc.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vmsmisc.c $Date: 2011/09/01 01:47:00 $ $Revision: 1.6 $ */ /* NetHack may be freely redistributed. See license for details. */ #include "config.h" diff --git a/sys/vms/vmstty.c b/sys/vms/vmstty.c index 29d72bae5..548e476b2 100644 --- a/sys/vms/vmstty.c +++ b/sys/vms/vmstty.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vmstty.c $Date$ $Revision$ */ +/* NetHack 3.5 vmstty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vmstty.c $Date: 2011/04/13 01:48:13 $ $Revision: 1.10 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ /* tty.c - (VMS) version */ diff --git a/sys/vms/vmsunix.c b/sys/vms/vmsunix.c index 364c96d66..baa4f75a3 100644 --- a/sys/vms/vmsunix.c +++ b/sys/vms/vmsunix.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 vmsunix.c $Date$ $Revision$ */ +/* NetHack 3.5 vmsunix.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vmsunix.c $Date: 2011/09/01 01:47:00 $ $Revision: 1.8 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/Install.ce b/sys/wince/Install.ce index 50fd50477..60c7ee081 100644 --- a/sys/wince/Install.ce +++ b/sys/wince/Install.ce @@ -4,7 +4,8 @@ NetHack may be freely redistributed. See license for details. Instructions for compiling and installing NetHack 3.5 on a Windows CE or PocketPC system ======================================================================== - Last revision: $Date$ + Last revision: $NHDT-Date$ + Last revision: $Date: 2005/01/02 20:55:41 $ Credit for the porting of NetHack to Windows CE goes to Alex Kompel who initially developed and contributed the port. diff --git a/sys/wince/bootstrp.mak b/sys/wince/bootstrp.mak index 9a04417df..4066b63d1 100644 --- a/sys/wince/bootstrp.mak +++ b/sys/wince/bootstrp.mak @@ -1,4 +1,5 @@ -# NetHack 3.5 bootstrp.mak $Date$ $Revision$ +# NetHack 3.5 bootstrp.mak $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 bootstrp.mak $Date: 2012/01/10 17:47:33 $ $Revision: 1.10 $ # Copyright (c) Michael Allison # # NetHack Windows CE bootstrap file for MS Visual C++ V6.x and diff --git a/sys/wince/celib.c b/sys/wince/celib.c index 4c0d0b487..a8e38ccc7 100644 --- a/sys/wince/celib.c +++ b/sys/wince/celib.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 celib.c $Date$ $Revision$ */ +/* NetHack 3.5 celib.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 celib.c $Date: 2009/10/22 02:59:30 $ $Revision: 1.6 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/cesetup.bat b/sys/wince/cesetup.bat old mode 100755 new mode 100644 index 9f7215434..28d3bf6ce --- a/sys/wince/cesetup.bat +++ b/sys/wince/cesetup.bat @@ -1,4 +1,5 @@ -@REM NetHack 3.5 cesetup.bat $Date$ $Revision$ */ +@REM NetHack 3.5 cesetup.bat $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +@REM NetHack 3.5 cesetup.bat $Date: 2009/10/22 02:59:30 $ $Revision: 1.9 $ */ @REM Copyright (c) Alex Kompel, 2002 @REM NetHack may be freely redistributed. See license for details. @REM Win32 nhsetup batch file, see Install.ce for details diff --git a/sys/wince/cesound.c b/sys/wince/cesound.c index 8071abc42..6df289f3d 100644 --- a/sys/wince/cesound.c +++ b/sys/wince/cesound.c @@ -1,5 +1,7 @@ -/* NetHack 3.5 cesound.c $Date$ $Revision$ */ -/* SCCS Id: @(#)cesound.c 3.5 $Date$ */ +/* NetHack 3.5 cesound.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 cesound.c $Date: 2009/05/06 10:52:00 $ $Revision: 1.4 $ */ +/* SCCS Id: @(#)cesound.c 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)cesound.c 3.5 $Date: 2009/05/06 10:52:00 $ */ /* Copyright (c) NetHack PC Development Team 1993 */ /* NetHack may be freely redistributed. See license for details. */ /* */ diff --git a/sys/wince/mhaskyn.c b/sys/wince/mhaskyn.c index a46e0f0ad..fa4dd8629 100644 --- a/sys/wince/mhaskyn.c +++ b/sys/wince/mhaskyn.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhaskyn.c $Date$ $Revision$ */ +/* NetHack 3.5 mhaskyn.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhaskyn.c $Date: 2009/05/06 10:52:00 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mhaskyn.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhaskyn.h b/sys/wince/mhaskyn.h index 0754723fb..e034486a8 100644 --- a/sys/wince/mhaskyn.h +++ b/sys/wince/mhaskyn.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhaskyn.h $Date$ $Revision$ */ +/* NetHack 3.5 mhaskyn.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhaskyn.h $Date: 2009/05/06 10:52:03 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)mhaskyn.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhcmd.c b/sys/wince/mhcmd.c index 8000db9ad..1e8b1c7f2 100644 --- a/sys/wince/mhcmd.c +++ b/sys/wince/mhcmd.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhcmd.c $Date$ $Revision$ */ +/* NetHack 3.5 mhcmd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhcmd.c $Date: 2009/10/22 02:59:30 $ $Revision: 1.8 $ */ /* NetHack may be freely redistributed. See license for details. */ #include "winMS.h" diff --git a/sys/wince/mhcolor.c b/sys/wince/mhcolor.c index a68056fb5..285861da5 100644 --- a/sys/wince/mhcolor.c +++ b/sys/wince/mhcolor.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhcolor.c $Date$ $Revision$ */ +/* NetHack 3.5 mhcolor.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhcolor.c $Date: 2009/05/06 10:52:03 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)mhcolor.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhcolor.h b/sys/wince/mhcolor.h index 392da954b..8ebb7dc50 100644 --- a/sys/wince/mhcolor.h +++ b/sys/wince/mhcolor.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhcolor.h $Date$ $Revision$ */ +/* NetHack 3.5 mhcolor.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhcolor.h $Date: 2009/05/06 10:52:04 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)mhcolor.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhdlg.c b/sys/wince/mhdlg.c index 81017832f..edaca4cc4 100644 --- a/sys/wince/mhdlg.c +++ b/sys/wince/mhdlg.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhdlg.c $Date$ $Revision$ */ +/* NetHack 3.5 mhdlg.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhdlg.c $Date: 2009/10/13 01:55:10 $ $Revision: 1.8 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhdlg.h b/sys/wince/mhdlg.h index 78540b1a5..40ed9154a 100644 --- a/sys/wince/mhdlg.h +++ b/sys/wince/mhdlg.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhdlg.h $Date$ $Revision$ */ +/* NetHack 3.5 mhdlg.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhdlg.h $Date: 2009/05/06 10:52:06 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)mhdlg.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhfont.c b/sys/wince/mhfont.c index 9d30c87da..4b8ec12f6 100644 --- a/sys/wince/mhfont.c +++ b/sys/wince/mhfont.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhfont.c $Date$ $Revision$ */ +/* NetHack 3.5 mhfont.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhfont.c $Date: 2009/05/06 10:52:08 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)mhfont.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhfont.h b/sys/wince/mhfont.h index 7b6aeb1cf..00928b5de 100644 --- a/sys/wince/mhfont.h +++ b/sys/wince/mhfont.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhfont.h $Date$ $Revision$ */ +/* NetHack 3.5 mhfont.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhfont.h $Date: 2009/05/06 10:52:08 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mhfont.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhinput.c b/sys/wince/mhinput.c index 129d790df..29b765470 100644 --- a/sys/wince/mhinput.c +++ b/sys/wince/mhinput.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhinput.c $Date$ $Revision$ */ +/* NetHack 3.5 mhinput.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhinput.c $Date: 2009/05/06 10:52:10 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mhinput.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhinput.h b/sys/wince/mhinput.h index c2d73aa5c..dce815301 100644 --- a/sys/wince/mhinput.h +++ b/sys/wince/mhinput.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhinput.h $Date$ $Revision$ */ +/* NetHack 3.5 mhinput.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhinput.h $Date: 2009/05/06 10:52:10 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mhinput.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhmain.c b/sys/wince/mhmain.c index 28a29c137..ff4e628b3 100644 --- a/sys/wince/mhmain.c +++ b/sys/wince/mhmain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmain.c $Date$ $Revision$ */ +/* NetHack 3.5 mhmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmain.c $Date: 2011/10/11 02:37:20 $ $Revision: 1.14 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhmain.h b/sys/wince/mhmain.h index c8d79dbee..6bca6d674 100644 --- a/sys/wince/mhmain.h +++ b/sys/wince/mhmain.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmain.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmain.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmain.h $Date: 2009/05/06 10:52:13 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mhmain.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhmap.c b/sys/wince/mhmap.c index 156a8f8b0..1fe386490 100644 --- a/sys/wince/mhmap.c +++ b/sys/wince/mhmap.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmap.c $Date$ $Revision$ */ +/* NetHack 3.5 mhmap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmap.c $Date: 2009/10/13 01:55:11 $ $Revision: 1.10 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhmap.h b/sys/wince/mhmap.h index e29aca51f..a418d0f64 100644 --- a/sys/wince/mhmap.h +++ b/sys/wince/mhmap.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmap.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmap.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmap.h $Date: 2009/10/13 01:55:12 $ $Revision: 1.6 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhmsg.h b/sys/wince/mhmsg.h index 6e2629ab4..56f8841d8 100644 --- a/sys/wince/mhmsg.h +++ b/sys/wince/mhmsg.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmsg.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmsg.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmsg.h $Date: 2009/05/06 10:52:21 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)mhmsg.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhmsgwnd.c b/sys/wince/mhmsgwnd.c index ffe3fc10a..6d2804f61 100644 --- a/sys/wince/mhmsgwnd.c +++ b/sys/wince/mhmsgwnd.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmsgwnd.c $Date$ $Revision$ */ +/* NetHack 3.5 mhmsgwnd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmsgwnd.c $Date: 2009/10/13 01:55:12 $ $Revision: 1.7 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhmsgwnd.h b/sys/wince/mhmsgwnd.h index 7638eaa2c..a0e4ee13c 100644 --- a/sys/wince/mhmsgwnd.h +++ b/sys/wince/mhmsgwnd.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmsgwnd.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmsgwnd.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmsgwnd.h $Date: 2009/05/06 10:52:26 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)mhmsgwnd.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhrip.c b/sys/wince/mhrip.c index 5de8f0957..8b6957569 100644 --- a/sys/wince/mhrip.c +++ b/sys/wince/mhrip.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhrip.c $Date$ $Revision$ */ +/* NetHack 3.5 mhrip.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhrip.c $Date: 2009/05/06 10:52:26 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mhrip.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhrip.h b/sys/wince/mhrip.h index bd4b74eee..f5a4d7d44 100644 --- a/sys/wince/mhrip.h +++ b/sys/wince/mhrip.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhrip.h $Date$ $Revision$ */ +/* NetHack 3.5 mhrip.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhrip.h $Date: 2009/05/06 10:52:28 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mhrip.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhstatus.c b/sys/wince/mhstatus.c index 786d2a8c2..6e18ed12a 100644 --- a/sys/wince/mhstatus.c +++ b/sys/wince/mhstatus.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhstatus.c $Date$ $Revision$ */ +/* NetHack 3.5 mhstatus.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhstatus.c $Date: 2009/05/06 10:52:28 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)mhstatus.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhstatus.h b/sys/wince/mhstatus.h index 18df7a9f2..fcd186162 100644 --- a/sys/wince/mhstatus.h +++ b/sys/wince/mhstatus.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhstatus.h $Date$ $Revision$ */ +/* NetHack 3.5 mhstatus.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhstatus.h $Date: 2009/05/06 10:52:29 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)mhstatus.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhtext.c b/sys/wince/mhtext.c index 01581df62..3b61dab66 100644 --- a/sys/wince/mhtext.c +++ b/sys/wince/mhtext.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhtext.c $Date$ $Revision$ */ +/* NetHack 3.5 mhtext.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhtext.c $Date: 2009/10/22 02:59:34 $ $Revision: 1.8 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhtext.h b/sys/wince/mhtext.h index ed12ec815..fdbae63f1 100644 --- a/sys/wince/mhtext.h +++ b/sys/wince/mhtext.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhtext.h $Date$ $Revision$ */ +/* NetHack 3.5 mhtext.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhtext.h $Date: 2009/05/06 10:52:32 $ $Revision: 1.3 $ */ /* SCCS Id: @(#)mhtext.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhtxtbuf.c b/sys/wince/mhtxtbuf.c index 5523d0f02..1be9af440 100644 --- a/sys/wince/mhtxtbuf.c +++ b/sys/wince/mhtxtbuf.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhtxtbuf.c $Date$ $Revision$ */ +/* NetHack 3.5 mhtxtbuf.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhtxtbuf.c $Date: 2009/10/13 01:55:12 $ $Revision: 1.6 $ */ /* Copyright (C) 2003 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhtxtbuf.h b/sys/wince/mhtxtbuf.h index fb38affb8..a61265796 100644 --- a/sys/wince/mhtxtbuf.h +++ b/sys/wince/mhtxtbuf.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhtxtbuf.h $Date$ $Revision$ */ +/* NetHack 3.5 mhtxtbuf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhtxtbuf.h $Date: 2009/10/13 01:55:12 $ $Revision: 1.5 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mswproc.c b/sys/wince/mswproc.c index b069d1284..a4e5ede90 100644 --- a/sys/wince/mswproc.c +++ b/sys/wince/mswproc.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mswproc.c $Date$ $Revision$ */ +/* NetHack 3.5 mswproc.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mswproc.c $Date: 2012/01/24 04:26:22 $ $Revision: 1.19 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/winMS.h b/sys/wince/winMS.h index c8df31219..31856e71f 100644 --- a/sys/wince/winMS.h +++ b/sys/wince/winMS.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 winMS.h $Date$ $Revision$ */ +/* NetHack 3.5 winMS.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winMS.h $Date: 2012/01/24 04:26:22 $ $Revision: 1.9 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/winhack.c b/sys/wince/winhack.c index 17ecf17eb..2e25082a0 100644 --- a/sys/wince/winhack.c +++ b/sys/wince/winhack.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winhack.c $Date$ $Revision$ */ +/* NetHack 3.5 winhack.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winhack.c $Date: 2009/10/22 02:59:35 $ $Revision: 1.11 $ */ /* Copyright (C) 2001 by Alex Kompel */ // winhack.cpp : Defines the entry point for the application. // diff --git a/sys/winnt/Install.nt b/sys/winnt/Install.nt index cc7af7962..b4beb8f87 100644 --- a/sys/winnt/Install.nt +++ b/sys/winnt/Install.nt @@ -5,7 +5,8 @@ NetHack 3.5 on a Windows system (Windows XP and Windows 2003 or later only) ============================================================== - Last revision: $Date$ + Last revision: $NHDT-Date$ + Last revision: $Date: 2012/01/15 17:43:54 $ Credit for the porting of NetHack to the Win32 Console Subsystem goes to the NT Porting Team started by Michael Allison. diff --git a/sys/winnt/Makefile.bcc b/sys/winnt/Makefile.bcc index 358feb966..018baecb8 100644 --- a/sys/winnt/Makefile.bcc +++ b/sys/winnt/Makefile.bcc @@ -1,4 +1,5 @@ -# NetHack 3.5 Makefile.bcc $Date$ $Revision$ +# NetHack 3.5 Makefile.bcc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.bcc $Date: 2011/10/11 02:37:22 $ $Revision: 1.46 $ # Copyright (c) NetHack PC Development Team 1993-2010 # # diff --git a/sys/winnt/Makefile.gcc b/sys/winnt/Makefile.gcc index a6e618386..eb436fbf2 100644 --- a/sys/winnt/Makefile.gcc +++ b/sys/winnt/Makefile.gcc @@ -1,4 +1,5 @@ -# NetHack 3.5 Makefile.gcc $Date$ $Revision$ +# NetHack 3.5 Makefile.gcc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.gcc $Date: 2011/10/11 02:37:22 $ $Revision: 1.38 $ # Copyright (c) NetHack PC Development Team 1993-2010 # # NetHack 3.5.x Makefile for MinGW diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index c4d013c0a..4d2b4c066 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -1,4 +1,5 @@ -# NetHack 3.5 Makefile.msc $Date$ $Revision$ +# NetHack 3.5 Makefile.msc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.msc $Date: 2012/04/14 00:38:09 $ $Revision: 1.54 $ # Copyright (c) NetHack PC Development Team 1993-2012 # # NetHack 3.5.x Makefile for MS Visual Studio Visual C++ compiler diff --git a/sys/winnt/console.rc b/sys/winnt/console.rc index 1f3824561..e76d9cdd3 100644 --- a/sys/winnt/console.rc +++ b/sys/winnt/console.rc @@ -1,5 +1,7 @@ -/* NetHack 3.5 console.rc $Date$ $Revision$ */ -/* SCCS Id: @(#)console.rc 3.5 $Date$ */ +/* NetHack 3.5 console.rc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 console.rc $Date: 2009/05/06 10:53:27 $ $Revision: 1.7 $ */ +/* SCCS Id: @(#)console.rc 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)console.rc 3.5 $Date: 2009/05/06 10:53:27 $ */ /* Copyright (c) Yitzhak Sapir, 2002. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/winnt/nh340key.c b/sys/winnt/nh340key.c index e42b9b8ae..1506bbfd7 100644 --- a/sys/winnt/nh340key.c +++ b/sys/winnt/nh340key.c @@ -1,5 +1,7 @@ -/* NetHack 3.5 nh340key.c $Date$ $Revision$ */ -/* SCCS Id: @(#)nh340key.c 3.5 $Date$ */ +/* NetHack 3.5 nh340key.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 nh340key.c $Date: 2009/05/06 10:53:29 $ $Revision: 1.7 $ */ +/* SCCS Id: @(#)nh340key.c 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)nh340key.c 3.5 $Date: 2009/05/06 10:53:29 $ */ /* Copyright (c) NetHack PC Development Team 2003 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/winnt/nhdefkey.c b/sys/winnt/nhdefkey.c index caae7b09c..3f40c0c38 100644 --- a/sys/winnt/nhdefkey.c +++ b/sys/winnt/nhdefkey.c @@ -1,5 +1,7 @@ -/* NetHack 3.5 nhdefkey.c $Date$ $Revision$ */ -/* SCCS Id: @(#)nhdefkey.c 3.5 $Date$ */ +/* NetHack 3.5 nhdefkey.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 nhdefkey.c $Date: 2009/05/06 10:53:29 $ $Revision: 1.10 $ */ +/* SCCS Id: @(#)nhdefkey.c 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)nhdefkey.c 3.5 $Date: 2009/05/06 10:53:29 $ */ /* Copyright (c) NetHack PC Development Team 2003 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/winnt/nhraykey.c b/sys/winnt/nhraykey.c index 73a4ed0ec..9c5d2b7a3 100644 --- a/sys/winnt/nhraykey.c +++ b/sys/winnt/nhraykey.c @@ -1,5 +1,7 @@ -/* NetHack 3.5 nhraykey.c $Date$ $Revision$ */ -/* SCCS Id: @(#)nhraykey.c 3.5 $Date$ */ +/* NetHack 3.5 nhraykey.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 nhraykey.c $Date: 2009/05/06 10:53:31 $ $Revision: 1.8 $ */ +/* SCCS Id: @(#)nhraykey.c 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)nhraykey.c 3.5 $Date: 2009/05/06 10:53:31 $ */ /* Copyright (c) NetHack PC Development Team 2003 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/winnt/nhsetup.bat b/sys/winnt/nhsetup.bat old mode 100755 new mode 100644 index c1324c35d..b4b4757a1 --- a/sys/winnt/nhsetup.bat +++ b/sys/winnt/nhsetup.bat @@ -1,4 +1,5 @@ -@REM NetHack 3.5 nhsetup.bat $Date$ $Revision$ */ +@REM NetHack 3.5 nhsetup.bat $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +@REM NetHack 3.5 nhsetup.bat $Date: 2010/09/05 14:22:16 $ $Revision: 1.21 $ */ @REM Copyright (c) NetHack PC Development Team 1993-2010 @REM NetHack may be freely redistributed. See license for details. @REM Win32 setup batch file, see Install.nt for details diff --git a/sys/winnt/ntsound.c b/sys/winnt/ntsound.c index c3008eb2e..0c2f1763d 100644 --- a/sys/winnt/ntsound.c +++ b/sys/winnt/ntsound.c @@ -1,5 +1,7 @@ -/* NetHack 3.5 ntsound.c $Date$ $Revision$ */ -/* SCCS Id: @(#)ntsound.c 3.5 $Date$ */ +/* NetHack 3.5 ntsound.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 ntsound.c $Date: 2009/05/06 10:53:33 $ $Revision: 1.7 $ */ +/* SCCS Id: @(#)ntsound.c 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)ntsound.c 3.5 $Date: 2009/05/06 10:53:33 $ */ /* Copyright (c) NetHack PC Development Team 1993 */ /* NetHack may be freely redistributed. See license for details. */ /* */ diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 39144e4ae..765d95142 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -1,5 +1,7 @@ -/* NetHack 3.5 nttty.c $Date$ $Revision$ */ -/* SCCS Id: @(#)nttty.c 3.5 $Date$ */ +/* NetHack 3.5 nttty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 nttty.c $Date: 2009/05/06 10:53:34 $ $Revision: 1.54 $ */ +/* SCCS Id: @(#)nttty.c 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)nttty.c 3.5 $Date: 2009/05/06 10:53:34 $ */ /* Copyright (c) NetHack PC Development Team 1993 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/winnt/win32api.h b/sys/winnt/win32api.h index 84d040560..3ea9f0598 100644 --- a/sys/winnt/win32api.h +++ b/sys/winnt/win32api.h @@ -1,5 +1,7 @@ -/* NetHack 3.5 win32api.h $Date$ $Revision$ */ -/* SCCS Id: @(#)win32api.h 3.5 $Date$ */ +/* NetHack 3.5 win32api.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 win32api.h $Date: 2009/05/06 10:53:39 $ $Revision: 1.6 $ */ +/* SCCS Id: @(#)win32api.h 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)win32api.h 3.5 $Date: 2009/05/06 10:53:39 $ */ /* Copyright (c) NetHack PC Development Team 1996 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/winnt/winnt.c b/sys/winnt/winnt.c index 0817e4858..e63db103b 100644 --- a/sys/winnt/winnt.c +++ b/sys/winnt/winnt.c @@ -1,5 +1,7 @@ -/* NetHack 3.5 winnt.c $Date$ $Revision$ */ -/* SCCS Id: @(#)winnt.c 3.5 $Date$ */ +/* NetHack 3.5 winnt.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winnt.c $Date: 2012/01/15 19:11:41 $ $Revision: 1.18 $ */ +/* SCCS Id: @(#)winnt.c 3.5 $NHDT-Date$ */ +/* SCCS Id: @(#)winnt.c 3.5 $Date: 2012/01/15 19:11:41 $ */ /* Copyright (c) NetHack PC Development Team 1993, 1994 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/util/dgn_comp.l b/util/dgn_comp.l index 19e1546da..5841d0e7c 100644 --- a/util/dgn_comp.l +++ b/util/dgn_comp.l @@ -1,5 +1,6 @@ %{ -/* NetHack 3.5 dgn_comp.l $Date$ $Revision$ */ +/* NetHack 3.5 dgn_comp.l $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dgn_comp.l $Date: 2009/05/06 10:54:26 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)dgn_lex.c 3.5 2002/03/27 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1990 by M. Stephenson */ diff --git a/util/dgn_comp.y b/util/dgn_comp.y index 83dbf78a5..eec4fa496 100644 --- a/util/dgn_comp.y +++ b/util/dgn_comp.y @@ -1,5 +1,6 @@ %{ -/* NetHack 3.5 dgn_comp.y $Date$ $Revision$ */ +/* NetHack 3.5 dgn_comp.y $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dgn_comp.y $Date: 2009/05/06 10:54:26 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)dgn_comp.c 3.5 1996/06/22 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1990 by M. Stephenson */ diff --git a/util/dgn_main.c b/util/dgn_main.c index 5d1cccb32..2544755c3 100644 --- a/util/dgn_main.c +++ b/util/dgn_main.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dgn_main.c $Date$ $Revision$ */ +/* NetHack 3.5 dgn_main.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dgn_main.c $Date: 2009/05/06 10:54:27 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)dgn_main.c 3.5 1994/09/23 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1990 by M. Stephenson */ diff --git a/util/dlb_main.c b/util/dlb_main.c index 8821139b3..17025570b 100644 --- a/util/dlb_main.c +++ b/util/dlb_main.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 dlb_main.c $Date$ $Revision$ */ +/* NetHack 3.5 dlb_main.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dlb_main.c $Date: 2012/01/16 03:56:08 $ $Revision: 1.6 $ */ /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1993. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/util/lev_comp.l b/util/lev_comp.l index e3bd584d7..2b0ad5188 100644 --- a/util/lev_comp.l +++ b/util/lev_comp.l @@ -1,5 +1,6 @@ %{ -/* NetHack 3.5 lev_comp.l $Date$ $Revision$ */ +/* NetHack 3.5 lev_comp.l $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev_comp.l $Date: 2009/05/06 10:54:31 $ $Revision: 1.9 $ */ /* SCCS Id: @(#)lev_lex.c 3.5 2002/03/27 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/util/lev_comp.y b/util/lev_comp.y index 7cb7df25d..c2fe15fb6 100644 --- a/util/lev_comp.y +++ b/util/lev_comp.y @@ -1,5 +1,6 @@ %{ -/* NetHack 3.5 lev_comp.y $Date$ $Revision$ */ +/* NetHack 3.5 lev_comp.y $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev_comp.y $Date: 2009/05/06 10:54:31 $ $Revision: 1.8 $ */ /* SCCS Id: @(#)lev_yacc.c 3.5 2007/08/01 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/util/lev_main.c b/util/lev_main.c index 6cc9d4f35..d192e1e3e 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 lev_main.c $Date$ $Revision$ */ +/* NetHack 3.5 lev_main.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev_main.c $Date: 2012/01/12 04:48:12 $ $Revision: 1.20 $ */ /* SCCS Id: @(#)lev_main.c 3.5 2007/01/17 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/util/makedefs.c b/util/makedefs.c index 1f8752893..d84e1c7ea 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 makedefs.c $Date$ $Revision$ */ +/* NetHack 3.5 makedefs.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 makedefs.c $Date: 2012/01/15 09:27:03 $ $Revision: 1.50 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) M. Stephenson, 1990, 1991. */ /* Copyright (c) Dean Luick, 1990. */ diff --git a/util/mdgrep.h b/util/mdgrep.h index a70e1d645..b2515aa86 100644 --- a/util/mdgrep.h +++ b/util/mdgrep.h @@ -1,5 +1,6 @@ /* - * NetHack 3.5 mdgrep.h $Date$ $Revision$ + * NetHack 3.5 mdgrep.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * NetHack 3.5 mdgrep.h $Date: 2010/05/01 20:57:17 $ $Revision: 1.5 $ * Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008 * NetHack may be freely redistributed. See license for details. * diff --git a/util/mdgrep.pl b/util/mdgrep.pl index d291b1464..10038fdc7 100644 --- a/util/mdgrep.pl +++ b/util/mdgrep.pl @@ -1,5 +1,5 @@ #!perl -# NetHack 3.5 mdgrep.pl $NHDT-Date: 1423877528 2015/02/14 01:32:08 $ $NHDT-Revision: 1.7 $ +# NetHack 3.5 mdgrep.pl $NHDT-Date: 1423877528 2015/02/14 01:32:08 $ $NHDT-Branch$:$NHDT-Revision: 1.7 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland # NetHack may be freely redistributed. See license for details. @@ -56,6 +56,7 @@ $outfile = "mdgrep.h"; sub start_file { ($rev) = ('$NHDT-Revision: 1.7 $') =~ m/: (.*) .$/; my $date = '$NHDT-Date: 1423877529 2015/02/14 01:32:09 $'; + my $branch = '$NHDT-Branch$'; my $revision = '$NHDT-Revision: 1.7 $'; open(OUT, ">$outfile") || die "open $outfile: $!"; # NB: Date and Revision below will be modified when mdgrep.h is written to @@ -63,7 +64,7 @@ sub start_file { # before generating mdgrep.h and committing that file). print OUT < */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnaskstr.c b/win/gnome/gnaskstr.c index 652f1ddb6..eeeba31a2 100644 --- a/win/gnome/gnaskstr.c +++ b/win/gnome/gnaskstr.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnaskstr.c $Date$ $Revision$ */ +/* NetHack 3.5 gnaskstr.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnaskstr.c $Date: 2009/05/06 10:57:24 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnaskstr.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnaskstr.h b/win/gnome/gnaskstr.h index 16aeb7da8..056434adb 100644 --- a/win/gnome/gnaskstr.h +++ b/win/gnome/gnaskstr.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnaskstr.h $Date$ $Revision$ */ +/* NetHack 3.5 gnaskstr.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnaskstr.h $Date: 2009/05/06 10:57:24 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnaskstr.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnbind.c b/win/gnome/gnbind.c index 14b315392..c48535a26 100644 --- a/win/gnome/gnbind.c +++ b/win/gnome/gnbind.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnbind.c $Date$ $Revision$ */ +/* NetHack 3.5 gnbind.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnbind.c $Date: 2012/01/24 04:26:31 $ $Revision: 1.25 $ */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnbind.h b/win/gnome/gnbind.h index dc1bd5986..e7d9ad3c7 100644 --- a/win/gnome/gnbind.h +++ b/win/gnome/gnbind.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnbind.h $Date$ $Revision$ */ +/* NetHack 3.5 gnbind.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnbind.h $Date: 2012/01/24 04:26:31 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)gnbind.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnglyph.c b/win/gnome/gnglyph.c index c22a2f15b..b4c9547ec 100644 --- a/win/gnome/gnglyph.c +++ b/win/gnome/gnglyph.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnglyph.c $Date$ $Revision$ */ +/* NetHack 3.5 gnglyph.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnglyph.c $Date: 2009/05/06 10:57:29 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)gnglyph.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnglyph.h b/win/gnome/gnglyph.h index 9b49eff92..2f7ea032c 100644 --- a/win/gnome/gnglyph.h +++ b/win/gnome/gnglyph.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnglyph.h $Date$ $Revision$ */ +/* NetHack 3.5 gnglyph.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnglyph.h $Date: 2009/05/06 10:57:30 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnglyph.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnmain.c b/win/gnome/gnmain.c index 7f9a24a6b..45c55ef2f 100644 --- a/win/gnome/gnmain.c +++ b/win/gnome/gnmain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnmain.c $Date$ $Revision$ */ +/* NetHack 3.5 gnmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnmain.c $Date: 2009/05/06 10:57:32 $ $Revision: 1.9 $ */ /* SCCS Id: @(#)gnmain.c 3.5 2008/01/30 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnmain.h b/win/gnome/gnmain.h index 8fd78fe3b..92d7f4bd6 100644 --- a/win/gnome/gnmain.h +++ b/win/gnome/gnmain.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnmain.h $Date$ $Revision$ */ +/* NetHack 3.5 gnmain.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnmain.h $Date: 2009/05/06 10:57:32 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gnmain.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnmap.c b/win/gnome/gnmap.c index f5ea9d107..6f40505a3 100644 --- a/win/gnome/gnmap.c +++ b/win/gnome/gnmap.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnmap.c $Date$ $Revision$ */ +/* NetHack 3.5 gnmap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnmap.c $Date: 2009/05/06 10:57:34 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)gnmap.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* Copyright (C) 1998 by Anthony Taylor */ diff --git a/win/gnome/gnmap.h b/win/gnome/gnmap.h index 31ed17c48..7a1fcd9fc 100644 --- a/win/gnome/gnmap.h +++ b/win/gnome/gnmap.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnmap.h $Date$ $Revision$ */ +/* NetHack 3.5 gnmap.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnmap.h $Date: 2009/05/06 10:57:35 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnmap.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnmenu.c b/win/gnome/gnmenu.c index 2b2ecb587..abe5ed6c1 100644 --- a/win/gnome/gnmenu.c +++ b/win/gnome/gnmenu.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnmenu.c $Date$ $Revision$ */ +/* NetHack 3.5 gnmenu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnmenu.c $Date: 2009/05/06 10:57:36 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)gnmenu.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnmenu.h b/win/gnome/gnmenu.h index 88ed6bca9..6d243ad40 100644 --- a/win/gnome/gnmenu.h +++ b/win/gnome/gnmenu.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnmenu.h $Date$ $Revision$ */ +/* NetHack 3.5 gnmenu.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnmenu.h $Date: 2009/05/06 10:57:39 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gnmenu.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnmesg.c b/win/gnome/gnmesg.c index b213fc819..ab75c0cd1 100644 --- a/win/gnome/gnmesg.c +++ b/win/gnome/gnmesg.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnmesg.c $Date$ $Revision$ */ +/* NetHack 3.5 gnmesg.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnmesg.c $Date: 2009/05/06 10:57:39 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnmesg.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnmesg.h b/win/gnome/gnmesg.h index 1c35d96cf..7ea0110e0 100644 --- a/win/gnome/gnmesg.h +++ b/win/gnome/gnmesg.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnmesg.h $Date$ $Revision$ */ +/* NetHack 3.5 gnmesg.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnmesg.h $Date: 2009/05/06 10:57:39 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnmesg.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnomeprv.h b/win/gnome/gnomeprv.h index ff3415b58..4062e87d0 100644 --- a/win/gnome/gnomeprv.h +++ b/win/gnome/gnomeprv.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnomeprv.h $Date$ $Revision$ */ +/* NetHack 3.5 gnomeprv.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnomeprv.h $Date: 2009/05/06 10:57:40 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gnomeprv.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnopts.c b/win/gnome/gnopts.c index bbfe63ab6..9c68be769 100644 --- a/win/gnome/gnopts.c +++ b/win/gnome/gnopts.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnopts.c $Date$ $Revision$ */ +/* NetHack 3.5 gnopts.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnopts.c $Date: 2009/05/06 10:57:40 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gnopts.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnopts.h b/win/gnome/gnopts.h index aad71618b..888ded2ba 100644 --- a/win/gnome/gnopts.h +++ b/win/gnome/gnopts.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnopts.h $Date$ $Revision$ */ +/* NetHack 3.5 gnopts.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnopts.h $Date: 2009/05/06 10:57:42 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnopts.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnplayer.c b/win/gnome/gnplayer.c index c0edf69de..cb0ba24e7 100644 --- a/win/gnome/gnplayer.c +++ b/win/gnome/gnplayer.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnplayer.c $Date$ $Revision$ */ +/* NetHack 3.5 gnplayer.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnplayer.c $Date: 2009/05/06 10:57:42 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)gnplayer.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnplayer.h b/win/gnome/gnplayer.h index 88b25e445..d30f44d28 100644 --- a/win/gnome/gnplayer.h +++ b/win/gnome/gnplayer.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnplayer.h $Date$ $Revision$ */ +/* NetHack 3.5 gnplayer.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnplayer.h $Date: 2009/05/06 10:57:44 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gnplayer.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnsignal.c b/win/gnome/gnsignal.c index 8a8586b71..fc3b2b713 100644 --- a/win/gnome/gnsignal.c +++ b/win/gnome/gnsignal.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnsignal.c $Date$ $Revision$ */ +/* NetHack 3.5 gnsignal.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnsignal.c $Date: 2009/05/06 10:57:45 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)gnsignal.c 3.5 2005/11/19 */ /* Copyright (C) 1998 by Anthony Taylor */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnsignal.h b/win/gnome/gnsignal.h index c1f7b08db..b35f4d0af 100644 --- a/win/gnome/gnsignal.h +++ b/win/gnome/gnsignal.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnsignal.h $Date$ $Revision$ */ +/* NetHack 3.5 gnsignal.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnsignal.h $Date: 2009/05/06 10:57:51 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnsignal.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Anthony Taylor */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnstatus.c b/win/gnome/gnstatus.c index 085d6b150..6e3841cc3 100644 --- a/win/gnome/gnstatus.c +++ b/win/gnome/gnstatus.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnstatus.c $Date$ $Revision$ */ +/* NetHack 3.5 gnstatus.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnstatus.c $Date: 2009/05/06 10:57:54 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gnstatus.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnstatus.h b/win/gnome/gnstatus.h index 7746445f3..f6be02de0 100644 --- a/win/gnome/gnstatus.h +++ b/win/gnome/gnstatus.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnstatus.h $Date$ $Revision$ */ +/* NetHack 3.5 gnstatus.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnstatus.h $Date: 2009/05/06 10:57:57 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnstatus.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gntext.c b/win/gnome/gntext.c index 8bc6b6386..8f5734627 100644 --- a/win/gnome/gntext.c +++ b/win/gnome/gntext.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gntext.c $Date$ $Revision$ */ +/* NetHack 3.5 gntext.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gntext.c $Date: 2009/05/06 10:58:00 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gntext.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gntext.h b/win/gnome/gntext.h index 101c32bb4..934b4d05c 100644 --- a/win/gnome/gntext.h +++ b/win/gnome/gntext.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gntext.h $Date$ $Revision$ */ +/* NetHack 3.5 gntext.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gntext.h $Date: 2009/05/06 10:58:03 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gntext.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnyesno.c b/win/gnome/gnyesno.c index b53db8b9d..793663e44 100644 --- a/win/gnome/gnyesno.c +++ b/win/gnome/gnyesno.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnyesno.c $Date$ $Revision$ */ +/* NetHack 3.5 gnyesno.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnyesno.c $Date: 2009/05/06 10:58:06 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnyesno.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnyesno.h b/win/gnome/gnyesno.h index 2c2deb832..93979bf3c 100644 --- a/win/gnome/gnyesno.h +++ b/win/gnome/gnyesno.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 gnyesno.h $Date$ $Revision$ */ +/* NetHack 3.5 gnyesno.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnyesno.h $Date: 2009/05/06 10:58:08 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)gnyesno.h 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/macosx/NetHackGuidebook.applescript b/win/macosx/NetHackGuidebook.applescript index 0060b6d80..4310b1e43 100644 --- a/win/macosx/NetHackGuidebook.applescript +++ b/win/macosx/NetHackGuidebook.applescript @@ -1,5 +1,6 @@ #!/usr/bin/osascript -# NetHack 3.5.0 NetHackGuidebook.applescript $Date$ $Revision$ +# NetHack 3.5.0 NetHackGuidebook.applescript $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5.0 NetHackGuidebook.applescript $Date: 2011/10/17 01:29:20 $ $Revision: 1.2 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2011 # NetHack may be freely redistributed. See license for details. diff --git a/win/macosx/NetHackRecover.applescript b/win/macosx/NetHackRecover.applescript index 93d792208..50569656e 100644 --- a/win/macosx/NetHackRecover.applescript +++ b/win/macosx/NetHackRecover.applescript @@ -1,5 +1,6 @@ #!/usr/bin/osascript -# NetHack 3.5 NetHackRecover.applescript $Date$ $Revision$ +# NetHack 3.5 NetHackRecover.applescript $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 NetHackRecover.applescript $Date: 2011/10/17 01:29:20 $ $Revision: 1.3 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009 # NetHack may be freely redistributed. See license for details. diff --git a/win/macosx/NetHackTerm.applescript b/win/macosx/NetHackTerm.applescript index 648128096..c8274ebc5 100644 --- a/win/macosx/NetHackTerm.applescript +++ b/win/macosx/NetHackTerm.applescript @@ -1,5 +1,6 @@ #!/usr/bin/osascript -# NetHack 3.5.0 NetHackTerm.applescript $Date$ $Revision$ +# NetHack 3.5.0 NetHackTerm.applescript $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5.0 NetHackTerm.applescript $Date: 2011/10/17 01:29:20 $ $Revision: 1.2 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2011 # NetHack may be freely redistributed. See license for details. diff --git a/win/macosx/recover.pl b/win/macosx/recover.pl old mode 100755 new mode 100644 index 65aa68dfc..95b299cf9 --- a/win/macosx/recover.pl +++ b/win/macosx/recover.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl -# NetHack 3.5 recover.pl $Date$ $Revision$ +# NetHack 3.5 recover.pl $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 recover.pl $Date: 2011/10/17 01:29:20 $ $Revision: 1.3 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009 # NetHack may be freely redistributed. See license for details. diff --git a/win/share/ppmwrite.c b/win/share/ppmwrite.c index c20e02c1e..32b98373f 100644 --- a/win/share/ppmwrite.c +++ b/win/share/ppmwrite.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 ppmwrite.c $Date$ $Revision$ */ +/* NetHack 3.5 ppmwrite.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 ppmwrite.c $Date: 2009/05/06 10:59:00 $ $Revision: 1.2 $ */ /* this produces a raw ppm file, with a 15-character header of * "P6 3-digit-width 3-digit-height 255\n" */ diff --git a/win/share/thintile.c b/win/share/thintile.c index 10ac899ed..def85c5af 100644 --- a/win/share/thintile.c +++ b/win/share/thintile.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 thintile.c $Date$ $Revision$ */ +/* NetHack 3.5 thintile.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 thintile.c $Date: 2012/01/10 17:47:40 $ $Revision: 1.5 $ */ /* Copyright (c) NetHack Development Team 1995 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/share/tile.doc b/win/share/tile.doc index c3b24e68f..7b776813c 100644 --- a/win/share/tile.doc +++ b/win/share/tile.doc @@ -1,4 +1,5 @@ -NetHack 3.5 tile.doc $Date$ $Revision$ +NetHack 3.5 tile.doc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +NetHack 3.5 tile.doc $Date: 2009/05/06 10:59:00 $ $Revision: 1.2 $ Window ports can optionally make use of the tiles (pictures for NetHack symbols) found in this directory. They are distributed in a text format diff --git a/win/share/tile.h b/win/share/tile.h index e2249414f..037f7f95f 100644 --- a/win/share/tile.h +++ b/win/share/tile.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 tile.h $Date$ $Revision$ */ +/* NetHack 3.5 tile.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tile.h $Date: 2009/05/06 21:59:39 $ $Revision: 1.6 $ */ typedef unsigned char pixval; typedef struct pixel_s { diff --git a/win/share/tile2bmp.c b/win/share/tile2bmp.c index 775c2ff68..fde808967 100644 --- a/win/share/tile2bmp.c +++ b/win/share/tile2bmp.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 tile2bmp.c $Date$ $Revision$ */ +/* NetHack 3.5 tile2bmp.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tile2bmp.c $Date: 2009/05/06 10:59:00 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)tile2bmp.c 3.5 2002/03/14 */ /* Copyright (c) NetHack PC Development Team 1995 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/share/tilemap.c b/win/share/tilemap.c index ab118cad1..87423f49c 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 tilemap.c $Date$ $Revision$ */ +/* NetHack 3.5 tilemap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tilemap.c $Date: 2009/05/06 10:59:02 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)tilemap.c 3.5 2000/06/04 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/share/tiletext.c b/win/share/tiletext.c index f17716251..d8a9c41db 100644 --- a/win/share/tiletext.c +++ b/win/share/tiletext.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 tiletext.c $Date$ $Revision$ */ +/* NetHack 3.5 tiletext.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tiletext.c $Date: 2009/05/06 10:59:03 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)tiletext.c 3.5 1999/10/24 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/tty/getline.c b/win/tty/getline.c index 60d97e7fe..6dfa10a6e 100644 --- a/win/tty/getline.c +++ b/win/tty/getline.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 getline.c $Date$ $Revision$ */ +/* NetHack 3.5 getline.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 getline.c $Date: 2011/12/11 01:54:56 $ $Revision: 1.18 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/tty/termcap.c b/win/tty/termcap.c index d3bd5d661..563491c48 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 termcap.c $Date$ $Revision$ */ +/* NetHack 3.5 termcap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 termcap.c $Date: 2009/05/06 10:59:19 $ $Revision: 1.13 $ */ /* SCCS Id: @(#)termcap.c 3.5 2007/12/12 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/tty/topl.c b/win/tty/topl.c index ed735f375..3efb52696 100644 --- a/win/tty/topl.c +++ b/win/tty/topl.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 topl.c $Date$ $Revision$ */ +/* NetHack 3.5 topl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 topl.c $Date: 2012/01/23 06:29:37 $ $Revision: 1.24 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 1d56f49ad..12ec044b3 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 wintty.c $Date$ $Revision$ */ +/* NetHack 3.5 wintty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wintty.c $Date: 2012/01/22 06:27:09 $ $Revision: 1.66 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhaskyn.c b/win/win32/mhaskyn.c index a46e0f0ad..db682be28 100644 --- a/win/win32/mhaskyn.c +++ b/win/win32/mhaskyn.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhaskyn.c $Date$ $Revision$ */ +/* NetHack 3.5 mhaskyn.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhaskyn.c $Date: 2009/05/06 10:59:46 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mhaskyn.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhaskyn.h b/win/win32/mhaskyn.h index cc91a02ec..5b0863b6e 100644 --- a/win/win32/mhaskyn.h +++ b/win/win32/mhaskyn.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhaskyn.h $Date$ $Revision$ */ +/* NetHack 3.5 mhaskyn.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhaskyn.h $Date: 2009/05/06 10:59:46 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mhaskyn.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhdlg.c b/win/win32/mhdlg.c index e2c68833e..dbac91bc5 100644 --- a/win/win32/mhdlg.c +++ b/win/win32/mhdlg.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhdlg.c $Date$ $Revision$ */ +/* NetHack 3.5 mhdlg.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhdlg.c $Date: 2012/01/11 01:45:02 $ $Revision: 1.18 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhdlg.h b/win/win32/mhdlg.h index 608810bc0..2c726ce9a 100644 --- a/win/win32/mhdlg.h +++ b/win/win32/mhdlg.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhdlg.h $Date$ $Revision$ */ +/* NetHack 3.5 mhdlg.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhdlg.h $Date: 2012/01/11 01:15:36 $ $Revision: 1.5 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhfont.c b/win/win32/mhfont.c index 23ae7770e..cfbec944e 100644 --- a/win/win32/mhfont.c +++ b/win/win32/mhfont.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhfont.c $Date$ $Revision$ */ +/* NetHack 3.5 mhfont.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhfont.c $Date: 2009/05/06 10:59:46 $ $Revision: 1.17 $ */ /* SCCS Id: @(#)mhfont.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhfont.h b/win/win32/mhfont.h index 9017da9d7..f097b9e38 100644 --- a/win/win32/mhfont.h +++ b/win/win32/mhfont.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhfont.h $Date$ $Revision$ */ +/* NetHack 3.5 mhfont.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhfont.h $Date: 2009/05/06 10:59:46 $ $Revision: 1.8 $ */ /* SCCS Id: @(#)mhfont.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhinput.c b/win/win32/mhinput.c index 99789fb14..92ea84364 100644 --- a/win/win32/mhinput.c +++ b/win/win32/mhinput.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhinput.c $Date$ $Revision$ */ +/* NetHack 3.5 mhinput.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhinput.c $Date: 2009/05/06 10:59:48 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)mhinput.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhinput.h b/win/win32/mhinput.h index 75ce3639d..d06c7b8f9 100644 --- a/win/win32/mhinput.h +++ b/win/win32/mhinput.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhinput.h $Date$ $Revision$ */ +/* NetHack 3.5 mhinput.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhinput.h $Date: 2009/05/06 10:59:49 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)mhinput.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmain.c b/win/win32/mhmain.c index 8473f498b..b8a2dac10 100644 --- a/win/win32/mhmain.c +++ b/win/win32/mhmain.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmain.c $Date$ $Revision$ */ +/* NetHack 3.5 mhmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmain.c $Date: 2012/01/11 01:53:44 $ $Revision: 1.49 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmain.h b/win/win32/mhmain.h index bd5cebd76..7a6593d5e 100644 --- a/win/win32/mhmain.h +++ b/win/win32/mhmain.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmain.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmain.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmain.h $Date: 2009/05/06 10:59:52 $ $Revision: 1.10 $ */ /* SCCS Id: @(#)mhmain.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmap.c b/win/win32/mhmap.c index c4ac00b03..ff1a43fb1 100644 --- a/win/win32/mhmap.c +++ b/win/win32/mhmap.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmap.c $Date$ $Revision$ */ +/* NetHack 3.5 mhmap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmap.c $Date: 2012/01/11 01:45:02 $ $Revision: 1.37 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmap.h b/win/win32/mhmap.h index 23be87fa6..54a614730 100644 --- a/win/win32/mhmap.h +++ b/win/win32/mhmap.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmap.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmap.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmap.h $Date: 2009/05/06 10:59:56 $ $Revision: 1.10 $ */ /* SCCS Id: @(#)mhmap.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmenu.c b/win/win32/mhmenu.c index 181caa446..e39470dc1 100644 --- a/win/win32/mhmenu.c +++ b/win/win32/mhmenu.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmenu.c $Date$ $Revision$ */ +/* NetHack 3.5 mhmenu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmenu.c $Date: 2012/01/11 01:53:44 $ $Revision: 1.36 $ */ /* Copyright (c) Alex Kompel, 2002 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmenu.h b/win/win32/mhmenu.h index 258c457eb..658a94a5b 100644 --- a/win/win32/mhmenu.h +++ b/win/win32/mhmenu.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmenu.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmenu.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmenu.h $Date: 2009/05/06 11:00:00 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)mhmenu.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmsg.h b/win/win32/mhmsg.h index 42a012ed2..8030b4391 100644 --- a/win/win32/mhmsg.h +++ b/win/win32/mhmsg.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmsg.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmsg.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmsg.h $Date: 2009/05/06 11:00:00 $ $Revision: 1.9 $ */ /* SCCS Id: @(#)mhmsg.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmsgwnd.c b/win/win32/mhmsgwnd.c index 3266ae071..a1ca24ba3 100644 --- a/win/win32/mhmsgwnd.c +++ b/win/win32/mhmsgwnd.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmsgwnd.c $Date$ $Revision$ */ +/* NetHack 3.5 mhmsgwnd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmsgwnd.c $Date: 2012/01/11 01:45:02 $ $Revision: 1.25 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhmsgwnd.h b/win/win32/mhmsgwnd.h index d3513c97c..68ca53baf 100644 --- a/win/win32/mhmsgwnd.h +++ b/win/win32/mhmsgwnd.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhmsgwnd.h $Date$ $Revision$ */ +/* NetHack 3.5 mhmsgwnd.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhmsgwnd.h $Date: 2009/05/06 11:00:10 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mhmsgwnd.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhrip.c b/win/win32/mhrip.c index bdae4c45f..87ac9d9b8 100644 --- a/win/win32/mhrip.c +++ b/win/win32/mhrip.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhrip.c $Date$ $Revision$ */ +/* NetHack 3.5 mhrip.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhrip.c $Date: 2012/01/11 01:45:02 $ $Revision: 1.13 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhrip.h b/win/win32/mhrip.h index c05542dfd..4c2927c2c 100644 --- a/win/win32/mhrip.h +++ b/win/win32/mhrip.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhrip.h $Date$ $Revision$ */ +/* NetHack 3.5 mhrip.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhrip.h $Date: 2009/05/06 11:00:15 $ $Revision: 1.6 $ */ /* SCCS Id: @(#)mhrip.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhsplash.c b/win/win32/mhsplash.c index 63ec10d88..fe14ff256 100644 --- a/win/win32/mhsplash.c +++ b/win/win32/mhsplash.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhsplash.c $Date$ $Revision$ */ +/* NetHack 3.5 mhsplash.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhsplash.c $Date: 2012/01/11 01:15:37 $ $Revision: 1.17 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhstatus.c b/win/win32/mhstatus.c index 2900e52f9..1ce6043ef 100644 --- a/win/win32/mhstatus.c +++ b/win/win32/mhstatus.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhstatus.c $Date$ $Revision$ */ +/* NetHack 3.5 mhstatus.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhstatus.c $Date: 2012/01/11 01:45:02 $ $Revision: 1.14 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhstatus.h b/win/win32/mhstatus.h index 5455a9505..273db526f 100644 --- a/win/win32/mhstatus.h +++ b/win/win32/mhstatus.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhstatus.h $Date$ $Revision$ */ +/* NetHack 3.5 mhstatus.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhstatus.h $Date: 2009/05/06 11:00:19 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mhstatus.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhtext.c b/win/win32/mhtext.c index 2c16f0c2d..4925b8b72 100644 --- a/win/win32/mhtext.c +++ b/win/win32/mhtext.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhtext.c $Date$ $Revision$ */ +/* NetHack 3.5 mhtext.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhtext.c $Date: 2012/01/11 01:53:44 $ $Revision: 1.17 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mhtext.h b/win/win32/mhtext.h index 21439f052..3cda167db 100644 --- a/win/win32/mhtext.h +++ b/win/win32/mhtext.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 mhtext.h $Date$ $Revision$ */ +/* NetHack 3.5 mhtext.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhtext.h $Date: 2009/05/06 11:00:26 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)mhtext.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index 3dd2a5528..11b109067 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 mswproc.c $Date$ $Revision$ */ +/* NetHack 3.5 mswproc.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mswproc.c $Date: 2012/01/24 04:26:33 $ $Revision: 1.71 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/winMS.h b/win/win32/winMS.h index 1e1352670..5b08c8a34 100644 --- a/win/win32/winMS.h +++ b/win/win32/winMS.h @@ -1,4 +1,5 @@ -/* NetHack 3.5 winMS.h $Date$ $Revision$ */ +/* NetHack 3.5 winMS.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winMS.h $Date: 2012/01/24 04:26:33 $ $Revision: 1.28 $ */ /* SCCS Id: @(#)winMS.h 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/win32/winhack.c b/win/win32/winhack.c index 7134ef902..dd0f6c14a 100644 --- a/win/win32/winhack.c +++ b/win/win32/winhack.c @@ -1,4 +1,5 @@ -/* NetHack 3.5 winhack.c $Date$ $Revision$ */ +/* NetHack 3.5 winhack.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winhack.c $Date: 2009/05/06 11:00:43 $ $Revision: 1.32 $ */ /* SCCS Id: @(#)winhack.c 3.5 2006/04/01 */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ From 28a53d5081f07cdea0691658680bc7896f0097b7 Mon Sep 17 00:00:00 2001 From: keni Date: Thu, 26 Feb 2015 09:22:52 -0500 Subject: [PATCH 117/354] Fix lost mode bits. --- sys/msdos/setup.bat | 0 sys/unix/hints/macosx.sh | 0 sys/unix/mkmkfile.sh | 0 sys/unix/nethack.sh | 0 sys/unix/setup.sh | 0 sys/wince/cesetup.bat | 0 sys/winnt/nhsetup.bat | 0 win/macosx/recover.pl | 0 8 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 sys/msdos/setup.bat mode change 100644 => 100755 sys/unix/hints/macosx.sh mode change 100644 => 100755 sys/unix/mkmkfile.sh mode change 100644 => 100755 sys/unix/nethack.sh mode change 100644 => 100755 sys/unix/setup.sh mode change 100644 => 100755 sys/wince/cesetup.bat mode change 100644 => 100755 sys/winnt/nhsetup.bat mode change 100644 => 100755 win/macosx/recover.pl diff --git a/sys/msdos/setup.bat b/sys/msdos/setup.bat old mode 100644 new mode 100755 diff --git a/sys/unix/hints/macosx.sh b/sys/unix/hints/macosx.sh old mode 100644 new mode 100755 diff --git a/sys/unix/mkmkfile.sh b/sys/unix/mkmkfile.sh old mode 100644 new mode 100755 diff --git a/sys/unix/nethack.sh b/sys/unix/nethack.sh old mode 100644 new mode 100755 diff --git a/sys/unix/setup.sh b/sys/unix/setup.sh old mode 100644 new mode 100755 diff --git a/sys/wince/cesetup.bat b/sys/wince/cesetup.bat old mode 100644 new mode 100755 diff --git a/sys/winnt/nhsetup.bat b/sys/winnt/nhsetup.bat old mode 100644 new mode 100755 diff --git a/win/macosx/recover.pl b/win/macosx/recover.pl old mode 100644 new mode 100755 From 414aea7517b3ffa76f4b27a0b8d9c4f7c7f52f5e Mon Sep 17 00:00:00 2001 From: keni Date: Thu, 26 Feb 2015 16:35:55 -0500 Subject: [PATCH 118/354] Update .gitignore files. --- doc/.gitignore | 1 + util/.gitignore | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 doc/.gitignore diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 000000000..7bdb35836 --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1 @@ +Guidebook diff --git a/util/.gitignore b/util/.gitignore index 43e9f40df..98b003527 100644 --- a/util/.gitignore +++ b/util/.gitignore @@ -8,3 +8,5 @@ lev_yacc.c tile2x11 lev_comp tileedit +dlb +recover From 4e50ba93f4fd92804a435b360f9627d415a877ad Mon Sep 17 00:00:00 2001 From: keni Date: Thu, 26 Feb 2015 17:10:11 -0500 Subject: [PATCH 119/354] A batch of manual header var additions. --- win/Qt/Install.Qt | 2 ++ win/X11/Install.X11 | 2 ++ win/X11/NetHack.ad | 3 +++ win/X11/dialogs.c | 3 +++ win/X11/nethack.rc | 2 ++ win/X11/tile2x11.c | 3 +++ win/share/gifread.c | 4 ++++ win/win32/dgnstuff.mak | 3 +++ win/win32/levstuff.mak | 2 ++ win/win32/mhsplash.h | 4 ++++ win/win32/tiles.mak | 3 +++ 11 files changed, 31 insertions(+) diff --git a/win/Qt/Install.Qt b/win/Qt/Install.Qt index bb204568d..28de2c431 100644 --- a/win/Qt/Install.Qt +++ b/win/Qt/Install.Qt @@ -1,5 +1,7 @@ Installing NetHack with a Qt or KDE interface --------------------------------------------- +$NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$Date: 2004/07/01 18:21:51 $ $Revision: 1.7 $ This document describes the installation of NetHack with a Qt interface on UNIX/X11 or Mac OS X. This code should also work with Qt/Windows, but diff --git a/win/X11/Install.X11 b/win/X11/Install.X11 index f26cbb72f..4473616bc 100644 --- a/win/X11/Install.X11 +++ b/win/X11/Install.X11 @@ -1,3 +1,5 @@ +$NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$Date: 2007/12/13 20:17:11 $ $Revision: 1.6 $ This document describes the installation of NetHack with an X11 interface. diff --git a/win/X11/NetHack.ad b/win/X11/NetHack.ad index f6f43be27..e6bff9721 100644 --- a/win/X11/NetHack.ad +++ b/win/X11/NetHack.ad @@ -1,3 +1,6 @@ +! $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +! $Date: 2003/10/03 02:09:25 $ $Revision: 1.5 $ + ! The display_file, tombstone, and menu windows are all formatted assuming ! a fixed width font. Text windows may or may not be formatted as above. ! The rip window applies if the GRAPHIC_TOMBSTONE option is turned on, and diff --git a/win/X11/dialogs.c b/win/X11/dialogs.c index a887ef0c7..21552921d 100644 --- a/win/X11/dialogs.c +++ b/win/X11/dialogs.c @@ -39,6 +39,9 @@ * + Added workaround for SYSV include problem. * + Changed the default width response text widget to be as wide as the * window itself. Suggestion from David E. Wexelblat, dwex@goblin.org. + * + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2002/03/31 17:11:23 $ $Revision: 1.2 $ */ #ifndef SYSV diff --git a/win/X11/nethack.rc b/win/X11/nethack.rc index e0124f325..18fa2ac8d 100644 --- a/win/X11/nethack.rc +++ b/win/X11/nethack.rc @@ -1,5 +1,7 @@ # # Nethack configuration file. +# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# $Date: 2007/12/13 20:17:11 $ $Revision: 1.2 $ # # Naming this file $(HOME)/.nethackrc (for UNIX) or setting the environment # variable NETHACKOPTIONS to point to its full path name elsewhere tells diff --git a/win/X11/tile2x11.c b/win/X11/tile2x11.c index a2542135d..ebfd3bd9b 100644 --- a/win/X11/tile2x11.c +++ b/win/X11/tile2x11.c @@ -1,6 +1,9 @@ /* * Convert the given input files into an output file that is expected * by nethack. + * + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2002/03/17 20:02:47 $ $Revision: 1.2 $ * * Assumptions: * + Two dimensional byte arrays are in row order and are not padded diff --git a/win/share/gifread.c b/win/share/gifread.c index 9757227ea..824393af9 100644 --- a/win/share/gifread.c +++ b/win/share/gifread.c @@ -12,6 +12,10 @@ /* | provided "as is" without express or implied warranty. | */ /* +-------------------------------------------------------------------+ */ +/* + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2002/01/05 21:06:02 $ $Revision: 1.1 $ + */ #include "config.h" #include "tile.h" diff --git a/win/win32/dgnstuff.mak b/win/win32/dgnstuff.mak index 8e5aa81fa..a23aadfd8 100644 --- a/win/win32/dgnstuff.mak +++ b/win/win32/dgnstuff.mak @@ -1,3 +1,6 @@ +# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# $Date: 2002/01/22 22:54:54 $ $Revision: 1.3 $ + #Set all of these or none of them #YACC = byacc.exe #LEX = flex.exe diff --git a/win/win32/levstuff.mak b/win/win32/levstuff.mak index c7540c4bd..cf749c6ce 100644 --- a/win/win32/levstuff.mak +++ b/win/win32/levstuff.mak @@ -1,3 +1,5 @@ +# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# $Date:2002/01/22 22:54:54 $ $Revision: 1.2 $ #YACC = byacc.exe #LEX = flex.exe #YTABC = y_tab.c diff --git a/win/win32/mhsplash.h b/win/win32/mhsplash.h index da6143c54..7d8ab4eb4 100644 --- a/win/win32/mhsplash.h +++ b/win/win32/mhsplash.h @@ -1,5 +1,9 @@ /* Copyright (C) 2002 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ +/* +$NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$Date: 2003/03/03 23:31:36 $ $Revision: 1.3 $ +*/ #ifndef MSWINSplashWindow_h #define MSWINSplashWindow_h diff --git a/win/win32/tiles.mak b/win/win32/tiles.mak index 26af1eada..0e76e1c53 100644 --- a/win/win32/tiles.mak +++ b/win/win32/tiles.mak @@ -1,3 +1,6 @@ +#$NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +#$Date: 2002/01/18 12:55:00 $ $Revision: 1.1 $ + default: all all: ..\win\win32\tiles.bmp From 69356cc77dfd9f2baf33980032e0e6310aa71673 Mon Sep 17 00:00:00 2001 From: keni Date: Thu, 26 Feb 2015 17:43:47 -0500 Subject: [PATCH 120/354] Another batch of manual header var additions --- sys/share/NetHack.cnf | 3 +++ sys/share/random.c | 3 +++ sys/share/uudecode.c | 2 ++ sys/unix/README.linux | 3 +++ sys/unix/depend.awk | 2 ++ sys/vms/install.com | 3 +++ sys/vms/nethack.com | 3 +++ sys/vms/spec_lev.com | 3 +++ sys/vms/vmsbuild.com | 2 ++ sys/wince/mhmenu.h | 4 ++++ sys/wince/winmain.c | 3 +++ sys/winnt/defaults.nh | 3 +++ win/gem/Install.gem | 3 +++ win/gem/bitmfile.c | 4 ++++ win/gem/gr_rect.h | 4 ++++ win/gem/load_img.c | 4 ++++ win/gnome/gnworn.c | 4 ++++ win/gnome/gnworn.h | 4 ++++ 18 files changed, 57 insertions(+) diff --git a/sys/share/NetHack.cnf b/sys/share/NetHack.cnf index 9b30b0b4d..29d8ce910 100644 --- a/sys/share/NetHack.cnf +++ b/sys/share/NetHack.cnf @@ -1,6 +1,9 @@ # NetHack Copyright (c) NetHack PC Development Team 1993 - 2006 # NetHack may be freely redistributed. See license for details. # +# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# $Date: 2006/09/23 04:40:09 $ $Revision: 1.7 $ +# # A '#' at the beginning of a line means the rest of the line is a comment. # # Some options MUST be set in this file, other options can be toggled while diff --git a/sys/share/random.c b/sys/share/random.c index 6905f48aa..ba1937bb4 100644 --- a/sys/share/random.c +++ b/sys/share/random.c @@ -32,6 +32,9 @@ * - remove useless variable `j' from srandom() * - cast result of pointer subtraction to long since ptrdiff_t could * be bigger than that and trigger warnings when assigning to long + * + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2007/12/23 00:59:25 $ $Revision: 1.2 $ */ #include "hack.h" diff --git a/sys/share/uudecode.c b/sys/share/uudecode.c index 8da6e714f..440bcaf14 100644 --- a/sys/share/uudecode.c +++ b/sys/share/uudecode.c @@ -41,6 +41,8 @@ * Modified 08 July 2006 to cast strlen() result to int to suppress a * warning on platforms where size_t > sizeof(int). * + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2006/07/09 16:42:21 $ $Revision: 1.4 $ */ #ifndef lint diff --git a/sys/unix/README.linux b/sys/unix/README.linux index e214f423d..e79359392 100644 --- a/sys/unix/README.linux +++ b/sys/unix/README.linux @@ -1,5 +1,8 @@ NetHack 3.5.0 Linux Elf +$NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$Date: 2005/01/02 17:17:28 $ $Revision: 1.16 $ + This README provides the instructions for using the official Linux binary, system platform requirements, as well as steps used to create that binary. The same steps can be used from the source distribution to create a similar diff --git a/sys/unix/depend.awk b/sys/unix/depend.awk index 47d107325..f78e24484 100644 --- a/sys/unix/depend.awk +++ b/sys/unix/depend.awk @@ -1,5 +1,7 @@ # depend.awk -- awk script used to construct makefile dependencies # for nethack's source files (`make depend' support for Makefile.src). +# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# $Date: 2005/12/15 03:42:52 $ $Revision: 1.3 $ # # usage: # cd src ; nawk -f depend.awk ../include/*.h list-of-.c/.cpp-files diff --git a/sys/vms/install.com b/sys/vms/install.com index aec87fe05..3cf0fc590 100755 --- a/sys/vms/install.com +++ b/sys/vms/install.com @@ -1,5 +1,8 @@ $ ! vms/install.com -- set up nethack 'playground' $ ! +$ ! $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$ ! $Date: 2006/09/23 04:45:56 $ $Revision: 1.4 $ +$ ! $ ! Use vmsbuild.com to create nethack.exe, makedefs, and lev_comp *first*. $ ! $ ! Edit this file to define gamedir & gameuic, or else invoke it with two diff --git a/sys/vms/nethack.com b/sys/vms/nethack.com index 164852f6c..93c76be11 100755 --- a/sys/vms/nethack.com +++ b/sys/vms/nethack.com @@ -1,6 +1,9 @@ $! NetHack.Com -- sample command procedure for invoking NetHack 9-JAN-1993 $ v = 'f$verify(0)' $! +$! $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$! $Date: 2002/01/05 21:06:00 $ $Revision: 1.1 $ +$! $! Possible command line arguments include $! "-uConan-B" !play a barbarian named Conan $! "-u" "Merlin-W" !play a wizard named Merlin (slight variant of above) diff --git a/sys/vms/spec_lev.com b/sys/vms/spec_lev.com index 9076933c2..fc680b572 100755 --- a/sys/vms/spec_lev.com +++ b/sys/vms/spec_lev.com @@ -1,5 +1,8 @@ $ ! sys/vms/spec_lev.com -- preprocess nethack's special level compiler code $ ! +$ ! $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$ ! $Date: 2002/01/05 21:06:00 $ $Revision: 1.1 $ +$ ! $ ! This operation needs to be performed prior to executing vmsbuild.com. $ ! Process the scanning and parsing code for NetHack's special level $ ! and dungeon compilers. *.l and *.y are converted into *'.c and *.h. diff --git a/sys/vms/vmsbuild.com b/sys/vms/vmsbuild.com index 20b4f01f4..b754601a5 100755 --- a/sys/vms/vmsbuild.com +++ b/sys/vms/vmsbuild.com @@ -1,5 +1,7 @@ $ ! vms/vmsbuild.com -- compile and link NetHack 3.5.* [pr] $ version_number = "3.5.0" +$ ! $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$ ! $Date: 2011/05/23 03:27:10 $ $Revision: 1.8 $ $ ! $ ! usage: $ ! $ set default [.src] !or [-.-.src] if starting from [.sys.vms] diff --git a/sys/wince/mhmenu.h b/sys/wince/mhmenu.h index 15c4759ac..e1ec643f5 100644 --- a/sys/wince/mhmenu.h +++ b/sys/wince/mhmenu.h @@ -1,4 +1,8 @@ /* NetHack may be freely redistributed. See license for details. */ +/* + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2002/07/22 03:19:13 $ $Revision: 1.1 $ + */ #ifndef MSWINMenuWindow_h #define MSWINMenuWindow_h diff --git a/sys/wince/winmain.c b/sys/wince/winmain.c index 0bb3d67b9..1d1a29a4b 100644 --- a/sys/wince/winmain.c +++ b/sys/wince/winmain.c @@ -1,4 +1,7 @@ // winmain.cpp : Defines the entry point for the application. +// +// $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +// $Date: 2002/12/18 03:51:34 $ $Revision: 1.2 $ #include "winMS.h" #include diff --git a/sys/winnt/defaults.nh b/sys/winnt/defaults.nh index 425edbf69..9de67ee85 100644 --- a/sys/winnt/defaults.nh +++ b/sys/winnt/defaults.nh @@ -6,6 +6,9 @@ # # To change the configuration, comment out the unwanted lines, and # uncomment the configuration you want. +# +# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# $Date: 2006/09/23 04:40:15 $ $Revision: 1.16 $ # *** OPTIONS *** # diff --git a/win/gem/Install.gem b/win/gem/Install.gem index 3880fe0dc..38c5740dd 100644 --- a/win/gem/Install.gem +++ b/win/gem/Install.gem @@ -1,3 +1,6 @@ +$NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +$Date: 2005/01/02 17:20:12 $ $Revision: 1.4 $ + Hi, This is nethack3.5.0 for Atari Gem and tty diff --git a/win/gem/bitmfile.c b/win/gem/bitmfile.c index 13e0073a9..fe6ccf5f4 100644 --- a/win/gem/bitmfile.c +++ b/win/gem/bitmfile.c @@ -7,6 +7,10 @@ * Bieber, Dez. 1994 * * -> Programmcode * \****************************/ +/* + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2002/01/05 21:06:00 $ $Revision: 1.1 $ + */ #include #include diff --git a/win/gem/gr_rect.h b/win/gem/gr_rect.h index 0e4a0bdc8..3927340f6 100644 --- a/win/gem/gr_rect.h +++ b/win/gem/gr_rect.h @@ -1,4 +1,8 @@ /* gr_rect.h */ +/* + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2002/03/20 03:50:49 $ $Revision: 1.1 $ + */ #include /********** structs **********/ typedef struct { diff --git a/win/gem/load_img.c b/win/gem/load_img.c index 16d8fe82c..fe995d6f5 100644 --- a/win/gem/load_img.c +++ b/win/gem/load_img.c @@ -1,3 +1,7 @@ +/* + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2002/03/20 03:45:03 $ $Revision: 1.2 $ + */ #define __TCC_COMPAT__ #include #include diff --git a/win/gnome/gnworn.c b/win/gnome/gnworn.c index dce035a94..20a8aa641 100644 --- a/win/gnome/gnworn.c +++ b/win/gnome/gnworn.c @@ -1,4 +1,8 @@ /* NetHack 3.5 gnworn.c 2009/05/06 10:58:06 1.3 */ +/* + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2012/01/10 17:47:38 $ $Revision: 1.4 $ + */ /* Copyright (C) 2002, Dylan Alex Simon */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/gnome/gnworn.h b/win/gnome/gnworn.h index db5169508..14e1a4fc9 100644 --- a/win/gnome/gnworn.h +++ b/win/gnome/gnworn.h @@ -1,4 +1,8 @@ /* NetHack 3.5 gnworn.h 2009/05/06 10:58:06 1.3 */ +/* + * $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ + * $Date: 2012/01/10 17:47:38 $ $Revision: 1.4 $ + */ /* Copyright (C) 2002 by Dylan Alex Simon */ /* NetHack may be freely redistributed. See license for details. */ From aba6ecb7b30adce05f10dd727ba6eb8497dda540 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 13 Feb 2015 16:58:59 -0500 Subject: [PATCH 121/354] Make ELBERETH unconditional. --- dat/oracles.txt | 2 +- include/config.h | 2 -- include/extern.h | 2 -- include/you.h | 2 -- src/cmd.c | 2 -- src/engrave.c | 2 -- src/monmove.c | 2 -- src/pray.c | 8 -------- src/u_init.c | 4 ---- util/makedefs.c | 17 ++++------------- 10 files changed, 5 insertions(+), 38 deletions(-) diff --git a/dat/oracles.txt b/dat/oracles.txt index bee2b4b30..d307c7a9f 100644 --- a/dat/oracles.txt +++ b/dat/oracles.txt @@ -96,7 +96,7 @@ The gods are said to be pleased when offerings are given to the priests who attend their temples, and they may grant various favors to those who do so. But beware! To be young and frugal is better than to be old and miserly. ------ ELBERETH +----- The name of Elbereth may strike fear into the hearts of thine enemies, if thou dost write it upon the ground at thy feet. If thou maintainest the utmost calm, thy safety will be aided greatly, but beware lest thy clumsy diff --git a/include/config.h b/include/config.h index 6db03c2c0..b1e69992c 100644 --- a/include/config.h +++ b/include/config.h @@ -427,8 +427,6 @@ typedef unsigned char uchar; #define SEDUCE /* Succubi/incubi seduction, by KAA, suggested by IM */ #define STEED /* Riding steeds */ #define TOURIST /* Tourist players with cameras and Hawaiian shirts */ -/* difficulty */ -#define ELBERETH /* Engraving the E-word repels monsters */ /* I/O */ #define REDO /* support for redoing last command - DGK */ #if !defined(MAC) diff --git a/include/extern.h b/include/extern.h index ac5fdb1ec..216b94e6f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -670,9 +670,7 @@ E void FDECL(cant_reach_floor, (int,int,BOOLEAN_P,BOOLEAN_P)); E const char *FDECL(surface, (int,int)); E const char *FDECL(ceiling, (int,int)); E struct engr *FDECL(engr_at, (XCHAR_P,XCHAR_P)); -#ifdef ELBERETH E int FDECL(sengr_at, (const char *,XCHAR_P,XCHAR_P)); -#endif E void FDECL(u_wipe_engr, (int)); E void FDECL(wipe_engr_at, (XCHAR_P,XCHAR_P,XCHAR_P)); E void FDECL(read_engr_at, (int,int)); diff --git a/include/you.h b/include/you.h index 50798acdb..b316abcf7 100644 --- a/include/you.h +++ b/include/you.h @@ -47,9 +47,7 @@ struct u_event { Bitfield(invoked,1); /* invoked Gate to the Sanctum level */ Bitfield(gehennom_entered,1); /* entered Gehennom via Valley */ -#ifdef ELBERETH Bitfield(uhand_of_elbereth,2); /* became Hand of Elbereth */ -#endif Bitfield(udemigod,1); /* killed the wiz */ Bitfield(uvibrated,1); /* stepped on "vibrating square" */ Bitfield(ascended,1); /* has offered the Amulet */ diff --git a/src/cmd.c b/src/cmd.c index eae24508c..3c8eff341 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1785,7 +1785,6 @@ int final; putstr(en_win, 0, ""); putstr(en_win, 0, final ? "Final Attributes:" : "Current Attributes:"); -#ifdef ELBERETH if (u.uevent.uhand_of_elbereth) { static const char * const hofe_titles[3] = { "the Hand of Elbereth", @@ -1794,7 +1793,6 @@ int final; }; you_are(hofe_titles[u.uevent.uhand_of_elbereth - 1],""); } -#endif /* note: piousness 20 matches MIN_QUEST_ALIGN (quest.h) */ if (u.ualign.record >= 20) you_are("piously aligned",""); diff --git a/src/engrave.c b/src/engrave.c index c4bdd4496..4af701654 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -244,7 +244,6 @@ xchar x, y; return((struct engr *) 0); } -#ifdef ELBERETH /* Decide whether a particular string is engraved at a specified * location; a case-insensitive substring match used. * Ignore headstones, in case the player names herself "Elbereth". @@ -259,7 +258,6 @@ sengr_at(s, x, y) return (ep && ep->engr_type != HEADSTONE && ep->engr_time <= moves && strstri(ep->engr_txt, s) != 0); } -#endif /* ELBERETH */ void u_wipe_engr(cnt) diff --git a/src/monmove.c b/src/monmove.c index 4b6ffc26f..a7e0da3d2 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -122,9 +122,7 @@ struct monst *mtmp; return(FALSE); return (boolean)(sobj_at(SCR_SCARE_MONSTER, x, y) || -#ifdef ELBERETH sengr_at("Elbereth", x, y) || -#endif (IS_ALTAR(levl[x][y].typ) && (mtmp->data->mlet == S_VAMPIRE || is_vampshifter(mtmp)))); diff --git a/src/pray.c b/src/pray.c index a6bd75ba4..602abee59 100644 --- a/src/pray.c +++ b/src/pray.c @@ -11,9 +11,7 @@ STATIC_DCL int NDECL(in_trouble); STATIC_DCL void FDECL(fix_worst_trouble,(int)); STATIC_DCL void FDECL(angrygods,(ALIGNTYP_P)); STATIC_DCL void FDECL(at_your_feet, (const char *)); -#ifdef ELBERETH STATIC_DCL void NDECL(gcrownu); -#endif /*ELBERETH*/ STATIC_DCL void FDECL(pleased,(ALIGNTYP_P)); STATIC_DCL void FDECL(godvoice,(ALIGNTYP_P,const char*)); STATIC_DCL void FDECL(god_zaps_you,(ALIGNTYP_P)); @@ -678,7 +676,6 @@ at_your_feet(str) } } -#ifdef ELBERETH STATIC_OVL void gcrownu() { @@ -830,7 +827,6 @@ gcrownu() add_weapon_skill(1); return; } -#endif /*ELBERETH*/ STATIC_OVL void pleased(g_align) @@ -1052,12 +1048,10 @@ pleased(g_align) } case 7: case 8: -#ifdef ELBERETH if (u.ualign.record >= PIOUS && !u.uevent.uhand_of_elbereth) { gcrownu(); break; } /* else FALLTHRU */ -#endif /*ELBERETH*/ case 6: { struct obj *otmp; int sp_no, trycnt = u.ulevel + 1; @@ -1090,9 +1084,7 @@ pleased(g_align) u.ublesscnt = rnz(350); kick_on_butt = u.uevent.udemigod ? 1 : 0; -#ifdef ELBERETH if (u.uevent.uhand_of_elbereth) kick_on_butt++; -#endif if (kick_on_butt) u.ublesscnt += kick_on_butt * rnz(1000); return; diff --git a/src/u_init.c b/src/u_init.c index 4e5927397..59ba3c23a 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -540,9 +540,7 @@ u_init() u.ublessed = 0; /* not worthy yet */ u.ugangr = 0; /* gods not angry */ u.ugifts = 0; /* no divine gifts bestowed */ -# ifdef ELBERETH u.uevent.uhand_of_elbereth = 0; -# endif u.uevent.uheard_tune = 0; u.uevent.uopened_dbridge = 0; u.uevent.udemigod = 0; /* not a demi-god yet... */ @@ -917,9 +915,7 @@ register struct trobj *trop; || otyp == nocreate2 || otyp == nocreate3 || otyp == nocreate4 -#ifdef ELBERETH || otyp == RIN_LEVITATION -#endif /* 'useless' items */ || otyp == POT_HALLUCINATION || otyp == POT_ACID diff --git a/util/makedefs.c b/util/makedefs.c index d84e1c7ea..dbedfe45b 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -961,8 +961,8 @@ do_rumors() */ #define IGNORED_FEATURES ( 0L \ | (1L << 12) /* GOLDOBJ */ \ - | (1L << 20) /* EXP_ON_BOTL */ \ - | (1L << 21) /* SCORE_ON_BOTL */ \ + | (1L << 19) /* EXP_ON_BOTL */ \ + | (1L << 20) /* SCORE_ON_BOTL */ \ | (1L << 27) /* ZEROCOMP */ \ | (1L << 28) /* RLECOMP */ \ ) @@ -1018,14 +1018,11 @@ make_version() #ifdef INSURANCE | (1L << 18) #endif -#ifdef ELBERETH +#ifdef EXP_ON_BOTL | (1L << 19) #endif -#ifdef EXP_ON_BOTL - | (1L << 20) -#endif #ifdef SCORE_ON_BOTL - | (1L << 21) + | (1L << 20) #endif /* data format (27..31) * External compression methods such as COMPRESS and ZLIB_COMP @@ -1257,9 +1254,6 @@ static const char *build_opts[] = { #ifdef DUNGEON_OVERVIEW "dungeon map overview patch", #endif -#ifdef ELBERETH - "Elbereth", -#endif #ifdef EXP_ON_BOTL "experience points on status line", #endif @@ -1684,9 +1678,6 @@ h_filter(line) skip = FALSE; #ifndef SINKS if (!strcmp(tag, "SINKS")) skip = TRUE; -#endif -#ifndef ELBERETH - if (!strcmp(tag, "ELBERETH")) skip = TRUE; #endif } else if (skip && !strncmp(line, "-----", 5)) skip = FALSE; From 9759f5bf6d9dc59e1911dbef5e584430ff4658d5 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 13 Feb 2015 21:23:56 -0500 Subject: [PATCH 122/354] Make STEED unconditional. --- include/config.h | 1 - include/display.h | 4 -- include/extern.h | 2 - include/hack.h | 2 - include/prop.h | 2 - include/rm.h | 4 -- include/skills.h | 4 -- include/you.h | 2 - include/youprop.h | 8 ---- src/allmain.c | 2 - src/apply.c | 42 +++--------------- src/artifact.c | 7 +-- src/attrib.c | 7 +-- src/ball.c | 5 +-- src/cmd.c | 17 +------- src/dig.c | 2 - src/display.c | 4 +- src/do.c | 22 ++-------- src/do_name.c | 10 ----- src/dog.c | 14 ------ src/dogmove.c | 16 ++----- src/dokick.c | 2 - src/dothrow.c | 2 - src/dungeon.c | 2 - src/eat.c | 12 +----- src/engrave.c | 2 - src/explode.c | 4 -- src/hack.c | 78 ++++++---------------------------- src/invent.c | 11 +---- src/lock.c | 12 +----- src/mhitm.c | 10 +---- src/mhitu.c | 12 +----- src/mon.c | 23 ++-------- src/mondata.c | 2 - src/objects.c | 4 -- src/objnam.c | 6 +-- src/pager.c | 2 - src/pickup.c | 4 -- src/pline.c | 7 +-- src/polyself.c | 2 - src/potion.c | 36 +++------------- src/pray.c | 10 +---- src/read.c | 5 +-- src/restore.c | 10 +---- src/save.c | 8 ---- src/shk.c | 18 +++----- src/sit.c | 2 - src/sounds.c | 12 +++--- src/steal.c | 40 ++++++++---------- src/steed.c | 5 --- src/teleport.c | 11 +---- src/timeout.c | 8 ---- src/trap.c | 101 +++----------------------------------------- src/u_init.c | 18 -------- src/uhitm.c | 20 ++------- src/weapon.c | 8 ---- src/wield.c | 16 ++----- src/worn.c | 6 --- src/zap.c | 18 +------- util/makedefs.c | 8 +--- win/gnome/gnmain.c | 2 - win/share/tilemap.c | 3 -- 62 files changed, 98 insertions(+), 641 deletions(-) diff --git a/include/config.h b/include/config.h index b1e69992c..715fc746a 100644 --- a/include/config.h +++ b/include/config.h @@ -425,7 +425,6 @@ typedef unsigned char uchar; /* monsters & objects */ #define KOPS /* Keystone Kops by Scott R. Turner */ #define SEDUCE /* Succubi/incubi seduction, by KAA, suggested by IM */ -#define STEED /* Riding steeds */ #define TOURIST /* Tourist players with cameras and Hawaiian shirts */ /* I/O */ #define REDO /* support for redoing last command - DGK */ diff --git a/include/display.h b/include/display.h index 59135b014..94ee1a15c 100644 --- a/include/display.h +++ b/include/display.h @@ -198,12 +198,8 @@ * Display the hero. It is assumed that all checks necessary to determine * _if_ the hero can be seen have already been done. */ -#ifdef STEED #define maybe_display_usteed (u.usteed && mon_visible(u.usteed)) ? \ ridden_mon_to_glyph(u.usteed) : -#else -#define maybe_display_usteed /* empty */ -#endif #define display_self() \ show_glyph(u.ux, u.uy, \ diff --git a/include/extern.h b/include/extern.h index 216b94e6f..866da61ec 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2205,7 +2205,6 @@ E struct obj *FDECL(findgold, (struct obj *)); /* ### steed.c ### */ -#ifdef STEED E void NDECL(rider_cant_reach); E boolean FDECL(can_saddle, (struct monst *)); E int FDECL(use_saddle, (struct obj *)); @@ -2217,7 +2216,6 @@ E void NDECL(kick_steed); E void FDECL(dismount_steed, (int)); E void FDECL(place_monster, (struct monst *,int,int)); E boolean FDECL(stucksteed, (BOOLEAN_P)); -#endif /* ### teleport.c ### */ diff --git a/include/hack.h b/include/hack.h index dc24bf8f9..c88d8dd56 100644 --- a/include/hack.h +++ b/include/hack.h @@ -38,7 +38,6 @@ #define BY_PAPER 2 #define BY_OTHER 9 -#ifdef STEED /* Macros for why you are no longer riding */ #define DISMOUNT_GENERIC 0 #define DISMOUNT_FELL 1 @@ -47,7 +46,6 @@ #define DISMOUNT_ENGULFED 4 #define DISMOUNT_BONES 5 #define DISMOUNT_BYCHOICE 6 -#endif /* Special returns from mapglyph() */ #define MG_CORPSE 0x01 diff --git a/include/prop.h b/include/prop.h index 810a730bc..2ca7b871d 100644 --- a/include/prop.h +++ b/include/prop.h @@ -114,9 +114,7 @@ struct prop { # define W_RINGR 0x00040000L /* Right ring */ # define W_RING (W_RINGL | W_RINGR) # define W_TOOL 0x00080000L /* Eyewear */ -#ifdef STEED # define W_SADDLE 0x00100000L /* KMH -- For riding monsters */ -#endif # define W_BALL 0x00200000L /* Punishment ball */ # define W_CHAIN 0x00400000L /* Punishment chain */ diff --git a/include/rm.h b/include/rm.h index 589ba619e..fbd7470cf 100644 --- a/include/rm.h +++ b/include/rm.h @@ -593,10 +593,6 @@ extern dlevel_t level; /* structure describing the current level */ !(level.monsters[x][y])->mburied) #define MON_BURIED_AT(x,y) (level.monsters[x][y] != (struct monst *)0 && \ (level.monsters[x][y])->mburied) -#ifndef STEED -#define place_monster(m,x,y) ((m)->mx=(x),(m)->my=(y),\ - level.monsters[(m)->mx][(m)->my]=(m)) -#endif #define place_worm_seg(m,x,y) level.monsters[x][y] = m #define remove_monster(x,y) level.monsters[x][y] = (struct monst *)0 #define m_at(x,y) (MON_AT(x,y) ? level.monsters[x][y] : \ diff --git a/include/skills.h b/include/skills.h index d2221e7fb..df5105e1b 100644 --- a/include/skills.h +++ b/include/skills.h @@ -68,12 +68,8 @@ #define P_BARE_HANDED_COMBAT 36 /* actually weaponless; gloves are ok */ #define P_MARTIAL_ARTS P_BARE_HANDED_COMBAT /* Role distinguishes */ #define P_TWO_WEAPON_COMBAT 37 /* Finally implemented */ -#ifdef STEED #define P_RIDING 38 /* How well you control your steed */ #define P_LAST_H_TO_H P_RIDING -#else -#define P_LAST_H_TO_H P_TWO_WEAPON_COMBAT -#endif #define P_FIRST_H_TO_H P_BARE_HANDED_COMBAT #define P_NUM_SKILLS (P_LAST_H_TO_H+1) diff --git a/include/you.h b/include/you.h index b316abcf7..c010abcb0 100644 --- a/include/you.h +++ b/include/you.h @@ -348,11 +348,9 @@ struct you { long usleep; /* sleeping; monstermove you last started */ int uinvault; struct monst *ustuck; -#ifdef STEED struct monst *usteed; long ugallop; int urideturns; -#endif int umortality; /* how many times you died */ int ugrave_arise; /* you die and become something aside from a ghost */ int weapon_slots; /* unused skill slots */ diff --git a/include/youprop.h b/include/youprop.h index 04c3349a3..a29e20bf8 100644 --- a/include/youprop.h +++ b/include/youprop.h @@ -229,13 +229,9 @@ #define HFlying u.uprops[FLYING].intrinsic #define EFlying u.uprops[FLYING].extrinsic #define BFlying u.uprops[FLYING].blocked -#ifdef STEED # define Flying ((HFlying || EFlying || \ (u.usteed && is_flyer(u.usteed->data))) && \ !BFlying) -#else -# define Flying ((HFlying || EFlying) && !BFlying) -#endif /* May touch surface; does not override any others */ #define Wwalking (u.uprops[WWALKING].extrinsic && \ @@ -245,12 +241,8 @@ #define HSwimming u.uprops[SWIMMING].intrinsic #define ESwimming u.uprops[SWIMMING].extrinsic /* [Tom] */ -#ifdef STEED # define Swimming (HSwimming || ESwimming || \ (u.usteed && is_swimmer(u.usteed->data))) -#else -# define Swimming (HSwimming || ESwimming) -#endif /* Get wet, don't go under water unless if amphibious */ #define HMagical_breathing u.uprops[MAGICAL_BREATHING].intrinsic diff --git a/src/allmain.c b/src/allmain.c index 51afc75f6..447aff1d8 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -118,12 +118,10 @@ boolean resuming; (void) makemon((struct permonst *)0, 0, 0, NO_MM_FLAGS); /* calculate how much time passed. */ -#ifdef STEED if (u.usteed && u.umoved) { /* your speed doesn't augment steed's speed */ moveamt = mcalcmove(u.usteed); } else -#endif { moveamt = youmonst.data->mmove; diff --git a/src/apply.c b/src/apply.c index fb97cc8fa..a5a38dd8a 100644 --- a/src/apply.c +++ b/src/apply.c @@ -302,7 +302,6 @@ use_stethoscope(obj) context.stethoscope_move = moves; context.stethoscope_movement = youmonst.movement; -#ifdef STEED if (u.usteed && u.dz > 0) { if (interference) { pline("%s interferes.", Monnam(u.ustuck)); @@ -311,7 +310,6 @@ use_stethoscope(obj) mstatusline(u.usteed); return res; } else -#endif if (u.uswallow && (u.dx || u.dy || u.dz)) { mstatusline(u.ustuck); return res; @@ -442,11 +440,9 @@ struct obj *obj; for(mtmp = fmon; mtmp; mtmp = nextmon) { nextmon = mtmp->nmon; /* trap might kill mon */ if (DEADMONSTER(mtmp)) continue; -#ifdef STEED /* steed is already at your location, so not affected; this avoids trap issues if you're on a trap location */ if (mtmp == u.usteed) continue; -#endif if (mtmp->mtame) { if (mtmp->mtrapped) { /* no longer in previous trap (affects mintrap) */ @@ -550,13 +546,11 @@ struct obj *obj; if(!get_adjacent_loc((char *)0, (char *)0, u.ux, u.uy, &cc)) return; if((cc.x == u.ux) && (cc.y == u.uy)) { -#ifdef STEED if (u.usteed && u.dz > 0) { mtmp = u.usteed; spotmon = 1; goto got_target; } -#endif pline("Leash yourself? Very funny..."); return; } @@ -567,9 +561,7 @@ struct obj *obj; } spotmon = canspotmon(mtmp); -#ifdef STEED got_target: -#endif if(!mtmp->mtame) { if(!spotmon) @@ -648,10 +640,8 @@ next_to_u() } } } -#ifdef STEED /* no pack mules for the Amulet */ if (u.usteed && mon_has_amulet(u.usteed)) return FALSE; -#endif return(TRUE); } @@ -1388,12 +1378,10 @@ int magic; /* 0=Physical, otherwise skill level */ } else if (!magic && !Jumping) { You_cant("jump very far."); return 0; -#ifdef STEED /* if steed is immobile, can't do physical jump but can do spell one */ } else if (!magic && u.usteed && stucksteed(FALSE)) { /* stucksteed gave " won't move" message */ return 0; -#endif } else if (u.uswallow) { if (magic) { You("bounce around a little."); @@ -1438,23 +1426,19 @@ int magic; /* 0=Physical, otherwise skill level */ const char *bp = body_part(LEG); if (wl == BOTH_SIDES) bp = makeplural(bp); -#ifdef STEED if (u.usteed) pline("%s is in no shape for jumping.", Monnam(u.usteed)); else -#endif - Your("%s%s %s in no shape for jumping.", - (wl == LEFT_SIDE) ? "left " : - (wl == RIGHT_SIDE) ? "right " : "", - bp, (wl == BOTH_SIDES) ? "are" : "is"); + Your("%s%s %s in no shape for jumping.", + (wl == LEFT_SIDE) ? "left " : + (wl == RIGHT_SIDE) ? "right " : "", + bp, (wl == BOTH_SIDES) ? "are" : "is"); return 0; } -#ifdef STEED else if (u.usteed && u.utrap) { pline("%s is stuck in a trap.", Monnam(u.usteed)); return (0); } -#endif pline("Where do you want to jump?"); cc.x = u.ux; @@ -2237,7 +2221,6 @@ struct obj *otmp; trapinfo.time_needed += (tmp > 12) ? 1 : (tmp > 7) ? 2 : 4; /*[fumbling and/or confusion and/or cursed object check(s) should be incorporated here instead of in set_trap]*/ -#ifdef STEED if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) { boolean chance; @@ -2267,7 +2250,6 @@ struct obj *otmp; return; } } -#endif You("begin setting %s%s.", shk_your(buf, otmp), defsyms[trap_to_defsym(what_trap(ttyp))].explanation); @@ -2369,19 +2351,13 @@ struct obj *obj; } else if ((!u.dx && !u.dy) || (u.dz > 0)) { int dam; -#ifdef STEED /* Sometimes you hit your steed by mistake */ if (u.usteed && !rn2(proficient + 2)) { You("whip %s!", mon_nam(u.usteed)); kick_steed(); return 1; } -#endif - if (Levitation -#ifdef STEED - || u.usteed -#endif - ) { + if (Levitation || u.usteed) { /* Have a shot at snaring something on the floor */ otmp = level.objects[u.ux][u.uy]; if (otmp && otmp->otyp == CORPSE && otmp->corpsenm == PM_HORSE) { @@ -3194,11 +3170,9 @@ doapply() case LEASH: use_leash(obj); break; -#ifdef STEED case SADDLE: res = use_saddle(obj); break; -#endif case MAGIC_WHISTLE: use_magic_whistle(obj); break; @@ -3336,11 +3310,7 @@ unfixable_trouble_count(is_horn) if (Stoned) unfixable_trbl++; if (Strangled) unfixable_trbl++; - if (Wounded_legs -#ifdef STEED - && !u.usteed -#endif - ) unfixable_trbl++; + if (Wounded_legs && !u.usteed) unfixable_trbl++; if (Slimed) unfixable_trbl++; /* lycanthropy is not desirable, but it doesn't actually make you feel bad */ diff --git a/src/artifact.c b/src/artifact.c index 088bc9c66..e9351ba92 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -1687,10 +1687,7 @@ long *abil; long wornbits; long wornmask = (W_ARM | W_ARMC | W_ARMH | W_ARMS | W_ARMG | W_ARMF | W_WEP | W_QUIVER | W_SWAPWEP | W_ART | W_ARTI | W_AMUL | - W_RINGL | W_RINGR | W_TOOL | W_BALL | W_CHAIN -#ifdef STEED - | W_SADDLE -#endif + W_RINGL | W_RINGR | W_TOOL | W_BALL | W_CHAIN | W_SADDLE #ifdef TOURIST | W_ARMU #endif @@ -1868,7 +1865,6 @@ int dropflag; /* 0==don't drop, 1==drop all, 2==drop weapon */ /* check primary weapon next so that they're handled together */ if (uwep) (void)untouchable(uwep, dropit); -#ifdef STEED /* in case someone is daft enough to add artifact or silver saddle */ if (u.usteed && (obj = which_armor(u.usteed, W_SADDLE)) != 0) { /* untouchable() calls retouch_object() which expects an object in @@ -1876,7 +1872,6 @@ int dropflag; /* 0==don't drop, 1==drop all, 2==drop weapon */ saddle and we're suppressing drop, so this works as intended */ if (untouchable(obj, FALSE)) dismount_steed(DISMOUNT_THROWN); } -#endif /* * TODO? Force off gloves if either or both rings are going to * become unworn; force off cloak [suit] before suit [shirt]. diff --git a/src/attrib.c b/src/attrib.c index 0c8ae76a8..15377c76c 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -440,11 +440,8 @@ exerper() if(Sick || Vomiting) exercise(A_CON, FALSE); if(Confusion || Hallucination) exercise(A_WIS, FALSE); - if((Wounded_legs -#ifdef STEED - && !u.usteed -#endif - ) || Fumbling || HStun) exercise(A_DEX, FALSE); + if((Wounded_legs && !u.usteed) || Fumbling || HStun) + exercise(A_DEX, FALSE); } } diff --git a/src/ball.c b/src/ball.c index 78aee97a0..b3513f7b5 100644 --- a/src/ball.c +++ b/src/ball.c @@ -692,10 +692,7 @@ xchar x, y; register long side = rn2(3) ? LEFT_SIDE : RIGHT_SIDE; pline(pullmsg, "bear trap"); set_wounded_legs(side, rn1(1000, 500)); -#ifdef STEED - if (!u.usteed) -#endif - { + if (!u.usteed) { Your("%s %s is severely damaged.", (side == LEFT_SIDE) ? "left" : "right", body_part(LEG)); diff --git a/src/cmd.c b/src/cmd.c index 3c8eff341..78981c274 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1528,7 +1528,6 @@ int final; boolean magic = (mode & MAGICENLIGHTENMENT) ? TRUE : FALSE; int cap; char buf[BUFSZ], youtoo[BUFSZ]; -#ifdef STEED boolean Riding = (u.usteed && /* if hero dies while dismounting, u.usteed will still be set; we want to ignore steed in that situation */ @@ -1540,7 +1539,6 @@ int final; (char *)0, (SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION), FALSE); -#endif /*\ * Status (many are abbreviated on bottom line; others are or @@ -1553,7 +1551,6 @@ int final; /* not a traditional status but inherently obvious to player; more detail given below (attributes section) for magic enlightenment */ if (Upolyd) you_are("transformed", ""); -#ifdef STEED /* not a trouble, but we want to display riding status before maybe reporting steed as trapped or hero stuck to cursed saddle */ if (Riding) { @@ -1561,7 +1558,6 @@ int final; you_are(buf, ""); Sprintf(eos(youtoo), "and %s ", steedname); } -#endif /*STEED*/ /* other movement situations that hero should always know */ if (Levitation) { if (Lev_at_will && magic) @@ -1639,14 +1635,12 @@ int final; Sprintf(eos(predicament), " in %s", an(defsyms[trap_to_defsym(t->ttyp)].explanation)); } -#ifdef STEED if (u.usteed) { /* not `Riding' here */ Sprintf(buf, "%s%s ", anchored ? "you and " : "", steedname); *buf = highc(*buf); enl_msg(buf, (anchored ? "are " : "is "), (anchored ? "were " : "was "), predicament, ""); } else -#endif /*STEED*/ you_are(predicament, ""); } /* (u.utrap) */ if (u.uswallow) { @@ -1661,7 +1655,6 @@ int final; a_monnam(u.ustuck)); you_are(buf, ""); } -#ifdef STEED if (Riding) { struct obj *saddle = which_armor(u.usteed, W_SADDLE); @@ -1671,9 +1664,7 @@ int final; you_are(buf, ""); } } -#endif /*STEED*/ if (Wounded_legs) { -#ifdef STEED /* when mounted, Wounded_legs applies to steed rather than to hero; we only report steed's wounded legs in wizard mode */ if (u.usteed) { /* not `Riding' here */ @@ -1684,9 +1675,7 @@ int final; enl_msg(buf, " has", " had", " wounded legs", ""); } # endif - } else -#endif /*STEED*/ - { + } else { Sprintf(buf, "wounded %s", makeplural(body_part(LEG))); you_have(buf, ""); } @@ -2474,9 +2463,7 @@ static const struct func_tab cmdlist[] = { {'r', FALSE, doread}, {'R', FALSE, doremring}, {M('r'), FALSE, dorub}, -#ifdef STEED {M('R'), FALSE, doride}, /* #ride */ -#endif {'s', TRUE, dosearch, "searching"}, {'S', TRUE, dosave}, {M('s'), FALSE, dosit}, @@ -2553,9 +2540,7 @@ struct ext_func_tab extcmdlist[] = { #endif /* DUNGEON_OVERVIEW */ {"pray", "pray to the gods for help", dopray, TRUE}, {"quit", "exit without saving current game", done2, TRUE}, -#ifdef STEED {"ride", "ride (or stop riding) a monster", doride, FALSE}, -#endif {"rub", "rub a lamp or a stone", dorub, FALSE}, {"sit", "sit down", dosit, FALSE}, {"terrain", "show map without obstructions", doterrain, TRUE}, diff --git a/src/dig.c b/src/dig.c index 382676865..ae4571218 100644 --- a/src/dig.c +++ b/src/dig.c @@ -250,13 +250,11 @@ dig(VOID_ARGS) You("fumble and drop %s.", yname(uwep)); dropx(uwep); } else { -#ifdef STEED if (u.usteed) pline("%s and %s %s!", Yobjnam2(uwep, "bounce"), otense(uwep, "hit"), mon_nam(u.usteed)); else -#endif pline("Ouch! %s and %s you!", Yobjnam2(uwep, "bounce"), otense(uwep, "hit")); set_wounded_legs(RIGHT_SIDE, 5 + rnd(5)); diff --git a/src/display.c b/src/display.c index 8da9af9fe..263dd853a 100644 --- a/src/display.c +++ b/src/display.c @@ -1126,11 +1126,9 @@ see_monsters() warn_obj_cnt = new_warn_obj_cnt; } -#ifdef STEED /* when mounted, hero's location gets caught by monster loop */ if (!u.usteed) -#endif - newsym(u.ux, u.uy); + newsym(u.ux, u.uy); } /* diff --git a/src/do.c b/src/do.c index 6ad4985da..1f51c14cc 100644 --- a/src/do.c +++ b/src/do.c @@ -80,11 +80,9 @@ boolean pushing; char whobuf[BUFSZ]; Strcpy(whobuf, "you"); -#ifdef STEED if (u.usteed) Strcpy(whobuf, y_monnam(u.usteed)); -#endif - pline("%s %s %s into the %s.", upstart(whobuf), - vtense(whobuf, "push"), the(xname(otmp)), what); + pline("%s %s %s into the %s.", upstart(whobuf), + vtense(whobuf, "push"), the(xname(otmp)), what); if (flags.verbose && !Blind) pline("Now you can cross it!"); /* no splashing in this case */ @@ -434,14 +432,12 @@ register const char *word; body_part(HAND)); return(FALSE); } -#ifdef STEED if (obj->owornmask & W_SADDLE) { if (*word) You("cannot %s %s you are sitting on.", word, something); return (FALSE); } -#endif return(TRUE); } @@ -801,11 +797,9 @@ dodown() return 1; } -#ifdef STEED if (stucksteed(TRUE)) { return 0; } -#endif /* Levitation might be blocked, but player can still use '>' to turn off controlled levitaiton */ if (HLevitation || ELevitation) { @@ -924,11 +918,9 @@ doup() You_cant("go up here."); return(0); } -#ifdef STEED if (stucksteed(TRUE)) { return(0); } -#endif if(u.ustuck) { You("are %s, and cannot go up.", !u.uswallow ? "being held" : is_animal(u.ustuck->data) ? @@ -1267,12 +1259,10 @@ boolean at_stairs, falling, portal; freeinv(uball); } } -#ifdef STEED /* falling off steed has its own losehp() call */ if (u.usteed) dismount_steed(DISMOUNT_FELL); else -#endif losehp(Maybe_Half_Phys(rnd(3)), at_ladder ? "falling off a ladder" : "tumbling down a flight of stairs", @@ -1305,11 +1295,7 @@ boolean at_stairs, falling, portal; initrack(); - if ((mtmp = m_at(u.ux, u.uy)) != 0 -#ifdef STEED - && mtmp != u.usteed -#endif - ) { + if ((mtmp = m_at(u.ux, u.uy)) != 0 && mtmp != u.usteed) { /* There's a monster at your target destination; it might be one which accompanied you--see mon_arrive(dogmove.c)--or perhaps it was already here. Randomly move you to an adjacent spot @@ -1746,9 +1732,7 @@ heal_legs() context.botl = 1; } -#ifdef STEED if (!u.usteed) -#endif { const char *legs = body_part(LEG); diff --git a/src/do_name.c b/src/do_name.c index 0c459bd50..ea5b64b8b 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -329,20 +329,16 @@ do_mname() cy = cc.y; if (cx == u.ux && cy == u.uy) { -#ifdef STEED if (u.usteed && canspotmon(u.usteed)) mtmp = u.usteed; else { -#endif pline("This %s creature is called %s and cannot be renamed.", ACURR(A_CHA) > 14 ? (flags.female ? "beautiful" : "handsome") : "ugly", plname); return; -#ifdef STEED } -#endif } else mtmp = m_at(cx, cy); @@ -678,9 +674,7 @@ boolean called; do_it = !canspotmon(mtmp) && article != ARTICLE_YOUR && !program_state.gameover && -#ifdef STEED mtmp != u.usteed && -#endif !(u.uswallow && mtmp == u.ustuck) && !(suppress & SUPPRESS_IT); do_saddle = !(suppress & SUPPRESS_SADDLE); @@ -746,11 +740,9 @@ boolean called; Strcat(strcat(buf, adjective), " "); if (do_invis) Strcat(buf, "invisible "); -#ifdef STEED if (do_saddle && (mtmp->misc_worn_check & W_SADDLE) && !Blind && !Hallucination) Strcat(buf, "saddled "); -#endif if (buf[0] != 0) has_adjectives = TRUE; else @@ -898,10 +890,8 @@ struct monst *mtmp; prefix = mtmp->mtame ? ARTICLE_YOUR : ARTICLE_THE; suppression_flag = (has_mname(mtmp) -#ifdef STEED /* "saddled" is redundant when mounted */ || mtmp == u.usteed -#endif ) ? SUPPRESS_SADDLE : 0; return x_monnam(mtmp, prefix, (char *)0, suppression_flag, FALSE); diff --git a/src/dog.c b/src/dog.c index 0a0162e61..fa9d1f99a 100644 --- a/src/dog.c +++ b/src/dog.c @@ -148,9 +148,7 @@ struct monst * makedog() { register struct monst *mtmp; -#ifdef STEED register struct obj *otmp; -#endif const char *petname; int pettype; static int petname_used = 0; @@ -179,7 +177,6 @@ makedog() if(!mtmp) return((struct monst *) 0); /* pets were genocided */ context.startingpet_mid = mtmp->m_id; -#ifdef STEED /* Horses already wear a saddle */ if (pettype == PM_PONY && !!(otmp = mksobj(SADDLE, TRUE, FALSE))) { if (mpickobj(mtmp, otmp)) @@ -190,7 +187,6 @@ makedog() otmp->leashmon = mtmp->m_id; update_mon_intrinsics(mtmp, otmp, TRUE, TRUE); } -#endif if (!petname_used++ && *petname) mtmp = christen_monst(mtmp, petname); @@ -323,10 +319,8 @@ boolean with_you; mtmp->mtrack[0].x = mtmp->mtrack[0].y = 0; mtmp->mtrack[1].x = mtmp->mtrack[1].y = 0; -#ifdef STEED if (mtmp == u.usteed) return; /* don't place steed on the map */ -#endif if (with_you) { /* When a monster accompanies you, sometimes it will arrive at your intended destination and you'll end up next to @@ -575,24 +569,20 @@ boolean pets_only; /* true for ascension or final escape */ only if in range. -3. */ (u.uhave.amulet && mtmp->iswiz)) && ((!mtmp->msleeping && mtmp->mcanmove) -#ifdef STEED /* eg if level teleport or new trap, steed has no control to avoid following */ || (mtmp == u.usteed) -#endif ) /* monster won't follow if it hasn't noticed you yet */ && !(mtmp->mstrategy & STRAT_WAITFORU)) { stay_behind = FALSE; if (mtmp->mtrapped) (void)mintrap(mtmp); /* try to escape */ -#ifdef STEED if (mtmp == u.usteed) { /* make sure steed is eligible to accompany hero */ mtmp->mtrapped = 0; /* escape trap */ mtmp->meating = 0; /* terminate eating */ mdrop_special_objs(mtmp); /* drop Amulet */ } else -#endif if (mtmp->meating || mtmp->mtrapped) { if (canseemon(mtmp)) pline("%s is still %s.", Monnam(mtmp), @@ -612,14 +602,12 @@ boolean pets_only; /* true for ascension or final escape */ : "Its"); m_unleash(mtmp, FALSE); } -#ifdef STEED if (mtmp == u.usteed) { /* can't happen unless someone makes a change which scrambles the stay_behind logic above */ impossible("steed left behind?"); dismount_steed(DISMOUNT_GENERIC); } -#endif continue; } if (mtmp->isshk) @@ -980,9 +968,7 @@ boolean was_dead; /* a life-saved monster might be leashed; don't leave it that way if it's no longer tame */ if (mtmp->mleashed) m_unleash(mtmp, TRUE); -#ifdef STEED if (mtmp == u.usteed) dismount_steed(DISMOUNT_THROWN); -#endif } else if (edog) { /* it's still a pet; start a clean pet-slate now */ edog->revivals++; diff --git a/src/dogmove.c b/src/dogmove.c index a56ad1066..6baa47651 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -354,11 +354,7 @@ register struct edog *edog; stop_occupation(); } else if (monstermoves > edog->hungrytime + 750 || mtmp->mhp < 1) { dog_died: - if (mtmp->mleashed -#ifdef STEED - && mtmp != u.usteed -#endif - ) + if (mtmp->mleashed && mtmp != u.usteed) Your("leash goes slack."); else if (cansee(mtmp->mx, mtmp->my)) pline("%s starves.", Monnam(mtmp)); @@ -453,11 +449,9 @@ int after, udist, whappr; xchar otyp; int appr; -#ifdef STEED /* Steeds don't move on their own will */ if (mtmp == u.usteed) return (-2); -#endif omx = mtmp->mx; omy = mtmp->my; @@ -626,7 +620,6 @@ register int after; /* this is extra fast monster movement */ if (has_edog && dog_hunger(mtmp, edog)) return(2); /* starved */ udist = distu(omx,omy); -#ifdef STEED /* Let steeds eat and maybe throw rider during Conflict */ if (mtmp == u.usteed) { if (Conflict && !resist(mtmp, RING_CLASS, 0, 0)) { @@ -634,10 +627,9 @@ register int after; /* this is extra fast monster movement */ return (1); } udist = 1; - } else -#endif - /* maybe we tamed him while being swallowed --jgm */ - if (!udist) return(0); + } else if (!udist) + /* maybe we tamed him while being swallowed --jgm */ + return(0); nix = omx; /* set before newdogpos */ niy = omy; diff --git a/src/dokick.c b/src/dokick.c index 424aa6fa1..1b122e799 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -716,7 +716,6 @@ dokick() } else if (verysmall(youmonst.data)) { You("are too small to do any kicking."); no_kick = TRUE; -#ifdef STEED } else if (u.usteed) { if (yn_function("Kick your steed?", ynchars, 'y') == 'y') { You("kick %s.", mon_nam(u.usteed)); @@ -725,7 +724,6 @@ dokick() } else { return 0; } -#endif } else if (Wounded_legs) { /* note: jump() has similar code */ long wl = (EWounded_legs & BOTH_SIDES); diff --git a/src/dothrow.c b/src/dothrow.c index ebd7c97e8..953ff1e35 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -1002,13 +1002,11 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */ u.twoweap = twoweap; } else if (u.dz < 0) { (void) toss_up(obj, rn2(5) && !Underwater); -#ifdef STEED } else if (u.dz > 0 && u.usteed && obj->oclass == POTION_CLASS && rn2(6)) { /* alternative to prayer or wand of opening/spell of knock for dealing with cursed saddle: throw holy water > */ potionhit(u.usteed, obj, TRUE); -#endif } else { hitfloor(obj); } diff --git a/src/dungeon.c b/src/dungeon.c index d9348183c..d87faa15e 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -1148,10 +1148,8 @@ int x, y; #ifdef CLIPPING cliparound(u.ux, u.uy); #endif -#ifdef STEED /* ridden steed always shares hero's location */ if (u.usteed) u.usteed->mx = u.ux, u.usteed->my = u.uy; -#endif /* when changing levels, don't leave old position set with stale values from previous level */ if (!on_level(&u.uz, &u.uz0)) u.ux0 = u.ux, u.uy0 = u.uy; diff --git a/src/eat.c b/src/eat.c index 5b5d1f38e..37561967b 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1017,10 +1017,8 @@ register int pm; u.uconduct.polyselfs++; /* you're changing form */ You_cant("resist the temptation to mimic %s.", Hallucination ? "an orange" : "a pile of gold"); -#ifdef STEED /* A pile of gold can't ride. */ if (u.usteed) dismount_steed(DISMOUNT_FELL); -#endif nomul(-tmp); Sprintf(buf, Hallucination ? "You suddenly dread being peeled and mimic %s again!" : @@ -1540,9 +1538,7 @@ struct obj *obj; what = "you lose control of", where = "yourself"; else what = "you slap against the", where = -#ifdef STEED (u.usteed) ? "saddle" : -#endif surface(u.ux,u.uy); pline_The("world spins and %s %s.", what, where); incr_itimeout(&HDeaf, duration); @@ -2337,11 +2333,7 @@ doeat() /* generic "eat" command funtion (see cmd.c) */ } else if (!is_edible(otmp)) { You("cannot eat that!"); return 0; - } else if ((otmp->owornmask & (W_ARMOR|W_TOOL|W_AMUL -#ifdef STEED - |W_SADDLE -#endif - )) != 0) { + } else if ((otmp->owornmask & (W_ARMOR|W_TOOL|W_AMUL|W_SADDLE)) != 0) { /* let them eat rings */ You_cant("eat %s you're wearing.", something); return 0; @@ -2844,9 +2836,7 @@ floorfood(verb,corpsecheck) /* get food from floor or pack */ /* if we can't touch floor objects then use invent food only */ if (!can_reach_floor(TRUE) || -#ifdef STEED (feeding && u.usteed) || /* can't eat off floor while riding */ -#endif (is_pool_or_lava(u.ux, u.uy) && (Wwalking || is_clinger(youmonst.data) || (Flying && !Breathless)))) diff --git a/src/engrave.c b/src/engrave.c index 4af701654..8ba7217ba 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -140,10 +140,8 @@ boolean check_pit; struct trap *t; if (u.uswallow) return FALSE; -#ifdef STEED /* Restricted/unskilled riders can't reach the floor */ if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) return FALSE; -#endif if (check_pit && (t = t_at(u.ux, u.uy)) != 0 && uteetering_at_seen_pit(t) && !Flying) return FALSE; diff --git a/src/explode.c b/src/explode.c index 54855f70a..65dbe82a5 100644 --- a/src/explode.c +++ b/src/explode.c @@ -167,10 +167,8 @@ int expltype; } /* can be both you and mtmp if you're swallowed */ mtmp = m_at(i+x-1, j+y-1); -#ifdef STEED if (!mtmp && i+x-1 == u.ux && j+y-1 == u.uy) mtmp = u.usteed; -#endif if (mtmp) { if (mtmp->mhp < 1) explmask[i][j] = 2; else switch(adtyp) { @@ -275,10 +273,8 @@ int expltype; type, &shopdamage, exploding_wand_typ); mtmp = m_at(i+x-1, j+y-1); -#ifdef STEED if (!mtmp && i+x-1 == u.ux && j+y-1 == u.uy) mtmp = u.usteed; -#endif if (!mtmp) continue; if (do_hallu) { /* replace "gas spore" with a different description diff --git a/src/hack.c b/src/hack.c index bcb3da1ad..fc62e71a4 100644 --- a/src/hack.c +++ b/src/hack.c @@ -118,11 +118,7 @@ moverock() /* Give them a chance to climb over it? */ return -1; } - if (verysmall(youmonst.data) -#ifdef STEED - && !u.usteed -#endif - ) { + if (verysmall(youmonst.data) && !u.usteed) { if (Blind) feel_location(sx, sy); pline("You're too small to push that %s.", xname(otmp)); goto cannot_push; @@ -159,10 +155,7 @@ moverock() } if (flags.verbose) pline("Perhaps that's why %s cannot move it.", -#ifdef STEED - u.usteed ? y_monnam(u.usteed) : -#endif - "you"); + u.usteed ? y_monnam(u.usteed) : "you"); goto cannot_push; } @@ -231,13 +224,11 @@ moverock() /* trap didn't work; skip "disappears" message */ goto dopush; } -#ifdef STEED if (u.usteed) - pline("%s pushes %s and suddenly it disappears!", - upstart(y_monnam(u.usteed)), the(xname(otmp))); + pline("%s pushes %s and suddenly it disappears!", + upstart(y_monnam(u.usteed)), the(xname(otmp))); else -#endif - You("push %s and suddenly it disappears!", + You("push %s and suddenly it disappears!", the(xname(otmp))); if (ttmp->ttyp == TELEP_TRAP) { (void)rloco(otmp); @@ -279,19 +270,15 @@ moverock() static NEARDATA long lastmovetime; #endif dopush: -#ifdef STEED if (!u.usteed) { -#endif if (moves > lastmovetime+2 || moves < lastmovetime) pline("With %s effort you move %s.", throws_rocks(youmonst.data) ? "little" : "great", the(xname(otmp))); exercise(A_STR, TRUE); -#ifdef STEED } else pline("%s moves %s.", upstart(y_monnam(u.usteed)), the(xname(otmp))); -#endif lastmovetime = moves; } @@ -307,24 +294,19 @@ moverock() } } else { nopushmsg: -#ifdef STEED if (u.usteed) pline("%s tries to move %s, but cannot.", upstart(y_monnam(u.usteed)), the(xname(otmp))); else -#endif You("try to move %s, but in vain.", the(xname(otmp))); if (Blind) feel_location(sx, sy); cannot_push: if (throws_rocks(youmonst.data)) { -#ifdef STEED if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) { You("aren't skilled enough to %s %s from %s.", (flags.pickup && !Sokoban) ? "pick up" : "push aside", the(xname(otmp)), y_monnam(u.usteed)); - } else -#endif - { + } else { pline("However, you can easily %s.", (flags.pickup && !Sokoban) ? "pick it up" : "push it aside"); @@ -334,11 +316,7 @@ moverock() break; } - if ( -#ifdef STEED - !u.usteed && -#endif - (((!invent || inv_weight() <= -850) && + if (!u.usteed && (((!invent || inv_weight() <= -850) && (!u.dx || !u.dy || (IS_ROCK(levl[u.ux][sy].typ) && IS_ROCK(levl[sx][u.uy].typ)))) || verysmall(youmonst.data))) { @@ -693,13 +671,10 @@ int mode; You("try to ooze under the door, but can't squeeze your possessions through."); else if (x == ux || y == uy) { if (Blind || Stunned || ACURR(A_DEX) < 10 || Fumbling) { -#ifdef STEED if (u.usteed) { You_cant("lead %s through that closed door.", y_monnam(u.usteed)); - } else -#endif - { + } else { pline("Ouch! You bump into a door."); exercise(A_DEX, FALSE); } @@ -1001,9 +976,7 @@ struct trap *desttrap; /* nonnull if another trap at */ { boolean anchored; const char *predicament, *culprit; -#ifdef STEED char *steedname = !u.usteed ? (char *)0 : y_monnam(u.usteed); -#endif if (!u.utrap) return TRUE; /* sanity check */ @@ -1011,11 +984,9 @@ struct trap *desttrap; /* nonnull if another trap at */ case TT_BEARTRAP: if (flags.verbose) { predicament = "caught in a bear trap"; -#ifdef STEED if (u.usteed) Norep("%s is %s.", upstart(steedname), predicament); else -#endif Norep("You are %s.", predicament); } /* [why does diagonal movement give quickest escape?] */ @@ -1037,41 +1008,33 @@ struct trap *desttrap; /* nonnull if another trap at */ if (--u.utrap) { if (flags.verbose) { predicament = "stuck to the web"; -#ifdef STEED if (u.usteed) - Norep("%s is %s.", upstart(steedname), predicament); + Norep("%s is %s.", upstart(steedname), predicament); else -#endif - Norep("You are %s.", predicament); + Norep("You are %s.", predicament); } } else { -#ifdef STEED if (u.usteed) pline("%s breaks out of the web.", upstart(steedname)); else -#endif You("disentangle yourself."); } break; case TT_LAVA: if (flags.verbose) { predicament = "stuck in the lava"; -#ifdef STEED if (u.usteed) Norep("%s is %s.", upstart(steedname), predicament); else -#endif Norep("You are %s.", predicament); } if (!is_lava(x, y)) { u.utrap--; if ((u.utrap & 0xff) == 0) { u.utrap = 0; -#ifdef STEED if (u.usteed) You("lead %s to the edge of the lava.", steedname); else -#endif You("pull yourself to the edge of the lava."); } } @@ -1106,7 +1069,6 @@ struct trap *desttrap; /* nonnull if another trap at */ predicament = "stuck in the"; culprit = surface(u.ux, u.uy); } -#ifdef STEED if (u.usteed) { if (anchored) Norep("You and %s are %s %s.", steedname, @@ -1115,16 +1077,13 @@ struct trap *desttrap; /* nonnull if another trap at */ Norep("%s is %s %s.", upstart(steedname), predicament, culprit); } else -#endif - Norep("You are %s %s.", predicament, culprit); + Norep("You are %s %s.", predicament, culprit); } } else { -#ifdef STEED if (u.usteed) pline("%s finally %s free.", upstart(steedname), !anchored ? "lurches" : "wrenches the ball"); else -#endif You("finally %s free.", !anchored ? "wriggle" : "wrench the ball"); if (anchored) @@ -1419,12 +1378,10 @@ domove() newsym(x, y); } /* not attacking an animal, so we try to move */ -#ifdef STEED if ((u.dx || u.dy) && u.usteed && stucksteed(FALSE)) { nomul(0); return; } -#endif if(!youmonst.data->mmove) { You("are rooted %s.", Levitation || Is_airlevel(&u.uz) || Is_waterlevel(&u.uz) ? @@ -1456,14 +1413,12 @@ domove() mtmp = m_at(x, y); u.ux += u.dx; u.uy += u.dy; -#ifdef STEED /* Move your steed, too */ if (u.usteed) { u.usteed->mx = u.ux; u.usteed->my = u.uy; exercise_steed(); } -#endif /* * If safepet at destination then move the pet to the hero's @@ -1662,11 +1617,8 @@ invocation_message() struct obj *otmp = carrying(CANDELABRUM_OF_INVOCATION); nomul(0); /* stop running or travelling */ -#ifdef STEED if (u.usteed) Sprintf(buf, "beneath %s", y_monnam(u.usteed)); - else -#endif - if (Levitation || Flying) Strcpy(buf, "beneath you"); + else if (Levitation || Flying) Strcpy(buf, "beneath you"); else Sprintf(buf, "under your %s", makeplural(body_part(FOOT))); You_feel("a strange vibration %s.", buf); @@ -1752,7 +1704,6 @@ boolean newspot; /* true if called by spoteffects */ /* check for entering water or lava */ if (!u.ustuck && !Levitation && !Flying && is_pool_or_lava(u.ux, u.uy)) { -#ifdef STEED if (u.usteed && (is_flyer(u.usteed->data) || is_floater(u.usteed->data) || is_clinger(u.usteed->data))) { /* floating or clinging steed keeps hero safe (is_flyer() test @@ -1770,7 +1721,6 @@ boolean newspot; /* true if called by spoteffects */ return TRUE; } /* not mounted */ -#endif /* STEED */ /* drown(),lava_effects() return true if hero changes location while surviving the problem */ @@ -2266,10 +2216,8 @@ dopickup() if (!can_reach_floor(TRUE)) { if (traphere && uteetering_at_seen_pit(traphere)) You("cannot reach the bottom of the pit."); -#ifdef STEED else if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) rider_cant_reach(); -#endif else if (Blind && !can_reach_floor(TRUE)) You("cannot reach anything here."); else @@ -2578,9 +2526,7 @@ weight_cap() } if (Levitation || Is_airlevel(&u.uz) /* pugh@cornell */ -#ifdef STEED || (u.usteed && strongmonst(u.usteed->data)) -#endif ) carrcap = MAX_CARR_CAP; else { diff --git a/src/invent.c b/src/invent.c index 12847bc7f..c6eea5989 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1252,10 +1252,7 @@ is_worn(otmp) register struct obj *otmp; { return((boolean)(!!(otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL | -#ifdef STEED - W_SADDLE | -#endif - W_WEP | W_SWAPWEP | W_QUIVER)))); + W_SADDLE | W_WEP | W_SWAPWEP | W_QUIVER)))); } /* extra xprname() input that askchain() can't pass through safe_qbuf() */ @@ -2803,11 +2800,7 @@ STATIC_OVL boolean tool_in_use(obj) struct obj *obj; { - if ((obj->owornmask & (W_TOOL -#ifdef STEED - | W_SADDLE -#endif - )) != 0L) return TRUE; + if ((obj->owornmask & (W_TOOL | W_SADDLE)) != 0L) return TRUE; if (obj->oclass != TOOL_CLASS) return FALSE; return (boolean)(obj == uwep || obj->lamplit || (obj->otyp == LEASH && obj->leashmon)); diff --git a/src/lock.c b/src/lock.c index 45be156f6..6e20e20e6 100644 --- a/src/lock.c +++ b/src/lock.c @@ -749,19 +749,11 @@ doclose() /* try to close a door */ } if(door->doormask == D_ISOPEN) { - if(verysmall(youmonst.data) -#ifdef STEED - && !u.usteed -#endif - ) { + if(verysmall(youmonst.data) && !u.usteed) { pline("You're too small to push the door closed."); return res; } - if ( -#ifdef STEED - u.usteed || -#endif - rn2(25) < (ACURRSTR+ACURR(A_DEX)+ACURR(A_CON))/3) { + if ( u.usteed || rn2(25) < (ACURRSTR+ACURR(A_DEX)+ACURR(A_CON))/3) { pline_The("door closes."); door->doormask = D_CLOSED; if (Blind) diff --git a/src/mhitm.c b/src/mhitm.c index 969a50458..a749cfd4d 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -405,12 +405,10 @@ mattackm(magr, mdef) break; case AT_ENGL: -#ifdef STEED if (u.usteed && (mdef == u.usteed)) { strike = 0; break; } -#endif /* Engulfing attacks are directed at the hero if * possible. -dlc */ @@ -956,11 +954,7 @@ mdamagem(magr, mdef, mattk) if (vis) Strcpy(mdef_Monnam, Monnam(mdef)); mdef->mstrategy &= ~STRAT_WAITFORU; (void) rloc(mdef, FALSE); - if (vis && !canspotmon(mdef) -#ifdef STEED - && mdef != u.usteed -#endif - ) + if (vis && !canspotmon(mdef) && mdef != u.usteed) pline("%s suddenly disappears!", mdef_Monnam); } break; @@ -1117,12 +1111,10 @@ mdamagem(magr, mdef, mattk) Strcpy(mdefnambuf, x_monnam(mdef, ARTICLE_THE, (char *)0, 0, FALSE)); otmp = obj; -#ifdef STEED if (u.usteed == mdef && otmp == which_armor(mdef, W_SADDLE)) /* "You can no longer ride ." */ dismount_steed(DISMOUNT_POLY); -#endif obj_extract_self(otmp); if (otmp->owornmask) { mdef->misc_worn_check &= ~otmp->owornmask; diff --git a/src/mhitu.c b/src/mhitu.c index 0a85b86a7..cf5f68bcd 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -323,7 +323,6 @@ mattacku(mtmp) if(u.uinvulnerable) return (0); /* stomachs can't hurt you! */ } -#ifdef STEED else if (u.usteed) { if (mtmp == u.usteed) /* Your steed won't attack you */ @@ -343,7 +342,6 @@ mattacku(mtmp) return (!!(mattackm(u.usteed, mtmp) & MM_DEF_DIED)); } } -#endif if (u.uundetected && !range2 && foundyou && !u.uswallow) { if (!canspotmon(mtmp)) map_invisible(mtmp->mx, mtmp->my); @@ -1145,11 +1143,7 @@ dopois: * still _can_ attack you when you're flying or mounted. * [FIXME: why can't a flying attacker overcome this?] */ - if ( -#ifdef STEED - u.usteed || -#endif - Levitation || Flying) { + if (u.usteed || Levitation || Flying) { pline("%s tries to reach your %s %s!", Monnam(mtmp), sidestr, body_part(LEG)); dmg = 0; @@ -1664,7 +1658,6 @@ gulpmu(mtmp, mattk) /* monster swallows you, or damage if u.uswallow */ place_monster(mtmp, u.ux, u.uy); u.ustuck = mtmp; newsym(mtmp->mx,mtmp->my); -#ifdef STEED if (is_animal(mtmp->data) && u.usteed) { char buf[BUFSZ]; /* Too many quirks presently if hero and steed @@ -1676,8 +1669,7 @@ gulpmu(mtmp, mattk) /* monster swallows you, or damage if u.uswallow */ Monnam(mtmp), buf); dismount_steed(DISMOUNT_ENGULFED); } else -#endif - pline("%s engulfs you!", Monnam(mtmp)); + pline("%s engulfs you!", Monnam(mtmp)); stop_occupation(); reset_occupations(); /* behave as if you had moved */ diff --git a/src/mon.c b/src/mon.c index e3880eafe..917e919c9 100644 --- a/src/mon.c +++ b/src/mon.c @@ -337,12 +337,10 @@ register struct monst *mtmp; !is_flyer(mtmp->data) && !is_floater(mtmp->data); infountain = IS_FOUNTAIN(levl[mtmp->mx][mtmp->my].typ); -#ifdef STEED /* Flying and levitation keeps our steed out of the liquid */ /* (but not water-walking or swimming) */ if (mtmp == u.usteed && (Flying || Levitation)) return (0); -#endif /* Gremlin multiplying won't go on forever since the hit points * keep going down, and when it gets to 1 hit point the clone @@ -449,15 +447,12 @@ struct monst *mon; else if (mon->mspeed == MFAST) mmove = (4 * mmove + 2) / 3; -#ifdef STEED if (mon == u.usteed) { if (u.ugallop && context.mv) { /* average movement is 1.50 times normal */ mmove = ((rn2(2) ? 4 : 5) * mmove) / 3; } - } else -#endif - if (mmove) { + } else if (mmove) { /* vary movement points allocated to slightly reduce predictability; random increment (avg +2) exceeds random decrement (avg +1) by a small amount; normal speed monsters will occasionally get an @@ -958,10 +953,8 @@ struct obj *otmp; (otyp != BELL_OF_OPENING || !is_covetous(mdat))) return FALSE; -#ifdef STEED /* Steeds don't pick up stuff (to avoid shop abuse) */ if (mtmp == u.usteed) return (FALSE); -#endif if (mtmp->isshk) return(TRUE); /* no limit */ if (mtmp->mpeaceful && !mtmp->mtame) return(FALSE); /* otherwise players might find themselves obligated to violate @@ -1313,10 +1306,8 @@ register struct monst *mtmp, *mtmp2; relmon(mtmp, (struct monst **)0); /* finish adding its replacement */ -#ifdef STEED - if (mtmp == u.usteed) ; else /* don't place steed onto the map */ -#endif - place_monster(mtmp2, mtmp2->mx, mtmp2->my); + if (mtmp != u.usteed) /* don't place steed onto the map */ + place_monster(mtmp2, mtmp2->mx, mtmp2->my); if (mtmp2->wormno) /* update level.monsters[wseg->wx][wseg->wy] */ place_wsegs(mtmp2); /* locations to mtmp2 not mtmp. */ if (emits_light(mtmp2->data)) { @@ -1330,9 +1321,7 @@ register struct monst *mtmp, *mtmp2; mtmp2->nmon = fmon; fmon = mtmp2; if (u.ustuck == mtmp) u.ustuck = mtmp2; -#ifdef STEED if (u.usteed == mtmp) u.usteed = mtmp2; -#endif if (mtmp2->isshk) replshk(mtmp,mtmp2); /* discard the old monster */ @@ -1597,11 +1586,9 @@ register struct monst *mtmp; need to do this after life-saving and before m_detach() */ if (mtmp->isgd && !grddead(mtmp)) return; -#ifdef STEED /* Player is thrown from his steed when it dies */ if (mtmp == u.usteed) dismount_steed(DISMOUNT_GENERIC); -#endif mptr = mtmp->data; /* save this for m_detach() */ /* restore chameleon, lycanthropes to true form at death */ @@ -1748,11 +1735,9 @@ mongone(mdef) register struct monst *mdef; { mdef->mhp = 0; /* can skip some inventory bookkeeping */ -#ifdef STEED /* Player is thrown from his steed when it disappears */ if (mdef == u.usteed) dismount_steed(DISMOUNT_GENERIC); -#endif /* drop special items like the Amulet so that a dismissed Kop or nurse can't remove them from the game */ @@ -2121,14 +2106,12 @@ mnexto(mtmp) /* Make monster mtmp next to you (if possible) */ coord mm; boolean couldspot = canspotmon(mtmp); -#ifdef STEED if (mtmp == u.usteed) { /* Keep your steed in sync with you instead */ mtmp->mx = u.ux; mtmp->my = u.uy; return; } -#endif if(!enexto(&mm, u.ux, u.uy, mtmp->data)) return; rloc_to(mtmp, mm.x, mm.y); diff --git a/src/mondata.c b/src/mondata.c index 3016b7adf..2cdf41cef 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -791,9 +791,7 @@ boolean levl_follower(mtmp) struct monst *mtmp; { -#ifdef STEED if (mtmp == u.usteed) return TRUE; -#endif /* Wizard with Amulet won't bother trying to follow across levels */ if (mtmp->iswiz && mon_has_amulet(mtmp)) return FALSE; diff --git a/src/objects.c b/src/objects.c index ec4483a51..86d65a214 100644 --- a/src/objects.c +++ b/src/objects.c @@ -618,12 +618,8 @@ TOOL("crystal ball", "glass orb", TOOL("lenses", (char *)0, 1, 0, 0, 0, 5, 3, 80, GLASS, HI_GLASS), TOOL("blindfold", (char *)0, 1, 0, 0, 0, 50, 2, 20, CLOTH, CLR_BLACK), TOOL("towel", (char *)0, 1, 0, 0, 0, 50, 2, 50, CLOTH, CLR_MAGENTA), -#ifdef STEED TOOL("saddle", (char *)0, 1, 0, 0, 0, 5,200, 150, LEATHER, HI_LEATHER), TOOL("leash", (char *)0, 1, 0, 0, 0, 65, 12, 20, LEATHER, HI_LEATHER), -#else -TOOL("leash", (char *)0, 1, 0, 0, 0, 70, 12, 20, LEATHER, HI_LEATHER), -#endif TOOL("stethoscope", (char *)0, 1, 0, 0, 0, 25, 4, 75, IRON, HI_METAL), TOOL("tinning kit", (char *)0, 1, 0, 0, 1, 15,100, 30, IRON, HI_METAL), TOOL("tin opener", (char *)0, 1, 0, 0, 0, 35, 4, 30, IRON, HI_METAL), diff --git a/src/objnam.c b/src/objnam.c index d29ad6091..94c2f4fb6 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -772,11 +772,7 @@ plus: /* weptools already get this done when we go to the +n code */ if (!is_weptool(obj)) add_erosion_words(obj, prefix); - if(obj->owornmask & (W_TOOL /* blindfold */ -#ifdef STEED - | W_SADDLE -#endif - )) { + if(obj->owornmask & (W_TOOL /* blindfold */ | W_SADDLE)) { Strcat(bp, " (being worn)"); break; } diff --git a/src/pager.c b/src/pager.c index b3647c7dd..69590754d 100644 --- a/src/pager.c +++ b/src/pager.c @@ -65,10 +65,8 @@ char *outbuf; /* being blinded may hide invisibility from self */ (Invis && (senseself() || !Blind)) ? "invisible " : "", race, mons[u.umonnum].mname, plname); -#ifdef STEED if (u.usteed) Sprintf(eos(outbuf), ", mounted on %s", y_monnam(u.usteed)); -#endif return outbuf; } diff --git a/src/pickup.c b/src/pickup.c index 0fd429bc3..bbc9a925d 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1516,11 +1516,9 @@ boolean looting; /* loot vs tip */ const char *verb = looting ? "loot" : "tip"; if (!can_reach_floor(TRUE)) { -#ifdef STEED if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) rider_cant_reach(); /* not skilled enough to reach */ else -#endif cant_reach_floor(x, y, FALSE, TRUE); return FALSE; } else if ((is_pool(x, y) && (looting || !Underwater)) || @@ -1777,7 +1775,6 @@ boolean *prev_loot; { int c = -1; int timepassed = 0; -#ifdef STEED struct obj *otmp; char qbuf[QBUFSZ]; @@ -1816,7 +1813,6 @@ boolean *prev_loot; return (0); } } -#endif /* STEED */ /* 3.4.0 introduced the ability to pick things up from within swallower's stomach */ if (u.uswallow) { int count = passed_info ? *passed_info : 0; diff --git a/src/pline.c b/src/pline.c index 2c1612e49..96b14d049 100644 --- a/src/pline.c +++ b/src/pline.c @@ -401,9 +401,7 @@ register struct monst *mtmp; ", digesting you" : is_animal(u.ustuck->data) ? ", swallowing you" : ", engulfing you"); -#ifdef STEED if (mtmp == u.usteed) Strcat(info, ", carrying you"); -#endif /* avoid "Status of the invisible newt ..., invisible" */ /* and unlike a normal mon_nam, use "saddled" even if it has a name */ @@ -451,10 +449,7 @@ ustatusline() } /* note: "goop" == "glop"; variation is intentional */ } if (Stunned) Strcat(info, ", stunned"); -#ifdef STEED - if (!u.usteed) -#endif - if (Wounded_legs) { + if (!u.usteed && Wounded_legs) { const char *what = body_part(LEG); if ((Wounded_legs & BOTH_SIDES) == BOTH_SIDES) what = makeplural(what); diff --git a/src/polyself.c b/src/polyself.c index 0e348035a..c1b2c99c4 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -691,7 +691,6 @@ int mntmp; if (!sticky && !u.uswallow && u.ustuck && sticks(youmonst.data)) u.ustuck = 0; else if (sticky && !sticks(youmonst.data)) uunstick(); -#ifdef STEED if (u.usteed) { if (touch_petrifies(u.usteed->data) && !Stone_resistance && rnl(3)) { @@ -704,7 +703,6 @@ int mntmp; } if (!can_ride(u.usteed)) dismount_steed(DISMOUNT_POLY); } -#endif if (flags.verbose) { static const char use_thec[] = "Use the command #%s to %s."; diff --git a/src/potion.c b/src/potion.c index 582409711..396dbfa53 100644 --- a/src/potion.c +++ b/src/potion.c @@ -90,11 +90,9 @@ boolean talk; } if (xtime && !old) { if (talk) { -#ifdef STEED if (u.usteed) You("wobble in the saddle."); else -#endif You("%s...", stagger(youmonst.data, "stagger")); } } @@ -676,10 +674,8 @@ peffects(otmp) else { if (Levitation || Is_airlevel(&u.uz)||Is_waterlevel(&u.uz)) You("are motionlessly suspended."); -#ifdef STEED else if (u.usteed) You("are frozen in place!"); -#endif else Your("%s are frozen to the %s!", makeplural(body_part(FOOT)), surface(u.ux, u.uy)); @@ -814,11 +810,8 @@ peffects(otmp) } break; case POT_SPEED: - if(Wounded_legs && !otmp->cursed -#ifdef STEED - && !u.usteed /* heal_legs() would heal steeds legs */ -#endif - ) { + if(Wounded_legs && !otmp->cursed && !u.usteed) { + /* heal_legs() would heal steeds legs */ heal_legs(); unkn++; break; @@ -1143,10 +1136,8 @@ boolean your_fault; register const char *botlnam = bottlename(); boolean isyou = (mon == &youmonst); int distance; -#ifdef STEED struct obj *saddle = (struct obj *)0; boolean hit_saddle = FALSE; -#endif if(isyou) { distance = 0; @@ -1154,7 +1145,6 @@ boolean your_fault; botlnam, body_part(HEAD)); losehp(Maybe_Half_Phys(rnd(2)), "thrown potion", KILLED_BY_AN); } else { -#ifdef STEED /* sometimes it hits the saddle */ if(((mon->misc_worn_check & W_SADDLE) && (saddle = which_armor(mon, W_SADDLE))) && @@ -1163,21 +1153,17 @@ boolean your_fault; ((rnl(10) > 7 && obj->cursed) || (rnl(10) < 4 && obj->blessed) || !rn2(3))))) hit_saddle = TRUE; -#endif distance = distu(mon->mx,mon->my); if (!cansee(mon->mx,mon->my)) pline("Crash!"); else { char *mnam = mon_nam(mon); char buf[BUFSZ]; -#ifdef STEED if(hit_saddle && saddle) { Sprintf(buf, "%s saddle", s_suffix(x_monnam(mon, ARTICLE_THE, (char *)0, (SUPPRESS_IT|SUPPRESS_SADDLE), FALSE))); - } else -#endif - if(has_head(mon->data)) { + } else if(has_head(mon->data)) { Sprintf(buf, "%s %s", s_suffix(mnam), (notonhead ? "body" : "head")); @@ -1187,20 +1173,12 @@ boolean your_fault; pline_The("%s crashes on %s and breaks into shards.", botlnam, buf); } - if(rn2(5) && mon->mhp > 1 -#ifdef STEED - && !hit_saddle -#endif - ) + if(rn2(5) && mon->mhp > 1 && !hit_saddle) mon->mhp--; } /* oil doesn't instantly evaporate; Neither does a saddle hit */ - if (obj->otyp != POT_OIL && -#ifdef STEED - !hit_saddle && -#endif - cansee(mon->mx,mon->my)) + if (obj->otyp != POT_OIL && !hit_saddle && cansee(mon->mx,mon->my)) pline("%s.", Tobjnam(obj, "evaporate")); if (isyou) { @@ -1224,7 +1202,6 @@ boolean your_fault; } break; } -#ifdef STEED } else if (hit_saddle && saddle) { char *mnam, buf[BUFSZ], saddle_glows[BUFSZ]; boolean affected = FALSE; @@ -1245,7 +1222,6 @@ boolean your_fault; } if (useeit && !affected) pline("%s %s wet.", buf, aobjnam(saddle, "get")); -#endif } else { boolean angermon = TRUE; @@ -1777,11 +1753,9 @@ dodip() if (yn(upstart(qtoo)) == 'y') { if (Levitation) { floating_above(pooltype); -#ifdef STEED } else if (u.usteed && !is_swimmer(u.usteed->data) && P_SKILL(P_RIDING) < P_BASIC) { rider_cant_reach(); /* not skilled enough to reach */ -#endif } else { if (obj->otyp == POT_ACID) obj->in_use = 1; (void) get_wet(obj); diff --git a/src/pray.c b/src/pray.c index 602abee59..b5312c25a 100644 --- a/src/pray.c +++ b/src/pray.c @@ -207,12 +207,10 @@ in_trouble() Cursed_obj(uarmf, FUMBLE_BOOTS)) return TROUBLE_FUMBLING; if (worst_cursed_item()) return TROUBLE_CURSED_ITEMS; -#ifdef STEED if (u.usteed) { /* can't voluntarily dismount from a cursed saddle */ otmp = which_armor(u.usteed, W_SADDLE); if (Cursed_obj(otmp, SADDLE)) return TROUBLE_SADDLE; } -#endif if (Blinded > 1 && haseyes(youmonst.data) && (!u.uswallow || @@ -220,11 +218,7 @@ in_trouble() return(TROUBLE_BLIND); for(i=0; i= HUNGRY) return TROUBLE_HUNGRY; if (HStun & TIMEOUT) return TROUBLE_STUNNED; if (HConfusion & TIMEOUT) return TROUBLE_CONFUSED; @@ -483,7 +477,6 @@ decurse: pline ("Looks like you are back in Kansas."); (void) make_hallucinated(0L,FALSE,0L); break; -#ifdef STEED case TROUBLE_SADDLE: otmp = which_armor(u.usteed, W_SADDLE); if (!Blind) { @@ -493,7 +486,6 @@ decurse: } uncurse(otmp); break; -#endif } } diff --git a/src/read.c b/src/read.c index 3564d6cec..40b40f2d9 100644 --- a/src/read.c +++ b/src/read.c @@ -1126,10 +1126,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */ for (i = -bd; i <= bd; i++) for(j = -bd; j <= bd; j++) { if (!isok(u.ux + i, u.uy + j)) continue; if ((mtmp = m_at(u.ux + i, u.uy + j)) != 0 -#ifdef STEED - || (!i && !j && (mtmp = u.usteed) != 0) -#endif - ) { + || (!i && !j && (mtmp = u.usteed) != 0)) { ++candidates; res = maybe_tame(mtmp, sobj); results += res; diff --git a/src/restore.c b/src/restore.c index 2297127c0..dc883c6da 100644 --- a/src/restore.c +++ b/src/restore.c @@ -516,7 +516,7 @@ STATIC_OVL boolean restgamestate(fd, stuckid, steedid) register int fd; -unsigned int *stuckid, *steedid; /* STEED */ +unsigned int *stuckid, *steedid; { struct flag newgameflags; #ifdef SYSFLAGS @@ -652,10 +652,8 @@ unsigned int *stuckid, *steedid; /* STEED */ restore_oracles(fd); if (u.ustuck) mread(fd, (genericptr_t) stuckid, sizeof (*stuckid)); -#ifdef STEED if (u.usteed) mread(fd, (genericptr_t) steedid, sizeof (*steedid)); -#endif mread(fd, (genericptr_t) pl_character, sizeof pl_character); mread(fd, (genericptr_t) pl_fruit, sizeof pl_fruit); @@ -676,7 +674,7 @@ unsigned int *stuckid, *steedid; /* STEED */ */ STATIC_OVL void restlevelstate(stuckid, steedid) -unsigned int stuckid, steedid; /* STEED */ +unsigned int stuckid, steedid; { register struct monst *mtmp; @@ -686,7 +684,6 @@ unsigned int stuckid, steedid; /* STEED */ if (!mtmp) panic("Cannot find the monster ustuck."); u.ustuck = mtmp; } -#ifdef STEED if (steedid) { for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) if (mtmp->m_id == steedid) break; @@ -694,7 +691,6 @@ unsigned int stuckid, steedid; /* STEED */ u.usteed = mtmp; remove_monster(mtmp->mx, mtmp->my); } -#endif } /*ARGSUSED*/ /* fd used in MFLOPPY only */ @@ -793,9 +789,7 @@ register int fd; * place_monster() on other levels */ u.ustuck = (struct monst *)0; -#ifdef STEED u.usteed = (struct monst *)0; -#endif #ifdef MICRO # ifdef AMII_GRAPHICS diff --git a/src/save.c b/src/save.c index a4055c915..f8f5d40b0 100644 --- a/src/save.c +++ b/src/save.c @@ -231,9 +231,7 @@ dosave0() store_savefileinfo(fd); store_plname_in_file(fd); ustuck_id = (u.ustuck ? u.ustuck->m_id : 0); -#ifdef STEED usteed_id = (u.usteed ? u.usteed->m_id : 0); -#endif savelev(fd, ledger_no(&u.uz), WRITE_SAVE | FREE_SAVE); savegamestate(fd, WRITE_SAVE | FREE_SAVE); @@ -248,9 +246,7 @@ dosave0() * may mislead place_monster() on other levels */ u.ustuck = (struct monst *)0; -#ifdef STEED u.usteed = (struct monst *)0; -#endif for(ltmp = (xchar)1; ltmp <= maxledgerno(); ltmp++) { if (ltmp == ledger_no(&uz_save)) continue; @@ -356,10 +352,8 @@ register int fd, mode; save_oracles(fd, mode); if(ustuck_id) bwrite(fd, (genericptr_t) &ustuck_id, sizeof ustuck_id); -#ifdef STEED if(usteed_id) bwrite(fd, (genericptr_t) &usteed_id, sizeof usteed_id); -#endif bwrite(fd, (genericptr_t) pl_character, sizeof pl_character); bwrite(fd, (genericptr_t) pl_fruit, sizeof pl_fruit); savefruitchn(fd, mode); @@ -433,9 +427,7 @@ savestateinlock() store_plname_in_file(fd); ustuck_id = (u.ustuck ? u.ustuck->m_id : 0); -#ifdef STEED usteed_id = (u.usteed ? u.usteed->m_id : 0); -#endif savegamestate(fd, WRITE_SAVE); } bclose(fd); diff --git a/src/shk.c b/src/shk.c index 944098c3a..7a4edcbdc 100644 --- a/src/shk.c +++ b/src/shk.c @@ -619,13 +619,11 @@ char *enterstring; "Leave the %s%s outside.", tool, plur(cnt)); should_block = TRUE; -#ifdef STEED } else if (u.usteed) { - verbalize(NOTANGRY(shkp) ? - "Will you please leave %s outside?" : - "Leave %s outside.", y_monnam(u.usteed)); - should_block = TRUE; -#endif + verbalize(NOTANGRY(shkp) ? + "Will you please leave %s outside?" : + "Leave %s outside.", y_monnam(u.usteed)); + should_block = TRUE; } else { should_block = (Fast && (sobj_at(PICK_AXE, u.ux, u.uy) || sobj_at(DWARVISH_MATTOCK, u.ux, u.uy))); @@ -3512,11 +3510,7 @@ register struct monst *shkp; avoid = FALSE; } else { #define GDIST(x,y) (dist2(x,y,gx,gy)) - if (Invis -#ifdef STEED - || u.usteed -#endif - ) { + if (Invis || u.usteed) { avoid = FALSE; } else { uondoor = (u.ux == eshkp->shd.x && u.uy == eshkp->shd.y); @@ -4285,9 +4279,7 @@ register xchar x, y; && shkp->mcanmove && !shkp->msleeping && (x == sx-1 || x == sx+1 || y == sy-1 || y == sy+1) && (Invis || carrying(PICK_AXE) || carrying(DWARVISH_MATTOCK) -#ifdef STEED || u.usteed -#endif )) { pline("%s%s blocks your way!", shkname(shkp), Invis ? " senses your motion and" : ""); diff --git a/src/sit.c b/src/sit.c index 154248392..4b8e2e7d1 100644 --- a/src/sit.c +++ b/src/sit.c @@ -363,7 +363,6 @@ rndcurse() /* curse a few inventory items at random! */ update_inventory(); } -#ifdef STEED /* treat steed's saddle as extended part of hero's inventory */ if (u.usteed && !rn2(4) && (otmp = which_armor(u.usteed, W_SADDLE)) != 0 && @@ -379,7 +378,6 @@ rndcurse() /* curse a few inventory items at random! */ otmp->bknown = TRUE; } } -#endif /*STEED*/ } void diff --git a/src/sounds.c b/src/sounds.c index b599f814e..27749d8b0 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -974,15 +974,13 @@ dochat() return(0); } -#ifdef STEED if (u.usteed && u.dz > 0) { - if (!u.usteed->mcanmove || u.usteed->msleeping) { - pline("%s seems not to notice you.", Monnam(u.usteed)); - return(1); - } else - return (domonnoise(u.usteed)); + if (!u.usteed->mcanmove || u.usteed->msleeping) { + pline("%s seems not to notice you.", Monnam(u.usteed)); + return(1); + } else + return (domonnoise(u.usteed)); } -#endif if (u.dz) { pline("They won't hear you %s there.", u.dz < 0 ? "up" : "down"); diff --git a/src/steal.c b/src/steal.c index f762ec18f..884b4135c 100644 --- a/src/steal.c +++ b/src/steal.c @@ -50,16 +50,15 @@ register struct monst *mtmp; mtmp->mgold += gold->quan; delobj(gold); newsym(u.ux, u.uy); -#ifdef STEED - if (u.usteed) - who = u.usteed, - whose = s_suffix(y_monnam(who)), - what = makeplural(mbodypart(who, FOOT)); - else -#endif - who = &youmonst, - whose = "your", - what = makeplural(body_part(FOOT)); + if (u.usteed) { + who = u.usteed; + whose = s_suffix(y_monnam(who)); + what = makeplural(mbodypart(who, FOOT)); + } else { + who = &youmonst; + whose = "your"; + what = makeplural(body_part(FOOT)); + } /* [ avoid "between your rear regions" :-] */ if (slithy(who->data)) what = "coils"; /* reduce "rear hooves/claws" to "hooves/claws" */ @@ -137,16 +136,15 @@ register struct monst *mtmp; obj_extract_self(fgold); add_to_minv(mtmp, fgold); newsym(u.ux, u.uy); -#ifdef STEED - if (u.usteed) - who = u.usteed, - whose = s_suffix(y_monnam(who)), - what = makeplural(mbodypart(who, FOOT)); - else -#endif - who = &youmonst, - whose = "your", - what = makeplural(body_part(FOOT)); + if (u.usteed) { + who = u.usteed; + whose = s_suffix(y_monnam(who)); + what = makeplural(mbodypart(who, FOOT)); + } else { + who = &youmonst; + whose = "your"; + what = makeplural(body_part(FOOT)); + } /* [ avoid "between your rear regions" :-] */ if (slithy(who->data)) what = "coils"; /* reduce "rear hooves/claws" to "hooves/claws" */ @@ -639,7 +637,6 @@ boolean verbosely; if (mon->mhp > 0) { mon->misc_worn_check &= ~obj->owornmask; update_mon = TRUE; -#ifdef STEED /* don't charge for an owned saddle on dead steed (provided that the hero is within the same shop at the time) */ } else if (mon->mtame && (obj->owornmask & W_SADDLE) && @@ -647,7 +644,6 @@ boolean verbosely; /* being at a costly_spot guarantees lev->roomno is not 0 */ index(in_rooms(u.ux, u.uy, SHOPBASE), levl[omx][omy].roomno)) { obj->no_charge = 1; -#endif } /* this should be done even if the monster has died */ if (obj->owornmask & W_WEP) setmnotwielded(mon, obj); diff --git a/src/steed.c b/src/steed.c index d42c2957d..afd4579dc 100644 --- a/src/steed.c +++ b/src/steed.c @@ -5,9 +5,6 @@ #include "hack.h" - -#ifdef STEED - /* Monsters that might be ridden */ static NEARDATA const char steeds[] = { S_QUADRUPED, S_UNICORN, S_ANGEL, S_CENTAUR, S_DRAGON, S_JABBERWOCK, '\0' @@ -698,6 +695,4 @@ int x, y; level.monsters[x][y] = mon; } -#endif /* STEED */ - /*steed.c*/ diff --git a/src/teleport.c b/src/teleport.c index 608e38374..158bd752c 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -39,10 +39,7 @@ unsigned gpflags; * oh well. */ if (mtmp != &youmonst && x == u.ux && y == u.uy -#ifdef STEED - && (!u.usteed || mtmp != u.usteed) -#endif - ) + && (!u.usteed || mtmp != u.usteed)) return FALSE; if (mtmp) { @@ -379,10 +376,8 @@ boolean force_it; { register struct obj *otmp; -#ifdef STEED if (mtmp == u.usteed) return (FALSE); -#endif if (mtmp->mleashed) { otmp = get_mleash(mtmp); @@ -454,10 +449,8 @@ struct obj *scroll; char whobuf[BUFSZ]; Strcpy(whobuf, "you"); -#ifdef STEED if (u.usteed) Sprintf(eos(whobuf), " and %s", mon_nam(u.usteed)); -#endif pline("To what position do %s want to be teleported?", whobuf); cc.x = u.ux; @@ -1032,12 +1025,10 @@ boolean suppress_impossible; { register int x, y, trycount; -#ifdef STEED if (mtmp == u.usteed) { tele(); return TRUE; } -#endif if (mtmp->iswiz && mtmp->mx) { /* Wizard, not just arriving */ if (!In_W_tower(u.ux, u.uy, &u.uz)) diff --git a/src/timeout.c b/src/timeout.c index 80d9a4da6..6e2b0f95e 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -236,12 +236,10 @@ nh_timeout() } } -#ifdef STEED if (u.ugallop) { if (--u.ugallop == 0L && u.usteed) pline("%s stops galloping.", Monnam(u.usteed)); } -#endif for(upp = u.uprops; upp < u.uprops+SIZE(u.uprops); upp++) if((upp->intrinsic & TIMEOUT) && !(--upp->intrinsic & TIMEOUT)) { @@ -671,9 +669,7 @@ slip_or_trip() const char *what; char buf[BUFSZ]; boolean on_foot = TRUE; -#ifdef STEED if (u.usteed) on_foot = FALSE; -#endif if (otmp && on_foot && !u.uinwater && is_pool(u.ux, u.uy)) otmp = 0; @@ -707,11 +703,9 @@ slip_or_trip() } } else if (rn2(3) && is_ice(u.ux, u.uy)) { pline("%s %s%s on the ice.", -#ifdef STEED u.usteed ? upstart(x_monnam(u.usteed, (has_mname(u.usteed)) ? ARTICLE_NONE : ARTICLE_THE, (char *)0, SUPPRESS_SADDLE, FALSE)) : -#endif "You", rn2(2) ? "slip" : "slide", on_foot ? "" : "s"); } else { if (on_foot) { @@ -732,7 +726,6 @@ slip_or_trip() break; } } -#ifdef STEED else { switch (rn2(4)) { case 1: @@ -750,7 +743,6 @@ slip_or_trip() } dismount_steed(DISMOUNT_FELL); } -#endif } } diff --git a/src/trap.c b/src/trap.c index 275776926..e14ffec6f 100644 --- a/src/trap.c +++ b/src/trap.c @@ -30,11 +30,9 @@ STATIC_DCL char *FDECL(trapnote, (struct trap *,BOOLEAN_P)); STATIC_DCL void FDECL(join_adjacent_pits, (struct trap *)); #endif STATIC_DCL void FDECL(clear_conjoined_pits, (struct trap *)); -#ifdef STEED STATIC_DCL int FDECL(steedintrap, (struct trap *, struct obj *)); STATIC_DCL boolean FDECL(keep_saddle_with_steedcorpse, (unsigned, struct obj *, struct obj *)); -#endif STATIC_DCL void NDECL(maybe_finish_sokoban); /* mintrap() should take a flags argument, but for time being we use this */ @@ -651,7 +649,6 @@ boolean shatter; return mtmp; } -#ifdef STEED STATIC_OVL boolean keep_saddle_with_steedcorpse(steed_mid, objchn, saddle) unsigned steed_mid; @@ -679,7 +676,6 @@ struct obj *objchn, *saddle; } return FALSE; } -#endif /*STEED*/ void dotrap(trap, trflags) @@ -695,9 +691,7 @@ unsigned trflags; plunged = (trflags & TOOKPLUNGE) != 0, adj_pit = conjoined_pits(trap, t_at(u.ux0,u.uy0), TRUE); int oldumort; -#ifdef STEED int steed_article = ARTICLE_THE; -#endif nomul(0); @@ -736,7 +730,6 @@ unsigned trflags; } } -#ifdef STEED if (u.usteed) { u.usteed->mtrapseen |= (1 << (ttype - 1)); /* suppress article in various steed messages when using its @@ -744,7 +737,6 @@ unsigned trflags; if (has_mname(u.usteed) && !Hallucination) steed_article = ARTICLE_NONE; } -#endif switch(ttype) { case ARROW_TRAP: @@ -761,11 +753,8 @@ unsigned trflags; otmp->quan = 1L; otmp->owt = weight(otmp); otmp->opoisoned = 0; -#ifdef STEED if (u.usteed && !rn2(2) && steedintrap(trap, otmp)) /* nothing */; - else -#endif - if (thitu(8, dmgval(otmp, &youmonst), otmp, "arrow")) { + else if (thitu(8, dmgval(otmp, &youmonst), otmp, "arrow")) { obfree(otmp, (struct obj *)0); } else { place_object(otmp, u.ux, u.uy); @@ -789,11 +778,8 @@ unsigned trflags; otmp->owt = weight(otmp); if (!rn2(6)) otmp->opoisoned = 1; oldumort = u.umortality; -#ifdef STEED if (u.usteed && !rn2(2) && steedintrap(trap, otmp)) /* nothing */; - else -#endif - if (thitu(7, dmgval(otmp, &youmonst), otmp, "little dart")) { + else if (thitu(7, dmgval(otmp, &youmonst), otmp, "little dart")) { if (otmp->opoisoned) poisoned("dart", A_CON, "little dart", /* if damage triggered life-saving, @@ -876,27 +862,20 @@ unsigned trflags; A_Your[trap->madeby_u]); break; } - if( -#ifdef STEED - !u.usteed && -#endif - youmonst.data->msize <= MZ_SMALL) { + if( !u.usteed && youmonst.data->msize <= MZ_SMALL) { pline("%s bear trap closes harmlessly over you.", A_Your[trap->madeby_u]); break; } u.utrap = rn1(4, 4); u.utraptype = TT_BEARTRAP; -#ifdef STEED if (u.usteed) { pline("%s bear trap closes on %s %s!", A_Your[trap->madeby_u], s_suffix(mon_nam(u.usteed)), mbodypart(u.usteed, FOOT)); if (thitm(0, u.usteed, (struct obj *)0, dmg, FALSE)) u.utrap = 0; /* steed died, hero not trapped */ - } else -#endif - { + } else { pline("%s bear trap closes on your %s!", A_Your[trap->madeby_u], body_part(FOOT)); if(u.umonnum == PM_OWLBEAR || u.umonnum == PM_BUGBEAR) @@ -915,9 +894,7 @@ unsigned trflags; pline("A cloud of gas puts you to sleep!"); fall_asleep(-rnd(25), TRUE); } -#ifdef STEED (void) steedintrap(trap, (struct obj *)0); -#endif break; case RUST_TRAP: @@ -1008,7 +985,6 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); } if (!Sokoban) { char verbbuf[BUFSZ]; -#ifdef STEED if (u.usteed) { if ((trflags & RECURSIVETRAP) != 0) Sprintf(verbbuf, "and %s fall", @@ -1018,9 +994,7 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); Sprintf(verbbuf, "lead %s", x_monnam(u.usteed, steed_article, "poor", SUPPRESS_SADDLE, FALSE)); - } else -#endif - if (adj_pit) { + } else if (adj_pit) { You("move into an adjacent pit."); } else { Strcpy(verbbuf, !plunged ? "fall" : @@ -1038,7 +1012,6 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); pline("How pitiful. Isn't that the pits?"); if (ttype == SPIKED_PIT) { const char *predicament = "on a set of sharp iron spikes"; -#ifdef STEED if (u.usteed) { pline("%s %s %s!", upstart(x_monnam(u.usteed, steed_article, @@ -1046,14 +1019,11 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); adj_pit ? "steps" : "lands", predicament); } else -#endif - You("%s %s!", adj_pit ? "step" : "land", predicament); + You("%s %s!", adj_pit ? "step" : "land", predicament); } u.utrap = rn1(6,2); u.utraptype = TT_PIT; -#ifdef STEED if (!steedintrap(trap, (struct obj *)0)) { -#endif if (ttype == SPIKED_PIT) { oldumort = u.umortality; losehp(Maybe_Half_Phys(rnd(adj_pit ? 6 : 10)), @@ -1086,9 +1056,7 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); vision_full_recalc = 1; /* vision limits change */ exercise(A_STR, FALSE); exercise(A_DEX, FALSE); -#ifdef STEED } -#endif break; case HOLE: case TRAPDOOR: @@ -1139,12 +1107,10 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); if (forcetrap) { Strcpy(verbbuf, "are caught by"); -#ifdef STEED } else if (u.usteed) { Sprintf(verbbuf, "lead %s into", x_monnam(u.usteed, steed_article, "poor", SUPPRESS_SADDLE, FALSE)); -#endif } else { Sprintf(verbbuf, "%s into", Levitation ? (const char *)"float" : @@ -1158,7 +1124,6 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); { register int str = ACURR(A_STR); -#ifdef STEED /* If mounted, the steed gets trapped. Use mintrap * to do all the work. If mtrapped is set as a result, * unset it and set utrap instead. In the case of a @@ -1183,7 +1148,6 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); webmsgok = FALSE; /* mintrap printed the messages */ } -#endif if (str <= 3) u.utrap = rn1(6,6); else if (str < 6) u.utrap = rn1(6,4); else if (str < 9) u.utrap = rn1(4,4); @@ -1216,9 +1180,7 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); u.uen = (u.uenmax += 2); break; } else domagictrap(); -#ifdef STEED (void) steedintrap(trap, (struct obj *)0); -#endif break; case ANTI_MAGIC: @@ -1258,13 +1220,11 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); case POLY_TRAP: { char verbbuf[BUFSZ]; seetrap(trap); -#ifdef STEED if (u.usteed) Sprintf(verbbuf, "lead %s", x_monnam(u.usteed, steed_article, (char *)0, SUPPRESS_SADDLE, FALSE)); else -#endif Sprintf(verbbuf,"%s", Levitation ? (const char *)"float" : locomotion(youmonst.data, "step")); @@ -1274,9 +1234,7 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); You_feel("momentarily different."); /* Trap did nothing; don't remove it --KAA */ } else { -#ifdef STEED (void) steedintrap(trap, (struct obj *)0); -#endif deltrap(trap); /* delete trap before polymorph */ newsym(u.ux,u.uy); /* get rid of trap symbol */ You_feel("a change coming over you."); @@ -1285,10 +1243,8 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); break; } case LANDMINE: { -#ifdef STEED unsigned steed_mid = 0; struct obj *saddle = 0; -#endif if ((Levitation || Flying) && !forcetrap) { if (!already_seen && rn2(3)) break; feeltrap(trap); @@ -1303,7 +1259,6 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); already_seen ? a_your[trap->madeby_u] : "", already_seen ? " land mine" : "it"); } else { -#ifdef STEED /* prevent landmine from killing steed, throwing you to * the ground, and you being affected again by the same * mine because it hasn't been deleted yet @@ -1311,26 +1266,21 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); static boolean recursive_mine = FALSE; if (recursive_mine) break; -#endif feeltrap(trap); pline("KAABLAMM!!! You triggered %s land mine!", a_your[trap->madeby_u]); -#ifdef STEED if (u.usteed) steed_mid = u.usteed->m_id; recursive_mine = TRUE; (void) steedintrap(trap, (struct obj *)0); recursive_mine = FALSE; saddle = sobj_at(SADDLE,u.ux, u.uy); -#endif set_wounded_legs(LEFT_SIDE, rn1(35, 41)); set_wounded_legs(RIGHT_SIDE, rn1(35, 41)); exercise(A_DEX, FALSE); } blow_up_landmine(trap); -#ifdef STEED if (steed_mid && saddle && !u.usteed) (void)keep_saddle_with_steedcorpse(steed_mid, fobj, saddle); -#endif newsym(u.ux,u.uy); /* update trap symbol */ losehp(Maybe_Half_Phys(rnd(16)), "land mine", KILLED_BY_AN); /* fall recursively into the pit... */ @@ -1383,7 +1333,6 @@ boolean noprefix; return tnbuf; } -#ifdef STEED STATIC_OVL int steedintrap(trap, otmp) struct trap *trap; @@ -1460,7 +1409,6 @@ struct obj *otmp; } return steedhit ? 1 : 0; } -#endif /*STEED*/ /* some actions common to both player and monsters for triggered landmine */ void @@ -1964,10 +1912,8 @@ register struct monst *mtmp; Sokoban && !trap->madeby_u); const char *fallverb; -#ifdef STEED /* true when called from dotrap, inescapable is not an option */ if (mtmp == u.usteed) inescapable = TRUE; -#endif if (!inescapable && ((mtmp->mtrapseen & (1 << (tt-1))) != 0 || (tt == HOLE && !mindless(mptr)))) { @@ -1983,10 +1929,8 @@ register struct monst *mtmp; in_sight = canseemon(mtmp); see_it = cansee(mtmp->mx, mtmp->my); -#ifdef STEED /* assume hero can tell what's going on for the steed */ if (mtmp == u.usteed) in_sight = TRUE; -#endif switch (tt) { case ARROW_TRAP: if (trap->once && trap->tseen && !rn2(15)) { @@ -2633,7 +2577,6 @@ float_up() You("gain control over your movements."); else You("start to float in the air!"); -#ifdef STEED if (u.usteed && !is_floater(u.usteed->data) && !is_flyer(u.usteed->data)) { if (Lev_at_will) @@ -2643,7 +2586,6 @@ float_up() dismount_steed(DISMOUNT_GENERIC); } } -#endif if (Flying) You("are no longer able to control your flight."); BFlying |= I_SPECIAL; return; @@ -2744,10 +2686,7 @@ long hmask, emask; /* might cancel timeout */ You_feel("heavier."); /* u.uinwater msgs already in spoteffects()/drown() */ else if (!u.uinwater && !no_msg) { -#ifdef STEED - if (!(emask & W_SADDLE)) -#endif - { + if (!(emask & W_SADDLE)) { if (Sokoban && trap) { /* Justification elsewhere for Sokoban traps * is based on air currents. This is @@ -2761,15 +2700,11 @@ long hmask, emask; /* might cancel timeout */ else You("fall over."); losehp(rnd(2), "dangerous winds", KILLED_BY); -#ifdef STEED if (u.usteed) dismount_steed(DISMOUNT_FELL); -#endif selftouch("As you fall, you"); -#ifdef STEED } else if (u.usteed && (is_floater(u.usteed->data) || is_flyer(u.usteed->data))) { You("settle more firmly in the saddle."); -#endif } else if (Hallucination) pline("Bummer! You've %s.", is_pool(u.ux,u.uy) ? "splashed down" : @@ -2834,19 +2769,15 @@ climb_pit() You("%s to the edge of the pit.", (Sokoban && Levitation) ? "struggle against the air currents and float" : -#ifdef STEED u.usteed ? "ride" : -#endif "crawl"); fill_pit(u.ux, u.uy); vision_full_recalc = 1; /* vision limits change */ } else if (u.dz || flags.verbose) { -#ifdef STEED if (u.usteed) Norep("%s is still in a pit.", upstart(y_monnam(u.usteed))); else -#endif Norep((Hallucination && !rn2(5)) ? "You've fallen, and you can't get up." : "You are still in a pit."); @@ -3361,13 +3292,11 @@ drown() return(TRUE); } else pline_The("attempted teleport spell fails."); } -#ifdef STEED if (u.usteed) { dismount_steed(DISMOUNT_GENERIC); if(!is_pool(u.ux,u.uy)) return(TRUE); } -#endif crawl_ok = FALSE; x = y = 0; /* lint suppression */ /* if sleeping, wake up now so that we don't crawl out of water @@ -3603,11 +3532,9 @@ boolean force_failure; } /* untrappable traps are located on the ground. */ if (!can_reach_floor(TRUE)) { -#ifdef STEED if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) rider_cant_reach(); else -#endif You("are unable to reach the %s!", defsyms[trap_to_defsym(ttype)].explanation); return 0; @@ -3627,12 +3554,10 @@ boolean force_failure; if (ttmp2) { pline_The("webbing sticks to you. You're caught too!"); dotrap(ttmp2, NOWEBMSG); -#ifdef STEED if (u.usteed && u.utrap) { /* you, not steed, are trapped */ dismount_steed(DISMOUNT_FELL); } -#endif } } else pline("%s remains entangled.", Monnam(mtmp)); @@ -3937,9 +3862,7 @@ boolean force; useplural ? "are" : "is", the_trap, here ? "here" : "there", useplural ? "them" : "it", -#ifdef STEED u.usteed ? " while mounted" : -#endif ""); trap_skipped = (ttmp != 0); } else { /* deal_with_floor_trap */ @@ -4131,9 +4054,7 @@ boolean *noticed; /* set to true iff hero notices the effect; */ const char *trapdescr, *which; boolean ishero = (mon == &youmonst); -#ifdef STEED if (mon == u.usteed) ishero = TRUE; -#endif t = t_at(ishero ? u.ux : mon->mx, ishero ? u.uy : mon->my); /* if no trap here or it's not a holding trap, we're done */ if (!t || (t->ttyp != BEAR_TRAP && t->ttyp != WEB)) return FALSE; @@ -4148,11 +4069,9 @@ boolean *noticed; /* set to true iff hero notices the effect; */ *noticed = TRUE; /* give message only if trap was the expected type */ if (u.utraptype == TT_BEARTRAP || u.utraptype == TT_WEB) { -#ifdef STEED if (u.usteed) Sprintf(buf, "%s is", noit_Monnam(u.usteed)); else -#endif Strcpy(buf, "You are"); pline("%s released from %s %s.", buf, which, trapdescr); } @@ -4188,9 +4107,7 @@ boolean *noticed; /* set to true iff hero notices the effect; */ unsigned dotrapflags; boolean ishero = (mon == &youmonst), result; -#ifdef STEED if (mon == u.usteed) ishero = TRUE; -#endif t = t_at(ishero ? u.ux : mon->mx, ishero ? u.uy : mon->my); /* if no trap here or it's not a holding trap, we're done */ if (!t || (t->ttyp != BEAR_TRAP && t->ttyp != WEB)) return FALSE; @@ -4199,10 +4116,8 @@ boolean *noticed; /* set to true iff hero notices the effect; */ if (u.utrap) return FALSE; /* already trapped */ *noticed = TRUE; dotrapflags = FORCETRAP; -#ifdef STEED /* dotrap calls mintrap when mounted hero encounters a web */ if (u.usteed) dotrapflags |= NOWEBMSG; -#endif ++force_mintrap; dotrap(t, dotrapflags); --force_mintrap; @@ -4230,9 +4145,7 @@ boolean *noticed; /* set to true iff hero notices the effect; */ struct trap *t; boolean ishero = (mon == &youmonst), result; -#ifdef STEED if (mon == u.usteed) ishero = TRUE; -#endif t = t_at(ishero ? u.ux : mon->mx, ishero ? u.uy : mon->my); /* if no trap here or it's not a falling trap, we're done (note: falling rock traps have a trapdoor in the ceiling) */ diff --git a/src/u_init.c b/src/u_init.c index 59ba3c23a..621f0d44d 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -262,9 +262,7 @@ static const struct def_skill Skill_A[] = { { P_UNICORN_HORN, P_SKILLED }, { P_ATTACK_SPELL, P_BASIC }, { P_HEALING_SPELL, P_BASIC }, { P_DIVINATION_SPELL, P_EXPERT}, { P_MATTER_SPELL, P_BASIC}, -#ifdef STEED { P_RIDING, P_BASIC }, -#endif { P_TWO_WEAPON_COMBAT, P_BASIC }, { P_BARE_HANDED_COMBAT, P_EXPERT }, { P_NONE, 0 } @@ -281,9 +279,7 @@ static const struct def_skill Skill_B[] = { { P_QUARTERSTAFF, P_BASIC }, { P_SPEAR, P_SKILLED }, { P_TRIDENT, P_SKILLED }, { P_BOW, P_BASIC }, { P_ATTACK_SPELL, P_SKILLED }, -#ifdef STEED { P_RIDING, P_BASIC }, -#endif { P_TWO_WEAPON_COMBAT, P_BASIC }, { P_BARE_HANDED_COMBAT, P_MASTER }, { P_NONE, 0 } @@ -332,9 +328,7 @@ static const struct def_skill Skill_K[] = { { P_BOW, P_BASIC }, { P_CROSSBOW, P_SKILLED }, { P_ATTACK_SPELL, P_SKILLED }, { P_HEALING_SPELL, P_SKILLED }, { P_CLERIC_SPELL, P_SKILLED }, -#ifdef STEED { P_RIDING, P_EXPERT }, -#endif { P_TWO_WEAPON_COMBAT, P_SKILLED }, { P_BARE_HANDED_COMBAT, P_EXPERT }, { P_NONE, 0 } @@ -379,9 +373,7 @@ static const struct def_skill Skill_R[] = { { P_DART, P_EXPERT }, { P_SHURIKEN, P_SKILLED }, { P_DIVINATION_SPELL, P_SKILLED }, { P_ESCAPE_SPELL, P_SKILLED }, { P_MATTER_SPELL, P_SKILLED }, -#ifdef STEED { P_RIDING, P_BASIC }, -#endif { P_TWO_WEAPON_COMBAT, P_EXPERT }, { P_BARE_HANDED_COMBAT, P_EXPERT }, { P_NONE, 0 } @@ -401,9 +393,7 @@ static const struct def_skill Skill_Ran[] = { { P_HEALING_SPELL, P_BASIC }, { P_DIVINATION_SPELL, P_EXPERT }, { P_ESCAPE_SPELL, P_BASIC }, -#ifdef STEED { P_RIDING, P_BASIC }, -#endif { P_BARE_HANDED_COMBAT, P_BASIC }, { P_NONE, 0 } }; @@ -418,9 +408,7 @@ static const struct def_skill Skill_S[] = { { P_LANCE, P_SKILLED }, { P_BOW, P_EXPERT }, { P_SHURIKEN, P_EXPERT }, { P_ATTACK_SPELL, P_SKILLED }, { P_CLERIC_SPELL, P_SKILLED }, -#ifdef STEED { P_RIDING, P_SKILLED }, -#endif { P_TWO_WEAPON_COMBAT, P_EXPERT }, { P_MARTIAL_ARTS, P_MASTER }, { P_NONE, 0 } @@ -444,9 +432,7 @@ static const struct def_skill Skill_T[] = { { P_WHIP, P_BASIC }, { P_UNICORN_HORN, P_SKILLED }, { P_DIVINATION_SPELL, P_BASIC }, { P_ENCHANTMENT_SPELL, P_BASIC }, { P_ESCAPE_SPELL, P_SKILLED }, -#ifdef STEED { P_RIDING, P_BASIC }, -#endif { P_TWO_WEAPON_COMBAT, P_SKILLED }, { P_BARE_HANDED_COMBAT, P_SKILLED }, { P_NONE, 0 } @@ -464,9 +450,7 @@ static const struct def_skill Skill_V[] = { { P_TRIDENT, P_BASIC }, { P_LANCE, P_SKILLED }, { P_SLING, P_BASIC }, { P_ATTACK_SPELL, P_BASIC }, { P_ESCAPE_SPELL, P_BASIC }, -#ifdef STEED { P_RIDING, P_SKILLED }, -#endif { P_TWO_WEAPON_COMBAT, P_SKILLED }, { P_BARE_HANDED_COMBAT, P_EXPERT }, { P_NONE, 0 } @@ -484,9 +468,7 @@ static const struct def_skill Skill_W[] = { { P_DIVINATION_SPELL, P_EXPERT }, { P_ENCHANTMENT_SPELL, P_SKILLED }, { P_CLERIC_SPELL, P_SKILLED }, { P_ESCAPE_SPELL, P_EXPERT }, { P_MATTER_SPELL, P_EXPERT }, -#ifdef STEED { P_RIDING, P_BASIC }, -#endif { P_BARE_HANDED_COMBAT, P_BASIC }, { P_NONE, 0 } }; diff --git a/src/uhitm.c b/src/uhitm.c index 43fb2c0a1..16b05fe9c 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -11,9 +11,7 @@ STATIC_DCL boolean FDECL(theft_petrifies, (struct obj *)); STATIC_DCL void FDECL(steal_it, (struct monst *, struct attack *)); STATIC_DCL boolean FDECL(hitum, (struct monst *,struct attack *)); STATIC_DCL boolean FDECL(hmon_hitmon, (struct monst *,struct obj *,int)); -#ifdef STEED STATIC_DCL int FDECL(joust, (struct monst *,struct obj *)); -#endif STATIC_DCL void NDECL(demonpet); STATIC_DCL boolean FDECL(m_slips_free, (struct monst *mtmp,struct attack *mattk)); STATIC_DCL int FDECL(explum, (struct monst *,struct attack *)); @@ -559,9 +557,7 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ boolean hand_to_hand = (thrown == HMON_MELEE || /* not grapnels; applied implies uwep */ (thrown == HMON_APPLIED && is_pole(uwep))); -#ifdef STEED int jousting = 0; -#endif int wtype; struct obj *monwep; char unconventional[BUFSZ]; /* substituted for word "attack" in msg */ @@ -607,11 +603,7 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ /* or strike with a missile in your hand... */ (!thrown && (is_missile(obj) || is_ammo(obj))) || /* or use a pole at short range and not mounted... */ - (!thrown && -#ifdef STEED - !u.usteed && -#endif - is_pole(obj)) || + (!thrown && !u.usteed && is_pole(obj)) || /* or throw a missile without the proper bow... */ (is_ammo(obj) && (thrown != HMON_THROWN || !ammo_and_launcher(obj, uwep)))) { @@ -693,14 +685,12 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ && mon_hates_silver(mon)) { silvermsg = TRUE; silverobj = TRUE; } -#ifdef STEED if (u.usteed && !thrown && tmp > 0 && weapon_type(obj) == P_LANCE && mon != u.ustuck) { jousting = joust(mon, obj); /* exercise skill even for minimal damage hits */ if (jousting) valid_weapon_attack = TRUE; } -#endif if (thrown == HMON_THROWN && (is_ammo(obj) || is_missile(obj))) { if (ammo_and_launcher(obj, uwep)) { @@ -991,7 +981,6 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ } } -#ifdef STEED if (jousting) { tmp += d(2, (obj == uwep) ? 10 : 2); /* [was in dmgval()] */ You("joust %s%s", @@ -1012,11 +1001,8 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ if (DEADMONSTER(mon)) already_killed = TRUE; } hittxt = TRUE; - } else -#endif - - /* VERY small chance of stunning opponent if unarmed. */ - if (unarmed && tmp > 1 && !thrown && !obj && !Upolyd) { + } else if (unarmed && tmp > 1 && !thrown && !obj && !Upolyd) { + /* VERY small chance of stunning opponent if unarmed. */ if (rnd(100) < P_SKILL(P_BARE_HANDED_COMBAT) && !bigmonst(mdat) && !thick_skinned(mdat)) { if (canspotmon(mon)) diff --git a/src/weapon.c b/src/weapon.c index 568c2d669..fc3258c6b 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -43,9 +43,7 @@ STATIC_VAR NEARDATA const short skill_names_indices[P_NUM_SKILLS] = { PN_CLERIC_SPELL, PN_ESCAPE_SPELL, PN_MATTER_SPELL, PN_BARE_HANDED, PN_TWO_WEAPONS, -#ifdef STEED PN_RIDING -#endif }; /* note: entry [0] isn't used */ @@ -1184,7 +1182,6 @@ struct obj *weapon; bonus = ((bonus + 2) * (martial_bonus() ? 2 : 1)) / 2; } -#ifdef STEED /* KMH -- It's harder to hit while you are riding */ if (u.usteed) { switch (P_SKILL(P_RIDING)) { @@ -1196,7 +1193,6 @@ struct obj *weapon; } if (u.twoweap) bonus -= 2; } -#endif return bonus; } @@ -1253,7 +1249,6 @@ struct obj *weapon; bonus = ((bonus + 1) * (martial_bonus() ? 3 : 1)) / 2; } -#ifdef STEED /* KMH -- Riding gives some thrusting damage */ if (u.usteed && type != P_TWO_WEAPON_COMBAT) { switch (P_SKILL(P_RIDING)) { @@ -1264,7 +1259,6 @@ struct obj *weapon; case P_EXPERT: bonus += 2; break; } } -#endif return bonus; } @@ -1326,10 +1320,8 @@ const struct def_skill *class_skill; P_SKILL(P_BARE_HANDED_COMBAT) = P_BASIC; /* Roles that start with a horse know how to ride it */ -#ifdef STEED if (urole.petnum == PM_PONY) P_SKILL(P_RIDING) = P_BASIC; -#endif /* * Make sure we haven't missed setting the max on a skill diff --git a/src/wield.c b/src/wield.c index 7d7c2d6af..32a3e1eb4 100644 --- a/src/wield.c +++ b/src/wield.c @@ -106,10 +106,7 @@ register struct obj *obj; unweapon = (obj->oclass == WEAPON_CLASS) ? is_launcher(obj) || is_ammo(obj) || is_missile(obj) || (is_pole(obj) -#ifdef STEED - && !u.usteed -#endif - ) : !is_weptool(obj); + && !u.usteed) : !is_weptool(obj); } else unweapon = TRUE; /* for "bare hands" message */ update_inventory(); @@ -288,11 +285,7 @@ dowield() return (doswapweapon()); else if (wep == uquiver) setuqwep((struct obj *) 0); - else if (wep->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL -#ifdef STEED - | W_SADDLE -#endif - )) { + else if (wep->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL | W_SADDLE)) { You("cannot wield that!"); return (0); } @@ -392,10 +385,7 @@ dowieldquiver() !is_plural(uwep) ? "That is" : "They are"); return(0); } else if (newquiver->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL -#ifdef STEED - | W_SADDLE -#endif - )) { + | W_SADDLE)) { You("cannot ready that!"); return (0); } else { diff --git a/src/worn.c b/src/worn.c index 4371d789a..bea315bdc 100644 --- a/src/worn.c +++ b/src/worn.c @@ -169,10 +169,8 @@ struct obj *obj; res = W_TOOL; /* WORN_BLINDF */ else if (is_weptool(obj) || otyp == TIN_OPENER) res = W_WEP|W_SWAPWEP; -#ifdef STEED else if (otyp == SADDLE) res = W_SADDLE; -#endif break; case FOOD_CLASS: if (obj->otyp == MEAT_RING) res = W_RINGL|W_RINGR; @@ -382,10 +380,8 @@ boolean on, silently; break; } -#ifdef STEED if (!on && mon == u.usteed && obj->otyp == SADDLE) dismount_steed(DISMOUNT_FELL); -#endif /* if couldn't see it but now can, or vice versa, update display */ if (!silently && (unseen ^ !canseemon(mon))) @@ -837,7 +833,6 @@ boolean polyspot; m_lose_armor(mon, otmp); } } -#ifdef STEED if (!can_saddle(mon)) { if ((otmp = which_armor(mon, W_SADDLE)) != 0) { if (polyspot) bypass_obj(otmp); @@ -861,7 +856,6 @@ boolean polyspot; } dismount_steed(DISMOUNT_FELL); } -#endif return; } diff --git a/src/zap.c b/src/zap.c index 5c95dde0d..41723a566 100644 --- a/src/zap.c +++ b/src/zap.c @@ -26,9 +26,7 @@ STATIC_DCL int FDECL(stone_to_flesh_obj, (struct obj *)); STATIC_DCL boolean FDECL(zap_updown, (struct obj *)); STATIC_DCL void FDECL(zhitu, (int,int,const char *,XCHAR_P,XCHAR_P)); STATIC_DCL void FDECL(revive_egg, (struct obj *)); -#ifdef STEED STATIC_DCL boolean FDECL(zap_steed, (struct obj *)); -#endif STATIC_DCL void FDECL(skiprange, (int,int *,int *)); STATIC_DCL int FDECL(zap_hit, (int,int)); @@ -300,7 +298,6 @@ struct obj *otmp; } else if (openfallingtrap(mtmp, TRUE, &learn_it)) { /* mtmp might now be on the migrating monsters list */ break; -#ifdef STEED } else if ((obj = which_armor(mtmp, W_SADDLE)) != 0) { char buf[BUFSZ]; @@ -316,7 +313,6 @@ struct obj *otmp; } obj_extract_self(obj); mdrop_obj(mtmp, obj, FALSE); -#endif /* STEED */ } break; case SPE_HEALING: @@ -2433,7 +2429,6 @@ long duration; return FALSE; } -#ifdef STEED /* you've zapped a wand downwards while riding * Return TRUE if the steed was hit by the wand. * Return FALSE if the steed was not hit by the wand. @@ -2495,7 +2490,6 @@ struct obj *obj; /* wand or spell */ } return steedhit; } -#endif /* * cancel a monster (possibly the hero). inventory is cancelled only @@ -2772,13 +2766,10 @@ struct obj *obj; boolean disclose = FALSE, was_unkn = !objects[otyp].oc_name_known; exercise(A_WIS, TRUE); -#ifdef STEED if (u.usteed && (objects[otyp].oc_dir != NODIR) && !u.dx && !u.dy && (u.dz > 0) && zap_steed(obj)) { disclose = TRUE; - } else -#endif - if (objects[otyp].oc_dir == IMMEDIATE) { + } else if (objects[otyp].oc_dir == IMMEDIATE) { zapsetup(); /* reset obj_zapped */ if (u.uswallow) { (void) bhitm(u.ustuck, obj); @@ -3769,9 +3760,7 @@ register int dx,dy; if (mon) { if (type == ZT_SPELL(ZT_FIRE)) break; if (type >= 0) mon->mstrategy &= ~STRAT_WAITMASK; -#ifdef STEED buzzmonst: -#endif if (zap_hit(find_mac(mon), spell_type)) { if (mon_reflects(mon, (char *)0)) { if(cansee(mon->mx,mon->my)) { @@ -3838,13 +3827,10 @@ register int dx,dy; } } else if (sx == u.ux && sy == u.uy && range >= 0) { nomul(0); -#ifdef STEED if (u.usteed && !rn2(3) && !mon_reflects(u.usteed, (char *)0)) { mon = u.usteed; goto buzzmonst; - } else -#endif - if (zap_hit((int) u.uac, 0)) { + } else if (zap_hit((int) u.uac, 0)) { range -= 2; pline("%s hits you!", The(fltxt)); if (Reflecting) { diff --git a/util/makedefs.c b/util/makedefs.c index dbedfe45b..c4ac5f3b5 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1005,11 +1005,8 @@ make_version() #ifdef TOURIST | (1L << 10) #endif -#ifdef STEED - | (1L << 11) -#endif #ifdef GOLDOBJ - | (1L << 12) + | (1L << 11) #endif /* flag bits and/or other global variables (15..26) */ #ifdef TEXTCOLOR @@ -1307,9 +1304,6 @@ static const char *build_opts[] = { #ifdef REINCARNATION "rogue level", #endif -#ifdef STEED - "saddles and riding", -#endif #ifdef SCORE_ON_BOTL "score on status line", #endif diff --git a/win/gnome/gnmain.c b/win/gnome/gnmain.c index 45c55ef2f..53273c407 100644 --- a/win/gnome/gnmain.c +++ b/win/gnome/gnmain.c @@ -366,14 +366,12 @@ GnomeUIInfo action_menu[] = { ghack_accelerator_selected, GINT_TO_POINTER(M('j')), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'j',GDK_MOD1_MASK }, -#ifdef STEED { GNOME_APP_UI_ITEM, N_("Ride"), N_("Ride (or stop riding) a monster"), doride, GINT_TO_POINTER(M('r')), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'R',GDK_MOD1_MASK }, -#endif { GNOME_APP_UI_ITEM, N_("Wipe face"), N_("wipe off your face"), diff --git a/win/share/tilemap.c b/win/share/tilemap.c index 87423f49c..9672b6568 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -81,9 +81,6 @@ struct conditionals { { OBJ_GLYPH, LEATHER_JACKET, "T-shirt" }, { OBJ_GLYPH, LOCK_PICK, "credit card" }, { OBJ_GLYPH, MAGIC_LAMP, "expensive camera" }, -#endif -#ifndef STEED - { OBJ_GLYPH, TOWEL, "saddle" }, #endif /* allow slime mold to look like slice of pizza, since we * don't know what a slime mold should look like when renamed anyway From 161070ce56a2b7dcf449d6f39d2e683d66ec3a42 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 13 Feb 2015 22:01:44 -0500 Subject: [PATCH 123/354] Make KOPS unconditional. --- include/config.h | 1 - include/monflag.h | 2 -- include/obj.h | 4 ---- src/bones.c | 2 -- src/makemon.c | 2 -- src/mon.c | 4 ---- src/mondata.c | 2 -- src/monst.c | 2 -- src/muse.c | 21 ++++++--------------- src/objects.c | 2 -- src/shk.c | 22 ---------------------- src/sit.c | 2 -- src/sounds.c | 2 -- src/weapon.c | 13 ++----------- util/makedefs.c | 8 +------- win/share/tilemap.c | 9 --------- 16 files changed, 9 insertions(+), 89 deletions(-) diff --git a/include/config.h b/include/config.h index 715fc746a..3e06382b8 100644 --- a/include/config.h +++ b/include/config.h @@ -423,7 +423,6 @@ typedef unsigned char uchar; #define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */ #define REINCARNATION /* Special Rogue-like levels */ /* monsters & objects */ -#define KOPS /* Keystone Kops by Scott R. Turner */ #define SEDUCE /* Succubi/incubi seduction, by KAA, suggested by IM */ #define TOURIST /* Tourist players with cameras and Hawaiian shirts */ /* I/O */ diff --git a/include/monflag.h b/include/monflag.h index 103060a41..bf6875581 100644 --- a/include/monflag.h +++ b/include/monflag.h @@ -29,9 +29,7 @@ #define MS_IMITATE 19 /* imitates others (leocrotta) */ #define MS_ORC MS_GRUNT /* intelligent brutes */ #define MS_HUMANOID 20 /* generic traveling companion */ -#ifdef KOPS #define MS_ARREST 21 /* "Stop in the name of the law!" (Kops) */ -#endif #define MS_SOLDIER 22 /* army and watchmen expressions */ #define MS_GUARD 23 /* "Please drop that gold and follow me." */ #define MS_DJINNI 24 /* "Thank you for freeing me!" */ diff --git a/include/obj.h b/include/obj.h index 8d302c0ae..3d0e5d88d 100644 --- a/include/obj.h +++ b/include/obj.h @@ -312,12 +312,8 @@ struct obj { (obj)->otyp == TOUCHSTONE) /* misc */ -#ifdef KOPS #define is_flimsy(otmp) (objects[(otmp)->otyp].oc_material <= LEATHER || \ (otmp)->otyp == RUBBER_HOSE) -#else -#define is_flimsy(otmp) (objects[(otmp)->otyp].oc_material <= LEATHER) -#endif /* helpers, simple enough to be macros */ #define is_plural(o) ((o)->quan > 1 || \ diff --git a/src/bones.c b/src/bones.c index 1d3b54eec..e6c33a262 100644 --- a/src/bones.c +++ b/src/bones.c @@ -372,9 +372,7 @@ struct obj *corpse; (mptr == &mons[PM_ORACLE] && !fixuporacle(mtmp))) mongone(mtmp); } -#ifdef STEED if (u.usteed) dismount_steed(DISMOUNT_BONES); -#endif dmonsfree(); /* discard dead or gone monsters */ /* mark all fruits as nonexistent; when we come to them we'll mark diff --git a/src/makemon.c b/src/makemon.c index 11051eab5..72f3ae6b9 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -313,14 +313,12 @@ register struct monst *mtmp; } } break; -# ifdef KOPS case S_KOP: /* create Keystone Kops with cream pies to * throw. As suggested by KAA. [MRS] */ if (!rn2(4)) m_initthrow(mtmp, CREAM_PIE, 2); if (!rn2(3)) (void)mongets(mtmp,(rn2(2)) ? CLUB : RUBBER_HOSE); break; -# endif case S_ORC: if(rn2(2)) (void)mongets(mtmp, ORCISH_HELM); switch (mm != PM_ORC_CAPTAIN ? mm : diff --git a/src/mon.c b/src/mon.c index 917e919c9..5be8c8e8a 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1626,7 +1626,6 @@ register struct monst *mtmp; if (tmp == PM_MAIL_DAEMON) mvitals[tmp].mvflags |= G_GENOD; #endif -#ifdef KOPS if (mtmp->data->mlet == S_KOP) { /* Dead Kops may come back. */ switch(rnd(5)) { @@ -1640,7 +1639,6 @@ register struct monst *mtmp; break; } } -#endif if(mtmp->iswiz) wizdead(); if(mtmp->data->msound == MS_NEMESIS) nemdead(); if(glyph_is_invisible(levl[mtmp->mx][mtmp->my].glyph)) @@ -1992,10 +1990,8 @@ int dest; if (!rn2(6) && !(mvitals[mndx].mvflags & G_NOCORPSE) && /* no extra item from swallower or steed */ (x != u.ux || y != u.uy) && -#ifdef KOPS /* no extra item from kops--too easy to abuse */ mdat->mlet != S_KOP && -#endif /* reduced chance of item from cloned monster */ (!mtmp->mcloned || !rn2(mvitals[mndx].died / 5 + 1))) { otmp = mkobj(RANDOM_CLASS, TRUE); diff --git a/src/mondata.c b/src/mondata.c index 2cdf41cef..98c3244f5 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -858,11 +858,9 @@ static const short grownups[][2] = { {PM_ACOLYTE, PM_PRIEST}, {PM_APPRENTICE, PM_WIZARD}, {PM_MANES,PM_LEMURE}, -#ifdef KOPS {PM_KEYSTONE_KOP, PM_KOP_SERGEANT}, {PM_KOP_SERGEANT, PM_KOP_LIEUTENANT}, {PM_KOP_LIEUTENANT, PM_KOP_KAPTAIN}, -#endif {NON_PM,NON_PM} }; diff --git a/src/monst.c b/src/monst.c index d774d1f2a..b85449ca2 100644 --- a/src/monst.c +++ b/src/monst.c @@ -1595,7 +1595,6 @@ struct permonst _mons2[] = { M1_ANIMAL|M1_FLY|M1_CARNIVORE, M2_HOSTILE|M2_STRONG|M2_NASTY|M2_COLLECT, M3_INFRAVISIBLE, HI_LORD), #endif -#ifdef KOPS /* * Kops */ @@ -1627,7 +1626,6 @@ struct permonst _mons2[] = { SIZ(WT_HUMAN, 200, MS_ARREST, MZ_HUMAN), 0, 0, M1_HUMANOID, M2_HUMAN|M2_WANDER|M2_HOSTILE|M2_STRONG|M2_MALE|M2_COLLECT, M3_INFRAVISIBLE, HI_LORD), -#endif /* * Liches */ diff --git a/src/muse.c b/src/muse.c index cc540ebb0..a404071c7 100644 --- a/src/muse.c +++ b/src/muse.c @@ -920,11 +920,8 @@ struct monst *mtmp; int trycnt = 0; if(is_animal(pm) || attacktype(pm, AT_EXPL) || mindless(mtmp->data) - || pm->mlet == S_GHOST -# ifdef KOPS - || pm->mlet == S_KOP -# endif - ) return 0; + || pm->mlet == S_GHOST || pm->mlet == S_KOP) + return 0; try_again: switch (rn2(8 + (difficulty > 3) + (difficulty > 6) + (difficulty > 8))) { @@ -1535,11 +1532,8 @@ struct monst *mtmp; int difficulty = monstr[(monsndx(pm))]; if(is_animal(pm) || attacktype(pm, AT_EXPL) || mindless(mtmp->data) - || pm->mlet == S_GHOST -# ifdef KOPS - || pm->mlet == S_KOP -# endif - ) return 0; + || pm->mlet == S_GHOST || pm->mlet == S_KOP) + return 0; if (difficulty > 7 && !rn2(35)) return WAN_DEATH; switch (rn2(9 - (difficulty < 4) + 4 * (difficulty > 6))) { case 0: { @@ -1943,11 +1937,8 @@ struct monst *mtmp; int difficulty = monstr[(monsndx(pm))]; if(is_animal(pm) || attacktype(pm, AT_EXPL) || mindless(mtmp->data) - || pm->mlet == S_GHOST -# ifdef KOPS - || pm->mlet == S_KOP -# endif - ) return 0; + || pm->mlet == S_GHOST || pm->mlet == S_KOP) + return 0; /* Unlike other rnd_item functions, we only allow _weak_ monsters * to have this item; after all, the item will be used to strengthen * the monster and strong monsters won't use it at all... diff --git a/src/objects.c b/src/objects.c index 86d65a214..1de8dfffe 100644 --- a/src/objects.c +++ b/src/objects.c @@ -242,10 +242,8 @@ WEAPON("war hammer", (char *)0, /* +1 small */ WEAPON("club", (char *)0, 1, 0, 0, 12, 30, 3, 6, 3, 0, B, P_CLUB, WOOD, HI_WOOD), -#ifdef KOPS WEAPON("rubber hose", (char *)0, 1, 0, 0, 0, 20, 3, 4, 3, 0, B, P_WHIP, PLASTIC, CLR_BROWN), -#endif WEAPON("quarterstaff", "staff", 0, 0, 1, 11, 40, 5, 6, 6, 0, B, P_QUARTERSTAFF, WOOD, HI_WOOD), /* two-piece */ diff --git a/src/shk.c b/src/shk.c index 7a4edcbdc..63596950f 100644 --- a/src/shk.c +++ b/src/shk.c @@ -13,11 +13,9 @@ #define PAY_SKIP (-1) #define PAY_BROKE (-2) -#ifdef KOPS STATIC_DCL void FDECL(makekops, (coord *)); STATIC_DCL void FDECL(call_kops, (struct monst *,BOOLEAN_P)); STATIC_DCL void FDECL(kops_gone, (BOOLEAN_P)); -#endif /* KOPS */ #define NOTANGRY(mon) ((mon)->mpeaceful) #define ANGRY(mon) (!NOTANGRY(mon)) @@ -313,7 +311,6 @@ register struct monst *shkp; return(total); } -#ifdef KOPS STATIC_OVL void call_kops(shkp, nearshop) register struct monst *shkp; @@ -364,7 +361,6 @@ register boolean nearshop; makekops(&mm); } } -#endif /* KOPS */ /* x,y is strictly inside shop */ char @@ -420,11 +416,7 @@ boolean newlev; } if (rob_shop(shkp)) { -#ifdef KOPS call_kops(shkp, (!newlev && levl[u.ux0][u.uy0].edge)); -#else - (void) angry_guards(FALSE); -#endif } } @@ -445,12 +437,8 @@ xchar x, y; return; if (rob_shop(shkp)) { -#ifdef KOPS /*[might want to set 2nd arg based on distance from shop doorway]*/ call_kops(shkp, FALSE); -#else - (void) angry_guards(FALSE); -#endif } } @@ -941,11 +929,7 @@ register boolean killkops; (void) mnearto(shkp, x, y, TRUE); level.flags.has_shop = 1; if (killkops) { -#ifdef KOPS kops_gone(TRUE); -#else - You_feel("vaguely apprehensive."); -#endif pacify_guards(); } after_shk_move(shkp); @@ -1065,9 +1049,7 @@ make_happy_shoppers(silentkops) boolean silentkops; { if (!angry_shk_exists()) { -#ifdef KOPS kops_gone(silentkops); -#endif pacify_guards(); } } @@ -3655,7 +3637,6 @@ register int fall; } } -#ifdef KOPS STATIC_OVL void makekops(mm) coord *mm; @@ -3680,7 +3661,6 @@ coord *mm; (void) makemon(&mons[mndx], mm->x, mm->y, NO_MM_FLAGS); } } -#endif /* KOPS */ void pay_for_damage(dmgstr, cant_mollify) @@ -4052,7 +4032,6 @@ struct monst *shkp; pline("%s talks about the problem of shoplifters.",shkname(shkp)); } -#ifdef KOPS STATIC_OVL void kops_gone(silent) register boolean silent; @@ -4071,7 +4050,6 @@ register boolean silent; pline_The("Kop%s (disappointed) vanish%s into thin air.", plur(cnt), cnt == 1 ? "es" : ""); } -#endif /* KOPS */ STATIC_OVL long cost_per_charge(shkp, otmp, altusage) diff --git a/src/sit.c b/src/sit.c index 4b8e2e7d1..c91a96a24 100644 --- a/src/sit.c +++ b/src/sit.c @@ -43,12 +43,10 @@ dosit() register struct trap *trap = t_at(u.ux,u.uy); register int typ = levl[u.ux][u.uy].typ; -#ifdef STEED if (u.usteed) { You("are already sitting on %s.", mon_nam(u.usteed)); return (0); } -#endif if (u.uundetected && is_hider(youmonst.data) && u.umonnum != PM_TRAPPER) u.uundetected = 0; /* no longer on the ceiling */ diff --git a/src/sounds.c b/src/sounds.c index 27749d8b0..bd20178c0 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -834,7 +834,6 @@ register struct monst *mtmp; } } break; -#ifdef KOPS case MS_ARREST: if (mtmp->mpeaceful) verbalize("Just the facts, %s.", @@ -848,7 +847,6 @@ register struct monst *mtmp; verbl_msg = arrest_msg[rn2(3)]; } break; -#endif case MS_BRIBE: if (mtmp->mpeaceful && !mtmp->mtame) { (void) demon_talk(mtmp); diff --git a/src/weapon.c b/src/weapon.c index fc3258c6b..796fba66a 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -370,7 +370,6 @@ static NEARDATA const int rwep[] = ORCISH_ARROW, CROSSBOW_BOLT, SILVER_DAGGER, ELVEN_DAGGER, DAGGER, ORCISH_DAGGER, KNIFE, FLINT, ROCK, LOADSTONE, LUCKSTONE, DART, /* BOOMERANG, */ CREAM_PIE - /* note: CREAM_PIE should NOT be #ifdef KOPS */ }; static NEARDATA const int pwep[] = @@ -389,16 +388,12 @@ register struct monst *mtmp; boolean mweponly; int i; -#ifdef KOPS char mlet = mtmp->data->mlet; -#endif propellor = &zeroobj; Oselect(EGG); /* cockatrice egg */ -#ifdef KOPS if(mlet == S_KOP) /* pies are first choice for Kops */ Oselect(CREAM_PIE); -#endif if(throws_rocks(mtmp->data)) /* ...boulders for giants */ Oselect(BOULDER); @@ -508,12 +503,8 @@ static const NEARDATA short hwep[] = { MORNING_STAR, ELVEN_SHORT_SWORD, DWARVISH_SHORT_SWORD, SHORT_SWORD, ORCISH_SHORT_SWORD, MACE, AXE, DWARVISH_SPEAR, SILVER_SPEAR, ELVEN_SPEAR, SPEAR, ORCISH_SPEAR, FLAIL, BULLWHIP, QUARTERSTAFF, - JAVELIN, AKLYS, CLUB, PICK_AXE, -#ifdef KOPS - RUBBER_HOSE, -#endif /* KOPS */ - WAR_HAMMER, SILVER_DAGGER, ELVEN_DAGGER, DAGGER, ORCISH_DAGGER, - ATHAME, SCALPEL, KNIFE, WORM_TOOTH + JAVELIN, AKLYS, CLUB, PICK_AXE, RUBBER_HOSE, WAR_HAMMER, SILVER_DAGGER, + ELVEN_DAGGER, DAGGER, ORCISH_DAGGER, ATHAME, SCALPEL, KNIFE, WORM_TOOTH }; struct obj * diff --git a/util/makedefs.c b/util/makedefs.c index c4ac5f3b5..57493448b 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -995,11 +995,8 @@ make_version() | (1L << 2) #endif /* monsters (5..9) */ -#ifdef KOPS - | (1L << 6) -#endif #ifdef MAIL - | (1L << 7) + | (1L << 6) #endif /* objects (10..14) */ #ifdef TOURIST @@ -1263,9 +1260,6 @@ static const char *build_opts[] = { #ifdef INSURANCE "insurance files for recovering from crashes", #endif -#ifdef KOPS - "Keystone Kops", -#endif #ifdef HOLD_LOCKFILE_OPEN "exclusive lock on level 0 file", #endif diff --git a/win/share/tilemap.c b/win/share/tilemap.c index 9672b6568..97fc7acc4 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -42,12 +42,6 @@ struct conditionals { { MON_GLYPH, PM_BABY_SILVER_DRAGON, "baby shimmering dragon" }, { MON_GLYPH, PM_SILVER_DRAGON, "shimmering dragon" }, { MON_GLYPH, PM_JABBERWOCK, "vorpal jabberwock" }, -#ifndef KOPS - { MON_GLYPH, PM_JABBERWOCK, "Keystone Kop" }, - { MON_GLYPH, PM_JABBERWOCK, "Kop Sergeant" }, - { MON_GLYPH, PM_JABBERWOCK, "Kop Lieutenant" }, - { MON_GLYPH, PM_JABBERWOCK, "Kop Kaptain" }, -#endif { MON_GLYPH, PM_VAMPIRE_LORD, "vampire mage" }, #ifndef CHARON /* not supported yet */ { MON_GLYPH, PM_CROESUS, "Charon" }, @@ -69,9 +63,6 @@ struct conditionals { { MON_GLYPH, PM_NEANDERTHAL, "High-elf" }, #ifndef TOURIST { MON_GLYPH, PM_ROSHI, "guide" }, -#endif -#ifndef KOPS - { OBJ_GLYPH, CLUB, "rubber hose" }, #endif /* objects commented out in objects.c at present */ { OBJ_GLYPH, SILVER_DRAGON_SCALE_MAIL, "shimmering dragon scale mail" }, From 44ca9fc16aad29d5e22a0ce12f0323fb6dbe77b1 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 13 Feb 2015 23:30:38 -0500 Subject: [PATCH 124/354] Make SINKS unconditional. --- dat/oracles.txt | 2 +- include/config.h | 1 - include/extern.h | 2 -- src/cmd.c | 2 -- src/dig.c | 4 ---- src/do.c | 6 ------ src/dogmove.c | 2 -- src/dokick.c | 4 ---- src/drawing.c | 4 ---- src/fountain.c | 2 -- src/hack.c | 6 ------ src/invent.c | 2 -- src/mklev.c | 7 ------- src/mthrowu.c | 5 +---- src/music.c | 2 -- src/objnam.c | 2 -- src/potion.c | 2 -- src/sit.c | 2 -- src/sounds.c | 2 -- src/zap.c | 4 ---- util/lev_main.c | 5 ----- util/makedefs.c | 9 --------- win/share/tilemap.c | 21 ++++----------------- 23 files changed, 6 insertions(+), 92 deletions(-) diff --git a/dat/oracles.txt b/dat/oracles.txt index d307c7a9f..d4d5ae250 100644 --- a/dat/oracles.txt +++ b/dat/oracles.txt @@ -48,7 +48,7 @@ It is well known that wily shopkeepers raise their prices whene'er they espy the garish apparel of the approaching tourist or the countenance of a disfavored patron. They favor the gentle of manner and the fair of face. The boor may expect unprofitable transactions. ------ SINKS +----- The cliche of the kitchen sink swallowing any unfortunate rings that contact its pernicious surface reflecteth greater truth than many homilies, yet even so, few have developed the skill to identify enchanted rings by the diff --git a/include/config.h b/include/config.h index 3e06382b8..5fb8bd9a8 100644 --- a/include/config.h +++ b/include/config.h @@ -418,7 +418,6 @@ typedef unsigned char uchar; /* display features */ #define LOADSYMSETS /* loadable symbol sets; only default symbols w/o this */ /* dungeon features */ -#define SINKS /* Kitchen sinks - Janet Walz */ /* dungeon levels */ #define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */ #define REINCARNATION /* Special Rogue-like levels */ diff --git a/include/extern.h b/include/extern.h index 866da61ec..8ffac991d 100644 --- a/include/extern.h +++ b/include/extern.h @@ -784,10 +784,8 @@ E void FDECL(gush, (int,int,genericptr_t)); E void FDECL(dryup, (XCHAR_P,XCHAR_P, BOOLEAN_P)); E void NDECL(drinkfountain); E void FDECL(dipfountain, (struct obj *)); -#ifdef SINKS E void FDECL(breaksink, (int,int)); E void NDECL(drinksink); -#endif /* ### hack.c ### */ diff --git a/src/cmd.c b/src/cmd.c index 78981c274..2abb73a07 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -876,11 +876,9 @@ wiz_map_levltyp(VOID_ARGS) if (level.flags.nfountains) Sprintf(eos(dsc), " %c:%d", defsyms[S_fountain].sym, (int)level.flags.nfountains); -#ifdef SINKS if (level.flags.nsinks) Sprintf(eos(dsc), " %c:%d", defsyms[S_sink].sym, (int)level.flags.nsinks); -#endif if (level.flags.has_vault) Strcat(dsc, " vault"); if (level.flags.has_shop) Strcat(dsc, " shop"); if (level.flags.has_temple) Strcat(dsc, " temple"); diff --git a/src/dig.c b/src/dig.c index ae4571218..dee64940c 100644 --- a/src/dig.c +++ b/src/dig.c @@ -542,11 +542,9 @@ int ttyp; SET_FOUNTAIN_WARNED(x,y); /* force dryup */ dryup(x, y, madeby_u); return; -#ifdef SINKS } else if (IS_SINK(lev->typ)) { breaksink(x, y); return; -#endif } else if (lev->typ == DRAWBRIDGE_DOWN || (is_drawbridge_wall(x, y) >= 0)) { int bx = x, by = y; @@ -1533,11 +1531,9 @@ char *msg; } else if (is_pool(cc->x,cc->y)) { } else if (IS_GRAVE(ltyp)) { #endif -#ifdef SINKS } else if (IS_SINK(ltyp)) { Strcpy(msg, "A tangled mass of plumbing remains below the sink."); return FALSE; -#endif } else if ((cc->x == xupladder && cc->y == yupladder) || /* "ladder up" */ (cc->x == xdnladder && cc->y == ydnladder)) { /* "ladder down" */ Strcpy(msg, "The ladder is unaffected."); diff --git a/src/do.c b/src/do.c index 1f51c14cc..35b0b9c40 100644 --- a/src/do.c +++ b/src/do.c @@ -8,10 +8,8 @@ #include "hack.h" #include "lev.h" -#ifdef SINKS STATIC_DCL void FDECL(trycall, (struct obj *)); STATIC_DCL void FDECL(dosinkring, (struct obj *)); -#endif /* SINKS */ STATIC_PTR int FDECL(drop, (struct obj *)); STATIC_PTR int NDECL(wipeoff); @@ -244,7 +242,6 @@ doaltarobj(obj) /* obj is an object dropped on an altar */ } } -#ifdef SINKS STATIC_OVL void trycall(obj) @@ -396,7 +393,6 @@ giveback: } else useup(obj); } -#endif /* some common tests when trying to drop or throw items */ boolean @@ -475,13 +471,11 @@ register struct obj *obj; mbodypart(u.ustuck, STOMACH)); } } else { -#ifdef SINKS if((obj->oclass == RING_CLASS || obj->otyp == MEAT_RING) && IS_SINK(levl[u.ux][u.uy].typ)) { dosinkring(obj); return(1); } -#endif if (!can_reach_floor(TRUE)) { /* we might be levitating due to #invoke Heart of Ahriman; if so, levitation would end during call to freeinv() diff --git a/src/dogmove.c b/src/dogmove.c index 6baa47651..795905393 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -1001,9 +1001,7 @@ static struct qmchoices { {PM_HOUSECAT, 0, PM_DOG, M_AP_MONSTER}, {PM_LARGE_CAT, 0, PM_LARGE_DOG, M_AP_MONSTER}, {PM_HOUSECAT, 0, PM_GIANT_RAT, M_AP_MONSTER}, -#ifdef SINKS {0, S_DOG, SINK, M_AP_FURNITURE}, /* sorry, no fire hydrants in NetHack */ -#endif {0, 0, TRIPE_RATION, M_AP_OBJECT}, /* leave this at end */ }; diff --git a/src/dokick.c b/src/dokick.c index 1b122e799..d0b20a604 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -688,9 +688,7 @@ char *buf; else if (IS_THRONE(maploc->typ)) what = "a throne"; else if (IS_FOUNTAIN(maploc->typ)) what = "a fountain"; else if (IS_GRAVE(maploc->typ)) what = "a headstone"; -#ifdef SINKS else if (IS_SINK(maploc->typ)) what = "a sink"; -#endif else if (IS_ALTAR(maploc->typ)) what = "an altar"; else if (IS_DRAWBRIDGE(maploc->typ)) what = "a drawbridge"; else if (maploc->typ == STAIRS) what = "the stairs"; @@ -1054,7 +1052,6 @@ dokick() } goto ouch; } -#ifdef SINKS if(IS_SINK(maploc->typ)) { int gend = poly_gender(); short washerndx = (gend == 1 || (gend == 2 && rn2(2))) ? @@ -1107,7 +1104,6 @@ dokick() } goto ouch; } -#endif if (maploc->typ == STAIRS || maploc->typ == LADDER || IS_STWALL(maploc->typ)) { if(!IS_STWALL(maploc->typ) && maploc->ladder == LA_DOWN) diff --git a/src/drawing.c b/src/drawing.c index 2d104be20..80e82133f 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -169,11 +169,7 @@ const struct symdef defsyms[MAXPCHARS] = { {'_', "altar", C(CLR_GRAY)}, /* altar */ {'|', "grave", C(CLR_GRAY)}, /* grave */ {'\\', "opulent throne",C(HI_GOLD)}, /* throne */ -#ifdef SINKS {'#', "sink", C(CLR_GRAY)}, /* sink */ -#else - {'#', "", C(CLR_GRAY)}, /* sink */ -#endif /*30*/ {'{', "fountain", C(CLR_BLUE)}, /* fountain */ {'}', "water", C(CLR_BLUE)}, /* pool */ {'.', "ice", C(CLR_CYAN)}, /* ice */ diff --git a/src/fountain.c b/src/fountain.c index 14fb6707e..c49efac69 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -504,7 +504,6 @@ register struct obj *obj; dryup(u.ux, u.uy, TRUE); } -#ifdef SINKS void breaksink(x,y) int x, y; @@ -610,6 +609,5 @@ drinksink() rn2(3) ? (rn2(2) ? "cold" : "warm") : "hot"); } } -#endif /* SINKS */ /*fountain.c*/ diff --git a/src/hack.c b/src/hack.c index fc62e71a4..1bbfa1977 100644 --- a/src/hack.c +++ b/src/hack.c @@ -10,9 +10,7 @@ STATIC_DCL void NDECL(maybe_wail); STATIC_DCL int NDECL(moverock); STATIC_DCL int FDECL(still_chewing,(XCHAR_P,XCHAR_P)); -#ifdef SINKS STATIC_DCL void NDECL(dosinkfall); -#endif STATIC_DCL boolean FDECL(findtravelpath, (BOOLEAN_P)); STATIC_DCL boolean FDECL(trapmove, (int,int,struct trap *)); STATIC_DCL void NDECL(switch_terrain); @@ -468,7 +466,6 @@ register xchar ox, oy; newsym(ox, oy); } -#ifdef SINKS static NEARDATA const char fell_on_sink[] = "fell onto a sink"; STATIC_OVL void @@ -549,7 +546,6 @@ dosinkfall() through float_down(), but make sure BFlying is up to date */ float_vs_flight(); } -#endif boolean may_dig(x,y) @@ -1767,10 +1763,8 @@ boolean pick; if (pooleffects(TRUE)) goto spotdone; check_special_room(FALSE); -#ifdef SINKS if(IS_SINK(levl[u.ux][u.uy].typ) && Levitation) dosinkfall(); -#endif if (!in_steed_dismounting) { /* if dismounting, we'll check again later */ boolean pit; diff --git a/src/invent.c b/src/invent.c index c6eea5989..90cb9ff1c 100644 --- a/src/invent.c +++ b/src/invent.c @@ -2364,10 +2364,8 @@ char *buf; cmap = S_ice; /* "ice" */ else if (is_pool(x,y)) dfeature = "pool of water"; -#ifdef SINKS else if (IS_SINK(ltyp)) cmap = S_sink; /* "sink" */ -#endif else if (IS_ALTAR(ltyp)) { Sprintf(altbuf, "%saltar to %s (%s)", ((lev->altarmask & AM_SHRINE) && diff --git a/src/mklev.c b/src/mklev.c index 8e3b267d1..1d895dc2c 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -20,9 +20,7 @@ STATIC_DCL void FDECL(mkfount,(int,struct mkroom *)); -#ifdef SINKS STATIC_DCL void FDECL(mksink,(struct mkroom *)); -#endif STATIC_DCL void FDECL(mkaltar,(struct mkroom *)); STATIC_DCL void FDECL(mkgrave,(struct mkroom *)); STATIC_DCL void NDECL(makevtele); @@ -790,9 +788,7 @@ skip0: if(Is_rogue_level(&u.uz)) goto skip_nonrogue; #endif if(!rn2(10)) mkfount(0,croom); -#ifdef SINKS if(!rn2(60)) mksink(croom); -#endif if(!rn2(60)) mkaltar(croom); x = 80 - (depth(&u.uz) * 2); if (x < 2) x = 2; @@ -1347,7 +1343,6 @@ register struct mkroom *croom; level.flags.nfountains++; } -#ifdef SINKS STATIC_OVL void mksink(croom) register struct mkroom *croom; @@ -1366,8 +1361,6 @@ register struct mkroom *croom; level.flags.nsinks++; } -#endif /* SINKS */ - STATIC_OVL void mkaltar(croom) diff --git a/src/mthrowu.c b/src/mthrowu.c index 02339c0ad..8a9ed6736 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -431,11 +431,8 @@ struct obj *obj; /* missile (or stack providing it) */ /* missile might hit iron bars */ || (levl[bhitpos.x+dx][bhitpos.y+dy].typ == IRONBARS && hits_bars(&singleobj, bhitpos.x, bhitpos.y, !rn2(5), 0)) -#ifdef SINKS /* Thrown objects "sink" */ - || IS_SINK(levl[bhitpos.x][bhitpos.y].typ) -#endif - ) { + || IS_SINK(levl[bhitpos.x][bhitpos.y].typ)) { if (singleobj) /* hits_bars might have destroyed it */ (void) drop_throw(singleobj, 0, bhitpos.x, bhitpos.y); break; diff --git a/src/music.c b/src/music.c index 4491b8909..94f6282d1 100644 --- a/src/music.c +++ b/src/music.c @@ -275,12 +275,10 @@ int force; if (cansee(x,y)) pline_The("fountain falls into a chasm."); goto do_pit; -#ifdef SINKS case SINK : if (cansee(x,y)) pline_The("kitchen sink falls into a chasm."); goto do_pit; -#endif case ALTAR : if (Is_astralevel(&u.uz) || Is_sanctum(&u.uz)) break; diff --git a/src/objnam.c b/src/objnam.c index 94c2f4fb6..e1b00a777 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -2913,7 +2913,6 @@ wiztrap: newsym(x, y); return(&zeroobj); } -# ifdef SINKS if (!BSTRCMPI(bp, p-4, "sink")) { lev->typ = SINK; level.flags.nsinks++; @@ -2921,7 +2920,6 @@ wiztrap: newsym(x, y); return &zeroobj; } -# endif /* ("water" matches "potion of water" rather than terrain) */ if (!BSTRCMPI(bp, p-4, "pool") || !BSTRCMPI(bp, p-4, "moat")) { lev->typ = !BSTRCMPI(bp, p-4, "pool") ? POOL : MOAT; diff --git a/src/potion.c b/src/potion.c index 396dbfa53..7a4014635 100644 --- a/src/potion.c +++ b/src/potion.c @@ -399,7 +399,6 @@ dodrink() return 1; } } -#ifdef SINKS /* Or a kitchen sink? */ if (IS_SINK(levl[u.ux][u.uy].typ) && /* not as low as floor level but similar restrictions apply */ @@ -409,7 +408,6 @@ dodrink() return 1; } } -#endif /* Or are you surrounded by water? */ if (Underwater && !u.uswallow) { diff --git a/src/sit.c b/src/sit.c index c91a96a24..72c94c56b 100644 --- a/src/sit.c +++ b/src/sit.c @@ -126,11 +126,9 @@ dosit() (void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst); if (!rn2(10) && uarmf && uarmf->otyp != WATER_WALKING_BOOTS) (void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst); -#ifdef SINKS } else if(IS_SINK(typ)) { You(sit_message, defsyms[S_sink].explanation); Your("%s gets wet.", humanoid(youmonst.data) ? "rump" : "underside"); -#endif } else if(IS_ALTAR(typ)) { You(sit_message, defsyms[S_altar].explanation); altar_wrath(u.ux, u.uy); diff --git a/src/sounds.c b/src/sounds.c index bd20178c0..efb496372 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -51,7 +51,6 @@ dosounds() }; You_hear1(fountain_msg[rn2(3)+hallu]); } -#ifdef SINK if (level.flags.nsinks && !rn2(300)) { static const char * const sink_msg[3] = { "a slow drip.", @@ -60,7 +59,6 @@ dosounds() }; You_hear1(sink_msg[rn2(2)+hallu]); } -#endif if (level.flags.has_court && !rn2(200)) { static const char * const throne_msg[4] = { "the tones of courtly conversation.", diff --git a/src/zap.c b/src/zap.c index 41723a566..c19557fd0 100644 --- a/src/zap.c +++ b/src/zap.c @@ -3160,10 +3160,8 @@ struct obj **pobj; /* object tossed/used, set to NULL (is_pool(bhitpos.x, bhitpos.y) || is_lava(bhitpos.x, bhitpos.y))) break; -#ifdef SINKS if(IS_SINK(typ) && weapon != FLASHED_LIGHT) break; /* physical objects fall onto sink */ -#endif } /* limit range of ball so hero won't make an invalid move */ if (weapon == THROWN_WEAPON && range > 0 && @@ -3273,10 +3271,8 @@ int dx, dy; } tmp_at(bhitpos.x, bhitpos.y); delay_output(); -#ifdef SINKS if(IS_SINK(levl[bhitpos.x][bhitpos.y].typ)) break; /* boomerang falls on sink */ -#endif /* ct==0, initial position, we want next delta to be same; ct==5, opposite position, repeat delta undoes first one */ if (ct % 5 != 0) i += (counterclockwise ? -1 : 1); diff --git a/util/lev_main.c b/util/lev_main.c index d192e1e3e..fa539f5e2 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -494,12 +494,7 @@ char c; case '{' : return(FOUNTAIN); case '\\' : return(THRONE); case 'K' : -#ifdef SINKS return(SINK); -#else - yywarning("Sinks are not allowed in this version! Ignoring..."); - return(ROOM); -#endif case '}' : return(MOAT); case 'P' : return(POOL); case 'L' : return(LAVAPOOL); diff --git a/util/makedefs.c b/util/makedefs.c index 57493448b..6ddff76c0 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -990,9 +990,6 @@ make_version() /* levels and/or topology (0..4) */ #ifdef REINCARNATION | (1L << 1) -#endif -#ifdef SINKS - | (1L << 2) #endif /* monsters (5..9) */ #ifdef MAIL @@ -1329,9 +1326,6 @@ static const char *build_opts[] = { #ifdef SHELL "shell command", #endif -#ifdef SINKS - "sinks", -#endif #ifdef SUSPEND "suspend command", #endif @@ -1664,9 +1658,6 @@ h_filter(line) if (*line == '#') return TRUE; /* ignore comment lines */ if (sscanf(line, "----- %s", tag) == 1) { skip = FALSE; -#ifndef SINKS - if (!strcmp(tag, "SINKS")) skip = TRUE; -#endif } else if (skip && !strncmp(line, "-----", 5)) skip = FALSE; return skip; diff --git a/win/share/tilemap.c b/win/share/tilemap.c index 97fc7acc4..19872f96a 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 tilemap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 tilemap.c $NHDT-Date: 1425082379 2015/02/28 00:12:59 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.12 $ */ /* NetHack 3.5 tilemap.c $Date: 2009/05/06 10:59:02 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)tilemap.c 3.5 2000/06/04 */ /* NetHack may be freely redistributed. See license for details. */ @@ -172,23 +172,10 @@ int set, entry; tilenum = 0; /* set-relative number */ for (i = 0; i < (MAXPCHARS - MAXEXPCHARS); i++) { if (set == OTH_GLYPH && tilenum == entry) { - if (*defsyms[i].explanation) + if (*defsyms[i].explanation) { return defsyms[i].explanation; - else { - /* if SINKS are turned off, this - * string won't be there (and can't be there - * to prevent symbol-identification and - * special-level mimic appearances from - * thinking the items exist) - */ - switch (i) { - case S_sink: - Sprintf(buf, "sink"); - break; - default: - Sprintf(buf, "cmap %d", tilenum); - break; - } + } else { + Sprintf(buf, "cmap %d", tilenum); return buf; } } From bb647dc33c69e695df058d3940642167bce41408 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 13 Feb 2015 23:31:41 -0500 Subject: [PATCH 125/354] Make TOURIST unconditional. --- include/artilist.h | 2 -- include/config.h | 1 - include/decl.h | 2 -- include/extern.h | 2 -- include/prop.h | 6 ---- src/apply.c | 8 ----- src/artifact.c | 6 +--- src/attrib.c | 4 --- src/decl.c | 2 -- src/do_wear.c | 73 ++++++--------------------------------------- src/dogmove.c | 8 ----- src/dokick.c | 5 +--- src/dothrow.c | 4 --- src/invent.c | 19 ++---------- src/lock.c | 23 ++------------ src/mhitu.c | 20 ++----------- src/mkobj.c | 2 -- src/mon.c | 2 -- src/monmove.c | 4 --- src/monst.c | 8 ----- src/mplayer.c | 2 -- src/mthrowu.c | 2 -- src/muse.c | 7 ++--- src/objects.c | 15 ---------- src/objnam.c | 4 --- src/polyself.c | 4 --- src/pray.c | 4 --- src/read.c | 4 --- src/role.c | 6 ---- src/shk.c | 10 ++----- src/sounds.c | 4 --- src/steal.c | 9 +----- src/trap.c | 8 ----- src/u_init.c | 14 --------- src/uhitm.c | 6 ---- src/vault.c | 5 +--- src/worn.c | 18 +---------- src/zap.c | 6 ---- sys/amiga/winami.c | 8 ----- util/makedefs.c | 10 +------ win/Qt/qt_win.cpp | 5 ---- win/gnome/gnworn.c | 11 ------- win/share/tilemap.c | 15 ---------- 43 files changed, 27 insertions(+), 351 deletions(-) diff --git a/include/artilist.h b/include/artilist.h index 2f21d6839..b13a91abd 100644 --- a/include/artilist.h +++ b/include/artilist.h @@ -215,13 +215,11 @@ A("The Tsurugi of Muramasa", TSURUGI, PHYS(0,8), NO_DFNS, NO_CARY, 0, A_LAWFUL, PM_SAMURAI, NON_PM, 4500L ), -#ifdef TOURIST A("The Platinum Yendorian Express Card", CREDIT_CARD, (SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL|SPFX_DEFN), (SPFX_ESP|SPFX_HSPDAM), 0, NO_ATTK, NO_DFNS, CARY(AD_MAGM), CHARGE_OBJ, A_NEUTRAL, PM_TOURIST, NON_PM, 7000L ), -#endif A("The Orb of Fate", CRYSTAL_BALL, (SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL|SPFX_LUCK), diff --git a/include/config.h b/include/config.h index 5fb8bd9a8..c9b17524d 100644 --- a/include/config.h +++ b/include/config.h @@ -423,7 +423,6 @@ typedef unsigned char uchar; #define REINCARNATION /* Special Rogue-like levels */ /* monsters & objects */ #define SEDUCE /* Succubi/incubi seduction, by KAA, suggested by IM */ -#define TOURIST /* Tourist players with cameras and Hawaiian shirts */ /* I/O */ #define REDO /* support for redoing last command - DGK */ #if !defined(MAC) diff --git a/include/decl.h b/include/decl.h index 3e7e94ac3..bfe3052db 100644 --- a/include/decl.h +++ b/include/decl.h @@ -234,9 +234,7 @@ E uchar monsyms[MAXMCLASSES]; /* current class symbols */ #include "obj.h" E NEARDATA struct obj *invent, *uarm, *uarmc, *uarmh, *uarms, *uarmg, *uarmf, -#ifdef TOURIST *uarmu, /* under-wear, so to speak */ -#endif *uskin, *uamul, *uleft, *uright, *ublindf, *uwep, *uswapwep, *uquiver; diff --git a/include/extern.h b/include/extern.h index 8ffac991d..667d598d1 100644 --- a/include/extern.h +++ b/include/extern.h @@ -429,9 +429,7 @@ E int NDECL(Gloves_off); E int NDECL(Boots_off); E int NDECL(Cloak_off); E int NDECL(Shield_off); -#ifdef TOURIST E int NDECL(Shirt_off); -#endif E void NDECL(Amulet_off); E void FDECL(Ring_on, (struct obj *)); E void FDECL(Ring_off, (struct obj *)); diff --git a/include/prop.h b/include/prop.h index 2ca7b871d..89728fa9f 100644 --- a/include/prop.h +++ b/include/prop.h @@ -96,12 +96,8 @@ struct prop { # define W_ARMS 0x00000008L /* Shield */ # define W_ARMG 0x00000010L /* Gloves/gauntlets */ # define W_ARMF 0x00000020L /* Footwear */ -#ifdef TOURIST # define W_ARMU 0x00000040L /* Undershirt */ # define W_ARMOR (W_ARM | W_ARMC | W_ARMH | W_ARMS | W_ARMG | W_ARMF | W_ARMU) -#else -# define W_ARMOR (W_ARM | W_ARMC | W_ARMH | W_ARMS | W_ARMG | W_ARMF) -#endif /* Weapons and artifacts */ # define W_WEP 0x00000100L /* Wielded weapon */ # define W_QUIVER 0x00000200L /* Quiver for (f)iring ammo */ @@ -149,8 +145,6 @@ struct prop { #define WORN_BOOTS W_ARMF #define WORN_AMUL W_AMUL #define WORN_BLINDF W_TOOL -#ifdef TOURIST #define WORN_SHIRT W_ARMU -#endif #endif /* PROP_H */ diff --git a/src/apply.c b/src/apply.c index a5a38dd8a..1ab6153df 100644 --- a/src/apply.c +++ b/src/apply.c @@ -7,9 +7,7 @@ extern boolean notonhead; /* for long worms */ -#ifdef TOURIST STATIC_DCL int FDECL(use_camera, (struct obj *)); -#endif STATIC_DCL int FDECL(use_towel, (struct obj *)); STATIC_DCL boolean FDECL(its_dead, (int,int,int *)); STATIC_DCL int FDECL(use_stethoscope, (struct obj *)); @@ -44,7 +42,6 @@ void FDECL( amii_speaker, ( struct obj *, char *, int ) ); static const char no_elbow_room[] = "don't have enough elbow-room to maneuver."; -#ifdef TOURIST STATIC_OVL int use_camera(obj) struct obj *obj; @@ -82,7 +79,6 @@ use_camera(obj) } return 1; } -#endif STATIC_OVL int use_towel(obj) @@ -3154,9 +3150,7 @@ doapply() use_grease(obj); break; case LOCK_PICK: -#ifdef TOURIST case CREDIT_CARD: -#endif case SKELETON_KEY: res = (pick_lock(obj) != 0); break; @@ -3223,11 +3217,9 @@ doapply() case POT_OIL: light_cocktail(obj); break; -#ifdef TOURIST case EXPENSIVE_CAMERA: res = use_camera(obj); break; -#endif case TOWEL: res = use_towel(obj); break; diff --git a/src/artifact.c b/src/artifact.c index e9351ba92..c9baaf365 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -1687,11 +1687,7 @@ long *abil; long wornbits; long wornmask = (W_ARM | W_ARMC | W_ARMH | W_ARMS | W_ARMG | W_ARMF | W_WEP | W_QUIVER | W_SWAPWEP | W_ART | W_ARTI | W_AMUL | - W_RINGL | W_RINGR | W_TOOL | W_BALL | W_CHAIN | W_SADDLE -#ifdef TOURIST - | W_ARMU -#endif - ); + W_RINGL | W_RINGR | W_TOOL | W_BALL | W_CHAIN | W_SADDLE | W_ARMU); dtyp = abil_to_adtyp(abil); spfx = abil_to_spfx(abil); diff --git a/src/attrib.c b/src/attrib.c index 15377c76c..fbac9949a 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -639,9 +639,7 @@ long frommask; case PM_RANGER: abil = ran_abil; break; case PM_ROGUE: abil = rog_abil; break; case PM_SAMURAI: abil = sam_abil; break; -#ifdef TOURIST case PM_TOURIST: abil = tou_abil; break; -#endif case PM_VALKYRIE: abil = val_abil; break; case PM_WIZARD: abil = wiz_abil; break; default: break; @@ -769,9 +767,7 @@ int oldlevel, newlevel; case PM_RANGER: abil = ran_abil; break; case PM_ROGUE: abil = rog_abil; break; case PM_SAMURAI: abil = sam_abil; break; -#ifdef TOURIST case PM_TOURIST: abil = tou_abil; break; -#endif case PM_VALKYRIE: abil = val_abil; break; case PM_WIZARD: abil = wiz_abil; break; default: abil = 0; break; diff --git a/src/decl.c b/src/decl.c index 963e55324..c9105bee6 100644 --- a/src/decl.c +++ b/src/decl.c @@ -150,9 +150,7 @@ NEARDATA struct obj *invent = (struct obj *)0, *uwep = (struct obj *)0, *uarm = (struct obj *)0, *uswapwep = (struct obj *)0, *uquiver = (struct obj *)0, /* quiver */ -#ifdef TOURIST *uarmu = (struct obj *)0, /* under-wear, so to speak */ -#endif *uskin = (struct obj *)0, /* dragon armor, if a dragon */ *uarmc = (struct obj *)0, *uarmh = (struct obj *)0, *uarms = (struct obj *)0, *uarmg = (struct obj *)0, diff --git a/src/do_wear.c b/src/do_wear.c index efd9a51ff..6b622d7af 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -9,9 +9,7 @@ static NEARDATA const char see_yourself[] = "see yourself"; static NEARDATA const char unknown_type[] = "Unknown type of %s (%d)"; static NEARDATA const char c_armor[] = "armor", c_suit[] = "suit", -#ifdef TOURIST c_shirt[] = "shirt", -#endif c_cloak[] = "cloak", c_gloves[] = "gloves", c_boots[] = "boots", @@ -24,11 +22,8 @@ static NEARDATA const char c_armor[] = "armor", static NEARDATA const long takeoff_order[] = { WORN_BLINDF, W_WEP, WORN_SHIELD, WORN_GLOVES, LEFT_RING, RIGHT_RING, WORN_CLOAK, - WORN_HELMET, WORN_AMUL, WORN_ARMOR, -#ifdef TOURIST - WORN_SHIRT, -#endif - WORN_BOOTS, W_SWAPWEP, W_QUIVER, 0L }; + WORN_HELMET, WORN_AMUL, WORN_ARMOR, WORN_SHIRT, WORN_BOOTS, W_SWAPWEP, + W_QUIVER, 0L }; STATIC_DCL void FDECL(on_msg, (struct obj *)); STATIC_DCL void FDECL(toggle_stealth, (struct obj *,long,BOOLEAN_P)); @@ -40,9 +35,7 @@ STATIC_PTR int NDECL(Helmet_on); STATIC_PTR int NDECL(Gloves_on); STATIC_DCL void FDECL(wielding_corpse, (struct obj *,BOOLEAN_P)); STATIC_PTR int NDECL(Shield_on); -#ifdef TOURIST STATIC_PTR int NDECL(Shirt_on); -#endif STATIC_DCL void NDECL(Amulet_on); STATIC_DCL void FDECL(learnring, (struct obj *,BOOLEAN_P)); STATIC_DCL void FDECL(Ring_off_or_gone, (struct obj *, BOOLEAN_P)); @@ -601,7 +594,6 @@ Shield_off(VOID_ARGS) return 0; } -#ifdef TOURIST STATIC_PTR int Shirt_on(VOID_ARGS) { @@ -631,7 +623,6 @@ Shirt_off(VOID_ARGS) setworn((struct obj *)0, W_ARMU); return 0; } -#endif /*TOURIST*/ /* This must be done in worn.c, because one of the possible intrinsics conferred * is fire resistance, and we have to immediately set HFire_resistance in worn.c @@ -1137,9 +1128,7 @@ struct obj *obj; /* if null, do all worn items; otherwise just obj itself */ if (!obj ? uleft != 0 : (obj == uleft)) (void) Ring_on(uleft); if (!obj ? uamul != 0 : (obj == uamul)) (void) Amulet_on(); -#ifdef TOURIST if (!obj ? uarmu != 0 : (obj == uarmu)) (void) Shirt_on(); -#endif if (!obj ? uarm != 0 : (obj == uarm)) (void) Armor_on(); if (!obj ? uarmc != 0 : (obj == uarmc)) (void) Cloak_on(); if (!obj ? uarmf != 0 : (obj == uarmf)) (void) Boots_on(); @@ -1163,11 +1152,9 @@ register struct obj *otmp; if (otmp == uarm) result = (afternmv == Armor_on || afternmv == Armor_off || what == WORN_ARMOR); -#ifdef TOURIST else if (otmp == uarmu) result = (afternmv == Shirt_on || afternmv == Shirt_off || what == WORN_SHIRT); -#endif else if (otmp == uarmc) result = (afternmv == Cloak_on || afternmv == Cloak_off || what == WORN_CLOAK); @@ -1199,10 +1186,8 @@ struct obj *otmp; /* 'T' (also 'W') sets afternmv, 'A' sets context.takeoff.what */ if (otmp == uarm) result = (afternmv == Armor_off || what == WORN_ARMOR); -#ifdef TOURIST else if (otmp == uarmu) result = (afternmv == Shirt_off || what == WORN_SHIRT); -#endif else if (otmp == uarmc) result = (afternmv == Cloak_off || what == WORN_CLOAK); else if (otmp == uarmf) @@ -1297,11 +1282,9 @@ dotakeoff() } else if (uarm) { armorpieces++; otmp = uarm; -#ifdef TOURIST } else if (uarmu) { armorpieces++; otmp = uarmu; -#endif } if (!armorpieces) { /* assert( GRAY_DRAGON_SCALES > YELLOW_DRAGON_SCALE_MAIL ); */ @@ -1325,21 +1308,16 @@ dotakeoff() /* note: the `uskin' case shouldn't be able to happen here; dragons can't wear any armor so will end up with `armorpieces == 0' above */ if (otmp == uskin || ((otmp == uarm) && uarmc) -#ifdef TOURIST - || ((otmp == uarmu) && (uarmc || uarm)) -#endif - ) { + || ((otmp == uarmu) && (uarmc || uarm))) { char why[BUFSZ], what[BUFSZ]; why[0] = what[0] = '\0'; if (otmp != uskin) { if (uarmc) Strcat(what, cloak_simple_name(uarmc)); -#ifdef TOURIST if ((otmp == uarmu) && uarm) { if (uarmc) Strcat(what, " and "); Strcat(what, suit_simple_name(uarm)); } -#endif Sprintf(why, " without taking off your %s first", what); } You_cant("take that off%s.", why); @@ -1369,12 +1347,10 @@ doremring() MOREACC(ublindf); if(!Accessories) { - pline("Not wearing any accessories.%s", (iflags.cmdassist && - (uarm || uarmc || -#ifdef TOURIST - uarmu || -#endif - uarms || uarmh || uarmg || uarmf)) ? + pline("Not wearing any accessories.%s", + (iflags.cmdassist + && (uarm || uarmc || uarmu || uarms || uarmh || uarmg + || uarmf)) ? " Use 'T' command to take off armor." : ""); return(0); } @@ -1516,9 +1492,7 @@ boolean noisy; const char *which; which = is_cloak(otmp) ? c_cloak : -#ifdef TOURIST is_shirt(otmp) ? c_shirt : -#endif is_suit(otmp) ? c_suit : 0; if (which && cantweararm(youmonst.data) && /* same exception for cloaks as used in m_dowear() */ @@ -1531,12 +1505,7 @@ boolean noisy; return 0; } - if (welded(uwep) && bimanual(uwep) && - (is_suit(otmp) -#ifdef TOURIST - || is_shirt(otmp) -#endif - )) { + if (welded(uwep) && bimanual(uwep) && (is_suit(otmp) || is_shirt(otmp))) { if (noisy) You("cannot do that while holding your %s.", is_sword(uwep) ? c_sword : c_weapon); @@ -1613,7 +1582,6 @@ boolean noisy; err++; } else *mask = W_ARMG; -#ifdef TOURIST } else if (is_shirt(otmp)) { if (uarm || uarmc || uarmu) { if (uarmu) { @@ -1625,7 +1593,6 @@ boolean noisy; err++; } else *mask = W_ARMU; -#endif } else if (is_cloak(otmp)) { if (uarmc) { if (noisy) already_wearing(an(cloak_simple_name(uarmc))); @@ -1711,9 +1678,7 @@ dowear() } else { if(is_cloak(otmp)) (void) Cloak_on(); if (is_shield(otmp)) (void) Shield_on(); -#ifdef TOURIST if (is_shirt(otmp)) (void) Shirt_on(); -#endif on_msg(otmp); } context.takeoff.mask = context.takeoff.what = 0L; @@ -1858,9 +1823,7 @@ find_ac() if(uarmf) uac -= ARM_BONUS(uarmf); if(uarms) uac -= ARM_BONUS(uarms); if(uarmg) uac -= ARM_BONUS(uarmg); -#ifdef TOURIST if(uarmu) uac -= ARM_BONUS(uarmu); -#endif if(uleft && uleft->otyp == RIN_PROTECTION) uac -= uleft->spe; if(uright && uright->otyp == RIN_PROTECTION) uac -= uright->spe; if (HProtection & INTRINSIC) uac -= u.ublessed; @@ -1966,10 +1929,8 @@ struct monst *victim; otmph = (victim == &youmonst) ? uarmc : which_armor(victim, W_ARMC); if (!otmph) otmph = (victim == &youmonst) ? uarm : which_armor(victim, W_ARM); -#ifdef TOURIST if (!otmph) otmph = (victim == &youmonst) ? uarmu : which_armor(victim, W_ARMU); -#endif otmp = (victim == &youmonst) ? uarmh : which_armor(victim, W_ARMH); if(otmp && (!otmph || !rn2(4))) otmph = otmp; @@ -2086,20 +2047,14 @@ register struct obj *otmp; } } /* special suit and shirt checks */ - if (otmp == uarm -#ifdef TOURIST - || otmp == uarmu -#endif - ) { + if (otmp == uarm || otmp == uarmu) { why = 0; /* the item which prevents disrobing */ if (uarmc && uarmc->cursed) { Sprintf(buf, "remove your %s", cloak_simple_name(uarmc)); why = uarmc; -#ifdef TOURIST } else if (otmp == uarmu && uarm && uarm->cursed) { Sprintf(buf, "remove your %s", c_suit); why = uarm; -#endif } else if (welded(uwep) && bimanual(uwep)) { Sprintf(buf, "release your %s", is_sword(uwep) ? c_sword : @@ -2126,9 +2081,7 @@ register struct obj *otmp; else if(otmp == uarmg) context.takeoff.mask |= WORN_GLOVES; else if(otmp == uarmh) context.takeoff.mask |= WORN_HELMET; else if(otmp == uarms) context.takeoff.mask |= WORN_SHIELD; -#ifdef TOURIST else if(otmp == uarmu) context.takeoff.mask |= WORN_SHIRT; -#endif else if(otmp == uleft) context.takeoff.mask |= LEFT_RING; else if(otmp == uright) context.takeoff.mask |= RIGHT_RING; else if(otmp == uamul) context.takeoff.mask |= WORN_AMUL; @@ -2179,11 +2132,9 @@ do_takeoff() } else if (doff->what == WORN_SHIELD) { otmp = uarms; if (!cursed(otmp)) (void) Shield_off(); -#ifdef TOURIST } else if (doff->what == WORN_SHIRT) { otmp = uarmu; if (!cursed(otmp)) (void) Shirt_off(); -#endif } else if (doff->what == WORN_AMUL) { otmp = uamul; if (!cursed(otmp)) Amulet_off(); @@ -2257,13 +2208,11 @@ take_off(VOID_ARGS) otmp = uarmh; } else if (doff->what == WORN_SHIELD) { otmp = uarms; -#ifdef TOURIST } else if (doff->what == WORN_SHIRT) { otmp = uarmu; /* add the time to take off and put back on armor and/or cloak */ if (uarm) doff->delay += 2 * objects[uarm->otyp].oc_delay; if (uarmc) doff->delay += 2 * objects[uarmc->otyp].oc_delay + 1; -#endif } else if (doff->what == WORN_AMUL) { doff->delay = 1; } else if (doff->what == LEFT_RING) { @@ -2399,13 +2348,11 @@ register struct obj *atmp; surface(u.ux,u.uy)); (void) Armor_gone(); useup(otmp); -#ifdef TOURIST } else if (DESTROY_ARM(uarmu)) { if (donning(otmp)) cancel_don(); Your("shirt crumbles into tiny threads and falls apart!"); (void) Shirt_off(); useup(otmp); -#endif } else if (DESTROY_ARM(uarmh)) { if (donning(otmp)) cancel_don(); Your("%s turns to dust and is blown away!", @@ -2484,7 +2431,6 @@ boolean only_if_known_cursed; /* ignore covering unless known to be cursed */ } return TRUE; } -#ifdef TOURIST /* check for shirt covered by suit and/or cloak */ if (obj == uarmu && ((uarm && BLOCKSACCESS(uarm)) || (uarmc && BLOCKSACCESS(uarmc)))) { @@ -2505,7 +2451,6 @@ boolean only_if_known_cursed; /* ignore covering unless known to be cursed */ } return TRUE; } -#endif /* check for ring covered by gloves */ if ((obj == uleft || obj == uright) && uarmg && BLOCKSACCESS(uarmg)) { if (verb) { diff --git a/src/dogmove.c b/src/dogmove.c index 795905393..526f40454 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -26,10 +26,6 @@ struct monst *mon; struct obj *obj, *wep, dummy, *pickaxe, *unihorn, *key; -#ifndef TOURIST -#define CREDIT_CARD STRANGE_OBJECT /* avoids messy conditionalization */ -#endif - #ifndef GOLDOBJ if (mon->mgold) return &zeroobj; /* pet has something to drop */ #endif @@ -111,10 +107,6 @@ struct monst *mon; if (!obj->owornmask && obj != wep) return obj; } -#ifndef TOURIST -#undef CREDIT_CARD -#endif - return (struct obj *)0; /* don't drop anything */ } diff --git a/src/dokick.c b/src/dokick.c index d0b20a604..fb81ab5c4 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -1456,10 +1456,7 @@ boolean shop_floor_obj; const char *result; if (objects[otmp->otyp].oc_material == GLASS -#ifdef TOURIST - || otmp->otyp == EXPENSIVE_CAMERA -#endif - ) { + || otmp->otyp == EXPENSIVE_CAMERA) { if (otmp->otyp == MIRROR) change_luck(-2); result = "crash"; diff --git a/src/dothrow.c b/src/dothrow.c index 953ff1e35..08e21d4f5 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -1775,9 +1775,7 @@ struct obj *obj; obj->oclass != GEM_CLASS) return 1; switch (obj->oclass == POTION_CLASS ? POT_WATER : obj->otyp) { -#ifdef TOURIST case EXPENSIVE_CAMERA: -#endif case POT_WATER: /* really, all potions */ case EGG: case CREAM_PIE: @@ -1806,9 +1804,7 @@ boolean in_view; case LENSES: case MIRROR: case CRYSTAL_BALL: -#ifdef TOURIST case EXPENSIVE_CAMERA: -#endif to_pieces = " into a thousand pieces"; /*FALLTHRU*/ case POT_WATER: /* really, all potions */ diff --git a/src/invent.c b/src/invent.c index 90cb9ff1c..189b63ea9 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1000,12 +1000,8 @@ register const char *let,*word; } else { /* "ugly check" for reading fortune cookies, part 2 */ - if ((!strcmp(word, "read") && - (otmp->otyp == FORTUNE_COOKIE -#ifdef TOURIST - || otmp->otyp == T_SHIRT -#endif - ))) + if ((!strcmp(word, "read") + && (otmp->otyp == FORTUNE_COOKIE || otmp->otyp == T_SHIRT))) allowall = TRUE; } } @@ -1241,10 +1237,7 @@ boolean wearing_armor() { return((boolean)(uarm || uarmc || uarmf || uarmg || uarmh || uarms -#ifdef TOURIST - || uarmu -#endif - )); + || uarmu)); } boolean @@ -2745,16 +2738,10 @@ doprarm() if (!wearing_armor()) { noarmor(TRUE); } else { -#ifdef TOURIST char lets[8]; -#else - char lets[7]; -#endif register int ct = 0; -#ifdef TOURIST if(uarmu) lets[ct++] = obj_to_let(uarmu); -#endif if(uarm) lets[ct++] = obj_to_let(uarm); if(uarmc) lets[ct++] = obj_to_let(uarmc); if(uarmh) lets[ct++] = obj_to_let(uarmh); diff --git a/src/lock.c b/src/lock.c index 6e20e20e6..2ba1d51b7 100644 --- a/src/lock.c +++ b/src/lock.c @@ -61,10 +61,8 @@ lock_action() /* otherwise we're trying to unlock it */ else if (xlock.picktyp == LOCK_PICK) return actions[3]; /* "picking the lock" */ -#ifdef TOURIST else if (xlock.picktyp == CREDIT_CARD) return actions[3]; /* same as lock_pick */ -#endif else if (xlock.door) return actions[0]; /* "unlocking the door" */ else @@ -253,9 +251,7 @@ pick_lock(pick) if (nohands(youmonst.data)) { const char *what = (picktyp == LOCK_PICK) ? "pick" : "key"; -#ifdef TOURIST if (picktyp == CREDIT_CARD) what = "card"; -#endif pline(no_longer, "hold the", what); reset_pick(); return PICKLOCK_LEARNED_SOMETHING; @@ -276,18 +272,13 @@ pick_lock(pick) return PICKLOCK_DID_NOTHING; } else if (u.uswallow) { You_cant("%sunlock %s.", -#ifdef TOURIST (picktyp == CREDIT_CARD) ? "" : -#endif "lock or ", mon_nam(u.ustuck)); return PICKLOCK_DID_NOTHING; } - if((picktyp != LOCK_PICK && -#ifdef TOURIST - picktyp != CREDIT_CARD && -#endif - picktyp != SKELETON_KEY)) { + if((picktyp != LOCK_PICK && picktyp != CREDIT_CARD + && picktyp != SKELETON_KEY)) { impossible("picking lock with object %d?", picktyp); return PICKLOCK_DID_NOTHING; } @@ -344,20 +335,16 @@ pick_lock(pick) You_cant("fix its broken lock with %s.", doname(pick)); return PICKLOCK_LEARNED_SOMETHING; } -#ifdef TOURIST else if (picktyp == CREDIT_CARD && !otmp->olocked) { /* credit cards are only good for unlocking */ You_cant("do that with %s.", an(simple_typename(picktyp))); return PICKLOCK_LEARNED_SOMETHING; } -#endif switch(picktyp) { -#ifdef TOURIST case CREDIT_CARD: ch = ACURR(A_DEX) + 20*Role_if(PM_ROGUE); break; -#endif case LOCK_PICK: ch = 4*ACURR(A_DEX) + 25*Role_if(PM_ROGUE); break; @@ -391,12 +378,10 @@ pick_lock(pick) if (mtmp && canseemon(mtmp) && mtmp->m_ap_type != M_AP_FURNITURE && mtmp->m_ap_type != M_AP_OBJECT) { -#ifdef TOURIST if (picktyp == CREDIT_CARD && (mtmp->isshk || mtmp->data == &mons[PM_ORACLE])) verbalize("No checks, no credit, no problem."); else -#endif pline("I don't think %s would appreciate that.", mon_nam(mtmp)); return PICKLOCK_LEARNED_SOMETHING; } else if (mtmp && mtmp->m_ap_type == M_AP_FURNITURE && @@ -430,13 +415,11 @@ pick_lock(pick) pline("This door is broken."); return PICKLOCK_LEARNED_SOMETHING; default: -#ifdef TOURIST /* credit cards are only good for unlocking */ if(picktyp == CREDIT_CARD && !(door->doormask & D_LOCKED)) { You_cant("lock a door with a credit card."); return PICKLOCK_LEARNED_SOMETHING; } -#endif Sprintf(qbuf,"%s it?", (door->doormask & D_LOCKED) ? "Unlock" : "Lock"); @@ -445,11 +428,9 @@ pick_lock(pick) if(c == 'n') return(0); switch(picktyp) { -#ifdef TOURIST case CREDIT_CARD: ch = 2*ACURR(A_DEX) + 20*Role_if(PM_ROGUE); break; -#endif case LOCK_PICK: ch = 3*ACURR(A_DEX) + 30*Role_if(PM_ROGUE); break; diff --git a/src/mhitu.c b/src/mhitu.c index cf5f68bcd..89cd68968 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -759,10 +759,8 @@ int attk; */ if (uarm) (void)rust_dmg(uarm, xname(uarm), hurt, TRUE, &youmonst); -#ifdef TOURIST else if (uarmu) (void)rust_dmg(uarmu, xname(uarmu), hurt, TRUE, &youmonst); -#endif break; case 2: if (!uarms || !rust_dmg(uarms, xname(uarms), hurt, FALSE, &youmonst)) @@ -803,9 +801,7 @@ struct attack *mattk; { struct obj *obj = (uarmc ? uarmc : uarm); -#ifdef TOURIST if (!obj) obj = uarmu; -#endif if (mattk->adtyp == AD_DRIN) obj = uarmh; /* if your cloak/armor is greased, monster slips off; this @@ -1375,11 +1371,8 @@ dopois: hitmsg(mtmp, mattk); break; } - if(!uwep -#ifdef TOURIST - && !uarmu -#endif - && !uarm && !uarmh && !uarms && !uarmg && !uarmc && !uarmf) { + if(!uwep && !uarmu && !uarm && !uarmh && !uarms && !uarmg && !uarmc + && !uarmf) { boolean goaway = FALSE; pline("%s hits! (I hope you don't mind.)", Monnam(mtmp)); if (Upolyd) { @@ -2331,10 +2324,7 @@ register struct monst *mon; } if (!uarmc && !uarmf && !uarmg && !uarms && !uarmh -#ifdef TOURIST - && !uarmu -#endif - ) + && !uarmu) pline("%s murmurs sweet nothings into your ear.", Blind ? (fem ? "She" : "He") : Monnam(mon)); else @@ -2348,10 +2338,8 @@ register struct monst *mon; mayberem(uarmg, "gloves"); mayberem(uarms, "shield"); mayberem(uarmh, helm_simple_name(uarmh)); -#ifdef TOURIST if(!uarmc && !uarm) mayberem(uarmu, "shirt"); -#endif if (uarm || uarmc) { verbalize("You're such a %s; I wish...", @@ -2515,9 +2503,7 @@ const char *str; (obj == uarmc || obj == uarms) ? "it's in the way" : (obj == uarmf) ? "let me rub your feet" : (obj == uarmg) ? "they're too clumsy" : -#ifdef TOURIST (obj == uarmu) ? "let me massage you" : -#endif /* obj == uarmh */ hairbuf); } diff --git a/src/mkobj.c b/src/mkobj.c index 19e3658df..1edb34977 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -726,9 +726,7 @@ boolean artif; break; case LEASH: otmp->leashmon = 0; break; -#ifdef TOURIST case EXPENSIVE_CAMERA: -#endif case TINNING_KIT: case MAGIC_MARKER: otmp->spe = rn1(70,30); break; diff --git a/src/mon.c b/src/mon.c index 5be8c8e8a..4ed4b168c 100644 --- a/src/mon.c +++ b/src/mon.c @@ -101,9 +101,7 @@ int mndx, mode; case PM_HUNTER: mndx = mode ? PM_RANGER : PM_HUMAN; break; case PM_THUG: mndx = mode ? PM_ROGUE : PM_HUMAN; break; case PM_ROSHI: mndx = mode ? PM_SAMURAI : PM_HUMAN; break; -#ifdef TOURIST case PM_GUIDE: mndx = mode ? PM_TOURIST : PM_HUMAN; break; -#endif case PM_APPRENTICE: mndx = mode ? PM_WIZARD : PM_HUMAN; break; case PM_WARRIOR: mndx = mode ? PM_VALKYRIE : PM_HUMAN; break; default: diff --git a/src/monmove.c b/src/monmove.c index a7e0da3d2..cc18bcd3c 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -46,9 +46,7 @@ monhaskey(mon, for_unlocking) struct monst *mon; boolean for_unlocking; /* true => credit card ok, false => not ok */ { -#ifdef TOURIST if (for_unlocking && m_carrying(mon, CREDIT_CARD)) return TRUE; -#endif return m_carrying(mon, SKELETON_KEY) || m_carrying(mon, LOCK_PICK); } @@ -1463,9 +1461,7 @@ struct monst *mtmp; typ != SLING && !is_cloak(obj) && typ != FEDORA && !is_gloves(obj) && typ != LEATHER_JACKET && -#ifdef TOURIST typ != CREDIT_CARD && !is_shirt(obj) && -#endif !(typ == CORPSE && verysmall(&mons[obj->corpsenm])) && typ != FORTUNE_COOKIE && typ != CANDY_BAR && typ != PANCAKE && typ != LEMBAS_WAFER && diff --git a/src/monst.c b/src/monst.c index b85449ca2..420118eda 100644 --- a/src/monst.c +++ b/src/monst.c @@ -3021,7 +3021,6 @@ struct permonst _mons2[] = { SIZ(WT_HUMAN, 400, MS_HUMANOID, MZ_HUMAN), 0, 0, M1_HUMANOID|M1_OMNIVORE, M2_NOPOLY|M2_HUMAN|M2_STRONG|M2_COLLECT, M3_INFRAVISIBLE, HI_DOMESTIC), -#ifdef TOURIST MON("tourist", S_HUMAN, LVL(10, 12, 10, 1, 0), G_NOGEN, A(ATTK(AT_WEAP, AD_PHYS, 1, 6), ATTK(AT_WEAP, AD_PHYS, 1, 6), @@ -3029,7 +3028,6 @@ struct permonst _mons2[] = { SIZ(WT_HUMAN, 400, MS_HUMANOID, MZ_HUMAN), 0, 0, M1_HUMANOID|M1_OMNIVORE, M2_NOPOLY|M2_HUMAN|M2_STRONG|M2_COLLECT, M3_INFRAVISIBLE, HI_DOMESTIC), -#endif MON("valkyrie", S_HUMAN, LVL(10, 12, 10, 1, -1), G_NOGEN, A(ATTK(AT_WEAP, AD_PHYS, 1, 8), ATTK(AT_WEAP, AD_PHYS, 1, 8), @@ -3165,7 +3163,6 @@ struct permonst _mons2[] = { M2_NOPOLY|M2_HUMAN|M2_PNAME|M2_PEACEFUL|M2_STRONG|M2_MALE| M2_COLLECT|M2_MAGIC, M3_CLOSE|M3_INFRAVISIBLE, HI_LORD), -#ifdef TOURIST MON("Twoflower", S_HUMAN, LVL(20, 12, 10, 20, 0), (G_NOGEN|G_UNIQ), A(ATTK(AT_WEAP, AD_PHYS, 1, 6), ATTK(AT_WEAP, AD_PHYS, 1, 6), @@ -3175,7 +3172,6 @@ struct permonst _mons2[] = { M2_NOPOLY|M2_HUMAN|M2_PNAME|M2_PEACEFUL|M2_STRONG|M2_MALE| M2_COLLECT|M2_MAGIC, M3_CLOSE|M3_INFRAVISIBLE, HI_DOMESTIC), -#endif MON("Norn", S_HUMAN, LVL(20, 12, 0, 80, 0), (G_NOGEN|G_UNIQ), A(ATTK(AT_WEAP, AD_PHYS, 1, 8), ATTK(AT_WEAP, AD_PHYS, 1, 6), @@ -3313,11 +3309,9 @@ struct permonst _mons2[] = { M2_NOPOLY|M2_HUMAN|M2_PNAME|M2_HOSTILE|M2_STRONG|M2_STALK| M2_NASTY|M2_MALE|M2_COLLECT|M2_MAGIC, M3_WANTSARTI|M3_WAITFORU|M3_INFRAVISIBLE, HI_LORD), -#ifdef TOURIST /* * Note: the Master of Thieves was defined above. */ -#endif MON("Lord Surtur", S_GIANT, LVL(15, 12, 2, 50, 12), (G_NOGEN|G_UNIQ), A(ATTK(AT_WEAP, AD_PHYS, 2,10), ATTK(AT_WEAP, AD_PHYS, 2,10), @@ -3438,7 +3432,6 @@ struct permonst _mons2[] = { M1_HUMANOID|M1_OMNIVORE, M2_NOPOLY|M2_HUMAN|M2_PEACEFUL|M2_STRONG|M2_COLLECT, M3_INFRAVISIBLE, HI_DOMESTIC), -#ifdef TOURIST MON("guide", S_HUMAN, LVL(5, 12, 10, 20, 0), G_NOGEN, A(ATTK(AT_WEAP, AD_PHYS, 1, 6), ATTK(AT_MAGC, AD_SPEL, 0, 0), @@ -3447,7 +3440,6 @@ struct permonst _mons2[] = { M1_HUMANOID|M1_OMNIVORE, M2_NOPOLY|M2_HUMAN|M2_PEACEFUL | M2_STRONG|M2_COLLECT|M2_MAGIC, M3_INFRAVISIBLE, HI_DOMESTIC), -#endif MON("warrior", S_HUMAN, LVL(5, 12, 10, 10, -1), G_NOGEN, A(ATTK(AT_WEAP, AD_PHYS, 1, 8), ATTK(AT_WEAP, AD_PHYS, 1, 8), diff --git a/src/mplayer.c b/src/mplayer.c index 58546c931..c2b7f23f8 100644 --- a/src/mplayer.c +++ b/src/mplayer.c @@ -203,11 +203,9 @@ register boolean special; case PM_SAMURAI: if (rn2(2)) weapon = KATANA; break; -#ifdef TOURIST case PM_TOURIST: /* Defaults are just fine */ break; -#endif case PM_VALKYRIE: if (rn2(2)) weapon = WAR_HAMMER; if (rn2(2)) armor = rnd_class(PLATE_MAIL, CHAIN_MAIL); diff --git a/src/mthrowu.c b/src/mthrowu.c index 8a9ed6736..e61814321 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -814,9 +814,7 @@ int whodidit; /* 1==hero, 0=other, -1==just check whether it'll pass thru */ case TOOL_CLASS: hits = (obj_type != SKELETON_KEY && obj_type != LOCK_PICK && -#ifdef TOURIST obj_type != CREDIT_CARD && -#endif obj_type != TALLOW_CANDLE && obj_type != WAX_CANDLE && obj_type != LENSES && diff --git a/src/muse.c b/src/muse.c index a404071c7..ec4bc55ab 100644 --- a/src/muse.c +++ b/src/muse.c @@ -988,11 +988,8 @@ struct monst *mtmp; return FALSE; if (u.uswallow) return FALSE; if (in_your_sanctuary(mtmp, 0, 0)) return FALSE; - if (dmgtype(mtmp->data, AD_HEAL) && !uwep -#ifdef TOURIST - && !uarmu -#endif - && !uarm && !uarmh && !uarms && !uarmg && !uarmc && !uarmf) + if (dmgtype(mtmp->data, AD_HEAL) && !uwep && !uarmu && !uarm && !uarmh + && !uarms && !uarmg && !uarmc && !uarmf) return FALSE; if (!ranged_stuff) return FALSE; diff --git a/src/objects.c b/src/objects.c index 1de8dfffe..4c015595d 100644 --- a/src/objects.c +++ b/src/objects.c @@ -367,13 +367,8 @@ ARMOR("plate mail", (char *)0, 1, 0, 1, 0, 44, 5, 450, 600, 3, 2, ARM_SUIT, IRON, HI_METAL), ARMOR("crystal plate mail", (char *)0, 1, 0, 1, 0, 10, 5, 450, 820, 3, 2, ARM_SUIT, GLASS, CLR_WHITE), -#ifdef TOURIST ARMOR("bronze plate mail", (char *)0, 1, 0, 1, 0, 25, 5, 450, 400, 4, 1, ARM_SUIT, COPPER, HI_COPPER), -#else -ARMOR("bronze plate mail", (char *)0, - 1, 0, 1, 0, 35, 5, 450, 400, 4, 1, ARM_SUIT, COPPER, HI_COPPER), -#endif ARMOR("splint mail", (char *)0, 1, 0, 1, 0, 62, 5, 400, 80, 4, 1, ARM_SUIT, IRON, HI_METAL), ARMOR("banded mail", (char *)0, @@ -399,13 +394,11 @@ ARMOR("leather armor", (char *)0, ARMOR("leather jacket", (char *)0, 1, 0, 0, 0, 12, 0, 30, 10, 9, 0, ARM_SUIT, LEATHER, CLR_BLACK), -#ifdef TOURIST /* shirts */ ARMOR("Hawaiian shirt", (char *)0, 1, 0, 0, 0, 8, 0, 5, 3, 10, 0, ARM_SHIRT, CLOTH, CLR_MAGENTA), ARMOR("T-shirt", (char *)0, 1, 0, 0, 0, 2, 0, 5, 2, 10, 0, ARM_SHIRT, CLOTH, CLR_WHITE), -#endif /* cloaks */ /* 'cope' is not a spelling mistake... leave it be */ @@ -591,12 +584,8 @@ CONTAINER("bag of tricks", "bag", 0, 1, 1, 20, 15, 100, CLOTH, HI_CLOTH), /* lock opening tools */ TOOL("skeleton key", "key", 0, 0, 0, 0, 80, 3, 10, IRON, HI_METAL), -#ifdef TOURIST TOOL("lock pick", (char *)0, 1, 0, 0, 0, 60, 4, 20, IRON, HI_METAL), TOOL("credit card", (char *)0, 1, 0, 0, 0, 15, 1, 10, PLASTIC, CLR_WHITE), -#else -TOOL("lock pick", (char *)0, 1, 0, 0, 0, 75, 4, 20, IRON, HI_METAL), -#endif /* light sources */ TOOL("tallow candle", "candle", 0, 1, 0, 0, 20, 2, 10, WAX, CLR_WHITE), TOOL("wax candle", "candle", 0, 1, 0, 0, 5, 2, 20, WAX, CLR_WHITE), @@ -604,13 +593,9 @@ TOOL("brass lantern", (char *)0,1, 0, 0, 0, 30, 30, 12, COPPER, CLR_YELLOW), TOOL("oil lamp", "lamp", 0, 0, 0, 0, 45, 20, 10, COPPER, CLR_YELLOW), TOOL("magic lamp", "lamp", 0, 0, 1, 0, 15, 20, 50, COPPER, CLR_YELLOW), /* other tools */ -#ifdef TOURIST TOOL("expensive camera", (char *)0, 1, 0, 0, 1, 15, 12, 200, PLASTIC, CLR_BLACK), TOOL("mirror", "looking glass", 0, 0, 0, 0, 45, 13, 10, GLASS, HI_SILVER), -#else -TOOL("mirror", "looking glass", 0, 0, 0, 0, 60, 13, 10, GLASS, HI_SILVER), -#endif TOOL("crystal ball", "glass orb", 0, 0, 1, 1, 15,150, 60, GLASS, HI_GLASS), TOOL("lenses", (char *)0, 1, 0, 0, 0, 5, 3, 80, GLASS, HI_GLASS), diff --git a/src/objnam.c b/src/objnam.c index e1b00a777..624ed92ff 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -2182,9 +2182,7 @@ STATIC_OVL NEARDATA const struct o_range o_ranges[] = { { "boots", ARMOR_CLASS, LOW_BOOTS, LEVITATION_BOOTS }, { "shoes", ARMOR_CLASS, LOW_BOOTS, IRON_SHOES }, { "cloak", ARMOR_CLASS, MUMMY_WRAPPING, CLOAK_OF_DISPLACEMENT }, -#ifdef TOURIST { "shirt", ARMOR_CLASS, HAWAIIAN_SHIRT, T_SHIRT }, -#endif { "dragon scales", ARMOR_CLASS, GRAY_DRAGON_SCALES, YELLOW_DRAGON_SCALES }, { "dragon scale mail", @@ -2218,10 +2216,8 @@ struct alt_spellings { { "amulet of poison resistance", AMULET_VERSUS_POISON }, { "potion of sleep", POT_SLEEPING }, { "stone", ROCK }, -#ifdef TOURIST { "camera", EXPENSIVE_CAMERA }, { "tee shirt", T_SHIRT }, -#endif { "can", TIN }, { "can opener", TIN_OPENER }, { "kelp", KELP_FROND }, diff --git a/src/polyself.c b/src/polyself.c index c1b2c99c4..3effba8b2 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -821,12 +821,10 @@ break_armor() useup(otmp); } } -#ifdef TOURIST if (uarmu) { Your("shirt rips to shreds!"); useup(uarmu); } -#endif } else if (sliparm(youmonst.data)) { if (((otmp = uarm) != 0) && (racial_exception(&youmonst, otmp) < 1)) { if (donning(otmp)) cancel_don(); @@ -841,7 +839,6 @@ break_armor() (void) Cloak_off(); dropx(otmp); } -#ifdef TOURIST if ((otmp = uarmu) != 0) { if (is_whirly(youmonst.data)) You("seep right through your shirt!"); @@ -849,7 +846,6 @@ break_armor() setworn((struct obj *)0, otmp->owornmask & W_ARMU); dropx(otmp); } -#endif } if (has_horns(youmonst.data)) { if ((otmp = uarmh) != 0) { diff --git a/src/pray.c b/src/pray.c index b5312c25a..0e3730e20 100644 --- a/src/pray.c +++ b/src/pray.c @@ -256,10 +256,8 @@ worst_cursed_item() otmp = uarmh; } else if (uarmf && uarmf->cursed) { /* boots */ otmp = uarmf; -#ifdef TOURIST } else if (uarmu && uarmu->cursed) { /* shirt */ otmp = uarmu; -#endif } else if (uamul && uamul->cursed) { /* amulet */ otmp = uamul; } else if (uleft && uleft->cursed) { /* left ring */ @@ -551,9 +549,7 @@ aligntyp resp_god; if (uarm && !(EReflecting & W_ARM) && !(EDisint_resistance & W_ARM) && !uarmc) (void) destroy_arm(uarm); -#ifdef TOURIST if (uarmu && !uarm && !uarmc) (void) destroy_arm(uarmu); -#endif if (!Disint_resistance) fry_by_god(resp_god, TRUE); else { diff --git a/src/read.c b/src/read.c index 40b40f2d9..6f4c7c478 100644 --- a/src/read.c +++ b/src/read.c @@ -72,7 +72,6 @@ doread() if (!Blind) u.uconduct.literate++; useup(scroll); return(1); -#ifdef TOURIST } else if (scroll->otyp == T_SHIRT) { static const char *shirt_msgs[] = { /* Scott Bigham */ "I explored the Dungeons of Doom and all I got was this lousy T-shirt!", @@ -117,7 +116,6 @@ doread() scroll->o_id ^ (unsigned)ubirthday); pline("\"%s\"", buf); return 1; -#endif /* TOURIST */ } else if (scroll->oclass != SCROLL_CLASS && scroll->oclass != SPBOOK_CLASS) { pline(silly_thing_to, "read"); @@ -364,9 +362,7 @@ int curse_bless; break; case MAGIC_MARKER: case TINNING_KIT: -#ifdef TOURIST case EXPENSIVE_CAMERA: -#endif if (is_cursed) stripspe(obj); else if (rechrg && obj->otyp == MAGIC_MARKER) { /* previously recharged */ obj->recharged = 1; /* override increment done above */ diff --git a/src/role.c b/src/role.c index 8cb7f3f7e..59624c528 100644 --- a/src/role.c +++ b/src/role.c @@ -299,7 +299,6 @@ const struct Role roles[] = { { 1, 0, 0, 1, 0, 1 },11, /* Energy */ 10, 10, 0, 0, 8, A_INT, SPE_CLAIRVOYANCE, -4 }, -#ifdef TOURIST { {"Tourist", 0}, { {"Rambler", 0}, {"Sightseer", 0}, @@ -325,7 +324,6 @@ const struct Role roles[] = { { 1, 0, 0, 1, 0, 1 },14, /* Energy */ 0, 5, 1, 2, 10, A_INT, SPE_CHARM_MONSTER, -4 }, -#endif { {"Valkyrie", 0}, { {"Stripling", 0}, {"Skirmisher", 0}, @@ -1705,10 +1703,8 @@ struct monst *mtmp; case PM_SAMURAI: return (mtmp && mtmp->data == &mons[PM_SHOPKEEPER] ? "Irasshaimase" : "Konnichi wa"); /* Japanese */ -#ifdef TOURIST case PM_TOURIST: return ("Aloha"); /* Hawaiian */ -#endif case PM_VALKYRIE: return ( #ifdef MAIL @@ -1728,10 +1724,8 @@ Goodbye() return ("Fare thee well"); /* Olde English */ case PM_SAMURAI: return ("Sayonara"); /* Japanese */ -#ifdef TOURIST case PM_TOURIST: return ("Aloha"); /* Hawaiian */ -#endif case PM_VALKYRIE: return ("Farvel"); /* Norse */ default: diff --git a/src/shk.c b/src/shk.c index 63596950f..5a397abf5 100644 --- a/src/shk.c +++ b/src/shk.c @@ -1951,11 +1951,9 @@ register struct monst *shkp; /* if angry, impose a surcharge */ } if (uarmh && uarmh->otyp == DUNCE_CAP) multiplier *= 4L, divisor *= 3L; -#ifdef TOURIST else if ((Role_if(PM_TOURIST) && u.ulevel < (MAXULEV/2)) || (uarmu && !uarm && !uarmc)) /* touristy shirt visible */ multiplier *= 4L, divisor *= 3L; -#endif if (ACURR(A_CHA) > 18) divisor *= 2L; else if (ACURR(A_CHA) == 18) multiplier *= 2L, divisor *= 3L; @@ -2116,11 +2114,9 @@ register struct monst *shkp; if (uarmh && uarmh->otyp == DUNCE_CAP) divisor *= 3L; -#ifdef TOURIST else if ((Role_if(PM_TOURIST) && u.ulevel < (MAXULEV/2)) || (uarmu && !uarm && !uarmc)) /* touristy shirt visible */ divisor *= 3L; -#endif else divisor *= 2L; @@ -4092,11 +4088,9 @@ boolean altusage; /* some items have an "alternate" use with different cost */ if (otmp->spe > 1) tmp /= 4L; } else if (otmp->oclass == SPBOOK_CLASS) { tmp -= tmp / 5L; - } else if (otmp->otyp == CAN_OF_GREASE || - otmp->otyp == TINNING_KIT -#ifdef TOURIST + } else if (otmp->otyp == CAN_OF_GREASE + || otmp->otyp == TINNING_KIT || otmp->otyp == EXPENSIVE_CAMERA -#endif ) { tmp /= 10L; } else if (otmp->otyp == POT_OIL) { diff --git a/src/sounds.c b/src/sounds.c index efb496372..2a7df5823 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -796,11 +796,9 @@ register struct monst *mtmp; case PM_ARCHEOLOGIST: pline_msg = "describes a recent article in \"Spelunker Today\" magazine."; break; -#ifdef TOURIST case PM_TOURIST: verbl_msg = "Aloha."; break; -#endif default: pline_msg = "discusses dungeon exploration."; break; @@ -871,10 +869,8 @@ register struct monst *mtmp; verbl_msg = Role_if(PM_HEALER) ? "Doc, I can't help you unless you cooperate." : "Please undress so I can examine you."; -#ifdef TOURIST else if (uarmu) verbl_msg = "Take off your shirt, please."; -#endif else verbl_msg = "Relax, this won't hurt a bit."; break; case MS_GUARD: diff --git a/src/steal.c b/src/steal.c index 884b4135c..f98cd693e 100644 --- a/src/steal.c +++ b/src/steal.c @@ -13,10 +13,7 @@ STATIC_OVL const char * equipname(otmp) register struct obj *otmp; { - return ( -#ifdef TOURIST - (otmp == uarmu) ? "shirt" : -#endif + return ((otmp == uarmu) ? "shirt" : (otmp == uarmf) ? "boots" : (otmp == uarms) ? "shield" : (otmp == uarmg) ? "gloves" : @@ -231,9 +228,7 @@ boolean unchain_ball; /* whether to unpunish or just unwield */ else if (obj == uarmg) (void) Gloves_off(); else if (obj == uarmh) (void) Helmet_off(); else if (obj == uarms) (void) Shield_off(); -#ifdef TOURIST else if (obj == uarmu) (void) Shirt_off(); -#endif /* catchall -- should never happen */ else setworn((struct obj *)0, obj->owornmask & W_ARMOR); } else if (obj->owornmask & W_AMUL) { @@ -342,11 +337,9 @@ nothing_to_steal: if (otmp == uarmg && uwep) otmp = uwep; /* can't steal armor while wearing cloak - so steal the cloak. */ else if(otmp == uarm && uarmc) otmp = uarmc; -#ifdef TOURIST /* can't steal shirt while wearing cloak or suit */ else if(otmp == uarmu && uarmc) otmp = uarmc; else if(otmp == uarmu && uarm) otmp = uarm; -#endif gotobj: if(otmp->o_id == stealoid) return(0); diff --git a/src/trap.c b/src/trap.c index e14ffec6f..cde767106 100644 --- a/src/trap.c +++ b/src/trap.c @@ -78,11 +78,9 @@ struct monst *victim; (void) burn_dmg(item, xname(item)); return TRUE; } -#ifdef TOURIST item = (victim == &youmonst) ? uarmu : which_armor(victim, W_ARMU); if (item) (void) burn_dmg(item, "shirt"); -#endif return TRUE; case 2: item = (victim == &youmonst) ? uarms : which_armor(victim, W_ARMS); @@ -953,10 +951,8 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); 1, TRUE, &youmonst); else if (uarm) (void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst); -#ifdef TOURIST else if (uarmu) (void) rust_dmg(uarmu, "shirt", 1, TRUE, &youmonst); -#endif } update_inventory(); break; @@ -2090,10 +2086,8 @@ glovecheck: target = which_armor(mtmp, W_ARMG); 1, TRUE, mtmp); else if ((target = which_armor(mtmp, W_ARM)) != 0) (void) rust_dmg(target, "armor", 1, TRUE, mtmp); -#ifdef TOURIST else if ((target = which_armor(mtmp, W_ARMU)) != 0) (void) rust_dmg(target, "shirt", 1, TRUE, mtmp); -#endif } if (mptr == &mons[PM_IRON_GOLEM]) { @@ -3172,9 +3166,7 @@ boolean *lostsome; obj == uamul || obj == uleft || obj == uright || obj == ublindf || obj == uarm || obj == uarmc || obj == uarmg || obj == uarmf || -#ifdef TOURIST obj == uarmu || -#endif (obj->cursed && (obj == uarmh || obj == uarms)) || welded(obj))) otmp = obj; diff --git a/src/u_init.c b/src/u_init.c index 621f0d44d..16956b976 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -138,7 +138,6 @@ static struct trobj Samurai[] = { { SPLINT_MAIL, 0, ARMOR_CLASS, 1, UNDEF_BLESS }, { 0, 0, 0, 0, 0 } }; -#ifdef TOURIST static struct trobj Tourist[] = { #define T_DARTS 0 { DART, 2, WEAPON_CLASS, 25, UNDEF_BLESS }, /* quan is variable */ @@ -150,7 +149,6 @@ static struct trobj Tourist[] = { { CREDIT_CARD, 0, TOOL_CLASS, 1, 0 }, { 0, 0, 0, 0, 0 } }; -#endif static struct trobj Valkyrie[] = { { LONG_SWORD, 1, WEAPON_CLASS, 1, UNDEF_BLESS }, { DAGGER, 0, WEAPON_CLASS, 1, UNDEF_BLESS }, @@ -200,7 +198,6 @@ static struct trobj Xtra_food[] = { { UNDEF_TYP, UNDEF_SPE, FOOD_CLASS, 2, 0 }, { 0, 0, 0, 0, 0 } }; -#ifdef TOURIST static struct trobj Leash[] = { { LEASH, 0, TOOL_CLASS, 1, 0 }, { 0, 0, 0, 0, 0 } @@ -209,7 +206,6 @@ static struct trobj Towel[] = { { TOWEL, 0, TOOL_CLASS, 1, 0 }, { 0, 0, 0, 0, 0 } }; -#endif /* TOURIST */ static struct trobj Wishing[] = { { WAN_WISHING, 3, WAND_CLASS, 1, 0 }, { 0, 0, 0, 0, 0 } @@ -414,7 +410,6 @@ static const struct def_skill Skill_S[] = { { P_NONE, 0 } }; -#ifdef TOURIST static const struct def_skill Skill_T[] = { { P_DAGGER, P_EXPERT }, { P_KNIFE, P_SKILLED }, { P_AXE, P_BASIC }, { P_PICK_AXE, P_BASIC }, @@ -437,7 +432,6 @@ static const struct def_skill Skill_T[] = { { P_BARE_HANDED_COMBAT, P_SKILLED }, { P_NONE, 0 } }; -#endif /* TOURIST */ static const struct def_skill Skill_V[] = { { P_DAGGER, P_EXPERT }, { P_AXE, P_EXPERT }, @@ -512,9 +506,7 @@ u_init() #if 0 /* documentation of more zero values as desirable */ u.usick_cause[0] = 0; u.uluck = u.moreluck = 0; -# ifdef TOURIST uarmu = 0; -# endif uarm = uarmc = uarmh = uarms = uarmg = uarmf = 0; uwep = uball = uchain = uleft = uright = 0; uswapwep = uquiver = 0; @@ -676,7 +668,6 @@ u_init() knows_class(ARMOR_CLASS); skill_init(Skill_S); break; -#ifdef TOURIST case PM_TOURIST: Tourist[T_DARTS].trquan = rn1(20, 21); #ifndef GOLDOBJ @@ -691,7 +682,6 @@ u_init() else if(!rn2(25)) ini_inv(Magicmarker); skill_init(Skill_T); break; -#endif case PM_VALKYRIE: ini_inv(Valkyrie); if(!rn2(6)) ini_inv(Lamp); @@ -840,9 +830,7 @@ int otyp; case PM_RANGER: skills = Skill_Ran; break; case PM_ROGUE: skills = Skill_R; break; case PM_SAMURAI: skills = Skill_S; break; -#ifdef TOURIST case PM_TOURIST: skills = Skill_T; break; -#endif case PM_VALKYRIE: skills = Skill_V; break; case PM_WIZARD: skills = Skill_W; break; default: skills = 0; break; /* lint suppression */ @@ -1001,10 +989,8 @@ register struct trobj *trop; setworn(obj, W_ARMH); else if (is_gloves(obj) && !uarmg) setworn(obj, W_ARMG); -#ifdef TOURIST else if (is_shirt(obj) && !uarmu) setworn(obj, W_ARMU); -#endif else if (is_cloak(obj) && !uarmc) setworn(obj, W_ARMC); else if (is_boots(obj) && !uarmf) diff --git a/src/uhitm.c b/src/uhitm.c index 16b05fe9c..0057e573d 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -67,10 +67,8 @@ int attk; } if ((target = which_armor(mdef, W_ARM)) != (struct obj *)0) { (void)rust_dmg(target, xname(target), hurt, TRUE, mdef); -#ifdef TOURIST } else if ((target = which_armor(mdef, W_ARMU)) != (struct obj *)0) { (void)rust_dmg(target, xname(target), hurt, TRUE, mdef); -#endif } break; case 2: @@ -745,7 +743,6 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ } tmp = 1; break; -#ifdef TOURIST case EXPENSIVE_CAMERA: You("succeed in destroying %s. Congratulations!", ysimple_name(obj)); @@ -753,7 +750,6 @@ int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */ return(TRUE); /*NOTREACHED*/ break; -#endif case CORPSE: /* fixed by polder@cs.vu.nl */ if (touch_petrifies(&mons[obj->corpsenm])) { tmp = 1; @@ -1152,9 +1148,7 @@ struct attack *mattk; /* grabbing attacks the body */ obj = which_armor(mdef, W_ARMC); /* cloak */ if (!obj) obj = which_armor(mdef, W_ARM); /* suit */ -#ifdef TOURIST if (!obj) obj = which_armor(mdef, W_ARMU); /* shirt */ -#endif } /* if monster's cloak/armor is greased, your grab slips off; this diff --git a/src/vault.c b/src/vault.c index 5205f6aca..487cb8e7c 100644 --- a/src/vault.c +++ b/src/vault.c @@ -350,10 +350,7 @@ fnd: } if (!strcmpi(buf, "Croesus") || !strcmpi(buf, "Kroisos") -#ifdef TOURIST - || !strcmpi(buf, "Creosote") -#endif - ) { + || !strcmpi(buf, "Creosote")) { if (!mvitals[PM_CROESUS].died) { verbalize("Oh, yes, of course. Sorry to have disturbed you."); mongone(guard); diff --git a/src/worn.c b/src/worn.c index bea315bdc..32bfe1003 100644 --- a/src/worn.c +++ b/src/worn.c @@ -20,9 +20,7 @@ const struct worn { { W_ARMS, &uarms }, { W_ARMG, &uarmg }, { W_ARMF, &uarmf }, -#ifdef TOURIST { W_ARMU, &uarmu }, -#endif { W_RINGL, &uleft }, { W_RINGR, &uright }, { W_WEP, &uwep }, @@ -155,9 +153,7 @@ struct obj *obj; case ARM_GLOVES: res = W_ARMG; break; /* WORN_GLOVES */ case ARM_BOOTS: res = W_ARMF; break; /* WORN_BOOTS */ case ARM_CLOAK: res = W_ARMC; break; /* WORN_CLOAK */ -#ifdef TOURIST case ARM_SHIRT: res = W_ARMU; break; /* WORN_SHIRT */ -#endif } break; case WEAPON_CLASS: @@ -438,11 +434,9 @@ boolean creation; return; m_dowear_type(mon, W_AMUL, creation, FALSE); -#ifdef TOURIST /* can't put on shirt if already wearing suit */ if (!cantweararm(mon->data) && !(mon->misc_worn_check & W_ARM)) m_dowear_type(mon, W_ARMU, creation, FALSE); -#endif /* treating small as a special case allows hobbits, gnomes, and kobolds to wear cloaks */ if (!cantweararm(mon->data) || mon->data->msize == MZ_SMALL) @@ -491,11 +485,9 @@ boolean racialexception; continue; best = obj; goto outer_break; /* no such thing as better amulets */ -#ifdef TOURIST case W_ARMU: if (!is_shirt(obj)) continue; break; -#endif case W_ARMC: if (!is_cloak(obj)) continue; break; @@ -542,11 +534,7 @@ outer_break: best->otyp == DUNCE_CAP) && !best->cursed); /* if wearing a cloak, account for the time spent removing and re-wearing it when putting on a suit or shirt */ - if ((flag == W_ARM -#ifdef TOURIST - || flag == W_ARMU -#endif - ) && (mon->misc_worn_check & W_ARMC)) + if ((flag == W_ARM || flag == W_ARMU) && (mon->misc_worn_check & W_ARMC)) m_delay += 2; /* when upgrading a piece of armor, account for time spent taking off current one */ @@ -741,7 +729,6 @@ boolean polyspot; m_useup(mon, otmp); } } -#ifdef TOURIST if ((otmp = which_armor(mon, W_ARMU)) != 0) { if (vis) pline("%s shirt rips to shreds!", s_suffix(Monnam(mon))); @@ -749,7 +736,6 @@ boolean polyspot; You_hear("a ripping sound."); m_useup(mon, otmp); } -#endif } else if (sliparm(mdat)) { if ((otmp = which_armor(mon, W_ARM)) != 0) { if (vis) @@ -772,7 +758,6 @@ boolean polyspot; if (polyspot) bypass_obj(otmp); m_lose_armor(mon, otmp); } -#ifdef TOURIST if ((otmp = which_armor(mon, W_ARMU)) != 0) { if (vis) { if (sliparm(mon->data)) @@ -785,7 +770,6 @@ boolean polyspot; if (polyspot) bypass_obj(otmp); m_lose_armor(mon, otmp); } -#endif } if (handless_or_tiny) { /* [caller needs to handle weapon checks] */ diff --git a/src/zap.c b/src/zap.c index c19557fd0..752b03796 100644 --- a/src/zap.c +++ b/src/zap.c @@ -2282,10 +2282,8 @@ boolean ordinary; case WAN_LIGHT: /* (broken wand) */ /* assert( !ordinary ); */ damage = d(obj->spe, 25); -#ifdef TOURIST case EXPENSIVE_CAMERA: if (!damage) damage = 5; -#endif damage = lightdamage(obj, ordinary, damage); damage += rnd(25); if (flashburn((long)damage)) learn_it = TRUE; @@ -3371,10 +3369,8 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */ tmp = MAGIC_COOKIE; if ((otmp2 = which_armor(mon, W_ARMC)) != 0) m_useup(mon, otmp2); -#ifdef TOURIST if ((otmp2 = which_armor(mon, W_ARMU)) != 0) m_useup(mon, otmp2); -#endif } type = -1; /* no saving throw wanted */ break; /* not ordinary damage */ @@ -3502,9 +3498,7 @@ xchar sx, sy; /* no shield or suit, you're dead; wipe out cloak and/or shirt in case of life-saving or bones */ if (uarmc) (void) destroy_arm(uarmc); -#ifdef TOURIST if (uarmu) (void) destroy_arm(uarmu); -#endif } else if (nonliving(youmonst.data) || is_demon(youmonst.data)) { shieldeff(sx, sy); You("seem unaffected."); diff --git a/sys/amiga/winami.c b/sys/amiga/winami.c index 4762f0697..c702af237 100644 --- a/sys/amiga/winami.c +++ b/sys/amiga/winami.c @@ -579,11 +579,7 @@ amii_player_selection() { flags.initrole = randrole(); #if 0 /* OBSOLETE */ -#ifdef TOURIST strcpy( pl_character, roles[ rnd( 11 ) ] ); -#else - strcpy( pl_character, roles[ rnd( 10 ) ] ); -#endif #endif aredone = 1; amii_clear_nhwindow( WIN_BASE ); @@ -608,11 +604,7 @@ amii_player_selection() case 1: /* Random Character */ flags.initrole = randrole(); #if 0 /* OBSOLETE */ -#ifdef TOURIST strcpy( pl_character, roles[ rnd( 11 ) ] ); -#else - strcpy( pl_character, roles[ rnd( 10 ) ] ); -#endif #endif amii_clear_nhwindow( WIN_BASE ); CloseShWindow( cwin ); diff --git a/util/makedefs.c b/util/makedefs.c index 6ddff76c0..1de90dc6c 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -996,11 +996,8 @@ make_version() | (1L << 6) #endif /* objects (10..14) */ -#ifdef TOURIST - | (1L << 10) -#endif #ifdef GOLDOBJ - | (1L << 11) + | (1L << 10) #endif /* flag bits and/or other global variables (15..26) */ #ifdef TEXTCOLOR @@ -1339,9 +1336,6 @@ static const char *build_opts[] = { #ifdef TIMED_DELAY "timed wait for display effects", #endif -#ifdef TOURIST - "tourists", -#endif #ifdef USER_SOUNDS # ifdef USER_SOUNDS_REGEX "user sounds via regular expressions", @@ -2515,11 +2509,9 @@ do_objs() if (!strncmp(objnam, "THE_", 4)) objnam += 4; -#ifdef TOURIST /* fudge _platinum_ YENDORIAN EXPRESS CARD */ if (!strncmp(objnam, "PLATINUM_", 9)) objnam += 9; -#endif Fprintf(ofp,"#define\tART_%s\t%d\n", limit(objnam, 1), i); } diff --git a/win/Qt/qt_win.cpp b/win/Qt/qt_win.cpp index 7d3341506..ac2141fcc 100644 --- a/win/Qt/qt_win.cpp +++ b/win/Qt/qt_win.cpp @@ -3498,13 +3498,8 @@ void NetHackQtInvUsageWindow::paintEvent(QPaintEvent*) drawWorn(painter,uarms,0,1); // Shield drawWorn(painter,uarmg,0,2); // Gloves - repeated drawWorn(painter,uarmg,2,2); // Gloves - repeated -#ifdef TOURIST drawWorn(painter,uarmf,1,5); // Shoes (feet) drawWorn(painter,uarmu,1,4); // Undershirt -#else - drawWorn(painter,0 ,1,5,FALSE); - drawWorn(painter,uarmf,1,4); // Shoes (feet) -#endif drawWorn(painter,uleft,0,3); // RingL drawWorn(painter,uright,2,3); // RingR diff --git a/win/gnome/gnworn.c b/win/gnome/gnworn.c index 20a8aa641..ee5e704b5 100644 --- a/win/gnome/gnworn.c +++ b/win/gnome/gnworn.c @@ -14,7 +14,6 @@ #define WORN_WIDTH 3 #define WORN_HEIGHT 6 -#ifdef TOURIST #define WORN_OBJECT_LIST /* struct obj *[WORN_HEIGHT][WORN_WIDTH] = */ { \ { uquiver, uarmh, u.twoweap ? NULL : uswapwep }, \ { u.twoweap ? uswapwep : NULL, ublindf, uwep }, \ @@ -23,16 +22,6 @@ { uarmu, uarm, uskin }, \ { uball, uarmf, uchain } \ } -#else -#define WORN_OBJECT_LIST /* struct obj *[WORN_HEIGHT][WORN_WIDTH] = */ { \ - { uquiver, uarmh, u.twoweap ? NULL : uswapwep }, \ - { u.twoweap ? uswapwep : NULL, ublindf, uwep }, \ - { uleft, uamul, uright }, \ - { uarms, uarmc, uarmg }, \ - { NULL, uarm, uskin }, \ - { uball, uarmf, uchain } \ -} -#endif static GtkWidget *worn_contents[WORN_HEIGHT][WORN_WIDTH]; static struct obj *last_worn_objects[WORN_HEIGHT][WORN_WIDTH]; diff --git a/win/share/tilemap.c b/win/share/tilemap.c index 19872f96a..06c966113 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -48,31 +48,16 @@ struct conditionals { #endif #ifndef MAIL { MON_GLYPH, PM_FAMINE, "mail daemon" }, -#endif -#ifndef TOURIST - { MON_GLYPH, PM_SAMURAI, "tourist" }, #endif /* commented out in monst.c at present */ { MON_GLYPH, PM_SHAMAN_KARNOV, "Earendil" }, { MON_GLYPH, PM_SHAMAN_KARNOV, "Elwing" }, -#ifndef TOURIST - { MON_GLYPH, PM_LORD_SATO, "Twoflower" }, -#endif /* commented out in monst.c at present */ { MON_GLYPH, PM_CHROMATIC_DRAGON, "Goblin King" }, { MON_GLYPH, PM_NEANDERTHAL, "High-elf" }, -#ifndef TOURIST - { MON_GLYPH, PM_ROSHI, "guide" }, -#endif /* objects commented out in objects.c at present */ { OBJ_GLYPH, SILVER_DRAGON_SCALE_MAIL, "shimmering dragon scale mail" }, { OBJ_GLYPH, SILVER_DRAGON_SCALES, "shimmering dragon scales" }, -#ifndef TOURIST - { OBJ_GLYPH, LEATHER_JACKET, "Hawaiian shirt" }, - { OBJ_GLYPH, LEATHER_JACKET, "T-shirt" }, - { OBJ_GLYPH, LOCK_PICK, "credit card" }, - { OBJ_GLYPH, MAGIC_LAMP, "expensive camera" }, -#endif /* allow slime mold to look like slice of pizza, since we * don't know what a slime mold should look like when renamed anyway */ From ffd201495cc3d708da734ab0d0a0d95defcf6f9e Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 13 Feb 2015 23:46:47 -0500 Subject: [PATCH 126/354] Make REINCARNATION unconditional. There is a lot of code affected by this, and Pat Rankin correctly observes that it would be better to store roguelike as a level flag rather than just using Is_rogue_level. A note for the future. --- dat/dungeon.def | 4 ++-- include/config.h | 1 - include/decl.h | 4 ---- include/dungeon.h | 2 -- include/extern.h | 6 ------ src/detect.c | 2 -- src/do.c | 4 ---- src/do_name.c | 2 -- src/dogmove.c | 2 -- src/drawing.c | 20 ++++---------------- src/dungeon.c | 8 -------- src/extralev.c | 3 --- src/files.c | 15 +++------------ src/hack.c | 2 -- src/lock.c | 2 -- src/makemon.c | 18 ------------------ src/mapglyph.c | 14 +++++--------- src/mhitu.c | 2 -- src/mklev.c | 22 ---------------------- src/mkobj.c | 4 ---- src/mon.c | 7 ------- src/monmove.c | 8 +------- src/muse.c | 2 -- src/options.c | 33 ++++++--------------------------- src/read.c | 9 ++------- src/restore.c | 2 -- src/vision.c | 12 ++---------- src/zap.c | 2 -- sys/amiga/winfuncs.c | 10 +--------- sys/msdos/pckeys.c | 16 ++++------------ sys/msdos/vidvga.c | 10 ---------- sys/share/pcmain.c | 2 -- sys/wince/mhmain.c | 2 -- sys/wince/mhmap.c | 6 +----- sys/wince/mswproc.c | 2 -- util/makedefs.c | 13 ++----------- win/Qt/qt_win.cpp | 9 +-------- win/X11/winmap.c | 11 ++--------- win/gem/wingem.c | 8 +------- win/win32/mhmain.c | 2 -- win/win32/mhmap.c | 6 +----- win/win32/mswproc.c | 2 -- 42 files changed, 38 insertions(+), 273 deletions(-) diff --git a/dat/dungeon.def b/dat/dungeon.def index b881884f5..bccd31b85 100644 --- a/dat/dungeon.def +++ b/dat/dungeon.def @@ -19,8 +19,8 @@ DUNGEON: "The Dungeons of Doom" "D" (25, 5) ALIGNMENT: unaligned BRANCH: "The Gnomish Mines" @ (2, 3) -%REINCARNATION LEVEL: "rogue" "R" @ (15, 4) -%REINCARNATION LEVELDESC: roguelike +LEVEL: "rogue" "R" @ (15, 4) +LEVELDESC: roguelike LEVEL: "oracle" "O" @ (5, 5) LEVALIGN: neutral CHAINBRANCH: "Sokoban" "oracle" + (1, 0) up diff --git a/include/config.h b/include/config.h index c9b17524d..bcc8e9903 100644 --- a/include/config.h +++ b/include/config.h @@ -420,7 +420,6 @@ typedef unsigned char uchar; /* dungeon features */ /* dungeon levels */ #define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */ -#define REINCARNATION /* Special Rogue-like levels */ /* monsters & objects */ #define SEDUCE /* Succubi/incubi seduction, by KAA, suggested by IM */ /* I/O */ diff --git a/include/decl.h b/include/decl.h index bfe3052db..8276c6022 100644 --- a/include/decl.h +++ b/include/decl.h @@ -46,9 +46,7 @@ E NEARDATA int in_doagain; E struct dgn_topology { /* special dungeon levels for speed */ d_level d_oracle_level; d_level d_bigroom_level; /* unused */ -#ifdef REINCARNATION d_level d_rogue_level; -#endif d_level d_medusa_level; d_level d_stronghold_level; d_level d_valley_level; @@ -75,9 +73,7 @@ E struct dgn_topology { /* special dungeon levels for speed */ /* macros for accesing the dungeon levels by their old names */ #define oracle_level (dungeon_topology.d_oracle_level) #define bigroom_level (dungeon_topology.d_bigroom_level) -#ifdef REINCARNATION #define rogue_level (dungeon_topology.d_rogue_level) -#endif #define medusa_level (dungeon_topology.d_medusa_level) #define stronghold_level (dungeon_topology.d_stronghold_level) #define valley_level (dungeon_topology.d_valley_level) diff --git a/include/dungeon.h b/include/dungeon.h index 2aac7f39e..d80d22a7d 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -232,9 +232,7 @@ typedef struct mapseen { Bitfield(valley, 1); Bitfield(msanctum, 1); Bitfield(ludios, 1); -# ifdef REINCARNATION Bitfield(roguelevel, 1); -# endif } flags; /* custom naming */ char *custom; diff --git a/include/extern.h b/include/extern.h index 667d598d1..6f0ad015f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -399,9 +399,7 @@ E char *FDECL(distant_monnam, (struct monst *,int,char *)); E const char *NDECL(rndmonnam); E const char *FDECL(hcolor, (const char *)); E const char *NDECL(rndcolor); -#ifdef REINCARNATION E const char *NDECL(roguename); -#endif E struct obj *FDECL(realloc_obj, (struct obj *, int, genericptr_t, int, const char *)); E char *FDECL(coyotename, (struct monst *,char *)); @@ -519,9 +517,7 @@ E int FDECL(def_char_to_monclass, (CHAR_P)); #if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C) E void FDECL(switch_symbols, (int)); E void FDECL(assign_graphics, (int)); -#ifdef REINCARNATION E void NDECL(init_r_symbols); -#endif E void NDECL(init_symbols); E void NDECL(init_showsyms); E void NDECL(init_l_symbols); @@ -702,11 +698,9 @@ E void FDECL(explode_oil, (struct obj *,int,int)); /* ### extralev.c ### */ -#ifdef REINCARNATION E void NDECL(makeroguerooms); E void FDECL(corr, (int,int)); E void NDECL(makerogueghost); -#endif /* ### files.c ### */ diff --git a/src/detect.c b/src/detect.c index db280b819..93db6c77c 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1059,12 +1059,10 @@ struct rm *lev; { int newmask = lev->doormask & ~WM_MASK; -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) /* rogue didn't have doors, only doorways */ newmask = D_NODOOR; else -#endif /* newly exposed door is closed */ if (!(newmask & D_LOCKED)) newmask |= D_CLOSED; diff --git a/src/do.c b/src/do.c index 35b0b9c40..e0fe5a5c3 100644 --- a/src/do.c +++ b/src/do.c @@ -1143,10 +1143,8 @@ boolean at_stairs, falling, portal; #endif } -#ifdef REINCARNATION if (Is_rogue_level(newlevel) || Is_rogue_level(&u.uz)) assign_graphics(Is_rogue_level(newlevel) ? ROGUESET : PRIMARY); -#endif #ifdef USE_TILES substitute_tiles(newlevel); #endif @@ -1411,10 +1409,8 @@ boolean at_stairs, falling, portal; } } } else { -#ifdef REINCARNATION if (new && Is_rogue_level(&u.uz)) You("enter what seems to be an older, more primitive world."); -#endif /* main dungeon message from your quest leader */ if (!In_quest(&u.uz0) && at_dgn_entrance("The Quest") && !(u.uevent.qcompleted || u.uevent.qexpelled || diff --git a/src/do_name.c b/src/do_name.c index ea5b64b8b..4face203e 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -1057,7 +1057,6 @@ const char *mname; return FALSE; } -#ifdef REINCARNATION const char * roguename() /* Name of a Rogue player */ { @@ -1075,7 +1074,6 @@ roguename() /* Name of a Rogue player */ return rn2(3) ? (rn2(2) ? "Michael Toy" : "Kenneth Arnold") : "Glenn Wichman"; } -#endif /* REINCARNATION */ static NEARDATA const char * const hcolors[] = { "ultraviolet", "infrared", "bluish-orange", diff --git a/src/dogmove.c b/src/dogmove.c index 526f40454..4300fb8de 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -673,9 +673,7 @@ register int after; /* this is extra fast monster movement */ } if (is_giant(mtmp->data)) allowflags |= BUSTDOOR; if (tunnels(mtmp->data) -#ifdef REINCARNATION && !Is_rogue_level(&u.uz) /* same restriction as m_move() */ -#endif ) allowflags |= ALLOW_DIG; cnt = mfndpos(mtmp, poss, info, allowflags); diff --git a/src/drawing.c b/src/drawing.c index 80e82133f..3d94d8803 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -27,9 +27,7 @@ int currentgraphics = 0; nhsym showsyms[SYM_MAX] = DUMMY; /* symbols to be displayed */ nhsym l_syms[SYM_MAX] = DUMMY; /* loaded symbols */ -#ifdef REINCARNATION nhsym r_syms[SYM_MAX] = DUMMY; /* rogue symbols */ -#endif nhsym warnsyms[WARNCOUNT] = DUMMY; /* the current warning display symbols */ const char invisexplain[] = "remembered, unseen, creature"; @@ -234,7 +232,6 @@ const struct symdef defsyms[MAXPCHARS] = { {'/', "", C(CLR_ORANGE)}, /* explosion bottom right */ }; -#ifdef REINCARNATION /* default rogue level symbols */ static const uchar def_r_oc_syms[MAXOCLASSES] = { /* 0*/ '\0', @@ -256,7 +253,6 @@ static const uchar def_r_oc_syms[MAXOCLASSES] = { CHAIN_SYM, VENOM_SYM }; -#endif #undef C @@ -306,10 +302,10 @@ def_char_to_monclass(ch) * Sets the current display symbols, the * loadable symbols to the default NetHack * symbols, including the r_syms rogue level - * symbols if REINCARNATION is defined. - * This would typically be done immediately - * after execution begins. Any previously - * loaded external symbol sets are discarded. + * symbols. This would typically be done + * immediately after execution begins. Any + * previously loaded external symbol sets are + * discarded. * * switch_symbols(arg) * Called to swap in new current display symbols @@ -350,9 +346,7 @@ init_symbols() { init_l_symbols(); init_showsyms(); -#ifdef REINCARNATION init_r_symbols(); -#endif } void @@ -410,7 +404,6 @@ init_l_symbols() #endif } -#ifdef REINCARNATION void init_r_symbols() { @@ -448,7 +441,6 @@ init_r_symbols() */ # endif } -#endif /*REINCARNATION*/ void assign_graphics(whichset) @@ -457,7 +449,6 @@ int whichset; register int i; switch(whichset) { -# ifdef REINCARNATION case ROGUESET: /* Adjust graphics display characters on Rogue levels */ @@ -469,7 +460,6 @@ int whichset; # endif currentgraphics = ROGUESET; break; -# endif case PRIMARY: default: @@ -518,7 +508,6 @@ int val; l_syms[symp->idx] = val; } -# ifdef REINCARNATION void update_r_symset(symp, val) struct symparse *symp; @@ -526,7 +515,6 @@ int val; { r_syms[symp->idx] = val; } -# endif /* REINCARNATION */ void clear_symsetentry(which_set, name_too) diff --git a/src/dungeon.c b/src/dungeon.c index d87faa15e..c08d195af 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -680,9 +680,7 @@ struct level_map { { "medusa", &medusa_level }, { "oracle", &oracle_level }, { "orcus", &orcus_level }, -#ifdef REINCARNATION { "rogue", &rogue_level }, -#endif { "sanctum", &sanctum_level }, { "valley", &valley_level }, { "water", &water_level }, @@ -2086,9 +2084,7 @@ mapseen *mptr; if (mptr->flags.unreachable || mptr->flags.forgot) return FALSE; /* level is of interest if it has an auto-generated annotation */ if (mptr->flags.oracle || mptr->flags.bigroom || -# ifdef REINCARNATION mptr->flags.roguelevel || -# endif mptr->flags.castle || mptr->flags.valley || mptr->flags.msanctum) return TRUE; /* when in Sokoban, list all sokoban levels visited; when not in it, @@ -2151,9 +2147,7 @@ recalc_mapseen() mptr->flags.bigroom = Is_bigroom(&u.uz); else if (mptr->flags.forgot) mptr->flags.bigroom = 0; -# ifdef REINCARNATION mptr->flags.roguelevel = Is_rogue_level(&u.uz); -# endif mptr->flags.oracle = 0; /* recalculated during room traversal below */ mptr->flags.castletune = 0; /* flags.castle, flags.valley, flags.msanctum retain previous value */ @@ -2650,10 +2644,8 @@ boolean printdun; mptr->flags.sokosolved ? "Solved" : "Unsolved"); } else if (mptr->flags.bigroom) { Sprintf(buf, "%sA very big room.", PREFIX); -# ifdef REINCARNATION } else if (mptr->flags.roguelevel) { Sprintf(buf, "%sA primitive area.", PREFIX); -# endif } else if (on_level(&mptr->lev, &qstart_level)) { Sprintf(buf, "%sHome%s.", PREFIX, mptr->flags.unreachable ? " (no way back...)" : ""); diff --git a/src/extralev.c b/src/extralev.c index 597b23e72..821e5794f 100644 --- a/src/extralev.c +++ b/src/extralev.c @@ -9,8 +9,6 @@ #include "hack.h" -#ifdef REINCARNATION - struct rogueroom { xchar rlx, rly; xchar dx, dy; @@ -336,6 +334,5 @@ makerogueghost() ghostobj->known = TRUE; } } -#endif /* REINCARNATION */ /*extralev.c*/ diff --git a/src/files.c b/src/files.c index 4b72c754d..f667b8093 100644 --- a/src/files.c +++ b/src/files.c @@ -2752,11 +2752,8 @@ int which_set; /* matches desired one */ chosen_symset_start = TRUE; /* these init_*() functions clear symset fields too */ -# ifdef REINCARNATION if (which_set == ROGUESET) init_r_symbols(); - else -# endif - if (which_set == PRIMARY) init_l_symbols(); + else if (which_set == PRIMARY) init_l_symbols(); } break; case 1: @@ -2808,11 +2805,8 @@ int which_set; if (chosen_symset_start) chosen_symset_end = FALSE; chosen_symset_start = FALSE; -# ifdef REINCARNATION if (which_set == ROGUESET) init_r_symbols(); - else -# endif - if (which_set == PRIMARY) init_l_symbols(); + else if (which_set == PRIMARY) init_l_symbols(); } } break; @@ -2822,12 +2816,9 @@ int which_set; if (chosen_symset_start) { if (which_set == PRIMARY) { update_l_symset(symp, val); - } -# ifdef REINCARNATION - else if (which_set == ROGUESET) { + } else if (which_set == ROGUESET) { update_r_symset(symp, val); } -# endif } } } diff --git a/src/hack.c b/src/hack.c index 1bbfa1977..545c4c4aa 100644 --- a/src/hack.c +++ b/src/hack.c @@ -2356,11 +2356,9 @@ int x, y; struct rm *lev_p = &levl[x][y]; if (!IS_DOOR(lev_p->typ)) return FALSE; -#ifdef REINCARNATION /* all rogue level doors are doorless but disallow diagonal access, so we treat them as if their non-existant doors were actually present */ if (Is_rogue_level(&u.uz)) return FALSE; -#endif return !(lev_p->doormask & ~(D_NODOOR|D_BROKEN)); } diff --git a/src/lock.c b/src/lock.c index 2ba1d51b7..73dc8c159 100644 --- a/src/lock.c +++ b/src/lock.c @@ -831,7 +831,6 @@ int x, y; switch(otmp->otyp) { case WAN_LOCKING: case SPE_WIZARD_LOCK: -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) { boolean vis = cansee(x,y); /* Can't have real locking in Rogue, so just hide doorway */ @@ -849,7 +848,6 @@ int x, y; newsym(x,y); return TRUE; } -#endif if (obstructed(x,y,mysterywand)) return FALSE; /* Don't allow doors to close over traps. This is for pits */ /* & trap doors, but is it ever OK for anything else? */ diff --git a/src/makemon.c b/src/makemon.c index 72f3ae6b9..44fcb79a0 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -5,9 +5,7 @@ #include "hack.h" -#ifdef REINCARNATION #include -#endif STATIC_VAR NEARDATA struct monst zeromonst; @@ -160,9 +158,7 @@ register struct monst *mtmp; register int mm = monsndx(ptr); struct obj *otmp; -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) return; -#endif /* * first a few special cases: * @@ -481,9 +477,7 @@ register struct monst *mtmp; register int cnt; register struct obj *otmp; register struct permonst *ptr = mtmp->data; -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) return; -#endif /* * Soldiers get armour & rations - armour approximates their ac. * Nymphs may get mirror or potion of object detection. @@ -1279,9 +1273,7 @@ rndmonst() if (rndmonst_state.choice_count < 0) { /* need to recalculate */ int zlevel, minmlev, maxmlev; boolean elemlevel; -#ifdef REINCARNATION boolean upper; -#endif rndmonst_state.choice_count = 0; /* look for first common monster */ @@ -1301,9 +1293,7 @@ rndmonst() minmlev = zlevel / 6; /* determine the level of the strongest monster to make. */ maxmlev = (zlevel + u.ulevel) / 2; -#ifdef REINCARNATION upper = Is_rogue_level(&u.uz); -#endif elemlevel = In_endgame(&u.uz) && !Is_astralevel(&u.uz); /* @@ -1315,9 +1305,7 @@ rndmonst() rndmonst_state.mchoices[mndx] = 0; if (tooweak(mndx, minmlev) || toostrong(mndx, maxmlev)) continue; -#ifdef REINCARNATION if (upper && !isupper(def_monsyms[(int)(ptr->mlet)].sym)) continue; -#endif if (elemlevel && wrong_elem_type(ptr)) continue; if (uncommon(mndx)) continue; if (Inhell && (ptr->geno & G_NOHELL)) continue; @@ -1825,15 +1813,9 @@ register struct monst *mtmp; levl[mx-1][my].typ == TDWALL || levl[mx-1][my].typ == CROSSWALL|| levl[mx-1][my].typ == TUWALL )) -#ifdef REINCARNATION appear = Is_rogue_level(&u.uz) ? S_hwall : S_hcdoor; else appear = Is_rogue_level(&u.uz) ? S_vwall : S_vcdoor; -#else - appear = S_hcdoor; - else - appear = S_vcdoor; -#endif if(!mtmp->minvis || See_invisible) block_point(mx,my); /* vision */ } else if (level.flags.is_maze_lev && !In_sokoban(&u.uz) && rn2(2)) { diff --git a/src/mapglyph.c b/src/mapglyph.c index b0dfa2a66..f1adae27a 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -34,9 +34,9 @@ int explcolors[] = { #define pet_color(n) color = iflags.use_color ? mons[n].mcolor : NO_COLOR #define warn_color(n) color = iflags.use_color ? def_warnsyms[n].color : NO_COLOR #define explode_color(n) color = iflags.use_color ? explcolors[n] : NO_COLOR -# if defined(REINCARNATION) && defined(LOADSYMSETS) -# define ROGUE_COLOR -# endif +#ifdef LOADSYMSETS +# define ROGUE_COLOR +#endif #else /* no text color */ @@ -236,14 +236,10 @@ unsigned *ospecial; ch = showsyms[idx]; #ifdef TEXTCOLOR /* Turn off color if no color defined, or rogue level w/o PC graphics. */ -# ifdef REINCARNATION -# ifdef ROGUE_COLOR +# ifdef ROGUE_COLOR if (!has_color(color) || (Is_rogue_level(&u.uz) && !has_rogue_color)) -# else - if (!has_color(color) || Is_rogue_level(&u.uz)) -# endif # else - if (!has_color(color)) + if (!has_color(color) || Is_rogue_level(&u.uz)) # endif color = NO_COLOR; #endif diff --git a/src/mhitu.c b/src/mhitu.c index 89cd68968..ad68b2d31 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -654,9 +654,7 @@ mattacku(mtmp) break; case AT_WEAP: if(range2) { -#ifdef REINCARNATION if (!Is_rogue_level(&u.uz)) -#endif thrwmu(mtmp); } else { int hittmp = 0; diff --git a/src/mklev.c b/src/mklev.c index 1d895dc2c..1bba98d61 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -400,11 +400,9 @@ register int type; levl[x][y].doormask = (shdoor ? D_ISOPEN : D_NODOOR); #endif -#ifdef REINCARNATION /* also done in roguecorr(); doing it here first prevents making mimics in place of trapped doors on rogue level */ if (Is_rogue_level(&u.uz)) levl[x][y].doormask = D_NODOOR; -#endif if(levl[x][y].doormask & D_TRAPPED) { struct monst *mtmp; @@ -627,11 +625,7 @@ makelevel() register s_level *slev = Is_special(&u.uz); /* check for special levels */ -#ifdef REINCARNATION if (slev && !Is_rogue_level(&u.uz)) -#else - if (slev) -#endif { makemaz(slev->proto); return; @@ -663,12 +657,10 @@ makelevel() /* otherwise, fall through - it's a "regular" level. */ -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) { makeroguerooms(); makerogueghost(); } else -#endif makerooms(); sort_rooms(); @@ -694,9 +686,7 @@ makelevel() branchp = Is_branchlev(&u.uz); /* possible dungeon branch */ room_threshold = branchp ? 4 : 3; /* minimum number of rooms needed to allow a random special room */ -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) goto skip0; -#endif makecorridors(); make_niches(); @@ -753,9 +743,7 @@ makelevel() !(mvitals[PM_COCKATRICE].mvflags & G_GONE)) mkroom(COCKNEST); } -#ifdef REINCARNATION skip0: -#endif /* Place multi-dungeon branch. */ place_branch(branchp, 0, 0); @@ -784,9 +772,7 @@ skip0: mktrap(0,0,croom,(coord*)0); if (!goldseen && !rn2(3)) (void) mkgold(0L, somex(croom), somey(croom)); -#ifdef REINCARNATION if(Is_rogue_level(&u.uz)) goto skip_nonrogue; -#endif if(!rn2(10)) mkfount(0,croom); if(!rn2(60)) mksink(croom); if(!rn2(60)) mkaltar(croom); @@ -822,9 +808,7 @@ skip0: } } -#ifdef REINCARNATION skip_nonrogue: -#endif if(!rn2(3)) { (void) mkobj_at(0, somex(croom), somey(croom), TRUE); tryct = 0; @@ -863,9 +847,7 @@ mineralize() /* determine if it is even allowed; almost all special levels are excluded */ if (In_hell(&u.uz) || In_V_tower(&u.uz) || -#ifdef REINCARNATION Is_rogue_level(&u.uz) || -#endif level.flags.arboreal || ((sp = Is_special(&u.uz)) != 0 && !Is_oracle_level(&u.uz) && (!In_mines(&u.uz) || sp->flags.town) @@ -983,10 +965,8 @@ register struct mkroom *croom; if ((int) levl[lowx][lowy].roomno == roomno || croom->irregular) return; #ifdef SPECIALIZATION -# ifdef REINCARNATION if (Is_rogue_level(&u.uz)) do_ordinary = TRUE; /* vision routine helper */ -# endif if ((rtype != OROOM) || do_ordinary) #endif { @@ -1207,7 +1187,6 @@ coord *tm; if (num > 0 && num < TRAPNUM) { kind = num; -#ifdef REINCARNATION } else if (Is_rogue_level(&u.uz)) { switch (rn2(7)) { default: kind = BEAR_TRAP; break; /* 0 */ @@ -1218,7 +1197,6 @@ coord *tm; case 5: kind = SLP_GAS_TRAP; break; case 6: kind = RUST_TRAP; break; } -#endif } else if (Inhell && !rn2(5)) { /* bias the frequency of fire traps in Gehennom */ kind = FIRE_TRAP; diff --git a/src/mkobj.c b/src/mkobj.c index 1edb34977..698018e9f 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -52,7 +52,6 @@ const struct icp boxiprobs[] = { { 1, AMULET_CLASS} }; -#ifdef REINCARNATION const struct icp rogueprobs[] = { {12, WEAPON_CLASS}, {12, ARMOR_CLASS}, @@ -62,7 +61,6 @@ const struct icp rogueprobs[] = { { 5, WAND_CLASS}, { 5, RING_CLASS} }; -#endif const struct icp hellprobs[] = { {20, WEAPON_CLASS}, @@ -222,10 +220,8 @@ boolean artif; if(oclass == RANDOM_CLASS) { const struct icp *iprobs = -#ifdef REINCARNATION (Is_rogue_level(&u.uz)) ? (const struct icp *)rogueprobs : -#endif Inhell ? (const struct icp *)hellprobs : (const struct icp *)mkobjprobs; diff --git a/src/mon.c b/src/mon.c index 4ed4b168c..2befc3e5b 100644 --- a/src/mon.c +++ b/src/mon.c @@ -28,14 +28,9 @@ STATIC_DCL boolean FDECL(validvamp, (struct monst *,int *,int)); #endif STATIC_DCL struct permonst *FDECL(accept_newcham_form, (int)); -#ifdef REINCARNATION #define LEVEL_SPECIFIC_NOCORPSE(mdat) \ (Is_rogue_level(&u.uz) || \ (level.flags.graveyard && is_undead(mdat) && rn2(3))) -#else -#define LEVEL_SPECIFIC_NOCORPSE(mdat) \ - (level.flags.graveyard && is_undead(mdat) && rn2(3)) -#endif #if 0 /* part of the original warning code which was replaced in 3.3.1 */ @@ -1048,9 +1043,7 @@ nexttry: /* eels prefer the water, but if there is no water nearby, if (nx != x && ny != y && (nodiag || (IS_DOOR(nowtyp) && (levl[x][y].doormask & ~D_BROKEN)) || (IS_DOOR(ntyp) && (levl[nx][ny].doormask & ~D_BROKEN)) || -#ifdef REINCARNATION ((IS_DOOR(nowtyp) || IS_DOOR(ntyp)) && Is_rogue_level(&u.uz)) || -#endif /* mustn't pass between adjacent long worm segments, but can attack that way */ (m_at(x, ny) && m_at(nx, y) && worm_cross(x, y, nx, ny) && diff --git a/src/monmove.c b/src/monmove.c index cc18bcd3c..dd7315346 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -680,9 +680,7 @@ register int after; /* Not necessary if m_move called from this file, but necessary in * other calls of m_move (ex. leprechauns dodging) */ -#ifdef REINCARNATION if (!Is_rogue_level(&u.uz)) -#endif can_tunnel = tunnels(ptr); can_open = !(nohands(ptr) || verysmall(ptr)); can_unlock = ((can_open && monhaskey(mtmp, TRUE)) || @@ -804,11 +802,7 @@ not_special: } } - if ((!mtmp->mpeaceful || !rn2(10)) -#ifdef REINCARNATION - && (!Is_rogue_level(&u.uz)) -#endif - ) { + if ((!mtmp->mpeaceful || !rn2(10)) && (!Is_rogue_level(&u.uz))) { boolean in_line = lined_up(mtmp) && (distmin(mtmp->mx, mtmp->my, mtmp->mux, mtmp->muy) <= (throws_rocks(youmonst.data) ? 20 : ACURRSTR/2+1) diff --git a/src/muse.c b/src/muse.c index ec4bc55ab..855a91887 100644 --- a/src/muse.c +++ b/src/muse.c @@ -1080,9 +1080,7 @@ struct monst *mtmp; unsolid(mtmp->data) || !rn2(10)) && dist2(mtmp->mx,mtmp->my,mtmp->mux,mtmp->muy) <= 2 && mtmp->mcansee && haseyes(mtmp->data) -#ifdef REINCARNATION && !Is_rogue_level(&u.uz) -#endif && (!In_endgame(&u.uz) || Is_earthlevel(&u.uz))) { m.offensive = obj; m.has_offense = MUSE_SCR_EARTH; diff --git a/src/options.c b/src/options.c index 18966efb5..8504a2c3e 100644 --- a/src/options.c +++ b/src/options.c @@ -369,14 +369,10 @@ static struct Comp_Opt DISP_IN_GAME}, #endif { "roguesymset", "load a set of rogue display symbols from the symbols file", 70, -#ifdef REINCARNATION -# ifdef LOADSYMSETS +#ifdef LOADSYMSETS SET_IN_GAME }, -# else - DISP_IN_GAME}, -# endif #else - SET_IN_FILE}, + DISP_IN_GAME}, #endif { "suppress_alert", "suppress alerts about version-specific features", 8, SET_IN_GAME }, @@ -1417,7 +1413,6 @@ boolean tinitial, tfrom_file; fullname = "roguesymset"; if (match_optname(opts, fullname, 7, TRUE)) { -#if defined(REINCARNATION) && defined(LOADSYMSETS) if (duplicate) complain_about_duplicate(opts,1); if (negated) bad_negation(fullname, FALSE); else if ((op = string_for_opt(opts, FALSE)) != 0) { @@ -1434,7 +1429,6 @@ boolean tinitial, tfrom_file; need_redraw = TRUE; } } -#endif return; } @@ -2594,10 +2588,8 @@ goodfruit: wait_synch(); } else { switch_symbols(TRUE); -# ifdef REINCARNATION if (!initial && Is_rogue_level(&u.uz)) assign_graphics(ROGUESET); -# endif } } # endif /*LOADSYMSETS*/ @@ -3449,16 +3441,10 @@ boolean setinitial,setfromfile; #endif int chosen = -2, which_set; -#ifdef REINCARNATION if (rogueflag) which_set = ROGUESET; else -#endif which_set = PRIMARY; -#ifndef REINCARNATION - if (rogueflag) return TRUE; -#endif - #ifdef LOADSYMSETS /* clear symset[].name as a flag to read_sym_file() to build list */ symset_name = symset[which_set].name; @@ -3587,12 +3573,10 @@ boolean setinitial,setfromfile; symset[which_set].name = symset_name; /* Set default symbols and clear the handling value */ -# ifdef REINCARNATION if(rogueflag) init_r_symbols(); else -# endif - init_l_symbols(); + init_l_symbols(); if (symset[which_set].name) { if (read_sym_file(which_set)) @@ -3605,13 +3589,10 @@ boolean setinitial,setfromfile; if (ready_to_switch) switch_symbols(TRUE); -# ifdef REINCARNATION if (Is_rogue_level(&u.uz)) { if (rogueflag) assign_graphics(ROGUESET); - } else -# endif - if (!rogueflag) assign_graphics(PRIMARY); + } else if (!rogueflag) assign_graphics(PRIMARY); need_redraw = TRUE; #endif /*LOADSYMSETS*/ return TRUE; @@ -3832,17 +3813,15 @@ char *buf; } else if (!strcmp(optname, "race")) Sprintf(buf, "%s", rolestring(flags.initrace, races, noun)); -#ifdef REINCARNATION else if (!strcmp(optname, "roguesymset")) { Sprintf(buf, "%s", -# ifdef LOADSYMSETS +#ifdef LOADSYMSETS symset[ROGUESET].name ? symset[ROGUESET].name : -# endif +#endif "default"); if (currentgraphics == ROGUESET && symset[ROGUESET].name) Strcat(buf, ", active"); -#endif } else if (!strcmp(optname, "role")) Sprintf(buf, "%s", rolestring(flags.initrole, roles, name.m)); diff --git a/src/read.c b/src/read.c index 6f4c7c478..bbdd11a09 100644 --- a/src/read.c +++ b/src/read.c @@ -1322,11 +1322,8 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */ break; case SCR_EARTH: /* TODO: handle steeds */ - if ( -#ifdef REINCARNATION - !Is_rogue_level(&u.uz) && -#endif - (!In_endgame(&u.uz) || Is_earthlevel(&u.uz))) { + if (!Is_rogue_level(&u.uz) + && (!In_endgame(&u.uz) || Is_earthlevel(&u.uz))) { register int x, y; /* Identify the scroll */ @@ -1606,7 +1603,6 @@ do_it: if (Punished && !on && !Blind) move_bc(1, 0, uball->ox, uball->oy, uchain->ox, uchain->oy); -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) { /* Can't use do_clear_area because MAX_RADIUS is too small */ /* rogue lighting must light the entire room */ @@ -1621,7 +1617,6 @@ do_it: } /* hallways remain dark on the rogue level */ } else -#endif do_clear_area(u.ux,u.uy, (obj && obj->oclass==SCROLL_CLASS && obj->blessed) ? 9 : 5, set_lit, (genericptr_t)(on ? &is_lit : (char *)0)); diff --git a/src/restore.c b/src/restore.c index dc883c6da..64e8710d6 100644 --- a/src/restore.c +++ b/src/restore.c @@ -857,9 +857,7 @@ register int fd; if (!wizard && !discover) (void) delete_savefile(); -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) assign_graphics(ROGUESET); -#endif #ifdef USE_TILES substitute_tiles(&u.uz); #endif diff --git a/src/vision.c b/src/vision.c index d835fb554..f00306b8c 100644 --- a/src/vision.c +++ b/src/vision.c @@ -103,9 +103,7 @@ STATIC_DCL void NDECL(view_init); STATIC_DCL void FDECL(view_from,(int,int,char **,char *,char *,int, void (*)(int,int,genericptr_t),genericptr_t)); STATIC_DCL void FDECL(get_unused_cs, (char ***,char **,char **)); -#ifdef REINCARNATION STATIC_DCL void FDECL(rogue_vision, (char **,char *,char *)); -#endif /* Macro definitions that I can't find anywhere. */ #define sign(z) ((z) < 0 ? -1 : ((z) ? 1 : 0 )) @@ -285,7 +283,6 @@ get_unused_cs(rows, rmin, rmax) } -#ifdef REINCARNATION /* * rogue_vision() * @@ -349,7 +346,6 @@ rogue_vision(next, rmin, rmax) } } } -#endif /* REINCARNATION */ /*#define EXTEND_SPINE*/ /* possibly better looking wall-angle */ @@ -568,13 +564,9 @@ vision_recalc(control) /* skip the normal update loop */ goto skip; - } -#ifdef REINCARNATION - else if (Is_rogue_level(&u.uz)) { + } else if (Is_rogue_level(&u.uz)) { rogue_vision(next_array,next_rmin,next_rmax); - } -#endif - else { + } else { int has_night_vision = 1; /* hero has night vision */ if (Underwater && !Is_waterlevel(&u.uz)) { diff --git a/src/zap.c b/src/zap.c index 752b03796..173bee625 100644 --- a/src/zap.c +++ b/src/zap.c @@ -4162,10 +4162,8 @@ short exploding_wand_typ; if (see_it) pline("%s %s reveals a secret door.", yourzap ? "Your" : "The", zapverb); -#ifdef REINCARNATION else if (Is_rogue_level(&u.uz)) You_feel("a draft."); /* new open doorway */ -#endif } /* regular door absorbs remaining zap range, possibly gets destroyed */ diff --git a/sys/amiga/winfuncs.c b/sys/amiga/winfuncs.c index 21f1937e4..cb9e3a504 100644 --- a/sys/amiga/winfuncs.c +++ b/sys/amiga/winfuncs.c @@ -2081,12 +2081,7 @@ if(u.uz.dlevel != x){ } } #endif - if( - WINVERS_AMIV -#ifdef REINCARNATION - && !Is_rogue_level(&u.uz) -#endif - ) + if(WINVERS_AMIV && !Is_rogue_level(&u.uz)) { amii_curs(win,x,y); amiga_print_glyph(win,0,glyph); @@ -2095,7 +2090,6 @@ if(u.uz.dlevel != x){ { /* map glyph to character and color */ (void) mapglyph(glyph, &och, &color, &special, x, y); - /* XXX next if should be ifdef REINCARNATION */ ch = (uchar)och; if( WINVERS_AMIV ){ /* implies Rogue level here */ amii_curs(win,x,y); @@ -2106,10 +2100,8 @@ if(u.uz.dlevel != x){ #ifdef TEXTCOLOR /* Turn off color if rogue level. */ -# ifdef REINCARNATION if (Is_rogue_level(&u.uz)) color = NO_COLOR; -# endif amiga_print_glyph(win,color,ch); #else diff --git a/sys/msdos/pckeys.c b/sys/msdos/pckeys.c index 142618ee7..6551f7df5 100644 --- a/sys/msdos/pckeys.c +++ b/sys/msdos/pckeys.c @@ -56,24 +56,16 @@ unsigned char shift; vga_userpan(0); break; case 0x3E: /* F4 = toggle overview mode */ - if (iflags.tile_view && - !opening_dialog -#ifdef REINCARNATION - && !Is_rogue_level(&u.uz) -#endif - ) { + if (iflags.tile_view && !opening_dialog + && !Is_rogue_level(&u.uz)) { iflags.traditional_view = FALSE; vga_overview(iflags.over_view ? FALSE : TRUE); vga_refresh(); } break; case 0x3F: /* F5 = toggle traditional mode */ - if (iflags.tile_view && - !opening_dialog -#ifdef REINCARNATION - && !Is_rogue_level(&u.uz) -#endif - ) { + if (iflags.tile_view && !opening_dialog + && !Is_rogue_level(&u.uz)) { iflags.over_view = FALSE; vga_traditional(iflags.traditional_view ? FALSE : TRUE); vga_refresh(); diff --git a/sys/msdos/vidvga.c b/sys/msdos/vidvga.c index e128821f9..0784cf007 100644 --- a/sys/msdos/vidvga.c +++ b/sys/msdos/vidvga.c @@ -1171,14 +1171,9 @@ vga_DrawCursor() unsigned char first,second; /* char on[2] = {0xFF,0xFF}; */ /* char off[2] = {0x00,0x00}; */ -#ifdef REINCARNATION boolean isrogue = Is_rogue_level(&u.uz); boolean singlebyte = (isrogue || iflags.over_view || iflags.traditional_view || !inmap); -#else - boolean singlebyte = (iflags.over_view - || iflags.traditional_view || !inmap); -#endif int curtyp; if (!cursor_type && inmap) return; /* CURSOR_INVIS - nothing to do */ @@ -1376,14 +1371,9 @@ vga_HideCursor() int i,pixx,pixy,x,y; char __far *tmp1; char __far *tmp2; -#ifdef REINCARNATION boolean isrogue = Is_rogue_level(&u.uz); boolean singlebyte = (isrogue || iflags.over_view || iflags.traditional_view || !inmap); -#else - boolean singlebyte = (iflags.over_view - || iflags.traditional_view || !inmap); -#endif int curtyp; if (inmap && !cursor_type) return; /* CURSOR_INVIS - nothing to do */ diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index f6c2b6b12..0923f735f 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -309,11 +309,9 @@ char *argv[]; if (!symset[PRIMARY].name) { load_symset("IBMGraphics_2", PRIMARY); } -# ifdef REINCARNATION if (!symset[ROGUESET].name) { load_symset("RogueEpyx", ROGUESET); } -# endif # endif #endif /*LOADSYMSETS*/ diff --git a/sys/wince/mhmain.c b/sys/wince/mhmain.c index ff4e628b3..943ab111f 100644 --- a/sys/wince/mhmain.c +++ b/sys/wince/mhmain.c @@ -1053,9 +1053,7 @@ void mswin_select_map_mode(int mode) #endif /* override for Rogue level */ -#ifdef REINCARNATION if( Is_rogue_level(&u.uz) && !IS_MAP_ASCII(mode) ) return; -#endif /* set map mode menu mark */ if( IS_MAP_ASCII(mode) ) { diff --git a/sys/wince/mhmap.c b/sys/wince/mhmap.c index 1fe386490..f2b611f9c 100644 --- a/sys/wince/mhmap.c +++ b/sys/wince/mhmap.c @@ -569,12 +569,8 @@ void onPaint(HWND hWnd) paint_rt.right = min(data->xPos + (ps.rcPaint.right - data->map_orig.x)/data->xScrTile+1, COLNO); paint_rt.bottom = min(data->yPos + (ps.rcPaint.bottom - data->map_orig.y)/data->yScrTile+1, ROWNO); - if( data->bAsciiMode -#ifdef REINCARNATION - || Is_rogue_level(&u.uz) + if(data->bAsciiMode || Is_rogue_level(&u.uz)) { /* You enter a VERY primitive world! */ -#endif - ) { HGDIOBJ oldFont; oldFont = SelectObject(hDC, data->hMapFont); diff --git a/sys/wince/mswproc.c b/sys/wince/mswproc.c index a4e5ede90..84c2b092c 100644 --- a/sys/wince/mswproc.c +++ b/sys/wince/mswproc.c @@ -793,14 +793,12 @@ void mswin_clear_nhwindow(winid wid) (wid < MAXWINDOWS) && (GetNHApp()->windowlist[wid].win != NULL)) { -#ifdef REINCARNATION if( GetNHApp()->windowlist[wid].type == NHW_MAP ) { if( Is_rogue_level(&u.uz) ) mswin_map_mode(mswin_hwnd_from_winid(WIN_MAP), ROGUE_LEVEL_MAP_MODE); else mswin_map_mode(mswin_hwnd_from_winid(WIN_MAP), iflags.wc_map_mode); } -#endif SendMessage( GetNHApp()->windowlist[wid].win, diff --git a/util/makedefs.c b/util/makedefs.c index 1de90dc6c..5cf318416 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -988,9 +988,6 @@ make_version() */ version.feature_set = (unsigned long)(0L /* levels and/or topology (0..4) */ -#ifdef REINCARNATION - | (1L << 1) -#endif /* monsters (5..9) */ #ifdef MAIL | (1L << 6) @@ -1289,9 +1286,6 @@ static const char *build_opts[] = { #ifdef SELECTSAVED "restore saved games via menu", #endif -#ifdef REINCARNATION - "rogue level", -#endif #ifdef SCORE_ON_BOTL "score on status line", #endif @@ -1823,12 +1817,9 @@ static struct deflist { const char *defname; boolean true_or_false; } deflist[] = { -#ifdef REINCARNATION { "REINCARNATION", TRUE }, -#else - { "REINCARNATION", FALSE }, -#endif - { 0, 0 } }; + { 0, 0 } +}; static int check_control(s) diff --git a/win/Qt/qt_win.cpp b/win/Qt/qt_win.cpp index ac2141fcc..af412e25a 100644 --- a/win/Qt/qt_win.cpp +++ b/win/Qt/qt_win.cpp @@ -1644,12 +1644,7 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event) painter.begin(this); - if ( -#ifdef REINCARNATION - Is_rogue_level(&u.uz) || -#endif - iflags.wc_ascii_map - ) + if (Is_rogue_level(&u.uz) || iflags.wc_ascii_map) { // You enter a VERY primitive world! @@ -1730,7 +1725,6 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event) } if (garea.contains(cursor)) { -#ifdef REINCARNATION if (Is_rogue_level(&u.uz)) { #ifdef TEXTCOLOR painter.setPen( white ); @@ -1738,7 +1732,6 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event) painter.setPen( green ); // REALLY primitive #endif } else -#endif { int hp100; if (u.mtimedone) { diff --git a/win/X11/winmap.c b/win/X11/winmap.c index cc48a5478..dd92ad680 100644 --- a/win/X11/winmap.c +++ b/win/X11/winmap.c @@ -839,10 +839,7 @@ display_map_window(wp) register int row; struct map_info_t *map_info = wp->map_information; - if (( -#ifdef REINCARNATION - Is_rogue_level(&u.uz) ? map_info->is_tile : -#endif + if ((Is_rogue_level(&u.uz) ? map_info->is_tile : (map_info->is_tile != iflags.wc_tiled_map)) && map_info->tile_map.image_width) { /* changed map display mode, re-display the full map */ @@ -850,11 +847,7 @@ display_map_window(wp) sizeof(map_info->t_start)); (void) memset((genericptr_t) map_info->t_stop, (char) COLNO-1, sizeof(map_info->t_stop)); - map_info->is_tile = iflags.wc_tiled_map -#ifdef REINCARNATION - && !Is_rogue_level(&u.uz) -#endif - ; + map_info->is_tile = iflags.wc_tiled_map && !Is_rogue_level(&u.uz); XClearWindow(XtDisplay(wp->w), XtWindow(wp->w)); set_map_size(wp, COLNO, ROWNO); check_cursor_visibility(wp); diff --git a/win/gem/wingem.c b/win/gem/wingem.c index 63fda6914..87d175231 100644 --- a/win/gem/wingem.c +++ b/win/gem/wingem.c @@ -911,9 +911,7 @@ int x, y; void mar_print_gl_char(winid,xchar,xchar,int); -#ifdef REINCARNATION extern int mar_set_rogue(int); -#endif extern void mar_add_pet_sign(winid,int,int); @@ -926,9 +924,7 @@ Gem_print_glyph(window, x, y, glyph) /* Move the cursor. */ Gem_curs(window, x,y); -# ifdef REINCARNATION - mar_set_rogue(Is_rogue_level(&u.uz) ? TRUE : FALSE); -# endif + mar_set_rogue(Is_rogue_level(&u.uz) ? TRUE : FALSE); x--; /* MAR -- because x ranges from 1 to COLNO */ if(mar_set_tile_mode(-1)){ @@ -960,9 +956,7 @@ void mar_print_gl_char(window, x, y, glyph) #ifdef TEXTCOLOR /* Turn off color if rogue level. */ -# ifdef REINCARNATION if (Is_rogue_level(&u.uz)) color = NO_COLOR; -# endif #endif /* TEXTCOLOR */ mar_print_char(window,x,y,ch,color); diff --git a/win/win32/mhmain.c b/win/win32/mhmain.c index b8a2dac10..6092f5cd5 100644 --- a/win/win32/mhmain.c +++ b/win/win32/mhmain.c @@ -1043,9 +1043,7 @@ void mswin_select_map_mode(int mode) data = (PNHMainWindow)GetWindowLongPtr(GetNHApp()->hMainWnd, GWLP_USERDATA); /* override for Rogue level */ -#ifdef REINCARNATION if( Is_rogue_level(&u.uz) && !IS_MAP_ASCII(mode) ) return; -#endif /* set map mode menu mark */ if( IS_MAP_ASCII(mode) ) { diff --git a/win/win32/mhmap.c b/win/win32/mhmap.c index ff1a43fb1..bd3c60a17 100644 --- a/win/win32/mhmap.c +++ b/win/win32/mhmap.c @@ -603,12 +603,8 @@ void onPaint(HWND hWnd) paint_rt.right = min(data->xPos + (ps.rcPaint.right - data->map_orig.x)/data->xScrTile+1, COLNO); paint_rt.bottom = min(data->yPos + (ps.rcPaint.bottom - data->map_orig.y)/data->yScrTile+1, ROWNO); - if( data->bAsciiMode -#ifdef REINCARNATION - || Is_rogue_level(&u.uz) + if( data->bAsciiMode || Is_rogue_level(&u.uz) ) { /* You enter a VERY primitive world! */ -#endif - ) { HGDIOBJ oldFont; oldFont = SelectObject(hDC, data->hMapFont); diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index 11b109067..39776d87b 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -802,14 +802,12 @@ void mswin_clear_nhwindow(winid wid) (wid < MAXWINDOWS) && (GetNHApp()->windowlist[wid].win != NULL)) { -#ifdef REINCARNATION if( GetNHApp()->windowlist[wid].type == NHW_MAP ) { if( Is_rogue_level(&u.uz) ) mswin_map_mode(mswin_hwnd_from_winid(WIN_MAP), ROGUE_LEVEL_MAP_MODE); else mswin_map_mode(mswin_hwnd_from_winid(WIN_MAP), iflags.wc_map_mode); } -#endif SendMessage( GetNHApp()->windowlist[wid].win, From eca41ae06065208e5efd9c41b547f2deba2c0e2f Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 13 Feb 2015 23:58:46 -0500 Subject: [PATCH 127/354] Make DUNGEON_OVERVIEW unconditional. --- include/config.h | 1 - include/dungeon.h | 2 -- include/extern.h | 2 -- include/rm.h | 4 ---- src/bones.c | 4 ---- src/cmd.c | 18 ------------------ src/decl.c | 2 -- src/display.c | 8 +------- src/do.c | 6 ------ src/dungeon.c | 14 -------------- src/hack.c | 2 -- src/lock.c | 17 ++++------------- src/mklev.c | 2 -- src/priest.c | 2 -- src/quest.c | 2 -- src/read.c | 4 ---- src/restore.c | 2 -- src/save.c | 2 -- src/vision.c | 2 -- util/makedefs.c | 3 --- 20 files changed, 5 insertions(+), 94 deletions(-) diff --git a/include/config.h b/include/config.h index bcc8e9903..abdeb4187 100644 --- a/include/config.h +++ b/include/config.h @@ -450,7 +450,6 @@ typedef unsigned char uchar; /*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */ #define STATUS_VIA_WINDOWPORT /* re-work of the status line updating process */ #define STATUS_HILITES /* support hilites of status fields */ -#define DUNGEON_OVERVIEW /* dungeon overview by Hojita Discordia */ /* #define WINCHAIN*/ /* stacked window systems */ /* End of Section 5 */ diff --git a/include/dungeon.h b/include/dungeon.h index d80d22a7d..f2bf75ef6 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -169,7 +169,6 @@ struct linfo { #endif /* MFLOPPY */ }; -#ifdef DUNGEON_OVERVIEW /* types and structures for dungeon map recording * * It is designed to eliminate the need for an external notes file for some of @@ -245,5 +244,4 @@ typedef struct mapseen { struct cemetery *final_resting_place; /* same as level.bonesinfo */ } mapseen; -#endif /* DUNGEON_OVERVIEW */ #endif /* DUNGEON_H */ diff --git a/include/extern.h b/include/extern.h index 6f0ad015f..186d5c9ff 100644 --- a/include/extern.h +++ b/include/extern.h @@ -581,7 +581,6 @@ E schar FDECL(lev_by_name, (const char *)); #ifdef WIZARD E schar FDECL(print_dungeon, (BOOLEAN_P,schar *,xchar *)); #endif -#ifdef DUNGEON_OVERVIEW E int NDECL(donamelevel); E int NDECL(dooverview); E void FDECL(show_overview, (int,int)); @@ -592,7 +591,6 @@ E void FDECL(mapseen_temple, (struct monst *)); E void FDECL(room_discovered, (int)); E void FDECL(recbranch_mapseen, (d_level *, d_level *)); E void FDECL(remdun_mapseen, (int)); -#endif /* DUNGEON_OVERVIEW */ /* ### eat.c ### */ diff --git a/include/rm.h b/include/rm.h index fbd7470cf..8747407f9 100644 --- a/include/rm.h +++ b/include/rm.h @@ -506,11 +506,9 @@ struct cemetery { char how[100 + 1]; /* [DTHSZ+1] */ /* date+time in string of digits rather than binary */ char when[4+2+2 + 2+2+2 + 1]; /* "YYYYMMDDhhmmss\0" */ -#ifdef DUNGEON_OVERVIEW /* final resting place spot */ schar frpx, frpy; boolean bonesknown; -#endif }; struct levelflags { @@ -564,9 +562,7 @@ typedef struct } dlevel_t; -#ifdef DUNGEON_OVERVIEW extern schar lastseentyp[COLNO][ROWNO]; /* last seen/touched dungeon typ */ -#endif /* DUNGEON_OVERVIEW */ extern dlevel_t level; /* structure describing the current level */ diff --git a/src/bones.c b/src/bones.c index e6c33a262..8a36ea11d 100644 --- a/src/bones.c +++ b/src/bones.c @@ -457,9 +457,7 @@ struct obj *corpse; levl[x][y].seenv = 0; levl[x][y].waslit = 0; levl[x][y].glyph = cmap_to_glyph(S_stone); -#ifdef DUNGEON_OVERVIEW lastseentyp[x][y] = 0; -#endif } /* Attach bones info to the current level before saving. */ @@ -476,11 +474,9 @@ struct obj *corpse; aligns[1 - u.ualign.type].filecode); formatkiller(newbones->how, sizeof newbones->how, how); Strcpy(newbones->when, yyyymmddhhmmss(when)); -#ifdef DUNGEON_OVERVIEW /* final resting place, used to decide when bones are discovered */ newbones->frpx = u.ux, newbones->frpy = u.uy; newbones->bonesknown = FALSE; -#endif /* if current character died on a bones level, the cememtery list will have multiple entries, most recent (this dead hero) first */ newbones->next = level.bonesinfo; diff --git a/src/cmd.c b/src/cmd.c index 2abb73a07..00e139001 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -123,9 +123,7 @@ STATIC_PTR int NDECL(doprev_message); STATIC_PTR int NDECL(timed_occupation); STATIC_PTR int NDECL(doextcmd); STATIC_PTR int NDECL(domonability); -#ifdef DUNGEON_OVERVIEW STATIC_PTR int NDECL(dooverview_or_wiz_where); -#endif /* DUNGEON_OVERVIEW */ STATIC_PTR int NDECL(dotravel); STATIC_PTR int NDECL(doterrain); # ifdef WIZARD @@ -537,7 +535,6 @@ enter_explore_mode(VOID_ARGS) return 0; } -#ifdef DUNGEON_OVERVIEW STATIC_PTR int dooverview_or_wiz_where(VOID_ARGS) { @@ -549,7 +546,6 @@ dooverview_or_wiz_where(VOID_ARGS) return 0; } -#endif /* DUNGEON_OVERVIEW */ #ifdef WIZARD /* ^W command - wish for something */ @@ -2392,14 +2388,8 @@ static const struct func_tab cmdlist[] = { {C('i'), TRUE, wiz_identify}, #endif {C('l'), TRUE, doredraw}, /* if number_pad is set */ -#ifndef DUNGEON_OVERVIEW -#ifdef WIZARD - {C('o'), TRUE, wiz_where}, -#endif -#else {C('n'), TRUE, donamelevel}, /* if number_pad is set */ {C('o'), TRUE, dooverview_or_wiz_where}, /* depending on wizard status */ -#endif /* DUNGEON_OVERVIEW */ {C('p'), TRUE, doprev_message}, {C('r'), TRUE, doredraw}, {C('t'), TRUE, dotele}, @@ -2412,9 +2402,7 @@ static const struct func_tab cmdlist[] = { {'a', FALSE, doapply}, {'A', FALSE, doddoremarm}, {M('a'), TRUE, doorganize}, -#ifdef DUNGEON_OVERVIEW {M('A'), TRUE, donamelevel}, /* #annotate */ -#endif /* 'b', 'B' : go sw */ {'c', FALSE, doclose}, {'C', TRUE, docallcmd}, @@ -2449,9 +2437,7 @@ static const struct func_tab cmdlist[] = { {'o', FALSE, doopen}, {'O', TRUE, doset}, {M('o'), FALSE, dosacrifice}, -#ifdef DUNGEON_OVERVIEW {M('O'), TRUE, dooverview}, /* #overview */ -#endif {'p', FALSE, dopay}, {'P', FALSE, doputon}, {M('p'), TRUE, dopray}, @@ -2517,9 +2503,7 @@ static const struct func_tab cmdlist[] = { struct ext_func_tab extcmdlist[] = { {"adjust", "adjust inventory letters", doorganize, TRUE}, -#ifdef DUNGEON_OVERVIEW {"annotate", "name current level", donamelevel, TRUE}, -#endif /* DUNGEON_OVERVIEW */ {"chat", "talk to someone", dotalk, TRUE}, /* converse? */ {"conduct", "list voluntary challenges you have maintained", doconduct, TRUE}, @@ -2533,9 +2517,7 @@ struct ext_func_tab extcmdlist[] = { {"monster", "use a monster's special ability", domonability, TRUE}, {"name", "name a monster or an object", docallcmd, TRUE}, {"offer", "offer a sacrifice to the gods", dosacrifice, FALSE}, -#ifdef DUNGEON_OVERVIEW {"overview", "show an overview of the dungeon", dooverview, TRUE}, -#endif /* DUNGEON_OVERVIEW */ {"pray", "pray to the gods for help", dopray, TRUE}, {"quit", "exit without saving current game", done2, TRUE}, {"ride", "ride (or stop riding) a monster", doride, FALSE}, diff --git a/src/decl.c b/src/decl.c index c9105bee6..d4892f9d4 100644 --- a/src/decl.c +++ b/src/decl.c @@ -142,9 +142,7 @@ NEARDATA struct you u = DUMMY; NEARDATA time_t ubirthday = DUMMY; -#ifdef DUNGEON_OVERVIEW schar lastseentyp[COLNO][ROWNO] = {DUMMY}; /* last seen/touched dungeon typ */ -#endif /* DUNGEON_OVERVIEW */ NEARDATA struct obj *invent = (struct obj *)0, *uwep = (struct obj *)0, *uarm = (struct obj *)0, diff --git a/src/display.c b/src/display.c index 263dd853a..48b9f0b65 100644 --- a/src/display.c +++ b/src/display.c @@ -137,11 +137,7 @@ STATIC_DCL void FDECL(set_seenv, (struct rm *, int, int, int, int)); STATIC_DCL void FDECL(t_warn, (struct rm *)); STATIC_DCL int FDECL(wall_angle, (struct rm *)); -#ifdef DUNGEON_OVERVIEW -# define remember_topology(x,y) (lastseentyp[x][y] = levl[x][y].typ) -#else -# define remember_topology(x,y) /*empty*/ -#endif +#define remember_topology(x,y) (lastseentyp[x][y] = levl[x][y].typ) #ifdef INVISIBLE_OBJECTS /* @@ -420,10 +416,8 @@ display_monster(x, y, mon, sightflags, worm_tail) levl[x][y].glyph = glyph; if (!sensed) { show_glyph(x,y, glyph); -#ifdef DUNGEON_OVERVIEW /* override real topology with mimic's fake one */ lastseentyp[x][y] = cmap_to_type(sym); -#endif } break; } diff --git a/src/do.c b/src/do.c index e0fe5a5c3..4e5876e6b 100644 --- a/src/do.c +++ b/src/do.c @@ -1107,9 +1107,7 @@ boolean at_stairs, falling, portal; keepdogs(FALSE); if (u.uswallow) /* idem */ u.uswldtim = u.uswallow = 0; -#ifdef DUNGEON_OVERVIEW recalc_mapseen(); /* recalculate map overview before we leave the level */ -#endif /* DUNGEON_OVERVIEW */ /* * We no longer see anything on the level. Make sure that this * follows u.uswallow set to null since uswallow overrides all @@ -1136,11 +1134,9 @@ boolean at_stairs, falling, portal; /* discard unreachable levels; keep #0 */ for (l_idx = maxledgerno(); l_idx > 0; --l_idx) delete_levelfile(l_idx); -#ifdef DUNGEON_OVERVIEW /* mark #overview data for all dungeon branches as uninteresting */ for (l_idx = 0; l_idx < n_dgns; ++l_idx) remdun_mapseen(l_idx); -#endif } if (Is_rogue_level(newlevel) || Is_rogue_level(&u.uz)) @@ -1148,13 +1144,11 @@ boolean at_stairs, falling, portal; #ifdef USE_TILES substitute_tiles(newlevel); #endif -#ifdef DUNGEON_OVERVIEW /* record this level transition as a potential seen branch unless using * some non-standard means of transportation (level teleport). */ if ((at_stairs || falling || portal) && (u.uz.dnum != newlevel->dnum)) recbranch_mapseen(&u.uz, newlevel); -#endif /* DUNGEON_OVERVIEW */ assign_level(&u.uz0, &u.uz); assign_level(&u.uz, newlevel); assign_level(&u.utolev, newlevel); diff --git a/src/dungeon.c b/src/dungeon.c index c08d195af..ed186796b 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -59,7 +59,6 @@ STATIC_DCL const char *FDECL(br_string, (int)); STATIC_DCL void FDECL(print_branch, (winid, int, int, int, BOOLEAN_P, struct lchoice *)); #endif -#ifdef DUNGEON_OVERVIEW mapseen *mapseenchn = (struct mapseen *)0; STATIC_DCL mapseen *FDECL(load_mapseen, (int)); STATIC_DCL void FDECL(save_mapseen, (int, mapseen *)); @@ -72,7 +71,6 @@ STATIC_DCL const char *FDECL(br_string2, (branch *)); STATIC_DCL const char *FDECL(endgamelevelname, (char *,int)); STATIC_DCL const char *FDECL(shop_string, (int)); STATIC_DCL char *FDECL(tunesuffix, (mapseen *,char *)); -#endif /* DUNGEON_OVERVIEW */ #ifdef DEBUG #define DD dungeons[i] @@ -135,9 +133,7 @@ save_dungeon(fd, perform_write, free_data) boolean perform_write, free_data; { branch *curr, *next; -#ifdef DUNGEON_OVERVIEW mapseen *curr_ms, *next_ms; -#endif int count; if (perform_write) { @@ -159,14 +155,12 @@ save_dungeon(fd, perform_write, free_data) (unsigned)count * sizeof (struct linfo)); bwrite(fd, (genericptr_t) &inv_pos, sizeof inv_pos); -#ifdef DUNGEON_OVERVIEW for (count = 0, curr_ms = mapseenchn; curr_ms; curr_ms = curr_ms->next) count++; bwrite(fd, (genericptr_t) &count, sizeof(count)); for (curr_ms = mapseenchn; curr_ms; curr_ms = curr_ms->next) save_mapseen(fd, curr_ms); -#endif /* DUNGEON_OVERVIEW */ } if (free_data) { @@ -175,7 +169,6 @@ save_dungeon(fd, perform_write, free_data) free((genericptr_t) curr); } branches = 0; -#ifdef DUNGEON_OVERVIEW for (curr_ms = mapseenchn; curr_ms; curr_ms = next_ms) { next_ms = curr_ms->next; if (curr_ms->custom) @@ -183,7 +176,6 @@ save_dungeon(fd, perform_write, free_data) free((genericptr_t) curr_ms); } mapseenchn = 0; -#endif /* DUNGEON_OVERVIEW */ } } @@ -194,9 +186,7 @@ restore_dungeon(fd) { branch *curr, *last; int count, i; -#ifdef DUNGEON_OVERVIEW mapseen *curr_ms, *last_ms; -#endif mread(fd, (genericptr_t) &n_dgns, sizeof(n_dgns)); mread(fd, (genericptr_t) dungeons, sizeof(dungeon) * (unsigned)n_dgns); @@ -223,7 +213,6 @@ restore_dungeon(fd) mread(fd, (genericptr_t) level_info, (unsigned)count*sizeof(struct linfo)); mread(fd, (genericptr_t) &inv_pos, sizeof inv_pos); -#ifdef DUNGEON_OVERVIEW mread(fd, (genericptr_t) &count, sizeof(count)); last_ms = (mapseen *) 0; for (i = 0; i < count; i++) { @@ -235,7 +224,6 @@ restore_dungeon(fd) mapseenchn = curr_ms; last_ms = curr_ms; } -#endif /* DUNGEON_OVERVIEW */ } static void @@ -1835,7 +1823,6 @@ xchar *rdgn; } #endif /* WIZARD */ -#ifdef DUNGEON_OVERVIEW /* Record that the player knows about a branch from a level. This function * will determine whether or not it was a "real" branch that was taken. * This function should not be called for a transition done via level @@ -2711,6 +2698,5 @@ boolean printdun; } } } -#endif /* DUNGEON_OVERVIEW */ /*dungeon.c*/ diff --git a/src/hack.c b/src/hack.c index 545c4c4aa..66e0962e6 100644 --- a/src/hack.c +++ b/src/hack.c @@ -2115,9 +2115,7 @@ register boolean newlev; rt = 0; break; } -#ifdef DUNGEON_OVERVIEW if (msg_given) room_discovered(roomno); -#endif if (rt != 0) { rooms[roomno].rtype = OROOM; diff --git a/src/lock.c b/src/lock.c index 73dc8c159..67a11a545 100644 --- a/src/lock.c +++ b/src/lock.c @@ -561,16 +561,12 @@ doopen() /* try to open a door */ portcullis = (is_drawbridge_wall(cc.x, cc.y) >= 0); if (Blind) { int oldglyph = door->glyph; -#ifdef DUNGEON_OVERVIEW schar oldlastseentyp = lastseentyp[cc.x][cc.y]; -#endif feel_location(cc.x, cc.y); if (door->glyph != oldglyph -#ifdef DUNGEON_OVERVIEW - || lastseentyp[cc.x][cc.y] != oldlastseentyp -#endif - ) res = 1; /* learned something */ + || lastseentyp[cc.x][cc.y] != oldlastseentyp) + res = 1; /* learned something */ } if (portcullis || !IS_DOOR(door->typ)) { @@ -693,16 +689,11 @@ doclose() /* try to close a door */ portcullis = (is_drawbridge_wall(x, y) >= 0); if (Blind) { int oldglyph = door->glyph; -#ifdef DUNGEON_OVERVIEW schar oldlastseentyp = lastseentyp[x][y]; -#endif feel_location(x, y); - if (door->glyph != oldglyph -#ifdef DUNGEON_OVERVIEW - || lastseentyp[x][y] != oldlastseentyp -#endif - ) res = 1; /* learned something */ + if (door->glyph != oldglyph || lastseentyp[x][y] != oldlastseentyp) + res = 1; /* learned something */ } if (portcullis || !IS_DOOR(door->typ)) { diff --git a/src/mklev.c b/src/mklev.c index 1bba98d61..acb4daac4 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -912,9 +912,7 @@ mklev() struct mkroom *croom; int ridx; -#ifdef DUNGEON_OVERVIEW init_mapseen(&u.uz); -#endif if(getbones()) return; in_mklev = TRUE; diff --git a/src/priest.c b/src/priest.c index 915813af0..5e3b2ea10 100644 --- a/src/priest.c +++ b/src/priest.c @@ -445,11 +445,9 @@ int roomno; if (*this_time <= *other_time) *other_time = *this_time - 1L; } } -#ifdef DUNGEON_OVERVIEW /* recognize the Valley of the Dead and Moloch's Sanctum once hero has encountered the temple priest on those levels */ mapseen_temple(priest); -#endif } else { /* untended */ diff --git a/src/quest.c b/src/quest.c index c5ef6c819..566d7f029 100644 --- a/src/quest.c +++ b/src/quest.c @@ -174,9 +174,7 @@ boolean seal; if (seal) { /* remove the portal to the quest - sealing it off */ int reexpelled = u.uevent.qexpelled; u.uevent.qexpelled = 1; -#ifdef DUNGEON_OVERVIEW remdun_mapseen(quest_dnum); -#endif /* Delete the near portal now; the far (main dungeon side) portal will be deleted as part of arrival on that level. If monster movement is in progress, any who haven't moved diff --git a/src/read.c b/src/read.c index bbdd11a09..6e3147714 100644 --- a/src/read.c +++ b/src/read.c @@ -570,9 +570,7 @@ forget_map(howmuch) levl[zx][zy].seenv = 0; levl[zx][zy].waslit = 0; levl[zx][zy].glyph = cmap_to_glyph(S_stone); -#ifdef DUNGEON_OVERVIEW lastseentyp[zx][zy] = STONE; -#endif } } @@ -633,9 +631,7 @@ forget_levels(percent) count = ((count * percent) + 50) / 100; for (i = 0; i < count; i++) { level_info[indices[i]].flags |= FORGOTTEN; -#ifdef DUNGEON_OVERVIEW forget_mapseen(indices[i]); -#endif } } diff --git a/src/restore.c b/src/restore.c index 64e8710d6..30af7762c 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1015,9 +1015,7 @@ boolean ghostly; } restcemetery(fd, &level.bonesinfo); rest_levl(fd, (boolean)((sfrestinfo.sfi1 & SFI1_RLECOMP) == SFI1_RLECOMP)); -#ifdef DUNGEON_OVERVIEW mread(fd, (genericptr_t)lastseentyp, sizeof(lastseentyp)); -#endif mread(fd, (genericptr_t)&omoves, sizeof(omoves)); elapsed = monstermoves - omoves; mread(fd, (genericptr_t)&upstair, sizeof(stairway)); diff --git a/src/save.c b/src/save.c index f8f5d40b0..e66a5c9eb 100644 --- a/src/save.c +++ b/src/save.c @@ -511,9 +511,7 @@ int mode; #endif savecemetery(fd, mode, &level.bonesinfo); savelevl(fd, (boolean)((sfsaveinfo.sfi1 & SFI1_RLECOMP) == SFI1_RLECOMP)); -#ifdef DUNGEON_OVERVIEW bwrite(fd,(genericptr_t) lastseentyp,sizeof(lastseentyp)); -#endif bwrite(fd,(genericptr_t) &monstermoves,sizeof(monstermoves)); bwrite(fd,(genericptr_t) &upstair,sizeof(stairway)); bwrite(fd,(genericptr_t) &dnstair,sizeof(stairway)); diff --git a/src/vision.c b/src/vision.c index f00306b8c..a6585de14 100644 --- a/src/vision.c +++ b/src/vision.c @@ -803,9 +803,7 @@ skip: viz_rmin = next_rmin; viz_rmax = next_rmax; -#ifdef DUNGEON_OVERVIEW recalc_mapseen(); -#endif } diff --git a/util/makedefs.c b/util/makedefs.c index 5cf318416..4ddb7f449 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1236,9 +1236,6 @@ static const char *build_opts[] = { #ifdef WIZARD "debug mode", #endif -#ifdef DUNGEON_OVERVIEW - "dungeon map overview patch", -#endif #ifdef EXP_ON_BOTL "experience points on status line", #endif From cc7ab4a2da538b071e0666b1f7f1675fa5f81c2c Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sat, 14 Feb 2015 00:31:17 -0500 Subject: [PATCH 128/354] Make WIZARD unconditional. --- include/config.h | 12 +++------ include/decl.h | 2 -- include/extern.h | 22 +--------------- include/flag.h | 2 -- include/trampoli.h | 2 -- include/vmsconf.h | 11 +------- src/allmain.c | 6 ----- src/attrib.c | 2 -- src/bones.c | 25 ++---------------- src/cmd.c | 62 +++------------------------------------------ src/do.c | 4 --- src/dungeon.c | 22 +++------------- src/eat.c | 4 --- src/end.c | 20 +++------------ src/engrave.c | 2 -- src/exper.c | 2 -- src/files.c | 13 +--------- src/fountain.c | 2 -- src/invent.c | 6 ----- src/light.c | 4 --- src/makemon.c | 8 ++---- src/mklev.c | 12 +-------- src/mkmaze.c | 2 -- src/mkobj.c | 4 --- src/mkroom.c | 15 +++-------- src/mon.c | 6 ----- src/monmove.c | 2 -- src/objnam.c | 12 --------- src/options.c | 34 +------------------------ src/pager.c | 6 ----- src/pline.c | 4 --- src/pray.c | 2 -- src/quest.c | 2 -- src/questpgr.c | 2 -- src/read.c | 8 ------ src/rect.c | 2 -- src/restore.c | 4 --- src/rumors.c | 2 -- src/save.c | 4 --- src/shknam.c | 2 -- src/sp_lev.c | 4 --- src/steed.c | 4 --- src/sys.c | 4 --- src/teleport.c | 58 +++++------------------------------------- src/timeout.c | 8 ------ src/u_init.c | 2 -- src/weapon.c | 11 +------- sys/be/bemain.c | 6 ----- sys/mac/macmain.c | 4 --- sys/mac/macmenu.c | 15 ++--------- sys/share/pcmain.c | 10 -------- sys/unix/unixmain.c | 11 +------- sys/unix/unixunix.c | 2 -- sys/vms/vmsmain.c | 17 +++---------- sys/vms/vmsunix.c | 2 -- sys/wince/mhcmd.c | 4 --- sys/wince/winhack.c | 2 -- sys/winnt/nttty.c | 2 +- sys/winnt/winnt.c | 2 -- util/makedefs.c | 3 --- util/mdgrep.h | 4 --- util/mdgrep.pl | 2 +- 62 files changed, 42 insertions(+), 493 deletions(-) diff --git a/include/config.h b/include/config.h index abdeb4187..c89f778e3 100644 --- a/include/config.h +++ b/include/config.h @@ -172,16 +172,12 @@ * GDBPATH (the path to the system gdb(1) program) */ -#ifndef WIZARD /* allow for compile-time or Makefile changes */ -# ifndef KR1ED -# define WIZARD "wizard" /* the person allowed to use the -D option */ +#ifndef WIZARD_NAME /* allow for compile-time or Makefile changes */ +# define WIZARD_NAME "wizard" +#endif + /* #define SYSCF */ /* use a global configuration */ /* #define SYSCF_FILE "sysconf" */ /* global configuration is in a file */ -# else -# define WIZARD -# define WIZARD_NAME "wizard" -# endif -#endif #ifndef GDBPATH # define GDBPATH "/usr/bin/gdb" diff --git a/include/decl.h b/include/decl.h index 8276c6022..ddc814f4d 100644 --- a/include/decl.h +++ b/include/decl.h @@ -151,9 +151,7 @@ E NEARDATA struct sinfo { #ifdef PANICLOG int in_paniclog; #endif -#ifdef WIZARD int wizkit_wishing; -#endif } program_state; E boolean restoring; diff --git a/include/extern.h b/include/extern.h index 186d5c9ff..fd4bc6520 100644 --- a/include/extern.h +++ b/include/extern.h @@ -172,7 +172,6 @@ E int NDECL(domonability); E int NDECL(doprev_message); E int NDECL(timed_occupation); E int NDECL(doattributes); -# ifdef WIZARD E int NDECL(wiz_detect); E int NDECL(wiz_genesis); E int NDECL(wiz_identify); @@ -180,7 +179,6 @@ E int NDECL(wiz_level_tele); E int NDECL(wiz_map); E int NDECL(wiz_where); E int NDECL(wiz_wish); -# endif /* WIZARD */ #endif /* USE_TRAMPOLI */ E void NDECL(reset_occupations); E void FDECL(set_occupation, (int (*)(void),const char *,int)); @@ -189,9 +187,7 @@ E char NDECL(pgetchar); E void FDECL(pushch, (CHAR_P)); E void FDECL(savech, (CHAR_P)); #endif -#ifdef WIZARD E void NDECL(add_debug_extended_commands); -#endif /* WIZARD */ E void FDECL(reset_commands, (BOOLEAN_P)); E void FDECL(rhack, (char *)); E int NDECL(doextlist); @@ -215,9 +211,7 @@ E void FDECL(hangup, (int)); E void NDECL(end_of_input); #endif E char NDECL(readchar); -#ifdef WIZARD E void NDECL(sanity_check); -#endif E char FDECL(yn_function, (const char *, const char *, CHAR_P)); E boolean FDECL(paranoid_query, (BOOLEAN_P,const char *)); @@ -578,9 +572,7 @@ E int FDECL(induced_align, (int)); E boolean FDECL(Invocation_lev, (d_level *)); E xchar NDECL(level_difficulty); E schar FDECL(lev_by_name, (const char *)); -#ifdef WIZARD E schar FDECL(print_dungeon, (BOOLEAN_P,schar *,xchar *)); -#endif E int NDECL(donamelevel); E int NDECL(dooverview); E void FDECL(show_overview, (int,int)); @@ -726,7 +718,7 @@ E void FDECL(set_savefile_name, (BOOLEAN_P)); #ifdef INSURANCE E void FDECL(save_savefile_name, (int)); #endif -#if defined(WIZARD) && !defined(MICRO) +#ifndef MICRO E void NDECL(set_error_savefile); #endif E int NDECL(create_savefile); @@ -742,9 +734,7 @@ E boolean FDECL(can_read_file, (const char *)); #endif E boolean FDECL(read_config_file, (const char *, int)); E void FDECL(check_recordfile, (const char *)); -#if defined(WIZARD) E void NDECL(read_wizkit); -#endif #ifdef LOADSYMSETS E int FDECL(read_sym_file, (int)); E int FDECL(parse_sym_line, (char *,int)); @@ -987,9 +977,7 @@ E void FDECL(obj_adjust_light_radius, (struct obj *,int)); E int FDECL(candle_light_range, (struct obj *)); E int FDECL(arti_light_radius, (struct obj *)); E const char *FDECL(arti_light_description, (struct obj *)); -#ifdef WIZARD E int NDECL(wiz_light_sources); -#endif /* ### lock.c ### */ @@ -1260,9 +1248,7 @@ E void FDECL(dealloc_obj, (struct obj *)); E void FDECL(obj_ice_effects, (int, int, BOOLEAN_P)); E long FDECL(peek_at_iced_corpse_age, (struct obj *)); E int FDECL(hornoplenty, (struct obj *,BOOLEAN_P)); -#ifdef WIZARD E void NDECL(obj_sanity_check); -#endif /* ### mkroom.c ### */ @@ -1896,9 +1882,7 @@ E void FDECL(do_genocide, (int)); E void FDECL(punish, (struct obj *)); E void NDECL(unpunish); E boolean FDECL(cant_revive, (int *,BOOLEAN_P,struct obj *)); -#ifdef WIZARD E boolean NDECL(create_particular); -#endif /* ### rect.c ### */ @@ -2000,9 +1984,7 @@ E void FDECL(outoracle, (BOOLEAN_P, BOOLEAN_P)); E void FDECL(save_oracles, (int,int)); E void FDECL(restore_oracles, (int)); E int FDECL(doconsult, (struct monst *)); -#ifdef WIZARD E void NDECL(rumor_check); -#endif /* ### save.c ### */ @@ -2263,10 +2245,8 @@ E boolean FDECL(obj_is_local, (struct obj *)); E void FDECL(save_timers, (int,int,int)); E void FDECL(restore_timers, (int,int,BOOLEAN_P,long)); E void FDECL(relink_timers, (BOOLEAN_P)); -#ifdef WIZARD E int NDECL(wiz_timeout_queue); E void NDECL(timer_sanity_check); -#endif /* ### topten.c ### */ diff --git a/include/flag.h b/include/flag.h index f6cc67aa2..1f53bdec6 100644 --- a/include/flag.h +++ b/include/flag.h @@ -174,10 +174,8 @@ struct instance_flags { coord travelcc; /* coordinates for travel_cache */ boolean window_inited; /* true if init_nhwindows() completed */ boolean vision_inited; /* true if vision is ready */ -#ifdef WIZARD boolean sanity_check; /* run sanity checks */ boolean mon_polycontrol; /* debug: control monster polymorphs */ -#endif /* stuff that is related to options and/or user or platform preferences */ unsigned msg_history; /* hint: # of top lines to save */ int menu_headings; /* ATR for menu headings */ diff --git a/include/trampoli.h b/include/trampoli.h index fa040a330..076b16d2f 100644 --- a/include/trampoli.h +++ b/include/trampoli.h @@ -28,7 +28,6 @@ #define doprev_message() doprev_message_() #define timed_occupation() timed_occupation_() #define wiz_attributes() wiz_attributes_() -#ifdef WIZARD #define wiz_detect() wiz_detect_() #define wiz_genesis() wiz_genesis_() #define wiz_identify() wiz_identify_() @@ -36,7 +35,6 @@ #define wiz_map() wiz_map_() #define wiz_where() wiz_where_() #define wiz_wish() wiz_wish_() -#endif /* ### display.c ### */ #define doredraw() doredraw_() diff --git a/include/vmsconf.h b/include/vmsconf.h index 5aaf9e1fc..d675588e2 100644 --- a/include/vmsconf.h +++ b/include/vmsconf.h @@ -30,20 +30,11 @@ #ifdef HACKDIR # undef HACKDIR #endif -#ifdef WIZARD -# undef WIZARD -#endif #ifdef WIZARD_NAME # undef WIZARD_NAME #endif #define HACKDIR Local_HACKDIR -#ifndef KR1ED -# define WIZARD Local_WIZARD -# define WIZARD_NAME WIZARD -#else -# define WIZARD 1 -# define WIZARD_NAME Local_WIZARD -#endif +#define WIZARD_NAME Local_WIZARD #ifndef SYSCF # define SYSCF #endif diff --git a/src/allmain.c b/src/allmain.c index 447aff1d8..d56f11bda 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -35,9 +35,7 @@ boolean resuming; monstr_init(); /* monster strengths */ objects_init(); -#ifdef WIZARD if (wizard) add_debug_extended_commands(); -#endif /* if a save file created in normal mode is now being restored in explore mode, treat it as normal restore followed by 'X' command @@ -384,10 +382,8 @@ boolean resuming; continue; } -#ifdef WIZARD if (iflags.sanity_check) sanity_check(); -#endif #ifdef CLIPPING /* just before rhack */ @@ -525,9 +521,7 @@ newgame() mklev(); u_on_upstairs(); -#ifdef WIZARD if (wizard) obj_delivery(FALSE); /* finish wizkit */ -#endif vision_reset(); /* set up internals for level (after mklev) */ check_special_room(FALSE); diff --git a/src/attrib.c b/src/attrib.c index fbac9949a..b2d5738b8 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -698,7 +698,6 @@ int propidx; /* special cases can have negative values */ /* * Restrict the source of the attributes just to debug mode for now */ -#ifdef WIZARD if (wizard) { static NEARDATA const char because_of[] = " because of %s"; @@ -745,7 +744,6 @@ int propidx; /* special cases can have negative values */ } } /*wizard*/ -#endif return buf; } diff --git a/src/bones.c b/src/bones.c index 8a36ea11d..5607355ee 100644 --- a/src/bones.c +++ b/src/bones.c @@ -312,10 +312,7 @@ can_make_bones() if(depth(&u.uz) <= 0 || /* bulletproofing for endgame */ (!rn2(1 + (depth(&u.uz)>>2)) /* fewer ghosts on low levels */ -#ifdef WIZARD - && !wizard -#endif - )) return FALSE; + && !wizard)) return FALSE; /* don't let multiple restarts generate multiple copies of objects * in bones files */ if (discover) return FALSE; @@ -344,23 +341,19 @@ struct obj *corpse; fd = open_bonesfile(&u.uz, &bonesid); if (fd >= 0) { (void) close(fd); -#ifdef WIZARD if (wizard) { if (yn("Bones file already exists. Replace it?") == 'y') { if (delete_bonesfile(&u.uz)) goto make_bones; else pline("Cannot unlink old bones."); } } -#endif /* compression can change the file's name, so must wait until after any attempt to delete this file */ compress_bonesfile(); return; } -#ifdef WIZARD make_bones: -#endif unleash_all(); /* in case these characters are not in their home bases */ for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { @@ -488,10 +481,8 @@ struct obj *corpse; fd = create_bonesfile(&u.uz, &bonesid, whynot); if(fd < 0) { -#ifdef WIZARD if(wizard) pline1(whynot); -#endif /* bones file creation problems are silent to the player. * Keep it that way, but place a clue into the paniclog. */ @@ -520,10 +511,8 @@ struct obj *corpse; savefruitchn(fd, COUNT_SAVE); bflush(fd); if (bytes_counted > freediskspace(bones)) { /* not enough room */ -# ifdef WIZARD if (wizard) pline("Insufficient space to create bones file."); -# endif (void) close(fd); cancel_bonesfile(); return; @@ -556,23 +545,18 @@ getbones() /* wizard check added by GAN 02/05/87 */ if(rn2(3) /* only once in three times do we find bones */ -#ifdef WIZARD && !wizard -#endif ) return(0); if(no_bones_level(&u.uz)) return(0); fd = open_bonesfile(&u.uz, &bonesid); if (fd < 0) return(0); if (validate(fd, bones) != 0) { -#ifdef WIZARD if (!wizard) -#endif pline("Discarding unuseable bones; no need to panic..."); ok = FALSE; } else { ok = TRUE; -#ifdef WIZARD if(wizard) { if(yn("Get bones?") == 'n') { (void) close(fd); @@ -580,7 +564,6 @@ getbones() return(0); } } -#endif mread(fd, (genericptr_t) &c, sizeof c); /* length incl. '\0' */ mread(fd, (genericptr_t) oldbonesid, (unsigned) c); /* DD.nnn */ if (strcmp(bonesid, oldbonesid) != 0) { @@ -588,12 +571,10 @@ getbones() Sprintf(errbuf, "This is bones level '%s', not '%s'!", oldbonesid, bonesid); -#ifdef WIZARD if (wizard) { pline1(errbuf); ok = FALSE; /* won't die of trickery */ } -#endif trickery(errbuf); } else { register struct monst *mtmp; @@ -610,7 +591,7 @@ getbones() for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (has_mname(mtmp)) sanitize_name(MNAME(mtmp)); if (mtmp->mhpmax == DEFUNCT_MONSTER) { -#if defined(DEBUG) && defined(WIZARD) +#if defined(DEBUG) if (wizard) pline("Removing defunct monster %s from bones.", mtmp->data->mname); @@ -627,14 +608,12 @@ getbones() (void) close(fd); sanitize_engravings(); -#ifdef WIZARD if(wizard) { if(yn("Unlink bones?") == 'n') { compress_bonesfile(); return(ok); } } -#endif if (!delete_bonesfile(&u.uz)) { /* When N games try to simultaneously restore the same * bones file, N-1 of them will fail to delete it diff --git a/src/cmd.c b/src/cmd.c index 00e139001..f07abb78c 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -126,7 +126,6 @@ STATIC_PTR int NDECL(domonability); STATIC_PTR int NDECL(dooverview_or_wiz_where); STATIC_PTR int NDECL(dotravel); STATIC_PTR int NDECL(doterrain); -# ifdef WIZARD STATIC_PTR int NDECL(wiz_wish); STATIC_PTR int NDECL(wiz_identify); STATIC_PTR int NDECL(wiz_map); @@ -164,7 +163,6 @@ STATIC_DCL int NDECL(wiz_port_debug); # endif STATIC_PTR int NDECL(wiz_rumor_check); STATIC_DCL char FDECL(cmd_from_func, (int NDECL((*)))); -# endif /* WIZARD */ STATIC_PTR int NDECL(doattributes); STATIC_PTR int NDECL(doconduct); /**/ @@ -514,9 +512,7 @@ int enter_explore_mode(VOID_ARGS) { if (wizard) { -#ifdef WIZARD You("are in debug mode."); -#endif } else if (discover) { You("are already in explore mode."); } else { @@ -538,16 +534,11 @@ enter_explore_mode(VOID_ARGS) STATIC_PTR int dooverview_or_wiz_where(VOID_ARGS) { -#ifdef WIZARD if (wizard) return wiz_where(); - else -#endif - dooverview(); + else dooverview(); return 0; } -#ifdef WIZARD - /* ^W command - wish for something */ STATIC_PTR int wiz_wish(VOID_ARGS) /* Unlimited wishes for debug mode by Paul Polderman */ @@ -1063,7 +1054,6 @@ wiz_rumor_check(VOID_ARGS) rumor_check(); return 0; } -#endif /* WIZARD */ /* #terrain command */ STATIC_PTR int @@ -1091,7 +1081,6 @@ doterrain(VOID_ARGS) add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE, "full map without monsters, objects, and traps", MENU_UNSELECTED); -#ifdef WIZARD if (wizard) { any.a_int = 3; add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE, @@ -1102,7 +1091,6 @@ doterrain(VOID_ARGS) "legend of base-36 levl[][].typ codes", MENU_UNSELECTED); } -#endif end_menu(men, "View which?"); n = select_menu(men, PICK_ONE, &sel); @@ -1121,10 +1109,8 @@ doterrain(VOID_ARGS) switch (which) { case 1: reveal_terrain(FALSE); break; /* known map */ case 2: reveal_terrain(TRUE); break; /* full map */ -#ifdef WIZARD case 3: wiz_map_levltyp(); break; /* map internals */ case 4: wiz_levltyp_legend(); break; /* internal details */ -#endif default: break; } return 0; /* no time elapses */ @@ -1584,9 +1570,7 @@ int final; you_are("buried", ""); } else { Strcpy(buf, "being strangled"); -#ifdef WIZARD if (wizard) Sprintf(eos(buf), " (%ld)", (Strangled & TIMEOUT)); -#endif you_are(buf, from_what(STRANGLED)); } } @@ -1639,9 +1623,7 @@ int final; } /* (u.utrap) */ if (u.uswallow) { Sprintf(buf, "swallowed by %s", a_monnam(u.ustuck)); -#ifdef WIZARD if (wizard) Sprintf(eos(buf), " (%u)", u.uswldtim); -#endif you_are(buf, ""); } else if (u.ustuck) { Sprintf(buf, "%s %s", @@ -1662,13 +1644,11 @@ int final; /* when mounted, Wounded_legs applies to steed rather than to hero; we only report steed's wounded legs in wizard mode */ if (u.usteed) { /* not `Riding' here */ -# ifdef WIZARD if (wizard) { Strcpy(buf, steedname); *buf = highc(*buf); enl_msg(buf, " has", " had", " wounded legs", ""); } -# endif } else { Sprintf(buf, "wounded %s", makeplural(body_part(LEG))); you_have(buf, ""); @@ -1685,9 +1665,7 @@ int final; if (Sleepy) { if (magic || cause_known(SLEEPY)) { Strcpy(buf, from_what(SLEEPY)); -#ifdef WIZARD if (wizard) Sprintf(eos(buf), " (%ld)", (HSleepy & TIMEOUT)); -#endif enl_msg("You ", "fall", "fell", " asleep uncontrollably", buf); } } @@ -1788,12 +1766,10 @@ int final; else if (u.ualign.record >= -3) you_have("strayed",""); else if (u.ualign.record >= -8) you_have("sinned",""); else you_have("transgressed",""); -#ifdef WIZARD if (wizard) { Sprintf(buf, " %d", u.ualign.record); enl_msg("Your alignment ", "is", "was", buf, ""); } -#endif /*** Resistances to troubles ***/ if (Invulnerable) you_are("invulnerable",from_what(INVULNERABLE)); @@ -1977,9 +1953,7 @@ int final; if (Upolyd) { if (u.umonnum == u.ulycn) Strcpy(buf, "in beast form"); else Sprintf(buf, "polymorphed into %s", an(youmonst.data->mname)); -#ifdef WIZARD if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone); -#endif you_are(buf,""); if (lays_eggs(youmonst.data) && flags.female) you_can("lay eggs", ""); @@ -2000,14 +1974,9 @@ int final; Sprintf(buf, "%s%slucky", ltmp >= 10 ? "extremely " : ltmp >= 5 ? "very " : "", Luck < 0 ? "un" : ""); -#ifdef WIZARD if (wizard) Sprintf(eos(buf), " (%d)", Luck); -#endif you_are(buf,""); - } -#ifdef WIZARD - else if (wizard) enl_msg("Your luck ", "is", "was", " zero",""); -#endif + } else if (wizard) enl_msg("Your luck ", "is", "was", " zero",""); if (u.moreluck > 0) you_have("extra luck",""); else if (u.moreluck < 0) you_have("reduced luck",""); if (carrying(LUCKSTONE) || stone_luck(TRUE)) { @@ -2021,9 +1990,7 @@ int final; if (u.ugangr) { Sprintf(buf, " %sangry with you", u.ugangr > 6 ? "extremely " : u.ugangr > 3 ? "very " : ""); -#ifdef WIZARD if (wizard) Sprintf(eos(buf), " (%d)", u.ugangr); -#endif enl_msg(u_gname(), " is", " was", buf,""); } else /* @@ -2039,9 +2006,7 @@ int final; #else Sprintf(buf, "%ssafely pray", can_pray(FALSE) ? "" : "not "); #endif -#ifdef WIZARD if (wizard) Sprintf(eos(buf), " (%d)", u.ublesscnt); -#endif you_can(buf,""); } if (wizard) { @@ -2301,25 +2266,21 @@ int final; if (!u.uconduct.weaphit) you_have_never("hit with a wielded weapon"); -#ifdef WIZARD else if (wizard) { Sprintf(buf, "used a wielded weapon %ld time%s", u.uconduct.weaphit, plur(u.uconduct.weaphit)); you_have_X(buf); } -#endif if (!u.uconduct.killer) you_have_been("a pacifist"); if (!u.uconduct.literate) you_have_been("illiterate"); -#ifdef WIZARD else if (wizard) { Sprintf(buf, "read items or engraved %ld time%s", u.uconduct.literate, plur(u.uconduct.literate)); you_have_X(buf); } -#endif ngenocided = num_genocides(); if (ngenocided == 0) { @@ -2332,23 +2293,19 @@ int final; if (!u.uconduct.polypiles) you_have_never("polymorphed an object"); -#ifdef WIZARD else if (wizard) { Sprintf(buf, "polymorphed %ld item%s", u.uconduct.polypiles, plur(u.uconduct.polypiles)); you_have_X(buf); } -#endif if (!u.uconduct.polyselfs) you_have_never("changed form"); -#ifdef WIZARD else if (wizard) { Sprintf(buf, "changed form %ld time%s", u.uconduct.polyselfs, plur(u.uconduct.polyselfs)); you_have_X(buf); } -#endif if (!u.uconduct.wishes) you_have_X("used no wishes"); @@ -2381,22 +2338,18 @@ int final; static const struct func_tab cmdlist[] = { {C('d'), FALSE, dokick}, /* "D" is for door!...? Msg is in dokick.c */ -#ifdef WIZARD {C('e'), TRUE, wiz_detect}, {C('f'), TRUE, wiz_map}, {C('g'), TRUE, wiz_genesis}, {C('i'), TRUE, wiz_identify}, -#endif {C('l'), TRUE, doredraw}, /* if number_pad is set */ {C('n'), TRUE, donamelevel}, /* if number_pad is set */ {C('o'), TRUE, dooverview_or_wiz_where}, /* depending on wizard status */ {C('p'), TRUE, doprev_message}, {C('r'), TRUE, doredraw}, {C('t'), TRUE, dotele}, -#ifdef WIZARD {C('v'), TRUE, wiz_level_tele}, {C('w'), TRUE, wiz_wish}, -#endif {C('x'), TRUE, doattributes}, {C('z'), TRUE, dosuspend_core}, {'a', FALSE, doapply}, @@ -2532,7 +2485,6 @@ struct ext_func_tab extcmdlist[] = { doextversion, TRUE}, {"wipe", "wipe off your face", dowipe, FALSE}, {"?", "get this list of extended commands", doextlist, TRUE}, -#if defined(WIZARD) /* * There must be a blank entry here for every entry in the table * below. @@ -2559,11 +2511,9 @@ struct ext_func_tab extcmdlist[] = { #endif {(char *)0, (char *)0, donull, TRUE}, /* wizrumorcheck */ {(char *)0, (char *)0, donull, TRUE}, /* wmode */ -#endif {(char *)0, (char *)0, donull, TRUE} /* sentinel */ }; -#ifdef WIZARD /* there must be a placeholder in the table above for every entry here */ static const struct ext_func_tab debug_extcmdlist[] = { {"levelchange", "change experience level", wiz_level_change, TRUE}, @@ -2882,8 +2832,6 @@ wiz_migrate_mons() } #endif -#endif /* WIZARD */ - #define unctrl(c) ((c) <= C('z') ? (0x60 | (c)) : (c)) #define unmeta(c) (0x7f & (c)) @@ -3371,11 +3319,7 @@ const char *msg; sym = highc(sym); ctrl = (sym - 'A') + 1; if ((explain = dowhatdoes_core(ctrl, buf2)) - && (!index(wiz_only_list, sym) -#ifdef WIZARD - || wizard -#endif - )) { + && (!index(wiz_only_list, sym) || wizard)) { Sprintf(buf, "Are you trying to use ^%c%s?", sym, index(wiz_only_list, sym) ? "" : " as specified in the Guidebook"); diff --git a/src/do.c b/src/do.c index 4e5876e6b..c225000ef 100644 --- a/src/do.c +++ b/src/do.c @@ -1029,9 +1029,7 @@ boolean at_stairs, falling, portal; newlevel->dlevel = dunlevs_in_dungeon(newlevel); if (newdungeon && In_endgame(newlevel)) { /* 1st Endgame Level !!! */ if (!u.uhave.amulet) return; /* must have the Amulet */ -#ifdef WIZARD if (!wizard) /* wizard ^V can bypass Earth level */ -#endif assign_level(newlevel, &earth_level); /* (redundant) */ } new_ledger = ledger_no(newlevel); @@ -1297,12 +1295,10 @@ boolean at_stairs, falling, portal; mnexto(mtmp); if ((mtmp = m_at(u.ux, u.uy)) != 0) { -#ifdef WIZARD /* there was an unconditional impossible("mnearto failed") here, but it's not impossible and we're prepared to cope with the situation, so only say something when debugging */ if (wizard) pline("(monster in hero's way)"); -#endif if (!rloc(mtmp, TRUE)) /* no room to move it; send it away, to return later */ migrate_to_level(mtmp, ledger_no(&u.uz), diff --git a/src/dungeon.c b/src/dungeon.c index ed186796b..ed6b726de 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -50,14 +50,12 @@ STATIC_DCL void FDECL(init_level, (int,int,struct proto_dungeon *)); STATIC_DCL int FDECL(possible_places, (int, boolean *, struct proto_dungeon *)); STATIC_DCL xchar FDECL(pick_level, (boolean *, int)); STATIC_DCL boolean FDECL(place_level, (int, struct proto_dungeon *)); -#ifdef WIZARD STATIC_DCL boolean FDECL(unplaced_floater, (struct dungeon *)); STATIC_DCL boolean FDECL(unreachable_level, (d_level *,BOOLEAN_P)); STATIC_DCL void FDECL(tport_menu, (winid,char *,struct lchoice *, d_level *,BOOLEAN_P)); STATIC_DCL const char *FDECL(br_string, (int)); STATIC_DCL void FDECL(print_branch, (winid, int, int, int, BOOLEAN_P, struct lchoice *)); -#endif mapseen *mapseenchn = (struct mapseen *)0; STATIC_DCL mapseen *FDECL(load_mapseen, (int)); @@ -521,10 +519,7 @@ init_level(dgn, proto_index, pd) struct tmplevel *tlevel = &pd->tmplevel[proto_index]; pd->final_lev[proto_index] = (s_level *) 0; /* no "real" level */ -#ifdef WIZARD - if (!wizard) -#endif - if (tlevel->chance <= rn2(100)) return; + if (!wizard && tlevel->chance <= rn2(100)) return; pd->final_lev[proto_index] = new_level = (s_level *) alloc(sizeof(s_level)); @@ -742,10 +737,8 @@ init_dungeons() /* initialize the "dungeon" structs */ for (i = 0; i < n_dgns; i++) { Fread((genericptr_t)&pd.tmpdungeon[i], sizeof(struct tmpdungeon), 1, dgn_file); -#ifdef WIZARD - if(!wizard) -#endif - if(pd.tmpdungeon[i].chance && (pd.tmpdungeon[i].chance <= rn2(100))) { + if(!wizard && pd.tmpdungeon[i].chance + && (pd.tmpdungeon[i].chance <= rn2(100))) { int j; /* skip over any levels or branches */ @@ -1542,9 +1535,7 @@ const char *nam; (u.uz.dnum == medusa_level.dnum && dlev.dnum == valley_level.dnum)) && ( /* either wizard mode or else seen and not forgotten */ -#ifdef WIZARD wizard || -#endif (level_info[idx].flags & (FORGOTTEN|VISITED)) == VISITED)) { lev = depth(&slev->dlevel); } @@ -1558,9 +1549,7 @@ const char *nam; idxtoo = (idx >> 8) & 0x00FF; idx &= 0x00FF; if ( /* either wizard mode, or else _both_ sides of branch seen */ -#ifdef WIZARD wizard || -#endif ((level_info[idx].flags & (FORGOTTEN|VISITED)) == VISITED && (level_info[idxtoo].flags & (FORGOTTEN|VISITED)) == VISITED)) { if (ledger_to_dnum(idxtoo) == u.uz.dnum) idx = idxtoo; @@ -1573,8 +1562,6 @@ const char *nam; return lev; } -#ifdef WIZARD - STATIC_OVL boolean unplaced_floater(dptr) struct dungeon *dptr; @@ -1821,7 +1808,6 @@ xchar *rdgn; destroy_nhwindow(win); return 0; } -#endif /* WIZARD */ /* Record that the player knows about a branch from a level. This function * will determine whether or not it was a "real" branch that was taken. @@ -2560,7 +2546,6 @@ boolean printdun; */ Sprintf(buf, "%sLevel %d:", TAB, i); -#ifdef WIZARD /* wizmode prints out proto dungeon names for clarity */ if (wizard) { s_level *slev; @@ -2568,7 +2553,6 @@ boolean printdun; if ((slev = Is_special(&mptr->lev)) != 0) Sprintf(eos(buf), " [%s]", slev->proto); } -#endif /* [perhaps print custom annotation on its own line when it's long] */ if (mptr->custom) Sprintf(eos(buf), " (%s)", mptr->custom); diff --git a/src/eat.c b/src/eat.c index 37561967b..196fb9e49 100644 --- a/src/eat.c +++ b/src/eat.c @@ -8,11 +8,7 @@ /* #define DEBUG */ /* uncomment to enable new eat code debugging */ #ifdef DEBUG -# ifdef WIZARD #define debugpline if (wizard) pline -# else -#define debugpline pline -# endif #endif STATIC_PTR int NDECL(eatmdone); diff --git a/src/end.c b/src/end.c index 66d164143..c9fe47cb2 100644 --- a/src/end.c +++ b/src/end.c @@ -323,7 +323,7 @@ done2() } return 0; } -#if defined(WIZARD) && (defined(UNIX) || defined(VMS) || defined(LATTICE)) +#if (defined(UNIX) || defined(VMS) || defined(LATTICE)) if(wizard) { int c; # ifdef VMS @@ -510,7 +510,7 @@ panic VA_DECL(const char *, str) !program_state.something_worth_saving ? "Program initialization has failed." : "Suddenly, the dungeon collapses."); -#if defined(WIZARD) && !defined(MICRO) +#ifndef MICRO # if defined(NOTIFY_NETHACK_BUGS) if (!wizard) raw_printf("Report the following error to \"%s\" or at \"%s\".", @@ -531,11 +531,7 @@ panic VA_DECL(const char *, str) free(tmp); } else raw_printf("Report error to \"%s\"%s.", -# ifdef WIZARD_NAME /*(KR1ED)*/ WIZARD_NAME, -# else - WIZARD, -# endif !program_state.something_worth_saving ? "" : " and it may be possible to rebuild."); } @@ -560,7 +556,7 @@ panic VA_DECL(const char *, str) #ifdef WIN32 interject(INTERJECT_PANIC); #endif -#if defined(WIZARD) && (defined(UNIX) || defined(VMS) || defined(LATTICE) || defined(WIN32)) +#if defined(UNIX) || defined(VMS) || defined(LATTICE) || defined(WIN32) if (wizard) NH_abort(); /* generate core dump */ #endif @@ -846,12 +842,10 @@ int how; paniclog("trickery", killer.name); killer.name[0] = 0; } -#ifdef WIZARD if (wizard) { You("are a very tricky wizard, it seems."); return; } -#endif } /* pbuf: holds Sprintf'd output for raw_print and putstr @@ -885,11 +879,7 @@ int how; return; } } - if (( -#ifdef WIZARD - wizard || -#endif - discover) && (how <= GENOCIDED)) { + if ((wizard || discover) && (how <= GENOCIDED)) { if (paranoid_query(ParanoidDie, "Die?")) goto die; pline("OK, so you don't %s.", (how == CHOKING) ? "choke" : "die"); @@ -1047,9 +1037,7 @@ die: } if (bones_ok) { -#ifdef WIZARD if (!wizard || paranoid_query(ParanoidBones, "Save bones?")) -#endif savebones(how, endtime, corpse); /* corpse may be invalid pointer now so ensure that it isn't used again */ diff --git a/src/engrave.c b/src/engrave.c index 8ba7217ba..ebfcd0829 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -836,12 +836,10 @@ doengrave() break; case VENOM_CLASS: -#ifdef WIZARD if (wizard) { pline("Writing a poison pen letter??"); break; } -#endif case ILLOBJ_CLASS: impossible("You're engraving with an illegal object!"); break; diff --git a/src/exper.c b/src/exper.c index 568b19e88..5b1d73927 100644 --- a/src/exper.c +++ b/src/exper.c @@ -171,13 +171,11 @@ const char *drainer; /* cause of death, if drain should be fatal */ { register int num; -#ifdef WIZARD /* override life-drain resistance when handling an explicit wizard mode request to reduce level; never fatal though */ if (drainer && !strcmp(drainer, "#levelchange")) drainer = 0; else -#endif if (resists_drli(&youmonst)) return; if (u.ulevel > 1) { diff --git a/src/files.c b/src/files.c index f667b8093..03b4d5ea3 100644 --- a/src/files.c +++ b/src/files.c @@ -124,12 +124,10 @@ boolean nethack_thinks_it_is_open; /* Does NetHack think it's open? */ # endif #endif /*HOLD_LOCKFILE_OPEN*/ -#ifdef WIZARD #define WIZKIT_MAX 128 static char wizkit[WIZKIT_MAX]; STATIC_DCL FILE *NDECL(fopen_wizkit_file); STATIC_DCL void FDECL(wizkit_addinv, (struct obj *)); -#endif #ifdef AMIGA extern char PATH[]; /* see sys/amiga/amidos.c */ @@ -790,10 +788,8 @@ d_level *lev; #else ret = rename(tempname, fq_bones); #endif -#ifdef WIZARD if (wizard && ret != 0) pline("couldn't rename %s to %s.", tempname, fq_bones); -#endif } @@ -899,7 +895,7 @@ int fd; #endif -#if defined(WIZARD) && !defined(MICRO) +#ifndef MICRO /* change pre-existing savefile name to indicate an error savefile */ void set_error_savefile() @@ -1298,9 +1294,7 @@ boolean uncomp; (void) signal(SIGQUIT, SIG_IGN); (void) wait((int *)&i); (void) signal(SIGINT, (SIG_RET_TYPE) done1); -# ifdef WIZARD if (wizard) (void) signal(SIGQUIT, SIG_DFL); -# endif #else /* I don't think we can really cope with external compression * without signals, so we'll declare that compress failed and @@ -2246,10 +2240,8 @@ int src; #ifdef LOADSYMSETS switch_symbols(TRUE); #endif -#ifdef WIZARD } else if (match_varname(buf, "WIZKIT", 6)) { (void) strncpy(wizkit, bufp, WIZKIT_MAX-1); -#endif #ifdef AMIGA } else if (match_varname(buf, "FONT", 4)) { char *t; @@ -2435,7 +2427,6 @@ OR: Forbid multiline stuff for alternate config sources. return rv; } -#ifdef WIZARD STATIC_OVL FILE * fopen_wizkit_file() { @@ -2569,8 +2560,6 @@ read_wizkit() return; } -#endif /*WIZARD*/ - #ifdef LOADSYMSETS extern struct symsetentry *symset_list; /* options.c */ extern struct symparse loadsyms[]; /* drawing.c */ diff --git a/src/fountain.c b/src/fountain.c index c49efac69..764ffb5a3 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -182,12 +182,10 @@ boolean isyou; if(!mtmp) pline_The("flow reduces to a trickle."); return; } -#ifdef WIZARD if (isyou && wizard) { if (yn("Dry up fountain?") == 'n') return; } -#endif /* replace the fountain with ordinary floor */ levl[x][y].typ = ROOM; levl[x][y].looted = 0; diff --git a/src/invent.c b/src/invent.c index 189b63ea9..5778135d9 100644 --- a/src/invent.c +++ b/src/invent.c @@ -33,7 +33,6 @@ STATIC_DCL char FDECL(obj_to_let,(struct obj *)); static int lastinvnr = 51; /* 0 ... 51 (never saved&restored) */ -#ifdef WIZARD /* wizards can wish for venom, which will become an invisible inventory * item without this. putting it in inv_order would mean venom would * suddenly become a choice for all the inventory-class commands, which @@ -42,7 +41,6 @@ static int lastinvnr = 51; /* 0 ... 51 (never saved&restored) */ * around on a bones level for normal players to find. */ static char venom_inv[] = { VENOM_CLASS, 0 }; /* (constant) */ -#endif void assigninvlet(otmp) @@ -1916,7 +1914,6 @@ long* out_cnt; } start_menu(win); -#ifdef WIZARD if (wizard && iflags.override_ID) { char prompt[BUFSZ]; any.a_char = -1; @@ -1927,7 +1924,6 @@ long* out_cnt; add_menu(win, NO_GLYPH, &any,' ', iflags.override_ID, ATR_NONE, prompt, MENU_UNSELECTED); } -#endif nextclass: classcount = 0; any = zeroany; /* set all bits to zero */ @@ -1950,12 +1946,10 @@ nextclass: } if (flags.sortpack) { if (*++invlet) goto nextclass; -#ifdef WIZARD if (--invlet != venom_inv) { invlet = venom_inv; goto nextclass; } -#endif } end_menu(win, (char *) 0); diff --git a/src/light.c b/src/light.c index 8d2b38ad4..244126021 100644 --- a/src/light.c +++ b/src/light.c @@ -633,8 +633,6 @@ struct obj *obj; return "strangely"; } -#ifdef WIZARD - int wiz_light_sources() { @@ -674,6 +672,4 @@ wiz_light_sources() return 0; } -#endif /* WIZARD */ - /*light.c*/ diff --git a/src/makemon.c b/src/makemon.c index 44fcb79a0..0f2d0c41c 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -779,7 +779,7 @@ boolean ghostly; mvitals[mndx].born++; if ((int) mvitals[mndx].born >= lim && !(mons[mndx].geno & G_NOGEN) && !(mvitals[mndx].mvflags & G_EXTINCT)) { -#if defined(DEBUG) && defined(WIZARD) +#ifdef DEBUG if (wizard) pline("Automatically extinguished %s.", makeplural(mons[mndx].mname)); #endif @@ -925,7 +925,7 @@ register int mmflags; /* if you are to make a specific monster and it has already been genocided, return */ if (mvitals[mndx].mvflags & G_GENOD) return((struct monst *) 0); -#if defined(WIZARD) && defined(DEBUG) +#ifdef DEBUG if (wizard && (mvitals[mndx].mvflags & G_EXTINCT)) pline("Explicitly creating extinct monster %s.", mons[mndx].mname); @@ -1186,12 +1186,9 @@ boolean neverask; int x, y; struct monst *mon; boolean known = FALSE; -#ifdef WIZARD boolean ask = (wizard && !neverask); -#endif while (cnt--) { -#ifdef WIZARD if (ask) { if (create_particular()) { known = TRUE; @@ -1199,7 +1196,6 @@ boolean neverask; } else ask = FALSE; /* ESC will shut off prompting */ } -#endif x = u.ux, y = u.uy; /* if in water, try to encourage an aquatic monster by finding and then specifying another wet location */ diff --git a/src/mklev.c b/src/mklev.c index acb4daac4..43bccaf40 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -7,11 +7,7 @@ /* #define DEBUG */ /* uncomment to enable code debugging */ #ifdef DEBUG -# ifdef WIZARD #define debugpline if (wizard) pline -# else -#define debugpline pline -# endif #endif /* for UNIX, Rand #def'd to (long)lrand48() or (long)random() */ @@ -720,9 +716,7 @@ makelevel() { register int u_depth = depth(&u.uz); -#ifdef WIZARD if(wizard && nh_getenv("SHOPTYPE")) mkroom(SHOPBASE); else -#endif if (u_depth > 1 && u_depth < depth(&medusa_level) && nroom >= room_threshold && @@ -1561,11 +1555,7 @@ xchar x, y; } /* Already set or 2/3 chance of deferring until a later level. */ - if (source->dnum < n_dgns || (rn2(3) -#ifdef WIZARD - && !wizard -#endif - )) return; + if (source->dnum < n_dgns || (rn2(3) && !wizard)) return; if (! (u.uz.dnum == oracle_level.dnum /* in main dungeon */ && !at_dgn_entrance("The Quest") /* but not Quest's entry */ diff --git a/src/mkmaze.c b/src/mkmaze.c index ccd865db2..7f4536869 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -509,7 +509,6 @@ register const char *s; } else Strcpy(protofile, ""); -#ifdef WIZARD /* SPLEVTYPE format is "level-choice,level-choice"... */ if (wizard && *protofile && sp && sp->rndlevs) { char *ep = getenv("SPLEVTYPE"); /* not nh_getenv */ @@ -531,7 +530,6 @@ register const char *s; } } } -#endif if(*protofile) { Strcat(protofile, LEV_EXT); diff --git a/src/mkobj.c b/src/mkobj.c index 698018e9f..253fd1293 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -10,14 +10,12 @@ STATIC_DCL void FDECL(maybe_adjust_light, (struct obj *,int)); STATIC_DCL void FDECL(obj_timer_checks,(struct obj *, XCHAR_P, XCHAR_P, int)); STATIC_DCL void FDECL(container_weight, (struct obj *)); STATIC_DCL struct obj *FDECL(save_mtraits, (struct obj *, struct monst *)); -#ifdef WIZARD STATIC_DCL void FDECL(objlist_sanity, (struct obj *,int,const char *)); STATIC_DCL void FDECL(mon_obj_sanity, (struct monst *,const char *)); STATIC_DCL const char *FDECL(where_name, (struct obj *)); STATIC_DCL void FDECL(insane_object, (struct obj *,const char *,const char *,struct monst *)); STATIC_DCL void FDECL(check_contained, (struct obj *,const char *)); -#endif /*#define DEBUG_EFFECTS*/ /* show some messages for debugging */ @@ -1950,7 +1948,6 @@ boolean tipping; /* caller emptying entire contents; affects shop handling */ return objcount; } -#ifdef WIZARD /* support for wizard-mode's `sanity_check' option */ static const char NEARDATA /* pline formats for insane_object() */ @@ -2144,6 +2141,5 @@ check_contained(container, mesg) } } } -#endif /* WIZARD */ /*mkobj.c*/ diff --git a/src/mkroom.c b/src/mkroom.c index c8bcb2ed0..7f94076e7 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -67,7 +67,6 @@ mkshop() { register struct mkroom *sroom; int i = -1; -#ifdef WIZARD char *ep = (char *)0; /* (init == lint suppression) */ /* first determine shoptype */ @@ -129,7 +128,6 @@ mkshop() } #ifndef MAC gottype: -#endif #endif for(sroom = &rooms[0]; ; sroom++){ if(sroom->hx < 0) return; @@ -140,11 +138,8 @@ gottype: if(sroom->rtype != OROOM) continue; if(has_dnstairs(sroom) || has_upstairs(sroom)) continue; - if( -#ifdef WIZARD - (wizard && ep && sroom->doorct != 0) || -#endif - sroom->doorct == 1) break; + if( (wizard && ep && sroom->doorct != 0) || sroom->doorct == 1) + break; } if (!sroom->rlit) { int x, y; @@ -200,11 +195,7 @@ register boolean strict; continue; } else if(has_upstairs(sroom) || has_dnstairs(sroom)) continue; - if(sroom->doorct == 1 || !rn2(5) -#ifdef WIZARD - || wizard -#endif - ) + if(sroom->doorct == 1 || !rn2(5) || wizard) return sroom; } return (struct mkroom *)0; diff --git a/src/mon.c b/src/mon.c index 2befc3e5b..d65eb1cf9 100644 --- a/src/mon.c +++ b/src/mon.c @@ -23,9 +23,7 @@ STATIC_DCL void FDECL(dealloc_mextra, (struct mextra *)); STATIC_DCL int FDECL(pickvampshape, (struct monst *)); STATIC_DCL boolean FDECL(isspecmon, (struct monst *)); STATIC_DCL boolean FDECL(validspecmon, (struct monst *,int)); -#ifdef WIZARD STATIC_DCL boolean FDECL(validvamp, (struct monst *,int *,int)); -#endif STATIC_DCL struct permonst *FDECL(accept_newcham_form, (int)); #define LEVEL_SPECIFIC_NOCORPSE(mdat) \ @@ -2599,7 +2597,6 @@ int mndx; return TRUE; /* potential new form is ok */ } -#ifdef WIZARD /* prevent wizard mode user from specifying invalid vampshifter shape */ STATIC_OVL boolean validvamp(mon, mndx_p, monclass) @@ -2638,7 +2635,6 @@ int *mndx_p, monclass; } return (*mndx_p != NON_PM); } -#endif /*WIZARD*/ int select_newcham_form(mon) @@ -2689,7 +2685,6 @@ struct monst *mon; } break; } -#ifdef WIZARD /* for debugging: allow control of polymorphed monster */ if (wizard && iflags.mon_polycontrol) { char pprompt[BUFSZ], buf[BUFSZ]; @@ -2731,7 +2726,6 @@ struct monst *mon; if (is_vampshifter(mon) && !validvamp(mon, &mndx, monclass)) mndx = pickvampshape(mon); /* don't resort to arbitrary */ } -#endif /*WIZARD*/ /* if no form was specified above, pick one at random now */ if (mndx == NON_PM) { diff --git a/src/monmove.c b/src/monmove.c index dd7315346..490f7faa0 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -1462,9 +1462,7 @@ struct monst *mtmp; typ != LUMP_OF_ROYAL_JELLY && obj->oclass != AMULET_CLASS && obj->oclass != RING_CLASS && -#ifdef WIZARD obj->oclass != VENOM_CLASS && -#endif typ != SACK && typ != BAG_OF_HOLDING && typ != BAG_OF_TRICKS && !Is_candle(obj) && typ != OILSKIN_SACK && typ != LEASH && diff --git a/src/objnam.c b/src/objnam.c index 624ed92ff..824398123 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1690,9 +1690,7 @@ static const char *const as_is[] = { "boots", "shoes", "gloves", "lenses", "scales", "gauntlets", -#ifdef WIZARD "iron bars", -#endif /* both singular and plural are spelled the same */ "deer", "fish", "tuna", "yaki", "-hai", "krill", "manes", "ninja", "sheep", "ronin", "roshi", "shito", "tengu", @@ -2188,9 +2186,7 @@ STATIC_OVL NEARDATA const struct o_range o_ranges[] = { { "dragon scale mail", ARMOR_CLASS, GRAY_DRAGON_SCALE_MAIL, YELLOW_DRAGON_SCALE_MAIL }, { "sword", WEAPON_CLASS, SHORT_SWORD, KATANA }, -#ifdef WIZARD { "venom", VENOM_CLASS, BLINDING_VENOM, ACID_VENOM }, -#endif { "gray stone", GEM_CLASS, LUCKSTONE, FLINT }, { "grey stone", GEM_CLASS, LUCKSTONE, FLINT }, }; @@ -2652,7 +2648,6 @@ struct obj *no_wish; } } -#ifdef WIZARD /* Wishing in wizard mode can create traps and furniture. * Part I: distinguish between trap and object for the two * types of traps which have corresponding objects: bear trap @@ -2692,7 +2687,6 @@ struct obj *no_wish; the object name and getting a disarmed trap object] */ } } -#endif retry: /* "grey stone" check must be before general "stone" */ @@ -2862,7 +2856,6 @@ srch: goto typfnd; } } -#ifdef WIZARD /* Let wizards wish for traps and furniture. * Must come after objects check so wizards can still wish for * trap objects like beartraps. @@ -2979,7 +2972,6 @@ wiztrap: return &zeroobj; } } -#endif /* WIZARD */ if(!oclass) return((struct obj *)0); any: @@ -3035,16 +3027,12 @@ typfnd: || typ == ROCK || is_missile(otmp))))) otmp->quan = (long) cnt; -#ifdef WIZARD if (oclass == VENOM_CLASS) otmp->spe = 1; -#endif if (spesgn == 0) { spe = otmp->spe; -#ifdef WIZARD } else if (wizard) { ; /* no alteration to spe */ -#endif } else if (oclass == ARMOR_CLASS || oclass == WEAPON_CLASS || is_weptool(otmp) || (oclass==RING_CLASS && objects[typ].oc_charged)) { diff --git a/src/options.c b/src/options.c index 8504a2c3e..9083ae63e 100644 --- a/src/options.c +++ b/src/options.c @@ -138,12 +138,8 @@ static struct Bool_Opt #else {"mail", (boolean *)0, TRUE, SET_IN_FILE}, #endif -#ifdef WIZARD /* for menu debugging only*/ {"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME}, -#else - {"menu_tab_sep", (boolean *)0, FALSE, SET_IN_FILE}, -#endif {"mouse_support", &iflags.wc_mouse_support, TRUE, DISP_IN_GAME}, /*WC*/ #ifdef NEWS {"news", &iflags.news, TRUE, DISP_IN_GAME}, @@ -177,11 +173,7 @@ static struct Bool_Opt DISP_IN_GAME}, #endif {"safe_pet", &flags.safe_dog, TRUE, SET_IN_GAME}, -#ifdef WIZARD {"sanity_check", &iflags.sanity_check, FALSE, SET_IN_GAME}, -#else - {"sanity_check", (boolean *)0, FALSE, SET_IN_FILE}, -#endif {"selectsaved", &iflags.wc2_selectsaved, TRUE, DISP_IN_GAME}, /*WC*/ #ifdef EXP_ON_BOTL {"showexp", &flags.showexp, FALSE, SET_IN_GAME}, @@ -339,12 +331,7 @@ static struct Comp_Opt MAXOCLASSES, SET_IN_GAME }, { "pile_limit", "threshold for \"there are many objects here\"", 24, SET_IN_GAME }, - { "playmode", -#ifdef WIZARD - "normal play, non-scoring explore mode, or debug mode", -#else - "normal play or non-scoring explore mode", -#endif + { "playmode", "normal play, non-scoring explore mode, or debug mode", 8, DISP_IN_GAME }, { "player_selection", "choose character via dialog or prompts", 12, DISP_IN_GAME }, @@ -1112,17 +1099,9 @@ STATIC_VAR const struct paranoia_opts { { PARANOID_QUIT, "quit", 1, "explore", 1, "yes vs y to quit or to enter explore mode" }, { PARANOID_DIE, "die", 1, "death", 2, -#ifdef WIZARD "yes vs y to die (explore mode or debug mode)" }, -#else - "yes vs y to die (explore mode only)" }, -#endif { PARANOID_BONES, "bones", 1, 0, 0, -#ifdef WIZARD "yes vs y to save bones data when dying in debug mode" }, -#else - "(only applicable for debug mode)" }, -#endif { PARANOID_HIT, "attack", 1, "hit", 1, "yes vs y to attack a peaceful monster" }, { PARANOID_PRAY, "pray", 1, 0, 0, @@ -2045,12 +2024,7 @@ goodfruit: wizard = FALSE, discover = TRUE; } else if (!strncmpi(op, "debug", 5) || !strncmpi(op, "wizard", 6)) { -#ifdef WIZARD wizard = TRUE, discover = FALSE; -#else - raw_printf("\"%s\":%s -- debug mode not available.", - fullname, op); -#endif } else { raw_printf("Invalid value for \"%s\":%s.", fullname, op); } @@ -2868,10 +2842,8 @@ doset() ((boolopt[i].optflags == DISP_IN_GAME && pass == 0) || (boolopt[i].optflags == SET_IN_GAME && pass == 1))) { if (bool_p == &flags.female) continue; /* obsolete */ -#ifdef WIZARD if (bool_p == &iflags.sanity_check && !wizard) continue; if (bool_p == &iflags.menu_tab_sep && !wizard) continue; -#endif if (is_wc_option(boolopt[i].name) && !wc_supported(boolopt[i].name)) continue; if (is_wc2_option(boolopt[i].name) && @@ -4162,10 +4134,8 @@ option_help() /* Boolean options */ for (i = 0; boolopt[i].name; i++) { if (boolopt[i].addr) { -#ifdef WIZARD if (boolopt[i].addr == &iflags.sanity_check && !wizard) continue; if (boolopt[i].addr == &iflags.menu_tab_sep && !wizard) continue; -#endif next_opt(datawin, boolopt[i].name); } } @@ -4756,11 +4726,9 @@ void set_playmode() { if (wizard) { -#ifdef WIZARD if (authorize_wizard_mode()) Strcpy(plname, "wizard"); else -#endif wizard = FALSE; /* not allowed or not available */ /* force explore mode if we didn't make it into wizard mode */ discover = !wizard; diff --git a/src/pager.c b/src/pager.c index 69590754d..4d734e5ef 100644 --- a/src/pager.c +++ b/src/pager.c @@ -936,9 +936,7 @@ static const char *help_menu_items[] = { #else #define WIZHLP_SLOT 11 #endif -#ifdef WIZARD "List of wizard-mode commands.", -#endif "", (char *)0 }; @@ -957,10 +955,8 @@ help_menu(sel) any = zeroany; /* zero all bits */ start_menu(tmpwin); -#ifdef WIZARD if (!wizard) help_menu_items[WIZHLP_SLOT] = "", help_menu_items[WIZHLP_SLOT+1] = (char *)0; -#endif for (i = 0; help_menu_items[i]; i++) #ifdef PORT_HELP /* port-specific line has a %s in it for the PORT_ID */ @@ -1010,10 +1006,8 @@ dohelp() case PORT_HELP_ID: port_help(); break; #endif default: -#ifdef WIZARD /* handle slot 11 or 12 */ display_file(DEBUGHELP, TRUE); -#endif break; } } diff --git a/src/pline.c b/src/pline.c index 96b14d049..bd80a040f 100644 --- a/src/pline.c +++ b/src/pline.c @@ -50,9 +50,7 @@ pline VA_DECL(const char *, line) #ifdef HANGUPHANDLING if (program_state.done_hup) return; #endif -#ifdef WIZARD if (program_state.wizkit_wishing) return; -#endif if (index(line, '%')) { Vsprintf(pbuf,line,VA_ARGS); @@ -341,7 +339,6 @@ register struct monst *mtmp; info[0] = 0; if (mtmp->mtame) { Strcat(info, ", tame"); -#ifdef WIZARD if (wizard) { Sprintf(eos(info), " (%d", mtmp->mtame); if (!mtmp->isminion) @@ -349,7 +346,6 @@ register struct monst *mtmp; EDOG(mtmp)->hungrytime, EDOG(mtmp)->apport); Strcat(info, ")"); } -#endif } else if (mtmp->mpeaceful) Strcat(info, ", peaceful"); if (mtmp->cham >= LOW_PM && mtmp->data != &mons[mtmp->cham]) diff --git a/src/pray.c b/src/pray.c index 0e3730e20..a91782c72 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1645,7 +1645,6 @@ dopray() /* set up p_type and p_alignment */ if (!can_pray(TRUE)) return 0; -#ifdef WIZARD if (wizard && p_type >= 0) { if (yn("Force the gods to be pleased?") == 'y') { u.ublesscnt = 0; @@ -1655,7 +1654,6 @@ dopray() if(p_type < 2) p_type = 3; } } -#endif nomul(-3); nomovemsg = "You finish your prayer."; afternmv = prayer_done; diff --git a/src/quest.c b/src/quest.c index 566d7f029..e6f8cbc83 100644 --- a/src/quest.c +++ b/src/quest.c @@ -129,7 +129,6 @@ boolean talk; int purity; aligntyp original_alignment = u.ualignbase[A_ORIGINAL]; -#ifdef WIZARD if (wizard && talk) { if (u.ualign.type != original_alignment) { You("are currently %s instead of %s.", @@ -143,7 +142,6 @@ boolean talk; u.ualign.record = MIN_QUEST_ALIGN; } } -#endif purity = (u.ualign.record >= MIN_QUEST_ALIGN && u.ualign.type == original_alignment && u.ualignbase[A_CURRENT] == original_alignment) ? 1 : diff --git a/src/questpgr.c b/src/questpgr.c index d06270c88..9f717754f 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -461,10 +461,8 @@ boolean skip_pager(common) boolean common; { -#ifdef WIZARD /* WIZKIT: suppress plot feedback if starting with quest artifact */ if (program_state.wizkit_wishing) return TRUE; -#endif if (!(common ? qt_list.common : qt_list.chrole)) { panic("%s: no %s quest text data available", common ? "com_pager" : "qt_pager", diff --git a/src/read.c b/src/read.c index 6e3147714..b60ffa66e 100644 --- a/src/read.c +++ b/src/read.c @@ -1687,7 +1687,6 @@ do_class_genocide() else if (immunecnt || class == S_invisible) You("aren't permitted to genocide such monsters."); else -#ifdef WIZARD /* to aid in topology testing; remove pesky monsters */ if (wizard && buf[0] == '*') { register struct monst *mtmp, *mtmp2; @@ -1701,7 +1700,6 @@ do_class_genocide() pline("Eliminated %d monster%s.", gonecnt, plur(gonecnt)); return; } else -#endif pline("That %s does not represent any monster.", strlen(buf) == 1 ? "symbol" : "response"); continue; @@ -2023,7 +2021,6 @@ struct obj *from_obj; return FALSE; } -#ifdef WIZARD /* * Make a new monster with the type controlled by the user. * @@ -2063,12 +2060,10 @@ create_particular() makehostile = TRUE; } /* decide whether a valid monster was chosen */ -#ifdef WIZARD if (wizard && (!strcmp(bufp, "*") || !strcmp(bufp, "random"))) { randmonst = TRUE; break; } -#endif which = name_to_mon(bufp); if (which >= LOW_PM) break; /* got one */ monclass = name_to_monclass(bufp, &which); @@ -2089,12 +2084,10 @@ create_particular() if (!randmonst) { firstchoice = which; if (cant_revive(&which, FALSE, (struct obj *)0)) { -#ifdef WIZARD /* intentionally redundant... */ /* wizard mode can override handling of special monsters */ Sprintf(buf, "Creating %s instead; force %s?", mons[which].mname, mons[firstchoice].mname); if (yn(buf) == 'y') which = firstchoice; -#endif } whichpm = &mons[which]; } @@ -2127,6 +2120,5 @@ create_particular() } return madeany; } -#endif /* WIZARD */ /*read.c*/ diff --git a/src/rect.c b/src/rect.c index be120c369..a3d6228c7 100644 --- a/src/rect.c +++ b/src/rect.c @@ -137,9 +137,7 @@ add_rect(r) NhRect *r; { if (rect_cnt >= MAXRECT) { -#ifdef WIZARD if (wizard) pline("MAXRECT may be too small."); -#endif return; } /* Check that this NhRect is not included in another one */ diff --git a/src/restore.c b/src/restore.c index 30af7762c..e888b4dcd 100644 --- a/src/restore.c +++ b/src/restore.c @@ -531,9 +531,7 @@ unsigned int *stuckid, *steedid; /* for wizard mode, issue a reminder; for others, treat it as an attempt to cheat and refuse to restore this file */ pline("Saved game was not yours."); -#ifdef WIZARD if (!wizard) -#endif return FALSE; } mread(fd, (genericptr_t) &context, sizeof(struct context_info)); @@ -1008,9 +1006,7 @@ boolean ghostly; hpid, pid); else Sprintf(trickbuf, "This is level %d, not %d!", dlvl, lev); -#ifdef WIZARD if (wizard) pline1(trickbuf); -#endif trickery(trickbuf); } restcemetery(fd, &level.bonesinfo); diff --git a/src/rumors.c b/src/rumors.c index e84418e2d..7df89e8f4 100644 --- a/src/rumors.c +++ b/src/rumors.c @@ -172,7 +172,6 @@ boolean exclude_cookie; return rumor_buf; } -#ifdef WIZARD /* * test that the true/false rumor boundaries are valid. */ @@ -266,7 +265,6 @@ rumor_check() true_rumor_size = -1; /* don't try to open it again */ } } -#endif void outrumor(truth, mechanism) diff --git a/src/save.c b/src/save.c index e66a5c9eb..dc0f94078 100644 --- a/src/save.c +++ b/src/save.c @@ -1391,12 +1391,10 @@ int lev; if (!swapout_oldest()) return FALSE; } -# ifdef WIZARD if (wizard) { pline("Swapping in `%s'.", from); wait_synch(); } -# endif copyfile(from, to); (void) unlink(from); level_info[lev].where = ACTIVE; @@ -1423,12 +1421,10 @@ swapout_oldest() { Sprintf(to, "%s%s", permbones, alllevels); set_levelfile_name(from, oldest); set_levelfile_name(to, oldest); -# ifdef WIZARD if (wizard) { pline("Swapping out `%s'.", from); wait_synch(); } -# endif copyfile(from, to); (void) unlink(from); level_info[oldest].where = SWAPPED; diff --git a/src/shknam.c b/src/shknam.c index ab2262bb4..77bdf2f3c 100644 --- a/src/shknam.c +++ b/src/shknam.c @@ -510,7 +510,6 @@ struct mkroom *sroom; else if(sy == sroom->hy+1) sy--; else { shk_failed: #ifdef DEBUG -# ifdef WIZARD /* Said to happen sometimes, but I have never seen it. */ /* Supposedly fixed by fdoor change in mklev.c */ if(wizard) { @@ -527,7 +526,6 @@ struct mkroom *sroom; } display_nhwindow(WIN_MESSAGE, FALSE); } -# endif #endif return(-1); } diff --git a/src/sp_lev.c b/src/sp_lev.c index 5ecf91aa1..f27637b9b 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -15,11 +15,7 @@ /* #define DEBUG */ /* uncomment to enable code debugging */ #ifdef DEBUG -# ifdef WIZARD #define debugpline if (wizard) pline -# else -#define debugpline pline -# endif #endif #include "sp_lev.h" diff --git a/src/steed.c b/src/steed.c index afd4579dc..a18b418b9 100644 --- a/src/steed.c +++ b/src/steed.c @@ -177,10 +177,8 @@ doride() if (u.usteed) { dismount_steed(DISMOUNT_BYCHOICE); } else if (getdir((char *)0) && isok(u.ux+u.dx, u.uy+u.dy)) { -#ifdef WIZARD if (wizard && yn("Force the mount to succeed?") == 'y') forcemount = TRUE; -#endif return (mount_steed(m_at(u.ux+u.dx, u.uy+u.dy), forcemount)); } else { return 0; @@ -225,11 +223,9 @@ mount_steed(mtmp, force) */ if (Wounded_legs) { Your("%s are in no shape for riding.", makeplural(body_part(LEG))); -#ifdef WIZARD if (force && wizard && yn("Heal your legs?") == 'y') HWounded_legs = EWounded_legs = 0; else -#endif return (FALSE); } diff --git a/src/sys.c b/src/sys.c index 4550f4ff5..2f6c5fd87 100644 --- a/src/sys.c +++ b/src/sys.c @@ -8,10 +8,6 @@ /* for KR1ED config, WIZARD is 0 or 1 and WIZARD_NAME is a string; for usual config, WIZARD is the string; forcing WIZARD_NAME to match it eliminates conditional testing for which one to use in string ops */ -#ifndef KR1ED -# undef WIZARD_NAME -# define WIZARD_NAME WIZARD -#endif struct sysopt sysopt; diff --git a/src/teleport.c b/src/teleport.c index 158bd752c..ab8bb063e 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -418,14 +418,10 @@ struct obj *scroll; /* Disable teleportation in stronghold && Vlad's Tower */ if (level.flags.noteleport) { -#ifdef WIZARD if (!wizard) { -#endif pline("A mysterious force prevents you from teleporting!"); return TRUE; -#ifdef WIZARD } -#endif } /* don't show trap if "Sorry..." */ @@ -433,15 +429,11 @@ struct obj *scroll; if ((u.uhave.amulet || On_W_tower_level(&u.uz)) && !rn2(3)) { You_feel("disoriented for a moment."); -#ifdef WIZARD if (wizard && yn("Override?") != 'y') -#endif return FALSE; } if ((Teleport_control && !Stunned) -#ifdef WIZARD || wizard -#endif ) { if (unconscious()) { pline("Being unconscious, you cannot control your teleport."); @@ -519,40 +511,29 @@ dotele() castit = TRUE; break; } -#ifdef WIZARD if (!wizard) { -#endif if (!castit) { if (!Teleportation) You("don't know that spell."); else You("are not able to teleport at will."); return(0); } -#ifdef WIZARD } -#endif } if (u.uhunger <= 100 || ACURR(A_STR) < 6) { -#ifdef WIZARD if (!wizard) { -#endif You("lack the strength %s.", castit ? "for a teleport spell" : "to teleport"); return 1; -#ifdef WIZARD } -#endif } energy = objects[SPE_TELEPORT_AWAY].oc_level * 7 / 2 - 2; if (u.uen <= energy) { -#ifdef WIZARD if (wizard) energy = u.uen; - else -#endif - { + else { You("lack the energy %s.", castit ? "for a teleport spell" : "to teleport"); return 1; @@ -567,10 +548,7 @@ dotele() exercise(A_WIS, TRUE); if (spelleffects(sp_no, TRUE)) return(1); - else -#ifdef WIZARD - if (!wizard) -#endif + else if (!wizard) return(0); } else { u.uen -= energy; @@ -601,29 +579,19 @@ level_tele() boolean force_dest = FALSE; if ((u.uhave.amulet || In_endgame(&u.uz) || In_sokoban(&u.uz)) -#ifdef WIZARD - && !wizard -#endif - ) { + && !wizard) { You_feel("very disoriented for a moment."); return; } - if ((Teleport_control && !Stunned) -#ifdef WIZARD - || wizard -#endif - ) { + if ((Teleport_control && !Stunned) || wizard) { char qbuf[BUFSZ]; int trycnt = 0; Strcpy(qbuf, "To what level do you want to teleport?"); do { if (++trycnt == 2) { -#ifdef WIZARD if (wizard) Strcat(qbuf, " [type a number or ? for a menu]"); - else -#endif - Strcat(qbuf, " [type a number]"); + else Strcat(qbuf, " [type a number]"); } getlin(qbuf, buf); if (!strcmp(buf,"\033")) { /* cancelled */ @@ -638,7 +606,6 @@ level_tele() pline("Oops..."); goto random_levtport; } -#ifdef WIZARD if (wizard && !strcmp(buf,"?")) { schar destlev = 0; xchar destdnum = 0; @@ -661,9 +628,7 @@ level_tele() } } force_dest = TRUE; - } else -#endif /*WIZARD*/ - if ((newlev = lev_by_name(buf)) == 0) newlev = atoi(buf); + } else if ((newlev = lev_by_name(buf)) == 0) newlev = atoi(buf); } while (!newlev && !digit(buf[0]) && (buf[0] != '-' || !digit(buf[1])) && trycnt < 10); @@ -721,7 +686,6 @@ level_tele() You1(shudder_for_moment); return; } -#ifdef WIZARD if (In_endgame(&u.uz)) { /* must already be wizard */ int llimit = dunlevs_in_dungeon(&u.uz); @@ -734,7 +698,6 @@ level_tele() schedule_goto(&newlevel, FALSE, FALSE, 0, (char *)0, (char *)0); return; } -#endif killer.name[0] = 0; /* still alive, so far... */ @@ -800,18 +763,13 @@ level_tele() } else if (u.uz.dnum == medusa_level.dnum && newlev >= dungeons[u.uz.dnum].depth_start + dunlevs_in_dungeon(&u.uz)) { -#ifdef WIZARD if (!(wizard && force_dest)) -#endif find_hell(&newlevel); } else { /* if invocation did not yet occur, teleporting into * the last level of Gehennom is forbidden. */ -#ifdef WIZARD - if (!wizard) -#endif - if (Inhell && !u.uevent.invoked && + if (!wizard && Inhell && !u.uevent.invoked && newlev >= (dungeons[u.uz.dnum].depth_start + dunlevs_in_dungeon(&u.uz) - 1)) { newlev = dungeons[u.uz.dnum].depth_start + @@ -825,9 +783,7 @@ level_tele() * we must translate newlev to a number relative to the * current dungeon. */ -#ifdef WIZARD if (!(wizard && force_dest)) -#endif get_level(&newlevel, newlev); } schedule_goto(&newlevel, FALSE, FALSE, 0, (char *)0, (char *)0); diff --git a/src/timeout.c b/src/timeout.c index 6e2b0f95e..481b16ae7 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -1336,10 +1336,8 @@ do_storms() * Check whether object has a timer of type timer_type. */ -#ifdef WIZARD STATIC_DCL const char *FDECL(kind_name, (SHORT_P)); STATIC_DCL void FDECL(print_queue, (winid, timer_element *)); -#endif STATIC_DCL void FDECL(insert_timer, (timer_element *)); STATIC_DCL timer_element *FDECL(remove_timer, (timer_element **, SHORT_P, ANY_P *)); @@ -1377,9 +1375,6 @@ static const ttable timeout_funcs[NUM_TIME_FUNCS] = { }; #undef TTAB - -#if defined(WIZARD) - STATIC_OVL const char * kind_name(kind) short kind; @@ -1460,9 +1455,6 @@ timer_sanity_check() } } -#endif /* WIZARD */ - - /* * Pick off timeout elements from the global queue and call their functions. * Do this until their time is less than or equal to the move count. diff --git a/src/u_init.c b/src/u_init.c index 16956b976..09930dd11 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -775,10 +775,8 @@ u_init() if (discover) ini_inv(Wishing); -#ifdef WIZARD if (wizard) read_wizkit(); -#endif #ifndef GOLDOBJ u.ugold0 += hidden_gold(); /* in case sack has gold in it */ diff --git a/src/weapon.c b/src/weapon.c index 796fba66a..746d1b5cd 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -821,9 +821,7 @@ boolean speedy; { return !P_RESTRICTED(skill) && P_SKILL(skill) < P_MAX_SKILL(skill) && ( -#ifdef WIZARD (wizard && speedy) || -#endif (P_ADVANCE(skill) >= (unsigned) practice_needed_to_advance(P_SKILL(skill)) && u.skills_advanced < P_SKILL_LIMIT @@ -896,10 +894,8 @@ enhance_weapon_skill() winid win; boolean speedy = FALSE; -#ifdef WIZARD if (wizard && yn("Advance skills without practice?") == 'y') speedy = TRUE; -#endif do { /* find longest available skill name, count those that can advance */ @@ -972,7 +968,6 @@ enhance_weapon_skill() prefix = (to_advance + eventually_advance + maxxed_cnt > 0) ? " " : ""; (void) skill_level_name(i, sklnambuf); -#ifdef WIZARD if (wizard) { if (!iflags.menu_tab_sep) Sprintf(buf, " %s%-*s %-12s %5d(%4d)", @@ -984,9 +979,7 @@ enhance_weapon_skill() prefix, P_NAME(i), sklnambuf, P_ADVANCE(i), practice_needed_to_advance(P_SKILL(i))); - } else -#endif - { + } else { if (!iflags.menu_tab_sep) Sprintf(buf, " %s %-*s [%s]", prefix, longest, P_NAME(i), sklnambuf); @@ -1001,11 +994,9 @@ enhance_weapon_skill() Strcpy(buf, (to_advance > 0) ? "Pick a skill to advance:" : "Current skills:"); -#ifdef WIZARD if (wizard && !speedy) Sprintf(eos(buf), " (%d slot%s available)", u.weapon_slots, plur(u.weapon_slots)); -#endif end_menu(win, buf); n = select_menu(win, to_advance ? PICK_ONE : PICK_NONE, &selected); destroy_nhwindow(win); diff --git a/sys/be/bemain.c b/sys/be/bemain.c index 6a3715a9a..e053718cf 100644 --- a/sys/be/bemain.c +++ b/sys/be/bemain.c @@ -161,10 +161,8 @@ static void process_options(int argc, char **argv) argc--; switch (argv[0][1]) { case 'D': -#ifdef WIZARD wizard = TRUE, discover = FALSE; break; -#endif /* otherwise fall thru to discover */ case 'X': discover = TRUE, wizard = FALSE; @@ -253,12 +251,8 @@ void getlock(void) boolean authorize_wizard_mode() { -#ifdef WIZARD /* other ports validate user name or character name here */ return TRUE; -#else - return FALSE; -#endif } #ifndef __begui__ diff --git a/sys/mac/macmain.c b/sys/mac/macmain.c index 644e8e58f..de48cd2f6 100644 --- a/sys/mac/macmain.c +++ b/sys/mac/macmain.c @@ -284,12 +284,8 @@ finder_file_request(void) boolean authorize_wizard_mode() { -#ifdef WIZARD /* other ports validate user name or character name here */ return TRUE; -#else - return FALSE; -#endif } /*macmain.c*/ diff --git a/sys/mac/macmenu.c b/sys/mac/macmenu.c index 651ab2242..b12bec9c9 100644 --- a/sys/mac/macmenu.c +++ b/sys/mac/macmenu.c @@ -619,9 +619,7 @@ void mac_askname () fatal("\pCannot create mode menu"); AppendMenu(askmenu[RSRC_ASK_MODE], "\pNormal"); AppendMenu(askmenu[RSRC_ASK_MODE], "\pExplore"); -#ifdef WIZARD AppendMenu(askmenu[RSRC_ASK_MODE], "\pDebug"); -#endif InsertMenu(askmenu[RSRC_ASK_MODE], hierMenu); currmode = 0; @@ -708,9 +706,7 @@ void mac_askname () /* Adjust the mode popup menu */ CheckMenuItem(askmenu[RSRC_ASK_MODE], 1, currmode == 0); CheckMenuItem(askmenu[RSRC_ASK_MODE], 2, currmode == 1); -#ifdef WIZARD CheckMenuItem(askmenu[RSRC_ASK_MODE], 3, currmode == 2); -#endif /* Wait for an action on an item */ ModalDialog(filter, &item); @@ -773,22 +769,17 @@ void mac_askname () DisposeUserItemUPP(redraw); /* Process the mode */ -#ifdef WIZARD - wizard = -#endif - discover = 0; + wizard = discover = 0; switch (currmode) { case 0: /* Normal */ break; case 1: /* Explore */ discover = 1; break; -#ifdef WIZARD case 2: /* Debug */ wizard = 1; - strcpy(plname, WIZARD); + strcpy(plname, WIZARD_NAME); break; -#endif default: /* Quit */ ExitToShell(); } @@ -935,7 +926,6 @@ AdjustMenus(short dimMenubar) if (newMenubar != mbarRegular) ; /* we've already found its state */ -#ifdef WIZARD else if (wizard) { newMenubar = mbarSpecial; @@ -947,7 +937,6 @@ AdjustMenus(short dimMenubar) SetMenuItemText(MHND_FILE, menuFilePlayMode, "\pDebug"); } } -#endif else if (discover) { diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 0923f735f..55188619b 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -702,21 +702,11 @@ port_help() # endif /* MSDOS || WIN32 */ #endif /* PORT_HELP */ -/* for KR1ED config, WIZARD is 0 or 1 and WIZARD_NAME is a string; - for usual config, WIZARD is the string; forcing WIZARD_NAME to match it - eliminates conditional testing for which one to use in string ops */ -#ifndef KR1ED -# undef WIZARD_NAME -# define WIZARD_NAME WIZARD -#endif - /* validate wizard mode if player has requested access to it */ boolean authorize_wizard_mode() { -#ifdef WIZARD if (!strcmp(plname, WIZARD_NAME)) return TRUE; -#endif return FALSE; } diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index 8f743e2ad..f7cb9b26c 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -224,13 +224,10 @@ char *argv[]; or holds a generic user name like "player" or "games" */ plnamesuffix(); -#ifdef WIZARD if (wizard) { /* use character name rather than lock letter for file names */ locknum = 0; - } else -#endif - { + } else { /* suppress interrupts while processing lock file */ (void) signal(SIGQUIT,SIG_IGN); (void) signal(SIGINT,SIG_IGN); @@ -560,12 +557,10 @@ port_help() boolean authorize_wizard_mode() { -#ifdef WIZARD struct passwd *pw = get_unix_pw(); if (pw && sysopt.wizards && sysopt.wizards[0]) { if(check_user_string(sysopt.wizards)) return TRUE; } -#endif /* WIZARD */ wiz_error_flag = TRUE; /* not being allowed into wizard mode */ return FALSE; } @@ -574,16 +569,12 @@ static void wd_message() { if (wiz_error_flag) { -#ifdef WIZARD if (sysopt.wizards && sysopt.wizards[0]) { char *tmp = build_english_list(sysopt.wizards); pline("Only user%s %s may access debug (wizard) mode.", index(sysopt.wizards, ' ')?"s":"", tmp); free(tmp); } else -#else - pline("Debug mode is not available."); -#endif pline("Entering explore/discovery mode instead."); wizard = 0, discover = 1; /* (paranoia) */ } else if (discover) diff --git a/sys/unix/unixunix.c b/sys/unix/unixunix.c index a6d6d378b..202dd85de 100644 --- a/sys/unix/unixunix.c +++ b/sys/unix/unixunix.c @@ -311,9 +311,7 @@ int wt; #endif #ifndef NO_SIGNAL (void) signal(SIGINT, (SIG_RET_TYPE) done1); -# ifdef WIZARD if(wizard) (void) signal(SIGQUIT,SIG_DFL); -# endif #endif if(wt) { raw_print(""); diff --git a/sys/vms/vmsmain.c b/sys/vms/vmsmain.c index 52c181ade..a34224005 100644 --- a/sys/vms/vmsmain.c +++ b/sys/vms/vmsmain.c @@ -136,13 +136,10 @@ char *argv[]; or holds a generic user name like "player" or "games" */ plnamesuffix(); -#ifdef WIZARD if (wizard) { /* use character name rather than lock letter for file names */ locknum = 0; - } else -#endif - { + } else { /* suppress interrupts while processing lock file */ (void) signal(SIGQUIT, SIG_IGN); (void) signal(SIGINT, SIG_IGN); @@ -416,12 +413,10 @@ genericptr_t sigargs, mechargs; /* [0] is argc, [1..argc] are the real args */ || (condition >= SS$_ASTFLT && condition <= SS$_TBIT) || (condition >= SS$_ARTRES && condition <= SS$_INHCHME)) { program_state.done_hup = TRUE; /* pretend hangup has been attempted */ -# if defined(WIZARD) && !defined(BETA) +# ifndef BETA if (wizard) -# endif /*WIZARD && !BETA*/ -# if defined(WIZARD) || defined(BETA) +# endif /* !BETA */ abort(); /* enter the debugger */ -# endif /*WIZARD || BETA*/ } return SS$_RESIGNAL; } @@ -454,9 +449,7 @@ port_help() boolean authorize_wizard_mode() { -#ifdef WIZARD if (!strcmpi(nh_getenv("USER"), WIZARD_NAME)) return TRUE; -#endif wiz_error_flag = TRUE; /* not being allowed into wizard mode */ return FALSE; } @@ -465,12 +458,8 @@ static void wd_message() { if (wiz_error_flag) { -#ifdef WIZARD pline("Only user \"%s\" may access debug (wizard) mode.", WIZARD_NAME); -#else - pline("Debug mode is not available."); -#endif pline("Entering explore/discovery mode instead."); wizard = 0, discover = 1; /* (paranoia) */ } else if (discover) diff --git a/sys/vms/vmsunix.c b/sys/vms/vmsunix.c index baa4f75a3..90e2bd855 100644 --- a/sys/vms/vmsunix.c +++ b/sys/vms/vmsunix.c @@ -367,9 +367,7 @@ hack_resume(screen_manip) boolean screen_manip; { (void) signal(SIGINT, (SIG_RET_TYPE) done1); -# ifdef WIZARD if (wizard) (void) signal(SIGQUIT,SIG_DFL); -# endif if (screen_manip) resume_nhwindows(); /* setup terminal modes, redraw screen, &c */ } diff --git a/sys/wince/mhcmd.c b/sys/wince/mhcmd.c index 1e8b1c7f2..29d13be0b 100644 --- a/sys/wince/mhcmd.c +++ b/sys/wince/mhcmd.c @@ -296,7 +296,6 @@ NHCmdPadCell cells_layout_lookup[NH_CMDPAD_CELLNUM] = { -1, "X", "X", 13, NH_CELL_LAYOUT_MENU, 1 , 0 } }; -#ifdef WIZARD /* wizard mode layout */ NHCmdPadCell cells_layout_wizard[NH_CMDPAD_CELLNUM] = { @@ -313,7 +312,6 @@ NHCmdPadCell cells_layout_wizard[NH_CMDPAD_CELLNUM] = { -1, "", "", -NH_CMDPAD_FONT_NORMAL, NH_CELL_REG, 1, (void*)-1 }, { -1, "X", "X", 13, NH_CELL_LAYOUT_MENU, 1 , 0 } }; -#endif #else /* !WIN_CE_SMARTPHONE */ @@ -557,13 +555,11 @@ void register_command_window_class() nhcmdlayout_init(plt, cells_layout_lookup); nhcmdset_add(nhcmdset_current, plt); -#ifdef WIZARD if( wizard ) { plt = nhcmdlayout_create("Wizard Mode", NH_CMDPAD_ROWS, NH_CMDPAD_COLS); nhcmdlayout_init(plt, cells_layout_wizard); nhcmdset_add(nhcmdset_current, plt); } -#endif #else /* ! WIN_CE_SMARTPHONE */ plt = nhcmdlayout_create("lowercase", NH_CMDPAD_ROWS, NH_CMDPAD_COLS); diff --git a/sys/wince/winhack.c b/sys/wince/winhack.c index 2e25082a0..25a0a80cd 100644 --- a/sys/wince/winhack.c +++ b/sys/wince/winhack.c @@ -340,10 +340,8 @@ register char *s; void win32_abort() { -#ifdef WIZARD if (wizard) DebugBreak(); -#endif abort(); } diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 765d95142..a0f9d95fe 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -417,7 +417,7 @@ int *x, *y, *mod; static void really_move_cursor() { -#if defined(PORT_DEBUG) && defined(WIZARD) +#ifdef PORT_DEBUG char oldtitle[BUFSZ], newtitle[BUFSZ]; if (display_cursor_info && wizard) { oldtitle[0] = '\0'; diff --git a/sys/winnt/winnt.c b/sys/winnt/winnt.c index e63db103b..c36175424 100644 --- a/sys/winnt/winnt.c +++ b/sys/winnt/winnt.c @@ -236,7 +236,6 @@ extern void NDECL(backsp); void win32_abort() { -#ifdef WIZARD if (wizard) { # ifdef WIN32CON int c, ci, ct; @@ -263,7 +262,6 @@ void win32_abort() DebugBreak(); # endif } -#endif abort(); } diff --git a/util/makedefs.c b/util/makedefs.c index 4ddb7f449..ad2186887 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1233,9 +1233,6 @@ static const char *build_opts[] = { #ifdef DLB "data librarian", #endif -#ifdef WIZARD - "debug mode", -#endif #ifdef EXP_ON_BOTL "experience points on status line", #endif diff --git a/util/mdgrep.h b/util/mdgrep.h index b2515aa86..823c269d3 100644 --- a/util/mdgrep.h +++ b/util/mdgrep.h @@ -257,11 +257,7 @@ static struct grep_var grep_vars[]={ #else {"WIN_CE_SMARTPHONE", 0}, #endif -#if defined(WIZARD) {"WIZARD", 1}, -#else - {"WIZARD", 0}, -#endif #if defined(X11_GRAPHICS) {"X11_GRAPHICS", 1}, #else diff --git a/util/mdgrep.pl b/util/mdgrep.pl index 10038fdc7..27e78fe47 100644 --- a/util/mdgrep.pl +++ b/util/mdgrep.pl @@ -18,7 +18,7 @@ # Game Features: @feature = qw/ZEROCOMP USE_TILES ASCIIGRAPH CLIPPING TEXTCOLOR - COMPRESS ZLIB_COMP RANDOM SECURE USER_SOUNDS WIZARD + COMPRESS ZLIB_COMP RANDOM SECURE USER_SOUNDS SAFERHANGUP MFLOPPY NOCWD_ASSUMPTIONS VAR_PLAYGROUND DLB SHELL SUSPEND NOSAVEONHANGUP HANGUPHANDLING BSD_JOB_CONTROL MAIL POSIX_JOB_CONTROL INSURANCE From 05f7a6372828224605a844376da365ea3faeba8b Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sat, 14 Feb 2015 01:31:22 -0500 Subject: [PATCH 129/354] Make GOLDOBJ unconditional. --- include/config.h | 1 - include/decl.h | 2 - include/extern.h | 25 ----- include/monst.h | 3 - include/you.h | 4 - src/apply.c | 17 ---- src/bones.c | 10 -- src/botl.c | 16 +--- src/decl.c | 2 - src/detect.c | 39 +------- src/do.c | 28 ------ src/dog.c | 9 -- src/dogmove.c | 3 - src/dokick.c | 8 -- src/dothrow.c | 29 ------ src/eat.c | 5 - src/end.c | 9 -- src/fountain.c | 9 -- src/hack.c | 16 +--- src/invent.c | 221 ------------------------------------------- src/makemon.c | 19 ---- src/mhitm.c | 9 -- src/mhitu.c | 22 ----- src/minion.c | 17 ---- src/mkobj.c | 8 -- src/mon.c | 18 ---- src/monmove.c | 29 +----- src/mplayer.c | 4 - src/objnam.c | 8 -- src/options.c | 5 - src/pickup.c | 128 ------------------------- src/priest.c | 27 ------ src/read.c | 2 - src/restore.c | 42 -------- src/rip.c | 4 - src/rumors.c | 9 -- src/save.c | 18 ---- src/shk.c | 91 ------------------ src/shknam.c | 4 - src/sit.c | 14 --- src/sounds.c | 4 - src/steal.c | 98 +------------------ src/trap.c | 23 ----- src/u_init.c | 22 ----- src/uhitm.c | 8 -- src/vault.c | 37 -------- src/wield.c | 7 -- src/zap.c | 7 -- sys/amiga/amirip.c | 7 +- sys/wince/mhstatus.c | 4 - util/makedefs.c | 7 -- win/Qt/qt_win.cpp | 8 -- win/X11/winstat.c | 4 - win/X11/wintext.c | 4 - win/gem/wingem.c | 4 - win/gnome/gnbind.c | 7 +- win/gnome/gnstatus.c | 15 --- win/win32/mswproc.c | 4 - 58 files changed, 8 insertions(+), 1196 deletions(-) diff --git a/include/config.h b/include/config.h index c89f778e3..1af4b0560 100644 --- a/include/config.h +++ b/include/config.h @@ -443,7 +443,6 @@ typedef unsigned char uchar; * bugs left here. */ -/*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */ #define STATUS_VIA_WINDOWPORT /* re-work of the status line updating process */ #define STATUS_HILITES /* support hilites of status fields */ /* #define WINCHAIN*/ /* stacked window systems */ diff --git a/include/decl.h b/include/decl.h index ddc814f4d..1e882705f 100644 --- a/include/decl.h +++ b/include/decl.h @@ -180,9 +180,7 @@ E NEARDATA struct kinfo { char name[BUFSZ]; /* actual killer name */ } killer; -#ifdef GOLDOBJ E long done_money; -#endif E const char *configfile; E NEARDATA char plname[PL_NSIZ]; E NEARDATA char dogname[]; diff --git a/include/extern.h b/include/extern.h index fd4bc6520..492718730 100644 --- a/include/extern.h +++ b/include/extern.h @@ -803,9 +803,7 @@ E int FDECL(calc_capacity, (int)); E int NDECL(max_capacity); E boolean FDECL(check_capacity, (const char *)); E int FDECL(inv_cnt, (BOOLEAN_P)); -#ifdef GOLDOBJ E long FDECL(money_cnt, (struct obj *)); -#endif /* ### hacklib.c ### */ @@ -900,11 +898,6 @@ E boolean FDECL(obj_here, (struct obj *,int,int)); E boolean NDECL(wearing_armor); E boolean FDECL(is_worn, (struct obj *)); E struct obj *FDECL(g_at, (int,int)); -#ifndef GOLDOBJ -E struct obj *FDECL(mkgoldobj, (long)); -E struct obj *FDECL(insert_gold_into_invent, (BOOLEAN_P)); -E void NDECL(remove_gold_from_invent); -#endif E struct obj *FDECL(getobj, (const char *,const char *)); E int FDECL(ggetobj, (const char *,int (*)(OBJ_P),int,BOOLEAN_P,unsigned *)); E int FDECL(askchain, (struct obj **,const char *,int,int (*)(OBJ_P), @@ -1076,9 +1069,7 @@ E void FDECL(freemcorpsenm, (struct monst *)); E void FDECL(set_mimic_sym, (struct monst *)); E int FDECL(mbirth_limit, (int)); E void FDECL(mimic_hit_msg, (struct monst *, SHORT_P)); -#ifdef GOLDOBJ E void FDECL(mkmonmoney, (struct monst *, long)); -#endif E int FDECL(bagotricks, (struct obj *,BOOLEAN_P,int *)); E boolean FDECL(propagate, (int, BOOLEAN_P,BOOLEAN_P)); E boolean FDECL(usmellmon, (struct permonst *)); @@ -1679,13 +1670,8 @@ E void NDECL(getlock); /* ### pickup.c ### */ -#ifdef GOLDOBJ E int FDECL(collect_obj_classes, (char *,struct obj *,BOOLEAN_P,boolean FDECL((*),(OBJ_P)), int *)); -#else -E int FDECL(collect_obj_classes, - (char *,struct obj *,BOOLEAN_P,BOOLEAN_P,boolean FDECL((*),(OBJ_P)), int *)); -#endif E boolean FDECL(rider_corpse_revival, (struct obj *,BOOLEAN_P)); E void FDECL(add_valid_menu_class, (int)); E boolean FDECL(allow_all, (struct obj *)); @@ -1926,9 +1912,6 @@ E int FDECL(validate, (int,const char *)); E void NDECL(reset_restpref); E void FDECL(set_restpref, (const char *)); E void FDECL(set_savepref, (const char *)); -#ifndef GOLDOBJ -E void FDECL(put_gold_back, (struct monst *)); -#endif /* ### rip.c ### */ @@ -2019,10 +2002,8 @@ E void FDECL(store_savefileinfo, (int)); /* ### shk.c ### */ -#ifdef GOLDOBJ E long FDECL(money2mon, (struct monst *, long)); E void FDECL(money2u, (struct monst *, long)); -#endif E void FDECL(shkgone, (struct monst *)); E void FDECL(set_residency, (struct monst *,BOOLEAN_P)); E void FDECL(replshk, (struct monst *,struct monst *)); @@ -2155,11 +2136,7 @@ E void FDECL(initialspell, (struct obj *)); #ifdef USE_TRAMPOLI E int NDECL(stealarm); #endif -#ifdef GOLDOBJ E long FDECL(somegold, (long)); -#else -E long NDECL(somegold); -#endif E void FDECL(stealgold, (struct monst *)); E void FDECL(remove_worn_item, (struct obj *,BOOLEAN_P)); E int FDECL(steal, (struct monst *, char *)); @@ -2169,9 +2146,7 @@ E void FDECL(maybe_absorb_item, (struct monst *,struct obj *,int,int)); E void FDECL(mdrop_obj, (struct monst *,struct obj *,BOOLEAN_P)); E void FDECL(mdrop_special_objs, (struct monst *)); E void FDECL(relobj, (struct monst *,int,BOOLEAN_P)); -#ifdef GOLDOBJ E struct obj *FDECL(findgold, (struct obj *)); -#endif /* ### steed.c ### */ diff --git a/include/monst.h b/include/monst.h index c451d374f..39e62f3e4 100644 --- a/include/monst.h +++ b/include/monst.h @@ -135,9 +135,6 @@ struct monst { long mtrapseen; /* bitmap of traps we've been trapped in */ long mlstmv; /* for catching up with lost time */ long mspare1; -#ifndef GOLDOBJ -#define mgold mspare1 -#endif struct obj *minvent; struct obj *mw; diff --git a/include/you.h b/include/you.h index c010abcb0..0c343b3c4 100644 --- a/include/you.h +++ b/include/you.h @@ -339,10 +339,6 @@ struct you { int ublessed, ublesscnt; /* blessing/duration from #pray */ long umoney0; long uspare1; -#ifndef GOLDOBJ -#define ugold uspare1 -#define ugold0 umoney0 -#endif long uexp, urexp; long ucleansed; /* to record moves when player was cleansed */ long usleep; /* sleeping; monstermove you last started */ diff --git a/src/apply.c b/src/apply.c index 1ab6153df..e92e6199f 100644 --- a/src/apply.c +++ b/src/apply.c @@ -2026,9 +2026,6 @@ struct obj *tstone; static const char scritch[] = "\"scritch, scritch\""; static const char allowall[3] = { COIN_CLASS, ALL_CLASSES, 0 }; static const char coins_gems[3] = { COIN_CLASS, GEM_CLASS, 0 }; -#ifndef GOLDOBJ - struct obj goldobj; -#endif /* in case it was acquired while blinded */ if (!Blind) tstone->dknown = 1; @@ -2039,17 +2036,6 @@ struct obj *tstone; Sprintf(stonebuf, "rub on the stone%s", plur(tstone->quan)); if ((obj = getobj(choices, stonebuf)) == 0) return; -#ifndef GOLDOBJ - if (obj->oclass == COIN_CLASS) { - u.ugold += obj->quan; /* keep botl up to date */ - goldobj = *obj; - goldobj.oextra = (struct oextra *)0; /* dealloc_obj(obj) will invalidate - the target of this copied ptr - here, so clear it out */ - dealloc_obj(obj); - obj = &goldobj; - } -#endif if (obj == tstone && obj->quan == 1L) { You_cant("rub %s on itself.", the(xname(obj))); @@ -2066,9 +2052,6 @@ struct obj *tstone; else pline("A sharp crack shatters %s%s.", (obj->quan > 1L) ? "one of " : "", the(xname(obj))); -#ifndef GOLDOBJ - /* assert(obj != &goldobj); */ -#endif useup(obj); return; } diff --git a/src/bones.c b/src/bones.c index 5607355ee..66a4d43f5 100644 --- a/src/bones.c +++ b/src/bones.c @@ -229,16 +229,6 @@ int x, y; else place_object(otmp, x, y); } -#ifndef GOLDOBJ - if(u.ugold) { - long ugold = u.ugold; - - if (mtmp) mtmp->mgold = ugold; - else if (cont) (void) add_to_container(cont, mkgoldobj(ugold)); - else (void)mkgold(ugold, x, y); - u.ugold = ugold; /* undo mkgoldobj()'s removal */ - } -#endif if (cont) cont->owt = weight(cont); } diff --git a/src/botl.c b/src/botl.c index 59c6078ac..ab02ae35b 100644 --- a/src/botl.c +++ b/src/botl.c @@ -159,13 +159,8 @@ botl_score() long deepest = deepest_lev_reached(FALSE); long utotal; -#ifndef GOLDOBJ - utotal = u.ugold + hidden_gold(); - if ((utotal -= u.ugold0) < 0L) utotal = 0L; -#else utotal = money_cnt(invent) + hidden_gold(); if ((utotal -= u.umoney0) < 0L) utotal = 0L; -#endif utotal += u.urexp + (50 * (deepest - 1)) + (deepest > 30 ? 10000 : deepest > 20 ? 1000*(deepest - 20) : 0); if (utotal < u.urexp) utotal = LONG_MAX; /* wrap around */ @@ -268,11 +263,7 @@ bot2() Sprintf(nb = eos(newbot2), "%s:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", encglyph(objnum_to_glyph(GOLD_PIECE)), -#ifndef GOLDOBJ - u.ugold, -#else money_cnt(invent), -#endif hp, hpmax, u.uen, u.uenmax, u.uac); if (Upolyd) @@ -709,12 +700,7 @@ bot() /* Gold */ - blstats[idx][BL_GOLD].a.a_long = -#ifndef GOLDOBJ - u.ugold; -#else - money_cnt(invent); -#endif + blstats[idx][BL_GOLD].a.a_long = money_cnt(invent); /* * The tty port needs to display the current symbol for gold * as a field header, so to accomodate that we pass gold with diff --git a/src/decl.c b/src/decl.c index d4892f9d4..47043d0cd 100644 --- a/src/decl.c +++ b/src/decl.c @@ -49,9 +49,7 @@ NEARDATA int doorindex = 0; NEARDATA char *save_cm = 0; NEARDATA struct kinfo killer = DUMMY; -#ifdef GOLDOBJ NEARDATA long done_money = 0; -#endif const char *nomovemsg = 0; NEARDATA char plname[PL_NSIZ] = DUMMY; /* player name */ NEARDATA char pl_character[PL_CSIZ] = DUMMY; diff --git a/src/detect.c b/src/detect.c index 93db6c77c..ecc4d3878 100644 --- a/src/detect.c +++ b/src/detect.c @@ -91,12 +91,7 @@ unsigned material; /* there's some object shown here */ if (oclass == ALL_CLASSES) { return((boolean)( !(level.objects[x][y] || /* stale if nothing here */ - ((mtmp = m_at(x,y)) != 0 && - ( -#ifndef GOLDOBJ - mtmp->mgold || -#endif - mtmp->minvent))))); + ((mtmp = m_at(x,y)) != 0 && ( mtmp->minvent))))); } else { if (material && objects[glyph_to_obj(glyph)].oc_material == material) { /* the object shown here is of interest because material matches */ @@ -115,19 +110,10 @@ unsigned material; for (otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere) if (o_in(otmp, oclass)) return FALSE; /* didn't find it; perhaps a monster is carrying it */ -#ifndef GOLDOBJ - if ((mtmp = m_at(x,y)) != 0) { - if (oclass == COIN_CLASS && mtmp->mgold) - return FALSE; - else for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) - if (o_in(otmp, oclass)) return FALSE; - } -#else if ((mtmp = m_at(x,y)) != 0) { for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) if (o_in(otmp, oclass)) return FALSE; } -#endif /* detection indicates removal of this object from the map */ return TRUE; } @@ -176,11 +162,7 @@ register struct obj *sobj; /* look for gold carried by monsters (might be in a container) */ for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (DEADMONSTER(mtmp)) continue; /* probably not needed in this case but... */ -#ifndef GOLDOBJ - if (mtmp->mgold || monsndx(mtmp->data) == PM_GOLD_GOLEM) { -#else if (findgold(mtmp->minvent) || monsndx(mtmp->data) == PM_GOLD_GOLEM) { -#endif known = TRUE; goto outgoldmap; /* skip further searching */ } else for (obj = mtmp->minvent; obj; obj = obj->nobj) @@ -212,12 +194,7 @@ register struct obj *sobj; if (youmonst.data == &mons[PM_GOLD_GOLEM]) { Sprintf(buf, "You feel like a million %s!", currency(2L)); - } else if (hidden_gold() || -#ifndef GOLDOBJ - u.ugold) -#else - money_cnt(invent)) -#endif + } else if (hidden_gold() || money_cnt(invent)) Strcpy(buf, "You feel worried about your future financial situation."); else @@ -254,11 +231,7 @@ outgoldmap: } for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (DEADMONSTER(mtmp)) continue; /* probably overkill here */ -#ifndef GOLDOBJ - if (mtmp->mgold || monsndx(mtmp->data) == PM_GOLD_GOLEM) { -#else if (findgold(mtmp->minvent) || monsndx(mtmp->data) == PM_GOLD_GOLEM) { -#endif struct obj gold; gold = zeroobj; /* ensure oextra is cleared too */ gold.otyp = GOLD_PIECE; @@ -460,11 +433,7 @@ int class; /* an object class, 0 for all */ } if ((is_cursed && mtmp->m_ap_type == M_AP_OBJECT && (!class || class == objects[mtmp->mappearance].oc_class)) || -#ifndef GOLDOBJ - (mtmp->mgold && (!class || class == COIN_CLASS))) { -#else (findgold(mtmp->minvent) && (!class || class == COIN_CLASS))) { -#endif ct++; break; } @@ -546,11 +515,7 @@ int class; /* an object class, 0 for all */ temp.oy = mtmp->my; temp.corpsenm = PM_TENGU; /* if mimicing a corpse */ map_object(&temp, 1); -#ifndef GOLDOBJ - } else if (mtmp->mgold && (!class || class == COIN_CLASS)) { -#else } else if (findgold(mtmp->minvent) && (!class || class == COIN_CLASS)) { -#endif struct obj gold; gold = zeroobj; /* ensure oextra is cleared too */ gold.otyp = GOLD_PIECE; diff --git a/src/do.c b/src/do.c index c225000ef..981981293 100644 --- a/src/do.c +++ b/src/do.c @@ -28,11 +28,7 @@ static NEARDATA const char drop_types[] = int dodrop() { -#ifndef GOLDOBJ - int result, i = (invent || u.ugold) ? 0 : (SIZE(drop_types) - 1); -#else int result, i = (invent) ? 0 : (SIZE(drop_types) - 1); -#endif if (*u.ushops) sellobj_state(SELL_DELIBERATE); result = drop(getobj(&drop_types[i], "drop")); @@ -484,13 +480,9 @@ register struct obj *obj; if (levhack) ELevitation = W_ART; /* other than W_ARTI */ if(flags.verbose) You("drop %s.", doname(obj)); -#ifndef GOLDOBJ - if (obj->oclass != COIN_CLASS || obj == invent) freeinv(obj); -#else /* Ensure update when we drop gold objects */ if (obj->oclass == COIN_CLASS) context.botl = 1; freeinv(obj); -#endif hitfloor(obj); if (levhack) float_down(I_SPECIAL|TIMEOUT, W_ARTI|W_ART); return(1); @@ -509,13 +501,9 @@ void dropx(obj) register struct obj *obj; { -#ifndef GOLDOBJ - if (obj->oclass != COIN_CLASS || obj == invent) freeinv(obj); -#else /* Ensure update when we drop gold objects */ if (obj->oclass == COIN_CLASS) context.botl = 1; freeinv(obj); -#endif if (!u.uswallow) { if (ship_object(obj, u.ux, u.uy, FALSE)) return; if (IS_ALTAR(levl[u.ux][u.uy].typ)) @@ -653,17 +641,10 @@ int retry; int n, i, n_dropped = 0; long cnt; struct obj *otmp, *otmp2; -#ifndef GOLDOBJ - struct obj *u_gold = 0; -#endif menu_item *pick_list; boolean all_categories = TRUE; boolean drop_everything = FALSE; -#ifndef GOLDOBJ - /* put gold where inventory traversal will see it */ - if (u.ugold) u_gold = insert_gold_into_invent(TRUE); -#endif if (retry) { all_categories = (retry == -2); } else if (flags.menu_style == MENU_FULL) { @@ -749,11 +730,6 @@ int retry; /* same kludge as getobj(), for canletgo()'s use */ otmp->corpsenm = (int) cnt; /* don't split */ } else { -#ifndef GOLDOBJ - if (otmp->oclass == COIN_CLASS) - (void) splitobj(otmp, otmp->quan - cnt); - else -#endif otmp = splitobj(otmp, cnt); } } @@ -765,10 +741,6 @@ int retry; } drop_done: -#ifndef GOLDOBJ - /* if we put gold into inventory above, take it back out now */ - if (u_gold) remove_gold_from_invent(); -#endif return n_dropped; } diff --git a/src/dog.c b/src/dog.c index fa9d1f99a..ff7dd525d 100644 --- a/src/dog.c +++ b/src/dog.c @@ -443,15 +443,6 @@ boolean with_you; } corpse = mkcorpstat(CORPSE, (struct monst *)0, mtmp->data, xlocale, ylocale, CORPSTAT_NONE); -#ifndef GOLDOBJ - if (mtmp->mgold) { - if (xlocale == 0 && ylocale == 0 && corpse) { - (void) get_obj_location(corpse, &xlocale, &ylocale, 0); - (void) mkgold(mtmp->mgold, xlocale, ylocale); - } - mtmp->mgold = 0L; - } -#endif mongone(mtmp); } } diff --git a/src/dogmove.c b/src/dogmove.c index 4300fb8de..0b6e7a6f8 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -26,9 +26,6 @@ struct monst *mon; struct obj *obj, *wep, dummy, *pickaxe, *unihorn, *key; -#ifndef GOLDOBJ - if (mon->mgold) return &zeroobj; /* pet has something to drop */ -#endif dummy = zeroobj; dummy.otyp = GOLD_PIECE; /* not STRANGE_OBJECT or tools of interest */ dummy.oartifact = 1; /* so real artifact won't override "don't keep it" */ diff --git a/src/dokick.c b/src/dokick.c index fb81ab5c4..b17379e07 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -322,11 +322,7 @@ register struct obj *gold; verbalize("Thank you for your contribution."); else verbalize("Thanks, scum!"); } else if (mtmp->isgd) { -#ifndef GOLDOBJ - umoney = u.ugold; -#else umoney = money_cnt(invent); -#endif /* Some of these are iffy, because a hostile guard won't become peaceful and resume leading hero out of the vault. If he did do that, player @@ -352,11 +348,7 @@ register struct obj *gold; goldreqd = 750L; if (goldreqd) { -#ifndef GOLDOBJ - umoney = u.ugold; -#else umoney = money_cnt(invent); -#endif if (value > goldreqd + (umoney + u.ulevel * rn2(5)) / ACURR(A_CHA)) mtmp->mpeaceful = TRUE; diff --git a/src/dothrow.c b/src/dothrow.c index 08e21d4f5..aedb4fc40 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -45,18 +45,6 @@ int shotlimit; boolean twoweap, weakmultishot; /* ask "in what direction?" */ -#ifndef GOLDOBJ - if (!getdir((char *)0)) { - if (obj->oclass == COIN_CLASS) { - u.ugold += obj->quan; - context.botl = 1; - dealloc_obj(obj); - } - return(0); - } - - if(obj->oclass == COIN_CLASS) return(throw_gold(obj)); -#else if (!getdir((char *)0)) { /* obj might need to be merged back into the singular gold object */ freeinv(obj); @@ -73,7 +61,6 @@ int shotlimit; possibly using a sling. */ if(obj->oclass == COIN_CLASS && obj != uquiver) return(throw_gold(obj)); -#endif if(!canletgo(obj,"throw")) return(0); @@ -1833,34 +1820,18 @@ throw_gold(obj) struct obj *obj; { int range, odx, ody; -#ifndef GOLDOBJ - long zorks = obj->quan; -#endif register struct monst *mon; if(!u.dx && !u.dy && !u.dz) { -#ifndef GOLDOBJ - u.ugold += obj->quan; - context.botl = 1; - dealloc_obj(obj); -#endif You("cannot throw gold at yourself."); return(0); } -#ifdef GOLDOBJ freeinv(obj); -#endif if(u.uswallow) { pline(is_animal(u.ustuck->data) ? "%s in the %s's entrails." : "%s into %s.", -#ifndef GOLDOBJ - "The gold disappears", mon_nam(u.ustuck)); - u.ustuck->mgold += zorks; - dealloc_obj(obj); -#else "The money disappears", mon_nam(u.ustuck)); add_to_minv(u.ustuck, obj); -#endif return(1); } diff --git a/src/eat.c b/src/eat.c index 196fb9e49..7259e6424 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1985,13 +1985,8 @@ eatspecial() /* called after eating non-food */ context.victual.o_id = 0; context.victual.eating = 0; if (otmp->oclass == COIN_CLASS) { -#ifdef GOLDOBJ if (carried(otmp)) useupall(otmp); -#else - if (otmp->where == OBJ_FREE) - dealloc_obj(otmp); -#endif else useupf(otmp, otmp->quan); vault_gd_watching(GD_EATGOLD); diff --git a/src/end.c b/src/end.c index c9fe47cb2..f7e7f5ec3 100644 --- a/src/end.c +++ b/src/end.c @@ -998,13 +998,8 @@ die: { int deepest = deepest_lev_reached(FALSE); -#ifndef GOLDOBJ - umoney = u.ugold; - tmp = u.ugold0; -#else umoney = money_cnt(invent); tmp = u.umoney0; -#endif umoney += hidden_gold(); /* accumulate gold from containers */ tmp = umoney - tmp; /* net gain */ @@ -1046,11 +1041,7 @@ die: /* update gold for the rip output, which can't use hidden_gold() (containers will be gone by then if bones just got saved...) */ -#ifndef GOLDOBJ - u.ugold = umoney; -#else done_money = umoney; -#endif /* clean up unneeded windows */ if (have_windows) { diff --git a/src/fountain.c b/src/fountain.c index 764ffb5a3..f167c09d4 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -452,14 +452,6 @@ register struct obj *obj; break; case 28: /* Strange feeling */ pline("An urge to take a bath overwhelms you."); -#ifndef GOLDOBJ - if (u.ugold > 10) { - u.ugold -= somegold() / 10; - You("lost some of your gold in the fountain!"); - CLEAR_FOUNTAIN_LOOTED(u.ux,u.uy); - exercise(A_WIS, FALSE); - } -#else { long money = money_cnt(invent); struct obj *otmp; @@ -479,7 +471,6 @@ register struct obj *obj; exercise(A_WIS, FALSE); } } -#endif break; case 29: /* You see coins */ diff --git a/src/hack.c b/src/hack.c index 66e0962e6..fafff35b6 100644 --- a/src/hack.c +++ b/src/hack.c @@ -2540,22 +2540,10 @@ inv_weight() register struct obj *otmp = invent; register int wt = 0; -#ifndef GOLDOBJ - /* when putting stuff into containers, gold is inserted at the head - of invent for easier manipulation by askchain & co, but it's also - retained in u.ugold in order to keep the status line accurate; we - mustn't add its weight in twice under that circumstance */ - wt = (otmp && otmp->oclass == COIN_CLASS) ? 0 : - (int)((u.ugold + 50L) / 100L); -#endif while (otmp) { -#ifndef GOLDOBJ - if (otmp->otyp != BOULDER || !throws_rocks(youmonst.data)) -#else if (otmp->oclass == COIN_CLASS) wt += (int)(((long)otmp->quan + 50L) / 100L); else if (otmp->otyp != BOULDER || !throws_rocks(youmonst.data)) -#endif wt += otmp->owt; otmp = otmp->nobj; } @@ -2609,7 +2597,7 @@ const char *str; int inv_cnt(incl_gold) -boolean incl_gold; /* only meaningful for GOLDOBJ config */ +boolean incl_gold; { register struct obj *otmp = invent; register int ct = 0; @@ -2621,7 +2609,6 @@ boolean incl_gold; /* only meaningful for GOLDOBJ config */ return(ct); } -#ifdef GOLDOBJ /* Counts the money in an object chain. */ /* Intended use is for your or some monsters inventory, */ /* now that u.gold/m.gold is gone.*/ @@ -2637,6 +2624,5 @@ struct obj *otmp; } return 0L; } -#endif /* GOLDOBJ */ /*hack.c*/ diff --git a/src/invent.c b/src/invent.c index 5778135d9..7a7a83734 100644 --- a/src/invent.c +++ b/src/invent.c @@ -168,9 +168,7 @@ struct obj **potmp, **pobj; / (otmp->quan + obj->quan); otmp->quan += obj->quan; -#ifdef GOLDOBJ /* temporary special case for gold objects!!!! */ -#endif if (otmp->oclass == COIN_CLASS) otmp->owt = weight(otmp); else otmp->owt += obj->owt; if(!has_oname(otmp) && has_oname(obj)) @@ -238,11 +236,7 @@ addinv_core1(obj) struct obj *obj; { if (obj->oclass == COIN_CLASS) { -#ifndef GOLDOBJ - u.ugold += obj->quan; -#else context.botl = 1; -#endif } else if (obj->otyp == AMULET_OF_YENDOR) { if (u.uhave.amulet) impossible("already have amulet?"); u.uhave.amulet = 1; @@ -305,11 +299,6 @@ struct obj *obj; obj->was_thrown = 0; /* not meaningful for invent */ addinv_core1(obj); -#ifndef GOLDOBJ - /* if handed gold, we're done */ - if (obj->oclass == COIN_CLASS) - return obj; -#endif /* merge with quiver in preference to any other inventory slot in case quiver and wielded weapon are both eligible; adding @@ -488,10 +477,6 @@ freeinv_core(obj) struct obj *obj; { if (obj->oclass == COIN_CLASS) { -#ifndef GOLDOBJ - u.ugold -= obj->quan; - obj->in_use = FALSE; -#endif context.botl = 1; return; } else if (obj->otyp == AMULET_OF_YENDOR) { @@ -679,60 +664,6 @@ register int x, y; return((struct obj *)0); } -#ifndef GOLDOBJ -/* Make a gold object from the hero's gold. */ -struct obj * -mkgoldobj(q) -register long q; -{ - register struct obj *otmp; - - otmp = mksobj(GOLD_PIECE, FALSE, FALSE); - u.ugold -= q; - otmp->quan = q; - otmp->owt = weight(otmp); - context.botl = 1; - return(otmp); -} - -/* used for container apply/#loot and multi-item Drop */ -struct obj * -insert_gold_into_invent(keep_on_status_line) -boolean keep_on_status_line; -{ - struct obj *u_gold = 0; - - if (u.ugold) { - u_gold = mkgoldobj(u.ugold); - if (keep_on_status_line) { - u_gold->in_use = 1; /* in case of panic/hangup save */ - u.ugold = u_gold->quan; /* put back on status line */ - } /* else mkgoldobj() left status $:0 */ - assigninvlet(u_gold); /* should yield '$' */ - u_gold->where = OBJ_INVENT; - u_gold->nobj = invent; - invent = u_gold; - } - return u_gold; -} - -/* undo insert_gold_into_invent; gold might have been used up though */ -void -remove_gold_from_invent() -{ - struct obj *u_gold = invent; /* we expect gold to be first */ - - if (u_gold && u_gold->otyp != GOLD_PIECE) - u_gold = carrying(GOLD_PIECE); - - if (u_gold) { - extract_nobj(u_gold, &invent); - if (!u_gold->in_use) u.ugold += u_gold->quan; - dealloc_obj(u_gold); - } -} -#endif /* !GOLDOBJ */ - STATIC_OVL void compactify(buf) register char *buf; @@ -802,10 +733,8 @@ const char *action; * struct obj *xxx: object to do something with. * (struct obj *) 0 error return: no object. * &zeroobj explicitly no object (as in w-). -#ifdef GOLDOBJ !!!! test if gold can be used in unusual ways (eaten etc.) !!!! may be able to remove "usegold" -#endif */ struct obj * getobj(let,word) @@ -819,10 +748,6 @@ register const char *let,*word; register char *bp = buf; xchar allowcnt = 0; /* 0, 1 or 2 */ struct obj *firstobj = invent; -#ifndef GOLDOBJ - struct obj *u_gold = 0; - boolean allowgold = FALSE; /* can't use gold because they don't have any */ -#endif boolean usegold = FALSE; /* can't use gold because its illegal */ boolean allowall = FALSE; boolean allownone = FALSE; @@ -833,22 +758,13 @@ register const char *let,*word; long dummymask; if(*let == ALLOW_COUNT) let++, allowcnt = 1; -#ifndef GOLDOBJ - if(*let == COIN_CLASS) let++, - usegold = TRUE, allowgold = (u.ugold ? TRUE : FALSE); -#else if(*let == COIN_CLASS) let++, usegold = TRUE; -#endif /* Equivalent of an "ugly check" for gold */ if (usegold && !strcmp(word, "eat") && (!metallivorous(youmonst.data) || youmonst.data == &mons[PM_RUST_MONSTER])) -#ifndef GOLDOBJ - usegold = allowgold = FALSE; -#else usegold = FALSE; -#endif if(*let == ALL_CLASSES) let++, allowall = TRUE; if(*let == ALLOW_NONE) let++, allownone = TRUE; @@ -866,17 +782,6 @@ register const char *let,*word; useboulder = TRUE; if(allownone) *bp++ = '-'; -#ifndef GOLDOBJ - if(allowgold) { - *bp++ = def_oc_syms[COIN_CLASS].sym; - if (firstobj && firstobj->otyp == GOLD_PIECE) { - /* gold has been inserted into inventory; skip it during - inventory letter collection */ - u_gold = firstobj; - firstobj = u_gold->nobj; - } - } -#endif if(bp > buf && bp[-1] == '-') *bp++ = ' '; ap = altlets; @@ -891,9 +796,7 @@ register const char *let,*word; } if (!*let || index(let, otmp->oclass) -#ifdef GOLDOBJ || (usegold && otmp->invlet == GOLD_SYM) -#endif || (useboulder && otmp->otyp == BOULDER) ) { register int otyp = otmp->otyp; @@ -1010,11 +913,7 @@ register const char *let,*word; compactify(bp); *ap = '\0'; -#ifndef GOLDOBJ - if(!foo && !allowall && !allowgold && !allownone) { -#else if(!foo && !allowall && !allownone) { -#endif You("don't have anything %sto %s.", foox ? "else " : "", word); return((struct obj *)0); @@ -1070,11 +969,6 @@ register const char *let,*word; if (!usegold) { You("cannot %s gold.", word); return(struct obj *)0; -#ifndef GOLDOBJ - } else if (!allowgold) { - You("are not carrying any gold."); - return(struct obj *)0; -#endif } /* Historic note: early Nethack had a bug which was * first reported for Larn, where trying to drop 2^32-n @@ -1089,15 +983,6 @@ register const char *let,*word; return (struct obj *)0; } -#ifndef GOLDOBJ - if(!(allowcnt == 2 && cnt < u.ugold)) - cnt = u.ugold; - if (!u_gold) - u_gold = mkgoldobj(cnt); - else if (cnt < u_gold->quan) - u_gold = splitobj(u_gold, cnt); - return u_gold; -#endif } if(ilet == '?' || ilet == '*') { char *allowed_choices = (ilet == '?') ? lets : (char *)0; @@ -1124,9 +1009,7 @@ register const char *let,*word; /* permit counts for throwing gold, but don't accept * counts for other things since the throw code will * split off a single item anyway */ -#ifdef GOLDOBJ if (ilet != def_oc_syms[COIN_CLASS].sym) -#endif allowcnt = 1; if(cnt == 0 && prezero) return((struct obj *)0); if(cnt > 1) { @@ -1134,9 +1017,7 @@ register const char *let,*word; continue; } } -#ifdef GOLDOBJ context.botl = 1; /* May have changed the amount of money */ -#endif #ifdef REDO savech(ilet); #endif @@ -1159,9 +1040,7 @@ register const char *let,*word; break; } if(!allowall && let && !index(let,otmp->oclass) -#ifdef GOLDOBJ && !(usegold && otmp->oclass == COIN_CLASS) -#endif ) { silly_thing(word, otmp); return((struct obj *)0); @@ -1289,25 +1168,14 @@ unsigned *resultflags; boolean FDECL((*filter),(OBJ_P)) = (boolean FDECL((*),(OBJ_P))) 0; boolean takeoff, ident, allflag, m_seen; int itemcount; -#ifndef GOLDOBJ - int oletct, iletct, allowgold, unpaid, oc_of_sym; -#else int oletct, iletct, unpaid, oc_of_sym; -#endif char sym, *ip, olets[MAXOCLASSES+5], ilets[MAXOCLASSES+5]; char extra_removeables[3+1]; /* uwep,uswapwep,uquiver */ char buf[BUFSZ], qbuf[QBUFSZ]; if (resultflags) *resultflags = 0; -#ifndef GOLDOBJ - allowgold = (u.ugold && !strcmp(word, "drop")) ? 1 : 0; -#endif takeoff = ident = allflag = m_seen = FALSE; -#ifndef GOLDOBJ - if(!invent && !allowgold){ -#else if(!invent){ -#endif You("have nothing to %s.", word); return(0); } @@ -1322,9 +1190,6 @@ unsigned *resultflags; iletct = collect_obj_classes(ilets, invent, FALSE, -#ifndef GOLDOBJ - (allowgold != 0), -#endif filter, &itemcount); unpaid = count_unpaid(invent); @@ -1397,15 +1262,7 @@ unsigned *resultflags; } if (oc_of_sym == COIN_CLASS && !combo) { -#ifndef GOLDOBJ - if (allowgold == 1) - (*fn)(mkgoldobj(u.ugold)); - else if (!u.ugold) - You("have no gold."); - allowgold = 2; -#else context.botl = 1; -#endif } else if (sym == 'a') { allflag = TRUE; } else if (sym == 'A') { @@ -1442,16 +1299,10 @@ unsigned *resultflags; return (allflag || (!oletct && ckfn != ckunpaid)) ? -2 : -3; else if (flags.menu_style != MENU_TRADITIONAL && combo && !allflag) return 0; -#ifndef GOLDOBJ - else if (allowgold == 2 && !oletct) - return 1; /* you dropped gold (or at least tried to) */ - else { -#else else /*!!!! if (allowgold == 2 && !oletct) !!!! return 1; you dropped gold (or at least tried to) !!!! test gold dropping else*/ { -#endif int cnt = askchain(&invent, olets, allflag, fn, ckfn, mx, word); /* * askchain() has already finished the job in this case @@ -1728,10 +1579,6 @@ STATIC_OVL char obj_to_let(obj) /* should of course only be called for things in invent */ register struct obj *obj; { -#ifndef GOLDOBJ - if (obj->oclass == COIN_CLASS) - return GOLD_SYM; -#endif if (!flags.invlet_constant) { obj->invlet = NOINVSYM; reassign(); @@ -1787,11 +1634,6 @@ long quan; /* if non-0, print this quantity, not obj->quan */ Sprintf(li, "%c - %-45s %6ld %s", (dot && use_invlet ? obj->invlet : let), (txt ? txt : doname(obj)), cost, currency(cost)); -#ifndef GOLDOBJ - } else if (obj && obj->oclass == COIN_CLASS) { - Sprintf(li, "%ld gold piece%s%s", obj->quan, plur(obj->quan), - (dot ? "." : "")); -#endif } else { /* ordinary inventory display or pickup message */ Sprintf(li, "%c - %s%s", @@ -1885,11 +1727,7 @@ long* out_cnt; to here is short circuited away. */ if (!invent && !(flags.perm_invent && !lets && !want_reply)) { -#ifndef GOLDOBJ - pline("Not carrying anything%s.", u.ugold ? " except gold" : ""); -#else pline("Not carrying anything."); -#endif return 0; } @@ -2219,11 +2057,7 @@ dotypeinv() boolean traditional = TRUE; const char *prompt = "What type of object do you want an inventory of?"; -#ifndef GOLDOBJ - if (!invent && !u.ugold && !billx) { -#else if (!invent && !billx) { -#endif You("aren't carrying anything."); return 0; } @@ -2245,9 +2079,6 @@ dotypeinv() types[0] = 0; class_count = collect_obj_classes(types, invent, FALSE, -#ifndef GOLDOBJ - (u.ugold != 0), -#endif (boolean FDECL((*),(OBJ_P))) 0, &itemcount); if (unpaid_count) { Strcat(types, "u"); @@ -2592,10 +2423,8 @@ mergable(otmp, obj) /* returns TRUE if obj & otmp can be merged */ { int objnamelth = 0, otmpnamelth = 0; if (obj->otyp != otmp->otyp) return FALSE; -#ifdef GOLDOBJ /* coins of the same kind will always merge */ if (obj->oclass == COIN_CLASS) return TRUE; -#endif if (obj->unpaid != otmp->unpaid || obj->spe != otmp->spe || obj->dknown != otmp->dknown || (obj->bknown != otmp->bknown && !Role_if(PM_PRIEST)) || @@ -2676,18 +2505,11 @@ doprgold() { /* the messages used to refer to "carrying gold", but that didn't take containers into account */ -#ifndef GOLDOBJ - if(!u.ugold) - Your("wallet is empty."); - else - Your("wallet contains %ld gold piece%s.", u.ugold, plur(u.ugold)); -#else long umoney = money_cnt(invent); if(!umoney) Your("wallet is empty."); else Your("wallet contains %ld %s.", umoney, currency(umoney)); -#endif shopper_financial_report(); return 0; } @@ -2915,17 +2737,13 @@ reassign() register struct obj *obj; for(obj = invent, i = 0; obj; obj = obj->nobj, i++) { -#ifdef GOLDOBJ if (obj->oclass == COIN_CLASS && obj->invlet == GOLD_SYM) --i; /* keep $ instead of using up i'th letter */ else -#endif if (i < 52) obj->invlet = (i < 26) ? ('a'+i) : ('A'+i-26); -#ifdef GOLDOBJ else if (obj->oclass == COIN_CLASS) obj->invlet = GOLD_SYM; -#endif else obj->invlet = NOINVSYM; } @@ -2969,7 +2787,6 @@ doorganize() /* inventory organizer by Del Lamb */ const char *adj_type; if (!invent) { - /* (we don't need any !GOLDOBJ check for "except gold" here) */ You("aren't carrying anything to adjust."); return 0; } @@ -3178,20 +2995,12 @@ int dflags; char *title; { struct obj *ret; -#ifndef GOLDOBJ - struct obj m_gold; -#endif char tmp[QBUFSZ]; int n; menu_item *selected = 0; int do_all = (dflags & MINV_ALL) != 0, incl_hero = (do_all && u.uswallow && mon == u.ustuck), -#ifndef GOLDOBJ - do_gold = (do_all && mon->mgold), - have_inv = (mon->minvent || do_gold), -#else have_inv = (mon->minvent != 0), -#endif have_any = (have_inv || incl_hero); Sprintf(tmp,"%s %s:", s_suffix(noit_Monnam(mon)), @@ -3203,34 +3012,12 @@ char *title; */ youmonst.data = mon->data; -#ifndef GOLDOBJ - if (do_gold) { - /* - * Make temporary gold object and insert at the head of - * the mon's inventory. We can get away with using a - * stack variable object because monsters don't carry - * gold in their inventory, so it won't merge. - */ - m_gold = zeroobj; - m_gold.otyp = GOLD_PIECE; m_gold.oclass = COIN_CLASS; - m_gold.quan = mon->mgold; m_gold.dknown = 1; - m_gold.where = OBJ_FREE; - /* we had better not merge and free this object... */ - if (add_to_minv(mon, &m_gold)) - panic("display_minventory: static object freed."); - } - -#endif n = query_objlist(title ? title : tmp, mon->minvent, INVORDER_SORT | (incl_hero ? INCLUDE_HERO : 0), &selected, (dflags & MINV_NOLET) ? PICK_NONE : PICK_ONE, do_all ? allow_all : worn_wield_only); -#ifndef GOLDOBJ - if (do_gold) obj_extract_self(&m_gold); -#endif - set_uasmon(); } else { invdisp_nothing(title ? title : tmp, "(none)"); @@ -3240,14 +3027,6 @@ char *title; if (n > 0) { ret = selected[0].item.a_obj; free((genericptr_t)selected); -#ifndef GOLDOBJ - /* - * Unfortunately, we can't return a pointer to our temporary - * gold object. We'll have to work out a scheme where this - * can happen. Maybe even put gold in the inventory list... - */ - if (ret == &m_gold) ret = (struct obj *) 0; -#endif } else ret = (struct obj *) 0; return ret; diff --git a/src/makemon.c b/src/makemon.c index 0f2d0c41c..9b63c72ec 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -454,7 +454,6 @@ register struct monst *mtmp; (void) mongets(mtmp, rnd_offensive_item(mtmp)); } -#ifdef GOLDOBJ /* * Makes up money for monster's inventory. * This will change with silver & copper coins @@ -468,7 +467,6 @@ long amount; gold->quan = amount; add_to_minv(mtmp, gold); } -#endif STATIC_OVL void m_initinv(mtmp) @@ -555,11 +553,7 @@ register struct monst *mtmp; rn2(3) ? CLOAK_OF_PROTECTION : CLOAK_OF_MAGIC_RESISTANCE); (void) mongets(mtmp, SMALL_SHIELD); -#ifndef GOLDOBJ - mtmp->mgold = (long)rn1(10,20); -#else mkmonmoney(mtmp,(long)rn1(10,20)); -#endif } else if (quest_mon_represents_role(ptr,PM_MONK)) { (void) mongets(mtmp, rn2(11) ? ROBE : CLOAK_OF_MAGIC_RESISTANCE); @@ -613,11 +607,7 @@ register struct monst *mtmp; } break; case S_LEPRECHAUN: -#ifndef GOLDOBJ - mtmp->mgold = (long) d(level_difficulty(), 30); -#else mkmonmoney(mtmp, (long) d(level_difficulty(), 30)); -#endif break; case S_DEMON: /* moved here from m_initweap() because these don't @@ -640,14 +630,8 @@ register struct monst *mtmp; (void) mongets(mtmp, rnd_defensive_item(mtmp)); if ((int) mtmp->m_lev > rn2(100)) (void) mongets(mtmp, rnd_misc_item(mtmp)); -#ifndef GOLDOBJ - if (likes_gold(ptr) && !mtmp->mgold && !rn2(5)) - mtmp->mgold = - (long) d(level_difficulty(), mtmp->minvent ? 5 : 10); -#else if (likes_gold(ptr) && !findgold(mtmp->minvent) && !rn2(5)) mkmonmoney(mtmp, (long) d(level_difficulty(), mtmp->minvent ? 5 : 10)); -#endif } /* Note: for long worms, always call cutworm (cutworm calls clone_mon) */ @@ -691,9 +675,6 @@ xchar x, y; /* clone's preferred location or 0 (near mon) */ m2->mcloned = 1; m2->minvent = (struct obj *) 0; /* objects don't clone */ m2->mleashed = FALSE; -#ifndef GOLDOBJ - m2->mgold = 0L; -#endif /* Max HP the same, but current HP halved for both. The caller * might want to override this by halving the max HP also. * When current HP is odd, the original keeps the extra point. diff --git a/src/mhitm.c b/src/mhitm.c index a749cfd4d..0e8bf7d1c 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1050,14 +1050,6 @@ mdamagem(magr, mdef, mattk) break; case AD_SGLD: tmp = 0; -#ifndef GOLDOBJ - if (magr->mcan || !mdef->mgold) break; - /* technically incorrect; no check for stealing gold from - * between mdef's feet... - */ - magr->mgold += mdef->mgold; - mdef->mgold = 0; -#else if (magr->mcan) break; /* technically incorrect; no check for stealing gold from * between mdef's feet... @@ -1068,7 +1060,6 @@ mdamagem(magr, mdef, mattk) obj_extract_self(gold); add_to_minv(magr, gold); } -#endif mdef->mstrategy &= ~STRAT_WAITFORU; if (vis) { Strcpy(buf, Monnam(magr)); diff --git a/src/mhitu.c b/src/mhitu.c index ad68b2d31..511513f39 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -2430,27 +2430,6 @@ register struct monst *mon; pline("%s tries to take your money, but fails...", noit_Monnam(mon)); else { -#ifndef GOLDOBJ - long cost; - - if (u.ugold > (long)LARGEST_INT - 10L) - cost = (long) rnd(LARGEST_INT) + 500L; - else - cost = (long) rnd((int)u.ugold + 10) + 500L; - if (mon->mpeaceful) { - cost /= 5L; - if (!cost) cost = 1L; - } - if (cost > u.ugold) cost = u.ugold; - if (!cost) verbalize("It's on the house!"); - else { - pline("%s takes %ld %s for services rendered!", - noit_Monnam(mon), cost, currency(cost)); - u.ugold -= cost; - mon->mgold += cost; - context.botl = 1; - } -#else long cost; long umoney = money_cnt(invent); @@ -2470,7 +2449,6 @@ register struct monst *mon; money2mon(mon, cost); context.botl = 1; } -#endif } if (!rn2(25)) mon->mcan = 1; /* monster is worn out */ if (!tele_restrict(mon)) (void) rloc(mon, FALSE); diff --git a/src/minion.c b/src/minion.c index f70b426b7..814bb21b5 100644 --- a/src/minion.c +++ b/src/minion.c @@ -236,11 +236,7 @@ register struct monst *mtmp; if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE); return(1); } -#ifndef GOLDOBJ - cash = u.ugold; -#else cash = money_cnt(invent); -#endif demand = (cash * (rnd(80) + 20 * Athome)) / (100 * (1 + (sgn(u.ualign.type) == sgn(mtmp->data->maligntyp)))); @@ -281,9 +277,7 @@ struct monst *mtmp; { char buf[BUFSZ]; long offer; -#ifdef GOLDOBJ long umoney = money_cnt(invent); -#endif getlin("How much will you offer?", buf); if (sscanf(buf, "%ld", &offer) != 1) offer = 0L; @@ -297,16 +291,6 @@ struct monst *mtmp; } else if (offer == 0L) { You("refuse."); return 0L; -#ifndef GOLDOBJ - } else if (offer >= u.ugold) { - You("give %s all your gold.", mon_nam(mtmp)); - offer = u.ugold; - } else { - You("give %s %ld %s.", mon_nam(mtmp), offer, currency(offer)); - } - u.ugold -= offer; - mtmp->mgold += offer; -#else } else if (offer >= umoney) { You("give %s all your gold.", mon_nam(mtmp)); offer = umoney; @@ -314,7 +298,6 @@ struct monst *mtmp; You("give %s %ld %s.", mon_nam(mtmp), offer, currency(offer)); } (void) money2mon(mtmp, offer); -#endif context.botl = 1; return(offer); } diff --git a/src/mkobj.c b/src/mkobj.c index 253fd1293..47b6668e7 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -1037,9 +1037,7 @@ register struct obj *otmp; { int old_light = 0; -#ifdef GOLDOBJ if (otmp->oclass == COIN_CLASS) return; -#endif if (otmp->lamplit) old_light = arti_light_radius(otmp); otmp->cursed = 0; otmp->blessed = 1; @@ -1074,9 +1072,7 @@ register struct obj *otmp; { int old_light = 0; -#ifdef GOLDOBJ if (otmp->oclass == COIN_CLASS) return; -#endif if (otmp->lamplit) old_light = arti_light_radius(otmp); otmp->blessed = 0; otmp->cursed = 1; @@ -1351,10 +1347,6 @@ struct monst *mtmp; mtmp2->data = (struct permonst *)0; mtmp2->minvent = (struct obj *)0; if (mtmp->mextra) copy_mextra(mtmp2, mtmp); -#ifndef GOLDOBJ - /* not a pointer but is discarded along with minvent */ - mtmp2->mgold = 0L; -#endif } return obj; } diff --git a/src/mon.c b/src/mon.c index d65eb1cf9..0de59cf8a 100644 --- a/src/mon.c +++ b/src/mon.c @@ -826,13 +826,8 @@ mpickgold(mtmp) if ((gold = g_at(mtmp->mx, mtmp->my)) != 0) { mat_idx = objects[gold->otyp].oc_material; -#ifndef GOLDOBJ - mtmp->mgold += gold->quan; - delobj(gold); -#else obj_extract_self(gold); add_to_minv(mtmp, gold); -#endif if (cansee(mtmp->mx, mtmp->my) ) { if (flags.verbose && !mtmp->isgd) pline("%s picks up some %s.", Monnam(mtmp), @@ -1731,9 +1726,6 @@ register struct monst *mdef; mdrop_special_objs(mdef); /* release rest of monster's inventory--it is removed from game */ discard_minvent(mdef); -#ifndef GOLDOBJ - mdef->mgold = 0L; -#endif m_detach(mdef, mdef->data); } @@ -1789,16 +1781,6 @@ register struct monst *mdef; oldminvent = obj->nobj; (void) add_to_container(otmp, obj); } -#ifndef GOLDOBJ - if (mdef->mgold) { - struct obj *au; - au = mksobj(GOLD_PIECE, FALSE, FALSE); - au->quan = mdef->mgold; - au->owt = weight(au); - (void) add_to_container(otmp, au); - mdef->mgold = 0; - } -#endif /* Archeologists should not break unique statues */ if (mdef->data->geno & G_UNIQ) otmp->spe = 1; diff --git a/src/monmove.c b/src/monmove.c index 490f7faa0..316018e52 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -477,13 +477,8 @@ toofar: if(!nearby || mtmp->mflee || scared || mtmp->mconf || mtmp->mstun || (mtmp->minvis && !rn2(3)) || -#ifndef GOLDOBJ - (mdat->mlet == S_LEPRECHAUN && - !u.ugold && (mtmp->mgold || rn2(2))) || -#else (mdat->mlet == S_LEPRECHAUN && !findgold(invent) && (findgold(mtmp->minvent) || rn2(2))) || -#endif (is_wanderer(mdat) && !rn2(4)) || (Conflict && !mtmp->iswiz) || (!mtmp->mcansee && !rn2(4)) || mtmp->mpeaceful) { /* Possibly cast an undirected spell if not attacking you */ @@ -765,9 +760,7 @@ not_special: if (mtmp->mconf || (u.uswallow && mtmp == u.ustuck)) appr = 0; else { -#ifdef GOLDOBJ struct obj *lepgold, *ygold; -#endif boolean should_see = (couldsee(omx, omy) && (levl[gx][gy].lit || !levl[omx][omy].lit) && @@ -783,12 +776,8 @@ not_special: appr = 0; if(monsndx(ptr) == PM_LEPRECHAUN && (appr == 1) && -#ifndef GOLDOBJ - (mtmp->mgold > u.ugold)) -#else ( (lepgold = findgold(mtmp->minvent)) && (lepgold->quan > ((ygold = findgold(invent)) ? ygold->quan : 0L)) )) -#endif appr = -1; if (!should_see && can_track(ptr)) { @@ -1320,9 +1309,7 @@ register struct monst *mtmp; { boolean notseen, gotu; register int disp, mx = mtmp->mux, my = mtmp->muy; -#ifdef GOLDOBJ long umoney = money_cnt(invent); -#endif /* * do cheapest and/or most likely tests first @@ -1340,13 +1327,7 @@ register struct monst *mtmp; if (notseen || Underwater) { /* Xorns can smell quantities of valuable metal like that in solid gold coins, treat as seen */ - if ((mtmp->data == &mons[PM_XORN]) && -#ifndef GOLDOBJ - u.ugold -#else - umoney -#endif - && !Underwater) + if ((mtmp->data == &mons[PM_XORN]) && umoney && !Underwater) disp = 0; else disp = 1; @@ -1433,22 +1414,14 @@ struct monst *mtmp; struct obj *chain, *obj; if (mtmp == &youmonst) { -#ifndef GOLDOBJ - if (u.ugold > 100L) return TRUE; -#endif chain = invent; } else { -#ifndef GOLDOBJ - if (mtmp->mgold > 100L) return TRUE; -#endif chain = mtmp->minvent; } for (obj = chain; obj; obj = obj->nobj) { int typ = obj->otyp; -#ifdef GOLDOBJ if (typ == COIN_CLASS && obj->quan > 100L) return TRUE; -#endif if (obj->oclass != GEM_CLASS && !(typ >= ARROW && typ <= BOOMERANG) && !(typ >= DAGGER && typ <= CRYSKNIFE) && diff --git a/src/mplayer.c b/src/mplayer.c index c2b7f23f8..e1cc0f812 100644 --- a/src/mplayer.c +++ b/src/mplayer.c @@ -260,11 +260,7 @@ register boolean special; (void)mongets(mtmp, rnd_class(DILITHIUM_CRYSTAL, JADE)); /* To get the gold "right" would mean a player can double his */ /* gold supply by killing one mplayer. Not good. */ -#ifndef GOLDOBJ - mtmp->mgold = rn2(1000); -#else mkmonmoney(mtmp, rn2(1000)); -#endif quan = rn2(10); while(quan--) (void) mpickobj(mtmp, mkobj(RANDOM_CLASS, FALSE)); diff --git a/src/objnam.c b/src/objnam.c index 824398123..321d7ff29 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -930,10 +930,8 @@ boolean not_fully_identified(otmp) register struct obj *otmp; { -#ifdef GOLDOBJ /* gold doesn't have any interesting attributes [yet?] */ if (otmp->oclass == COIN_CLASS) return FALSE; /* always fully ID'd */ -#endif /* check fundamental ID hallmarks first */ if (!otmp->known || !otmp->dknown || #ifdef MAIL @@ -2592,15 +2590,9 @@ struct obj *no_wish; !strcmpi(bp, "coin") || *bp == GOLD_SYM) { if (cnt > 5000 && !wizard) cnt = 5000; else if (cnt < 1) cnt = 1; -#ifndef GOLDOBJ - pline("%d gold piece%s.", cnt, plur(cnt)); - u.ugold += (long) cnt; - otmp = &zeroobj; /* readobjnam()'s return value for gold */ -#else otmp = mksobj(GOLD_PIECE, FALSE, FALSE); otmp->quan = (long) cnt; otmp->owt = weight(otmp); -#endif context.botl = 1; return otmp; } diff --git a/src/options.c b/src/options.c index 9083ae63e..dc8cbcfc2 100644 --- a/src/options.c +++ b/src/options.c @@ -909,12 +909,7 @@ char *op; char *sp, buf[BUFSZ]; num = 0; -#ifndef GOLDOBJ - if (!index(op, GOLD_SYM)) - buf[num++] = COIN_CLASS; -#else /* !!!! probably unnecessary with gold as normal inventory */ -#endif for (sp = op; *sp; sp++) { oc_sym = def_char_to_objclass(*sp); diff --git a/src/pickup.c b/src/pickup.c index bbc9a925d..30188e5f2 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -12,13 +12,8 @@ #define CONTAINED_SYM '>' /* from invent.c */ STATIC_DCL void FDECL(simple_look, (struct obj *,BOOLEAN_P)); -#ifndef GOLDOBJ -STATIC_DCL boolean FDECL(query_classes, (char *,boolean *,boolean *, - const char *,struct obj *,BOOLEAN_P,BOOLEAN_P,int *)); -#else STATIC_DCL boolean FDECL(query_classes, (char *,boolean *,boolean *, const char *,struct obj *,BOOLEAN_P,int *)); -#endif STATIC_DCL boolean FDECL(fatal_corpse_mistake, (struct obj *,BOOLEAN_P)); STATIC_DCL void FDECL(check_here, (BOOLEAN_P)); STATIC_DCL boolean FDECL(n_or_more, (struct obj *)); @@ -101,15 +96,6 @@ boolean here; /* flag for type of obj list linkage */ } } -#ifndef GOLDOBJ -int -collect_obj_classes(ilets, otmp, here, incl_gold, filter, itemcount) -char ilets[]; -register struct obj *otmp; -boolean here, incl_gold; -boolean FDECL((*filter),(OBJ_P)); -int *itemcount; -#else int collect_obj_classes(ilets, otmp, here, filter, itemcount) char ilets[]; @@ -117,16 +103,11 @@ register struct obj *otmp; boolean here; boolean FDECL((*filter),(OBJ_P)); int *itemcount; -#endif { register int iletct = 0; register char c; *itemcount = 0; -#ifndef GOLDOBJ - if (incl_gold) - ilets[iletct++] = def_oc_syms[COIN_CLASS].sym; -#endif ilets[iletct] = '\0'; /* terminate ilets so that index() will work */ while (otmp) { c = def_oc_syms[(int)otmp->oclass].sym; @@ -151,17 +132,6 @@ int *itemcount; * "?/a" or "a?/" or "/a?",&c picks all '?' even though no '/' * (ie, treated as if it had just been "?a"). */ -#ifndef GOLDOBJ -STATIC_OVL boolean -query_classes(oclasses, one_at_a_time, everything, action, objs, - here, incl_gold, menu_on_demand) -char oclasses[]; -boolean *one_at_a_time, *everything; -const char *action; -struct obj *objs; -boolean here, incl_gold; -int *menu_on_demand; -#else STATIC_OVL boolean query_classes(oclasses, one_at_a_time, everything, action, objs, here, menu_on_demand) @@ -171,7 +141,6 @@ const char *action; struct obj *objs; boolean here; int *menu_on_demand; -#endif { char ilets[20], inbuf[BUFSZ]; int iletct, oclassct; @@ -183,9 +152,6 @@ int *menu_on_demand; oclasses[oclassct = 0] = '\0'; *one_at_a_time = *everything = m_seen = FALSE; iletct = collect_obj_classes(ilets, objs, here, -#ifndef GOLDOBJ - incl_gold, -#endif (boolean FDECL((*),(OBJ_P))) 0, &itemcount); if (iletct == 0) { return FALSE; @@ -578,9 +544,6 @@ menu_pickup: if (!query_classes(oclasses, &selective, &all_of_a_type, "pick up", objchain, traverse_how == BY_NEXTHERE, -#ifndef GOLDOBJ - FALSE, -#endif &via_menu)) { if (!via_menu) return (0); n = query_objlist("Pick up what?", @@ -1096,11 +1059,7 @@ int *wt_before, *wt_after; savequan = obj->quan; saveowt = obj->owt; -#ifndef GOLDOBJ - umoney = u.ugold; -#else umoney = money_cnt(invent); -#endif iw = max_capacity(); if (count != savequan) { @@ -1324,53 +1283,6 @@ boolean telekinesis; /* not picking it up directly by hand */ return 0; } else if (obj->oartifact && !touch_artifact(obj,&youmonst)) { return 0; -#ifndef GOLDOBJ - } else if (obj->oclass == COIN_CLASS) { - /* Special consideration for gold pieces... */ - long iw = (long)max_capacity() - GOLD_WT(u.ugold); - long gold_capacity = GOLD_CAPACITY(iw, u.ugold); - const char *where = (obj->ox == u.ux && obj->oy == u.uy) ? - "here" : "there"; - - if (gold_capacity <= 0L) { - pline( - "There %s %ld gold piece%s %s, but you cannot carry any more.", - otense(obj, "are"), - obj->quan, plur(obj->quan), where); - return 0; - } else if (gold_capacity < count) { - You("can only %s %s of the %ld gold pieces lying %s.", - telekinesis ? "acquire" : "carry", - gold_capacity == 1L ? "one" : "some", obj->quan, where); - pline("%s %ld gold piece%s.", - nearloadmsg, gold_capacity, plur(gold_capacity)); - u.ugold += gold_capacity; - obj->quan -= gold_capacity; - costly_gold(obj->ox, obj->oy, gold_capacity); - } else { - u.ugold += count; - if (count == obj->quan) - /* costly_gold() can trigger --More-- prompt, so - take gold off map before messages in order to - prevent hangup save there from duplicating it */ - obj_extract_self(obj); /* remove from floor */ - else - obj->quan -= count; - if ((nearload = near_capacity()) != 0) - pline("%s %ld gold piece%s.", - nearload < MOD_ENCUMBER ? - moderateloadmsg : nearloadmsg, - count, plur(count)); - else - prinv((char *) 0, obj, count); - costly_gold(obj->ox, obj->oy, count); - if (obj->where == OBJ_FREE) - delobj(obj); - } - context.botl = 1; - if (context.run) nomul(0); - return 1; -#endif } else if (obj->otyp == CORPSE) { if (fatal_corpse_mistake(obj, telekinesis) || rider_corpse_revival(obj, telekinesis)) @@ -1395,10 +1307,8 @@ boolean telekinesis; /* not picking it up directly by hand */ if ((res = lift_object(obj, (struct obj *)0, &count, telekinesis)) <= 0) return res; -#ifdef GOLDOBJ /* Whats left of the special case for gold :-) */ if (obj->oclass == COIN_CLASS) context.botl = 1; -#endif if (obj->quan != count && obj->otyp != LOADSTONE) obj = splitobj(obj, count); @@ -1417,8 +1327,6 @@ boolean telekinesis; /* not picking it up directly by hand */ * and putting it in the hero's inventory. Take care of billing. Return a * pointer to the object where otmp ends up. This may be different * from otmp because of merging. - * - * Gold never reaches this routine unless GOLDOBJ is defined. */ struct obj * pick_obj(otmp) @@ -1703,12 +1611,6 @@ reverse_loot() return FALSE; } -#ifndef GOLDOBJ - if (u.ugold) { - contribution = ((long)rnd(5) * u.ugold + 4L) / 5L; - goldob = mkgoldobj(contribution); - } -#else /* find a money object to mess with */ for (goldob = invent; goldob; goldob = goldob->nobj) if (goldob->oclass == COIN_CLASS) { @@ -1717,7 +1619,6 @@ reverse_loot() goldob = splitobj(goldob, contribution); break; } -#endif if (!goldob) return FALSE; if (!IS_THRONE(levl[x][y].typ)) { @@ -1738,9 +1639,7 @@ reverse_loot() if (coffers) { verbalize("Thank you for your contribution to reduce the debt."); -#ifdef GOLDOBJ freeinv(goldob); -#endif (void)add_to_container(coffers, goldob); coffers->owt = weight(coffers); coffers->cknown = 0; @@ -1749,13 +1648,8 @@ reverse_loot() (void)boxlock(coffers, &boxdummy); } } else if ((mon = makemon(courtmon(), x, y, NO_MM_FLAGS)) != 0) { -#ifndef GOLDOBJ - mon->mgold += goldob->quan; - delobj(goldob); -#else freeinv(goldob); add_to_minv(mon, goldob); -#endif pline("The exchequer accepts your contribution."); } else { You("drop %s.", doname(goldob)); @@ -2048,9 +1942,6 @@ register struct obj *obj; otmp, count); if (is_gold) { -#ifndef GOLDOBJ - dealloc_obj(obj); -#endif bot(); /* update character's gold piece count immediately */ } return 1; @@ -2167,9 +2058,6 @@ struct obj **objp; int held; { struct obj *curr, *otmp, *obj = *objp; -#ifndef GOLDOBJ - struct obj *u_gold = (struct obj *)0; -#endif boolean quantum_cat, cursed_mbag, loot_out, loot_in, loot_in_first, stash_one, inokay, outokay, outmaybe; @@ -2233,9 +2121,6 @@ int held; } inokay = (invent != 0 && !(invent == current_container && !current_container->nobj)); -#ifndef GOLDOBJ - if (u.ugold) inokay = TRUE; -#endif outokay = Has_contents(current_container); if (!outokay) /* preformat the empty-container message */ Sprintf(emptymsg, "%s is %sempty.", @@ -2330,11 +2215,6 @@ int held; } } -#ifndef GOLDOBJ - /* if putting in, place gold where inventory traversal will see it */ - if ((loot_in || stash_one) && u.ugold) - u_gold = insert_gold_into_invent(TRUE); -#endif if ((loot_in || stash_one) && (!invent || (invent == current_container && !invent->nobj))) { You("don't have anything%s to %s.", @@ -2370,11 +2250,6 @@ int held; /* putting something in might have triggered magic bag explosion */ if (!current_container) loot_out = FALSE; -#ifndef GOLDOBJ - /* if we put gold into inventory above, take it back out now */ - if (u_gold) remove_gold_from_invent(); -#endif - /* out after in */ if (loot_out && loot_in_first) { if (!Has_contents(current_container)) { @@ -2432,9 +2307,6 @@ boolean put_in; if (query_classes(selection, &one_by_one, &allflag, action, *objlist, FALSE, -#ifndef GOLDOBJ - put_in ? (boolean)(u.ugold != 0L) : FALSE, -#endif &menu_on_request)) { if (askchain(objlist, (one_by_one ? (char *)0 : selection), allflag, actionfunc, checkfunc, 0, action)) diff --git a/src/priest.c b/src/priest.c index 5e3b2ea10..1ef7ea286 100644 --- a/src/priest.c +++ b/src/priest.c @@ -539,20 +539,6 @@ register struct monst *priest; priest->mpeaceful = 0; return; } -#ifndef GOLDOBJ - if(!u.ugold) { - if(coaligned && !strayed) { - if (priest->mgold > 0L) { - /* Note: two bits is actually 25 cents. Hmm. */ - pline("%s gives you %s for an ale.", Monnam(priest), - (priest->mgold == 1L) ? "one bit" : "two bits"); - if (priest->mgold > 1L) - u.ugold = 2L; - else - u.ugold = 1L; - priest->mgold -= u.ugold; - context.botl = 1; -#else if(!money_cnt(invent)) { if(coaligned && !strayed) { long pmoney = money_cnt(priest->minvent); @@ -561,7 +547,6 @@ register struct monst *priest; pline("%s gives you %s for an ale.", Monnam(priest), (pmoney == 1L) ? "one bit" : "two bits"); money2u(priest, pmoney > 1L ? 2 : 1); -#endif } else pline("%s preaches the virtues of poverty.", Monnam(priest)); exercise(A_WIS, TRUE); @@ -577,11 +562,7 @@ register struct monst *priest; verbalize("Thou shalt regret thine action!"); if(coaligned) adjalign(-1); } else if(offer < (u.ulevel * 200)) { -#ifndef GOLDOBJ - if(u.ugold > (offer * 2L)) verbalize("Cheapskate."); -#else if(money_cnt(invent) > (offer * 2L)) verbalize("Cheapskate."); -#endif else { verbalize("I thank thee for thy contribution."); /* give player some token */ @@ -589,11 +570,7 @@ register struct monst *priest; } } else if(offer < (u.ulevel * 400)) { verbalize("Thou art indeed a pious individual."); -#ifndef GOLDOBJ - if(u.ugold < (offer * 2L)) { -#else if(money_cnt(invent) < (offer * 2L)) { -#endif if (coaligned && u.ualign.record <= ALGN_SINNED) adjalign(1); verbalize("I bestow upon thee a blessing."); @@ -614,11 +591,7 @@ register struct monst *priest; } else u.ublessed++; } else { verbalize("Thy selfless generosity is deeply appreciated."); -#ifndef GOLDOBJ - if(u.ugold < (offer * 2L) && coaligned) { -#else if(money_cnt(invent) < (offer * 2L) && coaligned) { -#endif if(strayed && (moves - u.ucleansed) > 5000L) { u.ualign.record = 0; /* cleanse thee */ u.ucleansed = moves; diff --git a/src/read.c b/src/read.c index b60ffa66e..9be9f9390 100644 --- a/src/read.c +++ b/src/read.c @@ -992,10 +992,8 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */ } else { for (obj = invent; obj; obj = obj->nobj) { long wornmask; -#ifdef GOLDOBJ /* gold isn't subject to cursing and blessing */ if (obj->oclass == COIN_CLASS) continue; -#endif wornmask = (obj->owornmask & ~(W_BALL|W_ART|W_ARTI)); if (wornmask && !sblessed) { /* handle a couple of special cases; we don't diff --git a/src/restore.c b/src/restore.c index e888b4dcd..b4d4bb7fb 100644 --- a/src/restore.c +++ b/src/restore.c @@ -146,17 +146,6 @@ boolean quietly; for (otmp = invent; otmp; otmp = otmp2) { otmp2 = otmp->nobj; -#ifndef GOLDOBJ - if (otmp->oclass == COIN_CLASS) { - /* in_use gold is created by some menu operations */ - if (!otmp->in_use) { - impossible("inven_inuse: !in_use gold in inventory"); - } - extract_nobj(otmp, &invent); - otmp->in_use = FALSE; - dealloc_obj(otmp); - } else -#endif /* GOLDOBJ */ if (otmp->in_use) { if (!quietly) pline("Finishing off %s...", xname(otmp)); useup(otmp); @@ -441,9 +430,6 @@ boolean ghostly; /* restore monster back pointer */ for (obj = mtmp->minvent; obj; obj = obj->nobj) obj->ocarry = mtmp; -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - put_gold_back(mtmp); -#endif } if (mtmp->mw) { struct obj *obj; @@ -598,9 +584,6 @@ unsigned int *stuckid, *steedid; restore_timers(fd, RANGE_GLOBAL, FALSE, 0L); restore_light_sources(fd); invent = restobjchn(fd, FALSE, FALSE); -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - put_gold_back(&youmonst); -#endif /* tmp_bc only gets set here if the ball & chain were orphaned because you were swallowed; otherwise they will be on the floor or in your inventory */ @@ -1571,29 +1554,4 @@ register unsigned int len; } } -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ -/* used to make save & bones files be compatible with GOLDOBJ config; - takes all of the gold objects out of the invent or mtmp->minvent - chain and puts it into either u.ugold or mtmp->mgold */ -void -put_gold_back(mon) -struct monst *mon; -{ - struct obj *goldobj; - boolean is_hero = (mon == &youmonst); - - /* there could be two gold objects in invent if a hangup save was - performed while gold was in invent for Drop or container access */ - while ((goldobj = (is_hero ? carrying(GOLD_PIECE) : - m_carrying(mon, GOLD_PIECE))) != 0) { - extract_nobj(goldobj, is_hero ? &invent : &mon->minvent); - if (!goldobj->in_use) { - if (is_hero) u.ugold += goldobj->quan; - else mon->mgold += goldobj->quan; - } - dealloc_obj(goldobj); - } -} -#endif /*GOLDOBJ*/ - /*restore.c*/ diff --git a/src/rip.c b/src/rip.c index 526c56388..8b3d849a3 100644 --- a/src/rip.c +++ b/src/rip.c @@ -107,11 +107,7 @@ time_t when; center(NAME_LINE, buf); /* Put $ on stone */ -#ifndef GOLDOBJ - Sprintf(buf, "%ld Au", u.ugold); -#else Sprintf(buf, "%ld Au", done_money); -#endif buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */ center(GOLD_LINE, buf); diff --git a/src/rumors.c b/src/rumors.c index 7df89e8f4..081b81d8d 100644 --- a/src/rumors.c +++ b/src/rumors.c @@ -427,11 +427,7 @@ register struct monst *oracl; char qbuf[QBUFSZ]; multi = 0; -#ifndef GOLDOBJ - umoney = u.ugold; -#else umoney = money_cnt(invent); -#endif if (!oracl) { There("is no one here to consult."); @@ -468,12 +464,7 @@ register struct monst *oracl; u_pay = (umoney < (long)major_cost) ? (int)umoney : major_cost; break; } -#ifndef GOLDOBJ - u.ugold -= (long)u_pay; - oracl->mgold += (long)u_pay; -#else money2mon(oracl, (long)u_pay); -#endif context.botl = 1; add_xpts = 0; /* first oracle of each type gives experience points */ if (u_pay == minor_cost) { diff --git a/src/save.c b/src/save.c index dc0f94078..88db771e2 100644 --- a/src/save.c +++ b/src/save.c @@ -306,9 +306,6 @@ register int fd, mode; bwrite(fd, (genericptr_t) &flags, sizeof(struct flag)); #ifdef SYSFLAGS bwrite(fd, (genericptr_t) &sysflags, sizeof(struct sysflag)); -#endif -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - if (u.ugold) (void)insert_gold_into_invent(FALSE); #endif bwrite(fd, (genericptr_t) &u, sizeof(struct you)); bwrite(fd, yyyymmddhhmmss(ubirthday), 14); @@ -319,9 +316,6 @@ register int fd, mode; save_light_sources(fd, mode, RANGE_GLOBAL); saveobjchn(fd, invent, mode); -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - if (!release_data(mode)) remove_gold_from_invent(); -#endif if (BALL_IN_MON) { /* prevent loss of ball & chain when swallowed */ uball->nobj = uchain; @@ -1123,22 +1117,10 @@ register struct monst *mtmp; if (perform_bwrite(mode)) { mtmp->mnum = monsndx(mtmp->data); if (mtmp->ispriest) forget_temple_entry(mtmp); /* EPRI() */ -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - if (mtmp->mgold) { - struct obj *goldobj = mksobj(GOLD_PIECE, FALSE, FALSE); - - goldobj->quan = mtmp->mgold; - mtmp->mgold = 0L; - add_to_minv(mtmp, goldobj); - } -#endif savemon(fd, mtmp); } if (mtmp->minvent) saveobjchn(fd,mtmp->minvent,mode); -#ifndef GOLDOBJ /* GOLDOBJ-compatibility */ - if (!release_data(mode)) put_gold_back(mtmp); -#endif if (release_data(mode)) dealloc_monst(mtmp); mtmp = mtmp2; diff --git a/src/shk.c b/src/shk.c index 5a397abf5..0fe0e94db 100644 --- a/src/shk.c +++ b/src/shk.c @@ -78,7 +78,6 @@ STATIC_DCL const char *FDECL(cad, (BOOLEAN_P)); */ -#ifdef GOLDOBJ /* Transfer money from inventory to monster when paying shopkeepers, priests, oracle, succubus, & other demons. @@ -153,8 +152,6 @@ long amount; } } -#endif /* GOLDOBJ */ - STATIC_OVL struct monst * next_shkp(shkp, withbill) register struct monst *shkp; @@ -903,13 +900,8 @@ register struct monst *shkp; long robbed = ESHK(shkp)->robbed; long balance = ((tmp <= 0L) ? tmp : check_credit(tmp, shkp)); -#ifndef GOLDOBJ - u.ugold -= balance; - shkp->mgold += balance; -#else if (balance > 0) money2mon(shkp, balance); else if (balance < 0) money2u(shkp, -balance); -#endif context.botl = 1; if(robbed) { robbed -= tmp; @@ -1235,11 +1227,7 @@ proceed: } if(shkp != resident && NOTANGRY(shkp)) { -#ifdef GOLDOBJ umoney = money_cnt(invent); -#else - umoney = u.ugold; -#endif if(!ltmp) You("do not owe %s anything.", mon_nam(shkp)); else if(!umoney) { @@ -1268,11 +1256,7 @@ proceed: /* ltmp is still eshkp->robbed here */ if (!eshkp->billct && !eshkp->debit) { -#ifdef GOLDOBJ umoney = money_cnt(invent); -#else - umoney = u.ugold; -#endif if(!ltmp && NOTANGRY(shkp)) { You("do not owe %s anything.", shkname(shkp)); if (!umoney) @@ -1325,9 +1309,7 @@ proceed: long dtmp = eshkp->debit; long loan = eshkp->loan; char sbuf[BUFSZ]; -#ifdef GOLDOBJ umoney = money_cnt(invent); -#endif Sprintf(sbuf, "You owe %s %ld %s ", shkname(shkp), dtmp, currency(dtmp)); if(loan) { @@ -1337,11 +1319,7 @@ proceed: "for gold picked up and the use of merchandise."); } else Strcat(sbuf, "for the use of merchandise."); pline1(sbuf); -#ifndef GOLDOBJ - if (u.ugold + eshkp->credit < dtmp) { -#else if (umoney + eshkp->credit < dtmp) { -#endif pline("But you don't%s have enough gold%s.", stashed_gold ? " seem to" : "", eshkp->credit ? " or credit" : ""); @@ -1353,12 +1331,7 @@ proceed: eshkp->loan = 0L; Your("debt is covered by your credit."); } else if (!eshkp->credit) { -#ifndef GOLDOBJ - u.ugold -= dtmp; - shkp->mgold += dtmp; -#else money2mon(shkp, dtmp); -#endif eshkp->debit = 0L; eshkp->loan = 0L; You("pay that debt."); @@ -1366,12 +1339,7 @@ proceed: } else { dtmp -= eshkp->credit; eshkp->credit = 0L; -#ifndef GOLDOBJ - u.ugold -= dtmp; - shkp->mgold += dtmp; -#else money2mon(shkp, dtmp); -#endif eshkp->debit = 0L; eshkp->loan = 0L; pline("That debt is partially offset by your credit."); @@ -1384,22 +1352,14 @@ proceed: /* now check items on bill */ if (eshkp->billct) { register boolean itemize; -#ifndef GOLDOBJ - if (!u.ugold && !eshkp->credit) { -#else umoney = money_cnt(invent); if (!umoney && !eshkp->credit) { -#endif You("%shave no money or credit%s.", stashed_gold ? "seem to " : "", paid ? " left" : ""); return(0); } -#ifndef GOLDOBJ - if ((u.ugold + eshkp->credit) < cheapest_item(shkp)) { -#else if ((umoney + eshkp->credit) < cheapest_item(shkp)) { -#endif You("don't have enough money to buy%s the item%s you picked.", eshkp->billct > 1 ? " any of" : "", plur(eshkp->billct)); if(stashed_gold) @@ -1483,11 +1443,7 @@ boolean itemize; { register struct obj *obj = *obj_p; long ltmp, quan, save_quan; -#ifdef GOLDOBJ long umoney = money_cnt(invent); -#else - long umoney = u.ugold; -#endif int buy; boolean stashed_gold = (hidden_gold() > 0L), consumed = (which == 0); @@ -1672,9 +1628,7 @@ int numsk; int croaked; { long loss = 0L; -#ifdef GOLDOBJ long umoney; -#endif struct eshk *eshkp = ESHK(shkp); boolean take = FALSE, taken = FALSE; unsigned save_minvis = shkp->minvis; @@ -1721,12 +1675,8 @@ int croaked; } if (eshkp->following || ANGRY(shkp) || take) { -#ifndef GOLDOBJ - if (!invent && !u.ugold) goto skip; -#else if (!invent) goto skip; umoney = money_cnt(invent); -#endif takes[0] = '\0'; if (!shkp->mcanmove || shkp->msleeping) Strcat(takes, "wakes up and "); @@ -1734,18 +1684,10 @@ int croaked; Strcat(takes, "comes and "); Strcat(takes, "takes"); -#ifndef GOLDOBJ - if (loss > u.ugold || !loss || roomno == eshkp->shoproom) { - eshkp->robbed -= u.ugold; - if (eshkp->robbed < 0L) eshkp->robbed = 0L; - shkp->mgold += u.ugold; - u.ugold = 0L; -#else if (loss > umoney || !loss || roomno == eshkp->shoproom) { eshkp->robbed -= umoney; if (eshkp->robbed < 0L) eshkp->robbed = 0L; if (umoney > 0) money2mon(shkp, umoney); -#endif context.botl = 1; pline("%s %s all your possessions.", shkname(shkp), takes); @@ -1753,12 +1695,7 @@ int croaked; /* where to put player's invent (after disclosure) */ set_repo_loc(shkp); } else { -#ifndef GOLDOBJ - shkp->mgold += loss; - u.ugold -= loss; -#else money2mon(shkp, loss); -#endif context.botl = 1; pline("%s %s the %ld %s %sowed %s.", Monnam(shkp), takes, @@ -1827,14 +1764,9 @@ finish_paybill() unleash_all(); /* if hero has any gold left, take it into shopkeeper's possession */ if (shkp) { -#ifdef GOLDOBJ long umoney = money_cnt(invent); if (umoney) money2mon(shkp, umoney); -#else - shkp->mgold += u.ugold; - u.ugold = 0L; -#endif } /* transfer rest of the character's inventory to the shop floor */ drop_upon_death((struct monst *)0, (struct obj *)0, ox, oy); @@ -2837,11 +2769,7 @@ xchar x, y; return; } -#ifndef GOLDOBJ - shkmoney = shkp->mgold; -#else shkmoney = money_cnt(shkp->minvent); -#endif if (!shkmoney) { char c, qbuf[BUFSZ]; long tmpcr = ((offer * 9L) / 10L) + (offer <= 1L); @@ -3779,11 +3707,7 @@ boolean cant_mollify; } if((um_dist(x, y, 1) && !uinshp) || cant_mollify || -#ifndef GOLDOBJ - (u.ugold + ESHK(shkp)->credit) < cost_of_damage -#else (money_cnt(invent) + ESHK(shkp)->credit) < cost_of_damage -#endif || !rn2(50)) { getcad: if (muteshk(shkp)) { @@ -3807,12 +3731,7 @@ boolean cant_mollify; currency(cost_of_damage), !animal ? "\"" : ""); if(yn(qbuf) != 'n') { cost_of_damage = check_credit(cost_of_damage, shkp); -#ifndef GOLDOBJ - u.ugold -= cost_of_damage; - shkp->mgold += cost_of_damage; -#else money2mon(shkp, cost_of_damage); -#endif context.botl = 1; pline("Mollified, %s accepts your restitution.", shkname(shkp)); @@ -3967,9 +3886,7 @@ shk_chat(shkp) struct monst *shkp; { struct eshk *eshk; -#ifdef GOLDOBJ long shkmoney; -#endif if (!shkp->isshk) { /* The monster type is shopkeeper, but this monster is not actually a shk, which could happen if someone @@ -4010,17 +3927,9 @@ struct monst *shkp; shkname(shkp), eshk->credit, currency(eshk->credit)); else if (eshk->robbed) pline("%s complains about a recent robbery.", shkname(shkp)); -#ifndef GOLDOBJ - else if (shkp->mgold < 50) -#else else if ((shkmoney = money_cnt(shkp->minvent)) < 50) -#endif pline("%s complains that business is bad.", shkname(shkp)); -#ifndef GOLDOBJ - else if (shkp->mgold > 4000) -#else else if (shkmoney > 4000) -#endif pline("%s says that business is good.", shkname(shkp)); else if (is_izchak(shkp, FALSE)) pline(Izchak_speaks[rn2(SIZE(Izchak_speaks))],shkname(shkp)); diff --git a/src/shknam.c b/src/shknam.c index 77bdf2f3c..645fc6b58 100644 --- a/src/shknam.c +++ b/src/shknam.c @@ -552,11 +552,7 @@ struct mkroom *sroom; eshkp->billct = eshkp->visitct = 0; eshkp->bill_p = (struct bill_x *)0; eshkp->customer[0] = '\0'; -#ifndef GOLDOBJ - shk->mgold = 1000L + 30L*(long)rnd(100); /* initial capital */ -#else mkmonmoney(shk, 1000L + 30L*(long)rnd(100)); /* initial capital */ -#endif if (shp->shknms == shkrings) (void) mongets(shk, TOUCHSTONE); nameshk(shk, shp->shknms); diff --git a/src/sit.c b/src/sit.c index 72c94c56b..aa3a16605 100644 --- a/src/sit.c +++ b/src/sit.c @@ -9,15 +9,6 @@ void take_gold() { -#ifndef GOLDOBJ - if (u.ugold <= 0) { - You_feel("a strange sensation."); - } else { - You("notice you have no gold!"); - u.ugold = 0; - context.botl = 1; - } -#else struct obj *otmp, *nobj; int lost_money = 0; for (otmp = invent; otmp; otmp = nobj) { @@ -33,7 +24,6 @@ take_gold() You("notice you have no money!"); context.botl = 1; } -#endif } int @@ -324,10 +314,8 @@ rndcurse() /* curse a few inventory items at random! */ } for (otmp = invent; otmp; otmp = otmp->nobj) { -#ifdef GOLDOBJ /* gold isn't subject to being cursed or blessed */ if (otmp->oclass == COIN_CLASS) continue; -#endif nobj++; } if (nobj) { @@ -335,10 +323,8 @@ rndcurse() /* curse a few inventory items at random! */ cnt > 0; cnt--) { onum = rnd(nobj); for (otmp = invent; otmp; otmp = otmp->nobj) { -#ifdef GOLDOBJ /* as above */ if (otmp->oclass == COIN_CLASS) continue; -#endif if (--onum == 0) break; /* found the target */ } /* the !otmp case should never happen; picking an already diff --git a/src/sounds.c b/src/sounds.c index 2a7df5823..593c3ecd6 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -874,11 +874,7 @@ register struct monst *mtmp; else verbl_msg = "Relax, this won't hurt a bit."; break; case MS_GUARD: -#ifndef GOLDOBJ - if (u.ugold) -#else if (money_cnt(invent)) -#endif verbl_msg = "Please drop that gold and follow me."; else verbl_msg = "Please follow me."; diff --git a/src/steal.c b/src/steal.c index f98cd693e..0812a79df 100644 --- a/src/steal.c +++ b/src/steal.c @@ -22,66 +22,6 @@ register struct obj *otmp; "armor"); } -#ifndef GOLDOBJ -long /* actually returns something that fits in an int */ -somegold() -{ -#ifdef LINT /* long conv. ok */ - return(0L); -#else - return (long)( (u.ugold < 100) ? u.ugold : - (u.ugold > 10000) ? rnd(10000) : rnd((int) u.ugold) ); -#endif -} - -void -stealgold(mtmp) -register struct monst *mtmp; -{ - register struct obj *gold = g_at(u.ux, u.uy); - register long tmp; - struct monst *who; - const char *whose, *what; - - if (gold && (!u.ugold || gold->quan > u.ugold || !rn2(5))) { - mtmp->mgold += gold->quan; - delobj(gold); - newsym(u.ux, u.uy); - if (u.usteed) { - who = u.usteed; - whose = s_suffix(y_monnam(who)); - what = makeplural(mbodypart(who, FOOT)); - } else { - who = &youmonst; - whose = "your"; - what = makeplural(body_part(FOOT)); - } - /* [ avoid "between your rear regions" :-] */ - if (slithy(who->data)) what = "coils"; - /* reduce "rear hooves/claws" to "hooves/claws" */ - if (!strncmp(what, "rear ", 5)) what += 5; - pline("%s quickly snatches some gold from %s %s %s!", - Monnam(mtmp), - (Levitation || Flying) ? "beneath" : "between", - whose, what); - if(!u.ugold || !rn2(5)) { - if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE); - /* do not set mtmp->mavenge here; gold on the floor is fair game */ - monflee(mtmp, 0, FALSE, FALSE); - } - } else if(u.ugold) { - u.ugold -= (tmp = somegold()); - Your("purse feels lighter."); - mtmp->mgold += tmp; - if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE); - mtmp->mavenge = 1; - monflee(mtmp, 0, FALSE, FALSE); - context.botl = 1; - } -} - -#else /* !GOLDOBJ */ - long /* actually returns something that fits in an int */ somegold(umoney) long umoney; @@ -167,7 +107,6 @@ register struct monst *mtmp; context.botl = 1; } } -#endif /* GOLDOBJ */ /* steal armor after you finish taking it off */ unsigned int stealoid; /* object to be stolen */ @@ -257,7 +196,7 @@ boolean unchain_ball; /* whether to unpunish or just unwield */ /* Returns 1 when something was stolen (or at least, when N should flee now) * Returns -1 if the monster died in the attempt * Avoid stealing the object stealoid - * GOLDOBJ: nymphs and monkeys won't steal coins + * Nymphs and monkeys won't steal coins */ int steal(mtmp, objnambuf) @@ -304,9 +243,7 @@ nothing_to_steal: tmp = 0; for(otmp = invent; otmp; otmp = otmp->nobj) if ((!uarm || otmp != uarmc) && otmp != uskin -#ifdef GOLDOBJ && otmp->oclass != COIN_CLASS -#endif #ifdef INVISIBLE_OBJECTS && (!otmp->oinvis || perceives(mtmp->data)) #endif @@ -317,9 +254,7 @@ nothing_to_steal: tmp = rn2(tmp); for(otmp = invent; otmp; otmp = otmp->nobj) if ((!uarm || otmp != uarmc) && otmp != uskin -#ifdef GOLDOBJ && otmp->oclass != COIN_CLASS -#endif #ifdef INVISIBLE_OBJECTS && (!otmp->oinvis || perceives(mtmp->data)) #endif @@ -494,13 +429,6 @@ register struct obj *otmp; or kicking code shouldn't continue to track and place it */ if (otmp == thrownobj) thrownobj = 0; else if (otmp == kickedobj) kickedobj = 0; -#ifndef GOLDOBJ - if (otmp->oclass == COIN_CLASS) { - mtmp->mgold += otmp->quan; - obfree(otmp, (struct obj *)0); - freed_otmp = 1; - } else { -#endif boolean snuff_otmp = FALSE; /* don't want hidden light source inside the monster; assumes that engulfers won't have external inventories; whirly monsters cause @@ -523,9 +451,6 @@ register struct obj *otmp; freed_otmp = add_to_minv(mtmp, otmp); /* and we had to defer this until object is in mtmp's inventory */ if (snuff_otmp) snuff_light_source(mtmp->mx, mtmp->my); -#ifndef GOLDOBJ - } -#endif return freed_otmp; } @@ -686,35 +611,14 @@ boolean is_pet; /* If true, pet should keep wielded/worn items */ /* vault guard's gold goes away rather than be dropped... */ if (mtmp->isgd && -#ifdef GOLDOBJ (otmp = findgold(mtmp->minvent)) != 0 -#else - mtmp->mgold != 0L -#endif ) { if (canspotmon(mtmp)) pline("%s gold %s.", s_suffix(Monnam(mtmp)), canseemon(mtmp) ? "vanishes" : "seems to vanish"); -#ifdef GOLDOBJ obfree(otmp, (struct obj *)0); -#else - mtmp->mgold = 0L; -#endif } /* isgd && has gold */ -#ifndef GOLDOBJ - /* handle gold first since droppables() would get stuck on it */ - if (mtmp->mgold) { - long g = mtmp->mgold; - - (void) mkgold(g, omx, omy); - if (is_pet && cansee(omx, omy) && flags.verbose) - pline("%s drops %ld gold piece%s.", Monnam(mtmp), - g, plur(g)); - mtmp->mgold = 0L; - } -#endif - while ((otmp = (is_pet ? droppables(mtmp) : mtmp->minvent)) != 0) { obj_extract_self(otmp); mdrop_obj(mtmp, otmp, is_pet && flags.verbose); diff --git a/src/trap.c b/src/trap.c index cde767106..636598789 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3176,30 +3176,7 @@ boolean *lostsome; /* else continue */ } } -#ifndef GOLDOBJ - if (!otmp) { - /* Nothing available left to drop; try gold */ - if (u.ugold) { - pline("In desperation, you drop your purse."); - /* Hack: gold is not in the inventory, so make a gold object - * and put it at the head of the inventory list. - */ - obj = mkgoldobj(u.ugold); /* removes from u.ugold */ - obj->in_use = TRUE; - u.ugold = obj->quan; /* put the gold back */ - assigninvlet(obj); /* might end up as NOINVSYM */ - obj->nobj = invent; - invent = obj; - *lostsome = TRUE; - dropx(obj); - continue; /* Try again */ - } - /* We can't even drop gold! */ - return (FALSE); - } -#else if (!otmp) return (FALSE); /* nothing to drop! */ -#endif if (otmp->owornmask) remove_worn_item(otmp, FALSE); *lostsome = TRUE; dropx(otmp); diff --git a/src/u_init.c b/src/u_init.c index 09930dd11..bfe54671c 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -210,12 +210,10 @@ static struct trobj Wishing[] = { { WAN_WISHING, 3, WAND_CLASS, 1, 0 }, { 0, 0, 0, 0, 0 } }; -#ifdef GOLDOBJ static struct trobj Money[] = { { GOLD_PIECE, 0 , COIN_CLASS, 1, 0 }, { 0, 0, 0, 0, 0 } }; -#endif /* race-based substitutions for initial inventory; the weaker cloak for elven rangers is intentional--they shoot better */ @@ -597,11 +595,7 @@ u_init() skill_init(Skill_C); break; case PM_HEALER: -#ifndef GOLDOBJ - u.ugold = u.ugold0 = rn1(1000, 1001); -#else u.umoney0 = rn1(1000, 1001); -#endif ini_inv(Healer); if(!rn2(25)) ini_inv(Lamp); knows_object(POT_FULL_HEALING); @@ -650,11 +644,7 @@ u_init() break; case PM_ROGUE: Rogue[R_DAGGERS].trquan = rn1(10, 6); -#ifndef GOLDOBJ - u.ugold = u.ugold0 = 0; -#else u.umoney0 = 0; -#endif ini_inv(Rogue); if(!rn2(5)) ini_inv(Blindfold); knows_object(SACK); @@ -670,11 +660,7 @@ u_init() break; case PM_TOURIST: Tourist[T_DARTS].trquan = rn1(20, 21); -#ifndef GOLDOBJ - u.ugold = u.ugold0 = rnd(1000); -#else u.umoney0 = rnd(1000); -#endif ini_inv(Tourist); if(!rn2(25)) ini_inv(Tinopener); else if(!rn2(25)) ini_inv(Leash); @@ -778,12 +764,8 @@ u_init() if (wizard) read_wizkit(); -#ifndef GOLDOBJ - u.ugold0 += hidden_gold(); /* in case sack has gold in it */ -#else if (u.umoney0) ini_inv(Money); u.umoney0 += hidden_gold(); /* in case sack has gold in it */ -#endif find_ac(); /* get initial ac value */ init_attr(75); /* init attribute values */ @@ -939,12 +921,10 @@ register struct trobj *trop; nocreate4 = otyp; } -#ifdef GOLDOBJ if (trop->trclass == COIN_CLASS) { /* no "blessed" or "identified" money */ obj->quan = u.umoney0; } else { -#endif if (objects[otyp].oc_uses_known) obj->known = 1; obj->dknown = obj->bknown = obj->rknown = 1; if (Is_container(obj) || obj->otyp == STATUE) { @@ -966,9 +946,7 @@ register struct trobj *trop; obj->spe = trop->trspe; if (trop->trbless != UNDEF_BLESS) obj->blessed = trop->trbless; -#ifdef GOLDOBJ } -#endif /* defined after setting otyp+quan + blessedness */ obj->owt = weight(obj); obj = addinv(obj); diff --git a/src/uhitm.c b/src/uhitm.c index 0057e573d..04ec05c11 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1461,13 +1461,6 @@ register struct attack *mattk; tmp = 0; break; case AD_SGLD: -#ifndef GOLDOBJ - if (mdef->mgold) { - u.ugold += mdef->mgold; - mdef->mgold = 0; - Your("purse feels heavier."); - } -#else /* This you as a leprechaun, so steal real gold only, no lesser coins */ { @@ -1484,7 +1477,6 @@ register struct attack *mattk; } } } -#endif exercise(A_DEX, TRUE); tmp = 0; break; diff --git a/src/vault.c b/src/vault.c index 487cb8e7c..87c13b31a 100644 --- a/src/vault.c +++ b/src/vault.c @@ -366,11 +366,7 @@ fnd: return; } verbalize("I don't know you."); -#ifndef GOLDOBJ - umoney = u.ugold; -#else umoney = money_cnt(invent); -#endif if (Deaf) { ; } else if (!umoney && !hidden_gold()) { @@ -513,12 +509,8 @@ register struct monst *grd; grd_in_vault = *in_rooms(grd->mx, grd->my, VAULT)? TRUE : FALSE; boolean disappear_msg_seen = FALSE, semi_dead = (grd->mhp <= 0); -#ifndef GOLDOBJ - register boolean u_carry_gold = ((u.ugold + hidden_gold()) > 0L); -#else long umoney = money_cnt(invent); register boolean u_carry_gold = ((umoney + hidden_gold()) > 0L); -#endif boolean see_guard, newspot = FALSE; if(!on_level(&(egrd->gdlevel), &u.uz)) return(-1); @@ -560,15 +552,9 @@ register struct monst *grd; if(egrd->warncnt == 3 && !Deaf) verbalize("I repeat, %sfollow me!", u_carry_gold ? ( -#ifndef GOLDOBJ - !u.ugold ? - "drop that hidden gold and " : - "drop that gold and ") : ""); -#else !umoney ? "drop that hidden money and " : "drop that money and ") : ""); -#endif if(egrd->warncnt == 7) { m = grd->mx; n = grd->my; @@ -654,13 +640,8 @@ letknow: if (m == u.ux && n == u.uy) { struct obj *gold = g_at(m,n); /* Grab the gold from between the hero's feet. */ -#ifndef GOLDOBJ - grd->mgold += gold->quan; - delobj(gold); -#else obj_extract_self(gold); add_to_minv(grd, gold); -#endif newsym(m,n); } else if (m == x && n == y) { mpickgold(grd); /* does a newsym */ @@ -828,30 +809,17 @@ void paygd() { register struct monst *grd = findgd(); -#ifndef GOLDOBJ - struct obj *gold; -#else long umoney = money_cnt(invent); struct obj *coins, *nextcoins; -#endif int gx,gy; char buf[BUFSZ]; -#ifndef GOLDOBJ - if (!u.ugold || !grd) return; -#else if (!umoney || !grd) return; -#endif if (u.uinvault) { Your("%ld %s goes into the Magic Memory Vault.", -#ifndef GOLDOBJ - u.ugold, - currency(u.ugold)); -#else umoney, currency(umoney)); -#endif gx = u.ux; gy = u.uy; } else { @@ -868,10 +836,6 @@ paygd() plname, mons[u.umonster].mname); make_grave(gx, gy, buf); } -#ifndef GOLDOBJ - place_object(gold = mkgoldobj(u.ugold), gx, gy); - stackobj(gold); -#else for (coins = invent; coins; coins = nextcoins) { nextcoins = coins->nobj; if (objects[coins->otyp].oc_class == COIN_CLASS) { @@ -880,7 +844,6 @@ paygd() stackobj(coins); } } -#endif mongone(grd); } diff --git a/src/wield.c b/src/wield.c index 32a3e1eb4..dbb5d271f 100644 --- a/src/wield.c +++ b/src/wield.c @@ -238,17 +238,10 @@ register struct obj *obj; static NEARDATA const char wield_objs[] = { ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, TOOL_CLASS, 0 }; -#ifdef GOLDOBJ static NEARDATA const char ready_objs[] = { COIN_CLASS, ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, 0 }; static NEARDATA const char bullets[] = /* (note: different from dothrow.c) */ { COIN_CLASS, ALL_CLASSES, ALLOW_NONE, GEM_CLASS, WEAPON_CLASS, 0 }; -#else -static NEARDATA const char ready_objs[] = - { ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, 0 }; -static NEARDATA const char bullets[] = /* (note: different from dothrow.c) */ - { ALL_CLASSES, ALLOW_NONE, GEM_CLASS, WEAPON_CLASS, 0 }; -#endif int dowield() diff --git a/src/zap.c b/src/zap.c index 173bee625..c4d98c33c 100644 --- a/src/zap.c +++ b/src/zap.c @@ -436,11 +436,7 @@ struct monst *mtmp; mstatusline(mtmp); if (notonhead) return; /* don't show minvent for long worm tail */ -#ifndef GOLDOBJ - if (mtmp->minvent || mtmp->mgold) { -#else if (mtmp->minvent) { -#endif for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) { otmp->dknown = 1; /* treat as "seen" */ if (Is_container(otmp) || otmp->otyp == STATUE) { @@ -3661,9 +3657,6 @@ const char *fltxt; obfree(otmp, (struct obj *)0); } } -#ifndef GOLDOBJ - mon->mgold = 0L; -#endif #undef oresist_disintegration diff --git a/sys/amiga/amirip.c b/sys/amiga/amirip.c index 00e98b12d..5b625ba6d 100644 --- a/sys/amiga/amirip.c +++ b/sys/amiga/amirip.c @@ -183,12 +183,7 @@ time_t when; tomb_text(buf); /* Put $ on stone */ - Sprintf(buf, "%ld Au", -#ifndef GOLDOBJ - u.ugold); -#else - done_money); -#endif + Sprintf(buf, "%ld Au", done_money); buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */ tomb_text(buf); diff --git a/sys/wince/mhstatus.c b/sys/wince/mhstatus.c index 6e18ed12a..dd86e2d6e 100644 --- a/sys/wince/mhstatus.c +++ b/sys/wince/mhstatus.c @@ -233,11 +233,7 @@ void FormatStatusString(char* text, int format) (void) describe_level(nb=eos(nb)); Sprintf(nb = eos(nb), "%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", showsyms[COIN_CLASS + SYM_OFF_O], -#ifndef GOLDOBJ - u.ugold, -#else money_cnt(invent), -#endif hp, hpmax, u.uen, u.uenmax, u.uac); if (Upolyd) diff --git a/util/makedefs.c b/util/makedefs.c index ad2186887..9102945ce 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -960,7 +960,6 @@ do_rumors() * */ #define IGNORED_FEATURES ( 0L \ - | (1L << 12) /* GOLDOBJ */ \ | (1L << 19) /* EXP_ON_BOTL */ \ | (1L << 20) /* SCORE_ON_BOTL */ \ | (1L << 27) /* ZEROCOMP */ \ @@ -993,9 +992,6 @@ make_version() | (1L << 6) #endif /* objects (10..14) */ -#ifdef GOLDOBJ - | (1L << 10) -#endif /* flag bits and/or other global variables (15..26) */ #ifdef TEXTCOLOR | (1L << 17) @@ -1239,9 +1235,6 @@ static const char *build_opts[] = { #ifdef MFLOPPY "floppy drive support", #endif -#ifdef GOLDOBJ - "gold object in inventories", -#endif #ifdef INSURANCE "insurance files for recovering from crashes", #endif diff --git a/win/Qt/qt_win.cpp b/win/Qt/qt_win.cpp index af412e25a..16ff7873b 100644 --- a/win/Qt/qt_win.cpp +++ b/win/Qt/qt_win.cpp @@ -2550,11 +2550,7 @@ void NetHackQtStatusWindow::updateStats() dlevel.setLabel(buf,(long)depth(&u.uz)); } -#ifndef GOLDOBJ - gold.setLabel("Au:", u.ugold); -#else gold.setLabel("Au:", money_cnt(invent)); -#endif if (u.mtimedone) { // You're a monster! @@ -3296,11 +3292,7 @@ static char** rip_line=0; Sprintf(rip_line[NAME_LINE], "%s", plname); /* Put $ on stone */ -#ifndef GOLDOBJ - Sprintf(rip_line[GOLD_LINE], "%ld Au", u.ugold); -#else Sprintf(rip_line[GOLD_LINE], "%ld Au", done_money); -#endif /* Put together death description */ formatkiller(buf, sizeof buf, how); diff --git a/win/X11/winstat.c b/win/X11/winstat.c index 42462cbc3..ab65a168c 100644 --- a/win/X11/winstat.c +++ b/win/X11/winstat.c @@ -600,11 +600,7 @@ update_fancy_status(wp) case F_NAME: val = (long) 0L; break; /* special */ case F_DLEVEL: val = (long) 0L; break; /* special */ -#ifndef GOLDOBJ - case F_GOLD: val = (long) u.ugold; break; -#else case F_GOLD: val = money_cnt(invent); break; -#endif case F_HP: val = (long) (u.mtimedone ? (u.mh > 0 ? u.mh : 0): (u.uhp > 0 ? u.uhp : 0)); break; diff --git a/win/X11/wintext.c b/win/X11/wintext.c index 9b337d3b2..795b765a7 100644 --- a/win/X11/wintext.c +++ b/win/X11/wintext.c @@ -469,11 +469,7 @@ calculate_rip_text(int how, time_t when) /* Put $ on stone */ Sprintf(rip_line[GOLD_LINE], "%ld Au", -#ifndef GOLDOBJ - u.ugold); -#else done_money); -#endif /* Put together death description */ formatkiller(buf, sizeof buf, how); diff --git a/win/gem/wingem.c b/win/gem/wingem.c index 87d175231..ccc076bdf 100644 --- a/win/gem/wingem.c +++ b/win/gem/wingem.c @@ -1088,11 +1088,7 @@ time_t when; Sprintf(rip_line[NAME_LINE], "%s", plname); /* Put $ on stone */ Sprintf(rip_line[GOLD_LINE], "%ld Au", -#ifndef GOLDOBJ - u.ugold); -#else done_money); -#endif /* Put together death description */ formatkiller(buf, sizeof buf, how); diff --git a/win/gnome/gnbind.c b/win/gnome/gnbind.c index c48535a26..b001de04f 100644 --- a/win/gnome/gnbind.c +++ b/win/gnome/gnbind.c @@ -1183,12 +1183,7 @@ void gnome_outrip(winid wid, int how, time_t when) Strcat(ripString, buf); /* Put $ on stone */ - Sprintf(buf, "%ld Au\n", -#ifndef GOLDOBJ - u.ugold); -#else - done_money); -#endif + Sprintf(buf, "%ld Au\n", done_money); Strcat(ripString, buf); /* Put together death description */ diff --git a/win/gnome/gnstatus.c b/win/gnome/gnstatus.c index 6e3841cc3..37e1d7bf6 100644 --- a/win/gnome/gnstatus.c +++ b/win/gnome/gnstatus.c @@ -434,9 +434,7 @@ void ghack_status_window_update_stats() const char* hung; const char* enc; static int firstTime=TRUE; -#ifdef GOLDOBJ long umoney; -#endif /* First, fill in the player name and the dungeon level */ strcpy(buf, plname); @@ -565,30 +563,17 @@ void ghack_status_window_update_stats() gtk_label_set( GTK_LABEL( chaLabel), buf); /* Now do the non-pixmaped stats (gold and such) */ -#ifndef GOLDOBJ - sprintf(buf,"Au:%ld", u.ugold); - if (lastAu < u.ugold && firstTime==FALSE) { -#else umoney = money_cnt(invent); sprintf(buf,"Au:%ld", umoney); if (lastAu < umoney && firstTime==FALSE) { -#endif /* Ok, this changed so add it to the highlighing list */ ghack_highlight_widget( goldLabel, normalStyle, greenStyle); } -#ifndef GOLDOBJ - else if (lastAu > u.ugold && firstTime==FALSE) { -#else else if (lastAu > umoney && firstTime==FALSE) { -#endif /* Ok, this changed so add it to the highlighing list */ ghack_highlight_widget( goldLabel, normalStyle, redStyle); } -#ifndef GOLDOBJ - lastAu = u.ugold; -#else lastAu = umoney; -#endif gtk_label_set( GTK_LABEL( goldLabel), buf); if (u.mtimedone) { diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index 39776d87b..7d2177286 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -1796,11 +1796,7 @@ void mswin_outrip(winid wid, int how, time_t when) putstr(wid, 0, buf); /* Put $ on stone */ -#ifndef GOLDOBJ - Sprintf(buf, "%ld Au", u.ugold); -#else Sprintf(buf, "%ld Au", done_money); -#endif buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */ putstr(wid, 0, buf); From 099a1b7b327a87a2dea2674c9a4c1485e31c90e9 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 9 Feb 2015 20:56:44 +0200 Subject: [PATCH 130/354] Apply paxed's DEBUG patch to remove DEBUG/D_DEBUG. Move debugging output into couple preprocessor defines, which are no-op without DEBUG. To show debugging output from a certain source files, use sysconf: DEBUGFILES=dungeon.c questpgr.c Also fix couple debug lines which did not compile. This also includes fixes due to Derek Ray to depugpline to work better on other platforms. --- include/global.h | 2 + include/hack.h | 28 +++++++++++-- include/sys.h | 1 + src/apply.c | 4 +- src/attrib.c | 46 ++++++---------------- src/bones.c | 4 +- src/cmd.c | 21 +++++----- src/dbridge.c | 100 ++++++++++++----------------------------------- src/dig.c | 36 +++++------------ src/dungeon.c | 2 + src/eat.c | 70 --------------------------------- src/files.c | 3 ++ src/hack.c | 2 +- src/light.c | 12 ++---- src/makemon.c | 24 +++--------- src/mklev.c | 11 +----- src/mkmaze.c | 8 +--- src/mkobj.c | 16 ++------ src/mon.c | 4 +- src/pickup.c | 4 +- src/questpgr.c | 11 +++--- src/restore.c | 4 +- src/rnd.c | 20 ++++------ src/save.c | 4 +- src/shk.c | 6 +-- src/sp_lev.c | 11 ------ src/steal.c | 2 +- src/sys.c | 1 + src/teleport.c | 4 +- src/zap.c | 8 +--- sys/unix/sysconf | 5 +++ win/tty/wintty.c | 2 +- 32 files changed, 136 insertions(+), 340 deletions(-) diff --git a/include/global.h b/include/global.h index 7e8acda38..985066520 100644 --- a/include/global.h +++ b/include/global.h @@ -11,6 +11,8 @@ #define BETA /* development or beta testing [MRS] */ +#define DEBUG + /* * Files expected to exist in the playground directory. */ diff --git a/include/hack.h b/include/hack.h index c88d8dd56..0ace170e5 100644 --- a/include/hack.h +++ b/include/hack.h @@ -11,9 +11,31 @@ #include "config.h" #endif -/* For debugging beta code. */ -#ifdef BETA -#define Dpline pline +#ifdef DEBUG +/* due to strstr(), mon.c matches makemon.c */ +# define showdebug() (sysopt.debugfiles && \ + ((sysopt.debugfiles[0] == '*') || \ + (strstr( __FILE__ , sysopt.debugfiles)))) + +/* GCC understands this syntax */ +# ifdef __GNUC__ +/* ... but whines about it anyway without these pragmas. */ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wvariadic-macros" +# define debugpline(args...) \ + do { if (showdebug()) pline( args ); } while(0); +# pragma GCC diagnostic pop +# endif + +/* and Visual Studio understands this one */ +# ifdef _MSC_VER +# define debugpline(...) \ + do { if (showdebug()) pline(__VA_ARGS__); } while(0); +# endif + +#else +# define showdebug() (0) +# define debugpline(...) #endif #define TELL 1 diff --git a/include/sys.h b/include/sys.h index 227e68781..ac39239ee 100644 --- a/include/sys.h +++ b/include/sys.h @@ -15,6 +15,7 @@ struct sysopt { char *recover; /* how to run recover - may be overridden by win port */ char *wizards; char *shellers; /* like wizards, for ! command (-DSHELL) */ + char *debugfiles; /* files to show debugplines in. '*' is all. */ int maxplayers; /* record file */ int persmax; diff --git a/src/apply.c b/src/apply.c index e92e6199f..d2377b51e 100644 --- a/src/apply.c +++ b/src/apply.c @@ -1773,9 +1773,7 @@ long timeout; char monnambuf[BUFSZ], carriedby[BUFSZ]; if (!figurine) { -#ifdef DEBUG - pline("null figurine in fig_transform()"); -#endif + debugpline("null figurine in fig_transform()"); return; } silent = (timeout != monstermoves); /* happened while away */ diff --git a/src/attrib.c b/src/attrib.c index b2d5738b8..8bba3d61c 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -8,8 +8,6 @@ #include "hack.h" #include -/* #define DEBUG */ /* uncomment for debugging info */ - /* part of the output on gain or loss of attribute */ static const char * const plusattr[] = { @@ -349,9 +347,7 @@ exercise(i, inc_or_dec) int i; boolean inc_or_dec; { -#ifdef DEBUG - pline("Exercise:"); -#endif + debugpline("Exercise:"); if (i == A_INT || i == A_CHA) return; /* can't exercise these */ /* no physical exercise while polymorphed; the body's temporary */ @@ -368,12 +364,10 @@ boolean inc_or_dec; * Note: *YES* ACURR is the right one to use. */ AEXE(i) += (inc_or_dec) ? (rn2(19) > ACURR(i)) : -rn2(2); -#ifdef DEBUG - pline("%s, %s AEXE = %d", + debugpline("%s, %s AEXE = %d", (i == A_STR) ? "Str" : (i == A_WIS) ? "Wis" : (i == A_DEX) ? "Dex" : "Con", (inc_or_dec) ? "inc" : "dec", AEXE(i)); -#endif } if (moves > 0 && (i == A_STR || i == A_CON)) (void)encumber_msg(); } @@ -398,9 +392,7 @@ exerper() (u.uhunger > 50) ? HUNGRY : (u.uhunger > 0) ? WEAK : FAINTING; -#ifdef DEBUG - pline("exerper: Hunger checks"); -#endif + debugpline("exerper: Hunger checks"); switch (hs) { case SATIATED: exercise(A_DEX, FALSE); if (Role_if(PM_MONK)) @@ -416,9 +408,7 @@ exerper() } /* Encumberance Checks */ -#ifdef DEBUG - pline("exerper: Encumber checks"); -#endif + debugpline("exerper: Encumber checks"); switch (near_capacity()) { case MOD_ENCUMBER: exercise(A_STR, TRUE); break; case HVY_ENCUMBER: exercise(A_STR, TRUE); @@ -431,9 +421,7 @@ exerper() /* status checks */ if(!(moves % 5)) { -#ifdef DEBUG - pline("exerper: Status checks"); -#endif + debugpline("exerper: Status checks"); if ((HClairvoyant & (INTRINSIC|TIMEOUT)) && !BClairvoyant) exercise(A_WIS, TRUE); if (HRegeneration) exercise(A_STR, TRUE); @@ -464,15 +452,11 @@ exerchk() /* Check out the periodic accumulations */ exerper(); -#ifdef DEBUG if(moves >= context.next_attrib_check) - pline("exerchk: ready to test. multi = %d.", multi); -#endif + debugpline("exerchk: ready to test. multi = %d.", multi); /* Are we ready for a test? */ if(moves >= context.next_attrib_check && !multi) { -#ifdef DEBUG - pline("exerchk: testing."); -#endif + debugpline("exerchk: testing."); /* * Law of diminishing returns (Part II): * @@ -499,13 +483,11 @@ exerchk() exercise/abuse gradually wears off without impact then */ if (Upolyd && i != A_WIS) goto nextattrib; -#ifdef DEBUG - pline("exerchk: testing %s (%d).", + debugpline("exerchk: testing %s (%d).", (i == A_STR) ? "Str" : (i == A_INT) ? "Int?" : (i == A_WIS) ? "Wis" : (i == A_DEX) ? "Dex" : (i == A_CON) ? "Con" : (i == A_CHA) ? "Cha?" : "???", ax); -#endif /* * Law of diminishing returns (Part III): * @@ -515,13 +497,9 @@ exerchk() if (rn2(AVAL) > ((i != A_WIS) ? (abs(ax) * 2 / 3) : abs(ax))) goto nextattrib; -#ifdef DEBUG - pline("exerchk: changing %d.", i); -#endif + debugpline("exerchk: changing %d.", i); if(adjattrib(i, mod_val, -1)) { -#ifdef DEBUG - pline("exerchk: changed %d.", i); -#endif + debugpline("exerchk: changed %d.", i); /* if you actually changed an attrib - zero accumulation */ AEXE(i) = ax = 0; /* then print an explanation */ @@ -535,9 +513,7 @@ exerchk() AEXE(i) = (abs(ax) / 2) * mod_val; } context.next_attrib_check += rn1(200,800); -#ifdef DEBUG - pline("exerchk: next check at %ld.", context.next_attrib_check); -#endif + debugpline("exerchk: next check at %ld.", context.next_attrib_check); } } diff --git a/src/bones.c b/src/bones.c index 66a4d43f5..926b9079e 100644 --- a/src/bones.c +++ b/src/bones.c @@ -581,11 +581,9 @@ getbones() for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) { if (has_mname(mtmp)) sanitize_name(MNAME(mtmp)); if (mtmp->mhpmax == DEFUNCT_MONSTER) { -#if defined(DEBUG) if (wizard) - pline("Removing defunct monster %s from bones.", + debugpline("Removing defunct monster %s from bones.", mtmp->data->mname); -#endif mongone(mtmp); } else /* to correctly reset named artifacts on the level */ diff --git a/src/cmd.c b/src/cmd.c index f07abb78c..1477eabdc 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -5,7 +5,6 @@ #include "hack.h" #include "func_tab.h" -/* #define DEBUG */ /* uncomment for debugging */ #ifdef ALTMETA STATIC_VAR boolean alt_esc = FALSE; @@ -30,12 +29,8 @@ extern const char *enc_stat[]; /* encumbrance status from botl.c */ #define CMD_CLICKLOOK (char)0x8F #ifdef DEBUG -/* - * only one "wiz_debug_cmd" routine should be available (in whatever - * module you are trying to debug) or things are going to get rather - * hard to link :-) - */ -extern int NDECL(wiz_debug_cmd); +extern int NDECL(wiz_debug_cmd_bury); +extern int NDECL(wiz_debug_cmd_traveldisplay); #endif #ifdef DUMB /* stuff commented out in extern.h, but needed here */ @@ -389,11 +384,11 @@ extcmd_via_menu() /* here after # - now show pick-list of possible commands */ Sprintf(fmtstr, "%%-%ds", biggest + 15); } if (++i > MAX_EXT_CMD) { -# if defined(DEBUG) || defined(BETA) +# if defined(BETA) impossible( "Exceeded %d extended commands in doextcmd() menu; 'extmenu' disabled.", MAX_EXT_CMD); -# endif /* DEBUG || BETA */ +# endif /* BETA */ iflags.extmenu = 0; return -1; } @@ -454,7 +449,7 @@ extcmd_via_menu() /* here after # - now show pick-list of possible commands */ if (n == 1) { if (matchlevel > (QBUFSZ - 2)) { free((genericptr_t)pick_list); -# if defined(DEBUG) || defined(BETA) +# if defined(BETA) impossible("Too many chars (%d) entered in extcmd_via_menu()", matchlevel); # endif @@ -2507,7 +2502,8 @@ struct ext_func_tab extcmdlist[] = { {(char *)0, (char *)0, donull, TRUE}, /* vision */ {(char *)0, (char *)0, donull, TRUE}, /* wizsmell */ #ifdef DEBUG - {(char *)0, (char *)0, donull, TRUE}, /* wizdebug */ + {(char *)0, (char *)0, donull, TRUE}, /* wizdebug_traveldisplay */ + {(char *)0, (char *)0, donull, TRUE}, /* wizdebug_bury */ #endif {(char *)0, (char *)0, donull, TRUE}, /* wizrumorcheck */ {(char *)0, (char *)0, donull, TRUE}, /* wmode */ @@ -2534,7 +2530,8 @@ static const struct ext_func_tab debug_extcmdlist[] = { {"vision", "show vision array", wiz_show_vision, TRUE}, {"wizsmell", "smell monster", wiz_smell, TRUE}, #ifdef DEBUG - {"wizdebug", "wizard debug command", wiz_debug_cmd, TRUE}, + {"wizdebug_traveldisplay", "wizard debug: toggle travel display", wiz_debug_cmd_traveldisplay, TRUE}, + {"wizdebug_bury", "wizard debug: bury objs under and around you", wiz_debug_cmd_bury, TRUE}, #endif {"wizrumorcheck", "verify rumor boundaries", wiz_rumor_check, TRUE}, {"wmode", "show wall modes", wiz_show_wmodes, TRUE}, diff --git a/src/dbridge.c b/src/dbridge.c index b63d2714c..316b2707f 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -26,9 +26,6 @@ STATIC_DCL void FDECL(m_to_e, (struct monst *, int, int, struct entity *)); STATIC_DCL void FDECL(u_to_e, (struct entity *)); STATIC_DCL void FDECL(set_entity, (int, int, struct entity *)); STATIC_DCL const char *FDECL(e_nam, (struct entity *)); -#ifdef D_DEBUG -static const char *FDECL(Enam, (struct entity *)); /* unused */ -#endif STATIC_DCL const char *FDECL(E_phrase, (struct entity *, const char *)); STATIC_DCL boolean FDECL(e_survives_at, (struct entity *, int, int)); STATIC_DCL void FDECL(e_died, (struct entity *, int, int)); @@ -253,8 +250,8 @@ int x, y; (occupants[entitycnt].ex == x) && (occupants[entitycnt].ey == y)) break; + debugpline("entitycnt = %d", entitycnt); #ifdef D_DEBUG - pline("entitycnt = %d", entitycnt); wait_synch(); #endif return((entitycnt == ENTITIES)? @@ -319,19 +316,6 @@ struct entity *etmp; return(is_u(etmp)? "you" : mon_nam(etmp->emon)); } -#ifdef D_DEBUG -/* - * Enam is another unused utility routine: E_phrase is preferable. - */ - -static const char * -Enam(etmp) -struct entity *etmp; -{ - return(is_u(etmp)? "You" : Monnam(etmp->emon)); -} -#endif /* D_DEBUG */ - /* * Generates capitalized entity name, makes 2nd -> 3rd person conversion on * verb, where necessary. @@ -465,10 +449,8 @@ boolean chunks; { int misses; -#ifdef D_DEBUG if (chunks) - pline("Do chunks miss?"); -#endif + debugpline("Do chunks miss?"); if (automiss(etmp)) return(TRUE); @@ -488,9 +470,7 @@ boolean chunks; if (is_db_wall(etmp->ex, etmp->ey)) misses -= 3; /* less airspace */ -#ifdef D_DEBUG - pline("Miss chance = %d (out of 8)", misses); -#endif + debugpline("Miss chance = %d (out of 8)", misses); return((boolean)((misses >= rnd(8))? TRUE : FALSE)); } @@ -519,9 +499,7 @@ struct entity *etmp; if (is_db_wall(etmp->ex, etmp->ey)) tmp -= 2; /* less room to maneuver */ -#ifdef D_DEBUG - pline("%s to jump (%d chances in 10)", E_phrase(etmp, "try"), tmp); -#endif + debugpline("%s to jump (%d chances in 10)", E_phrase(etmp, "try"), tmp); return((boolean)((tmp >= rnd(10))? TRUE : FALSE)); } @@ -554,17 +532,13 @@ struct entity *etmp; if (at_portcullis) pline_The("portcullis misses %s!", e_nam(etmp)); -#ifdef D_DEBUG else - pline_The("drawbridge misses %s!", + debugpline("The drawbridge misses %s!", e_nam(etmp)); -#endif if (e_survives_at(etmp, oldx, oldy)) return; else { -#ifdef D_DEBUG - pline("Mon can't survive here"); -#endif + debugpline("Mon can't survive here"); if (at_portcullis) must_jump = TRUE; else @@ -583,9 +557,7 @@ struct entity *etmp; if (at_portcullis) { if (e_jumps(etmp)) { relocates = TRUE; -#ifdef D_DEBUG - pline("Jump succeeds!"); -#endif + debugpline("Jump succeeds!"); } else { if (e_inview) pline("%s crushed by the falling portcullis!", @@ -598,9 +570,7 @@ struct entity *etmp; } } else { /* tries to jump off bridge to original square */ relocates = !e_jumps(etmp); -#ifdef D_DEBUG - pline("Jump %s!", (relocates)? "fails" : "succeeds"); -#endif + debugpline("Jump %s!", (relocates)? "fails" : "succeeds"); } } @@ -610,17 +580,13 @@ struct entity *etmp; * would be inaccessible (i.e. etmp started on drawbridge square) or * unnecessary (i.e. etmp started here) in such a situation. */ -#ifdef D_DEBUG - pline("Doing relocation."); -#endif + debugpline("Doing relocation."); newx = oldx; newy = oldy; (void)find_drawbridge(&newx, &newy); if ((newx == oldx) && (newy == oldy)) get_wall_for_db(&newx, &newy); -#ifdef D_DEBUG - pline("Checking new square for occupancy."); -#endif + debugpline("Checking new square for occupancy."); if (relocates && (e_at(newx, newy))) { /* @@ -631,30 +597,24 @@ struct entity *etmp; struct entity *other; other = e_at(newx, newy); -#ifdef D_DEBUG - pline("New square is occupied by %s", e_nam(other)); -#endif + debugpline("New square is occupied by %s", e_nam(other)); if (e_survives_at(other, newx, newy) && automiss(other)) { relocates = FALSE; /* "other" won't budge */ -#ifdef D_DEBUG - pline("%s suicide.", E_phrase(etmp, "commit")); -#endif + debugpline("%s suicide.", E_phrase(etmp, "commit")); } else { -#ifdef D_DEBUG - pline("Handling %s", e_nam(other)); -#endif + debugpline("Handling %s", e_nam(other)); while ((e_at(newx, newy) != 0) && (e_at(newx, newy) != etmp)) do_entity(other); + debugpline("Checking existence of %s", e_nam(etmp)); #ifdef D_DEBUG - pline("Checking existence of %s", e_nam(etmp)); wait_synch(); #endif if (e_at(oldx, oldy) != etmp) { -#ifdef D_DEBUG - pline("%s moved or died in recursion somewhere", + debugpline("%s moved or died in recursion somewhere", E_phrase(etmp, "have")); +#ifdef D_DEBUG wait_synch(); #endif return; @@ -662,9 +622,7 @@ struct entity *etmp; } } if (relocates && !e_at(newx, newy)) {/* if e_at() entity = worm tail */ -#ifdef D_DEBUG - pline("Moving %s", e_nam(etmp)); -#endif + debugpline("Moving %s", e_nam(etmp)); if (!is_u(etmp)) { remove_monster(etmp->ex, etmp->ey); place_monster(etmp->emon, newx, newy); @@ -677,13 +635,13 @@ struct entity *etmp; etmp->ey = newy; e_inview = e_canseemon(etmp); } + debugpline("Final disposition of %s", e_nam(etmp)); #ifdef D_DEBUG - pline("Final disposition of %s", e_nam(etmp)); wait_synch(); #endif if (is_db_wall(etmp->ex, etmp->ey)) { + debugpline("%s in portcullis chamber", E_phrase(etmp, "are")); #ifdef D_DEBUG - pline("%s in portcullis chamber", E_phrase(etmp, "are")); wait_synch(); #endif if (e_inview) { @@ -703,13 +661,9 @@ struct entity *etmp; e_died(etmp, 0, CRUSHING); /* no message */ return; } -#ifdef D_DEBUG - pline("%s in here", E_phrase(etmp, "survive")); -#endif + debugpline("%s in here", E_phrase(etmp, "survive")); } else { -#ifdef D_DEBUG - pline("%s on drawbridge square", E_phrase(etmp, "are")); -#endif + debugpline("%s on drawbridge square", E_phrase(etmp, "are")); if (is_pool(etmp->ex, etmp->ey) && !e_inview) if (!Deaf) You_hear("a splash."); @@ -720,9 +674,7 @@ struct entity *etmp; E_phrase(etmp, "fall")); return; } -#ifdef D_DEBUG - pline("%s cannot survive on the drawbridge square",Enam(etmp)); -#endif + debugpline("%s cannot survive on the drawbridge square",E_phrase(etmp, NULL)); if (is_pool(etmp->ex, etmp->ey) || is_lava(etmp->ex, etmp->ey)) if (e_inview && !is_u(etmp)) { /* drown() will supply msgs if nec. */ @@ -938,9 +890,7 @@ int x,y; if (etmp1->edata) { e_inview = e_canseemon(etmp1); if (e_missed(etmp1, TRUE)) { -#ifdef D_DEBUG - pline("%s spared!", E_phrase(etmp1, "are")); -#endif + debugpline("%s spared!", E_phrase(etmp1, "are")); /* if there is water or lava here, fall in now */ if (is_u(etmp1)) spoteffects(FALSE); @@ -957,11 +907,9 @@ int x,y; } else { if (!Deaf && !is_u(etmp1) && !is_pool(x,y)) You_hear("a crushing sound."); -#ifdef D_DEBUG else - pline("%s from shrapnel", + debugpline("%s from shrapnel", E_phrase(etmp1, "die")); -#endif } killer.format = KILLED_BY_AN; Strcpy(killer.name, "collapsing drawbridge"); diff --git a/src/dig.c b/src/dig.c index dee64940c..00a60aaba 100644 --- a/src/dig.c +++ b/src/dig.c @@ -5,8 +5,6 @@ #include "hack.h" -/* #define DEBUG */ /* turn on for diagnostics */ - static NEARDATA boolean did_dig_msg; STATIC_DCL boolean NDECL(rm_waslit); @@ -1692,9 +1690,7 @@ bury_an_obj(otmp) struct obj *otmp2; boolean under_ice; -#ifdef DEBUG - pline("bury_an_obj: %s", xname(otmp)); -#endif + debugpline("bury_an_obj: %s", xname(otmp)); if (otmp == uball) { unpunish(); u.utrap = rn1(50,20); @@ -1756,10 +1752,8 @@ int x, y; { struct obj *otmp, *otmp2; -#ifdef DEBUG if(level.objects[x][y] != (struct obj *)0) - pline("bury_objs: at %d, %d", x, y); -#endif + debugpline("bury_objs: at %d, %d", x, y); for (otmp = level.objects[x][y]; otmp; otmp = otmp2) otmp2 = bury_an_obj(otmp); @@ -1776,9 +1770,7 @@ int x, y; struct obj *otmp, *otmp2, *bball; coord cc; -#ifdef DEBUG - pline("unearth_objs: at %d, %d", x, y); -#endif + debugpline("unearth_objs: at %d, %d", x, y); cc.x = x; cc.y = y; bball = buried_ball(&cc); for (otmp = level.buriedobjlist; otmp; otmp = otmp2) { @@ -1887,9 +1879,7 @@ void bury_monst(mtmp) struct monst *mtmp; { -#ifdef DEBUG - pline("bury_monst: %s", mon_nam(mtmp)); -#endif + debugpline("bury_monst: %s", mon_nam(mtmp)); if(canseemon(mtmp)) { if(is_flyer(mtmp->data) || is_floater(mtmp->data)) { pline_The("%s opens up, but %s is not swallowed!", @@ -1908,9 +1898,7 @@ struct monst *mtmp; void bury_you() { -#ifdef DEBUG - pline("bury_you"); -#endif + debugpline("bury_you"); if (!Levitation && !Flying) { if(u.uswallow) You_feel("a sensation like falling into a trap!"); @@ -1927,9 +1915,7 @@ bury_you() void unearth_you() { -#ifdef DEBUG - pline("unearth_you"); -#endif + debugpline("unearth_you"); u.uburied = FALSE; under_ground(0); if(!uamul || uamul->otyp != AMULET_OF_STRANGULATION) @@ -1940,9 +1926,7 @@ unearth_you() void escape_tomb() { -#ifdef DEBUG - pline("escape_tomb"); -#endif + debugpline("escape_tomb"); if ((Teleportation || can_teleport(youmonst.data)) && (Teleport_control || rn2(3) < Luck+2)) { You("attempt a teleport spell."); @@ -1974,9 +1958,7 @@ bury_obj(otmp) struct obj *otmp; { -#ifdef DEBUG - pline("bury_obj"); -#endif + debugpline("bury_obj"); if(cansee(otmp->ox, otmp->oy)) pline_The("objects on the %s tumble into a hole!", surface(otmp->ox, otmp->oy)); @@ -1987,7 +1969,7 @@ struct obj *otmp; #ifdef DEBUG int -wiz_debug_cmd() /* in this case, bury everything at your loc and around */ +wiz_debug_cmd_bury() /* in this case, bury everything at your loc and around */ { int x, y; diff --git a/src/dungeon.c b/src/dungeon.c index ed6b726de..4c8e6beeb 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -81,6 +81,8 @@ dumpit() s_level *x; branch *br; + if (!showdebug()) return; + for(i = 0; i < n_dgns; i++) { fprintf(stderr, "\n#%d \"%s\" (%s):\n", i, DD.dname, DD.proto); diff --git a/src/eat.c b/src/eat.c index 7259e6424..67e4b88b9 100644 --- a/src/eat.c +++ b/src/eat.c @@ -5,12 +5,6 @@ #include "hack.h" -/* #define DEBUG */ /* uncomment to enable new eat code debugging */ - -#ifdef DEBUG -#define debugpline if (wizard) pline -#endif - STATIC_PTR int NDECL(eatmdone); STATIC_PTR int NDECL(eatfood); STATIC_PTR void FDECL(costly_tin, (int)); @@ -290,15 +284,11 @@ recalc_wt() { struct obj *piece = context.victual.piece; -#ifdef DEBUG debugpline("Old weight = %d", piece->owt); debugpline("Used time = %d, Req'd time = %d", context.victual.usedtime, context.victual.reqtime); -#endif piece->owt = weight(piece); -#ifdef DEBUG debugpline("New weight = %d", piece->owt); -#endif } void @@ -308,9 +298,7 @@ reset_eat() /* called when eating interrupted by an event */ * the round is spent eating. */ if(context.victual.eating && !context.victual.doreset) { -#ifdef DEBUG debugpline("reset_eat..."); -#endif context.victual.doreset = TRUE; } return; @@ -325,9 +313,7 @@ register struct obj *otmp; (void) splitobj(otmp, otmp->quan - 1L); else otmp = splitobj(otmp, 1L); -#ifdef DEBUG debugpline("split object,"); -#endif } if (!otmp->oeaten) { @@ -388,9 +374,7 @@ struct obj *old_obj, *new_obj; STATIC_OVL void do_reset_eat() { -#ifdef DEBUG debugpline("do_reset_eat..."); -#endif if (context.victual.piece) { context.victual.o_id = 0; context.victual.piece = touchfood(context.victual.piece); @@ -731,57 +715,39 @@ register struct permonst *ptr; switch (type) { case FIRE_RES: res = (ptr->mconveys & MR_FIRE) != 0; -#ifdef DEBUG if (res) debugpline("can get fire resistance"); -#endif break; case SLEEP_RES: res = (ptr->mconveys & MR_SLEEP) != 0; -#ifdef DEBUG if (res) debugpline("can get sleep resistance"); -#endif break; case COLD_RES: res = (ptr->mconveys & MR_COLD) != 0; -#ifdef DEBUG if (res) debugpline("can get cold resistance"); -#endif break; case DISINT_RES: res = (ptr->mconveys & MR_DISINT) != 0; -#ifdef DEBUG if (res) debugpline("can get disintegration resistance"); -#endif break; case SHOCK_RES: /* shock (electricity) resistance */ res = (ptr->mconveys & MR_ELEC) != 0; -#ifdef DEBUG if (res) debugpline("can get shock resistance"); -#endif break; case POISON_RES: res = (ptr->mconveys & MR_POISON) != 0; -#ifdef DEBUG if (res) debugpline("can get poison resistance"); -#endif break; case TELEPORT: res = can_teleport(ptr); -#ifdef DEBUG if (res) debugpline("can get teleport"); -#endif break; case TELEPORT_CONTROL: res = control_teleport(ptr); -#ifdef DEBUG if (res) debugpline("can get teleport control"); -#endif break; case TELEPAT: res = telepathic(ptr); -#ifdef DEBUG if (res) debugpline("can get telepathy"); -#endif break; default: /* res stays 0 */ @@ -800,9 +766,7 @@ register struct permonst *ptr; { register int chance; -#ifdef DEBUG debugpline("Attempting to give intrinsic %d", type); -#endif /* some intrinsics are easier to get than others */ switch (type) { case POISON_RES: @@ -831,9 +795,7 @@ register struct permonst *ptr; switch (type) { case FIRE_RES: -#ifdef DEBUG debugpline("Trying to give fire resistance"); -#endif if(!(HFire_resistance & FROMOUTSIDE)) { You(Hallucination ? "be chillin'." : "feel a momentary chill."); @@ -841,27 +803,21 @@ register struct permonst *ptr; } break; case SLEEP_RES: -#ifdef DEBUG debugpline("Trying to give sleep resistance"); -#endif if(!(HSleep_resistance & FROMOUTSIDE)) { You_feel("wide awake."); HSleep_resistance |= FROMOUTSIDE; } break; case COLD_RES: -#ifdef DEBUG debugpline("Trying to give cold resistance"); -#endif if(!(HCold_resistance & FROMOUTSIDE)) { You_feel("full of hot air."); HCold_resistance |= FROMOUTSIDE; } break; case DISINT_RES: -#ifdef DEBUG debugpline("Trying to give disintegration resistance"); -#endif if(!(HDisint_resistance & FROMOUTSIDE)) { You_feel(Hallucination ? "totally together, man." : @@ -870,9 +826,7 @@ register struct permonst *ptr; } break; case SHOCK_RES: /* shock (electricity) resistance */ -#ifdef DEBUG debugpline("Trying to give shock resistance"); -#endif if(!(HShock_resistance & FROMOUTSIDE)) { if (Hallucination) You_feel("grounded in reality."); @@ -882,9 +836,7 @@ register struct permonst *ptr; } break; case POISON_RES: -#ifdef DEBUG debugpline("Trying to give poison resistance"); -#endif if(!(HPoison_resistance & FROMOUTSIDE)) { You_feel(Poison_resistance ? "especially healthy." : "healthy."); @@ -892,9 +844,7 @@ register struct permonst *ptr; } break; case TELEPORT: -#ifdef DEBUG debugpline("Trying to give teleport"); -#endif if(!(HTeleportation & FROMOUTSIDE)) { You_feel(Hallucination ? "diffuse." : "very jumpy."); @@ -902,9 +852,7 @@ register struct permonst *ptr; } break; case TELEPORT_CONTROL: -#ifdef DEBUG debugpline("Trying to give teleport control"); -#endif if(!(HTeleport_control & FROMOUTSIDE)) { You_feel(Hallucination ? "centered in your personal space." : @@ -913,9 +861,7 @@ register struct permonst *ptr; } break; case TELEPAT: -#ifdef DEBUG debugpline("Trying to give telepathy"); -#endif if(!(HTelepat & FROMOUTSIDE)) { You_feel(Hallucination ? "in touch with the cosmos." : @@ -926,9 +872,7 @@ register struct permonst *ptr; } break; default: -#ifdef DEBUG debugpline("Tried to give an impossible intrinsic"); -#endif break; } } @@ -1059,9 +1003,7 @@ register int pm; case PM_DISENCHANTER: /* picks an intrinsic at random and removes it; there's no feedback if hero already lacks the chosen ability */ -#ifdef DEBUG debugpline("using attrcurse to strip an intrinsic"); -#endif attrcurse(); break; case PM_MIND_FLAYER: @@ -1101,9 +1043,7 @@ register int pm; if (conveys_STR) { count = 1; tmp = -1; /* use -1 as fake prop index for STR */ -#ifdef DEBUG debugpline("\"Intrinsic\" strength, %d", tmp); -#endif } for (i = 1; i <= LAST_PROP; i++) { if (!intrinsic_possible(i, ptr)) continue; @@ -1113,9 +1053,7 @@ register int pm; of keeping the old choice (note that 1 in 1 and 0 in 1 are what we want for the first candidate) */ if (!rn2(count)) { -#ifdef DEBUG debugpline("Intrinsic %d replacing %d", i, tmp); -#endif tmp = i; } } @@ -1659,13 +1597,11 @@ start_eating(otmp) /* called as you start to eat */ { const char *old_nomovemsg, *save_nomovemsg; -#ifdef DEBUG debugpline("start_eating: %lx (victual = %lx)", otmp, context.victual.piece); debugpline("reqtime = %d", context.victual.reqtime); debugpline("(original reqtime = %d)", objects[otmp->otyp].oc_delay); debugpline("nmod = %d", context.victual.nmod); debugpline("oeaten = %d", otmp->oeaten); -#endif context.victual.fullwarn = context.victual.doreset = FALSE; context.victual.eating = TRUE; @@ -2505,15 +2441,11 @@ doeat() /* generic "eat" command funtion (see cmd.c) */ if (otmp->otyp == CORPSE) basenutrit = mons[otmp->corpsenm].cnutrit; else basenutrit = objects[otmp->otyp].oc_nutrition; -#ifdef DEBUG debugpline("before rounddiv: context.victual.reqtime == %d", context.victual.reqtime); debugpline("oeaten == %d, basenutrit == %d", otmp->oeaten, basenutrit); -#endif context.victual.reqtime = (basenutrit == 0 ? 0 : rounddiv(context.victual.reqtime * (long)otmp->oeaten, basenutrit)); -#ifdef DEBUG debugpline("after rounddiv: context.victual.reqtime == %d", context.victual.reqtime); -#endif /* calculate the modulo value (nutrit. units per round eating) * note: this isn't exact - you actually lose a little nutrition * due to this method. @@ -2615,9 +2547,7 @@ register int num; { /* See comments in newuhs() for discussion on force_save_hs */ boolean iseating = (occupation == eatfood) || force_save_hs; -#ifdef DEBUG debugpline("lesshungry(%d)", num); -#endif u.uhunger += num; if(u.uhunger >= 2000) { if (!iseating || context.victual.canchoke) { diff --git a/src/files.c b/src/files.c index 03b4d5ea3..f45db8bce 100644 --- a/src/files.c +++ b/src/files.c @@ -2107,6 +2107,9 @@ int src; } else if (src == SET_IN_SYS && match_varname(buf, "SHELLERS", 8)) { if (sysopt.shellers) free(sysopt.shellers); sysopt.shellers = dupstr(bufp); + } else if (src == SET_IN_SYS && match_varname(buf, "DEBUGFILES", 5)) { + if (sysopt.debugfiles) free(sysopt.debugfiles); + sysopt.debugfiles = dupstr(bufp); } else if (src == SET_IN_SYS && match_varname(buf, "SUPPORT", 7)) { if (sysopt.support) free(sysopt.support); sysopt.support = dupstr(bufp); diff --git a/src/hack.c b/src/hack.c index fafff35b6..1edfb9f4e 100644 --- a/src/hack.c +++ b/src/hack.c @@ -767,7 +767,7 @@ int mode; static boolean trav_debug = FALSE; int -wiz_debug_cmd() /* in this case, toggle display of travel debug info */ +wiz_debug_cmd_traveldisplay() /* in this case, toggle display of travel debug info */ { trav_debug = !trav_debug; return 0; diff --git a/src/light.c b/src/light.c index 244126021..f7d43eeee 100644 --- a/src/light.c +++ b/src/light.c @@ -393,18 +393,14 @@ write_ls(fd, ls) otmp = ls->id.a_obj; ls->id = zeroany; ls->id.a_uint = otmp->o_id; -#ifdef DEBUG - if (find_oid((unsigned)ls->id) != otmp) - panic("write_ls: can't find obj #%u!", ls->id.a_uint); -#endif + if (find_oid((unsigned)ls->id.a_uint) != otmp) + debugpline("write_ls: can't find obj #%u!", ls->id.a_uint); } else { /* ls->type == LS_MONSTER */ mtmp = (struct monst *)ls->id.a_monst; ls->id = zeroany; ls->id.a_uint = mtmp->m_id; -#ifdef DEBUG - if (find_mid((unsigned)ls->id, FM_EVERYWHERE) != mtmp) - panic("write_ls: can't find mon #%u!", ls->x_id); -#endif + if (find_mid((unsigned)ls->id.a_uint, FM_EVERYWHERE) != mtmp) + debugpline("write_ls: can't find mon #%u!", ls->id.a_uint); } ls->flags |= LSF_NEEDS_FIXUP; bwrite(fd, (genericptr_t)ls, sizeof(light_source)); diff --git a/src/makemon.c b/src/makemon.c index 9b63c72ec..afaa0140a 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -93,9 +93,7 @@ register int x, y, n; int cnttmp,cntdiv; cnttmp = cnt; -# ifdef DEBUG - pline("init group call x=%d,y=%d,n=%d,cnt=%d.", x, y, n, cnt); -# endif + debugpline("init group call x=%d,y=%d,n=%d,cnt=%d.", x, y, n, cnt); cntdiv = ((u.ulevel < 3) ? 4 : (u.ulevel < 5) ? 2 : 1); #endif /* Tuning: cut down on swarming at low character levels [mrs] */ @@ -760,10 +758,8 @@ boolean ghostly; mvitals[mndx].born++; if ((int) mvitals[mndx].born >= lim && !(mons[mndx].geno & G_NOGEN) && !(mvitals[mndx].mvflags & G_EXTINCT)) { -#ifdef DEBUG - if (wizard) pline("Automatically extinguished %s.", + if (wizard) debugpline("Automatically extinguished %s.", makeplural(mons[mndx].mname)); -#endif mvitals[mndx].mvflags |= G_EXTINCT; reset_rndmonst(mndx); } @@ -906,11 +902,9 @@ register int mmflags; /* if you are to make a specific monster and it has already been genocided, return */ if (mvitals[mndx].mvflags & G_GENOD) return((struct monst *) 0); -#ifdef DEBUG if (wizard && (mvitals[mndx].mvflags & G_EXTINCT)) - pline("Explicitly creating extinct monster %s.", + debugpline("Explicitly creating extinct monster %s.", mons[mndx].mname); -#endif } else { /* make a random (common) monster that can survive here. * (the special levels ask for random monsters at specific @@ -922,9 +916,7 @@ register int mmflags; do { if(!(ptr = rndmonst())) { -#ifdef DEBUG - pline("Warning: no monster."); -#endif + debugpline("Warning: no monster."); return((struct monst *) 0); /* no more monsters! */ } fakemon.data = ptr; /* set up for goodpos */ @@ -1260,9 +1252,7 @@ rndmonst() } if (mndx == SPECIAL_PM) { /* evidently they've all been exterminated */ -#ifdef DEBUG - pline("rndmonst: no common mons!"); -#endif + debugpline("rndmonst: no common mons!"); return (struct permonst *)0; } /* else `mndx' now ready for use below */ zlevel = level_difficulty(); @@ -1300,9 +1290,7 @@ rndmonst() if (rndmonst_state.choice_count <= 0) { /* maybe no common mons left, or all are too weak or too strong */ -#ifdef DEBUG - Norep("rndmonst: choice_count=%d", rndmonst_state.choice_count); -#endif + debugpline("rndmonst: choice_count=%d", rndmonst_state.choice_count); return (struct permonst *)0; } diff --git a/src/mklev.c b/src/mklev.c index 43bccaf40..2d4899984 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -4,11 +4,6 @@ /* NetHack may be freely redistributed. See license for details. */ #include "hack.h" -/* #define DEBUG */ /* uncomment to enable code debugging */ - -#ifdef DEBUG -#define debugpline if (wizard) pline -#endif /* for UNIX, Rand #def'd to (long)lrand48() or (long)random() */ /* croom->lx etc are schar (width <= int), so % arith ensures that */ @@ -689,9 +684,7 @@ makelevel() /* make a secret treasure vault, not connected to the rest */ if(do_vault()) { xchar w,h; -#ifdef DEBUG debugpline("trying to make a vault..."); -#endif w = 1; h = 1; if (check_room(&vault_x, &w, &vault_y, &h, TRUE)) { @@ -1567,9 +1560,7 @@ xchar x, y; *source = u.uz; insert_branch(br, TRUE); -#ifdef DEBUG - pline("Made knox portal."); -#endif + debugpline("Made knox portal."); place_branch(br, x, y); } diff --git a/src/mkmaze.c b/src/mkmaze.c index 7f4536869..0cfdbe35a 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -587,12 +587,10 @@ register const char *s; int x_range = x_maze_max - x_maze_min - 2*INVPOS_X_MARGIN - 1, y_range = y_maze_max - y_maze_min - 2*INVPOS_Y_MARGIN - 1; -#ifdef DEBUG if (x_range <= INVPOS_X_MARGIN || y_range <= INVPOS_Y_MARGIN || (x_range * y_range) <= (INVPOS_DISTANCE * INVPOS_DISTANCE)) - panic("inv_pos: maze is too small! (%d x %d)", + debugpline("inv_pos: maze is too small! (%d x %d)", x_maze_max, y_maze_max); -#endif inv_pos.x = inv_pos.y = 0; /*{occupied() => invocation_pos()}*/ do { x = rn1(x_range, x_maze_min + INVPOS_X_MARGIN + 1); @@ -879,10 +877,8 @@ register xchar x, y, todnum, todlevel; impossible("portal on top of portal??"); return; } -#ifdef DEBUG - pline("mkportal: at (%d,%d), to %s, level %d", + debugpline("mkportal: at (%d,%d), to %s, level %d", x, y, dungeons[todnum].dname, todlevel); -#endif ttmp->dst.dnum = todnum; ttmp->dst.dlevel = todlevel; return; diff --git a/src/mkobj.c b/src/mkobj.c index 47b6668e7..08bb41bfb 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -17,8 +17,6 @@ STATIC_DCL void FDECL(insane_object, (struct obj *,const char *,const char *,struct monst *)); STATIC_DCL void FDECL(check_contained, (struct obj *,const char *)); -/*#define DEBUG_EFFECTS*/ /* show some messages for debugging */ - struct icp { int iprob; /* probability of an item type */ char iclass; /* item class */ @@ -1526,12 +1524,10 @@ struct obj *otmp; /* Adjust the age; must be same as obj_timer_checks() for off ice*/ age = monstermoves - otmp->age; retval += age * (ROT_ICE_ADJUSTMENT-1) / ROT_ICE_ADJUSTMENT; -#ifdef DEBUG_EFFECTS - pline_The("%s age has ice modifications:otmp->age = %ld, returning %ld.", + debugpline("The %s age has ice modifications:otmp->age = %ld, returning %ld.", s_suffix(doname(otmp)),otmp->age, retval); - pline("Effective age of corpse: %ld.", + debugpline("Effective age of corpse: %ld.", monstermoves - retval); -#endif } return retval; } @@ -1560,9 +1556,7 @@ int force; /* 0 = no force so do checks, <0 = force off, >0 force on */ /* mark the corpse as being on ice */ otmp->on_ice = 1; -#ifdef DEBUG_EFFECTS - pline("%s is now on ice at %d,%d.", The(xname(otmp)),x,y); -#endif + debugpline("%s is now on ice at %d,%d.", The(xname(otmp)),x,y); /* Adjust the time remaining */ tleft *= ROT_ICE_ADJUSTMENT; restart_timer = TRUE; @@ -1588,9 +1582,7 @@ int force; /* 0 = no force so do checks, <0 = force off, >0 force on */ long age; otmp->on_ice = 0; -#ifdef DEBUG_EFFECTS - pline("%s is no longer on ice at %d,%d.", The(xname(otmp)),x,y); -#endif + debugpline("%s is no longer on ice at %d,%d.", The(xname(otmp)),x,y); /* Adjust the remaining time */ tleft /= ROT_ICE_ADJUSTMENT; restart_timer = TRUE; diff --git a/src/mon.c b/src/mon.c index 0de59cf8a..d3841462e 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1278,10 +1278,8 @@ register struct monst *mtmp, *mtmp2; /* transfer the monster's inventory */ for (otmp = mtmp2->minvent; otmp; otmp = otmp->nobj) { -#ifdef DEBUG if (otmp->where != OBJ_MINVENT || otmp->ocarry != mtmp) - panic("replmon: minvent inconsistency"); -#endif + debugpline("replmon: minvent inconsistency"); otmp->ocarry = mtmp2; } mtmp->minvent = 0; diff --git a/src/pickup.c b/src/pickup.c index 30188e5f2..ee0d91dc7 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -903,9 +903,7 @@ int how; /* type of query */ (*pick_list)->item.a_int = curr->oclass; return 1; } else { -#ifdef DEBUG - impossible("query_category: no single object match"); -#endif + debugpline("query_category: no single object match"); } return 0; } diff --git a/src/questpgr.c b/src/questpgr.c index 9f717754f..e85877840 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -12,8 +12,6 @@ #define QTEXT_FILE "quest.dat" -/* #define DEBUG */ /* uncomment for debugging */ - /* from sp_lev.c, for deliver_splev_message() */ extern char *lev_message; @@ -46,6 +44,8 @@ dump_qtlist() /* dump the character msg list to check appearance */ struct qtmsg *msg; long size; + if (!showdebug()) return; + for (msg = qt_list.chrole; msg->msgnum > 0; msg++) { pline("msgnum %d: delivery %c", msg->msgnum, msg->delivery); @@ -54,7 +54,10 @@ dump_qtlist() /* dump the character msg list to check appearance */ deliver_by_window(msg, NHW_TEXT); } } -#endif /* DEBUG */ +#else +static void +dump_qtlist() { } +#endif /* !DEBUG */ static void Fread(ptr, size, nitems, stream) @@ -133,9 +136,7 @@ load_qtlist() if (!qt_list.common || !qt_list.chrole) impossible("load_qtlist: cannot load quest text."); -#ifdef DEBUG dump_qtlist(); -#endif return; /* no ***DON'T*** close the msg_file */ } diff --git a/src/restore.c b/src/restore.c index b4d4bb7fb..af974d147 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1153,9 +1153,7 @@ register int fd; ++msgcount; } if (msgcount) putmsghistory((char *)0, TRUE); -#ifdef DEBUG_MSGCOUNT - pline("Read %d messages from savefile.", msgcount); -#endif + debugpline("Read %d messages from savefile.", msgcount); } /* Clear all structures for object and monster ID mapping. */ diff --git a/src/rnd.c b/src/rnd.c index a2ce45685..662d1a275 100644 --- a/src/rnd.c +++ b/src/rnd.c @@ -5,10 +5,6 @@ #include "hack.h" -#if defined(BETA) && !defined(DEBUG) && !defined(NODEBUG) -#define DEBUG -#endif - /* "Rand()"s definition is determined by [OS]conf.h */ #if defined(LINT) && defined(UNIX) /* rand() is long... */ extern int NDECL(rand); @@ -26,9 +22,9 @@ int rn2(x) /* 0 <= rn2(x) < x */ register int x; { -#ifdef DEBUG +#ifdef BETA if (x <= 0) { - impossible("rn2(%d) attempted", x); + debugpline("rn2(%d) attempted", x); return(0); } x = RND(x); @@ -44,9 +40,9 @@ register int x; /* good luck approaches 0, bad luck approaches (x-1) */ { register int i, adjustment; -#ifdef DEBUG +#ifdef BETA if (x <= 0) { - impossible("rnl(%d) attempted", x); + debugpline("rnl(%d) attempted", x); return(0); } #endif @@ -83,9 +79,9 @@ int rnd(x) /* 1 <= rnd(x) <= x */ register int x; { -#ifdef DEBUG +#ifdef BETA if (x <= 0) { - impossible("rnd(%d) attempted", x); + debugpline("rnd(%d) attempted", x); return(1); } x = RND(x)+1; @@ -101,9 +97,9 @@ register int n, x; { register int tmp = n; -#ifdef DEBUG +#ifdef BETA if (x < 0 || n < 0 || (x == 0 && n != 0)) { - impossible("d(%d,%d) attempted", n, x); + debugpline("d(%d,%d) attempted", n, x); return(1); } #endif diff --git a/src/save.c b/src/save.c index 88db771e2..1fa51dfaa 100644 --- a/src/save.c +++ b/src/save.c @@ -1210,9 +1210,7 @@ int fd, mode; } bwrite(fd, (genericptr_t) &minusone, sizeof(int)); } -#ifdef DEBUG_MSGCOUNT - pline("Stored %d messages into savefile.", msgcount); -#endif + debugpline("Stored %d messages into savefile.", msgcount); /* note: we don't attempt to handle release_data() here */ } diff --git a/src/shk.c b/src/shk.c index 0fe0e94db..12f22eb40 100644 --- a/src/shk.c +++ b/src/shk.c @@ -5,8 +5,6 @@ #include "hack.h" -/*#define DEBUG*/ - #define PAY_SOME 2 #define PAY_BUY 1 #define PAY_CANT 0 /* too poor */ @@ -1207,9 +1205,7 @@ dopay() } if(!shkp) { -#ifdef DEBUG - pline("dopay: null shkp."); -#endif + debugpline("dopay: null shkp."); return(0); } proceed: diff --git a/src/sp_lev.c b/src/sp_lev.c index f27637b9b..6be2c9713 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -12,11 +12,6 @@ #include "hack.h" #include "dlb.h" -/* #define DEBUG */ /* uncomment to enable code debugging */ - -#ifdef DEBUG -#define debugpline if (wizard) pline -#endif #include "sp_lev.h" @@ -329,10 +324,8 @@ chk: lev = &levl[x][y]; for (; y <= ymax; y++) { if (lev++->typ) { -#ifdef DEBUG if(!vault) debugpline("strange area [%d,%d] in check_room.",x,y); -#endif if (!rn2(3)) return FALSE; if (x < *lowx) *lowx = x + xlim + 1; @@ -405,9 +398,7 @@ xchar rtype, rlit; r1 = rnd_rect(); /* Get a random rectangle */ if (!r1) { /* No more free rectangles ! */ -#ifdef DEBUG debugpline("No more rects..."); -#endif return FALSE; } hx = r1->hx; @@ -1320,10 +1311,8 @@ schar ftyp, btyp; if (xx <= 0 || yy <= 0 || tx <= 0 || ty <= 0 || xx > COLNO-1 || tx > COLNO-1 || yy > ROWNO-1 || ty > ROWNO-1) { -#ifdef DEBUG debugpline("dig_corridor: bad coords : (%d,%d) (%d,%d).", xx,yy,tx,ty); -#endif return FALSE; } if (tx > xx) dx = 1; diff --git a/src/steal.c b/src/steal.c index 0812a79df..bf7238b01 100644 --- a/src/steal.c +++ b/src/steal.c @@ -424,12 +424,12 @@ register struct monst *mtmp; register struct obj *otmp; { int freed_otmp; + boolean snuff_otmp = FALSE; /* if monster is acquiring a thrown or kicked object, the throwing or kicking code shouldn't continue to track and place it */ if (otmp == thrownobj) thrownobj = 0; else if (otmp == kickedobj) kickedobj = 0; - boolean snuff_otmp = FALSE; /* don't want hidden light source inside the monster; assumes that engulfers won't have external inventories; whirly monsters cause the light to be extinguished rather than letting it shine thru */ diff --git a/src/sys.c b/src/sys.c index 2f6c5fd87..b559c1450 100644 --- a/src/sys.c +++ b/src/sys.c @@ -20,6 +20,7 @@ sys_early_init(){ #else sysopt.wizards = WIZARD_NAME; #endif + sysopt.debugfiles = NULL; sysopt.shellers = NULL; sysopt.maxplayers = 0; /* XXX eventually replace MAX_NR_OF_PLAYERS */ diff --git a/src/teleport.c b/src/teleport.c index ab8bb063e..cd179c1f1 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -121,9 +121,7 @@ unsigned entflags; struct monst fakemon; /* dummy monster */ if (!mdat) { -#ifdef DEBUG - pline("enexto() called with mdat==0"); -#endif + debugpline("enexto() called with mdat==0"); /* default to player's original monster type */ mdat = &mons[u.umonster]; } diff --git a/src/zap.c b/src/zap.c index c4d98c33c..97fa65a15 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1717,9 +1717,7 @@ struct obj *obj, *otmp; if (context.bypasses) return 0; else { -#ifdef DEBUG - pline("%s for a moment.", Tobjnam(obj, "pulsate")); -#endif + debugpline("%s for a moment.", Tobjnam(obj, "pulsate")); obj->bypass = 0; } } @@ -3418,9 +3416,7 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */ resist(mon, type < ZT_SPELL(0) ? WAND_CLASS : '\0', 0, NOTELL)) tmp /= 2; if (tmp < 0) tmp = 0; /* don't allow negative damage */ -#ifdef WIZ_PATCH_DEBUG - pline("zapped monster hp = %d (= %d - %d)", mon->mhp-tmp,mon->mhp,tmp); -#endif + debugpline("zapped monster hp = %d (= %d - %d)", mon->mhp-tmp,mon->mhp,tmp); mon->mhp -= tmp; return(tmp); } diff --git a/sys/unix/sysconf b/sys/unix/sysconf index 3eb07ecaa..74e7fb1ae 100644 --- a/sys/unix/sysconf +++ b/sys/unix/sysconf @@ -14,6 +14,11 @@ WIZARDS=root games # Uses the same syntax as the WIZARDS option above. #SHELLERS= +# Show debugging information originating from these source files. +# Use '*' for all, or list source files separated by spaces. +# Only available if game has been compiled with DEBUG. +#DEBUGFILES=* + # Limit the number of simultaneous games (see also nethack.sh). MAXPLAYERS=10 diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 12ec044b3..d4c921501 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1946,7 +1946,7 @@ register int x, y; /* not xchar: perhaps xchar is unsigned and case NHW_TEXT: s = "[text window]"; break; case NHW_BASE: s = "[base window]"; break; } - impossible("bad curs positioning win %d %s (%d,%d)", window, s, x, y); + debugpline("bad curs positioning win %d %s (%d,%d)", window, s, x, y); return; } #endif From dcc2f8ba93b76f2cd920d0549216b1841038f961 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 27 Feb 2015 19:05:01 -0500 Subject: [PATCH 131/354] Make SEDUCE unconditional. --- include/config.h | 1 - include/extern.h | 2 -- include/monattk.h | 1 - include/sys.h | 6 +----- src/mhitm.c | 2 -- src/mhitu.c | 23 ++++------------------- src/monst.c | 10 ++-------- src/sounds.c | 2 -- src/sys.c | 2 -- src/uhitm.c | 2 -- src/zap.c | 2 -- util/makedefs.c | 3 --- 12 files changed, 7 insertions(+), 49 deletions(-) diff --git a/include/config.h b/include/config.h index 1af4b0560..3084be864 100644 --- a/include/config.h +++ b/include/config.h @@ -417,7 +417,6 @@ typedef unsigned char uchar; /* dungeon levels */ #define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */ /* monsters & objects */ -#define SEDUCE /* Succubi/incubi seduction, by KAA, suggested by IM */ /* I/O */ #define REDO /* support for redoing last command - DGK */ #if !defined(MAC) diff --git a/include/extern.h b/include/extern.h index 492718730..9f03e8151 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1112,9 +1112,7 @@ E boolean NDECL(gulp_blnd_check); E int FDECL(gazemu, (struct monst *,struct attack *)); E void FDECL(mdamageu, (struct monst *,int)); E int FDECL(could_seduce, (struct monst *,struct monst *,struct attack *)); -#ifdef SEDUCE E int FDECL(doseduce, (struct monst *)); -#endif /* ### minion.c ### */ diff --git a/include/monattk.h b/include/monattk.h index 7c228c87d..1bd7ff616 100644 --- a/include/monattk.h +++ b/include/monattk.h @@ -72,7 +72,6 @@ #define AD_DISE 33 /* confers diseases */ #define AD_DCAY 34 /* decays organics (brown Pudding) */ #define AD_SSEX 35 /* Succubus seduction (extended) */ - /* If no SEDUCE then same as AD_SEDU */ #define AD_HALU 36 /* causes hallucination */ #define AD_DETH 37 /* for Death only */ #define AD_PEST 38 /* for Pestilence only */ diff --git a/include/sys.h b/include/sys.h index ac39239ee..713e33a55 100644 --- a/include/sys.h +++ b/include/sys.h @@ -35,11 +35,7 @@ struct sysopt { }; E struct sysopt sysopt; -#ifdef SEDUCE -# define SYSOPT_SEDUCE sysopt.seduce -#else -# define SYSOPT_SEDUCE 0 -#endif +#define SYSOPT_SEDUCE sysopt.seduce #endif /* SYS_H */ diff --git a/src/mhitm.c b/src/mhitm.c index 0e8bf7d1c..24e5c7f1c 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1083,9 +1083,7 @@ mdamagem(magr, mdef, mattk) /* Automatic kill if drained past level 0 */ } break; -#ifdef SEDUCE case AD_SSEX: -#endif case AD_SITM: /* for now these are the same */ case AD_SEDU: if (magr->mcan) break; diff --git a/src/mhitu.c b/src/mhitu.c index 511513f39..6f298ff63 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -12,9 +12,7 @@ STATIC_DCL void FDECL(urustm, (struct monst *, struct obj *)); STATIC_DCL boolean FDECL(u_slip_free, (struct monst *,struct attack *)); STATIC_DCL int FDECL(passiveum, (struct permonst *,struct monst *,struct attack *)); -#ifdef SEDUCE STATIC_DCL void FDECL(mayberem, (struct obj *, const char *)); -#endif STATIC_DCL boolean FDECL(diseasemu, (struct permonst *)); STATIC_DCL int FDECL(hitmu, (struct monst *,struct attack *)); @@ -1256,7 +1254,6 @@ dopois: if(!mtmp->mcan) stealgold(mtmp); break; -#ifdef SEDUCE case AD_SSEX: if(SYSOPT_SEDUCE){ if(could_seduce(mtmp, &youmonst, mattk) == 1 @@ -1266,7 +1263,6 @@ dopois: break; } /* else FALLTHRU */ -#endif case AD_SITM: /* for now these are the same */ case AD_SEDU: if (is_animal(mtmp->data)) { @@ -1274,10 +1270,7 @@ dopois: if (mtmp->mcan) break; /* Continue below */ } else if (dmgtype(youmonst.data, AD_SEDU) -#ifdef SEDUCE - || (SYSOPT_SEDUCE && dmgtype(youmonst.data, AD_SSEX)) -#endif - ) { + || (SYSOPT_SEDUCE && dmgtype(youmonst.data, AD_SSEX))) { pline("%s %s.", Monnam(mtmp), mtmp->minvent ? "brags about the goods some dungeon explorer provided" : "makes some remarks about how difficult theft is lately"); @@ -2198,19 +2191,13 @@ struct attack *mattk; gendef = gender(mdef); } - if(agrinvis && !defperc -#ifdef SEDUCE - && (!SYSOPT_SEDUCE || ( mattk && mattk->adtyp != AD_SSEX)) -#endif - ) + if(agrinvis && !defperc && + (!SYSOPT_SEDUCE || ( mattk && mattk->adtyp != AD_SSEX))) return 0; if(pagr->mlet != S_NYMPH && ((pagr != &mons[PM_INCUBUS] && pagr != &mons[PM_SUCCUBUS]) -#ifdef SEDUCE - || (SYSOPT_SEDUCE && mattk && mattk->adtyp != AD_SSEX) -#endif - )) + || (SYSOPT_SEDUCE && mattk && mattk->adtyp != AD_SSEX))) return 0; if(genagr == 1 - gendef) @@ -2219,7 +2206,6 @@ struct attack *mattk; return (pagr->mlet == S_NYMPH) ? 2 : 0; } -#ifdef SEDUCE /* Returns 1 if monster teleported */ int doseduce(mon) @@ -2485,7 +2471,6 @@ const char *str; } remove_worn_item(obj, TRUE); } -#endif /* SEDUCE */ STATIC_OVL int passiveum(olduasmon,mtmp,mattk) diff --git a/src/monst.c b/src/monst.c index 420118eda..d6b843b6c 100644 --- a/src/monst.c +++ b/src/monst.c @@ -2554,14 +2554,9 @@ struct permonst _mons2[] = { #define SEDUCTION_ATTACKS_NO \ A(ATTK(AT_CLAW, AD_PHYS, 1, 3), ATTK(AT_CLAW, AD_PHYS, 1, 3), \ ATTK(AT_BITE, AD_DRLI, 2, 6), NO_ATTK, NO_ATTK, NO_ATTK) -#ifdef SEDUCE -# define SEDUCTION_ATTACKS SEDUCTION_ATTACKS_YES -#else -# define SEDUCTION_ATTACKS SEDUCTION_ATTACKS_NO -#endif MON("succubus", S_DEMON, LVL(6, 12, 0, 70, -9), (G_NOCORPSE|1), - SEDUCTION_ATTACKS, + SEDUCTION_ATTACKS_YES, SIZ(WT_HUMAN, 400, MS_SEDUCE, MZ_HUMAN), MR_FIRE|MR_POISON, 0, M1_HUMANOID|M1_FLY|M1_POIS, M2_DEMON|M2_STALK|M2_HOSTILE|M2_NASTY|M2_FEMALE, @@ -2577,12 +2572,11 @@ struct permonst _mons2[] = { CLR_BROWN), MON("incubus", S_DEMON, LVL(6, 12, 0, 70, -9), (G_NOCORPSE|1), - SEDUCTION_ATTACKS, + SEDUCTION_ATTACKS_YES, SIZ(WT_HUMAN, 400, MS_SEDUCE, MZ_HUMAN), MR_FIRE|MR_POISON, 0, M1_HUMANOID|M1_FLY|M1_POIS, M2_DEMON|M2_STALK|M2_HOSTILE|M2_NASTY|M2_MALE, M3_INFRAVISIBLE|M3_INFRAVISION, CLR_GRAY), -#undef SEDUCTION_ATTACKS /* Used by AD&D for a type of demon, originally one of the Furies */ /* and spelled this way */ MON("erinys", S_DEMON, diff --git a/src/sounds.c b/src/sounds.c index 593c3ecd6..d57904778 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -807,7 +807,6 @@ register struct monst *mtmp; case MS_SEDUCE: { int swval; -#ifdef SEDUCE if (SYSOPT_SEDUCE) { if (ptr->mlet != S_NYMPH && could_seduce(mtmp, &youmonst, (struct attack *)0) == 1) { @@ -816,7 +815,6 @@ register struct monst *mtmp; } swval = ((poly_gender() != (int) mtmp->female) ? rn2(3) : 0); } else -#endif swval = ((poly_gender() == 0) ? rn2(3) : 0); switch(swval){ case 2: diff --git a/src/sys.c b/src/sys.c index b559c1450..5f17a0a91 100644 --- a/src/sys.c +++ b/src/sys.c @@ -54,10 +54,8 @@ sys_early_init(){ # endif #endif -#ifdef SEDUCE sysopt.seduce = 1; /* if it's compiled in, default to on */ sysopt_seduce_set(sysopt.seduce); -#endif } diff --git a/src/uhitm.c b/src/uhitm.c index 04ec05c11..bbb3a7fb4 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1452,9 +1452,7 @@ register struct attack *mattk; minstapetrify(mdef, TRUE); tmp = 0; break; -#ifdef SEDUCE case AD_SSEX: -#endif case AD_SEDU: case AD_SITM: steal_it(mdef, mattk); diff --git a/src/zap.c b/src/zap.c index 97fa65a15..cbc533041 100644 --- a/src/zap.c +++ b/src/zap.c @@ -584,9 +584,7 @@ coord *cc; /* most cancelled monsters return to normal, but some need to stay cancelled */ if (!dmgtype(mtmp2->data, AD_SEDU) -#ifdef SEDUCE && (!SYSOPT_SEDUCE || !dmgtype(mtmp2->data, AD_SSEX)) -#endif ) mtmp2->mcan = 0; mtmp2->mcansee = 1; /* set like in makemon */ mtmp2->mblinded = 0; diff --git a/util/makedefs.c b/util/makedefs.c index 9102945ce..32107d0ab 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1298,9 +1298,6 @@ static const char *build_opts[] = { # endif # endif #endif -#ifdef SEDUCE - "seduction", -#endif #ifdef SHELL "shell command", #endif From 8798197d85c8dcfa10479e23a9107b3668caf9b5 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 27 Feb 2015 19:06:01 -0500 Subject: [PATCH 132/354] Make BARGETHROUGH unconditional. --- include/config.h | 1 - include/extern.h | 6 ------ include/mfndpos.h | 2 -- include/mondata.h | 2 -- include/monflag.h | 1 - src/dogmove.c | 20 -------------------- src/mhitm.c | 2 -- src/mon.c | 12 ------------ src/monmove.c | 12 ------------ util/makedefs.c | 3 --- 10 files changed, 61 deletions(-) diff --git a/include/config.h b/include/config.h index 3084be864..399217b6f 100644 --- a/include/config.h +++ b/include/config.h @@ -425,7 +425,6 @@ typedef unsigned char uchar; # endif #endif #define AUTOPICKUP_EXCEPTIONS /* exceptions to autopickup */ -#define BARGETHROUGH /* allow some monsters to move others out of their way */ #ifdef REDO # define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ diff --git a/include/extern.h b/include/extern.h index 9f03e8151..e4cccef6f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -520,9 +520,7 @@ E void FDECL(clear_symsetentry, (int,BOOLEAN_P)); E void FDECL(update_l_symset, (struct symparse *,int)); E void FDECL(update_r_symset, (struct symparse *,int)); #endif -#ifdef BARGETHROUGH E boolean FDECL(cursed_object_at, (int, int)); -#endif /* ### dungeon.c ### */ @@ -1090,9 +1088,7 @@ E int FDECL(buzzmu, (struct monst *,struct attack *)); E int FDECL(fightm, (struct monst *)); E int FDECL(mattackm, (struct monst *,struct monst *)); E boolean FDECL(engulf_target, (struct monst *,struct monst *)); -#ifdef BARGETHROUGH E int FDECL(mdisplacem, (struct monst *,struct monst *,BOOLEAN_P)); -#endif E void FDECL(paralyze_monst, (struct monst *,int)); E int FDECL(sleep_monst, (struct monst *,int,int)); E void FDECL(slept_monst, (struct monst *)); @@ -1374,11 +1370,9 @@ E boolean FDECL(accessible, (int,int)); E void FDECL(set_apparxy, (struct monst *)); E boolean FDECL(can_ooze, (struct monst *)); E boolean FDECL(can_fog, (struct monst *)); -#ifdef BARGETHROUGH E boolean FDECL(should_displace, (struct monst *,coord *,long *,int, XCHAR_P,XCHAR_P)); E boolean FDECL(undesirable_disp, (struct monst *,XCHAR_P,XCHAR_P)); -#endif /* ### monst.c ### */ diff --git a/include/mfndpos.h b/include/mfndpos.h index ffbb50d74..00406798d 100644 --- a/include/mfndpos.h +++ b/include/mfndpos.h @@ -7,9 +7,7 @@ #ifndef MFNDPOS_H #define MFNDPOS_H -#ifdef BARGETHROUGH #define ALLOW_MDISP 0x00001000L /* can displace a monster out of its way */ -#endif #define ALLOW_TRAPS 0x00020000L /* can enter traps */ #define ALLOW_U 0x00040000L /* can attack you */ #define ALLOW_M 0x00080000L /* can attack other monsters */ diff --git a/include/mondata.h b/include/mondata.h index 3996e439e..e5c7332ea 100644 --- a/include/mondata.h +++ b/include/mondata.h @@ -131,9 +131,7 @@ #define is_covetous(ptr) ((ptr->mflags3 & M3_COVETOUS)) #define infravision(ptr) ((ptr->mflags3 & M3_INFRAVISION)) #define infravisible(ptr) ((ptr->mflags3 & M3_INFRAVISIBLE)) -#ifdef BARGETHROUGH #define is_displacer(ptr) (((ptr)->mflags3 & M3_DISPLACES) != 0L) -#endif #define is_mplayer(ptr) (((ptr) >= &mons[PM_ARCHEOLOGIST]) && \ ((ptr) <= &mons[PM_WIZARD])) #define is_rider(ptr) ((ptr) == &mons[PM_DEATH] || \ diff --git a/include/monflag.h b/include/monflag.h index bf6875581..df703dc3d 100644 --- a/include/monflag.h +++ b/include/monflag.h @@ -161,7 +161,6 @@ #define M3_INFRAVISION 0x0100 /* has infravision */ #define M3_INFRAVISIBLE 0x0200 /* visible by infravision */ -/* define the bit even if BARGETHROUGH is not defined for savefile compat. */ #define M3_DISPLACES 0x0400 /* moves monsters out of its way */ #define MZ_TINY 0 /* < 2' */ diff --git a/src/dogmove.c b/src/dogmove.c index 0b6e7a6f8..604c52267 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -109,19 +109,11 @@ struct monst *mon; static NEARDATA const char nofetch[] = { BALL_CLASS, CHAIN_CLASS, ROCK_CLASS, 0 }; -#ifndef BARGETHROUGH -STATIC_OVL boolean FDECL(cursed_object_at, (int, int)); -#endif /* not BARGETHROUGH */ - STATIC_VAR xchar gtyp, gx, gy; /* type and position of dog's current goal */ STATIC_PTR void FDECL(wantdoor, (int, int, genericptr_t)); -#ifdef BARGETHROUGH boolean -#else -STATIC_OVL boolean -#endif cursed_object_at(x, y) int x, y; { @@ -584,9 +576,7 @@ register int after; /* this is extra fast monster movement */ struct obj *obj = (struct obj *) 0; xchar otyp; boolean has_edog, cursemsg[9], do_eat = FALSE; -#ifdef BARGETHROUGH boolean better_with_displacing = FALSE; -#endif xchar nix, niy; /* position mtmp is (considering) moving to */ register int nx, ny; /* temporary coordinates */ xchar cnt, uncursedcnt, chcnt; @@ -642,9 +632,7 @@ register int after; /* this is extra fast monster movement */ if (passes_walls(mtmp->data)) allowflags |= (ALLOW_ROCK | ALLOW_WALL); if (passes_bars(mtmp->data)) allowflags |= ALLOW_BARS; if (throws_rocks(mtmp->data)) allowflags |= ALLOW_ROCK; -#ifdef BARGETHROUGH if (is_displacer(mtmp->data)) allowflags |= ALLOW_MDISP; -#endif if (Conflict && !resist(mtmp, RING_CLASS, 0, 0)) { allowflags |= ALLOW_U; if (!has_edog) { @@ -681,19 +669,13 @@ register int after; /* this is extra fast monster movement */ uncursedcnt = 0; for (i = 0; i < cnt; i++) { nx = poss[i].x; ny = poss[i].y; -#ifdef BARGETHROUGH if (MON_AT(nx,ny) && !((info[i] & ALLOW_M) || info[i] & ALLOW_MDISP)) continue; -#else - if (MON_AT(nx,ny) && !(info[i] & ALLOW_M)) continue; -#endif if (cursed_object_at(nx, ny)) continue; uncursedcnt++; } -#ifdef BARGETHROUGH better_with_displacing = should_displace(mtmp,poss,info,cnt,gx,gy); -#endif chcnt = 0; chi = -1; @@ -747,7 +729,6 @@ register int after; /* this is extra fast monster movement */ } return 0; } -#ifdef BARGETHROUGH if ((info[i] & ALLOW_MDISP) && MON_AT(nx, ny) && better_with_displacing && !undesirable_disp(mtmp,nx,ny)) { @@ -757,7 +738,6 @@ register int after; /* this is extra fast monster movement */ if (mstatus & MM_DEF_DIED) return 2; return 0; } -#endif /* BARGETHROUGH */ { /* Dog avoids harmful traps, but perhaps it has to pass one * in order to follow player. (Non-harmful traps do not diff --git a/src/mhitm.c b/src/mhitm.c index 24e5c7f1c..47a14915f 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -168,7 +168,6 @@ fightm(mtmp) /* have monsters fight each other */ return 0; } -#ifdef BARGETHROUGH /* * mdisplacem() -- attacker moves defender out of the way; * returns same results as mattackm(). @@ -244,7 +243,6 @@ boolean quietly; return MM_HIT; } -#endif /* BARGETHROUGH */ /* * mattackm() -- a monster attacks another monster. diff --git a/src/mon.c b/src/mon.c index d3841462e..4823ae1c7 100644 --- a/src/mon.c +++ b/src/mon.c @@ -14,9 +14,7 @@ STATIC_DCL boolean FDECL(restrap,(struct monst *)); STATIC_DCL long FDECL(mm_aggression, (struct monst *,struct monst *)); -#ifdef BARGETHROUGH STATIC_DCL long FDECL(mm_displacement, (struct monst *,struct monst *)); -#endif STATIC_DCL int NDECL(pick_animal); STATIC_DCL void FDECL(kill_eggs, (struct obj *)); STATIC_DCL void FDECL(dealloc_mextra, (struct mextra *)); @@ -1083,13 +1081,6 @@ nexttry: /* eels prefer the water, but if there is no water nearby, struct monst *mtmp2 = m_at(nx, ny); long mmflag = flag | mm_aggression(mon, mtmp2); -#ifndef BARGETHROUGH - if (!(mmflag & ALLOW_M)) continue; - info[cnt] |= ALLOW_M; - if (mtmp2->mtame) { - if (!(mmflag & ALLOW_TM)) continue; - info[cnt] |= ALLOW_TM; -#else /* BARGETHROUGH */ if (mmflag & ALLOW_M) { info[cnt] |= ALLOW_M; if (mtmp2->mtame) { @@ -1100,7 +1091,6 @@ nexttry: /* eels prefer the water, but if there is no water nearby, mmflag = flag | mm_displacement(mon, mtmp2); if (!(mmflag & ALLOW_MDISP)) continue; info[cnt] |= ALLOW_MDISP; -#endif /* BARGETHROUGH */ } } /* Note: ALLOW_SANCT only prevents movement, not */ @@ -1206,7 +1196,6 @@ struct monst *magr, /* monster that is currently deciding where to move */ return 0L; } -#ifdef BARGETHROUGH /* Monster displacing another monster out of the way */ STATIC_OVL long mm_displacement(magr, mdef) @@ -1232,7 +1221,6 @@ struct monst *magr, /* monster that is currently deciding where to move */ return ALLOW_MDISP; return 0L; } -#endif /* BARGETHROUGH */ boolean monnear(mon, x, y) diff --git a/src/monmove.c b/src/monmove.c index 316018e52..81eb563d3 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -579,7 +579,6 @@ register struct monst *mtmp; return(FALSE); } -#ifdef BARGETHROUGH /* * should_displace() * @@ -623,7 +622,6 @@ xchar gx, gy; return TRUE; return FALSE; } -#endif /* BARGETHROUGH */ /* Return values: * 0: did not move, but can still attack and do other stuff. @@ -644,9 +642,7 @@ register int after; boolean can_open=0, can_unlock=0, doorbuster=0; boolean uses_items=0, setlikes=0; boolean avoid=FALSE; -#ifdef BARGETHROUGH boolean better_with_displacing = FALSE; -#endif struct permonst *ptr; struct monst *mtoo; schar mmoved = 0; /* not strictly nec.: chi >= 0 will do */ @@ -956,19 +952,15 @@ not_special: for(i = 0; i < cnt; i++) if(!(info[i] & NOTONL)) avoid=TRUE; } -#ifdef BARGETHROUGH better_with_displacing = should_displace(mtmp,poss,info,cnt,gx,gy); -#endif for(i=0; i < cnt; i++) { if (avoid && (info[i] & NOTONL)) continue; nx = poss[i].x; ny = poss[i].y; -#ifdef BARGETHROUGH if (MON_AT(nx,ny) && (info[i] & ALLOW_MDISP) && !(info[i] & ALLOW_M) && !better_with_displacing) continue; -#endif if (appr != 0) { mtrk = &mtmp->mtrack[0]; for(j=0; j < jcnt; mtrk++, j++) @@ -1064,7 +1056,6 @@ not_special: return 3; } -#ifdef BARGETHROUGH if((info[chi] & ALLOW_MDISP)) { struct monst *mtmp2; int mstatus; @@ -1075,7 +1066,6 @@ not_special: if (mstatus & MM_HIT) return 1; return 3; } -#endif /* BARGETHROUGH */ if (!m_in_out_region(mtmp,nix,niy)) return 3; @@ -1369,7 +1359,6 @@ found_you: mtmp->muy = my; } -#ifdef BARGETHROUGH /* * mon-to-mon displacement is a deliberate "get out of my way" act, * not an accidental bump, so we don't consider mstun or mconf in @@ -1401,7 +1390,6 @@ xchar x,y; return FALSE; } -#endif /* BARGETHROUGH */ /* * Inventory prevents passage under door. diff --git a/util/makedefs.c b/util/makedefs.c index 32107d0ab..b0d9f2078 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1247,9 +1247,6 @@ static const char *build_opts[] = { #ifdef MAIL "mail daemon", #endif -#ifdef BARGETHROUGH - "monsters moving monsters", -#endif #ifdef GNUDOS "MSDOS protected mode", #endif From 3481ec658974d7021dac291ca8ac1a4eac72d32e Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 27 Feb 2015 19:06:17 -0500 Subject: [PATCH 133/354] Make AUTOPICKUP_EXCEPTIONS unconditional. --- include/config.h | 3 +-- include/decl.h | 4 +--- include/extern.h | 6 +----- include/flag.h | 4 +--- include/wceconf.h | 4 +--- src/files.c | 4 +--- src/options.c | 16 +--------------- src/pickup.c | 8 +------- src/save.c | 4 +--- util/makedefs.c | 5 +---- 10 files changed, 10 insertions(+), 48 deletions(-) diff --git a/include/config.h b/include/config.h index 399217b6f..282b6949b 100644 --- a/include/config.h +++ b/include/config.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 config.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 config.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.48 $ */ /* NetHack 3.5 config.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.37 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -424,7 +424,6 @@ typedef unsigned char uchar; # define CLIPPING /* allow smaller screens -- ERS */ # endif #endif -#define AUTOPICKUP_EXCEPTIONS /* exceptions to autopickup */ #ifdef REDO # define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ diff --git a/include/decl.h b/include/decl.h index 1e882705f..4733b5317 100644 --- a/include/decl.h +++ b/include/decl.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 decl.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 decl.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.50 $ */ /* NetHack 3.5 decl.h $Date: 2011/12/29 20:06:27 $ $Revision: 1.44 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -381,13 +381,11 @@ E char *fqn_prefix_names[PREFIX_COUNT]; E NEARDATA struct savefile_info sfcap, sfrestinfo, sfsaveinfo; -#ifdef AUTOPICKUP_EXCEPTIONS struct autopickup_exception { char *pattern; boolean grab; struct autopickup_exception *next; }; -#endif /* AUTOPICKUP_EXCEPTIONS */ #ifdef PANICTRACE E char *ARGV0; diff --git a/include/extern.h b/include/extern.h index e4cccef6f..be15406c2 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 extern.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 extern.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.390 $ */ /* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1587,10 +1587,8 @@ E void FDECL(set_duplicate_opt_detection, (int)); E void FDECL(set_wc_option_mod_status, (unsigned long, int)); E void FDECL(set_wc2_option_mod_status, (unsigned long, int)); E void FDECL(set_option_mod_status, (const char *,int)); -#ifdef AUTOPICKUP_EXCEPTIONS E int FDECL(add_autopickup_exception, (const char *)); E void NDECL(free_autopickup_exceptions); -#endif /* AUTOPICKUP_EXCEPTIONS */ #ifdef LOADSYMSETS E int FDECL(load_symset, (const char *,int)); E void FDECL(parsesymbols, (char *)); @@ -1687,9 +1685,7 @@ E boolean FDECL(container_gone, (int (*)(OBJ_P))); E int FDECL(use_container, (struct obj **,int)); E int FDECL(loot_mon, (struct monst *,int *,boolean *)); E int NDECL(dotip); -#ifdef AUTOPICKUP_EXCEPTIONS E boolean FDECL(is_autopickup_exception, (struct obj *, BOOLEAN_P)); -#endif /* AUTOPICKUP_EXCEPTIONS */ /* ### pline.c ### */ diff --git a/include/flag.h b/include/flag.h index 1f53bdec6..2b5d2c3ee 100644 --- a/include/flag.h +++ b/include/flag.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 flag.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 flag.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.60 $ */ /* NetHack 3.5 flag.h $Date: 2012/04/09 02:56:32 $ $Revision: 1.59 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -297,11 +297,9 @@ struct instance_flags { boolean cmdassist; /* provide detailed assistance for some commands */ boolean clicklook; /* allow right-clicking for look */ boolean obsolete; /* obsolete options can point at this, it isn't used */ -#ifdef AUTOPICKUP_EXCEPTIONS struct autopickup_exception *autopickup_exceptions[2]; #define AP_LEAVE 0 #define AP_GRAB 1 -#endif #ifdef WIN32CON #define MAX_ALTKEYHANDLER 25 char altkeyhandler[MAX_ALTKEYHANDLER]; diff --git a/include/wceconf.h b/include/wceconf.h index c5fef1547..808334768 100644 --- a/include/wceconf.h +++ b/include/wceconf.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 wceconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wceconf.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.12 $ */ /* NetHack 3.5 wceconf.h $Date: 2009/10/22 02:59:14 $ $Revision: 1.12 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ @@ -44,8 +44,6 @@ #define USER_SOUNDS -#define AUTOPICKUP_EXCEPTIONS - /* * ----------------------------------------------------------------- * The remaining code shouldn't need modification. diff --git a/src/files.c b/src/files.c index f45db8bce..5d8b2bf2e 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 files.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 files.c $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.127 $ */ /* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2020,10 +2020,8 @@ int src; parseoptions(bufp, TRUE, TRUE); if (plname[0]) /* If a name was given */ plnamesuffix(); /* set the character class */ -#ifdef AUTOPICKUP_EXCEPTIONS } else if (match_varname(buf, "AUTOPICKUP_EXCEPTION", 5)) { add_autopickup_exception(bufp); -#endif #ifdef NOCWD_ASSUMPTIONS } else if (match_varname(buf, "HACKDIR", 4)) { adjust_prefix(bufp, HACKPREFIX); diff --git a/src/options.c b/src/options.c index dc8cbcfc2..ecb259159 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 options.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 options.c $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.156 $ */ /* NetHack 3.5 options.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.153 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -501,10 +501,8 @@ STATIC_OVL boolean FDECL(is_wc_option, (const char *)); STATIC_OVL boolean FDECL(wc_supported, (const char *)); STATIC_OVL boolean FDECL(is_wc2_option, (const char *)); STATIC_OVL boolean FDECL(wc2_supported, (const char *)); -#ifdef AUTOPICKUP_EXCEPTIONS STATIC_DCL void FDECL(remove_autopickup_exception, (struct autopickup_exception *)); STATIC_OVL int FDECL(count_ape_maps, (int *, int *)); -#endif /* check whether a user-supplied option string is a proper leading substring of a particular option name; option string might have @@ -2923,12 +2921,10 @@ doset() add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, MENU_UNSELECTED); # endif #endif -#ifdef AUTOPICKUP_EXCEPTIONS any.a_int = -1; Sprintf(buf, "autopickup exceptions (%d currently set)", count_ape_maps((int *)0, (int *)0)); add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, MENU_UNSELECTED); -#endif /* AUTOPICKUP_EXCEPTIONS */ #ifdef PREFIXES_IN_USE any = zeroany; add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", MENU_UNSELECTED); @@ -2948,12 +2944,10 @@ doset() */ for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx) { opt_indx = pick_list[pick_idx].item.a_int - 1; -#ifdef AUTOPICKUP_EXCEPTIONS if (opt_indx == -2) { /* -3 due to -1 offset for select_menu() */ (void)special_handling("autopickup_exception", setinitial, fromfile); } else -#endif #ifdef STATUS_VIA_WINDOWPORT # ifdef STATUS_HILITES if (opt_indx == -3) { /* -3 due to -1 offset for select_menu() */ @@ -3020,9 +3014,7 @@ boolean setinitial,setfromfile; /* Special handling of menustyle, pickup_burden, pickup_types, * disclose, runmode, msg_window, menu_headings, and number_pad options. -#ifdef AUTOPICKUP_EXCEPTIONS * Also takes care of interactive autopickup_exception_handling changes. -#endif */ if (!strcmp("menustyle", optname)) { const char *style_name; @@ -3296,7 +3288,6 @@ boolean setinitial,setfromfile; } destroy_nhwindow(tmpwin); } else if (!strcmp("autopickup_exception", optname)) { -#ifdef AUTOPICKUP_EXCEPTIONS int pick_cnt, pick_idx, opt_idx, pass; int totalapes = 0, numapes[2] = {0,0}; menu_item *pick_list = (menu_item *)0; @@ -3392,7 +3383,6 @@ boolean setinitial,setfromfile; destroy_nhwindow(tmpwin); if (pick_cnt >= 0) goto ape_again; } -#endif /* AUTOPICKUP_EXCEPTIONS */ } else if (!strcmp("symset", optname) || !strcmp("roguesymset", optname)) { menu_item *symset_pick = (menu_item *)0; @@ -3897,12 +3887,10 @@ dotogglepickup() if (flags.pickup) { oc_to_str(flags.pickup_types, ocl); Sprintf(buf, "ON, for %s objects%s", ocl[0] ? ocl : "all", -#ifdef AUTOPICKUP_EXCEPTIONS (iflags.autopickup_exceptions[AP_LEAVE] || iflags.autopickup_exceptions[AP_GRAB]) ? ((count_ape_maps((int *)0, (int *)0) == 1) ? ", with one exception" : ", with some exceptions") : -#endif ""); } else { Strcpy(buf, "OFF"); @@ -3911,7 +3899,6 @@ dotogglepickup() return 0; } -#ifdef AUTOPICKUP_EXCEPTIONS int add_autopickup_exception(mapping) const char *mapping; @@ -4004,7 +3991,6 @@ free_autopickup_exceptions() } } } -#endif /* AUTOPICKUP_EXCEPTIONS */ #ifdef LOADSYMSETS /* bundle some common usage into one easy-to-use routine */ diff --git a/src/pickup.c b/src/pickup.c index ee0d91dc7..2c1564f84 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 pickup.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pickup.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.126 $ */ /* NetHack 3.5 pickup.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.123 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -612,7 +612,6 @@ end_query: return (n_tried > 0); } -#ifdef AUTOPICKUP_EXCEPTIONS boolean is_autopickup_exception(obj, grab) struct obj *obj; @@ -631,7 +630,6 @@ boolean grab; /* forced pickup, rather than forced leave behind? */ } return FALSE; } -#endif /* AUTOPICKUP_EXCEPTIONS */ /* * Pick from the given list using flags.pickup_types. Return the number @@ -655,12 +653,10 @@ menu_item **pick_list; /* list of objects and counts to pick up */ /* first count the number of eligible items */ for (n = 0, curr = olist; curr; curr = FOLLOW(curr, follow)) { pickit = (!*otypes || index(otypes, curr->oclass)); -#ifdef AUTOPICKUP_EXCEPTIONS /* check for "always pick up */ if (!pickit) pickit = is_autopickup_exception(curr, TRUE); /* then for "never pick up */ if (pickit) pickit = !is_autopickup_exception(curr, FALSE); -#endif /* pickup_thrown overrides pickup_types and exceptions */ if (!pickit) pickit = (flags.pickup_thrown && curr->was_thrown); /* finally, do we count this object? */ @@ -671,10 +667,8 @@ menu_item **pick_list; /* list of objects and counts to pick up */ *pick_list = pi = (menu_item *) alloc(sizeof(menu_item) * n); for (n = 0, curr = olist; curr; curr = FOLLOW(curr, follow)) { pickit = (!*otypes || index(otypes, curr->oclass)); -#ifdef AUTOPICKUP_EXCEPTIONS if (!pickit) pickit = is_autopickup_exception(curr, TRUE); if (pickit) pickit = !is_autopickup_exception(curr, FALSE); -#endif if (!pickit) pickit = (flags.pickup_thrown && curr->was_thrown); if (pickit) { pi[n].item.a_obj = curr; diff --git a/src/save.c b/src/save.c index 1fa51dfaa..d7828655a 100644 --- a/src/save.c +++ b/src/save.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 save.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 save.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.59 $ */ /* NetHack 3.5 save.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.53 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1345,9 +1345,7 @@ freedynamicdata() if (iflags.wc_font_menu) free(iflags.wc_font_menu); if (iflags.wc_font_status) free(iflags.wc_font_status); if (iflags.wc_tile_file) free(iflags.wc_tile_file); -#ifdef AUTOPICKUP_EXCEPTIONS free_autopickup_exceptions(); -#endif #endif /* FREE_ALL_MEMORY */ #ifdef STATUS_VIA_WINDOWPORT status_finish(); diff --git a/util/makedefs.c b/util/makedefs.c index b0d9f2078..c61b561d1 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 makedefs.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 makedefs.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.61 $ */ /* NetHack 3.5 makedefs.c $Date: 2012/01/15 09:27:03 $ $Revision: 1.50 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) M. Stephenson, 1990, 1991. */ @@ -1208,9 +1208,6 @@ static const char *build_opts[] = { #ifdef ANSI_DEFAULT "ANSI default terminal", #endif -#ifdef AUTOPICKUP_EXCEPTIONS - "autopickup exceptions", -#endif #ifdef TEXTCOLOR "color", #endif From 11d11c5de358a7e867c6dbfbc6a9062b3b5841db Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sat, 14 Feb 2015 14:15:27 -0500 Subject: [PATCH 134/354] Make LOADSYMSETS unconditional. There are some bugs here, but this functionality should make it into the release in some form. --- include/config.h | 1 - include/extern.h | 6 ------ include/rm.h | 4 ---- src/drawing.c | 8 -------- src/files.c | 12 ------------ src/mapglyph.c | 38 +------------------------------------- src/options.c | 32 -------------------------------- sys/share/pcmain.c | 10 ++-------- sys/share/unixtty.c | 2 -- sys/unix/unixmain.c | 4 ---- sys/vms/vmsmain.c | 4 ---- 11 files changed, 3 insertions(+), 118 deletions(-) diff --git a/include/config.h b/include/config.h index 282b6949b..db5070a3a 100644 --- a/include/config.h +++ b/include/config.h @@ -412,7 +412,6 @@ typedef unsigned char uchar; */ /* display features */ -#define LOADSYMSETS /* loadable symbol sets; only default symbols w/o this */ /* dungeon features */ /* dungeon levels */ #define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */ diff --git a/include/extern.h b/include/extern.h index be15406c2..836b64d5f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -515,11 +515,9 @@ E void NDECL(init_r_symbols); E void NDECL(init_symbols); E void NDECL(init_showsyms); E void NDECL(init_l_symbols); -#ifdef LOADSYMSETS E void FDECL(clear_symsetentry, (int,BOOLEAN_P)); E void FDECL(update_l_symset, (struct symparse *,int)); E void FDECL(update_r_symset, (struct symparse *,int)); -#endif E boolean FDECL(cursed_object_at, (int, int)); /* ### dungeon.c ### */ @@ -733,11 +731,9 @@ E boolean FDECL(can_read_file, (const char *)); E boolean FDECL(read_config_file, (const char *, int)); E void FDECL(check_recordfile, (const char *)); E void NDECL(read_wizkit); -#ifdef LOADSYMSETS E int FDECL(read_sym_file, (int)); E int FDECL(parse_sym_line, (char *,int)); E int FDECL(sym_val, (const char *)); -#endif E void FDECL(paniclog, (const char *, const char *)); E int FDECL(validate_prefix_locations, (char *)); #ifdef SELECTSAVED @@ -1589,11 +1585,9 @@ E void FDECL(set_wc2_option_mod_status, (unsigned long, int)); E void FDECL(set_option_mod_status, (const char *,int)); E int FDECL(add_autopickup_exception, (const char *)); E void NDECL(free_autopickup_exceptions); -#ifdef LOADSYMSETS E int FDECL(load_symset, (const char *,int)); E void FDECL(parsesymbols, (char *)); E struct symparse *FDECL(match_sym, (char *)); -#endif E void NDECL(set_playmode); /* ### pager.c ### */ diff --git a/include/rm.h b/include/rm.h index 8747407f9..2fa3da6b6 100644 --- a/include/rm.h +++ b/include/rm.h @@ -278,12 +278,8 @@ extern const struct symdef def_warnsyms[WARNCOUNT]; extern int currentgraphics; /* from drawing.c */ extern nhsym showsyms[]; -#ifdef LOADSYMSETS extern struct symsetentry symset[NUM_GRAPHICS]; /* from drawing.c */ #define SYMHANDLING(ht) (symset[currentgraphics].handling == (ht)) -#else -#define SYMHANDLING(ht) ((ht) == H_UNK) -#endif /* * The 5 possible states of doors diff --git a/src/drawing.c b/src/drawing.c index 3d94d8803..7fb0d461a 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -19,9 +19,7 @@ #define C(n) #endif -#ifdef LOADSYMSETS struct symsetentry symset[NUM_GRAPHICS]; -#endif int currentgraphics = 0; @@ -399,9 +397,7 @@ init_l_symbols() l_syms[i + SYM_OFF_X] = DEF_INVISIBLE; } -#ifdef LOADSYMSETS clear_symsetentry(PRIMARY, FALSE); -#endif } void @@ -433,13 +429,11 @@ init_r_symbols() r_syms[i + SYM_OFF_X] = DEF_INVISIBLE; } -# ifdef LOADSYMSETS clear_symsetentry(ROGUESET, FALSE); symset[ROGUESET].nocolor = 1; /* default on Rogue level is no color * but some symbol sets can * override that */ -# endif } void @@ -499,7 +493,6 @@ int nondefault; init_symbols(); } -#ifdef LOADSYMSETS void update_l_symset(symp, val) struct symparse *symp; @@ -755,7 +748,6 @@ struct symparse loadsyms[] = { {SYM_OTH, SYM_INVISIBLE + SYM_OFF_X, "S_invisible"}, {0,0,(const char *)0} /* fence post */ }; -#endif /*LOADSYMSETS*/ /*drawing.c*/ diff --git a/src/files.c b/src/files.c index 5d8b2bf2e..cb7363399 100644 --- a/src/files.c +++ b/src/files.c @@ -190,10 +190,8 @@ STATIC_DCL FILE *FDECL(fopen_config_file, (const char *, int)); STATIC_DCL int FDECL(get_uchars, (FILE *,char *,char *,uchar *,BOOLEAN_P,int,const char *)); int FDECL(parse_config_line, (FILE *,char *,int)); -#ifdef LOADSYMSETS STATIC_DCL FILE *NDECL(fopen_sym_file); STATIC_DCL void FDECL(set_symhandling, (char *,int)); -#endif #ifdef NOCWD_ASSUMPTIONS STATIC_DCL void FDECL(adjust_prefix, (char *, int)); #endif @@ -2202,10 +2200,6 @@ int src; WARNCOUNT, "WARNINGS"); assign_warnings(translate); } else if (match_varname(buf, "SYMBOLS", 4)) { - /* This part is not ifdef LOADSYMSETS because we want to be able - * to silently ignore its presence in a config file if that is - * not defined. - */ char *op, symbuf[BUFSZ]; boolean morelines; do { @@ -2224,10 +2218,8 @@ int src; /* strip trailing space now that '\' is gone */ while (--op >= bufp && isspace(*op)) *op = '\0'; } -#ifdef LOADSYMSETS /* parse here */ parsesymbols(bufp); -#endif if (morelines) do { *symbuf = '\0'; @@ -2238,9 +2230,7 @@ int src; bufp = symbuf; } while (*bufp == '#'); } while (morelines); -#ifdef LOADSYMSETS switch_symbols(TRUE); -#endif } else if (match_varname(buf, "WIZKIT", 6)) { (void) strncpy(wizkit, bufp, WIZKIT_MAX-1); #ifdef AMIGA @@ -2561,7 +2551,6 @@ read_wizkit() return; } -#ifdef LOADSYMSETS extern struct symsetentry *symset_list; /* options.c */ extern struct symparse loadsyms[]; /* drawing.c */ extern const char *known_handling[]; /* drawing.c */ @@ -2897,7 +2886,6 @@ const char *cp; } return cval; } -#endif /*LOADSYMSETS*/ /* ---------- END CONFIG FILE HANDLING ----------- */ diff --git a/src/mapglyph.c b/src/mapglyph.c index f1adae27a..c00d6f8ad 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -34,9 +34,6 @@ int explcolors[] = { #define pet_color(n) color = iflags.use_color ? mons[n].mcolor : NO_COLOR #define warn_color(n) color = iflags.use_color ? def_warnsyms[n].color : NO_COLOR #define explode_color(n) color = iflags.use_color ? explcolors[n] : NO_COLOR -#ifdef LOADSYMSETS -# define ROGUE_COLOR -#endif #else /* no text color */ @@ -66,17 +63,13 @@ int *ochar; unsigned *ospecial; { register int offset, idx; -#if defined(TEXTCOLOR) || defined(ROGUE_COLOR) int color = NO_COLOR; -#endif nhsym ch; unsigned special = 0; /* condense multiple tests in macro version down to single */ boolean has_rogue_ibm_graphics = HAS_ROGUE_IBM_GRAPHICS; -#ifdef ROGUE_COLOR boolean has_rogue_color = (has_rogue_ibm_graphics && (symset[currentgraphics].nocolor == 0)); -#endif /* * Map the glyph back to a character and color. @@ -86,45 +79,36 @@ unsigned *ospecial; */ if ((offset = (glyph - GLYPH_STATUE_OFF)) >= 0) { /* a statue */ idx = mons[offset].mlet + SYM_OFF_M; -# ifdef ROGUE_COLOR if (has_rogue_color) color = CLR_RED; else -# endif obj_color(STATUE); special |= MG_STATUE; } else if ((offset = (glyph - GLYPH_WARNING_OFF)) >= 0) { /* a warning flash */ idx = offset + SYM_OFF_W; -# ifdef ROGUE_COLOR if (has_rogue_color) color = NO_COLOR; else -# endif warn_color(offset); } else if ((offset = (glyph - GLYPH_SWALLOW_OFF)) >= 0) { /* swallow */ /* see swallow_to_glyph() in display.c */ idx = (S_sw_tl + (offset & 0x7)) + SYM_OFF_P; -#ifdef ROGUE_COLOR if (has_rogue_color && iflags.use_color) color = NO_COLOR; else -#endif mon_color(offset >> 3); } else if ((offset = (glyph - GLYPH_ZAP_OFF)) >= 0) { /* zap beam */ /* see zapdir_to_glyph() in display.c */ idx = (S_vbeam + (offset & 0x3)) + SYM_OFF_P; -#ifdef ROGUE_COLOR if (has_rogue_color && iflags.use_color) color = NO_COLOR; else -#endif zap_color((offset >> 2)); } else if ((offset = (glyph - GLYPH_EXPLODE_OFF)) >= 0) { /* explosion */ idx = ((offset % MAXEXPCHARS) + S_explode1) + SYM_OFF_P; explode_color(offset / MAXEXPCHARS); } else if ((offset = (glyph - GLYPH_CMAP_OFF)) >= 0) { /* cmap */ idx = offset + SYM_OFF_P; -#ifdef ROGUE_COLOR if (has_rogue_color && iflags.use_color) { if (offset >= S_vwall && offset <= S_hcdoor) color = CLR_BROWN; @@ -137,7 +121,6 @@ unsigned *ospecial; else color = NO_COLOR; } else -#endif #ifdef TEXTCOLOR /* provide a visible difference if normal and lit corridor * use the same symbol */ @@ -151,7 +134,6 @@ unsigned *ospecial; idx = objects[offset].oc_class + SYM_OFF_O; if (offset == BOULDER && iflags.bouldersym) idx = SYM_BOULDER + SYM_OFF_X; -#ifdef ROGUE_COLOR if (has_rogue_color && iflags.use_color) { switch(objects[offset].oc_class) { case COIN_CLASS: color = CLR_YELLOW; break; @@ -159,70 +141,56 @@ unsigned *ospecial; default: color = CLR_BRIGHT_BLUE; break; } } else -#endif obj_color(offset); } else if ((offset = (glyph - GLYPH_RIDDEN_OFF)) >= 0) { /* mon ridden */ idx = mons[offset].mlet + SYM_OFF_M; -#ifdef ROGUE_COLOR if (has_rogue_color) /* This currently implies that the hero is here -- monsters */ /* don't ride (yet...). Should we set it to yellow like in */ /* the monster case below? There is no equivalent in rogue. */ color = NO_COLOR; /* no need to check iflags.use_color */ else -#endif mon_color(offset); special |= MG_RIDDEN; } else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) { /* a corpse */ idx = objects[CORPSE].oc_class + SYM_OFF_O; -#ifdef ROGUE_COLOR if (has_rogue_color && iflags.use_color) color = CLR_RED; else -#endif mon_color(offset); special |= MG_CORPSE; } else if ((offset = (glyph - GLYPH_DETECT_OFF)) >= 0) { /* mon detect */ idx = mons[offset].mlet + SYM_OFF_M; -#ifdef ROGUE_COLOR if (has_rogue_color) color = NO_COLOR; /* no need to check iflags.use_color */ else -#endif mon_color(offset); /* Disabled for now; anyone want to get reverse video to work? */ /* is_reverse = TRUE; */ special |= MG_DETECT; } else if ((offset = (glyph - GLYPH_INVIS_OFF)) >= 0) { /* invisible */ idx = SYM_INVISIBLE + SYM_OFF_X; -#ifdef ROGUE_COLOR if (has_rogue_color) color = NO_COLOR; /* no need to check iflags.use_color */ else -#endif invis_color(offset); special |= MG_INVIS; } else if ((offset = (glyph - GLYPH_PET_OFF)) >= 0) { /* a pet */ idx = mons[offset].mlet + SYM_OFF_M; -#ifdef ROGUE_COLOR if (has_rogue_color) color = NO_COLOR; /* no need to check iflags.use_color */ else -#endif pet_color(offset); special |= MG_PET; } else { /* a monster */ idx = mons[glyph].mlet + SYM_OFF_M; -#ifdef ROGUE_COLOR if (has_rogue_color && iflags.use_color) { if (x == u.ux && y == u.uy) /* actually player should be yellow-on-gray if in a corridor */ color = CLR_YELLOW; else color = NO_COLOR; - } else -#endif - { + } else { mon_color(glyph); /* special case the hero for `showrace' option */ #ifdef TEXTCOLOR @@ -236,11 +204,7 @@ unsigned *ospecial; ch = showsyms[idx]; #ifdef TEXTCOLOR /* Turn off color if no color defined, or rogue level w/o PC graphics. */ -# ifdef ROGUE_COLOR if (!has_color(color) || (Is_rogue_level(&u.uz) && !has_rogue_color)) -# else - if (!has_color(color) || Is_rogue_level(&u.uz)) -# endif color = NO_COLOR; #endif diff --git a/src/options.c b/src/options.c index ecb259159..51bda6c59 100644 --- a/src/options.c +++ b/src/options.c @@ -350,17 +350,9 @@ static struct Comp_Opt { "soundcard", "type of sound card to use", 20, SET_IN_FILE }, #endif { "symset", "load a set of display symbols from the symbols file", 70, -#ifdef LOADSYMSETS SET_IN_GAME }, -#else - DISP_IN_GAME}, -#endif { "roguesymset", "load a set of rogue display symbols from the symbols file", 70, -#ifdef LOADSYMSETS SET_IN_GAME }, -#else - DISP_IN_GAME}, -#endif { "suppress_alert", "suppress alerts about version-specific features", 8, SET_IN_GAME }, { "tile_width", "width of tiles", 20, DISP_IN_GAME}, /*WC*/ @@ -654,11 +646,9 @@ initoptions_init() */ /* this detects the IBM-compatible console on most 386 boxes */ if ((opts = nh_getenv("TERM")) && !strncmp(opts, "AT", 2)) { -#ifdef LOADSYMSETS if (!symset[PRIMARY].name) load_symset("IBMGraphics", PRIMARY); if (!symset[ROGUESET].name) load_symset("RogueIBM", ROGUESET); switch_symbols(TRUE); -#endif # ifdef TEXTCOLOR iflags.use_color = TRUE; # endif @@ -670,10 +660,8 @@ initoptions_init() if ((opts = nh_getenv("TERM")) && !strncmpi(opts, "vt", 2) && AS && AE && index(AS, '\016') && index(AE, '\017')) { -# ifdef LOADSYMSETS if (!symset[PRIMARY].name) load_symset("DECGraphics", PRIMARY); switch_symbols(TRUE); -# endif /*LOADSYMSETS*/ } # endif #endif /* UNIX || VMS */ @@ -1406,7 +1394,6 @@ boolean tinitial, tfrom_file; fullname = "symset"; if (match_optname(opts, fullname, 6, TRUE)) { -#ifdef LOADSYMSETS if (duplicate) complain_about_duplicate(opts,1); if (negated) bad_negation(fullname, FALSE); else if ((op = string_for_opt(opts, FALSE)) != 0) { @@ -1422,7 +1409,6 @@ boolean tinitial, tfrom_file; need_redraw = TRUE; } } -#endif return; } @@ -2505,7 +2491,6 @@ goodfruit: fullname = "DECgraphics"; if (match_optname(opts, fullname, 10, TRUE)) { boolean badflag = FALSE; -# ifdef LOADSYMSETS if (duplicate) complain_about_duplicate(opts,1); if (!negated) { /* There is no rogue level DECgraphics-specific set */ @@ -2525,14 +2510,12 @@ goodfruit: wait_synch(); } } -# endif /*LOADSYMSETS*/ return; } fullname = "IBMgraphics"; if (match_optname(opts, fullname, 10, TRUE)) { const char *sym_name = fullname; boolean badflag = FALSE; -# ifdef LOADSYMSETS if (duplicate) complain_about_duplicate(opts,1); if (!negated) { for (i = PRIMARY; i <= ROGUESET; ++i) { @@ -2559,7 +2542,6 @@ goodfruit: assign_graphics(ROGUESET); } } -# endif /*LOADSYMSETS*/ return; } #endif @@ -2567,7 +2549,6 @@ goodfruit: fullname = "MACgraphics"; if (match_optname(opts, fullname, 11, TRUE)) { boolean badflag = FALSE; -# ifdef LOADSYMSETS if (duplicate) complain_about_duplicate(opts,1); if (!negated) { if (symset[PRIMARY]).name badflag = TRUE; @@ -2589,7 +2570,6 @@ goodfruit: assign_graphics(ROGUESET); } } -# endif /*LOADSYMSETS*/ return; } #endif @@ -2997,10 +2977,8 @@ doset() return 0; } -#ifdef LOADSYMSETS struct symsetentry *symset_list = 0; /* files.c will populate this with list of available sets */ -#endif STATIC_OVL boolean special_handling(optname, setinitial, setfromfile) @@ -3390,19 +3368,16 @@ boolean setinitial,setfromfile; rogueflag = (*optname == 'r'), ready_to_switch = FALSE, nothing_to_do = FALSE; -#ifdef LOADSYMSETS int res; char *symset_name, fmtstr[20]; struct symsetentry *sl; int setcount = 0; -#endif int chosen = -2, which_set; if (rogueflag) which_set = ROGUESET; else which_set = PRIMARY; -#ifdef LOADSYMSETS /* clear symset[].name as a flag to read_sym_file() to build list */ symset_name = symset[which_set].name; symset[which_set].name = (char *)0; @@ -3551,7 +3526,6 @@ boolean setinitial,setfromfile; assign_graphics(ROGUESET); } else if (!rogueflag) assign_graphics(PRIMARY); need_redraw = TRUE; -#endif /*LOADSYMSETS*/ return TRUE; } else { @@ -3772,10 +3746,8 @@ char *buf; Sprintf(buf, "%s", rolestring(flags.initrace, races, noun)); else if (!strcmp(optname, "roguesymset")) { Sprintf(buf, "%s", -#ifdef LOADSYMSETS symset[ROGUESET].name ? symset[ROGUESET].name : -#endif "default"); if (currentgraphics == ROGUESET && symset[ROGUESET].name) Strcat(buf, ", active"); @@ -3813,10 +3785,8 @@ char *buf; } else if (!strcmp(optname, "symset")) { Sprintf(buf, "%s", -#ifdef LOADSYMSETS symset[PRIMARY].name ? symset[PRIMARY].name : -#endif "default"); if (currentgraphics == PRIMARY && symset[PRIMARY].name) Strcat(buf, ", active"); @@ -3992,7 +3962,6 @@ free_autopickup_exceptions() } } -#ifdef LOADSYMSETS /* bundle some common usage into one easy-to-use routine */ int load_symset(s, which_set) @@ -4070,7 +4039,6 @@ char *buf; } return (struct symparse *)0; } -#endif /*LOADSYMSETS*/ /* data for option_help() */ static const char *opt_intro[] = { diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 55188619b..6635c56ad 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -303,8 +303,7 @@ char *argv[]; process_options(argc, argv); #endif -#ifdef LOADSYMSETS -# if defined(MSDOS) || defined(WIN32) +#if defined(MSDOS) || defined(WIN32) /* Player didn't specify any symbol set so use IBM defaults */ if (!symset[PRIMARY].name) { load_symset("IBMGraphics_2", PRIMARY); @@ -312,8 +311,7 @@ char *argv[]; if (!symset[ROGUESET].name) { load_symset("RogueEpyx", ROGUESET); } -# endif -#endif /*LOADSYMSETS*/ +#endif #ifdef MSDOS init_nhwindows(&argc,argv); @@ -536,20 +534,16 @@ char *argv[]; case 'I': case 'i': if (!strncmpi(argv[0]+1, "IBM", 3)) { -# ifdef LOADSYMSETS load_symset("IBMGraphics", PRIMARY); load_symset("RogueIBM", ROGUESET); switch_symbols(TRUE); -# endif } break; /* case 'D': */ case 'd': if (!strncmpi(argv[0]+1, "DEC", 3)) { -# ifdef LOADSYMSETS load_symset("DECGraphics", PRIMARY); switch_symbols(TRUE); -# endif } break; #endif diff --git a/sys/share/unixtty.c b/sys/share/unixtty.c index 68c6f104c..678ab565d 100644 --- a/sys/share/unixtty.c +++ b/sys/share/unixtty.c @@ -364,11 +364,9 @@ init_sco_cons() if (!strcmp(windowprocs.name, "tty") && sco_flag_console) { atexit(sco_mapon); sco_mapoff(); -# ifdef LOADSYMSETS load_symset("IBMGraphics", PRIMARY); load_symset("RogueIBM", ROGUESET); switch_symbols(TRUE); -# endif # ifdef TEXTCOLOR if (has_colors()) iflags.use_color = TRUE; diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index f7cb9b26c..c470dc6e0 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -357,20 +357,16 @@ char *argv[]; case 'I': case 'i': if (!strncmpi(argv[0]+1, "IBM", 3)) { -#ifdef LOADSYMSETS load_symset("IBMGraphics", PRIMARY); load_symset("RogueIBM", ROGUESET); switch_symbols(TRUE); -#endif } break; /* case 'D': */ case 'd': if (!strncmpi(argv[0]+1, "DEC", 3)) { -#ifdef LOADSYMSETS load_symset("DECGraphics", PRIMARY); switch_symbols(TRUE); -#endif } break; case 'p': /* profession (role) */ diff --git a/sys/vms/vmsmain.c b/sys/vms/vmsmain.c index a34224005..abeff040e 100644 --- a/sys/vms/vmsmain.c +++ b/sys/vms/vmsmain.c @@ -266,20 +266,16 @@ char *argv[]; case 'I': case 'i': if (!strncmpi(argv[0]+1, "IBM", 3)) { -#ifdef LOADSYMSETS load_symset("IBMGraphics", PRIMARY); load_symset("RogueIBM", ROGUESET); switch_symbols(TRUE); -#endif } break; /* case 'D': */ case 'd': if (!strncmpi(argv[0]+1, "DEC", 3)) { -#ifdef LOADSYMSETS load_symset("DECGraphics", PRIMARY); switch_symbols(TRUE); -#endif } break; case 'p': /* profession (role) */ From f27d319e685f0543fb9a5f8f51691f52cc49d762 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 27 Feb 2015 19:24:28 -0500 Subject: [PATCH 135/354] Make REDO unconditional. --- include/config.h | 5 +---- include/decl.h | 2 -- include/extern.h | 2 -- include/global.h | 6 ------ include/ntconf.h | 5 ----- include/os2conf.h | 5 ----- include/pcconf.h | 5 ----- include/unixconf.h | 3 --- include/vmsconf.h | 3 --- include/wceconf.h | 5 ----- src/allmain.c | 8 +------- src/cmd.c | 24 +++--------------------- src/decl.c | 2 -- src/invent.c | 12 ------------ src/o_init.c | 2 -- sys/share/pcsys.c | 2 +- util/makedefs.c | 3 --- win/tty/getline.c | 8 +------- 18 files changed, 7 insertions(+), 95 deletions(-) diff --git a/include/config.h b/include/config.h index db5070a3a..5cf035b54 100644 --- a/include/config.h +++ b/include/config.h @@ -417,16 +417,13 @@ typedef unsigned char uchar; #define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */ /* monsters & objects */ /* I/O */ -#define REDO /* support for redoing last command - DGK */ #if !defined(MAC) # if !defined(NOCLIPPING) # define CLIPPING /* allow smaller screens -- ERS */ # endif #endif -#ifdef REDO -# define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ -#endif +#define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ #define EXP_ON_BOTL /* Show experience on bottom line */ /* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson@ucivax) */ diff --git a/include/decl.h b/include/decl.h index 4733b5317..92f1e8240 100644 --- a/include/decl.h +++ b/include/decl.h @@ -39,9 +39,7 @@ E NEARDATA int warn_obj_cnt; /* count of monsters meeting criteria */ E int x_maze_max, y_maze_max; E int otg_temp; -#ifdef REDO E NEARDATA int in_doagain; -#endif E struct dgn_topology { /* special dungeon levels for speed */ d_level d_oracle_level; diff --git a/include/extern.h b/include/extern.h index 836b64d5f..bfd361326 100644 --- a/include/extern.h +++ b/include/extern.h @@ -182,11 +182,9 @@ E int NDECL(wiz_wish); #endif /* USE_TRAMPOLI */ E void NDECL(reset_occupations); E void FDECL(set_occupation, (int (*)(void),const char *,int)); -#ifdef REDO E char NDECL(pgetchar); E void FDECL(pushch, (CHAR_P)); E void FDECL(savech, (CHAR_P)); -#endif E void NDECL(add_debug_extended_commands); E void FDECL(reset_commands, (BOOLEAN_P)); E void FDECL(rhack, (char *)); diff --git a/include/global.h b/include/global.h index 985066520..e3292e243 100644 --- a/include/global.h +++ b/include/global.h @@ -134,12 +134,6 @@ typedef char nhptext; */ #define LARGEST_INT 32767 - -#ifdef REDO -#define Getchar pgetchar -#endif - - #include "coord.h" /* * Automatic inclusions for the subsidiary files. diff --git a/include/ntconf.h b/include/ntconf.h index 539833aed..4ad1a6e73 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -229,11 +229,6 @@ int _RTLENTRY _EXPFUNC read (int __handle, void _FAR *__buf, unsigned __len); #define ALLOCA_HACK /* used in util/panic.c */ #endif -#ifndef REDO -#undef Getchar -#define Getchar nhgetch -#endif - extern int FDECL(set_win32_option, (const char *, const char *)); #ifdef WIN32CON #define LEFTBUTTON FROM_LEFT_1ST_BUTTON_PRESSED diff --git a/include/os2conf.h b/include/os2conf.h index eeb4e53aa..1c24c10fd 100644 --- a/include/os2conf.h +++ b/include/os2conf.h @@ -100,11 +100,6 @@ #define sethanguphandler(foo) (void)signal(SIGHUP, (SIG_RET_TYPE)foo) #endif -#ifndef REDO -# undef Getchar -# define Getchar nhgetch -#endif - void hangup(int i); #endif /* OS2CONF_H */ #endif /* OS2 */ diff --git a/include/pcconf.h b/include/pcconf.h index 70a519c00..77a496dac 100644 --- a/include/pcconf.h +++ b/include/pcconf.h @@ -249,11 +249,6 @@ #include -#ifndef REDO -# undef Getchar -# define Getchar nhgetch -#endif - #ifdef MSDOS # define TEXTCOLOR /* */ # define PORT_HELP "msdoshlp.txt" /* msdos port specific help file */ diff --git a/include/unixconf.h b/include/unixconf.h index 0ffa2e119..c85611c2a 100644 --- a/include/unixconf.h +++ b/include/unixconf.h @@ -281,9 +281,6 @@ #define HLOCK "perm" /* an empty file used for locking purposes */ -#ifndef REDO -#define Getchar nhgetch -#endif #define tgetch getchar #ifndef NOSHELL diff --git a/include/vmsconf.h b/include/vmsconf.h index d675588e2..f3045bed7 100644 --- a/include/vmsconf.h +++ b/include/vmsconf.h @@ -234,9 +234,6 @@ typedef __mode_t mode_t; # define O_TRUNC 0x400 #endif -#ifndef REDO -# define Getchar nhgetch -#endif #define tgetch vms_getchar #include "system.h" diff --git a/include/wceconf.h b/include/wceconf.h index 808334768..52ad4d1f1 100644 --- a/include/wceconf.h +++ b/include/wceconf.h @@ -185,11 +185,6 @@ extern void NDECL(toggle_mouse_support); #define ALLOCA_HACK /* used in util/panic.c */ #endif -#ifndef REDO -#undef Getchar -#define Getchar nhgetch -#endif - #ifdef _MSC_VER #if 0 #pragma warning(disable:4018) /* signed/unsigned mismatch */ diff --git a/src/allmain.c b/src/allmain.c index d56f11bda..2bb1c4240 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -246,11 +246,9 @@ boolean resuming; if (!next_to_u()) { check_leash(old_ux, old_uy); } -#ifdef REDO /* clear doagain keystrokes */ pushch(0); savech(0); -#endif } } /* delayed change may not be valid anymore */ @@ -355,12 +353,10 @@ boolean resuming; #if defined(MICRO) || defined(WIN32) abort_lev = 0; if (kbhit()) { - if ((ch = Getchar()) == ABORT) + if ((ch = pgetchar()) == ABORT) abort_lev++; -# ifdef REDO else pushch(ch); -# endif /* REDO */ } if (!abort_lev && (*occupation)() == 0) #else @@ -439,10 +435,8 @@ stop_occupation() You("stop %s.", occtxt); occupation = 0; context.botl = 1; /* in case u.uhs changed */ -#ifdef REDO nomul(0); pushch(0); -#endif } } diff --git a/src/cmd.c b/src/cmd.c index 1477eabdc..f7e858e01 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -236,7 +236,6 @@ int xtime; return; } -#ifdef REDO STATIC_DCL char NDECL(popch); @@ -298,7 +297,6 @@ char ch; } return; } -#endif /* REDO */ STATIC_PTR int doextcmd(VOID_ARGS) /* here after # - now read a full-word command */ @@ -2950,7 +2948,6 @@ register char *cmd; context.move = FALSE; return; } -#ifdef REDO if (*cmd == DOAGAIN && !in_doagain && saveq[0]) { in_doagain = TRUE; stail = 0; @@ -2960,9 +2957,6 @@ register char *cmd; } /* Special case of *cmd == ' ' handled better below */ if(!*cmd || *cmd == (char)0377) -#else - if(!*cmd || *cmd == (char)0377 || (!flags.rest_on_space && *cmd == ' ')) -#endif { nhbell(); context.move = FALSE; @@ -3253,11 +3247,9 @@ const char *s; int is_mov; retry: -#ifdef REDO if (in_doagain || *readchar_queue) dirsym = readchar(); else -#endif dirsym = yn_function((s && *s != '^') ? s : "In what direction?", (char *)0, '\0'); /* remove the prompt string so caller won't have to */ @@ -3267,9 +3259,7 @@ const char *s; docrt(); /* redraw */ goto retry; } -#ifdef REDO savech(dirsym); -#endif if (dirsym == '.' || dirsym == 's') { u.dx = u.dy = u.dz = 0; @@ -3554,14 +3544,12 @@ parse() if (foo == '\033') { /* esc cancels count (TH) */ clear_nhwindow(WIN_MESSAGE); multi = last_multi = 0; -# ifdef REDO } else if (foo == DOAGAIN || in_doagain) { multi = last_multi; } else { last_multi = multi; savech(0); /* reset input queue */ savech((char)foo); -# endif } if (multi) { @@ -3589,9 +3577,7 @@ parse() if (foo == 'g' || foo == 'G' || foo == 'm' || foo == 'M' || foo == 'F' || (Cmd.num_pad && (foo == '5' || foo == '-'))) { foo = readchar(); -#ifdef REDO savech((char)foo); -#endif in_line[1] = foo; in_line[2] = 0; } @@ -3658,11 +3644,7 @@ readchar() if ( *readchar_queue ) sym = *readchar_queue++; else -#ifdef REDO - sym = in_doagain ? Getchar() : nh_poskey(&x, &y, &mod); -#else - sym = Getchar(); -#endif + sym = in_doagain ? pgetchar() : nh_poskey(&x, &y, &mod); #ifdef NR_OF_EOFS if (sym == EOF) { @@ -3674,7 +3656,7 @@ readchar() */ do { clearerr(stdin); /* omit if clearerr is undefined */ - sym = Getchar(); + sym = pgetchar(); } while (--cnt && sym == EOF); } #endif /* NR_OF_EOFS */ @@ -3687,7 +3669,7 @@ readchar() #ifdef ALTMETA } else if (sym == '\033' && alt_esc) { /* iflags.altmeta: treat two character ``ESC c'' as single `M-c' */ - sym = *readchar_queue ? *readchar_queue++ : Getchar(); + sym = *readchar_queue ? *readchar_queue++ : pgetchar(); if (sym == EOF || sym == 0) sym = '\033'; else if (sym != '\033') diff --git a/src/decl.c b/src/decl.c index 47043d0cd..f7601bda0 100644 --- a/src/decl.c +++ b/src/decl.c @@ -31,9 +31,7 @@ int x_maze_max = (COLNO-1) & ~1, int otg_temp; /* used by object_to_glyph() [otg] */ -#ifdef REDO NEARDATA int in_doagain = 0; -#endif /* * The following structure will be initialized at startup time with diff --git a/src/invent.c b/src/invent.c index 7a7a83734..e3cd20247 100644 --- a/src/invent.c +++ b/src/invent.c @@ -928,11 +928,9 @@ register const char *let,*word; Sprintf(qbuf, "What do you want to %s? [%s or ?*]", word, buf); } -#ifdef REDO if (in_doagain) ilet = readchar(); else -#endif ilet = yn_function(qbuf, (char *)0, '\0'); if (digit(ilet) && !allowcnt) { pline("No count allowed with this command."); @@ -940,9 +938,7 @@ register const char *let,*word; } if (ilet == '0') prezero = TRUE; while (digit(ilet)) { -#ifdef REDO if (ilet != '?' && ilet != '*') savech(ilet); -#endif /* accumulate unless cnt has overflowed */ if (allowcnt < 3) { prevcnt = cnt; @@ -1018,23 +1014,17 @@ register const char *let,*word; } } context.botl = 1; /* May have changed the amount of money */ -#ifdef REDO savech(ilet); -#endif for (otmp = invent; otmp; otmp = otmp->nobj) if (otmp->invlet == ilet) break; if(!otmp) { You("don't have that object."); -#ifdef REDO if (in_doagain) return((struct obj *) 0); -#endif continue; } else if (cnt < 0 || otmp->quan < cnt) { You("don't have that many! You have only %ld.", otmp->quan); -#ifdef REDO if (in_doagain) return((struct obj *) 0); -#endif continue; } break; @@ -2102,9 +2092,7 @@ dotypeinv() if(class_count > 1) { c = yn_function(prompt, types, '\0'); -#ifdef REDO savech(c); -#endif if(c == '\0') { clear_nhwindow(WIN_MESSAGE); return 0; diff --git a/src/o_init.c b/src/o_init.c index 102160635..4ae8892e9 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -568,9 +568,7 @@ doclassdisco() } /* get the class (via its symbol character) */ c = yn_function(prompt, discosyms, '\0'); -#ifdef REDO savech(c); -#endif if (!c) clear_nhwindow(WIN_MESSAGE); } else { diff --git a/sys/share/pcsys.c b/sys/share/pcsys.c index 0fc5ee8ed..16d36bbb7 100644 --- a/sys/share/pcsys.c +++ b/sys/share/pcsys.c @@ -407,7 +407,7 @@ const char *str; #else msmsg("Hit %s.", str); #endif - while (Getchar() != '\n') ; + while (pgetchar() != '\n') ; return; } diff --git a/util/makedefs.c b/util/makedefs.c index c61b561d1..9ea0d3898 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1261,9 +1261,6 @@ static const char *build_opts[] = { # endif # endif #endif -#ifdef REDO - "redo command", -#endif #ifdef SELECTSAVED "restore saved games via menu", #endif diff --git a/win/tty/getline.c b/win/tty/getline.c index 6dfa10a6e..2dd90ae3f 100644 --- a/win/tty/getline.c +++ b/win/tty/getline.c @@ -82,7 +82,7 @@ getlin_hook_proc hook; #else Strcat(strcat(strcpy(toplines, query), " "), obufp); #endif - c = Getchar(); + c = pgetchar(); if (c == '\033' || c == EOF) { obufp[0] = '\033'; obufp[1] = '\0'; @@ -271,26 +271,20 @@ tty_get_ext_cmd() if (iflags.extmenu) return extcmd_via_menu(); /* maybe a runtime option? */ /* hooked_tty_getlin("#", buf, flags.cmd_comp ? ext_cmd_getlin_hook : (getlin_hook_proc) 0); */ -#ifdef REDO hooked_tty_getlin("#", buf, in_doagain ? (getlin_hook_proc)0 : ext_cmd_getlin_hook); -#else - hooked_tty_getlin("#", buf, ext_cmd_getlin_hook); -#endif (void) mungspaces(buf); if (buf[0] == 0 || buf[0] == '\033') return -1; for (i = 0; extcmdlist[i].ef_txt != (char *)0; i++) if (!strcmpi(buf, extcmdlist[i].ef_txt)) break; -#ifdef REDO if (!in_doagain) { int j; for (j = 0; buf[j]; j++) savech(buf[j]); savech('\n'); } -#endif if (extcmdlist[i].ef_txt == (char *)0) { pline("%s: unknown extended command.", buf); From fb46fed99d91682ee3427adfa64cf443ea9d3dc3 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Fri, 27 Feb 2015 19:24:43 -0500 Subject: [PATCH 136/354] Make EXP_ON_BOTL unconditional. --- include/config.h | 3 +-- src/botl.c | 4 +--- src/options.c | 8 +------- sys/wince/mhstatus.c | 4 +--- util/makedefs.c | 13 +++---------- win/X11/winstat.c | 15 +-------------- win/gnome/gnstatus.c | 4 +--- 7 files changed, 9 insertions(+), 42 deletions(-) diff --git a/include/config.h b/include/config.h index 5cf035b54..3bddda18b 100644 --- a/include/config.h +++ b/include/config.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 config.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.48 $ */ +/* NetHack 3.5 config.h $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.51 $ */ /* NetHack 3.5 config.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.37 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -425,7 +425,6 @@ typedef unsigned char uchar; #define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ -#define EXP_ON_BOTL /* Show experience on bottom line */ /* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson@ucivax) */ /* diff --git a/src/botl.c b/src/botl.c index ab02ae35b..76d16a8ff 100644 --- a/src/botl.c +++ b/src/botl.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 botl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 botl.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.38 $ */ /* NetHack 3.5 botl.c $Date: 2012/01/10 17:47:19 $ $Revision: 1.36 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -268,10 +268,8 @@ bot2() if (Upolyd) Sprintf(nb = eos(nb), " HD:%d", mons[u.umonnum].mlevel); -#ifdef EXP_ON_BOTL else if(flags.showexp) Sprintf(nb = eos(nb), " Xp:%u/%-1ld", u.ulevel,u.uexp); -#endif else Sprintf(nb = eos(nb), " Exp:%u", u.ulevel); diff --git a/src/options.c b/src/options.c index 51bda6c59..97378888a 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 options.c $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.156 $ */ +/* NetHack 3.5 options.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.158 $ */ /* NetHack 3.5 options.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.153 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -175,11 +175,7 @@ static struct Bool_Opt {"safe_pet", &flags.safe_dog, TRUE, SET_IN_GAME}, {"sanity_check", &iflags.sanity_check, FALSE, SET_IN_GAME}, {"selectsaved", &iflags.wc2_selectsaved, TRUE, DISP_IN_GAME}, /*WC*/ -#ifdef EXP_ON_BOTL {"showexp", &flags.showexp, FALSE, SET_IN_GAME}, -#else - {"showexp", (boolean *)0, FALSE, SET_IN_FILE}, -#endif {"showrace", &flags.showrace, FALSE, SET_IN_GAME}, #ifdef SCORE_ON_BOTL {"showscore", &flags.showscore, FALSE, SET_IN_GAME}, @@ -2618,9 +2614,7 @@ goodfruit: if (initial) return; if ((boolopt[i].addr) == &flags.time -#ifdef EXP_ON_BOTL || (boolopt[i].addr) == &flags.showexp -#endif #ifdef SCORE_ON_BOTL || (boolopt[i].addr) == &flags.showscore #endif diff --git a/sys/wince/mhstatus.c b/sys/wince/mhstatus.c index dd86e2d6e..397f2dcb8 100644 --- a/sys/wince/mhstatus.c +++ b/sys/wince/mhstatus.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mhstatus.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mhstatus.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.8 $ */ /* NetHack 3.5 mhstatus.c $Date: 2009/05/06 10:52:28 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)mhstatus.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ @@ -238,10 +238,8 @@ void FormatStatusString(char* text, int format) if (Upolyd) Sprintf(nb = eos(nb), " HD:%d", mons[u.umonnum].mlevel); -#ifdef EXP_ON_BOTL else if(flags.showexp) Sprintf(nb = eos(nb), " Xp:%u/%-1ld", u.ulevel,u.uexp); -#endif else Sprintf(nb = eos(nb), " Exp:%u", u.ulevel); if( format==NHSTAT_LINES_4 ) strcat(text, "\r\n"); diff --git a/util/makedefs.c b/util/makedefs.c index 9ea0d3898..ba3ee79f3 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 makedefs.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.61 $ */ +/* NetHack 3.5 makedefs.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.63 $ */ /* NetHack 3.5 makedefs.c $Date: 2012/01/15 09:27:03 $ $Revision: 1.50 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) M. Stephenson, 1990, 1991. */ @@ -960,8 +960,7 @@ do_rumors() * */ #define IGNORED_FEATURES ( 0L \ - | (1L << 19) /* EXP_ON_BOTL */ \ - | (1L << 20) /* SCORE_ON_BOTL */ \ + | (1L << 19) /* SCORE_ON_BOTL */ \ | (1L << 27) /* ZEROCOMP */ \ | (1L << 28) /* RLECOMP */ \ ) @@ -999,11 +998,8 @@ make_version() #ifdef INSURANCE | (1L << 18) #endif -#ifdef EXP_ON_BOTL - | (1L << 19) -#endif #ifdef SCORE_ON_BOTL - | (1L << 20) + | (1L << 19) #endif /* data format (27..31) * External compression methods such as COMPRESS and ZLIB_COMP @@ -1226,9 +1222,6 @@ static const char *build_opts[] = { #ifdef DLB "data librarian", #endif -#ifdef EXP_ON_BOTL - "experience points on status line", -#endif #ifdef MFLOPPY "floppy drive support", #endif diff --git a/win/X11/winstat.c b/win/X11/winstat.c index ab65a168c..ae2a3ce83 100644 --- a/win/X11/winstat.c +++ b/win/X11/winstat.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 winstat.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winstat.c $NHDT-Date: 1425083083 2015/02/28 00:24:43 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.5 $ */ /* NetHack 3.5 winstat.c $Date: 2009/05/06 10:55:59 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)winstat.c 3.5 1996/04/05 */ /* Copyright (c) Dean Luick, 1992 */ @@ -427,7 +427,6 @@ update_val(attr_rec, new_value) /* special case: exp can be enabled & disabled */ else if (attr_rec == &shown_stats[F_EXP]) { static boolean flagexp = TRUE; -#ifdef EXP_ON_BOTL if (flags.showexp && !flagexp) { set_name(attr_rec->w, shown_stats[F_EXP].name); @@ -439,14 +438,6 @@ update_val(attr_rec, new_value) flagexp = flags.showexp; } if (!flagexp) return; -#else - if (flagexp) { - set_name(attr_rec->w, ""); - set_value(attr_rec->w, ""); - flagexp = FALSE; - } - return; /* don't show it at all */ -#endif } /* special case: score can be enabled & disabled */ @@ -612,11 +603,7 @@ update_fancy_status(wp) case F_LEVEL: val = (long) (u.mtimedone ? mons[u.umonnum].mlevel : u.ulevel); break; -#ifdef EXP_ON_BOTL case F_EXP: val = flags.showexp ? u.uexp : 0L; break; -#else - case F_EXP: val = 0L; break; -#endif case F_ALIGN: val = (long) u.ualign.type; break; case F_TIME: val = flags.time ? (long) moves : 0L; break; #ifdef SCORE_ON_BOTL diff --git a/win/gnome/gnstatus.c b/win/gnome/gnstatus.c index 37e1d7bf6..5109f5bb7 100644 --- a/win/gnome/gnstatus.c +++ b/win/gnome/gnstatus.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 gnstatus.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 gnstatus.c $NHDT-Date: 1425083083 2015/02/28 00:24:43 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.6 $ */ /* NetHack 3.5 gnstatus.c $Date: 2009/05/06 10:57:54 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gnstatus.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ @@ -655,7 +655,6 @@ void ghack_status_window_update_stats() lastAC = u.uac; gtk_label_set( GTK_LABEL( acLabel), buf); -#ifdef EXP_ON_BOTL if (flags.showexp) { sprintf(buf,"Exp:%ld", u.uexp); if (lastExp < u.uexp && firstTime==FALSE) { @@ -669,7 +668,6 @@ void ghack_status_window_update_stats() lastExp = u.uexp; gtk_label_set( GTK_LABEL( expLabel), buf); } else -#endif { gtk_label_set( GTK_LABEL( expLabel), ""); } From 5fb3fea9c6c5c6eb9389386ba01acdd5d646f6a0 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sat, 14 Feb 2015 15:02:50 -0500 Subject: [PATCH 137/354] Remove experimental Unicode support. This reverts commit 7f0f43e6f98bccab20db7ab3cb509fdbe60a7b2b and some related subsequent commits. This compiles, but I have not done extensive testing. Conflicts: include/config.h include/decl.h include/extern.h include/global.h include/tradstdc.h include/wintty.h src/drawing.c src/files.c src/hacklib.c src/mapglyph.c src/options.c sys/winnt/nttty.c win/tty/getline.c win/tty/topl.c win/tty/wintty.c --- dat/symbols | 132 ----------------- include/config.h | 4 - include/decl.h | 2 +- include/extern.h | 16 +-- include/flag.h | 2 - include/global.h | 33 +---- include/ntconf.h | 5 - include/rm.h | 22 +-- include/tradstdc.h | 9 -- include/wintty.h | 17 +-- src/decl.c | 3 +- src/drawing.c | 6 +- src/files.c | 90 +----------- src/hacklib.c | 188 ------------------------- src/mapglyph.c | 17 ++- src/options.c | 40 +++--- src/pager.c | 2 +- src/pline.c | 6 +- sys/winnt/nttty.c | 84 ++--------- win/tty/getline.c | 62 +++----- win/tty/topl.c | 167 ++++++++-------------- win/tty/wintty.c | 342 +++++---------------------------------------- 22 files changed, 189 insertions(+), 1060 deletions(-) diff --git a/dat/symbols b/dat/symbols index 8f396582b..108d761d1 100644 --- a/dat/symbols +++ b/dat/symbols @@ -201,10 +201,6 @@ start: RogueEpyx S_food: \x05 # club (as in cards) S_potion: \xad # upside down '!' S_scroll: \x0e # musical note -# S_armor: \x5b -# S_ring: \x3d -# S_amulet: \x0c -# S_tool: \x28 S_wand: \xe7 # greek tau S_coin: \x0f # yes it's the same as gems S_gem: \x0f # fancy '*' @@ -397,131 +393,3 @@ start: NHAccess S_explode9: \047 finish -start: Unicode_US - Description: Unicode symbols similar to code page 437 - Restrictions: Unicode - S_vwall: U+2502 # box drawings light vertical - S_hwall: U+2500 # box drawings light horizontal - S_tlcorn: U+250C # box drawings light down and right - S_trcorn: U+2510 # box drawings light down and left - S_blcorn: U+2514 # box drawings light up and right - S_brcorn: U+2518 # box drawings light up and left - S_crwall: U+253C # box drawings light up and left - S_tuwall: U+2534 # box drawings light up and horizontal - S_tdwall: U+252C # box drawings light down and horizontal - S_tlwall: U+2524 # box drawings light vertical and left - S_trwall: U+251C # box drawings light vertical and right - S_ndoor: U+2556 # box drawings down double and left single - S_vodoor: U+25A0 # black square - S_hodoor: U+25A0 # black square - S_bars: U+2261 # identical to - S_tree: U+00B1 # plus-minus sign - S_room: U+00B7 # middle dot - S_corr: U+2591 # light shade - S_litcorr: U+2592 # medium shade - S_fountain: U+2320 # top half integral - S_pool: U+2248 # almost equal to - S_ice: U+00B7 # middle dot - S_lava: U+2248 # almost equal to - S_vodbridge: U+00B7 # middle dot - S_hodbridge: U+00B7 # middle dot - S_water: U+2248 # almost equal to - S_vbeam: U+2502 # box drawings light vertical - S_hbeam: U+2500 # box drawings light horizontal - S_sw_ml: U+2502 # box drawings light vertical - S_sw_mr: U+2502 # box drawings light vertical - S_explode4: U+2502 # box drawings light vertical - S_explode6: U+2502 # box drawings light vertical -finish - -start: Unicode_non_US - Description: If default OEM CP for non-Unicode programs is not 437 or 850 - Restrictions: Unicode - S_vwall: U+2502 # box drawings light vertical - S_hwall: U+2500 # box drawings light horizontal - S_tlcorn: U+250C # box drawings light down and right - S_trcorn: U+2510 # box drawings light down and left - S_blcorn: U+2514 # box drawings light up and right - S_brcorn: U+2518 # box drawings light up and left - S_crwall: U+253C # box drawings light up and left - S_tuwall: U+2534 # box drawings light up and horizontal - S_tdwall: U+252C # box drawings light down and horizontal - S_tlwall: U+2524 # box drawings light vertical and left - S_trwall: U+251C # box drawings light vertical and right - S_vodoor: U+25A0 # black square - S_hodoor: U+25A0 # black square - S_corr: U+2591 # light shade - S_litcorr: U+2592 # medium shade - S_vbeam: U+2502 # box drawings light vertical - S_hbeam: U+2500 # box drawings light horizontal - S_sw_ml: U+2502 # box drawings light vertical - S_sw_mr: U+2502 # box drawings light vertical - S_explode4: U+2502 # box drawings light vertical - S_explode6: U+2502 # box drawings light vertical - S_coin: U+20AC # euro -finish - -start: UnicodeRogueEpyx - Description: Unicode Rogue level symbols - Restrictions: Unicode - Restrictions: Rogue - Color: Yes - S_weapon: U+2191 # up arrow - S_armor: U+25d9 # Vert rect with o - S_ring: U+2642 # circle with arrow - S_amulet: U+2640 # "female" symbol - S_food: U+2663 # club (as in cards) - S_potion: U+00a1 # upside down '!' - S_scroll: U+266a # musical note - S_wand: U+03c4 # greek tau - S_coin: U+263c # yes it's the same as gems - S_gem: U+263c # fancy '*' - S_rock: U+0060 # grave accent - S_ball: U+0030 # digit 0 - S_chain: U+005f # low line - S_venom: U+002e # full stop - S_book: U+002b # + sign - S_vwall: U+2551 # all walls now use - S_hwall: U+2550 # double line graphics - S_tlcorn: U+2554 # box drawing double down and right - S_trcorn: U+2557 # box drawing double down and left - S_blcorn: U+255a # box drawing double up and right - S_brcorn: U+255d # box drawing double up and left - S_crwall: U+256c # box drawing double vertical and horizontal - S_tuwall: U+2569 # box drawing double up and horizontal - S_tdwall: U+2566 # box drawing double down and horizontal - S_tlwall: U+2563 # box drawing double vertical and left - S_trwall: U+2560 # box drawing double vertical and right - S_ndoor: U+256c # box drawing double vertical and horizontal - S_vodoor: U+256c # box drawing double vertical and horizontal - S_hodoor: U+256c # box drawing double vertical and horizontal - S_room: U+00b7 # centered dot - S_corr: U+2592 # medium shade - S_litcorr: U+2593 # dark shade - S_upstair: U+001e # Greek Xi - S_dnstair: U+001f - S_arrow_trap: U+2666 # diamond (cards) - S_dart_trap: U+2666 - S_falling_rock_trap: U+2666 - S_squeaky_board: U+2666 - S_bear_trap: U+2666 - S_land_mine: U+2666 - S_rolling_boulder_trap: U+2666 - S_sleeping_gas_trap: U+2666 - S_rust_trap: U+2666 - S_fire_trap: U+2666 - S_pit: U+2666 - S_spiked_pit: U+2666 - S_hole: U+2666 - S_trap_door: U+2666 - S_teleportation_trap: U+2666 - S_level_teleporter: U+2666 - S_magic_portal: U+2666 - S_web: U+2666 - S_statue_trap: U+2666 - S_magic_trap: U+2666 - S_anti_magic_trap: U+2666 - S_polymorph_trap: U+2666 - S_human: U+263a # face -finish - diff --git a/include/config.h b/include/config.h index 3bddda18b..c13b2dd01 100644 --- a/include/config.h +++ b/include/config.h @@ -315,10 +315,6 @@ */ #endif /* CHDIR */ -/* - * Enable some UNICODE support. - */ -/*#define UNICODE_SUPPORT */ /* master on/off for any unicode support */ /* diff --git a/include/decl.h b/include/decl.h index 92f1e8240..f9d4a7b7c 100644 --- a/include/decl.h +++ b/include/decl.h @@ -320,7 +320,6 @@ E NEARDATA winid WIN_MESSAGE; E NEARDATA winid WIN_STATUS; #endif E NEARDATA winid WIN_MAP, WIN_INVEN; -E nhwchar toplines[]; /* pline (et al) for a single string argument (suppress compiler warning) */ #define pline1(cstr) pline("%s", cstr) @@ -331,6 +330,7 @@ E nhwchar toplines[]; #define Sprintf1(buf, cstr) Sprintf(buf, "%s", cstr) #define panic1(cstr) panic("%s", cstr) +E char toplines[]; #ifndef TCAP_H E struct tc_gbl_data { /* also declared in tcap.h */ char *tc_AS, *tc_AE; /* graphics start and end (tty font swapping) */ diff --git a/include/extern.h b/include/extern.h index bfd361326..c3004a0a0 100644 --- a/include/extern.h +++ b/include/extern.h @@ -731,7 +731,6 @@ E void FDECL(check_recordfile, (const char *)); E void NDECL(read_wizkit); E int FDECL(read_sym_file, (int)); E int FDECL(parse_sym_line, (char *,int)); -E int FDECL(sym_val, (const char *)); E void FDECL(paniclog, (const char *, const char *)); E int FDECL(validate_prefix_locations, (char *)); #ifdef SELECTSAVED @@ -846,20 +845,6 @@ E int NDECL(phase_of_the_moon); E boolean NDECL(friday_13th); E int NDECL(night); E int NDECL(midnight); -#ifdef UNICODE_WIDEWINPORT -E nhwchar *FDECL(nhwstrncpy, (nhwchar *,const char *,size_t)); -E nhwchar *FDECL(nhwncpy, (nhwchar *,const nhwchar *,size_t)); -E nhwchar *FDECL(nhwcpy, (nhwchar *,const nhwchar *)); -E nhwchar *FDECL(nhwstrcpy, (nhwchar *,const char *)); -E char *FDECL(strnhwcpy, (char *,const nhwchar *)); -E nhwchar *FDECL(nhwstrcat, (nhwchar *,const char *)); -E nhwchar *FDECL(nhwcat, (nhwchar *,const nhwchar *)); -E nhwchar *FDECL(nhwindex, (const nhwchar *,int)); -E size_t FDECL(nhwlen, (const nhwchar *)); -E int FDECL(nhwcmp, (const nhwchar *,const nhwchar *)); -E int FDECL(nhwncmp, (const nhwchar *,const nhwchar *,int)); -E int FDECL(nhwstrcmp, (const nhwchar *,const char *)); -#endif /* ### invent.c ### */ @@ -1587,6 +1572,7 @@ E int FDECL(load_symset, (const char *,int)); E void FDECL(parsesymbols, (char *)); E struct symparse *FDECL(match_sym, (char *)); E void NDECL(set_playmode); +E int FDECL(sym_val, (char *)); /* ### pager.c ### */ diff --git a/include/flag.h b/include/flag.h index 2b5d2c3ee..de2b63e84 100644 --- a/include/flag.h +++ b/include/flag.h @@ -198,8 +198,6 @@ struct instance_flags { boolean rlecomp; /* run-length comp of levels when writing savefile */ uchar num_pad_mode; boolean echo; /* 1 to echo characters */ - boolean unicodecapable; /* unicode support is possible on platform */ - boolean unicodedisp; /* unicode support is turned on */ #if 0 boolean DECgraphics; /* use DEC VT-xxx extended character set */ boolean IBMgraphics; /* use IBM extended character set */ diff --git a/include/global.h b/include/global.h index e3292e243..6179409bb 100644 --- a/include/global.h +++ b/include/global.h @@ -65,41 +65,10 @@ typedef xchar boolean; /* 0 or 1 */ #endif /* - * UNICODE_SUPPORT - * Unicode/wide character related support. + * type nhsym: loadable symbols go into this type */ -#ifdef UNICODE_SUPPORT -# define UNICODE_DRAWING /* store drawing symbols in wchar_t data type */ -# define UNICODE_WIDEWINPORT /* store and render wide chars in window port */ -/*# define UNICODE_PLAYERTEXT*/ /* not implemented - player input in wide chars */ -#include -#include -#else -# undef UNICODE_DRAWING -# undef UNICODE_WIDEWINPORT -# undef UNICODE_PLAYERTEXT -#endif - -#if defined(UNICODE_DRAWING) -typedef wchar_t nhsym; /* nhsym is wide char */ -#else typedef uchar nhsym; -#endif -#if defined(UNICODE_WIDEWINPORT) -typedef wchar_t nhwchar; /* nhwchar (window port char) is wide char */ -#else -typedef char nhwchar; -#endif - -#if 0 -/* Not Implemented presently */ -#if defined(UNICODE_PLAYERTEXT) -typedef wchar_t nhptext; /* player input is wide char */ -#else -typedef char nhptext; -#endif -#endif #ifndef STRNCMPI # ifndef __SASC_60 /* SAS/C already shifts to stricmp */ diff --git a/include/ntconf.h b/include/ntconf.h index 4ad1a6e73..95a506635 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -193,11 +193,6 @@ extern void NDECL(toggle_mouse_support); extern void FDECL(map_subkeyvalue, (char *)); extern void NDECL(load_keyboard_handler); extern void NDECL(raw_clear_screen); -# ifdef UNICODE_WIDEWINPORT -extern void FDECL(xputc, (NHWCHAR_P)); -# else -extern void FDECL(xputc, (int)); -# endif #endif #include diff --git a/include/rm.h b/include/rm.h index 2fa3da6b6..c007f6a4f 100644 --- a/include/rm.h +++ b/include/rm.h @@ -227,13 +227,6 @@ struct symdef { #endif }; -/* - * Graphics sets for display symbols - */ -#define PRIMARY 0 /* primary graphics */ -#define ROGUESET 1 /* rogue graphics */ -#define NUM_GRAPHICS 2 - struct symparse { unsigned range; #define SYM_CONTROL 1 /* start/finish markers */ @@ -260,18 +253,25 @@ struct symsetentry { Bitfield(nocolor,1); /* don't use color if set */ Bitfield(primary,1); /* restricted for use as primary set */ Bitfield(rogue,1); /* restricted for use as rogue lev set */ - Bitfield(unicode,1); /* restricted for use as a unicode set */ /* 5 free bits */ }; +/* + * Graphics sets for display symbols + */ +#define DEFAULT_GRAPHICS 0 /* regular characters: '-', '+', &c */ +#define PRIMARY 0 /* primary graphics set */ +#define ROGUESET 1 /* rogue graphics set */ +#define NUM_GRAPHICS 2 + /* * special symbol set handling types ( for invoking callbacks, etc.) * Must match the order of the known_handlers strings * in drawing.c */ -#define H_UNK 0 -#define H_IBM 1 -#define H_DEC 2 +#define H_UNK 0 +#define H_IBM 1 +#define H_DEC 2 extern const struct symdef defsyms[MAXPCHARS]; /* defaults */ extern const struct symdef def_warnsyms[WARNCOUNT]; diff --git a/include/tradstdc.h b/include/tradstdc.h index 480ea7878..dc75bc393 100644 --- a/include/tradstdc.h +++ b/include/tradstdc.h @@ -257,7 +257,6 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */ # define BOOLEAN_P boolean # endif # define ALIGNTYP_P aligntyp -# define NHWCHAR_P nhwchar #else # ifdef WIDENED_PROTOTYPES # define CHAR_P int @@ -267,14 +266,6 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */ # define SHORT_P int # define BOOLEAN_P int # define ALIGNTYP_P int -# if defined(UNICODE_WIDEWINPORT) && defined(WCHAR_MAX) -# if WCHAR_MAX >= INT_MAX -# define NHWCHAR_P nhwchar -# endif -# endif -# ifndef NHWCHAR_P -# define NHWCHAR_P int -# endif # else /* Neither widened nor unwidened prototypes. Argument list expansion * by FDECL/VDECL always empty; all xxx_P vanish so defs aren't needed. */ diff --git a/include/wintty.h b/include/wintty.h index a2ed1e009..507804a9f 100644 --- a/include/wintty.h +++ b/include/wintty.h @@ -35,8 +35,8 @@ struct WinDesc { /* maxcol is also used by WIN_MESSAGE for */ /* tracking the ^P command */ short *datlen; /* allocation size for *data */ - nhwchar **data; /* window data [row][column] */ - nhwchar *morestr; /* string to display instead of default */ + char **data; /* window data [row][column] */ + char *morestr; /* string to display instead of default */ tty_menu_item *mlist; /* menu information (MENU) */ tty_menu_item **plist; /* menu page pointers (MENU) */ short plist_size; /* size of allocated plist (MENU) */ @@ -88,7 +88,7 @@ extern struct WinDesc *wins[MAXWIN]; extern struct DisplayDesc *ttyDisplay; /* the tty display descriptor */ extern char morc; /* last character typed to xwaitforspace */ -extern nhwchar defmorestr[]; /* default --more-- prompt */ +extern char defmorestr[]; /* default --more-- prompt */ /* port specific external function references */ @@ -109,9 +109,7 @@ E void NDECL(tty_shutdown); * actually would be expanded. So here, we have to make an exception. */ E void FDECL(xputc, (int)); #else -# ifndef WIN32CON E void FDECL(xputc, (CHAR_P)); -# endif #endif E void FDECL(xputs, (const char *)); #if defined(SCREEN_VGA) || defined(SCREEN_8514) @@ -154,10 +152,10 @@ E int FDECL(has_color,(int color)); /* ### topl.c ### */ -E void FDECL(addtopl, (const nhwchar *)); +E void FDECL(addtopl, (const char *)); E void NDECL(more); -E void FDECL(update_topl, (const nhwchar *)); -E void FDECL(putsyms, (const nhwchar *)); +E void FDECL(update_topl, (const char *)); +E void FDECL(putsyms, (const char*)); /* ### wintty.c ### */ #ifdef CLIPPING @@ -167,9 +165,6 @@ E void FDECL(docorner, (int, int)); E void NDECL(end_glyphout); E void FDECL(g_putch, (int)); E void FDECL(win_tty_init, (int)); -#ifdef UNICODE_WIDEWINPORT -E void FDECL(u_putch, (nhwchar)); -#endif /* external declarations */ E void FDECL(tty_init_nhwindows, (int *, char **)); diff --git a/src/decl.c b/src/decl.c index f7601bda0..6c83f0f14 100644 --- a/src/decl.c +++ b/src/decl.c @@ -262,8 +262,7 @@ NEARDATA winid WIN_MESSAGE = WIN_ERR; NEARDATA winid WIN_STATUS = WIN_ERR; #endif NEARDATA winid WIN_MAP = WIN_ERR, WIN_INVEN = WIN_ERR; -nhwchar toplines[TBUFSZ]; - +char toplines[TBUFSZ]; /* Windowing stuff that's really tty oriented, but present for all ports */ struct tc_gbl_data tc_gbl_data = { 0,0, 0,0 }; /* AS,AE, LI,CO */ diff --git a/src/drawing.c b/src/drawing.c index 7fb0d461a..a5cc10d46 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -24,8 +24,8 @@ struct symsetentry symset[NUM_GRAPHICS]; int currentgraphics = 0; nhsym showsyms[SYM_MAX] = DUMMY; /* symbols to be displayed */ -nhsym l_syms[SYM_MAX] = DUMMY; /* loaded symbols */ -nhsym r_syms[SYM_MAX] = DUMMY; /* rogue symbols */ +nhsym l_syms[SYM_MAX] = DUMMY; /* loaded symbols */ +nhsym r_syms[SYM_MAX] = DUMMY; /* rogue symbols */ nhsym warnsyms[WARNCOUNT] = DUMMY; /* the current warning display symbols */ const char invisexplain[] = "remembered, unseen, creature"; @@ -525,7 +525,6 @@ boolean name_too; /* initialize restriction bits */ symset[which_set].primary = 0; symset[which_set].rogue = 0; - symset[which_set].unicode = 0; if (name_too) { if (symset[which_set].name) @@ -563,7 +562,6 @@ const char *known_handling[] = { const char *known_restrictions[] = { "primary", "rogue", - "unicode", (const char *)0, }; diff --git a/src/files.c b/src/files.c index cb7363399..7ba180547 100644 --- a/src/files.c +++ b/src/files.c @@ -2607,7 +2607,7 @@ parse_sym_line(buf, which_set) char *buf; int which_set; { - int val; + int val, i; struct symparse *symp = (struct symparse *)0; char *bufp, *commentp, *altp; @@ -2657,7 +2657,6 @@ int which_set; return 0; if (!symset[which_set].name) { - int i; /* A null symset name indicates that we're just building a pick-list of possible symset values from the file, so only do that */ @@ -2682,7 +2681,6 @@ int which_set; /* initialize restriction bits */ tmpsp->primary = 0; tmpsp->rogue = 0; - tmpsp->unicode = 0; break; case 2: /* handler type identified */ @@ -2705,17 +2703,14 @@ int which_set; case 5: /* restrictions: xxxx*/ tmpsp = symset_list; /* most recent symset */ - i = 0; - while (known_restrictions[i]) { + for (i = 0; known_restrictions[i]; ++i) { if (!strcmpi(known_restrictions[i], bufp)) { switch(i) { case 0: tmpsp->primary = 1; break; case 1: tmpsp->rogue = 1; break; - case 2: tmpsp->unicode = 1; break; } break; /* while loop */ } - i++; } break; } @@ -2732,7 +2727,7 @@ int which_set; chosen_symset_start = TRUE; /* these init_*() functions clear symset fields too */ if (which_set == ROGUESET) init_r_symbols(); - else if (which_set == PRIMARY) init_l_symbols(); + else if (which_set == PRIMARY) init_l_symbols(); } break; case 1: @@ -2771,23 +2766,12 @@ int which_set; break; case 1: symset[which_set].rogue = 1; break; - case 2: symset[which_set].unicode = 1; - break; } break; /* while loop */ } n++; } - /* Don't allow unicode set if code can't handle it */ - if (symset[which_set].unicode && - !iflags.unicodedisp) { - if (chosen_symset_start) - chosen_symset_end = FALSE; - chosen_symset_start = FALSE; - if (which_set == ROGUESET) init_r_symbols(); - else if (which_set == PRIMARY) init_l_symbols(); - } - } + } break; } } else { /* !SYM_CONTROL */ @@ -2821,72 +2805,6 @@ int which_set; } } -/* - * Produces a single integer value. - */ -int -sym_val(cp) -const char *cp; -{ - unsigned int cval = 0; - int meta = 0, dcount = 0; - const char *dp, *hex = "00112233445566778899aAbBcCdDeEfF"; - - while (*cp) - { - if (*cp == '\\' && index("mM", cp[1])) { - meta = 1; - cp += 2; - } - if ((*cp == 'U' || *cp == 'u') && cp[1] == '+' && index(hex, cp[2])) - { - dcount = 0; - cp++; - for (++cp; *cp && (dp = index(hex, *cp)) && (dcount++ < 4); cp++) - cval = (unsigned int)((cval * 16) + - ((unsigned int)(dp - hex) / 2)); - } - else if (*cp == '\\' && index("0123456789xXoO", cp[1])) - { - dcount = 0; - cp++; - if (*cp == 'x' || *cp == 'X') - for (++cp; *cp && (dp = index(hex, *cp)) && (dcount++ < 4); cp++) - cval = (unsigned int)((cval * 16) + - ((unsigned int)(dp - hex) / 2)); - else if (*cp == 'o' || *cp == 'O') - for (++cp; *cp && (index("01234567",*cp)) && (dcount++ < 5); cp++) - cval = (cval * 8) + (unsigned int)(*cp - '0'); - else - for (; *cp && (index("0123456789",*cp)) && (dcount++ < 5); cp++) - cval = (cval * 10) + (unsigned int)(*cp - '0'); - } - else if (*cp == '\\') /* C-style character escapes */ - { - switch (*++cp) - { - case '\\': cval = '\\'; break; - case 'n': cval = '\n'; break; - case 't': cval = '\t'; break; - case 'b': cval = '\b'; break; - case 'r': cval = '\r'; break; - default: cval = (unsigned int)*cp; - } - cp++; - } - else if (*cp == '^') /* expand control-character syntax */ - { - cval = (unsigned int)(*++cp & 0x1f); - cp++; - } - else - cval = (unsigned int)*cp++; - if (meta) - cval |= 0x80; - } - return cval; -} - /* ---------- END CONFIG FILE HANDLING ----------- */ /* ---------- BEGIN SCOREBOARD CREATION ----------- */ diff --git a/src/hacklib.c b/src/hacklib.c index 398b96dd4..4565f6d65 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -768,192 +768,4 @@ midnight() return(getlt()->tm_hour == 0); } -#ifdef UNICODE_WIDEWINPORT -nhwchar * -nhwstrncpy(dest, strSource, cnt) -nhwchar *dest; -const char *strSource; -size_t cnt; -{ - nhwchar *d = dest; - const char *s = strSource; - size_t dcnt = 0; - - while(*s && dcnt < cnt) { - *d++ = (nhwchar)*s++; - dcnt++; - } - if (dcnt < cnt) *d = 0; - return dest; -} - -nhwchar * -nhwncpy(dest, src, cnt) -nhwchar *dest; -const nhwchar *src; -size_t cnt; -{ - nhwchar *d = dest; - const nhwchar *s = src; - size_t dcnt = 0; - - while(*s && dcnt < cnt) { - *d++ = *s++; - dcnt++; - } - if (dcnt < cnt) *d = 0; - return dest; -} - -nhwchar * -nhwcpy(dest, src) -nhwchar *dest; -const nhwchar *src; -{ - nhwchar *d = dest; - const nhwchar *s = src; - - while(*s) { - *d++ = *s++; - } - *d = 0; - return dest; -} - -nhwchar * -nhwstrcpy(dest, strSource) -nhwchar *dest; -const char *strSource; -{ - nhwchar *d = dest; - const char *s = strSource; - - while(*s) { - *d++ = *s++; - } - *d = 0; - return dest; -} - -char * -strnhwcpy(strDest, src) -char *strDest; -const nhwchar *src; -{ - char *d = strDest; - const nhwchar *s = src; - - while(*s) { - *d++ = (char)*s++; - } - *d = 0; - return strDest; -} - -nhwchar * -nhwstrcat(dest, strSource) -nhwchar *dest; -const char *strSource; -{ - nhwchar *d = dest; - const char *s = strSource; - - while(*d) d++; - while(*s) { - *d++ = *s++; - } - *d = 0; - return dest; -} - -nhwchar * -nhwcat(dest, src) -nhwchar *dest; -const nhwchar *src; -{ - nhwchar *d = dest; - const nhwchar *s = src; - - while(*d) d++; - while(*s) { - *d++ = *s++; - } - *d = 0; - return dest; -} - -nhwchar * -nhwindex(ss, c) -const nhwchar *ss; -int c; -{ - const nhwchar *s = ss; - - while (*s) { - if (*s == c) return (nhwchar *)s; - s++; - } - if (*s == c) return (nhwchar *)s; - return (nhwchar *)0; -} - -size_t nhwlen(src) -const nhwchar *src; -{ - register size_t dl = 0; - - while(*src++) dl++; - return dl; -} - -int -nhwcmp(s1, s2) /* case sensitive comparison */ -register const nhwchar *s1, *s2; -{ - register nhwchar t1, t2; - - for (;;) { - if (!*s2) return (*s1 != 0); /* s1 >= s2 */ - else if (!*s1) return -1; /* s1 < s2 */ - t1 = *s1++; - t2 = *s2++; - if (t1 != t2) return (t1 > t2) ? 1 : -1; - } - return 0; /* s1 == s2 */ -} - -int -nhwncmp(s1, s2, n) /* case sensitive counted nhwchar (wide string) comparison */ - register const nhwchar *s1, *s2; - register int n; /*(should probably be size_t, which is usually unsigned)*/ -{ - register nhwchar t1, t2; - - while (n--) { - if (!*s2) return (*s1 != 0); /* s1 >= s2 */ - else if (!*s1) return -1; /* s1 < s2 */ - t1 = *s1++; - t2 = *s2++; - if (t1 != t2) return (t1 > t2) ? 1 : -1; - } - return 0; /* s1 == s2 */ -} - -int -nhwstrcmp(s1, s2) -register const nhwchar *s1; -const char *s2; -{ - register nhwchar t1, t2; - - for (;;) { - if (!*s2) return (*s1 != 0); /* s1 >= s2 */ - else if (!*s1) return -1; /* s1 < s2 */ - t1 = *s1++; - t2 = (nhwchar)*s2++; - if (t1 != t2) return (t1 > t2) ? 1 : -1; - } - return 0; /* s1 == s2 */ -} -#endif /*hacklib.c*/ diff --git a/src/mapglyph.c b/src/mapglyph.c index c00d6f8ad..e44265d3a 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -225,7 +225,6 @@ int glyph; return encbuf; } -#ifndef UNICODE_WIDEWINPORT /* * This differs from putstr() because the str parameter can * contain a sequence of characters representing: @@ -267,12 +266,25 @@ genl_putmixed(window, attr, str) gv = (int)((gv * 16) + ((int)(dp - hex) / 2)); so = mapglyph(gv, &ch, &oc, &os, 0, 0); *put++ = showsyms[so]; - continue; } else { /* possible forgery - leave it the way it is */ cp = save_cp; } break; +# if 0 + case 'S': /* symbol offset */ + dcount = 0; + for (++cp; *cp && (dp = index(hex, *cp)) && (dcount++ < 4); cp++) + rndchk = (int)((rndchk * 16) + ((int)(dp - hex) / 2)); + + if (rndchk == context.rndencode) { + dcount = 0; + for (; *cp && (dp = index(hex, *cp)) && (dcount++ < 2); cp++) + so = (int)((so * 16) + ((int)(dp - hex) / 2)); + } + *put++ = showsyms[so]; + break; +# endif case '\\': break; } @@ -283,5 +295,4 @@ genl_putmixed(window, attr, str) /* now send it to the normal putstr */ putstr(window, attr, buf); } -#endif /*!UNICODE_WIDEWINPORT*/ /*mapglyph.c*/ diff --git a/src/options.c b/src/options.c index 97378888a..1c63c5ed5 100644 --- a/src/options.c +++ b/src/options.c @@ -198,9 +198,6 @@ static struct Bool_Opt {"tombstone",&flags.tombstone, TRUE, SET_IN_GAME}, {"toptenwin",&iflags.toptenwin, FALSE, SET_IN_GAME}, {"travel", &flags.travelcmd, TRUE, SET_IN_GAME}, -#ifdef UNICODE_SUPPORT - {"unicode", &iflags.unicodedisp, FALSE, SET_IN_GAME}, -#endif #ifdef WIN32CON {"use_inverse", &iflags.wc_inverse, TRUE, SET_IN_GAME}, /*WC*/ #else @@ -605,9 +602,6 @@ initoptions_init() iflags.msg_history = 20; #ifdef TTY_GRAPHICS iflags.prevmsg_window = 's'; -# if defined(UNIX) && defined(UNICODE_WIDEWINPORT) - iflags.unicodecapable = TRUE; -# endif #endif iflags.menu_headings = ATR_INVERSE; @@ -2514,7 +2508,7 @@ goodfruit: boolean badflag = FALSE; if (duplicate) complain_about_duplicate(opts,1); if (!negated) { - for (i = PRIMARY; i <= ROGUESET; ++i) { + for (i = 0; i < NUM_GRAPHICS; ++i) { if (symset[i].name) badflag = TRUE; else { @@ -3359,7 +3353,7 @@ boolean setinitial,setfromfile; || !strcmp("roguesymset", optname)) { menu_item *symset_pick = (menu_item *)0; boolean primaryflag = (*optname == 's'), - rogueflag = (*optname == 'r'), + rogueflag = (*optname == 'r'), ready_to_switch = FALSE, nothing_to_do = FALSE; int res; @@ -3384,8 +3378,7 @@ boolean setinitial,setfromfile; sl = symset_list; while (sl) { /* check restrictions */ - if ((!rogueflag && sl->rogue) || - (!iflags.unicodedisp && sl->unicode) || + if ((!rogueflag && sl->rogue) || (!primaryflag && sl->primary)) { sl = sl->next; continue; @@ -3398,8 +3391,8 @@ boolean setinitial,setfromfile; } if (!setcount) { pline("There are no appropriate %ssymbol sets available.", - (rogueflag) ? "rogue level " : - (primaryflag) ? "primary " : + (rogueflag) ? "rogue level " : + (primaryflag) ? "primary " : ""); return TRUE; } @@ -3415,7 +3408,6 @@ boolean setinitial,setfromfile; while (sl) { /* check restrictions */ if ((!rogueflag && sl->rogue) || - (!iflags.unicodedisp && sl->unicode) || (!primaryflag && sl->primary)) { sl = sl->next; continue; @@ -3502,7 +3494,7 @@ boolean setinitial,setfromfile; if(rogueflag) init_r_symbols(); else - init_l_symbols(); + init_l_symbols(); if (symset[which_set].name) { if (read_sym_file(which_set)) @@ -3568,14 +3560,9 @@ char *buf; #endif #ifdef BACKWARD_COMPAT else if (!strcmp(optname, "boulder")) - Sprintf(buf, -# ifdef UNICODE_DRAWING - "\\x%04X", -# else - "%c", -# endif - iflags.bouldersym ? iflags.bouldersym : - showsyms[(int)objects[BOULDER].oc_class + SYM_OFF_O]); + Sprintf(buf, "%c", iflags.bouldersym ? + iflags.bouldersym : + showsyms[(int)objects[BOULDER].oc_class + SYM_OFF_O]); #endif else if (!strcmp(optname, "catname")) Sprintf(buf, "%s", catname[0] ? catname : none); @@ -4034,6 +4021,15 @@ char *buf; return (struct symparse *)0; } +int sym_val(strval) +char *strval; +{ + char buf[QBUFSZ]; + buf[0] = '\0'; + escapes(strval, buf); + return (int)*buf; +} + /* data for option_help() */ static const char *opt_intro[] = { "", diff --git a/src/pager.c b/src/pager.c index 4d734e5ef..4e8008c1b 100644 --- a/src/pager.c +++ b/src/pager.c @@ -571,7 +571,7 @@ do_look(mode, click_cc) for (i = 0; i < MAXMCLASSES; i++) { if (sym == ((from_screen || clicklook) ? showsyms[i + SYM_OFF_M] : def_monsyms[i].sym) && - def_monsyms[i].explain) { + def_monsyms[i].explain) { need_to_look = TRUE; if (!found) { Sprintf(out_str, "%s %s", diff --git a/src/pline.c b/src/pline.c index bd80a040f..3ee998684 100644 --- a/src/pline.c +++ b/src/pline.c @@ -76,11 +76,7 @@ pline VA_DECL(const char *, line) return; } #ifndef MAC -# ifdef UNICODE_WIDEWINPORT - if (no_repeat && !nhwstrcmp(toplines, line)) -# else - if (no_repeat && !strcmp(toplines, line)) -# endif + if (no_repeat && !strcmp(line, toplines)) return; #endif /* MAC */ if (vision_full_recalc) vision_recalc(0); diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index a0f9d95fe..9b9b186bc 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -64,6 +64,9 @@ int GUILaunched; extern int redirect_stdout; static BOOL FDECL(CtrlHandler, (DWORD)); +/* Flag for whether unicode is supported */ +static boolean has_unicode; + #ifdef PORT_DEBUG static boolean display_cursor_info = FALSE; #endif @@ -146,12 +149,6 @@ static void NDECL(init_ttycolor); # endif static void NDECL(really_move_cursor); -#ifdef UNICODE_WIDEWINPORT -void FDECL(xputc_core,(NHWCHAR_P)); -#else -void FDECL(xputc_core,(int)); -#endif - #define MAX_OVERRIDES 256 unsigned char key_overrides[MAX_OVERRIDES]; @@ -199,14 +196,11 @@ const char *s; void setftty() { - static int cp = 0; - if (!cp) cp = GetConsoleOutputCP(); - /* SetConsoleOutputCP(1250); */ #ifdef CHANGE_COLOR if (altered_palette) adjust_palette(); #endif start_screen(); - iflags.unicodecapable = ((GetVersion() & 0x80000000) == 0); + has_unicode = ((GetVersion() & 0x80000000) == 0); } void @@ -457,61 +451,24 @@ int x,y; ttyDisplay->cury = y; } -#ifdef UNICODE_WIDEWINPORT -#define T(x) L##x -#else -#define T(x) x -#endif - void -xputc_core(ich) -#ifdef UNICODE_WIDEWINPORT -nhwchar ich; -#else -int ich; -#endif +xputc_core(ch) +char ch; { - static uchar c[2] = {0,0}; - char ch = (char)ich; - -#if 0 - /*EURO symbol*/ - if (ich == 0x20AC) { - if (!c[0]) { - wchar_t t[2]={0x20ac, 0x0000}; - int cp = GetConsoleOutputCP(); - (void) WideCharToMultiByte(cp, - 0, - t, 1, - c, 2, - (LPCSTR)0, - (LPBOOL)0); - } - ich = (nhwchar)c[0]; - } -#endif -#ifdef UNICODE_WIDEWINPORT - switch(ich) { -#else switch(ch) { -#endif - case T('\n'): + case '\n': cursor.Y++; /* fall through */ - case T('\r'): + case '\r': cursor.X = 1; break; - case T('\b'): + case '\b': cursor.X--; break; default: WriteConsoleOutputAttribute(hConOut,&attr,1, cursor,&acount); - if (iflags.unicodedisp) { -#ifdef UNICODE_WIDEWINPORT - WriteConsoleOutputCharacterW(hConOut,&ich,1, - cursor,&ccount); -#else + if (has_unicode) { /* Avoid bug in ANSI API on WinNT */ WCHAR c2[2]; int rc; @@ -522,7 +479,6 @@ int ich; c2, 2); WriteConsoleOutputCharacterW(hConOut,c2,rc, cursor,&ccount); -#endif } else { WriteConsoleOutputCharacterA(hConOut,&ch,1, @@ -534,11 +490,7 @@ int ich; void xputc(ch) -#ifdef UNICODE_WIDEWINPORT -nhwchar ch; -#else -int ch; -#endif +char ch; { cursor.X = ttyDisplay->curx; cursor.Y = ttyDisplay->cury; @@ -569,8 +521,8 @@ const char *s; * for win32. It is used for glyphs only, not text. */ void -g_putch(in_sym) -int in_sym; +g_putch(in_ch) +int in_ch; { /* CP437 to Unicode mapping according to the Unicode Consortium */ static const WCHAR cp437[] = @@ -608,18 +560,12 @@ int in_sym; 0x2261, 0x00b1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00f7, 0x2248, 0x00b0, 0x2219, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x25a0, 0x00a0 }; - uchar ch = (uchar)in_sym; + unsigned char ch = (unsigned char)in_ch; cursor.X = ttyDisplay->curx; cursor.Y = ttyDisplay->cury; WriteConsoleOutputAttribute(hConOut,&attr,1,cursor,&acount); -#ifdef UNICODE_DRAWING - if (symset[currentgraphics].name && - symset[currentgraphics].unicode && iflags.unicodedisp) - WriteConsoleOutputCharacterW(hConOut,(LPCWSTR)&in_sym,1,cursor,&ccount); - else -#endif - if (SYMHANDLING(H_IBM)) + if (has_unicode) WriteConsoleOutputCharacterW(hConOut,&cp437[ch],1,cursor,&ccount); else WriteConsoleOutputCharacterA(hConOut,&ch,1,cursor,&ccount); diff --git a/win/tty/getline.c b/win/tty/getline.c index 2dd90ae3f..4a2d8c251 100644 --- a/win/tty/getline.c +++ b/win/tty/getline.c @@ -24,25 +24,6 @@ extern int NDECL(extcmd_via_menu); /* cmd.c */ extern char erase_char, kill_char; /* from appropriate tty.c file */ -/* cloned from topl.c, but not identical - */ -#ifdef UNICODE_WIDEWINPORT - /* nhwchar is wchar; data from core needs narrow-to-wide conversion; - data going back to core needs wide-to-narrow conversion; data - used within tty routines typically needs wide-to-wide awareness */ -STATIC_VAR nhwchar getl_wbuf[BUFSZ]; -STATIC_VAR char getl_nbuf[BUFSZ]; -#define T(x) L##x -#define Waddtopl(str) addtopl(nhwstrcpy(getl_wbuf,str)) -#define Wputsyms(str) putsyms(nhwstrcpy(getl_wbuf,str)) -#define NWstrcpy(wdst,src) nhwstrcpy(wdst,src) /* narrow-to-wide */ -#else /*!UNICODE_WIDEWINPORT*/ - /* nhwchar is char; no conversions needed */ -#define T(x) x -#define Waddtopl(str) addtopl(str) -#define Wputsyms(str) putsyms(str) -#endif /*?UNICODE_WIDEWINPORT*/ - /* * Read a line closed with '\n' into the array char bufp[BUFSZ]. * (The '\n' is not stored. The string is closed with a '\0'.) @@ -76,12 +57,7 @@ getlin_hook_proc hook; *obufp = 0; for(;;) { (void) fflush(stdout); -#ifdef UNICODE_WIDEWINPORT - Strcat(strcat(strcpy(getl_nbuf, query), " "), obufp); - (void)NWstrcpy(toplines, getl_nbuf); -#else Strcat(strcat(strcpy(toplines, query), " "), obufp); -#endif c = pgetchar(); if (c == '\033' || c == EOF) { obufp[0] = '\033'; @@ -100,10 +76,10 @@ getlin_hook_proc hook; ttyDisplay->inread = sav; tty_clear_nhwindow(WIN_MESSAGE); cw->maxcol = cw->maxrow; - Waddtopl(query); - Waddtopl(T(" ")); + addtopl(query); + addtopl(" "); *bufp = 0; - Waddtopl(obufp); + addtopl(obufp); } else { if (!doprev) (void) tty_doprev_message();/* need two initially */ @@ -115,10 +91,10 @@ getlin_hook_proc hook; tty_clear_nhwindow(WIN_MESSAGE); cw->maxcol = cw->maxrow; doprev = 0; - Waddtopl(query); - Waddtopl(T(" ")); + addtopl(query); + addtopl(" "); *bufp = 0; - Waddtopl(obufp); + addtopl(obufp); } if(c == erase_char || c == '\b') { if(bufp != obufp) { @@ -128,11 +104,11 @@ getlin_hook_proc hook; #endif /* NEWAUTOCOMP */ bufp--; #ifndef NEWAUTOCOMP - putsyms(T("\b \b"));/* putsym converts \b */ + putsyms("\b \b");/* putsym converts \b */ #else /* NEWAUTOCOMP */ - putsyms(T("\b")); - for (i = bufp; *i; ++i) putsyms(T(" ")); - for (; i > bufp; --i) putsyms(T("\b")); + putsyms("\b"); + for (i = bufp; *i; ++i) putsyms(" "); + for (; i > bufp; --i) putsyms("\b"); *bufp = 0; #endif /* NEWAUTOCOMP */ } else tty_nhbell(); @@ -155,21 +131,21 @@ getlin_hook_proc hook; #endif /* NEWAUTOCOMP */ *bufp = c; bufp[1] = 0; - Wputsyms(bufp); + putsyms(bufp); bufp++; if (hook && (*hook)(obufp)) { - Wputsyms(bufp); + putsyms(bufp); #ifndef NEWAUTOCOMP bufp = eos(bufp); #else /* NEWAUTOCOMP */ /* pointer and cursor left where they were */ - for (i = bufp; *i; ++i) putsyms(T("\b")); + for (i = bufp; *i; ++i) putsyms("\b"); } else if (i > bufp) { char *s = i; /* erase rest of prior guess */ - for (; i > bufp; --i) putsyms(T(" ")); - for (; s > bufp; --s) putsyms(T("\b")); + for (; i > bufp; --i) putsyms(" "); + for (; s > bufp; --s) putsyms("\b"); #endif /* NEWAUTOCOMP */ } } else if(c == kill_char || c == '\177') { /* Robert Viduya */ @@ -177,11 +153,11 @@ getlin_hook_proc hook; #ifndef NEWAUTOCOMP while(bufp != obufp) { bufp--; - putsyms(T("\b \b")); + putsyms("\b \b"); } #else /* NEWAUTOCOMP */ - for (; *bufp; ++bufp) putsyms(T(" ")); - for (; bufp != obufp; --bufp) putsyms(T("\b \b")); + for (; *bufp; ++bufp) putsyms(" "); + for (; bufp != obufp; --bufp) putsyms("\b \b"); *bufp = 0; #endif /* NEWAUTOCOMP */ } else @@ -192,8 +168,6 @@ getlin_hook_proc hook; clear_nhwindow(WIN_MESSAGE); /* clean up after ourselves */ } -#undef T - void xwaitforspace(s) register const char *s; /* chars allowed besides return */ diff --git a/win/tty/topl.c b/win/tty/topl.c index 3efb52696..db307b73a 100644 --- a/win/tty/topl.c +++ b/win/tty/topl.c @@ -1,5 +1,4 @@ -/* NetHack 3.5 topl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ -/* NetHack 3.5 topl.c $Date: 2012/01/23 06:29:37 $ $Revision: 1.24 $ */ +/* NetHack 3.5 topl.c $NHDT-Date: 1425081315 2015/02/27 23:55:15 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.24 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -15,44 +14,8 @@ #define C(c) (0x1f & (c)) #endif -/* use caution with this stuff; it's very easy to get things mixed up... - */ -#ifdef UNICODE_WIDEWINPORT - /* nhwchar is wchar; data from core needs narrow-to-wide conversion; - data going back to core needs wide-to-narrow conversion; data - used within tty routines typically needs wide-to-wide awareness */ -STATIC_VAR nhwchar topl_wbuf[BUFSZ]; -STATIC_VAR char topl_nbuf[BUFSZ]; -#define T(x) L##x -#define DoGputch(x) ((x) >= 0x80) -#define Waddtopl(str) addtopl(nhwstrcpy(topl_wbuf,str)) -#define Wputstr(win,atr,wstr) putstr(win,atr,strnhwcpy(topl_nbuf,wstr)) -#define Windex(wstr,wchr) nhwindex(wstr,wchr) -#define Wstrlen(wstr) (int)nhwlen(wstr) -#define NWstrcpy(wdst,src) nhwstrcpy(wdst,src) /* narrow-to-wide */ -#define WNstrcpy(dst,wsrc) strnhwcpy(dst,wsrc) /* wide-to-narrow */ -#define WWstrcpy(wdst,wsrc) nhwcpy(wdst,wsrc) /* wide-to-wide */ -#define WWstrcat(wdst,wsrc) nhwcat(wdst,wsrc) -#define WWstrncpy(wdst,wsrc,ln nhwncpy(wdst,wsrc,ln) -#define WWstrncmp(wst1,wst2,ln) nhwncmp(wst1,wst2,ln) -#else /*!UNICODE_WIDEWINPORT*/ - /* nhwchar is char; no conversions needed */ -#define T(x) x -#define DoGputch(x) ((x) & 0x80) -#define Waddtopl(str) addtopl(str) -#define Wputstr(win,atr,str) putstr(win,atr,str) -#define Windex(wstr,wchr) index(wstr,wchr) -#define Wstrlen(wstr) (int)strlen(wstr) -#define NWstrcpy(wdst,src) strcpy(wdst,src) -#define WNstrcpy(dst,wsrc) strcpy(dst,wsrc) -#define WWstrcpy(wdst,wsrc) strcpy(wdst,wsrc) -#define WWstrcat(wdst,wsrc) strcat(wdst,wsrc) -#define WWstrncpy(wdst,wsrc,ln) strncpy(wdst,wsrc,ln) -#define WWstrncmp(wst1,wst2,ln) strncmp(wst1,wst2,ln) -#endif /*?UNICODE_WIDEWINPORT*/ - -STATIC_DCL void FDECL(redotoplin, (const nhwchar*)); -STATIC_DCL void FDECL(topl_putsym, (NHWCHAR_P)); +STATIC_DCL void FDECL(redotoplin, (const char*)); +STATIC_DCL void FDECL(topl_putsym, (CHAR_P)); STATIC_DCL void NDECL(remember_topl); STATIC_DCL void FDECL(removetopl, (int)); STATIC_DCL void FDECL(msghistory_snapshot, (BOOLEAN_P)); @@ -62,9 +25,9 @@ int tty_doprev_message() { register struct WinDesc *cw = wins[WIN_MESSAGE]; + winid prevmsg_win; int i; - if ((iflags.prevmsg_window != 's') && !ttyDisplay->inread) { /* not single */ if(iflags.prevmsg_window == 'f') { /* full */ prevmsg_win = create_nhwindow(NHW_MENU); @@ -73,11 +36,11 @@ tty_doprev_message() cw->maxcol = cw->maxrow; i = cw->maxcol; do { - if (cw->data[i] && *cw->data[i]) - Wputstr(prevmsg_win, 0, cw->data[i]); + if(cw->data[i] && strcmp(cw->data[i], "") ) + putstr(prevmsg_win, 0, cw->data[i]); i = (i + 1) % cw->rows; } while (i != cw->maxcol); - Wputstr(prevmsg_win, 0, toplines); + putstr(prevmsg_win, 0, toplines); display_nhwindow(prevmsg_win, TRUE); destroy_nhwindow(prevmsg_win); } else if (iflags.prevmsg_window == 'c') { /* combination */ @@ -104,12 +67,11 @@ tty_doprev_message() cw->maxcol = cw->maxrow; i = cw->maxcol; do { - if (cw->data[i] && *cw->data[i]) - Wputstr(prevmsg_win, 0, cw->data[i]); + if(cw->data[i] && strcmp(cw->data[i], "") ) + putstr(prevmsg_win, 0, cw->data[i]); i = (i + 1) % cw->rows; } while (i != cw->maxcol); - - Wputstr(prevmsg_win, 0, toplines); + putstr(prevmsg_win, 0, toplines); display_nhwindow(prevmsg_win, TRUE); destroy_nhwindow(prevmsg_win); } @@ -121,11 +83,11 @@ tty_doprev_message() prevmsg_win = create_nhwindow(NHW_MENU); putstr(prevmsg_win, 0, "Message History"); putstr(prevmsg_win, 0, ""); - Wputstr(prevmsg_win, 0, toplines); + putstr(prevmsg_win, 0, toplines); cw->maxcol=cw->maxrow-1; if(cw->maxcol < 0) cw->maxcol = cw->rows-1; do { - Wputstr(prevmsg_win, 0, cw->data[cw->maxcol]); + putstr(prevmsg_win, 0, cw->data[cw->maxcol]); cw->maxcol--; if (cw->maxcol < 0) cw->maxcol = cw->rows-1; if (!cw->data[cw->maxcol]) @@ -156,19 +118,19 @@ tty_doprev_message() } STATIC_OVL void -redotoplin(symstr) - const nhwchar *symstr; +redotoplin(str) + const char *str; { int otoplin = ttyDisplay->toplin; home(); - if (DoGputch(*symstr)) { + if(*str & 0x80) { /* kludge for the / command, the only time we ever want a */ /* graphics character on the top line */ - g_putch((int)*symstr++); + g_putch((int)*str++); ttyDisplay->curx++; } end_glyphout(); /* in case message printed during graphics output */ - putsyms(symstr); + putsyms(str); cl_end(); ttyDisplay->toplin = 1; if(ttyDisplay->cury && otoplin != 3) @@ -180,25 +142,25 @@ remember_topl() { register struct WinDesc *cw = wins[WIN_MESSAGE]; int idx = cw->maxrow; - unsigned len; + unsigned len = strlen(toplines) + 1; if ((cw->flags & WIN_LOCKHISTORY) || !*toplines) return; - len = Wstrlen(toplines) + 1; + if (len > (unsigned)cw->datlen[idx]) { if (cw->data[idx]) free(cw->data[idx]); len += (8 - (len & 7)); /* pad up to next multiple of 8 */ - cw->data[idx] = (nhwchar *)alloc(sizeof(nhwchar) * len); + cw->data[idx] = (char *)alloc(len); cw->datlen[idx] = (short)len; } - (void)WWstrcpy(cw->data[idx], toplines); + Strcpy(cw->data[idx], toplines); *toplines = '\0'; cw->maxcol = cw->maxrow = (idx + 1) % cw->rows; } void addtopl(s) -const nhwchar *s; +const char *s; { register struct WinDesc *cw = wins[WIN_MESSAGE]; @@ -219,8 +181,7 @@ more() if(ttyDisplay->toplin) { tty_curs(BASE_WINDOW, cw->curx+1, cw->cury); - if(cw->curx >= CO - 8) - topl_putsym(T('\n')); + if(cw->curx >= CO - 8) topl_putsym('\n'); } if(flags.standout) @@ -249,22 +210,22 @@ more() void update_topl(bp) - register const nhwchar *bp; + register const char *bp; { - register nhwchar *tl, *otl; + register char *tl, *otl; register int n0; int notdied = 1; struct WinDesc *cw = wins[WIN_MESSAGE]; /* If there is room on the line, print message on same line */ /* But messages like "You die..." deserve their own line */ - n0 = Wstrlen(bp); + n0 = strlen(bp); if ((ttyDisplay->toplin == 1 || (cw->flags & WIN_STOP)) && cw->cury == 0 && - n0 + Wstrlen(toplines) + 3 < CO-8 && /* room for --More-- */ - (notdied = WWstrncmp(bp, T("You die"), 7))) { - (void)WWstrcat(toplines, T(" ")); - (void)WWstrcat(toplines, bp); + n0 + (int)strlen(toplines) + 3 < CO-8 && /* room for --More-- */ + (notdied = strncmp(bp, "You die", 7))) { + Strcat(toplines, " "); + Strcat(toplines, bp); cw->curx += 2; if(!(cw->flags & WIN_STOP)) addtopl(bp); @@ -277,7 +238,7 @@ update_topl(bp) } } remember_topl(); - (void)WWstrncpy(toplines, bp, TBUFSZ); + (void) strncpy(toplines, bp, TBUFSZ); toplines[TBUFSZ - 1] = 0; for(tl = toplines; n0 >= CO; ){ @@ -285,11 +246,11 @@ update_topl(bp) for(tl+=CO-1; tl != otl && !isspace(*tl); --tl) ; if(tl == otl) { /* Eek! A huge token. Try splitting after it. */ - tl = Windex(otl, T(' ')); + tl = index(otl, ' '); if (!tl) break; /* No choice but to spit it out whole. */ } - *tl++ = T('\n'); - n0 = Wstrlen(tl); + *tl++ = '\n'; + n0 = strlen(tl); } if(!notdied) cw->flags &= ~WIN_STOP; if(!(cw->flags & WIN_STOP)) redotoplin(toplines); @@ -298,21 +259,21 @@ update_topl(bp) STATIC_OVL void topl_putsym(c) - nhwchar c; + char c; { register struct WinDesc *cw = wins[WIN_MESSAGE]; if(cw == (struct WinDesc *) 0) panic("Putsym window MESSAGE nonexistant"); switch(c) { - case T('\b'): + case '\b': if(ttyDisplay->curx == 0 && ttyDisplay->cury > 0) tty_curs(BASE_WINDOW, CO, (int)ttyDisplay->cury-1); backsp(); ttyDisplay->curx--; cw->curx = ttyDisplay->curx; return; - case T('\n'): + case '\n': cl_end(); ttyDisplay->curx = 0; ttyDisplay->cury++; @@ -323,7 +284,7 @@ topl_putsym(c) break; default: if(ttyDisplay->curx == CO-1) - topl_putsym(T('\n')); /* 1 <= curx <= CO; avoid CO */ + topl_putsym('\n'); /* 1 <= curx <= CO; avoid CO */ #ifdef WIN32CON (void) putchar(c); #endif @@ -337,11 +298,11 @@ topl_putsym(c) } void -putsyms(symstr) - const nhwchar *symstr; +putsyms(str) + const char *str; { - while(*symstr) - topl_putsym(*symstr++); + while(*str) + topl_putsym(*str++); } STATIC_OVL void @@ -349,8 +310,7 @@ removetopl(n) register int n; { /* assume addtopl() has been done, so ttyDisplay->toplin is already set */ - while (n-- > 0) - putsyms(T("\b \b")); + while (n-- > 0) putsyms("\b \b"); } extern char erase_char; /* from xxxtty.c; don't need kill_char */ @@ -413,7 +373,7 @@ char def; ttyDisplay->inread = sav; tty_clear_nhwindow(WIN_MESSAGE); cw->maxcol = cw->maxrow; - Waddtopl(prompt); + addtopl(prompt); } else { if(!doprev) (void) tty_doprev_message(); /* need two initially */ @@ -429,7 +389,7 @@ char def; tty_clear_nhwindow(WIN_MESSAGE); cw->maxcol = cw->maxrow; doprev = 0; - Waddtopl(prompt); + addtopl(prompt); q = '\0'; /* force another loop iteration */ continue; } @@ -450,14 +410,13 @@ char def; tty_nhbell(); q = (char)0; } else if (q == '#' || digit_ok) { - char z; - nhwchar digit_string[2]; + char z, digit_string[2]; int n_len = 0; long value = 0; - addtopl(T("#")), n_len++; - digit_string[1] = (nhwchar)0; + addtopl("#"), n_len++; + digit_string[1] = '\0'; if (q != '#') { - digit_string[0] = (nhwchar)q; + digit_string[0] = q; addtopl(digit_string), n_len++; value = q - '0'; q = '#'; @@ -467,7 +426,7 @@ char def; if (digit(z)) { value = (10 * value) + (z - '0'); if (value < 0) break; /* overflow: try again */ - digit_string[0] = (nhwchar)z; + digit_string[0] = z; addtopl(digit_string), n_len++; } else if (z == 'y' || index(quitchars, z)) { if (z == '\033') value = -1; /* abort */ @@ -492,7 +451,7 @@ char def; if (q != '#') { Sprintf(rtmp, "%c", q); - Waddtopl(rtmp); + addtopl(rtmp); } clean_up: ttyDisplay->inread--; @@ -505,7 +464,7 @@ char def; } /* shared by tty_getmsghistory() and tty_putmsghistory() */ -static nhwchar **snapshot_mesgs = 0; +static char **snapshot_mesgs = 0; /* collect currently available message history data into a sequential array; optionally, purge that data from the active circular buffer set as we go */ @@ -513,7 +472,7 @@ STATIC_OVL void msghistory_snapshot(purge) boolean purge; /* clear message history buffer as we copy it */ { - nhwchar *mesg; + char *mesg; int i, inidx, outidx; struct WinDesc *cw; @@ -528,24 +487,24 @@ boolean purge; /* clear message history buffer as we copy it */ history updating to take place because that could clobber them */ if (!purge) cw->flags |= WIN_LOCKHISTORY; - snapshot_mesgs = (nhwchar **)alloc((cw->rows + 1) * sizeof (nhwchar *)); + snapshot_mesgs = (char **)alloc((cw->rows + 1) * sizeof (char *)); outidx = 0; inidx = cw->maxrow; for (i = 0; i < cw->rows; ++i) { - snapshot_mesgs[i] = (nhwchar *)0; + snapshot_mesgs[i] = (char *)0; mesg = cw->data[inidx]; if (mesg && *mesg) { snapshot_mesgs[outidx++] = mesg; if (purge) { /* we're taking this pointer away; subsequest history updates will eventually allocate a new one to replace it */ - cw->data[inidx] = (nhwchar *)0; + cw->data[inidx] = (char *)0; cw->datlen[inidx] = 0; } } inidx = (inidx + 1) % cw->rows; } - snapshot_mesgs[cw->rows] = (nhwchar *)0; /* sentinel */ + snapshot_mesgs[cw->rows] = (char *)0; /* sentinel */ /* for a destructive snapshot, history is now completely empty */ if (purge) cw->maxcol = cw->maxrow = 0; @@ -565,7 +524,7 @@ boolean purged; /* True: took history's pointers, False: just cloned them */ free((genericptr_t)snapshot_mesgs[i]); } - free((genericptr_t)snapshot_mesgs), snapshot_mesgs = (nhwchar **)0; + free((genericptr_t)snapshot_mesgs), snapshot_mesgs = (char **)0; /* history can resume being updated at will now... */ if (!purged) wins[WIN_MESSAGE]->flags &= ~WIN_LOCKHISTORY; @@ -587,7 +546,7 @@ tty_getmsghistory(init) boolean init; { static int nxtidx; - nhwchar *nextmesg; + char *nextmesg; char *result = 0; if (init) { @@ -598,11 +557,7 @@ boolean init; if (snapshot_mesgs) { nextmesg = snapshot_mesgs[nxtidx++]; if (nextmesg) { -#ifdef UNICODE_WIDEWINPORT - result = WNstrcpy(topl_nbuf, nextmesg); /* wide-to-narrow */ -#else result = (char *)nextmesg; -#endif } else { free_msghistory_snapshot(FALSE); } @@ -648,12 +603,12 @@ boolean restoring_msghist; if (msg) { /* move most recent message to history, make this become most recent */ remember_topl(); - (void)NWstrcpy(toplines, msg); /* narrow-to-wide */ + Strcpy(toplines, msg); } else if (snapshot_mesgs) { /* done putting arbitrary messages in; put the snapshot ones back */ for (idx = 0; snapshot_mesgs[idx]; ++idx) { remember_topl(); - (void)WWstrcpy(toplines, snapshot_mesgs[idx]); /* wide-to-wide */ + Strcpy(toplines, snapshot_mesgs[idx]); } /* now release the snapshot */ free_msghistory_snapshot(TRUE); diff --git a/win/tty/wintty.c b/win/tty/wintty.c index d4c921501..a526897b7 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -43,11 +43,6 @@ extern char mapped_menu_cmds[]; /* from options.c */ /* this is only needed until tty_status_* routines are written */ extern NEARDATA winid WIN_STATUS; -#ifdef UNICODE_WIDEWINPORT -void FDECL(tty_putmixed,(winid,int,const char *)); -void FDECL(tty_putstr_core,(winid,int,const nhwchar *)); -#endif - /* Interface definition, for windows.c */ struct window_procs tty_procs = { "tty", @@ -75,11 +70,7 @@ struct window_procs tty_procs = { tty_destroy_nhwindow, tty_curs, tty_putstr, -#ifdef UNICODE_WIDEWINPORT - tty_putmixed, -#else genl_putmixed, -#endif tty_display_file, tty_start_menu, tty_add_menu, @@ -151,12 +142,7 @@ static char obuf[BUFSIZ]; /* BUFSIZ is defined in stdio.h */ #endif static char winpanicstr[] = "Bad window id %d"; -#ifdef UNICODE_WIDEWINPORT -nhwchar defmorestr[] = L"--More--"; -#else -nhwchar defmorestr[] = "--More--"; -#endif -nhwchar emptysym[1] = {0}; +char defmorestr[] = "--More--"; #ifdef CLIPPING # if defined(USE_TILES) && defined(MSDOS) @@ -196,11 +182,8 @@ STATIC_DCL void FDECL(process_menu_window, (winid,struct WinDesc *)); STATIC_DCL void FDECL(process_text_window, (winid,struct WinDesc *)); STATIC_DCL tty_menu_item *FDECL(reverse, (tty_menu_item *)); STATIC_DCL const char * FDECL(compress_str, (const char *)); -STATIC_DCL void FDECL(tty_putsym, (winid, int, int, NHWCHAR_P)); +STATIC_DCL void FDECL(tty_putsym, (winid, int, int, CHAR_P)); STATIC_DCL char *FDECL(copy_of, (const char *)); -#ifdef UNICODE_WIDEWINPORT -STATIC_DCL nhwchar *FDECL(nhwchar_copy_of, (const nhwchar *)); -#endif STATIC_DCL void FDECL(bail, (const char *)); /* __attribute__((noreturn)) */ /* @@ -295,11 +278,7 @@ if(wc_tracelogf) for(i=WIN_INVEN; i < MAXWIN; i++) if(wins[i] && wins[i]->active) { /* cop-out */ -#ifdef UNICODE_WIDEWINPORT - addtopl(L"Press Return to continue: "); -#else addtopl("Press Return to continue: "); -#endif break; } (void) fflush(stdout); @@ -1120,24 +1099,24 @@ tty_create_nhwindow(type) if(newwin->maxrow) { newwin->data = - (nhwchar **) alloc(sizeof(nhwchar *) * (unsigned)newwin->maxrow); + (char **) alloc(sizeof(char *) * (unsigned)newwin->maxrow); newwin->datlen = (short *) alloc(sizeof(short) * (unsigned)newwin->maxrow); if(newwin->maxcol) { for (i = 0; i < newwin->maxrow; i++) { - newwin->data[i] = (nhwchar *) alloc(sizeof(nhwchar) * (unsigned)newwin->maxcol); + newwin->data[i] = (char *) alloc((unsigned)newwin->maxcol); newwin->datlen[i] = newwin->maxcol; } } else { for (i = 0; i < newwin->maxrow; i++) { - newwin->data[i] = (nhwchar *) 0; + newwin->data[i] = (char *) 0; newwin->datlen[i] = 0; } } if(newwin->type == NHW_MESSAGE) newwin->maxrow = 0; } else { - newwin->data = (nhwchar **)0; + newwin->data = (char **)0; newwin->datlen = (short *)0; } @@ -1175,12 +1154,12 @@ free_window_info(cw, free_data) for(i=0; imaxrow; i++) if(cw->data[i]) { free((genericptr_t)cw->data[i]); - cw->data[i] = (nhwchar *)0; + cw->data[i] = (char *)0; if (cw->datlen) cw->datlen[i] = 0; } if (free_data) { free((genericptr_t)cw->data); - cw->data = (nhwchar **)0; + cw->data = (char **)0; if (cw->datlen) free((genericptr_t)cw->datlen); cw->datlen = (short *)0; cw->rows = 0; @@ -1254,25 +1233,15 @@ dmore(cw, s) register struct WinDesc *cw; const char *s; /* valid responses */ { -#ifdef UNICODE_WIDEWINPORT - char buf[BUFSZ]; -#endif - const nhwchar *prompt = cw->morestr ? cw->morestr : defmorestr; - + const char *prompt = cw->morestr ? cw->morestr : defmorestr; int offset = (cw->type == NHW_TEXT) ? 1 : 2; tty_curs(BASE_WINDOW, (int)ttyDisplay->curx + offset, (int)ttyDisplay->cury); if(flags.standout) standoutbeg(); -#ifdef UNICODE_WIDEWINPORT - strnhwcpy(buf, prompt); - xputs(buf); - ttyDisplay->curx += strlen(buf); -#else xputs(prompt); ttyDisplay->curx += strlen(prompt); -#endif if(flags.standout) standoutend(); @@ -1387,13 +1356,13 @@ struct WinDesc *cw; long count; int n, curr_page, page_lines; boolean finished, counting, reset_count; - char *cp, *rp, resp[QBUFSZ], gacc[QBUFSZ]; - nhwchar *msave, *morestr; + char *cp, *rp, resp[QBUFSZ], gacc[QBUFSZ], + *msave, *morestr; curr_page = page_lines = 0; page_start = page_end = 0; msave = cw->morestr; /* save the morestr */ - cw->morestr = morestr = (nhwchar*) alloc(sizeof(nhwchar) * (unsigned) QBUFSZ); + cw->morestr = morestr = (char*) alloc((unsigned) QBUFSZ); counting = FALSE; count = 0L; reset_count = TRUE; @@ -1510,41 +1479,20 @@ struct WinDesc *cw; Strcat(resp, gacc); /* group accelerators */ Strcat(resp, mapped_menu_cmds); - if (cw->npages > 1) { -#ifdef UNICODE_WIDEWINPORT - char buf[BUFSZ]; - Sprintf(buf, "(%d of %d)", - curr_page + 1, (int) cw->npages); - (void)nhwstrcpy(cw->morestr, buf); -#else + if (cw->npages > 1) Sprintf(cw->morestr, "(%d of %d)", curr_page + 1, (int) cw->npages); -#endif - } else if (msave) { -#ifdef UNICODE_WIDEWINPORT - (void)nhwcpy(cw->morestr, msave); -#else + else if (msave) Strcpy(cw->morestr, msave); -#endif - } else { -#ifdef UNICODE_WIDEWINPORT - (void)nhwcpy(cw->morestr, defmorestr); -#else + else Strcpy(cw->morestr, defmorestr); -#endif - } + tty_curs(window, 1, page_lines); cl_end(); dmore(cw, resp); } else { /* just put the cursor back... */ - tty_curs(window, -#ifdef UNICODE_WIDEWINPORT - (int) nhwlen(cw->morestr) + 2, -#else - (int) strlen(cw->morestr) + 2, -#endif - page_lines); + tty_curs(window, (int) strlen(cw->morestr) + 2, page_lines); xwaitforspace(resp); } @@ -1708,7 +1656,7 @@ winid window; struct WinDesc *cw; { int i, n, attr; - register nhwchar *cp; + register char *cp; for (n = 0, i = 0; i < cw->maxrow; i++) { if (!cw->offx && (n + cw->offy == ttyDisplay->rows - 1)) { @@ -1746,11 +1694,7 @@ struct WinDesc *cw; *cp && (int) ttyDisplay->curx < (int) ttyDisplay->cols; cp++, ttyDisplay->curx++) #endif -#ifdef UNICODE_WIDEWINPORT - u_putch(*cp); -#else (void) putchar(*cp); -#endif term_end_attr(attr); } } @@ -1996,7 +1940,7 @@ STATIC_OVL void tty_putsym(window, x, y, ch) winid window; int x, y; - nhwchar ch; + char ch; { register struct WinDesc *cw = 0; @@ -2008,11 +1952,7 @@ tty_putsym(window, x, y, ch) case NHW_MAP: case NHW_BASE: tty_curs(window, x, y); -#ifdef UNICODE_WIDEWINPORT - u_putch(ch); -#else (void) putchar(ch); -#endif ttyDisplay->curx++; cw->curx++; break; @@ -2055,14 +1995,9 @@ tty_putstr(window, attr, str) const char *str; { register struct WinDesc *cw = 0; -#ifdef UNICODE_WIDEWINPORT - nhwchar symbuf[BUFSZ]; - register const nhwchar *symstr = symbuf; -#else - register const nhwchar *nb; - register nhwchar *ob; + register char *ob; + register const char *nb; register int i, j, n0; -#endif /* Assume there's a real problem if the window is missing -- * probably a panic message @@ -2077,52 +2012,21 @@ tty_putstr(window, attr, str) return; if(cw->type != NHW_MESSAGE) str = compress_str(str); -#if defined(USER_SOUNDS) && defined(WIN32CON) - else - play_sound_for_message(str); -#endif - -#ifdef UNICODE_WIDEWINPORT - nhwstrcpy(symbuf, str); - tty_putstr_core(window, attr, symstr); -} - -void -tty_putstr_core(window, attr, symstr) - winid window; - int attr; - const nhwchar *symstr; -{ - register struct WinDesc *cw = wins[window]; - register const nhwchar *nb; - register nhwchar *ob; - register int i, j, n0; -#endif ttyDisplay->lastwin = window; switch(cw->type) { case NHW_MESSAGE: /* really do this later */ -#ifdef UNICODE_WIDEWINPORT - update_topl(symstr); -#else - update_topl(str); +#if defined(USER_SOUNDS) && defined(WIN32CON) + play_sound_for_message(str); #endif + update_topl(str); break; case NHW_STATUS: ob = &cw->data[cw->cury][j = cw->curx]; if(context.botlx) *ob = 0; -#ifdef UNICODE_WIDEWINPORT - if(!cw->cury && (int)nhwlen(symstr) >= CO) { - /* the characters before "St:" are unnecessary */ - nb = nhwindex(symstr, L':'); - if(nb && nb > symstr+2) - symstr = nb - 2; - } - nb = symstr; -#else if(!cw->cury && (int)strlen(str) >= CO) { /* the characters before "St:" are unnecessary */ nb = index(str, ':'); @@ -2130,8 +2034,6 @@ tty_putstr_core(window, attr, symstr) str = nb - 2; } nb = str; -#endif - for(i = cw->curx+1, n0 = cw->cols; i < n0; i++, nb++) { if(!*nb) { if(*ob || context.botlx) { @@ -2146,31 +2048,19 @@ tty_putstr_core(window, attr, symstr) if(*ob) ob++; } -#ifdef UNICODE_WIDEWINPORT - (void) nhwncpy(&cw->data[cw->cury][j], symstr, cw->cols - j - 1); -#else (void) strncpy(&cw->data[cw->cury][j], str, cw->cols - j - 1); -#endif - cw->data[cw->cury][cw->cols-1] = (nhwchar)0; /* null terminate */ + cw->data[cw->cury][cw->cols-1] = '\0'; /* null terminate */ cw->cury = (cw->cury+1) % 2; cw->curx = 0; break; case NHW_MAP: tty_curs(window, cw->curx+1, cw->cury); term_start_attr(attr); -#ifdef UNICODE_WIDEWINPORT - while(*symstr && (int) ttyDisplay->curx < (int) ttyDisplay->cols-1) { - u_putch(*symstr); - symstr++; - ttyDisplay->curx++; - } -#else while(*str && (int) ttyDisplay->curx < (int) ttyDisplay->cols-1) { (void) putchar(*str); str++; ttyDisplay->curx++; } -#endif cw->curx = 0; cw->cury++; term_end_attr(attr); @@ -2178,23 +2068,14 @@ tty_putstr_core(window, attr, symstr) case NHW_BASE: tty_curs(window, cw->curx+1, cw->cury); term_start_attr(attr); -#ifdef UNICODE_WIDEWINPORT - while (*symstr) { -#else while (*str) { -#endif if ((int) ttyDisplay->curx >= (int) ttyDisplay->cols-1) { cw->curx = 0; cw->cury++; tty_curs(window, cw->curx+1, cw->cury); } -#ifdef UNICODE_WIDEWINPORT - u_putch(*symstr); - symstr++; -#else (void) putchar(*str); str++; -#endif ttyDisplay->curx++; } cw->curx = 0; @@ -2221,10 +2102,10 @@ tty_putstr_core(window, attr, symstr) } /* always grows one at a time, but alloc 12 at a time */ if(cw->cury >= cw->rows) { - nhwchar **tmp; + char **tmp; cw->rows += 12; - tmp = (nhwchar **) alloc(sizeof(nhwchar *) * (unsigned)cw->rows); + tmp = (char **) alloc(sizeof(char *) * (unsigned)cw->rows); for(i=0; imaxrow; i++) tmp[i] = cw->data[i]; if(cw->data) @@ -2236,19 +2117,10 @@ tty_putstr_core(window, attr, symstr) } if(cw->data[cw->cury]) free((genericptr_t)cw->data[cw->cury]); -#ifdef UNICODE_WIDEWINPORT - n0 = nhwlen(symstr) + 1; -#else n0 = strlen(str) + 1; -#endif - - ob = cw->data[cw->cury] = (nhwchar *)alloc(sizeof(nhwchar) * ((unsigned)n0 + 1)); - *ob++ = (nhwchar)(attr + 1); /* avoid nuls, for convenience */ -#ifdef UNICODE_WIDEWINPORT - (void)nhwcpy(ob, symstr); -#else + ob = cw->data[cw->cury] = (char *)alloc((unsigned)n0 + 1); + *ob++ = (char)(attr + 1); /* avoid nuls, for convenience */ Strcpy(ob, str); -#endif if(n0 > cw->maxcol) cw->maxcol = n0; @@ -2256,19 +2128,11 @@ tty_putstr_core(window, attr, symstr) cw->maxrow = cw->cury; if(n0 > CO) { /* attempt to break the line */ -#ifdef UNICODE_WIDEWINPORT - for(i = CO-1; i && symstr[i] != L' ' && symstr[i] != L'\n';) -#else for(i = CO-1; i && str[i] != ' ' && str[i] != '\n';) -#endif i--; if(i) { - cw->data[cw->cury-1][++i] = (nhwchar)0; -#ifdef UNICODE_WIDEWINPORT - tty_putstr_core(window, attr, &symstr[i]); -#else + cw->data[cw->cury-1][++i] = '\0'; tty_putstr(window, attr, &str[i]); -#endif } } @@ -2276,60 +2140,6 @@ tty_putstr_core(window, attr, symstr) } } -#ifdef UNICODE_WIDEWINPORT -/* - * This differs from putstr() because the str parameter can - * contain a sequence of characters representing: - * \GXXXXNNNN a glyph value, encoded by encglyph(). - * - */ -void -tty_putmixed(window, attr, str) - winid window; - int attr; - const char *str; -{ - nhwchar wbuf[BUFSZ]; - const char *cp = str; - nhwchar *put = wbuf; - while (*cp) { - if (*cp == '\\') { - int rndchk = 0, so = 0, gv = 0, ch, oc, dcount; - unsigned os; - const char *dp, *hex = "00112233445566778899aAbBcCdDeEfF"; - const char *save_cp = cp; - - cp++; - switch(*cp) { - case 'G': /* glyph value \GXXXXNNNN*/ - dcount = 0; - for (++cp; *cp && (dp = index(hex, *cp)) && (dcount++ < 4); cp++) - rndchk = (int)((rndchk * 16) + ((int)(dp - hex) / 2)); - - if (rndchk == context.rndencode) { - dcount = 0; - for (; *cp && (dp = index(hex, *cp)) && (dcount++ < 4); cp++) - gv = (int)((gv * 16) + ((int)(dp - hex) / 2)); - so = mapglyph(gv, &ch, &oc, &os, 0, 0); - *put++ = (nhwchar)showsyms[so]; - continue; - } else { - /* possible forgery - leave it the way it is */ - cp = save_cp; - } - break; - case '\\': - break; - } - } - *put++ = (nhwchar)*cp++; - } - *put = (nhwchar)0; - /* now send it to tty_putstr_core() */ - tty_putstr_core(window, attr, wbuf); -} -#endif /*UNICODE_WIDEWINPORT*/ - void tty_display_file(fname, complain) const char *fname; @@ -2515,7 +2325,7 @@ tty_end_menu(window, prompt) /* Reverse the list so that items are in correct order. */ cw->mlist = reverse(cw->mlist); - /* Put the prompt at the beginning of the menu. */ + /* Put the promt at the beginning of the menu. */ if (prompt) { anything any; @@ -2567,19 +2377,10 @@ tty_end_menu(window, prompt) /* produce the largest demo string */ Sprintf(buf, "(%d of %d) ", cw->npages, cw->npages); len = strlen(buf); -#ifdef UNICODE_WIDEWINPORT - cw->morestr = nhwchar_copy_of(emptysym); -#else cw->morestr = copy_of(""); -#endif } else { -#ifdef UNICODE_WIDEWINPORT - cw->morestr = nhwchar_copy_of(L"(end) "); - len = nhwlen(cw->morestr); -#else cw->morestr = copy_of("(end) "); len = strlen(cw->morestr); -#endif } if (len > (int)ttyDisplay->cols) { @@ -2699,11 +2500,7 @@ tty_wait_synch() } else { tty_display_nhwindow(WIN_MAP, FALSE); if(ttyDisplay->inmore) { -#ifdef UNICODE_WIDEWINPORT - addtopl(L"--More--"); -#else addtopl("--More--"); -#endif (void) fflush(stdout); } else if(ttyDisplay->inread > program_state.gameover) { /* this can only happen if we were reading and got interrupted */ @@ -2775,58 +2572,6 @@ end_glyphout() #endif } -#ifdef UNICODE_WIDEWINPORT -/* - * Parts of u_putch() were contributed by Adam Wozniak, 2005. - */ -void -u_putch(sym) -nhwchar sym; -{ - unsigned long unicode = sym; - if (!iflags.unicodedisp) - putchar((char)sym); - else { -#if defined(UNIX) || defined(VMS) - /* send utf8 to display */ - if (unicode < 0x80) { - (void) putchar(unicode); - } else if (unicode < 0x00000800) { - (void) putchar(0xC0 | (unicode >> 6)); - (void) putchar(0x80 | (unicode & 0x3F)); - } else if (unicode < 0x00010000) { - (void) putchar(0xE0 | (unicode >> 12)); - (void) putchar(0x80 | ((unicode >> 6) & 0x3F)); - (void) putchar(0x80 | (unicode & 0x3F)); - } else if (unicode < 0x00200000) { - (void) putchar(0xF0 | (unicode >> 18)); - (void) putchar(0x80 | ((unicode >> 12) & 0x3F)); - (void) putchar(0x80 | ((unicode >> 6) & 0x3F)); - (void) putchar(0x80 | (unicode & 0x3F)); - } else if (unicode < 0x04000000) { - (void) putchar(0xF8 | (unicode >> 24)); - (void) putchar(0x80 | ((unicode >> 18) & 0x3F)); - (void) putchar(0x80 | ((unicode >> 12) & 0x3F)); - (void) putchar(0x80 | ((unicode >> 6) & 0x3F)); - (void) putchar(0x80 | (unicode & 0x3F)); - } else { - (void) putchar(0xFC | (unicode >> 30)); - (void) putchar(0x80 | ((unicode >> 24) & 0x3F)); - (void) putchar(0x80 | ((unicode >> 18) & 0x3F)); - (void) putchar(0x80 | ((unicode >> 12) & 0x3F)); - (void) putchar(0x80 | ((unicode >> 6) & 0x3F)); - (void) putchar(0x80 | (unicode & 0x3F)); - } -#else - /* it is assumed that whatever is being substituted for - putchar() can handle unicode characters directly at - this point (nttty's xputc() for example) */ - (void) putchar(sym); -#endif - } -} -#endif /*UNICODE_WIDEWINPORT*/ - #ifndef WIN32 void g_putch(in_ch) @@ -2835,11 +2580,6 @@ int in_ch; register char ch = (char)in_ch; # if defined(ASCIIGRAPH) && !defined(NO_TERMS) -# if defined(UNICODE_WIDEWINPORT) && defined(UNICODE_DRAWING) - if (iflags.unicodedisp && symset[currentgraphics].name) { - u_putch(in_ch); - } else -# endif if (SYMHANDLING(H_IBM) || iflags.eight_bit_tty) { /* IBM-compatible displays don't need other stuff */ (void) putchar(ch); @@ -2923,9 +2663,9 @@ tty_print_glyph(window, x, y, glyph) xchar x, y; int glyph; { - int ch, idx; + int ch; boolean reverse_on = FALSE; - int color; + int color; unsigned special; #ifdef CLIPPING @@ -2935,7 +2675,7 @@ tty_print_glyph(window, x, y, glyph) } #endif /* map glyph to character and color */ - idx = mapglyph(glyph, &ch, &color, &special, x, y); + (void)mapglyph(glyph, &ch, &color, &special, x, y); /* Move the cursor. */ tty_curs(window, x,y); @@ -2968,11 +2708,6 @@ tty_print_glyph(window, x, y, glyph) if (iflags.grmode && iflags.tile_view) xputg(glyph,ch,special); else -#endif -#if defined(UNICODE_WIDEWINPORT) && defined(UNICODE_DRAWING) - if (iflags.unicodedisp && symset[currentgraphics].name) - g_putch(showsyms[idx]); /* use the unicode symset */ - else #endif g_putch(ch); /* print the character */ @@ -3127,15 +2862,6 @@ copy_of(s) return strcpy((char *) alloc((unsigned) (strlen(s) + 1)), s); } -# ifdef UNICODE_WIDEWINPORT -STATIC_OVL nhwchar * -nhwchar_copy_of(s) - const nhwchar *s; -{ - if (!s) s = emptysym; - return nhwcpy((nhwchar *) alloc(sizeof(nhwchar) * (unsigned) (nhwlen(s) + 1)), s); -} -# endif /*UNICODE_WIDEWINPORT*/ #endif /* TTY_GRAPHICS */ /*wintty.c*/ From 07da4a740ef3b39786abf69515833de3be086b2d Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Mon, 16 Feb 2015 02:09:57 -0500 Subject: [PATCH 138/354] Fix some warnings on the unconditionals branch. --- src/eat.c | 2 +- src/questpgr.c | 6 ++++++ util/makedefs.c | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/eat.c b/src/eat.c index 67e4b88b9..320fa2351 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1597,7 +1597,7 @@ start_eating(otmp) /* called as you start to eat */ { const char *old_nomovemsg, *save_nomovemsg; - debugpline("start_eating: %lx (victual = %lx)", otmp, context.victual.piece); + debugpline("start_eating: %p (victual = %p)", otmp, context.victual.piece); debugpline("reqtime = %d", context.victual.reqtime); debugpline("(original reqtime = %d)", objects[otmp->otyp].oc_delay); debugpline("nmod = %d", context.victual.nmod); diff --git a/src/questpgr.c b/src/questpgr.c index e85877840..d1bd4b250 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -12,6 +12,10 @@ #define QTEXT_FILE "quest.dat" +#ifdef TTY_GRAPHICS +#include "wintty.h" +#endif + /* from sp_lev.c, for deliver_splev_message() */ extern char *lev_message; @@ -49,7 +53,9 @@ dump_qtlist() /* dump the character msg list to check appearance */ for (msg = qt_list.chrole; msg->msgnum > 0; msg++) { pline("msgnum %d: delivery %c", msg->msgnum, msg->delivery); +#ifdef TTY_GRAPHICS more(); +#endif (void) dlb_fseek(msg_file, msg->offset, SEEK_SET); deliver_by_window(msg, NHW_TEXT); } diff --git a/util/makedefs.c b/util/makedefs.c index ba3ee79f3..6914af250 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -2256,7 +2256,7 @@ put_qt_hdrs() qt_hdr.n_hdr, ofp); #ifdef DEBUG for(i = 0; i < qt_hdr.n_hdr; i++) - Fprintf(stderr, "%c @ %ld, ", qt_hdr.id[i], qt_hdr.offset[i]); + Fprintf(stderr, "%s @ %ld, ", qt_hdr.id[i], qt_hdr.offset[i]); Fprintf(stderr, "\n"); #endif @@ -2267,7 +2267,7 @@ put_qt_hdrs() for(i = 0; i < qt_hdr.n_hdr; i++) { #ifdef DEBUG - Fprintf(stderr, "%ld: %c header info.\n", ftell(ofp), + Fprintf(stderr, "%ld: %s header info.\n", ftell(ofp), qt_hdr.id[i]); #endif (void) fwrite((genericptr_t)&(msg_hdr[i].n_msg), sizeof(int), From 8fa8e024156d7df72b6904877fd2c77cd87352a9 Mon Sep 17 00:00:00 2001 From: "Derek S. Ray" Date: Tue, 17 Feb 2015 13:42:59 -0500 Subject: [PATCH 139/354] Remove unused size from questpgr.c --- src/questpgr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/questpgr.c b/src/questpgr.c index d1bd4b250..7f51965f7 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -46,7 +46,6 @@ static void dump_qtlist() /* dump the character msg list to check appearance */ { struct qtmsg *msg; - long size; if (!showdebug()) return; From 66289b13abe176605ea58a5bd51de26ce44d9483 Mon Sep 17 00:00:00 2001 From: "Derek S. Ray" Date: Tue, 17 Feb 2015 13:58:27 -0500 Subject: [PATCH 140/354] remove and transfer INVISIBLE_OBJECTS to branch --- include/display.h | 8 ++++++-- include/extern.h | 3 --- include/obj.h | 6 +----- src/apply.c | 3 --- src/display.c | 24 ------------------------ src/do_wear.c | 6 ------ src/invent.c | 6 ------ src/mkobj.c | 3 --- src/mon.c | 8 -------- src/objnam.c | 18 ------------------ src/pickup.c | 3 --- src/potion.c | 22 ---------------------- src/steal.c | 22 +++++----------------- src/weapon.c | 5 ----- src/zap.c | 8 -------- 15 files changed, 12 insertions(+), 133 deletions(-) diff --git a/include/display.h b/include/display.h index 94ee1a15c..5be06d08a 100644 --- a/include/display.h +++ b/include/display.h @@ -16,9 +16,13 @@ #include "mondata.h" /* for mindless() */ #endif -#ifndef INVISIBLE_OBJECTS +/* + * vobj_at() + * + * Returns the head of the list of objects that the player can see + * at location (x,y). + */ #define vobj_at(x,y) (level.objects[x][y]) -#endif /* * sensemon() diff --git a/include/extern.h b/include/extern.h index c3004a0a0..39a42641c 100644 --- a/include/extern.h +++ b/include/extern.h @@ -295,9 +295,6 @@ E void FDECL(bury_obj, (struct obj *)); /* ### display.c ### */ -#ifdef INVISIBLE_OBJECTS -E struct obj * FDECL(vobj_at, (XCHAR_P,XCHAR_P)); -#endif /* INVISIBLE_OBJECTS */ E void FDECL(magic_map_background, (XCHAR_P,XCHAR_P,int)); E void FDECL(map_background, (XCHAR_P,XCHAR_P,int)); E void FDECL(map_trap, (struct trap *,int)); diff --git a/include/obj.h b/include/obj.h index 3d0e5d88d..dc522b338 100644 --- a/include/obj.h +++ b/include/obj.h @@ -94,11 +94,7 @@ struct obj { Bitfield(recharged,3); /* number of times it's been recharged */ #define on_ice recharged /* corpse on ice */ Bitfield(lamplit,1); /* a light-source -- can be lit */ -#ifdef INVISIBLE_OBJECTS - Bitfield(oinvis,1); /* invisible */ -#else - Bitfield(oreserved1,1); -#endif + Bitfield(oreserved1,1); /* was the placeholder for invisible objects, free for use */ Bitfield(greased,1); /* covered with grease */ Bitfield(nomerge,1); /* set temporarily to prevent merging */ Bitfield(was_thrown,1); /* thrown by hero since last picked up */ diff --git a/src/apply.c b/src/apply.c index d2377b51e..2ac4088dd 100644 --- a/src/apply.c +++ b/src/apply.c @@ -715,9 +715,6 @@ struct obj *obj; if(!getdir((char *)0)) return 0; invis_mirror = Invis; -#ifdef INVISIBLE_OBJECTS - if (obj->oinvis) invis_mirror = TRUE; -#endif useeit = !Blind && (!invis_mirror || See_invisible); uvisage = (ACURR(A_CHA) > 14) ? (poly_gender() == 1 ? "beautiful" : "handsome") : "ugly"; diff --git a/src/display.c b/src/display.c index 48b9f0b65..23dcef3a0 100644 --- a/src/display.c +++ b/src/display.c @@ -139,30 +139,6 @@ STATIC_DCL int FDECL(wall_angle, (struct rm *)); #define remember_topology(x,y) (lastseentyp[x][y] = levl[x][y].typ) -#ifdef INVISIBLE_OBJECTS -/* - * vobj_at() - * - * Returns a pointer to an object if the hero can see an object at the - * given location. This takes care of invisible objects. NOTE, this - * assumes that the hero is not blind and on top of the object pile. - * It does NOT take into account that the location is out of sight, or, - * say, one can see blessed, etc. - */ -struct obj * -vobj_at(x,y) - xchar x,y; -{ - register struct obj *obj = level.objects[x][y]; - - while (obj) { - if (!obj->oinvis || See_invisible) return obj; - obj = obj->nexthere; - } - return ((struct obj *) 0); -} -#endif /* else vobj_at() is defined in display.h */ - /* * magic_map_background() * diff --git a/src/do_wear.c b/src/do_wear.c index 6b622d7af..414f5a522 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -854,9 +854,6 @@ register struct obj *obj; /* can now see invisible monsters */ set_mimic_blocking(); /* do special mimic handling */ see_monsters(); -#ifdef INVISIBLE_OBJECTS - see_objects(); -#endif if (Invis && !oldprop && !HSee_invisible && !Blind) { newsym(u.ux,u.uy); @@ -966,9 +963,6 @@ boolean gone; if (!See_invisible) { set_mimic_blocking(); /* do special mimic handling */ see_monsters(); -#ifdef INVISIBLE_OBJECTS - see_objects(); -#endif } if (Invisible && !Blind) { diff --git a/src/invent.c b/src/invent.c index e3cd20247..62295915c 100644 --- a/src/invent.c +++ b/src/invent.c @@ -2315,9 +2315,6 @@ boolean picked_some; /* only one object */ if (dfeature) pline1(fbuf); read_engr_at(u.ux, u.uy); /* Eric Backus */ -#ifdef INVISIBLE_OBJECTS - if (otmp->oinvis && !See_invisible) verb = "feel"; -#endif You("%s here %s.", verb, doname(otmp)); iflags.last_msg = PLNMSG_ONE_ITEM_HERE; if (otmp->otyp == CORPSE) feel_cockatrice(otmp, FALSE); @@ -2421,9 +2418,6 @@ mergable(otmp, obj) /* returns TRUE if obj & otmp can be merged */ obj->obroken != otmp->obroken || obj->otrapped != otmp->otrapped || obj->lamplit != otmp->lamplit || -#ifdef INVISIBLE_OBJECTS - obj->oinvis != otmp->oinvis || -#endif obj->greased != otmp->greased || obj->oeroded != otmp->oeroded || obj->oeroded2 != otmp->oeroded2 || diff --git a/src/mkobj.c b/src/mkobj.c index 08bb41bfb..5c7cffb7c 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -606,9 +606,6 @@ boolean artif; otmp->known = 1; otmp->lknown = 0; otmp->cknown = 0; -#ifdef INVISIBLE_OBJECTS - otmp->oinvis = !rn2(1250); -#endif otmp->corpsenm = NON_PM; if (init) switch (let) { diff --git a/src/mon.c b/src/mon.c index 4823ae1c7..f617dad4c 100644 --- a/src/mon.c +++ b/src/mon.c @@ -303,11 +303,6 @@ unsigned corpseflags; */ if (Blind && !sensemon(mtmp)) obj->dknown = 0; -#ifdef INVISIBLE_OBJECTS - /* Invisible monster ==> invisible corpse */ - obj->oinvis = mtmp->minvis; -#endif - stackobj(obj); newsym(x, y); return obj; @@ -858,9 +853,6 @@ mpickstuff(mtmp, str) if (!touch_artifact(otmp,mtmp)) continue; if (!can_carry(mtmp,otmp)) continue; if (is_pool(mtmp->mx,mtmp->my)) continue; -#ifdef INVISIBLE_OBJECTS - if (otmp->oinvis && !perceives(mtmp->data)) continue; -#endif if (cansee(mtmp->mx,mtmp->my) && flags.verbose) pline("%s picks up %s.", Monnam(mtmp), (distu(mtmp->mx, mtmp->my) <= 5) ? diff --git a/src/objnam.c b/src/objnam.c index 321d7ff29..84c3599f4 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -683,10 +683,6 @@ register struct obj *obj; } else Strcpy(prefix, "a "); -#ifdef INVISIBLE_OBJECTS - if (obj->oinvis) Strcat(prefix,"invisible "); -#endif - /* "empty" goes at the beginning, but item count goes at the end */ if (cknown && (Is_container(obj) || obj->otyp == STATUE) && !Has_contents(obj)) @@ -2241,9 +2237,6 @@ struct obj *no_wish; int cnt, spe, spesgn, typ, very, rechrg; int blessed, uncursed, iscursed, ispoisoned, isgreased; int eroded, eroded2, erodeproof; -#ifdef INVISIBLE_OBJECTS - int isinvisible; -#endif int halfeaten, mntmp, contents; int islit, unlabeled, ishistoric, isdiluted, trapped; int tmp, tinv, tvariety; @@ -2271,9 +2264,6 @@ struct obj *no_wish; cnt = spe = spesgn = typ = very = rechrg = blessed = uncursed = iscursed = -#ifdef INVISIBLE_OBJECTS - isinvisible = -#endif ispoisoned = isgreased = eroded = eroded2 = erodeproof = halfeaten = islit = unlabeled = ishistoric = isdiluted = trapped = 0; @@ -2324,10 +2314,6 @@ struct obj *no_wish; iscursed = 1; } else if (!strncmpi(bp, "uncursed ", l=9)) { uncursed = 1; -#ifdef INVISIBLE_OBJECTS - } else if (!strncmpi(bp, "invisible ", l=10)) { - isinvisible = 1; -#endif } else if (!strncmpi(bp, "rustproof ", l=10) || !strncmpi(bp, "erodeproof ", l=11) || !strncmpi(bp, "corrodeproof ", l=13) || @@ -3137,10 +3123,6 @@ typfnd: curse(otmp); } -#ifdef INVISIBLE_OBJECTS - if (isinvisible) otmp->oinvis = 1; -#endif - /* set eroded */ if (is_damageable(otmp) || otmp->otyp == CRYSKNIFE) { if (eroded && (is_flammable(otmp) || is_rustprone(otmp))) diff --git a/src/pickup.c b/src/pickup.c index 2c1564f84..fea45dce3 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1266,9 +1266,6 @@ boolean telekinesis; /* not picking it up directly by hand */ /* In case of auto-pickup, where we haven't had a chance to look at it yet; affects docall(SCR_SCARE_MONSTER). */ if (!Blind) -#ifdef INVISIBLE_OBJECTS - if (!obj->oinvis || See_invisible) -#endif obj->dknown = 1; if (obj == uchain) { /* do not pick up attached chain */ diff --git a/src/potion.c b/src/potion.c index 7a4014635..7542ea451 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1909,28 +1909,6 @@ dodip() return 1; } -#ifdef INVISIBLE_OBJECTS - if (potion->otyp == POT_INVISIBILITY && !obj->oinvis) { - obj->oinvis = TRUE; - if (!Blind) { - if (!See_invisible) pline("Where did %s go?", - the(xname(obj))); - else You("notice a little haziness around %s.", - the(xname(obj))); - } - goto poof; - } else if (potion->otyp == POT_SEE_INVISIBLE && obj->oinvis) { - obj->oinvis = FALSE; - if (!Blind) { - if (!See_invisible) pline("So that's where %s went!", - the(xname(obj))); - else pline_The("haziness around %s disappears.", - the(xname(obj))); - } - goto poof; - } -#endif - if(is_poisonable(obj)) { if(potion->otyp == POT_SICKNESS && !obj->opoisoned) { char buf[BUFSZ]; diff --git a/src/steal.c b/src/steal.c index bf7238b01..c73878310 100644 --- a/src/steal.c +++ b/src/steal.c @@ -242,26 +242,14 @@ nothing_to_steal: retry: tmp = 0; for(otmp = invent; otmp; otmp = otmp->nobj) - if ((!uarm || otmp != uarmc) && otmp != uskin - && otmp->oclass != COIN_CLASS -#ifdef INVISIBLE_OBJECTS - && (!otmp->oinvis || perceives(mtmp->data)) -#endif - ) - tmp += ((otmp->owornmask & - (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1); + if ((!uarm || otmp != uarmc) && otmp != uskin && otmp->oclass != COIN_CLASS) + tmp += ((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1); if (!tmp) goto nothing_to_steal; tmp = rn2(tmp); for(otmp = invent; otmp; otmp = otmp->nobj) - if ((!uarm || otmp != uarmc) && otmp != uskin - && otmp->oclass != COIN_CLASS -#ifdef INVISIBLE_OBJECTS - && (!otmp->oinvis || perceives(mtmp->data)) -#endif - ) - if((tmp -= ((otmp->owornmask & - (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1)) < 0) - break; + if ((!uarm || otmp != uarmc) && otmp != uskin && otmp->oclass != COIN_CLASS) + if((tmp -= ((otmp->owornmask & (W_ARMOR | W_RING | W_AMUL | W_TOOL)) ? 5 : 1)) < 0) + break; if(!otmp) { impossible("Steal fails!"); return(0); diff --git a/src/weapon.c b/src/weapon.c index 746d1b5cd..5f611ddcf 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -183,11 +183,6 @@ struct monst *mon; if (is_pick(otmp) && (passes_walls(ptr) && thick_skinned(ptr))) tmp += 2; -#ifdef INVISIBLE_OBJECTS - /* Invisible weapons against monsters who can't see invisible */ - if (otmp->oinvis && !perceives(ptr)) tmp += 3; -#endif - /* Check specially named weapon "to hit" bonuses */ if (otmp->oartifact) tmp += spec_abon(otmp, mon); diff --git a/src/zap.c b/src/zap.c index cbc533041..dfdf95d4c 100644 --- a/src/zap.c +++ b/src/zap.c @@ -979,10 +979,6 @@ register struct obj *obj; } unbless(obj); uncurse(obj); -#ifdef INVISIBLE_OBJECTS - /*[this will be insufficient if it ever reduces obj's shop value]*/ - if (obj->oinvis) obj->oinvis = 0; -#endif return; } @@ -1833,10 +1829,6 @@ struct obj *obj, *otmp; (void) rloco(obj); break; case WAN_MAKE_INVISIBLE: -#ifdef INVISIBLE_OBJECTS - obj->oinvis = TRUE; - newsym(obj->ox,obj->oy); /* make object disappear */ -#endif break; case WAN_UNDEAD_TURNING: case SPE_TURN_UNDEAD: From 56279a9950ec8064d85c4560d557332a226cbd8c Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 25 Feb 2015 22:29:17 +0200 Subject: [PATCH 141/354] Add new parameters to makedefs: --debug and --make "makedefs --debug --make q" is equivalent to "makedefs -q" with DEBUG defined. --- doc/makedefs.6 | 8 ++++++++ util/makedefs.c | 38 +++++++++++++++++++------------------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/doc/makedefs.6 b/doc/makedefs.6 index 9a81780ec..7b850108c 100644 --- a/doc/makedefs.6 +++ b/doc/makedefs.6 @@ -118,6 +118,14 @@ and .IR vis_tab.h . .SH LONG COMMANDS .TP +.BI --debug +Show debugging output. +.br +.TP +.B --make \fR[\fIcommand\fR] +Execute a short command. Command is given without preceding dash. +.br +.TP .BI --input " file" Specify the input .I file diff --git a/util/makedefs.c b/util/makedefs.c index 6914af250..ad37677bc 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -6,7 +6,6 @@ /* NetHack may be freely redistributed. See license for details. */ #define MAKEDEFS_C /* use to conditionally include file sections */ -/* #define DEBUG */ /* uncomment for debugging info */ #include "config.h" #include "permonst.h" @@ -385,6 +384,7 @@ getfp(template, tag, mode) return rv; } +static boolean debug = FALSE; static FILE *inputfp; static FILE *outputfp; @@ -431,6 +431,15 @@ do_ext_makedefs(int argc, char **argv){ Fprintf(stdout, "%s", version_string(buf, delim)); exit(EXIT_SUCCESS); } + IS_OPTION("debug"){ + debug = TRUE; + CONTINUE; + } + IS_OPTION("make"){ + CONSUME; + do_makedefs(argv[0]); + exit(EXIT_SUCCESS); + } IS_OPTION("input"){ CONSUME; if(!strcmp(argv[0], "-")){ @@ -2246,36 +2255,30 @@ put_qt_hdrs() /* * The main header record. */ -#ifdef DEBUG - Fprintf(stderr, "%ld: header info.\n", ftell(ofp)); -#endif + if (debug) Fprintf(stderr, "%ld: header info.\n", ftell(ofp)); (void) fwrite((genericptr_t)&(qt_hdr.n_hdr), sizeof(int), 1, ofp); (void) fwrite((genericptr_t)&(qt_hdr.id[0][0]), sizeof(char)*LEN_HDR, qt_hdr.n_hdr, ofp); (void) fwrite((genericptr_t)&(qt_hdr.offset[0]), sizeof(long), qt_hdr.n_hdr, ofp); -#ifdef DEBUG - for(i = 0; i < qt_hdr.n_hdr; i++) + if (debug) { + for(i = 0; i < qt_hdr.n_hdr; i++) Fprintf(stderr, "%s @ %ld, ", qt_hdr.id[i], qt_hdr.offset[i]); - - Fprintf(stderr, "\n"); -#endif + Fprintf(stderr, "\n"); + } /* * The individual class headers. */ for(i = 0; i < qt_hdr.n_hdr; i++) { -#ifdef DEBUG - Fprintf(stderr, "%ld: %s header info.\n", ftell(ofp), - qt_hdr.id[i]); -#endif + if (debug) Fprintf(stderr, "%ld: %s header info.\n", ftell(ofp), + qt_hdr.id[i]); (void) fwrite((genericptr_t)&(msg_hdr[i].n_msg), sizeof(int), 1, ofp); (void) fwrite((genericptr_t)&(msg_hdr[i].qt_msg[0]), sizeof(struct qtmsg), msg_hdr[i].n_msg, ofp); -#ifdef DEBUG - { int j; + if (debug) { int j; for(j = 0; j < msg_hdr[i].n_msg; j++) { Fprintf(stderr, "msg %d @ %ld (%ld)", msg_hdr[i].qt_msg[j].msgnum, @@ -2287,7 +2290,6 @@ put_qt_hdrs() Fprintf(stderr, "\n"); } } -#endif } } @@ -2340,9 +2342,7 @@ do_questtxt() /* we have summary text; replace raw %E record with it */ Strcpy(in_line, summary_p); /* (guaranteed to fit) */ } else if(qt_comment(in_line)) continue; -#ifdef DEBUG - Fprintf(stderr, "%ld: %s", ftell(stdout), in_line); -#endif + if (debug) Fprintf(stderr, "%ld: %s", ftell(stdout), in_line); (void) fputs(xcrypt(in_line), ofp); } Fclose(ifp); From 5b4000a2e9d98da9b058d3a16cd70e82f45af659 Mon Sep 17 00:00:00 2001 From: keni Date: Sat, 28 Feb 2015 17:52:19 -0500 Subject: [PATCH 142/354] Change NHtext to double the speed of "git checkout" --- DEVEL/hooksdir/NHtext | 82 +++++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/DEVEL/hooksdir/NHtext b/DEVEL/hooksdir/NHtext index e9ee8c28c..03550e513 100755 --- a/DEVEL/hooksdir/NHtext +++ b/DEVEL/hooksdir/NHtext @@ -5,30 +5,32 @@ # clean/smudge filter for handling substitutions use strict; -my $debug = 0; # save trace to file -my $debug2 = 0; # annotate output when running from command line +#my $debug = 0; # save trace to file +#my $debug2 = 0; # annotate output when running from command line -my $sink = ($^O eq "MSWin32")? "NUL" :"/dev/null"; -my $dbgfile = ($^O eq "MSWin32") ? "$ENV{TEMP}.$$" : "/tmp/trace.$$"; -open TRACE, ">>", ($debug==0)? $sink : $dbgfile; -print TRACE "START CLIENT ARGV:\n"; -print TRACE "[0] $0\n"; -my $x1; -for(my $x=0;$x $ENV{$k}\n"; -} -print TRACE "CWD: " . `pwd`; -print TRACE "END\n"; +#my $sink = ($^O eq "MSWin32")? "NUL" :"/dev/null"; +#my $dbgfile = ($^O eq "MSWin32") ? "$ENV{TEMP}.$$" : "/tmp/trace.$$"; +#open TRACE, ">>", ($debug==0)? $sink : $dbgfile; # pick up the prefix for substitutions in this repo -my $PREFIX = `git config --local --get nethack.substprefix`; -chomp($PREFIX); +#my $PREFIX = `git config --local --get nethack.substprefix`; +#chomp($PREFIX); +sub git_config { + my($section, $var) = @_; + local($_); + open(CONFIG, "<", "$ENV{GIT_DIR}/config") or die "Missing .git/config: $!"; + while(){ + m/^\[$section]/ && do { + while(){ + m/^\s+$var\s+=\s+(.*)/ && do { + return $1; + }; + } + }; + } + die "Missing config var: [$section] $var\n"; +} +my $PREFIX = &git_config('nethack','substprefix'); my $submode = 0; # ok to make non-cleaning changes to file my $mode; @@ -37,7 +39,7 @@ if($ARGV[0] eq "--clean"){ $mode = "c"; if(0 == 0+$ENV{NHMODE}){ $submode = 1; # do NOT add extra changes to the file - print TRACE "SKIPPING\n"; +# print TRACE "SKIPPING\n"; } } elsif($ARGV[0] eq "--smudge"){ $mode = "s"; @@ -51,27 +53,30 @@ if($ARGV[0] eq "--clean"){ #XXX #git check-attr -a $ARGV[1] -# process stdin to stdout +# Process stdin to stdout. +# For speed we read in the entire file then do the substitutions. -while(){ - print TRACE "IN: $_"; - # $1 - var and value (including trailing space but not $) - # $2 - var - # $4 - value or undef -# s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\N{DOLLAR SIGN}]+))?)\$/&handlevar($2,$4)/eg; - s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\x24]+))?)\$/&handlevar($2,$4)/eg; - if($debug2){ - chomp; - print "XX: |$_|\n"; - } else { - print; - } - print TRACE "OT: X${_}X\n"; +local($_) = ''; +my $len; +while(1){ + # On at least some systems we only get 64K. + my $len = sysread(STDIN, $_, 999999, length($_)); + last if($len == 0); + die "read failed: $!" unless defined($len); } +# $1 - var and value (including trailing space but not $) +# $2 - var +# $4 - value or undef +# s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\N{DOLLAR SIGN}]+))?)\$/&handlevar($2,$4)/eg; +s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\x24]+))?)\$/&handlevar($2,$4)/ego; + +die "write failed: $!" unless defined syswrite(STDOUT, $_); +exit 0; + sub handlevar { my($var, $val) = @_; - print "HIT '$var' '$val'\n" if($debug2); +# print "HIT '$var' '$val'\n" if($debug2); my $subname = "PREFIX::$var"; if(defined &$subname){ @@ -147,4 +152,3 @@ sub Revision { return $val; } -__END__ From 1b25fe74d8002b2f211bb91955d63d6dc05be480 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 1 Mar 2015 10:16:00 +0200 Subject: [PATCH 143/354] Remove last mention of DUNGEON_OVERVIEW --- src/display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/display.c b/src/display.c index 23dcef3a0..0e8b042a6 100644 --- a/src/display.c +++ b/src/display.c @@ -168,7 +168,7 @@ magic_map_background(x, y, show) lev->glyph = glyph; if (show) show_glyph(x,y, glyph); - remember_topology(x,y); /* DUNGEON_OVERVIEW */ + remember_topology(x,y); } /* @@ -325,7 +325,7 @@ unmap_object(x, y) else \ map_background(x,y,show); \ \ - remember_topology(x,y); /* DUNGEON_OVERVIEW */ \ + remember_topology(x,y); \ } void From f56b880e0aff8e79fa0dc2673dcf0508f94e3548 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 1 Mar 2015 10:26:24 +0200 Subject: [PATCH 144/354] Remove last mention of EXP_ON_BOTL --- dat/opthelp | 3 +-- win/Qt/qt_win.cpp | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/dat/opthelp b/dat/opthelp index f6759e04d..836e33d87 100644 --- a/dat/opthelp +++ b/dat/opthelp @@ -30,6 +30,7 @@ pushweapon when wielding a new weapon, put your previously rawio allow the use of raw I/O [FALSE] rest_on_space count the space bar as a rest character [FALSE] safe_pet prevent you from (knowingly) attacking your pet(s) [TRUE] +showexp display your accumulated experience points [FALSE] showrace show yourself by your race rather than by role [FALSE] silent don't use your terminal's bell sound [TRUE] sortpack group similar kinds of objects in inventory [TRUE] @@ -61,8 +62,6 @@ news print any news from game administrator on startup [TRUE] Boolean option if MFLOPPY was set at compile time: checkspace check free disk space before writing files to disk [TRUE] -Boolean option if EXP_ON_BOTL was set at compile time: -showexp display your accumulated experience points [FALSE] Boolean option if SCORE_ON_BOTL was set at compile time: showscore display your approximate accumulated score [FALSE] diff --git a/win/Qt/qt_win.cpp b/win/Qt/qt_win.cpp index 16ff7873b..110f34756 100644 --- a/win/Qt/qt_win.cpp +++ b/win/Qt/qt_win.cpp @@ -2567,11 +2567,9 @@ void NetHackQtStatusWindow::updateStats() Sprintf(buf, "/%d", u.uenmax); power.setLabel("Pow:",u.uen,buf); ac.setLabel("AC:",(long)u.uac); -#ifdef EXP_ON_BOTL if (::flags.showexp) { exp.setLabel("Exp:",(long)u.uexp); } else -#endif { exp.setLabel(""); } From a156f98de0d5a5f34f7812bf2505cea727dba1bb Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 1 Mar 2015 12:03:51 +0200 Subject: [PATCH 145/354] Remove mention of compile-time AUTOPICKUP_EXCEPTIONS --- doc/Guidebook.mn | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index cf8196b3a..f04f3b309 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1882,8 +1882,7 @@ the character position in the current font to be used in displaying each entry. Such a sequence can be continued to multiple lines by putting a `\e' at the end of each line to be continued. .pg -If your copy of the game included the compile time AUTOPICKUP_EXCEPTIONS -option, then any line starting with ``AUTOPICKUP_EXCEPTION='' is taken +Any line starting with ``AUTOPICKUP_EXCEPTION='' is taken as defining an exception to the .op pickup_types option. @@ -2234,8 +2233,7 @@ or match an autopickup exception. Default is on. .lp pickup_types Specify the object types to be picked up when .op autopickup -is on. Default is all types. If your copy of the game has the -compile time option AUTOPICKUP_EXCEPTIONS included, you may be able to use +is on. Default is all types. You can use .op autopickup_exception configuration file lines to further refine .op autopickup @@ -2540,9 +2538,7 @@ Cannot be set with the `O' command. .hn 2 Configuring autopickup exceptions .pg -There is a compile time option called AUTOPICKUP_EXCEPTIONS. -If your copy of the game was built with that option defined, you can -further refine the behavior of the +You can further refine the behavior of the .op autopickup option beyond what is available through the .op pickup_types From d67ffd179a47f5f81fe1d8f7aa2d8d04085be398 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 1 Mar 2015 14:33:03 +0200 Subject: [PATCH 146/354] Remove useless dungeon.def mangling --- util/makedefs.c | 51 +------------------------------------------------ 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/util/makedefs.c b/util/makedefs.c index ad37677bc..b8a40199f 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -169,8 +169,6 @@ static char *FDECL(bannerc_string, (char *,const char *)); static char *FDECL(xcrypt, (const char *)); static unsigned long FDECL(read_rumors_file, (const char *,int *,long *,unsigned long)); -static int FDECL(check_control, (char *)); -static char *FDECL(without_control, (char *)); static boolean FDECL(d_filter, (char *)); static boolean FDECL(h_filter, (char *)); static boolean FDECL(ranged_attk,(struct permonst*)); @@ -1788,38 +1786,6 @@ dead_data: perror(in_line); /* report the problem */ return; } - -static struct deflist { - - const char *defname; - boolean true_or_false; -} deflist[] = { - { "REINCARNATION", TRUE }, - { 0, 0 } -}; - -static int -check_control(s) - char *s; -{ - int i; - - if(s[0] != '%') return(-1); - - for(i = 0; deflist[i].defname; i++) - if(!strncmp(deflist[i].defname, s+1, strlen(deflist[i].defname))) - return(i); - - return(-1); -} - -static char * -without_control(s) - char *s; -{ - return(s + 1 + strlen(deflist[check_control(in_line)].defname)); -} - void do_dungeon() { @@ -1850,22 +1816,7 @@ do_dungeon() rcnt++; if(in_line[0] == '#') continue; /* discard comments */ -recheck: - if(in_line[0] == '%') { - int i = check_control(in_line); - if(i >= 0) { - if(!deflist[i].true_or_false) { - while (fgets(in_line, sizeof in_line, ifp) != 0) - if(check_control(in_line) != i) goto recheck; - } else - (void) fputs(without_control(in_line),ofp); - } else { - Fprintf(stderr, "Unknown control option '%s' in file %s at line %d.\n", - in_line, DGN_I_FILE, rcnt); - exit(EXIT_FAILURE); - } - } else - (void) fputs(in_line,ofp); + (void) fputs(in_line,ofp); } Fclose(ifp); Fclose(ofp); From 4da05c9dba574a6be2ee810e2eb556eb7ec18eec Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 1 Mar 2015 09:28:09 -0500 Subject: [PATCH 147/354] catch up fixes with some recent changes; also add 'community patch' section --- doc/fixes35.0 | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 6721eb0bb..3cc0e61dd 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -987,7 +987,6 @@ allow digging an adjacent pit with wand of digging while trapped in a pit #terrain command to show unobstructed view of map (w/o mons, objs, traps) digging can activate or disarm some types of traps some monsters can eat tins in addition to corpses to cure some ailments -add Roderick Schertler's pickup_thrown patch add ability to sort the list when viewing known spells with '+' command describe magic cancellation from worn armor in enlightment/end-of-game feedback disclose half physical and/or spell damage in enlightment/end-of-game feedback @@ -1001,7 +1000,6 @@ new config file keyword: SYMBOLS for overriding character symbol values by name opening magic frees from bear traps and webs, activates trap doors closing magic activates bear traps and webs locking converts a hole into a trap door; striking does the opposite -add Malcolm Ryan's Statue Glyphs patch lembas and cram never rot unless cursed multiple squeaks for squeaky boards include time, user ID, and play mode in paniclog entries @@ -1045,15 +1043,6 @@ chatting to a gecko or shopkeeper while hallucinating gives alternate message mimic posing as door might steal hero's key when [un]locking is attempted polymorphing into a dragon while wearing dragon scale mail will cause that mail to revert to dragon scales -adopt/adapt/improve the Paranoid_Quit patch; default is paranoid_confirm:pray - paranoid_confirm:Confirm when requiring "yes" instead of y to confirm, - also require explicit "no" to reject - paranoid_confirm:quit yes vs y to quit or to enter explore mode - paranoid_confirm:die yes vs y to die in explore or wizard mode - paranoid_confirm:bones yes vs y to save bones when dying in wizard mode - paranoid_confirm:attack yes vs y to attack a peaceful monster - paranoid_confirm:pray y to confirm #pray; supersedes prayconfirm - paranoid_confirm:Remove always pick from inventory for 'R' and 'T' flexibility for specifying "detect " vs " detection" when wishing when a sokoban puzzle has been completed (last pit or hole filled in), stop assessing luck penalties and lift most movement restrictions @@ -1088,6 +1077,22 @@ smartphone: fixed F command to prompt for direction unix,vms: altmeta option to handle terminals which send "ESC c" for Alt+c +NetHack Community Patches (or Variation) Included +------------------------------------------------- +Roderick Schertler's pickup_thrown patch +Malcolm Ryan's Statue Glyphs patch +adopt/adapt/improve the Paranoid_Quit patch; default is paranoid_confirm:pray + paranoid_confirm:Confirm when requiring "yes" instead of y to confirm, + also require explicit "no" to reject + paranoid_confirm:quit yes vs y to quit or to enter explore mode + paranoid_confirm:die yes vs y to die in explore or wizard mode + paranoid_confirm:bones yes vs y to save bones when dying in wizard mode + paranoid_confirm:attack yes vs y to attack a peaceful monster + paranoid_confirm:pray y to confirm #pray; supersedes prayconfirm + paranoid_confirm:Remove always pick from inventory for 'R' and 'T' +adopt/adapt/improve Dungeon Overview + + Code Cleanup and Reorganization ------------------------------- removed OVLx section dividers previously used for TRAMPOLINE overlay system @@ -1106,3 +1111,17 @@ drawing symbols for DECGraphics, IBMGraphics, MACgraphics are now stored in an new hints-based configuration system allow documentation to be specialized to the options in the game binary add param to winsys ini routines to allow cleaner shifting during startup +make STEED unconditional +make EXP_ON_BOTL unconditional +make REDO unconditional +make AUTOPICKUP_EXCEPTIONS unconditional +make SEDUCE compile-time unconditional but still removable through SYSCF +clean up some DEBUG conditional code +make GOLDOBJ unconditional +make WIZARD unconditional +make SINKS +make REINCARNATION +make TOURIST unconditional +make KOPS unconditional +make ELBERETH unconditional + From 140ad86cebcdcc4922186023ec360fe79635decb Mon Sep 17 00:00:00 2001 From: keni Date: Sun, 1 Mar 2015 20:26:29 -0500 Subject: [PATCH 148/354] Switch NHtext from "git branch" to "git symbolic-ref" to avoid corner cases. --- DEVEL/hooksdir/NHtext | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/DEVEL/hooksdir/NHtext b/DEVEL/hooksdir/NHtext index 03550e513..861b9e6b1 100755 --- a/DEVEL/hooksdir/NHtext +++ b/DEVEL/hooksdir/NHtext @@ -12,9 +12,6 @@ use strict; #my $dbgfile = ($^O eq "MSWin32") ? "$ENV{TEMP}.$$" : "/tmp/trace.$$"; #open TRACE, ">>", ($debug==0)? $sink : $dbgfile; -# pick up the prefix for substitutions in this repo -#my $PREFIX = `git config --local --get nethack.substprefix`; -#chomp($PREFIX); sub git_config { my($section, $var) = @_; local($_); @@ -30,6 +27,7 @@ sub git_config { } die "Missing config var: [$section] $var\n"; } +# pick up the prefix for substitutions in this repo my $PREFIX = &git_config('nethack','substprefix'); my $submode = 0; # ok to make non-cleaning changes to file @@ -119,16 +117,17 @@ sub Date { #sub Author { #} -# NB: the standard-ish Revision line isn't enough - you need Branch/Revision - +# NB: the standard-ish Revision line isn't enough - you need Branch:Revision - # but we split it into 2 so we can use the standard processing code on Revision # and just slip Branch in. sub Branch { my($val, $mode, $submode) = @_; if($mode eq "c"){ if($submode==0){ - $val = `git branch --no-color --contains`; + $val = `git symbolic-ref -q --short HEAD`; $val =~ s/[\n\r]*$//; $val =~ s/^\*\s*//; + $val = "(unknown)" unless($val =~ m/^[[:print:]]+$/); } } # if($mode eq "s"){ From c5bc6a52680386caa7b624f5a49a561aef9fc9df Mon Sep 17 00:00:00 2001 From: keni Date: Sun, 1 Mar 2015 20:32:28 -0500 Subject: [PATCH 149/354] Manually fix botched NHDT-Branch expansions. --- include/config.h | 2 +- include/decl.h | 2 +- include/extern.h | 2 +- include/flag.h | 2 +- include/wceconf.h | 2 +- src/botl.c | 2 +- src/files.c | 2 +- src/options.c | 2 +- src/pickup.c | 2 +- src/save.c | 2 +- sys/wince/mhstatus.c | 2 +- util/makedefs.c | 2 +- win/X11/winstat.c | 2 +- win/gnome/gnstatus.c | 2 +- win/share/tilemap.c | 2 +- win/tty/topl.c | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/config.h b/include/config.h index c13b2dd01..d8b067fc7 100644 --- a/include/config.h +++ b/include/config.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 config.h $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.51 $ */ +/* NetHack 3.5 config.h $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.51 $ */ /* NetHack 3.5 config.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.37 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/decl.h b/include/decl.h index f9d4a7b7c..4591226e4 100644 --- a/include/decl.h +++ b/include/decl.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 decl.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.50 $ */ +/* NetHack 3.5 decl.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.50 $ */ /* NetHack 3.5 decl.h $Date: 2011/12/29 20:06:27 $ $Revision: 1.44 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/extern.h b/include/extern.h index 39a42641c..cdeee5478 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 extern.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.390 $ */ +/* NetHack 3.5 extern.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.390 $ */ /* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/flag.h b/include/flag.h index de2b63e84..a34abe839 100644 --- a/include/flag.h +++ b/include/flag.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 flag.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.60 $ */ +/* NetHack 3.5 flag.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.60 $ */ /* NetHack 3.5 flag.h $Date: 2012/04/09 02:56:32 $ $Revision: 1.59 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/include/wceconf.h b/include/wceconf.h index 52ad4d1f1..d2d11d404 100644 --- a/include/wceconf.h +++ b/include/wceconf.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 wceconf.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.12 $ */ +/* NetHack 3.5 wceconf.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */ /* NetHack 3.5 wceconf.h $Date: 2009/10/22 02:59:14 $ $Revision: 1.12 $ */ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/botl.c b/src/botl.c index 76d16a8ff..6006df8ce 100644 --- a/src/botl.c +++ b/src/botl.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 botl.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.38 $ */ +/* NetHack 3.5 botl.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.38 $ */ /* NetHack 3.5 botl.c $Date: 2012/01/10 17:47:19 $ $Revision: 1.36 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/files.c b/src/files.c index 7ba180547..71fd0c217 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 files.c $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.127 $ */ +/* NetHack 3.5 files.c $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.127 $ */ /* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/options.c b/src/options.c index 1c63c5ed5..54ad99efc 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 options.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.158 $ */ +/* NetHack 3.5 options.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.158 $ */ /* NetHack 3.5 options.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.153 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/pickup.c b/src/pickup.c index fea45dce3..d044cf46f 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 pickup.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.126 $ */ +/* NetHack 3.5 pickup.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.126 $ */ /* NetHack 3.5 pickup.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.123 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/save.c b/src/save.c index d7828655a..b220f945d 100644 --- a/src/save.c +++ b/src/save.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 save.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.59 $ */ +/* NetHack 3.5 save.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.59 $ */ /* NetHack 3.5 save.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.53 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/sys/wince/mhstatus.c b/sys/wince/mhstatus.c index 397f2dcb8..a9a6b2855 100644 --- a/sys/wince/mhstatus.c +++ b/sys/wince/mhstatus.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mhstatus.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.8 $ */ +/* NetHack 3.5 mhstatus.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */ /* NetHack 3.5 mhstatus.c $Date: 2009/05/06 10:52:28 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)mhstatus.c 3.5 2005/01/23 */ /* Copyright (C) 2001 by Alex Kompel */ diff --git a/util/makedefs.c b/util/makedefs.c index b8a40199f..f4ca9febb 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 makedefs.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.63 $ */ +/* NetHack 3.5 makedefs.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.63 $ */ /* NetHack 3.5 makedefs.c $Date: 2012/01/15 09:27:03 $ $Revision: 1.50 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) M. Stephenson, 1990, 1991. */ diff --git a/win/X11/winstat.c b/win/X11/winstat.c index ae2a3ce83..3267e26be 100644 --- a/win/X11/winstat.c +++ b/win/X11/winstat.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 winstat.c $NHDT-Date: 1425083083 2015/02/28 00:24:43 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.5 $ */ +/* NetHack 3.5 winstat.c $NHDT-Date: 1425083083 2015/02/28 00:24:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.5 $ */ /* NetHack 3.5 winstat.c $Date: 2009/05/06 10:55:59 $ $Revision: 1.4 $ */ /* SCCS Id: @(#)winstat.c 3.5 1996/04/05 */ /* Copyright (c) Dean Luick, 1992 */ diff --git a/win/gnome/gnstatus.c b/win/gnome/gnstatus.c index 5109f5bb7..2f1cea075 100644 --- a/win/gnome/gnstatus.c +++ b/win/gnome/gnstatus.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 gnstatus.c $NHDT-Date: 1425083083 2015/02/28 00:24:43 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.6 $ */ +/* NetHack 3.5 gnstatus.c $NHDT-Date: 1425083083 2015/02/28 00:24:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.6 $ */ /* NetHack 3.5 gnstatus.c $Date: 2009/05/06 10:57:54 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)gnstatus.c 3.5 2000/07/16 */ /* Copyright (C) 1998 by Erik Andersen */ diff --git a/win/share/tilemap.c b/win/share/tilemap.c index 06c966113..bb8273f47 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 tilemap.c $NHDT-Date: 1425082379 2015/02/28 00:12:59 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.12 $ */ +/* NetHack 3.5 tilemap.c $NHDT-Date: 1425082379 2015/02/28 00:12:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */ /* NetHack 3.5 tilemap.c $Date: 2009/05/06 10:59:02 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)tilemap.c 3.5 2000/06/04 */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/win/tty/topl.c b/win/tty/topl.c index db307b73a..cc4df15d5 100644 --- a/win/tty/topl.c +++ b/win/tty/topl.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 topl.c $NHDT-Date: 1425081315 2015/02/27 23:55:15 $ $NHDT-Branch: (no branch, rebasing scshunt-unconditionals) $:$NHDT-Revision: 1.24 $ */ +/* NetHack 3.5 topl.c $NHDT-Date: 1425081315 2015/02/27 23:55:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ From 2b1820a67bb083b6a425d1eb267b09c5b6fc2489 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Mon, 23 Feb 2015 14:59:24 -0500 Subject: [PATCH 150/354] Factor out a new `is_moat` function. The fact that Juiblex's swamp is MOAT but not moat is weird and should probably be looked at at some point. --- include/extern.h | 1 + src/dbridge.c | 23 ++++++++++++++++++++--- src/dig.c | 19 +++++++++---------- src/zap.c | 7 ++++--- 4 files changed, 34 insertions(+), 16 deletions(-) diff --git a/include/extern.h b/include/extern.h index cdeee5478..0f7fb0d3f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -219,6 +219,7 @@ E boolean FDECL(is_pool, (int,int)); E boolean FDECL(is_lava, (int,int)); E boolean FDECL(is_pool_or_lava, (int,int)); E boolean FDECL(is_ice, (int,int)); +E boolean FDECL(is_moat, (int,int)); E int FDECL(is_drawbridge_wall, (int,int)); E boolean FDECL(is_db_wall, (int,int)); E boolean FDECL(find_drawbridge, (int *,int*)); diff --git a/src/dbridge.c b/src/dbridge.c index 316b2707f..a82805377 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -42,9 +42,11 @@ int x,y; if (!isok(x,y)) return FALSE; ltyp = levl[x][y].typ; - if (ltyp == POOL || ltyp == MOAT || ltyp == WATER) return TRUE; - if (ltyp == DRAWBRIDGE_UP && - (levl[x][y].drawbridgemask & DB_UNDER) == DB_MOAT) return TRUE; + /* The ltyp == MOAT is not redundant with is_moat, because the + * Juiblex level does not have moats, although it has MOATs. There + * is probably a better way to express this. */ + if (ltyp == POOL || ltyp == MOAT || ltyp == WATER || is_moat(x, y)) + return TRUE; return FALSE; } @@ -86,6 +88,21 @@ int x,y; return FALSE; } +boolean +is_moat(x,y) +int x, y; +{ + schar ltyp; + + if (!isok(x, y)) return FALSE; + ltyp = levl[x][y].typ; + if (!Is_juiblex_level(&u.uz) && + (ltyp == MOAT || (ltyp == DRAWBRIDGE_UP && + (levl[x][y].drawbridgemask & DB_UNDER) == DB_MOAT))) + return TRUE; + return FALSE; +} + /* * We want to know whether a wall (or a door) is the portcullis (passageway) * of an eventual drawbridge. diff --git a/src/dig.c b/src/dig.c index 00a60aaba..39791dde0 100644 --- a/src/dig.c +++ b/src/dig.c @@ -486,16 +486,15 @@ boolean fill_if_any; /* force filling if it exists at all */ for (x1 = lo_x; x1 <= hi_x; x1++) for (y1 = lo_y; y1 <= hi_y; y1++) - if (levl[x1][y1].typ == POOL) - pool_cnt++; - else if (levl[x1][y1].typ == MOAT || - (levl[x1][y1].typ == DRAWBRIDGE_UP && - (levl[x1][y1].drawbridgemask & DB_UNDER) == DB_MOAT)) - moat_cnt++; - else if (levl[x1][y1].typ == LAVAPOOL || - (levl[x1][y1].typ == DRAWBRIDGE_UP && - (levl[x1][y1].drawbridgemask & DB_UNDER) == DB_LAVA)) - lava_cnt++; + if (is_moat(x1, y1)) + moat_cnt++; + else if (is_pool(x1, y1)) + /* This must come after is_moat since moats are pools + * but not vice-versa. */ + pool_cnt++; + else if (is_lava(x1, y1)) + lava_cnt++; + if (!fill_if_any) pool_cnt /= 3; /* not as much liquid as the others */ if ((lava_cnt > moat_cnt + pool_cnt && rn2(lava_cnt + 1)) || diff --git a/src/zap.c b/src/zap.c index dfdf95d4c..03cbc6c52 100644 --- a/src/zap.c +++ b/src/zap.c @@ -4017,7 +4017,7 @@ short exploding_wand_typ; case ZT_COLD: if (is_pool(x,y) || is_lava(x,y)) { boolean lava = is_lava(x,y); - const char *moat = waterbody_name(x, y); + boolean moat = is_moat(x,y); if (lev->typ == WATER) { /* For now, don't let WATER freeze. */ @@ -4041,8 +4041,9 @@ short exploding_wand_typ; if (see_it) { if(lava) Norep("The lava cools and solidifies."); - else if(strcmp(moat, "moat") == 0) - Norep("The %s is bridged with ice!", moat); + else if(moat) + Norep("The %s is bridged with ice!", + waterbody_name(x,y)); else Norep("The water freezes."); newsym(x,y); From 48b048f9212e7ded4e341d655049766eb1ed41a3 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Mon, 23 Feb 2015 15:08:30 -0500 Subject: [PATCH 151/354] Remove the `victim` argument to `rust_dmg()`. The argument can be calculated from `otmp`. --- include/extern.h | 2 +- src/dokick.c | 2 +- src/mhitu.c | 14 +++++++------- src/sit.c | 4 ++-- src/trap.c | 33 +++++++++++++++++---------------- src/uhitm.c | 22 +++++++++++----------- 6 files changed, 39 insertions(+), 38 deletions(-) diff --git a/include/extern.h b/include/extern.h index 0f7fb0d3f..120f7d506 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2203,7 +2203,7 @@ E coord *FDECL(gettrack, (int,int)); /* ### trap.c ### */ E boolean FDECL(burnarmor,(struct monst *)); -E boolean FDECL(rust_dmg, (struct obj *,const char *,int,BOOLEAN_P,struct monst *)); +E boolean FDECL(rust_dmg, (struct obj *,const char *,int,BOOLEAN_P)); E void FDECL(grease_protect, (struct obj *,const char *,struct monst *)); E struct trap *FDECL(maketrap, (int,int,int)); E void FDECL(fall_through, (BOOLEAN_P)); diff --git a/src/dokick.c b/src/dokick.c index b17379e07..06ff075e6 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -983,7 +983,7 @@ dokick() if(!rn2(3)) goto ouch; /* make metal boots rust */ if(uarmf && rn2(3)) - if (!rust_dmg(uarmf, "metal boots", 1, FALSE, &youmonst)) { + if (!rust_dmg(uarmf, "metal boots", 1, FALSE)) { Your("boots get wet."); /* could cause short-lived fumbling here */ } diff --git a/src/mhitu.c b/src/mhitu.c index 6f298ff63..416edaa5b 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -740,12 +740,12 @@ int attk; while (1) { switch(rn2(5)) { case 0: - if (!uarmh || !rust_dmg(uarmh, xname(uarmh), hurt, FALSE, &youmonst)) + if (!uarmh || !rust_dmg(uarmh, xname(uarmh), hurt, FALSE)) continue; break; case 1: if (uarmc) { - (void)rust_dmg(uarmc, xname(uarmc), hurt, TRUE, &youmonst); + (void)rust_dmg(uarmc, xname(uarmc), hurt, TRUE); break; } /* Note the difference between break and continue; @@ -754,20 +754,20 @@ int attk; * something else did. */ if (uarm) - (void)rust_dmg(uarm, xname(uarm), hurt, TRUE, &youmonst); + (void)rust_dmg(uarm, xname(uarm), hurt, TRUE); else if (uarmu) - (void)rust_dmg(uarmu, xname(uarmu), hurt, TRUE, &youmonst); + (void)rust_dmg(uarmu, xname(uarmu), hurt, TRUE); break; case 2: - if (!uarms || !rust_dmg(uarms, xname(uarms), hurt, FALSE, &youmonst)) + if (!uarms || !rust_dmg(uarms, xname(uarms), hurt, FALSE)) continue; break; case 3: - if (!uarmg || !rust_dmg(uarmg, xname(uarmg), hurt, FALSE, &youmonst)) + if (!uarmg || !rust_dmg(uarmg, xname(uarmg), hurt, FALSE)) continue; break; case 4: - if (!uarmf || !rust_dmg(uarmf, xname(uarmf), hurt, FALSE, &youmonst)) + if (!uarmf || !rust_dmg(uarmf, xname(uarmf), hurt, FALSE)) continue; break; } diff --git a/src/sit.c b/src/sit.c index aa3a16605..e5e77aa42 100644 --- a/src/sit.c +++ b/src/sit.c @@ -113,9 +113,9 @@ dosit() in_water: You("sit in the water."); if (!rn2(10) && uarm) - (void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst); + (void) rust_dmg(uarm, "armor", 1, TRUE); if (!rn2(10) && uarmf && uarmf->otyp != WATER_WALKING_BOOTS) - (void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst); + (void) rust_dmg(uarm, "armor", 1, TRUE); } else if(IS_SINK(typ)) { You(sit_message, defsyms[S_sink].explanation); Your("%s gets wet.", humanoid(youmonst.data) ? "rump" : "underside"); diff --git a/src/trap.c b/src/trap.c index 636598789..d819724a5 100644 --- a/src/trap.c +++ b/src/trap.c @@ -55,7 +55,7 @@ struct monst *victim; int mat_idx; if (!victim) return 0; -#define burn_dmg(obj,descr) rust_dmg(obj, descr, 0, FALSE, victim) +#define burn_dmg(obj,descr) rust_dmg(obj, descr, 0, FALSE) while (1) { switch (rn2(5)) { case 0: @@ -107,20 +107,21 @@ struct monst *victim; * returned only for rustable items. */ boolean -rust_dmg(otmp, ostr, type, print, victim) +rust_dmg(otmp, ostr, type, print) register struct obj *otmp; register const char *ostr; int type; boolean print; -struct monst *victim; { static NEARDATA const char * const action[] = { "smoulder", "rust", "rot", "corrode" }; static NEARDATA const char * const msg[] = { "burnt", "rusted", "rotten", "corroded" }; boolean vulnerable = FALSE; boolean grprot = FALSE; boolean is_primary = TRUE; - boolean vismon = (victim != &youmonst) && canseemon(victim); int erosion; + struct monst *victim = + carried(otmp) ? &youmonst : mcarried(otmp) ? otmp->ocarry : NULL; + boolean vismon = (victim != &youmonst) && canseemon(victim); if (!otmp) return(FALSE); switch(type) { @@ -920,17 +921,17 @@ unsigned trflags; pline("%s you on the %s!", A_gush_of_water_hits, body_part(HEAD)); (void) rust_dmg(uarmh, helm_simple_name(uarmh), - 1, TRUE, &youmonst); + 1, TRUE); break; case 1: pline("%s your left %s!", A_gush_of_water_hits, body_part(ARM)); - if (rust_dmg(uarms, "shield", 1, TRUE, &youmonst)) + if (rust_dmg(uarms, "shield", 1, TRUE)) break; if (u.twoweap || (uwep && bimanual(uwep))) (void) erode_obj(u.twoweap ? uswapwep : uwep, 1, TRUE, FALSE); -glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); +glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE); /* Not "metal gauntlets" since it gets called * even if it's leather for the message */ @@ -948,11 +949,11 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); (void) snuff_lit(otmp); if (uarmc) (void) rust_dmg(uarmc, cloak_simple_name(uarmc), - 1, TRUE, &youmonst); + 1, TRUE); else if (uarm) - (void) rust_dmg(uarm, "armor", 1, TRUE, &youmonst); + (void) rust_dmg(uarm, "armor", 1, TRUE); else if (uarmu) - (void) rust_dmg(uarmu, "shirt", 1, TRUE, &youmonst); + (void) rust_dmg(uarmu, "shirt", 1, TRUE); } update_inventory(); break; @@ -2051,20 +2052,20 @@ register struct monst *mtmp; mon_nam(mtmp), mbodypart(mtmp, HEAD)); target = which_armor(mtmp, W_ARMH); (void) rust_dmg(target, helm_simple_name(target), - 1, TRUE, mtmp); + 1, TRUE); break; case 1: if (in_sight) pline("%s %s's left %s!", A_gush_of_water_hits, mon_nam(mtmp), mbodypart(mtmp, ARM)); target = which_armor(mtmp, W_ARMS); - if (rust_dmg(target, "shield", 1, TRUE, mtmp)) + if (rust_dmg(target, "shield", 1, TRUE)) break; target = MON_WEP(mtmp); if (target && bimanual(target)) (void) erode_obj(target, 1, TRUE, FALSE); glovecheck: target = which_armor(mtmp, W_ARMG); - (void) rust_dmg(target, "gauntlets", 1, TRUE, mtmp); + (void) rust_dmg(target, "gauntlets", 1, TRUE); break; case 2: if (in_sight) @@ -2083,11 +2084,11 @@ glovecheck: target = which_armor(mtmp, W_ARMG); if ((target = which_armor(mtmp, W_ARMC)) != 0) (void) rust_dmg(target, cloak_simple_name(target), - 1, TRUE, mtmp); + 1, TRUE); else if ((target = which_armor(mtmp, W_ARM)) != 0) - (void) rust_dmg(target, "armor", 1, TRUE, mtmp); + (void) rust_dmg(target, "armor", 1, TRUE); else if ((target = which_armor(mtmp, W_ARMU)) != 0) - (void) rust_dmg(target, "shirt", 1, TRUE, mtmp); + (void) rust_dmg(target, "shirt", 1, TRUE); } if (mptr == &mons[PM_IRON_GOLEM]) { diff --git a/src/uhitm.c b/src/uhitm.c index bbb3a7fb4..1ccb8a2cb 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -56,34 +56,34 @@ int attk; switch(rn2(5)) { case 0: target = which_armor(mdef, W_ARMH); - if (!target || !rust_dmg(target, xname(target), hurt, FALSE, mdef)) + if (!target || !rust_dmg(target, xname(target), hurt, FALSE)) continue; break; case 1: target = which_armor(mdef, W_ARMC); if (target) { - (void)rust_dmg(target, xname(target), hurt, TRUE, mdef); + (void)rust_dmg(target, xname(target), hurt, TRUE); break; } if ((target = which_armor(mdef, W_ARM)) != (struct obj *)0) { - (void)rust_dmg(target, xname(target), hurt, TRUE, mdef); + (void)rust_dmg(target, xname(target), hurt, TRUE); } else if ((target = which_armor(mdef, W_ARMU)) != (struct obj *)0) { - (void)rust_dmg(target, xname(target), hurt, TRUE, mdef); + (void)rust_dmg(target, xname(target), hurt, TRUE); } break; case 2: target = which_armor(mdef, W_ARMS); - if (!target || !rust_dmg(target, xname(target), hurt, FALSE, mdef)) + if (!target || !rust_dmg(target, xname(target), hurt, FALSE)) continue; break; case 3: target = which_armor(mdef, W_ARMG); - if (!target || !rust_dmg(target, xname(target), hurt, FALSE, mdef)) + if (!target || !rust_dmg(target, xname(target), hurt, FALSE)) continue; break; case 4: target = which_armor(mdef, W_ARMF); - if (!target || !rust_dmg(target, xname(target), hurt, FALSE, mdef)) + if (!target || !rust_dmg(target, xname(target), hurt, FALSE)) continue; break; } @@ -2231,7 +2231,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf && !rn2(6)) - (void)rust_dmg(uarmf, xname(uarmf), 0, TRUE, &youmonst); + (void)rust_dmg(uarmf, xname(uarmf), 0, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2251,7 +2251,7 @@ boolean wep_was_destroyed; if (mhit) { if (aatyp == AT_KICK) { if (uarmf && !rn2(6)) - (void)rust_dmg(uarmf, xname(uarmf), 3, TRUE, &youmonst); + (void)rust_dmg(uarmf, xname(uarmf), 3, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2284,7 +2284,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf) - (void)rust_dmg(uarmf, xname(uarmf), 1, TRUE, &youmonst); + (void)rust_dmg(uarmf, xname(uarmf), 1, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2294,7 +2294,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf) - (void)rust_dmg(uarmf, xname(uarmf), 3, TRUE, &youmonst); + (void)rust_dmg(uarmf, xname(uarmf), 3, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); From 5532600f1a6a2290de77d5a70145a71bb53306d9 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Mon, 2 Mar 2015 12:36:33 -0500 Subject: [PATCH 152/354] Cover a couple of corner cases with `rust_dmg()`. --- doc/fixes35.0 | 3 + include/extern.h | 2 +- include/obj.h | 6 ++ src/trap.c | 139 +++++++++++++++++++++++++++++------------------ 4 files changed, 96 insertions(+), 54 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 3cc0e61dd..4fd81cff5 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -858,6 +858,9 @@ fix "object_is_local" panic when saving bones after hero is killed by explosion if lava burns up the player's water walking boots, the player falls in the messages for lava burning items up are always printed fix used-up magic trap trying to hit steed. +messages are now printed when objects on the ground are eroded +object erosion now always identifies rust/rot/fire/corrodeproof objects +grease protects from all types of erosion Platform- and/or Interface-Specific Fixes diff --git a/include/extern.h b/include/extern.h index 120f7d506..87427dd3a 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2204,7 +2204,7 @@ E coord *FDECL(gettrack, (int,int)); E boolean FDECL(burnarmor,(struct monst *)); E boolean FDECL(rust_dmg, (struct obj *,const char *,int,BOOLEAN_P)); -E void FDECL(grease_protect, (struct obj *,const char *,struct monst *)); +E boolean FDECL(grease_protect, (struct obj *,const char *,struct monst *)); E struct trap *FDECL(maketrap, (int,int,int)); E void FDECL(fall_through, (BOOLEAN_P)); E struct monst *FDECL(animate_statue, (struct obj *,XCHAR_P,XCHAR_P,int,int *)); diff --git a/include/obj.h b/include/obj.h index dc522b338..12b1fce35 100644 --- a/include/obj.h +++ b/include/obj.h @@ -319,6 +319,12 @@ struct obj { #define CONTAINED_TOO 0x1 #define BURIED_TOO 0x2 +/* object erosion types */ +#define ERODE_BURN 0 +#define ERODE_RUST 1 +#define ERODE_ROT 2 +#define ERODE_CORRODE 3 + /* * Notes for adding new oextra structures: * diff --git a/src/trap.c b/src/trap.c index d819724a5..1220105f5 100644 --- a/src/trap.c +++ b/src/trap.c @@ -101,10 +101,9 @@ struct monst *victim; #undef burn_dmg } -/* Generic rust-armor function. Returns TRUE if a message was printed; - * "print", if set, means to print a message (and thus to return TRUE) even - * if the item could not be rusted; otherwise a message is printed and TRUE is - * returned only for rustable items. +/* Generic erode-item function. Returns TRUE if any change in state + * occurred. "print", if set, means to print a message even if no change + * occurs. */ boolean rust_dmg(otmp, ostr, type, print) @@ -119,69 +118,95 @@ boolean print; boolean grprot = FALSE; boolean is_primary = TRUE; int erosion; - struct monst *victim = - carried(otmp) ? &youmonst : mcarried(otmp) ? otmp->ocarry : NULL; - boolean vismon = (victim != &youmonst) && canseemon(victim); + struct monst *victim; + boolean vismon; + boolean visobj; if (!otmp) return(FALSE); + + victim = carried(otmp) ? &youmonst : mcarried(otmp) ? + otmp->ocarry : NULL; + vismon = victim && (victim != &youmonst) && canseemon(victim); + /* Is bhitpos correct here? Ugh. */ + visobj = !victim && cansee(bhitpos.x, bhitpos.y); + switch(type) { - case 0: vulnerable = is_flammable(otmp); - break; - case 1: vulnerable = is_rustprone(otmp); - grprot = TRUE; - break; - case 2: vulnerable = is_rottable(otmp); - is_primary = FALSE; - break; - case 3: vulnerable = is_corrodeable(otmp); - grprot = TRUE; - is_primary = FALSE; - break; + case ERODE_BURN: + vulnerable = is_flammable(otmp); + break; + case ERODE_RUST: + vulnerable = is_rustprone(otmp); + grprot = TRUE; + break; + case ERODE_ROT: + vulnerable = is_rottable(otmp); + is_primary = FALSE; + break; + case ERODE_CORRODE: + vulnerable = is_corrodeable(otmp); + grprot = TRUE; + is_primary = FALSE; + break; + default: + impossible("Invalid erosion type in rust_dmg"); + return FALSE; } erosion = is_primary ? otmp->oeroded : otmp->oeroded2; - if (!print && (!vulnerable || otmp->oerodeproof || erosion == MAX_ERODE)) - return FALSE; + if (!ostr) + ostr = cxname(otmp); - if (!vulnerable) { - if (flags.verbose) { + if (grprot && otmp->greased) { + return grease_protect(otmp, ostr, victim); + } else if (!vulnerable || (otmp->oerodeproof && otmp->rknown)) { + if (print && flags.verbose) { if (victim == &youmonst) Your("%s %s not affected.", ostr, vtense(ostr, "are")); else if (vismon) pline("%s's %s %s not affected.", Monnam(victim), ostr, vtense(ostr, "are")); } - } else if (erosion < MAX_ERODE) { - if (grprot && otmp->greased) { - grease_protect(otmp,ostr,victim); - } else if (otmp->oerodeproof || (otmp->blessed && !rnl(4))) { - if (flags.verbose) { - if (victim == &youmonst) - pline("Somehow, your %s %s not affected.", - ostr, vtense(ostr, "are")); - else if (vismon) - pline("Somehow, %s's %s %s not affected.", - mon_nam(victim), ostr, vtense(ostr, "are")); - } - } else { + return FALSE; + } else if (otmp->oerodeproof || otmp->blessed && !rnl(4)) { + if (flags.verbose && (print || otmp->oerodeproof)) { if (victim == &youmonst) - Your("%s %s%s!", ostr, - vtense(ostr, action[type]), - erosion+1 == MAX_ERODE ? " completely" : - erosion ? " further" : ""); + pline("Somehow, your %s %s not affected.", + ostr, vtense(ostr, "are")); else if (vismon) - pline("%s's %s %s%s!", Monnam(victim), ostr, - vtense(ostr, action[type]), - erosion+1 == MAX_ERODE ? " completely" : - erosion ? " further" : ""); - if (is_primary) - otmp->oeroded++; - else - otmp->oeroded2++; - update_inventory(); - } + pline("Somehow, %s's %s %s not affected.", + mon_nam(victim), ostr, vtense(ostr, "are")); + else if (visobj) + pline("Somehow, the %s %s not affected." ostr, + vtense(ostr, "are")); + } + /* We assume here that if the object is protected because it + * is blessed, it still shows some minor signs of wear, and + * the hero can distinguish this from an object that is + * actually proof against damage. */ + if (otmp->oerodeproof) + otmp->rknown = TRUE; + return FALSE; + } else if (erosion < MAX_ERODE) { + const char *adverb = (erosion + 1 == MAX_ERODE) ? + " complete" : erosion ? " further" : ""; + + if (victim == &youmonst) + Your("%s %s%s!", ostr, vtense(ostr, action[type]), adverb); + else if (vismon) + pline("%s's %s %s%s!", Monnam(victim), ostr, + vtense(ostr, action[type]), adverb); + else if (visobj) + pline("The %s %s%s!", ostr, vtense(ostr, action[type]), adverb); + + if (is_primary) + otmp->oeroded++; + else + otmp->oeroded2++; + + update_inventory(); + return TRUE; } else { - if (flags.verbose) { + if (flags.verbose && print) { if (victim == &youmonst) Your("%s %s completely %s.", ostr, vtense(ostr, Blind ? "feel" : "look"), @@ -190,12 +215,18 @@ boolean print; pline("%s's %s %s completely %s.", Monnam(victim), ostr, vtense(ostr, "look"), msg[type]); + else if (visobj) + pline("The %s %s completely %s.", ostr, + vtense(ostr, "look"), msg[type]); } + return FALSE; } - return(TRUE); } -void +/* Protect an item from erosion with grease. Returns TRUE if the grease + * wears off. + */ +boolean grease_protect(otmp,ostr,victim) register struct obj *otmp; register const char *ostr; @@ -219,7 +250,9 @@ struct monst *victim; pline_The("grease dissolves."); update_inventory(); } + return TRUE; } + return FALSE; } struct trap * From 4e05b9a1ec9e4c6d67bf3e5866ebcb2891009527 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Mon, 23 Feb 2015 17:21:11 -0500 Subject: [PATCH 153/354] A lot more cleanup to rust and water. --- doc/fixes35.0 | 1 + include/extern.h | 8 +- src/do.c | 3 +- src/do_wear.c | 14 --- src/dokick.c | 2 +- src/fountain.c | 2 +- src/mhitm.c | 10 +- src/mhitu.c | 70 +----------- src/mon.c | 6 +- src/objnam.c | 2 +- src/sit.c | 4 +- src/trap.c | 279 ++++++++++++++++++++++++----------------------- src/uhitm.c | 43 +++----- src/worn.c | 25 ++++- src/zap.c | 4 +- 15 files changed, 206 insertions(+), 267 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 4fd81cff5..48da8da36 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -861,6 +861,7 @@ fix used-up magic trap trying to hit steed. messages are now printed when objects on the ground are eroded object erosion now always identifies rust/rot/fire/corrodeproof objects grease protects from all types of erosion +all sources of erosion now affect objects the same way Platform- and/or Interface-Specific Fixes diff --git a/include/extern.h b/include/extern.h index 87427dd3a..87d3adee7 100644 --- a/include/extern.h +++ b/include/extern.h @@ -434,7 +434,6 @@ E int NDECL(doputon); E void NDECL(find_ac); E void NDECL(glibr); E struct obj *FDECL(some_armor,(struct monst *)); -E void FDECL(erode_armor, (struct monst *,BOOLEAN_P)); E struct obj *FDECL(stuck_ring, (struct obj *,int)); E struct obj *NDECL(unchanger); E void NDECL(reset_remarm); @@ -2203,7 +2202,7 @@ E coord *FDECL(gettrack, (int,int)); /* ### trap.c ### */ E boolean FDECL(burnarmor,(struct monst *)); -E boolean FDECL(rust_dmg, (struct obj *,const char *,int,BOOLEAN_P)); +E boolean FDECL(rust_dmg, (struct obj *,const char *,int,BOOLEAN_P,BOOLEAN_P)); E boolean FDECL(grease_protect, (struct obj *,const char *,struct monst *)); E struct trap *FDECL(maketrap, (int,int,int)); E void FDECL(fall_through, (BOOLEAN_P)); @@ -2223,7 +2222,8 @@ E void FDECL(fill_pit, (int,int)); E int FDECL(float_down, (long, long)); E void NDECL(climb_pit); E int FDECL(fire_damage, (struct obj *,BOOLEAN_P,BOOLEAN_P,XCHAR_P,XCHAR_P)); -E void FDECL(water_damage, (struct obj **,BOOLEAN_P,BOOLEAN_P)); +E int FDECL(water_damage, (struct obj *,const char*,BOOLEAN_P)); +E void FDECL(water_damage_chain, (struct obj *,BOOLEAN_P)); E boolean NDECL(drown); E void FDECL(drain_en, (int)); E int NDECL(dountrap); @@ -2253,7 +2253,7 @@ E void NDECL(u_init); /* ### uhitm.c ### */ -E void FDECL(hurtmarmor,(struct monst *,int)); +E void FDECL(erode_armor,(struct monst *,int)); E boolean FDECL(attack_checks, (struct monst *,struct obj *)); E void FDECL(check_caitiff, (struct monst *)); E int FDECL(find_roll_to_hit, (struct monst *,UCHAR_P,struct obj *,int *,int *)); diff --git a/src/do.c b/src/do.c index 981981293..319317bf5 100644 --- a/src/do.c +++ b/src/do.c @@ -201,8 +201,7 @@ const char *verb; map_background(x, y, 0); newsym(x, y); } - water_damage(&obj, FALSE, FALSE); - if (!obj) return TRUE; + return water_damage(obj, NULL, FALSE) == 3; } else if (u.ux == x && u.uy == y && (t = t_at(x,y)) != 0 && uteetering_at_seen_pit(t)) { if (Blind && !Deaf) diff --git a/src/do_wear.c b/src/do_wear.c index 414f5a522..9925ceaf0 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -1937,20 +1937,6 @@ struct monst *victim; return(otmph); } -/* erode some arbitrary armor worn by the victim */ -void -erode_armor(victim, acid_dmg) -struct monst *victim; -boolean acid_dmg; -{ - struct obj *otmph = some_armor(victim); - - if (otmph && (otmph != uarmf)) { - (void) erode_obj(otmph, acid_dmg ? 3 : 1, FALSE, FALSE); - if (carried(otmph)) update_inventory(); - } -} - /* used for praying to check and fix levitation trouble */ struct obj * stuck_ring(ring, otyp) diff --git a/src/dokick.c b/src/dokick.c index 06ff075e6..c399f6bbc 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -983,7 +983,7 @@ dokick() if(!rn2(3)) goto ouch; /* make metal boots rust */ if(uarmf && rn2(3)) - if (!rust_dmg(uarmf, "metal boots", 1, FALSE)) { + if (!water_damage(uarmf, "metal boots", TRUE)) { Your("boots get wet."); /* could cause short-lived fumbling here */ } diff --git a/src/fountain.c b/src/fountain.c index f167c09d4..cc8aeb7bf 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -136,7 +136,7 @@ genericptr_t poolcnt; levl[x][y].typ = POOL; /* No kelp! */ del_engr_at(x, y); - water_damage(&level.objects[x][y], FALSE, TRUE); + water_damage_chain(level.objects[x][y], TRUE); if ((mtmp = m_at(x, y)) != 0) (void) minliquid(mtmp); diff --git a/src/mhitm.c b/src/mhitm.c index 47a14915f..ae66279e7 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -883,7 +883,7 @@ mdamagem(magr, mdef, mattk) pline("%s is covered in acid!", Monnam(mdef)); pline("It burns %s!", mon_nam(mdef)); } - if (!rn2(30)) erode_armor(mdef, TRUE); + if (!rn2(30)) erode_armor(mdef, ERODE_CORRODE); if (!rn2(6)) (void) erode_obj(MON_WEP(mdef), 3, TRUE, FALSE); break; case AD_RUST: @@ -897,13 +897,13 @@ mdamagem(magr, mdef, mattk) return (MM_DEF_DIED | (grow_up(magr,mdef) ? 0 : MM_AGR_DIED)); } - hurtmarmor(mdef, AD_RUST); + erode_armor(mdef, ERODE_RUST); mdef->mstrategy &= ~STRAT_WAITFORU; tmp = 0; break; case AD_CORR: if (magr->mcan) break; - hurtmarmor(mdef, AD_CORR); + erode_armor(mdef, ERODE_CORRODE); mdef->mstrategy &= ~STRAT_WAITFORU; tmp = 0; break; @@ -919,7 +919,7 @@ mdamagem(magr, mdef, mattk) return (MM_DEF_DIED | (grow_up(magr,mdef) ? 0 : MM_AGR_DIED)); } - hurtmarmor(mdef, AD_DCAY); + erode_armor(mdef, ERODE_CORRODE); mdef->mstrategy &= ~STRAT_WAITFORU; tmp = 0; break; @@ -1361,7 +1361,7 @@ int mdead; tmp = 0; } } else tmp = 0; - if (!rn2(30)) erode_armor(magr, TRUE); + if (!rn2(30)) erode_armor(magr, ERODE_CORRODE); if (!rn2(6)) (void)erode_obj(MON_WEP(magr), 3, TRUE, FALSE); goto assess_dmg; case AD_ENCH: /* KMH -- remove enchantment (disenchanter) */ diff --git a/src/mhitu.c b/src/mhitu.c index 416edaa5b..cc9b6f1be 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -22,7 +22,6 @@ STATIC_DCL void FDECL(missmu,(struct monst *,BOOLEAN_P,struct attack *)); STATIC_DCL void FDECL(mswings,(struct monst *,struct obj *)); STATIC_DCL void FDECL(wildmiss, (struct monst *,struct attack *)); -STATIC_DCL void FDECL(hurtarmor,(int)); STATIC_DCL void FDECL(hitmsg,(struct monst *,struct attack *)); /* See comment in mhitm.c. If we use this a lot it probably should be */ @@ -714,67 +713,6 @@ mattacku(mtmp) return(0); } -/* - * helper function for some compilers that have trouble with hitmu - */ - -STATIC_OVL void -hurtarmor(attk) -int attk; -{ - int hurt; - - switch(attk) { - /* 0 is burning, which we should never be called with */ - case AD_RUST: hurt = 1; break; - case AD_CORR: hurt = 3; break; - default: hurt = 2; break; - } - - /* What the following code does: it keeps looping until it - * finds a target for the rust monster. - * Head, feet, etc... not covered by metal, or covered by - * rusty metal, are not targets. However, your body always - * is, no matter what covers it. - */ - while (1) { - switch(rn2(5)) { - case 0: - if (!uarmh || !rust_dmg(uarmh, xname(uarmh), hurt, FALSE)) - continue; - break; - case 1: - if (uarmc) { - (void)rust_dmg(uarmc, xname(uarmc), hurt, TRUE); - break; - } - /* Note the difference between break and continue; - * break means it was hit and didn't rust; continue - * means it wasn't a target and though it didn't rust - * something else did. - */ - if (uarm) - (void)rust_dmg(uarm, xname(uarm), hurt, TRUE); - else if (uarmu) - (void)rust_dmg(uarmu, xname(uarmu), hurt, TRUE); - break; - case 2: - if (!uarms || !rust_dmg(uarms, xname(uarms), hurt, FALSE)) - continue; - break; - case 3: - if (!uarmg || !rust_dmg(uarmg, xname(uarmg), hurt, FALSE)) - continue; - break; - case 4: - if (!uarmf || !rust_dmg(uarmf, xname(uarmf), hurt, FALSE)) - continue; - break; - } - break; /* Out of while loop */ - } -} - STATIC_OVL boolean diseasemu(mdat) struct permonst *mdat; @@ -1336,12 +1274,12 @@ dopois: rehumanize(); break; } - hurtarmor(AD_RUST); + erode_armor(&youmonst, ERODE_RUST); break; case AD_CORR: hitmsg(mtmp, mattk); if (mtmp->mcan) break; - hurtarmor(AD_CORR); + erode_armor(&youmonst, ERODE_CORRODE); break; case AD_DCAY: hitmsg(mtmp, mattk); @@ -1353,7 +1291,7 @@ dopois: rehumanize(); break; } - hurtarmor(AD_DCAY); + erode_armor(&youmonst, ERODE_ROT); break; case AD_HEAL: /* a cancelled nurse is just an ordinary monster, @@ -2503,7 +2441,7 @@ register struct attack *mattk; tmp = 0; } } else tmp = 0; - if (!rn2(30)) erode_armor(mtmp, TRUE); + if (!rn2(30)) erode_armor(mtmp, ERODE_CORRODE); if (!rn2(6)) (void)erode_obj(MON_WEP(mtmp), 3, TRUE, FALSE); goto assess_dmg; case AD_STON: /* cockatrice */ diff --git a/src/mon.c b/src/mon.c index f617dad4c..1c2009a0b 100644 --- a/src/mon.c +++ b/src/mon.c @@ -333,7 +333,7 @@ register struct monst *mtmp; if (mtmp->data == &mons[PM_GREMLIN] && (inpool || infountain) && rn2(3)) { if (split_mon(mtmp, (struct monst *)0)) dryup(mtmp->mx, mtmp->my, FALSE); - if (inpool) water_damage(&mtmp->minvent, FALSE, FALSE); + if (inpool) water_damage_chain(mtmp->minvent, FALSE); return (0); } else if (mtmp->data == &mons[PM_IRON_GOLEM] && inpool && !rn2(5)) { int dam = d(2,6); @@ -345,7 +345,7 @@ register struct monst *mtmp; mondead(mtmp); if (mtmp->mhp < 1) return (1); } - water_damage(&mtmp->minvent, FALSE, FALSE); + water_damage_chain(mtmp->minvent, FALSE); return (0); } @@ -398,7 +398,7 @@ register struct monst *mtmp; } mondead(mtmp); if (mtmp->mhp > 0) { - water_damage(&mtmp->minvent, FALSE, FALSE); + water_damage_chain(mtmp->minvent, FALSE); (void) rloc(mtmp, FALSE); return 0; } diff --git a/src/objnam.c b/src/objnam.c index 84c3599f4..fe692b226 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -2893,7 +2893,7 @@ wiztrap: del_engr_at(x, y); pline("A %s.", (lev->typ == POOL) ? "pool" : "moat"); /* Must manually make kelp! */ - water_damage(&level.objects[x][y], FALSE, TRUE); + water_damage_chain(level.objects[x][y], TRUE); newsym(x, y); return &zeroobj; } diff --git a/src/sit.c b/src/sit.c index e5e77aa42..19cd63471 100644 --- a/src/sit.c +++ b/src/sit.c @@ -113,9 +113,9 @@ dosit() in_water: You("sit in the water."); if (!rn2(10) && uarm) - (void) rust_dmg(uarm, "armor", 1, TRUE); + (void) water_damage(uarm, "armor", TRUE); if (!rn2(10) && uarmf && uarmf->otyp != WATER_WALKING_BOOTS) - (void) rust_dmg(uarm, "armor", 1, TRUE); + (void) water_damage(uarm, "armor", TRUE); } else if(IS_SINK(typ)) { You(sit_message, defsyms[S_sink].explanation); Your("%s gets wet.", humanoid(youmonst.data) ? "rump" : "underside"); diff --git a/src/trap.c b/src/trap.c index 1220105f5..f6266791f 100644 --- a/src/trap.c +++ b/src/trap.c @@ -55,7 +55,7 @@ struct monst *victim; int mat_idx; if (!victim) return 0; -#define burn_dmg(obj,descr) rust_dmg(obj, descr, 0, FALSE) +#define burn_dmg(obj,descr) rust_dmg(obj, descr, ERODE_BURN, TRUE, FALSE) while (1) { switch (rn2(5)) { case 0: @@ -102,20 +102,21 @@ struct monst *victim; } /* Generic erode-item function. Returns TRUE if any change in state - * occurred. "print", if set, means to print a message even if no change - * occurs. + * occurred, or if grease protected the item. + * "check_grease", if FALSE, means that grease is not checked for + * "print", if set, means to print a message even if no change occurs. */ boolean -rust_dmg(otmp, ostr, type, print) +rust_dmg(otmp, ostr, type, check_grease, print) register struct obj *otmp; register const char *ostr; int type; +boolean check_grease; boolean print; { static NEARDATA const char * const action[] = { "smoulder", "rust", "rot", "corrode" }; static NEARDATA const char * const msg[] = { "burnt", "rusted", "rotten", "corroded" }; boolean vulnerable = FALSE; - boolean grprot = FALSE; boolean is_primary = TRUE; int erosion; struct monst *victim; @@ -133,18 +134,18 @@ boolean print; switch(type) { case ERODE_BURN: vulnerable = is_flammable(otmp); + check_grease = FALSE; break; case ERODE_RUST: vulnerable = is_rustprone(otmp); - grprot = TRUE; break; case ERODE_ROT: vulnerable = is_rottable(otmp); + check_grease = FALSE; is_primary = FALSE; break; case ERODE_CORRODE: vulnerable = is_corrodeable(otmp); - grprot = TRUE; is_primary = FALSE; break; default: @@ -156,8 +157,9 @@ boolean print; if (!ostr) ostr = cxname(otmp); - if (grprot && otmp->greased) { - return grease_protect(otmp, ostr, victim); + if (check_grease && otmp->greased) { + grease_protect(otmp, ostr, victim); + return TRUE; } else if (!vulnerable || (otmp->oerodeproof && otmp->rknown)) { if (print && flags.verbose) { if (victim == &youmonst) @@ -167,7 +169,7 @@ boolean print; vtense(ostr, "are")); } return FALSE; - } else if (otmp->oerodeproof || otmp->blessed && !rnl(4)) { + } else if (otmp->oerodeproof || (otmp->blessed && !rnl(4))) { if (flags.verbose && (print || otmp->oerodeproof)) { if (victim == &youmonst) pline("Somehow, your %s %s not affected.", @@ -176,7 +178,7 @@ boolean print; pline("Somehow, %s's %s %s not affected.", mon_nam(victim), ostr, vtense(ostr, "are")); else if (visobj) - pline("Somehow, the %s %s not affected." ostr, + pline("Somehow, the %s %s not affected.", ostr, vtense(ostr, "are")); } /* We assume here that if the object is protected because it @@ -188,7 +190,7 @@ boolean print; return FALSE; } else if (erosion < MAX_ERODE) { const char *adverb = (erosion + 1 == MAX_ERODE) ? - " complete" : erosion ? " further" : ""; + " completely" : erosion ? " further" : ""; if (victim == &youmonst) Your("%s %s%s!", ostr, vtense(ostr, action[type]), adverb); @@ -931,18 +933,6 @@ unsigned trflags; case RUST_TRAP: seetrap(trap); - if (u.umonnum == PM_IRON_GOLEM) { - int dam = u.mhmax; - - pline("%s you!", A_gush_of_water_hits); - You("are covered with rust!"); - losehp(Maybe_Half_Phys(dam), "rusting away", KILLED_BY); - break; - } else if (u.umonnum == PM_GREMLIN && rn2(3)) { - pline("%s you!", A_gush_of_water_hits); - (void)split_mon(&youmonst, (struct monst *)0); - break; - } /* Unlike monsters, traps cannot aim their rust attacks at * you, so instead of looping through and taking either the @@ -953,18 +943,18 @@ unsigned trflags; case 0: pline("%s you on the %s!", A_gush_of_water_hits, body_part(HEAD)); - (void) rust_dmg(uarmh, helm_simple_name(uarmh), - 1, TRUE); + (void) water_damage(uarmh, helm_simple_name(uarmh), + TRUE); break; case 1: pline("%s your left %s!", A_gush_of_water_hits, body_part(ARM)); - if (rust_dmg(uarms, "shield", 1, TRUE)) + if (water_damage(uarms, "shield", TRUE)) break; if (u.twoweap || (uwep && bimanual(uwep))) (void) erode_obj(u.twoweap ? uswapwep : uwep, 1, TRUE, FALSE); -glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE); +glovecheck: (void) water_damage(uarmg, "gauntlets", TRUE); /* Not "metal gauntlets" since it gets called * even if it's leather for the message */ @@ -981,14 +971,26 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE); (otmp != uswapwep || !u.twoweap)) (void) snuff_lit(otmp); if (uarmc) - (void) rust_dmg(uarmc, cloak_simple_name(uarmc), - 1, TRUE); + (void) water_damage(uarmc, cloak_simple_name(uarmc), + TRUE); else if (uarm) - (void) rust_dmg(uarm, "armor", 1, TRUE); + (void) water_damage(uarm, "armor", TRUE); else if (uarmu) - (void) rust_dmg(uarmu, "shirt", 1, TRUE); + (void) water_damage(uarmu, "shirt", TRUE); } update_inventory(); + + if (u.umonnum == PM_IRON_GOLEM) { + int dam = u.mhmax; + + pline("%s you!", A_gush_of_water_hits); + You("are covered with rust!"); + losehp(Maybe_Half_Phys(dam), "rusting away", KILLED_BY); + } else if (u.umonnum == PM_GREMLIN && rn2(3)) { + pline("%s you!", A_gush_of_water_hits); + (void)split_mon(&youmonst, (struct monst *)0); + } + break; case FIRE_TRAP: @@ -2084,21 +2086,21 @@ register struct monst *mtmp; pline("%s %s on the %s!", A_gush_of_water_hits, mon_nam(mtmp), mbodypart(mtmp, HEAD)); target = which_armor(mtmp, W_ARMH); - (void) rust_dmg(target, helm_simple_name(target), - 1, TRUE); + (void) water_damage(target, helm_simple_name(target), + TRUE); break; case 1: if (in_sight) pline("%s %s's left %s!", A_gush_of_water_hits, mon_nam(mtmp), mbodypart(mtmp, ARM)); target = which_armor(mtmp, W_ARMS); - if (rust_dmg(target, "shield", 1, TRUE)) + if (water_damage(target, "shield", TRUE)) break; target = MON_WEP(mtmp); if (target && bimanual(target)) (void) erode_obj(target, 1, TRUE, FALSE); glovecheck: target = which_armor(mtmp, W_ARMG); - (void) rust_dmg(target, "gauntlets", 1, TRUE); + (void) water_damage(target, "gauntlets", TRUE); break; case 2: if (in_sight) @@ -2115,13 +2117,13 @@ glovecheck: target = which_armor(mtmp, W_ARMG); (otmp->owornmask & (W_WEP|W_SWAPWEP)) == 0) (void) snuff_lit(otmp); if ((target = which_armor(mtmp, W_ARMC)) != 0) - (void) rust_dmg(target, - cloak_simple_name(target), - 1, TRUE); + (void) water_damage(target, + cloak_simple_name(target), + TRUE); else if ((target = which_armor(mtmp, W_ARM)) != 0) - (void) rust_dmg(target, "armor", 1, TRUE); + (void) water_damage(target, "armor", TRUE); else if ((target = which_armor(mtmp, W_ARMU)) != 0) - (void) rust_dmg(target, "shirt", 1, TRUE); + (void) water_damage(target, "shirt", TRUE); } if (mptr == &mons[PM_IRON_GOLEM]) { @@ -3067,107 +3069,112 @@ xchar x, y; return retval; } -void -water_damage(objp, force, here) -struct obj **objp; -boolean force, here; +/* returns: + * 0 if obj is unaffected + * 1 if obj is protected by grease + * 2 if obj is changed but survived + * 3 if obj is destroyed + */ +int +water_damage(obj, ostr, force) +struct obj *obj; +const char *ostr; +boolean force; { - register struct obj *obj = *objp, *otmp; boolean loose_obj = (obj && obj->where == OBJ_FREE), exploded = FALSE; - if (loose_obj && (obj->nobj || obj->nexthere)) { - /* [this should actually be a panic()] */ - impossible("water_damage: loose object has%s%s%s list%s?", - obj->nobj ? " nobj" : "", - (obj->nobj && obj->nexthere) ? " and" : "", - obj->nexthere ? " nexthere" : "", - (obj->nobj && obj->nexthere) ? "s" : ""); - } + (void) snuff_lit(obj); - /* Scrolls, spellbooks, potions, weapons and - pieces of armor may get affected by the water. - - [FIXME? The item transformations here lack shop price/billing - handling [costly_alteration()], which is okay as long as shops - don't contain any pools. However, that's probably not a valid - assumption; a broken fountain might spill new pools far enough - to put one inside a nearby shop, particularly if dug walls in - Minetown haven't been repaired yet. Note that water_damage() - might be getting called right now because we're in the midst - of creating such a pool, not just because one has already been - created and we've walked into it while carrying unpaid stuff.] - */ - for (; obj; obj = otmp) { - otmp = here ? obj->nexthere : obj->nobj; - - (void) snuff_lit(obj); - - if(obj->otyp == CAN_OF_GREASE && obj->spe > 0) { - continue; - } else if(obj->greased) { - if (force || !rn2(2)) obj->greased = 0; - } else if(Is_container(obj) && !Is_box(obj) && - (obj->otyp != OILSKIN_SACK || (obj->cursed && !rn2(3)))) { - water_damage(&obj->cobj, force, FALSE); - } else if (!force && (Luck + 5) > rn2(20)) { - /* chance per item of sustaining damage: - * max luck: 10% - * avg luck (Luck==0): 75% - * awful luck (Luck<-4): 100% - */ - continue; - } else if (obj->oclass == SCROLL_CLASS) { + if(obj->otyp == CAN_OF_GREASE && obj->spe > 0) { + return 0; + } else if(obj->greased) { + if (!rn2(2)) obj->greased = 0; + if (carried(obj)) update_inventory(); + return 1; + } else if(Is_container(obj) && !Is_box(obj) && + (obj->otyp != OILSKIN_SACK || (obj->cursed && !rn2(3)))) { + water_damage_chain(obj->cobj, FALSE); + return 0; + } else if (!force && (Luck + 5) > rn2(20)) { + /* chance per item of sustaining damage: + * max luck: 10% + * avg luck (Luck==0): 75% + * awful luck (Luck<-4): 100% + */ + return 0; + } else if (obj->oclass == SCROLL_CLASS) { #ifdef MAIL - if (obj->otyp == SCR_MAIL) continue; + if (obj->otyp == SCR_MAIL) return 0; #endif - obj->otyp = SCR_BLANK_PAPER; - obj->dknown = 0; - obj->spe = 0; - } else if (obj->oclass == SPBOOK_CLASS) { - if (obj->otyp == SPE_BOOK_OF_THE_DEAD) { - pline("Steam rises from %s.", the(xname(obj))); - continue; - } - obj->otyp = SPE_BLANK_PAPER; - obj->dknown = 0; - } else if (obj->oclass == POTION_CLASS) { - if (obj->otyp == POT_ACID) { - char *bufp, buf[BUFSZ]; - boolean one = (obj->quan == 1L); + obj->otyp = SCR_BLANK_PAPER; + obj->dknown = 0; + obj->spe = 0; + if (carried(obj)) + update_inventory(); + return 2; + } else if (obj->oclass == SPBOOK_CLASS) { + if (obj->otyp == SPE_BOOK_OF_THE_DEAD) { + pline("Steam rises from %s.", the(xname(obj))); + return 0; + } + obj->otyp = SPE_BLANK_PAPER; + obj->dknown = 0; + if (carried(obj)) + update_inventory(); + return 2; + } else if (obj->oclass == POTION_CLASS) { + if (obj->otyp == POT_ACID) { + char *bufp, buf[BUFSZ]; + boolean one = (obj->quan == 1L); + boolean update = carried(obj); - bufp = strcpy(buf, "potion"); - if (!one) bufp = makeplural(bufp); - /* [should we damage player/monster?] */ - pline("%s %s %s!", /* "A potion explodes!" */ - !exploded ? (one ? "A" : "Some") : - (one ? "Another" : "More"), - bufp, vtense(bufp, "explode")); - exploded = TRUE; - /* let caller know that obj has gone away - [when obj is part of a list, delobj()'s - obj_extract_self() takes care of this; - for loose_obj, obj should always equal - *objp and otmp should always be null] */ - if (loose_obj && obj == *objp) *objp = otmp; - delobj(obj); - continue; - } else if (obj->odiluted) { - obj->otyp = POT_WATER; - obj->dknown = 0; - obj->blessed = obj->cursed = 0; - obj->odiluted = 0; - } else if (obj->otyp != POT_WATER) - obj->odiluted++; - } else if (is_rustprone(obj) && obj->oeroded < MAX_ERODE && - !(obj->oerodeproof || (obj->blessed && !rnl(4)))) { - /* all metal stuff and armor except (body armor - protected by oilskin cloak) */ - if(obj->oclass != ARMOR_CLASS || obj != uarm || - !uarmc || uarmc->otyp != OILSKIN_CLOAK || - (uarmc->cursed && !rn2(3))) - obj->oeroded++; - } - } + bufp = strcpy(buf, "potion"); + if (!one) bufp = makeplural(bufp); + /* [should we damage player/monster?] */ + pline("%s %s %s!", /* "A potion explodes!" */ + !exploded ? (one ? "A" : "Some") : + (one ? "Another" : "More"), + bufp, vtense(bufp, "explode")); + exploded = TRUE; + /* let caller know that obj has gone away + [when obj is part of a list, delobj()'s + obj_extract_self() takes care of this; + for loose_obj, obj should always equal + *objp and otmp should always be null] */ + delobj(obj); + if (update) + update_inventory(); + return 3; + } else if (obj->odiluted) { + obj->otyp = POT_WATER; + obj->dknown = 0; + obj->blessed = obj->cursed = 0; + obj->odiluted = 0; + if (carried(obj)) + update_inventory(); + return 2; + } else if (obj->otyp != POT_WATER) { + obj->odiluted++; + if (carried(obj)) + update_inventory(); + return 2; + } + } else { + return rust_dmg(obj, ostr, ERODE_RUST, FALSE, FALSE) ? 2 : 0; + } + return 0; +} + +void +water_damage_chain(obj,here) +struct obj *obj; +boolean here; +{ + struct obj *otmp; + for (; obj; obj = otmp) { + otmp = here ? obj->nexthere : obj->nobj; + water_damage(obj, NULL, FALSE); + } } /* @@ -3246,7 +3253,7 @@ drown() Hallucination ? "the Titanic" : "a rock"); } - water_damage(&invent, FALSE, FALSE); + water_damage_chain(invent, FALSE); if (u.umonnum == PM_GREMLIN && rn2(3)) (void)split_mon(&youmonst, (struct monst *)0); diff --git a/src/uhitm.c b/src/uhitm.c index 1ccb8a2cb..a0f90d3de 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -30,22 +30,13 @@ static boolean override_confirmation = FALSE; #define PROJECTILE(obj) ((obj) && is_ammo(obj)) -/* modified from hurtarmor() in mhitu.c */ -/* This is not static because it is also used for monsters rusting monsters */ void -hurtmarmor(mdef, attk) +erode_armor(mdef, hurt) struct monst *mdef; -int attk; +int hurt; { - int hurt; struct obj *target; - switch(attk) { - /* 0 is burning, which we should never be called with */ - case AD_RUST: hurt = 1; break; - case AD_CORR: hurt = 3; break; - default: hurt = 2; break; - } /* What the following code does: it keeps looping until it * finds a target for the rust monster. * Head, feet, etc... not covered by metal, or covered by @@ -56,34 +47,34 @@ int attk; switch(rn2(5)) { case 0: target = which_armor(mdef, W_ARMH); - if (!target || !rust_dmg(target, xname(target), hurt, FALSE)) + if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE)) continue; break; case 1: target = which_armor(mdef, W_ARMC); if (target) { - (void)rust_dmg(target, xname(target), hurt, TRUE); + (void)rust_dmg(target, xname(target), hurt, TRUE, TRUE); break; } if ((target = which_armor(mdef, W_ARM)) != (struct obj *)0) { - (void)rust_dmg(target, xname(target), hurt, TRUE); + (void)rust_dmg(target, xname(target), hurt, TRUE, TRUE); } else if ((target = which_armor(mdef, W_ARMU)) != (struct obj *)0) { - (void)rust_dmg(target, xname(target), hurt, TRUE); + (void)rust_dmg(target, xname(target), hurt, TRUE, TRUE); } break; case 2: target = which_armor(mdef, W_ARMS); - if (!target || !rust_dmg(target, xname(target), hurt, FALSE)) + if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE)) continue; break; case 3: target = which_armor(mdef, W_ARMG); - if (!target || !rust_dmg(target, xname(target), hurt, FALSE)) + if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE)) continue; break; case 4: target = which_armor(mdef, W_ARMF); - if (!target || !rust_dmg(target, xname(target), hurt, FALSE)) + if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE)) continue; break; } @@ -1536,11 +1527,11 @@ register struct attack *mattk; pline("%s falls to pieces!", Monnam(mdef)); xkilled(mdef,0); } - hurtmarmor(mdef, AD_RUST); + erode_armor(mdef, ERODE_RUST); tmp = 0; break; case AD_CORR: - hurtmarmor(mdef, AD_CORR); + erode_armor(mdef, ERODE_CORRODE); tmp = 0; break; case AD_DCAY: @@ -1549,7 +1540,7 @@ register struct attack *mattk; pline("%s falls to pieces!", Monnam(mdef)); xkilled(mdef,0); } - hurtmarmor(mdef, AD_DCAY); + erode_armor(mdef, ERODE_ROT); tmp = 0; break; case AD_DREN: @@ -2231,7 +2222,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf && !rn2(6)) - (void)rust_dmg(uarmf, xname(uarmf), 0, TRUE); + (void)rust_dmg(uarmf, xname(uarmf), ERODE_BURN, TRUE, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2246,12 +2237,12 @@ boolean wep_was_destroyed; if (!Acid_resistance) mdamageu(mon, tmp); - if(!rn2(30)) erode_armor(&youmonst, TRUE); + if(!rn2(30)) erode_armor(&youmonst, ERODE_CORRODE); } if (mhit) { if (aatyp == AT_KICK) { if (uarmf && !rn2(6)) - (void)rust_dmg(uarmf, xname(uarmf), 3, TRUE); + (void)rust_dmg(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2284,7 +2275,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf) - (void)rust_dmg(uarmf, xname(uarmf), 1, TRUE); + (void)rust_dmg(uarmf, xname(uarmf), ERODE_RUST, TRUE, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2294,7 +2285,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf) - (void)rust_dmg(uarmf, xname(uarmf), 3, TRUE); + (void)rust_dmg(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); diff --git a/src/worn.c b/src/worn.c index 32bfe1003..a542f3be4 100644 --- a/src/worn.c +++ b/src/worn.c @@ -583,11 +583,28 @@ which_armor(mon, flag) struct monst *mon; long flag; { - register struct obj *obj; + if (mon == &youmonst) { + switch (flag) { + case W_ARM: return uarm; + case W_ARMC: return uarmc; + case W_ARMH: return uarmh; + case W_ARMS: return uarms; + case W_ARMG: return uarmg; + case W_ARMF: return uarmf; +#ifdef TOURIST + case W_ARMU: return uarmu; +#endif + default: + impossible("bad flag in which_armor"); + return 0; + } + } else { + register struct obj *obj; - for(obj = mon->minvent; obj; obj = obj->nobj) - if (obj->owornmask & flag) return obj; - return((struct obj *)0); + for(obj = mon->minvent; obj; obj = obj->nobj) + if (obj->owornmask & flag) return obj; + return((struct obj *)0); + } } /* remove an item of armor and then drop it */ diff --git a/src/zap.c b/src/zap.c index 03cbc6c52..2fb2396de 100644 --- a/src/zap.c +++ b/src/zap.c @@ -3396,7 +3396,7 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */ } tmp = d(nd,6); if (!rn2(6)) (void) erode_obj(MON_WEP(mon), 3, TRUE, FALSE); - if (!rn2(6)) erode_armor(mon, TRUE); + if (!rn2(6)) erode_armor(mon, ERODE_CORRODE); break; } if (sho_shieldeff) shieldeff(mon->mx, mon->my); @@ -3525,7 +3525,7 @@ xchar sx, sy; (void) erode_obj(uwep, 3, TRUE, FALSE); if (u.twoweap && !rn2(3)) (void) erode_obj(uswapwep, 3, TRUE, FALSE); - if (!rn2(6)) erode_armor(&youmonst, TRUE); + if (!rn2(6)) erode_armor(&youmonst, ERODE_CORRODE); break; } From 04a0331cccb954b985f25be352930efb3d034e1d Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Tue, 24 Feb 2015 15:20:01 -0500 Subject: [PATCH 154/354] Eliminate `erode_obj()` and other erosion. Now all erosion that isn't fire-based goes through `rust_dmg()` --- doc/fixes35.0 | 4 +- include/extern.h | 3 +- src/mhitm.c | 23 +++++---- src/mhitu.c | 25 +--------- src/potion.c | 2 +- src/spell.c | 16 +----- src/trap.c | 57 ++++++++++++++++----- src/uhitm.c | 8 +-- src/wield.c | 125 ----------------------------------------------- src/zap.c | 6 +-- 10 files changed, 73 insertions(+), 196 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 48da8da36..9dc59fa66 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -859,9 +859,11 @@ if lava burns up the player's water walking boots, the player falls in the messages for lava burning items up are always printed fix used-up magic trap trying to hit steed. messages are now printed when objects on the ground are eroded -object erosion now always identifies rust/rot/fire/corrodeproof objects +object erosion now always identifies fooproof objects grease protects from all types of erosion all sources of erosion now affect objects the same way +passive attacks no longer erode armor covered by other armor +dipping a fooproof item into acid no longer forgets that it's fooproof Platform- and/or Interface-Specific Fixes diff --git a/include/extern.h b/include/extern.h index 87d3adee7..6ca49b411 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1070,6 +1070,7 @@ E int FDECL(sleep_monst, (struct monst *,int,int)); E void FDECL(slept_monst, (struct monst *)); E void FDECL(xdrainenergym, (struct monst *,BOOLEAN_P)); E long FDECL(attk_protection, (int)); +E void FDECL(rustm, (struct monst *,struct obj *)); /* ### mhitu.c ### */ @@ -2222,6 +2223,7 @@ E void FDECL(fill_pit, (int,int)); E int FDECL(float_down, (long, long)); E void NDECL(climb_pit); E int FDECL(fire_damage, (struct obj *,BOOLEAN_P,BOOLEAN_P,XCHAR_P,XCHAR_P)); +E void acid_damage(struct obj *); E int FDECL(water_damage, (struct obj *,const char*,BOOLEAN_P)); E void FDECL(water_damage_chain, (struct obj *,BOOLEAN_P)); E boolean NDECL(drown); @@ -2516,7 +2518,6 @@ E void NDECL(uwepgone); E void NDECL(uswapwepgone); E void NDECL(uqwepgone); E void NDECL(untwoweapon); -E boolean FDECL(erode_obj, (struct obj *,int,BOOLEAN_P,BOOLEAN_P)); E int FDECL(chwepon, (struct obj *,int)); E int FDECL(welded, (struct obj *)); E void FDECL(weldmsg, (struct obj *)); diff --git a/src/mhitm.c b/src/mhitm.c index ae66279e7..31c9dba11 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -16,7 +16,6 @@ static const char brief_feeling[] = "have a %s feeling for a moment, then it passes."; STATIC_DCL char *FDECL(mon_nam_too, (char *,struct monst *,struct monst *)); -STATIC_DCL void FDECL(mrustm, (struct monst *, struct monst *, struct obj *)); STATIC_DCL int FDECL(hitmm, (struct monst *,struct monst *,struct attack *)); STATIC_DCL int FDECL(gazemm, (struct monst *,struct monst *,struct attack *)); STATIC_DCL int FDECL(gulpmm, (struct monst *,struct monst *,struct attack *)); @@ -796,7 +795,7 @@ mdamagem(magr, mdef, mattk) (grow_up(magr,mdef) ? 0 : MM_AGR_DIED)); } if (tmp) - mrustm(magr, mdef, otmp); + rustm(mdef, otmp); } } else if (pa == &mons[PM_PURPLE_WORM] && pd == &mons[PM_SHRIEKER]) { @@ -884,7 +883,7 @@ mdamagem(magr, mdef, mattk) pline("It burns %s!", mon_nam(mdef)); } if (!rn2(30)) erode_armor(mdef, ERODE_CORRODE); - if (!rn2(6)) (void) erode_obj(MON_WEP(mdef), 3, TRUE, FALSE); + if (!rn2(6)) acid_damage(MON_WEP(mdef)); break; case AD_RUST: if (magr->mcan) break; @@ -1287,24 +1286,24 @@ struct monst *mon; } } -STATIC_OVL void -mrustm(magr, mdef, obj) -register struct monst *magr, *mdef; +void +rustm(mdef, obj) +register struct monst *mdef; register struct obj *obj; { int dmgtyp; - if (!magr || !mdef || !obj) return; /* just in case */ + if (!mdef || !obj) return; /* just in case */ /* AD_ACID is handled in passivemm */ if (dmgtype(mdef->data, AD_CORR)) - dmgtyp = 3; + dmgtyp = ERODE_CORRODE; else if (dmgtype(mdef->data, AD_RUST)) - dmgtyp = 1; + dmgtyp = ERODE_RUST; else if (dmgtype(mdef->data, AD_FIRE)) - dmgtyp = 0; + dmgtyp = ERODE_BURN; else return; - (void) erode_obj(obj, dmgtyp, FALSE, FALSE); + (void) rust_dmg(obj, 0, dmgtyp, TRUE, TRUE); } STATIC_OVL void @@ -1362,7 +1361,7 @@ int mdead; } } else tmp = 0; if (!rn2(30)) erode_armor(magr, ERODE_CORRODE); - if (!rn2(6)) (void)erode_obj(MON_WEP(magr), 3, TRUE, FALSE); + if (!rn2(6)) acid_damage(MON_WEP(magr)); goto assess_dmg; case AD_ENCH: /* KMH -- remove enchantment (disenchanter) */ if (mhit && !mdef->mcan && otmp) { diff --git a/src/mhitu.c b/src/mhitu.c index cc9b6f1be..6aa4225f7 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -8,7 +8,6 @@ STATIC_VAR NEARDATA struct obj *otmp; -STATIC_DCL void FDECL(urustm, (struct monst *, struct obj *)); STATIC_DCL boolean FDECL(u_slip_free, (struct monst *,struct attack *)); STATIC_DCL int FDECL(passiveum, (struct permonst *,struct monst *,struct attack *)); @@ -920,7 +919,7 @@ hitmu(mtmp, mattk) if (cloneu()) You("divide as %s hits you!", mon_nam(mtmp)); } - urustm(mtmp, otmp); + rustm(&youmonst, otmp); } else if (mattk->aatyp != AT_TUCH || dmg != 0 || mtmp != u.ustuck) hitmsg(mtmp, mattk); @@ -2079,26 +2078,6 @@ register int n; } } -STATIC_OVL void -urustm(mon, obj) -register struct monst *mon; -register struct obj *obj; -{ - int dmgtyp; - - if (!mon || !obj) return; /* just in case */ - /* AD_ACID is handled in passiveum */ - if (dmgtype(youmonst.data, AD_CORR)) - dmgtyp = 3; - else if (dmgtype(youmonst.data, AD_RUST)) - dmgtyp = 1; - else if (dmgtype(youmonst.data, AD_FIRE)) - dmgtyp = 0; - else - return; - (void) erode_obj(obj, dmgtyp, FALSE, FALSE); -} - int could_seduce(magr,mdef,mattk) struct monst *magr, *mdef; @@ -2442,7 +2421,7 @@ register struct attack *mattk; } } else tmp = 0; if (!rn2(30)) erode_armor(mtmp, ERODE_CORRODE); - if (!rn2(6)) (void)erode_obj(MON_WEP(mtmp), 3, TRUE, FALSE); + if (!rn2(6)) acid_damage(MON_WEP(mtmp)); goto assess_dmg; case AD_STON: /* cockatrice */ { diff --git a/src/potion.c b/src/potion.c index 7542ea451..483544c2b 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1931,7 +1931,7 @@ dodip() } if (potion->otyp == POT_ACID) { - if (erode_obj(obj, 3, FALSE, TRUE)) + if (rust_dmg(obj, 0, ERODE_CORRODE, TRUE, FALSE)) goto poof; } diff --git a/src/spell.c b/src/spell.c index e1f6fc55b..5d499bf73 100644 --- a/src/spell.c +++ b/src/spell.c @@ -144,21 +144,7 @@ cursed_book(bp) case 5: pline_The("book was coated with contact poison!"); if (uarmg) { - if (uarmg->oerodeproof || !is_corrodeable(uarmg)) { - Your("gloves seem unaffected."); - } else if (uarmg->oeroded2 < MAX_ERODE) { - if (uarmg->greased) { - grease_protect(uarmg, "gloves", &youmonst); - } else { - Your("gloves corrode%s!", - uarmg->oeroded2+1 == MAX_ERODE ? - " completely" : uarmg->oeroded2 ? - " further" : ""); - uarmg->oeroded2++; - } - } else - Your("gloves %s completely corroded.", - Blind ? "feel" : "look"); + rust_dmg(uarmg, "gloves", ERODE_CORRODE, TRUE, TRUE); break; } /* temp disable in_use; death should not destroy the book */ diff --git a/src/trap.c b/src/trap.c index f6266791f..f78b7ad66 100644 --- a/src/trap.c +++ b/src/trap.c @@ -103,6 +103,8 @@ struct monst *victim; /* Generic erode-item function. Returns TRUE if any change in state * occurred, or if grease protected the item. + * "ostr", if non-null, is an alternate string to print instead of the + * object's name. * "check_grease", if FALSE, means that grease is not checked for * "print", if set, means to print a message even if no change occurs. */ @@ -165,8 +167,8 @@ boolean print; if (victim == &youmonst) Your("%s %s not affected.", ostr, vtense(ostr, "are")); else if (vismon) - pline("%s's %s %s not affected.", Monnam(victim), ostr, - vtense(ostr, "are")); + pline("%s %s %s not affected.", s_suffix(Monnam(victim)), + ostr, vtense(ostr, "are")); } return FALSE; } else if (otmp->oerodeproof || (otmp->blessed && !rnl(4))) { @@ -175,8 +177,9 @@ boolean print; pline("Somehow, your %s %s not affected.", ostr, vtense(ostr, "are")); else if (vismon) - pline("Somehow, %s's %s %s not affected.", - mon_nam(victim), ostr, vtense(ostr, "are")); + pline("Somehow, %s %s %s not affected.", + s_suffix(mon_nam(victim)), ostr, + vtense(ostr, "are")); else if (visobj) pline("Somehow, the %s %s not affected.", ostr, vtense(ostr, "are")); @@ -214,8 +217,8 @@ boolean print; vtense(ostr, Blind ? "feel" : "look"), msg[type]); else if (vismon) - pline("%s's %s %s completely %s.", - Monnam(victim), ostr, + pline("%s %s %s completely %s.", + s_suffix(Monnam(victim)), ostr, vtense(ostr, "look"), msg[type]); else if (visobj) pline("The %s %s completely %s.", ostr, @@ -952,8 +955,8 @@ unsigned trflags; if (water_damage(uarms, "shield", TRUE)) break; if (u.twoweap || (uwep && bimanual(uwep))) - (void) erode_obj(u.twoweap ? uswapwep : uwep, - 1, TRUE, FALSE); + (void) water_damage(u.twoweap ? uswapwep : uwep, 0, + TRUE); glovecheck: (void) water_damage(uarmg, "gauntlets", TRUE); /* Not "metal gauntlets" since it gets called * even if it's leather for the message @@ -962,7 +965,7 @@ glovecheck: (void) water_damage(uarmg, "gauntlets", TRUE); case 2: pline("%s your right %s!", A_gush_of_water_hits, body_part(ARM)); - (void) erode_obj(uwep, 1, TRUE, FALSE); + (void) water_damage(uwep, 0, TRUE); goto glovecheck; default: pline("%s you!", A_gush_of_water_hits); @@ -2098,7 +2101,7 @@ register struct monst *mtmp; break; target = MON_WEP(mtmp); if (target && bimanual(target)) - (void) erode_obj(target, 1, TRUE, FALSE); + (void) water_damage(target, 0, TRUE); glovecheck: target = which_armor(mtmp, W_ARMG); (void) water_damage(target, "gauntlets", TRUE); break; @@ -2106,7 +2109,7 @@ glovecheck: target = which_armor(mtmp, W_ARMG); if (in_sight) pline("%s %s's right %s!", A_gush_of_water_hits, mon_nam(mtmp), mbodypart(mtmp, ARM)); - (void) erode_obj(MON_WEP(mtmp), 1, TRUE, FALSE); + (void) water_damage(MON_WEP(mtmp), 0, TRUE); goto glovecheck; default: if (in_sight) @@ -3069,6 +3072,38 @@ xchar x, y; return retval; } +void +acid_damage(obj) +struct obj *obj; +{ + /* Scrolls but not spellbooks can be erased by acid. */ + struct monst *victim = + carried(obj) ? &youmonst : mcarried(obj) ? obj->ocarry : NULL; + boolean vismon = victim && (victim != &youmonst) && canseemon(victim); + + if (obj->greased) + grease_protect(obj, NULL, victim); + else if (obj->oclass == SCROLL_CLASS && obj->otyp != SCR_BLANK_PAPER) { + if (obj->otyp != SCR_BLANK_PAPER +#ifdef MAIL + && obj->otyp != SCR_MAIL +#endif + ) { + if (!Blind) { + if (victim == &youmonst) + pline("Your %s.", aobjnam(obj, "fade")); + else if (vismon) + pline("%s %s.", s_suffix(Monnam(victim)), + aobjnam(obj, "fade")); + } + } + obj->otyp = SCR_BLANK_PAPER; + obj->spe = 0; + obj->dknown = 0; + } else + rust_dmg(obj, NULL, ERODE_CORRODE, TRUE, TRUE); +} + /* returns: * 0 if obj is unaffected * 1 if obj is protected by grease diff --git a/src/uhitm.c b/src/uhitm.c index a0f90d3de..51f38eee0 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -2446,22 +2446,22 @@ struct attack *mattk; /* null means we find one internally */ case AD_FIRE: if(!rn2(6) && !mon->mcan) { - (void) erode_obj(obj, 0, FALSE, FALSE); + (void) rust_dmg(obj, 0, ERODE_BURN, FALSE, FALSE); } break; case AD_ACID: if(!rn2(6)) { - (void) erode_obj(obj, 3, FALSE, FALSE); + (void) rust_dmg(obj, 0, ERODE_CORRODE, FALSE, FALSE); } break; case AD_RUST: if(!mon->mcan) { - (void) erode_obj(obj, 1, FALSE, FALSE); + (void) rust_dmg(obj, 0, ERODE_RUST, FALSE, FALSE); } break; case AD_CORR: if(!mon->mcan) { - (void) erode_obj(obj, 3, FALSE, FALSE); + (void) rust_dmg(obj, 0, ERODE_CORRODE, FALSE, FALSE); } break; case AD_ENCH: diff --git a/src/wield.c b/src/wield.c index dbb5d271f..9e1447bff 100644 --- a/src/wield.c +++ b/src/wield.c @@ -597,131 +597,6 @@ untwoweapon() return; } -/* Maybe rust (or corrode, burn, rot) object. - * Returns TRUE if something happened. */ -boolean -erode_obj(target, type, fade_scrolls, for_dip) -struct obj *target; /* object (e.g. weapon or armor) to erode */ -int type; -boolean fade_scrolls; -boolean for_dip; -{ - static NEARDATA const char * const action[] = { "smoulder", "rust", "rot", "corrode" }; - static NEARDATA const char * const msg[] = { "burnt", "rusty", "rotten", "corroded" }; - boolean vulnerable = FALSE; - boolean grprot = FALSE; - boolean is_primary = TRUE; - int erosion; - int dmgtyp = AD_ACID; - struct monst *victim; - boolean vismon, visobj, chill; - boolean ret = FALSE; - boolean already_affected = FALSE; - - if (!target) - return FALSE; - victim = carried(target) ? &youmonst : - mcarried(target) ? target->ocarry : (struct monst *)0; - vismon = victim && (victim != &youmonst) && canseemon(victim); - visobj = !victim && cansee(bhitpos.x, bhitpos.y); /* assume thrown */ - - switch(type) { - case 0: vulnerable = is_flammable(target); - dmgtyp = AD_FIRE; - break; - case 1: vulnerable = is_rustprone(target); - dmgtyp = AD_RUST; - grprot = TRUE; - if (target->lamplit) { - already_affected = snuff_lit(target); - if (already_affected) ret = TRUE; - } - break; - case 2: vulnerable = is_rottable(target); - dmgtyp = AD_DCAY; - is_primary = FALSE; - break; - case 3: vulnerable = is_corrodeable(target); - dmgtyp = AD_ACID; - grprot = TRUE; - is_primary = FALSE; - break; - } - erosion = is_primary ? target->oeroded : target->oeroded2; - - if (target->greased && grprot) { - grease_protect(target,(char *)0,victim); - ret = TRUE; - } else if (target->oclass == SCROLL_CLASS && (type == 1 || type == 3)) { - if(fade_scrolls && target->otyp != SCR_BLANK_PAPER -#ifdef MAIL - && target->otyp != SCR_MAIL -#endif - ) - { - if (!Blind) { - if ((victim == &youmonst) || vismon || visobj) - pline("%s.", Yobjnam2(target, "fade")); - } - target->otyp = SCR_BLANK_PAPER; - target->spe = 0; - ret = TRUE; - } - } else if (target->oartifact && arti_immune(target, dmgtyp)) { - if (flags.verbose && (dmgtyp != AD_FIRE)) { - if (victim == &youmonst) - pline("%s.", Yobjnam2(target, "sizzle")); - } - /* no damage to object */ - } else if (target->oartifact && (type == 1) && - /* cold and fire provide partial protection against rust */ - ((chill = arti_immune(target, AD_COLD)) != 0 || - arti_immune(target, AD_FIRE)) && - /* once rusted, the chance for further rusting goes up */ - rn2(2 * (MAX_ERODE + 1 - erosion))) { - if (flags.verbose && target->oclass == WEAPON_CLASS) { - if (victim == &youmonst || vismon || visobj) - pline("%s some water.", - Yobjnam2(target, chill ? "freeze" : "boil")); - } - /* no damage to object */ - } else if (target->oerodeproof || !vulnerable) { - /* no message if dipping or not carried */ - if (for_dip) { - /* assumes that for_dip implies player action */ - if (!Blind) target->rknown = 0; - } else if (victim == &youmonst || vismon) { - if (flags.verbose || (vulnerable && !target->rknown)) - pline("%s not %s.", Yobjnam2(target, "are"), - already_affected ? "harmed" : "affected"); - if (vulnerable) target->rknown = 1; - } - } else if (erosion < MAX_ERODE) { - if (victim == &youmonst || vismon || visobj) { - pline("%s%s!", Yobjnam2(target, action[type]), - erosion+1 == MAX_ERODE ? " completely" : - erosion ? " further" : ""); - target->rknown = 1; /* it's obviously not erode-proof */ - } - if (is_primary) - target->oeroded++; - else - target->oeroded2++; - ret = TRUE; - } else { - if (flags.verbose && !for_dip) { - if (victim == &youmonst) - pline("%s completely %s.", - Yobjnam2(target, Blind ? "feel" : "look"), msg[type]); - else if (vismon || visobj) - pline("%s completely %s.", - Yobjnam2(target, "look"), msg[type]); - } - } - - return ret; -} - int chwepon(otmp, amount) register struct obj *otmp; diff --git a/src/zap.c b/src/zap.c index 2fb2396de..95b9760a3 100644 --- a/src/zap.c +++ b/src/zap.c @@ -3395,7 +3395,7 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */ break; } tmp = d(nd,6); - if (!rn2(6)) (void) erode_obj(MON_WEP(mon), 3, TRUE, FALSE); + if (!rn2(6)) acid_damage(MON_WEP(mon)); if (!rn2(6)) erode_armor(mon, ERODE_CORRODE); break; } @@ -3522,9 +3522,9 @@ xchar sx, sy; } /* using two weapons at once makes both of them more vulnerable */ if (!rn2(u.twoweap ? 3 : 6)) - (void) erode_obj(uwep, 3, TRUE, FALSE); + acid_damage(uwep); if (u.twoweap && !rn2(3)) - (void) erode_obj(uswapwep, 3, TRUE, FALSE); + acid_damage(uswapwep); if (!rn2(6)) erode_armor(&youmonst, ERODE_CORRODE); break; } From cd83f7e802856e4b64734b2a6c4f6660c7661ab8 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Tue, 24 Feb 2015 15:21:30 -0500 Subject: [PATCH 155/354] Rename `rust_dmg()` to `erode_obj()`. --- include/extern.h | 2 +- src/mhitm.c | 2 +- src/potion.c | 2 +- src/spell.c | 2 +- src/trap.c | 10 +++++----- src/uhitm.c | 30 +++++++++++++++--------------- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/extern.h b/include/extern.h index 6ca49b411..f9fc3be0c 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2203,7 +2203,7 @@ E coord *FDECL(gettrack, (int,int)); /* ### trap.c ### */ E boolean FDECL(burnarmor,(struct monst *)); -E boolean FDECL(rust_dmg, (struct obj *,const char *,int,BOOLEAN_P,BOOLEAN_P)); +E boolean FDECL(erode_obj, (struct obj *,const char *,int,BOOLEAN_P,BOOLEAN_P)); E boolean FDECL(grease_protect, (struct obj *,const char *,struct monst *)); E struct trap *FDECL(maketrap, (int,int,int)); E void FDECL(fall_through, (BOOLEAN_P)); diff --git a/src/mhitm.c b/src/mhitm.c index 31c9dba11..88770c523 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1303,7 +1303,7 @@ register struct obj *obj; dmgtyp = ERODE_BURN; else return; - (void) rust_dmg(obj, 0, dmgtyp, TRUE, TRUE); + (void) erode_obj(obj, 0, dmgtyp, TRUE, TRUE); } STATIC_OVL void diff --git a/src/potion.c b/src/potion.c index 483544c2b..782fa7ace 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1931,7 +1931,7 @@ dodip() } if (potion->otyp == POT_ACID) { - if (rust_dmg(obj, 0, ERODE_CORRODE, TRUE, FALSE)) + if (erode_obj(obj, 0, ERODE_CORRODE, TRUE, FALSE)) goto poof; } diff --git a/src/spell.c b/src/spell.c index 5d499bf73..597d4e606 100644 --- a/src/spell.c +++ b/src/spell.c @@ -144,7 +144,7 @@ cursed_book(bp) case 5: pline_The("book was coated with contact poison!"); if (uarmg) { - rust_dmg(uarmg, "gloves", ERODE_CORRODE, TRUE, TRUE); + erode_obj(uarmg, "gloves", ERODE_CORRODE, TRUE, TRUE); break; } /* temp disable in_use; death should not destroy the book */ diff --git a/src/trap.c b/src/trap.c index f78b7ad66..d535fc230 100644 --- a/src/trap.c +++ b/src/trap.c @@ -55,7 +55,7 @@ struct monst *victim; int mat_idx; if (!victim) return 0; -#define burn_dmg(obj,descr) rust_dmg(obj, descr, ERODE_BURN, TRUE, FALSE) +#define burn_dmg(obj,descr) erode_obj(obj, descr, ERODE_BURN, TRUE, FALSE) while (1) { switch (rn2(5)) { case 0: @@ -109,7 +109,7 @@ struct monst *victim; * "print", if set, means to print a message even if no change occurs. */ boolean -rust_dmg(otmp, ostr, type, check_grease, print) +erode_obj(otmp, ostr, type, check_grease, print) register struct obj *otmp; register const char *ostr; int type; @@ -151,7 +151,7 @@ boolean print; is_primary = FALSE; break; default: - impossible("Invalid erosion type in rust_dmg"); + impossible("Invalid erosion type in erode_obj"); return FALSE; } erosion = is_primary ? otmp->oeroded : otmp->oeroded2; @@ -3101,7 +3101,7 @@ struct obj *obj; obj->spe = 0; obj->dknown = 0; } else - rust_dmg(obj, NULL, ERODE_CORRODE, TRUE, TRUE); + erode_obj(obj, NULL, ERODE_CORRODE, TRUE, TRUE); } /* returns: @@ -3195,7 +3195,7 @@ boolean force; return 2; } } else { - return rust_dmg(obj, ostr, ERODE_RUST, FALSE, FALSE) ? 2 : 0; + return erode_obj(obj, ostr, ERODE_RUST, FALSE, FALSE) ? 2 : 0; } return 0; } diff --git a/src/uhitm.c b/src/uhitm.c index 51f38eee0..b594fd863 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -47,34 +47,34 @@ int hurt; switch(rn2(5)) { case 0: target = which_armor(mdef, W_ARMH); - if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE)) + if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE)) continue; break; case 1: target = which_armor(mdef, W_ARMC); if (target) { - (void)rust_dmg(target, xname(target), hurt, TRUE, TRUE); + (void)erode_obj(target, xname(target), hurt, TRUE, TRUE); break; } if ((target = which_armor(mdef, W_ARM)) != (struct obj *)0) { - (void)rust_dmg(target, xname(target), hurt, TRUE, TRUE); + (void)erode_obj(target, xname(target), hurt, TRUE, TRUE); } else if ((target = which_armor(mdef, W_ARMU)) != (struct obj *)0) { - (void)rust_dmg(target, xname(target), hurt, TRUE, TRUE); + (void)erode_obj(target, xname(target), hurt, TRUE, TRUE); } break; case 2: target = which_armor(mdef, W_ARMS); - if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE)) + if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE)) continue; break; case 3: target = which_armor(mdef, W_ARMG); - if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE)) + if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE)) continue; break; case 4: target = which_armor(mdef, W_ARMF); - if (!target || !rust_dmg(target, xname(target), hurt, TRUE, FALSE)) + if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE)) continue; break; } @@ -2222,7 +2222,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf && !rn2(6)) - (void)rust_dmg(uarmf, xname(uarmf), ERODE_BURN, TRUE, TRUE); + (void)erode_obj(uarmf, xname(uarmf), ERODE_BURN, TRUE, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2242,7 +2242,7 @@ boolean wep_was_destroyed; if (mhit) { if (aatyp == AT_KICK) { if (uarmf && !rn2(6)) - (void)rust_dmg(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE); + (void)erode_obj(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2275,7 +2275,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf) - (void)rust_dmg(uarmf, xname(uarmf), ERODE_RUST, TRUE, TRUE); + (void)erode_obj(uarmf, xname(uarmf), ERODE_RUST, TRUE, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2285,7 +2285,7 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf) - (void)rust_dmg(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE); + (void)erode_obj(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2446,22 +2446,22 @@ struct attack *mattk; /* null means we find one internally */ case AD_FIRE: if(!rn2(6) && !mon->mcan) { - (void) rust_dmg(obj, 0, ERODE_BURN, FALSE, FALSE); + (void) erode_obj(obj, 0, ERODE_BURN, FALSE, FALSE); } break; case AD_ACID: if(!rn2(6)) { - (void) rust_dmg(obj, 0, ERODE_CORRODE, FALSE, FALSE); + (void) erode_obj(obj, 0, ERODE_CORRODE, FALSE, FALSE); } break; case AD_RUST: if(!mon->mcan) { - (void) rust_dmg(obj, 0, ERODE_RUST, FALSE, FALSE); + (void) erode_obj(obj, 0, ERODE_RUST, FALSE, FALSE); } break; case AD_CORR: if(!mon->mcan) { - (void) rust_dmg(obj, 0, ERODE_CORRODE, FALSE, FALSE); + (void) erode_obj(obj, 0, ERODE_CORRODE, FALSE, FALSE); } break; case AD_ENCH: From d58a9bb56e739ef1d0e3936708c7f7e65ec1d8fe Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Tue, 24 Feb 2015 15:26:09 -0500 Subject: [PATCH 156/354] Fold `get_wet()` into `water_damage()`. This now ensures that dipping into water works like other sources of water damage. There is a potentially significant gameplay change here: dipping a container into uncursed water will wet all its contents. If this is a problem, then we should add another parameter to water_damage which will suppress this behaviour for dipping. --- doc/fixes35.0 | 2 +- include/extern.h | 1 - src/fountain.c | 2 +- src/potion.c | 96 +----------------------------------------------- src/trap.c | 3 +- 5 files changed, 6 insertions(+), 98 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 9dc59fa66..d3f6b1a90 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -864,7 +864,7 @@ grease protects from all types of erosion all sources of erosion now affect objects the same way passive attacks no longer erode armor covered by other armor dipping a fooproof item into acid no longer forgets that it's fooproof - +dipping a container into uncursed water now gets its contents wet Platform- and/or Interface-Specific Fixes ----------------------------------------- diff --git a/include/extern.h b/include/extern.h index f9fc3be0c..4da79874d 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1726,7 +1726,6 @@ E void FDECL(healup, (int,int,BOOLEAN_P,BOOLEAN_P)); E void FDECL(strange_feeling, (struct obj *,const char *)); E void FDECL(potionhit, (struct monst *,struct obj *,BOOLEAN_P)); E void FDECL(potionbreathe, (struct obj *)); -E boolean FDECL(get_wet, (struct obj *)); E int NDECL(dodip); E void FDECL(mongrantswish, (struct monst **)); E void FDECL(djinni_from_bottle, (struct obj *)); diff --git a/src/fountain.c b/src/fountain.c index cc8aeb7bf..7de917ad9 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -402,7 +402,7 @@ register struct obj *obj; if(in_town(u.ux, u.uy)) (void) angry_guards(FALSE); return; - } else if (get_wet(obj)) { + } else if (water_damage(obj, NULL, TRUE)) { if (obj->otyp == POT_ACID) { /* Acid and water don't mix */ useup(obj); return; diff --git a/src/potion.c b/src/potion.c index 782fa7ace..4c57eaecb 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1088,7 +1088,7 @@ const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */ } else { /* dipping into uncursed water; carried() check skips steed saddle */ if (carried(targobj)) { - if (get_wet(targobj)) + if (water_damage(targobj, 0, TRUE)) res = TRUE; } } @@ -1626,98 +1626,6 @@ register struct obj *o1, *o2; return 0; } - -boolean -get_wet(obj) -register struct obj *obj; -/* returns TRUE if something happened (potion should be used up) */ -{ - if (snuff_lit(obj)) return(TRUE); - - if (obj->greased) { - grease_protect(obj,(char *)0,&youmonst); - return(FALSE); - } - - /* (Rusting shop goods ought to be charged for.) */ - switch (obj->oclass) { - case POTION_CLASS: - if (obj->otyp == POT_WATER) return FALSE; - /* KMH -- Water into acid causes an explosion */ - if (obj->otyp == POT_ACID) { - pline("It boils vigorously!"); - You("are caught in the explosion!"); - losehp(Maybe_Half_Phys(rnd(10)), "elementary chemistry", - KILLED_BY); - makeknown(obj->otyp); - update_inventory(); - return (TRUE); - } - pline("%s%s.", Yobjnam2(obj,"dilute"), - obj->odiluted ? " further" : ""); - costly_alteration(obj, COST_DILUTE); - if (obj->odiluted) { - obj->odiluted = 0; - obj->blessed = FALSE; - obj->cursed = FALSE; - obj->otyp = POT_WATER; - } else - obj->odiluted++; - update_inventory(); - return TRUE; - case SCROLL_CLASS: - if (obj->otyp != SCR_BLANK_PAPER -#ifdef MAIL - && obj->otyp != SCR_MAIL -#endif - ) { - if (!Blind) - pline_The("scroll%s %s.", - plur(obj->quan), otense(obj, "fade")); - costly_alteration(obj, COST_ERASE); - obj->otyp = SCR_BLANK_PAPER; - obj->spe = 0; - update_inventory(); - return TRUE; - } else break; - case SPBOOK_CLASS: - if (obj->otyp != SPE_BLANK_PAPER) { - - if (obj->otyp == SPE_BOOK_OF_THE_DEAD) { - pline( - "%s suddenly heats up; steam rises and it remains dry.", - The(xname(obj))); - } else { - if (!Blind) - pline_The("spellbook%s %s.", - plur(obj->quan), - otense(obj, "fade")); - costly_alteration(obj, COST_ERASE); - obj->otyp = SPE_BLANK_PAPER; - update_inventory(); - } - return TRUE; - } - break; - case WEAPON_CLASS: - /* Just "fall through" to generic rustprone check for now. */ - /* fall through */ - default: - if (!obj->oerodeproof && is_rustprone(obj) && - (obj->oeroded < MAX_ERODE) && !rn2(2)) { - pline("%s some%s.", - Yobjnam2(obj, "rust"), - obj->oeroded ? " more" : "what"); - obj->oeroded++; - update_inventory(); - return TRUE; - } - break; - } - pline("%s wet.", Yobjnam2(obj, "get")); - return FALSE; -} - int dodip() { @@ -1756,7 +1664,7 @@ dodip() rider_cant_reach(); /* not skilled enough to reach */ } else { if (obj->otyp == POT_ACID) obj->in_use = 1; - (void) get_wet(obj); + (void) water_damage(obj, 0, TRUE); if (obj->in_use) useup(obj); } return 1; diff --git a/src/trap.c b/src/trap.c index d535fc230..6a5cb3755 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3118,7 +3118,8 @@ boolean force; { boolean loose_obj = (obj && obj->where == OBJ_FREE), exploded = FALSE; - (void) snuff_lit(obj); + if (snuff_lit(obj)) + return 2; if(obj->otyp == CAN_OF_GREASE && obj->spe > 0) { return 0; From b98fd27f9d20b63b2e3d49c52775a771cf90ca9e Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sun, 1 Mar 2015 11:54:40 -0500 Subject: [PATCH 157/354] Merge fire-based erosion to common codepaths. This finally eliminates all direct increases of `oeroded` and `oeroded2` and moves them all to go via `erode_obj()`. They are still manipulated directly in a few places, but not to erode objects. This now merges the `fire_damage()` function to a common codepath, used for items on lava and burning oil, but fire needs more work. There is still a duplication between `destroy_item()` and `fire_damage()`; the two codepaths should eventually be merged in some manner so that there is only one codepath to say "an object was affected by fire". This path might require some parameters, such as whether the fire will just erode objects or burn them outright, but that can happen another day. --- include/extern.h | 5 +- include/hack.h | 3 + include/obj.h | 13 +++ src/do.c | 4 +- src/dokick.c | 3 +- src/fountain.c | 2 +- src/mhitm.c | 2 +- src/mkobj.c | 2 +- src/mon.c | 4 +- src/potion.c | 30 +---- src/spell.c | 3 +- src/trap.c | 294 +++++++++++++++++++++++++++-------------------- src/uhitm.c | 38 +++--- 13 files changed, 226 insertions(+), 177 deletions(-) diff --git a/include/extern.h b/include/extern.h index 4da79874d..0bd3aab7b 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2202,7 +2202,7 @@ E coord *FDECL(gettrack, (int,int)); /* ### trap.c ### */ E boolean FDECL(burnarmor,(struct monst *)); -E boolean FDECL(erode_obj, (struct obj *,const char *,int,BOOLEAN_P,BOOLEAN_P)); +E int FDECL(erode_obj, (struct obj *,const char *,int,int)); E boolean FDECL(grease_protect, (struct obj *,const char *,struct monst *)); E struct trap *FDECL(maketrap, (int,int,int)); E void FDECL(fall_through, (BOOLEAN_P)); @@ -2221,7 +2221,8 @@ E void NDECL(float_up); E void FDECL(fill_pit, (int,int)); E int FDECL(float_down, (long, long)); E void NDECL(climb_pit); -E int FDECL(fire_damage, (struct obj *,BOOLEAN_P,BOOLEAN_P,XCHAR_P,XCHAR_P)); +E boolean FDECL(fire_damage, (struct obj *,BOOLEAN_P,XCHAR_P,XCHAR_P)); +E int FDECL(fire_damage_chain, (struct obj *,BOOLEAN_P,BOOLEAN_P,XCHAR_P,XCHAR_P)); E void acid_damage(struct obj *); E int FDECL(water_damage, (struct obj *,const char*,BOOLEAN_P)); E void FDECL(water_damage_chain, (struct obj *,BOOLEAN_P)); diff --git a/include/hack.h b/include/hack.h index 0ace170e5..7c6af5b18 100644 --- a/include/hack.h +++ b/include/hack.h @@ -99,6 +99,9 @@ #define COST_BITE 13 /* start eating food */ #define COST_OPEN 14 /* open tin */ #define COST_BRKLCK 15 /* break box/chest's lock */ +#define COST_RUST 16 /* rust damage */ +#define COST_ROT 17 /* rotting attack */ +#define COST_CORRODE 18 /* acid damage */ /* bitmask flags for corpse_xname(); PFX_THE takes precedence over ARTICLE, NO_PFX takes precedence over both */ diff --git a/include/obj.h b/include/obj.h index 12b1fce35..fe43d0878 100644 --- a/include/obj.h +++ b/include/obj.h @@ -325,6 +325,19 @@ struct obj { #define ERODE_ROT 2 #define ERODE_CORRODE 3 +/* erosion flags for erode_obj() */ +#define EF_NONE 0 +#define EF_GREASE 0x1 /* check for a greased object */ +#define EF_DESTROY 0x2 /* potentially destroy the object */ +#define EF_VERBOSE 0x4 /* print extra messages */ +#define EF_PAY 0x8 /* it's the player's fault */ + +/* erosion return values for erode_obj(), water_damage() */ +#define ER_NOTHING 0 /* nothing happened */ +#define ER_GREASED 1 /* protected by grease */ +#define ER_DAMAGED 2 /* object was damaged in some way */ +#define ER_DESTROYED 3 /* object was destroyed */ + /* * Notes for adding new oextra structures: * diff --git a/src/do.c b/src/do.c index 319317bf5..30cfb77f1 100644 --- a/src/do.c +++ b/src/do.c @@ -184,7 +184,7 @@ const char *verb; newsym(x,y); return TRUE; } else if (is_lava(x, y)) { - return fire_damage(obj, FALSE, FALSE, x, y); + return fire_damage(obj, FALSE, x, y); } else if (is_pool(x, y)) { /* Reasonably bulky objects (arbitrary) splash when dropped. * If you're floating above the water even small things make @@ -201,7 +201,7 @@ const char *verb; map_background(x, y, 0); newsym(x, y); } - return water_damage(obj, NULL, FALSE) == 3; + return water_damage(obj, NULL, FALSE) == ER_DESTROYED; } else if (u.ux == x && u.uy == y && (t = t_at(x,y)) != 0 && uteetering_at_seen_pit(t)) { if (Blind && !Deaf) diff --git a/src/dokick.c b/src/dokick.c index c399f6bbc..645eb5cf2 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -983,7 +983,8 @@ dokick() if(!rn2(3)) goto ouch; /* make metal boots rust */ if(uarmf && rn2(3)) - if (!water_damage(uarmf, "metal boots", TRUE)) { + if (water_damage(uarmf, "metal boots", TRUE) == + ER_NOTHING) { Your("boots get wet."); /* could cause short-lived fumbling here */ } diff --git a/src/fountain.c b/src/fountain.c index 7de917ad9..482b0ed76 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -402,7 +402,7 @@ register struct obj *obj; if(in_town(u.ux, u.uy)) (void) angry_guards(FALSE); return; - } else if (water_damage(obj, NULL, TRUE)) { + } else if (water_damage(obj, NULL, TRUE) != ER_NOTHING) { if (obj->otyp == POT_ACID) { /* Acid and water don't mix */ useup(obj); return; diff --git a/src/mhitm.c b/src/mhitm.c index 88770c523..6ec4b9833 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1303,7 +1303,7 @@ register struct obj *obj; dmgtyp = ERODE_BURN; else return; - (void) erode_obj(obj, 0, dmgtyp, TRUE, TRUE); + (void) erode_obj(obj, NULL, dmgtyp, EF_GREASE | EF_VERBOSE); } STATIC_OVL void diff --git a/src/mkobj.c b/src/mkobj.c index 5c7cffb7c..ddfa363d4 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -502,7 +502,7 @@ static const char * const alteration_verbs[] = { "cancel", "drain", "uncharge", "unbless", "uncurse", "disenchant", "degrade", "dilute", "erase", "burn", "neutralize", "destroy", "splatter", "bite", "open", - "break the lock on", + "break the lock on", "rust", "rot", "tarnish" }; /* possibly bill for an object which the player has just modified */ diff --git a/src/mon.c b/src/mon.c index 1c2009a0b..f229cd399 100644 --- a/src/mon.c +++ b/src/mon.c @@ -373,8 +373,8 @@ register struct monst *mtmp; pline("%s burns slightly.", Monnam(mtmp)); } if (mtmp->mhp > 0) { - (void) fire_damage(mtmp->minvent, FALSE, FALSE, - mtmp->mx, mtmp->my); + (void) fire_damage_chain(mtmp->minvent, FALSE, FALSE, mtmp->mx, + mtmp->my); (void) rloc(mtmp, FALSE); return 0; } diff --git a/src/potion.c b/src/potion.c index 4c57eaecb..d4bfcdad3 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1088,7 +1088,7 @@ const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */ } else { /* dipping into uncursed water; carried() check skips steed saddle */ if (carried(targobj)) { - if (water_damage(targobj, 0, TRUE)) + if (water_damage(targobj, 0, TRUE) != ER_NOTHING) res = TRUE; } } @@ -1839,38 +1839,14 @@ dodip() } if (potion->otyp == POT_ACID) { - if (erode_obj(obj, 0, ERODE_CORRODE, TRUE, FALSE)) + if (erode_obj(obj, 0, ERODE_CORRODE, EF_GREASE) != ER_NOTHING) goto poof; } if (potion->otyp == POT_OIL) { boolean wisx = FALSE; if (potion->lamplit) { /* burning */ - int omat = objects[obj->otyp].oc_material; - /* the code here should be merged with fire_damage */ - if (catch_lit(obj)) { - /* catch_lit does all the work if true */ - } else if (obj->oerodeproof || obj_resists(obj, 5, 95) || - !is_flammable(obj) || obj->oclass == FOOD_CLASS) { - pline("%s %s to burn for a moment but %s unharmed.", - Yname2(obj), otense(obj, "seem"), otense(obj, "are")); - } else { - if ((omat == PLASTIC || omat == PAPER) && !obj->oartifact) - obj->oeroded = MAX_ERODE; - pline_The("burning oil %s %s%c", - obj->oeroded == MAX_ERODE ? "destroys" : "damages", - yname(obj), - obj->oeroded == MAX_ERODE ? '!' : '.'); - costly_alteration(obj, COST_BURN); - if (obj->oeroded == MAX_ERODE) { - if (obj->owornmask) remove_worn_item(obj, TRUE); - obj_extract_self(obj); - obfree(obj, (struct obj *)0); - obj = (struct obj *) 0; - } else { - obj->oeroded++; - } - } + fire_damage(obj, TRUE, u.ux, u.uy); } else if (potion->cursed) { pline_The("potion spills and covers your %s with oil.", makeplural(body_part(FINGER))); diff --git a/src/spell.c b/src/spell.c index 597d4e606..53b8626f0 100644 --- a/src/spell.c +++ b/src/spell.c @@ -144,7 +144,8 @@ cursed_book(bp) case 5: pline_The("book was coated with contact poison!"); if (uarmg) { - erode_obj(uarmg, "gloves", ERODE_CORRODE, TRUE, TRUE); + erode_obj(uarmg, "gloves", ERODE_CORRODE, + EF_GREASE | EF_VERBOSE); break; } /* temp disable in_use; death should not destroy the book */ diff --git a/src/trap.c b/src/trap.c index 6a5cb3755..77b1f92c4 100644 --- a/src/trap.c +++ b/src/trap.c @@ -55,7 +55,7 @@ struct monst *victim; int mat_idx; if (!victim) return 0; -#define burn_dmg(obj,descr) erode_obj(obj, descr, ERODE_BURN, TRUE, FALSE) +#define burn_dmg(obj,descr) erode_obj(obj, descr, ERODE_BURN, EF_GREASE) while (1) { switch (rn2(5)) { case 0: @@ -101,31 +101,34 @@ struct monst *victim; #undef burn_dmg } -/* Generic erode-item function. Returns TRUE if any change in state - * occurred, or if grease protected the item. +/* Generic erode-item function. * "ostr", if non-null, is an alternate string to print instead of the * object's name. - * "check_grease", if FALSE, means that grease is not checked for - * "print", if set, means to print a message even if no change occurs. + * "type" is an ERODE_* value for the erosion type + * "flags" is an or-ed list of EF_* flags + * + * Returns an erosion return value (ER_*) */ -boolean -erode_obj(otmp, ostr, type, check_grease, print) +int +erode_obj(otmp, ostr, type, ef_flags) register struct obj *otmp; register const char *ostr; int type; -boolean check_grease; -boolean print; +int ef_flags; { static NEARDATA const char * const action[] = { "smoulder", "rust", "rot", "corrode" }; static NEARDATA const char * const msg[] = { "burnt", "rusted", "rotten", "corroded" }; boolean vulnerable = FALSE; boolean is_primary = TRUE; + boolean check_grease = ef_flags & EF_GREASE; + boolean print = ef_flags & EF_VERBOSE; int erosion; struct monst *victim; boolean vismon; boolean visobj; + int cost_type; - if (!otmp) return(FALSE); + if (!otmp) return ER_NOTHING; victim = carried(otmp) ? &youmonst : mcarried(otmp) ? otmp->ocarry : NULL; @@ -137,22 +140,26 @@ boolean print; case ERODE_BURN: vulnerable = is_flammable(otmp); check_grease = FALSE; + cost_type = COST_BURN; break; case ERODE_RUST: vulnerable = is_rustprone(otmp); + cost_type = COST_RUST; break; case ERODE_ROT: vulnerable = is_rottable(otmp); check_grease = FALSE; is_primary = FALSE; + cost_type = COST_ROT; break; case ERODE_CORRODE: vulnerable = is_corrodeable(otmp); is_primary = FALSE; + cost_type = COST_CORRODE; break; default: impossible("Invalid erosion type in erode_obj"); - return FALSE; + return ER_NOTHING; } erosion = is_primary ? otmp->oeroded : otmp->oeroded2; @@ -161,7 +168,7 @@ boolean print; if (check_grease && otmp->greased) { grease_protect(otmp, ostr, victim); - return TRUE; + return ER_GREASED; } else if (!vulnerable || (otmp->oerodeproof && otmp->rknown)) { if (print && flags.verbose) { if (victim == &youmonst) @@ -170,7 +177,7 @@ boolean print; pline("%s %s %s not affected.", s_suffix(Monnam(victim)), ostr, vtense(ostr, "are")); } - return FALSE; + return ER_NOTHING; } else if (otmp->oerodeproof || (otmp->blessed && !rnl(4))) { if (flags.verbose && (print || otmp->oerodeproof)) { if (victim == &youmonst) @@ -188,9 +195,13 @@ boolean print; * is blessed, it still shows some minor signs of wear, and * the hero can distinguish this from an object that is * actually proof against damage. */ - if (otmp->oerodeproof) + if (otmp->oerodeproof) { otmp->rknown = TRUE; - return FALSE; + if (victim == &youmonst) + update_inventory(); + } + + return ER_NOTHING; } else if (erosion < MAX_ERODE) { const char *adverb = (erosion + 1 == MAX_ERODE) ? " completely" : erosion ? " further" : ""; @@ -198,19 +209,39 @@ boolean print; if (victim == &youmonst) Your("%s %s%s!", ostr, vtense(ostr, action[type]), adverb); else if (vismon) - pline("%s's %s %s%s!", Monnam(victim), ostr, + pline("%s %s %s%s!", s_suffix(Monnam(victim)), ostr, vtense(ostr, action[type]), adverb); else if (visobj) pline("The %s %s%s!", ostr, vtense(ostr, action[type]), adverb); + if (ef_flags & EF_PAY) + costly_alteration(otmp, cost_type); + if (is_primary) otmp->oeroded++; else otmp->oeroded2++; - update_inventory(); - return TRUE; - } else { + if (victim == &youmonst) + update_inventory(); + + return ER_DAMAGED; + } else if (ef_flags & EF_DESTROY) { + if (victim == &youmonst) + Your("%s %s away!", ostr, vtense(ostr, action[type])); + else if (vismon) + pline("%s %s %s away!", s_suffix(Monnam(victim)), ostr, + vtense(ostr, action[type])); + else if (visobj) + pline("The %s %s away!", ostr, vtense(ostr, action[type])); + + if (ef_flags & EF_PAY) + costly_alteration(otmp, cost_type); + + setnotworn(otmp); + delobj(otmp); + return ER_DESTROYED; + } else { if (flags.verbose && print) { if (victim == &youmonst) Your("%s %s completely %s.", ostr, @@ -224,7 +255,7 @@ boolean print; pline("The %s %s completely %s.", ostr, vtense(ostr, "look"), msg[type]); } - return FALSE; + return ER_NOTHING; } } @@ -952,7 +983,7 @@ unsigned trflags; case 1: pline("%s your left %s!", A_gush_of_water_hits, body_part(ARM)); - if (water_damage(uarms, "shield", TRUE)) + if (water_damage(uarms, "shield", TRUE) != ER_NOTHING) break; if (u.twoweap || (uwep && bimanual(uwep))) (void) water_damage(u.twoweap ? uswapwep : uwep, 0, @@ -2097,7 +2128,7 @@ register struct monst *mtmp; pline("%s %s's left %s!", A_gush_of_water_hits, mon_nam(mtmp), mbodypart(mtmp, ARM)); target = which_armor(mtmp, W_ARMS); - if (water_damage(target, "shield", TRUE)) + if (water_damage(target, "shield", TRUE) != ER_NOTHING) break; target = MON_WEP(mtmp); if (target && bimanual(target)) @@ -2972,104 +3003,118 @@ domagictrap() } } -/* - * Scrolls, spellbooks, potions, and flammable items - * may get affected by the fire. +/* Set an item on fire. + * "force" means not to roll a luck-based protection check for the + * item. + * "x" and "y" are the coordinates to dump the contents of a + * container, if it burns up. * - * Return number of objects destroyed. --ALI + * Return whether the object was destroyed. */ -int -fire_damage(chain, force, here, x, y) -struct obj *chain; -boolean force, here; +boolean +fire_damage(obj, force, x, y) +struct obj *obj; +boolean force; xchar x, y; { int chance; - struct obj *obj, *otmp, *nobj, *ncobj; + struct obj *otmp, *ncobj; int retval = 0; int in_sight = !Blind && couldsee(x, y); /* Don't care if it's lit */ int dindx; + /* object might light in a controlled manner */ + if (catch_lit(obj)) + return FALSE; + + if (Is_container(obj)) { + switch (obj->otyp) { + case ICE_BOX: + return FALSE; /* Immune */ + case CHEST: + chance = 40; + break; + case LARGE_BOX: + chance = 30; + break; + default: + chance = 20; + break; + } + if ((!force && (Luck + 5) > rn2(chance)) || + (is_flammable(obj) && obj->oerodeproof)) + return FALSE; + /* Container is burnt up - dump contents out */ + if (in_sight) pline("%s catches fire and burns.", Yname2(obj)); + if (Has_contents(obj)) { + if (in_sight) pline("Its contents fall out."); + for (otmp = obj->cobj; otmp; otmp = ncobj) { + ncobj = otmp->nobj; + obj_extract_self(otmp); + if (!flooreffects(otmp, x, y, "")) + place_object(otmp, x, y); + } + } + setnotworn(obj); + delobj(obj); + return TRUE; + } else if (!force && (Luck + 5) > rn2(20)) { + /* chance per item of sustaining damage: + * max luck (Luck==13): 10% + * avg luck (Luck==0): 75% + * awful luck (Luck<-4): 100% + */ + return FALSE; + } else if (obj->oclass == SCROLL_CLASS || obj->oclass == SPBOOK_CLASS) { + if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL) + return FALSE; + if (obj->otyp == SPE_BOOK_OF_THE_DEAD) { + if (in_sight) pline("Smoke rises from %s.", the(xname(obj))); + return FALSE; + } + dindx = (obj->oclass == SCROLL_CLASS) ? 3 : 4; + if (in_sight) + pline("%s %s.", Yname2(obj), + destroy_strings[dindx][(obj->quan > 1L)]); + setnotworn(obj); + delobj(obj); + return TRUE; + } else if (obj->oclass == POTION_CLASS) { + dindx = (obj->otyp != POT_OIL) ? 1 : 2; + if (in_sight) + pline("%s %s.", Yname2(obj), + destroy_strings[dindx][(obj->quan > 1L)]); + setnotworn(obj); + delobj(obj); + return TRUE; + } else if (erode_obj(obj, NULL, ERODE_BURN, EF_DESTROY) == ER_DESTROYED) { + return TRUE; + } + return FALSE; +} + +/* + * Apply fire_damage() to an entire chain. + * + * Return number of objects destroyed. --ALI + */ +int +fire_damage_chain(chain, force, here, x, y) +struct obj *chain; +boolean force, here; +xchar x, y; +{ + struct obj *obj, *nobj; + int num = 0; for (obj = chain; obj; obj = nobj) { nobj = here ? obj->nexthere : obj->nobj; - - /* object might light in a controlled manner */ - if (catch_lit(obj)) - continue; - - if (Is_container(obj)) { - switch (obj->otyp) { - case ICE_BOX: - continue; /* Immune */ - /*NOTREACHED*/ - break; - case CHEST: - chance = 40; - break; - case LARGE_BOX: - chance = 30; - break; - default: - chance = 20; - break; - } - if ((!force && (Luck + 5) > rn2(chance)) || - (is_flammable(obj) && obj->oerodeproof)) - continue; - /* Container is burnt up - dump contents out */ - if (in_sight) pline("%s catches fire and burns.", Yname2(obj)); - if (Has_contents(obj)) { - if (in_sight) pline("Its contents fall out."); - for (otmp = obj->cobj; otmp; otmp = ncobj) { - ncobj = otmp->nobj; - obj_extract_self(otmp); - if (!flooreffects(otmp, x, y, "")) - place_object(otmp, x, y); - } - } - delobj(obj); - retval++; - } else if (!force && (Luck + 5) > rn2(20)) { - /* chance per item of sustaining damage: - * max luck (Luck==13): 10% - * avg luck (Luck==0): 75% - * awful luck (Luck<-4): 100% - */ - continue; - } else if (obj->oclass == SCROLL_CLASS || obj->oclass == SPBOOK_CLASS) { - if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL) - continue; - if (obj->otyp == SPE_BOOK_OF_THE_DEAD) { - if (in_sight) pline("Smoke rises from %s.", the(xname(obj))); - continue; - } - dindx = (obj->oclass == SCROLL_CLASS) ? 3 : 4; - if (in_sight) - pline("%s %s.", Yname2(obj), - destroy_strings[dindx][(obj->quan > 1L)]); - delobj(obj); - retval++; - } else if (obj->oclass == POTION_CLASS) { - dindx = (obj->otyp != POT_OIL) ? 1 : 2; - if (in_sight) - pline("%s %s.", Yname2(obj), - destroy_strings[dindx][(obj->quan > 1L)]); - delobj(obj); - retval++; - } else if (is_flammable(obj) && obj->oeroded < MAX_ERODE && - !(obj->oerodeproof || (obj->blessed && !rnl(4)))) { - if (in_sight) { - pline("%s %s%s.", Yname2(obj), otense(obj, "burn"), - obj->oeroded+1 == MAX_ERODE ? " completely" : - obj->oeroded ? " further" : ""); - } - obj->oeroded++; - } + if (fire_damage(obj, force, x, y)) + ++num; } - if (retval && !in_sight) + if (num && (Blind && !couldsee(x, y))) You("smell smoke."); - return retval; + return num; } void @@ -3101,14 +3146,14 @@ struct obj *obj; obj->spe = 0; obj->dknown = 0; } else - erode_obj(obj, NULL, ERODE_CORRODE, TRUE, TRUE); + erode_obj(obj, NULL, ERODE_CORRODE, EF_GREASE | EF_VERBOSE); } -/* returns: - * 0 if obj is unaffected - * 1 if obj is protected by grease - * 2 if obj is changed but survived - * 3 if obj is destroyed +/* Get an object wet and damage it appropriately. + * "ostr", if present, is used instead of the object name in some + * messages. + * "force" means not to roll luck to protect some objects. + * Returns an erosion return value (ER_*) */ int water_damage(obj, ostr, force) @@ -3119,25 +3164,25 @@ boolean force; boolean loose_obj = (obj && obj->where == OBJ_FREE), exploded = FALSE; if (snuff_lit(obj)) - return 2; + return ER_DAMAGED; if(obj->otyp == CAN_OF_GREASE && obj->spe > 0) { - return 0; + return ER_NOTHING; } else if(obj->greased) { if (!rn2(2)) obj->greased = 0; if (carried(obj)) update_inventory(); - return 1; + return ER_GREASED; } else if(Is_container(obj) && !Is_box(obj) && (obj->otyp != OILSKIN_SACK || (obj->cursed && !rn2(3)))) { water_damage_chain(obj->cobj, FALSE); - return 0; + return ER_NOTHING; } else if (!force && (Luck + 5) > rn2(20)) { /* chance per item of sustaining damage: * max luck: 10% * avg luck (Luck==0): 75% * awful luck (Luck<-4): 100% */ - return 0; + return ER_NOTHING; } else if (obj->oclass == SCROLL_CLASS) { #ifdef MAIL if (obj->otyp == SCR_MAIL) return 0; @@ -3147,7 +3192,7 @@ boolean force; obj->spe = 0; if (carried(obj)) update_inventory(); - return 2; + return ER_DAMAGED; } else if (obj->oclass == SPBOOK_CLASS) { if (obj->otyp == SPE_BOOK_OF_THE_DEAD) { pline("Steam rises from %s.", the(xname(obj))); @@ -3157,7 +3202,7 @@ boolean force; obj->dknown = 0; if (carried(obj)) update_inventory(); - return 2; + return ER_DAMAGED; } else if (obj->oclass == POTION_CLASS) { if (obj->otyp == POT_ACID) { char *bufp, buf[BUFSZ]; @@ -3177,10 +3222,11 @@ boolean force; obj_extract_self() takes care of this; for loose_obj, obj should always equal *objp and otmp should always be null] */ + setnotworn(obj); delobj(obj); if (update) update_inventory(); - return 3; + return ER_DESTROYED; } else if (obj->odiluted) { obj->otyp = POT_WATER; obj->dknown = 0; @@ -3188,17 +3234,17 @@ boolean force; obj->odiluted = 0; if (carried(obj)) update_inventory(); - return 2; + return ER_DAMAGED; } else if (obj->otyp != POT_WATER) { obj->odiluted++; if (carried(obj)) update_inventory(); - return 2; + return ER_DAMAGED; } } else { - return erode_obj(obj, ostr, ERODE_RUST, FALSE, FALSE) ? 2 : 0; + return erode_obj(obj, ostr, ERODE_RUST, EF_NONE); } - return 0; + return ER_NOTHING; } void diff --git a/src/uhitm.c b/src/uhitm.c index b594fd863..21de567e5 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -47,34 +47,38 @@ int hurt; switch(rn2(5)) { case 0: target = which_armor(mdef, W_ARMH); - if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE)) + if (!target || + erode_obj(target, xname(target), hurt, EF_GREASE) == ER_NOTHING) continue; break; case 1: target = which_armor(mdef, W_ARMC); if (target) { - (void)erode_obj(target, xname(target), hurt, TRUE, TRUE); + (void)erode_obj(target, xname(target), hurt, EF_GREASE | EF_VERBOSE); break; } if ((target = which_armor(mdef, W_ARM)) != (struct obj *)0) { - (void)erode_obj(target, xname(target), hurt, TRUE, TRUE); + (void)erode_obj(target, xname(target), hurt, EF_GREASE | EF_VERBOSE); } else if ((target = which_armor(mdef, W_ARMU)) != (struct obj *)0) { - (void)erode_obj(target, xname(target), hurt, TRUE, TRUE); + (void)erode_obj(target, xname(target), hurt, EF_GREASE | EF_VERBOSE); } break; case 2: target = which_armor(mdef, W_ARMS); - if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE)) + if (!target || + erode_obj(target, xname(target), hurt, EF_GREASE) == ER_NOTHING) continue; break; case 3: target = which_armor(mdef, W_ARMG); - if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE)) + if (!target || + erode_obj(target, xname(target), hurt, EF_GREASE) == ER_NOTHING) continue; break; case 4: target = which_armor(mdef, W_ARMF); - if (!target || !erode_obj(target, xname(target), hurt, TRUE, FALSE)) + if (!target || + erode_obj(target, xname(target), hurt, EF_GREASE) == ER_NOTHING) continue; break; } @@ -2222,7 +2226,8 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf && !rn2(6)) - (void)erode_obj(uarmf, xname(uarmf), ERODE_BURN, TRUE, TRUE); + (void)erode_obj(uarmf, xname(uarmf), ERODE_BURN, + EF_GREASE | EF_VERBOSE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2242,7 +2247,8 @@ boolean wep_was_destroyed; if (mhit) { if (aatyp == AT_KICK) { if (uarmf && !rn2(6)) - (void)erode_obj(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE); + (void)erode_obj(uarmf, xname(uarmf), ERODE_CORRODE, + EF_GREASE | EF_VERBOSE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2275,7 +2281,8 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf) - (void)erode_obj(uarmf, xname(uarmf), ERODE_RUST, TRUE, TRUE); + (void)erode_obj(uarmf, xname(uarmf), ERODE_RUST, + EF_GREASE | EF_VERBOSE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2285,7 +2292,8 @@ boolean wep_was_destroyed; if(mhit && !mon->mcan) { if (aatyp == AT_KICK) { if (uarmf) - (void)erode_obj(uarmf, xname(uarmf), ERODE_CORRODE, TRUE, TRUE); + (void)erode_obj(uarmf, xname(uarmf), ERODE_CORRODE, + EF_GREASE | EF_VERBOSE); } else if (aatyp == AT_WEAP || aatyp == AT_CLAW || aatyp == AT_MAGC || aatyp == AT_TUCH) passive_obj(mon, (struct obj*)0, &(ptr->mattk[i])); @@ -2446,22 +2454,22 @@ struct attack *mattk; /* null means we find one internally */ case AD_FIRE: if(!rn2(6) && !mon->mcan) { - (void) erode_obj(obj, 0, ERODE_BURN, FALSE, FALSE); + (void) erode_obj(obj, NULL, ERODE_BURN, EF_NONE); } break; case AD_ACID: if(!rn2(6)) { - (void) erode_obj(obj, 0, ERODE_CORRODE, FALSE, FALSE); + (void) erode_obj(obj, NULL, ERODE_CORRODE, EF_NONE); } break; case AD_RUST: if(!mon->mcan) { - (void) erode_obj(obj, 0, ERODE_RUST, FALSE, FALSE); + (void) erode_obj(obj, NULL, ERODE_RUST, EF_NONE); } break; case AD_CORR: if(!mon->mcan) { - (void) erode_obj(obj, 0, ERODE_CORRODE, FALSE, FALSE); + (void) erode_obj(obj, NULL, ERODE_CORRODE, EF_NONE); } break; case AD_ENCH: From b4fa80ec7d3dc77c5f4fab767248dfb39f957136 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sun, 1 Mar 2015 12:02:38 -0500 Subject: [PATCH 158/354] Print lava item destructions only if surviving. This partially reverts commit 72c2ae233d35076adece2e8d02a7f8839e4a5aa8 in order to prevent players from using hangups during the destruction messages to save themselves. --- src/trap.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/trap.c b/src/trap.c index 77b1f92c4..7efe8db00 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 trap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 trap.c $NHDT-Date: 1425318721 2015/03/02 17:52:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.194 $ */ /* NetHack 3.5 trap.c $Date: 2013/03/14 01:58:21 $ $Revision: 1.179 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -4737,6 +4737,9 @@ lava_effects() } else You("fall into the lava!"); + usurvive = Lifesaved || discover; + if (wizard) usurvive = TRUE; + /* prevent remove_worn_item() -> Boots_off(WATER_WALKING_BOOTS) -> spoteffects() -> lava_effects() recursion which would successfully delete (via useupall) the no-longer-worn boots; @@ -4748,16 +4751,18 @@ lava_effects() obj2 = obj->nobj; /* above, we set in_use for objects which are to be destroyed */ if (obj->otyp == SPE_BOOK_OF_THE_DEAD && !Blind) { - pline("%s glows a strange %s, but remains intact.", - The(xname(obj)), hcolor("dark red")); + if (usurvive) + pline("%s glows a strange %s, but remains intact.", + The(xname(obj)), hcolor("dark red")); } else if (obj->in_use) { if (obj->owornmask) { - pline("%s into flame!", Yobjnam2(obj, "burst")); + if (usurvive) + pline("%s into flame!", Yobjnam2(obj, "burst")); remove_worn_item(obj, TRUE); } useupall(obj); } - } + } iflags.in_lava_effects--; From 019b24005f522dcd3036650a546874596bd3aaa5 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 2 Mar 2015 20:10:18 +0200 Subject: [PATCH 159/354] Sanitize petnames and fruit to prevent escape codes --- doc/fixes35.0 | 1 + src/options.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index d3f6b1a90..1e31bf65a 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -865,6 +865,7 @@ all sources of erosion now affect objects the same way passive attacks no longer erode armor covered by other armor dipping a fooproof item into acid no longer forgets that it's fooproof dipping a container into uncursed water now gets its contents wet +sanitize petnames and fruit to prevent escape codes Platform- and/or Interface-Specific Fixes ----------------------------------------- diff --git a/src/options.c b/src/options.c index 54ad99efc..229c2df91 100644 --- a/src/options.c +++ b/src/options.c @@ -1300,6 +1300,7 @@ boolean tinitial, tfrom_file; if (negated) bad_negation(fullname, FALSE); else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) nmcpy(catname, op, PL_PSIZ); + sanitize_name(catname); return; } @@ -1309,6 +1310,7 @@ boolean tinitial, tfrom_file; if (negated) bad_negation(fullname, FALSE); else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) nmcpy(dogname, op, PL_PSIZ); + sanitize_name(dogname); return; } @@ -1318,6 +1320,7 @@ boolean tinitial, tfrom_file; if (negated) bad_negation(fullname, FALSE); else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) nmcpy(horsename, op, PL_PSIZ); + sanitize_name(horsename); return; } @@ -1662,6 +1665,7 @@ boolean tinitial, tfrom_file; } goodfruit: nmcpy(pl_fruit, op, PL_FSIZ); + sanitize_name(pl_fruit); /* OBJ_NAME(objects[SLIME_MOLD]) won't work after initialization */ if (!*pl_fruit) nmcpy(pl_fruit, "slime mold", PL_FSIZ); From a6e89b01d299eeb061c440cfdb5a49027b8ed524 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 2 Mar 2015 20:21:34 +0200 Subject: [PATCH 160/354] Fix segfault when MD termcap is not defined --- win/tty/termcap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/win/tty/termcap.c b/win/tty/termcap.c index 563491c48..b06a9abfe 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -847,6 +847,7 @@ init_hilite() hilites[CLR_GRAY] = hilites[NO_COLOR] = (char *)0; if (tgetnum("Co") < 8 + || (MD == NULL) || (strlen(MD) == 0) || ((setf = tgetstr("AF", (char **)0)) == (char *)0 && (setf = tgetstr("Sf", (char **)0)) == (char *)0)) return; From f8baf4bd8ee5639faf5ee6a9ee46ea88bbcd3d85 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Mon, 2 Mar 2015 13:11:24 -0500 Subject: [PATCH 161/354] Make a few fixes to code that was confusing indent --- src/dog.c | 18 +++++++----------- src/end.c | 2 +- src/mon.c | 3 ++- sys/msdos/pctiles.c | 4 ++-- sys/msdos/vidvga.c | 9 +++++---- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/dog.c b/src/dog.c index ff7dd525d..d8ab09e4f 100644 --- a/src/dog.c +++ b/src/dog.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 dog.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dog.c $NHDT-Date: 1425319883 2015/03/02 18:11:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.39 $ */ /* NetHack 3.5 dog.c $Date: 2011/04/15 01:55:42 $ $Revision: 1.37 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -295,16 +295,12 @@ boolean with_you; num_segs = mtmp->wormno; /* baby long worms have no tail so don't use is_longworm() */ - if ((mtmp->data == &mons[PM_LONG_WORM]) && -#ifdef DCC30_BUG - (mtmp->wormno = get_wormno(), mtmp->wormno != 0)) -#else - (mtmp->wormno = get_wormno()) != 0) -#endif - { - initworm(mtmp, num_segs); - /* tail segs are not yet initialized or displayed */ - } else mtmp->wormno = 0; + if (mtmp->data == &mons[PM_LONG_WORM]) { + mtmp->wormno = get_wormno(); + if (mtmp->wormno) + initworm(mtmp, num_segs); + } else + mtmp->wormno = 0; /* some monsters might need to do something special upon arrival _after_ the current level has been fully set up; see dochug() */ diff --git a/src/end.c b/src/end.c index f7e7f5ec3..995ef8ec7 100644 --- a/src/end.c +++ b/src/end.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 end.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 end.c $NHDT-Date: 1425319883 2015/03/02 18:11:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.81 $ */ /* NetHack 3.5 end.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.79 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ diff --git a/src/mon.c b/src/mon.c index f229cd399..82457199a 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mon.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mon.c $NHDT-Date: 1425319883 2015/03/02 18:11:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.137 $ */ /* NetHack 3.5 mon.c $Date: 2012/05/16 02:15:10 $ $Revision: 1.126 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -32,6 +32,7 @@ STATIC_DCL struct permonst *FDECL(accept_newcham_form, (int)); /* part of the original warning code which was replaced in 3.3.1 */ const char *warnings[] = { "white", "pink", "red", "ruby", "purple", "black" +}; #endif /* 0 */ STATIC_DCL struct obj *FDECL(make_corpse,(struct monst *, unsigned)); diff --git a/sys/msdos/pctiles.c b/sys/msdos/pctiles.c index e60c26f7a..fb294067a 100644 --- a/sys/msdos/pctiles.c +++ b/sys/msdos/pctiles.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 pctiles.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pctiles.c $NHDT-Date: 1425319883 2015/03/02 18:11:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.5 $ */ /* NetHack 3.5 pctiles.c $Date: 2009/05/06 10:49:39 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)pctiles.c 3.5 1995/07/31 */ /* Copyright (c) NetHack PC Development Team 1993, 1994 */ @@ -241,7 +241,7 @@ char (*pta)[TILE_X]; long fpos; fpos = ((long)(tilenum) * (long)(TILE_Y * TILE_X) + - (long)TIBHEADER_SIZE; + (long)TIBHEADER_SIZE); if (fseek(tilefile,fpos,SEEK_SET)) { return 1; } else { diff --git a/sys/msdos/vidvga.c b/sys/msdos/vidvga.c index 0784cf007..e93810fea 100644 --- a/sys/msdos/vidvga.c +++ b/sys/msdos/vidvga.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 vidvga.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 vidvga.c $NHDT-Date: 1425319884 2015/03/02 18:11:24 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */ /* NetHack 3.5 vidvga.c $Date: 2009/05/06 10:49:50 $ $Revision: 1.9 $ */ /* SCCS Id: @(#)vidvga.c 3.5 2006/07/08 */ /* Copyright (c) NetHack PC Development Team 1995 */ @@ -627,12 +627,13 @@ boolean left; for (y = 0; y < ROWNO; ++y) { for (x = i; x < j; x += 2) { t = map[y][x].glyph; - if (!ReadPlanarTileFile(glyph2tile[t], &planecell)) + if (!ReadPlanarTileFile(glyph2tile[t], &planecell)) { if (map[y][x].special) decal_planar(planecell, map[y][x].special); vga_DisplayCell(planecell, x - clipx, y + TOP_MAP_ROW); - else + } else { pline("vga_shiftmap: Error reading tile (%d,%d)", - t, glyph2tile[t]); + t, glyph2tile[t]); + } } } } From ff7230a15910ade480898f76251b6902cfe473a8 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 2 Mar 2015 20:34:25 +0200 Subject: [PATCH 162/354] Fix TTY crashing when a location has more than 32k items --- include/wintty.h | 12 ++++++------ win/tty/wintty.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/wintty.h b/include/wintty.h index 507804a9f..76007ed3f 100644 --- a/include/wintty.h +++ b/include/wintty.h @@ -29,9 +29,9 @@ struct WinDesc { xchar type; /* type of window */ boolean active; /* true if window is active */ short offx, offy; /* offset from topleft of display */ - short rows, cols; /* dimensions */ - short curx, cury; /* current cursor position */ - short maxrow, maxcol; /* the maximum size used -- for MENU wins */ + long rows, cols; /* dimensions */ + long curx, cury; /* current cursor position */ + long maxrow, maxcol; /* the maximum size used -- for MENU wins */ /* maxcol is also used by WIN_MESSAGE for */ /* tracking the ^P command */ short *datlen; /* allocation size for *data */ @@ -39,9 +39,9 @@ struct WinDesc { char *morestr; /* string to display instead of default */ tty_menu_item *mlist; /* menu information (MENU) */ tty_menu_item **plist; /* menu page pointers (MENU) */ - short plist_size; /* size of allocated plist (MENU) */ - short npages; /* number of pages in menu (MENU) */ - short nitems; /* total number of items (MENU) */ + long plist_size; /* size of allocated plist (MENU) */ + long npages; /* number of pages in menu (MENU) */ + long nitems; /* total number of items (MENU) */ short how; /* menu mode - pick 1 or N (MENU) */ char menu_ch; /* menu char (MENU) */ }; diff --git a/win/tty/wintty.c b/win/tty/wintty.c index a526897b7..67b0243d4 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1997,7 +1997,7 @@ tty_putstr(window, attr, str) register struct WinDesc *cw = 0; register char *ob; register const char *nb; - register int i, j, n0; + register long i, j, n0; /* Assume there's a real problem if the window is missing -- * probably a panic message @@ -2375,7 +2375,7 @@ tty_end_menu(window, prompt) if (cw->npages > 1) { char buf[QBUFSZ]; /* produce the largest demo string */ - Sprintf(buf, "(%d of %d) ", cw->npages, cw->npages); + Sprintf(buf, "(%ld of %ld) ", cw->npages, cw->npages); len = strlen(buf); cw->morestr = copy_of(""); } else { From 9de92d55dc537706aeeb0bd13b04dd1b852ea0d6 Mon Sep 17 00:00:00 2001 From: keni Date: Mon, 2 Mar 2015 16:32:29 -0500 Subject: [PATCH 163/354] Fix NHtext when GIT_DIR is not defined. --- DEVEL/hooksdir/NHtext | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DEVEL/hooksdir/NHtext b/DEVEL/hooksdir/NHtext index 861b9e6b1..0cc065db3 100755 --- a/DEVEL/hooksdir/NHtext +++ b/DEVEL/hooksdir/NHtext @@ -15,6 +15,13 @@ use strict; sub git_config { my($section, $var) = @_; local($_); + # Sigh. Without GIT_DIR we have to do it the slow way, and sometimes we don't + # have GIT_DIR. + if(0 == length($ENV{GIT_DIR})){ + my $raw = `git config --local --get $section.$var`; + chomp($raw); + return $raw + } open(CONFIG, "<", "$ENV{GIT_DIR}/config") or die "Missing .git/config: $!"; while(){ m/^\[$section]/ && do { From dcd32997239980f1f2b1c22fe979547f364e6f86 Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 3 Mar 2015 20:13:51 -0500 Subject: [PATCH 164/354] Updated README On 3/1/2015 10:37 AM, coppro wrote: > >> Sun SPARC based machine running SunOS 4.x, Solaris 2.x, or > Solaris 7 > > By release time, I should have access to a BSD flavour installed on a SPARC > machine. Would out be helpful for me to do cursory tests? On 3/1/2015 10:41 AM, lorimer wrote: > I have access to a Borland environment too, so I'll be > borrowing that at some point. [Just not soon.] I didn't include the above, just in case they don't happen. The README can, of course, be updated again once they have been tried. --- README | 162 +++++++++++++++++++++++---------------------------------- 1 file changed, 64 insertions(+), 98 deletions(-) diff --git a/README b/README index e38bf2e83..1d4b8063d 100644 --- a/README +++ b/README @@ -1,18 +1,27 @@ - NetHack 3.5.0 -- General information + NetHack 3.6.0 -- General information -NetHack 3.5 is an enhancement to the dungeon exploration game NetHack. +NetHack 3.6 is an enhancement to the dungeon exploration game NetHack. It is a distant descendent of Rogue and Hack, and a direct descendent of -NetHack 3.4. +NetHack 3.4. In order to avoid confusion with interim development code +that was posted online in 2014 by others, there is no NetHack 3.5 release. -NetHack 3.5.0 has many new features. - * List new features here +NetHack 3.6.0 contains some code reorganization, new features, and bugfixes. -A fuller list of changes for this release can be found in the file -doc/fixes35.0 in the source distribution. The text in there was written -for the development team's own use and is provided "as is", so please do -not ask us to further explain the entries in that file. +The file doc/fixes36.0 in the source disribution has a full list of each. +The text in there was written for the development team's own use and is +provided "as is", so please do not ask us to further explain the entries +in that file. Some entries might be considered "spoilers", particularly +in the "new features" section. + +Here are some additional general notes that are not considered spoilers: + * Some code paths and long-established game features have been made + part of the base build and no longer conditional on compile settings. + * Save files and bones files should be compatible across platforms and + machine architectures. + * The following treasured NetHack community patches, or a variation of + them, have been rolled in to the base NetHack source tree: menucolors, + pickup thrown, statue glyphs, . -If you are a developer, please see the file DEVEL/Developer.txt. - - - - - - - - - - - Please read items (1), (2) and (3) BEFORE doing anything with your new code. @@ -21,64 +30,28 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. directory as the 'Top' directory. It makes no difference what you call it. -2. If there is no flaw in the packaging, many sub-directories will be - automatically created, and files will be deposited in them: +2. Having unpacked, you should have a file called 'Files' in your Top + directory. - a. A 'dat' directory, which contains a variety of data files. - b. A 'doc' directory, which contains various documentation. - c. An 'include' directory, which contains *.h files. - d. A 'src' directory, which contains game *.c files used by all versions. - e. A 'util' directory, which contains files for utility programs. - f. A 'sys' directory, which contains subdirectories for files that - are operating-system specific. - g. A 'sys/share' subdirectory, which contains files shared by some OSs. - h. A 'sys/share/sounds' subsubdirectory, which contains sound files - shared by some OSs. - i. A 'sys/amiga' subdirectory, which contains files specific to AmigaDOS. - j. A 'sys/atari' subdirectory, which contains files specific to TOS. - k. A 'sys/be' subdirectory, which contains files specific to Be OS. - l. A 'sys/mac' subdirectory, which contains files specific to MacOS. - m. A 'sys/msdos' subdirectory, which contains files specific to MS-DOS. - n. A 'sys/os2' subdirectory, which contains files specific to OS/2. - o. A 'sys/unix' subdirectory, which contains files specific to UNIX. - p. A 'sys/vms' subdirectory, which contains files specific to VMS. - q. A 'sys/wince' subdirectory, which contains files specific to Windows CE. - r. A 'sys/wince/ceinc' subdirectory; header files for Windows CE - s. A 'sys/wince/ceinc/sys' subdirectory; ditto - t. A 'sys/winnt' subdirectory, which contains files specific to Windows NT. - u. A 'win' directory, which contains subdirectories for files that - are windowing-system specific (but not operating-system specific). - v. A 'win/share' subdirectory, which contains files shared by some - windowing systems. - w. A 'win/Qt' subdirectory, which contains files specific to Qt. - x. A 'win/X11' subdirectory, which contains files specific to X11. - y. A 'win/gem' subdirectory, which contains files specific to GEM. - z. A 'win/gnome' subdirectory, which contains files specific to GNOME. - A. A 'win/tty' subdirectory, which contains files specific to ttys. - B. A 'win/win32' subdirectory, which contains files specific to the - Windows Win32 API. - C. A 'DEVEL' directory, which contains files for NetHack developers. - - The names of these directories should not be changed unless you are - ready to go through the makefiles and the makedefs program and change - all the directory references in them. - -3. Having unpacked, you should have a file called 'Files' in your Top - directory. This file contains the list of all the files you now SHOULD + This file contains the list of all the files you now SHOULD have in each directory. Please check the files in each directory against this list to make sure that you have a complete set. -4. Before you do anything else, please read carefully the file called + This file also contains a list of what files are created during + the build process. + + The names of the directories listed should not be changed unless you + are ready to go through the makefiles and the makedefs program and change + all the directory references in them. + +3. Before you do anything else, please read carefully the file called "license" in the 'dat' subdirectory. It is expected that you comply with the terms of that license, and we are very serious about it. -5. If everything is in order, you can now turn to trying to get the program +4. If everything is in order, you can now turn to trying to get the program to compile and run on your particular system. It is worth mentioning that the default configuration is SysV/Sun/Solaris2.x (simply because - the code was housed on such a system). It is also worth mentioning - here that NetHack 3.5 is a huge program. If you intend to run it on a - small machine, you'll have to make hard choices among the options - available in config.h. + the code was housed on such a system). The files sys/*/Install.* were written to guide you in configuring the program for your operating system. The files win/*/Install.* are @@ -86,21 +59,21 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. for particular windowing environments. Reading them, and the man pages, should answer most of your questions. - At the time of this release, NetHack 3.5 is known to run/compile on: + At the time of this release, NetHack 3.6 has been tested to run/compile on: - Intel 80386 or greater (or clone) boxes running Linux, BSDI, or - Windows NT/XP/2000/2003/2008 - Intel Pentium or better (or clone) running BeOS 4.5 + Intel Pentium or better (or clone) running Linux, BSDI, or + Windows (XP through 8.1) + Intel 80386 or greater (or clone) boxes running Linux, or BSDI Sun SPARC based machine running SunOS 4.x, Solaris 2.x, or Solaris 7 + Mac OS X 10.9 should be added to the list. - - Previous versions of NetHack were tested on the following systems, - and with a little work we expect that NetHack 3.5 will work on them - as well: + Previous versions of NetHack were tested and known to run on the + following systems, but it is unknown if they can still build and + execute NetHack 3.6: Apple Macintosh running MacOS 7.5 or higher, LinuxPPC, BeOS 4.0 Atari ST/TT/Falcon running TOS (or MultiTOS) with GCC - AT&T 3B1 running System V (3.51) + AT&T 3B1 running System V (3.61) AT&T 3B2/600 & 3B2/622 running System V R3.2.1 AT&T 3B2/1000 Model 80 running System V R3.2.2 AT&T 3B4000 running System V @@ -116,14 +89,18 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. Gould NP1 running UTX 3/2 HP 9000s300 running HP-UX HP 9000s700 running HP-UX 9.x, 10.x, 11.x + H/PC Pro devices running Windows CE 2.11 and higher. IBM PC/RT and RS/6000 running AIX 3.x IBM PS/2 and AT compatibles running OS/2 - 2.0 and up with GCC emx IBM PS/2 and AT compatibles running OS/2 1.1 - 2.0 (and probably Warp) with Microsoft 6.0, and OS/2 2.0 and up with IBM CSet++ 2.0. Intel 80386 or greater (or clone) running 386BSD Intel 80386 or greater (or clone) boxes running MS-DOS with DPMI. + Intel x86 running version of Windows prior to XP. Mips M2000 running RiscOS 4.1 NeXT running Mach (using BSD configuration) + Palm Size PC 1.1 devices running Windows CE 2.11 + Pocket PC devices running Windows CE 3.0 and higher Pyramid 9820x running OSx 4.4c SGI Iris running IRIX Stardent Vistra 800 running SysV R4.0 @@ -135,54 +112,43 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. Unless otherwise mentioned, the compiler used was the OS-vendor's C compiler. - NetHack 3.5 may also run on the following, but a cross-compiler hosted - on another platform, such as win32, would be required to build from - source. - - Pocket PC devices running Windows CE 3.0 and higher - H/PC Pro devices running Windows CE 2.11 and higher. - Palm Size PC 1.1 devices running Windows CE 2.11 - - The sources necessary to build an 80286 DOS "real mode" overlaid version - are still included in the source distribution, so if someone has access - to a real-mode compiler and lots of spare time on their hands, you may - be able to get things working. Of course you do so at your own risk. - - - - - - - - - - - - If you have problems building the game, or you find bugs in it, we recommend filing a bug report from our "Contact Us" web page at: http://www.nethack.org/ +A public repository of the latest NetHack code that we've made +available can be obtained via git here: + + When sending correspondence, please observe the following: o Please be sure to include your machine type, OS, and patchlevel. -o Never send us binary files (e.g. save files or bones files). Whichever - platform you are using, only a small minority of the development team has - access to it, and you will rapidly annoy the others. If you have found - a bug and think that your save file would aid in solving the problem, - send us a description in words of the problem, your machine type, your - operating system, and the version of NetHack. Tell us that you have a - save file, but do not actually send it. - In the rare case that we think your save file would be helpful, you will - be contacted by a member of the development team with the address of a - specific person to send the save file to. +o Please avoid sending us binary files (e.g. save files or bones files). + If you have found a bug and think that your save file would aid in solving + the problem, send us a description in words of the problem, your machine + type, your operating system, and the version of NetHack. Tell us that you + have a save file, but do not actually send it. + You may then be contacted by a member of the development team with the + address of a specific person to send the save file to. o Though we make an effort to reply to each bug report, it may take some time before you receive feedback. This is especially true during the period immediately after a new release, when we get the most bug reports. o We don't give hints for playing the game. -o Don't bother to ask when the next version will be out. You will not get - a reply. +o Don't bother to ask when the next version will be out, or expect a + stock answer. -If you don't have access to the world wide web, or if you want to submit -a patch for the NetHack source code via email directly, you can direct it -to this address: +If you want to submit a patch for the NetHack source code via email directly, +you can direct it to this address: nethack-bugs (at) nethack.org If a feature is not accepted you are free, of course, to post the patches to the net yourself and let the marketplace decide their worth. All of this amounts to the following: If you decide to apply a free-lanced -patch to your 3.5 code, you are on your own. In our own patches, we will -assume that your code is synchronized with ours. +patch to your 3.6 code, you are welcome to do so, of course, but we won't +be able to provide support or receive bug reports for it. + +In our own patches, we will assume that your code is synchronized with ours. -- Good luck, and happy Hacking -- From c6e85f2c27ab454cac12fd2ca0718289912e5c37 Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 5 Mar 2015 20:45:17 -0500 Subject: [PATCH 165/354] Fix some README mistakes that Janet spotted --- README | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/README b/README index 1d4b8063d..a2ee7cf40 100644 --- a/README +++ b/README @@ -7,7 +7,7 @@ that was posted online in 2014 by others, there is no NetHack 3.5 release. NetHack 3.6.0 contains some code reorganization, new features, and bugfixes. -The file doc/fixes36.0 in the source disribution has a full list of each. +The file doc/fixes36.0 in the source distribution has a full list of each. The text in there was written for the development team's own use and is provided "as is", so please do not ask us to further explain the entries in that file. Some entries might be considered "spoilers", particularly @@ -17,7 +17,7 @@ Here are some additional general notes that are not considered spoilers: * Some code paths and long-established game features have been made part of the base build and no longer conditional on compile settings. * Save files and bones files should be compatible across platforms and - machine architectures. + machine architectures . * The following treasured NetHack community patches, or a variation of them, have been rolled in to the base NetHack source tree: menucolors, pickup thrown, statue glyphs, . @@ -64,8 +64,7 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. Intel Pentium or better (or clone) running Linux, BSDI, or Windows (XP through 8.1) Intel 80386 or greater (or clone) boxes running Linux, or BSDI - Sun SPARC based machine running SunOS 4.x, Solaris 2.x, or Solaris 7 - Mac OS X 10.9 should be added to the list. + Mac OS X 10.9 Previous versions of NetHack were tested and known to run on the following systems, but it is unknown if they can still build and @@ -73,7 +72,7 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. Apple Macintosh running MacOS 7.5 or higher, LinuxPPC, BeOS 4.0 Atari ST/TT/Falcon running TOS (or MultiTOS) with GCC - AT&T 3B1 running System V (3.61) + AT&T 3B1 running System V (3.51) AT&T 3B2/600 & 3B2/622 running System V R3.2.1 AT&T 3B2/1000 Model 80 running System V R3.2.2 AT&T 3B4000 running System V @@ -96,7 +95,7 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. Warp) with Microsoft 6.0, and OS/2 2.0 and up with IBM CSet++ 2.0. Intel 80386 or greater (or clone) running 386BSD Intel 80386 or greater (or clone) boxes running MS-DOS with DPMI. - Intel x86 running version of Windows prior to XP. + Intel x86 running a version of Windows prior to XP. Mips M2000 running RiscOS 4.1 NeXT running Mach (using BSD configuration) Palm Size PC 1.1 devices running Windows CE 2.11 @@ -107,8 +106,15 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code. Stride 460 running UniStride 2.1 Sun-3s, -4s, and -386is running SunOS 3.x Sun-3s and -386is running SunOS 4.x + Sun SPARC based machine running SunOS 4.x, Solaris 2.x, or Solaris 7 Valid Logic Systems SCALD-System + Previous versions, using a cross-compiler hosted on another platform, such as + win32, could also build the following from source: + Pocket PC devices running Windows CE 3.0 and higher + H/PC Pro devices running Windows CE 2.11 and higher + Palm Size PC 1.1 devices running Windows CE 2.11 + Unless otherwise mentioned, the compiler used was the OS-vendor's C compiler. @@ -135,8 +141,8 @@ o Though we make an effort to reply to each bug report, it may take some time before you receive feedback. This is especially true during the period immediately after a new release, when we get the most bug reports. o We don't give hints for playing the game. -o Don't bother to ask when the next version will be out, or expect a - stock answer. +o Don't bother to ask when the next version will be out or you can expect + to receive a stock answer. If you want to submit a patch for the NetHack source code via email directly, you can direct it to this address: From 08eebb58e110a43e97a7b9a3b58a86dcf3bb5352 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 5 Mar 2015 14:03:56 +0200 Subject: [PATCH 166/354] Fix data.base entries -"bat" overrode later "combat" entry. -"gelatinous cube" and "jack boot" have their own entries. -"vampire bat" matched twice; use the bat entry. -dagger attribution started with spaces instead of tabs. --- dat/data.base | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dat/data.base b/dat/data.base index 67fca7aba..0c9f493b0 100644 --- a/dat/data.base +++ b/dat/data.base @@ -429,6 +429,7 @@ barbed devil Barbed devils lack any real special abilities, though they are quite difficult to kill. # takes "bat or bird" when specifying 'B' +~combat *bat bat or bird A bat, flitting in the darkness outside, took the wrong turn @@ -511,7 +512,6 @@ blind io own. Several were currently hovering above the table. [ The Colour of Magic, by Terry Pratchett ] * blob -gelatinous cube ooze * ooze *pudding @@ -548,6 +548,7 @@ candelabrum* Because it is Saint Peter's holy day. (Enter all the Friars to sing the dirge) [ Doctor Faustus and Other Plays, by Christopher Marlowe ] +~*jack*boot* *boot* In Fantasyland these are remarkable in that they seldom or never wear out and are suitable for riding or walking in @@ -1101,7 +1102,7 @@ cyclops Proceeding from the heat-oppressed brain? I see thee yet, in form as palpable As this which now I draw. - [ Macbeth, by William Shakespeare ] + [ Macbeth, by William Shakespeare ] dark one ... But he ruled rather by force and fear, if they might avail; and those who perceived his shadow spreading over the @@ -5157,7 +5158,7 @@ valkyrie Nations, by Herbert Robinson and Knox Wilson ] vampire -vampire bat +~vampire bat vampire lord The Oxford English Dictionary is quite unequivocal: _vampire_ - "a preternatural being of a malignant nature (in From f0114b2ead7b4018fa6d0fa608a23fe399dc7627 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 5 Mar 2015 14:21:21 +0200 Subject: [PATCH 167/354] Add database entry for shuriken --- dat/data.base | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dat/data.base b/dat/data.base index 0c9f493b0..31d9360be 100644 --- a/dat/data.base +++ b/dat/data.base @@ -4503,6 +4503,14 @@ shrieker its fetid bulk looming overhead... The monster was some kind of great dark worm, but that was about all they were sure of. [ The Adventurers, Epic IV, by Thomas A. Miller ] +shuriken + You know, that's what I hate most about fighting against magic: + you never know what they're trying to do to you until it hits. + The sorceress knew what hit her, however. Two of the shuriken + got past whatever defenses she had. One caught her just below + the throat, the other in the middle of her chest. It wouldn't + kill her, but she wouldn't be fighting anyone for a while. + [ Jhereg, Steven Brust ] skeleton A skeleton is a magically animated undead creature. Unlike shades, only a humanoid creature can be used to create a From aeb3b49549ac4fe21197ef853162c5f84bbc9079 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 5 Mar 2015 14:22:19 +0200 Subject: [PATCH 168/354] Fix shuriken attribution --- dat/data.base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dat/data.base b/dat/data.base index 31d9360be..1da1c54dd 100644 --- a/dat/data.base +++ b/dat/data.base @@ -4510,7 +4510,7 @@ shuriken got past whatever defenses she had. One caught her just below the throat, the other in the middle of her chest. It wouldn't kill her, but she wouldn't be fighting anyone for a while. - [ Jhereg, Steven Brust ] + [ Jhereg, by Steven Brust ] skeleton A skeleton is a magically animated undead creature. Unlike shades, only a humanoid creature can be used to create a From cf66f8bcebc7124fa40fcdea84458381cc140ab1 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 5 Mar 2015 14:23:23 +0200 Subject: [PATCH 169/354] Make shuriken entry also match throwing star. --- dat/data.base | 1 + 1 file changed, 1 insertion(+) diff --git a/dat/data.base b/dat/data.base index 1da1c54dd..409d5eba4 100644 --- a/dat/data.base +++ b/dat/data.base @@ -4503,6 +4503,7 @@ shrieker its fetid bulk looming overhead... The monster was some kind of great dark worm, but that was about all they were sure of. [ The Adventurers, Epic IV, by Thomas A. Miller ] +throwing star shuriken You know, that's what I hate most about fighting against magic: you never know what they're trying to do to you until it hits. From 587d1678f7aecc37cc199182ac7a7c5a2c49184c Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 5 Mar 2015 16:15:40 +0200 Subject: [PATCH 170/354] Add database entry for fedora --- dat/data.base | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dat/data.base b/dat/data.base index 409d5eba4..9fa99e08f 100644 --- a/dat/data.base +++ b/dat/data.base @@ -1571,6 +1571,12 @@ eyes of the overworld Usually, there is nothing to be seen. However, the wearer is also able to look back and see the area around herself, much like looking on a map. Why anyone would want to ... +fedora + Some hats can only be worn if you're willing to be jaunty, to set + them at an angle and to walk beneath them with a spring in your + stride as if you're only a step away from dancing. They demand a + lot of you. + [ Anansi Boys, by Neil Gaiman ] figurine* Then it appeared in Paris at just about the time that Paris was full of Carlists who had to get out of Spain. One of From 7d8d8ad1f5e628a4bed4d3257ac70f1a925582b2 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 5 Mar 2015 16:34:16 +0200 Subject: [PATCH 171/354] Add database entry for land mine --- dat/data.base | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dat/data.base b/dat/data.base index 9fa99e08f..6bca23177 100644 --- a/dat/data.base +++ b/dat/data.base @@ -2774,6 +2774,12 @@ lance evil plight. [ Don Quixote of La Mancha, by Miquel de Cervantes Saavedra ] +land mine + Your heart is intact, your brain is not badly damaged, but the rest + of your injuries are comparable to stepping on a land mine. You'd + never walk again, and you'd be in great pain. You would come to + wish you had not survived. + [ Steel Beach, by John Varley ] *lantern While pretending to be a fancy safety lamp, it is in fact battery powered. A discreet little switch is marked "on/off" From 7fa05c63110880c2fc6011190e4acba224a73fdb Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 6 Mar 2015 21:01:02 +0200 Subject: [PATCH 172/354] You_hear already checks deafness --- src/dig.c | 2 +- src/lock.c | 4 ++-- src/mon.c | 10 +++++----- src/music.c | 2 +- src/pray.c | 3 +-- src/trap.c | 9 +++------ src/zap.c | 14 ++++++-------- 7 files changed, 19 insertions(+), 25 deletions(-) diff --git a/src/dig.c b/src/dig.c index 39791dde0..1c053ec73 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1245,7 +1245,7 @@ register struct monst *mtmp; if (IS_WALL(here->typ)) { /* KMH -- Okay on arboreal levels (room walls are still stone) */ - if (!Deaf && flags.verbose && !rn2(5)) + if (flags.verbose && !rn2(5)) You_hear("crashing rock."); if (*in_rooms(mtmp->mx, mtmp->my, SHOPBASE)) add_damage(mtmp->mx, mtmp->my, 0L); diff --git a/src/lock.c b/src/lock.c index 67a11a545..91e0f0728 100644 --- a/src/lock.c +++ b/src/lock.c @@ -888,7 +888,7 @@ int x, y; else if (flags.verbose) { if (cansee(x,y)) pline("KABOOM!! You see a door explode."); - else if (!Deaf) + else You_hear("a distant explosion."); } door->doormask = D_NODOOR; @@ -901,7 +901,7 @@ int x, y; if (flags.verbose) { if (cansee(x,y)) pline_The("door crashes open!"); - else if (!Deaf) + else You_hear("a crashing sound."); } unblock_point(x,y); diff --git a/src/mon.c b/src/mon.c index 82457199a..49f6282dc 100644 --- a/src/mon.c +++ b/src/mon.c @@ -638,7 +638,7 @@ meatmetal(mtmp) if (cansee(mtmp->mx,mtmp->my) && flags.verbose) pline("%s eats %s!", Monnam(mtmp), distant_name(otmp,doname)); - else if (!Deaf && flags.verbose) + else if (flags.verbose) You_hear("a crunching sound."); mtmp->meating = otmp->owt/2 + 1; /* Heal up to the object's weight in hp */ @@ -758,7 +758,7 @@ meatobj(mtmp) /* for gelatinous cubes */ if (cansee(mtmp->mx,mtmp->my) && flags.verbose) pline("%s eats %s!", Monnam(mtmp), distant_name(otmp, doname)); - else if (!Deaf && flags.verbose) + else if (flags.verbose) You_hear("a slurping sound."); /* Heal up to the object's weight in hp */ if (mtmp->mhp < mtmp->mhpmax) { @@ -803,7 +803,7 @@ meatobj(mtmp) /* for gelatinous cubes */ if (ecount > 0) { if (cansee(mtmp->mx, mtmp->my) && flags.verbose && buf[0]) pline1(buf); - else if (!Deaf && flags.verbose) + else if (flags.verbose) You_hear("%s slurping sound%s.", ecount == 1 ? "a" : "several", ecount == 1 ? "" : "s"); @@ -1642,7 +1642,7 @@ boolean was_swallowed; /* digestion */ s_suffix(mdat->mname)); losehp(Maybe_Half_Phys(tmp), killer.name, KILLED_BY_AN); } else { - if (!Deaf) You_hear("an explosion."); + You_hear("an explosion."); magr->mhp -= tmp; if (magr->mhp < 1) mondied(magr); if (magr->mhp < 1) { /* maybe lifesaved */ @@ -3106,7 +3106,7 @@ register boolean silent; else if(!Blind) You_see("%sangry guard%s approaching!", sct == 1 ? "an " : "", sct > 1 ? "s" : ""); - } else if(!Deaf) + } else You_hear("the shrill sound of a guard's whistle."); } return(TRUE); diff --git a/src/music.c b/src/music.c index 94f6282d1..0912d78cc 100644 --- a/src/music.c +++ b/src/music.c @@ -334,7 +334,7 @@ do_pit: chasm = maketrap(x,y,PIT); if (!m_already_trapped) { /* suppress messages */ if(cansee(x,y)) pline("%s falls into a chasm!", Monnam(mtmp)); - else if (!Deaf && humanoid(mtmp->data)) + else if (humanoid(mtmp->data)) You_hear("a scream!"); } /* Falling is okay for falling down diff --git a/src/pray.c b/src/pray.c index a91782c72..d2b24c00a 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1386,8 +1386,7 @@ verbalize("In return for thy service, I grant thee the gift of Immortality!"); if (otmp->otyp == FAKE_AMULET_OF_YENDOR) { if (!highaltar && !otmp->known) goto too_soon; - if (!Deaf) - You_hear("a nearby thunderclap."); + You_hear("a nearby thunderclap."); if (!otmp->known) { You("realize you have made a %s.", Hallucination ? "boo-boo" : "mistake"); diff --git a/src/trap.c b/src/trap.c index 7efe8db00..911aafdc5 100644 --- a/src/trap.c +++ b/src/trap.c @@ -2062,10 +2062,9 @@ register struct monst *mtmp; pline("%s stops momentarily and appears to cringe.", Monnam(mtmp)); } - } else if (!Deaf) { + } else You_hear("a distant %s squeak.", trapnote(trap,1)); - } /* wake up nearby monsters */ wake_nearto(mtmp->mx, mtmp->my, 40); break; @@ -2080,9 +2079,8 @@ register struct monst *mtmp; Monnam(mtmp), a_your[trap->madeby_u]); seetrap(trap); } else { - if((mptr == &mons[PM_OWLBEAR] + if(mptr == &mons[PM_OWLBEAR] || mptr == &mons[PM_BUGBEAR]) - && !Deaf) You_hear("the roaring of an angry bear!"); } } else if (force_mintrap) { @@ -2923,9 +2921,8 @@ domagictrap() if (!Blind) Your1(vision_clears); } else if (!Blind) { You_see("a flash of light!"); - } else if (!Deaf) { + } else You_hear("a deafening roar!"); - } incr_itimeout(&HDeaf, rn1(20,30)); while(cnt--) (void) makemon((struct permonst *) 0, u.ux, u.uy, NO_MM_FLAGS); diff --git a/src/zap.c b/src/zap.c index 95b9760a3..38b883115 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1790,7 +1790,7 @@ struct obj *obj, *otmp; if (obj->otyp == BOULDER) { if (cansee(obj->ox, obj->oy)) pline_The("boulder falls apart."); - else if (!Deaf) + else You_hear("a crumbling sound."); fracture_rock(obj); } @@ -1801,9 +1801,8 @@ struct obj *obj, *otmp; pline_The("%s shatters.", rndmonnam()); else pline_The("statue shatters."); - } else if (!Deaf) { + } else You_hear("a crumbling sound."); - } } } else { if (context.mon_moving ? @@ -3025,7 +3024,7 @@ struct obj **pobj; /* object tossed/used, set to NULL if (!Blind) pline("%s %s%s.", Yname2(obj), otense(obj, "skip"), skipcount ? " again" : ""); - else if (!Deaf) You_hear("%s skip.", yname(obj)); + else You_hear("%s skip.", yname(obj)); skipcount++; } else if (skiprange_start > skiprange_end + 1) { --skiprange_start; @@ -4047,7 +4046,7 @@ short exploding_wand_typ; else Norep("The water freezes."); newsym(x,y); - } else if(!Deaf && !lava) + } else if(!lava) You_hear("a crackling sound."); if (x == u.ux && y == u.uy) { @@ -4214,9 +4213,8 @@ short exploding_wand_typ; newsym(x, y); } else if (sense_txt) { You1(sense_txt); - } else if (hear_txt) { - if (!Deaf) You_hear1(hear_txt); - } + } else if (hear_txt) + You_hear1(hear_txt); if (picking_at(x, y)) { stop_occupation(); reset_pick(); From 66a1f0ced4bc31619506c5fde83d87f4926bc18b Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 7 Mar 2015 15:11:41 +0200 Subject: [PATCH 173/354] Implement fcntl(2) file locking If you run a server, then you know of the somewhat annoying perm_lock errors that creep up, requiring your attention before anyone else can start a game. This patch properly implements fcntl(2) locking on systems that can handle it (*nix systems), that results in the lock being automatically released on program termination, whether abnormal or not. Original patch by Drew Streib, update by Edoardo Spadolini --- include/unixconf.h | 6 +++++ src/files.c | 60 ++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 62 insertions(+), 4 deletions(-) diff --git a/include/unixconf.h b/include/unixconf.h index c85611c2a..9feefd2c8 100644 --- a/include/unixconf.h +++ b/include/unixconf.h @@ -217,6 +217,12 @@ #define FCMASK 0660 /* file creation mask */ +/* fcntl(2) is a POSIX-portable call for manipulating file descriptors. + * Comment out the USE_FCNTL if for some reason you have a strange + * OS/filesystem combination for which fcntl(2) does not work. */ +#ifdef POSIX_TYPES +# define USE_FCNTL +#endif /* * The remainder of the file should not need to be changed. diff --git a/src/files.c b/src/files.c index 71fd0c217..2cae9fb7f 100644 --- a/src/files.c +++ b/src/files.c @@ -12,7 +12,7 @@ #include -#if !defined(MAC) && !defined(O_WRONLY) && !defined(AZTEC_C) +#if (!defined(MAC) && !defined(O_WRONLY) && !defined(AZTEC_C)) || defined(USE_FCNTL) #include #endif @@ -185,7 +185,9 @@ STATIC_DCL void FDECL(docompress_file, (const char *,BOOLEAN_P)); #if defined(ZLIB_COMP) STATIC_DCL boolean FDECL(make_compressed_name, (const char *, char *)); #endif +#ifndef USE_FCNTL STATIC_DCL char *FDECL(make_lockname, (const char *,char *)); +#endif STATIC_DCL FILE *FDECL(fopen_config_file, (const char *, int)); STATIC_DCL int FDECL(get_uchars, (FILE *,char *,char *,uchar *,BOOLEAN_P,int,const char *)); @@ -1537,12 +1539,16 @@ boolean uncomp; static int nesting = 0; -#ifdef NO_FILE_LINKS /* implies UNIX */ +#if defined(NO_FILE_LINKS) || defined(USE_FCNTL) /* implies UNIX */ static int lockfd; /* for lock_file() to pass to unlock_file() */ #endif +#ifdef USE_FCNTL +struct flock sflock; /* for unlocking, same as above */ +#endif #define HUP if (!program_state.done_hup) +#ifndef USE_FCNTL STATIC_OVL char * make_lockname(filename, lockname) const char *filename; @@ -1574,6 +1580,7 @@ char *lockname; return (char*)0; #endif } +#endif /* !USE_FCNTL */ /* lock a file */ boolean @@ -1585,8 +1592,10 @@ int retryct; #if defined(PRAGMA_UNUSED) && !(defined(UNIX) || defined(VMS)) && !(defined(AMIGA) || defined(WIN32) || defined(MSDOS)) # pragma unused(retryct) #endif +#ifndef USE_FCNTL char locknambuf[BUFSZ]; const char *lockname; +#endif nesting++; if (nesting > 1) { @@ -1594,18 +1603,50 @@ int retryct; return TRUE; } +#ifndef USE_FCNTL lockname = make_lockname(filename, locknambuf); - filename = fqname(filename, whichprefix, 0); #ifndef NO_FILE_LINKS /* LOCKDIR should be subsumed by LOCKPREFIX */ lockname = fqname(lockname, LOCKPREFIX, 2); #endif +#endif + filename = fqname(filename, whichprefix, 0); +#ifdef USE_FCNTL + lockfd = open(filename,O_RDWR); + if (lockfd == -1) { + HUP raw_printf("Cannot open file %s. This is a program bug.", + filename); + } + sflock.l_type = F_WRLCK; + sflock.l_whence = SEEK_SET; + sflock.l_start = 0; + sflock.l_len = 0; +#endif #if defined(UNIX) || defined(VMS) +# ifdef USE_FCNTL + while (fcntl(lockfd,F_SETLK,&sflock) == -1) { +# else # ifdef NO_FILE_LINKS while ((lockfd = open(lockname, O_RDWR|O_CREAT|O_EXCL, 0666)) == -1) { # else while (link(filename, lockname) == -1) { # endif +# endif + +#ifdef USE_FCNTL + if (retryct--) { + HUP raw_printf( + "Waiting for release of fcntl lock on %s. (%d retries left).", + filename, retryct); + sleep(1); + } else { + HUP (void) raw_print("I give up. Sorry."); + HUP raw_printf("Some other process has an unnatural grip on %s.", + filename); + nesting--; + return FALSE; + } +#else register int errnosv = errno; switch (errnosv) { /* George Barbanis */ @@ -1660,11 +1701,12 @@ int retryct; nesting--; return FALSE; } +#endif /* USE_FCNTL */ } #endif /* UNIX || VMS */ -#if defined(AMIGA) || defined(WIN32) || defined(MSDOS) +#if (defined(AMIGA) || defined(WIN32) || defined(MSDOS)) && !defined(USE_FCNTL) # ifdef AMIGA #define OPENFAILURE(fd) (!fd) lockptr = 0; @@ -1711,10 +1753,19 @@ void unlock_file(filename) const char *filename; { +#ifndef USE_FCNTL char locknambuf[BUFSZ]; const char *lockname; +#endif if (nesting == 1) { +#ifdef USE_FCNTL + sflock.l_type = F_UNLCK; + if (fcntl(lockfd,F_SETLK,&sflock) == -1) { + HUP raw_printf("Can't remove fcntl lock on %s.", filename); + (void) close(lockfd); + } +#else lockname = make_lockname(filename, locknambuf); #ifndef NO_FILE_LINKS /* LOCKDIR should be subsumed by LOCKPREFIX */ lockname = fqname(lockname, LOCKPREFIX, 2); @@ -1734,6 +1785,7 @@ const char *filename; DeleteFile(lockname); lockptr = 0; #endif /* AMIGA || WIN32 || MSDOS */ +#endif /* USE_FCNTL */ } nesting--; From bb2351b83f60924b226c7532a36aca28f7c57792 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 8 Mar 2015 10:40:26 +0200 Subject: [PATCH 174/354] TTY: Do not cut off statuslines at 80 characters Show as much of the status line as possible, instead of chopping it at COLNO - this prevents possible game-influencing status effects (Ill, Burdened, etc) from being hidden. --- win/tty/wintty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 67b0243d4..19af943b9 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1061,7 +1061,7 @@ tty_create_nhwindow(type) #endif newwin->offy = min((int)ttyDisplay->rows-2, ROWNO+1); newwin->rows = newwin->maxrow = 2; - newwin->cols = newwin->maxcol = min(ttyDisplay->cols, COLNO); + newwin->cols = newwin->maxcol = ttyDisplay->cols; break; case NHW_MAP: /* map window, ROWNO lines long, full width, below message window */ From dd0a28c7b153924cd616166503a968e8e5076fb8 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 8 Mar 2015 15:11:01 +0200 Subject: [PATCH 175/354] TTY: Prevent accidental escapes from string entries On NAO, one of the major complaints was accidental escaping from wishing prompt when using cursor keys. The users were trying to go "back" on the entry to fix a typo, but lost the wish instead. This prevents escaping out of a text prompt if there is any text entered into the prompt; pressing escape clears the prompt. --- win/tty/getline.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/win/tty/getline.c b/win/tty/getline.c index 4a2d8c251..1e4e6c43f 100644 --- a/win/tty/getline.c +++ b/win/tty/getline.c @@ -60,9 +60,19 @@ getlin_hook_proc hook; Strcat(strcat(strcpy(toplines, query), " "), obufp); c = pgetchar(); if (c == '\033' || c == EOF) { - obufp[0] = '\033'; - obufp[1] = '\0'; - break; + if (c == '\033' && obufp[0] != '\0') { + obufp[0] = '\0'; + bufp = obufp; + tty_clear_nhwindow(WIN_MESSAGE); + cw->maxcol = cw->maxrow; + addtopl(query); + addtopl(" "); + addtopl(obufp); + } else { + obufp[0] = '\033'; + obufp[1] = '\0'; + break; + } } if (ttyDisplay->intr) { ttyDisplay->intr--; From 0b231571bc8c486c264ab63ec6d909f1915cadd8 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 9 Mar 2015 21:08:26 -0400 Subject: [PATCH 176/354] fix a segfault in mapglyph reported by Pasi earlier today Changes to be committed: modified: src/pager.c Steps to reproduce the reported segfault: Use / command, answer n, press space and enter In do_look() variable glyph is only set to a proper value if using the screen (from_screen) or the mouse (clicklook). On the code path that triggered the segfault, glyph was being passed to mapglyph with a random arbitrary value. If glyph had been initialized at the start of do_look(), it would have prevented the segfault, but would have always displayed a giant ant or something silly instead of the correct thing. Don't use glyph except under from_screen || clicklook. --- src/pager.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pager.c b/src/pager.c index 4e8008c1b..721119060 100644 --- a/src/pager.c +++ b/src/pager.c @@ -574,9 +574,14 @@ do_look(mode, click_cc) def_monsyms[i].explain) { need_to_look = TRUE; if (!found) { - Sprintf(out_str, "%s %s", + if (from_screen || clicklook) + Sprintf(out_str, "%s %s", encglyph(glyph), - an(def_monsyms[i].explain)); + an(def_monsyms[i].explain)); + else + Sprintf(out_str, "%c %s", + sym, + an(def_monsyms[i].explain)); firstmatch = def_monsyms[i].explain; found++; } else { From c92c8ab9d173dcff308380a1c3e4809093d2c428 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 9 Mar 2015 18:42:53 +0200 Subject: [PATCH 177/354] Define for generic usernames which prompt for name Instead of hard-coding the "play", "player", etc. usernames which will prompt the user for their name, allow defining the names in config.h --- include/config.h | 5 +++++ src/role.c | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/config.h b/include/config.h index d8b067fc7..930bd549c 100644 --- a/include/config.h +++ b/include/config.h @@ -316,6 +316,11 @@ #endif /* CHDIR */ +/* If GENERIC_USERNAMES is defined, and the user name is found + * in that list, prompt for username instead. + * A public server should probably disable this. */ +#define GENERIC_USERNAMES "play player game games nethack nethacker" + /* * Section 3: Definitions that may vary with system type. diff --git a/src/role.c b/src/role.c index 59624c528..2e2cbabae 100644 --- a/src/role.c +++ b/src/role.c @@ -1332,12 +1332,15 @@ plnamesuffix() char *sptr, *eptr; int i; +#ifdef GENERIC_USERNAMES /* some generic user names will be ignored in favor of prompting */ i = (int)strlen(plname); - if ((i >= 4 && !strncmpi(plname, "player", i)) || /* play[er] */ - (i >= 4 && !strncmpi(plname, "games", i)) || /* game[s] */ - (i >= 7 && !strncmpi(plname, "nethacker", i))) /* nethack[er] */ + eptr = GENERIC_USERNAMES; + sptr = strstri(eptr, plname); + if (sptr && ((sptr == eptr && (sptr[i] == ' ' || sptr[i] == '\0')) + || sptr[i] == ' ' || sptr[i] == '\0')) *plname = '\0'; /* call askname() */ +#endif do { if (!*plname) askname(); /* fill plname[] if necessary */ From c4c81480ca88437f9b40205113590b287cbfd3dc Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 9 Mar 2015 21:08:42 +0200 Subject: [PATCH 178/354] Use a menu to loot multiple containers When looting a location with multiple containers, show a menu for user to pick the containers to loot instead of asking a yes/no question for each container. --- src/pickup.c | 108 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 77 insertions(+), 31 deletions(-) diff --git a/src/pickup.c b/src/pickup.c index d044cf46f..0b6abf06d 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1451,6 +1451,36 @@ int x, y; return FALSE; } +int +do_loot_cont(cobjp) +struct obj **cobjp; +{ + struct obj *cobj = *cobjp; + if (!cobj) return 0; + if (cobj->olocked) { + pline("%s locked.", cobj->lknown ? "It is" : + "Hmmm, it turns out to be"); + cobj->lknown = 1; + return 0; + } + cobj->lknown = 1; + + if (cobj->otyp == BAG_OF_TRICKS) { + int tmp; + You("carefully open the bag..."); + pline("It develops a huge set of teeth and bites you!"); + tmp = rnd(10); + losehp(Maybe_Half_Phys(tmp), "carnivorous bag", KILLED_BY_AN); + makeknown(BAG_OF_TRICKS); + return 1; + } + + You("%sopen %s...", + (!cobj->cknown || !cobj->lknown) ? "carefully " : "", + the(xname(cobj))); + return use_container(cobjp, 0); +} + int doloot() /* loot a container on the floor or loot saddle from mon. */ { @@ -1486,46 +1516,62 @@ lootcont: if (container_at(cc.x, cc.y, FALSE)) { boolean any = FALSE; + int num_conts = 0; if (!able_to_loot(cc.x, cc.y, TRUE)) return 0; - for (cobj = level.objects[cc.x][cc.y]; cobj; cobj = nobj) { - nobj = cobj->nexthere; - if (Is_container(cobj)) { - c = ynq(safe_qbuf(qbuf, "There is ", " here, loot it?", - cobj, doname, ansimpleoname, "a container")); - if (c == 'q') return (timepassed); - if (c == 'n') continue; - any = TRUE; + for (cobj = level.objects[cc.x][cc.y]; cobj; cobj = cobj->nexthere) + if (Is_container(cobj)) num_conts++; - if (cobj->olocked) { - pline("%s locked.", cobj->lknown ? "It is" : - "Hmmm, it turns out to be"); - cobj->lknown = 1; - continue; + if (num_conts > 1) { + /* use a menu to loot many containers */ + int n, i; + winid win; + anything any; + menu_item *pick_list = NULL; + + any.a_void = 0; + win = create_nhwindow(NHW_MENU); + start_menu(win); + + for (cobj = level.objects[cc.x][cc.y]; cobj; cobj = cobj->nexthere) + if (Is_container(cobj)) { + any.a_obj = cobj; + add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE, doname(cobj), MENU_UNSELECTED); } - cobj->lknown = 1; + end_menu(win, "Loot which containers?"); + n = select_menu(win, PICK_ANY, &pick_list); + destroy_nhwindow(win); - if (cobj->otyp == BAG_OF_TRICKS) { - int tmp; - You("carefully open the bag..."); - pline("It develops a huge set of teeth and bites you!"); - tmp = rnd(10); - losehp(Maybe_Half_Phys(tmp), "carnivorous bag", KILLED_BY_AN); - makeknown(BAG_OF_TRICKS); - timepassed = 1; - continue; + if (n > 0) { + for (i = 0; i < n; i++) { + timepassed |= do_loot_cont(&pick_list[i].item.a_obj); + if (multi < 0 || !pick_list[i].item.a_obj) { + free((genericptr_t) pick_list); + return 1; + } } - - You("%sopen %s...", - (!cobj->cknown || !cobj->lknown) ? "carefully " : "", - the(xname(cobj))); - timepassed |= use_container(&cobj, 0); - /* might have triggered chest trap or magic bag explosion */ - if (multi < 0 || !cobj) return 1; } + if (pick_list) free((genericptr_t) pick_list); + if (n != 0) c = 'y'; + } else { + for (cobj = level.objects[cc.x][cc.y]; cobj; cobj = nobj) { + nobj = cobj->nexthere; + + if (Is_container(cobj)) { + c = ynq(safe_qbuf(qbuf, "There is ", " here, loot it?", + cobj, doname, ansimpleoname, "a container")); + if (c == 'q') return (timepassed); + if (c == 'n') continue; + any = TRUE; + + timepassed |= do_loot_cont(&cobj); + /* might have triggered chest trap or magic bag explosion */ + if (multi < 0 || !cobj) return 1; + } + } + if (any) c = 'y'; } - if (any) c = 'y'; } else if (IS_GRAVE(levl[cc.x][cc.y].typ)) { You("need to dig up the grave to effectively loot it..."); } From 504048c0a85be1d034df91a4e68ea1d75343d776 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 9 Mar 2015 22:22:32 +0200 Subject: [PATCH 179/354] Comment typofix --- src/fountain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fountain.c b/src/fountain.c index 482b0ed76..e87748e0a 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -456,7 +456,7 @@ register struct obj *obj; long money = money_cnt(invent); struct obj *otmp; if (money > 10) { - /* Amount to loose. Might get rounded up as fountains don't pay change... */ + /* Amount to lose. Might get rounded up as fountains don't pay change... */ money = somegold(money) / 10; for (otmp = invent; otmp && money > 0; otmp = otmp->nobj) if (otmp->oclass == COIN_CLASS) { int denomination = objects[otmp->otyp].oc_cost; From 63e7d97148bb2cdb237b94a8c8ed55ec082d27b8 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 9 Mar 2015 22:53:43 +0200 Subject: [PATCH 180/354] Change command X to twoweapon toggle Explore mode is now an extended command #exploremode. There's no sense that a command used max. once per game, and in normal games not at all, takes up a key. So, analogous to the 'x' command (swap weapons), 'X' now toggles two-weapon combat. --- dat/cmdhelp | 2 +- dat/help | 2 +- dat/hh | 2 +- doc/Guidebook.mn | 7 ++++--- src/cmd.c | 3 ++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dat/cmdhelp b/dat/cmdhelp index 811c9bdda..d7487750f 100644 --- a/dat/cmdhelp +++ b/dat/cmdhelp @@ -69,7 +69,7 @@ V Show long version and game history w Wield (put in use) a weapon W Wear a piece of armor x Swap wielded and secondary weapons -X Enter explore (discovery) mode (only if defined) +X Toggle two-weapon combat y Go northwest 1 space Y Go northwest until you are on top of something ^Y Go northwest until you are near something diff --git a/dat/help b/dat/help index 7f9ee92ab..07971cec2 100644 --- a/dat/help +++ b/dat/help @@ -147,7 +147,7 @@ Commands: w Wield weapon. w- means wield nothing, use bare hands. W Wear armor. x Swap wielded and secondary weapons. - X Switch the game to explore (discovery) mode. + X Toggle two-weapon combat. ^X Show your attributes. z Zap a wand. (Use y instead of z if number_pad is -1.) Z Cast a spell. (Use Y instead of Z if number_pad is -1.) diff --git a/dat/hh b/dat/hh index 1887547c7..b16b1c91c 100644 --- a/dat/hh +++ b/dat/hh @@ -32,7 +32,6 @@ O options set options \ known display list of what's been discovered v version display version number V history display game history -X explore switch the game to explore (discovery) mode ^A again redo the previous command (^A denotes the keystroke CTRL-A) ^R redraw redraw the screen ^P prevmsg repeat previous message (subsequent ^P's repeat earlier ones) @@ -70,6 +69,7 @@ T takeoff take off some armor w wield wield a weapon (w- wield nothing) W wear put on some armor x xchange swap wielded and secondary weapons +X twoweapon toggle two-weapon combat z zap zap a wand (use y instead of z if number_pad is -1) Z Zap cast a spell (use Y instead of Z if number_pad is -1) < up go up the stairs diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index f04f3b309..86094fe26 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -708,7 +708,8 @@ The latter is used as your secondary weapon when engaging in two-weapon combat. Note that if one of these slots is empty, the exchange still takes place. .lp X -Enter explore (discovery) mode, explained in its own section later. +Toggle two-weapon combat, if your character can do it. Also available +via the ``#twoweapon'' extended command .lp "" Since using this command by accident would be troublesome, you are asked to confirm your intent before switching to explore mode. By default @@ -2980,8 +2981,8 @@ with the .op -X command-line switch or with the .op playmode:explore -option. The other is to issue the `X' command while already -playing the game. Starting a new game in explore mode provides your +option. The other is to issue the ``#exploremode'' extended command while +already playing the game. Starting a new game in explore mode provides your character with a wand of wishing in initial inventory; switching via `X' during play does not. The other benefits of explore mode are left for the trepid reader to discover. diff --git a/src/cmd.c b/src/cmd.c index f7e858e01..5d9bcfc27 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -2411,7 +2411,7 @@ static const struct func_tab cmdlist[] = { {'W', FALSE, dowear}, {M('w'), FALSE, dowipe}, {'x', FALSE, doswapweapon}, - {'X', TRUE, enter_explore_mode}, + {'X', FALSE, dotwoweapon}, /* 'y', 'Y' : go nw */ {'z', FALSE, dozap}, {'Z', TRUE, docast}, @@ -2456,6 +2456,7 @@ struct ext_func_tab extcmdlist[] = { {"dip", "dip an object into something", dodip, FALSE}, {"enhance", "advance or check weapon and spell skills", enhance_weapon_skill, TRUE}, + {"exploremode", "enter explore mode", enter_explore_mode, TRUE}, {"force", "force a lock", doforce, FALSE}, {"invoke", "invoke an object's powers", doinvoke, TRUE}, {"jump", "jump to a location", dojump, FALSE}, From 20b16455efbd55e0f2be2570231904dc63737b33 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 9 Mar 2015 22:05:48 -0400 Subject: [PATCH 181/354] more do_look() glyph usage without it being set properly Changes to be committed: modified: src/pager.c When the previous occurrence that triggered a segfault was fixed, I didn't check for more of them. It turns out there were more instances. This also removes some dead code. --- src/pager.c | 76 ++++++++++++++++------------------------------------- 1 file changed, 23 insertions(+), 53 deletions(-) diff --git a/src/pager.c b/src/pager.c index 721119060..377eda642 100644 --- a/src/pager.c +++ b/src/pager.c @@ -453,7 +453,7 @@ do_look(mode, click_cc) { boolean quick = (mode == 1); /* use cursor && don't search for "more info" */ boolean clicklook = (mode == 2); /* right mouse-click method */ - char out_str[BUFSZ], look_buf[BUFSZ]; + char out_str[BUFSZ], look_buf[BUFSZ], prefix[BUFSZ]; const char *x_str, *firstmatch = 0; struct permonst *pm = 0; int glyph; /* glyph at selected position */ @@ -532,36 +532,14 @@ do_look(mode, click_cc) glyph = glyph_at(cc.x,cc.y); /* Convert the glyph at the selected position to a symbol. */ -#if 0 - if (glyph_is_cmap(glyph)) { - sym = showsyms[glyph_to_cmap(glyph)]; - } else if (glyph_is_trap(glyph)) { - sym = showsyms[trap_to_defsym(glyph_to_trap(glyph))]; - } else if (glyph_is_statue(glyph)) { - sym = showsyms[(int)mons[glyph_to_mon(glyph)].mlet + SYM_OFF_M]; - } else if (glyph_is_object(glyph)) { - sym = showsyms[(int)objects[glyph_to_obj(glyph)].oc_class + SYM_OFF_O]; - if (sym == '`' && iflags.bouldersym && (int)glyph_to_obj(glyph) == BOULDER) - sym = iflags.bouldersym; - } else if (glyph_is_monster(glyph)) { - /* takes care of pets, detected, ridden, and regular mons */ - sym = showsyms[(int)mons[glyph_to_mon(glyph)].mlet + SYM_OFF_M]; - } else if (glyph_is_swallow(glyph)) { - sym = showsyms[glyph_to_swallow(glyph)+S_sw_tl]; - } else if (glyph_is_invisible(glyph)) { - sym = DEF_INVISIBLE; - } else if (glyph_is_warning(glyph)) { - sym = glyph_to_warning(glyph); - sym = showsyms[sym + SYM_OFF_W]; - } else { - impossible("do_look: bad glyph %d at (%d,%d)", - glyph, (int)cc.x, (int)cc.y); - sym = ' '; - } -#endif so = mapglyph(glyph, &sym, &oc, &os, cc.x, cc.y); } + if (from_screen || clicklook) + Sprintf(prefix, "%s ", encglyph(glyph)); + else + Sprintf(prefix, "%s ", sym); + /* * Check all the possibilities, saving all explanations in a buffer. * When all have been checked then the string is printed. @@ -574,14 +552,8 @@ do_look(mode, click_cc) def_monsyms[i].explain) { need_to_look = TRUE; if (!found) { - if (from_screen || clicklook) - Sprintf(out_str, "%s %s", - encglyph(glyph), - an(def_monsyms[i].explain)); - else - Sprintf(out_str, "%c %s", - sym, - an(def_monsyms[i].explain)); + Sprintf(out_str, "%s%s", + prefix, an(def_monsyms[i].explain)); firstmatch = def_monsyms[i].explain; found++; } else { @@ -605,8 +577,8 @@ do_look(mode, click_cc) */ if (u.uswallow && (from_screen || clicklook) && is_swallow_sym(sym)) { if (!found) { - Sprintf(out_str, "%s %s", - encglyph(glyph), mon_interior); + Sprintf(out_str, "%s%s", + prefix, mon_interior); firstmatch = mon_interior; } else { found += append_str(out_str, mon_interior); @@ -624,9 +596,8 @@ do_look(mode, click_cc) continue; } if (!found) { - Sprintf(out_str, "%s %s", - encglyph(glyph), - an(def_oc_syms[i].explain)); + Sprintf(out_str, "%s%s", + prefix, an(def_oc_syms[i].explain)); firstmatch = def_oc_syms[i].explain; found++; } else { @@ -637,8 +608,8 @@ do_look(mode, click_cc) if (sym == DEF_INVISIBLE) { if (!found) { - Sprintf(out_str, "%s %s", - encglyph(glyph), + Sprintf(out_str, "%s%s", + prefix, an(invisexplain)); firstmatch = invisexplain; found++; @@ -662,12 +633,11 @@ do_look(mode, click_cc) if (!found) { if (is_cmap_trap(i)) { - Sprintf(out_str, "%s a trap", - encglyph(glyph)); + Sprintf(out_str, "%sa trap", prefix); hit_trap = TRUE; } else { - Sprintf(out_str, "%s %s", - encglyph(glyph), + Sprintf(out_str, "%s%s", + prefix, article == 2 ? the(x_str) : article == 1 ? an(x_str) : x_str); } @@ -692,8 +662,8 @@ do_look(mode, click_cc) if (sym == ((from_screen || clicklook) ? warnsyms[i] : def_warnsyms[i].sym)) { if (!found) { - Sprintf(out_str, "%s %s", - encglyph(glyph), def_warnsyms[i].explanation); + Sprintf(out_str, "%s%s", + prefix, def_warnsyms[i].explanation); firstmatch = def_warnsyms[i].explanation; found++; } else { @@ -711,8 +681,8 @@ do_look(mode, click_cc) if (skipped_venom && found < 2) { x_str = def_oc_syms[VENOM_CLASS].explain; if (!found) { - Sprintf(out_str, "%s %s", - encglyph(glyph), an(x_str)); + Sprintf(out_str, "%s%s", + prefix, an(x_str)); firstmatch = x_str; found++; } else { @@ -724,8 +694,8 @@ do_look(mode, click_cc) if (iflags.bouldersym && sym == iflags.bouldersym) { if (!found) { firstmatch = "boulder"; - Sprintf(out_str, "%s %s", - encglyph(glyph), an(firstmatch)); + Sprintf(out_str, "%s%s", + prefix, an(firstmatch)); found++; } else { found += append_str(out_str, "boulder"); From 2b83895fd4db0188e06899fb6b3f249102f26656 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 9 Mar 2015 22:11:49 -0400 Subject: [PATCH 182/354] typo in format string on previous commit --- src/pager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pager.c b/src/pager.c index 377eda642..459a6daf4 100644 --- a/src/pager.c +++ b/src/pager.c @@ -538,7 +538,7 @@ do_look(mode, click_cc) if (from_screen || clicklook) Sprintf(prefix, "%s ", encglyph(glyph)); else - Sprintf(prefix, "%s ", sym); + Sprintf(prefix, "%c ", sym); /* * Check all the possibilities, saving all explanations in a buffer. From 5174eb157fc0669c9fb5f0c9fbe5d99f7831c8c9 Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 10 Mar 2015 14:25:54 -0400 Subject: [PATCH 183/354] One VS Makefile for Nethack that works with VS2010-VS2015 --- sys/winnt/Makefile.msc | 164 ++++++++++++++++++++++++++++++++++------- 1 file changed, 136 insertions(+), 28 deletions(-) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 4d2b4c066..847aa3797 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -1,13 +1,17 @@ -# NetHack 3.5 Makefile.msc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ -# NetHack 3.5 Makefile.msc $Date: 2012/04/14 00:38:09 $ $Revision: 1.54 $ -# Copyright (c) NetHack PC Development Team 1993-2012 +# NetHack 3.5 Makefile.msc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +# Copyright (c) NetHack PC Development Team 1993-2015 # -# NetHack 3.5.x Makefile for MS Visual Studio Visual C++ compiler +#============================================================================== +# Build Tools Environment +# +# NetHack 3.6.x Makefile for MS Visual Studio Visual C++ compiler # -# Win32 Compilers Tested: -# - Microsoft Visual Studio 2010 Express +# Visual Studio Compilers Tested: # - Microsoft Visual Studio 2010 Express, with the Platform SDK +# - Microsoft Visual Studio 2013 Express +# - Microsoft Visual Studio 2015 Express (pre-release) # +#============================================================================== # This is used for building two versions of NetHack: # A tty port utilizing the Win32 Console I/O subsystem, Console # NetHack; @@ -21,18 +25,71 @@ # .y yacc (such as bison) # .l lex (such as flex) # -# -# If you have any questions read the sys/winnt/Install.nt file included -# with the distribution. +# If you have any questions read the sys/winnt/Install.nt file included +# with the distribution. #============================================================================== -# Do not delete the following line. +#============================================================================== +# This section is used to determine the version of Visual Studio we are using. +# We set VSVER to 0000 to flag any version that is too old or untested. +# +!IF "$(_NMAKE_VER)" == "14.00.22310.1" +VSVER=2015 +!ELSEIF "$(_NMAKE_VER)" == "12.00.21005.1" +VSVER=2013 +!ELSEIF "$(_NMAKE_VER)" == "10.00.40219.01" +VSVER=2010 +!ELSE +VSVER=0000 #untested version +!ENDIF +# +#============================================================================== +# BUILD DECISIONS SECTION +# +# 1. 32-bit or 64-bit? +# +!IF ($(VSVER) >= 2013) +# Set your desired target to x86 (32-bit) or x64 (64-bit) here by +# uncommenting the appropriate target size. +# +# 64 bit +#TARGET_CPU=x64 +# +# 32 bit +TARGET_CPU=x86 +!ELSE +# For VS2010 use "setenv /x86" or "setenv /x64" before invoking make process +# DO NOT DELETE THE FOLLOWING LINE !include - +!ENDIF +# +#--------------------------------------------------------------- +# 2. Graphical version or command line version? +# # Graphical interface -# Set to Y for a graphical version +# Uncomment below to set to Y for a graphical version #GRAPHICAL = Y +# +#--------------------------------------------------------------- +# 3. Where do you want the game to be built (which folder)? +# + +GAMEDIR = ..\binary # Game directory + +# This marks the end of the BUILD DECISIONS section. +#============================================================================== +# +#=============================================== +#======= End of Modification Section =========== +#=============================================== +# +################################################ +# # +# Nothing below here should have to be changed.# +# # +################################################ + # Set the gamedir according to your preference. # If not present prior to compilation it gets created. @@ -42,8 +99,6 @@ GAME = NetHackW # Game Name GAME = NetHack # Game Name !ENDIF -GAMEDIR = ..\binary # Game directory - # # Source directories. Makedefs hardcodes these, don't change them. # @@ -65,6 +120,66 @@ WSHR = ..\win\share # Tile support files OBJ = o +cc=cl +link=link +rc=Rc + +# +#============================================= +# Visual Studio versions >= 2013 specific stuff +#============================================= + +!IF "$(TARGET_CPU)" == "" +TARGET_CPU=x86 +!ENDIF + +# Common compiler flags: +# -c - compile without linking +# -W3 - Set warning level to level 3 (-W4 for 64-bit compilations) +# -Zi - generate debugging information +# -Od - disable all optimizations +# -Ox - use maximum optimizations +# -Zd - generate only public symbols and line numbers for debugging +# -GS - enable security checks +# +ccommon=-c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -c +lflags=/INCREMENTAL:NO /NOLOGO + +!IF "$(TARGET_CPU)" == "x86" +cflags = $(ccommon) -D_X86_=1 -DWIN32 -D_WIN32 -W3 +scall = -Gz + +!ELSEIF "$(TARGET_CPU)" == "x64" +cflags = $(ccommon) -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 +cflags = $(cflags) -W4 +scall = +!ENDIF + +# declarations for use on Intel x86 systems +!IF "$(TARGET_CPU)" == "x86" +DLLENTRY = @12 +!ENDIF + +# declarations for use on AMD64 systems +!IF "$(TARGET_CPU)" == "x64" +DLLENTRY = +!ENDIF + +# for Windows applications +conlflags = $(lflags) -subsystem:console,$(EXEVER) +guilflags = $(lflags) -subsystem:windows,$(EXEVER) +dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll + +# basic subsystem specific libraries, less the C Run-Time +baselibs = kernel32.lib $(optlibs) $(winsocklibs) advapi32.lib +winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib + +# for Windows applications that use the C Run-Time libraries +conlibs = $(baselibs) +guilibs = $(winlibs) +# +# End of VS2013 and greater stuff +#============================================= # #========================================== @@ -134,15 +249,6 @@ PRECOMPHEAD = N # set to Y if you want to use precomp. headers #ZLIB = zlib.lib -#=============================================== -#======= End of Modification Section =========== -#=============================================== -################################################ -# # -# Nothing below here should have to be changed.# -# # -################################################ - !IF "$(GRAPHICAL)" == "Y" WINPORT = $(O)tile.o $(O)mhaskyn.o $(O)mhdlg.o \ $(O)mhfont.o $(O)mhinput.o $(O)mhmain.o $(O)mhmap.o \ @@ -420,7 +526,7 @@ OBJS = $(VOBJ01) $(VOBJ02) $(VOBJ03) $(VOBJ04) $(VOBJ05) \ $(VOBJ11) $(VOBJ12) $(VOBJ13) $(VOBJ14) $(VOBJ15) \ $(VOBJ16) $(VOBJ17) $(VOBJ18) $(VOBJ19) $(VOBJ20) \ $(VOBJ21) $(VOBJ22) $(VOBJ23) $(VOBJ24) $(VOBJ25) \ - $(VOBJ26) $(VOBJ27) + $(VOBJ26) $(VOBJ27) $(VOBJ28) $(VOBJ29) WINPOBJ = $(WINPORT) @@ -483,10 +589,10 @@ GAMEFILE = $(GAMEDIR)\$(GAME).exe # # The default make target (so just typing 'nmake' is useful). # -default : $(GAMEFILE) +default : install # -# The main target. +# The game target. # $(GAME): $(O)obj.tag $(O)utility.tag envchk $(GAMEFILE) @@ -920,10 +1026,12 @@ $(O)obj.tag: #========================================== envchk: +! IF ($(VSVER) < 2010) + @echo Your Visual Studio version is too old or untested ($(_NMAKE_VER)) +!ERROR Your Visual Studio version is too old or untested ($(_NMAKE_VER)) +! ENDIF ! IF "$(TARGET_CPU)"=="x64" @echo Windows x64 64-bit build -! ELSEIF "$(TARGET_CPU)"=="IA64" - @echo Windows x64 64-bit build ! ELSE @echo Windows x86 32-bit build ! ENDIF From 074fb69be03b95c3b04f572d3a22a61995eea44e Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 10 Mar 2015 18:00:49 -0400 Subject: [PATCH 184/354] do_look() in post-3.4.3 code fixes entry --- doc/fixes35.0 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 1e31bf65a..b6ddc30d1 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -866,6 +866,8 @@ passive attacks no longer erode armor covered by other armor dipping a fooproof item into acid no longer forgets that it's fooproof dipping a container into uncursed water now gets its contents wet sanitize petnames and fruit to prevent escape codes +do_look() in post-3.4.3 used glyph prior to setting it in pager.c + Platform- and/or Interface-Specific Fixes ----------------------------------------- From ee7e9f563b02d0238e0473299875aa34b3557b6d Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 10 Mar 2015 17:30:24 +0200 Subject: [PATCH 185/354] Fix GENERIC_USERNAMES thinko --- src/role.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/role.c b/src/role.c index 2e2cbabae..9e09d448a 100644 --- a/src/role.c +++ b/src/role.c @@ -1337,8 +1337,9 @@ plnamesuffix() i = (int)strlen(plname); eptr = GENERIC_USERNAMES; sptr = strstri(eptr, plname); - if (sptr && ((sptr == eptr && (sptr[i] == ' ' || sptr[i] == '\0')) - || sptr[i] == ' ' || sptr[i] == '\0')) + if (sptr + && (sptr == eptr || sptr[-1] == ' ') + && (sptr[i] == ' ' || sptr[i] == '\0')) *plname = '\0'; /* call askname() */ #endif From 770a92d259fde32484f6c3180b4d95d88ea0507c Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 10 Mar 2015 19:48:04 +0200 Subject: [PATCH 186/354] Add boolean option "bones" Setting bones off prevents saving and loading bones files. --- doc/Guidebook.mn | 2 ++ include/flag.h | 1 + include/patchlevel.h | 2 +- src/bones.c | 2 ++ src/options.c | 1 + 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 86094fe26..8ce5dbaad 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1927,6 +1927,8 @@ quality of the weapon; you are free to manually fill your quiver or quiver sack or make ready with the `Q' command instead. If no weapon is found or the option is false, the `t' (throw) command is executed instead. (default false) +.lp bones +Allow saving and loading bones files. (default true) .lp boulder Set the character used to display boulders (default is rock class symbol). .lp catname diff --git a/include/flag.h b/include/flag.h index a34abe839..aaff7431c 100644 --- a/include/flag.h +++ b/include/flag.h @@ -21,6 +21,7 @@ struct flag { boolean autoquiver; /* Automatically fill quiver */ boolean beginner; boolean biff; /* enable checking for mail */ + boolean bones; /* allow saving/loading bones */ boolean confirm; /* confirm before hitting tame monsters */ boolean debug; /* in debugging mode */ #define wizard flags.debug diff --git a/include/patchlevel.h b/include/patchlevel.h index 2399ca5b0..00411a2c2 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -14,7 +14,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 55 +#define EDITLEVEL 56 #define COPYRIGHT_BANNER_A \ "NetHack, Copyright 1985-2012" diff --git a/src/bones.c b/src/bones.c index 926b9079e..269152578 100644 --- a/src/bones.c +++ b/src/bones.c @@ -287,6 +287,7 @@ can_make_bones() { register struct trap *ttmp; + if (!flags.bones) return FALSE; if (ledger_no(&u.uz) <= 0 || ledger_no(&u.uz) > maxledgerno()) return FALSE; if (no_bones_level(&u.uz)) @@ -533,6 +534,7 @@ getbones() if(discover) /* save bones files for real games */ return(0); + if (!flags.bones) return (0); /* wizard check added by GAN 02/05/87 */ if(rn2(3) /* only once in three times do we find bones */ && !wizard diff --git a/src/options.c b/src/options.c index 229c2df91..98ab3724b 100644 --- a/src/options.c +++ b/src/options.c @@ -85,6 +85,7 @@ static struct Bool_Opt #else {"BIOS", (boolean *)0, FALSE, SET_IN_FILE}, #endif + {"bones", &flags.bones, TRUE, SET_IN_FILE}, #ifdef INSURANCE {"checkpoint", &flags.ins_chkpt, TRUE, SET_IN_GAME}, #else From d594f9fe019853288562987c6227ab6569164bc4 Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 10 Mar 2015 18:34:01 -0400 Subject: [PATCH 187/354] catch up on some fixes entries --- doc/fixes35.0 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index b6ddc30d1..f6519a6f7 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -866,6 +866,12 @@ passive attacks no longer erode armor covered by other armor dipping a fooproof item into acid no longer forgets that it's fooproof dipping a container into uncursed water now gets its contents wet sanitize petnames and fruit to prevent escape codes +data.base "bat" overrode later "combat" entry +data.base "gelatinous cube" and "jack boot" have their own entries +data.base "vampire bat" matched twice; use the bat entry +data.base dagger attribution started with spaces instead of tabs +remove 'if (Deaf)' guards preceding You_hear which already checks deafness +tse a menu to loot multiple containers do_look() in post-3.4.3 used glyph prior to setting it in pager.c @@ -883,6 +889,10 @@ tty: when loading user's run-time configuration, explicitly negating one of to regular ASCII and left the earlier option inaccurately set to "on" tty: various bugfixes for very wide and/or tall screens tty+GOLDOBJ: dropping or looting by menu wouldn't honor a count for gold +tty: fix crashing when a location has more than 32k items +tty: fix segfault when MD termcap is not defined +tty: do not cut off statuslines at 80 characters for wider term +tty: prevent accidental escapes from string entries unix: remove use of parentheses in nethack man page usage that confused a man page conversion tool unix: new -wwindowtype option @@ -890,6 +900,7 @@ unix: don't clobber old level files if 2nd hangup/disconnect occurs while reconnected user is responding to the "destroy old game?" prompt unix/Qt: saved games were not found if nethack was built with prefixes in use unix,vms: allow digits after first character in name at "Who are you?" prompt +unix: implement fcntl(2) locking on systems that can handle it vms: the DLB configuration could fail to build if a file without a dot in its name happened to match a logical name Windows: starting a game with nethack.exe (tty) and saving, then restoring @@ -1065,6 +1076,10 @@ dipping multiple potions in another potion may only dip part of their stack make being inside a stinking cloud (when not immune or resistant) become a major trouble which is fixable by prayer introduce some variation in monster movement rates +Add database entry for shuriken and make it match throwing star +Add database entry for fedora +Add database entry for land mine +change command X to twoweapon toggle Platform- and/or Interface-Specific New Features @@ -1133,4 +1148,5 @@ make REINCARNATION make TOURIST unconditional make KOPS unconditional make ELBERETH unconditional +allow defining of generic usernames in config.h instead of hard-coding in role.c From 21cce7fbe6bc6cefd470090885b64e813a321295 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 11 Mar 2015 17:16:05 +0200 Subject: [PATCH 188/354] getpos improvements: automatic description Pressing '@' will move the cursor on top of the hero. Pressing '#' will toggle automatic description mode, where the feature under the cursor is automatically described when the cursor is moved. --- doc/fixes35.0 | 3 + src/do_name.c | 43 ++++- src/pager.c | 427 ++++++++++++++++++++++++++------------------------ 3 files changed, 271 insertions(+), 202 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index f6519a6f7..89646e389 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1080,6 +1080,9 @@ Add database entry for shuriken and make it match throwing star Add database entry for fedora Add database entry for land mine change command X to twoweapon toggle +pressing @ when cursor positioning moves cursor on top of hero +pressing # when cursor positioning toggles automatic description of features + under the cursor Platform- and/or Interface-Specific New Features diff --git a/src/do_name.c b/src/do_name.c index 4face203e..ce538adb4 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -40,6 +40,8 @@ const char *goal; putstr(tmpwin, 0, sbuf); putstr(tmpwin, 0, "Use [HJKL] to move the cursor 8 units at a time."); putstr(tmpwin, 0, "Or enter a background symbol (ex. <)."); + putstr(tmpwin, 0, "Use @ to move the cursor on yourself."); + putstr(tmpwin, 0, "Use # to toggle automatic description."); /* disgusting hack; the alternate selection characters work for any getpos call, but they only matter for dowhatis (and doquickwhatis) */ doing_what_is = (goal == what_is_an_unknown_object); @@ -63,6 +65,8 @@ const char *goal; int cx, cy, i, c; int sidx, tx, ty; boolean msg_given = TRUE; /* clear message window by default */ + boolean auto_msg = FALSE; + boolean show_goal_msg = FALSE; static const char pick_chars[] = ".,;:"; const char *cp; @@ -82,7 +86,32 @@ const char *goal; lock_mouse_cursor(TRUE); #endif for (;;) { + + if (show_goal_msg) { + pline("Move cursor to %s:", goal); + curs(WIN_MAP, cx, cy); + flush_screen(0); + show_goal_msg = FALSE; + } else if (auto_msg && !msg_given) { + coord cc; + int sym = 0; + char tmpbuf[BUFSZ]; + char *firstmatch = NULL; + cc.x = cx; + cc.y = cy; + if (do_screen_description(cc, TRUE, sym, tmpbuf, &firstmatch)) { + /* there may be an encoded glyph */ + putmixed(WIN_MESSAGE, 0, tmpbuf); + curs(WIN_MAP, cx, cy); + flush_screen(0); + } + } + c = nh_poskey(&tx, &ty, &sidx); + + if (auto_msg) + msg_given = FALSE; + if (c == '\033') { cx = cy = -10; msg_given = TRUE; /* force clear */ @@ -142,8 +171,20 @@ const char *goal; else /* ^R */ docrt(); /* redraw */ /* update message window to reflect that we're still targetting */ - pline("Move cursor to %s:", goal); + show_goal_msg = TRUE; msg_given = TRUE; + } else if (c == '#') { + auto_msg = !auto_msg; + pline("Automatic description %sis %s.", + flags.verbose ? "of features under cursor " : "", + auto_msg ? "on" : "off"); + if (!auto_msg) show_goal_msg = TRUE; + msg_given = TRUE; + goto nxtc; + } else if (c == '@') { + cx = u.ux; + cy = u.uy; + goto nxtc; } else { if (!index(quitchars, c)) { char matching[MAXPCHARS]; diff --git a/src/pager.c b/src/pager.c index 459a6daf4..af36ba6e0 100644 --- a/src/pager.c +++ b/src/pager.c @@ -437,6 +437,229 @@ bad_data_file: impossible("'data' file in wrong format"); (void) dlb_fclose(fp); } +int +do_screen_description(cc, looked, sym, out_str, firstmatch) +coord cc; +boolean looked; +int sym; +char *out_str; +const char **firstmatch; +{ + boolean need_to_look = FALSE; + int glyph; + char look_buf[BUFSZ], prefix[BUFSZ]; + int found = 0; /* count of matching syms found */ + int i; + int skipped_venom = 0; + boolean hit_trap; + const char *x_str; + static const char *mon_interior = "the interior of a monster"; + struct permonst *pm = NULL; + + if (looked) { + int oc, so; + unsigned os; + + glyph = glyph_at(cc.x,cc.y); + + /* Convert the glyph at the selected position to a symbol. */ + so = mapglyph(glyph, &sym, &oc, &os, cc.x, cc.y); + } + + if (looked) + Sprintf(prefix, "%s ", encglyph(glyph)); + else + Sprintf(prefix, "%c ", sym); + + /* + * Check all the possibilities, saving all explanations in a buffer. + * When all have been checked then the string is printed. + */ + + /* Check for monsters */ + for (i = 0; i < MAXMCLASSES; i++) { + if (sym == ((looked) ? + showsyms[i + SYM_OFF_M] : def_monsyms[i].sym) && + def_monsyms[i].explain) { + need_to_look = TRUE; + if (!found) { + Sprintf(out_str, "%s%s", + prefix, an(def_monsyms[i].explain)); + *firstmatch = def_monsyms[i].explain; + found++; + } else { + found += append_str(out_str, an(def_monsyms[i].explain)); + } + } + } + /* handle '@' as a special case if it refers to you and you're + playing a character which isn't normally displayed by that + symbol; firstmatch is assumed to already be set for '@' */ + if (((looked) ? + (sym == showsyms[S_HUMAN + SYM_OFF_M] && cc.x == u.ux && cc.y == u.uy) : + (sym == def_monsyms[S_HUMAN].sym && !flags.showrace)) && + !(Race_if(PM_HUMAN) || Race_if(PM_ELF)) && !Upolyd) + found += append_str(out_str, "you"); /* tack on "or you" */ + + /* + * Special case: if identifying from the screen, and we're swallowed, + * and looking at something other than our own symbol, then just say + * "the interior of a monster". + */ + if (u.uswallow && (looked) && is_swallow_sym(sym)) { + if (!found) { + Sprintf(out_str, "%s%s", + prefix, mon_interior); + *firstmatch = mon_interior; + } else { + found += append_str(out_str, mon_interior); + } + need_to_look = TRUE; + } + + /* Now check for objects */ + for (i = 1; i < MAXOCLASSES; i++) { + if (sym == ((looked) ? + showsyms[i + SYM_OFF_O] : def_oc_syms[i].sym)) { + need_to_look = TRUE; + if ((looked) && i == VENOM_CLASS) { + skipped_venom++; + continue; + } + if (!found) { + Sprintf(out_str, "%s%s", + prefix, an(def_oc_syms[i].explain)); + *firstmatch = def_oc_syms[i].explain; + found++; + } else { + found += append_str(out_str, an(def_oc_syms[i].explain)); + } + } + } + + if (sym == DEF_INVISIBLE) { + if (!found) { + Sprintf(out_str, "%s%s", + prefix, + an(invisexplain)); + *firstmatch = invisexplain; + found++; + } else { + found += append_str(out_str, an(invisexplain)); + } + } + +#define is_cmap_trap(i) ((i) >= S_arrow_trap && (i) <= S_polymorph_trap) +#define is_cmap_drawbridge(i) ((i) >= S_vodbridge && (i) <= S_hcdbridge) + + /* Now check for graphics symbols */ + for (hit_trap = FALSE, i = 0; i < MAXPCHARS; i++) { + x_str = defsyms[i].explanation; + if (sym == ((looked) ? + showsyms[i] : defsyms[i].sym) && *x_str) { + /* avoid "an air", "a water", or "a floor of a room" */ + int article = (i == S_room) ? 2 : /* 2=>"the" */ + !(strcmp(x_str, "air") == 0 || /* 1=>"an" */ + strcmp(x_str, "water") == 0); /* 0=>(none)*/ + + if (!found) { + if (is_cmap_trap(i)) { + Sprintf(out_str, "%sa trap", prefix); + hit_trap = TRUE; + } else { + Sprintf(out_str, "%s%s", + prefix, + article == 2 ? the(x_str) : + article == 1 ? an(x_str) : x_str); + } + *firstmatch = x_str; + found++; + } else if (!u.uswallow && !(hit_trap && is_cmap_trap(i)) && + !(found >= 3 && is_cmap_drawbridge(i))) { + found += append_str(out_str, + article == 2 ? the(x_str) : + article == 1 ? an(x_str) : x_str); + if (is_cmap_trap(i)) hit_trap = TRUE; + } + + if (i == S_altar || is_cmap_trap(i)) + need_to_look = TRUE; + } + } + + /* Now check for warning symbols */ + for (i = 1; i < WARNCOUNT; i++) { + x_str = def_warnsyms[i].explanation; + if (sym == ((looked) ? + warnsyms[i] : def_warnsyms[i].sym)) { + if (!found) { + Sprintf(out_str, "%s%s", + prefix, def_warnsyms[i].explanation); + *firstmatch = def_warnsyms[i].explanation; + found++; + } else { + found += append_str(out_str, def_warnsyms[i].explanation); + } + /* Kludge: warning trumps boulders on the display. + Reveal the boulder too or player can get confused */ + if ((looked) && sobj_at(BOULDER, cc.x, cc.y)) + Strcat(out_str, " co-located with a boulder"); + break; /* out of for loop*/ + } + } + + /* if we ignored venom and list turned out to be short, put it back */ + if (skipped_venom && found < 2) { + x_str = def_oc_syms[VENOM_CLASS].explain; + if (!found) { + Sprintf(out_str, "%s%s", + prefix, an(x_str)); + *firstmatch = x_str; + found++; + } else { + found += append_str(out_str, an(x_str)); + } + } + + /* handle optional boulder symbol as a special case */ + if (iflags.bouldersym && sym == iflags.bouldersym) { + if (!found) { + *firstmatch = "boulder"; + Sprintf(out_str, "%s%s", + prefix, an(*firstmatch)); + found++; + } else { + found += append_str(out_str, "boulder"); + } + } + + /* + * If we are looking at the screen, follow multiple possibilities or + * an ambiguous explanation by something more detailed. + */ + if (looked) { + if (found > 1 || need_to_look) { + char monbuf[BUFSZ]; + char temp_buf[BUFSZ]; + + pm = lookat(cc.x, cc.y, look_buf, monbuf); + *firstmatch = look_buf; + if (*(*firstmatch)) { + Sprintf(temp_buf, " (%s)", *firstmatch); + (void)strncat(out_str, temp_buf, BUFSZ-strlen(out_str)-1); + found = 1; /* we have something to look up */ + } + if (monbuf[0]) { + Sprintf(temp_buf, " [seen: %s]", monbuf); + (void)strncat(out_str, temp_buf, BUFSZ-strlen(out_str)-1); + } + } + } + + return found; +} + + /* getpos() return values */ #define LOOK_TRADITIONAL 0 /* '.' -- ask about "more info?" */ #define LOOK_QUICK 1 /* ',' -- skip "more info?" */ @@ -453,19 +676,15 @@ do_look(mode, click_cc) { boolean quick = (mode == 1); /* use cursor && don't search for "more info" */ boolean clicklook = (mode == 2); /* right mouse-click method */ - char out_str[BUFSZ], look_buf[BUFSZ], prefix[BUFSZ]; - const char *x_str, *firstmatch = 0; + char out_str[BUFSZ]; + const char *firstmatch = 0; struct permonst *pm = 0; - int glyph; /* glyph at selected position */ int i, ans = 0; int sym; /* typed symbol or converted glyph */ int found; /* count of matching syms found */ coord cc; /* screen pos of unknown glyph */ boolean save_verbose; /* saved value of flags.verbose */ boolean from_screen; /* question from the screen */ - boolean need_to_look; /* need to get explan. from glyph */ - boolean hit_trap; /* true if found trap explanation */ - int skipped_venom; /* non-zero if we ignored "splash of venom" */ static const char *mon_interior = "the interior of a monster"; if (!clicklook) { @@ -506,9 +725,7 @@ do_look(mode, click_cc) */ do { /* Reset some variables. */ - need_to_look = FALSE; pm = (struct permonst *)0; - skipped_venom = 0; found = 0; out_str[0] = '\0'; @@ -529,201 +746,9 @@ do_look(mode, click_cc) } flags.verbose = FALSE; /* only print long question once */ } - glyph = glyph_at(cc.x,cc.y); - - /* Convert the glyph at the selected position to a symbol. */ - so = mapglyph(glyph, &sym, &oc, &os, cc.x, cc.y); } - if (from_screen || clicklook) - Sprintf(prefix, "%s ", encglyph(glyph)); - else - Sprintf(prefix, "%c ", sym); - - /* - * Check all the possibilities, saving all explanations in a buffer. - * When all have been checked then the string is printed. - */ - - /* Check for monsters */ - for (i = 0; i < MAXMCLASSES; i++) { - if (sym == ((from_screen || clicklook) ? - showsyms[i + SYM_OFF_M] : def_monsyms[i].sym) && - def_monsyms[i].explain) { - need_to_look = TRUE; - if (!found) { - Sprintf(out_str, "%s%s", - prefix, an(def_monsyms[i].explain)); - firstmatch = def_monsyms[i].explain; - found++; - } else { - found += append_str(out_str, an(def_monsyms[i].explain)); - } - } - } - /* handle '@' as a special case if it refers to you and you're - playing a character which isn't normally displayed by that - symbol; firstmatch is assumed to already be set for '@' */ - if (((from_screen || clicklook) ? - (sym == showsyms[S_HUMAN + SYM_OFF_M] && cc.x == u.ux && cc.y == u.uy) : - (sym == def_monsyms[S_HUMAN].sym && !flags.showrace)) && - !(Race_if(PM_HUMAN) || Race_if(PM_ELF)) && !Upolyd) - found += append_str(out_str, "you"); /* tack on "or you" */ - - /* - * Special case: if identifying from the screen, and we're swallowed, - * and looking at something other than our own symbol, then just say - * "the interior of a monster". - */ - if (u.uswallow && (from_screen || clicklook) && is_swallow_sym(sym)) { - if (!found) { - Sprintf(out_str, "%s%s", - prefix, mon_interior); - firstmatch = mon_interior; - } else { - found += append_str(out_str, mon_interior); - } - need_to_look = TRUE; - } - - /* Now check for objects */ - for (i = 1; i < MAXOCLASSES; i++) { - if (sym == ((from_screen || clicklook) ? - showsyms[i + SYM_OFF_O] : def_oc_syms[i].sym)) { - need_to_look = TRUE; - if ((from_screen || clicklook) && i == VENOM_CLASS) { - skipped_venom++; - continue; - } - if (!found) { - Sprintf(out_str, "%s%s", - prefix, an(def_oc_syms[i].explain)); - firstmatch = def_oc_syms[i].explain; - found++; - } else { - found += append_str(out_str, an(def_oc_syms[i].explain)); - } - } - } - - if (sym == DEF_INVISIBLE) { - if (!found) { - Sprintf(out_str, "%s%s", - prefix, - an(invisexplain)); - firstmatch = invisexplain; - found++; - } else { - found += append_str(out_str, an(invisexplain)); - } - } - -#define is_cmap_trap(i) ((i) >= S_arrow_trap && (i) <= S_polymorph_trap) -#define is_cmap_drawbridge(i) ((i) >= S_vodbridge && (i) <= S_hcdbridge) - - /* Now check for graphics symbols */ - for (hit_trap = FALSE, i = 0; i < MAXPCHARS; i++) { - x_str = defsyms[i].explanation; - if (sym == ((from_screen || clicklook) ? - showsyms[i] : defsyms[i].sym) && *x_str) { - /* avoid "an air", "a water", or "a floor of a room" */ - int article = (i == S_room) ? 2 : /* 2=>"the" */ - !(strcmp(x_str, "air") == 0 || /* 1=>"an" */ - strcmp(x_str, "water") == 0); /* 0=>(none)*/ - - if (!found) { - if (is_cmap_trap(i)) { - Sprintf(out_str, "%sa trap", prefix); - hit_trap = TRUE; - } else { - Sprintf(out_str, "%s%s", - prefix, - article == 2 ? the(x_str) : - article == 1 ? an(x_str) : x_str); - } - firstmatch = x_str; - found++; - } else if (!u.uswallow && !(hit_trap && is_cmap_trap(i)) && - !(found >= 3 && is_cmap_drawbridge(i))) { - found += append_str(out_str, - article == 2 ? the(x_str) : - article == 1 ? an(x_str) : x_str); - if (is_cmap_trap(i)) hit_trap = TRUE; - } - - if (i == S_altar || is_cmap_trap(i)) - need_to_look = TRUE; - } - } - - /* Now check for warning symbols */ - for (i = 1; i < WARNCOUNT; i++) { - x_str = def_warnsyms[i].explanation; - if (sym == ((from_screen || clicklook) ? - warnsyms[i] : def_warnsyms[i].sym)) { - if (!found) { - Sprintf(out_str, "%s%s", - prefix, def_warnsyms[i].explanation); - firstmatch = def_warnsyms[i].explanation; - found++; - } else { - found += append_str(out_str, def_warnsyms[i].explanation); - } - /* Kludge: warning trumps boulders on the display. - Reveal the boulder too or player can get confused */ - if ((from_screen || clicklook) && sobj_at(BOULDER, cc.x, cc.y)) - Strcat(out_str, " co-located with a boulder"); - break; /* out of for loop*/ - } - } - - /* if we ignored venom and list turned out to be short, put it back */ - if (skipped_venom && found < 2) { - x_str = def_oc_syms[VENOM_CLASS].explain; - if (!found) { - Sprintf(out_str, "%s%s", - prefix, an(x_str)); - firstmatch = x_str; - found++; - } else { - found += append_str(out_str, an(x_str)); - } - } - - /* handle optional boulder symbol as a special case */ - if (iflags.bouldersym && sym == iflags.bouldersym) { - if (!found) { - firstmatch = "boulder"; - Sprintf(out_str, "%s%s", - prefix, an(firstmatch)); - found++; - } else { - found += append_str(out_str, "boulder"); - } - } - - /* - * If we are looking at the screen, follow multiple possibilities or - * an ambiguous explanation by something more detailed. - */ - if (from_screen || clicklook) { - if (found > 1 || need_to_look) { - char monbuf[BUFSZ]; - char temp_buf[BUFSZ]; - - pm = lookat(cc.x, cc.y, look_buf, monbuf); - firstmatch = look_buf; - if (*firstmatch) { - Sprintf(temp_buf, " (%s)", firstmatch); - (void)strncat(out_str, temp_buf, BUFSZ-strlen(out_str)-1); - found = 1; /* we have something to look up */ - } - if (monbuf[0]) { - Sprintf(temp_buf, " [seen: %s]", monbuf); - (void)strncat(out_str, temp_buf, BUFSZ-strlen(out_str)-1); - } - } - } + found = do_screen_description(cc, (from_screen||clicklook), sym, out_str, &firstmatch); /* Finally, print out our explanation. */ if (found) { From 36995448fb6fa9a76d2151b7278aa9b74d145dd3 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 11 Mar 2015 19:56:34 +0200 Subject: [PATCH 189/354] Add MAX_STATUENAME_RANK sysconf setting MAX_STATUENAME_RANK tells how many score file entries to use for random statue names. --- doc/Guidebook.mn | 4 ++++ include/sys.h | 1 + src/files.c | 7 +++++++ src/sys.c | 1 + src/topten.c | 2 +- sys/unix/sysconf | 3 +++ 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 8ce5dbaad..4c499ac96 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2945,6 +2945,10 @@ Minimum number of points to get an entry in the score file. PERS_IS_UID 0 or 1 to use user names or numeric userids, respectively, to identify unique people for the score file. +.lp +MAX_STATUENAME_RANK +Maximum number of score file entries to use for random statue names +(default is 10). .hn 1 Scoring .pg diff --git a/include/sys.h b/include/sys.h index 713e33a55..8358021a2 100644 --- a/include/sys.h +++ b/include/sys.h @@ -22,6 +22,7 @@ struct sysopt { int pers_is_uid; int entrymax; int pointsmin; + int tt_oname_maxrank; #ifdef PANICTRACE /* panic options */ char *gdbpath; diff --git a/src/files.c b/src/files.c index 2cae9fb7f..d4c216276 100644 --- a/src/files.c +++ b/src/files.c @@ -2209,6 +2209,13 @@ int src; return 0; } sysopt.pointsmin = n; + } else if (src == SET_IN_SYS && match_varname(buf, "MAX_STATUENAME_RANK", 10)) { + n = atoi(bufp); + if (n < 1) { + raw_printf("Illegal value in MAX_STATUENAME_RANK (minimum is 1)."); + return 0; + } + sysopt.tt_oname_maxrank = n; # ifdef PANICTRACE } else if (src == SET_IN_SYS && match_varname(buf, "PANICTRACE_LIBC", 15)) { diff --git a/src/sys.c b/src/sys.c index 5f17a0a91..14e0aa642 100644 --- a/src/sys.c +++ b/src/sys.c @@ -29,6 +29,7 @@ sys_early_init(){ sysopt.entrymax = ENTRYMAX; sysopt.pointsmin = POINTSMIN; sysopt.pers_is_uid = PERS_IS_UID; + sysopt.tt_oname_maxrank = 10; /* sanity checks */ if(PERSMAX<1) sysopt.persmax = 1; diff --git a/src/topten.c b/src/topten.c index 58079a6de..db2e6fccb 100644 --- a/src/topten.c +++ b/src/topten.c @@ -975,7 +975,7 @@ struct obj *otmp; } tt = &tt_buf; - rank = rnd(10); + rank = rnd(sysopt.tt_oname_maxrank); pickentry: for(i = rank; i; i--) { readentry(rfile, tt); diff --git a/sys/unix/sysconf b/sys/unix/sysconf index 74e7fb1ae..cff28b04f 100644 --- a/sys/unix/sysconf +++ b/sys/unix/sysconf @@ -45,6 +45,9 @@ MAXPLAYERS=10 # numeric (1) user id. #PERS_IS_UID=1 +# Maximum number of score file entries to use for random statue names +#MAX_STATUENAME_RANK=10 + # Try to get more info in case of a program bug or crash. Using GDB can # get more information and works on more systems but requires gdb be available; # using LIBC only works if NetHack is linked with a libc that supports the From 9e0d8deaedffa224827a0c6e29527f2500f8644b Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 11 Mar 2015 21:56:12 +0200 Subject: [PATCH 190/354] TTY: Implement the menu_search command When in a menu that allows selecting entries, press ':' to enter any text. Entries that match the text (via pmatch) will be toggled. --- doc/Guidebook.mn | 2 +- doc/fixes35.0 | 1 + win/tty/wintty.c | 86 ++++++++++++++++++++++++++++++++++++------------ 3 files changed, 67 insertions(+), 22 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 4c499ac96..82fa2d195 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2104,7 +2104,7 @@ Implemented by the Amiga, Gem and tty ports. Default '<'. .lp menu_search Menu character accelerator to search for a menu item. -Implemented by the Amiga, Gem and X11 ports. +Implemented by the Amiga, Gem, X11 and tty ports. Default ':'. .lp menu_select_all Menu character accelerator to select all items in a menu. diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 89646e389..2da27738f 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1097,6 +1097,7 @@ win32tty: support for 'selectsaved' option for menu of existing save files to choose from at game startup tty: add window port routines for saving/restoring message history tty: enhanced role, race, &c selection at start of new game +tty: implement : (menu_search) command smartphone: added "Type Cmd" command that allows to type arbitrary commands using phone keypad smartphone: added Q(quiver) command to "Attack" layout diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 19af943b9..a201218e7 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -201,6 +201,7 @@ static const char default_menu_cmds[] = { MENU_SELECT_PAGE, MENU_UNSELECT_PAGE, MENU_INVERT_PAGE, + MENU_SEARCH, 0 /* null terminator */ }; @@ -1228,6 +1229,42 @@ tty_clear_nhwindow(window) cw->curx = cw->cury = 0; } + +boolean +toggle_menu_curr(window, curr, lineno, in_view, counting, count) +winid window; +tty_menu_item *curr; +int lineno; +boolean in_view, counting; +long count; +{ + if (curr->selected) { + if (counting && count > 0) { + curr->count = count; + if (in_view) set_item_state(window, lineno, curr); + return TRUE; + } else { /* change state */ + curr->selected = FALSE; + curr->count = -1L; + if (in_view) set_item_state(window, lineno, curr); + return TRUE; + } + } else { /* !selected */ + if (counting && count > 0) { + curr->count = count; + curr->selected = TRUE; + if (in_view) set_item_state(window, lineno, curr); + return TRUE; + } else if (!counting) { + curr->selected = TRUE; + if (in_view) set_item_state(window, lineno, curr); + return TRUE; + } + /* do nothing counting&&count==0 */ + } + return FALSE; +} + STATIC_OVL void dmore(cw, s) register struct WinDesc *cw; @@ -1600,6 +1637,33 @@ struct WinDesc *cw; if (cw->how == PICK_ANY) invert_all(window, page_start, page_end, 0); break; + case MENU_SEARCH: + if (cw->how == PICK_NONE) { + tty_nhbell(); + break; + } else { + char searchbuf[BUFSZ], tmpbuf[BUFSZ]; + boolean on_curr_page = FALSE; + int lineno = 0; + tty_getlin("Search for:", tmpbuf); + if (!tmpbuf || tmpbuf[0] == '\033') break; + Sprintf(searchbuf, "*%s*", tmpbuf); + for (curr = cw->mlist; curr; curr = curr->next) { + if (on_curr_page) lineno++; + if (curr == page_start) + on_curr_page = TRUE; + else if (curr == page_end) + on_curr_page = FALSE; + if (curr->identifier.a_void && pmatch(searchbuf, curr->str)) { + toggle_menu_curr(window, curr, lineno, on_curr_page, counting, count); + if (cw->how == PICK_ONE) { + finished = TRUE; + break; + } + } + } + } + break; default: if (cw->how == PICK_NONE || !index(resp, morc)) { /* unacceptable input received */ @@ -1618,27 +1682,7 @@ struct WinDesc *cw; curr != page_end; n++, curr = curr->next) if (morc == curr->selector) { - if (curr->selected) { - if (counting && count > 0) { - curr->count = count; - set_item_state(window, n, curr); - } else { /* change state */ - curr->selected = FALSE; - curr->count = -1L; - set_item_state(window, n, curr); - } - } else { /* !selected */ - if (counting && count > 0) { - curr->count = count; - curr->selected = TRUE; - set_item_state(window, n, curr); - } else if (!counting) { - curr->selected = TRUE; - set_item_state(window, n, curr); - } - /* do nothing counting&&count==0 */ - } - + toggle_menu_curr(window, curr, n, TRUE, counting, count); if (cw->how == PICK_ONE) finished = TRUE; break; /* from `for' loop */ } From ad1d6827513778f8127be93f7086555b489ffea8 Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 11 Mar 2015 21:57:36 -0400 Subject: [PATCH 191/354] from ais523 list: charge for boulder filling pit --- doc/fixes35.0 | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 2da27738f..4ad731e36 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -873,6 +873,7 @@ data.base dagger attribution started with spaces instead of tabs remove 'if (Deaf)' guards preceding You_hear which already checks deafness tse a menu to loot multiple containers do_look() in post-3.4.3 used glyph prior to setting it in pager.c +charge for a boulder that fills a pit in shop Platform- and/or Interface-Specific Fixes From 631005ed030ba20995fd396c8665952a798a4eea Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 11 Mar 2015 23:04:02 -0400 Subject: [PATCH 192/354] charge for a boulder that fills a pit in shop Changes to be committed: modified: src/do.c From the email sent by ais523 earlier: > You aren't charged for digging a pit below an unpaid boulder > (causing the boulder to fill the pit). --- src/do.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/do.c b/src/do.c index 30cfb77f1..3069a4047 100644 --- a/src/do.c +++ b/src/do.c @@ -179,7 +179,7 @@ const char *verb; } } deltrap(t); - obfree(obj, (struct obj *)0); + useupf(obj, 1L); bury_objs(x, y); newsym(x,y); return TRUE; From 73b944037abecfed294d3d07713b1482bb814627 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 12 Mar 2015 17:57:13 +0200 Subject: [PATCH 193/354] Fix warnings --- include/extern.h | 1 + src/do_name.c | 2 +- src/pager.c | 10 +++------- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/include/extern.h b/include/extern.h index 0bd3aab7b..f382c4f7a 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1582,6 +1582,7 @@ E int NDECL(dowhatdoes); E char *FDECL(dowhatdoes_core,(CHAR_P, char *)); E int NDECL(dohelp); E int NDECL(dohistory); +E int FDECL(do_screen_description, (coord, BOOLEAN_P, int, char *, const char **)); E int FDECL(do_look, (int, coord *)); /* ### pcmain.c ### */ diff --git a/src/do_name.c b/src/do_name.c index ce538adb4..f1960b6ff 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -96,7 +96,7 @@ const char *goal; coord cc; int sym = 0; char tmpbuf[BUFSZ]; - char *firstmatch = NULL; + const char *firstmatch = NULL; cc.x = cx; cc.y = cy; if (do_screen_description(cc, TRUE, sym, tmpbuf, &firstmatch)) { diff --git a/src/pager.c b/src/pager.c index af36ba6e0..bb1c82e72 100644 --- a/src/pager.c +++ b/src/pager.c @@ -454,16 +454,15 @@ const char **firstmatch; boolean hit_trap; const char *x_str; static const char *mon_interior = "the interior of a monster"; - struct permonst *pm = NULL; if (looked) { - int oc, so; + int oc; unsigned os; glyph = glyph_at(cc.x,cc.y); /* Convert the glyph at the selected position to a symbol. */ - so = mapglyph(glyph, &sym, &oc, &os, cc.x, cc.y); + (void) mapglyph(glyph, &sym, &oc, &os, cc.x, cc.y); } if (looked) @@ -642,7 +641,7 @@ const char **firstmatch; char monbuf[BUFSZ]; char temp_buf[BUFSZ]; - pm = lookat(cc.x, cc.y, look_buf, monbuf); + (void) lookat(cc.x, cc.y, look_buf, monbuf); *firstmatch = look_buf; if (*(*firstmatch)) { Sprintf(temp_buf, " (%s)", *firstmatch); @@ -685,7 +684,6 @@ do_look(mode, click_cc) coord cc; /* screen pos of unknown glyph */ boolean save_verbose; /* saved value of flags.verbose */ boolean from_screen; /* question from the screen */ - static const char *mon_interior = "the interior of a monster"; if (!clicklook) { if (quick) { @@ -730,8 +728,6 @@ do_look(mode, click_cc) out_str[0] = '\0'; if (from_screen || clicklook) { - int oc, so; - unsigned os; if (from_screen) { if (flags.verbose) pline("Please move the cursor to %s.", From 3b89c474ab6a82548cb4608031c5c15e6934f300 Mon Sep 17 00:00:00 2001 From: "Derek S. Ray" Date: Thu, 12 Mar 2015 22:47:44 -0400 Subject: [PATCH 194/354] Initial version of simple recipes file --- DEVEL/git_recipes.txt | 115 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 DEVEL/git_recipes.txt diff --git a/DEVEL/git_recipes.txt b/DEVEL/git_recipes.txt new file mode 100644 index 000000000..49c7a7cca --- /dev/null +++ b/DEVEL/git_recipes.txt @@ -0,0 +1,115 @@ +Git has a messy learning curve. This file is an attempt to serve as a quick +reference for basic tasks while you get up to speed. + +------------------------ + +git checkout [-f] (branch) + +Switch your local repository to be at the most recent commit of (branch). +Including -f will discard changes made in the working directory. + + +git status [-uall | -uno] + +Shows all changed files in your local repository and also a list of the ones +you have staged for commit. +Including -uall will also show you all untracked files in all subdirectories. +Including -uno will show you _no_ untracked files. + + +git log [-NUM] +git log +git log [--pretty=one] +git log (branch) + +For a full explanation of all the arguments you can pass to 'log', please see +the manual; there are a lot and these are just a few of the common ones. For +our purposes, git log will show you all the commits according to criteria +you specify: + +-NUM: The last NUM commits in this branch + : all commits between commit1 and commit2 +-pretty=one: format output as a single line for each entry +(branch): show the commits from (branch) instead of the current one + + +git add (filename) + +Adds the changes you've made in (filename) to the pre-commit staging area. +(also referred to as the 'index') + + +git commit [-a] [-m "text"] + +Commits all staged changes (in the index) to this branch in your local repo +from your current position. +Including -a will 'git add' all eligible files before doing so. +Including -m will use "text" as the commit message instead of opening an +editor window for you to create one. + + +git push [--all] [-u origin (branch)] + +Sends all your commits for the current branch to the centralized repo. +Including --all will send the commits for _all_ branches. +Specifying -u is only needed the first time you push (branch) that you +created; it establishes the connection between local and remote for that +branch. + + +git reset [--hard] (filename) + +Without any parameters, unstages the changes for (filename) from the index; +does not change the working tree. This is the equivalent of the command +git reset --mixed (filename); git reset --soft (filename) has no effect. + +With --hard, unstages (filename) from the index and reverts (filename) in +the working tree to the most recent commit. + +*** WARNING *** --hard _will_ throw away your changes. + + +[DSR: I'm hesitant about including this command because you can trash stuff +with it. But at the same time, for people who are adapting to a commit not +also automatically being a send, it's nice for them to know how to undo one in +case they do something wrong. thoughts?] + +git reset [--soft | --mixed | --hard] HEAD~1 + +*** WARNING *** Never, EVER do this to a commit that you have already pushed; +you will be rewriting history on other people's machines and this will +generally turn out very poorly. + +With --soft, undoes the most recent 'git commit' action, but leaves the +changes in the index and in the working directory. + +With --mixed, does everything --soft does but also unstages the changes from +the index. If you don't specify one of the three, reset will assume this. + +With --hard, does everything --mixed does but also reverts the working tree to +the prior commit. + +*** WARNING *** --hard will effectively delete a commit and "lose" the changes. + + +git fetch [-a] + +Retrieve commits from the remote repository to your machine. +Including -a will get commits for all branches. + + +git pull + +Incorporate any fetched commits for the current branch into your repository +and update your position accordingly. + + +git merge (branch) [--no-commit] + +Merges all the changes from (branch) since it last diverged from a common +ancestor into your current branch. + +With --no-commit, does not automatically create a merge entry in the log but +leaves all the merged files in your working directory; to complete the merge +you must commit them manually later (likely after you have edited them). + From f2d9494d959df06891be5d3f62a932643bef322d Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 13 Mar 2015 01:02:09 -0400 Subject: [PATCH 195/354] abuse wisdom in keeping with Rider eating msg The death message for eating a Rider is "unwisely tried to eat...", but it doesn't abuse Wisdom (potentially relevant if you lifesave) --- doc/fixes35.0 | 1 + src/eat.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 4ad731e36..3ac75e94e 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -874,6 +874,7 @@ remove 'if (Deaf)' guards preceding You_hear which already checks deafness tse a menu to loot multiple containers do_look() in post-3.4.3 used glyph prior to setting it in pager.c charge for a boulder that fills a pit in shop +abuse wisdom in keeping with Rider eating message Platform- and/or Interface-Specific Fixes diff --git a/src/eat.c b/src/eat.c index 320fa2351..793925fb7 100644 --- a/src/eat.c +++ b/src/eat.c @@ -659,6 +659,8 @@ register int pm; mons[pm].mname); killer.format = NO_KILLER_PREFIX; done(DIED); + /* life-saving needed to reach here */ + exercise(A_WIS, FALSE); /* It so happens that since we know these monsters */ /* cannot appear in tins, context.victual.piece will always */ /* be what we want, which is not generally true. */ From c2ed47803a632d1266c967db4143521e6bb954ab Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 13 Mar 2015 07:33:32 -0400 Subject: [PATCH 196/354] "swallowed whole" was preceded by "You bite into" Another reported by ais523: The death message "swallowed %s whole" is preceded by "You bite into %s."; these contradict. --- doc/fixes35.0 | 2 ++ src/uhitm.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 3ac75e94e..614bbe57f 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -875,6 +875,8 @@ tse a menu to loot multiple containers do_look() in post-3.4.3 used glyph prior to setting it in pager.c charge for a boulder that fills a pit in shop abuse wisdom in keeping with Rider eating message +message inconsistency: death message "swallowed whole" was preceded + by "You bite into" Platform- and/or Interface-Specific Fixes diff --git a/src/uhitm.c b/src/uhitm.c index 21de567e5..80f38addf 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1822,7 +1822,7 @@ register struct attack *mattk; const char *mname = pd->mname; if (!type_is_pname(pd)) mname = an(mname); - You("bite into %s.", mon_nam(mdef)); + You("englut %s.", mon_nam(mdef)); Sprintf(kbuf, "swallowing %s whole", mname); instapetrify(kbuf); } else { From 995ba09363ecb35246ce56ffbc07d79b648c9824 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 13 Mar 2015 22:27:09 -0400 Subject: [PATCH 197/354] fix messaging in obstructed() in lock.c From ais523's recent list of bugs: If a long worm tail is blocking the door, and you're blind and not telepathic, attempting to close the door marks the position of its head. From an email received in late September 2014 before the git conversion: > I was trying to close a door, not noticing that there was a garter > snake there, and this message resulted: > The garter snake stands in the way! > I haven't tried it with any other monsters without feet, but > "stands in the way" appears to be the wrong way to describe > this situation... Both of the above were found in the same function in lock.c --- doc/fixes35.0 | 1 + src/lock.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 614bbe57f..ad8117820 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -877,6 +877,7 @@ charge for a boulder that fills a pit in shop abuse wisdom in keeping with Rider eating message message inconsistency: death message "swallowed whole" was preceded by "You bite into" +improve the messaging when a monster you can't see is causing an obstruction Platform- and/or Interface-Specific Fixes diff --git a/src/lock.c b/src/lock.c index 91e0f0728..b57d9eb85 100644 --- a/src/lock.c +++ b/src/lock.c @@ -627,13 +627,16 @@ register int x, y; boolean quietly; { register struct monst *mtmp = m_at(x, y); + boolean is_worm_tail = ((mtmp->mx != x) || (mtmp->my != y)); if(mtmp && mtmp->m_ap_type != M_AP_FURNITURE) { if (mtmp->m_ap_type == M_AP_OBJECT) goto objhere; - if (!quietly) pline("%s stands in the way!", !canspotmon(mtmp) ? - "Some creature" : Monnam(mtmp)); + if (!quietly) pline("%s %s in the way!", + is_worm_tail ? "Something" : + !canspotmon(mtmp) ? "Some creature" : Monnam(mtmp), + slithy(mtmp->data) ? "is situated" : "stands"); if (!canspotmon(mtmp)) - map_invisible(mtmp->mx, mtmp->my); + map_invisible(x, y); return(TRUE); } if (OBJ_AT(x, y)) { From 2904297cc00c7dfb5157096dd3123754186eb66d Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 14 Mar 2015 09:43:07 -0400 Subject: [PATCH 198/354] Additional obstruction messaging fixup --- src/lock.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/lock.c b/src/lock.c index b57d9eb85..3de76fe66 100644 --- a/src/lock.c +++ b/src/lock.c @@ -627,14 +627,21 @@ register int x, y; boolean quietly; { register struct monst *mtmp = m_at(x, y); - boolean is_worm_tail = ((mtmp->mx != x) || (mtmp->my != y)); if(mtmp && mtmp->m_ap_type != M_AP_FURNITURE) { if (mtmp->m_ap_type == M_AP_OBJECT) goto objhere; - if (!quietly) pline("%s %s in the way!", - is_worm_tail ? "Something" : - !canspotmon(mtmp) ? "Some creature" : Monnam(mtmp), - slithy(mtmp->data) ? "is situated" : "stands"); + if (!quietly) { + if ((mtmp->mx != x) || (mtmp->my != y)) { + /* worm tail */ + pline("%s%s blocks the way!", + !canspotmon(mtmp) ? Something : + s_suffix(Monnam(mtmp)), + !canspotmon(mtmp) ? "" : " tail"); + } else { + pline("%s blocks the way!", + !canspotmon(mtmp) ? "Some creature" : Monnam(mtmp)); + } + } if (!canspotmon(mtmp)) map_invisible(x, y); return(TRUE); From 232d4e69bb0df6760ad9b2888904ac926d0d11b7 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 15 Mar 2015 09:53:34 +0200 Subject: [PATCH 199/354] Death talks in CAPITAL LETTERS --- include/extern.h | 1 + src/hacklib.c | 12 ++++++++++++ src/sounds.c | 10 +++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/extern.h b/include/extern.h index f382c4f7a..0a1dabe77 100644 --- a/include/extern.h +++ b/include/extern.h @@ -800,6 +800,7 @@ E boolean FDECL(letter, (CHAR_P)); E char FDECL(highc, (CHAR_P)); E char FDECL(lowc, (CHAR_P)); E char *FDECL(lcase, (char *)); +E char *FDECL(ucase, (char *)); E char *FDECL(upstart, (char *)); E char *FDECL(mungspaces, (char *)); E char *FDECL(eos, (char *)); diff --git a/src/hacklib.c b/src/hacklib.c index 4565f6d65..fd4273074 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -17,6 +17,7 @@ NetHack, except that rounddiv may call panic(). char highc (char) char lowc (char) char * lcase (char *) + char * ucase (char *) char * upstart (char *) char * mungspaces (char *) char * eos (char *) @@ -99,6 +100,17 @@ lcase(s) /* convert a string into all lowercase */ return s; } +char * +ucase(s) /* convert a string into all uppercase */ + char *s; +{ + register char *p; + + for (p = s; *p; p++) + if ('a' <= *p && *p <= 'z') *p &= ~040; + return s; +} + char * upstart(s) /* convert first character of a string to uppercase */ char *s; diff --git a/src/sounds.c b/src/sounds.c index d57904778..3b2ee2f56 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -901,7 +901,15 @@ register struct monst *mtmp; if (pline_msg) pline("%s %s", Monnam(mtmp), pline_msg); else if (mtmp->mcan && verbl_msg_mcan) verbalize1(verbl_msg_mcan); - else if (verbl_msg) verbalize1(verbl_msg); + else if (verbl_msg) { + if (ptr == &mons[PM_DEATH]) { /* Death talks in CAPITAL LETTERS */ + char tmpbuf[BUFSZ]; + Sprintf(tmpbuf, "%s", verbl_msg); + verbalize1(ucase(tmpbuf)); + } else { + verbalize1(verbl_msg); + } + } return(1); } From 3e5d6bf68ff139c2c532f257d0abb2310a4fd244 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 15 Mar 2015 12:36:45 -0400 Subject: [PATCH 200/354] catch up on half-physical damage docs This is catching up on some things that were changed in development years ago that Dave C. suggested be documented. For the record: -The things that were evaluated and ruled out are now documented in include/youprop.h so they don't come up again. - The things that were evaluated and deemed to be susceptible to the intrinsic and thus led to a modification in the code are listed below in this commit message. Modifications: - A crystal ball exploding on being applied - Artifacts' blasting - Being a fish out of water - Being hit by Mjollnir on the return - Being thwacked by an iron ball chained to you - Boiling/freezing potions - Broken wands - Bumping head on ceiling by cursed levitation - Burning (un)holy water - Chest/door/tin traps - Dipping a lit lamp into a potion of oil - Exploding rings and wands (under all circumstances) - Exploding spellbooks - Falling downstairs - Falling into a (spiked) pit - Falling off or failing to mount a steed - Falling on a sink while levitating - Getting squished in a pit under a boulder - Hitting your foot with a bullwhip - Hitting yourself with your pick-axe - Hooking yourself with a grappling hook - iron-ball-pulling yourself out of a bear trap - Jumping/Newton's-Thirding into something solid - Kicking something that makes you go "Ouch!" - Land mine explosion - Sitting in a spiked pit - Stinking cloud damage - Thrown potion (bottle) - Zapping yourself with a wand, horn or spell - Jumping yourself out of a bear trap --- doc/fixes35.0 | 2 ++ include/youprop.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index ad8117820..5efe01fbe 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -4,6 +4,8 @@ $rcsfile: fixes35.0,v $ $Revision: 1.445 $ $Date: 2014/11/18 03:10:36 $ General Fixes and Modified Features ----------------------------------- change the dreaded "Stop eating?" to "Continue eating?" with default "no" +fix half-physical damage intrinsic protection from a number of + events and circumstances setmangry should not be called when a monster enters a bones region bad capitalization of msg when charging for something that catches light missing opthelp for use_inverse diff --git a/include/youprop.h b/include/youprop.h index a29e20bf8..1dfe3a9e9 100644 --- a/include/youprop.h +++ b/include/youprop.h @@ -286,7 +286,35 @@ * 2. it doesn't leave a mark. Marks include destruction of, or * damage to, an internal organ (including the brain), * lacerations, bruises, crushed body parts, bleeding. + * + * The following were evaluated and determined _NOT_ to be + * susceptable to Half_physical_damage protection: + * Being caught in a fireball [fire damage] + * Sitting in lava [lava damage] + * Thrown potion (acid) [acid damage] + * Splattered burning oil from thrown potion [fire damage] + * Mixing water and acid [acid damage] + * Molten lava (entering or being splashed) [lava damage] + * boiling water from a sink [fire damage] + * Fire traps [fire damage] + * Scrolls of fire (confused and otherwise) [fire damage] + * Alchemical explosion [not physical] + * System shock [shock damage] + * Bag of holding explosion [magical] + * Being undead-turned by your god [magical] + * Level-drain [magical] + * Magical explosion of a magic trap [magical] + * Sitting on a throne with a bad effect [magical] + * Contaminated water from a sink [poison/sickness] + * Contact-poisoned spellbooks [poison/sickness] + * Eating acidic/poisonous/mildly-old corpses [poison/sickness] + * Eating a poisoned weapon while polyselfed [poison/sickness] + * Engulfing a zombie or mummy (AT_ENGL in hmonas) [poison/sickness] + * Quaffed potions of sickness, lit oil, acid [poison/sickness] + * Pyrolisks' fiery gaze [fire damage] + * Any passive attack [most don't qualify] */ + #define HHalf_physical_damage u.uprops[HALF_PHDAM].intrinsic #define EHalf_physical_damage u.uprops[HALF_PHDAM].extrinsic #define Half_physical_damage (HHalf_physical_damage || EHalf_physical_damage) From a873129caf747cbb5398166ec9c3483cfaac5b2f Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 15 Mar 2015 12:59:34 -0400 Subject: [PATCH 201/354] withdraw fixes35.0 part of prior commit There was actually a fixes35.0 entry further down that covered off that particular entry already which I missed first time around. > many instances of physical damage were not taking Half_physical_damage > into account when reducing your hitpoints --- doc/fixes35.0 | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 5efe01fbe..ad8117820 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -4,8 +4,6 @@ $rcsfile: fixes35.0,v $ $Revision: 1.445 $ $Date: 2014/11/18 03:10:36 $ General Fixes and Modified Features ----------------------------------- change the dreaded "Stop eating?" to "Continue eating?" with default "no" -fix half-physical damage intrinsic protection from a number of - events and circumstances setmangry should not be called when a monster enters a bones region bad capitalization of msg when charging for something that catches light missing opthelp for use_inverse From 4c28a96b92bf062bad13b8d2a9ccdda4a7c240e2 Mon Sep 17 00:00:00 2001 From: "Derek S. Ray" Date: Sun, 15 Mar 2015 14:28:01 -0400 Subject: [PATCH 202/354] Some few updates/additions; clean up formatting --- DEVEL/git_recipes.txt | 87 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 70 insertions(+), 17 deletions(-) diff --git a/DEVEL/git_recipes.txt b/DEVEL/git_recipes.txt index 49c7a7cca..71ce0e5dc 100644 --- a/DEVEL/git_recipes.txt +++ b/DEVEL/git_recipes.txt @@ -3,13 +3,13 @@ reference for basic tasks while you get up to speed. ------------------------ -git checkout [-f] (branch) +[*] git checkout [-f] (branch) Switch your local repository to be at the most recent commit of (branch). Including -f will discard changes made in the working directory. -git status [-uall | -uno] +[*] git status [-uall | -uno] Shows all changed files in your local repository and also a list of the ones you have staged for commit. @@ -17,10 +17,10 @@ Including -uall will also show you all untracked files in all subdirectories. Including -uno will show you _no_ untracked files. -git log [-NUM] -git log -git log [--pretty=one] -git log (branch) +[*] git log [-NUM] +[*] git log +[*] git log [--pretty=one] +[*] git log (branch) For a full explanation of all the arguments you can pass to 'log', please see the manual; there are a lot and these are just a few of the common ones. For @@ -33,13 +33,13 @@ you specify: (branch): show the commits from (branch) instead of the current one -git add (filename) +[*] git add (filename) Adds the changes you've made in (filename) to the pre-commit staging area. (also referred to as the 'index') -git commit [-a] [-m "text"] +[*] git commit [-a] [-m "text"] Commits all staged changes (in the index) to this branch in your local repo from your current position. @@ -48,7 +48,7 @@ Including -m will use "text" as the commit message instead of opening an editor window for you to create one. -git push [--all] [-u origin (branch)] +[*] git push [--all] [-u origin (branch)] Sends all your commits for the current branch to the centralized repo. Including --all will send the commits for _all_ branches. @@ -57,11 +57,11 @@ created; it establishes the connection between local and remote for that branch. -git reset [--hard] (filename) +[*] git reset [--hard] (filename) Without any parameters, unstages the changes for (filename) from the index; does not change the working tree. This is the equivalent of the command -git reset --mixed (filename); git reset --soft (filename) has no effect. +[*] git reset --mixed (filename); git reset --soft (filename) has no effect. With --hard, unstages (filename) from the index and reverts (filename) in the working tree to the most recent commit. @@ -74,7 +74,7 @@ with it. But at the same time, for people who are adapting to a commit not also automatically being a send, it's nice for them to know how to undo one in case they do something wrong. thoughts?] -git reset [--soft | --mixed | --hard] HEAD~1 +[*] git reset [--soft | --mixed | --hard] HEAD~1 *** WARNING *** Never, EVER do this to a commit that you have already pushed; you will be rewriting history on other people's machines and this will @@ -90,26 +90,79 @@ With --hard, does everything --mixed does but also reverts the working tree to the prior commit. *** WARNING *** --hard will effectively delete a commit and "lose" the changes. +[/end area-of-concern] -git fetch [-a] +[*] git fetch [-a] Retrieve commits from the remote repository to your machine. Including -a will get commits for all branches. +Does NOT merge them into your local repository. -git pull +[*] git pull Incorporate any fetched commits for the current branch into your repository -and update your position accordingly. +and update your position accordingly. This will create a merge commit (noting +that you merged a branch into itself). -git merge (branch) [--no-commit] +[*] git rebase [no-arguments version ONLY] + +Incorporate fetched commits for the current branch into your repository, and +replay any local commits and changes afterwards on top. + +Quality picture-pages ASCII art: + + E---F---G---H (remote changes) + / + / +(branch 'frog') A---B---C---D---E'---F' (your local changes) + +After 'git fetch' and 'git rebase', it will look like this: + + --- (remote HEAD) + | + V +(branch 'frog') A---B---C---D---E---F---G---H---E'---F' + ^ ^ + | | + -------- (to be pushed) + + +[*] git branch (branch) + +Creates a new branch from the current commit you're pointed to. +Does not automatically checkout (switch to) the branch. + + +[*] git checkout -b (branch) + +Creates a new branch from the current commit you're pointed to, and +automatically checks out that branch. + + +[*] git branch --list | [--all | -a] | [--remotes | -r] + +Lists all branches matching . +With --all instead, lists all branches (including remotely tracked ones). +With --remotes instead, lists only remote branches. + + +[*] git merge (branch) [--no-commit] Merges all the changes from (branch) since it last diverged from a common ancestor into your current branch. With --no-commit, does not automatically create a merge entry in the log but leaves all the merged files in your working directory; to complete the merge -you must commit them manually later (likely after you have edited them). +you must commit them manually later (likely after you have edited them). This +more accurately mimics the merge behavior of svn [and cvs?] + + +======================================= +Typical workflows for common activities +======================================= + +{To be added in near future: DSR 3/15} From 058299aa3a6d4ed095f0f5d0f60abacab30558d3 Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 15 Mar 2015 18:02:26 -0700 Subject: [PATCH 203/354] DEBUG/debugpline() fixup * Replace variadic debugpline() with fixed argument debugpline0(str), debugpline1(fmt,arg), and so on so that C99 support isn't required; * showdebug() becomes a function rather than a macro and handles a bit more; * two debugpline() calls in light.c have been changed to impossible(); * DEBUGFILES macro (in sys.c) can substitute for SYSCF's DEBUGFILES setting in !SYSCF configuration (I hope that's temporary). --- include/extern.h | 5 ++- include/hack.h | 40 +++++++++-------------- src/apply.c | 4 +-- src/attrib.c | 25 +++++++------- src/bones.c | 4 +-- src/dbridge.c | 51 +++++++++++++++-------------- src/dig.c | 18 +++++------ src/dungeon.c | 4 +-- src/eat.c | 84 +++++++++++++++++++++++++----------------------- src/files.c | 53 +++++++++++++++++++++++++++++- src/light.c | 6 ++-- src/makemon.c | 17 +++++----- src/mklev.c | 6 ++-- src/mkmaze.c | 6 ++-- src/mkobj.c | 15 +++++---- src/mon.c | 4 +-- src/pickup.c | 4 +-- src/questpgr.c | 4 +-- src/restore.c | 4 +-- src/rnd.c | 10 +++--- src/save.c | 4 +-- src/shk.c | 4 +-- src/sp_lev.c | 12 +++---- src/sys.c | 20 ++++++++---- src/teleport.c | 4 +-- src/zap.c | 12 ++++--- win/tty/wintty.c | 4 +-- 27 files changed, 243 insertions(+), 181 deletions(-) diff --git a/include/extern.h b/include/extern.h index 0a1dabe77..cd8843762 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 extern.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.390 $ */ +/* NetHack 3.5 extern.h $NHDT-Date: 1426465429 2015/03/16 00:23:49 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.406 $ */ /* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -741,6 +741,9 @@ E boolean NDECL(recover_savefile); #ifdef HOLD_LOCKFILE_OPEN E void NDECL(really_close); #endif +#ifdef DEBUG +E boolean FDECL(showdebug, (const char *)); +#endif /* ### fountain.c ### */ diff --git a/include/hack.h b/include/hack.h index 7c6af5b18..c85f95d8d 100644 --- a/include/hack.h +++ b/include/hack.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 hack.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 hack.h $NHDT-Date: 1426465431 2015/03/16 00:23:51 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.52 $ */ /* NetHack 3.5 hack.h $Date: 2009/05/06 10:44:46 $ $Revision: 1.49 $ */ /* SCCS Id: @(#)hack.h 3.5 2008/03/19 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ @@ -11,32 +11,22 @@ #include "config.h" #endif +/* [DEBUG shouldn't be defined unless you know what you're doing...] */ #ifdef DEBUG -/* due to strstr(), mon.c matches makemon.c */ -# define showdebug() (sysopt.debugfiles && \ - ((sysopt.debugfiles[0] == '*') || \ - (strstr( __FILE__ , sysopt.debugfiles)))) - -/* GCC understands this syntax */ -# ifdef __GNUC__ -/* ... but whines about it anyway without these pragmas. */ -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wvariadic-macros" -# define debugpline(args...) \ - do { if (showdebug()) pline( args ); } while(0); -# pragma GCC diagnostic pop -# endif - -/* and Visual Studio understands this one */ -# ifdef _MSC_VER -# define debugpline(...) \ - do { if (showdebug()) pline(__VA_ARGS__); } while(0); -# endif - +# define ifdebug(stmt) do { if (showdebug(__FILE__)) stmt; } while (0) +/* these don't require compiler support for C99 variadic macros */ +# define debugpline0(str) ifdebug(pline(str)) +# define debugpline1(fmt,arg) ifdebug(pline(fmt,arg)) +# define debugpline2(fmt,a1,a2) ifdebug(pline(fmt,a1,a2)) +# define debugpline3(fmt,a1,a2,a3) ifdebug(pline(fmt,a1,a2,a3)) +# define debugpline4(fmt,a1,a2,a3,a4) ifdebug(pline(fmt,a1,a2,a3,a4)) #else -# define showdebug() (0) -# define debugpline(...) -#endif +# define debugpline0(str) /*empty*/ +# define debugpline1(fmt,arg) /*empty*/ +# define debugpline2(fmt,a1,a2) /*empty*/ +# define debugpline3(fmt,a1,a2,a3) /*empty*/ +# define debugpline4(fmt,a1,a2,a3,a4) /*empty*/ +#endif /*DEBUG*/ #define TELL 1 #define NOTELL 0 diff --git a/src/apply.c b/src/apply.c index 2ac4088dd..fd3193fb3 100644 --- a/src/apply.c +++ b/src/apply.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 apply.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 apply.c $NHDT-Date: 1426465431 2015/03/16 00:23:51 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.173 $ */ /* NetHack 3.5 apply.c $Date: 2012/05/01 02:22:32 $ $Revision: 1.168 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1770,7 +1770,7 @@ long timeout; char monnambuf[BUFSZ], carriedby[BUFSZ]; if (!figurine) { - debugpline("null figurine in fig_transform()"); + debugpline0("null figurine in fig_transform()"); return; } silent = (timeout != monstermoves); /* happened while away */ diff --git a/src/attrib.c b/src/attrib.c index 8bba3d61c..b9ce67596 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 attrib.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 attrib.c $NHDT-Date: 1426465433 2015/03/16 00:23:53 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.34 $ */ /* NetHack 3.5 attrib.c $Date: 2011/10/01 00:25:55 $ $Revision: 1.30 $ */ /* Copyright 1988, 1989, 1990, 1992, M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ @@ -347,7 +347,7 @@ exercise(i, inc_or_dec) int i; boolean inc_or_dec; { - debugpline("Exercise:"); + debugpline0("Exercise:"); if (i == A_INT || i == A_CHA) return; /* can't exercise these */ /* no physical exercise while polymorphed; the body's temporary */ @@ -364,7 +364,7 @@ boolean inc_or_dec; * Note: *YES* ACURR is the right one to use. */ AEXE(i) += (inc_or_dec) ? (rn2(19) > ACURR(i)) : -rn2(2); - debugpline("%s, %s AEXE = %d", + debugpline3("%s, %s AEXE = %d", (i == A_STR) ? "Str" : (i == A_WIS) ? "Wis" : (i == A_DEX) ? "Dex" : "Con", (inc_or_dec) ? "inc" : "dec", AEXE(i)); @@ -392,7 +392,7 @@ exerper() (u.uhunger > 50) ? HUNGRY : (u.uhunger > 0) ? WEAK : FAINTING; - debugpline("exerper: Hunger checks"); + debugpline0("exerper: Hunger checks"); switch (hs) { case SATIATED: exercise(A_DEX, FALSE); if (Role_if(PM_MONK)) @@ -408,7 +408,7 @@ exerper() } /* Encumberance Checks */ - debugpline("exerper: Encumber checks"); + debugpline0("exerper: Encumber checks"); switch (near_capacity()) { case MOD_ENCUMBER: exercise(A_STR, TRUE); break; case HVY_ENCUMBER: exercise(A_STR, TRUE); @@ -421,7 +421,7 @@ exerper() /* status checks */ if(!(moves % 5)) { - debugpline("exerper: Status checks"); + debugpline0("exerper: Status checks"); if ((HClairvoyant & (INTRINSIC|TIMEOUT)) && !BClairvoyant) exercise(A_WIS, TRUE); if (HRegeneration) exercise(A_STR, TRUE); @@ -453,10 +453,10 @@ exerchk() exerper(); if(moves >= context.next_attrib_check) - debugpline("exerchk: ready to test. multi = %d.", multi); + debugpline1("exerchk: ready to test. multi = %d.", multi); /* Are we ready for a test? */ if(moves >= context.next_attrib_check && !multi) { - debugpline("exerchk: testing."); + debugpline0("exerchk: testing."); /* * Law of diminishing returns (Part II): * @@ -483,7 +483,7 @@ exerchk() exercise/abuse gradually wears off without impact then */ if (Upolyd && i != A_WIS) goto nextattrib; - debugpline("exerchk: testing %s (%d).", + debugpline2("exerchk: testing %s (%d).", (i == A_STR) ? "Str" : (i == A_INT) ? "Int?" : (i == A_WIS) ? "Wis" : (i == A_DEX) ? "Dex" : (i == A_CON) ? "Con" : (i == A_CHA) ? "Cha?" : "???", @@ -497,9 +497,9 @@ exerchk() if (rn2(AVAL) > ((i != A_WIS) ? (abs(ax) * 2 / 3) : abs(ax))) goto nextattrib; - debugpline("exerchk: changing %d.", i); + debugpline1("exerchk: changing %d.", i); if(adjattrib(i, mod_val, -1)) { - debugpline("exerchk: changed %d.", i); + debugpline1("exerchk: changed %d.", i); /* if you actually changed an attrib - zero accumulation */ AEXE(i) = ax = 0; /* then print an explanation */ @@ -513,7 +513,8 @@ exerchk() AEXE(i) = (abs(ax) / 2) * mod_val; } context.next_attrib_check += rn1(200,800); - debugpline("exerchk: next check at %ld.", context.next_attrib_check); + debugpline1("exerchk: next check at %ld.", + context.next_attrib_check); } } diff --git a/src/bones.c b/src/bones.c index 269152578..9024354a2 100644 --- a/src/bones.c +++ b/src/bones.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 bones.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 bones.c $NHDT-Date: 1426465433 2015/03/16 00:23:53 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.45 $ */ /* NetHack 3.5 bones.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.39 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985,1993. */ /* NetHack may be freely redistributed. See license for details. */ @@ -584,7 +584,7 @@ getbones() if (has_mname(mtmp)) sanitize_name(MNAME(mtmp)); if (mtmp->mhpmax == DEFUNCT_MONSTER) { if (wizard) - debugpline("Removing defunct monster %s from bones.", + debugpline1("Removing defunct monster %s from bones.", mtmp->data->mname); mongone(mtmp); } else diff --git a/src/dbridge.c b/src/dbridge.c index a82805377..8c4b90031 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 dbridge.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dbridge.c $NHDT-Date: 1426465433 2015/03/16 00:23:53 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.23 $ */ /* NetHack 3.5 dbridge.c $Date: 2012/02/01 00:49:16 $ $Revision: 1.21 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -267,7 +267,7 @@ int x, y; (occupants[entitycnt].ex == x) && (occupants[entitycnt].ey == y)) break; - debugpline("entitycnt = %d", entitycnt); + debugpline1("entitycnt = %d", entitycnt); #ifdef D_DEBUG wait_synch(); #endif @@ -467,7 +467,7 @@ boolean chunks; int misses; if (chunks) - debugpline("Do chunks miss?"); + debugpline0("Do chunks miss?"); if (automiss(etmp)) return(TRUE); @@ -487,7 +487,7 @@ boolean chunks; if (is_db_wall(etmp->ex, etmp->ey)) misses -= 3; /* less airspace */ - debugpline("Miss chance = %d (out of 8)", misses); + debugpline1("Miss chance = %d (out of 8)", misses); return((boolean)((misses >= rnd(8))? TRUE : FALSE)); } @@ -516,7 +516,8 @@ struct entity *etmp; if (is_db_wall(etmp->ex, etmp->ey)) tmp -= 2; /* less room to maneuver */ - debugpline("%s to jump (%d chances in 10)", E_phrase(etmp, "try"), tmp); + debugpline2("%s to jump (%d chances in 10)", + E_phrase(etmp, "try"), tmp); return((boolean)((tmp >= rnd(10))? TRUE : FALSE)); } @@ -550,12 +551,11 @@ struct entity *etmp; pline_The("portcullis misses %s!", e_nam(etmp)); else - debugpline("The drawbridge misses %s!", - e_nam(etmp)); + debugpline1("The drawbridge misses %s!", e_nam(etmp)); if (e_survives_at(etmp, oldx, oldy)) return; else { - debugpline("Mon can't survive here"); + debugpline0("Mon can't survive here"); if (at_portcullis) must_jump = TRUE; else @@ -574,7 +574,7 @@ struct entity *etmp; if (at_portcullis) { if (e_jumps(etmp)) { relocates = TRUE; - debugpline("Jump succeeds!"); + debugpline0("Jump succeeds!"); } else { if (e_inview) pline("%s crushed by the falling portcullis!", @@ -587,7 +587,7 @@ struct entity *etmp; } } else { /* tries to jump off bridge to original square */ relocates = !e_jumps(etmp); - debugpline("Jump %s!", (relocates)? "fails" : "succeeds"); + debugpline1("Jump %s!", (relocates)? "fails" : "succeeds"); } } @@ -597,13 +597,13 @@ struct entity *etmp; * would be inaccessible (i.e. etmp started on drawbridge square) or * unnecessary (i.e. etmp started here) in such a situation. */ - debugpline("Doing relocation."); + debugpline0("Doing relocation."); newx = oldx; newy = oldy; (void)find_drawbridge(&newx, &newy); if ((newx == oldx) && (newy == oldy)) get_wall_for_db(&newx, &newy); - debugpline("Checking new square for occupancy."); + debugpline0("Checking new square for occupancy."); if (relocates && (e_at(newx, newy))) { /* @@ -614,22 +614,22 @@ struct entity *etmp; struct entity *other; other = e_at(newx, newy); - debugpline("New square is occupied by %s", e_nam(other)); + debugpline1("New square is occupied by %s", e_nam(other)); if (e_survives_at(other, newx, newy) && automiss(other)) { relocates = FALSE; /* "other" won't budge */ - debugpline("%s suicide.", E_phrase(etmp, "commit")); + debugpline1("%s suicide.", E_phrase(etmp, "commit")); } else { - debugpline("Handling %s", e_nam(other)); + debugpline1("Handling %s", e_nam(other)); while ((e_at(newx, newy) != 0) && (e_at(newx, newy) != etmp)) do_entity(other); - debugpline("Checking existence of %s", e_nam(etmp)); + debugpline1("Checking existence of %s", e_nam(etmp)); #ifdef D_DEBUG wait_synch(); #endif if (e_at(oldx, oldy) != etmp) { - debugpline("%s moved or died in recursion somewhere", + debugpline1("%s moved or died in recursion somewhere", E_phrase(etmp, "have")); #ifdef D_DEBUG wait_synch(); @@ -639,7 +639,7 @@ struct entity *etmp; } } if (relocates && !e_at(newx, newy)) {/* if e_at() entity = worm tail */ - debugpline("Moving %s", e_nam(etmp)); + debugpline1("Moving %s", e_nam(etmp)); if (!is_u(etmp)) { remove_monster(etmp->ex, etmp->ey); place_monster(etmp->emon, newx, newy); @@ -652,12 +652,12 @@ struct entity *etmp; etmp->ey = newy; e_inview = e_canseemon(etmp); } - debugpline("Final disposition of %s", e_nam(etmp)); + debugpline1("Final disposition of %s", e_nam(etmp)); #ifdef D_DEBUG wait_synch(); #endif if (is_db_wall(etmp->ex, etmp->ey)) { - debugpline("%s in portcullis chamber", E_phrase(etmp, "are")); + debugpline1("%s in portcullis chamber", E_phrase(etmp, "are")); #ifdef D_DEBUG wait_synch(); #endif @@ -678,9 +678,9 @@ struct entity *etmp; e_died(etmp, 0, CRUSHING); /* no message */ return; } - debugpline("%s in here", E_phrase(etmp, "survive")); + debugpline1("%s in here", E_phrase(etmp, "survive")); } else { - debugpline("%s on drawbridge square", E_phrase(etmp, "are")); + debugpline1("%s on drawbridge square", E_phrase(etmp, "are")); if (is_pool(etmp->ex, etmp->ey) && !e_inview) if (!Deaf) You_hear("a splash."); @@ -691,7 +691,8 @@ struct entity *etmp; E_phrase(etmp, "fall")); return; } - debugpline("%s cannot survive on the drawbridge square",E_phrase(etmp, NULL)); + debugpline1("%s cannot survive on the drawbridge square", + E_phrase(etmp, NULL)); if (is_pool(etmp->ex, etmp->ey) || is_lava(etmp->ex, etmp->ey)) if (e_inview && !is_u(etmp)) { /* drown() will supply msgs if nec. */ @@ -907,7 +908,7 @@ int x,y; if (etmp1->edata) { e_inview = e_canseemon(etmp1); if (e_missed(etmp1, TRUE)) { - debugpline("%s spared!", E_phrase(etmp1, "are")); + debugpline1("%s spared!", E_phrase(etmp1, "are")); /* if there is water or lava here, fall in now */ if (is_u(etmp1)) spoteffects(FALSE); @@ -925,7 +926,7 @@ int x,y; if (!Deaf && !is_u(etmp1) && !is_pool(x,y)) You_hear("a crushing sound."); else - debugpline("%s from shrapnel", + debugpline1("%s from shrapnel", E_phrase(etmp1, "die")); } killer.format = KILLED_BY_AN; diff --git a/src/dig.c b/src/dig.c index 1c053ec73..fa25f76a0 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 dig.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dig.c $NHDT-Date: 1426465434 2015/03/16 00:23:54 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.73 $ */ /* NetHack 3.5 dig.c $Date: 2012/02/16 03:01:37 $ $Revision: 1.67 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1689,7 +1689,7 @@ bury_an_obj(otmp) struct obj *otmp2; boolean under_ice; - debugpline("bury_an_obj: %s", xname(otmp)); + debugpline1("bury_an_obj: %s", xname(otmp)); if (otmp == uball) { unpunish(); u.utrap = rn1(50,20); @@ -1752,7 +1752,7 @@ int x, y; struct obj *otmp, *otmp2; if(level.objects[x][y] != (struct obj *)0) - debugpline("bury_objs: at %d, %d", x, y); + debugpline2("bury_objs: at <%d,%d>", x, y); for (otmp = level.objects[x][y]; otmp; otmp = otmp2) otmp2 = bury_an_obj(otmp); @@ -1769,7 +1769,7 @@ int x, y; struct obj *otmp, *otmp2, *bball; coord cc; - debugpline("unearth_objs: at %d, %d", x, y); + debugpline2("unearth_objs: at <%d,%d>", x, y); cc.x = x; cc.y = y; bball = buried_ball(&cc); for (otmp = level.buriedobjlist; otmp; otmp = otmp2) { @@ -1878,7 +1878,7 @@ void bury_monst(mtmp) struct monst *mtmp; { - debugpline("bury_monst: %s", mon_nam(mtmp)); + debugpline1("bury_monst: %s", mon_nam(mtmp)); if(canseemon(mtmp)) { if(is_flyer(mtmp->data) || is_floater(mtmp->data)) { pline_The("%s opens up, but %s is not swallowed!", @@ -1897,7 +1897,7 @@ struct monst *mtmp; void bury_you() { - debugpline("bury_you"); + debugpline0("bury_you"); if (!Levitation && !Flying) { if(u.uswallow) You_feel("a sensation like falling into a trap!"); @@ -1914,7 +1914,7 @@ bury_you() void unearth_you() { - debugpline("unearth_you"); + debugpline0("unearth_you"); u.uburied = FALSE; under_ground(0); if(!uamul || uamul->otyp != AMULET_OF_STRANGULATION) @@ -1925,7 +1925,7 @@ unearth_you() void escape_tomb() { - debugpline("escape_tomb"); + debugpline0("escape_tomb"); if ((Teleportation || can_teleport(youmonst.data)) && (Teleport_control || rn2(3) < Luck+2)) { You("attempt a teleport spell."); @@ -1957,7 +1957,7 @@ bury_obj(otmp) struct obj *otmp; { - debugpline("bury_obj"); + debugpline0("bury_obj"); if(cansee(otmp->ox, otmp->oy)) pline_The("objects on the %s tumble into a hole!", surface(otmp->ox, otmp->oy)); diff --git a/src/dungeon.c b/src/dungeon.c index 4c8e6beeb..ed87652f1 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 dungeon.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 dungeon.c $NHDT-Date: 1426465434 2015/03/16 00:23:54 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.39 $ */ /* NetHack 3.5 dungeon.c $Date: 2012/04/14 08:31:05 $ $Revision: 1.34 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -81,7 +81,7 @@ dumpit() s_level *x; branch *br; - if (!showdebug()) return; + if (!showdebug(__FILE__)) return; for(i = 0; i < n_dgns; i++) { fprintf(stderr, "\n#%d \"%s\" (%s):\n", i, diff --git a/src/eat.c b/src/eat.c index 793925fb7..983f6bcec 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 eat.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 eat.c $NHDT-Date: 1426465435 2015/03/16 00:23:55 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.123 $ */ /* NetHack 3.5 eat.c $Date: 2012/02/01 00:49:16 $ $Revision: 1.116 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -284,11 +284,11 @@ recalc_wt() { struct obj *piece = context.victual.piece; - debugpline("Old weight = %d", piece->owt); - debugpline("Used time = %d, Req'd time = %d", - context.victual.usedtime, context.victual.reqtime); + debugpline1("Old weight = %d", piece->owt); + debugpline2("Used time = %d, Req'd time = %d", + context.victual.usedtime, context.victual.reqtime); piece->owt = weight(piece); - debugpline("New weight = %d", piece->owt); + debugpline1("New weight = %d", piece->owt); } void @@ -298,7 +298,7 @@ reset_eat() /* called when eating interrupted by an event */ * the round is spent eating. */ if(context.victual.eating && !context.victual.doreset) { - debugpline("reset_eat..."); + debugpline0("reset_eat..."); context.victual.doreset = TRUE; } return; @@ -313,7 +313,7 @@ register struct obj *otmp; (void) splitobj(otmp, otmp->quan - 1L); else otmp = splitobj(otmp, 1L); - debugpline("split object,"); + debugpline0("split object,"); } if (!otmp->oeaten) { @@ -374,7 +374,7 @@ struct obj *old_obj, *new_obj; STATIC_OVL void do_reset_eat() { - debugpline("do_reset_eat..."); + debugpline0("do_reset_eat..."); if (context.victual.piece) { context.victual.o_id = 0; context.victual.piece = touchfood(context.victual.piece); @@ -717,39 +717,39 @@ register struct permonst *ptr; switch (type) { case FIRE_RES: res = (ptr->mconveys & MR_FIRE) != 0; - if (res) debugpline("can get fire resistance"); + if (res) debugpline0("can get fire resistance"); break; case SLEEP_RES: res = (ptr->mconveys & MR_SLEEP) != 0; - if (res) debugpline("can get sleep resistance"); + if (res) debugpline0("can get sleep resistance"); break; case COLD_RES: res = (ptr->mconveys & MR_COLD) != 0; - if (res) debugpline("can get cold resistance"); + if (res) debugpline0("can get cold resistance"); break; case DISINT_RES: res = (ptr->mconveys & MR_DISINT) != 0; - if (res) debugpline("can get disintegration resistance"); + if (res) debugpline0("can get disintegration resistance"); break; case SHOCK_RES: /* shock (electricity) resistance */ res = (ptr->mconveys & MR_ELEC) != 0; - if (res) debugpline("can get shock resistance"); + if (res) debugpline0("can get shock resistance"); break; case POISON_RES: res = (ptr->mconveys & MR_POISON) != 0; - if (res) debugpline("can get poison resistance"); + if (res) debugpline0("can get poison resistance"); break; case TELEPORT: res = can_teleport(ptr); - if (res) debugpline("can get teleport"); + if (res) debugpline0("can get teleport"); break; case TELEPORT_CONTROL: res = control_teleport(ptr); - if (res) debugpline("can get teleport control"); + if (res) debugpline0("can get teleport control"); break; case TELEPAT: res = telepathic(ptr); - if (res) debugpline("can get telepathy"); + if (res) debugpline0("can get telepathy"); break; default: /* res stays 0 */ @@ -768,7 +768,7 @@ register struct permonst *ptr; { register int chance; - debugpline("Attempting to give intrinsic %d", type); + debugpline1("Attempting to give intrinsic %d", type); /* some intrinsics are easier to get than others */ switch (type) { case POISON_RES: @@ -797,7 +797,7 @@ register struct permonst *ptr; switch (type) { case FIRE_RES: - debugpline("Trying to give fire resistance"); + debugpline0("Trying to give fire resistance"); if(!(HFire_resistance & FROMOUTSIDE)) { You(Hallucination ? "be chillin'." : "feel a momentary chill."); @@ -805,21 +805,21 @@ register struct permonst *ptr; } break; case SLEEP_RES: - debugpline("Trying to give sleep resistance"); + debugpline0("Trying to give sleep resistance"); if(!(HSleep_resistance & FROMOUTSIDE)) { You_feel("wide awake."); HSleep_resistance |= FROMOUTSIDE; } break; case COLD_RES: - debugpline("Trying to give cold resistance"); + debugpline0("Trying to give cold resistance"); if(!(HCold_resistance & FROMOUTSIDE)) { You_feel("full of hot air."); HCold_resistance |= FROMOUTSIDE; } break; case DISINT_RES: - debugpline("Trying to give disintegration resistance"); + debugpline0("Trying to give disintegration resistance"); if(!(HDisint_resistance & FROMOUTSIDE)) { You_feel(Hallucination ? "totally together, man." : @@ -828,7 +828,7 @@ register struct permonst *ptr; } break; case SHOCK_RES: /* shock (electricity) resistance */ - debugpline("Trying to give shock resistance"); + debugpline0("Trying to give shock resistance"); if(!(HShock_resistance & FROMOUTSIDE)) { if (Hallucination) You_feel("grounded in reality."); @@ -838,7 +838,7 @@ register struct permonst *ptr; } break; case POISON_RES: - debugpline("Trying to give poison resistance"); + debugpline0("Trying to give poison resistance"); if(!(HPoison_resistance & FROMOUTSIDE)) { You_feel(Poison_resistance ? "especially healthy." : "healthy."); @@ -846,7 +846,7 @@ register struct permonst *ptr; } break; case TELEPORT: - debugpline("Trying to give teleport"); + debugpline0("Trying to give teleport"); if(!(HTeleportation & FROMOUTSIDE)) { You_feel(Hallucination ? "diffuse." : "very jumpy."); @@ -854,7 +854,7 @@ register struct permonst *ptr; } break; case TELEPORT_CONTROL: - debugpline("Trying to give teleport control"); + debugpline0("Trying to give teleport control"); if(!(HTeleport_control & FROMOUTSIDE)) { You_feel(Hallucination ? "centered in your personal space." : @@ -863,7 +863,7 @@ register struct permonst *ptr; } break; case TELEPAT: - debugpline("Trying to give telepathy"); + debugpline0("Trying to give telepathy"); if(!(HTelepat & FROMOUTSIDE)) { You_feel(Hallucination ? "in touch with the cosmos." : @@ -874,7 +874,7 @@ register struct permonst *ptr; } break; default: - debugpline("Tried to give an impossible intrinsic"); + debugpline0("Tried to give an impossible intrinsic"); break; } } @@ -1005,7 +1005,7 @@ register int pm; case PM_DISENCHANTER: /* picks an intrinsic at random and removes it; there's no feedback if hero already lacks the chosen ability */ - debugpline("using attrcurse to strip an intrinsic"); + debugpline0("using attrcurse to strip an intrinsic"); attrcurse(); break; case PM_MIND_FLAYER: @@ -1045,7 +1045,7 @@ register int pm; if (conveys_STR) { count = 1; tmp = -1; /* use -1 as fake prop index for STR */ - debugpline("\"Intrinsic\" strength, %d", tmp); + debugpline1("\"Intrinsic\" strength, %d", tmp); } for (i = 1; i <= LAST_PROP; i++) { if (!intrinsic_possible(i, ptr)) continue; @@ -1055,7 +1055,7 @@ register int pm; of keeping the old choice (note that 1 in 1 and 0 in 1 are what we want for the first candidate) */ if (!rn2(count)) { - debugpline("Intrinsic %d replacing %d", i, tmp); + debugpline2("Intrinsic %d replacing %d", i, tmp); tmp = i; } } @@ -1599,11 +1599,12 @@ start_eating(otmp) /* called as you start to eat */ { const char *old_nomovemsg, *save_nomovemsg; - debugpline("start_eating: %p (victual = %p)", otmp, context.victual.piece); - debugpline("reqtime = %d", context.victual.reqtime); - debugpline("(original reqtime = %d)", objects[otmp->otyp].oc_delay); - debugpline("nmod = %d", context.victual.nmod); - debugpline("oeaten = %d", otmp->oeaten); + debugpline2("start_eating: %lx (victual = %lx)", + (unsigned long)otmp, (unsigned long)context.victual.piece); + debugpline1("reqtime = %d", context.victual.reqtime); + debugpline1("(original reqtime = %d)", objects[otmp->otyp].oc_delay); + debugpline1("nmod = %d", context.victual.nmod); + debugpline1("oeaten = %d", otmp->oeaten); context.victual.fullwarn = context.victual.doreset = FALSE; context.victual.eating = TRUE; @@ -2443,11 +2444,14 @@ doeat() /* generic "eat" command funtion (see cmd.c) */ if (otmp->otyp == CORPSE) basenutrit = mons[otmp->corpsenm].cnutrit; else basenutrit = objects[otmp->otyp].oc_nutrition; - debugpline("before rounddiv: context.victual.reqtime == %d", context.victual.reqtime); - debugpline("oeaten == %d, basenutrit == %d", otmp->oeaten, basenutrit); + debugpline1("before rounddiv: context.victual.reqtime == %d", + context.victual.reqtime); + debugpline2("oeaten == %d, basenutrit == %d", + otmp->oeaten, basenutrit); context.victual.reqtime = (basenutrit == 0 ? 0 : rounddiv(context.victual.reqtime * (long)otmp->oeaten, basenutrit)); - debugpline("after rounddiv: context.victual.reqtime == %d", context.victual.reqtime); + debugpline1("after rounddiv: context.victual.reqtime == %d", + context.victual.reqtime); /* calculate the modulo value (nutrit. units per round eating) * note: this isn't exact - you actually lose a little nutrition * due to this method. @@ -2549,7 +2553,7 @@ register int num; { /* See comments in newuhs() for discussion on force_save_hs */ boolean iseating = (occupation == eatfood) || force_save_hs; - debugpline("lesshungry(%d)", num); + debugpline1("lesshungry(%d)", num); u.uhunger += num; if(u.uhunger >= 2000) { if (!iseating || context.victual.canchoke) { diff --git a/src/files.c b/src/files.c index d4c216276..9e9cea746 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 files.c $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.127 $ */ +/* NetHack 3.5 files.c $NHDT-Date: 1426465435 2015/03/16 00:23:55 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.133 $ */ /* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3195,4 +3195,55 @@ int ifd, ofd; /* ---------- END INTERNAL RECOVER ----------- */ #endif /*SELF_RECOVER*/ +#ifdef DEBUG +/* used by debugpline() to decide whether to issue a message + from a partiular source file; caller passes __FILE__ and we check + whether it is in the source file list supplied by SYSCF's DEBUGFILES */ +boolean +showdebug(filename) +const char *filename; +{ + const char *debugfiles, *p; + + if (!filename || !*filename) return FALSE; /* sanity precaution */ + + debugfiles = sysopt.debugfiles; + /* usual case: sysopt.debugfiles will be empty */ + if (!debugfiles || !*debugfiles) return FALSE; + + /* strip filename's path if present */ +# ifdef UNIX + if ((p = rindex(filename, '/')) != 0) filename = p + 1; +# endif +# ifdef VMS + filename = vms_basename(filename); + /* vms_basename strips off 'type' suffix as well as path and version; + we want to put suffix back (".c" assumed); since it always returns + a pointer to a static buffer, we can safely modify its result */ + Strcat((char *)filename, ".c"); +# endif + + /* + * Wildcard match will only work if there's a single pattern (which + * might be a single file name without any wildcarding) rather than + * a space-separated list. + * [to NOT do: We could step through the space-separated list and + * attempt a wildcard match against each element, but that would be + * overkill for the intended usage.] + */ + if (pmatch(debugfiles, filename)) + return TRUE; + + /* check whether filename is an element of the list */ + if ((p = strstr(debugfiles, filename)) != 0) { + int l = (int)strlen(filename); + + if ((p == debugfiles || p[-1] == ' ' || p[-1] == '/') + && (p[l] == ' ' || p[l] == '\0')) + return TRUE; + } + return FALSE; +} +#endif /*DEBUG*/ + /*files.c*/ diff --git a/src/light.c b/src/light.c index f7d43eeee..52efe9759 100644 --- a/src/light.c +++ b/src/light.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 light.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 light.c $NHDT-Date: 1426465436 2015/03/16 00:23:56 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.17 $ */ /* NetHack 3.5 light.c $Date: 2009/05/06 10:46:38 $ $Revision: 1.15 $ */ /* SCCS Id: @(#)light.c 3.5 2009/01/20 */ /* Copyright (c) Dean Luick, 1994 */ @@ -394,13 +394,13 @@ write_ls(fd, ls) ls->id = zeroany; ls->id.a_uint = otmp->o_id; if (find_oid((unsigned)ls->id.a_uint) != otmp) - debugpline("write_ls: can't find obj #%u!", ls->id.a_uint); + impossible("write_ls: can't find obj #%u!", ls->id.a_uint); } else { /* ls->type == LS_MONSTER */ mtmp = (struct monst *)ls->id.a_monst; ls->id = zeroany; ls->id.a_uint = mtmp->m_id; if (find_mid((unsigned)ls->id.a_uint, FM_EVERYWHERE) != mtmp) - debugpline("write_ls: can't find mon #%u!", ls->id.a_uint); + impossible("write_ls: can't find mon #%u!", ls->id.a_uint); } ls->flags |= LSF_NEEDS_FIXUP; bwrite(fd, (genericptr_t)ls, sizeof(light_source)); diff --git a/src/makemon.c b/src/makemon.c index afaa0140a..6ce548ea0 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 makemon.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 makemon.c $NHDT-Date: 1426465436 2015/03/16 00:23:56 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.74 $ */ /* NetHack 3.5 makemon.c $Date: 2012/01/29 00:34:33 $ $Revision: 1.69 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -93,7 +93,7 @@ register int x, y, n; int cnttmp,cntdiv; cnttmp = cnt; - debugpline("init group call x=%d,y=%d,n=%d,cnt=%d.", x, y, n, cnt); + debugpline4("init group call <%d,%d>, n=%d, cnt=%d.", x, y, n, cnt); cntdiv = ((u.ulevel < 3) ? 4 : (u.ulevel < 5) ? 2 : 1); #endif /* Tuning: cut down on swarming at low character levels [mrs] */ @@ -758,7 +758,7 @@ boolean ghostly; mvitals[mndx].born++; if ((int) mvitals[mndx].born >= lim && !(mons[mndx].geno & G_NOGEN) && !(mvitals[mndx].mvflags & G_EXTINCT)) { - if (wizard) debugpline("Automatically extinguished %s.", + if (wizard) debugpline1("Automatically extinguished %s.", makeplural(mons[mndx].mname)); mvitals[mndx].mvflags |= G_EXTINCT; reset_rndmonst(mndx); @@ -903,8 +903,8 @@ register int mmflags; already been genocided, return */ if (mvitals[mndx].mvflags & G_GENOD) return((struct monst *) 0); if (wizard && (mvitals[mndx].mvflags & G_EXTINCT)) - debugpline("Explicitly creating extinct monster %s.", - mons[mndx].mname); + debugpline1("Explicitly creating extinct monster %s.", + mons[mndx].mname); } else { /* make a random (common) monster that can survive here. * (the special levels ask for random monsters at specific @@ -916,7 +916,7 @@ register int mmflags; do { if(!(ptr = rndmonst())) { - debugpline("Warning: no monster."); + debugpline0("Warning: no monster."); return((struct monst *) 0); /* no more monsters! */ } fakemon.data = ptr; /* set up for goodpos */ @@ -1252,7 +1252,7 @@ rndmonst() } if (mndx == SPECIAL_PM) { /* evidently they've all been exterminated */ - debugpline("rndmonst: no common mons!"); + debugpline0("rndmonst: no common mons!"); return (struct permonst *)0; } /* else `mndx' now ready for use below */ zlevel = level_difficulty(); @@ -1290,7 +1290,8 @@ rndmonst() if (rndmonst_state.choice_count <= 0) { /* maybe no common mons left, or all are too weak or too strong */ - debugpline("rndmonst: choice_count=%d", rndmonst_state.choice_count); + debugpline1("rndmonst: choice_count=%d", + rndmonst_state.choice_count); return (struct permonst *)0; } diff --git a/src/mklev.c b/src/mklev.c index 2d4899984..4412d68aa 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mklev.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mklev.c $NHDT-Date: 1426465436 2015/03/16 00:23:56 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.25 $ */ /* NetHack 3.5 mklev.c $Date: 2012/02/15 01:55:33 $ $Revision: 1.20 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -684,7 +684,7 @@ makelevel() /* make a secret treasure vault, not connected to the rest */ if(do_vault()) { xchar w,h; - debugpline("trying to make a vault..."); + debugpline0("trying to make a vault..."); w = 1; h = 1; if (check_room(&vault_x, &w, &vault_y, &h, TRUE)) { @@ -1560,7 +1560,7 @@ xchar x, y; *source = u.uz; insert_branch(br, TRUE); - debugpline("Made knox portal."); + debugpline0("Made knox portal."); place_branch(br, x, y); } diff --git a/src/mkmaze.c b/src/mkmaze.c index 0cfdbe35a..87a3a870b 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mkmaze.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mkmaze.c $NHDT-Date: 1426465437 2015/03/16 00:23:57 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.20 $ */ /* NetHack 3.5 mkmaze.c $Date: 2009/05/06 10:46:56 $ $Revision: 1.18 $ */ /* SCCS Id: @(#)mkmaze.c 3.5 2007/06/18 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ @@ -589,7 +589,7 @@ register const char *s; if (x_range <= INVPOS_X_MARGIN || y_range <= INVPOS_Y_MARGIN || (x_range * y_range) <= (INVPOS_DISTANCE * INVPOS_DISTANCE)) - debugpline("inv_pos: maze is too small! (%d x %d)", + debugpline2("inv_pos: maze is too small! (%d x %d)", x_maze_max, y_maze_max); inv_pos.x = inv_pos.y = 0; /*{occupied() => invocation_pos()}*/ do { @@ -877,7 +877,7 @@ register xchar x, y, todnum, todlevel; impossible("portal on top of portal??"); return; } - debugpline("mkportal: at (%d,%d), to %s, level %d", + debugpline4("mkportal: at <%d,%d>, to %s, level %d", x, y, dungeons[todnum].dname, todlevel); ttmp->dst.dnum = todnum; ttmp->dst.dlevel = todlevel; diff --git a/src/mkobj.c b/src/mkobj.c index ddfa363d4..4092401cd 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mkobj.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mkobj.c $NHDT-Date: 1426465437 2015/03/16 00:23:57 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.77 $ */ /* NetHack 3.5 mkobj.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.70 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1521,10 +1521,9 @@ struct obj *otmp; /* Adjust the age; must be same as obj_timer_checks() for off ice*/ age = monstermoves - otmp->age; retval += age * (ROT_ICE_ADJUSTMENT-1) / ROT_ICE_ADJUSTMENT; - debugpline("The %s age has ice modifications:otmp->age = %ld, returning %ld.", - s_suffix(doname(otmp)),otmp->age, retval); - debugpline("Effective age of corpse: %ld.", - monstermoves - retval); + debugpline3("The %s age has ice modifications: otmp->age = %ld, returning %ld.", + s_suffix(doname(otmp)), otmp->age, retval); + debugpline1("Effective age of corpse: %ld.", monstermoves - retval); } return retval; } @@ -1553,7 +1552,8 @@ int force; /* 0 = no force so do checks, <0 = force off, >0 force on */ /* mark the corpse as being on ice */ otmp->on_ice = 1; - debugpline("%s is now on ice at %d,%d.", The(xname(otmp)),x,y); + debugpline3("%s is now on ice at <%d,%d>.", + The(xname(otmp)), x, y); /* Adjust the time remaining */ tleft *= ROT_ICE_ADJUSTMENT; restart_timer = TRUE; @@ -1579,7 +1579,8 @@ int force; /* 0 = no force so do checks, <0 = force off, >0 force on */ long age; otmp->on_ice = 0; - debugpline("%s is no longer on ice at %d,%d.", The(xname(otmp)),x,y); + debugpline3("%s is no longer on ice at <%d,%d>.", + The(xname(otmp)), x, y); /* Adjust the remaining time */ tleft /= ROT_ICE_ADJUSTMENT; restart_timer = TRUE; diff --git a/src/mon.c b/src/mon.c index 49f6282dc..fb0a75a57 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mon.c $NHDT-Date: 1425319883 2015/03/02 18:11:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.137 $ */ +/* NetHack 3.5 mon.c $NHDT-Date: 1426465438 2015/03/16 00:23:58 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.139 $ */ /* NetHack 3.5 mon.c $Date: 2012/05/16 02:15:10 $ $Revision: 1.126 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1260,7 +1260,7 @@ register struct monst *mtmp, *mtmp2; /* transfer the monster's inventory */ for (otmp = mtmp2->minvent; otmp; otmp = otmp->nobj) { if (otmp->where != OBJ_MINVENT || otmp->ocarry != mtmp) - debugpline("replmon: minvent inconsistency"); + debugpline0("replmon: minvent inconsistency"); otmp->ocarry = mtmp2; } mtmp->minvent = 0; diff --git a/src/pickup.c b/src/pickup.c index 0b6abf06d..7b3096c59 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 pickup.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.126 $ */ +/* NetHack 3.5 pickup.c $NHDT-Date: 1426465438 2015/03/16 00:23:58 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.130 $ */ /* NetHack 3.5 pickup.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.123 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -897,7 +897,7 @@ int how; /* type of query */ (*pick_list)->item.a_int = curr->oclass; return 1; } else { - debugpline("query_category: no single object match"); + debugpline0("query_category: no single object match"); } return 0; } diff --git a/src/questpgr.c b/src/questpgr.c index 7f51965f7..62e1ae4e4 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 questpgr.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 questpgr.c $NHDT-Date: 1426465439 2015/03/16 00:23:59 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.18 $ */ /* NetHack 3.5 questpgr.c $Date: 2012/02/02 09:18:14 $ $Revision: 1.14 $ */ /* Copyright 1991, M. Stephenson */ /* NetHack may be freely redistributed. See license for details. */ @@ -47,7 +47,7 @@ dump_qtlist() /* dump the character msg list to check appearance */ { struct qtmsg *msg; - if (!showdebug()) return; + if (!showdebug(__FILE__)) return; for (msg = qt_list.chrole; msg->msgnum > 0; msg++) { pline("msgnum %d: delivery %c", diff --git a/src/restore.c b/src/restore.c index af974d147..24a0f777c 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 restore.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 restore.c $NHDT-Date: 1426465439 2015/03/16 00:23:59 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.77 $ */ /* NetHack 3.5 restore.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.71 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1153,7 +1153,7 @@ register int fd; ++msgcount; } if (msgcount) putmsghistory((char *)0, TRUE); - debugpline("Read %d messages from savefile.", msgcount); + debugpline1("Read %d messages from savefile.", msgcount); } /* Clear all structures for object and monster ID mapping. */ diff --git a/src/rnd.c b/src/rnd.c index 662d1a275..fc7147d50 100644 --- a/src/rnd.c +++ b/src/rnd.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 rnd.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 rnd.c $NHDT-Date: 1426465440 2015/03/16 00:24:00 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.8 $ */ /* NetHack 3.5 rnd.c $Date: 2009/05/06 10:47:41 $ $Revision: 1.7 $ */ /* SCCS Id: @(#)rnd.c 3.5 2004/08/27 */ /* NetHack may be freely redistributed. See license for details. */ @@ -24,7 +24,7 @@ register int x; { #ifdef BETA if (x <= 0) { - debugpline("rn2(%d) attempted", x); + debugpline1("rn2(%d) attempted", x); return(0); } x = RND(x); @@ -42,7 +42,7 @@ register int x; /* good luck approaches 0, bad luck approaches (x-1) */ #ifdef BETA if (x <= 0) { - debugpline("rnl(%d) attempted", x); + debugpline1("rnl(%d) attempted", x); return(0); } #endif @@ -81,7 +81,7 @@ register int x; { #ifdef BETA if (x <= 0) { - debugpline("rnd(%d) attempted", x); + debugpline1("rnd(%d) attempted", x); return(1); } x = RND(x)+1; @@ -99,7 +99,7 @@ register int n, x; #ifdef BETA if (x < 0 || n < 0 || (x == 0 && n != 0)) { - debugpline("d(%d,%d) attempted", n, x); + debugpline2("d(%d,%d) attempted", n, x); return(1); } #endif diff --git a/src/save.c b/src/save.c index b220f945d..165c792db 100644 --- a/src/save.c +++ b/src/save.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 save.c $NHDT-Date: 1425081977 2015/02/28 00:06:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.59 $ */ +/* NetHack 3.5 save.c $NHDT-Date: 1426465440 2015/03/16 00:24:00 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.61 $ */ /* NetHack 3.5 save.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.53 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1210,7 +1210,7 @@ int fd, mode; } bwrite(fd, (genericptr_t) &minusone, sizeof(int)); } - debugpline("Stored %d messages into savefile.", msgcount); + debugpline1("Stored %d messages into savefile.", msgcount); /* note: we don't attempt to handle release_data() here */ } diff --git a/src/shk.c b/src/shk.c index 12f22eb40..ffc827482 100644 --- a/src/shk.c +++ b/src/shk.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 shk.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 shk.c $NHDT-Date: 1426465441 2015/03/16 00:24:01 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.96 $ */ /* NetHack 3.5 shk.c $Date: 2012/07/03 22:54:49 $ $Revision: 1.91 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1205,7 +1205,7 @@ dopay() } if(!shkp) { - debugpline("dopay: null shkp."); + debugpline0("dopay: null shkp."); return(0); } proceed: diff --git a/src/sp_lev.c b/src/sp_lev.c index 6be2c9713..41a747da9 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 sp_lev.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sp_lev.c $NHDT-Date: 1426465441 2015/03/16 00:24:01 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.25 $ */ /* NetHack 3.5 sp_lev.c $Date: 2011/01/05 01:28:36 $ $Revision: 1.23 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -324,8 +324,8 @@ chk: lev = &levl[x][y]; for (; y <= ymax; y++) { if (lev++->typ) { - if(!vault) - debugpline("strange area [%d,%d] in check_room.",x,y); + if (!vault) + debugpline2("strange area [%d,%d] in check_room.", x, y); if (!rn2(3)) return FALSE; if (x < *lowx) *lowx = x + xlim + 1; @@ -398,7 +398,7 @@ xchar rtype, rlit; r1 = rnd_rect(); /* Get a random rectangle */ if (!r1) { /* No more free rectangles ! */ - debugpline("No more rects..."); + debugpline0("No more rects..."); return FALSE; } hx = r1->hx; @@ -1311,8 +1311,8 @@ schar ftyp, btyp; if (xx <= 0 || yy <= 0 || tx <= 0 || ty <= 0 || xx > COLNO-1 || tx > COLNO-1 || yy > ROWNO-1 || ty > ROWNO-1) { - debugpline("dig_corridor: bad coords : (%d,%d) (%d,%d).", - xx,yy,tx,ty); + debugpline4("dig_corridor: bad coords <%d,%d> <%d,%d>.", + xx, yy, tx, ty); return FALSE; } if (tx > xx) dx = 1; diff --git a/src/sys.c b/src/sys.c index 14e0aa642..0392d6554 100644 --- a/src/sys.c +++ b/src/sys.c @@ -1,26 +1,34 @@ -/* NetHack 3.5 sys.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sys.c $NHDT-Date: 1426465442 2015/03/16 00:24:02 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.16 $ */ /* NetHack 3.5 sys.c $Date: 2012/03/10 02:22:07 $ $Revision: 1.12 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ #include "hack.h" -/* for KR1ED config, WIZARD is 0 or 1 and WIZARD_NAME is a string; - for usual config, WIZARD is the string; forcing WIZARD_NAME to match it - eliminates conditional testing for which one to use in string ops */ +#ifndef SYSCF +/* !SYSCF configurations need '#define DEBUGFILES "foo.c bar.c"' + to enable debugging feedback for source files foo.c and bar.c; + to activate debugpline(), set an appropriate value and uncomment */ +/* # define DEBUGFILES "*" */ +#endif struct sysopt sysopt; void -sys_early_init(){ +sys_early_init() +{ sysopt.support = NULL; sysopt.recover = NULL; #ifdef SYSCF sysopt.wizards = NULL; #else - sysopt.wizards = WIZARD_NAME; + sysopt.wizards = dupstr(WIZARD_NAME); #endif +#if defined(SYSCF) || !defined(DEBUGFILES) sysopt.debugfiles = NULL; +#else + sysopt.debugfiles = dupstr(DEBUGFILES); +#endif sysopt.shellers = NULL; sysopt.maxplayers = 0; /* XXX eventually replace MAX_NR_OF_PLAYERS */ diff --git a/src/teleport.c b/src/teleport.c index cd179c1f1..bf5e323a7 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 teleport.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 teleport.c $NHDT-Date: 1426465443 2015/03/16 00:24:03 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.48 $ */ /* NetHack 3.5 teleport.c $Date: 2012/01/04 18:52:36 $ $Revision: 1.45 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -121,7 +121,7 @@ unsigned entflags; struct monst fakemon; /* dummy monster */ if (!mdat) { - debugpline("enexto() called with mdat==0"); + debugpline0("enexto() called with null mdat"); /* default to player's original monster type */ mdat = &mons[u.umonster]; } diff --git a/src/zap.c b/src/zap.c index 38b883115..5f39fc30e 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 zap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 zap.c $NHDT-Date: 1426465444 2015/03/16 00:24:04 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.195 $ */ /* NetHack 3.5 zap.c $Date: 2013/11/05 00:57:56 $ $Revision: 1.183 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1708,10 +1708,11 @@ struct obj *obj, *otmp; * as a safeguard against any stray occurrence left in an obj * struct someplace, although that should never happen. */ - if (context.bypasses) + if (context.bypasses) { return 0; - else { - debugpline("%s for a moment.", Tobjnam(obj, "pulsate")); + } else { + debugpline1("%s for a moment.", + Tobjnam(obj, "pulsate")); obj->bypass = 0; } } @@ -3405,7 +3406,8 @@ struct obj **ootmp; /* to return worn armor for caller to disintegrate */ resist(mon, type < ZT_SPELL(0) ? WAND_CLASS : '\0', 0, NOTELL)) tmp /= 2; if (tmp < 0) tmp = 0; /* don't allow negative damage */ - debugpline("zapped monster hp = %d (= %d - %d)", mon->mhp-tmp,mon->mhp,tmp); + debugpline3("zapped monster hp = %d (= %d - %d)", + mon->mhp-tmp, mon->mhp, tmp); mon->mhp -= tmp; return(tmp); } diff --git a/win/tty/wintty.c b/win/tty/wintty.c index a201218e7..553553744 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 wintty.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wintty.c $NHDT-Date: 1426465444 2015/03/16 00:24:04 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.71 $ */ /* NetHack 3.5 wintty.c $Date: 2012/01/22 06:27:09 $ $Revision: 1.66 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -1934,7 +1934,7 @@ register int x, y; /* not xchar: perhaps xchar is unsigned and case NHW_TEXT: s = "[text window]"; break; case NHW_BASE: s = "[base window]"; break; } - debugpline("bad curs positioning win %d %s (%d,%d)", window, s, x, y); + debugpline4("bad curs positioning win %d %s (%d,%d)", window, s, x, y); return; } #endif From 77dbb1080d560292fc3c56f793e7f1033db26ce4 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 16 Mar 2015 02:03:40 -0700 Subject: [PATCH 204/354] free 'sysopt' strings upon termination --- include/extern.h | 4 +++- include/sys.h | 9 +++------ src/save.c | 3 ++- src/sys.c | 20 +++++++++++++++++++- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/include/extern.h b/include/extern.h index cd8843762..d901d3641 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 extern.h $NHDT-Date: 1426465429 2015/03/16 00:23:49 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.406 $ */ +/* NetHack 3.5 extern.h $NHDT-Date: 1426496453 2015/03/16 09:00:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.407 $ */ /* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2065,6 +2065,8 @@ E void FDECL(play_sound_for_message, (const char *)); /* ### sys.c ### */ +E void NDECL(sys_early_init); +E void NDECL(sysopt_release); E void FDECL(sysopt_seduce_set,(int)); /* ### sys/msdos/sound.c ### */ diff --git a/include/sys.h b/include/sys.h index 8358021a2..940e95a11 100644 --- a/include/sys.h +++ b/include/sys.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 sys.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 sys.h $NHDT-Date: 1426496454 2015/03/16 09:00:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */ /* NetHack 3.5 sys.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.9 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -6,10 +6,6 @@ #ifndef SYS_H #define SYS_H -#define E extern - -E void NDECL(sys_early_init); - struct sysopt { char *support; /* local support contact */ char *recover; /* how to run recover - may be overridden by win port */ @@ -34,7 +30,8 @@ struct sysopt { #endif int seduce; }; -E struct sysopt sysopt; + +extern struct sysopt sysopt; #define SYSOPT_SEDUCE sysopt.seduce diff --git a/src/save.c b/src/save.c index 165c792db..802d560a9 100644 --- a/src/save.c +++ b/src/save.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 save.c $NHDT-Date: 1426465440 2015/03/16 00:24:00 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.61 $ */ +/* NetHack 3.5 save.c $NHDT-Date: 1426496455 2015/03/16 09:00:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.62 $ */ /* NetHack 3.5 save.c $Date: 2012/02/16 02:40:24 $ $Revision: 1.53 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1350,6 +1350,7 @@ freedynamicdata() #ifdef STATUS_VIA_WINDOWPORT status_finish(); #endif + sysopt_release(); /* SYSCF strings */ return; } diff --git a/src/sys.c b/src/sys.c index 0392d6554..52489135e 100644 --- a/src/sys.c +++ b/src/sys.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 sys.c $NHDT-Date: 1426465442 2015/03/16 00:24:02 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.16 $ */ +/* NetHack 3.5 sys.c $NHDT-Date: 1426496455 2015/03/16 09:00:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.17 $ */ /* NetHack 3.5 sys.c $Date: 2012/03/10 02:22:07 $ $Revision: 1.12 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -67,6 +67,24 @@ sys_early_init() sysopt_seduce_set(sysopt.seduce); } +void +sysopt_release() +{ + if (sysopt.support) + free(sysopt.support), sysopt.support = NULL; + if (sysopt.recover) + free(sysopt.recover), sysopt.recover = NULL; + if (sysopt.wizards) + free(sysopt.wizards), sysopt.wizards = NULL; + if (sysopt.debugfiles) + free(sysopt.debugfiles), sysopt.debugfiles = NULL; +#ifdef PANICTRACE + if (sysopt.gdbpath) + free(sysopt.gdbpath), sysopt.gdbpath = NULL; + if (sysopt.greppath) + free (sysopt.greppath), sysopt.greppath = NULL; +#endif +} extern struct attack sa_yes[NATTK]; extern struct attack sa_no[NATTK]; From 105545172f28719b0fcf07ceead160334ac33460 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 16 Mar 2015 02:29:10 -0700 Subject: [PATCH 205/354] fix #H3724 - gold pile stacking bug Bug report included a pointer to a fix; this patch is a superset. Gold pieces dropped on an altar by the player got their bknown flag set, which is incorrect since bless/curse doesn't apply to coins. If a monster (in reported case, a slain temple priest) dropped gold there too then the two stacks wouldn't merge. For the normal !GOLDOBJ config, the problem goes away as soon as the gold gets picked up. I didn't test for GOLDOBJ but think two inventory slots containing gold can result. The superset part is to not break agnostic conduct by dropping gold on an altar since no information is revealed when doing that. [This was one of the very last patches checked into the old cvs repository, where the somewhat out of date message above was accidentally omitted.] --- doc/fixes35.0 | 1 + src/do.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index ad8117820..250b09d85 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -855,6 +855,7 @@ fix "object lost" panic (or even crash) when dropping multiple items while levitating and a lit potion of oil explodes and destroys some inventory fix "object_is_local" panic when saving bones after hero is killed by explosion produced by dropped or thrown lit potion of oil +gold dropped on altar by hero wouldn't stack with gold dropped there by monster if lava burns up the player's water walking boots, the player falls in the messages for lava burning items up are always printed fix used-up magic trap trying to hit steed. diff --git a/src/do.c b/src/do.c index 3069a4047..41e25a1b0 100644 --- a/src/do.c +++ b/src/do.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 do.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 do.c $NHDT-Date: 1426497723 2015/03/16 09:22:03 $ $NHDT-Branch: H3724 $:$NHDT-Revision: 1.109 $ */ /* NetHack 3.5 do.c $Date: 2014/11/18 03:10:39 $ $Revision: 1.101 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -222,10 +222,15 @@ doaltarobj(obj) /* obj is an object dropped on an altar */ if (Blind) return; - /* KMH, conduct */ - u.uconduct.gnostic++; + if (obj->oclass != COIN_CLASS) { + /* KMH, conduct */ + u.uconduct.gnostic++; + } else { + /* coins don't have bless/curse status */ + obj->blessed = obj->cursed = 0; + } - if ((obj->blessed || obj->cursed) && obj->oclass != COIN_CLASS) { + if (obj->blessed || obj->cursed) { There("is %s flash as %s %s the altar.", an(hcolor(obj->blessed ? NH_AMBER : NH_BLACK)), doname(obj), otense(obj, "hit")); @@ -233,7 +238,7 @@ doaltarobj(obj) /* obj is an object dropped on an altar */ } else { pline("%s %s on the altar.", Doname2(obj), otense(obj, "land")); - obj->bknown = 1; + if (obj->oclass != COIN_CLASS) obj->bknown = 1; } } From ae974e7a6dcfbae4de9bca8c74a225bddf875e94 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 16 Mar 2015 06:04:43 -0400 Subject: [PATCH 206/354] dungeoneers update March 16, 2015 --- dat/history | 75 +++++++++++++++++++++---------------------- doc/Guidebook.mn | 81 ++++++++++++++++++++++++----------------------- doc/Guidebook.tex | 81 ++++++++++++++++++++++++----------------------- 3 files changed, 120 insertions(+), 117 deletions(-) diff --git a/dat/history b/dat/history index 662ec57ae..b97c99039 100644 --- a/dat/history +++ b/dat/history @@ -159,41 +159,42 @@ particularly intriguing modification to help out with the game. The Gods of the Dungeon sometimes make note of the names of the worst of these miscreants in this, the list of Dungeoneers: - Adam Aronow Izchak Miller Mike Passaretti - Alex Kompel J. Ali Harlow Mike Stephenson - Andreas Dorn Janet Walz Norm Meluch - Andy Church Janne Salmijarvi Olaf Seibert - Andy Swanson Jean-Christophe Collet Pasi Kallinen - Ari Huttunen Jochen Erwied Pat Rankin - Barton House John Kallen Paul Winner - Benson I. Margulies John Rupley Pierre Martineau - Bill Dyer John S. Bien Ralf Brown - Boudewijn Waijers Johnny Lee Ray Chason - Bruce Cox Jon W{tte Richard Addison - Bruce Holloway Jonathan Handler Richard Beigel - Bruce Mewborne Joshua Delahunty Richard P. Hughey - Carl Schelin Keizo Yamamoto Rob Menke - Chris Russo Ken Arnold Robin Johnson - David Cohrs Ken Arromdee Roderick Schertler - David Damerell Ken Lorber Roland McGrath - David Gentzel Ken Washikita Ron Van Iwaarden - David Hairston Kevin Darcy Ronnen Miller - Dean Luick Kevin Hugo Ross Brown - Del Lamb Kevin Sitze Sascha Wostmann - Deron Meranda Kevin Smolkowski Scott Bigham - Dion Nicolaas Kevin Sweet Scott R. Turner - Dylan O'Donnell Lars Huttar Stephen Spackman - Eric Backus Leon Arnott Stephen White - Eric Hendrickson Malcolm Ryan Steve Creps - Eric R. Smith Mark Gooderum Steve Linhart - Eric S. Raymond Mark Modrall Steve VanDevender - Erik Andersen Marvin Bressler Teemu Suikki - Frederick Roeber Matthew Day Tim Lennan - Gil Neiger Merlyn LeRoy Timo Hakulinen - Greg Laskin Michael Allison Tom Almy - Greg Olson Michael Feir Tom West - Gregg Wonderly Michael Hamel Warren Cheung - Hao-yang Wang Michael Sokolov Warwick Allison - Helge Hafting Mike Engber Yitzhak Sapir - Irina Rempt-Drijfhout Mike Gallop + Adam Aronow Izchak Miller Mike Stephenson + Alex Kompel J. Ali Harlow Norm Meluch + Andreas Dorn Janet Walz Olaf Seibert + Andy Church Janne Salmijarvi Pasi Kallinen + Andy Swanson Jean-Christophe Collet Pat Rankin + Ari Huttunen Jochen Erwied Paul Winner + Barton House John Kallen Pierre Martineau + Benson I. Margulies John Rupley Ralf Brown + Bill Dyer John S. Bien Ray Chason + Boudewijn Waijers Johnny Lee Richard Addison + Bruce Cox Jon W{tte Richard Beigel + Bruce Holloway Jonathan Handler Richard P. Hughey + Bruce Mewborne Joshua Delahunty Rob Menke + Carl Schelin Keizo Yamamoto Robin Johnson + Chris Russo Ken Arnold Roderick Schertler + David Cohrs Ken Arromdee Roland McGrath + David Damerell Ken Lorber Ron Van Iwaarden + David Gentzel Ken Washikita Ronnen Miller + David Hairston Kevin Darcy Ross Brown + Dean Luick Kevin Hugo Sascha Wostmann + Del Lamb Kevin Sitze Scott Bigham + Derek S. Ray Kevin Smolkowski Scott R. Turner + Deron Meranda Kevin Sweet Sean Hunt + Dion Nicolaas Lars Huttar Stephen Spackman + Dylan O'Donnell Leon Arnott Stephen White + Eric Backus Malcolm Ryan Steve Creps + Eric Hendrickson Mark Gooderum Steve Linhart + Eric R. Smith Mark Modrall Steve VanDevender + Eric S. Raymond Marvin Bressler Teemu Suikki + Erik Andersen Matthew Day Tim Lennan + Frederick Roeber Merlyn LeRoy Timo Hakulinen + Gil Neiger Michael Allison Tom Almy + Greg Laskin Michael Feir Tom West + Greg Olson Michael Hamel Warren Cheung + Gregg Wonderly Michael Sokolov Warwick Allison + Hao-yang Wang Mike Engber Yitzhak Sapir + Helge Hafting Mike Gallop + Irina Rempt-Drijfhout Mike Passaretti diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 82fa2d195..0b2e5cf3b 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -3,10 +3,10 @@ .ds h0 "NetHack Guidebook .ds h1 .ds h2 % -.ds vr "NetHack 3.5 +.ds vr "NetHack 3.6 .ds f0 "\*(vr .ds f1 -.ds f2 "April 7, 2012 +.ds f2 "March 16, 2015 .\" labeled paragraph start (should be part of tmac.n, but I don't want to .\" make changes to that file) .\" .PS word @@ -58,7 +58,7 @@ A Guide to the Mazes of Menace (Guidebook for NetHack) .au Eric S. Raymond -(Extensively edited and expanded for 3.5) +(Edited and expanded for 3.6) .hn 1 Introduction @@ -3205,43 +3205,44 @@ in this, the list of Dungeoneers: center; c c c. .\"TABLE_START -Adam Aronow Izchak Miller Mike Passaretti -Alex Kompel J. Ali Harlow Mike Stephenson -Andreas Dorn Janet Walz Norm Meluch -Andy Church Janne Salmijarvi Olaf Seibert -Andy Swanson Jean-Christophe Collet Pasi Kallinen -Ari Huttunen Jochen Erwied Pat Rankin -Barton House John Kallen Paul Winner -Benson I. Margulies John Rupley Pierre Martineau -Bill Dyer John S. Bien Ralf Brown -Boudewijn Waijers Johnny Lee Ray Chason -Bruce Cox Jon W{tte Richard Addison -Bruce Holloway Jonathan Handler Richard Beigel -Bruce Mewborne Joshua Delahunty Richard P. Hughey -Carl Schelin Keizo Yamamoto Rob Menke -Chris Russo Ken Arnold Robin Johnson -David Cohrs Ken Arromdee Roderick Schertler -David Damerell Ken Lorber Roland McGrath -David Gentzel Ken Washikita Ron Van Iwaarden -David Hairston Kevin Darcy Ronnen Miller -Dean Luick Kevin Hugo Ross Brown -Del Lamb Kevin Sitze Sascha Wostmann -Deron Meranda Kevin Smolkowski Scott Bigham -Dion Nicolaas Kevin Sweet Scott R. Turner -Dylan O'Donnell Lars Huttar Stephen Spackman -Eric Backus Leon Arnott Stephen White -Eric Hendrickson Malcolm Ryan Steve Creps -Eric R. Smith Mark Gooderum Steve Linhart -Eric S. Raymond Mark Modrall Steve VanDevender -Erik Andersen Marvin Bressler Teemu Suikki -Frederick Roeber Matthew Day Tim Lennan -Gil Neiger Merlyn LeRoy Timo Hakulinen -Greg Laskin Michael Allison Tom Almy -Greg Olson Michael Feir Tom West -Gregg Wonderly Michael Hamel Warren Cheung -Hao-yang Wang Michael Sokolov Warwick Allison -Helge Hafting Mike Engber Yitzhak Sapir -Irina Rempt-Drijfhout Mike Gallop +Adam Aronow Izchak Miller Mike Stephenson +Alex Kompel J. Ali Harlow Norm Meluch +Andreas Dorn Janet Walz Olaf Seibert +Andy Church Janne Salmijarvi Pasi Kallinen +Andy Swanson Jean-Christophe Collet Pat Rankin +Ari Huttunen Jochen Erwied Paul Winner +Barton House John Kallen Pierre Martineau +Benson I. Margulies John Rupley Ralf Brown +Bill Dyer John S. Bien Ray Chason +Boudewijn Waijers Johnny Lee Richard Addison +Bruce Cox Jon W{tte Richard Beigel +Bruce Holloway Jonathan Handler Richard P. Hughey +Bruce Mewborne Joshua Delahunty Rob Menke +Carl Schelin Keizo Yamamoto Robin Johnson +Chris Russo Ken Arnold Roderick Schertler +David Cohrs Ken Arromdee Roland McGrath +David Damerell Ken Lorber Ron Van Iwaarden +David Gentzel Ken Washikita Ronnen Miller +David Hairston Kevin Darcy Ross Brown +Dean Luick Kevin Hugo Sascha Wostmann +Del Lamb Kevin Sitze Scott Bigham +Derek S. Ray Kevin Smolkowski Scott R. Turner +Deron Meranda Kevin Sweet Sean Hunt +Dion Nicolaas Lars Huttar Stephen Spackman +Dylan O'Donnell Leon Arnott Stephen White +Eric Backus Malcolm Ryan Steve Creps +Eric Hendrickson Mark Gooderum Steve Linhart +Eric R. Smith Mark Modrall Steve VanDevender +Eric S. Raymond Marvin Bressler Teemu Suikki +Erik Andersen Matthew Day Tim Lennan +Frederick Roeber Merlyn LeRoy Timo Hakulinen +Gil Neiger Michael Allison Tom Almy +Greg Laskin Michael Feir Tom West +Greg Olson Michael Hamel Warren Cheung +Gregg Wonderly Michael Sokolov Warwick Allison +Hao-yang Wang Mike Engber Yitzhak Sapir +Helge Hafting Mike Gallop +Irina Rempt-Drijfhout Mike Passaretti .\"TABLE_END Do not delete this line. .TE diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index d8e361648..c1cf2015e 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -33,7 +33,7 @@ \begin{document} % % input file: guidebook.mn -% $Revision: 1.121 $ $Date: 2012/04/09 02:56:37 $ +% $Revision: 1.122 $ $Date: 2015/03/16 06:00:00 $ % %.ds h0 " %.ds h1 %.ds h2 \% @@ -45,8 +45,8 @@ %.au \author{Eric S. Raymond\\ -(Extensively edited and expanded for 3.5)} -\date{April 7, 2012} +(Edited and expanded for 3.6)} +\date{March 16, 2015} \maketitle @@ -3801,43 +3801,44 @@ in this, the list of Dungeoneers: \begin{center} \begin{tabular}{lll} %TABLE_START -Adam Aronow & Izchak Miller & Mike Passaretti\\ -Alex Kompel & J. Ali Harlow & Mike Stephenson\\ -Andreas Dorn & Janet Walz & Norm Meluch\\ -Andy Church & Janne Salmij\"{a}rvi & Olaf Seibert\\ -Andy Swanson & Jean-Christophe Collet & Pasi Kallinen\\ -Ari Huttunen & Jochen Erwied & Pat Rankin\\ -Barton House & John Kallen & Paul Winner\\ -Benson I. Margulies & John Rupley & Pierre Martineau\\ -Bill Dyer & John S. Bien & Ralf Brown\\ -Boudewijn Waijers & Johnny Lee & Ray Chason\\ -Bruce Cox & Jon W\{tte & Richard Addison\\ -Bruce Holloway & Jonathan Handler & Richard Beigel\\ -Bruce Mewborne & Joshua Delahunty & Richard P. Hughey\\ -Carl Schelin & Keizo Yamamoto & Rob Menke\\ -Chris Russo & Ken Arnold & Robin Johnson\\ -David Cohrs & Ken Arromdee & Roderick Schertler\\ -David Damerell & Ken Lorber & Roland McGrath\\ -David Gentzel & Ken Washikita & Ron Van Iwaarden\\ -David Hairston & Kevin Darcy & Ronnen Miller\\ -Dean Luick & Kevin Hugo & Ross Brown\\ -Del Lamb & Kevin Sitze & Sascha Wostmann\\ -Deron Meranda & Kevin Smolkowski & Scott Bigham\\ -Dion Nicolaas & Kevin Sweet & Scott R. Turner\\ -Dylan O'Donnell & Lars Huttar & Stephen Spackman\\ -Eric Backus & Leon Arnott & Stephen White\\ -Eric Hendrickson & Malcolm Ryan & Steve Creps\\ -Eric R. Smith & Mark Gooderum & Steve Linhart\\ -Eric S. Raymond & Mark Modrall & Steve VanDevender\\ -Erik Andersen & Marvin Bressler & Teemu Suikki\\ -Frederick Roeber & Matthew Day & Tim Lennan\\ -Gil Neiger & Merlyn LeRoy & Timo Hakulinen\\ -Greg Laskin & Michael Allison & Tom Almy\\ -Greg Olson & Michael Feir & Tom West\\ -Gregg Wonderly & Michael Hamel & Warren Cheung\\ -Hao-yang Wang & Michael Sokolov & Warwick Allison\\ -Helge Hafting & Mike Engber & Yitzhak Sapir\\ -Irina Rempt-Drijfhout & Mike Gallop +Adam Aronow & Izchak Miller & Mike Stephenson\\ +Alex Kompel & J. Ali Harlow & Norm Meluch\\ +Andreas Dorn & Janet Walz & Olaf Seibert\\ +Andy Church & Janne Salmij\"{a}rvi & Pasi Kallinen\\ +Andy Swanson & Jean-Christophe Collet & Pat Rankin\\ +Ari Huttunen & Jochen Erwied & Paul Winner\\ +Barton House & John Kallen & Pierre Martineau\\ +Benson I. Margulies & John Rupley & Ralf Brown\\ +Bill Dyer & John S. Bien & Ray Chason\\ +Boudewijn Waijers & Johnny Lee & Richard Addison\\ +Bruce Cox & Jon W\{tte & Richard Beigel\\ +Bruce Holloway & Jonathan Handler & Richard P. Hughey\\ +Bruce Mewborne & Joshua Delahunty & Rob Menke\\ +Carl Schelin & Keizo Yamamoto & Robin Johnson\\ +Chris Russo & Ken Arnold & Roderick Schertler\\ +David Cohrs & Ken Arromdee & Roland McGrath\\ +David Damerell & Ken Lorber & Ron Van Iwaarden\\ +David Gentzel & Ken Washikita & Ronnen Miller\\ +David Hairston & Kevin Darcy & Ross Brown\\ +Dean Luick & Kevin Hugo & Sascha Wostmann\\ +Del Lamb & Kevin Sitze & Scott Bigham\\ +Derek S. Ray & Kevin Smolkowski & Scott R. Turner\\ +Deron Meranda & Kevin Sweet & Sean Hunt\\ +Dion Nicolaas & Lars Huttar & Stephen Spackman\\ +Dylan O'Donnell & Leon Arnott & Stephen White\\ +Eric Backus & Malcolm Ryan & Steve Creps\\ +Eric Hendrickson & Mark Gooderum & Steve Linhart\\ +Eric R. Smith & Mark Modrall & Steve VanDevender\\ +Eric S. Raymond & Marvin Bressler & Teemu Suikki\\ +Erik Andersen & Matthew Day & Tim Lennan\\ +Frederick Roeber & Merlyn LeRoy & Timo Hakulinen\\ +Gil Neiger & Michael Allison & Tom Almy\\ +Greg Laskin & Michael Feir & Tom West\\ +Greg Olson & Michael Hamel & Warren Cheung\\ +Gregg Wonderly & Michael Sokolov & Warwick Allison\\ +Hao-yang Wang & Mike Engber & Yitzhak Sapir\\ +Helge Hafting & Mike Gallop\\ +Irina Rempt-Drijfhout & Mike Passaretti %TABLE_END Do not delete this line. \end{tabular} \end{center} From b6ec0f066efac319d927ea13522a497148f73679 Mon Sep 17 00:00:00 2001 From: "Derek S. Ray" Date: Mon, 16 Mar 2015 17:26:31 -0400 Subject: [PATCH 207/354] finally remember to add the 'nh-' versions --- DEVEL/git_recipes.txt | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/DEVEL/git_recipes.txt b/DEVEL/git_recipes.txt index 71ce0e5dc..88af7f927 100644 --- a/DEVEL/git_recipes.txt +++ b/DEVEL/git_recipes.txt @@ -34,12 +34,17 @@ you specify: [*] git add (filename) +[*] git nhadd (filename) Adds the changes you've made in (filename) to the pre-commit staging area. (also referred to as the 'index') +"nhadd" is the preferred syntax and will automatically update the source file +headers with the latest date, branch, and version. + [*] git commit [-a] [-m "text"] +[*] git nhcommit [-a] [-m "text"] Commits all staged changes (in the index) to this branch in your local repo from your current position. @@ -47,6 +52,9 @@ Including -a will 'git add' all eligible files before doing so. Including -m will use "text" as the commit message instead of opening an editor window for you to create one. +"nhcommit" is the preferred syntax and will automatically update the source file +headers with the latest date, branch, and version. + [*] git push [--all] [-u origin (branch)] @@ -61,7 +69,7 @@ branch. Without any parameters, unstages the changes for (filename) from the index; does not change the working tree. This is the equivalent of the command -[*] git reset --mixed (filename); git reset --soft (filename) has no effect. +git reset --mixed (filename); git reset --soft (filename) has no effect. With --hard, unstages (filename) from the index and reverts (filename) in the working tree to the most recent commit. @@ -160,6 +168,20 @@ you must commit them manually later (likely after you have edited them). This more accurately mimics the merge behavior of svn [and cvs?] +[*] git stash [save | apply | list] + +save: Takes all changes in your working directory and 'stashes' them in a temporary +holding area. Convenient if the command you're trying to run won't go unless +you have a clean working dir; also convenient to move experimental changes +between branches without needing to commit them. + +apply: Replays the named stash onto your current working directory as though +it were a patch. Does not delete the stash from the list. + +list: Lists all of your stashed code blobs. + + + ======================================= Typical workflows for common activities ======================================= From d4467fc59467c6dd5dfcba90cd071672e78586ad Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 16 Mar 2015 15:28:01 -0700 Subject: [PATCH 208/354] allow DEBUGFILES to be overridden via getenv() If getenv("DEBUGFILES") yields a value then it takes precedence over sysconf.DEBUGFILES or sys.c's #define DEBUGFILES. (It probably should only be controlled via environment since it is not a system-wide attribute, but I haven't taken out the SYSCF handling for it.) --- include/sys.h | 7 ++++++- src/files.c | 21 +++++++++++++++++++-- src/sys.c | 5 ++++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/include/sys.h b/include/sys.h index 940e95a11..b97f7ca80 100644 --- a/include/sys.h +++ b/include/sys.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 sys.h $NHDT-Date: 1426496454 2015/03/16 09:00:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */ +/* NetHack 3.5 sys.h $NHDT-Date: 1426544796 2015/03/16 22:26:36 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ */ /* NetHack 3.5 sys.h $Date: 2012/01/27 20:15:26 $ $Revision: 1.9 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -12,6 +12,11 @@ struct sysopt { char *wizards; char *shellers; /* like wizards, for ! command (-DSHELL) */ char *debugfiles; /* files to show debugplines in. '*' is all. */ + int env_dbgfl; /* 1: debugfiles comes from getenv("DEBUGFILES") + * so sysconf's DEBUGFILES shouldn't override it; + * 0: getenv() hasn't been attempted yet; + * -1: getenv() didn't find a value for DEBUGFILES. + */ int maxplayers; /* record file */ int persmax; diff --git a/src/files.c b/src/files.c index 9e9cea746..a6f17b906 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 files.c $NHDT-Date: 1426465435 2015/03/16 00:23:55 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.133 $ */ +/* NetHack 3.5 files.c $NHDT-Date: 1426544796 2015/03/16 22:26:36 $ $NHDT-Branch: master $:$NHDT-Revision: 1.134 $ */ /* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2157,7 +2157,11 @@ int src; sysopt.shellers = dupstr(bufp); } else if (src == SET_IN_SYS && match_varname(buf, "DEBUGFILES", 5)) { if (sysopt.debugfiles) free(sysopt.debugfiles); - sysopt.debugfiles = dupstr(bufp); + /* if showdebug() has already been called (perhaps we've added + some debugpline() calls to option processing) and has found + a value for getenv("DEBUGFILES"), don't override that */ + if (sysopt.env_dbgfl == 0) + sysopt.debugfiles = dupstr(bufp); } else if (src == SET_IN_SYS && match_varname(buf, "SUPPORT", 7)) { if (sysopt.support) free(sysopt.support); sysopt.support = dupstr(bufp); @@ -3207,6 +3211,19 @@ const char *filename; if (!filename || !*filename) return FALSE; /* sanity precaution */ + if (sysopt.env_dbgfl == 0) { + /* check once for DEBUGFILES in the environment; + if found, it supersedes the sysconf value + [note: getenv() rather than nh_getenv() since a long value + is valid and doesn't pose any sort of overflow risk here] */ + if ((p = getenv("DEBUGFILES")) != 0) { + if (sysopt.debugfiles) free(sysopt.debugfiles); + sysopt.debugfiles = dupstr(p); + sysopt.env_dbgfl = 1; + } else + sysopt.env_dbgfl = -1; + } + debugfiles = sysopt.debugfiles; /* usual case: sysopt.debugfiles will be empty */ if (!debugfiles || !*debugfiles) return FALSE; diff --git a/src/sys.c b/src/sys.c index 52489135e..35e46b7c8 100644 --- a/src/sys.c +++ b/src/sys.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 sys.c $NHDT-Date: 1426496455 2015/03/16 09:00:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.17 $ */ +/* NetHack 3.5 sys.c $NHDT-Date: 1426544797 2015/03/16 22:26:37 $ $NHDT-Branch: master $:$NHDT-Revision: 1.18 $ */ /* NetHack 3.5 sys.c $Date: 2012/03/10 02:22:07 $ $Revision: 1.12 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -10,6 +10,8 @@ to enable debugging feedback for source files foo.c and bar.c; to activate debugpline(), set an appropriate value and uncomment */ /* # define DEBUGFILES "*" */ +/* note: DEBUGFILES value here or in sysconf.DEBUGFILES can be overridden + at runtime by setting up a value for "DEBUGFILES" in the environment */ #endif struct sysopt sysopt; @@ -29,6 +31,7 @@ sys_early_init() #else sysopt.debugfiles = dupstr(DEBUGFILES); #endif + sysopt.env_dbgfl = 0; /* haven't checked getenv("DEBUGFILES") yet */ sysopt.shellers = NULL; sysopt.maxplayers = 0; /* XXX eventually replace MAX_NR_OF_PLAYERS */ From 7912a566e5ed0b0b40145c12dcc882f138aa0dda Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 16 Mar 2015 19:22:49 -0700 Subject: [PATCH 209/354] some lint cleanup --- src/do_name.c | 15 ++++++++------- src/pickup.c | 8 ++++---- src/role.c | 20 +++++++++++--------- src/trap.c | 10 ++-------- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/src/do_name.c b/src/do_name.c index f1960b6ff..37daffbc4 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 do_name.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 do_name.c $NHDT-Date: 1426558927 2015/03/17 02:22:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.53 $ */ /* NetHack 3.5 do_name.c $Date: 2012/01/29 03:00:17 $ $Revision: 1.49 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -56,8 +56,8 @@ const char *goal; } int -getpos(cc, force, goal) -coord *cc; +getpos(ccp, force, goal) +coord *ccp; boolean force; const char *goal; { @@ -75,8 +75,8 @@ const char *goal; pline("(For instructions type a ?)"); msg_given = TRUE; } - cx = cc->x; - cy = cc->y; + cx = ccp->x; + cy = ccp->y; #ifdef CLIPPING cliparound(cx, cy); #endif @@ -97,6 +97,7 @@ const char *goal; int sym = 0; char tmpbuf[BUFSZ]; const char *firstmatch = NULL; + cc.x = cx; cc.y = cy; if (do_screen_description(cc, TRUE, sym, tmpbuf, &firstmatch)) { @@ -250,8 +251,8 @@ const char *goal; lock_mouse_cursor(FALSE); #endif if (msg_given) clear_nhwindow(WIN_MESSAGE); - cc->x = cx; - cc->y = cy; + ccp->x = cx; + ccp->y = cy; return result; } diff --git a/src/pickup.c b/src/pickup.c index 7b3096c59..3eba9874f 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 pickup.c $NHDT-Date: 1426465438 2015/03/16 00:23:58 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.130 $ */ +/* NetHack 3.5 pickup.c $NHDT-Date: 1426558927 2015/03/17 02:22:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.131 $ */ /* NetHack 3.5 pickup.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.123 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1515,7 +1515,7 @@ doloot() /* loot a container on the floor or loot saddle from mon. */ lootcont: if (container_at(cc.x, cc.y, FALSE)) { - boolean any = FALSE; + boolean anyfound = FALSE; int num_conts = 0; if (!able_to_loot(cc.x, cc.y, TRUE)) return 0; @@ -1563,14 +1563,14 @@ lootcont: cobj, doname, ansimpleoname, "a container")); if (c == 'q') return (timepassed); if (c == 'n') continue; - any = TRUE; + anyfound = TRUE; timepassed |= do_loot_cont(&cobj); /* might have triggered chest trap or magic bag explosion */ if (multi < 0 || !cobj) return 1; } } - if (any) c = 'y'; + if (anyfound) c = 'y'; } } else if (IS_GRAVE(levl[cc.x][cc.y].typ)) { You("need to dig up the grave to effectively loot it..."); diff --git a/src/role.c b/src/role.c index 9e09d448a..bf4d66de7 100644 --- a/src/role.c +++ b/src/role.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 role.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 role.c $NHDT-Date: 1426558928 2015/03/17 02:22:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.21 $ */ /* NetHack 3.5 role.c $Date: 2012/02/16 03:01:38 $ $Revision: 1.18 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1333,14 +1333,16 @@ plnamesuffix() int i; #ifdef GENERIC_USERNAMES - /* some generic user names will be ignored in favor of prompting */ - i = (int)strlen(plname); - eptr = GENERIC_USERNAMES; - sptr = strstri(eptr, plname); - if (sptr - && (sptr == eptr || sptr[-1] == ' ') - && (sptr[i] == ' ' || sptr[i] == '\0')) - *plname = '\0'; /* call askname() */ + { + /* some generic user names will be ignored in favor of prompting */ + const char *uptr = GENERIC_USERNAMES; + + i = (int)strlen(plname); + if ((sptr = strstri(uptr, plname)) != 0 + && (sptr == uptr || sptr[-1] == ' ') + && (sptr[i] == ' ' || sptr[i] == '\0')) + *plname = '\0'; /* call askname() */ + } #endif do { diff --git a/src/trap.c b/src/trap.c index 911aafdc5..36c1ee632 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 trap.c $NHDT-Date: 1425318721 2015/03/02 17:52:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.194 $ */ +/* NetHack 3.5 trap.c $NHDT-Date: 1426558928 2015/03/17 02:22:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.195 $ */ /* NetHack 3.5 trap.c $Date: 2013/03/14 01:58:21 $ $Revision: 1.179 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3016,7 +3016,6 @@ xchar x, y; { int chance; struct obj *otmp, *ncobj; - int retval = 0; int in_sight = !Blind && couldsee(x, y); /* Don't care if it's lit */ int dindx; @@ -3158,7 +3157,7 @@ struct obj *obj; const char *ostr; boolean force; { - boolean loose_obj = (obj && obj->where == OBJ_FREE), exploded = FALSE; + boolean exploded = FALSE; if (snuff_lit(obj)) return ER_DAMAGED; @@ -3214,11 +3213,6 @@ boolean force; (one ? "Another" : "More"), bufp, vtense(bufp, "explode")); exploded = TRUE; - /* let caller know that obj has gone away - [when obj is part of a list, delobj()'s - obj_extract_self() takes care of this; - for loose_obj, obj should always equal - *objp and otmp should always be null] */ setnotworn(obj); delobj(obj); if (update) From 47bb9abace1922593339d2a34badef890b523196 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 18 Feb 2015 20:14:40 +0200 Subject: [PATCH 210/354] New level compiler: code changes --- include/extern.h | 5 +- include/mkroom.h | 2 + include/rm.h | 14 + include/sp_lev.h | 538 +++-- src/dig.c | 9 +- src/hacklib.c | 14 + src/mklev.c | 42 +- src/mkmaze.c | 46 +- src/mon.c | 5 +- src/sp_lev.c | 4991 ++++++++++++++++++++++++++++++++++------------ src/trap.c | 2 +- util/lev_comp.l | 395 ++-- util/lev_comp.y | 3178 ++++++++++++++++++----------- util/lev_main.c | 1724 +++++++--------- 14 files changed, 7189 insertions(+), 3776 deletions(-) diff --git a/include/extern.h b/include/extern.h index d901d3641..d7d1a3d57 100644 --- a/include/extern.h +++ b/include/extern.h @@ -275,7 +275,7 @@ E int FDECL(use_pick_axe2, (struct obj *)); E boolean FDECL(mdig_tunnel, (struct monst *)); E void FDECL(watch_dig, (struct monst *,XCHAR_P,XCHAR_P,BOOLEAN_P)); E void NDECL(zap_dig); -E struct obj *FDECL(bury_an_obj, (struct obj *)); +E struct obj *FDECL(bury_an_obj, (struct obj *, boolean *)); E void FDECL(bury_objs, (int,int)); E void FDECL(unearth_objs, (int,int)); E void FDECL(rot_organic, (ANY_P *, long)); @@ -1132,6 +1132,7 @@ E void FDECL(dodoor, (int,int,struct mkroom *)); E void FDECL(mktrap, (int,int,struct mkroom *,coord*)); E void FDECL(mkstairs, (XCHAR_P,XCHAR_P,CHAR_P,struct mkroom *)); E void NDECL(mkinvokearea); +E void FDECL(mineralize, (int, int, int, int, boolean)); /* ### mkmap.c ### */ @@ -1141,7 +1142,7 @@ void FDECL(remove_rooms, (int,int,int,int)); /* ### mkmaze.c ### */ E void FDECL(wallification, (int,int,int,int)); -E void FDECL(walkfrom, (int,int)); +E void FDECL(walkfrom, (int,int,SCHAR_P)); E void FDECL(makemaz, (const char *)); E void FDECL(mazexy, (coord *)); E void NDECL(bound_digging); diff --git a/include/mkroom.h b/include/mkroom.h index e9952ddfa..45f49305f 100644 --- a/include/mkroom.h +++ b/include/mkroom.h @@ -13,6 +13,8 @@ struct mkroom { schar rtype; /* type of room (zoo, throne, etc...) */ schar orig_rtype; /* same as rtype, but not zeroed later */ schar rlit; /* is the room lit ? */ + schar needfill; /* sp_lev: does the room need filling? */ + schar needjoining; /* sp_lev */ schar doorct; /* door count */ schar fdoor; /* index for the first door of the room */ schar nsubrooms; /* number of subrooms */ diff --git a/include/rm.h b/include/rm.h index c007f6a4f..00f0bc4c5 100644 --- a/include/rm.h +++ b/include/rm.h @@ -291,6 +291,7 @@ extern struct symsetentry symset[NUM_GRAPHICS]; /* from drawing.c */ #define D_CLOSED 4 #define D_LOCKED 8 #define D_TRAPPED 16 +#define D_SECRET 32 /* only used by sp_lev.c, NOT in rm-struct */ /* * Some altars are considered as shrines, so we need a flag. @@ -393,6 +394,19 @@ struct rm { Bitfield(candig,1); /* Exception to Can_dig_down; was a trapdoor */ }; + +#define SET_TYPLIT(x,y,ttyp,llit) \ +{ \ + if ((x) >= 0 && (y) >= 0 && (x) < COLNO && (y) < ROWNO) { \ + if ((ttyp) < MAX_TYPE) levl[(x)][(y)].typ = (ttyp); \ + if ((ttyp) == LAVAPOOL) levl[(x)][(y)].lit = 1; \ + else if ((schar)(llit) != -2) { \ + if ((schar)(llit) == -1) levl[(x)][(y)].lit = rn2(2); \ + else levl[(x)][(y)].lit = (llit); \ + } \ + } \ +} + /* * Add wall angle viewing by defining "modes" for each wall type. Each * mode describes which parts of a wall are finished (seen as as wall) diff --git a/include/sp_lev.h b/include/sp_lev.h index 0a1d22173..f2c61625b 100644 --- a/include/sp_lev.h +++ b/include/sp_lev.h @@ -19,26 +19,315 @@ #define MAP_Y_LIM 21 /* Per level flags */ -#define NOTELEPORT 1 -#define HARDFLOOR 2 -#define NOMMAP 4 -#define SHORTSIGHTED 8 -#define ARBOREAL 16 +#define NOTELEPORT 0x00000001L +#define HARDFLOOR 0x00000002L +#define NOMMAP 0x00000004L +#define SHORTSIGHTED 0x00000008L +#define ARBOREAL 0x00000010L +#define MAZELEVEL 0x00000020L +#define PREMAPPED 0x00000040L +#define SHROUD 0x00000080L +#define STORMY 0x00000100L +#define GRAVEYARD 0x00000200L - /* special level types */ -#define SP_LEV_ROOMS 1 -#define SP_LEV_MAZE 2 + +/* different level layout initializers */ +#define LVLINIT_NONE 0 +#define LVLINIT_SOLIDFILL 1 +#define LVLINIT_MAZEGRID 2 +#define LVLINIT_MINES 3 +#define LVLINIT_ROGUE 4 + +/* max. layers of object containment */ +#define MAX_CONTAINMENT 10 + +/* max. # of random registers */ +#define MAX_REGISTERS 10 + +/* max. nested depth of subrooms */ +#define MAX_NESTED_ROOMS 5 + +/* max. # of opcodes per special level */ +#define SPCODER_MAX_RUNTIME 65536 + +/* Opcodes for creating the level + * If you change these, also change opcodestr[] in util/lev_main.c + */ +enum opcode_defs { + SPO_NULL = 0, + SPO_MESSAGE, + SPO_MONSTER, + SPO_OBJECT, + SPO_ENGRAVING, + SPO_ROOM, + SPO_SUBROOM, + SPO_DOOR, + SPO_STAIR, + SPO_LADDER, + SPO_ALTAR, + SPO_FOUNTAIN, + SPO_SINK, + SPO_POOL, + SPO_TRAP, + SPO_GOLD, + SPO_CORRIDOR, + SPO_LEVREGION, + SPO_DRAWBRIDGE, + SPO_MAZEWALK, + SPO_NON_DIGGABLE, + SPO_NON_PASSWALL, + SPO_WALLIFY, + SPO_MAP, + SPO_ROOM_DOOR, + SPO_REGION, + SPO_MINERALIZE, + SPO_CMP, + SPO_JMP, + SPO_JL, + SPO_JLE, + SPO_JG, + SPO_JGE, + SPO_JE, + SPO_JNE, + SPO_TERRAIN, + SPO_REPLACETERRAIN, + SPO_EXIT, + SPO_ENDROOM, + SPO_POP_CONTAINER, + SPO_PUSH, + SPO_POP, + SPO_RN2, + SPO_DEC, + SPO_INC, + SPO_MATH_ADD, + SPO_MATH_SUB, + SPO_MATH_MUL, + SPO_MATH_DIV, + SPO_MATH_MOD, + SPO_MATH_SIGN, + SPO_COPY, + SPO_END_MONINVENT, + SPO_GRAVE, + SPO_FRAME_PUSH, + SPO_FRAME_POP, + SPO_CALL, + SPO_RETURN, + SPO_INITLEVEL, + SPO_LEVEL_FLAGS, + SPO_VAR_INIT, /* variable_name data */ + SPO_SHUFFLE_ARRAY, + SPO_DICE, + + SPO_SEL_ADD, + SPO_SEL_POINT, + SPO_SEL_RECT, + SPO_SEL_FILLRECT, + SPO_SEL_LINE, + SPO_SEL_RNDLINE, + SPO_SEL_GROW, + SPO_SEL_FLOOD, + SPO_SEL_RNDCOORD, + SPO_SEL_ELLIPSE, + SPO_SEL_FILTER, + SPO_SEL_GRADIENT, + SPO_SEL_COMPLEMENT, + + MAX_SP_OPCODES +}; + +/* MONSTER and OBJECT can take a variable number of parameters, + * they also pop different # of values from the stack. So, + * first we pop a value that tells what the _next_ value will + * mean. + */ +/* MONSTER */ +#define SP_M_V_PEACEFUL 0 +#define SP_M_V_ALIGN 1 +#define SP_M_V_ASLEEP 2 +#define SP_M_V_APPEAR 3 +#define SP_M_V_NAME 4 + +#define SP_M_V_FEMALE 5 +#define SP_M_V_INVIS 6 +#define SP_M_V_CANCELLED 7 +#define SP_M_V_REVIVED 8 +#define SP_M_V_AVENGE 9 +#define SP_M_V_FLEEING 10 +#define SP_M_V_BLINDED 11 +#define SP_M_V_PARALYZED 12 +#define SP_M_V_STUNNED 13 +#define SP_M_V_CONFUSED 14 +#define SP_M_V_SEENTRAPS 15 + +#define SP_M_V_END 16 /* end of variable parameters */ + +/* OBJECT */ +#define SP_O_V_SPE 0 +#define SP_O_V_CURSE 1 +#define SP_O_V_CORPSENM 2 +#define SP_O_V_NAME 3 +#define SP_O_V_QUAN 4 +#define SP_O_V_BURIED 5 +#define SP_O_V_LIT 6 +#define SP_O_V_ERODED 7 +#define SP_O_V_LOCKED 8 +#define SP_O_V_TRAPPED 9 +#define SP_O_V_RECHARGED 10 +#define SP_O_V_INVIS 11 +#define SP_O_V_GREASED 12 +#define SP_O_V_BROKEN 13 +#define SP_O_V_COORD 14 +#define SP_O_V_END 15 /* end of variable parameters */ + + +/* When creating objects, we need to know whether + * it's a container and/or contents. + */ +#define SP_OBJ_CONTENT 0x1 +#define SP_OBJ_CONTAINER 0x2 + + +/* SPO_FILTER types */ +#define SPOFILTER_PERCENT 0 +#define SPOFILTER_SELECTION 1 +#define SPOFILTER_MAPCHAR 2 + +/* gradient filter types */ +#define SEL_GRADIENT_RADIAL 0 +#define SEL_GRADIENT_SQUARE 1 + +/* variable types */ +#define SPOVAR_NULL 0x00 +#define SPOVAR_INT 0x01 /* l */ +#define SPOVAR_STRING 0x02 /* str */ +#define SPOVAR_VARIABLE 0x03 /* str (contains the variable name) */ +#define SPOVAR_COORD 0x04 /* coordinate, encoded in l; use SP_COORD_X() and SP_COORD_Y() */ +#define SPOVAR_REGION 0x05 /* region, encoded in l; use SP_REGION_X1() etc */ +#define SPOVAR_MAPCHAR 0x06 /* map char, in l */ +#define SPOVAR_MONST 0x07 /* monster class & specific monster, encoded in l; use SP_MONST_... */ +#define SPOVAR_OBJ 0x08 /* object class & specific object type, encoded in l; use SP_OBJ_... */ +#define SPOVAR_SEL 0x09 /* selection. char[COLNO][ROWNO] in str */ +#define SPOVAR_ARRAY 0x40 /* used in splev_var & lc_vardefs, not in opvar */ + +#define SP_COORD_IS_RANDOM 0x01000000 +/* Humidity flags for get_location() and friends, used with SP_COORD_PACK_RANDOM() */ +#define DRY 0x1 +#define WET 0x2 +#define HOT 0x4 +#define SOLID 0x8 +#define ANY_LOC 0x10 /* even outside the level */ +#define NO_LOC_WARN 0x20 /* no complaints and set x & y to -1, if no loc */ + +#define SP_COORD_X(l) (l & 0xff) +#define SP_COORD_Y(l) ((l >> 16) & 0xff) +#define SP_COORD_PACK(x,y) ((( x ) & 0xff) + ((( y ) & 0xff) << 16)) +#define SP_COORD_PACK_RANDOM(f) (SP_COORD_IS_RANDOM | (f)) + +#define SP_REGION_X1(l) (l & 0xff) +#define SP_REGION_Y1(l) ((l >> 8) & 0xff) +#define SP_REGION_X2(l) ((l >> 16) & 0xff) +#define SP_REGION_Y2(l) ((l >> 24) & 0xff) +#define SP_REGION_PACK(x1,y1,x2,y2) ((( x1 ) & 0xff) + ((( y1 ) & 0xff) << 8) + ((( x2 ) & 0xff) << 16) + ((( y2 ) & 0xff) << 24)) + +#define SP_MONST_CLASS(l) (l & 0xff) +#define SP_MONST_PM(l) ((l >> 8) & 0xffff) +#define SP_MONST_PACK(m,c) ((( m ) << 8) + ((char)( c ))) + +#define SP_OBJ_CLASS(l) (l & 0xff) +#define SP_OBJ_TYP(l) ((l >> 8) & 0xffff) +#define SP_OBJ_PACK(o,c) ((( o ) << 8) + ((char)( c ))) + +#define SP_MAPCHAR_TYP(l) (l & 0xff) +#define SP_MAPCHAR_LIT(l) ((l >> 8) & 0xff) +#define SP_MAPCHAR_PACK(typ,lit) ((( lit ) << 8) + ((char)( typ ))) + + +struct opvar { + xchar spovartyp; /* one of SPOVAR_foo */ + union { + char *str; + long l; + } vardata; +}; + +struct splev_var { + struct splev_var *next; + char *name; + xchar svtyp; /* SPOVAR_foo */ + union { + struct opvar *value; + struct opvar **arrayvalues; + } data; + long array_len; +}; + +struct splevstack { + long depth; + long depth_alloc; + struct opvar **stackdata; +}; + + +struct sp_frame { + struct sp_frame *next; + struct splevstack *stack; + struct splev_var *variables; + long n_opcode; +}; + + +struct sp_coder { + struct splevstack *stack; + struct sp_frame *frame; + /*int allow_flips;*/ + int premapped; + struct mkroom *croom; + struct mkroom *tmproomlist[MAX_NESTED_ROOMS+1]; + boolean failed_room[MAX_NESTED_ROOMS+1]; + int n_subroom; + boolean exit_script; + int lvl_is_joined; + + int opcode; /* current opcode */ + struct opvar *opdat; /* current push data (req. opcode == SPO_PUSH) */ +}; + +/* special level coder CPU flags */ +#define SP_CPUFLAG_LT 1 +#define SP_CPUFLAG_GT 2 +#define SP_CPUFLAG_EQ 4 +#define SP_CPUFLAG_ZERO 8 /* * Structures manipulated by the special levels loader & compiler */ +#define packed_coord long +typedef struct { + xchar is_random; + long getloc_flags; + int x, y; +} unpacked_coord; + +typedef struct { + int cmp_what; + int cmp_val; +} opcmp; + +typedef struct { + long jmp_target; +} opjmp; + + typedef union str_or_len { char *str; int len; } Str_or_Len; typedef struct { + xchar init_style; /* one of LVLINIT_foo */ + long flags; + schar filling; boolean init_present, padding; char fg, bg; boolean smoothed, joined; @@ -46,65 +335,62 @@ typedef struct { boolean icedpools; /* for ice locations: ICED_POOL vs ICED_MOAT */ } lev_init; -typedef struct { - xchar x, y, mask; -} door; - typedef struct { xchar wall, pos, secret, mask; } room_door; typedef struct { - xchar x, y, chance, type; + packed_coord coord; + xchar x, y, type; } trap; typedef struct { Str_or_Len name, appear_as; short id; aligntyp align; - xchar x, y, chance, class, appear; + packed_coord coord; + xchar x, y, class, appear; schar peaceful, asleep; + short female, invis, cancelled, revived, avenge, fleeing, blinded, paralyzed, stunned, confused; + long seentraps; + short has_invent; } monster; typedef struct { Str_or_Len name; int corpsenm; short id, spe; - xchar x, y, chance, class, containment; + packed_coord coord; + xchar x, y, class, containment; schar curse_state; + int quan; + short buried; + short lit; + short eroded, locked, trapped, recharged, invis, greased, broken; } object; typedef struct { + packed_coord coord; xchar x, y; aligntyp align; xchar shrine; } altar; -typedef struct { - xchar x, y, dir, db_open; -} drawbridge; - -typedef struct { - xchar x, y, dir; -} walk; - -typedef struct { - xchar x1, y1, x2, y2; -} digpos; - -typedef struct { - xchar x, y, up; -} lad; - -typedef struct { - xchar x, y, up; -} stair; - typedef struct { xchar x1, y1, x2, y2; xchar rtype, rlit, rirreg; } region; +typedef struct { + xchar ter, tlit; +} terrain; + +typedef struct { + xchar chance; + xchar x1,y1,x2,y2; + xchar fromter, toter, tolit; +} replaceterrain; + /* values for rtype are defined in dungeon.h */ typedef struct { struct { xchar x1, y1, x2, y2; } inarea; @@ -114,116 +400,6 @@ typedef struct { Str_or_Len rname; } lev_region; -typedef struct { - xchar x, y; - int amount; -} gold; - -typedef struct { - xchar x, y; - Str_or_Len engr; - xchar etype; -} engraving; - -typedef struct { - xchar x, y; -} fountain; - -typedef struct { - xchar x, y; -} sink; - -typedef struct { - xchar x, y; -} pool; - -typedef struct { - char halign, valign; - char xsize, ysize; - char **map; - char nrobjects; - char *robjects; - char nloc; - char *rloc_x; - char *rloc_y; - char nrmonst; - char *rmonst; - char nreg; - region **regions; - char nlreg; - lev_region **lregions; - char ndoor; - door **doors; - char ntrap; - trap **traps; - char nmonster; - monster **monsters; - char nobject; - object **objects; - char ndrawbridge; - drawbridge **drawbridges; - char nwalk; - walk **walks; - char ndig; - digpos **digs; - char npass; - digpos **passs; - char nlad; - lad **lads; - char nstair; - stair **stairs; - char naltar; - altar **altars; - char ngold; - gold **golds; - char nengraving; - engraving **engravings; - char nfountain; - fountain **fountains; -} mazepart; - -typedef struct { - long flags; - lev_init init_lev; - schar filling; - char numpart; - mazepart **parts; -} specialmaze; - -typedef struct _room { - char *name; - char *parent; - xchar x, y, w, h; - xchar xalign, yalign; - xchar rtype, chance, rlit, filled; - char ndoor; - room_door **doors; - char ntrap; - trap **traps; - char nmonster; - monster **monsters; - char nobject; - object **objects; - char naltar; - altar **altars; - char nstair; - stair **stairs; - char ngold; - gold **golds; - char nengraving; - engraving **engravings; - char nfountain; - fountain **fountains; - char nsink; - sink **sinks; - char npool; - pool **pools; - /* These three fields are only used when loading the level... */ - int nsubroom; - struct _room *subrooms[MAX_SUBROOMS]; - struct mkroom *mkr; -} room; - typedef struct { struct { xchar room; @@ -232,18 +408,66 @@ typedef struct { } src, dest; } corridor; -/* used only by lev_comp */ +typedef struct _room { + Str_or_Len name; + Str_or_Len parent; + xchar x, y, w, h; + xchar xalign, yalign; + xchar rtype, chance, rlit, filled, joined; +} room; + typedef struct { - long flags; - lev_init init_lev; - char nrobjects; - char *robjects; - char nrmonst; - char *rmonst; - xchar nroom; - room **rooms; - xchar ncorr; - corridor **corrs; -} splev; + schar zaligntyp; + schar keep_region; + schar halign, valign; + char xsize, ysize; + char **map; +} mazepart; + +typedef struct { + int opcode; + struct opvar *opdat; +} _opcode; + +typedef struct { + _opcode *opcodes; + long n_opcodes; +} sp_lev; + +typedef struct { + xchar x, y, direction, count, lit; + char typ; +} spill; + + +/* only used by lev_comp */ +struct lc_funcdefs_parm { + char *name; + char parmtype; + struct lc_funcdefs_parm *next; +}; + +struct lc_funcdefs { + struct lc_funcdefs *next; + char *name; + long addr; + sp_lev code; + long n_called; + struct lc_funcdefs_parm *params; + long n_params; +}; + +struct lc_vardefs { + struct lc_vardefs *next; + char *name; + long var_type; /* SPOVAR_foo */ + long n_used; +}; + +struct lc_breakdef { + struct lc_breakdef *next; + struct opvar *breakpoint; + int break_depth; +}; #endif /* SP_LEV_H */ diff --git a/src/dig.c b/src/dig.c index fa25f76a0..66d41d163 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1683,13 +1683,15 @@ buried_ball_to_freedom() /* move objects from fobj/nexthere lists to buriedobjlist, keeping position */ /* information */ struct obj * -bury_an_obj(otmp) +bury_an_obj(otmp, dealloced) struct obj *otmp; + boolean *dealloced; { struct obj *otmp2; boolean under_ice; debugpline1("bury_an_obj: %s", xname(otmp)); + if (dealloced) *dealloced = FALSE; if (otmp == uball) { unpunish(); u.utrap = rn1(50,20); @@ -1720,6 +1722,7 @@ bury_an_obj(otmp) under_ice = is_ice(otmp->ox, otmp->oy); if (otmp->otyp == ROCK && !under_ice) { /* merges into burying material */ + if (dealloced) *dealloced = TRUE; obfree(otmp, (struct obj *)0); return(otmp2); } @@ -1754,7 +1757,7 @@ int x, y; if(level.objects[x][y] != (struct obj *)0) debugpline2("bury_objs: at <%d,%d>", x, y); for (otmp = level.objects[x][y]; otmp; otmp = otmp2) - otmp2 = bury_an_obj(otmp); + otmp2 = bury_an_obj(otmp, NULL); /* don't expect any engravings here, but just in case */ del_engr_at(x, y); @@ -1814,7 +1817,7 @@ long timeout UNUSED; /* Everything which can be held in a container can also be buried, so bury_an_obj's use of obj_extract_self insures that Has_contents(obj) will eventually become false. */ - (void)bury_an_obj(obj->cobj); + (void)bury_an_obj(obj->cobj, NULL); } obj_extract_self(obj); obfree(obj, (struct obj *) 0); diff --git a/src/hacklib.c b/src/hacklib.c index fd4273074..78f12dea5 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -398,6 +398,20 @@ dist2(x0, y0, x1, y1) /* square of euclidean distance between pair of pts */ return dx * dx + dy * dy; } +int +isqrt(val) +int val; +{ + int rt = 0; + int odd = 1; + while(val >= odd) { + val = val-odd; + odd = odd+2; + rt = rt + 1; + } + return rt; +} + boolean online2(x0, y0, x1, y1) /* are two points lined up (on a straight line)? */ int x0, y0, x1, y1; diff --git a/src/mklev.c b/src/mklev.c index 4412d68aa..5b4c9634a 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -17,7 +17,6 @@ STATIC_DCL void FDECL(mkgrave,(struct mkroom *)); STATIC_DCL void NDECL(makevtele); STATIC_DCL void NDECL(clear_level_structures); STATIC_DCL void NDECL(makelevel); -STATIC_DCL void NDECL(mineralize); STATIC_DCL boolean FDECL(bydoor,(XCHAR_P,XCHAR_P)); STATIC_DCL struct mkroom *FDECL(find_branch_room, (coord *)); STATIC_DCL struct mkroom *FDECL(pos_to_room, (XCHAR_P, XCHAR_P)); @@ -814,43 +813,50 @@ skip0: * Place deposits of minerals (gold and misc gems) in the stone * surrounding the rooms on the map. * Also place kelp in water. + * mineralize(-1, -1, -1, -1, FALSE); => "default" behaviour */ -STATIC_OVL void -mineralize() +void +mineralize(kelp_pool, kelp_moat, goldprob, gemprob, skip_lvl_checks) +int kelp_pool, kelp_moat, goldprob, gemprob; +boolean skip_lvl_checks; { s_level *sp; struct obj *otmp; - int goldprob, gemprob, x, y, cnt; + int x, y, cnt; + if (kelp_pool < 0) kelp_pool = 10; + if (kelp_moat < 0) kelp_moat = 30; /* Place kelp, except on the plane of water */ - if (In_endgame(&u.uz)) return; + if (!skip_lvl_checks && In_endgame(&u.uz)) return; for (x = 2; x < (COLNO - 2); x++) for (y = 1; y < (ROWNO - 1); y++) - if ((levl[x][y].typ == POOL && !rn2(10)) || - (levl[x][y].typ == MOAT && !rn2(30))) + if ((kelp_pool && levl[x][y].typ == POOL && !rn2(kelp_pool)) || + (kelp_moat && levl[x][y].typ == MOAT && !rn2(kelp_moat))) (void) mksobj_at(KELP_FROND, x, y, TRUE, FALSE); /* determine if it is even allowed; almost all special levels are excluded */ - if (In_hell(&u.uz) || In_V_tower(&u.uz) || + if (!skip_lvl_checks && (In_hell(&u.uz) || In_V_tower(&u.uz) || Is_rogue_level(&u.uz) || level.flags.arboreal || ((sp = Is_special(&u.uz)) != 0 && !Is_oracle_level(&u.uz) && (!In_mines(&u.uz) || sp->flags.town) - )) return; + ))) return; /* basic level-related probabilities */ - goldprob = 20 + depth(&u.uz) / 3; - gemprob = goldprob / 4; + if (goldprob < 0) goldprob = 20 + depth(&u.uz) / 3; + if (gemprob < 0) gemprob = goldprob / 4; /* mines have ***MORE*** goodies - otherwise why mine? */ - if (In_mines(&u.uz)) { - goldprob *= 2; - gemprob *= 3; - } else if (In_quest(&u.uz)) { - goldprob /= 4; - gemprob /= 6; + if (!skip_lvl_checks) { + if (In_mines(&u.uz)) { + goldprob *= 2; + gemprob *= 3; + } else if (In_quest(&u.uz)) { + goldprob /= 4; + gemprob /= 6; + } } /* @@ -905,7 +911,7 @@ mklev() in_mklev = TRUE; makelevel(); bound_digging(); - mineralize(); + mineralize(-1, -1, -1, -1, FALSE); in_mklev = FALSE; /* has_morgue gets cleared once morgue is entered; graveyard stays set (graveyard might already be set even when has_morgue is clear diff --git a/src/mkmaze.c b/src/mkmaze.c index 87a3a870b..4270ba783 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -556,7 +556,7 @@ register const char *s; #endif maze0xy(&mm); - walkfrom((int) mm.x, (int) mm.y); + walkfrom((int) mm.x, (int) mm.y, 0); /* put a boulder at the maze center */ (void) mksobj_at(BOULDER, (int) mm.x, (int) mm.y, TRUE, FALSE); @@ -644,14 +644,21 @@ register const char *s; * that is totally safe. */ void -walkfrom(x,y) +walkfrom(x,y,typ) int x,y; +schar typ; { #define CELLS (ROWNO * COLNO) / 4 /* a maze cell is 4 squares */ char mazex[CELLS + 1], mazey[CELLS + 1]; /* char's are OK */ int q, a, dir, pos; int dirs[4]; +#ifndef WALLIFIED_MAZE + if (!typ) typ = CORR; +#else + if (!typ) typ = ROOM; +#endif + pos = 1; mazex[pos] = (char) x; mazey[pos] = (char) y; @@ -660,11 +667,7 @@ int x,y; y = (int) mazey[pos]; if(!IS_DOOR(levl[x][y].typ)) { /* might still be on edge of MAP, so don't overwrite */ -#ifndef WALLIFIED_MAZE - levl[x][y].typ = CORR; -#else - levl[x][y].typ = ROOM; -#endif + levl[x][y].typ = typ; levl[x][y].flags = 0; } q = 0; @@ -675,11 +678,7 @@ int x,y; else { dir = dirs[rn2(q)]; move(&x, &y, dir); -#ifndef WALLIFIED_MAZE - levl[x][y].typ = CORR; -#else - levl[x][y].typ = ROOM; -#endif + levl[x][y].typ = typ; move(&x, &y, dir); pos++; if (pos > CELLS) @@ -692,19 +691,22 @@ int x,y; #else void -walkfrom(x,y) +walkfrom(x,y,typ) int x,y; +schar typ; { register int q,a,dir; int dirs[4]; +#ifndef WALLIFIED_MAZE + if (!typ) typ = CORR; +#else + if (!typ) typ = ROOM; +#endif + if(!IS_DOOR(levl[x][y].typ)) { /* might still be on edge of MAP, so don't overwrite */ -#ifndef WALLIFIED_MAZE - levl[x][y].typ = CORR; -#else - levl[x][y].typ = ROOM; -#endif + levl[x][y].typ = typ; levl[x][y].flags = 0; } @@ -715,13 +717,9 @@ int x,y; if(!q) return; dir = dirs[rn2(q)]; move(&x,&y,dir); -#ifndef WALLIFIED_MAZE - levl[x][y].typ = CORR; -#else - levl[x][y].typ = ROOM; -#endif + levl[x][y].typ = typ; move(&x,&y,dir); - walkfrom(x,y); + walkfrom(x,y,typ); } } #endif /* MICRO */ diff --git a/src/mon.c b/src/mon.c index fb0a75a57..cfe5cddca 100644 --- a/src/mon.c +++ b/src/mon.c @@ -278,9 +278,10 @@ unsigned corpseflags; obj = mkcorpstat(CORPSE, KEEPTRAITS(mtmp) ? mtmp : 0, mdat, x, y, corpstatflags); if (burythem) { - (void) bury_an_obj(obj); + boolean dealloc; + (void) bury_an_obj(obj, &dealloc); newsym(x, y); - return obj; + return (dealloc ? NULL : obj); } } break; diff --git a/src/sp_lev.c b/src/sp_lev.c index 41a747da9..0650a7bd1 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -18,25 +18,24 @@ extern void FDECL(mkmap, (lev_init *)); STATIC_DCL void FDECL(get_room_loc, (schar *, schar *, struct mkroom *)); -STATIC_DCL void FDECL(get_free_room_loc, (schar *, schar *, struct mkroom *)); +STATIC_DCL void FDECL(get_free_room_loc, (schar *, schar *, struct mkroom *, packed_coord)); STATIC_DCL void FDECL(create_trap, (trap *, struct mkroom *)); STATIC_DCL int FDECL(noncoalignment, (ALIGNTYP_P)); STATIC_DCL boolean FDECL(m_bad_boulder_spot, (int,int)); STATIC_DCL void FDECL(create_monster, (monster *, struct mkroom *)); STATIC_DCL void FDECL(create_object, (object *, struct mkroom *)); -STATIC_DCL void FDECL(create_engraving, (engraving *,struct mkroom *)); -STATIC_DCL void FDECL(create_stairs, (stair *, struct mkroom *)); STATIC_DCL void FDECL(create_altar, (altar *, struct mkroom *)); -STATIC_DCL void FDECL(create_gold, (gold *, struct mkroom *)); -STATIC_DCL void FDECL(create_feature, (int,int,struct mkroom *,int)); STATIC_DCL boolean FDECL(search_door, (struct mkroom *, xchar *, xchar *, XCHAR_P, int)); STATIC_DCL void NDECL(fix_stair_rooms); STATIC_DCL void FDECL(create_corridor, (corridor *)); +STATIC_DCL void NDECL(count_features); STATIC_DCL boolean FDECL(create_subroom, (struct mkroom *, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P)); +long FDECL(opvar_array_length, (struct sp_coder *)); + #define LEFT 1 #define H_LEFT 2 #define CENTER 3 @@ -57,11 +56,11 @@ STATIC_DCL boolean FDECL(create_subroom, (struct mkroom *, XCHAR_P, XCHAR_P, #define NewTab(type, size) (type **) alloc(sizeof(type *) * (unsigned)size) #define Free(ptr) if(ptr) free((genericptr_t) (ptr)) -static NEARDATA walk walklist[50]; +extern struct engr *head_engr; + extern int min_rx, max_rx, min_ry, max_ry; /* from mkmap.c */ -static char Map[COLNO][ROWNO]; -static char robjects[10], rloc_x[10], rloc_y[10], rmonst[10]; +static char SpLev_Map[COLNO][ROWNO]; static aligntyp ralign[3] = { AM_CHAOTIC, AM_NEUTRAL, AM_LAWFUL }; static NEARDATA xchar xstart, ystart; static NEARDATA char xsize, ysize; @@ -69,24 +68,375 @@ static NEARDATA char xsize, ysize; STATIC_DCL void FDECL(set_wall_property, (XCHAR_P,XCHAR_P,XCHAR_P,XCHAR_P,int)); STATIC_DCL int NDECL(rnddoor); STATIC_DCL int NDECL(rndtrap); -STATIC_DCL void FDECL(get_location, (schar *,schar *,int)); -STATIC_DCL void FDECL(sp_lev_shuffle, (char *,char *,int)); +STATIC_DCL void FDECL(get_location, (schar *,schar *,int, struct mkroom *)); STATIC_DCL void FDECL(light_region, (region *)); -STATIC_DCL void FDECL(load_common_data, (dlb *,int)); -STATIC_DCL void FDECL(load_one_monster, (dlb *,monster *)); -STATIC_DCL void FDECL(load_one_object, (dlb *,object *)); -STATIC_DCL void FDECL(load_one_engraving, (dlb *,engraving *)); -STATIC_DCL boolean FDECL(load_rooms, (dlb *)); STATIC_DCL void FDECL(maze1xy, (coord *,int)); -STATIC_DCL boolean FDECL(load_maze, (dlb *)); +STATIC_DCL boolean FDECL(sp_level_loader, (dlb *, sp_lev *)); STATIC_DCL void FDECL(create_door, (room_door *, struct mkroom *)); -STATIC_DCL void FDECL(free_rooms,(room **, int)); -STATIC_DCL void FDECL(build_room, (room *, room*)); +struct mkroom * FDECL(build_room, (room *, struct mkroom *)); char *lev_message = 0; lev_region *lregions = 0; int num_lregions = 0; -lev_init init_lev; + +struct obj *container_obj[MAX_CONTAINMENT]; +int container_idx = 0; + +struct monst *invent_carrying_monster = NULL; + +#define SPLEV_STACK_RESERVE 128 + +void +splev_stack_init(st) + struct splevstack *st; +{ + if (st) { + st->depth = 0; + st->depth_alloc = SPLEV_STACK_RESERVE; + st->stackdata = (struct opvar **)alloc(st->depth_alloc * sizeof(struct opvar *)); + if (!st->stackdata) panic("stack init alloc"); + } +} + +void +splev_stack_done(st) + struct splevstack *st; +{ + if (st) { + int i; + + if (st->stackdata && st->depth) + for (i = 0; i < st->depth; i++) { + switch (st->stackdata[i]->spovartyp) { + default: + case SPOVAR_NULL: + case SPOVAR_COORD: + case SPOVAR_REGION: + case SPOVAR_MAPCHAR: + case SPOVAR_MONST: + case SPOVAR_OBJ: + case SPOVAR_INT: + break; + case SPOVAR_VARIABLE: + case SPOVAR_STRING: + case SPOVAR_SEL: + if (st->stackdata[i]->vardata.str) Free(st->stackdata[i]->vardata.str); + st->stackdata[i]->vardata.str = NULL; + break; + } + Free(st->stackdata[i]); + st->stackdata[i] = NULL; + } + + Free(st->stackdata); + st->stackdata = NULL; + st->depth = st->depth_alloc = 0; + Free(st); + } +} + +void +splev_stack_push(st, v) + struct splevstack *st; + struct opvar *v; +{ + if (!st || !v) return; + if (!st->stackdata) panic("splev_stack_push: no stackdata allocated?"); + + if (st->depth >= st->depth_alloc) { + struct opvar **tmp = (struct opvar **)alloc((st->depth_alloc + SPLEV_STACK_RESERVE) * sizeof(struct opvar *)); + if (!tmp) panic("stack push alloc"); + (void)memcpy(tmp, st->stackdata, st->depth_alloc * sizeof(struct opvar *)); + Free(st->stackdata); + st->stackdata = tmp; + st->depth_alloc += SPLEV_STACK_RESERVE; + } + + st->stackdata[st->depth] = v; + st->depth++; +} + +struct opvar * +splev_stack_pop(st) + struct splevstack *st; +{ + struct opvar *ret = NULL; + if (!st) return ret; + if (!st->stackdata) panic("splev_stack_pop: no stackdata allocated?"); + + if (st->depth) { + st->depth--; + ret = st->stackdata[st->depth]; + st->stackdata[st->depth] = NULL; + return ret; + } else impossible("splev_stack_pop: empty stack?"); + return ret; +} + +struct splevstack * +splev_stack_reverse(st) + struct splevstack *st; +{ + long i; + struct opvar *tmp; + if (!st) return NULL; + if (!st->stackdata) panic("splev_stack_reverse: no stackdata allocated?"); + for (i = 0; i < (st->depth / 2); i++) { + tmp = st->stackdata[i]; + st->stackdata[i] = st->stackdata[st->depth - i - 1]; + st->stackdata[st->depth - i - 1] = tmp; + } + return st; +} + +#define OV_typ(o) (o->spovartyp) +#define OV_i(o) (o->vardata.l) +#define OV_s(o) (o->vardata.str) + +#define OV_pop_i(x) (x = splev_stack_getdat(coder, SPOVAR_INT)) +#define OV_pop_c(x) (x = splev_stack_getdat(coder, SPOVAR_COORD)) +#define OV_pop_r(x) (x = splev_stack_getdat(coder, SPOVAR_REGION)) +#define OV_pop_s(x) (x = splev_stack_getdat(coder, SPOVAR_STRING)) +#define OV_pop(x) (x = splev_stack_getdat_any(coder)) +#define OV_pop_typ(x,typ) (x = splev_stack_getdat(coder, typ)) + + +struct opvar * +opvar_new_str(s) + char *s; +{ + struct opvar *tmpov = (struct opvar *)alloc(sizeof(struct opvar)); + if (!tmpov) panic("could not alloc opvar struct"); + tmpov->spovartyp = SPOVAR_STRING; + if (s) { + int len = strlen(s); + tmpov->vardata.str = (char *)alloc(len + 1); + if (!tmpov->vardata.str) panic("opvar new str alloc"); + (void)memcpy((genericptr_t)tmpov->vardata.str, + (genericptr_t)s, len); + tmpov->vardata.str[len] = '\0'; + } else + tmpov->vardata.str = NULL; + return tmpov; +} + +struct opvar * +opvar_new_int(i) + long i; +{ + struct opvar *tmpov = (struct opvar *)alloc(sizeof(struct opvar)); + if (!tmpov) panic("could not alloc opvar struct"); + tmpov->spovartyp = SPOVAR_INT; + tmpov->vardata.l = i; + return tmpov; +} + +struct opvar * +opvar_new_coord(x,y) + int x,y; +{ + struct opvar *tmpov = (struct opvar *)alloc(sizeof(struct opvar)); + if (!tmpov) panic("could not alloc opvar struct"); + tmpov->spovartyp = SPOVAR_COORD; + tmpov->vardata.l = SP_COORD_PACK(x,y); + return tmpov; +} + +struct opvar * +opvar_new_region(x1,y1,x2,y2) + int x1,y1,x2,y2; +{ + struct opvar *tmpov = (struct opvar *)alloc(sizeof(struct opvar)); + if (!tmpov) panic("could not alloc opvar struct"); + tmpov->spovartyp = SPOVAR_REGION; + tmpov->vardata.l = SP_REGION_PACK(x1,y1,x2,y2); + return tmpov; +} + +void +opvar_free_x(ov) + struct opvar *ov; +{ + if (!ov) return; + switch (ov->spovartyp) { + case SPOVAR_COORD: + case SPOVAR_REGION: + case SPOVAR_MAPCHAR: + case SPOVAR_MONST: + case SPOVAR_OBJ: + case SPOVAR_INT: + break; + case SPOVAR_VARIABLE: + case SPOVAR_STRING: + case SPOVAR_SEL: + Free(ov->vardata.str); + break; + default: impossible("Unknown opvar value type (%i)!", ov->spovartyp); + } + Free(ov); +} + +#define opvar_free(ov) { if (ov) { opvar_free_x(ov); ov = NULL; } else impossible("opvar_free(), %s", __FUNCTION__); } + +struct opvar * +opvar_clone(ov) + struct opvar *ov; +{ + struct opvar *tmpov; + if (!ov) panic("no opvar to clone"); + tmpov = (struct opvar *)alloc(sizeof(struct opvar)); + if (!tmpov) panic("could not alloc opvar struct"); + tmpov->spovartyp = ov->spovartyp; + switch (ov->spovartyp) { + case SPOVAR_COORD: + case SPOVAR_REGION: + case SPOVAR_MAPCHAR: + case SPOVAR_MONST: + case SPOVAR_OBJ: + case SPOVAR_INT: + tmpov->vardata.l = ov->vardata.l; + break; + case SPOVAR_VARIABLE: + case SPOVAR_STRING: + case SPOVAR_SEL: + tmpov->vardata.str = strdup(ov->vardata.str); + break; + default: impossible("Unknown push value type (%i)!", ov->spovartyp); + } + return tmpov; +} + + +struct opvar * +opvar_var_conversion(coder, ov) + struct sp_coder *coder; + struct opvar *ov; +{ + struct splev_var *tmp; + struct opvar *tmpov; + struct opvar *array_idx = NULL; + if (!coder || !ov) return NULL; + if (ov->spovartyp != SPOVAR_VARIABLE) return ov; + tmp = coder->frame->variables; + while (tmp) { + if (!strcmp(tmp->name, OV_s(ov))) { + if ((tmp->svtyp & SPOVAR_ARRAY)) { + array_idx = opvar_var_conversion(coder, splev_stack_pop(coder->stack)); + if (!array_idx || OV_typ(array_idx) != SPOVAR_INT) + panic("array idx not an int"); + if (tmp->array_len < 1) panic("array len < 1"); + OV_i(array_idx) = (OV_i(array_idx) % tmp->array_len); + tmpov = opvar_clone(tmp->data.arrayvalues[OV_i(array_idx)]); + return tmpov; + } else { + tmpov = opvar_clone(tmp->data.value); + return tmpov; + } + } + tmp = tmp->next; + } + return NULL; +} + +struct splev_var * +opvar_var_defined(coder, name) + struct sp_coder *coder; + char *name; +{ + struct splev_var *tmp; + if (!coder) return NULL; + tmp = coder->frame->variables; + while (tmp) { + if (!strcmp(tmp->name, name)) return tmp; + tmp = tmp->next; + } + return NULL; +} + +struct opvar * +splev_stack_getdat(coder, typ) + struct sp_coder *coder; + xchar typ; +{ + if (coder && coder->stack) { + struct opvar *tmp = splev_stack_pop(coder->stack); + if (!tmp) panic("no value type %i in stack.", typ); + if (tmp->spovartyp == SPOVAR_VARIABLE) + tmp = opvar_var_conversion(coder, tmp); + if (tmp->spovartyp == typ) + return tmp; + } + return NULL; +} + +struct opvar * +splev_stack_getdat_any(coder) + struct sp_coder *coder; +{ + if (coder && coder->stack) { + struct opvar *tmp = splev_stack_pop(coder->stack); + if (tmp && tmp->spovartyp == SPOVAR_VARIABLE) + tmp = opvar_var_conversion(coder, tmp); + return tmp; + } + return NULL; +} + + + +void +variable_list_del(varlist) + struct splev_var *varlist; +{ + struct splev_var *tmp = varlist; + if (!tmp) return; + while (tmp) { + Free(tmp->name); + if ((tmp->svtyp & SPOVAR_ARRAY)) { + long idx = tmp->array_len; + while (idx-- > 0) { + opvar_free(tmp->data.arrayvalues[idx]); + }; + Free(tmp->data.arrayvalues); + } else { + opvar_free(tmp->data.value); + } + tmp = varlist->next; + Free(varlist); + varlist = tmp; + } +} + +void +lvlfill_maze_grid(x1,y1,x2,y2,filling) +int x1,y1,x2,y2; +schar filling; +{ + int x,y; + + for (x = x1; x <= x2; x++) + for (y = y1; y <= y2; y++) { +#ifndef WALLIFIED_MAZE + levl[x][y].typ = STONE; +#else + levl[x][y].typ = + (y < 2 || ((x % 2) && (y % 2))) ? STONE : filling; +#endif + } +} + +void +lvlfill_solid(filling,lit) +schar filling; +schar lit; +{ + int x,y; + for (x = 2; x <= x_maze_max; x++) + for (y = 0; y <= y_maze_max; y++) { + SET_TYPLIT(x,y,filling,lit); + } +} + /* * Make walls of the area (x1, y1, x2, y2) non diggable/non passwall-able @@ -99,12 +449,78 @@ int prop; { register xchar x, y; - for(y = y1; y <= y2; y++) - for(x = x1; x <= x2; x++) - if(IS_STWALL(levl[x][y].typ)) + for(y = max(y1,0); y <= min(y2, ROWNO-1); y++) + for(x = max(x1,0); x <= min(x2,COLNO-1); x++) + if(IS_STWALL(levl[x][y].typ) || IS_TREE(levl[x][y].typ)) levl[x][y].wall_info |= prop; } +STATIC_OVL void +shuffle_alignments() +{ + int i; + aligntyp atmp; + /* shuffle 3 alignments */ + i = rn2(3); atmp=ralign[2]; ralign[2]=ralign[i]; ralign[i]=atmp; + if (rn2(2)) { atmp=ralign[1]; ralign[1]=ralign[0]; ralign[0]=atmp; } +} + +/* + * Count the different features (sinks, fountains) in the level. + */ +STATIC_OVL void +count_features() +{ + xchar x,y; + level.flags.nfountains = level.flags.nsinks = 0; + for (y = 0; y < ROWNO; y++) + for (x = 0; x < COLNO; x++) { + int typ = levl[x][y].typ; + if (typ == FOUNTAIN) + level.flags.nfountains++; + else if (typ == SINK) + level.flags.nsinks++; + } +} + +void +remove_boundary_syms() +{ + /* + * If any CROSSWALLs are found, must change to ROOM after REGION's + * are laid out. CROSSWALLS are used to specify "invisible" + * boundaries where DOOR syms look bad or aren't desirable. + */ + xchar x,y; + boolean has_bounds = FALSE; + for (x = 0; x < COLNO-1; x++) + for (y = 0; y < ROWNO-1; y++) + if (levl[x][y].typ == CROSSWALL) { + has_bounds = TRUE; + break; + } + if (has_bounds) { + for(x = 0; x < x_maze_max; x++) + for(y = 0; y < y_maze_max; y++) + if ((levl[x][y].typ == CROSSWALL) && !SpLev_Map[x][y]) + levl[x][y].typ = ROOM; + } +} + +void +fill_rooms() +{ + int tmpi; + for (tmpi = 0; tmpi < nroom; tmpi++) { + int m; + if (rooms[tmpi].needfill) + fill_room(&rooms[tmpi], (rooms[tmpi].needfill == 2)); + for (m = 0; m < rooms[tmpi].nsubrooms; m++) + if (rooms[tmpi].sbrooms[m]->needfill) + fill_room(rooms[tmpi].sbrooms[m], FALSE); + } +} + /* * Choose randomly the state (nodoor, open, closed or locked) for a door */ @@ -146,55 +562,74 @@ rndtrap() /* * Coordinates in special level files are handled specially: * - * if x or y is -11, we generate a random coordinate. - * if x or y is between -1 and -10, we read one from the corresponding - * register (x0, x1, ... x9). - * if x or y is nonnegative, we convert it from relative to the local map - * to global coordinates. + * if x or y is < 0, we generate a random coordinate. * The "humidity" flag is used to insure that engravings aren't * created underwater, or eels on dry land. */ -#define DRY 0x1 -#define WET 0x2 - STATIC_DCL boolean FDECL(is_ok_location, (SCHAR_P, SCHAR_P, int)); STATIC_OVL void -get_location(x, y, humidity) +get_location(x, y, humidity, croom) schar *x, *y; int humidity; +struct mkroom *croom; { int cpt = 0; + int mx, my, sx, sy; + + if (croom) { + mx = croom->lx; + my = croom->ly; + sx = croom->hx - mx + 1; + sy = croom->hy - my + 1; + } else { + mx = xstart; + my = ystart; + sx = xsize; + sy = ysize; + } if (*x >= 0) { /* normal locations */ - *x += xstart; - *y += ystart; - } else if (*x > -11) { /* special locations */ - *y = ystart + rloc_y[ - *y - 1]; - *x = xstart + rloc_x[ - *x - 1]; + *x += mx; + *y += my; } else { /* random location */ do { - *x = xstart + rn2((int)xsize); - *y = ystart + rn2((int)ysize); + if (croom) { /* handle irregular areas */ + coord tmpc; + somexy(croom, &tmpc); + *x = tmpc.x; + *y = tmpc.y; + } else { + *x = mx + rn2((int)sx); + *y = my + rn2((int)sy); + } if (is_ok_location(*x,*y,humidity)) break; } while (++cpt < 100); if (cpt >= 100) { register int xx, yy; /* last try */ - for (xx = 0; xx < xsize; xx++) - for (yy = 0; yy < ysize; yy++) { - *x = xstart + xx; - *y = ystart + yy; + for (xx = 0; xx < sx; xx++) + for (yy = 0; yy < sy; yy++) { + *x = mx + xx; + *y = my + yy; if (is_ok_location(*x,*y,humidity)) goto found_it; } - panic("get_location: can't find a place!"); + if (!(humidity & NO_LOC_WARN)) { + impossible("get_location: can't find a place!"); + } else { + *x = *y = -1; + } } } found_it:; - if (!isok(*x,*y)) { - impossible("get_location: (%d,%d) out of bounds", *x, *y); - *x = x_maze_max; *y = y_maze_max; + if (!(humidity & ANY_LOC) && !isok(*x,*y)) { + if (!(humidity & NO_LOC_WARN)) { + /*warning("get_location: (%d,%d) out of bounds", *x, *y);*/ + *x = x_maze_max; *y = y_maze_max; + } else { + *x = *y = -1; + } } } @@ -207,42 +642,58 @@ register int humidity; if (Is_waterlevel(&u.uz)) return TRUE; /* accept any spot */ + /* TODO: Should perhaps check if wall is diggable/passwall? */ + if (humidity & ANY_LOC) return TRUE; + + if ((humidity & SOLID) && IS_ROCK(levl[x][y].typ)) return TRUE; + if (humidity & DRY) { typ = levl[x][y].typ; if (typ == ROOM || typ == AIR || typ == CLOUD || typ == ICE || typ == CORR) return TRUE; } - if (humidity & WET) { - if (is_pool(x,y) || ((humidity & DRY) && is_lava(x,y))) - return TRUE; - } + if ((humidity & WET) && is_pool(x,y)) return TRUE; + if ((humidity & HOT) && is_lava(x,y)) return TRUE; return FALSE; } -/* - * Shuffle the registers for locations, objects or monsters - */ + +unpacked_coord +get_unpacked_coord(loc, defhumidity) + long loc; + int defhumidity; +{ + static unpacked_coord c; + + if (loc & SP_COORD_IS_RANDOM) { + c.x = c.y = -1; + c.is_random = 1; + c.getloc_flags = (loc & ~SP_COORD_IS_RANDOM); + if (!c.getloc_flags) c.getloc_flags = defhumidity; + } else { + c.is_random = 0; + c.getloc_flags = defhumidity; + c.x = SP_COORD_X(loc); + c.y = SP_COORD_Y(loc); + } + return c; +} STATIC_OVL void -sp_lev_shuffle(list1, list2, n) -char list1[], list2[]; -int n; +get_location_coord(x, y, humidity, croom, crd) +schar *x, *y; +int humidity; +struct mkroom *croom; +long crd; { - register int i, j; - register char k; - - for (i = n - 1; i > 0; i--) { - if ((j = rn2(i + 1)) == i) continue; - k = list1[j]; - list1[j] = list1[i]; - list1[i] = k; - if (list2) { - k = list2[j]; - list2[j] = list2[i]; - list2[i] = k; - } - } + unpacked_coord c; + c = get_unpacked_coord(crd, humidity); + *x = c.x; + *y = c.y; + get_location(x, y, c.getloc_flags | (c.is_random ? NO_LOC_WARN : 0), croom); + if (*x == -1 && *y == -1 && c.is_random) + get_location(x,y, humidity, croom); } /* @@ -279,20 +730,24 @@ struct mkroom *croom; */ STATIC_OVL void -get_free_room_loc(x,y, croom) +get_free_room_loc(x,y, croom, pos) schar *x, *y; struct mkroom *croom; +packed_coord pos; { schar try_x, try_y; register int trycnt = 0; - do { - try_x = *x, try_y = *y; - get_room_loc(&try_x, &try_y, croom); - } while (levl[try_x][try_y].typ != ROOM && ++trycnt <= 100); + get_location_coord(&try_x, &try_y, DRY, croom, pos); + if (levl[try_x][try_y].typ != ROOM) { + do { + try_x = *x, try_y = *y; + get_room_loc(&try_x, &try_y, croom); + } while (levl[try_x][try_y].typ != ROOM && ++trycnt <= 100); - if (trycnt > 100) - panic("get_free_room_loc: can't find a place!"); + if (trycnt > 100) + panic("get_free_room_loc: can't find a place!"); + } *x = try_x, *y = try_y; } @@ -390,7 +845,7 @@ xchar rtype, rlit; xtmp = x; ytmp = y; xaltmp = xal; yaltmp = yal; - /* First case : a totaly random room */ + /* First case : a totally random room */ if((xtmp < 0 && ytmp <0 && wtmp < 0 && xaltmp < 0 && yaltmp < 0) || vault) { @@ -571,8 +1026,8 @@ create_door(dd, broom) room_door *dd; struct mkroom *broom; { - int x, y; - int trycnt = 0; + int x = 0, y = 0; + int trycnt = 0, wtry = 0; if (dd->secret == -1) dd->secret = rn2(2); @@ -607,37 +1062,43 @@ struct mkroom *broom; dwall = 1 << rn2(4); dpos = dd->pos; - if (dpos == -1) /* The position is RANDOM */ - dpos = rn2((dwall == W_WEST || dwall == W_EAST) ? - (broom->hy - broom->ly + 1) : - (broom->hx - broom->lx + 1)); /* Convert wall and pos into an absolute coordinate! */ - - switch (dwall) { - case W_NORTH: + wtry = rn2(4); + switch (wtry) { + case 0: + if (!(dwall & W_NORTH)) goto redoloop; y = broom->ly - 1; - x = broom->lx + dpos; - break; - case W_SOUTH: + x = broom->lx + ((dpos == -1) ? rn2(1+(broom->hx - broom->lx)) : dpos); + if (IS_ROCK(levl[x][y-1].typ)) goto redoloop; + goto outdirloop; + case 1: + if (!(dwall & W_SOUTH)) goto redoloop; y = broom->hy + 1; - x = broom->lx + dpos; - break; - case W_WEST: + x = broom->lx + ((dpos == -1) ? rn2(1+(broom->hx - broom->lx)) : dpos); + if (IS_ROCK(levl[x][y+1].typ)) goto redoloop; + goto outdirloop; + case 2: + if (!(dwall & W_WEST)) goto redoloop; x = broom->lx - 1; - y = broom->ly + dpos; - break; - case W_EAST: + y = broom->ly + ((dpos == -1) ? rn2(1+(broom->hy - broom->ly)) : dpos); + if (IS_ROCK(levl[x-1][y].typ)) goto redoloop; + goto outdirloop; + case 3: + if (!(dwall & W_EAST)) goto redoloop; x = broom->hx + 1; - y = broom->ly + dpos; - break; + y = broom->ly + ((dpos == -1) ? rn2(1+(broom->hy - broom->ly)) : dpos); + if (IS_ROCK(levl[x+1][y].typ)) goto redoloop; + goto outdirloop; default: x = y = 0; panic("create_door: No wall for door!"); - break; + goto outdirloop; } +outdirloop: if (okdoor(x,y)) break; +redoloop: ; } while (++trycnt <= 100); if (trycnt > 100) { impossible("create_door: Can't find a proper place!"); @@ -701,19 +1162,20 @@ struct mkroom *croom; schar x,y; coord tm; - if (rn2(100) < t->chance) { - x = t->x; - y = t->y; - if (croom) - get_free_room_loc(&x, &y, croom); - else - get_location(&x, &y, DRY); + if (croom) + get_free_room_loc(&x, &y, croom, t->coord); + else { + int trycnt = 0; + do { + get_location_coord(&x, &y, DRY, croom, t->coord); + } while ((levl[x][y].typ == STAIRS || levl[x][y].typ == LADDER) && ++trycnt <= 100); + if (trycnt > 100) return; + } tm.x = x; tm.y = y; mktrap(t->type, 1, (struct mkroom*) 0, &tm); - } } /* @@ -765,12 +1227,9 @@ struct mkroom *croom; struct permonst *pm; unsigned g_mvflags; - if (rn2(100) < m->chance) { if (m->class >= 0) class = (char) def_char_to_monclass((char)m->class); - else if (m->class > -11) - class = (char) def_char_to_monclass(rmonst[- m->class - 1]); else class = 0; @@ -781,7 +1240,7 @@ struct mkroom *croom; Align2amask(u.ualignbase[A_ORIGINAL]) : (m->align == AM_SPLEV_NONCO) ? Align2amask(noncoalignment(u.ualignbase[A_ORIGINAL])) : - (m->align <= -11) ? induced_align(80) : + (m->align <= -(MAX_REGISTERS+1)) ? induced_align(80) : (m->align < 0 ? ralign[-m->align-1] : m->align); if (!class) @@ -790,7 +1249,7 @@ struct mkroom *croom; pm = &mons[m->id]; g_mvflags = (unsigned) mvitals[monsndx(pm)].mvflags; if ((pm->geno & G_UNIQ) && (g_mvflags & G_EXTINCT)) - goto m_done; + return; else if (g_mvflags & G_GONE) /* genocided or extinct */ pm = (struct permonst *) 0; /* make random monster */ } else { @@ -802,23 +1261,27 @@ struct mkroom *croom; (Race_if(PM_DWARF) || Race_if(PM_GNOME)) && rn2(3)) pm = (struct permonst *) 0; - x = m->x; - y = m->y; - if (croom) - get_room_loc(&x, &y, croom); - else { - if (!pm || !is_swimmer(pm)) - get_location(&x, &y, DRY); - else if (pm->mlet == S_EEL) - get_location(&x, &y, WET); - else - get_location(&x, &y, DRY|WET); + if (pm) { + int loc = DRY; + if (pm->mlet == S_EEL || amphibious(pm) || is_swimmer(pm)) loc = WET; + if (is_flyer(pm) || is_floater(pm)) loc |= (HOT | WET); + if (passes_walls(pm) || noncorporeal(pm)) loc |= SOLID; + if (flaming(pm)) loc |= HOT; + /* If water-liking monster, first try is without DRY */ + get_location_coord(&x, &y, loc|NO_LOC_WARN, croom, m->coord); + if (x == -1 && y == -1) { + loc |= DRY; + get_location_coord(&x, &y, loc, croom, m->coord); + } + } else { + get_location_coord(&x, &y, DRY, croom, m->coord); } + /* try to find a close place if someone else is already there */ if (MON_AT(x,y) && enexto(&cc, x, y, pm)) x = cc.x, y = cc.y; - if(m->align != -12) + if(m->align != -(MAX_REGISTERS+2)) mtmp = mk_roamer(pm, Amask2align(amask), x, y, m->peaceful); else if(PM_ARCHEOLOGIST <= m->id && m->id <= PM_WIZARD) mtmp = mk_mplayer(pm, x, y, FALSE); @@ -833,7 +1296,7 @@ struct mkroom *croom; * This is currently hardwired for mimics only. It should * eventually be expanded. */ - if (m->appear_as.str && mtmp->data->mlet == S_MIMIC) { + if (m->appear_as.str && ((mtmp->data->mlet == S_MIMIC) || mtmp->cham)) { int i; switch (m->appear) { @@ -879,10 +1342,7 @@ struct mkroom *croom; do { x = m->x; y = m->y; - if (croom) - get_room_loc(&x, &y, croom); - else - get_location(&x, &y, DRY); + get_location(&x, &y, DRY, croom); if (MON_AT(x,y) && enexto(&cc, x, y, pm)) x = cc.x, y = cc.y; } while (m_bad_boulder_spot(x, y) && @@ -896,8 +1356,38 @@ struct mkroom *croom; break; case M_AP_MONSTER: - /* note: mimics don't appear as monsters! */ - /* (but chameleons can :-) */ + { + int mndx; + if (!strcmpi(m->appear_as.str, "random")) + mndx = select_newcham_form(mtmp); + else + mndx = name_to_mon(m->appear_as.str); + if ((mndx != NON_PM) && (&mons[mndx] != mtmp->data)) { + struct permonst *mdat = &mons[mndx]; + struct permonst *olddata = mtmp->data; + /* this code duplicated from newcham() */ + if(is_male(mdat)) { + if(mtmp->female) mtmp->female = FALSE; + } else if (is_female(mdat)) { + if(!mtmp->female) mtmp->female = TRUE; + } else if (!is_neuter(mdat)) { + if(!rn2(10)) mtmp->female = !mtmp->female; + } + set_mon_data(mtmp, mdat, 0); + if (emits_light(olddata) != emits_light(mtmp->data)) { + /* used to give light, now doesn't, or vice versa, + or light's range has changed */ + if (emits_light(olddata)) + del_light_source(LS_MONSTER, (genericptr_t)mtmp); + if (emits_light(mtmp->data)) + new_light_source(mtmp->mx, mtmp->my, emits_light(mtmp->data), + LS_MONSTER, (genericptr_t)mtmp); + } + if (!mtmp->perminvis || pm_invisible(olddata)) + mtmp->perminvis = pm_invisible(mdat); + } + } + break; default: impossible( "create_monster: unimplemented mon appear type [%d,\"%s\"]", @@ -924,12 +1414,35 @@ struct mkroom *croom; mtmp->msleeping = m->asleep; #endif } + if (m->seentraps) mtmp->mtrapseen = m->seentraps; + if (m->female) mtmp->female = 1; + if (m->cancelled) mtmp->mcan = 1; + if (m->revived) mtmp->mrevived = 1; + if (m->avenge) mtmp->mavenge = 1; + if (m->stunned) mtmp->mstun = 1; + if (m->confused) mtmp->mconf = 1; + if (m->invis) { + mtmp->minvis = mtmp->perminvis = 1; + } + if (m->blinded) { + mtmp->mcansee = 0; + mtmp->mblinded = (m->blinded % 127); + } + if (m->paralyzed) { + mtmp->mcanmove = 0; + mtmp->mfrozen = (m->paralyzed % 127); + } + if (m->fleeing) { + mtmp->mflee = 1; + mtmp->mfleetim = (m->fleeing % 127); + } + + if (m->has_invent) { + discard_minvent(mtmp); + invent_carrying_monster = mtmp; + } } - } /* if (rn2(100) < m->chance) */ - m_done: - Free(m->name.str); - Free(m->appear_as.str); } /* @@ -946,19 +1459,12 @@ struct mkroom *croom; char c; boolean named; /* has a name been supplied in level description? */ - if (rn2(100) < o->chance) { named = o->name.str ? TRUE : FALSE; - x = o->x; y = o->y; - if (croom) - get_room_loc(&x, &y, croom); - else - get_location(&x, &y, DRY); + get_location_coord(&x, &y, DRY, croom, o->coord); if (o->class >= 0) c = o->class; - else if (o->class > -11) - c = robjects[ -(o->class+1)]; else c = 0; @@ -1005,27 +1511,78 @@ struct mkroom *croom; if (named) otmp = oname(otmp, o->name.str); - switch(o->containment) { - static struct obj *container = 0; + if (o->eroded) { + if (o->eroded < 0) otmp->oerodeproof = 1; + else { + otmp->oeroded = (o->eroded % 4); + otmp->oeroded2 = ((o->eroded >> 2) % 4); + } + } + if (o->recharged) otmp->recharged = (o->recharged % 8); + if (o->locked) otmp->olocked = 1; + else if (o->broken) { + otmp->obroken = 1; + otmp->olocked = 0; /* obj generation may set */ + } + if (o->trapped) otmp->otrapped = 1; + if (o->greased) otmp->greased = 1; +#ifdef INVISIBLE_OBJECTS + if (o->invis) otmp->oinvis = 1; +#endif - /* contents */ - case 1: - if (!container) { - impossible("create_object: no container"); - break; + if ((o->quan > 0) && objects[otmp->otyp].oc_merge) { + otmp->quan = o->quan; + otmp->owt = weight(otmp); + } + + /* contents */ + if (o->containment & SP_OBJ_CONTENT) { + if (!container_idx) { + if (!invent_carrying_monster) { + /*impossible("create_object: no container");*/ + /* don't complain, the monster may be gone legally (eg. unique demon already generated) + TODO: In the case of unique demon lords, they should get their inventories even when + they get generated outside the des-file. Maybe another data file that determines what + inventories monsters get by default? + */ + } else { + int c; + struct obj *objcheck = otmp; + int inuse = -1; + for (c = 0; c < container_idx; c++) + if (container_obj[c] == objcheck) + inuse = c; + remove_object(otmp); + if (mpickobj(invent_carrying_monster, otmp)) { + if (inuse > -1) { + impossible("container given to monster was merged or deallocated."); + for (c = inuse; c < container_idx-1; c++) + container_obj[c] = container_obj[c+1]; + container_obj[container_idx] = NULL; + container_idx--; + } + /* we lost track of it. */ + return; + } } + } else { remove_object(otmp); - (void) add_to_container(container, otmp); - goto o_done; /* don't stack, but do other cleanup */ - /* container */ - case 2: - delete_contents(otmp); - container = otmp; - break; - /* nothing */ - case 0: break; - - default: impossible("containment type %d?", (int) o->containment); + if (container_obj[container_idx-1]) + (void) add_to_container(container_obj[container_idx-1], otmp); + else { + obj_extract_self(otmp); + obfree(otmp, NULL); + return; + } + } + } + /* container */ + if (o->containment & SP_OBJ_CONTAINER) { + delete_contents(otmp); + if (container_idx < MAX_CONTAINMENT) { + container_obj[container_idx] = otmp; + container_idx++; + } else impossible("create_object: too deeply nested containers."); } /* Medusa level special case: statues are petrified monsters, so they @@ -1037,73 +1594,48 @@ struct mkroom *croom; struct monst *was; struct obj *obj; int wastyp; + int i = 0; /* prevent endless loop in case makemon always fails */ /* Named random statues are of player types, and aren't stone- * resistant (if they were, we'd have to reset the name as well as * setting corpsenm). */ - for (wastyp = otmp->corpsenm; ; wastyp = rndmonnum()) { + for (wastyp = otmp->corpsenm; i < 1000 ; i++, wastyp = rndmonnum()) { /* makemon without rndmonst() might create a group */ was = makemon(&mons[wastyp], 0, 0, MM_NOCOUNTBIRTH); - if (!resists_ston(was)) { + if (was && !resists_ston(was)) { (void) propagate(wastyp, TRUE, FALSE); break; } mongone(was); } - set_corpsenm(otmp, wastyp); - while(was->minvent) { - obj = was->minvent; - obj->owornmask = 0; - obj_extract_self(obj); - (void) add_to_container(otmp, obj); + if (was) { + set_corpsenm(otmp, wastyp); + while(was->minvent) { + obj = was->minvent; + obj->owornmask = 0; + obj_extract_self(obj); + (void) add_to_container(otmp, obj); + } + otmp->owt = weight(otmp); + mongone(was); } - otmp->owt = weight(otmp); - mongone(was); } stackobj(otmp); - } /* if (rn2(100) < o->chance) */ - o_done: - Free(o->name.str); -} + if (o->lit) { + begin_burn(otmp, FALSE); + } -/* - * Randomly place a specific engraving, then release its memory. - */ -STATIC_OVL void -create_engraving(e, croom) -engraving *e; -struct mkroom *croom; -{ - xchar x, y; + if (o->buried) { + boolean dealloced; + (void) bury_an_obj(otmp, &dealloced); + if (dealloced && container_idx) { + container_obj[container_idx-1] = NULL; + } + } - x = e->x, y = e->y; - if (croom) - get_room_loc(&x, &y, croom); - else - get_location(&x, &y, DRY); - - make_engr_at(x, y, e->engr.str, 0L, e->etype); - free((genericptr_t) e->engr.str); -} - -/* - * Create stairs in a room. - * - */ - -STATIC_OVL void -create_stairs(s,croom) -stair *s; -struct mkroom *croom; -{ - schar x,y; - - x = s->x; y = s->y; - get_free_room_loc(&x, &y, croom); - mkstairs(x,y,(char)s->up, croom); } /* @@ -1118,16 +1650,14 @@ create_altar(a, croom) schar sproom,x,y; aligntyp amask; boolean croom_is_temple = TRUE; - int oldtyp; - - x = a->x; y = a->y; + int oldtyp; if (croom) { - get_free_room_loc(&x, &y, croom); + get_free_room_loc(&x, &y, croom, a->coord); if (croom->rtype != TEMPLE) croom_is_temple = FALSE; } else { - get_location(&x, &y, DRY); + get_location_coord(&x, &y, DRY, croom, a->coord); if ((sproom = (schar) *in_rooms(x, y, TEMPLE)) != 0) croom = &rooms[sproom - ROOMOFFSET]; else @@ -1139,9 +1669,6 @@ create_altar(a, croom) if (oldtyp == STAIRS || oldtyp == LADDER) return; - a->x = x; - a->y = y; - /* Is the alignment random ? * If so, it's an 80% chance that the altar will be co-aligned. * @@ -1154,7 +1681,7 @@ create_altar(a, croom) Align2amask(u.ualignbase[A_ORIGINAL]) : (a->align == AM_SPLEV_NONCO) ? Align2amask(noncoalignment(u.ualignbase[A_ORIGINAL])) : - (a->align == -11) ? induced_align(80) : + (a->align == -(MAX_REGISTERS+1)) ? induced_align(80) : (a->align < 0 ? ralign[-a->align-1] : a->align); levl[x][y].typ = ALTAR; @@ -1162,11 +1689,6 @@ create_altar(a, croom) if (a->shrine < 0) a->shrine = rn2(2); /* handle random case */ - if (oldtyp == FOUNTAIN) - level.flags.nfountains--; - else if (oldtyp == SINK) - level.flags.nsinks--; - if (!croom_is_temple || !a->shrine) return; if (a->shrine) { /* Is it a shrine or sanctum? */ @@ -1176,68 +1698,29 @@ create_altar(a, croom) } } -/* - * Create a gold pile in a room. - */ -STATIC_OVL void -create_gold(g,croom) -gold *g; -struct mkroom *croom; +void +replace_terrain(terr, croom) +replaceterrain *terr; +struct mkroom *croom; { - schar x,y; + schar x, y, x1, y1, x2, y2; - x = g->x; y= g->y; - if (croom) - get_room_loc(&x, &y, croom); - else - get_location(&x, &y, DRY); + if (terr->toter >= MAX_TYPE) return; - if (g->amount == -1) - g->amount = rnd(200); - (void) mkgold((long) g->amount, x, y); + x1 = terr->x1; y1 = terr->y1; + get_location(&x1, &y1, ANY_LOC, croom); + + x2 = terr->x2; y2 = terr->y2; + get_location(&x2, &y2, ANY_LOC, croom); + + for (x = max(x1,0); x <= min(x2,COLNO-1); x++) + for (y = max(y1,0); y <= min(y2,ROWNO-1); y++) + if ((levl[x][y].typ == terr->fromter) && (rn2(100) < terr->chance)) { + SET_TYPLIT(x,y, terr->toter, terr->tolit); + } } -/* - * Create a feature (e.g a fountain) in a room. - */ - -STATIC_OVL void -create_feature(fx, fy, croom, typ) -int fx, fy; -struct mkroom *croom; -int typ; -{ - schar x,y; - int trycnt = 0; - - x = fx; y = fy; - if (croom) { - if (x < 0 && y < 0) - do { - x = -1; y = -1; - get_room_loc(&x, &y, croom); - } while (++trycnt <= 200 && occupied(x,y)); - else - get_room_loc(&x, &y, croom); - if(trycnt > 200) - return; - } else { - get_location(&x, &y, DRY); - } - /* Don't cover up an existing feature (particularly randomly - placed stairs). However, if the _same_ feature is already - here, it came from the map drawing and we still need to - update the special counters. */ - if (IS_FURNITURE(levl[x][y].typ) && levl[x][y].typ != typ) - return; - - levl[x][y].typ = typ; - if (typ == FOUNTAIN) - level.flags.nfountains++; - else if (typ == SINK) - level.flags.nsinks++; -} /* * Search for a door in a room on a specified wall. @@ -1451,9 +1934,9 @@ corridor *c; coord org, dest; if (c->src.room == -1) { - sort_rooms(); + /*sort_rooms();*/ fix_stair_rooms(); - makecorridors(); + makecorridors(); /*makecorridors(c->src.door);*/ return; } @@ -1547,154 +2030,38 @@ boolean prefilled; } } -STATIC_OVL void -free_rooms(ro, n) -room **ro; -int n; -{ - short j; - room *r; - while(n--) { - r = ro[n]; - Free(r->name); - Free(r->parent); - if ((j = r->ndoor) != 0) { - while(j--) - Free(r->doors[j]); - Free(r->doors); - } - if ((j = r->nstair) != 0) { - while(j--) - Free(r->stairs[j]); - Free(r->stairs); - } - if ((j = r->naltar) != 0) { - while (j--) - Free(r->altars[j]); - Free(r->altars); - } - if ((j = r->nfountain) != 0) { - while(j--) - Free(r->fountains[j]); - Free(r->fountains); - } - if ((j = r->nsink) != 0) { - while(j--) - Free(r->sinks[j]); - Free(r->sinks); - } - if ((j = r->npool) != 0) { - while(j--) - Free(r->pools[j]); - Free(r->pools); - } - if ((j = r->ntrap) != 0) { - while (j--) - Free(r->traps[j]); - Free(r->traps); - } - if ((j = r->nmonster) != 0) { - while (j--) - Free(r->monsters[j]); - Free(r->monsters); - } - if ((j = r->nobject) != 0) { - while (j--) - Free(r->objects[j]); - Free(r->objects); - } - if ((j = r->ngold) != 0) { - while(j--) - Free(r->golds[j]); - Free(r->golds); - } - if ((j = r->nengraving) != 0) { - while (j--) - Free(r->engravings[j]); - Free(r->engravings); - } - Free(r); - } - Free(ro); -} - -STATIC_OVL void -build_room(r, pr) -room *r, *pr; +struct mkroom * +build_room(r, mkr) +room *r; +struct mkroom *mkr; { boolean okroom; struct mkroom *aroom; short i; xchar rtype = (!r->chance || rn2(100) < r->chance) ? r->rtype : OROOM; - if(pr) { + if(mkr) { aroom = &subrooms[nsubroom]; - okroom = create_subroom(pr->mkr, r->x, r->y, r->w, r->h, + okroom = create_subroom(mkr, r->x, r->y, r->w, r->h, rtype, r->rlit); } else { aroom = &rooms[nroom]; okroom = create_room(r->x, r->y, r->w, r->h, r->xalign, r->yalign, rtype, r->rlit); - r->mkr = aroom; } if (okroom) { - /* Create subrooms if necessary... */ - for(i=0; i < r->nsubroom; i++) - build_room(r->subrooms[i], r); - /* And now we can fill the room! */ - - /* Priority to the stairs */ - - for(i=0; i nstair; i++) - create_stairs(r->stairs[i], aroom); - - /* Then to the various elements (sinks, etc..) */ - for(i = 0; insink; i++) - create_feature(r->sinks[i]->x, r->sinks[i]->y, aroom, SINK); - for(i = 0; inpool; i++) - create_feature(r->pools[i]->x, r->pools[i]->y, aroom, POOL); - for(i = 0; infountain; i++) - create_feature(r->fountains[i]->x, r->fountains[i]->y, - aroom, FOUNTAIN); - for(i = 0; inaltar; i++) - create_altar(r->altars[i], aroom); - for(i = 0; indoor; i++) - create_door(r->doors[i], aroom); - - /* The traps */ - for(i = 0; intrap; i++) - create_trap(r->traps[i], aroom); - - /* The monsters */ - for(i = 0; inmonster; i++) - create_monster(r->monsters[i], aroom); - - /* The objects */ - for(i = 0; inobject; i++) - create_object(r->objects[i], aroom); - - /* The gold piles */ - for(i = 0; ingold; i++) - create_gold(r->golds[i], aroom); - - /* The engravings */ - for (i = 0; i < r->nengraving; i++) - create_engraving(r->engravings[i], aroom); - #ifdef SPECIALIZATION topologize(aroom,FALSE); /* set roomno */ #else topologize(aroom); /* set roomno */ #endif - /* MRS - 07/04/91 - This is temporary but should result - * in proper filling of shops, etc. - * DLC - this can fail if corridors are added to this room - * at a later point. Currently no good way to fix this. - */ - if(aroom->rtype != OROOM && r->filled) fill_room(aroom, FALSE); + aroom->needfill = r->filled; + aroom->needjoining = r->joined; + return aroom; } + return (struct mkroom *)0; } /* @@ -1728,328 +2095,29 @@ light_region(tmpregion) } } -/* initialization common to all special levels */ -STATIC_OVL void -load_common_data(fd, typ) -dlb *fd; -int typ; +void +wallify_map(x1,y1,x2,y2) +int x1,y1,x2,y2; { - uchar n; - long lev_flags; - int i; + int x, y, xx, yy, lo_xx, lo_yy, hi_xx, hi_yy; - { - aligntyp atmp; - /* shuffle 3 alignments; can't use sp_lev_shuffle() on aligntyp's */ - i = rn2(3); atmp=ralign[2]; ralign[2]=ralign[i]; ralign[i]=atmp; - if (rn2(2)) { atmp=ralign[1]; ralign[1]=ralign[0]; ralign[0]=atmp; } - } - - level.flags.is_maze_lev = typ == SP_LEV_MAZE; - - /* Read the level initialization data */ - Fread((genericptr_t) &init_lev, 1, sizeof(lev_init), fd); - if(init_lev.init_present) { - if(init_lev.lit < 0) - init_lev.lit = rn2(2); - mkmap(&init_lev); - } - - /* Read the per level flags */ - Fread((genericptr_t) &lev_flags, 1, sizeof(lev_flags), fd); - if (lev_flags & NOTELEPORT) - level.flags.noteleport = 1; - if (lev_flags & HARDFLOOR) - level.flags.hardfloor = 1; - if (lev_flags & NOMMAP) - level.flags.nommap = 1; - if (lev_flags & SHORTSIGHTED) - level.flags.shortsighted = 1; - if (lev_flags & ARBOREAL) - level.flags.arboreal = 1; - - /* Read message */ - Fread((genericptr_t) &n, 1, sizeof(n), fd); - if (n) { - lev_message = (char *) alloc(n + 1); - Fread((genericptr_t) lev_message, 1, (int) n, fd); - lev_message[n] = 0; - } -} - -STATIC_OVL void -load_one_monster(fd, m) -dlb *fd; -monster *m; -{ - int size; - - Fread((genericptr_t) m, 1, sizeof *m, fd); - if ((size = m->name.len) != 0) { - m->name.str = (char *) alloc((unsigned)size + 1); - Fread((genericptr_t) m->name.str, 1, size, fd); - m->name.str[size] = '\0'; - } else - m->name.str = (char *) 0; - if ((size = m->appear_as.len) != 0) { - m->appear_as.str = (char *) alloc((unsigned)size + 1); - Fread((genericptr_t) m->appear_as.str, 1, size, fd); - m->appear_as.str[size] = '\0'; - } else - m->appear_as.str = (char *) 0; -} - -STATIC_OVL void -load_one_object(fd, o) -dlb *fd; -object *o; -{ - int size; - - Fread((genericptr_t) o, 1, sizeof *o, fd); - if ((size = o->name.len) != 0) { - o->name.str = (char *) alloc((unsigned)size + 1); - Fread((genericptr_t) o->name.str, 1, size, fd); - o->name.str[size] = '\0'; - } else - o->name.str = (char *) 0; -} - -STATIC_OVL void -load_one_engraving(fd, e) -dlb *fd; -engraving *e; -{ - int size; - - Fread((genericptr_t) e, 1, sizeof *e, fd); - size = e->engr.len; - e->engr.str = (char *) alloc((unsigned)size+1); - Fread((genericptr_t) e->engr.str, 1, size, fd); - e->engr.str[size] = '\0'; -} - -STATIC_OVL boolean -load_rooms(fd) -dlb *fd; -{ - xchar nrooms, ncorr; - char n; - short size; - corridor tmpcor; - room** tmproom; - int i, j; - - load_common_data(fd, SP_LEV_ROOMS); - - Fread((genericptr_t) &n, 1, sizeof(n), fd); /* nrobjects */ - if (n) { - Fread((genericptr_t)robjects, sizeof(*robjects), n, fd); - sp_lev_shuffle(robjects, (char *)0, (int)n); - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); /* nrmonst */ - if (n) { - Fread((genericptr_t)rmonst, sizeof(*rmonst), n, fd); - sp_lev_shuffle(rmonst, (char *)0, (int)n); - } - - Fread((genericptr_t) &nrooms, 1, sizeof(nrooms), fd); - /* Number of rooms to read */ - tmproom = NewTab(room,nrooms); - for (i=0;i 0) { /* Yup, it does! */ - r->name = (char *) alloc((unsigned)size + 1); - Fread((genericptr_t) r->name, 1, size, fd); - r->name[size] = 0; - } else - r->name = (char *) 0; - - /* Let's see if this room has a parent */ - Fread((genericptr_t) &size, 1, sizeof(size), fd); - if (size > 0) { /* Yup, it does! */ - r->parent = (char *) alloc((unsigned)size + 1); - Fread((genericptr_t) r->parent, 1, size, fd); - r->parent[size] = 0; - } else - r->parent = (char *) 0; - - Fread((genericptr_t) &r->x, 1, sizeof(r->x), fd); - /* x pos on the grid (1-5) */ - Fread((genericptr_t) &r->y, 1, sizeof(r->y), fd); - /* y pos on the grid (1-5) */ - Fread((genericptr_t) &r->w, 1, sizeof(r->w), fd); - /* width of the room */ - Fread((genericptr_t) &r->h, 1, sizeof(r->h), fd); - /* height of the room */ - Fread((genericptr_t) &r->xalign, 1, sizeof(r->xalign), fd); - /* horizontal alignment */ - Fread((genericptr_t) &r->yalign, 1, sizeof(r->yalign), fd); - /* vertical alignment */ - Fread((genericptr_t) &r->rtype, 1, sizeof(r->rtype), fd); - /* type of room (zoo, shop, etc.) */ - Fread((genericptr_t) &r->chance, 1, sizeof(r->chance), fd); - /* chance of room being special. */ - Fread((genericptr_t) &r->rlit, 1, sizeof(r->rlit), fd); - /* lit or not ? */ - Fread((genericptr_t) &r->filled, 1, sizeof(r->filled), fd); - /* to be filled? */ - r->nsubroom= 0; - - /* read the doors */ - Fread((genericptr_t) &r->ndoor, 1, sizeof(r->ndoor), fd); - if ((n = r->ndoor) != 0) - r->doors = NewTab(room_door, n); - while(n--) { - r->doors[(int)n] = New(room_door); - Fread((genericptr_t) r->doors[(int)n], 1, - sizeof(room_door), fd); - } - - /* read the stairs */ - Fread((genericptr_t) &r->nstair, 1, sizeof(r->nstair), fd); - if ((n = r->nstair) != 0) - r->stairs = NewTab(stair, n); - while (n--) { - r->stairs[(int)n] = New(stair); - Fread((genericptr_t) r->stairs[(int)n], 1, - sizeof(stair), fd); - } - - /* read the altars */ - Fread((genericptr_t) &r->naltar, 1, sizeof(r->naltar), fd); - if ((n = r->naltar) != 0) - r->altars = NewTab(altar, n); - while (n--) { - r->altars[(int)n] = New(altar); - Fread((genericptr_t) r->altars[(int)n], 1, - sizeof(altar), fd); - } - - /* read the fountains */ - Fread((genericptr_t) &r->nfountain, 1, - sizeof(r->nfountain), fd); - if ((n = r->nfountain) != 0) - r->fountains = NewTab(fountain, n); - while (n--) { - r->fountains[(int)n] = New(fountain); - Fread((genericptr_t) r->fountains[(int)n], 1, - sizeof(fountain), fd); - } - - /* read the sinks */ - Fread((genericptr_t) &r->nsink, 1, sizeof(r->nsink), fd); - if ((n = r->nsink) != 0) - r->sinks = NewTab(sink, n); - while (n--) { - r->sinks[(int)n] = New(sink); - Fread((genericptr_t) r->sinks[(int)n], 1, sizeof(sink), fd); - } - - /* read the pools */ - Fread((genericptr_t) &r->npool, 1, sizeof(r->npool), fd); - if ((n = r->npool) != 0) - r->pools = NewTab(pool,n); - while (n--) { - r->pools[(int)n] = New(pool); - Fread((genericptr_t) r->pools[(int)n], 1, sizeof(pool), fd); - } - - /* read the traps */ - Fread((genericptr_t) &r->ntrap, 1, sizeof(r->ntrap), fd); - if ((n = r->ntrap) != 0) - r->traps = NewTab(trap, n); - while(n--) { - r->traps[(int)n] = New(trap); - Fread((genericptr_t) r->traps[(int)n], 1, sizeof(trap), fd); - } - - /* read the monsters */ - Fread((genericptr_t) &r->nmonster, 1, sizeof(r->nmonster), fd); - if ((n = r->nmonster) != 0) { - r->monsters = NewTab(monster, n); - while(n--) { - r->monsters[(int)n] = New(monster); - load_one_monster(fd, r->monsters[(int)n]); - } - } else - r->monsters = 0; - - /* read the objects, in same order as mazes */ - Fread((genericptr_t) &r->nobject, 1, sizeof(r->nobject), fd); - if ((n = r->nobject) != 0) { - r->objects = NewTab(object, n); - for (j = 0; j < n; ++j) { - r->objects[j] = New(object); - load_one_object(fd, r->objects[j]); - } - } else - r->objects = 0; - - /* read the gold piles */ - Fread((genericptr_t) &r->ngold, 1, sizeof(r->ngold), fd); - if ((n = r->ngold) != 0) - r->golds = NewTab(gold, n); - while (n--) { - r->golds[(int)n] = New(gold); - Fread((genericptr_t) r->golds[(int)n], 1, sizeof(gold), fd); - } - - /* read the engravings */ - Fread((genericptr_t) &r->nengraving, 1, - sizeof(r->nengraving), fd); - if ((n = r->nengraving) != 0) { - r->engravings = NewTab(engraving,n); - while (n--) { - r->engravings[(int)n] = New(engraving); - load_one_engraving(fd, r->engravings[(int)n]); - } - } else - r->engravings = 0; - - } - - /* Now that we have loaded all the rooms, search the - * subrooms and create the links. - */ - - for (i = 0; iparent) { - /* Search the parent room */ - for(j=0; jname && !strcmp(tmproom[j]->name, - tmproom[i]->parent)) { - n = tmproom[j]->nsubroom++; - tmproom[j]->subrooms[(int)n] = tmproom[i]; - break; + for (y = y1; y <= y2; y++) { + lo_yy = (y > 0) ? y - 1 : 0; + hi_yy = (y < y2) ? y + 1 : y2; + for (x = x1; x <= x2; x++) { + if (levl[x][y].typ != STONE) continue; + lo_xx = (x > 0) ? x - 1 : 0; + hi_xx = (x < x2) ? x + 1 : x2; + for (yy = lo_yy; yy <= hi_yy; yy++) + for (xx = lo_xx; xx <= hi_xx; xx++) + if (IS_ROOM(levl[xx][yy].typ) || + levl[xx][yy].typ == CROSSWALL) { + levl[x][y].typ = (yy != y) ? HWALL : VWALL; + yy = hi_yy; /* end `yy' loop */ + break; /* end `xx' loop */ } } - - /* - * Create the rooms now... - */ - - for (i=0; i < nrooms; i++) - if(!tmproom[i]->parent) - build_room(tmproom[i], (room *) 0); - - free_rooms(tmproom, nrooms); - - /* read the corridors */ - - Fread((genericptr_t) &ncorr, sizeof(ncorr), 1, fd); - for (i=0; ix = (xchar)x, m->y = (xchar)y; } /* - * The Big Thing: special maze loader + * If there's a significant portion of maze unused by the special level, + * we don't want it empty. * - * Could be cleaner, but it works. + * Makes the number of traps, monsters, etc. proportional + * to the size of the maze. */ - -STATIC_OVL boolean -load_maze(fd) -dlb *fd; +STATIC_OVL void +fill_empty_maze() { - xchar x, y, typ; - boolean prefilled, room_not_needed; + int mapcountmax, mapcount, mapfact; + xchar x,y; + coord mm; - char n, numpart = 0; - xchar nwalk = 0, nwalk_sav; - schar filling; - char halign, valign; - - int xi, dir, size; - coord mm; - int mapcount, mapcountmax, mapfact; - - lev_region tmplregion; - region tmpregion; - door tmpdoor; - trap tmptrap; - monster tmpmons; - object tmpobj; - drawbridge tmpdb; - walk tmpwalk; - digpos tmpdig; - lad tmplad; - stair tmpstair, prevstair; - altar tmpaltar; - gold tmpgold; - fountain tmpfountain; - engraving tmpengraving; - xchar mustfill[(MAXNROFROOMS+1)*2]; - struct trap *badtrap; - boolean has_bounds; - boolean bounds_nodigpass; - - (void) memset((genericptr_t)&Map[0][0], 0, sizeof Map); - load_common_data(fd, SP_LEV_MAZE); - - /* Initialize map */ - Fread((genericptr_t) &filling, 1, sizeof(filling), fd); - if (!init_lev.init_present) { /* don't init if mkmap() has been called */ - for(x = 2; x <= x_maze_max; x++) - for(y = 0; y <= y_maze_max; y++) - if (filling == -1) { -#ifndef WALLIFIED_MAZE - levl[x][y].typ = STONE; -#else - levl[x][y].typ = - (y < 2 || ((x % 2) && (y % 2))) ? STONE : HWALL; -#endif - } else { - levl[x][y].typ = filling; - } - } - - /* if filling with stone, surrounding stone may all be nondig, nonpass */ - bounds_nodigpass = (filling == STONE); - - /* Start reading the file */ - Fread((genericptr_t) &numpart, 1, sizeof(numpart), fd); - /* Number of parts */ - if (!numpart || numpart > 9) - panic("load_maze error: numpart = %d", (int) numpart); - - while (numpart--) { - Fread((genericptr_t) &halign, 1, sizeof(halign), fd); - /* Horizontal alignment */ - Fread((genericptr_t) &valign, 1, sizeof(valign), fd); - /* Vertical alignment */ - Fread((genericptr_t) &xsize, 1, sizeof(xsize), fd); - /* size in X */ - Fread((genericptr_t) &ysize, 1, sizeof(ysize), fd); - /* size in Y */ - switch((int) halign) { - /* mkmap always creates levels starting at x==1 */ - case LEFT: xstart = init_lev.init_present ? 1 : 3; break; - case H_LEFT: xstart = 2+((x_maze_max-2-xsize)/4); break; - case CENTER: xstart = 2+((x_maze_max-2-xsize)/2); break; - case H_RIGHT: xstart = 2+((x_maze_max-2-xsize)*3/4); break; - case RIGHT: xstart = x_maze_max-xsize-1; break; - } - switch((int) valign) { - case TOP: ystart = 3; break; - case CENTER: ystart = 2+((y_maze_max-2-ysize)/2); break; - case BOTTOM: ystart = y_maze_max-ysize-1; break; - } - if (!(xstart % 2)) xstart++; - if (!(ystart % 2)) ystart++; - if ((ystart < 0) || (ystart + ysize > ROWNO)) { - /* try to move the start a bit */ - ystart += (ystart > 0) ? -2 : 2; - if(ysize == ROWNO) ystart = 0; - if(ystart < 0 || ystart + ysize > ROWNO) - panic("reading special level with ysize too large"); - } - - /* - * If any CROSSWALLs are found, must change to ROOM after REGION's - * are laid out. CROSSWALLS are used to specify "invisible" - * boundaries where DOOR syms look bad or aren't desirable. - */ - has_bounds = FALSE; - - if(init_lev.init_present && xsize <= 1 && ysize <= 1) { - xstart = 1; - ystart = 0; - xsize = COLNO-1; - ysize = ROWNO; - bounds_nodigpass = FALSE; - } else { - /* Load the map */ - for(y = ystart; y < ystart+ysize; y++) - for(x = xstart; x < xstart+xsize; x++) { - levl[x][y].typ = Fgetc(fd); - levl[x][y].lit = FALSE; - /* clear out levl: load_common_data may set them */ - levl[x][y].flags = 0; - levl[x][y].horizontal = 0; - levl[x][y].roomno = 0; - levl[x][y].edge = 0; - /* - * Note: Even though levl[x][y].typ is type schar, - * lev_comp.y saves it as type char. Since schar != char - * all the time we must make this exception or hack - * through lev_comp.y to fix. - */ - - /* - * Set secret doors to closed (why not trapped too?). Set - * the horizontal bit. - */ - if (levl[x][y].typ == SDOOR || IS_DOOR(levl[x][y].typ)) { - if(levl[x][y].typ == SDOOR) - levl[x][y].doormask = D_CLOSED; - /* - * If there is a wall to the left that connects to a - * (secret) door, then it is horizontal. This does - * not allow (secret) doors to be corners of rooms. - */ - if (x != xstart && (IS_WALL(levl[x-1][y].typ) || - levl[x-1][y].horizontal)) - levl[x][y].horizontal = 1; - } else if(levl[x][y].typ == HWALL || - levl[x][y].typ == IRONBARS) - levl[x][y].horizontal = 1; - else if(levl[x][y].typ == LAVAPOOL) - levl[x][y].lit = 1; - else if (init_lev.init_present && levl[x][y].typ == ICE) - levl[x][y].icedpool = init_lev.icedpools ? ICED_POOL : - ICED_MOAT; - else if(levl[x][y].typ == CROSSWALL) - has_bounds = TRUE; - Map[x][y] = 1; - } - if (init_lev.init_present && init_lev.joined) - remove_rooms(xstart, ystart, xstart+xsize, ystart+ysize); - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Number of level regions */ - if(n) { - if(num_lregions) { - /* realloc the lregion space to add the new ones */ - /* don't really free it up until the whole level is done */ - lev_region *newl = (lev_region *) alloc(sizeof(lev_region) * - (unsigned)(n+num_lregions)); - (void) memcpy((genericptr_t)(newl+n), (genericptr_t)lregions, - sizeof(lev_region) * num_lregions); - Free(lregions); - num_lregions += n; - lregions = newl; - } else { - num_lregions = n; - lregions = (lev_region *) - alloc(sizeof(lev_region) * (unsigned)n); - } - } - - while(n--) { - Fread((genericptr_t) &tmplregion, sizeof(tmplregion), 1, fd); - if ((size = tmplregion.rname.len) != 0) { - tmplregion.rname.str = (char *) alloc((unsigned)size + 1); - Fread((genericptr_t) tmplregion.rname.str, size, 1, fd); - tmplregion.rname.str[size] = '\0'; - } else - tmplregion.rname.str = (char *) 0; - if(!tmplregion.in_islev) { - get_location(&tmplregion.inarea.x1, &tmplregion.inarea.y1, - DRY|WET); - get_location(&tmplregion.inarea.x2, &tmplregion.inarea.y2, - DRY|WET); - } - if(!tmplregion.del_islev) { - get_location(&tmplregion.delarea.x1, &tmplregion.delarea.y1, - DRY|WET); - get_location(&tmplregion.delarea.x2, &tmplregion.delarea.y2, - DRY|WET); - } - lregions[(int)n] = tmplregion; - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Random objects */ - if(n) { - Fread((genericptr_t)robjects, sizeof(*robjects), (int) n, fd); - sp_lev_shuffle(robjects, (char *)0, (int)n); - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Random locations */ - if(n) { - Fread((genericptr_t)rloc_x, sizeof(*rloc_x), (int) n, fd); - Fread((genericptr_t)rloc_y, sizeof(*rloc_y), (int) n, fd); - sp_lev_shuffle(rloc_x, rloc_y, (int)n); - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Random monsters */ - if(n) { - Fread((genericptr_t)rmonst, sizeof(*rmonst), (int) n, fd); - sp_lev_shuffle(rmonst, (char *)0, (int)n); - } - - (void) memset((genericptr_t)mustfill, 0, sizeof(mustfill)); - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Number of subrooms */ - while(n--) { - register struct mkroom *troom; - - Fread((genericptr_t)&tmpregion, 1, sizeof(tmpregion), fd); - - if(tmpregion.rtype > MAXRTYPE) { - tmpregion.rtype -= MAXRTYPE+1; - prefilled = TRUE; - } else - prefilled = FALSE; - - if(tmpregion.rlit < 0) - tmpregion.rlit = (rnd(1+abs(depth(&u.uz))) < 11 && rn2(77)) - ? TRUE : FALSE; - - get_location(&tmpregion.x1, &tmpregion.y1, DRY|WET); - get_location(&tmpregion.x2, &tmpregion.y2, DRY|WET); - - /* for an ordinary room, `prefilled' is a flag to force - an actual room to be created (such rooms are used to - control placement of migrating monster arrivals) */ - room_not_needed = (tmpregion.rtype == OROOM && - !tmpregion.rirreg && !prefilled); - if (room_not_needed || nroom >= MAXNROFROOMS) { - if (!room_not_needed) - impossible("Too many rooms on new level!"); - light_region(&tmpregion); - continue; - } - - troom = &rooms[nroom]; - - /* mark rooms that must be filled, but do it later */ - if (tmpregion.rtype != OROOM) - mustfill[nroom] = (prefilled ? 2 : 1); - - if(tmpregion.rirreg) { - min_rx = max_rx = tmpregion.x1; - min_ry = max_ry = tmpregion.y1; - flood_fill_rm(tmpregion.x1, tmpregion.y1, - nroom+ROOMOFFSET, tmpregion.rlit, TRUE); - add_room(min_rx, min_ry, max_rx, max_ry, - FALSE, tmpregion.rtype, TRUE); - troom->rlit = tmpregion.rlit; - troom->irregular = TRUE; - } else { - add_room(tmpregion.x1, tmpregion.y1, - tmpregion.x2, tmpregion.y2, - tmpregion.rlit, tmpregion.rtype, TRUE); -#ifdef SPECIALIZATION - topologize(troom,FALSE); /* set roomno */ -#else - topologize(troom); /* set roomno */ -#endif - } - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Number of doors */ - while(n--) { - struct mkroom *croom = &rooms[0]; - - Fread((genericptr_t)&tmpdoor, 1, sizeof(tmpdoor), fd); - - x = tmpdoor.x; y = tmpdoor.y; - typ = tmpdoor.mask == -1 ? rnddoor() : tmpdoor.mask; - - get_location(&x, &y, DRY); - if(levl[x][y].typ != SDOOR) - levl[x][y].typ = DOOR; - else { - if(typ < D_CLOSED) - typ = D_CLOSED; /* force it to be closed */ - } - levl[x][y].doormask = typ; - - /* Now the complicated part, list it with each subroom */ - /* The dog move and mail daemon routines use this */ - while(croom->hx >= 0 && doorindex < DOORMAX) { - if(croom->hx >= x-1 && croom->lx <= x+1 && - croom->hy >= y-1 && croom->ly <= y+1) { - /* Found it */ - add_door(x, y, croom); - } - croom++; - } - } - - /* now that we have rooms _and_ associated doors, fill the rooms */ - for(n = 0; n < SIZE(mustfill); n++) - if(mustfill[(int)n]) - fill_room(&rooms[(int)n], (mustfill[(int)n] == 2)); - - /* if special boundary syms (CROSSWALL) in map, remove them now */ - if(has_bounds) { - for(x = xstart; x < xstart+xsize; x++) - for(y = ystart; y < ystart+ysize; y++) - if(levl[x][y].typ == CROSSWALL) - levl[x][y].typ = ROOM; - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Number of drawbridges */ - while(n--) { - Fread((genericptr_t)&tmpdb, 1, sizeof(tmpdb), fd); - - x = tmpdb.x; y = tmpdb.y; - get_location(&x, &y, DRY|WET); - - typ = tmpdb.db_open; - if (typ == 127) typ = rn2(2); /* 0 => closed, 1 => open */ - if (!create_drawbridge(x, y, tmpdb.dir, typ)) - impossible("Cannot create drawbridge."); - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Number of mazewalks */ - while(n--) { - Fread((genericptr_t)&tmpwalk, 1, sizeof(tmpwalk), fd); - - get_location(&tmpwalk.x, &tmpwalk.y, DRY|WET); - - walklist[nwalk++] = tmpwalk; - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Number of non_diggables */ - while(n--) { - Fread((genericptr_t)&tmpdig, 1, sizeof(tmpdig), fd); - - get_location(&tmpdig.x1, &tmpdig.y1, DRY|WET); - get_location(&tmpdig.x2, &tmpdig.y2, DRY|WET); - - set_wall_property(tmpdig.x1, tmpdig.y1, - tmpdig.x2, tmpdig.y2, W_NONDIGGABLE); - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Number of non_passables */ - while(n--) { - Fread((genericptr_t)&tmpdig, 1, sizeof(tmpdig), fd); - - get_location(&tmpdig.x1, &tmpdig.y1, DRY|WET); - get_location(&tmpdig.x2, &tmpdig.y2, DRY|WET); - - set_wall_property(tmpdig.x1, tmpdig.y1, - tmpdig.x2, tmpdig.y2, W_NONPASSWALL); - } - - /* walk bounds, reset bounds_nodigpass diggable or passable */ - if (bounds_nodigpass) { - for (x = xstart; x < xstart+xsize; x++) { - if (!IS_STWALL(levl[x][ystart].typ) || - (levl[x][ystart].wall_info & - (W_NONDIGGABLE|W_NONPASSWALL)) != - (W_NONDIGGABLE|W_NONPASSWALL) || - !IS_STWALL(levl[x][ystart+ysize-1].typ) || - (levl[x][ystart+ysize-1].wall_info & - (W_NONDIGGABLE|W_NONPASSWALL)) != - (W_NONDIGGABLE|W_NONPASSWALL)) { - bounds_nodigpass = FALSE; - break; - } - } - } - if (bounds_nodigpass) { - for(y = ystart; y < ystart+ysize; y++) { - if (!IS_STWALL(levl[xstart][y].typ) || - (levl[xstart][y].wall_info & - (W_NONDIGGABLE|W_NONPASSWALL)) != - (W_NONDIGGABLE|W_NONPASSWALL) || - !IS_STWALL(levl[xstart+xsize-1][y].typ) || - (levl[xstart+xsize-1][y].wall_info & - (W_NONDIGGABLE|W_NONPASSWALL)) != - (W_NONDIGGABLE|W_NONPASSWALL)) { - bounds_nodigpass = FALSE; - break; - } - } - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Number of ladders */ - while(n--) { - Fread((genericptr_t)&tmplad, 1, sizeof(tmplad), fd); - - x = tmplad.x; y = tmplad.y; - get_location(&x, &y, DRY); - - levl[x][y].typ = LADDER; - if (tmplad.up == 1) { - xupladder = x; yupladder = y; - levl[x][y].ladder = LA_UP; - } else { - xdnladder = x; ydnladder = y; - levl[x][y].ladder = LA_DOWN; - } - } - - prevstair.x = prevstair.y = 0; - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Number of stairs */ - while(n--) { - Fread((genericptr_t)&tmpstair, 1, sizeof(tmpstair), fd); - - xi = 0; - do { - x = tmpstair.x; y = tmpstair.y; - get_location(&x, &y, DRY); - } while(prevstair.x && xi++ < 100 && - distmin(x,y,prevstair.x,prevstair.y) <= 8); - if ((badtrap = t_at(x,y)) != 0) deltrap(badtrap); - mkstairs(x, y, (char)tmpstair.up, (struct mkroom *)0); - prevstair.x = x; - prevstair.y = y; - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Number of altars */ - while(n--) { - Fread((genericptr_t)&tmpaltar, 1, sizeof(tmpaltar), fd); - - create_altar(&tmpaltar, (struct mkroom *)0); - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Number of fountains */ - while (n--) { - Fread((genericptr_t)&tmpfountain, 1, sizeof(tmpfountain), fd); - - create_feature(tmpfountain.x, tmpfountain.y, - (struct mkroom *)0, FOUNTAIN); - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Number of traps */ - while(n--) { - Fread((genericptr_t)&tmptrap, 1, sizeof(tmptrap), fd); - - create_trap(&tmptrap, (struct mkroom *)0); - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Number of monsters */ - while(n--) { - load_one_monster(fd, &tmpmons); - - create_monster(&tmpmons, (struct mkroom *)0); - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Number of objects */ - while(n--) { - load_one_object(fd, &tmpobj); - - create_object(&tmpobj, (struct mkroom *)0); - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Number of gold piles */ - while (n--) { - Fread((genericptr_t)&tmpgold, 1, sizeof(tmpgold), fd); - - create_gold(&tmpgold, (struct mkroom *)0); - } - - Fread((genericptr_t) &n, 1, sizeof(n), fd); - /* Number of engravings */ - while(n--) { - load_one_engraving(fd, &tmpengraving); - - create_engraving(&tmpengraving, (struct mkroom *)0); - } - - } /* numpart loop */ - - nwalk_sav = nwalk; - while(nwalk--) { - x = (xchar) walklist[nwalk].x; - y = (xchar) walklist[nwalk].y; - dir = walklist[nwalk].dir; - - /* don't use move() - it doesn't use W_NORTH, etc. */ - switch (dir) { - case W_NORTH: --y; break; - case W_SOUTH: y++; break; - case W_EAST: x++; break; - case W_WEST: --x; break; - default: panic("load_maze: bad MAZEWALK direction"); - } - - if(!IS_DOOR(levl[x][y].typ)) { -#ifndef WALLIFIED_MAZE - levl[x][y].typ = CORR; -#else - levl[x][y].typ = ROOM; -#endif - levl[x][y].flags = 0; - } - - /* - * We must be sure that the parity of the coordinates for - * walkfrom() is odd. But we must also take into account - * what direction was chosen. - */ - if(!(x % 2)) { - if (dir == W_EAST) - x++; - else - x--; - - /* no need for IS_DOOR check; out of map bounds */ -#ifndef WALLIFIED_MAZE - levl[x][y].typ = CORR; -#else - levl[x][y].typ = ROOM; -#endif - levl[x][y].flags = 0; - } - - if (!(y % 2)) { - if (dir == W_SOUTH) - y++; - else - y--; - } - - walkfrom(x, y); - } - wallification(1, 0, COLNO-1, ROWNO-1); - - /* - * If there's a significant portion of maze unused by the special level, - * we don't want it empty. - * - * Makes the number of traps, monsters, etc. proportional - * to the size of the maze. - */ mapcountmax = mapcount = (x_maze_max - 2) * (y_maze_max - 2); + mapcountmax = mapcountmax / 2; for(x = 2; x < x_maze_max; x++) for(y = 0; y < y_maze_max; y++) - if(Map[x][y]) mapcount--; + if(!SpLev_Map[x][y]) mapcount--; - if (nwalk_sav && (mapcount > (int) (mapcountmax / 10))) { + if ((mapcount > (int) (mapcountmax / 10))) { mapfact = (int) ((mapcount * 100L) / mapcountmax); for(x = rnd((int) (20 * mapfact) / 100); x; x--) { maze1xy(&mm, DRY); @@ -2672,7 +2184,7 @@ dlb *fd; (void) makemon(&mons[PM_MINOTAUR], mm.x, mm.y, NO_MM_FLAGS); } for(x = rnd((int) (12 * mapfact) / 100); x; x--) { - maze1xy(&mm, WET|DRY); + maze1xy(&mm, DRY); (void) makemon((struct permonst *) 0, mm.x, mm.y, NO_MM_FLAGS); } for(x = rn2((int) (15 * mapfact) / 100); x; x--) { @@ -2691,17 +2203,2864 @@ dlb *fd; (void) maketrap(mm.x, mm.y, trytrap); } } +} + +/* + * special level loader + */ +STATIC_OVL boolean +sp_level_loader(fd, lvl) +dlb *fd; +sp_lev *lvl; +{ + long n_opcode = 0; + struct opvar *opdat; + int opcode; + + Fread((genericptr_t)&(lvl->n_opcodes), 1, sizeof(lvl->n_opcodes), fd); + + lvl->opcodes = (_opcode *)alloc(sizeof(_opcode) * (lvl->n_opcodes)); + if (!lvl->opcodes) panic("sp lvl load opcodes alloc"); + while (n_opcode < lvl->n_opcodes) { + + Fread((genericptr_t) &lvl->opcodes[n_opcode].opcode, 1, + sizeof(lvl->opcodes[n_opcode].opcode), fd); + opcode = lvl->opcodes[n_opcode].opcode; + + opdat = NULL; + + if (opcode < SPO_NULL || opcode >= MAX_SP_OPCODES) + panic("sp_level_loader: impossible opcode %i.", opcode); + + if (opcode == SPO_PUSH) { + struct opvar *ov = (opdat = (struct opvar *)alloc(sizeof(struct opvar))); + int nsize; + + if (!ov) panic("push ov alloc"); + ov->spovartyp = SPO_NULL; + ov->vardata.l = 0; + Fread((genericptr_t)&(ov->spovartyp), 1, sizeof(ov->spovartyp), fd); + + switch (ov->spovartyp) { + case SPOVAR_NULL: break; + case SPOVAR_COORD: + case SPOVAR_REGION: + case SPOVAR_MAPCHAR: + case SPOVAR_MONST: + case SPOVAR_OBJ: + case SPOVAR_INT: + Fread((genericptr_t)&(ov->vardata.l), 1, sizeof(ov->vardata.l), fd); + break; + case SPOVAR_VARIABLE: + case SPOVAR_STRING: + case SPOVAR_SEL: + { + char *opd; + Fread((genericptr_t) &nsize, 1, sizeof(nsize), fd); + opd = (char *)alloc(nsize + 1); + if (!opd) panic("sp lvl load opd alloc"); + if (nsize) Fread(opd, 1, nsize, fd); + opd[nsize] = 0; + ov->vardata.str = opd; + } + break; + default: + panic("sp_level_loader: unknown opvar type %i", ov->spovartyp); + } + } + + lvl->opcodes[n_opcode].opdat = opdat; + n_opcode++; + } /*while*/ + + return TRUE; +} + + +/* Frees the memory allocated for special level creation structs */ +STATIC_OVL boolean +sp_level_free(lvl) +sp_lev *lvl; +{ + long n_opcode = 0; + + while (n_opcode < lvl->n_opcodes) { + int opcode = lvl->opcodes[n_opcode].opcode; + struct opvar *opdat = lvl->opcodes[n_opcode].opdat; + + if (opcode < SPO_NULL || opcode >= MAX_SP_OPCODES) + panic("sp_level_free: unknown opcode %i", opcode); + + if (opdat) opvar_free(opdat); + n_opcode++; + } + Free(lvl->opcodes); + lvl->opcodes = NULL; + return TRUE; +} + +void +splev_initlev(linit) +lev_init *linit; +{ + switch (linit->init_style) { + default: impossible("Unrecognized level init style."); break; + case LVLINIT_NONE: break; + case LVLINIT_SOLIDFILL: + if (linit->lit == -1) linit->lit = rn2(2); + lvlfill_solid(linit->filling, linit->lit); + break; + case LVLINIT_MAZEGRID: + lvlfill_maze_grid(2,0, x_maze_max,y_maze_max, linit->filling); + break; +#ifdef REINCARNATION + case LVLINIT_ROGUE: + makeroguerooms(); + break; +#endif + case LVLINIT_MINES: + if (linit->lit == -1) linit->lit = rn2(2); + if (linit->filling > -1) lvlfill_solid(linit->filling, 0); + mkmap(linit); + break; + } +} + +struct sp_frame * +frame_new(execptr) + long execptr; +{ + struct sp_frame *frame = (struct sp_frame *)alloc(sizeof(struct sp_frame)); + if (!frame) panic("could not create execution frame."); + frame->next = NULL; + frame->variables = NULL; + frame->n_opcode = execptr; + frame->stack = (struct splevstack *)alloc(sizeof(struct splevstack)); + if (!frame->stack) panic("could not create execution frame stack."); + splev_stack_init(frame->stack); + return frame; +} + +void +frame_del(frame) + struct sp_frame *frame; +{ + if (!frame) return; + if (frame->stack) { + splev_stack_done(frame->stack); + frame->stack = NULL; + } + if (frame->variables) { + variable_list_del(frame->variables); + frame->variables = NULL; + } + Free(frame); +} + +void +spo_frame_push(coder) + struct sp_coder *coder; +{ + struct sp_frame *tmpframe = frame_new(coder->frame->n_opcode); + tmpframe->next = coder->frame; + coder->frame = tmpframe; +} + +void +spo_frame_pop(coder) + struct sp_coder *coder; +{ + if (coder->frame && coder->frame->next) { + struct sp_frame *tmpframe = coder->frame->next; + frame_del(coder->frame); + coder->frame = tmpframe; + coder->stack = coder->frame->stack; + } +} + +long +sp_code_jmpaddr(curpos, jmpaddr) + long curpos, jmpaddr; +{ + return (curpos + jmpaddr); +} + +void +spo_call(coder) + struct sp_coder *coder; +{ + struct opvar *addr; + struct opvar *params; + struct sp_frame *tmpframe; + + if (!OV_pop_i(addr) || !OV_pop_i(params)) return; + if (OV_i(params) < 0) return; + + tmpframe = frame_new(sp_code_jmpaddr(coder->frame->n_opcode, OV_i(addr)-1)); + + while (OV_i(params)-- > 0) { + splev_stack_push(tmpframe->stack, splev_stack_getdat_any(coder)); + } + splev_stack_reverse(tmpframe->stack); + + /* push a frame */ + tmpframe->next = coder->frame; + coder->frame = tmpframe; + + opvar_free(addr); + opvar_free(params); +} + +void +spo_return(coder) + struct sp_coder *coder; +{ + struct opvar *params; + if (!coder->frame || !coder->frame->next) panic("return: no frame."); + if (!OV_pop_i(params)) return; + if (OV_i(params) < 0) return; + + while (OV_i(params)-- > 0) { + splev_stack_push(coder->frame->next->stack, splev_stack_pop(coder->stack)); + } + + /* pop the frame */ + if (coder->frame->next) { + struct sp_frame *tmpframe = coder->frame->next; + frame_del(coder->frame); + coder->frame = tmpframe; + coder->stack = coder->frame->stack; + } + + opvar_free(params); +} + +void +spo_end_moninvent(coder) + struct sp_coder *coder; +{ + if (invent_carrying_monster) + m_dowear(invent_carrying_monster, TRUE); + invent_carrying_monster = NULL; +} + +void +spo_pop_container(coder) + struct sp_coder *coder; +{ + if (container_idx > 0) { + container_idx--; + container_obj[container_idx] = NULL; + } +} + + +void +spo_message(coder) + struct sp_coder *coder; +{ + struct opvar *op; + char *msg, *levmsg; + int old_n, n; + if (!OV_pop_s(op)) return; + msg = OV_s(op); + if (!msg) return; + + old_n = lev_message ? (strlen(lev_message)+1) : 0; + n = strlen(msg); + + levmsg = (char *) alloc(old_n+n+1); + if (!levmsg) panic("spo_message alloc"); + if (old_n) levmsg[old_n-1] = '\n'; + if (lev_message) + (void) memcpy((genericptr_t)levmsg, (genericptr_t)lev_message, old_n-1); + (void) memcpy((genericptr_t)&levmsg[old_n], msg, n); + levmsg[old_n+n] = '\0'; + Free(lev_message); + lev_message = levmsg; + opvar_free(op); +} + +void +spo_monster(coder) + struct sp_coder *coder; +{ + int nparams = 0; + + struct opvar *varparam; + struct opvar *id, *coord, *has_inv; + monster tmpmons; + + tmpmons.peaceful = -1; + tmpmons.asleep = -1; + tmpmons.name.str = (char *)0; + tmpmons.appear = 0; + tmpmons.appear_as.str = (char *)0; + tmpmons.align = - MAX_REGISTERS - 2; + tmpmons.female = 0; + tmpmons.invis = 0; + tmpmons.cancelled = 0; + tmpmons.revived = 0; + tmpmons.avenge = 0; + tmpmons.fleeing = 0; + tmpmons.blinded = 0; + tmpmons.paralyzed = 0; + tmpmons.stunned = 0; + tmpmons.confused = 0; + tmpmons.seentraps = 0; + tmpmons.has_invent = 0; + + if (!OV_pop_i(has_inv)) return; + + if (!OV_pop_i(varparam)) return; + + while ((nparams++ < (SP_M_V_END+1)) && + (OV_typ(varparam) == SPOVAR_INT) && + (OV_i(varparam) >= 0) && + (OV_i(varparam) < SP_M_V_END)) { + struct opvar *parm = NULL; + OV_pop(parm); + switch (OV_i(varparam)) { + case SP_M_V_NAME: + if ((OV_typ(parm) == SPOVAR_STRING) && + !tmpmons.name.str) + tmpmons.name.str = strdup(OV_s(parm)); + break; + case SP_M_V_APPEAR: + if ((OV_typ(parm) == SPOVAR_INT) && + !tmpmons.appear_as.str) { + tmpmons.appear = OV_i(parm); + opvar_free(parm); + OV_pop(parm); + tmpmons.appear_as.str = strdup(OV_s(parm)); + } + break; + case SP_M_V_ASLEEP: + if (OV_typ(parm) == SPOVAR_INT) + tmpmons.asleep = OV_i(parm); + break; + case SP_M_V_ALIGN: + if (OV_typ(parm) == SPOVAR_INT) + tmpmons.align = OV_i(parm); + break; + case SP_M_V_PEACEFUL: + if (OV_typ(parm) == SPOVAR_INT) + tmpmons.peaceful = OV_i(parm); + break; + case SP_M_V_FEMALE: + if (OV_typ(parm) == SPOVAR_INT) + tmpmons.female = OV_i(parm); + break; + case SP_M_V_INVIS: + if (OV_typ(parm) == SPOVAR_INT) + tmpmons.invis = OV_i(parm); + break; + case SP_M_V_CANCELLED: + if (OV_typ(parm) == SPOVAR_INT) + tmpmons.cancelled = OV_i(parm); + break; + case SP_M_V_REVIVED: + if (OV_typ(parm) == SPOVAR_INT) + tmpmons.revived = OV_i(parm); + break; + case SP_M_V_AVENGE: + if (OV_typ(parm) == SPOVAR_INT) + tmpmons.avenge = OV_i(parm); + break; + case SP_M_V_FLEEING: + if (OV_typ(parm) == SPOVAR_INT) + tmpmons.fleeing = OV_i(parm); + break; + case SP_M_V_BLINDED: + if (OV_typ(parm) == SPOVAR_INT) + tmpmons.blinded = OV_i(parm); + break; + case SP_M_V_PARALYZED: + if (OV_typ(parm) == SPOVAR_INT) + tmpmons.paralyzed = OV_i(parm); + break; + case SP_M_V_STUNNED: + if (OV_typ(parm) == SPOVAR_INT) + tmpmons.stunned = OV_i(parm); + break; + case SP_M_V_CONFUSED: + if (OV_typ(parm) == SPOVAR_INT) + tmpmons.confused = OV_i(parm); + break; + case SP_M_V_SEENTRAPS: + if (OV_typ(parm) == SPOVAR_INT) + tmpmons.seentraps = OV_i(parm); + break; + case SP_M_V_END: + nparams = SP_M_V_END+1; + break; + default: + impossible("MONSTER with unknown variable param type!"); + break; + } + opvar_free(parm); + if (OV_i(varparam) != SP_M_V_END) { + opvar_free(varparam); + OV_pop(varparam); + } + } + + if (!OV_pop_c(coord)) panic("no monster coord?"); + + if (!OV_pop_typ(id, SPOVAR_MONST)) panic("no mon type"); + + tmpmons.id = SP_MONST_PM(OV_i(id)); + tmpmons.class = SP_MONST_CLASS(OV_i(id)); + tmpmons.coord = OV_i(coord); + tmpmons.has_invent = OV_i(has_inv); + + create_monster(&tmpmons, coder->croom); + + Free(tmpmons.name.str); + Free(tmpmons.appear_as.str); + + opvar_free(id); + opvar_free(coord); + opvar_free(has_inv); + opvar_free(varparam); +} + +void +spo_object(coder) + struct sp_coder *coder; +{ + int nparams = 0; + long quancnt; + + struct opvar *varparam; + struct opvar *id, *containment; + + object tmpobj; + + tmpobj.spe = -127; + tmpobj.curse_state = -1; + tmpobj.corpsenm = NON_PM; + tmpobj.name.str = (char *)0; + tmpobj.quan = -1; + tmpobj.buried = 0; + tmpobj.lit = 0; + tmpobj.eroded = 0; + tmpobj.locked = 0; + tmpobj.trapped = 0; + tmpobj.recharged = 0; + tmpobj.invis = 0; + tmpobj.greased = 0; + tmpobj.broken = 0; + tmpobj.coord = SP_COORD_PACK_RANDOM(0); + + if (!OV_pop_i(containment)) return; + + if (!OV_pop_i(varparam)) return; + + while ((nparams++ < (SP_O_V_END+1)) && + (OV_typ(varparam) == SPOVAR_INT) && + (OV_i(varparam) >= 0) && + (OV_i(varparam) < SP_O_V_END)) { + struct opvar *parm; + OV_pop(parm); + switch (OV_i(varparam)) { + case SP_O_V_NAME: + if ((OV_typ(parm) == SPOVAR_STRING) && + !tmpobj.name.str) + tmpobj.name.str = strdup(OV_s(parm)); + break; + case SP_O_V_CORPSENM: + if (OV_typ(parm) == SPOVAR_MONST) { + char monclass = SP_MONST_CLASS(OV_i(parm)); + int monid = SP_MONST_PM(OV_i(parm)); + if (monid >= 0 && monid < NUMMONS) { + tmpobj.corpsenm = monid; + break; /* we're done! */ + } else { + struct permonst *pm = (struct permonst *)0; + if (def_char_to_monclass(monclass) != MAXMCLASSES) { + pm = mkclass(def_char_to_monclass(monclass), G_NOGEN); + } else { + pm = rndmonst(); + } + if (pm) + tmpobj.corpsenm = monsndx(pm); + } + } + break; + case SP_O_V_CURSE: + if (OV_typ(parm) == SPOVAR_INT) + tmpobj.curse_state = OV_i(parm); + break; + case SP_O_V_SPE: + if (OV_typ(parm) == SPOVAR_INT) + tmpobj.spe = OV_i(parm); + break; + case SP_O_V_QUAN: + if (OV_typ(parm) == SPOVAR_INT) + tmpobj.quan = OV_i(parm); + break; + case SP_O_V_BURIED: + if (OV_typ(parm) == SPOVAR_INT) + tmpobj.buried = OV_i(parm); + break; + case SP_O_V_LIT: + if (OV_typ(parm) == SPOVAR_INT) + tmpobj.lit = OV_i(parm); + break; + case SP_O_V_ERODED: + if (OV_typ(parm) == SPOVAR_INT) + tmpobj.eroded = OV_i(parm); + break; + case SP_O_V_LOCKED: + if (OV_typ(parm) == SPOVAR_INT) + tmpobj.locked = OV_i(parm); + break; + case SP_O_V_TRAPPED: + if (OV_typ(parm) == SPOVAR_INT) + tmpobj.trapped = OV_i(parm); + break; + case SP_O_V_RECHARGED: + if (OV_typ(parm) == SPOVAR_INT) + tmpobj.recharged = OV_i(parm); + break; + case SP_O_V_INVIS: + if (OV_typ(parm) == SPOVAR_INT) + tmpobj.invis = OV_i(parm); + break; + case SP_O_V_GREASED: + if (OV_typ(parm) == SPOVAR_INT) + tmpobj.greased = OV_i(parm); + break; + case SP_O_V_BROKEN: + if (OV_typ(parm) == SPOVAR_INT) + tmpobj.broken = OV_i(parm); + break; + case SP_O_V_COORD: + if (OV_typ(parm) != SPOVAR_COORD) + panic("no coord for obj?"); + tmpobj.coord = OV_i(parm); + break; + case SP_O_V_END: + nparams = SP_O_V_END+1; + break; + default: + impossible("OBJECT with unknown variable param type!"); + break; + } + opvar_free(parm); + if (OV_i(varparam) != SP_O_V_END) { + opvar_free(varparam); + OV_pop(varparam); + } + } + + if (!OV_pop_typ(id, SPOVAR_OBJ)) panic("no obj type"); + + tmpobj.id = SP_OBJ_TYP(OV_i(id)); + tmpobj.class = SP_OBJ_CLASS(OV_i(id)); + tmpobj.containment = OV_i(containment); + + quancnt = (tmpobj.id > STRANGE_OBJECT) ? tmpobj.quan : 0; + + do { + create_object(&tmpobj, coder->croom); + quancnt--; + } while ((quancnt > 0) && + ((tmpobj.id > STRANGE_OBJECT) && + !objects[tmpobj.id].oc_merge)); + + Free(tmpobj.name.str); + + opvar_free(varparam); + opvar_free(id); + opvar_free(containment); +} + +void +spo_level_flags(coder) + struct sp_coder *coder; +{ + struct opvar *flagdata; + long flags; + + if (!OV_pop_i(flagdata)) return; + flags = OV_i(flagdata); + + if (flags & NOTELEPORT) level.flags.noteleport = 1; + if (flags & HARDFLOOR) level.flags.hardfloor = 1; + if (flags & NOMMAP) level.flags.nommap = 1; + if (flags & SHORTSIGHTED) level.flags.shortsighted = 1; + if (flags & ARBOREAL) level.flags.arboreal = 1; + /* + if (flags & NOFLIPX) coder->allow_flips &= ~1; + if (flags & NOFLIPY) coder->allow_flips &= ~2; + if (flags & MAZELEVEL) level.flags.is_maze_lev = 1; + if (flags & PREMAPPED) coder->premapped = TRUE; + if (flags & SHROUD) level.flags.hero_memory = 0; + if (flags & STORMY) level.flags.stormy = 1; + if (flags & GRAVEYARD) level.flags.graveyard = 1; + if (flags & SKYMAP) level.flags.sky = 1; + if (flags & FLAG_RNDVAULT) coder->allow_flips = 0; + */ + + opvar_free(flagdata); +} + +void +spo_initlevel(coder) + struct sp_coder *coder; +{ + lev_init init_lev; + struct opvar *init_style, *fg, *bg, *smoothed, *joined, *lit, *walled, *filling; + + if (!OV_pop_i(fg) || + !OV_pop_i(bg) || + !OV_pop_i(smoothed) || + !OV_pop_i(joined) || + !OV_pop_i(lit) || + !OV_pop_i(walled) || + !OV_pop_i(filling) || + !OV_pop_i(init_style)) return; + + init_lev.init_style = OV_i(init_style); + init_lev.fg = OV_i(fg); + init_lev.bg = OV_i(bg); + init_lev.smoothed = OV_i(smoothed); + init_lev.joined = OV_i(joined); + init_lev.lit = OV_i(lit); + init_lev.walled = OV_i(walled); + init_lev.filling = OV_i(filling); + + coder->lvl_is_joined = OV_i(joined); + + splev_initlev(&init_lev); + + opvar_free(init_style); + opvar_free(fg); + opvar_free(bg); + opvar_free(smoothed); + opvar_free(joined); + opvar_free(lit); + opvar_free(walled); + opvar_free(filling); +} + +void +spo_engraving(coder) + struct sp_coder *coder; +{ + struct opvar *etyp, *txt, *coord; + xchar x,y; + + if (!OV_pop_i(etyp) || + !OV_pop_s(txt) || + !OV_pop_c(coord)) return; + + get_location_coord(&x, &y, DRY, coder->croom, OV_i(coord)); + make_engr_at(x, y, OV_s(txt), 0L, OV_i(etyp)); + + opvar_free(etyp); + opvar_free(txt); + opvar_free(coord); +} + +void +spo_mineralize(coder) + struct sp_coder *coder; +{ + struct opvar *kelp_pool, *kelp_moat, *gold_prob, *gem_prob; + + if (!OV_pop_i(gem_prob) || + !OV_pop_i(gold_prob) || + !OV_pop_i(kelp_moat) || + !OV_pop_i(kelp_pool)) return; + + mineralize(OV_i(kelp_pool), OV_i(kelp_moat), OV_i(gold_prob), OV_i(gem_prob), TRUE); + + opvar_free(gem_prob); + opvar_free(gold_prob); + opvar_free(kelp_moat); + opvar_free(kelp_pool); +} + +void +spo_room(coder) + struct sp_coder *coder; +{ + int isbigrm = FALSE; + if (coder->n_subroom > MAX_NESTED_ROOMS) + panic("Too deeply nested rooms?!"); + else { + struct opvar *flags, *h, *w, *yalign, *xalign, + *y, *x, *rlit, *chance, *rtype; + + room tmproom; + struct mkroom *tmpcr; + + if (!OV_pop_i(h) || + !OV_pop_i(w) || + !OV_pop_i(y) || + !OV_pop_i(x) || + !OV_pop_i(yalign) || + !OV_pop_i(xalign) || + !OV_pop_i(flags) || + !OV_pop_i(rlit) || + !OV_pop_i(chance) || + !OV_pop_i(rtype)) return; + + + tmproom.x = OV_i(x); + tmproom.y = OV_i(y); + tmproom.w = OV_i(w); + tmproom.h = OV_i(h); + tmproom.xalign = OV_i(xalign); + tmproom.yalign = OV_i(yalign); + tmproom.rtype = OV_i(rtype); + tmproom.chance = OV_i(chance); + tmproom.rlit = OV_i(rlit); + tmproom.filled = (OV_i(flags) & (1 << 0)); + /*tmproom.irregular = (OV_i(flags) & (1 << 1));*/ + tmproom.joined = !(OV_i(flags) & (1 << 2)); + + isbigrm = ((tmproom.w * tmproom.h) > 20); + + opvar_free(x); + opvar_free(y); + opvar_free(w); + opvar_free(h); + opvar_free(xalign); + opvar_free(yalign); + opvar_free(rtype); + opvar_free(chance); + opvar_free(rlit); + opvar_free(flags); + + if (!coder->failed_room[coder->n_subroom-1]) { + tmpcr = build_room(&tmproom, coder->croom); + if (tmpcr) { + coder->tmproomlist[coder->n_subroom] = tmpcr; + coder->failed_room[coder->n_subroom] = FALSE; + coder->n_subroom++; + return; + } + } /* failed to create parent room, so fail this too */ + } + coder->tmproomlist[coder->n_subroom] = (struct mkroom *)0; + coder->failed_room[coder->n_subroom] = TRUE; + coder->n_subroom++; +} + +void +spo_endroom(coder) + struct sp_coder *coder; +{ + if (coder->n_subroom > 1) { + coder->n_subroom--; + coder->tmproomlist[coder->n_subroom] = NULL; + coder->failed_room[coder->n_subroom] = TRUE; + } else { + /* no subroom, get out of top-level room */ + /* Need to ensure xstart/ystart/xsize/ysize have something sensible, + in case there's some stuff to be created outside the outermost room, + and there's no MAP. + */ + if(xsize <= 1 && ysize <= 1) { + xstart = 1; + ystart = 0; + xsize = COLNO-1; + ysize = ROWNO; + } + } +} + +void +spo_stair(coder) + struct sp_coder *coder; +{ + xchar x,y; + struct opvar *up, *coord; + struct trap *badtrap; + + if (!OV_pop_i(up) || + !OV_pop_c(coord)) return; + + if (coder->croom) { + get_location_coord(&x, &y, DRY, coder->croom, OV_i(coord)); + mkstairs(x,y,(char)OV_i(up), coder->croom); + SpLev_Map[x][y] = 1; + } else { + get_location_coord(&x, &y, DRY, coder->croom, OV_i(coord)); + if ((badtrap = t_at(x,y)) != 0) deltrap(badtrap); + mkstairs(x, y, (char)OV_i(up), coder->croom); + SpLev_Map[x][y] = 1; + } + + opvar_free(coord); + opvar_free(up); +} + +void +spo_ladder(coder) + struct sp_coder *coder; +{ + xchar x,y; + struct opvar *up, *coord; + + if (!OV_pop_i(up) || + !OV_pop_c(coord)) return; + + get_location_coord(&x, &y, DRY, coder->croom, OV_i(coord)); + + levl[x][y].typ = LADDER; + SpLev_Map[x][y] = 1; + if (OV_i(up)) { + xupladder = x; yupladder = y; + levl[x][y].ladder = LA_UP; + } else { + xdnladder = x; ydnladder = y; + levl[x][y].ladder = LA_DOWN; + } + opvar_free(coord); + opvar_free(up); +} + +void +spo_grave(coder) + struct sp_coder *coder; +{ + struct opvar *coord, *typ, *txt; + schar x,y; + if (!OV_pop_i(typ) || + !OV_pop_s(txt) || + !OV_pop_c(coord)) return; + + get_location_coord(&x, &y, DRY, coder->croom, OV_i(coord)); + + if (isok(x, y) && !t_at(x, y)) { + levl[x][y].typ = GRAVE; + switch (OV_i(typ)) { + case 2: make_grave(x, y, OV_s(txt)); break; + case 1: make_grave(x, y, NULL); break; + default: del_engr_at(x, y); break; + } + } + + opvar_free(coord); + opvar_free(typ); + opvar_free(txt); +} + +void +spo_altar(coder) + struct sp_coder *coder; +{ + struct opvar *al, *shrine, *coord; + altar tmpaltar; + + if (!OV_pop_i(al) || + !OV_pop_i(shrine) || + !OV_pop_c(coord)) return; + + tmpaltar.coord = OV_i(coord); + tmpaltar.align = OV_i(al); + tmpaltar.shrine = OV_i(shrine); + + create_altar(&tmpaltar, coder->croom); + + opvar_free(coord); + opvar_free(shrine); + opvar_free(al); +} + +void +spo_trap(coder) + struct sp_coder *coder; +{ + struct opvar *type; + struct opvar *coord; + trap tmptrap; + + if (!OV_pop_i(type) || + !OV_pop_c(coord)) return; + + tmptrap.coord = OV_i(coord); + tmptrap.type = OV_i(type); + + create_trap(&tmptrap, coder->croom); + opvar_free(coord); + opvar_free(type); +} + +void +spo_gold(coder) + struct sp_coder *coder; +{ + struct opvar *coord, *amt; + schar x,y; + long amount; + if (!OV_pop_c(coord) || !OV_pop_i(amt)) return; + amount = OV_i(amt); + get_location_coord(&x, &y, DRY, coder->croom, OV_i(coord)); + if (amount == -1) amount = rnd(200); + mkgold(amount, x,y); + opvar_free(coord); + opvar_free(amt); +} + +void +spo_corridor(coder) + struct sp_coder *coder; +{ + struct opvar *deswall, *desdoor, *desroom, + *srcwall, *srcdoor, *srcroom; + corridor tc; + + if (!OV_pop_i(deswall) || + !OV_pop_i(desdoor) || + !OV_pop_i(desroom) || + !OV_pop_i(srcwall) || + !OV_pop_i(srcdoor) || + !OV_pop_i(srcroom)) return; + + tc.src.room = OV_i(srcroom); + tc.src.door = OV_i(srcdoor); + tc.src.wall = OV_i(srcwall); + tc.dest.room = OV_i(desroom); + tc.dest.door = OV_i(desdoor); + tc.dest.wall = OV_i(deswall); + + create_corridor(&tc); + + opvar_free(deswall); + opvar_free(desdoor); + opvar_free(desroom); + opvar_free(srcwall); + opvar_free(srcdoor); + opvar_free(srcroom); +} + + +struct opvar * +selection_opvar(nbuf) + char *nbuf; +{ + struct opvar *ov; + char buf[(COLNO*ROWNO)+1]; + + if (!nbuf) { + (void) memset(buf, 1, sizeof(buf)); + buf[(COLNO*ROWNO)] = '\0'; + ov = opvar_new_str(buf); + } else { + ov = opvar_new_str(nbuf); + } + ov->spovartyp = SPOVAR_SEL; + return ov; +} + +char +selection_getpoint(x,y,ov) + int x,y; + struct opvar *ov; +{ + if (!ov || ov->spovartyp != SPOVAR_SEL) return 0; + if (x < 0 || y < 0 || x >= COLNO || y >= ROWNO) return 0; + + return (ov->vardata.str[COLNO*y + x] - 1); +} + +void +selection_setpoint(x,y,ov, c) + int x,y; + struct opvar *ov; + char c; +{ + if (!ov || ov->spovartyp != SPOVAR_SEL) return; + if (x < 0 || y < 0 || x >= COLNO || y >= ROWNO) return; + + ov->vardata.str[COLNO*y + x] = (c + 1); +} + +struct opvar * +selection_not(s) + struct opvar *s; +{ + struct opvar *ov; + int x,y; + ov = selection_opvar(NULL); + if (!ov) return NULL; + + for (x = 0; x < COLNO; x++) + for (y = 0; y < ROWNO; y++) + if (!selection_getpoint(x,y,s)) + selection_setpoint(x,y,ov,1); + + return ov; +} + +struct opvar * +selection_logical_oper(s1, s2, oper) + struct opvar *s1, *s2; + char oper; +{ + struct opvar *ov; + int x,y; + + ov = selection_opvar(NULL); + if (!ov) return NULL; + + for (x = 0; x < COLNO; x++) + for (y = 0; y < ROWNO; y++) { + switch (oper) { + default: + case '|': + if (selection_getpoint(x,y,s1) || selection_getpoint(x,y,s2)) + selection_setpoint(x,y,ov,1); + break; + case '&': + if (selection_getpoint(x,y,s1) && selection_getpoint(x,y,s2)) + selection_setpoint(x,y,ov,1); + break; + } + } + + return ov; +} + +struct opvar * +selection_filter_mapchar(ov, mc) + struct opvar *ov; + struct opvar *mc; +{ + int x,y; + schar mapc; + xchar lit; + struct opvar *ret = selection_opvar(NULL); + if (!ov || !mc || !ret) return NULL; + mapc = SP_MAPCHAR_TYP(OV_i(mc)); + lit = SP_MAPCHAR_LIT(OV_i(mc)); + for (x = 0; x < COLNO; x++) + for (y = 0; y < ROWNO; y++) + if (selection_getpoint(x,y,ov) && (levl[x][y].typ == mapc)) { + switch (lit) { + default: + case -2: selection_setpoint(x,y,ret, 1); break; + case -1: selection_setpoint(x,y,ret, rn2(2)); break; + case 0: + case 1: if (levl[x][y].lit == lit) selection_setpoint(x,y,ret, 1); break; + } + } + return ret; +} + + +void +selection_filter_percent(ov, percent) + struct opvar *ov; + int percent; +{ + int x,y; + if (!ov) return; + for (x = 0; x < COLNO; x++) + for (y = 0; y < ROWNO; y++) + if (selection_getpoint(x,y,ov) && (rn2(100) >= percent)) + selection_setpoint(x,y,ov,0); +} + +int +selection_rndcoord(ov, x,y) + struct opvar *ov; + schar *x, *y; +{ + int idx = 0; + int c; + int dx,dy; + + for (dx = 0; dx < COLNO; dx++) + for (dy = 0; dy < ROWNO; dy++) + if (isok(dx,dy) && selection_getpoint(dx,dy,ov)) idx++; + + if (idx) { + c = rn2(idx); + for (dx = 0; dx < COLNO; dx++) + for (dy = 0; dy < ROWNO; dy++) + if (isok(dx,dy) && selection_getpoint(dx,dy, ov)) { + if (!c) { + *x = dx; + *y = dy; + return 1; + } + c--; + } + } + *x = *y = -1; + return 0; +} + +void +selection_do_grow(ov, dir) + struct opvar *ov; + int dir; +{ + int x,y, c; + char tmp[COLNO][ROWNO]; + + if (ov->spovartyp != SPOVAR_SEL) return; + if (!ov) return; + + (void) memset(tmp, 0, sizeof(tmp)); + + for (x = 0; x < COLNO; x++) + for (y = 0; y < ROWNO; y++) { + c = 0; + if ((dir & W_WEST) && (x > 0) && (selection_getpoint(x-1,y, ov))) c++; + if ((dir & (W_WEST|W_NORTH)) && (x > 0) && (y > 0) && (selection_getpoint(x-1,y-1, ov))) c++; + if ((dir & W_NORTH) && (y > 0) && (selection_getpoint(x,y-1, ov))) c++; + if ((dir & (W_NORTH|W_EAST)) && (y > 0) && (x < COLNO-1) && (selection_getpoint(x+1,y-1, ov))) c++; + if ((dir & W_EAST) && (x < COLNO-1) && (selection_getpoint(x+1,y, ov))) c++; + if ((dir & (W_EAST|W_SOUTH)) && (x < COLNO-1) && (y < ROWNO-1) && (selection_getpoint(x+1,y+1, ov))) c++; + if ((dir & W_SOUTH) && (y < ROWNO-1) && (selection_getpoint(x,y+1, ov))) c++; + if ((dir & (W_SOUTH|W_WEST)) && (y < ROWNO-1) && (x > 0) && (selection_getpoint(x-1,y+1, ov))) c++; + if (c) tmp[x][y] = 1; + } + + for (x = 0; x < COLNO; x++) + for (y = 0; y < ROWNO; y++) + if (tmp[x][y]) selection_setpoint(x,y,ov,1); +} + +void +selection_floodfill(ov, x,y) + struct opvar *ov; + int x,y; +{ + struct opvar *tmp = selection_opvar(NULL); +#define SEL_FLOOD_STACK (COLNO*ROWNO) +#define SEL_FLOOD(nx,ny) {if (idx 0); +#undef SEL_FLOOD +#undef SEL_FLOOD_STACK + opvar_free(tmp); +} + +/* McIlroy's Ellipse Algorithm */ +void +selection_do_ellipse(ov, xc,yc, a,b, filled) + struct opvar *ov; + int xc,yc,a,b,filled; +{ /* e(x,y) = b^2*x^2 + a^2*y^2 - a^2*b^2 */ + int x = 0, y = b; + long a2 = (long)a*a, b2 = (long)b*b; + long crit1 = -(a2/4 + a%2 + b2); + long crit2 = -(b2/4 + b%2 + a2); + long crit3 = -(b2/4 + b%2); + long t = -a2*y; /* e(x+1/2,y-1/2) - (a^2+b^2)/4 */ + long dxt = 2*b2*x, dyt = -2*a2*y; + long d2xt = 2*b2, d2yt = 2*a2; + long width = 1; + long i; + + if (!ov) return; + + filled = !filled; + + if (!filled) { + while (y>=0 && x<=a) { + selection_setpoint(xc+x, yc+y, ov, 1); + if (x!=0 || y!=0) + selection_setpoint(xc-x, yc-y, ov, 1); + if (x!=0 && y!=0) { + selection_setpoint(xc+x, yc-y, ov, 1); + selection_setpoint(xc-x, yc+y, ov, 1); + } + if (t + b2*x <= crit1 || /* e(x+1,y-1/2) <= 0 */ + t + a2*y <= crit3) { /* e(x+1/2,y) <= 0 */ + x++; dxt += d2xt; t += dxt; + } else if (t - a2*y > crit2) { /* e(x+1/2,y-1) > 0 */ + y--; dyt += d2yt; t += dyt; + } else { + x++; dxt += d2xt; t += dxt; + y--; dyt += d2yt; t += dyt; + } + } + } else { + while (y>=0 && x<=a) { + if (t + b2*x <= crit1 || /* e(x+1,y-1/2) <= 0 */ + t + a2*y <= crit3) { /* e(x+1/2,y) <= 0 */ + x++; dxt += d2xt; t += dxt; + width += 2; + } else if (t - a2*y > crit2) { /* e(x+1/2,y-1) > 0 */ + for (i = 0; i < width; i++) selection_setpoint(xc-x+i, yc-y, ov, 1); + if (y!=0) + for (i = 0; i < width; i++) selection_setpoint(xc-x+i, yc+y, ov, 1); + y--; dyt += d2yt; t += dyt; + } else { + for (i = 0; i < width; i++) selection_setpoint(xc-x+i, yc-y, ov, 1); + if (y!=0) + for (i = 0; i < width; i++) selection_setpoint(xc-x+i, yc+y, ov, 1); + x++; dxt += d2xt; t += dxt; + y--; dyt += d2yt; t += dyt; + width += 2; + } + } + } +} + +/* distance from line segment (x1,y1, x2,y2) to point (x3,y3) */ +long +line_dist_coord(x1,y1, x2,y2, x3,y3) + long x1,y1,x2,y2,x3,y3; +{ + long px = x2-x1; + long py = y2-y1; + + if (x1 == x2 && y1 == y2) return isqrt(dist2(x1,y1, x3,y3)); + + long s = px*px + py*py; + float u = ((x3 - x1) * px + (y3 - y1) * py) / (float)s; + + if (u > 1) u = 1; + else if (u < 0) u = 0; + + long x = x1 + u * px; + long y = y1 + u * py; + long dx = x - x3; + long dy = y - y3; + long dist = isqrt(dx*dx + dy*dy); + + return dist; +} + +void +selection_do_gradient(ov, x,y, x2,y2, gtyp, mind, maxd, limit) + struct opvar *ov; + long x, y, x2,y2, gtyp, mind, maxd, limit; +{ + long dx,dy, dofs; + + if (mind > maxd) { + long tmp = mind; + mind = maxd; + maxd = tmp; + } + + dofs = maxd - mind; + if (dofs < 1) dofs = 1; + + switch (gtyp) { + default: + case SEL_GRADIENT_RADIAL: + { + for (dx = 0; dx < COLNO; dx++) + for (dy = 0; dy < ROWNO; dy++) { + long d = line_dist_coord(x,y, x2,y2, dx,dy); + if (d >= mind && (!limit || (d <= maxd))) { + if ((d - mind) > rn2(dofs)) + selection_setpoint(dx,dy, ov, 1); + } + } + } + break; + case SEL_GRADIENT_SQUARE: + { + for (dx = 0; dx < COLNO; dx++) + for (dy = 0; dy < ROWNO; dy++) { + long d1 = line_dist_coord(x,y, x2,y2, x,dy); + long d2 = line_dist_coord(x,y, x2,y2, dx,y); + long d3 = line_dist_coord(x,y, x2,y2, x2,dy); + long d4 = line_dist_coord(x,y, x2,y2, dx,y2); + long d5 = line_dist_coord(x,y, x2,y2, dx,dy); + long d = min(d5, min(max(d1, d2),max(d3,d4))); + + if (d >= mind && (!limit || (d <= maxd))) { + if ((d - mind) > rn2(dofs)) + selection_setpoint(dx,dy, ov, 1); + } + } + } + break; + } +} + +void +selection_do_line(x1,y1,x2,y2, ov) /* bresenham line algo */ + schar x1,y1,x2,y2; + struct opvar *ov; +{ + int d,dx,dy,ai,bi,xi,yi; + + if (x1 < x2) { + xi = 1; + dx = x2 - x1; + } else { + xi = - 1; + dx = x1 - x2; + } + + if (y1 < y2) { + yi = 1; + dy = y2 - y1; + } else { + yi = - 1; + dy = y1 - y2; + } + + selection_setpoint(x1,y1, ov, 1); + + if (dx > dy) { + ai = (dy - dx) * 2; + bi = dy * 2; + d = bi - dx; + do { + if (d >= 0) { + y1 += yi; + d += ai; + } else d += bi; + x1 += xi; + selection_setpoint(x1,y1, ov, 1); + } while (x1 != x2); + } else { + ai = (dx - dy) * 2; + bi = dx * 2; + d = bi - dy; + do { + if (d >= 0) { + x1 += xi; + d += ai; + } else d += bi; + y1 += yi; + selection_setpoint(x1,y1, ov, 1); + } while (y1 != y2); + } +} + +void +selection_do_randline(x1,y1,x2,y2,rough, rec, ov) + schar x1,y1,x2,y2,rough,rec; + struct opvar *ov; +{ + int mx, my; + int dx, dy; + + if (rec < 1) { + return; + } + + if ((x2 == x1) && (y2 == y1)) { + selection_setpoint(x1,y1, ov, 1); + return; + } + + if (rough > max(abs(x2-x1), abs(y2-y1))) + rough = max(abs(x2-x1), abs(y2-y1)); + + if (rough < 2) { + mx = ((x1 + x2) / 2); + my = ((y1 + y2) / 2); + } else { + do { + dx = (rand() % rough) - (rough / 2); + dy = (rand() % rough) - (rough / 2); + mx = ((x1 + x2) / 2) + dx; + my = ((y1 + y2) / 2) + dy; + } while ((mx > COLNO-1 || mx < 0 || my < 0 || my > ROWNO-1)); + } + + selection_setpoint(mx,my, ov, 1); + + rough = (rough * 2) / 3; + + rec--; + + selection_do_randline(x1,y1,mx,my, rough, rec, ov); + selection_do_randline(mx,my,x2,y2, rough, rec, ov); +} + + +void +selection_iterate(ov, func, arg) + struct opvar *ov; + void FDECL((*func), (int,int,genericptr_t)); + genericptr_t arg; +{ + int x,y; + /* yes, this is very naive, but it's not _that_ expensive. */ + for (x = 0; x < COLNO; x++) + for (y = 0; y < ROWNO; y++) + if (selection_getpoint(x,y, ov)) (*func)(x,y, arg); +} + +void +sel_set_ter(x,y,arg) + int x,y; + genericptr_t arg; +{ + terrain terr; + terr = (*(terrain *)arg); + SET_TYPLIT(x,y, terr.ter, terr.tlit); + /* handle doors and secret doors */ + if (levl[x][y].typ == SDOOR || IS_DOOR(levl[x][y].typ)) { + if(levl[x][y].typ == SDOOR) + levl[x][y].doormask = D_CLOSED; + if (x && (IS_WALL(levl[x-1][y].typ) || + levl[x-1][y].horizontal)) + levl[x][y].horizontal = 1; + } +} + +void +sel_set_feature(x,y,arg) + int x,y; + genericptr_t arg; +{ + if (IS_FURNITURE(levl[x][y].typ)) return; + levl[x][y].typ = (*(int *)arg); +} + +void +sel_set_door(dx,dy,arg) + int dx,dy; + genericptr_t arg; +{ + xchar typ = (*(xchar *)arg); + xchar x = dx; + xchar y = dy; + struct mkroom *droom; + droom = &rooms[0]; + /*get_location(&x, &y, DRY, (struct mkroom *)0);*/ + if (!IS_DOOR(levl[x][y].typ) && levl[x][y].typ != SDOOR) + levl[x][y].typ = (typ & D_SECRET) ? SDOOR : DOOR; + if (typ & D_SECRET) { + typ &= ~D_SECRET; + if (typ < D_CLOSED) + typ = D_CLOSED; + } + levl[x][y].doormask = typ; + /*SpLev_Map[x][y] = 1;*/ + + /* Now the complicated part, list it with each subroom */ + /* The dog move and mail daemon routines use this */ + while(droom->hx >= 0 && doorindex < DOORMAX) { + if(droom->hx >= x-1 && droom->lx <= x+1 && + droom->hy >= y-1 && droom->ly <= y+1) { + /* Found it */ + add_door(x, y, droom); + } + droom++; + } + +} + + + +void +spo_door(coder) + struct sp_coder *coder; +{ + struct opvar *msk, *sel; + xchar typ; + + if (!OV_pop_i(msk) || + !OV_pop_typ(sel, SPOVAR_SEL)) return; + + typ = OV_i(msk) == -1 ? rnddoor() : (xchar)OV_i(msk); + + selection_iterate(sel, sel_set_door, (genericptr_t)&typ); + + opvar_free(sel); + opvar_free(msk); +} + +void +spo_feature(coder) + struct sp_coder *coder; +{ + struct opvar *sel; + int typ; + + if (!OV_pop_typ(sel, SPOVAR_SEL)) return; + + switch (coder->opcode) { + default: impossible("spo_feature called with wrong opcode %i.", coder->opcode); break; + case SPO_FOUNTAIN: typ = FOUNTAIN; break; + case SPO_SINK: typ = SINK; break; + case SPO_POOL: typ = POOL; break; + } + selection_iterate(sel, sel_set_feature, (genericptr_t)&typ); + opvar_free(sel); +} + +void +spo_terrain(coder) + struct sp_coder *coder; +{ + terrain tmpterrain; + struct opvar *ter, *sel; + + if (!OV_pop_typ(ter, SPOVAR_MAPCHAR) || + !OV_pop_typ(sel, SPOVAR_SEL)) return; + + tmpterrain.ter = SP_MAPCHAR_TYP(OV_i(ter)); + tmpterrain.tlit = SP_MAPCHAR_LIT(OV_i(ter)); + selection_iterate(sel, sel_set_ter, (genericptr_t)&tmpterrain); + + opvar_free(ter); + opvar_free(sel); +} + +void +spo_replace_terrain(coder) + struct sp_coder *coder; +{ + replaceterrain rt; + struct opvar *reg,*from_ter,*to_ter,*chance; + + if (!OV_pop_i(chance) || + !OV_pop_typ(to_ter, SPOVAR_MAPCHAR) || + !OV_pop_typ(from_ter, SPOVAR_MAPCHAR) || + !OV_pop_r(reg)) return; + + rt.chance = OV_i(chance); + rt.tolit = SP_MAPCHAR_LIT(OV_i(to_ter)); + rt.toter = SP_MAPCHAR_TYP(OV_i(to_ter)); + rt.fromter = SP_MAPCHAR_TYP(OV_i(from_ter)); + /* TODO: use SP_MAPCHAR_LIT(OV_i(from_ter)) too */ + rt.x1 = SP_REGION_X1(OV_i(reg)); + rt.y1 = SP_REGION_Y1(OV_i(reg)); + rt.x2 = SP_REGION_X2(OV_i(reg)); + rt.y2 = SP_REGION_Y2(OV_i(reg)); + + replace_terrain(&rt, coder->croom); + + opvar_free(reg); + opvar_free(from_ter); + opvar_free(to_ter); + opvar_free(chance); +} + +void +spo_levregion(coder) + struct sp_coder *coder; +{ + struct opvar *rname, *padding, *rtype, + *del_islev, *dy2, *dx2, *dy1, *dx1, + *in_islev, *iy2, *ix2, *iy1, *ix1; + + lev_region *tmplregion; + + if (!OV_pop_s(rname) || + !OV_pop_i(padding) || + !OV_pop_i(rtype) || + !OV_pop_i(del_islev) || + !OV_pop_i(dy2) || + !OV_pop_i(dx2) || + !OV_pop_i(dy1) || + !OV_pop_i(dx1) || + !OV_pop_i(in_islev) || + !OV_pop_i(iy2) || + !OV_pop_i(ix2) || + !OV_pop_i(iy1) || + !OV_pop_i(ix1)) return; + + tmplregion = (lev_region *)alloc(sizeof(lev_region)); + if (!tmplregion) panic("levreg alloc"); + tmplregion->inarea.x1 = OV_i(ix1); + tmplregion->inarea.y1 = OV_i(iy1); + tmplregion->inarea.x2 = OV_i(ix2); + tmplregion->inarea.y2 = OV_i(iy2); + + tmplregion->delarea.x1 = OV_i(dx1); + tmplregion->delarea.y1 = OV_i(dy1); + tmplregion->delarea.x2 = OV_i(dx2); + tmplregion->delarea.y2 = OV_i(dy2); + + tmplregion->in_islev = OV_i(in_islev); + tmplregion->del_islev = OV_i(del_islev); + tmplregion->rtype = OV_i(rtype); + tmplregion->padding = OV_i(padding); + tmplregion->rname.str = strdup(OV_s(rname)); + + if(!tmplregion->in_islev) { + get_location(&tmplregion->inarea.x1, &tmplregion->inarea.y1, + ANY_LOC, (struct mkroom *)0); + get_location(&tmplregion->inarea.x2, &tmplregion->inarea.y2, + ANY_LOC, (struct mkroom *)0); + } + + if(!tmplregion->del_islev) { + get_location(&tmplregion->delarea.x1, &tmplregion->delarea.y1, + ANY_LOC, (struct mkroom *)0); + get_location(&tmplregion->delarea.x2, &tmplregion->delarea.y2, + ANY_LOC, (struct mkroom *)0); + } + if(num_lregions) { + /* realloc the lregion space to add the new one */ + lev_region *newl = (lev_region *) alloc(sizeof(lev_region) * + (unsigned)(1+num_lregions)); + if (!newl) panic("levreg newl alloc"); + (void) memcpy((genericptr_t)(newl), (genericptr_t)lregions, + sizeof(lev_region) * num_lregions); + Free(lregions); + num_lregions++; + lregions = newl; + } else { + num_lregions = 1; + lregions = (lev_region *) alloc(sizeof(lev_region)); + if (!lregions) panic("lregions alloc"); + } + (void) memcpy(&lregions[num_lregions-1], tmplregion, sizeof(lev_region)); + + opvar_free(dx1); + opvar_free(dy1); + opvar_free(dx2); + opvar_free(dy2); + + opvar_free(ix1); + opvar_free(iy1); + opvar_free(ix2); + opvar_free(iy2); + + opvar_free(del_islev); + opvar_free(in_islev); + opvar_free(rname); + opvar_free(rtype); + opvar_free(padding); +} + +void +spo_region(coder) + struct sp_coder *coder; +{ + struct opvar *rtype, *rlit, *flags, *area; + xchar dx1,dy1,dx2,dy2; + register struct mkroom *troom; + boolean prefilled, room_not_needed, irregular, joined; + + if (!OV_pop_i(flags) || + !OV_pop_i(rtype) || + !OV_pop_i(rlit) || + !OV_pop_r(area)) return; + + prefilled = !(OV_i(flags) & (1 << 0)); + irregular = (OV_i(flags) & (1 << 1)); + joined = !(OV_i(flags) & (1 << 2)); + + if(OV_i(rtype) > MAXRTYPE) { + OV_i(rtype) -= MAXRTYPE+1; + prefilled = TRUE; + } else + prefilled = FALSE; + + if(OV_i(rlit) < 0) + OV_i(rlit) = (rnd(1+abs(depth(&u.uz))) < 11 && rn2(77)) + ? TRUE : FALSE; + + dx1 = SP_REGION_X1(OV_i(area)); + dy1 = SP_REGION_Y1(OV_i(area)); + dx2 = SP_REGION_X2(OV_i(area)); + dy2 = SP_REGION_Y2(OV_i(area)); + + get_location(&dx1, &dy1, ANY_LOC, (struct mkroom *)0); + get_location(&dx2, &dy2, ANY_LOC, (struct mkroom *)0); + + /* for an ordinary room, `prefilled' is a flag to force + an actual room to be created (such rooms are used to + control placement of migrating monster arrivals) */ + room_not_needed = (OV_i(rtype) == OROOM && + !irregular && !prefilled); + if (room_not_needed || nroom >= MAXNROFROOMS) { + region tmpregion; + if (!room_not_needed) + impossible("Too many rooms on new level!"); + tmpregion.rlit = OV_i(rlit); + tmpregion.x1 = dx1; + tmpregion.y1 = dy1; + tmpregion.x2 = dx2; + tmpregion.y2 = dy2; + light_region(&tmpregion); + + opvar_free(area); + opvar_free(flags); + opvar_free(rlit); + opvar_free(rtype); + + return; + } + + troom = &rooms[nroom]; + + /* mark rooms that must be filled, but do it later */ + if (OV_i(rtype) != OROOM) + troom->needfill = (prefilled ? 2 : 1); + + troom->needjoining = joined; + + if (irregular) { + min_rx = max_rx = dx1; + min_ry = max_ry = dy1; + smeq[nroom] = nroom; + flood_fill_rm(dx1, dy1, nroom+ROOMOFFSET, + OV_i(rlit), TRUE); + add_room(min_rx, min_ry, max_rx, max_ry, + FALSE, OV_i(rtype), TRUE); + troom->rlit = OV_i(rlit); + troom->irregular = TRUE; + } else { + add_room(dx1, dy1, dx2, dy2, + OV_i(rlit), OV_i(rtype), TRUE); +#ifdef SPECIALIZATION + topologize(troom,FALSE); /* set roomno */ +#else + topologize(troom); /* set roomno */ +#endif + } + + if (!room_not_needed) { + if (coder->n_subroom > 1) + impossible("region as subroom"); + else { + coder->tmproomlist[coder->n_subroom] = troom; + coder->failed_room[coder->n_subroom] = FALSE; + coder->n_subroom++; + } + } + + opvar_free(area); + opvar_free(flags); + opvar_free(rlit); + opvar_free(rtype); +} + +void +spo_drawbridge(coder) + struct sp_coder *coder; +{ + xchar x,y; + struct opvar *dir, *db_open, *coord; + + if (!OV_pop_i(dir) || + !OV_pop_i(db_open) || + !OV_pop_c(coord)) return; + + get_location_coord(&x, &y, DRY|WET|HOT, coder->croom, OV_i(coord)); + if (!create_drawbridge(x, y, OV_i(dir), OV_i(db_open))) + impossible("Cannot create drawbridge."); + SpLev_Map[x][y] = 1; + + opvar_free(coord); + opvar_free(db_open); + opvar_free(dir); +} + +void +spo_mazewalk(coder) + struct sp_coder *coder; +{ + xchar x,y; + struct opvar *ftyp, *fstocked,*fdir, *coord; + int dir; + + if (!OV_pop_i(ftyp) || + !OV_pop_i(fstocked) || + !OV_pop_i(fdir) || + !OV_pop_c(coord)) return; + + dir = OV_i(fdir); + + get_location_coord(&x, &y, ANY_LOC, coder->croom, OV_i(coord)); + if (!isok(x,y)) return; + + if (OV_i(ftyp) < 1) { +#ifndef WALLIFIED_MAZE + OV_i(ftyp) = CORR; +#else + OV_i(ftyp) = ROOM; +#endif + } + + /* don't use move() - it doesn't use W_NORTH, etc. */ + switch (dir) { + case W_NORTH: --y; break; + case W_SOUTH: y++; break; + case W_EAST: x++; break; + case W_WEST: --x; break; + default: + impossible("sp_level_coder: Bad MAZEWALK direction"); + } + + if(!IS_DOOR(levl[x][y].typ)) { + levl[x][y].typ = OV_i(ftyp); + levl[x][y].flags = 0; + } /* - * If bounds_nodigpass, and no mazewalks, mark all locations outside - * the map are mapped as nodig and nopass as well. This avoids passwall - * monsters like Xorns from appearing outside the accessible area. + * We must be sure that the parity of the coordinates for + * walkfrom() is odd. But we must also take into account + * what direction was chosen. */ - if (bounds_nodigpass && !nwalk_sav) { - for(x = 1; x < COLNO; x++) - for(y = 0; y < ROWNO; y++) - if(!Map[x][y]) - levl[x][y].wall_info |= W_NONDIGGABLE|W_NONPASSWALL; + if(!(x % 2)) { + if (dir == W_EAST) + x++; + else + x--; + + /* no need for IS_DOOR check; out of map bounds */ + levl[x][y].typ = OV_i(ftyp); + levl[x][y].flags = 0; + } + + if (!(y % 2)) { + if (dir == W_SOUTH) + y++; + else + y--; + } + + walkfrom(x, y, OV_i(ftyp)); + if (OV_i(fstocked)) fill_empty_maze(); + + opvar_free(coord); + opvar_free(fdir); + opvar_free(fstocked); + opvar_free(ftyp); +} + +void +spo_wall_property(coder) + struct sp_coder *coder; +{ + struct opvar *r; + xchar dx1,dy1,dx2,dy2; + int wprop = (coder->opcode == SPO_NON_DIGGABLE) ? W_NONDIGGABLE : W_NONPASSWALL; + + if (!OV_pop_r(r)) return; + + dx1 = SP_REGION_X1(OV_i(r)); + dy1 = SP_REGION_Y1(OV_i(r)); + dx2 = SP_REGION_X2(OV_i(r)); + dy2 = SP_REGION_Y2(OV_i(r)); + + get_location(&dx1, &dy1, ANY_LOC, (struct mkroom *)0); + get_location(&dx2, &dy2, ANY_LOC, (struct mkroom *)0); + + set_wall_property(dx1, dy1, dx2, dy2, wprop); + + opvar_free(r); +} + +void +spo_room_door(coder) + struct sp_coder *coder; +{ + struct opvar *wall, *secret, *mask, *pos; + room_door tmpd; + + if (!OV_pop_i(wall) || + !OV_pop_i(secret) || + !OV_pop_i(mask) || + !OV_pop_i(pos) || + !coder->croom) return; + + tmpd.secret = OV_i(secret); + tmpd.mask = OV_i(mask); + tmpd.pos = OV_i(pos); + tmpd.wall = OV_i(wall); + + create_door(&tmpd, coder->croom); + + opvar_free(wall); + opvar_free(secret); + opvar_free(mask); + opvar_free(pos); +} + +void +sel_set_wallify(x,y,arg) + int x, y; + genericptr_t arg; +{ + wallify_map(x,y, x,y); +} + +void +spo_wallify(coder) + struct sp_coder *coder; +{ + struct opvar *typ, *r; + int dx1,dy1,dx2,dy2; + if (!OV_pop_i(typ)) return; + switch (OV_i(typ)) { + default: + case 0: + { + if (!OV_pop_r(r)) return; + dx1 = (xchar)SP_REGION_X1(OV_i(r)); + dy1 = (xchar)SP_REGION_Y1(OV_i(r)); + dx2 = (xchar)SP_REGION_X2(OV_i(r)); + dy2 = (xchar)SP_REGION_Y2(OV_i(r)); + wallify_map(dx1 < 0 ? xstart : dx1, + dy1 < 0 ? ystart : dy1, + dx2 < 0 ? xstart+xsize : dx2, + dy2 < 0 ? ystart+ysize : dy2); + } + break; + case 1: + { + if (!OV_pop_typ(r, SPOVAR_SEL)) return; + selection_iterate(r, sel_set_wallify, NULL); + } + break; + } + opvar_free(r); +} + +void +spo_map(coder) + struct sp_coder *coder; +{ + mazepart tmpmazepart; + struct opvar *mpxs, *mpys, *mpmap, *mpa, *mpkeepr, *mpzalign; + xchar halign, valign; + xchar tmpxstart, tmpystart, tmpxsize, tmpysize; + int tryct = 0; + unpacked_coord upc; + + if (!OV_pop_i(mpxs) || + !OV_pop_i(mpys) || + !OV_pop_s(mpmap) || + !OV_pop_i(mpkeepr) || + !OV_pop_i(mpzalign) || + !OV_pop_c(mpa)) return; + +redo_maploc: + + tmpmazepart.xsize = OV_i(mpxs); + tmpmazepart.ysize = OV_i(mpys); + tmpmazepart.zaligntyp = OV_i(mpzalign); + + upc = get_unpacked_coord(OV_i(mpa), ANY_LOC); + tmpmazepart.halign = upc.x; + tmpmazepart.valign = upc.y; + + tmpxsize = xsize; tmpysize = ysize; + tmpxstart = xstart; tmpystart = ystart; + + halign = tmpmazepart.halign; + valign = tmpmazepart.valign; + xsize = tmpmazepart.xsize; + ysize = tmpmazepart.ysize; + switch (tmpmazepart.zaligntyp) { + default: + case 0: + break; + case 1: + switch((int) halign) { + case LEFT: xstart = 3; break; + case H_LEFT: xstart = 2+((x_maze_max-2-xsize)/4); break; + case CENTER: xstart = 2+((x_maze_max-2-xsize)/2); break; + case H_RIGHT: xstart = 2+((x_maze_max-2-xsize)*3/4); break; + case RIGHT: xstart = x_maze_max-xsize-1; break; + } + switch((int) valign) { + case TOP: ystart = 3; break; + case CENTER: ystart = 2+((y_maze_max-2-ysize)/2); break; + case BOTTOM: ystart = y_maze_max-ysize-1; break; + } + if (!(xstart % 2)) xstart++; + if (!(ystart % 2)) ystart++; + break; + case 2: + if (!coder->croom) { + xstart = 1; + ystart = 0; + xsize = COLNO-1-tmpmazepart.xsize; + ysize = ROWNO-tmpmazepart.ysize; + } + get_location_coord(&halign, &valign, ANY_LOC, coder->croom, OV_i(mpa)); + xsize = tmpmazepart.xsize; + ysize = tmpmazepart.ysize; + xstart = halign; + ystart = valign; + break; + } + if ((ystart < 0) || (ystart + ysize > ROWNO)) { + /* try to move the start a bit */ + ystart += (ystart > 0) ? -2 : 2; + if(ysize == ROWNO) ystart = 0; + if(ystart < 0 || ystart + ysize > ROWNO) + panic("reading special level with ysize too large"); + } + if (xsize <= 1 && ysize <= 1) { + xstart = 1; + ystart = 0; + xsize = COLNO-1; + ysize = ROWNO; + } else { + xchar x,y; + /* Load the map */ + for(y = ystart; y < ystart+ysize; y++) + for(x = xstart; x < xstart+xsize; x++) { + xchar mptyp = (mpmap->vardata.str[(y-ystart) * xsize + (x-xstart)] - 1); + if (mptyp >= MAX_TYPE) continue; + levl[x][y].typ = mptyp; + levl[x][y].lit = FALSE; + /* clear out levl: load_common_data may set them */ + levl[x][y].flags = 0; + levl[x][y].horizontal = 0; + levl[x][y].roomno = 0; + levl[x][y].edge = 0; + /* + * Set secret doors to closed (why not trapped too?). Set + * the horizontal bit. + */ + if (levl[x][y].typ == SDOOR || IS_DOOR(levl[x][y].typ)) { + if(levl[x][y].typ == SDOOR) + levl[x][y].doormask = D_CLOSED; + /* + * If there is a wall to the left that connects to a + * (secret) door, then it is horizontal. This does + * not allow (secret) doors to be corners of rooms. + */ + if (x != xstart && (IS_WALL(levl[x-1][y].typ) || + levl[x-1][y].horizontal)) + levl[x][y].horizontal = 1; + } else if(levl[x][y].typ == HWALL || + levl[x][y].typ == IRONBARS) + levl[x][y].horizontal = 1; + else if(levl[x][y].typ == LAVAPOOL) + levl[x][y].lit = 1; + } + if (coder->lvl_is_joined) + remove_rooms(xstart, ystart, xstart+xsize, ystart+ysize); + } + if (!OV_i(mpkeepr)) { + xstart = tmpxstart; ystart = tmpystart; + xsize = tmpxsize; ysize = tmpysize; + } + +skipmap: + opvar_free(mpxs); + opvar_free(mpys); + opvar_free(mpmap); + opvar_free(mpa); + opvar_free(mpkeepr); + opvar_free(mpzalign); +} + +void +spo_jmp(coder, lvl) + struct sp_coder *coder; + sp_lev *lvl; +{ + struct opvar *tmpa; + long a; + if (!OV_pop_i(tmpa)) return; + a = sp_code_jmpaddr(coder->frame->n_opcode, (OV_i(tmpa) - 1)); + if ((a >= 0) && (a < lvl->n_opcodes) && + (a != coder->frame->n_opcode)) + coder->frame->n_opcode = a; + opvar_free(tmpa); +} + +void +spo_conditional_jump(coder,lvl) + struct sp_coder *coder; + sp_lev *lvl; +{ + struct opvar *oa, *oc; + long a,c; + int test = 0; + if (!OV_pop_i(oa) || !OV_pop_i(oc)) return; + + a = sp_code_jmpaddr(coder->frame->n_opcode, (OV_i(oa) - 1)); + c = OV_i(oc); + + switch (coder->opcode) { + default: impossible("spo_conditional_jump: illegal opcode"); break; + case SPO_JL: test = (c & SP_CPUFLAG_LT); break; + case SPO_JLE: test = (c & (SP_CPUFLAG_LT|SP_CPUFLAG_EQ)); break; + case SPO_JG: test = (c & SP_CPUFLAG_GT); break; + case SPO_JGE: test = (c & (SP_CPUFLAG_GT|SP_CPUFLAG_EQ)); break; + case SPO_JE: test = (c & SP_CPUFLAG_EQ); break; + case SPO_JNE: test = (c & ~SP_CPUFLAG_EQ); break; + } + + if ((test) && (a >= 0) && + (a < lvl->n_opcodes) && + (a != coder->frame->n_opcode)) + coder->frame->n_opcode = a; + + opvar_free(oa); + opvar_free(oc); +} + + +void +spo_var_init(coder) + struct sp_coder *coder; +{ + struct opvar *vname; + struct opvar *arraylen; + struct opvar *vvalue; + struct splev_var *tmpvar; + struct splev_var *tmp2; + long idx; + + OV_pop_s(vname); + OV_pop_i(arraylen); + + if (!vname || !arraylen) + panic("no values for SPO_VAR_INIT"); + + tmpvar = opvar_var_defined(coder, OV_s(vname)); + + if (tmpvar) { + /* variable redefinition */ + if (OV_i(arraylen) < 0) { + /* copy variable */ + if (tmpvar->array_len) { + idx = tmpvar->array_len; + while (idx-- > 0) { + opvar_free(tmpvar->data.arrayvalues[idx]); + } + Free(tmpvar->data.arrayvalues); + } else { + opvar_free(tmpvar->data.value); + } + tmpvar->data.arrayvalues = NULL; + goto copy_variable; + } else if (OV_i(arraylen)) { + /* redefined array */ + idx = tmpvar->array_len; + while (idx-- > 0) { + opvar_free(tmpvar->data.arrayvalues[idx]); + } + Free(tmpvar->data.arrayvalues); + tmpvar->data.arrayvalues = NULL; + goto create_new_array; + } else { + /* redefined single value */ + OV_pop(vvalue); + if (tmpvar->svtyp != vvalue->spovartyp) panic("redefining variable as different type"); + opvar_free(tmpvar->data.value); + tmpvar->data.value = vvalue; + tmpvar->array_len = 0; + } + } else { + /* new variable definition */ + tmpvar = (struct splev_var *)malloc(sizeof(struct splev_var)); + if (!tmpvar) panic("newvar tmpvar alloc"); + tmpvar->next = coder->frame->variables; + tmpvar->name = strdup(OV_s(vname)); + coder->frame->variables = tmpvar; + + if (OV_i(arraylen) < 0) { + /* copy variable */ +copy_variable: + OV_pop(vvalue); + tmp2 = opvar_var_defined(coder, OV_s(vvalue)); + if (!tmp2) panic("no copyable var"); + tmpvar->svtyp = tmp2->svtyp; + tmpvar->array_len = tmp2->array_len; + if (tmpvar->array_len) { + idx = tmpvar->array_len; + tmpvar->data.arrayvalues = (struct opvar **)malloc(sizeof(struct opvar *) * idx); + if (!tmpvar->data.arrayvalues) panic("tmpvar->data.arrayvalues alloc"); + while (idx-- > 0) { + tmpvar->data.arrayvalues[idx] = opvar_clone(tmp2->data.arrayvalues[idx]); + } + } else { + tmpvar->data.value = opvar_clone(tmp2->data.value); + } + opvar_free(vvalue); + } else if (OV_i(arraylen)) { + /* new array */ +create_new_array: + idx = OV_i(arraylen); + tmpvar->array_len = idx; + tmpvar->data.arrayvalues = (struct opvar **)malloc(sizeof(struct opvar *) * idx); + if (!tmpvar->data.arrayvalues) panic("malloc tmpvar->data.arrayvalues"); + while (idx-- > 0) { + OV_pop(vvalue); + if (!vvalue) panic("no value for arrayvariable"); + tmpvar->data.arrayvalues[idx] = vvalue; + } + tmpvar->svtyp = SPOVAR_ARRAY; + } else { + /* new single value */ + OV_pop(vvalue); + if (!vvalue) panic("no value for variable"); + tmpvar->svtyp = OV_typ(vvalue); + tmpvar->data.value = vvalue; + tmpvar->array_len = 0; + } + } + + opvar_free(vname); + opvar_free(arraylen); +} + + +long +opvar_array_length(coder) + struct sp_coder *coder; +{ + struct opvar *vname; + struct splev_var *tmp; + long len = 0; + + if (!coder) return 0; + + vname = splev_stack_pop(coder->stack); + if (!vname) return 0; + if (vname->spovartyp != SPOVAR_VARIABLE) goto pass; + + tmp = coder->frame->variables; + while (tmp) { + if (!strcmp(tmp->name, OV_s(vname))) { + if ((tmp->svtyp & SPOVAR_ARRAY)) { + len = tmp->array_len; + if (len < 1) len = 0; + } + goto pass; + } + tmp = tmp->next; + } + +pass: + opvar_free(vname); + return len; +} + + +void +spo_shuffle_array(coder) + struct sp_coder *coder; +{ + struct opvar *vname; + struct splev_var *tmp; + struct opvar *tmp2; + long i,j; + + if (!OV_pop_s(vname)) return; + + tmp = opvar_var_defined(coder, OV_s(vname)); + if (!tmp || (tmp->array_len < 1)) { + opvar_free(vname); + return; + } + for (i = tmp->array_len - 1; i > 0; i--) { + if ((j = rn2(i + 1)) == i) continue; + tmp2 = tmp->data.arrayvalues[j]; + tmp->data.arrayvalues[j] = tmp->data.arrayvalues[i]; + tmp->data.arrayvalues[i] = tmp2; + } + + opvar_free(vname); +} + + + +/* Special level coder, creates the special level from the sp_lev codes. + * Does not free the allocated memory. + */ +STATIC_OVL boolean +sp_level_coder(lvl) +sp_lev *lvl; +{ + unsigned long exec_opcodes = 0; + int tmpi; + long room_stack = 0; + unsigned long max_execution = SPCODER_MAX_RUNTIME; + struct sp_coder *coder = (struct sp_coder *)alloc(sizeof(struct sp_coder)); + if (!coder) panic("coder alloc"); + coder->frame = frame_new(0); + coder->stack = NULL; + coder->premapped = FALSE; + /*coder->allow_flips = 3;*/ + coder->croom = NULL; + coder->n_subroom = 1; + coder->exit_script = FALSE; + coder->lvl_is_joined = 0; + + if (wizard) { + char *met = nh_getenv("SPCODER_MAX_RUNTIME"); + if (met && met[0] == '1') max_execution = (1<<30) - 1; + } + + for (tmpi = 0; tmpi <= MAX_NESTED_ROOMS; tmpi++) { + coder->tmproomlist[tmpi] = (struct mkroom *)0; + coder->failed_room[tmpi] = FALSE; + } + + shuffle_alignments(); + + for (tmpi = 0; tmpi < MAX_CONTAINMENT; tmpi++) container_obj[tmpi] = NULL; + container_idx = 0; + + invent_carrying_monster = NULL; + + (void) memset((genericptr_t)&SpLev_Map[0][0], 0, sizeof SpLev_Map); + + level.flags.is_maze_lev = 0; + + xstart = 1; + ystart = 0; + xsize = COLNO-1; + ysize = ROWNO; + + while (coder->frame->n_opcode < lvl->n_opcodes && !coder->exit_script) { + coder->opcode = lvl->opcodes[coder->frame->n_opcode].opcode; + coder->opdat = lvl->opcodes[coder->frame->n_opcode].opdat; + + coder->stack = coder->frame->stack; + + if (exec_opcodes++ > max_execution) { + impossible("Level script is taking too much time, stopping."); + coder->exit_script = TRUE; + } + + if (coder->failed_room[coder->n_subroom-1] && + coder->opcode != SPO_ENDROOM && + coder->opcode != SPO_ROOM && + coder->opcode != SPO_SUBROOM) goto next_opcode; + + coder->croom = coder->tmproomlist[coder->n_subroom-1]; + + switch (coder->opcode) { + case SPO_NULL: break; + case SPO_EXIT: coder->exit_script = TRUE; break; + case SPO_FRAME_PUSH: spo_frame_push(coder); break; + case SPO_FRAME_POP: spo_frame_pop(coder); break; + case SPO_CALL: spo_call(coder); break; + case SPO_RETURN: spo_return(coder); break; + case SPO_END_MONINVENT: spo_end_moninvent(coder); break; + case SPO_POP_CONTAINER: spo_pop_container(coder); break; + case SPO_POP: + { + struct opvar *ov = splev_stack_pop(coder->stack); + opvar_free(ov); + } + break; + case SPO_PUSH: splev_stack_push(coder->stack, opvar_clone(coder->opdat)); break; + case SPO_MESSAGE: spo_message(coder); break; + case SPO_MONSTER: spo_monster(coder); break; + case SPO_OBJECT: spo_object(coder); break; + case SPO_LEVEL_FLAGS: spo_level_flags(coder); break; + case SPO_INITLEVEL: spo_initlevel(coder); break; + /*case SPO_MON_GENERATION: spo_mon_generation(coder); break;*/ + /*case SPO_LEVEL_SOUNDS: spo_level_sounds(coder); break;*/ + case SPO_ENGRAVING: spo_engraving(coder); break; + case SPO_MINERALIZE: spo_mineralize(coder); break; + case SPO_SUBROOM: + case SPO_ROOM: + if (!coder->failed_room[coder->n_subroom-1]) { + spo_room(coder); + } else room_stack++; + break; + case SPO_ENDROOM: + if (coder->failed_room[coder->n_subroom-1]) { + if (!room_stack) + spo_endroom(coder); + else + room_stack--; + } else { + spo_endroom(coder); + } + break; + case SPO_DOOR: spo_door(coder); break; + case SPO_STAIR: spo_stair(coder); break; + case SPO_LADDER: spo_ladder(coder); break; + case SPO_GRAVE: spo_grave(coder); break; + case SPO_ALTAR: spo_altar(coder); break; + case SPO_SINK: + case SPO_POOL: + case SPO_FOUNTAIN: spo_feature(coder); break; + /*case SPO_WALLWALK: spo_wallwalk(coder); break;*/ + case SPO_TRAP: spo_trap(coder); break; + case SPO_GOLD: spo_gold(coder); break; + case SPO_CORRIDOR: spo_corridor(coder); break; + case SPO_TERRAIN: spo_terrain(coder); break; + case SPO_REPLACETERRAIN: spo_replace_terrain(coder); break; + /*case SPO_SPILL: spo_spill(coder); break;*/ + case SPO_LEVREGION: spo_levregion(coder); break; + case SPO_REGION: spo_region(coder); break; + case SPO_DRAWBRIDGE: spo_drawbridge(coder); break; + case SPO_MAZEWALK: spo_mazewalk(coder); break; + case SPO_NON_PASSWALL: + case SPO_NON_DIGGABLE: spo_wall_property(coder); break; + case SPO_ROOM_DOOR: spo_room_door(coder); break; + case SPO_WALLIFY: spo_wallify(coder); break; + case SPO_COPY: + { + struct opvar *a = splev_stack_pop(coder->stack); + splev_stack_push(coder->stack, opvar_clone(a)); + splev_stack_push(coder->stack, opvar_clone(a)); + opvar_free(a); + } + break; + case SPO_DEC: + { + struct opvar *a; + if (!OV_pop_i(a)) break; + OV_i(a)--; + splev_stack_push(coder->stack, a); + } + break; + case SPO_INC: + { + struct opvar *a; + if (!OV_pop_i(a)) break; + OV_i(a)++; + splev_stack_push(coder->stack, a); + } + break; + case SPO_MATH_SIGN: + { + struct opvar *a; + if (!OV_pop_i(a)) break; + OV_i(a) = ((OV_i(a) < 0) ? -1 : ((OV_i(a) > 0) ? 1 : 0)); + splev_stack_push(coder->stack, a); + } + break; + case SPO_MATH_ADD: + { + struct opvar *a, *b; + if (!OV_pop(b) || !OV_pop(a)) break; + if (OV_typ(b) == OV_typ(a)) { + if (OV_typ(a) == SPOVAR_INT) { + OV_i(a) = OV_i(a) + OV_i(b); + splev_stack_push(coder->stack, a); + opvar_free(b); + } else if (OV_typ(a) == SPOVAR_STRING) { + char *tmpbuf = (char *)alloc(strlen(OV_s(a)) + strlen(OV_s(b)) + 1); + if (tmpbuf) { + struct opvar *c; + (void) sprintf(tmpbuf, "%s%s", OV_s(a), OV_s(b)); + c = opvar_new_str(tmpbuf); + splev_stack_push(coder->stack, c); + opvar_free(a); + opvar_free(b); + Free(tmpbuf); + } else { + splev_stack_push(coder->stack, a); + opvar_free(b); + impossible("malloc at str concat"); + } + } else { + splev_stack_push(coder->stack, a); + opvar_free(b); + impossible("adding weird types"); + } + } else { + splev_stack_push(coder->stack, a); + opvar_free(b); + impossible("adding different types"); + } + } + break; + case SPO_MATH_SUB: + { + struct opvar *a, *b; + if (!OV_pop_i(b) || !OV_pop_i(a)) break; + OV_i(a) = OV_i(a) - OV_i(b); + splev_stack_push(coder->stack, a); + opvar_free(b); + } + break; + case SPO_MATH_MUL: + { + struct opvar *a, *b; + if (!OV_pop_i(b) || !OV_pop_i(a)) break; + OV_i(a) = OV_i(a) * OV_i(b); + splev_stack_push(coder->stack, a); + opvar_free(b); + } + break; + case SPO_MATH_DIV: + { + struct opvar *a, *b; + if (!OV_pop_i(b) || !OV_pop_i(a)) break; + if (OV_i(b) >= 1) { + OV_i(a) = OV_i(a) / OV_i(b); + } else { + OV_i(a) = 0; + } + splev_stack_push(coder->stack, a); + opvar_free(b); + } + break; + case SPO_MATH_MOD: + { + struct opvar *a, *b; + if (!OV_pop_i(b) || !OV_pop_i(a)) break; + if (OV_i(b) > 0) { + OV_i(a) = OV_i(a) % OV_i(b); + } else { + OV_i(a) = 0; + } + splev_stack_push(coder->stack, a); + opvar_free(b); + } + break; + case SPO_CMP: + { + struct opvar *a; + struct opvar *b; + struct opvar *c; + long val = 0; + + OV_pop(b); + OV_pop(a); + + if (!a || !b) { + impossible("spo_cmp: no values in stack"); + break; + } + + if (OV_typ(a) != OV_typ(b)) { + impossible("spo_cmp: trying to compare differing datatypes"); + break; + } + + switch (OV_typ(a)) { + case SPOVAR_COORD: + case SPOVAR_REGION: + case SPOVAR_MAPCHAR: + case SPOVAR_MONST: + case SPOVAR_OBJ: + case SPOVAR_INT: + if (OV_i(b) > OV_i(a)) val |= SP_CPUFLAG_LT; + if (OV_i(b) < OV_i(a)) val |= SP_CPUFLAG_GT; + if (OV_i(b) == OV_i(a)) val |= SP_CPUFLAG_EQ; + c = opvar_new_int(val); + break; + case SPOVAR_STRING: + c = opvar_new_int(((!strcmp(OV_s(b), OV_s(a))) ? SP_CPUFLAG_EQ : 0)); + break; + default: + c = opvar_new_int(0); + break; + } + splev_stack_push(coder->stack, c); + opvar_free(a); + opvar_free(b); + } + break; + case SPO_JMP: + spo_jmp(coder, lvl); break; + case SPO_JL: + case SPO_JLE: + case SPO_JG: + case SPO_JGE: + case SPO_JE: + case SPO_JNE: + spo_conditional_jump(coder, lvl); break; + case SPO_RN2: + { + struct opvar *tmpv; + struct opvar *t; + if (!OV_pop_i(tmpv)) break; + t = opvar_new_int((OV_i(tmpv) > 1) ? rn2(OV_i(tmpv)) : 0); + splev_stack_push(coder->stack, t); + opvar_free(tmpv); + } + break; + /* + case SPO_COREFUNC: + { + struct opvar *a; + if (!OV_pop_i(a)) break; + spo_corefunc(coder, OV_i(a)); + } + break; + */ + case SPO_DICE: + { + struct opvar *a, *b, *t; + if (!OV_pop_i(b) || !OV_pop_i(a)) break; + if (OV_i(b) < 1) OV_i(b) = 1; + if (OV_i(a) < 1) OV_i(a) = 1; + t = opvar_new_int(d(OV_i(a), OV_i(b))); + splev_stack_push(coder->stack, t); + opvar_free(a); + opvar_free(b); + } + break; + case SPO_MAP: + spo_map(coder); break; + case SPO_VAR_INIT: + spo_var_init(coder); break; + case SPO_SHUFFLE_ARRAY: + spo_shuffle_array(coder); break; + case SPO_SEL_ADD: /* actually, logical or */ + { + struct opvar *sel1, *sel2, *pt; + if (!OV_pop_typ(sel1, SPOVAR_SEL)) panic("no sel1 for add"); + if (!OV_pop_typ(sel2, SPOVAR_SEL)) panic("no sel1 for add"); + pt = selection_logical_oper(sel1, sel2, '|'); + opvar_free(sel1); + opvar_free(sel2); + splev_stack_push(coder->stack, pt); + } + break; + case SPO_SEL_COMPLEMENT: + { + struct opvar *sel, *pt; + if (!OV_pop_typ(sel, SPOVAR_SEL)) panic("no sel for not"); + pt = selection_not(sel); + opvar_free(sel); + splev_stack_push(coder->stack, pt); + } + break; + case SPO_SEL_FILTER: /* sorta like logical and */ + { + struct opvar *filtertype; + if (!OV_pop_i(filtertype)) panic("no sel filter type"); + switch (OV_i(filtertype)) { + case SPOFILTER_PERCENT: + { + struct opvar *tmp1, *sel; + if (!OV_pop_i(tmp1)) panic("no sel filter percent"); + if (!OV_pop_typ(sel, SPOVAR_SEL)) panic("no sel filter"); + selection_filter_percent(sel, OV_i(tmp1)); + splev_stack_push(coder->stack, sel); + opvar_free(tmp1); + } + break; + case SPOFILTER_SELECTION: /* logical and */ + { + struct opvar *pt, *sel1, *sel2; + if (!OV_pop_typ(sel1, SPOVAR_SEL)) panic("no sel filter sel1"); + if (!OV_pop_typ(sel2, SPOVAR_SEL)) panic("no sel filter sel2"); + pt = selection_logical_oper(sel1, sel2, '&'); + splev_stack_push(coder->stack, pt); + opvar_free(sel1); + opvar_free(sel2); + } + break; + case SPOFILTER_MAPCHAR: + { + struct opvar *pt, *tmp1, *sel; + if (!OV_pop_typ(sel, SPOVAR_SEL)) panic("no sel filter"); + if (!OV_pop_typ(tmp1, SPOVAR_MAPCHAR)) panic("no sel filter mapchar"); + pt = selection_filter_mapchar(sel, tmp1); + splev_stack_push(coder->stack, pt); + opvar_free(tmp1); + opvar_free(sel); + } + break; + default: panic("unknown sel filter type"); + } + opvar_free(filtertype); + } + break; + case SPO_SEL_POINT: + { + struct opvar *tmp; + struct opvar *pt = selection_opvar(NULL); + schar x,y; + if (!OV_pop_c(tmp)) panic("no ter sel coord"); + get_location_coord(&x, &y, ANY_LOC, coder->croom, OV_i(tmp)); + selection_setpoint(x,y, pt, 1); + splev_stack_push(coder->stack, pt); + opvar_free(tmp); + } + break; + case SPO_SEL_RECT: + case SPO_SEL_FILLRECT: + { + struct opvar *tmp, *pt = selection_opvar(NULL); + schar x,y,x1,y1,x2,y2; + if (!OV_pop_r(tmp)) panic("no ter sel region"); + x1 = min(SP_REGION_X1(OV_i(tmp)), SP_REGION_X2(OV_i(tmp))); + y1 = min(SP_REGION_Y1(OV_i(tmp)), SP_REGION_Y2(OV_i(tmp))); + x2 = max(SP_REGION_X1(OV_i(tmp)), SP_REGION_X2(OV_i(tmp))); + y2 = max(SP_REGION_Y1(OV_i(tmp)), SP_REGION_Y2(OV_i(tmp))); + get_location(&x1, &y1, ANY_LOC, coder->croom); + get_location(&x2, &y2, ANY_LOC, coder->croom); + x1 = (x1 < 0) ? 0 : x1; + y1 = (y1 < 0) ? 0 : y1; + x2 = (x2 >= COLNO) ? COLNO-1 : x2; + y2 = (y2 >= ROWNO) ? ROWNO-1 : y2; + if (coder->opcode == SPO_SEL_RECT) { + for (x = x1; x <= x2; x++) { + selection_setpoint(x,y1, pt, 1); + selection_setpoint(x,y2, pt, 1); + } + for (y = y1; y <= y2; y++) { + selection_setpoint(x1,y, pt, 1); + selection_setpoint(x2,y, pt, 1); + } + } else { + for (x = x1; x <= x2; x++) + for (y = y1; y <= y2; y++) + selection_setpoint(x,y, pt, 1); + } + splev_stack_push(coder->stack, pt); + opvar_free(tmp); + } + break; + case SPO_SEL_LINE: + { + struct opvar *tmp, *tmp2, *pt = selection_opvar(NULL); + schar x1,y1,x2,y2; + if (!OV_pop_c(tmp) || !OV_pop_c(tmp2)) panic("no ter sel linecoord"); + get_location_coord(&x1, &y1, ANY_LOC, coder->croom, OV_i(tmp)); + get_location_coord(&x2, &y2, ANY_LOC, coder->croom, OV_i(tmp2)); + x1 = (x1 < 0) ? 0 : x1; + y1 = (y1 < 0) ? 0 : y1; + x2 = (x2 >= COLNO) ? COLNO-1 : x2; + y2 = (y2 >= ROWNO) ? ROWNO-1 : y2; + selection_do_line(x1,y1,x2,y2, pt); + splev_stack_push(coder->stack, pt); + opvar_free(tmp); + opvar_free(tmp2); + } + break; + case SPO_SEL_RNDLINE: + { + struct opvar *tmp, *tmp2, *tmp3, *pt = selection_opvar(NULL); + schar x1,y1,x2,y2; + if (!OV_pop_i(tmp3) || !OV_pop_c(tmp) || !OV_pop_c(tmp2)) panic("no ter sel randline"); + get_location_coord(&x1, &y1, ANY_LOC, coder->croom, OV_i(tmp)); + get_location_coord(&x2, &y2, ANY_LOC, coder->croom, OV_i(tmp2)); + x1 = (x1 < 0) ? 0 : x1; + y1 = (y1 < 0) ? 0 : y1; + x2 = (x2 >= COLNO) ? COLNO-1 : x2; + y2 = (y2 >= ROWNO) ? ROWNO-1 : y2; + selection_do_randline(x1,y1,x2,y2, OV_i(tmp3), 12, pt); + splev_stack_push(coder->stack, pt); + opvar_free(tmp); + opvar_free(tmp2); + opvar_free(tmp3); + } + break; + case SPO_SEL_GROW: + { + struct opvar *dirs, *pt; + if (!OV_pop_i(dirs)) panic("no dirs for grow"); + if (!OV_pop_typ(pt, SPOVAR_SEL)) panic("no selection for grow"); + selection_do_grow(pt, OV_i(dirs)); + splev_stack_push(coder->stack, pt); + opvar_free(dirs); + } + break; + case SPO_SEL_FLOOD: + { + struct opvar *tmp; + schar x,y; + if (!OV_pop_c(tmp)) panic("no ter sel flood coord"); + get_location_coord(&x, &y, ANY_LOC, coder->croom, OV_i(tmp)); + if (isok(x,y)) { + struct opvar *pt = selection_opvar(NULL); + selection_floodfill(pt, x,y); + splev_stack_push(coder->stack, pt); + } + opvar_free(tmp); + } + break; + case SPO_SEL_RNDCOORD: + { + struct opvar *pt; + schar x,y; + if (!OV_pop_typ(pt, SPOVAR_SEL)) panic("no selection for rndcoord"); + if (selection_rndcoord(pt, &x, &y)) { + x -= xstart; + y -= ystart; + } + /*get_location(&x, &y, DRY|WET, coder->croom);*/ + splev_stack_push(coder->stack, opvar_new_coord(x,y)); + opvar_free(pt); + } + break; + case SPO_SEL_ELLIPSE: + { + struct opvar *filled, *xaxis, *yaxis, *pt; + struct opvar *sel = selection_opvar(NULL); + schar x,y; + if (!OV_pop_i(filled)) panic("no filled for ellipse"); + if (!OV_pop_i(yaxis)) panic("no yaxis for ellipse"); + if (!OV_pop_i(xaxis)) panic("no xaxis for ellipse"); + if (!OV_pop_c(pt)) panic("no pt for ellipse"); + get_location_coord(&x, &y, ANY_LOC, coder->croom, OV_i(pt)); + selection_do_ellipse(sel, x,y, OV_i(xaxis), OV_i(yaxis), OV_i(filled)); + splev_stack_push(coder->stack, sel); + opvar_free(filled); + opvar_free(yaxis); + opvar_free(xaxis); + opvar_free(pt); + } + break; + case SPO_SEL_GRADIENT: + { + struct opvar *gtyp, *glim, *mind, *maxd, *coord, *coord2; + struct opvar *sel; + schar x,y, x2,y2; + if (!OV_pop_i(gtyp)) panic("no gtyp for grad"); + if (!OV_pop_i(glim)) panic("no glim for grad"); + if (!OV_pop_c(coord2)) panic("no coord2 for grad"); + if (!OV_pop_c(coord)) panic("no coord for grad"); + if (!OV_pop_i(maxd)) panic("no maxd for grad"); + if (!OV_pop_i(mind)) panic("no mind for grad"); + get_location_coord(&x, &y, ANY_LOC, coder->croom, OV_i(coord)); + get_location_coord(&x2, &y2, ANY_LOC, coder->croom, OV_i(coord2)); + + sel = selection_opvar(NULL); + selection_do_gradient(sel, x,y, x2,y2, OV_i(gtyp), OV_i(mind), OV_i(maxd), OV_i(glim)); + splev_stack_push(coder->stack, sel); + + opvar_free(gtyp); + opvar_free(glim); + opvar_free(coord); + opvar_free(coord2); + opvar_free(maxd); + opvar_free(mind); + } + break; + default: + panic("sp_level_coder: Unknown opcode %i", coder->opcode); + } + +next_opcode: + coder->frame->n_opcode++; + } /*while*/ + + fill_rooms(); + remove_boundary_syms(); + wallification(1, 0, COLNO-1, ROWNO-1); + + /*flip_level_rnd(coder->allow_flips);*/ + + count_features(); + + if (coder->premapped) sokoban_detect(); + + if (coder->frame) { + struct sp_frame *tmpframe; + do { + tmpframe = coder->frame->next; + frame_del(coder->frame); + coder->frame = tmpframe; + } while (coder->frame); } return TRUE; @@ -2716,32 +5075,28 @@ load_special(name) const char *name; { dlb *fd; + sp_lev *lvl = NULL; boolean result = FALSE; - char c; struct version_info vers_info; fd = dlb_fopen(name, RDBMODE); if (!fd) return FALSE; - Fread((genericptr_t) &vers_info, sizeof vers_info, 1, fd); - if (!check_version(&vers_info, name, TRUE)) + if (!check_version(&vers_info, name, TRUE)) { + (void)dlb_fclose(fd); goto give_up; - - Fread((genericptr_t) &c, sizeof c, 1, fd); /* c Header */ - - switch (c) { - case SP_LEV_ROOMS: - result = load_rooms(fd); - break; - case SP_LEV_MAZE: - result = load_maze(fd); - break; - default: /* ??? */ - result = FALSE; } - give_up: + lvl = (sp_lev *)alloc(sizeof(sp_lev)); + if (!lvl) panic("alloc sp_lev"); + result = sp_level_loader(fd, lvl); (void)dlb_fclose(fd); + if (result) result = sp_level_coder(lvl); + sp_level_free(lvl); + Free(lvl); + + give_up: return result; } + /*sp_lev.c*/ diff --git a/src/trap.c b/src/trap.c index 36c1ee632..8fa07cbe4 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3535,7 +3535,7 @@ boolean bury_it; place_object(otmp, ttmp->tx, ttmp->ty); if (bury_it) { /* magical digging first disarms this trap, then will unearth it */ - (void) bury_an_obj(otmp); + (void) bury_an_obj(otmp, NULL); } else { /* Sell your own traps only... */ if (ttmp->madeby_u) sellobj(otmp, ttmp->tx, ttmp->ty); diff --git a/util/lev_comp.l b/util/lev_comp.l index 2b0ad5188..02ca2d4ee 100644 --- a/util/lev_comp.l +++ b/util/lev_comp.l @@ -66,16 +66,36 @@ int FDECL(yyoutput, (int)); void FDECL(init_yyin, (FILE *)); void FDECL(init_yyout, (FILE *)); +long NDECL(handle_varstring_check); +long FDECL(corefunc_str_check, (char *, long)); + +extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); + +extern struct lc_vardefs *variable_definitions; + +extern long FDECL(method_defined, (char *, long, long *)); + +void FDECL(savetoken, (char *)); +void NDECL(newline); +void FDECL(advancepos, (char *)); + /* * This doesn't always get put in lev_comp.h * (esp. when using older versions of bison). */ extern YYSTYPE yylval; -int nh_line_number = 1, colon_line_number = 1; +int nh_line_number = 1; +int token_start_pos = 0; +char curr_token[512]; static char map[4096]; static int map_cnt = 0; +FILE *orig_yyin = NULL; + +#define ST_RET(x) do { savetoken(yytext); return x; } while (0); +#define ST_RETF(y, x) do { savetoken(yytext); y; return x; } while (0); + %} %e 1500 %p 5000 @@ -83,6 +103,7 @@ static int map_cnt = 0; %s MAPC %% ENDMAP { + savetoken(yytext); BEGIN(INITIAL); yylval.map = (char *) alloc(map_cnt + 1); (void) strncpy(yylval.map, map, map_cnt); @@ -90,129 +111,229 @@ static int map_cnt = 0; map_cnt = 0; return MAP_ID; } -[-|}{+ABCISHKPLWTF\\#. 0123456789]*\r?\n { +[-|}{+xABCISHKMPLWTtFYU\\#. 0123456789]*\r?\n { int len = yyleng; + savetoken(yytext); /* convert \r\n to \n */ if (len >= 2 && yytext[len - 2] == '\r') len -= 1; - nh_line_number++; (void) strncpy(map + map_cnt, yytext, len); map_cnt += len; map[map_cnt - 1] = '\n'; map[map_cnt] = '\0'; + newline(); } -^#.*\n { nh_line_number++; } -: { colon_line_number = nh_line_number; return ':'; } -MESSAGE return MESSAGE_ID; -MAZE return MAZE_ID; -NOMAP return NOMAP_ID; -LEVEL return LEVEL_ID; -INIT_MAP return LEV_INIT_ID; -FLAGS return FLAGS_ID; -GEOMETRY return GEOMETRY_ID; -^MAP\r?\n { BEGIN(MAPC); nh_line_number++; } -OBJECT return OBJECT_ID; -CONTAINER return COBJECT_ID; -MONSTER return MONSTER_ID; -TRAP return TRAP_ID; -DOOR return DOOR_ID; -DRAWBRIDGE return DRAWBRIDGE_ID; -MAZEWALK return MAZEWALK_ID; -WALLIFY return WALLIFY_ID; -REGION return REGION_ID; -RANDOM_OBJECTS return RANDOM_OBJECTS_ID; -RANDOM_MONSTERS return RANDOM_MONSTERS_ID; -RANDOM_PLACES return RANDOM_PLACES_ID; -ALTAR return ALTAR_ID; -LADDER return LADDER_ID; -STAIR return STAIR_ID; -PORTAL return PORTAL_ID; -TELEPORT_REGION return TELEPRT_ID; -BRANCH return BRANCH_ID; -FOUNTAIN return FOUNTAIN_ID; -SINK return SINK_ID; -POOL return POOL_ID; -NON_DIGGABLE return NON_DIGGABLE_ID; -NON_PASSWALL return NON_PASSWALL_ID; -ROOM return ROOM_ID; -SUBROOM return SUBROOM_ID; -RANDOM_CORRIDORS return RAND_CORRIDOR_ID; -CORRIDOR return CORRIDOR_ID; -GOLD return GOLD_ID; -ENGRAVING return ENGRAVING_ID; -NAME return NAME_ID; -CHANCE return CHANCE_ID; -levregion return LEV; -open { yylval.i=D_ISOPEN; return DOOR_STATE; } -closed { yylval.i=D_CLOSED; return DOOR_STATE; } -locked { yylval.i=D_LOCKED; return DOOR_STATE; } -nodoor { yylval.i=D_NODOOR; return DOOR_STATE; } -broken { yylval.i=D_BROKEN; return DOOR_STATE; } -north { yylval.i=W_NORTH; return DIRECTION; } -east { yylval.i=W_EAST; return DIRECTION; } -south { yylval.i=W_SOUTH; return DIRECTION; } -west { yylval.i=W_WEST; return DIRECTION; } -random { yylval.i = -1; return RANDOM_TYPE; } -none { yylval.i = -2; return NONE; } -object return O_REGISTER; -monster return M_REGISTER; -place return P_REGISTER; -align return A_REGISTER; -left { yylval.i=1; return LEFT_OR_RIGHT; } -half-left { yylval.i=2; return LEFT_OR_RIGHT; } -center { yylval.i=3; return CENTER; } -half-right { yylval.i=4; return LEFT_OR_RIGHT; } -right { yylval.i=5; return LEFT_OR_RIGHT; } -top { yylval.i=1; return TOP_OR_BOT; } -bottom { yylval.i=5; return TOP_OR_BOT; } -lit { yylval.i=1; return LIGHT_STATE; } -unlit { yylval.i=0; return LIGHT_STATE; } -filled { yylval.i=0; return FILLING; } -unfilled { yylval.i=1; return FILLING; } -noalign { yylval.i= AM_NONE; return ALIGNMENT; } -law { yylval.i= AM_LAWFUL; return ALIGNMENT; } -neutral { yylval.i= AM_NEUTRAL; return ALIGNMENT; } -chaos { yylval.i= AM_CHAOTIC; return ALIGNMENT; } -coaligned { yylval.i= AM_SPLEV_CO; return ALIGNMENT; } -noncoaligned { yylval.i= AM_SPLEV_NONCO; return ALIGNMENT; } -peaceful { yylval.i=1; return MON_ATTITUDE; } -hostile { yylval.i=0; return MON_ATTITUDE; } -asleep { yylval.i=1; return MON_ALERTNESS; } -awake { yylval.i=0; return MON_ALERTNESS; } -m_feature { yylval.i= M_AP_FURNITURE; return MON_APPEARANCE; } -m_monster { yylval.i= M_AP_MONSTER; return MON_APPEARANCE; } -m_object { yylval.i= M_AP_OBJECT; return MON_APPEARANCE; } -sanctum { yylval.i=2; return ALTAR_TYPE; } -shrine { yylval.i=1; return ALTAR_TYPE; } -altar { yylval.i=0; return ALTAR_TYPE; } -up { yylval.i=1; return UP_OR_DOWN; } -down { yylval.i=0; return UP_OR_DOWN; } -false { yylval.i=0; return BOOLEAN; } -true { yylval.i=1; return BOOLEAN; } -dust { yylval.i=DUST; return ENGRAVING_TYPE; } -engrave { yylval.i=ENGRAVE; return ENGRAVING_TYPE; } -burn { yylval.i=BURN; return ENGRAVING_TYPE; } -mark { yylval.i=MARK; return ENGRAVING_TYPE; } -blood { yylval.i=ENGR_BLOOD; return ENGRAVING_TYPE; } -blessed { yylval.i=1; return CURSE_TYPE; } -uncursed { yylval.i=2; return CURSE_TYPE; } -cursed { yylval.i=3; return CURSE_TYPE; } -contained { return CONTAINED; } -noteleport { yylval.i=NOTELEPORT; return FLAG_TYPE; } -hardfloor { yylval.i=HARDFLOOR; return FLAG_TYPE; } -nommap { yylval.i=NOMMAP; return FLAG_TYPE; } -arboreal { yylval.i=ARBOREAL; return FLAG_TYPE; } /* KMH */ -shortsighted { yylval.i=SHORTSIGHTED; return FLAG_TYPE; } -\[\ *[0-9]+\%\ *\] { yylval.i = atoi(yytext + 1); return PERCENT; } -[+\-]?[0-9]+ { yylval.i=atoi(yytext); return INTEGER; } -\"[^"]*\" { yytext[yyleng-1] = 0; /* Discard the trailing \" */ +^[ \t]*#.*\n { savetoken(yytext); newline(); } +MESSAGE ST_RET(MESSAGE_ID); +NOMAP ST_RET(NOMAP_ID); +MAZE ST_RET(MAZE_ID); +LEVEL ST_RET(LEVEL_ID); +INIT_MAP ST_RET(LEV_INIT_ID); +mazegrid ST_RET(MAZE_GRID_ID); +solidfill ST_RET(SOLID_FILL_ID); +mines ST_RET(MINES_ID); +rogue ST_RET(ROGUELEV_ID); +FLAGS ST_RET(FLAGS_ID); +GEOMETRY ST_RET(GEOMETRY_ID); +^MAP\r?\n { savetoken(yytext); BEGIN(MAPC); newline(); } +obj(ect)? ST_RET(object_ID); +OBJECT ST_RET(OBJECT_ID); +CONTAINER ST_RET(COBJECT_ID); +MONSTER ST_RET(MONSTER_ID); +monster ST_RET(monster_ID); +TRAP ST_RET(TRAP_ID); +DOOR ST_RET(DOOR_ID); +ROOMDOOR ST_RET(ROOMDOOR_ID); +DRAWBRIDGE ST_RET(DRAWBRIDGE_ID); +MAZEWALK ST_RET(MAZEWALK_ID); +WALLIFY ST_RET(WALLIFY_ID); +REGION ST_RET(REGION_ID); +ALTAR ST_RET(ALTAR_ID); +LADDER ST_RET(LADDER_ID); +STAIR ST_RET(STAIR_ID); +PORTAL ST_RET(PORTAL_ID); +TELEPORT_REGION ST_RET(TELEPRT_ID); +BRANCH ST_RET(BRANCH_ID); +FOUNTAIN ST_RET(FOUNTAIN_ID); +SINK ST_RET(SINK_ID); +POOL ST_RET(POOL_ID); +NON_DIGGABLE ST_RET(NON_DIGGABLE_ID); +NON_PASSWALL ST_RET(NON_PASSWALL_ID); +IF ST_RET(IF_ID); +ELSE ST_RET(ELSE_ID); +EXIT ST_RET(EXIT_ID); +ROOM ST_RET(ROOM_ID); +SUBROOM ST_RET(SUBROOM_ID); +RANDOM_CORRIDORS ST_RET(RAND_CORRIDOR_ID); +CORRIDOR ST_RET(CORRIDOR_ID); +TERRAIN ST_RET(TERRAIN_ID); +terrain ST_RET(terrain_ID); +REPLACE_TERRAIN ST_RET(REPLACE_TERRAIN_ID); +GOLD ST_RET(GOLD_ID); +GRAVE ST_RET(GRAVE_ID); +ENGRAVING ST_RET(ENGRAVING_ID); +MINERALIZE ST_RET(MINERALIZE_ID); +(NAME|name) ST_RET(NAME_ID); +FOR ST_RET(FOR_ID); +TO ST_RET(TO_ID); +LOOP ST_RET(LOOP_ID); +SWITCH ST_RET(SWITCH_ID); +CASE ST_RET(CASE_ID); +BREAK ST_RET(BREAK_ID); +DEFAULT ST_RET(DEFAULT_ID); +FUNCTION ST_RET(FUNCTION_ID); +SHUFFLE ST_RET(SHUFFLE_ID); +montype ST_RET(MONTYPE_ID); +selection ST_RET(selection_ID); +rect ST_RET(rect_ID); +fillrect ST_RET(fillrect_ID); +line ST_RET(line_ID); +randline ST_RET(randline_ID); +grow ST_RET(grow_ID); +floodfill ST_RET(flood_ID); +rndcoord ST_RET(rndcoord_ID); +circle ST_RET(circle_ID); +ellipse ST_RET(ellipse_ID); +filter ST_RET(filter_ID); +gradient ST_RET(gradient_ID); +complement ST_RET(complement_ID); +radial { savetoken(yytext); yylval.i=SEL_GRADIENT_RADIAL; return GRADIENT_TYPE; } +square { savetoken(yytext); yylval.i=SEL_GRADIENT_SQUARE; return GRADIENT_TYPE; } +dry { savetoken(yytext); yylval.i=DRY; return HUMIDITY_TYPE; } +wet { savetoken(yytext); yylval.i=WET; return HUMIDITY_TYPE; } +hot { savetoken(yytext); yylval.i=HOT; return HUMIDITY_TYPE; } +solid { savetoken(yytext); yylval.i=SOLID; return HUMIDITY_TYPE; } +any { savetoken(yytext); yylval.i=ANY_LOC; return HUMIDITY_TYPE; } +levregion ST_RET(LEV); +quantity ST_RET(QUANTITY_ID); +buried ST_RET(BURIED_ID); +eroded ST_RET(ERODED_ID); +erodeproof ST_RET(ERODEPROOF_ID); +trapped ST_RET(TRAPPED_ID); +recharged ST_RET(RECHARGED_ID); +invisible ST_RET(INVIS_ID); +greased ST_RET(GREASED_ID); +female ST_RET(FEMALE_ID); +cancelled ST_RET(CANCELLED_ID); +revived ST_RET(REVIVED_ID); +avenge ST_RET(AVENGE_ID); +fleeing ST_RET(FLEEING_ID); +blinded ST_RET(BLINDED_ID); +paralyzed ST_RET(PARALYZED_ID); +stunned ST_RET(STUNNED_ID); +confused ST_RET(CONFUSED_ID); +seen_traps ST_RET(SEENTRAPS_ID); +all ST_RET(ALL_ID); +horizontal ST_RETF((yylval.i=1), HORIZ_OR_VERT); +vertical { savetoken(yytext); yylval.i=2; return HORIZ_OR_VERT; } +open { savetoken(yytext); yylval.i=D_ISOPEN; return DOOR_STATE; } +closed { savetoken(yytext); yylval.i=D_CLOSED; return DOOR_STATE; } +locked { savetoken(yytext); yylval.i=D_LOCKED; return DOOR_STATE; } +nodoor { savetoken(yytext); yylval.i=D_NODOOR; return DOOR_STATE; } +broken { savetoken(yytext); yylval.i=D_BROKEN; return DOOR_STATE; } +secret { savetoken(yytext); yylval.i=D_SECRET; return DOOR_STATE; } +north { savetoken(yytext); yylval.i=W_NORTH; return DIRECTION; } +east { savetoken(yytext); yylval.i=W_EAST; return DIRECTION; } +south { savetoken(yytext); yylval.i=W_SOUTH; return DIRECTION; } +west { savetoken(yytext); yylval.i=W_WEST; return DIRECTION; } +random { savetoken(yytext); yylval.i = -1; return RANDOM_TYPE; } +random\[ { savetoken(yytext); yylval.i = -1; return RANDOM_TYPE_BRACKET; } +none { savetoken(yytext); yylval.i = -2; return NONE; } +align ST_RET(A_REGISTER); +left { savetoken(yytext); yylval.i=1; return LEFT_OR_RIGHT; } +half-left { savetoken(yytext); yylval.i=2; return LEFT_OR_RIGHT; } +center { savetoken(yytext); yylval.i=3; return CENTER; } +half-right { savetoken(yytext); yylval.i=4; return LEFT_OR_RIGHT; } +right { savetoken(yytext); yylval.i=5; return LEFT_OR_RIGHT; } +top { savetoken(yytext); yylval.i=1; return TOP_OR_BOT; } +bottom { savetoken(yytext); yylval.i=5; return TOP_OR_BOT; } +lit { savetoken(yytext); yylval.i=1; return LIGHT_STATE; } +unlit { savetoken(yytext); yylval.i=0; return LIGHT_STATE; } +filled { savetoken(yytext); yylval.i=1; return FILLING; } +unfilled { savetoken(yytext); yylval.i=0; return FILLING; } +regular { savetoken(yytext); yylval.i=0; return IRREGULAR; } +irregular { savetoken(yytext); yylval.i=1; return IRREGULAR; } +unjoined { savetoken(yytext); yylval.i=1; return JOINED; } +joined { savetoken(yytext); yylval.i=0; return JOINED; } +limited { savetoken(yytext); yylval.i=1; return LIMITED; } +unlimited { savetoken(yytext); yylval.i=0; return LIMITED; } +noalign { savetoken(yytext); yylval.i= AM_NONE; return ALIGNMENT; } +law { savetoken(yytext); yylval.i= AM_LAWFUL; return ALIGNMENT; } +neutral { savetoken(yytext); yylval.i= AM_NEUTRAL; return ALIGNMENT; } +chaos { savetoken(yytext); yylval.i= AM_CHAOTIC; return ALIGNMENT; } +coaligned { savetoken(yytext); yylval.i= AM_SPLEV_CO; return ALIGNMENT; } +noncoaligned { savetoken(yytext); yylval.i= AM_SPLEV_NONCO; return ALIGNMENT; } +peaceful { savetoken(yytext); yylval.i=1; return MON_ATTITUDE; } +hostile { savetoken(yytext); yylval.i=0; return MON_ATTITUDE; } +asleep { savetoken(yytext); yylval.i=1; return MON_ALERTNESS; } +awake { savetoken(yytext); yylval.i=0; return MON_ALERTNESS; } +m_feature { savetoken(yytext); yylval.i= M_AP_FURNITURE; return MON_APPEARANCE; } +m_monster { savetoken(yytext); yylval.i= M_AP_MONSTER; return MON_APPEARANCE; } +m_object { savetoken(yytext); yylval.i= M_AP_OBJECT; return MON_APPEARANCE; } +sanctum { savetoken(yytext); yylval.i=2; return ALTAR_TYPE; } +shrine { savetoken(yytext); yylval.i=1; return ALTAR_TYPE; } +altar { savetoken(yytext); yylval.i=0; return ALTAR_TYPE; } +up { savetoken(yytext); yylval.i=1; return UP_OR_DOWN; } +down { savetoken(yytext); yylval.i=0; return UP_OR_DOWN; } +false { savetoken(yytext); yylval.i=0; return BOOLEAN; } +true { savetoken(yytext); yylval.i=1; return BOOLEAN; } +dust { savetoken(yytext); yylval.i=DUST; return ENGRAVING_TYPE; } +engrave { savetoken(yytext); yylval.i=ENGRAVE; return ENGRAVING_TYPE; } +burn { savetoken(yytext); yylval.i=BURN; return ENGRAVING_TYPE; } +mark { savetoken(yytext); yylval.i=MARK; return ENGRAVING_TYPE; } +blood { savetoken(yytext); yylval.i=ENGR_BLOOD; return ENGRAVING_TYPE; } +blessed { savetoken(yytext); yylval.i=1; return CURSE_TYPE; } +uncursed { savetoken(yytext); yylval.i=2; return CURSE_TYPE; } +cursed { savetoken(yytext); yylval.i=3; return CURSE_TYPE; } +noteleport { savetoken(yytext); yylval.i=NOTELEPORT; return FLAG_TYPE; } +hardfloor { savetoken(yytext); yylval.i=HARDFLOOR; return FLAG_TYPE; } +nommap { savetoken(yytext); yylval.i=NOMMAP; return FLAG_TYPE; } +arboreal { savetoken(yytext); yylval.i=ARBOREAL; return FLAG_TYPE; } /* KMH */ +shortsighted { savetoken(yytext); yylval.i=SHORTSIGHTED; return FLAG_TYPE; } +mazelevel { savetoken(yytext); yylval.i=MAZELEVEL; return FLAG_TYPE; } +premapped { savetoken(yytext); yylval.i=PREMAPPED; return FLAG_TYPE; } +shroud { savetoken(yytext); yylval.i=SHROUD; return FLAG_TYPE; } +stormy { savetoken(yytext); yylval.i=STORMY; return FLAG_TYPE; } +graveyard { savetoken(yytext); yylval.i=GRAVEYARD; return FLAG_TYPE; } +[0-9]+d[0-9]+ { char *p = strchr(yytext, 'd'); + savetoken(yytext); + if (p) { + *p = '\0'; + p++; + yylval.dice.num=atoi(yytext); + yylval.dice.die=atoi(p); + } else { yylval.dice.num = yylval.dice.die = 1; } + return DICE; + } +\[\ *[0-9]+\%\ *\] { savetoken(yytext); yylval.i = atoi(yytext + 1); + if (yylval.i < 0 || yylval.i > 100) + lc_error("Unexpected percentile '%li%%'", yylval.i); + return PERCENT; } +-[0-9]+ { savetoken(yytext); yylval.i=atoi(yytext); return MINUS_INTEGER; } +\+[0-9]+ { savetoken(yytext); yylval.i=atoi(yytext); return PLUS_INTEGER; } +[0-9]+\% { savetoken(yytext); yylval.i = atoi(yytext); + if (yylval.i < 0 || yylval.i > 100) + lc_error("Unexpected percentile '%li%%'", yylval.i); + return SPERCENT; } +[0-9]+ { savetoken(yytext); yylval.i=atoi(yytext); return INTEGER; } +\"[^"]*\" { savetoken(yytext); + yytext[yyleng-1] = 0; /* Discard the trailing \" */ yylval.map = (char *) alloc(strlen(yytext+1)+1); Strcpy(yylval.map, yytext+1); /* Discard the first \" */ return STRING; } -\r?\n { nh_line_number++; } -[ \t]+ ; -'\\.' { yylval.i = yytext[2]; return CHAR; } -'.' { yylval.i = yytext[1]; return CHAR; } -. { return yytext[0]; } +\$[a-zA-Z_]+ { savetoken(yytext); return handle_varstring_check(); } +"==" { savetoken(yytext); yylval.i = SPO_JE; return COMPARE_TYPE; } +"!=" { savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } +"<>" { savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } +"<=" { savetoken(yytext); yylval.i = SPO_JLE; return COMPARE_TYPE; } +">=" { savetoken(yytext); yylval.i = SPO_JGE; return COMPARE_TYPE; } +"<" { savetoken(yytext); yylval.i = SPO_JL; return COMPARE_TYPE; } +">" { savetoken(yytext); yylval.i = SPO_JG; return COMPARE_TYPE; } +\r?\n { newline(); } +[ \t]+ { advancepos(yytext); } +'\\.' { savetoken(yytext); yylval.i = yytext[2]; return CHAR; } +'.' { savetoken(yytext); yylval.i = yytext[1]; return CHAR; } +[-_a-zA-Z0-9]+ ST_RET(UNKNOWN_TYPE); +. { savetoken(yytext); return yytext[0]; } %% #ifdef AMIGA long *alloc(n) @@ -232,6 +353,7 @@ FILE *input_f; else #endif yyin = input_f; + if (!orig_yyin) orig_yyin = yyin; } /* analogous routine (for completeness) */ void init_yyout( output_f ) @@ -240,4 +362,51 @@ FILE *output_f; yyout = output_f; } +long +handle_varstring_check() +{ + struct lc_vardefs *vd; + yylval.map = (char *) alloc(strlen(yytext)+1); + Strcpy(yylval.map, yytext); + if ((vd = vardef_defined(variable_definitions, yytext, 1))) { + long l = vd->var_type; + long a = ((l & SPOVAR_ARRAY) == SPOVAR_ARRAY); + l = (l & ~SPOVAR_ARRAY); + if (l == SPOVAR_INT) return (a ? VARSTRING_INT_ARRAY : VARSTRING_INT); + if (l == SPOVAR_STRING) return (a ? VARSTRING_STRING_ARRAY : VARSTRING_STRING); + if (l == SPOVAR_VARIABLE) return (a ? VARSTRING_VAR_ARRAY : VARSTRING_VAR); + if (l == SPOVAR_COORD) return (a ? VARSTRING_COORD_ARRAY : VARSTRING_COORD); + if (l == SPOVAR_REGION) return (a ? VARSTRING_REGION_ARRAY : VARSTRING_REGION); + if (l == SPOVAR_MAPCHAR) return (a ? VARSTRING_MAPCHAR_ARRAY : VARSTRING_MAPCHAR); + if (l == SPOVAR_MONST) return (a ? VARSTRING_MONST_ARRAY : VARSTRING_MONST); + if (l == SPOVAR_OBJ) return (a ? VARSTRING_OBJ_ARRAY : VARSTRING_OBJ); + if (l == SPOVAR_SEL) return (a ? VARSTRING_SEL_ARRAY : VARSTRING_SEL); + } + return VARSTRING; +} + + +void +newline() +{ + nh_line_number++; + token_start_pos = 0; + memset(curr_token, 0, 512); +} + +void +savetoken(s) +char *s; +{ + sprintf(curr_token, "%s", s); + advancepos(s); +} + +void +advancepos(s) +char *s; +{ + token_start_pos += strlen(s); +} + /*lev_comp.l*/ diff --git a/util/lev_comp.y b/util/lev_comp.y index c2fe15fb6..fab3a9450 100644 --- a/util/lev_comp.y +++ b/util/lev_comp.y @@ -26,7 +26,6 @@ #include "hack.h" #include "sp_lev.h" -#define MAX_REGISTERS 10 #define ERR (-1) /* many types of things are put in chars for transference to NetHack. * since some systems will use signed chars, limit everybody to the @@ -34,11 +33,16 @@ */ #define MAX_OF_TYPE 128 +#define MAX_NESTED_IFS 20 +#define MAX_SWITCH_CASES 20 + #define New(type) \ (type *) memset((genericptr_t)alloc(sizeof(type)), 0, sizeof(type)) #define NewTab(type, size) (type **) alloc(sizeof(type *) * size) #define Free(ptr) free((genericptr_t)ptr) +extern void VDECL(lc_error, (const char *, ...)); +extern void VDECL(lc_warning, (const char *, ...)); extern void FDECL(yyerror, (const char *)); extern void FDECL(yywarning, (const char *)); extern int NDECL(yylex); @@ -52,119 +56,219 @@ extern int FDECL(get_object_id, (char *,CHAR_P)); extern boolean FDECL(check_monster_char, (CHAR_P)); extern boolean FDECL(check_object_char, (CHAR_P)); extern char FDECL(what_map_char, (CHAR_P)); -extern void FDECL(scan_map, (char *)); -extern void NDECL(wallify_map); -extern boolean NDECL(check_subrooms); -extern void FDECL(check_coord, (int,int,const char *)); -extern void NDECL(store_part); -extern void NDECL(store_room); -extern boolean FDECL(write_level_file, (char *,splev *,specialmaze *)); -extern void FDECL(free_rooms, (splev *)); +extern void FDECL(scan_map, (char *, sp_lev *)); +extern void FDECL(add_opcode, (sp_lev *, int, genericptr_t)); +extern genericptr_t FDECL(get_last_opcode_data1, (sp_lev *, int)); +extern genericptr_t FDECL(get_last_opcode_data2, (sp_lev *, int,int)); +extern boolean FDECL(check_subrooms, (sp_lev *)); +extern boolean FDECL(write_level_file, (char *,sp_lev *)); +extern struct opvar *FDECL(set_opvar_int, (struct opvar *, long)); +extern void VDECL(add_opvars, (sp_lev *, const char *, ...)); +extern void FDECL(start_level_def, (sp_lev * *, char *)); -static struct reg { - int x1, y1; - int x2, y2; -} current_region; +extern struct lc_funcdefs *FDECL(funcdef_new,(long,char *)); +extern void FDECL(funcdef_free_all,(struct lc_funcdefs *)); +extern struct lc_funcdefs *FDECL(funcdef_defined,(struct lc_funcdefs *,char *, int)); +extern char *FDECL(funcdef_paramtypes, (struct lc_funcdefs *)); +extern char *FDECL(decode_parm_str, (char *)); -static struct coord { - int x; - int y; -} current_coord, current_align; +extern struct lc_vardefs *FDECL(vardef_new,(long,char *)); +extern void FDECL(vardef_free_all,(struct lc_vardefs *)); +extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); -static struct size { - int height; - int width; -} current_size; +extern void NDECL(break_stmt_start); +extern void FDECL(break_stmt_end, (sp_lev *)); +extern void FDECL(break_stmt_new, (sp_lev *, long)); -char tmpmessage[256]; -digpos *tmppass[32]; -char *tmpmap[ROWNO]; +extern void FDECL(splev_add_from, (sp_lev *, sp_lev *)); -digpos *tmpdig[MAX_OF_TYPE]; -region *tmpreg[MAX_OF_TYPE]; -lev_region *tmplreg[MAX_OF_TYPE]; -door *tmpdoor[MAX_OF_TYPE]; -drawbridge *tmpdb[MAX_OF_TYPE]; -walk *tmpwalk[MAX_OF_TYPE]; +extern void FDECL(check_vardef_type, (struct lc_vardefs *, char *, long)); +extern void FDECL(vardef_used, (struct lc_vardefs *, char *)); +extern struct lc_vardefs *FDECL(add_vardef_type, (struct lc_vardefs *, char *, long)); -room_door *tmprdoor[MAX_OF_TYPE]; -trap *tmptrap[MAX_OF_TYPE]; -monster *tmpmonst[MAX_OF_TYPE]; -object *tmpobj[MAX_OF_TYPE]; -altar *tmpaltar[MAX_OF_TYPE]; -lad *tmplad[MAX_OF_TYPE]; -stair *tmpstair[MAX_OF_TYPE]; -gold *tmpgold[MAX_OF_TYPE]; -engraving *tmpengraving[MAX_OF_TYPE]; -fountain *tmpfountain[MAX_OF_TYPE]; -sink *tmpsink[MAX_OF_TYPE]; -pool *tmppool[MAX_OF_TYPE]; +extern int FDECL(reverse_jmp_opcode, (int)); -mazepart *tmppart[10]; -room *tmproom[MAXNROFROOMS*2]; -corridor *tmpcor[MAX_OF_TYPE]; +struct coord { + long x; + long y; +}; -static specialmaze maze; -static splev special_lev; -static lev_init init_lev; +struct forloopdef { + char *varname; + long jmp_point; +}; +static struct forloopdef forloop_list[MAX_NESTED_IFS]; +static short n_forloops = 0; -static char olist[MAX_REGISTERS], mlist[MAX_REGISTERS]; -static struct coord plist[MAX_REGISTERS]; -int n_olist = 0, n_mlist = 0, n_plist = 0; +sp_lev *splev = NULL; -unsigned int nlreg = 0, nreg = 0, ndoor = 0, ntrap = 0, nmons = 0, nobj = 0; -unsigned int ndb = 0, nwalk = 0, npart = 0, ndig = 0, nlad = 0, nstair = 0; -unsigned int naltar = 0, ncorridor = 0, nrooms = 0, ngold = 0, nengraving = 0; -unsigned int nfountain = 0, npool = 0, nsink = 0, npass = 0; +static struct opvar *if_list[MAX_NESTED_IFS]; -static int lev_flags = 0; +static short n_if_list = 0; unsigned int max_x_map, max_y_map; +int obj_containment = 0; -static xchar in_room; +int in_container_obj = 0; + +/* integer value is possibly an inconstant value (eg. dice notation or a variable) */ +int is_inconstant_number = 0; + +int in_switch_statement = 0; +static struct opvar *switch_check_jump = NULL; +static struct opvar *switch_default_case = NULL; +static struct opvar *switch_case_list[MAX_SWITCH_CASES]; +static long switch_case_value[MAX_SWITCH_CASES]; +int n_switch_case_list = 0; + +int allow_break_statements = 0; +struct lc_breakdef *break_list = NULL; + +extern struct lc_vardefs *variable_definitions; + + +struct lc_vardefs *function_tmp_var_defs = NULL; +extern struct lc_funcdefs *function_definitions; +struct lc_funcdefs *curr_function = NULL; +struct lc_funcdefs_parm * curr_function_param = NULL; +int in_function_definition = 0; +sp_lev *function_splev_backup = NULL; extern int fatal_error; -extern int want_warnings; +extern int got_errors; +extern int line_number; extern const char *fname; +extern char curr_token[512]; + %} %union { - int i; + long i; char* map; struct { - xchar room; - xchar wall; - xchar door; + long room; + long wall; + long door; } corpos; + struct { + long area; + long x1; + long y1; + long x2; + long y2; + } lregn; + struct { + long x; + long y; + } crd; + struct { + long ter; + long lit; + } terr; + struct { + long height; + long width; + } sze; + struct { + long die; + long num; + } dice; + struct { + long cfunc; + char *varstr; + } meth; } -%token CHAR INTEGER BOOLEAN PERCENT +%token CHAR INTEGER BOOLEAN PERCENT SPERCENT +%token MINUS_INTEGER PLUS_INTEGER +%token MAZE_GRID_ID SOLID_FILL_ID MINES_ID ROGUELEV_ID %token MESSAGE_ID MAZE_ID LEVEL_ID LEV_INIT_ID GEOMETRY_ID NOMAP_ID %token OBJECT_ID COBJECT_ID MONSTER_ID TRAP_ID DOOR_ID DRAWBRIDGE_ID -%token MAZEWALK_ID WALLIFY_ID REGION_ID FILLING -%token RANDOM_OBJECTS_ID RANDOM_MONSTERS_ID RANDOM_PLACES_ID +%token object_ID monster_ID terrain_ID +%token MAZEWALK_ID WALLIFY_ID REGION_ID FILLING IRREGULAR JOINED %token ALTAR_ID LADDER_ID STAIR_ID NON_DIGGABLE_ID NON_PASSWALL_ID ROOM_ID -%token PORTAL_ID TELEPRT_ID BRANCH_ID LEV CHANCE_ID +%token PORTAL_ID TELEPRT_ID BRANCH_ID LEV MINERALIZE_ID %token CORRIDOR_ID GOLD_ID ENGRAVING_ID FOUNTAIN_ID POOL_ID SINK_ID NONE %token RAND_CORRIDOR_ID DOOR_STATE LIGHT_STATE CURSE_TYPE ENGRAVING_TYPE -%token DIRECTION RANDOM_TYPE O_REGISTER M_REGISTER P_REGISTER A_REGISTER +%token DIRECTION RANDOM_TYPE RANDOM_TYPE_BRACKET A_REGISTER %token ALIGNMENT LEFT_OR_RIGHT CENTER TOP_OR_BOT ALTAR_TYPE UP_OR_DOWN %token SUBROOM_ID NAME_ID FLAGS_ID FLAG_TYPE MON_ATTITUDE MON_ALERTNESS -%token MON_APPEARANCE -%token CONTAINED -%token ',' ':' '(' ')' '[' ']' +%token MON_APPEARANCE ROOMDOOR_ID IF_ID ELSE_ID +%token TERRAIN_ID HORIZ_OR_VERT REPLACE_TERRAIN_ID +%token EXIT_ID SHUFFLE_ID +%token QUANTITY_ID BURIED_ID LOOP_ID +%token FOR_ID TO_ID +%token SWITCH_ID CASE_ID BREAK_ID DEFAULT_ID +%token ERODED_ID TRAPPED_ID RECHARGED_ID INVIS_ID GREASED_ID +%token FEMALE_ID CANCELLED_ID REVIVED_ID AVENGE_ID FLEEING_ID BLINDED_ID +%token PARALYZED_ID STUNNED_ID CONFUSED_ID SEENTRAPS_ID ALL_ID +%token MONTYPE_ID +%token GRAVE_ID ERODEPROOF_ID +%token FUNCTION_ID +%token MSG_OUTPUT_TYPE +%token COMPARE_TYPE +%token UNKNOWN_TYPE +%token rect_ID fillrect_ID line_ID randline_ID grow_ID selection_ID flood_ID +%token rndcoord_ID circle_ID ellipse_ID filter_ID complement_ID +%token gradient_ID GRADIENT_TYPE LIMITED HUMIDITY_TYPE +%token ',' ':' '(' ')' '[' ']' '{' '}' %token STRING MAP_ID +%token NQSTRING VARSTRING +%token CFUNC CFUNC_INT CFUNC_STR CFUNC_COORD CFUNC_REGION +%token VARSTRING_INT VARSTRING_INT_ARRAY +%token VARSTRING_STRING VARSTRING_STRING_ARRAY +%token VARSTRING_VAR VARSTRING_VAR_ARRAY +%token VARSTRING_COORD VARSTRING_COORD_ARRAY +%token VARSTRING_REGION VARSTRING_REGION_ARRAY +%token VARSTRING_MAPCHAR VARSTRING_MAPCHAR_ARRAY +%token VARSTRING_MONST VARSTRING_MONST_ARRAY +%token VARSTRING_OBJ VARSTRING_OBJ_ARRAY +%token VARSTRING_SEL VARSTRING_SEL_ARRAY +%token METHOD_INT METHOD_INT_ARRAY +%token METHOD_STRING METHOD_STRING_ARRAY +%token METHOD_VAR METHOD_VAR_ARRAY +%token METHOD_COORD METHOD_COORD_ARRAY +%token METHOD_REGION METHOD_REGION_ARRAY +%token METHOD_MAPCHAR METHOD_MAPCHAR_ARRAY +%token METHOD_MONST METHOD_MONST_ARRAY +%token METHOD_OBJ METHOD_OBJ_ARRAY +%token METHOD_SEL METHOD_SEL_ARRAY +%token DICE %type h_justif v_justif trap_name room_type door_state light_state -%type alignment altar_type a_register roomfill filling door_pos -%type door_wall walled secret amount chance -%type engraving_type flags flag_list prefilled lev_region lev_init -%type monster monster_c m_register object object_c o_register -%type string maze_def level_def m_name o_name +%type alignment altar_type a_register roomfill door_pos +%type alignment_prfx +%type door_wall walled secret +%type dir_list teleprt_detail +%type object_infos object_info monster_infos monster_info +%type levstatements stmt_block region_detail_end +%type engraving_type flag_list roomregionflag roomregionflags optroomregionflags +%type humidity_flags +%type comparestmt encodecoord encoderegion mapchar +%type seen_trap_mask +%type encodemonster encodeobj encodeobj_list +%type integer_list string_list encodecoord_list encoderegion_list mapchar_list encodemonster_list +%type opt_percent opt_fillchar +%type all_integers +%type ter_selection ter_selection_x +%type func_param_type +%type objectid monsterid terrainid +%type opt_coord_or_var opt_limited +%type mazefiller +%type level_def +%type any_var any_var_array any_var_or_arr any_var_or_unk +%type func_call_params_list func_call_param_list +%type func_call_param_part %type corr_spec +%type region lev_region +%type room_pos subroom_pos room_align +%type room_size +%type terrain_type +%left '+' '-' +%left '*' '/' '%' %start file %% @@ -176,331 +280,926 @@ levels : level | level levels ; -level : maze_level - | room_level - ; - -maze_level : maze_def flags lev_init messages regions +level : level_def flags levstatements { - unsigned i; - if (fatal_error > 0) { (void) fprintf(stderr, - "%s : %d errors detected. No output created!\n", - fname, fatal_error); - } else { - maze.flags = $2; - (void) memcpy((genericptr_t)&(maze.init_lev), - (genericptr_t)&(init_lev), - sizeof(lev_init)); - maze.numpart = npart; - maze.parts = NewTab(mazepart, npart); - for(i=0;i 0) { - (void) fprintf(stderr, - "%s : %d errors detected. No output created!\n", - fname, fatal_error); - } else { - special_lev.flags = (long) $2; - (void) memcpy( - (genericptr_t)&(special_lev.init_lev), - (genericptr_t)&(init_lev), - sizeof(lev_init)); - special_lev.nroom = nrooms; - special_lev.rooms = NewTab(room, nrooms); - for(i=0; i 8) - yyerror("Level names limited to 8 characters."); - $$ = $3; - special_lev.nrmonst = special_lev.nrobjects = 0; - n_mlist = n_olist = 0; + $$ = -1; + } + | CHAR + { + $$ = what_map_char((char) $1); } ; -lev_init : /* nothing */ +lev_init : LEV_INIT_ID ':' SOLID_FILL_ID ',' terrain_type { - /* in case we're processing multiple files, - explicitly clear any stale settings */ - (void) memset((genericptr_t) &init_lev, 0, - sizeof init_lev); - init_lev.init_present = FALSE; - $$ = 0; + long filling = $5.ter; + if (filling == INVALID_TYPE || filling >= MAX_TYPE) + lc_error("INIT_MAP: Invalid fill char type."); + add_opvars(splev, "iiiiiiiio", LVLINIT_SOLIDFILL,filling,0,(long)$5.lit, 0,0,0,0, SPO_INITLEVEL); + max_x_map = COLNO-1; + max_y_map = ROWNO; } - | LEV_INIT_ID ':' CHAR ',' CHAR ',' BOOLEAN ',' BOOLEAN ',' light_state ',' walled + | LEV_INIT_ID ':' MAZE_GRID_ID ',' CHAR { - init_lev.init_present = TRUE; - init_lev.fg = what_map_char((char) $3); - if (init_lev.fg == INVALID_TYPE) - yyerror("Invalid foreground type."); - init_lev.bg = what_map_char((char) $5); - if (init_lev.bg == INVALID_TYPE) - yyerror("Invalid background type."); - init_lev.smoothed = $7; - init_lev.joined = $9; - if (init_lev.joined && - init_lev.fg != CORR && init_lev.fg != ROOM) - yyerror("Invalid foreground type for joined map."); - init_lev.lit = $11; - init_lev.walled = $13; - init_lev.icedpools = FALSE; - $$ = 1; + long filling = what_map_char((char) $5); + if (filling == INVALID_TYPE || filling >= MAX_TYPE) + lc_error("INIT_MAP: Invalid fill char type."); + add_opvars(splev, "iiiiiiiio", LVLINIT_MAZEGRID,filling,0,0, 0,0,0,0, SPO_INITLEVEL); + max_x_map = COLNO-1; + max_y_map = ROWNO; } - | LEV_INIT_ID ':' CHAR ',' CHAR ',' BOOLEAN ',' BOOLEAN ',' light_state ',' walled ',' BOOLEAN + | LEV_INIT_ID ':' ROGUELEV_ID { - init_lev.init_present = TRUE; - init_lev.fg = what_map_char((char) $3); - if (init_lev.fg == INVALID_TYPE) - yyerror("Invalid foreground type."); - init_lev.bg = what_map_char((char) $5); - if (init_lev.bg == INVALID_TYPE) - yyerror("Invalid background type."); - init_lev.smoothed = $7; - init_lev.joined = $9; - if (init_lev.joined && - init_lev.fg != CORR && init_lev.fg != ROOM) - yyerror("Invalid foreground type for joined map."); - init_lev.lit = $11; - init_lev.walled = $13; - init_lev.icedpools = $15; - $$ = 1; + add_opvars(splev, "iiiiiiiio", LVLINIT_ROGUE,0,0,0,0,0,0,0, SPO_INITLEVEL); + } + | LEV_INIT_ID ':' MINES_ID ',' CHAR ',' CHAR ',' BOOLEAN ',' BOOLEAN ',' light_state ',' walled opt_fillchar + { + long fg = what_map_char((char) $5); + long bg = what_map_char((char) $7); + long smoothed = $9; + long joined = $11; + long lit = $13; + long walled = $15; + long filling = $16; + if (fg == INVALID_TYPE || fg >= MAX_TYPE) + lc_error("INIT_MAP: Invalid foreground type."); + if (bg == INVALID_TYPE || bg >= MAX_TYPE) + lc_error("INIT_MAP: Invalid background type."); + if (joined && fg != CORR && fg != ROOM) + lc_error("INIT_MAP: Invalid foreground type for joined map."); + + if (filling == INVALID_TYPE) + lc_error("INIT_MAP: Invalid fill char type."); + + add_opvars(splev, "iiiiiiiio", LVLINIT_MINES,filling,walled,lit, joined,smoothed,bg,fg, SPO_INITLEVEL); + max_x_map = COLNO-1; + max_y_map = ROWNO; } ; +opt_limited : /* nothing */ + { + $$ = 0; + } + | ',' LIMITED + { + $$ = $2; + } + ; + +opt_coord_or_var : /* nothing */ + { + add_opvars(splev, "o", SPO_COPY); + $$ = 0; + } + | ',' coord_or_var + { + $$ = 1; + } + ; + +opt_fillchar : /* nothing */ + { + $$ = -1; + } + | ',' CHAR + { + $$ = what_map_char((char) $2); + } + ; + + walled : BOOLEAN | RANDOM_TYPE ; flags : /* nothing */ { - $$ = 0; + add_opvars(splev, "io", 0, SPO_LEVEL_FLAGS); } | FLAGS_ID ':' flag_list { - $$ = lev_flags; - lev_flags = 0; /* clear for next user */ + add_opvars(splev, "io", $3, SPO_LEVEL_FLAGS); } ; flag_list : FLAG_TYPE ',' flag_list { - lev_flags |= $1; + $$ = ($1 | $3); } | FLAG_TYPE { - lev_flags |= $1; + $$ = $1; } ; -messages : /* nothing */ - | message messages - ; - -message : MESSAGE_ID ':' STRING +levstatements : /* nothing */ { - int i, j; - - i = (int) strlen($3) + 1; - j = (int) strlen(tmpmessage); - if (i + j > 255) { - yyerror("Message string too long (>256 characters)"); - } else { - if (j) tmpmessage[j++] = '\n'; - (void) strncpy(tmpmessage+j, $3, i - 1); - tmpmessage[j + i - 1] = 0; - } - Free($3); + $$ = 0; + } + | levstatement levstatements + { + $$ = 1 + $2; } ; -rreg_init : /* nothing */ - | rreg_init init_rreg +stmt_block : '{' levstatements '}' + { + $$ = $2; + } ; -init_rreg : RANDOM_OBJECTS_ID ':' object_list +levstatement : message + | lev_init + | altar_detail + | grave_detail + | branch_region + | corridor + | variable_define + | shuffle_detail + | diggable_detail + | door_detail + | drawbridge_detail + | engraving_detail + | mineralize + | fountain_detail + | gold_detail + | switchstatement + | forstatement + | loopstatement + | ifstatement + | chancestatement + | exitstatement + | breakstatement + | function_define + | function_call + | ladder_detail + | map_definition + | mazewalk_detail + | monster_detail + | object_detail + | passwall_detail + | pool_detail + | portal_region + | random_corridors + | region_detail + | room_def + | subroom_def + | sink_detail + | terrain_detail + | replace_terrain_detail + | stair_detail + | stair_region + | teleprt_region + | trap_detail + | wallify_detail + ; + +any_var_array : VARSTRING_INT_ARRAY + | VARSTRING_STRING_ARRAY + | VARSTRING_VAR_ARRAY + | VARSTRING_COORD_ARRAY + | VARSTRING_REGION_ARRAY + | VARSTRING_MAPCHAR_ARRAY + | VARSTRING_MONST_ARRAY + | VARSTRING_OBJ_ARRAY + | VARSTRING_SEL_ARRAY + ; + +any_var : VARSTRING_INT + | VARSTRING_STRING + | VARSTRING_VAR + | VARSTRING_COORD + | VARSTRING_REGION + | VARSTRING_MAPCHAR + | VARSTRING_MONST + | VARSTRING_OBJ + | VARSTRING_SEL + ; + +any_var_or_arr : any_var_array + | any_var + | VARSTRING + ; + +any_var_or_unk : VARSTRING + | any_var + ; + +shuffle_detail : SHUFFLE_ID ':' any_var_array { - if(special_lev.nrobjects) { - yyerror("Object registers already initialized!"); - } else { - special_lev.nrobjects = n_olist; - special_lev.robjects = (char *) alloc(n_olist); - (void) memcpy((genericptr_t)special_lev.robjects, - (genericptr_t)olist, n_olist); - } + struct lc_vardefs *vd; + if ((vd = vardef_defined(variable_definitions, $3, 1))) { + if (!(vd->var_type & SPOVAR_ARRAY)) + lc_error("Trying to shuffle non-array variable '%s'", $3); + } else lc_error("Trying to shuffle undefined variable '%s'", $3); + add_opvars(splev, "so", $3, SPO_SHUFFLE_ARRAY); + Free($3); } - | RANDOM_MONSTERS_ID ':' monster_list + ; + +variable_define : any_var_or_arr '=' math_expr_var { - if(special_lev.nrmonst) { - yyerror("Monster registers already initialized!"); - } else { - special_lev.nrmonst = n_mlist; - special_lev.rmonst = (char *) alloc(n_mlist); - (void) memcpy((genericptr_t)special_lev.rmonst, - (genericptr_t)mlist, n_mlist); + variable_definitions = add_vardef_type(variable_definitions, $1, SPOVAR_INT); + add_opvars(splev, "iso", 0, $1, SPO_VAR_INIT); + Free($1); + } + | any_var_or_arr '=' selection_ID ':' ter_selection + { + variable_definitions = add_vardef_type(variable_definitions, $1, SPOVAR_SEL); + add_opvars(splev, "iso", 0, $1, SPO_VAR_INIT); + Free($1); + } + | any_var_or_arr '=' string_expr + { + variable_definitions = add_vardef_type(variable_definitions, $1, SPOVAR_STRING); + add_opvars(splev, "iso", 0, $1, SPO_VAR_INIT); + Free($1); + } + | any_var_or_arr '=' terrainid ':' mapchar_or_var + { + variable_definitions = add_vardef_type(variable_definitions, $1, SPOVAR_MAPCHAR); + add_opvars(splev, "iso", 0, $1, SPO_VAR_INIT); + Free($1); + } + | any_var_or_arr '=' monsterid ':' monster_or_var + { + variable_definitions = add_vardef_type(variable_definitions, $1, SPOVAR_MONST); + add_opvars(splev, "iso", 0, $1, SPO_VAR_INIT); + Free($1); + } + | any_var_or_arr '=' objectid ':' object_or_var + { + variable_definitions = add_vardef_type(variable_definitions, $1, SPOVAR_OBJ); + add_opvars(splev, "iso", 0, $1, SPO_VAR_INIT); + Free($1); + } + | any_var_or_arr '=' coord_or_var + { + variable_definitions = add_vardef_type(variable_definitions, $1, SPOVAR_COORD); + add_opvars(splev, "iso", 0, $1, SPO_VAR_INIT); + Free($1); + } + | any_var_or_arr '=' region_or_var + { + variable_definitions = add_vardef_type(variable_definitions, $1, SPOVAR_REGION); + add_opvars(splev, "iso", 0, $1, SPO_VAR_INIT); + Free($1); + } + | any_var_or_arr '=' '{' integer_list '}' + { + long n_items = $4; + variable_definitions = add_vardef_type(variable_definitions, $1, SPOVAR_INT|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, $1, SPO_VAR_INIT); + Free($1); + } + | any_var_or_arr '=' '{' encodecoord_list '}' + { + long n_items = $4; + variable_definitions = add_vardef_type(variable_definitions, $1, SPOVAR_COORD|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, $1, SPO_VAR_INIT); + Free($1); + } + | any_var_or_arr '=' '{' encoderegion_list '}' + { + long n_items = $4; + variable_definitions = add_vardef_type(variable_definitions, $1, SPOVAR_REGION|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, $1, SPO_VAR_INIT); + Free($1); + } + | any_var_or_arr '=' terrainid ':' '{' mapchar_list '}' + { + long n_items = $6; + variable_definitions = add_vardef_type(variable_definitions, $1, SPOVAR_MAPCHAR|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, $1, SPO_VAR_INIT); + Free($1); + } + | any_var_or_arr '=' monsterid ':' '{' encodemonster_list '}' + { + long n_items = $6; + variable_definitions = add_vardef_type(variable_definitions, $1, SPOVAR_MONST|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, $1, SPO_VAR_INIT); + Free($1); + } + | any_var_or_arr '=' objectid ':' '{' encodeobj_list '}' + { + long n_items = $6; + variable_definitions = add_vardef_type(variable_definitions, $1, SPOVAR_OBJ|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, $1, SPO_VAR_INIT); + Free($1); + } + | any_var_or_arr '=' '{' string_list '}' + { + long n_items = $4; + variable_definitions = add_vardef_type(variable_definitions, $1, SPOVAR_STRING|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, $1, SPO_VAR_INIT); + Free($1); + } + ; + +encodeobj_list : encodeobj + { + add_opvars(splev, "O", $1); + $$ = 1; + } + | encodeobj_list ',' encodeobj + { + add_opvars(splev, "O", $3); + $$ = 1 + $1; + } + ; + +encodemonster_list : encodemonster + { + add_opvars(splev, "M", $1); + $$ = 1; + } + | encodemonster_list ',' encodemonster + { + add_opvars(splev, "M", $3); + $$ = 1 + $1; + } + ; + +mapchar_list : mapchar + { + add_opvars(splev, "m", $1); + $$ = 1; + } + | mapchar_list ',' mapchar + { + add_opvars(splev, "m", $3); + $$ = 1 + $1; + } + ; + +encoderegion_list : encoderegion + { + $$ = 1; + } + | encoderegion_list ',' encoderegion + { + $$ = 1 + $1; + } + ; + +encodecoord_list : encodecoord + { + add_opvars(splev, "c", $1); + $$ = 1; + } + | encodecoord_list ',' encodecoord + { + add_opvars(splev, "c", $3); + $$ = 1 + $1; + } + ; + +integer_list : math_expr_var + { + $$ = 1; + } + | integer_list ',' math_expr_var + { + $$ = 1 + $1; + } + ; + +string_list : string_expr + { + $$ = 1; + } + | string_list ',' string_expr + { + $$ = 1 + $1; + } + ; + +function_define : FUNCTION_ID NQSTRING '(' + { + struct lc_funcdefs *funcdef; + + if (in_function_definition) + lc_error("Recursively defined functions not allowed (function %s).", $2); + + in_function_definition++; + + if (funcdef_defined(function_definitions, $2, 1)) + lc_error("Function '%s' already defined once.", $2); + + funcdef = funcdef_new(-1, $2); + funcdef->next = function_definitions; + function_definitions = funcdef; + function_splev_backup = splev; + splev = &(funcdef->code); + Free($2); + curr_function = funcdef; + function_tmp_var_defs = variable_definitions; + variable_definitions = NULL; + } + func_params_list ')' + { + /* nothing */ + } + stmt_block + { + add_opvars(splev, "io", 0, SPO_RETURN); + splev = function_splev_backup; + in_function_definition--; + curr_function = NULL; + vardef_free_all(variable_definitions); + variable_definitions = function_tmp_var_defs; + } + ; + +function_call : NQSTRING '(' func_call_params_list ')' + { + struct lc_funcdefs *tmpfunc; + tmpfunc = funcdef_defined(function_definitions, $1, 1); + if (tmpfunc) { + long l; + long nparams = strlen( $3 ); + char *fparamstr = funcdef_paramtypes(tmpfunc); + if (strcmp($3, fparamstr)) { + char *tmps = strdup(decode_parm_str(fparamstr)); + lc_error("Function '%s' requires params '%s', got '%s' instead.", $1, tmps, decode_parm_str($3)); + Free(tmps); } + Free(fparamstr); + Free($3); + if (!(tmpfunc->n_called)) { + /* we haven't called the function yet, so insert it in the code */ + struct opvar *jmp = New(struct opvar); + set_opvar_int(jmp, splev->n_opcodes+1); + add_opcode(splev, SPO_PUSH, jmp); + add_opcode(splev, SPO_JMP, NULL); /* we must jump past it first, then CALL it, due to RETURN. */ + + tmpfunc->addr = splev->n_opcodes; + + { /* init function parameter variables */ + struct lc_funcdefs_parm *tfp = tmpfunc->params; + while (tfp) { + add_opvars(splev, "iso", 0, tfp->name, SPO_VAR_INIT); + tfp = tfp->next; + } + } + + splev_add_from(splev, &(tmpfunc->code)); + set_opvar_int(jmp, splev->n_opcodes - jmp->vardata.l); + } + l = tmpfunc->addr - splev->n_opcodes - 2; + add_opvars(splev, "iio", nparams, l, SPO_CALL); + tmpfunc->n_called++; + } else { + lc_error("Function '%s' not defined.", $1); + } + Free($1); } ; -rooms : /* Nothing - dummy room for use with INIT_MAP */ +exitstatement : EXIT_ID { - tmproom[nrooms] = New(room); - tmproom[nrooms]->name = (char *) 0; - tmproom[nrooms]->parent = (char *) 0; - tmproom[nrooms]->rtype = 0; - tmproom[nrooms]->rlit = 0; - tmproom[nrooms]->xalign = ERR; - tmproom[nrooms]->yalign = ERR; - tmproom[nrooms]->x = 0; - tmproom[nrooms]->y = 0; - tmproom[nrooms]->w = 2; - tmproom[nrooms]->h = 2; - in_room = 1; + add_opcode(splev, SPO_EXIT, NULL); } - | roomlist ; -roomlist : aroom - | aroom roomlist +opt_percent : /* nothing */ + { + $$ = 100; + } + | PERCENT + { + $$ = $1; + } ; -corridors_def : random_corridors - | corridors +comparestmt : PERCENT + { + /* val > rn2(100) */ + add_opvars(splev, "iio", (long)$1, 100, SPO_RN2); + $$ = SPO_JG; + } + | '[' math_expr_var COMPARE_TYPE math_expr_var ']' + { + $$ = $3; + } + | '[' math_expr_var ']' + { + /* boolean, explicit foo != 0 */ + add_opvars(splev, "i", 0); + $$ = SPO_JNE; + } + ; + +switchstatement : SWITCH_ID + { + is_inconstant_number = 0; + } + '[' integer_or_var ']' + { + struct opvar *chkjmp; + if (in_switch_statement > 0) + lc_error("Cannot nest switch-statements."); + + in_switch_statement++; + + n_switch_case_list = 0; + switch_default_case = NULL; + + if (!is_inconstant_number) + add_opvars(splev, "o", SPO_RN2); + is_inconstant_number = 0; + + chkjmp = New(struct opvar); + set_opvar_int(chkjmp, splev->n_opcodes+1); + switch_check_jump = chkjmp; + add_opcode(splev, SPO_PUSH, chkjmp); + add_opcode(splev, SPO_JMP, NULL); + break_stmt_start(); + } + '{' switchcases '}' + { + struct opvar *endjump = New(struct opvar); + int i; + + set_opvar_int(endjump, splev->n_opcodes+1); + + add_opcode(splev, SPO_PUSH, endjump); + add_opcode(splev, SPO_JMP, NULL); + + set_opvar_int(switch_check_jump, splev->n_opcodes - switch_check_jump->vardata.l); + + for (i = 0; i < n_switch_case_list; i++) { + add_opvars(splev, "oio", SPO_COPY, switch_case_value[i], SPO_CMP); + set_opvar_int(switch_case_list[i], switch_case_list[i]->vardata.l - splev->n_opcodes-1); + add_opcode(splev, SPO_PUSH, switch_case_list[i]); + add_opcode(splev, SPO_JE, NULL); + } + + if (switch_default_case) { + set_opvar_int(switch_default_case, switch_default_case->vardata.l - splev->n_opcodes-1); + add_opcode(splev, SPO_PUSH, switch_default_case); + add_opcode(splev, SPO_JMP, NULL); + } + + set_opvar_int(endjump, splev->n_opcodes - endjump->vardata.l); + + break_stmt_end(splev); + + add_opcode(splev, SPO_POP, NULL); /* get rid of the value in stack */ + in_switch_statement--; + + + } + ; + +switchcases : /* nothing */ + | switchcase switchcases + ; + +switchcase : CASE_ID all_integers ':' + { + if (n_switch_case_list < MAX_SWITCH_CASES) { + struct opvar *tmppush = New(struct opvar); + set_opvar_int(tmppush, splev->n_opcodes); + switch_case_value[n_switch_case_list] = $2; + switch_case_list[n_switch_case_list++] = tmppush; + } else lc_error("Too many cases in a switch."); + } + levstatements + { + } + | DEFAULT_ID ':' + { + struct opvar *tmppush = New(struct opvar); + + if (switch_default_case) + lc_error("Switch default case already used."); + + set_opvar_int(tmppush, splev->n_opcodes); + switch_default_case = tmppush; + } + levstatements + { + } + ; + +breakstatement : BREAK_ID + { + if (!allow_break_statements) + lc_error("Cannot use BREAK outside a statement block."); + else { + break_stmt_new(splev, splev->n_opcodes); + } + } + ; + +for_to_span : '.' '.' + | TO_ID + ; + +forstmt_start : FOR_ID any_var_or_unk '=' math_expr_var for_to_span math_expr_var + { + char buf[256], buf2[256]; + + if (n_forloops >= MAX_NESTED_IFS) { + lc_error("FOR: Too deeply nested loops."); + n_forloops = MAX_NESTED_IFS - 1; + } + + /* first, define a variable for the for-loop end value */ + snprintf(buf, 255, "%s end", $2); + /* the value of which is already in stack (the 2nd math_expr) */ + add_opvars(splev, "iso", 0, buf, SPO_VAR_INIT); + + variable_definitions = add_vardef_type(variable_definitions, $2, SPOVAR_INT); + /* define the for-loop variable. value is in stack (1st math_expr) */ + add_opvars(splev, "iso", 0, $2, SPO_VAR_INIT); + + /* calculate value for the loop "step" variable */ + snprintf(buf2, 255, "%s step", $2); + add_opvars(splev, "vvo", buf, $2, SPO_MATH_SUB); /* end - start */ + add_opvars(splev, "o", SPO_MATH_SIGN); /* sign of that */ + add_opvars(splev, "iso", 0, buf2, SPO_VAR_INIT); /* save the sign into the step var */ + + forloop_list[n_forloops].varname = strdup($2); + forloop_list[n_forloops].jmp_point = splev->n_opcodes; + + n_forloops++; + Free($2); + } + ; + +forstatement : forstmt_start + { + /* nothing */ + break_stmt_start(); + } + stmt_block + { + char buf[256], buf2[256]; + n_forloops--; + snprintf(buf, 255, "%s step", forloop_list[n_forloops].varname); + snprintf(buf2, 255, "%s end", forloop_list[n_forloops].varname); + /* compare for-loop var to end value */ + add_opvars(splev, "vvo", forloop_list[n_forloops].varname, buf2, SPO_CMP); + /* var + step */ + add_opvars(splev, "vvo", buf, + forloop_list[n_forloops].varname, SPO_MATH_ADD); + /* for-loop var = (for-loop var + step) */ + add_opvars(splev, "iso", 0, forloop_list[n_forloops].varname, SPO_VAR_INIT); + /* jump back if compared values were not equal */ + add_opvars(splev, "io", forloop_list[n_forloops].jmp_point - splev->n_opcodes - 1, SPO_JNE); + Free(forloop_list[n_forloops].varname); + break_stmt_end(splev); + } + ; + +loopstatement : LOOP_ID '[' integer_or_var ']' + { + struct opvar *tmppush = New(struct opvar); + + if (n_if_list >= MAX_NESTED_IFS) { + lc_error("LOOP: Too deeply nested conditionals."); + n_if_list = MAX_NESTED_IFS - 1; + } + set_opvar_int(tmppush, splev->n_opcodes); + if_list[n_if_list++] = tmppush; + + add_opvars(splev, "o", SPO_DEC); + break_stmt_start(); + } + stmt_block + { + struct opvar *tmppush; + + add_opvars(splev, "oio", SPO_COPY, 0, SPO_CMP); + + tmppush = (struct opvar *) if_list[--n_if_list]; + set_opvar_int(tmppush, tmppush->vardata.l - splev->n_opcodes-1); + add_opcode(splev, SPO_PUSH, tmppush); + add_opcode(splev, SPO_JG, NULL); + add_opcode(splev, SPO_POP, NULL); /* get rid of the count value in stack */ + break_stmt_end(splev); + } + ; + +chancestatement : comparestmt ':' + { + struct opvar *tmppush2 = New(struct opvar); + + if (n_if_list >= MAX_NESTED_IFS) { + lc_error("IF: Too deeply nested conditionals."); + n_if_list = MAX_NESTED_IFS - 1; + } + + add_opcode(splev, SPO_CMP, NULL); + + set_opvar_int(tmppush2, splev->n_opcodes+1); + + if_list[n_if_list++] = tmppush2; + + add_opcode(splev, SPO_PUSH, tmppush2); + + add_opcode(splev, reverse_jmp_opcode( $1 ), NULL); + + } + levstatement + { + if (n_if_list > 0) { + struct opvar *tmppush; + tmppush = (struct opvar *) if_list[--n_if_list]; + set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); + } else lc_error("IF: Huh?! No start address?"); + } + ; + +ifstatement : IF_ID comparestmt + { + struct opvar *tmppush2 = New(struct opvar); + + if (n_if_list >= MAX_NESTED_IFS) { + lc_error("IF: Too deeply nested conditionals."); + n_if_list = MAX_NESTED_IFS - 1; + } + + add_opcode(splev, SPO_CMP, NULL); + + set_opvar_int(tmppush2, splev->n_opcodes+1); + + if_list[n_if_list++] = tmppush2; + + add_opcode(splev, SPO_PUSH, tmppush2); + + add_opcode(splev, reverse_jmp_opcode( $2 ), NULL); + + } + if_ending + { + /* do nothing */ + } + ; + +if_ending : stmt_block + { + if (n_if_list > 0) { + struct opvar *tmppush; + tmppush = (struct opvar *) if_list[--n_if_list]; + set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); + } else lc_error("IF: Huh?! No start address?"); + } + | stmt_block + { + if (n_if_list > 0) { + struct opvar *tmppush = New(struct opvar); + struct opvar *tmppush2; + + set_opvar_int(tmppush, splev->n_opcodes+1); + add_opcode(splev, SPO_PUSH, tmppush); + + add_opcode(splev, SPO_JMP, NULL); + + tmppush2 = (struct opvar *) if_list[--n_if_list]; + + set_opvar_int(tmppush2, splev->n_opcodes - tmppush2->vardata.l); + if_list[n_if_list++] = tmppush; + } else lc_error("IF: Huh?! No else-part address?"); + } + ELSE_ID stmt_block + { + if (n_if_list > 0) { + struct opvar *tmppush; + tmppush = (struct opvar *) if_list[--n_if_list]; + set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); + } else lc_error("IF: Huh?! No end address?"); + } + ; + +message : MESSAGE_ID ':' string_expr + { + add_opvars(splev, "o", SPO_MESSAGE); + } ; random_corridors: RAND_CORRIDOR_ID { - tmpcor[0] = New(corridor); - tmpcor[0]->src.room = -1; - ncorridor = 1; + add_opvars(splev, "iiiiiio", -1, 0, -1, -1, -1, -1, SPO_CORRIDOR); + } + | RAND_CORRIDOR_ID ':' all_integers + { + add_opvars(splev, "iiiiiio", -1, $3, -1, -1, -1, -1, SPO_CORRIDOR); + } + | RAND_CORRIDOR_ID ':' RANDOM_TYPE + { + add_opvars(splev, "iiiiiio", -1, -1, -1, -1, -1, -1, SPO_CORRIDOR); } - ; - -corridors : /* nothing */ - | corridors corridor ; corridor : CORRIDOR_ID ':' corr_spec ',' corr_spec { - tmpcor[ncorridor] = New(corridor); - tmpcor[ncorridor]->src.room = $3.room; - tmpcor[ncorridor]->src.wall = $3.wall; - tmpcor[ncorridor]->src.door = $3.door; - tmpcor[ncorridor]->dest.room = $5.room; - tmpcor[ncorridor]->dest.wall = $5.wall; - tmpcor[ncorridor]->dest.door = $5.door; - ncorridor++; - if (ncorridor >= MAX_OF_TYPE) { - yyerror("Too many corridors in level!"); - ncorridor--; - } + add_opvars(splev, "iiiiiio", + $3.room, $3.door, $3.wall, + $5.room, $5.door, $5.wall, + SPO_CORRIDOR); } - | CORRIDOR_ID ':' corr_spec ',' INTEGER + | CORRIDOR_ID ':' corr_spec ',' all_integers { - tmpcor[ncorridor] = New(corridor); - tmpcor[ncorridor]->src.room = $3.room; - tmpcor[ncorridor]->src.wall = $3.wall; - tmpcor[ncorridor]->src.door = $3.door; - tmpcor[ncorridor]->dest.room = -1; - tmpcor[ncorridor]->dest.wall = $5; - ncorridor++; - if (ncorridor >= MAX_OF_TYPE) { - yyerror("Too many corridors in level!"); - ncorridor--; - } + add_opvars(splev, "iiiiiio", + $3.room, $3.door, $3.wall, + -1, -1, (long)$5, + SPO_CORRIDOR); } ; corr_spec : '(' INTEGER ',' DIRECTION ',' door_pos ')' { - if ((unsigned) $2 >= nrooms) - yyerror("Wrong room number!"); $$.room = $2; $$.wall = $4; $$.door = $6; } ; -aroom : room_def room_details +room_begin : room_type opt_percent ',' light_state + { + if (($2 < 100) && ($1 == OROOM)) + lc_error("Only typed rooms can have a chance."); + else { + add_opvars(splev, "iii", (long)$1, (long)$2, (long)$4); + } + } + ; + +subroom_def : SUBROOM_ID ':' room_begin ',' subroom_pos ',' room_size optroomregionflags { - store_room(); + long flags = $8; + if (flags == -1) flags = (1 << 0); + add_opvars(splev, "iiiiiiio", flags, ERR, ERR, + $5.x, $5.y, $7.width, $7.height, SPO_SUBROOM); + break_stmt_start(); } - | subroom_def room_details + stmt_block { - store_room(); + break_stmt_end(splev); + add_opcode(splev, SPO_ENDROOM, NULL); } ; -subroom_def : SUBROOM_ID ':' room_type ',' light_state ',' subroom_pos ',' room_size ',' string roomfill +room_def : ROOM_ID ':' room_begin ',' room_pos ',' room_align ',' room_size optroomregionflags { - tmproom[nrooms] = New(room); - tmproom[nrooms]->parent = $11; - tmproom[nrooms]->name = (char *) 0; - tmproom[nrooms]->rtype = $3; - tmproom[nrooms]->rlit = $5; - tmproom[nrooms]->filled = $12; - tmproom[nrooms]->xalign = ERR; - tmproom[nrooms]->yalign = ERR; - tmproom[nrooms]->x = current_coord.x; - tmproom[nrooms]->y = current_coord.y; - tmproom[nrooms]->w = current_size.width; - tmproom[nrooms]->h = current_size.height; - in_room = 1; + long flags = $8; + if (flags == -1) flags = (1 << 0); + add_opvars(splev, "iiiiiiio", flags, + $7.x, $7.y, $5.x, $5.y, + $9.width, $9.height, SPO_ROOM); + break_stmt_start(); } - ; - -room_def : ROOM_ID ':' room_type ',' light_state ',' room_pos ',' room_align ',' room_size roomfill + stmt_block { - tmproom[nrooms] = New(room); - tmproom[nrooms]->name = (char *) 0; - tmproom[nrooms]->parent = (char *) 0; - tmproom[nrooms]->rtype = $3; - tmproom[nrooms]->rlit = $5; - tmproom[nrooms]->filled = $12; - tmproom[nrooms]->xalign = current_align.x; - tmproom[nrooms]->yalign = current_align.y; - tmproom[nrooms]->x = current_coord.x; - tmproom[nrooms]->y = current_coord.y; - tmproom[nrooms]->w = current_size.width; - tmproom[nrooms]->h = current_size.height; - in_room = 1; + break_stmt_end(splev); + add_opcode(splev, SPO_ENDROOM, NULL); } ; @@ -518,193 +1217,109 @@ room_pos : '(' INTEGER ',' INTEGER ')' { if ( $2 < 1 || $2 > 5 || $4 < 1 || $4 > 5 ) { - yyerror("Room position should be between 1 & 5!"); + lc_error("Room positions should be between 1-5: (%li,%li)!", $2, $4); } else { - current_coord.x = $2; - current_coord.y = $4; + $$.x = $2; + $$.y = $4; } } | RANDOM_TYPE { - current_coord.x = current_coord.y = ERR; + $$.x = $$.y = ERR; } ; subroom_pos : '(' INTEGER ',' INTEGER ')' { if ( $2 < 0 || $4 < 0) { - yyerror("Invalid subroom position !"); + lc_error("Invalid subroom position (%li,%li)!", $2, $4); } else { - current_coord.x = $2; - current_coord.y = $4; + $$.x = $2; + $$.y = $4; } } | RANDOM_TYPE { - current_coord.x = current_coord.y = ERR; + $$.x = $$.y = ERR; } ; room_align : '(' h_justif ',' v_justif ')' { - current_align.x = $2; - current_align.y = $4; + $$.x = $2; + $$.y = $4; } | RANDOM_TYPE { - current_align.x = current_align.y = ERR; + $$.x = $$.y = ERR; } ; room_size : '(' INTEGER ',' INTEGER ')' { - current_size.width = $2; - current_size.height = $4; + $$.width = $2; + $$.height = $4; } | RANDOM_TYPE { - current_size.height = current_size.width = ERR; + $$.height = $$.width = ERR; } ; -room_details : /* nothing */ - | room_details room_detail - ; - -room_detail : room_name - | room_chance - | room_door - | monster_detail - | object_detail - | trap_detail - | altar_detail - | fountain_detail - | sink_detail - | pool_detail - | gold_detail - | engraving_detail - | stair_detail - ; - -room_name : NAME_ID ':' string - { - if (tmproom[nrooms]->name) - yyerror("This room already has a name!"); - else - tmproom[nrooms]->name = $3; - } - ; - -room_chance : CHANCE_ID ':' INTEGER - { - if (tmproom[nrooms]->chance) - yyerror("This room already assigned a chance!"); - else if (tmproom[nrooms]->rtype == OROOM) - yyerror("Only typed rooms can have a chance!"); - else if ($3 < 1 || $3 > 99) - yyerror("The chance is supposed to be percentile."); - else - tmproom[nrooms]->chance = $3; - } - ; - -room_door : DOOR_ID ':' secret ',' door_state ',' door_wall ',' door_pos +door_detail : ROOMDOOR_ID ':' secret ',' door_state ',' door_wall ',' door_pos { /* ERR means random here */ if ($7 == ERR && $9 != ERR) { - yyerror("If the door wall is random, so must be its pos!"); + lc_error("If the door wall is random, so must be its pos!"); } else { - tmprdoor[ndoor] = New(room_door); - tmprdoor[ndoor]->secret = $3; - tmprdoor[ndoor]->mask = $5; - tmprdoor[ndoor]->wall = $7; - tmprdoor[ndoor]->pos = $9; - ndoor++; - if (ndoor >= MAX_OF_TYPE) { - yyerror("Too many doors in room!"); - ndoor--; - } + add_opvars(splev, "iiiio", (long)$9, (long)$5, (long)$3, (long)$7, SPO_ROOM_DOOR); } } + | DOOR_ID ':' door_state ',' ter_selection + { + add_opvars(splev, "io", (long)$3, SPO_DOOR); + } ; secret : BOOLEAN | RANDOM_TYPE ; -door_wall : DIRECTION +door_wall : dir_list | RANDOM_TYPE ; +dir_list : DIRECTION + { + $$ = $1; + } + | DIRECTION '|' dir_list + { + $$ = ($1 | $3); + } + ; + door_pos : INTEGER | RANDOM_TYPE ; -maze_def : MAZE_ID ':' string ',' filling - { - maze.filling = (schar) $5; - if (index($3, '.')) - yyerror("Invalid dot ('.') in level name."); - if ((int) strlen($3) > 8) - yyerror("Level names limited to 8 characters."); - $$ = $3; - in_room = 0; - n_plist = n_mlist = n_olist = 0; - } - ; - -filling : CHAR - { - $$ = get_floor_type((char)$1); - } - | RANDOM_TYPE - { - $$ = -1; - } - ; - -regions : aregion - | aregion regions - ; - -aregion : map_definition reg_init map_details - { - store_part(); - } - ; - map_definition : NOMAP_ID { - tmppart[npart] = New(mazepart); - tmppart[npart]->halign = 1; - tmppart[npart]->valign = 1; - tmppart[npart]->nrobjects = 0; - tmppart[npart]->nloc = 0; - tmppart[npart]->nrmonst = 0; - tmppart[npart]->xsize = 1; - tmppart[npart]->ysize = 1; - tmppart[npart]->map = (char **) alloc(sizeof(char *)); - tmppart[npart]->map[0] = (char *) alloc(1); - tmppart[npart]->map[0][0] = STONE; - max_x_map = COLNO-1; - max_y_map = ROWNO; + add_opvars(splev, "ciisiio", 0, 0, 1, (char *)0, 0, 0, SPO_MAP); + max_x_map = COLNO-1; + max_y_map = ROWNO; } - | map_geometry MAP_ID + | GEOMETRY_ID ':' h_justif ',' v_justif roomfill MAP_ID { - tmppart[npart] = New(mazepart); - tmppart[npart]->halign = $1 % 10; - tmppart[npart]->valign = $1 / 10; - tmppart[npart]->nrobjects = 0; - tmppart[npart]->nloc = 0; - tmppart[npart]->nrmonst = 0; - scan_map($2); - Free($2); + add_opvars(splev, "cii", SP_COORD_PACK(($3),($5)), 1, (long)$6); + scan_map($7, splev); + Free($7); } - ; - -map_geometry : GEOMETRY_ID ':' h_justif ',' v_justif + | GEOMETRY_ID ':' coord_or_var roomfill MAP_ID { - $$ = $3 + ($5 * 10); + add_opvars(splev, "ii", 2, (long)$4); + scan_map($5, splev); + Free($5); } ; @@ -716,852 +1331,587 @@ v_justif : TOP_OR_BOT | CENTER ; -reg_init : /* nothing */ - | reg_init init_reg +monster_detail : MONSTER_ID ':' monster_desc + { + add_opvars(splev, "io", 0, SPO_MONSTER); + } + | MONSTER_ID ':' monster_desc + { + add_opvars(splev, "io", 1, SPO_MONSTER); + in_container_obj++; + break_stmt_start(); + } + stmt_block + { + break_stmt_end(splev); + in_container_obj--; + add_opvars(splev, "o", SPO_END_MONINVENT); + } ; -init_reg : RANDOM_OBJECTS_ID ':' object_list +monster_desc : monster_or_var ',' coord_or_var monster_infos { - if (tmppart[npart]->nrobjects) { - yyerror("Object registers already initialized!"); - } else { - tmppart[npart]->robjects = (char *)alloc(n_olist); - (void) memcpy((genericptr_t)tmppart[npart]->robjects, - (genericptr_t)olist, n_olist); - tmppart[npart]->nrobjects = n_olist; - } - } - | RANDOM_PLACES_ID ':' place_list - { - if (tmppart[npart]->nloc) { - yyerror("Location registers already initialized!"); - } else { - register int i; - tmppart[npart]->rloc_x = (char *) alloc(n_plist); - tmppart[npart]->rloc_y = (char *) alloc(n_plist); - for(i=0;irloc_x[i] = plist[i].x; - tmppart[npart]->rloc_y[i] = plist[i].y; - } - tmppart[npart]->nloc = n_plist; - } - } - | RANDOM_MONSTERS_ID ':' monster_list - { - if (tmppart[npart]->nrmonst) { - yyerror("Monster registers already initialized!"); - } else { - tmppart[npart]->rmonst = (char *) alloc(n_mlist); - (void) memcpy((genericptr_t)tmppart[npart]->rmonst, - (genericptr_t)mlist, n_mlist); - tmppart[npart]->nrmonst = n_mlist; - } - } - ; - -object_list : object - { - if (n_olist < MAX_REGISTERS) - olist[n_olist++] = $1; - else - yyerror("Object list too long!"); - } - | object ',' object_list - { - if (n_olist < MAX_REGISTERS) - olist[n_olist++] = $1; - else - yyerror("Object list too long!"); - } - ; - -monster_list : monster - { - if (n_mlist < MAX_REGISTERS) - mlist[n_mlist++] = $1; - else - yyerror("Monster list too long!"); - } - | monster ',' monster_list - { - if (n_mlist < MAX_REGISTERS) - mlist[n_mlist++] = $1; - else - yyerror("Monster list too long!"); - } - ; - -place_list : place - { - if (n_plist < MAX_REGISTERS) - plist[n_plist++] = current_coord; - else - yyerror("Location list too long!"); - } - | place - { - if (n_plist < MAX_REGISTERS) - plist[n_plist++] = current_coord; - else - yyerror("Location list too long!"); - } - ',' place_list - ; - -map_details : /* nothing */ - | map_details map_detail - ; - -map_detail : monster_detail - | object_detail - | door_detail - | trap_detail - | drawbridge_detail - | region_detail - | stair_region - | portal_region - | teleprt_region - | branch_region - | altar_detail - | fountain_detail - | mazewalk_detail - | wallify_detail - | ladder_detail - | stair_detail - | gold_detail - | engraving_detail - | diggable_detail - | passwall_detail - ; - -monster_detail : MONSTER_ID chance ':' monster_c ',' m_name ',' coordinate - { - tmpmonst[nmons] = New(monster); - tmpmonst[nmons]->x = current_coord.x; - tmpmonst[nmons]->y = current_coord.y; - tmpmonst[nmons]->class = $4; - tmpmonst[nmons]->peaceful = -1; /* no override */ - tmpmonst[nmons]->asleep = -1; - tmpmonst[nmons]->align = - MAX_REGISTERS - 2; - tmpmonst[nmons]->name.str = 0; - tmpmonst[nmons]->appear = 0; - tmpmonst[nmons]->appear_as.str = 0; - tmpmonst[nmons]->chance = $2; - tmpmonst[nmons]->id = NON_PM; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Monster"); - if ($6) { - int token = get_monster_id($6, (char) $4); - if (token == ERR) - yywarning( - "Invalid monster name! Making random monster."); - else - tmpmonst[nmons]->id = token; - Free($6); - } - } - monster_infos - { - if (++nmons >= MAX_OF_TYPE) { - yyerror("Too many monsters in room or mazepart!"); - nmons--; - } + /* nothing */ } ; monster_infos : /* nothing */ - | monster_infos monster_info - ; - -monster_info : ',' string { - tmpmonst[nmons]->name.str = $2; + struct opvar *stopit = New(struct opvar); + set_opvar_int(stopit, SP_M_V_END); + add_opcode(splev, SPO_PUSH, stopit); + $$ = 0x0000; } - | ',' MON_ATTITUDE + | monster_infos ',' monster_info { - tmpmonst[nmons]->peaceful = $2; - } - | ',' MON_ALERTNESS - { - tmpmonst[nmons]->asleep = $2; - } - | ',' alignment - { - tmpmonst[nmons]->align = $2; - } - | ',' MON_APPEARANCE string - { - tmpmonst[nmons]->appear = $2; - tmpmonst[nmons]->appear_as.str = $3; + if (( $1 & $3 )) + lc_error("MONSTER extra info defined twice."); + $$ = ( $1 | $3 ); } ; -object_detail : OBJECT_ID object_desc +monster_info : string_expr { + add_opvars(splev, "i", SP_M_V_NAME); + $$ = 0x0001; } - | COBJECT_ID object_desc + | MON_ATTITUDE { - /* 1: is contents of preceeding object with 2 */ - /* 2: is a container */ - /* 0: neither */ - tmpobj[nobj-1]->containment = 2; + add_opvars(splev, "ii", (long)$1, SP_M_V_PEACEFUL); + $$ = 0x0002; + } + | MON_ALERTNESS + { + add_opvars(splev, "ii", (long)$1, SP_M_V_ASLEEP); + $$ = 0x0004; + } + | alignment_prfx + { + add_opvars(splev, "ii", (long)$1, SP_M_V_ALIGN); + $$ = 0x0008; + } + | MON_APPEARANCE string_expr + { + add_opvars(splev, "ii", (long)$1, SP_M_V_APPEAR); + $$ = 0x0010; + } + | FEMALE_ID + { + add_opvars(splev, "ii", 1, SP_M_V_FEMALE); + $$ = 0x0020; + } + | INVIS_ID + { + add_opvars(splev, "ii", 1, SP_M_V_INVIS); + $$ = 0x0040; + } + | CANCELLED_ID + { + add_opvars(splev, "ii", 1, SP_M_V_CANCELLED); + $$ = 0x0080; + } + | REVIVED_ID + { + add_opvars(splev, "ii", 1, SP_M_V_REVIVED); + $$ = 0x0100; + } + | AVENGE_ID + { + add_opvars(splev, "ii", 1, SP_M_V_AVENGE); + $$ = 0x0200; + } + | FLEEING_ID ':' integer_or_var + { + add_opvars(splev, "i", SP_M_V_FLEEING); + $$ = 0x0400; + } + | BLINDED_ID ':' integer_or_var + { + add_opvars(splev, "i", SP_M_V_BLINDED); + $$ = 0x0800; + } + | PARALYZED_ID ':' integer_or_var + { + add_opvars(splev, "i", SP_M_V_PARALYZED); + $$ = 0x1000; + } + | STUNNED_ID + { + add_opvars(splev, "ii", 1, SP_M_V_STUNNED); + $$ = 0x2000; + } + | CONFUSED_ID + { + add_opvars(splev, "ii", 1, SP_M_V_CONFUSED); + $$ = 0x4000; + } + | SEENTRAPS_ID ':' seen_trap_mask + { + add_opvars(splev, "ii", (long)$3, SP_M_V_SEENTRAPS); + $$ = 0x8000; } ; -object_desc : chance ':' object_c ',' o_name +seen_trap_mask : STRING { - tmpobj[nobj] = New(object); - tmpobj[nobj]->class = $3; - tmpobj[nobj]->corpsenm = NON_PM; - tmpobj[nobj]->curse_state = -1; - tmpobj[nobj]->name.str = 0; - tmpobj[nobj]->chance = $1; - tmpobj[nobj]->id = -1; - if ($5) { - int token = get_object_id($5, $3); - if (token == ERR) - yywarning( - "Illegal object name! Making random object."); - else - tmpobj[nobj]->id = token; - Free($5); - } + int token = get_trap_type($1); + if (token == ERR || token == 0) + lc_error("Unknown trap type '%s'!", $1); + $$ = (1L << (token - 1)); } - ',' object_where object_infos + | ALL_ID { - if (++nobj >= MAX_OF_TYPE) { - yyerror("Too many objects in room or mazepart!"); - nobj--; - } + $$ = (long) ~0; + } + | STRING '|' seen_trap_mask + { + int token = get_trap_type($1); + if (token == ERR || token == 0) + lc_error("Unknown trap type '%s'!", $1); + + if ((1L << (token - 1)) & $3) + lc_error("Monster seen_traps, trap '%s' listed twice.", $1); + + $$ = ((1L << (token - 1)) | $3); } ; -object_where : coordinate +object_detail : OBJECT_ID ':' object_desc { - tmpobj[nobj]->containment = 0; - tmpobj[nobj]->x = current_coord.x; - tmpobj[nobj]->y = current_coord.y; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Object"); + long cnt = 0; + if (in_container_obj) cnt |= SP_OBJ_CONTENT; + add_opvars(splev, "io", cnt, SPO_OBJECT); } - | CONTAINED + | COBJECT_ID ':' object_desc { - tmpobj[nobj]->containment = 1; - /* random coordinate, will be overridden anyway */ - tmpobj[nobj]->x = -MAX_REGISTERS-1; - tmpobj[nobj]->y = -MAX_REGISTERS-1; + long cnt = SP_OBJ_CONTAINER; + if (in_container_obj) cnt |= SP_OBJ_CONTENT; + add_opvars(splev, "io", cnt, SPO_OBJECT); + in_container_obj++; + break_stmt_start(); + } + stmt_block + { + break_stmt_end(splev); + in_container_obj--; + add_opcode(splev, SPO_POP_CONTAINER, NULL); + } + ; + +object_desc : object_or_var object_infos + { + if (( $2 & 0x4000) && in_container_obj) lc_error("Object cannot have a coord when contained."); + else if (!( $2 & 0x4000) && !in_container_obj) lc_error("Object needs a coord when not contained."); } ; object_infos : /* nothing */ { - tmpobj[nobj]->spe = -127; - /* Note below: we're trying to make as many of these optional as - * possible. We clearly can't make curse_state, enchantment, and - * monster_id _all_ optional, since ",random" would be ambiguous. - * We can't even just make enchantment mandatory, since if we do that - * alone, ",random" requires too much lookahead to parse. - */ + struct opvar *stopit = New(struct opvar); + set_opvar_int(stopit, SP_O_V_END); + add_opcode(splev, SPO_PUSH, stopit); + $$ = 0x00; } - | ',' curse_state ',' monster_id ',' enchantment optional_name - { - } - | ',' curse_state ',' enchantment optional_name - { - } - | ',' monster_id ',' enchantment optional_name + | object_infos ',' object_info { + if (( $1 & $3 )) + lc_error("OBJECT extra info '%s' defined twice.", curr_token); + $$ = ( $1 | $3 ); } ; -curse_state : RANDOM_TYPE +object_info : CURSE_TYPE { - tmpobj[nobj]->curse_state = -1; + add_opvars(splev, "ii", (long)$1, SP_O_V_CURSE); + $$ = 0x0001; } - | CURSE_TYPE + | MONTYPE_ID ':' monster_or_var { - tmpobj[nobj]->curse_state = $1; + add_opvars(splev, "i", SP_O_V_CORPSENM); + $$ = 0x0002; + } + | all_ints_push + { + add_opvars(splev, "i", SP_O_V_SPE); + $$ = 0x0004; + } + | NAME_ID ':' string_expr + { + add_opvars(splev, "i", SP_O_V_NAME); + $$ = 0x0008; + } + | QUANTITY_ID ':' integer_or_var + { + add_opvars(splev, "i", SP_O_V_QUAN); + $$ = 0x0010; + } + | BURIED_ID + { + add_opvars(splev, "ii", 1, SP_O_V_BURIED); + $$ = 0x0020; + } + | LIGHT_STATE + { + add_opvars(splev, "ii", (long)$1, SP_O_V_LIT); + $$ = 0x0040; + } + | ERODED_ID ':' integer_or_var + { + add_opvars(splev, "i", SP_O_V_ERODED); + $$ = 0x0080; + } + | ERODEPROOF_ID + { + add_opvars(splev, "ii", -1, SP_O_V_ERODED); + $$ = 0x0080; + } + | DOOR_STATE + { + if ($1 == D_LOCKED) { + add_opvars(splev, "ii", 1, SP_O_V_LOCKED); + $$ = 0x0100; + } else if ($1 == D_BROKEN) { + add_opvars(splev, "ii", 1, SP_O_V_BROKEN); + $$ = 0x0200; + } else + lc_error("OBJECT state can only be locked or broken."); + } + | TRAPPED_ID + { + add_opvars(splev, "ii", 1, SP_O_V_TRAPPED); + $$ = 0x0400; + } + | RECHARGED_ID ':' integer_or_var + { + add_opvars(splev, "i", SP_O_V_RECHARGED); + $$ = 0x0800; + } + | INVIS_ID + { + add_opvars(splev, "ii", 1, SP_O_V_INVIS); + $$ = 0x1000; + } + | GREASED_ID + { + add_opvars(splev, "ii", 1, SP_O_V_GREASED); + $$ = 0x2000; + } + | coord_or_var + { + add_opvars(splev, "i", SP_O_V_COORD); + $$ = 0x4000; } ; -monster_id : STRING +trap_detail : TRAP_ID ':' trap_name ',' coord_or_var { - int token = get_monster_id($1, (char)0); - if (token == ERR) /* "random" */ - tmpobj[nobj]->corpsenm = NON_PM - 1; - else - tmpobj[nobj]->corpsenm = token; - Free($1); + add_opvars(splev, "io", (long)$3, SPO_TRAP); } ; -enchantment : RANDOM_TYPE - { - tmpobj[nobj]->spe = -127; - } - | INTEGER - { - tmpobj[nobj]->spe = $1; - } - ; - -optional_name : /* nothing */ - | ',' NONE - { - } - | ',' STRING - { - tmpobj[nobj]->name.str = $2; - } - ; - -door_detail : DOOR_ID ':' door_state ',' coordinate - { - tmpdoor[ndoor] = New(door); - tmpdoor[ndoor]->x = current_coord.x; - tmpdoor[ndoor]->y = current_coord.y; - tmpdoor[ndoor]->mask = $3; - if(current_coord.x >= 0 && current_coord.y >= 0 && - tmpmap[current_coord.y][current_coord.x] != DOOR && - tmpmap[current_coord.y][current_coord.x] != SDOOR) - yyerror("Door decl doesn't match the map"); - ndoor++; - if (ndoor >= MAX_OF_TYPE) { - yyerror("Too many doors in mazepart!"); - ndoor--; - } - } - ; - -trap_detail : TRAP_ID chance ':' trap_name ',' coordinate - { - tmptrap[ntrap] = New(trap); - tmptrap[ntrap]->x = current_coord.x; - tmptrap[ntrap]->y = current_coord.y; - tmptrap[ntrap]->type = $4; - tmptrap[ntrap]->chance = $2; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Trap"); - if (++ntrap >= MAX_OF_TYPE) { - yyerror("Too many traps in room or mazepart!"); - ntrap--; - } - } - ; - -drawbridge_detail: DRAWBRIDGE_ID ':' coordinate ',' DIRECTION ',' door_state +drawbridge_detail: DRAWBRIDGE_ID ':' coord_or_var ',' DIRECTION ',' door_state { - int x, y, dir; + long d, state = 0; + /* convert dir from a DIRECTION to a DB_DIR */ + d = $5; + switch(d) { + case W_NORTH: d = DB_NORTH; break; + case W_SOUTH: d = DB_SOUTH; break; + case W_EAST: d = DB_EAST; break; + case W_WEST: d = DB_WEST; break; + default: + lc_error("Invalid drawbridge direction."); + break; + } - tmpdb[ndb] = New(drawbridge); - x = tmpdb[ndb]->x = current_coord.x; - y = tmpdb[ndb]->y = current_coord.y; - /* convert dir from a DIRECTION to a DB_DIR */ - dir = $5; - switch(dir) { - case W_NORTH: dir = DB_NORTH; y--; break; - case W_SOUTH: dir = DB_SOUTH; y++; break; - case W_EAST: dir = DB_EAST; x++; break; - case W_WEST: dir = DB_WEST; x--; break; - default: - yyerror("Invalid drawbridge direction"); - break; - } - tmpdb[ndb]->dir = dir; - if (current_coord.x >= 0 && current_coord.y >= 0 && - !IS_WALL(tmpmap[y][x])) { - char ebuf[60]; - Sprintf(ebuf, - "Wall needed for drawbridge (%02d, %02d)", - current_coord.x, current_coord.y); - yyerror(ebuf); - } - - if ( $7 == D_ISOPEN ) - tmpdb[ndb]->db_open = 1; - else if ( $7 == D_CLOSED ) - tmpdb[ndb]->db_open = 0; - else if ($7 == -1) /* RANDOM_TYPE */ - tmpdb[ndb]->db_open = 127; /* random */ - else - yyerror("A drawbridge can only be open, closed, or random!"); - ndb++; - if (ndb >= MAX_OF_TYPE) { - yyerror("Too many drawbridges in mazepart!"); - ndb--; - } + if ( $7 == D_ISOPEN ) + state = 1; + else if ( $7 == D_CLOSED ) + state = 0; + else if ( $7 == -1 ) + state = -1; + else + lc_error("A drawbridge can only be open, closed or random!"); + add_opvars(splev, "iio", state, d, SPO_DRAWBRIDGE); } ; -mazewalk_detail : MAZEWALK_ID ':' coordinate ',' DIRECTION +mazewalk_detail : MAZEWALK_ID ':' coord_or_var ',' DIRECTION { - tmpwalk[nwalk] = New(walk); - tmpwalk[nwalk]->x = current_coord.x; - tmpwalk[nwalk]->y = current_coord.y; - tmpwalk[nwalk]->dir = $5; - nwalk++; - if (nwalk >= MAX_OF_TYPE) { - yyerror("Too many mazewalks in mazepart!"); - nwalk--; - } + add_opvars(splev, "iiio", + (long)$5, 1, 0, SPO_MAZEWALK); + } + | MAZEWALK_ID ':' coord_or_var ',' DIRECTION ',' BOOLEAN opt_fillchar + { + add_opvars(splev, "iiio", + (long)$5, (long)$7, (long)$8, SPO_MAZEWALK); } ; wallify_detail : WALLIFY_ID { - wallify_map(); + add_opvars(splev, "rio", SP_REGION_PACK(-1,-1,-1,-1), 0, SPO_WALLIFY); + } + | WALLIFY_ID ':' ter_selection + { + add_opvars(splev, "io", 1, SPO_WALLIFY); } ; -ladder_detail : LADDER_ID ':' coordinate ',' UP_OR_DOWN +ladder_detail : LADDER_ID ':' coord_or_var ',' UP_OR_DOWN { - tmplad[nlad] = New(lad); - tmplad[nlad]->x = current_coord.x; - tmplad[nlad]->y = current_coord.y; - tmplad[nlad]->up = $5; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Ladder"); - nlad++; - if (nlad >= MAX_OF_TYPE) { - yyerror("Too many ladders in mazepart!"); - nlad--; - } + add_opvars(splev, "io", (long)$5, SPO_LADDER); } ; -stair_detail : STAIR_ID ':' coordinate ',' UP_OR_DOWN +stair_detail : STAIR_ID ':' coord_or_var ',' UP_OR_DOWN { - tmpstair[nstair] = New(stair); - tmpstair[nstair]->x = current_coord.x; - tmpstair[nstair]->y = current_coord.y; - tmpstair[nstair]->up = $5; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Stairway"); - nstair++; - if (nstair >= MAX_OF_TYPE) { - yyerror("Too many stairs in room or mazepart!"); - nstair--; - } + add_opvars(splev, "io", (long)$5, SPO_STAIR); } ; -stair_region : STAIR_ID ':' lev_region +stair_region : STAIR_ID ':' lev_region ',' lev_region ',' UP_OR_DOWN { - tmplreg[nlreg] = New(lev_region); - tmplreg[nlreg]->in_islev = $3; - tmplreg[nlreg]->inarea.x1 = current_region.x1; - tmplreg[nlreg]->inarea.y1 = current_region.y1; - tmplreg[nlreg]->inarea.x2 = current_region.x2; - tmplreg[nlreg]->inarea.y2 = current_region.y2; - } - ',' lev_region ',' UP_OR_DOWN - { - tmplreg[nlreg]->del_islev = $6; - tmplreg[nlreg]->delarea.x1 = current_region.x1; - tmplreg[nlreg]->delarea.y1 = current_region.y1; - tmplreg[nlreg]->delarea.x2 = current_region.x2; - tmplreg[nlreg]->delarea.y2 = current_region.y2; - if($8) - tmplreg[nlreg]->rtype = LR_UPSTAIR; - else - tmplreg[nlreg]->rtype = LR_DOWNSTAIR; - tmplreg[nlreg]->rname.str = 0; - nlreg++; - if (nlreg >= MAX_OF_TYPE) { - yyerror("Too many levregions in mazepart!"); - nlreg--; - } + add_opvars(splev, "iiiii iiiii iiso", + $3.x1, $3.y1, $3.x2, $3.y2, $3.area, + $5.x1, $5.y1, $5.x2, $5.y2, $5.area, + (long)(($7) ? LR_UPSTAIR : LR_DOWNSTAIR), + 0, (char *)0, SPO_LEVREGION); } ; -portal_region : PORTAL_ID ':' lev_region +portal_region : PORTAL_ID ':' lev_region ',' lev_region ',' STRING { - tmplreg[nlreg] = New(lev_region); - tmplreg[nlreg]->in_islev = $3; - tmplreg[nlreg]->inarea.x1 = current_region.x1; - tmplreg[nlreg]->inarea.y1 = current_region.y1; - tmplreg[nlreg]->inarea.x2 = current_region.x2; - tmplreg[nlreg]->inarea.y2 = current_region.y2; - } - ',' lev_region ',' string - { - tmplreg[nlreg]->del_islev = $6; - tmplreg[nlreg]->delarea.x1 = current_region.x1; - tmplreg[nlreg]->delarea.y1 = current_region.y1; - tmplreg[nlreg]->delarea.x2 = current_region.x2; - tmplreg[nlreg]->delarea.y2 = current_region.y2; - tmplreg[nlreg]->rtype = LR_PORTAL; - tmplreg[nlreg]->rname.str = $8; - nlreg++; - if (nlreg >= MAX_OF_TYPE) { - yyerror("Too many levregions in mazepart!"); - nlreg--; - } + add_opvars(splev, "iiiii iiiii iiso", + $3.x1, $3.y1, $3.x2, $3.y2, $3.area, + $5.x1, $5.y1, $5.x2, $5.y2, $5.area, + LR_PORTAL, 0, $7, SPO_LEVREGION); + Free($7); } ; -teleprt_region : TELEPRT_ID ':' lev_region +teleprt_region : TELEPRT_ID ':' lev_region ',' lev_region teleprt_detail { - tmplreg[nlreg] = New(lev_region); - tmplreg[nlreg]->in_islev = $3; - tmplreg[nlreg]->inarea.x1 = current_region.x1; - tmplreg[nlreg]->inarea.y1 = current_region.y1; - tmplreg[nlreg]->inarea.x2 = current_region.x2; - tmplreg[nlreg]->inarea.y2 = current_region.y2; - } - ',' lev_region - { - tmplreg[nlreg]->del_islev = $6; - tmplreg[nlreg]->delarea.x1 = current_region.x1; - tmplreg[nlreg]->delarea.y1 = current_region.y1; - tmplreg[nlreg]->delarea.x2 = current_region.x2; - tmplreg[nlreg]->delarea.y2 = current_region.y2; - } - teleprt_detail - { - switch($8) { - case -1: tmplreg[nlreg]->rtype = LR_TELE; break; - case 0: tmplreg[nlreg]->rtype = LR_DOWNTELE; break; - case 1: tmplreg[nlreg]->rtype = LR_UPTELE; break; - } - tmplreg[nlreg]->rname.str = 0; - nlreg++; - if (nlreg >= MAX_OF_TYPE) { - yyerror("Too many levregions in mazepart!"); - nlreg--; - } + long rtype = 0; + switch($6) { + case -1: rtype = LR_TELE; break; + case 0: rtype = LR_DOWNTELE; break; + case 1: rtype = LR_UPTELE; break; + } + add_opvars(splev, "iiiii iiiii iiso", + $3.x1, $3.y1, $3.x2, $3.y2, $3.area, + $5.x1, $5.y1, $5.x2, $5.y2, $5.area, + rtype, 0, (char *)0, SPO_LEVREGION); } ; -branch_region : BRANCH_ID ':' lev_region +branch_region : BRANCH_ID ':' lev_region ',' lev_region { - tmplreg[nlreg] = New(lev_region); - tmplreg[nlreg]->in_islev = $3; - tmplreg[nlreg]->inarea.x1 = current_region.x1; - tmplreg[nlreg]->inarea.y1 = current_region.y1; - tmplreg[nlreg]->inarea.x2 = current_region.x2; - tmplreg[nlreg]->inarea.y2 = current_region.y2; - } - ',' lev_region - { - tmplreg[nlreg]->del_islev = $6; - tmplreg[nlreg]->delarea.x1 = current_region.x1; - tmplreg[nlreg]->delarea.y1 = current_region.y1; - tmplreg[nlreg]->delarea.x2 = current_region.x2; - tmplreg[nlreg]->delarea.y2 = current_region.y2; - tmplreg[nlreg]->rtype = LR_BRANCH; - tmplreg[nlreg]->rname.str = 0; - nlreg++; - if (nlreg >= MAX_OF_TYPE) { - yyerror("Too many levregions in mazepart!"); - nlreg--; - } + add_opvars(splev, "iiiii iiiii iiso", + $3.x1, $3.y1, $3.x2, $3.y2, $3.area, + $5.x1, $5.y1, $5.x2, $5.y2, $5.area, + (long)LR_BRANCH, 0, (char *)0, SPO_LEVREGION); } ; teleprt_detail : /* empty */ { - $$ = -1; + $$ = -1; } | ',' UP_OR_DOWN { - $$ = $2; + $$ = $2; } ; -lev_region : region +fountain_detail : FOUNTAIN_ID ':' ter_selection { - $$ = 0; - } - | LEV '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')' - { -/* This series of if statements is a hack for MSC 5.1. It seems that its - tiny little brain cannot compile if these are all one big if statement. */ - if ($3 <= 0 || $3 >= COLNO) - yyerror("Region out of level range!"); - else if ($5 < 0 || $5 >= ROWNO) - yyerror("Region out of level range!"); - else if ($7 <= 0 || $7 >= COLNO) - yyerror("Region out of level range!"); - else if ($9 < 0 || $9 >= ROWNO) - yyerror("Region out of level range!"); - current_region.x1 = $3; - current_region.y1 = $5; - current_region.x2 = $7; - current_region.y2 = $9; - $$ = 1; + add_opvars(splev, "o", SPO_FOUNTAIN); } ; -fountain_detail : FOUNTAIN_ID ':' coordinate +sink_detail : SINK_ID ':' ter_selection { - tmpfountain[nfountain] = New(fountain); - tmpfountain[nfountain]->x = current_coord.x; - tmpfountain[nfountain]->y = current_coord.y; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Fountain"); - nfountain++; - if (nfountain >= MAX_OF_TYPE) { - yyerror("Too many fountains in room or mazepart!"); - nfountain--; - } + add_opvars(splev, "o", SPO_SINK); } ; -sink_detail : SINK_ID ':' coordinate +pool_detail : POOL_ID ':' ter_selection { - tmpsink[nsink] = New(sink); - tmpsink[nsink]->x = current_coord.x; - tmpsink[nsink]->y = current_coord.y; - nsink++; - if (nsink >= MAX_OF_TYPE) { - yyerror("Too many sinks in room!"); - nsink--; - } + add_opvars(splev, "o", SPO_POOL); } ; -pool_detail : POOL_ID ':' coordinate +terrain_type : CHAR { - tmppool[npool] = New(pool); - tmppool[npool]->x = current_coord.x; - tmppool[npool]->y = current_coord.y; - npool++; - if (npool >= MAX_OF_TYPE) { - yyerror("Too many pools in room!"); - npool--; - } + $$.lit = -2; + $$.ter = what_map_char((char) $1); + } + | '(' CHAR ',' light_state ')' + { + $$.lit = $4; + $$.ter = what_map_char((char) $2); } ; -diggable_detail : NON_DIGGABLE_ID ':' region +replace_terrain_detail : REPLACE_TERRAIN_ID ':' region_or_var ',' mapchar_or_var ',' mapchar_or_var ',' SPERCENT { - tmpdig[ndig] = New(digpos); - tmpdig[ndig]->x1 = current_region.x1; - tmpdig[ndig]->y1 = current_region.y1; - tmpdig[ndig]->x2 = current_region.x2; - tmpdig[ndig]->y2 = current_region.y2; - ndig++; - if (ndig >= MAX_OF_TYPE) { - yyerror("Too many diggables in mazepart!"); - ndig--; - } + add_opvars(splev, "io", $9, SPO_REPLACETERRAIN); } ; -passwall_detail : NON_PASSWALL_ID ':' region +terrain_detail : TERRAIN_ID ':' ter_selection ',' mapchar_or_var + { + add_opvars(splev, "o", SPO_TERRAIN); + } + ; + +diggable_detail : NON_DIGGABLE_ID ':' region_or_var { - tmppass[npass] = New(digpos); - tmppass[npass]->x1 = current_region.x1; - tmppass[npass]->y1 = current_region.y1; - tmppass[npass]->x2 = current_region.x2; - tmppass[npass]->y2 = current_region.y2; - npass++; - if (npass >= 32) { - yyerror("Too many passwalls in mazepart!"); - npass--; - } + add_opvars(splev, "o", SPO_NON_DIGGABLE); } ; -region_detail : REGION_ID ':' region ',' light_state ',' room_type prefilled +passwall_detail : NON_PASSWALL_ID ':' region_or_var { - tmpreg[nreg] = New(region); - tmpreg[nreg]->x1 = current_region.x1; - tmpreg[nreg]->y1 = current_region.y1; - tmpreg[nreg]->x2 = current_region.x2; - tmpreg[nreg]->y2 = current_region.y2; - tmpreg[nreg]->rlit = $5; - tmpreg[nreg]->rtype = $7; - if($8 & 1) tmpreg[nreg]->rtype += MAXRTYPE+1; - tmpreg[nreg]->rirreg = (($8 & 2) != 0); - if(current_region.x1 > current_region.x2 || - current_region.y1 > current_region.y2) - yyerror("Region start > end!"); - if(tmpreg[nreg]->rtype == VAULT && - (tmpreg[nreg]->rirreg || - (tmpreg[nreg]->x2 - tmpreg[nreg]->x1 != 1) || - (tmpreg[nreg]->y2 - tmpreg[nreg]->y1 != 1))) - yyerror("Vaults must be exactly 2x2!"); - if(want_warnings && !tmpreg[nreg]->rirreg && - current_region.x1 > 0 && current_region.y1 > 0 && - current_region.x2 < (int)max_x_map && - current_region.y2 < (int)max_y_map) { - /* check for walls in the room */ - char ebuf[60]; - register int x, y, nrock = 0; - - for(y=current_region.y1; y<=current_region.y2; y++) - for(x=current_region.x1; - x<=current_region.x2; x++) - if(IS_ROCK(tmpmap[y][x]) || - IS_DOOR(tmpmap[y][x])) nrock++; - if(nrock) { - Sprintf(ebuf, - "Rock in room (%02d,%02d,%02d,%02d)?!", - current_region.x1, current_region.y1, - current_region.x2, current_region.y2); - yywarning(ebuf); - } - if ( - !IS_ROCK(tmpmap[current_region.y1-1][current_region.x1-1]) || - !IS_ROCK(tmpmap[current_region.y2+1][current_region.x1-1]) || - !IS_ROCK(tmpmap[current_region.y1-1][current_region.x2+1]) || - !IS_ROCK(tmpmap[current_region.y2+1][current_region.x2+1])) { - Sprintf(ebuf, - "NonRock edge in room (%02d,%02d,%02d,%02d)?!", - current_region.x1, current_region.y1, - current_region.x2, current_region.y2); - yywarning(ebuf); - } - } else if(tmpreg[nreg]->rirreg && - !IS_ROOM(tmpmap[current_region.y1][current_region.x1])) { - char ebuf[60]; - Sprintf(ebuf, - "Rock in irregular room (%02d,%02d)?!", - current_region.x1, current_region.y1); - yyerror(ebuf); - } - nreg++; - if (nreg >= MAX_OF_TYPE) { - yyerror("Too many regions in mazepart!"); - nreg--; - } + add_opvars(splev, "o", SPO_NON_PASSWALL); } ; -altar_detail : ALTAR_ID ':' coordinate ',' alignment ',' altar_type +region_detail : REGION_ID ':' region_or_var ',' light_state ',' room_type optroomregionflags { - tmpaltar[naltar] = New(altar); - tmpaltar[naltar]->x = current_coord.x; - tmpaltar[naltar]->y = current_coord.y; - tmpaltar[naltar]->align = $5; - tmpaltar[naltar]->shrine = $7; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Altar"); - naltar++; - if (naltar >= MAX_OF_TYPE) { - yyerror("Too many altars in room or mazepart!"); - naltar--; - } + long irr; + long rt = $7; + long flags = $8; + if (flags == -1) flags = (1 << 0); + if (!(( flags ) & 1)) rt += MAXRTYPE+1; + irr = ((( flags ) & 2) != 0); + add_opvars(splev, "iiio", + (long)$5, rt, flags, SPO_REGION); + $$ = (irr || (flags & 1) || rt != OROOM); + break_stmt_start(); + } + region_detail_end + { + break_stmt_end(splev); + if ( $9 ) { + add_opcode(splev, SPO_ENDROOM, NULL); + } else if ( $10 ) + lc_error("Cannot use lev statements in non-permanent REGION"); } ; -gold_detail : GOLD_ID ':' amount ',' coordinate +region_detail_end : /* nothing */ { - tmpgold[ngold] = New(gold); - tmpgold[ngold]->x = current_coord.x; - tmpgold[ngold]->y = current_coord.y; - tmpgold[ngold]->amount = $3; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Gold"); - ngold++; - if (ngold >= MAX_OF_TYPE) { - yyerror("Too many golds in room or mazepart!"); - ngold--; - } + $$ = 0; + } + | stmt_block + { + $$ = $1; } ; -engraving_detail: ENGRAVING_ID ':' coordinate ',' engraving_type ',' string +altar_detail : ALTAR_ID ':' coord_or_var ',' alignment ',' altar_type { - tmpengraving[nengraving] = New(engraving); - tmpengraving[nengraving]->x = current_coord.x; - tmpengraving[nengraving]->y = current_coord.y; - tmpengraving[nengraving]->engr.str = $7; - tmpengraving[nengraving]->etype = $5; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Engraving"); - nengraving++; - if (nengraving >= MAX_OF_TYPE) { - yyerror("Too many engravings in room or mazepart!"); - nengraving--; - } + add_opvars(splev, "iio", (long)$7, (long)$5, SPO_ALTAR); } ; -monster_c : monster - | RANDOM_TYPE +grave_detail : GRAVE_ID ':' coord_or_var ',' string_expr { - $$ = - MAX_REGISTERS - 1; + add_opvars(splev, "io", 2, SPO_GRAVE); } - | m_register - ; - -object_c : object - | RANDOM_TYPE + | GRAVE_ID ':' coord_or_var ',' RANDOM_TYPE { - $$ = - MAX_REGISTERS - 1; + add_opvars(splev, "sio", + (char *)0, 1, SPO_GRAVE); } - | o_register - ; - -m_name : string - | RANDOM_TYPE + | GRAVE_ID ':' coord_or_var { - $$ = (char *) 0; + add_opvars(splev, "sio", + (char *)0, 0, SPO_GRAVE); } ; -o_name : string - | RANDOM_TYPE +gold_detail : GOLD_ID ':' math_expr_var ',' coord_or_var { - $$ = (char *) 0; + add_opvars(splev, "o", SPO_GOLD); } ; -trap_name : string +engraving_detail: ENGRAVING_ID ':' coord_or_var ',' engraving_type ',' string_expr + { + add_opvars(splev, "io", + (long)$5, SPO_ENGRAVING); + } + ; + +mineralize : MINERALIZE_ID ':' integer_or_var ',' integer_or_var ',' integer_or_var ',' integer_or_var + { + add_opvars(splev, "o", SPO_MINERALIZE); + } + | MINERALIZE_ID + { + add_opvars(splev, "iiiio", -1L, -1L, -1L, -1L, SPO_MINERALIZE); + } + ; + +trap_name : STRING { int token = get_trap_type($1); if (token == ERR) - yyerror("Unknown trap type!"); - $$ = token; + lc_error("Unknown trap type '%s'!", $1); + $$ = token; Free($1); } | RANDOM_TYPE ; -room_type : string +room_type : STRING { int token = get_room_type($1); if (token == ERR) { - yywarning("Unknown room type! Making ordinary room..."); - $$ = OROOM; + lc_warning("Unknown room type \"%s\"! Making ordinary room...", $1); + $$ = OROOM; } else - $$ = token; + $$ = token; Free($1); } | RANDOM_TYPE ; -prefilled : /* empty */ +optroomregionflags : /* empty */ { - $$ = 0; + $$ = -1; } - | ',' FILLING + | ',' roomregionflags { - $$ = $2; - } - | ',' FILLING ',' BOOLEAN - { - $$ = $2 + ($4 << 1); + $$ = $2; } ; -coordinate : coord - | p_register - | RANDOM_TYPE +roomregionflags : roomregionflag { - current_coord.x = current_coord.y = -MAX_REGISTERS-1; + $$ = $1; + } + | roomregionflag ',' roomregionflags + { + $$ = $1 | $3; + } + ; + +/* 0 is the "default" here */ +roomregionflag : FILLING + { + $$ = ($1 << 0); + } + | IRREGULAR + { + $$ = ($1 << 1); + } + | JOINED + { + $$ = ($1 << 2); } ; @@ -1577,7 +1927,15 @@ alignment : ALIGNMENT | a_register | RANDOM_TYPE { - $$ = - MAX_REGISTERS - 1; + $$ = - MAX_REGISTERS - 1; + } + ; + +alignment_prfx : ALIGNMENT + | a_register + | A_REGISTER ':' RANDOM_TYPE + { + $$ = - MAX_REGISTERS - 1; } ; @@ -1585,99 +1943,555 @@ altar_type : ALTAR_TYPE | RANDOM_TYPE ; -p_register : P_REGISTER '[' INTEGER ']' - { - if ( $3 >= MAX_REGISTERS ) - yyerror("Register Index overflow!"); - else - current_coord.x = current_coord.y = - $3 - 1; - } - ; - -o_register : O_REGISTER '[' INTEGER ']' - { - if ( $3 >= MAX_REGISTERS ) - yyerror("Register Index overflow!"); - else - $$ = - $3 - 1; - } - ; - -m_register : M_REGISTER '[' INTEGER ']' - { - if ( $3 >= MAX_REGISTERS ) - yyerror("Register Index overflow!"); - else - $$ = - $3 - 1; - } - ; - a_register : A_REGISTER '[' INTEGER ']' { if ( $3 >= 3 ) - yyerror("Register Index overflow!"); + lc_error("Register Index overflow!"); else - $$ = - $3 - 1; + $$ = - $3 - 1; } ; -place : coord - ; - -monster : CHAR +string_or_var : STRING { - if (check_monster_char((char) $1)) - $$ = $1 ; - else { - yyerror("Unknown monster class!"); - $$ = ERR; - } + add_opvars(splev, "s", $1); + Free($1); } - ; - -object : CHAR + | VARSTRING_STRING { - char c = $1; - if (check_object_char(c)) - $$ = c; - else { - yyerror("Unknown char class!"); - $$ = ERR; - } + check_vardef_type(variable_definitions, $1, SPOVAR_STRING); + vardef_used(variable_definitions, $1); + add_opvars(splev, "v", $1); + Free($1); + } + | VARSTRING_STRING_ARRAY '[' math_expr_var ']' + { + check_vardef_type(variable_definitions, $1, SPOVAR_STRING|SPOVAR_ARRAY); + vardef_used(variable_definitions, $1); + add_opvars(splev, "v", $1); + Free($1); } ; -string : STRING + +integer_or_var : math_expr_var + { + /* nothing */ + } ; -amount : INTEGER +coord_or_var : encodecoord + { + add_opvars(splev, "c", $1); + } + | rndcoord_ID '(' ter_selection ')' + { + add_opvars(splev, "o", SPO_SEL_RNDCOORD); + } + | VARSTRING_COORD + { + check_vardef_type(variable_definitions, $1, SPOVAR_COORD); + vardef_used(variable_definitions, $1); + add_opvars(splev, "v", $1); + Free($1); + } + | VARSTRING_COORD_ARRAY '[' math_expr_var ']' + { + check_vardef_type(variable_definitions, $1, SPOVAR_COORD|SPOVAR_ARRAY); + vardef_used(variable_definitions, $1); + add_opvars(splev, "v", $1); + Free($1); + } + ; + +encodecoord : '(' INTEGER ',' INTEGER ')' + { + if ($2 < 0 || $4 < 0 || $2 >= COLNO || $4 >= ROWNO) + lc_error("Coordinates (%li,%li) out of map range!", $2, $4); + $$ = SP_COORD_PACK($2, $4); + } | RANDOM_TYPE + { + $$ = SP_COORD_PACK_RANDOM(0); + } + | RANDOM_TYPE_BRACKET humidity_flags ']' + { + $$ = SP_COORD_PACK_RANDOM( $2 ); + } ; -chance : /* empty */ +humidity_flags : HUMIDITY_TYPE { - $$ = 100; /* default is 100% */ + $$ = $1; } - | PERCENT + | HUMIDITY_TYPE ',' humidity_flags { - if ($1 <= 0 || $1 > 100) - yyerror("Expected percentile chance."); - $$ = $1; + if (($1 & $3)) + lc_warning("Humidity flag used twice."); + $$ = ($1 | $3); } ; +region_or_var : encoderegion + { + /* nothing */ + } + | VARSTRING_REGION + { + check_vardef_type(variable_definitions, $1, SPOVAR_REGION); + vardef_used(variable_definitions, $1); + add_opvars(splev, "v", $1); + Free($1); + } + | VARSTRING_REGION_ARRAY '[' math_expr_var ']' + { + check_vardef_type(variable_definitions, $1, SPOVAR_REGION|SPOVAR_ARRAY); + vardef_used(variable_definitions, $1); + add_opvars(splev, "v", $1); + Free($1); + } + ; + +encoderegion : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')' + { + long r = SP_REGION_PACK($2, $4, $6, $8); + if ( $2 > $6 || $4 > $8 ) + lc_error("Region start > end: (%li,%li,%li,%li)!", $2, $4, $6, $8); + + add_opvars(splev, "r", r); + $$ = r; + } + ; + +mapchar_or_var : mapchar + { + add_opvars(splev, "m", $1); + } + | VARSTRING_MAPCHAR + { + check_vardef_type(variable_definitions, $1, SPOVAR_MAPCHAR); + vardef_used(variable_definitions, $1); + add_opvars(splev, "v", $1); + Free($1); + } + | VARSTRING_MAPCHAR_ARRAY '[' math_expr_var ']' + { + check_vardef_type(variable_definitions, $1, SPOVAR_MAPCHAR|SPOVAR_ARRAY); + vardef_used(variable_definitions, $1); + add_opvars(splev, "v", $1); + Free($1); + } + ; + +mapchar : CHAR + { + if (what_map_char((char) $1) != INVALID_TYPE) + $$ = SP_MAPCHAR_PACK(what_map_char((char) $1), -2); + else { + lc_error("Unknown map char type '%c'!", $1); + $$ = SP_MAPCHAR_PACK(STONE, -2); + } + } + | '(' CHAR ',' light_state ')' + { + if (what_map_char((char) $2) != INVALID_TYPE) + $$ = SP_MAPCHAR_PACK(what_map_char((char) $2), $4); + else { + lc_error("Unknown map char type '%c'!", $2); + $$ = SP_MAPCHAR_PACK(STONE, $4); + } + } + ; + +monster_or_var : encodemonster + { + add_opvars(splev, "M", $1); + } + | VARSTRING_MONST + { + check_vardef_type(variable_definitions, $1, SPOVAR_MONST); + vardef_used(variable_definitions, $1); + add_opvars(splev, "v", $1); + Free($1); + } + | VARSTRING_MONST_ARRAY '[' math_expr_var ']' + { + check_vardef_type(variable_definitions, $1, SPOVAR_MONST|SPOVAR_ARRAY); + vardef_used(variable_definitions, $1); + add_opvars(splev, "v", $1); + Free($1); + } + ; + +encodemonster : STRING + { + long m = get_monster_id($1, (char)0); + if (m == ERR) { + lc_error("Unknown monster \"%s\"!", $1); + $$ = -1; + } else + $$ = SP_MONST_PACK(m, def_monsyms[(int)mons[m].mlet].sym); + } + | CHAR + { + if (check_monster_char((char) $1)) + $$ = SP_MONST_PACK(-1, $1); + else { + lc_error("Unknown monster class '%c'!", $1); + $$ = -1; + } + } + | '(' CHAR ',' STRING ')' + { + long m = get_monster_id($4, (char) $2); + if (m == ERR) { + lc_error("Unknown monster ('%c', \"%s\")!", $2, $4); + $$ = -1; + } else + $$ = SP_MONST_PACK(m, $2); + } + | RANDOM_TYPE + { + $$ = -1; + } + ; + +object_or_var : encodeobj + { + add_opvars(splev, "O", $1); + } + | VARSTRING_OBJ + { + check_vardef_type(variable_definitions, $1, SPOVAR_OBJ); + vardef_used(variable_definitions, $1); + add_opvars(splev, "v", $1); + Free($1); + } + | VARSTRING_OBJ_ARRAY '[' math_expr_var ']' + { + check_vardef_type(variable_definitions, $1, SPOVAR_OBJ|SPOVAR_ARRAY); + vardef_used(variable_definitions, $1); + add_opvars(splev, "v", $1); + Free($1); + } + ; + +encodeobj : STRING + { + long m = get_object_id($1, (char)0); + if (m == ERR) { + lc_error("Unknown object \"%s\"!", $1); + $$ = -1; + } else + $$ = SP_OBJ_PACK(m, 1); /* obj class != 0 to force generation of a specific item */ + + } + | CHAR + { + if (check_object_char((char) $1)) + $$ = SP_OBJ_PACK(-1, $1); + else { + lc_error("Unknown object class '%c'!", $1); + $$ = -1; + } + } + | '(' CHAR ',' STRING ')' + { + long m = get_object_id($4, (char) $2); + if (m == ERR) { + lc_error("Unknown object ('%c', \"%s\")!", $2, $4); + $$ = -1; + } else + $$ = SP_OBJ_PACK(m, $2); + } + | RANDOM_TYPE + { + $$ = -1; + } + ; + + +string_expr : string_or_var { } + | string_expr '.' string_or_var + { + add_opvars(splev, "o", SPO_MATH_ADD); + } + ; + +math_expr_var : INTEGER { add_opvars(splev, "i", $1 ); } + | dice { is_inconstant_number = 1; } + | '(' MINUS_INTEGER ')' { add_opvars(splev, "i", $2 ); } + | VARSTRING_INT + { + check_vardef_type(variable_definitions, $1, SPOVAR_INT); + vardef_used(variable_definitions, $1); + add_opvars(splev, "v", $1); + Free($1); + is_inconstant_number = 1; + } + | VARSTRING_INT_ARRAY '[' math_expr_var ']' + { + check_vardef_type(variable_definitions, $1, SPOVAR_INT|SPOVAR_ARRAY); + vardef_used(variable_definitions, $1); + add_opvars(splev, "v", $1); + Free($1); + is_inconstant_number = 1; + } + | math_expr_var '+' math_expr_var { add_opvars(splev, "o", SPO_MATH_ADD); } + | math_expr_var '-' math_expr_var { add_opvars(splev, "o", SPO_MATH_SUB); } + | math_expr_var '*' math_expr_var { add_opvars(splev, "o", SPO_MATH_MUL); } + | math_expr_var '/' math_expr_var { add_opvars(splev, "o", SPO_MATH_DIV); } + | math_expr_var '%' math_expr_var { add_opvars(splev, "o", SPO_MATH_MOD); } + | '(' math_expr_var ')' { } + ; + +func_param_type : CFUNC_INT + { + if (!strcmp("int", $1) || !strcmp("integer", $1)) { + $$ = (int)'i'; + } else lc_error("Unknown function parameter type '%s'", $1); + } + | CFUNC_STR + { + if (!strcmp("str", $1) || !strcmp("string", $1)) { + $$ = (int)'s'; + } else lc_error("Unknown function parameter type '%s'", $1); + } + ; + +func_param_part : any_var_or_arr ':' func_param_type + { + struct lc_funcdefs_parm *tmp = New(struct lc_funcdefs_parm); + + if (!curr_function) + lc_error("Function parameters outside function definition."); + else if (!tmp) + lc_error("Could not alloc function params."); + else { + tmp->name = strdup($1); + tmp->parmtype = (char) $3; + tmp->next = curr_function->params; + curr_function->params = tmp; + curr_function->n_params++; + { + long vt; + switch (tmp->parmtype) { + case 'i': vt = SPOVAR_INT; break; + case 's': vt = SPOVAR_STRING; break; + default: lc_error("Unknown func param conversion."); break; + } + variable_definitions = add_vardef_type(variable_definitions, $1, vt); + } + } + Free($1); + } + ; + + +func_param_list : func_param_part + | func_param_list ',' func_param_part + ; + +func_params_list : /* nothing */ + | func_param_list + ; + +func_call_param_part : math_expr_var + { + $$ = (int)'i'; + } + | string_expr + { + $$ = (int)'s'; + } + ; + + +func_call_param_list : func_call_param_part + { + char tmpbuf[2]; + tmpbuf[0] = (char) $1; + tmpbuf[1] = '\0'; + $$ = strdup(tmpbuf); + } + | func_call_param_list ',' func_call_param_part + { + long len = strlen( $1 ); + char *tmp = (char *)alloc(len + 2); + sprintf(tmp, "%c%s", (char) $3, $1 ); + Free( $1 ); + $$ = tmp; + } + ; + +func_call_params_list : /* nothing */ + { + $$ = strdup(""); + } + | func_call_param_list + { + char *tmp = strdup( $1 ); + Free( $1 ); + $$ = tmp; + } + ; + +ter_selection_x : coord_or_var + { + add_opvars(splev, "o", SPO_SEL_POINT); + } + | rect_ID region_or_var + { + add_opvars(splev, "o", SPO_SEL_RECT); + } + | fillrect_ID region_or_var + { + add_opvars(splev, "o", SPO_SEL_FILLRECT); + } + | line_ID coord_or_var '-' coord_or_var + { + add_opvars(splev, "o", SPO_SEL_LINE); + } + | randline_ID coord_or_var '-' coord_or_var ',' math_expr_var + { + /* randline (x1,y1),(x2,y2), roughness */ + add_opvars(splev, "o", SPO_SEL_RNDLINE); + } + | grow_ID '(' ter_selection ')' + { + add_opvars(splev, "io", W_ANY, SPO_SEL_GROW); + } + | grow_ID '(' dir_list ',' ter_selection ')' + { + add_opvars(splev, "io", $3, SPO_SEL_GROW); + } + | filter_ID '(' SPERCENT ',' ter_selection ')' + { + add_opvars(splev, "iio", $3, SPOFILTER_PERCENT, SPO_SEL_FILTER); + } + | filter_ID '(' ter_selection ',' ter_selection ')' + { + add_opvars(splev, "io", SPOFILTER_SELECTION, SPO_SEL_FILTER); + } + | filter_ID '(' mapchar_or_var ',' ter_selection ')' + { + add_opvars(splev, "io", SPOFILTER_MAPCHAR, SPO_SEL_FILTER); + } + | flood_ID coord_or_var + { + add_opvars(splev, "o", SPO_SEL_FLOOD); + } + | circle_ID '(' coord_or_var ',' math_expr_var ')' + { + add_opvars(splev, "oio", SPO_COPY, 1, SPO_SEL_ELLIPSE); + } + | circle_ID '(' coord_or_var ',' math_expr_var ',' FILLING ')' + { + add_opvars(splev, "oio", SPO_COPY, $7, SPO_SEL_ELLIPSE); + } + | ellipse_ID '(' coord_or_var ',' math_expr_var ',' math_expr_var ')' + { + add_opvars(splev, "io", 1, SPO_SEL_ELLIPSE); + } + | ellipse_ID '(' coord_or_var ',' math_expr_var ',' math_expr_var ',' FILLING ')' + { + add_opvars(splev, "io", $9, SPO_SEL_ELLIPSE); + } + | gradient_ID '(' GRADIENT_TYPE ',' '(' math_expr_var '-' math_expr_var opt_limited ')' ',' coord_or_var opt_coord_or_var ')' + { + add_opvars(splev, "iio", $9, $3, SPO_SEL_GRADIENT); + } + | complement_ID ter_selection_x + { + add_opvars(splev, "o", SPO_SEL_COMPLEMENT); + } + | VARSTRING_SEL + { + check_vardef_type(variable_definitions, $1, SPOVAR_SEL); + vardef_used(variable_definitions, $1); + add_opvars(splev, "v", $1); + Free($1); + } + | '(' ter_selection ')' + { + /* nothing */ + } + ; + +ter_selection : ter_selection_x + { + /* nothing */ + } + | ter_selection_x '&' ter_selection + { + add_opvars(splev, "o", SPO_SEL_ADD); + } + ; + +dice : DICE + { + add_opvars(splev, "iio", $1.num, $1.die, SPO_DICE); + } + ; + +all_integers : MINUS_INTEGER + | PLUS_INTEGER + | INTEGER + ; + +all_ints_push : MINUS_INTEGER + { + add_opvars(splev, "i", $1 ); + } + | PLUS_INTEGER + { + add_opvars(splev, "i", $1 ); + } + | INTEGER + { + add_opvars(splev, "i", $1 ); + } + | dice + { + /* nothing */ + } + ; + +objectid : object_ID + | OBJECT_ID + ; + +monsterid : monster_ID + | MONSTER_ID + ; + +terrainid : terrain_ID + | TERRAIN_ID + ; + engraving_type : ENGRAVING_TYPE | RANDOM_TYPE ; -coord : '(' INTEGER ',' INTEGER ')' +lev_region : region { - if (!in_room && !init_lev.init_present && - ($2 < 0 || $2 > (int)max_x_map || - $4 < 0 || $4 > (int)max_y_map)) - yyerror("Coordinates out of map range!"); - current_coord.x = $2; - current_coord.y = $4; + $$ = $1; + } + | LEV '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')' + { + if ($3 <= 0 || $3 >= COLNO) + lc_error("Region (%li,%li,%li,%li) out of level range (x1)!", $3, $5, $7, $9); + else if ($5 < 0 || $5 >= ROWNO) + lc_error("Region (%li,%li,%li,%li) out of level range (y1)!", $3, $5, $7, $9); + else if ($7 <= 0 || $7 >= COLNO) + lc_error("Region (%li,%li,%li,%li) out of level range (x2)!", $3, $5, $7, $9); + else if ($9 < 0 || $9 >= ROWNO) + lc_error("Region (%li,%li,%li,%li) out of level range (y2)!", $3, $5, $7, $9); + $$.x1 = $3; + $$.y1 = $5; + $$.x2 = $7; + $$.y2 = $9; + $$.area = 1; } ; @@ -1686,20 +2500,22 @@ region : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')' /* This series of if statements is a hack for MSC 5.1. It seems that its tiny little brain cannot compile if these are all one big if statement. */ if ($2 < 0 || $2 > (int)max_x_map) - yyerror("Region out of map range!"); + lc_error("Region (%li,%li,%li,%li) out of map range (x1)!", $2, $4, $6, $8); else if ($4 < 0 || $4 > (int)max_y_map) - yyerror("Region out of map range!"); + lc_error("Region (%li,%li,%li,%li) out of map range (y1)!", $2, $4, $6, $8); else if ($6 < 0 || $6 > (int)max_x_map) - yyerror("Region out of map range!"); + lc_error("Region (%li,%li,%li,%li) out of map range (x2)!", $2, $4, $6, $8); else if ($8 < 0 || $8 > (int)max_y_map) - yyerror("Region out of map range!"); - current_region.x1 = $2; - current_region.y1 = $4; - current_region.x2 = $6; - current_region.y2 = $8; + lc_error("Region (%li,%li,%li,%li) out of map range (y2)!", $2, $4, $6, $8); + $$.area = 0; + $$.x1 = $2; + $$.y1 = $4; + $$.x2 = $6; + $$.y2 = $8; } ; + %% /*lev_comp.y*/ diff --git a/util/lev_main.c b/util/lev_main.c index fa539f5e2..1045bdf34 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -11,6 +11,8 @@ #define SPEC_LEV /* for MPW */ /* although, why don't we move those special defines here.. and in dgn_main? */ +#include + #include "hack.h" #include "date.h" #include "sp_lev.h" @@ -90,27 +92,34 @@ int FDECL(get_object_id, (char *,CHAR_P)); boolean FDECL(check_monster_char, (CHAR_P)); boolean FDECL(check_object_char, (CHAR_P)); char FDECL(what_map_char, (CHAR_P)); -void FDECL(scan_map, (char *)); -void NDECL(wallify_map); +void FDECL(scan_map, (char *, sp_lev *)); boolean NDECL(check_subrooms); -void FDECL(check_coord, (int,int,const char *)); -void NDECL(store_part); -void NDECL(store_room); -boolean FDECL(write_level_file, (char *,splev *,specialmaze *)); -void FDECL(free_rooms, (splev *)); +boolean FDECL(write_level_file, (char *,sp_lev *)); + +struct lc_funcdefs *FDECL(funcdef_new,(long,char *)); +void FDECL(funcdef_free_all,(struct lc_funcdefs *)); +struct lc_funcdefs *FDECL(funcdef_defined,(struct lc_funcdefs *,char *, int)); + +struct lc_vardefs *FDECL(vardef_new,(long,char *)); +void FDECL(vardef_free_all,(struct lc_vardefs *)); +struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); + +void FDECL(splev_add_from, (sp_lev *, sp_lev *)); extern void NDECL(monst_init); extern void NDECL(objects_init); extern void NDECL(decl_init); -static boolean FDECL(write_common_data, (int,int,lev_init *,long)); -static boolean FDECL(write_monsters, (int,char *,monster ***)); -static boolean FDECL(write_objects, (int,char *,object ***)); -static boolean FDECL(write_engravings, (int,char *,engraving ***)); -static boolean FDECL(write_maze, (int,specialmaze *)); -static boolean FDECL(write_rooms, (int,splev *)); +void FDECL(add_opcode, (sp_lev *, int, genericptr_t)); + +static boolean FDECL(write_common_data, (int,sp_lev *)); +static boolean FDECL(write_maze, (int,sp_lev *)); static void NDECL(init_obj_classes); +void VDECL(lc_error, (const char *, ...)); +void VDECL(add_opvars, (sp_lev *, const char *, ...)); + + static struct { const char *name; int type; @@ -176,47 +185,27 @@ static struct { const char *fname = "(stdin)"; int fatal_error = 0; -int want_warnings = 0; +int got_errors = 0; +int be_verbose = 0; +int fname_counter = 1; #ifdef FLEX23_BUG /* Flex 2.3 bug work around; not needed for 2.3.6 or later */ int yy_more_len = 0; #endif -extern char tmpmessage[]; -extern altar *tmpaltar[]; -extern lad *tmplad[]; -extern stair *tmpstair[]; -extern digpos *tmpdig[]; -extern digpos *tmppass[]; -extern char *tmpmap[]; -extern region *tmpreg[]; -extern lev_region *tmplreg[]; -extern door *tmpdoor[]; -extern room_door *tmprdoor[]; -extern trap *tmptrap[]; -extern monster *tmpmonst[]; -extern object *tmpobj[]; -extern drawbridge *tmpdb[]; -extern walk *tmpwalk[]; -extern gold *tmpgold[]; -extern fountain *tmpfountain[]; -extern sink *tmpsink[]; -extern pool *tmppool[]; -extern engraving *tmpengraving[]; -extern mazepart *tmppart[]; -extern room *tmproom[]; - -extern int n_olist, n_mlist, n_plist; - -extern unsigned int nlreg, nreg, ndoor, ntrap, nmons, nobj; -extern unsigned int ndb, nwalk, npart, ndig, npass, nlad, nstair; -extern unsigned int naltar, ncorridor, nrooms, ngold, nengraving; -extern unsigned int nfountain, npool, nsink; - extern unsigned int max_x_map, max_y_map; -extern int nh_line_number, colon_line_number; +extern int nh_line_number; + +extern int token_start_pos; +extern char curr_token[512]; + +struct lc_vardefs *variable_definitions = NULL; +struct lc_funcdefs *function_definitions = NULL; + +extern int allow_break_statements; +extern struct lc_breakdef *break_list; int main(argc, argv) @@ -276,8 +265,8 @@ char **argv; } else { /* Otherwise every argument is a filename */ for(i=1; i 0) { + if (fatal_error > 0 || got_errors > 0) { errors_encountered = TRUE; fatal_error = 0; } @@ -314,8 +304,14 @@ void yyerror(s) const char *s; { - (void) fprintf(stderr, "%s: line %d : %s\n", fname, - (*s >= 'A' && *s <= 'Z') ? colon_line_number : nh_line_number, s); + char *e = ((char *)s + strlen(s) - 1); + (void) fprintf(stderr, "%s: line %d, pos %d: %s", + fname, nh_line_number, + token_start_pos-strlen(curr_token), s); + if (*e != '.' && *e != '!') + (void) fprintf(stderr, " at \"%s\"", curr_token); + (void) fprintf(stderr, "\n"); + if (++fatal_error > MAX_ERRORS) { (void) fprintf(stderr,"Too many errors, good bye!\n"); exit(EXIT_FAILURE); @@ -330,7 +326,7 @@ yywarning(s) const char *s; { (void) fprintf(stderr, "%s: line %d : WARNING : %s\n", - fname, colon_line_number, s); + fname, nh_line_number, s); } /* @@ -342,6 +338,586 @@ yywrap() return 1; } +void +lc_error(const char *fmt, ...) +{ + char buf[512]; + va_list argp; + + va_start(argp, fmt); + (void) vsnprintf(buf, 511, fmt, argp); + va_end(argp); + + yyerror(buf); +} + +void +lc_warning(const char *fmt, ...) +{ + char buf[512]; + va_list argp; + + va_start(argp, fmt); + (void) vsnprintf(buf, 511, fmt, argp); + va_end(argp); + + yywarning(buf); +} + + +char * +decode_parm_chr(chr) +char chr; +{ + static char buf[32]; + switch (chr) { + default: sprintf(buf, "unknown"); break; + case 'i': sprintf(buf, "int"); break; + case 'r': sprintf(buf, "region"); break; + case 's': sprintf(buf, "str"); break; + case 'O': sprintf(buf, "obj"); break; + case 'c': sprintf(buf, "coord"); break; + case ' ': sprintf(buf, "nothing"); break; + case 'm': sprintf(buf, "mapchar"); break; + case 'M': sprintf(buf, "monster"); break; + } + return buf; +} + +char * +decode_parm_str(str) +char *str; +{ + static char tmpbuf[1024]; + char *p = str; + tmpbuf[0] = '\0'; + if (str) { + for ( ; *p; p++) { + Strcat(tmpbuf, decode_parm_chr(*p)); + if (*(p + 1)) Strcat(tmpbuf, ", "); + } + } + return tmpbuf; +} + + +struct opvar * +set_opvar_int(ov, val) +struct opvar *ov; +long val; +{ + if (ov) { + ov->spovartyp = SPOVAR_INT; + ov->vardata.l = val; + } + return ov; +} + +struct opvar * +set_opvar_coord(ov, val) +struct opvar *ov; +long val; +{ + if (ov) { + ov->spovartyp = SPOVAR_COORD; + ov->vardata.l = val; + } + return ov; +} + +struct opvar * +set_opvar_region(ov, val) +struct opvar *ov; +long val; +{ + if (ov) { + ov->spovartyp = SPOVAR_REGION; + ov->vardata.l = val; + } + return ov; +} + +struct opvar * +set_opvar_mapchar(ov, val) +struct opvar *ov; +long val; +{ + if (ov) { + ov->spovartyp = SPOVAR_MAPCHAR; + ov->vardata.l = val; + } + return ov; +} + +struct opvar * +set_opvar_monst(ov, val) +struct opvar *ov; +long val; +{ + if (ov) { + ov->spovartyp = SPOVAR_MONST; + ov->vardata.l = val; + } + return ov; +} + +struct opvar * +set_opvar_obj(ov, val) +struct opvar *ov; +long val; +{ + if (ov) { + ov->spovartyp = SPOVAR_OBJ; + ov->vardata.l = val; + } + return ov; +} + +struct opvar * +set_opvar_str(ov, val) +struct opvar *ov; +char *val; +{ + if (ov) { + ov->spovartyp = SPOVAR_STRING; + ov->vardata.str = (val) ? strdup(val) : NULL; + } + return ov; +} + +struct opvar * +set_opvar_var(ov, val) +struct opvar *ov; +char *val; +{ + if (ov) { + ov->spovartyp = SPOVAR_VARIABLE; + ov->vardata.str = (val) ? strdup(val) : NULL; + } + return ov; +} + +#define New(type) \ + (type *) memset((genericptr_t)alloc(sizeof(type)), 0, sizeof(type)) + +void +add_opvars(sp_lev *sp, const char *fmt, ...) +{ + const char *p; + va_list argp; + + va_start(argp, fmt); + + for(p = fmt; *p != '\0'; p++) { + switch(*p) { + case ' ': break; + case 'i': /* integer */ + { + struct opvar *ov = New(struct opvar); + set_opvar_int(ov, va_arg(argp, long)); + add_opcode(sp, SPO_PUSH, ov); + break; + } + case 'c': /* coordinate */ + { + struct opvar *ov = New(struct opvar); + set_opvar_coord(ov, va_arg(argp, long)); + add_opcode(sp, SPO_PUSH, ov); + break; + } + case 'r': /* region */ + { + struct opvar *ov = New(struct opvar); + set_opvar_region(ov, va_arg(argp, long)); + add_opcode(sp, SPO_PUSH, ov); + break; + } + case 'm': /* mapchar */ + { + struct opvar *ov = New(struct opvar); + set_opvar_mapchar(ov, va_arg(argp, long)); + add_opcode(sp, SPO_PUSH, ov); + break; + } + case 'M': /* monster */ + { + struct opvar *ov = New(struct opvar); + set_opvar_monst(ov, va_arg(argp, long)); + add_opcode(sp, SPO_PUSH, ov); + break; + } + case 'O': /* object */ + { + struct opvar *ov = New(struct opvar); + set_opvar_obj(ov, va_arg(argp, long)); + add_opcode(sp, SPO_PUSH, ov); + break; + } + case 's': /* string */ + { + struct opvar *ov = New(struct opvar); + set_opvar_str(ov, va_arg(argp, char *)); + add_opcode(sp, SPO_PUSH, ov); + break; + } + case 'v': /* variable */ + { + struct opvar *ov = New(struct opvar); + set_opvar_var(ov, va_arg(argp, char *)); + add_opcode(sp, SPO_PUSH, ov); + break; + } + case 'o': /* opcode */ + { + long i = va_arg(argp, int); + if (i < 0 || i >= MAX_SP_OPCODES) + fprintf(stderr, "add_opvars: unknown opcode '%li'.\n", i); + add_opcode(sp, i, NULL); + break; + } + default: + fprintf(stderr, "add_opvars: illegal format character '%c'.\n", *p); + break; + } + } + + va_end(argp); +} + +void +break_stmt_start() +{ + allow_break_statements++; +} + +void +break_stmt_end(splev) + sp_lev *splev; +{ + struct lc_breakdef *tmp = break_list; + struct lc_breakdef *prv = NULL; + while (tmp) { + if (tmp->break_depth == allow_break_statements) { + struct lc_breakdef *nxt = tmp->next; + set_opvar_int(tmp->breakpoint, splev->n_opcodes - tmp->breakpoint->vardata.l-1); + tmp->next = NULL; + Free(tmp); + if (!prv) break_list = NULL; + else prv->next = nxt; + tmp = nxt; + } else { + prv = tmp; + tmp = tmp->next; + } + } + allow_break_statements--; +} + +void +break_stmt_new(splev,i) + sp_lev *splev; + long i; +{ + struct lc_breakdef *tmp = New(struct lc_breakdef); + tmp->breakpoint = New(struct opvar); + tmp->break_depth = allow_break_statements; + tmp->next = break_list; + break_list = tmp; + set_opvar_int(tmp->breakpoint, i); + add_opcode(splev, SPO_PUSH, tmp->breakpoint); + add_opcode(splev, SPO_JMP, NULL); +} + +struct lc_funcdefs * +funcdef_new(addr, name) + long addr; + char *name; +{ + struct lc_funcdefs *f = New(struct lc_funcdefs); + if (!f) { + lc_error("Could not alloc function definition for '%s'.", name); + return NULL; + } + f->next = NULL; + f->addr = addr; + f->name = strdup(name); + f->n_called = 0; + f->n_params = 0; + f->params = NULL; + f->code.opcodes = NULL; + f->code.n_opcodes = 0; + return f; +} + +void +funcdef_free_all(fchain) + struct lc_funcdefs *fchain; +{ + struct lc_funcdefs *tmp = fchain; + struct lc_funcdefs *nxt; + struct lc_funcdefs_parm *tmpparam; + while (tmp) { + nxt = tmp->next; + Free(tmp->name); + while (tmp->params) { + tmpparam = tmp->params->next; + Free(tmp->params->name); + tmp->params = tmpparam; + } + /* FIXME: free tmp->code */ + Free(tmp); + tmp = nxt; + } +} + + +char * +funcdef_paramtypes(f) + struct lc_funcdefs *f; +{ + int i = 0; + struct lc_funcdefs_parm *fp = f->params; + char *tmp = (char *)alloc((f->n_params) + 1); + if (!tmp) return NULL; + while (fp) { + tmp[i++] = fp->parmtype; + fp = fp->next; + } + tmp[i] = '\0'; + return tmp; +} + +struct lc_funcdefs * +funcdef_defined(f, name, casesense) + struct lc_funcdefs *f; + char *name; + int casesense; +{ + while (f) { + if (casesense) { + if (!strcmp(name, f->name)) return f; + } else { + if (!strcasecmp(name, f->name)) return f; + } + f = f->next; + } + return NULL; +} + + +struct lc_vardefs * +vardef_new(typ, name) + long typ; + char *name; +{ + struct lc_vardefs *f = New(struct lc_vardefs); + if (!f) { + lc_error("Could not alloc variable definition for '%s'.", name); + return NULL; + } + f->next = NULL; + f->var_type = typ; + f->name = strdup(name); + f->n_used = 0; + return f; +} + +void +vardef_free_all(fchain) + struct lc_vardefs *fchain; +{ + struct lc_vardefs *tmp = fchain; + struct lc_vardefs *nxt; + while (tmp) { + if (be_verbose && (tmp->n_used == 0)) + lc_warning("Unused variable '%s'", tmp->name); + nxt = tmp->next; + Free(tmp->name); + Free(tmp); + tmp = nxt; + } +} + +struct lc_vardefs * +vardef_defined(f, name, casesense) + struct lc_vardefs *f; + char *name; + int casesense; +{ + while (f) { + if (casesense) { + if (!strcmp(name, f->name)) return f; + } else { + if (!strcasecmp(name, f->name)) return f; + } + f = f->next; + } + return NULL; +} + +const char * +spovar2str(spovar) + long spovar; +{ + static int togl = 0; + static char buf[2][128]; + char *n = NULL; + int is_array = (spovar & SPOVAR_ARRAY); + spovar &= ~SPOVAR_ARRAY; + + switch (spovar) { + default: lc_error("spovar2str(%li)", spovar); break; + case SPOVAR_INT: n = "integer"; break; + case SPOVAR_STRING: n = "string"; break; + case SPOVAR_VARIABLE: n = "variable"; break; + case SPOVAR_COORD: n = "coordinate"; break; + case SPOVAR_REGION: n = "region"; break; + case SPOVAR_MAPCHAR: n = "mapchar"; break; + case SPOVAR_MONST: n = "monster"; break; + case SPOVAR_OBJ: n = "object"; break; + } + + togl = ((togl + 1) % 2); + + snprintf(buf[togl], 127, "%s%s", n, (is_array ? " array" : "")); + return buf[togl]; +} + +void +vardef_used(vd, varname) + struct lc_vardefs *vd; + char *varname; +{ + struct lc_vardefs *tmp; + if ((tmp = vardef_defined(vd, varname, 1))) tmp->n_used++; +} + +void +check_vardef_type(vd, varname, vartype) + struct lc_vardefs *vd; + char *varname; + long vartype; +{ + struct lc_vardefs *tmp; + if ((tmp = vardef_defined(vd, varname, 1))) { + if (tmp->var_type != vartype) + lc_error("Trying to use variable '%s' as %s, when it is %s.", + varname, spovar2str(vartype), spovar2str(tmp->var_type)); + } else lc_error("Variable '%s' not defined.", varname); +} + +struct lc_vardefs * +add_vardef_type(vd, varname, vartype) + struct lc_vardefs *vd; + char *varname; + long vartype; +{ + struct lc_vardefs *tmp; + if ((tmp = vardef_defined(vd, varname, 1))) { + if (tmp->var_type != vartype) + lc_error("Trying to redefine variable '%s' as %s, when it is %s.", + varname, spovar2str(vartype), spovar2str(tmp->var_type)); + } else { + tmp = vardef_new(vartype, varname); + tmp->next = vd; + return tmp; + } + return vd; +} + +int +reverse_jmp_opcode(opcode) + int opcode; +{ + switch (opcode) { + case SPO_JE: return SPO_JNE; + case SPO_JNE: return SPO_JE; + case SPO_JL: return SPO_JGE; + case SPO_JG: return SPO_JLE; + case SPO_JLE: return SPO_JG; + case SPO_JGE: return SPO_JL; + default: lc_error("Cannot reverse comparison jmp opcode %i.", opcode); return SPO_NULL; + } +} + +/* basically copied from src/sp_lev.c */ +struct opvar * +opvar_clone(ov) + struct opvar *ov; +{ + if (ov) { + struct opvar *tmpov = (struct opvar *)alloc(sizeof(struct opvar)); + if (!tmpov) panic("could not alloc opvar struct"); + switch (ov->spovartyp) { + case SPOVAR_COORD: + case SPOVAR_REGION: + case SPOVAR_MAPCHAR: + case SPOVAR_MONST: + case SPOVAR_OBJ: + case SPOVAR_INT: + { + tmpov->spovartyp = ov->spovartyp; + tmpov->vardata.l = ov->vardata.l; + } + break; + case SPOVAR_VARIABLE: + case SPOVAR_STRING: + { + int len = strlen(ov->vardata.str); + tmpov->spovartyp = ov->spovartyp; + tmpov->vardata.str = (char *)alloc(len+1); + (void)memcpy((genericptr_t)tmpov->vardata.str, + (genericptr_t)ov->vardata.str, len); + tmpov->vardata.str[len] = '\0'; + } + break; + default: + { + lc_error("Unknown opvar_clone value type (%i)!", ov->spovartyp); + } + } + return tmpov; + } + return NULL; +} + + +void +splev_add_from(splev, from_splev) + sp_lev *splev; + sp_lev *from_splev; +{ + int i; + if (splev && from_splev) + for (i = 0; i < from_splev->n_opcodes; i++) + add_opcode(splev, from_splev->opcodes[i].opcode, opvar_clone(from_splev->opcodes[i].opdat)); +} + + +void +start_level_def(splev, fname) +sp_lev **splev; +char *fname; +{ + struct lc_funcdefs *f; + if (index(fname, '.')) + lc_error("Invalid dot ('.') in level name '%s'.", fname); + if ((int) strlen(fname) > 14) + lc_error("Level names limited to 14 characters ('%s').", fname); + f = function_definitions; + while (f) { + f->n_called = 0; + f = f->next; + } + *splev = (sp_lev *)alloc(sizeof(sp_lev)); + (*splev)->n_opcodes = 0; + (*splev)->opcodes = NULL; + + vardef_free_all(variable_definitions); + variable_definitions = NULL; +} + + /* * Find the type of floor, knowing its char representation. */ @@ -409,6 +985,14 @@ char c; for (i = LOW_PM; i < NUMMONS; i++) if (!class || class == mons[i].mlet) if (!strcmp(s, mons[i].mname)) return i; + /* didn't find it; lets try case insensitive search */ + for (i = LOW_PM; i < NUMMONS; i++) + if (!class || class == mons[i].mlet) + if (!strcasecmp(s, mons[i].mname)) { + if (be_verbose) + lc_warning("Monster type \"%s\" matches \"%s\".", s, mons[i].mname); + return i; + } return ERR; } @@ -433,6 +1017,15 @@ char c; /* class */ if (objname && !strcmp(s, objname)) return i; } + for (i = class ? bases[class] : 0; i < NUM_OBJECTS; i++) { + if (class && objects[i].oc_class != class) break; + objname = obj_descr[i].oc_name; + if (objname && !strcasecmp(s, objname)) { + if (be_verbose) + lc_warning("Object type \"%s\" matches \"%s\".", s, objname); + return i; + } + } return ERR; } @@ -506,19 +1099,50 @@ char c; return(INVALID_TYPE); } +void +add_opcode(sp, opc, dat) +sp_lev *sp; +int opc; +genericptr_t dat; +{ + long nop = sp->n_opcodes; + _opcode *tmp; + + if ((opc < 0) || (opc >= MAX_SP_OPCODES)) + lc_error("Unknown opcode '%i'", opc); + + tmp = (_opcode *)alloc(sizeof(_opcode)*(nop+1)); + if (sp->opcodes && nop) { + (void) memcpy(tmp, sp->opcodes, sizeof(_opcode)*nop); + free(sp->opcodes); + } else if (!tmp) + lc_error("Could not alloc opcode space"); + + sp->opcodes = tmp; + + sp->opcodes[nop].opcode = opc; + sp->opcodes[nop].opdat = dat; + + sp->n_opcodes++; +} + + /* * Yep! LEX gives us the map in a raw mode. * Just analyze it here. */ void -scan_map(map) +scan_map(map, sp) char *map; +sp_lev *sp; { register int i, len; register char *s1, *s2; int max_len = 0; int max_hig = 0; - char msg[256]; + char *tmpmap[ROWNO]; + int dx,dy; + char *mbuf; /* First, strip out digits 0-9 (line numbering) */ for (s1 = s2 = map; *s1; s1++) @@ -553,10 +1177,7 @@ char *map; } for(i=0; i MAP_X_LIM || max_hig > MAP_Y_LIM) { - Sprintf(msg, "Map too large! (max %d x %d)", MAP_X_LIM, MAP_Y_LIM); - yyerror(msg); + lc_error("Map too large at (%d x %d), max is (%d x %d)", max_len, max_hig, MAP_X_LIM, MAP_Y_LIM); } - tmppart[npart]->xsize = max_len; - tmppart[npart]->ysize = max_hig; - tmppart[npart]->map = (char **) alloc(max_hig*sizeof(char *)); - for(i = 0; i< max_hig; i++) - tmppart[npart]->map[i] = tmpmap[i]; + mbuf = (char *) alloc(((max_hig-1) * max_len) + (max_len-1) + 2); + for (dy = 0; dy < max_hig; dy++) + for (dx = 0; dx < max_len; dx++) + mbuf[(dy * max_len) + dx] = (tmpmap[dy][dx] + 1); + + mbuf[((max_hig-1) * max_len) + (max_len-1) + 1] = '\0'; + + add_opvars(sp, "siio", mbuf, max_hig, max_len, SPO_MAP); + + for (dy = 0; dy < max_hig; dy++) + Free(tmpmap[dy]); + Free(mbuf); } -/* - * If we have drawn a map without walls, this allows us to - * auto-magically wallify it. - */ -#define Map_point(x,y) *(tmppart[npart]->map[y] + x) -void -wallify_map() -{ - unsigned int x, y, xx, yy, lo_xx, lo_yy, hi_xx, hi_yy; - for (y = 0; y <= max_y_map; y++) { - SpinCursor(3); - lo_yy = (y > 0) ? y - 1 : 0; - hi_yy = (y < max_y_map) ? y + 1 : max_y_map; - for (x = 0; x <= max_x_map; x++) { - if (Map_point(x,y) != STONE) continue; - lo_xx = (x > 0) ? x - 1 : 0; - hi_xx = (x < max_x_map) ? x + 1 : max_x_map; - for (yy = lo_yy; yy <= hi_yy; yy++) - for (xx = lo_xx; xx <= hi_xx; xx++) - if (IS_ROOM(Map_point(xx,yy)) || - Map_point(xx,yy) == CROSSWALL) { - Map_point(x,y) = (yy != y) ? HWALL : VWALL; - yy = hi_yy; /* end `yy' loop */ - break; /* end `xx' loop */ - } - } - } -} - -/* - * We need to check the subrooms apartenance to an existing room. - */ -boolean -check_subrooms() -{ - unsigned i, j, n_subrooms; - boolean found, ok = TRUE; - char *last_parent, msg[256]; - - for (i = 0; i < nrooms; i++) - if (tmproom[i]->parent) { - found = FALSE; - for(j = 0; j < nrooms; j++) - if (tmproom[j]->name && - !strcmp(tmproom[i]->parent, tmproom[j]->name)) { - found = TRUE; - break; - } - if (!found) { - Sprintf(msg, - "Subroom error : parent room '%s' not found!", - tmproom[i]->parent); - yyerror(msg); - ok = FALSE; - } - } - - msg[0] = '\0'; - last_parent = msg; - for (i = 0; i < nrooms; i++) - if (tmproom[i]->parent) { - n_subrooms = 0; - for(j = i; j < nrooms; j++) { -/* - * This is by no means perfect, but should cut down the duplicate error - * messages by over 90%. The only problem will be when either subrooms - * are mixed in the level definition (not likely but possible) or rooms - * have subrooms that have subrooms. - */ - if (!strcmp(tmproom[i]->parent, last_parent)) continue; - if (tmproom[j]->parent && - !strcmp(tmproom[i]->parent, tmproom[j]->parent)) { - n_subrooms++; - if(n_subrooms > MAX_SUBROOMS) { - - Sprintf(msg, - "Subroom error: too many subrooms attached to parent room '%s'!", - tmproom[i]->parent); - yyerror(msg); - last_parent = tmproom[i]->parent; - ok = FALSE; - break; - } - } - } - } - return ok; -} - -/* - * Check that coordinates (x,y) are roomlike locations. - * Print warning "str" if they aren't. - */ -void -check_coord(x, y, str) -int x, y; -const char *str; -{ - char ebuf[60]; - - if (x >= 0 && y >= 0 && x <= (int)max_x_map && y <= (int)max_y_map && - (IS_ROCK(tmpmap[y][x]) || IS_DOOR(tmpmap[y][x]))) { - Sprintf(ebuf, "%s placed in wall at (%02d,%02d)?!", str, x, y); - yywarning(ebuf); - } -} - -/* - * Here we want to store the maze part we just got. - */ -void -store_part() -{ - register unsigned i; - - /* Ok, We got the whole part, now we store it. */ - - /* The Regions */ - - if ((tmppart[npart]->nreg = nreg) != 0) { - tmppart[npart]->regions = NewTab(region, nreg); - for(i=0;iregions[i] = tmpreg[i]; - } - nreg = 0; - - /* The Level Regions */ - - if ((tmppart[npart]->nlreg = nlreg) != 0) { - tmppart[npart]->lregions = NewTab(lev_region, nlreg); - for(i=0;ilregions[i] = tmplreg[i]; - } - nlreg = 0; - - /* the doors */ - - if ((tmppart[npart]->ndoor = ndoor) != 0) { - tmppart[npart]->doors = NewTab(door, ndoor); - for(i=0;idoors[i] = tmpdoor[i]; - } - ndoor = 0; - - /* the drawbridges */ - - if ((tmppart[npart]->ndrawbridge = ndb) != 0) { - tmppart[npart]->drawbridges = NewTab(drawbridge, ndb); - for(i=0;idrawbridges[i] = tmpdb[i]; - } - ndb = 0; - - /* The walkmaze directives */ - - if ((tmppart[npart]->nwalk = nwalk) != 0) { - tmppart[npart]->walks = NewTab(walk, nwalk); - for(i=0;iwalks[i] = tmpwalk[i]; - } - nwalk = 0; - - /* The non_diggable directives */ - - if ((tmppart[npart]->ndig = ndig) != 0) { - tmppart[npart]->digs = NewTab(digpos, ndig); - for(i=0;idigs[i] = tmpdig[i]; - } - ndig = 0; - - /* The non_passwall directives */ - - if ((tmppart[npart]->npass = npass) != 0) { - tmppart[npart]->passs = NewTab(digpos, npass); - for(i=0;ipasss[i] = tmppass[i]; - } - npass = 0; - - /* The ladders */ - - if ((tmppart[npart]->nlad = nlad) != 0) { - tmppart[npart]->lads = NewTab(lad, nlad); - for(i=0;ilads[i] = tmplad[i]; - } - nlad = 0; - - /* The stairs */ - - if ((tmppart[npart]->nstair = nstair) != 0) { - tmppart[npart]->stairs = NewTab(stair, nstair); - for(i=0;istairs[i] = tmpstair[i]; - } - nstair = 0; - - /* The altars */ - if ((tmppart[npart]->naltar = naltar) != 0) { - tmppart[npart]->altars = NewTab(altar, naltar); - for(i=0;ialtars[i] = tmpaltar[i]; - } - naltar = 0; - - /* The fountains */ - - if ((tmppart[npart]->nfountain = nfountain) != 0) { - tmppart[npart]->fountains = NewTab(fountain, nfountain); - for(i=0;ifountains[i] = tmpfountain[i]; - } - nfountain = 0; - - /* the traps */ - - if ((tmppart[npart]->ntrap = ntrap) != 0) { - tmppart[npart]->traps = NewTab(trap, ntrap); - for(i=0;itraps[i] = tmptrap[i]; - } - ntrap = 0; - - /* the monsters */ - - if ((tmppart[npart]->nmonster = nmons) != 0) { - tmppart[npart]->monsters = NewTab(monster, nmons); - for(i=0;imonsters[i] = tmpmonst[i]; - } else - tmppart[npart]->monsters = 0; - nmons = 0; - - /* the objects */ - - if ((tmppart[npart]->nobject = nobj) != 0) { - tmppart[npart]->objects = NewTab(object, nobj); - for(i=0;iobjects[i] = tmpobj[i]; - } else - tmppart[npart]->objects = 0; - nobj = 0; - - /* The gold piles */ - - if ((tmppart[npart]->ngold = ngold) != 0) { - tmppart[npart]->golds = NewTab(gold, ngold); - for(i=0;igolds[i] = tmpgold[i]; - } - ngold = 0; - - /* The engravings */ - - if ((tmppart[npart]->nengraving = nengraving) != 0) { - tmppart[npart]->engravings = NewTab(engraving, nengraving); - for(i=0;iengravings[i] = tmpengraving[i]; - } else - tmppart[npart]->engravings = 0; - nengraving = 0; - - npart++; - n_plist = n_mlist = n_olist = 0; -} - -/* - * Here we want to store the room part we just got. - */ -void -store_room() -{ - register unsigned i; - - /* Ok, We got the whole room, now we store it. */ - - /* the doors */ - - if ((tmproom[nrooms]->ndoor = ndoor) != 0) { - tmproom[nrooms]->doors = NewTab(room_door, ndoor); - for(i=0;idoors[i] = tmprdoor[i]; - } - ndoor = 0; - - /* The stairs */ - - if ((tmproom[nrooms]->nstair = nstair) != 0) { - tmproom[nrooms]->stairs = NewTab(stair, nstair); - for(i=0;istairs[i] = tmpstair[i]; - } - nstair = 0; - - /* The altars */ - if ((tmproom[nrooms]->naltar = naltar) != 0) { - tmproom[nrooms]->altars = NewTab(altar, naltar); - for(i=0;ialtars[i] = tmpaltar[i]; - } - naltar = 0; - - /* The fountains */ - - if ((tmproom[nrooms]->nfountain = nfountain) != 0) { - tmproom[nrooms]->fountains = NewTab(fountain, nfountain); - for(i=0;ifountains[i] = tmpfountain[i]; - } - nfountain = 0; - - /* The sinks */ - - if ((tmproom[nrooms]->nsink = nsink) != 0) { - tmproom[nrooms]->sinks = NewTab(sink, nsink); - for(i=0;isinks[i] = tmpsink[i]; - } - nsink = 0; - - /* The pools */ - - if ((tmproom[nrooms]->npool = npool) != 0) { - tmproom[nrooms]->pools = NewTab(pool, npool); - for(i=0;ipools[i] = tmppool[i]; - } - npool = 0; - - /* the traps */ - - if ((tmproom[nrooms]->ntrap = ntrap) != 0) { - tmproom[nrooms]->traps = NewTab(trap, ntrap); - for(i=0;itraps[i] = tmptrap[i]; - } - ntrap = 0; - - /* the monsters */ - - if ((tmproom[nrooms]->nmonster = nmons) != 0) { - tmproom[nrooms]->monsters = NewTab(monster, nmons); - for(i=0;imonsters[i] = tmpmonst[i]; - } else - tmproom[nrooms]->monsters = 0; - nmons = 0; - - /* the objects */ - - if ((tmproom[nrooms]->nobject = nobj) != 0) { - tmproom[nrooms]->objects = NewTab(object, nobj); - for(i=0;iobjects[i] = tmpobj[i]; - } else - tmproom[nrooms]->objects = 0; - nobj = 0; - - /* The gold piles */ - - if ((tmproom[nrooms]->ngold = ngold) != 0) { - tmproom[nrooms]->golds = NewTab(gold, ngold); - for(i=0;igolds[i] = tmpgold[i]; - } - ngold = 0; - - /* The engravings */ - - if ((tmproom[nrooms]->nengraving = nengraving) != 0) { - tmproom[nrooms]->engravings = NewTab(engraving, nengraving); - for(i=0;iengravings[i] = tmpengraving[i]; - } else - tmproom[nrooms]->engravings = 0; - nengraving = 0; - - nrooms++; -} /* * Output some info common to all special levels. */ static boolean -write_common_data(fd, typ, init, flgs) -int fd, typ; -lev_init *init; -long flgs; +write_common_data(fd, lvl) +int fd; +sp_lev *lvl; { - char c; - uchar len; static struct version_info version_data = { VERSION_NUMBER, VERSION_FEATURES, VERSION_SANITY1, VERSION_SANITY2, VERSION_SANITY3 }; Write(fd, &version_data, sizeof version_data); - c = typ; - Write(fd, &c, sizeof(c)); /* 1 byte header */ - Write(fd, init, sizeof(lev_init)); - Write(fd, &flgs, sizeof flgs); - - len = (uchar) strlen(tmpmessage); - Write(fd, &len, sizeof len); - if (len) Write(fd, tmpmessage, (int) len); - tmpmessage[0] = '\0'; return TRUE; } /* - * Output monster info, which needs string fixups, then release memory. + * Here we write the sp_lev structure in the specified file (fd). + * Also, we have to free the memory allocated via alloc(). */ static boolean -write_monsters(fd, nmonster_p, monsters_p) +write_maze(fd, maze) int fd; -char *nmonster_p; -monster ***monsters_p; +sp_lev *maze; { - monster *m; - char *name, *appr; - int j, n = (int)*nmonster_p; + int i; + + if (!write_common_data(fd, maze)) + return FALSE; + + Write(fd, &(maze->n_opcodes), sizeof(maze->n_opcodes)); + + for (i = 0; i < maze->n_opcodes; i++) { + _opcode tmpo = maze->opcodes[i]; + + Write(fd, &(tmpo.opcode), sizeof(tmpo.opcode)); + + if (tmpo.opcode < SPO_NULL || tmpo.opcode >= MAX_SP_OPCODES) + panic("write_maze: unknown opcode (%i).", tmpo.opcode); + + if (tmpo.opcode == SPO_PUSH) { + genericptr_t opdat = tmpo.opdat; + if (opdat) { + struct opvar *ov = (struct opvar *)opdat; + int size; + Write(fd, &(ov->spovartyp), sizeof(ov->spovartyp)); + switch (ov->spovartyp) { + case SPOVAR_NULL: break; + case SPOVAR_COORD: + case SPOVAR_REGION: + case SPOVAR_MAPCHAR: + case SPOVAR_MONST: + case SPOVAR_OBJ: + case SPOVAR_INT: + Write(fd, &(ov->vardata.l), sizeof(ov->vardata.l)); + break; + case SPOVAR_VARIABLE: + case SPOVAR_STRING: + if (ov->vardata.str) + size = strlen(ov->vardata.str); + else size = 0; + Write(fd, &size, sizeof(size)); + if (size) { + Write(fd, ov->vardata.str, size); + Free(ov->vardata.str); + } + break; + default: panic("write_maze: unknown data type (%i).", ov->spovartyp); + } + } else panic("write_maze: PUSH with no data."); + } else { + /* sanity check */ + genericptr_t opdat = tmpo.opdat; + if (opdat) + panic("write_maze: opcode (%i) has data.", tmpo.opcode); + } + + Free(tmpo.opdat); - Write(fd, nmonster_p, sizeof *nmonster_p); - for (j = 0; j < n; j++) { - m = (*monsters_p)[j]; - name = m->name.str; - appr = m->appear_as.str; - m->name.str = m->appear_as.str = 0; - m->name.len = name ? strlen(name) : 0; - m->appear_as.len = appr ? strlen(appr) : 0; - Write(fd, m, sizeof *m); - if (name) { - Write(fd, name, m->name.len); - Free(name); - } - if (appr) { - Write(fd, appr, m->appear_as.len); - Free(appr); - } - Free(m); } - if (*monsters_p) { - Free(*monsters_p); - *monsters_p = 0; - } - *nmonster_p = 0; + /* clear the struct for next user */ + Free(maze->opcodes); + maze->opcodes = NULL; + /*(void) memset((genericptr_t) &maze->init_lev, 0, sizeof maze->init_lev);*/ + return TRUE; } -/* - * Output object info, which needs string fixup, then release memory. - */ -static boolean -write_objects(fd, nobject_p, objects_p) -int fd; -char *nobject_p; -object ***objects_p; -{ - object *o; - char *name; - int j, n = (int)*nobject_p; - Write(fd, nobject_p, sizeof *nobject_p); - for (j = 0; j < n; j++) { - o = (*objects_p)[j]; - name = o->name.str; - o->name.str = 0; /* reset in case `len' is narrower */ - o->name.len = name ? strlen(name) : 0; - Write(fd, o, sizeof *o); - if (name) { - Write(fd, name, o->name.len); - Free(name); - } - Free(o); - } - if (*objects_p) { - Free(*objects_p); - *objects_p = 0; - } - *nobject_p = 0; - return TRUE; -} -/* - * Output engraving info, which needs string fixup, then release memory. - */ -static boolean -write_engravings(fd, nengraving_p, engravings_p) -int fd; -char *nengraving_p; -engraving ***engravings_p; -{ - engraving *e; - char *engr; - int j, n = (int)*nengraving_p; - - Write(fd, nengraving_p, sizeof *nengraving_p); - for (j = 0; j < n; j++) { - e = (*engravings_p)[j]; - engr = e->engr.str; - e->engr.str = 0; /* reset in case `len' is narrower */ - e->engr.len = strlen(engr); - Write(fd, e, sizeof *e); - Write(fd, engr, e->engr.len); - Free(engr); - Free(e); - } - if (*engravings_p) { - Free(*engravings_p); - *engravings_p = 0; - } - *nengraving_p = 0; - return TRUE; -} /* * Open and write maze or rooms file, based on which pointer is non-null. * Return TRUE on success, FALSE on failure. */ boolean -write_level_file(filename, room_level, maze_level) +write_level_file(filename, lvl) char *filename; -splev *room_level; -specialmaze *maze_level; +sp_lev *lvl; { int fout; char lbuf[60]; @@ -1129,410 +1330,19 @@ specialmaze *maze_level; #endif if (fout < 0) return FALSE; - if (room_level) { - if (!write_rooms(fout, room_level)) - return FALSE; - } else if (maze_level) { - if (!write_maze(fout, maze_level)) - return FALSE; - } else - panic("write_level_file"); + if (!lvl) panic("write_level_file"); + + if (be_verbose) + fprintf(stdout, "File: '%s', opcodes: %li\n", lbuf, lvl->n_opcodes); + + if (!write_maze(fout, lvl)) + return FALSE; (void) close(fout); + return TRUE; } -/* - * Here we write the structure of the maze in the specified file (fd). - * Also, we have to free the memory allocated via alloc(). - */ -static boolean -write_maze(fd, maze) -int fd; -specialmaze *maze; -{ - short i,j; - mazepart *pt; - - if (!write_common_data(fd, SP_LEV_MAZE, &(maze->init_lev), maze->flags)) - return FALSE; - - Write(fd, &(maze->filling), sizeof(maze->filling)); - Write(fd, &(maze->numpart), sizeof(maze->numpart)); - /* Number of parts */ - for(i=0;inumpart;i++) { - pt = maze->parts[i]; - - /* First, write the map */ - - Write(fd, &(pt->halign), sizeof(pt->halign)); - Write(fd, &(pt->valign), sizeof(pt->valign)); - Write(fd, &(pt->xsize), sizeof(pt->xsize)); - Write(fd, &(pt->ysize), sizeof(pt->ysize)); - for(j=0;jysize;j++) { - if(!maze->init_lev.init_present || - pt->xsize > 1 || pt->ysize > 1) { - Write(fd, pt->map[j], pt->xsize * sizeof *pt->map[j]); - } - Free(pt->map[j]); - } - Free(pt->map); - - /* level region stuff */ - Write(fd, &pt->nlreg, sizeof pt->nlreg); - for (j = 0; j < pt->nlreg; j++) { - lev_region *l = pt->lregions[j]; - char *rname = l->rname.str; - l->rname.str = 0; /* reset in case `len' is narrower */ - l->rname.len = rname ? strlen(rname) : 0; - Write(fd, l, sizeof *l); - if (rname) { - Write(fd, rname, l->rname.len); - Free(rname); - } - Free(l); - } - if (pt->nlreg > 0) - Free(pt->lregions); - - /* The random registers */ - Write(fd, &(pt->nrobjects), sizeof(pt->nrobjects)); - if(pt->nrobjects) { - Write(fd, pt->robjects, pt->nrobjects); - Free(pt->robjects); - } - Write(fd, &(pt->nloc), sizeof(pt->nloc)); - if(pt->nloc) { - Write(fd, pt->rloc_x, pt->nloc); - Write(fd, pt->rloc_y, pt->nloc); - Free(pt->rloc_x); - Free(pt->rloc_y); - } - Write(fd, &(pt->nrmonst), sizeof(pt->nrmonst)); - if(pt->nrmonst) { - Write(fd, pt->rmonst, pt->nrmonst); - Free(pt->rmonst); - } - - /* subrooms */ - Write(fd, &(pt->nreg), sizeof(pt->nreg)); - for(j=0;jnreg;j++) { - Write(fd, pt->regions[j], sizeof(region)); - Free(pt->regions[j]); - } - if(pt->nreg > 0) - Free(pt->regions); - - /* the doors */ - Write(fd, &(pt->ndoor), sizeof(pt->ndoor)); - for(j=0;jndoor;j++) { - Write(fd, pt->doors[j], sizeof(door)); - Free(pt->doors[j]); - } - if (pt->ndoor > 0) - Free(pt->doors); - - /* The drawbridges */ - Write(fd, &(pt->ndrawbridge), sizeof(pt->ndrawbridge)); - for(j=0;jndrawbridge;j++) { - Write(fd, pt->drawbridges[j], sizeof(drawbridge)); - Free(pt->drawbridges[j]); - } - if(pt->ndrawbridge > 0) - Free(pt->drawbridges); - - /* The mazewalk directives */ - Write(fd, &(pt->nwalk), sizeof(pt->nwalk)); - for(j=0; jnwalk; j++) { - Write(fd, pt->walks[j], sizeof(walk)); - Free(pt->walks[j]); - } - if (pt->nwalk > 0) - Free(pt->walks); - - /* The non_diggable directives */ - Write(fd, &(pt->ndig), sizeof(pt->ndig)); - for(j=0;jndig;j++) { - Write(fd, pt->digs[j], sizeof(digpos)); - Free(pt->digs[j]); - } - if (pt->ndig > 0) - Free(pt->digs); - - /* The non_passwall directives */ - Write(fd, &(pt->npass), sizeof(pt->npass)); - for(j=0;jnpass;j++) { - Write(fd, pt->passs[j], sizeof(digpos)); - Free(pt->passs[j]); - } - if (pt->npass > 0) - Free(pt->passs); - - /* The ladders */ - Write(fd, &(pt->nlad), sizeof(pt->nlad)); - for(j=0;jnlad;j++) { - Write(fd, pt->lads[j], sizeof(lad)); - Free(pt->lads[j]); - } - if (pt->nlad > 0) - Free(pt->lads); - - /* The stairs */ - Write(fd, &(pt->nstair), sizeof(pt->nstair)); - for(j=0;jnstair;j++) { - Write(fd, pt->stairs[j], sizeof(stair)); - Free(pt->stairs[j]); - } - if (pt->nstair > 0) - Free(pt->stairs); - - /* The altars */ - Write(fd, &(pt->naltar), sizeof(pt->naltar)); - for(j=0;jnaltar;j++) { - Write(fd, pt->altars[j], sizeof(altar)); - Free(pt->altars[j]); - } - if (pt->naltar > 0) - Free(pt->altars); - - /* The fountains */ - Write(fd, &(pt->nfountain), sizeof(pt->nfountain)); - for(j=0;jnfountain;j++) { - Write(fd, pt->fountains[j], sizeof(fountain)); - Free(pt->fountains[j]); - } - if (pt->nfountain > 0) - Free(pt->fountains); - - /* The traps */ - Write(fd, &(pt->ntrap), sizeof(pt->ntrap)); - for(j=0;jntrap;j++) { - Write(fd, pt->traps[j], sizeof(trap)); - Free(pt->traps[j]); - } - if (pt->ntrap) - Free(pt->traps); - - /* The monsters */ - if (!write_monsters(fd, &pt->nmonster, &pt->monsters)) - return FALSE; - - /* The objects */ - if (!write_objects(fd, &pt->nobject, &pt->objects)) - return FALSE; - - /* The gold piles */ - Write(fd, &(pt->ngold), sizeof(pt->ngold)); - for(j=0;jngold;j++) { - Write(fd, pt->golds[j], sizeof(gold)); - Free(pt->golds[j]); - } - if (pt->ngold > 0) - Free(pt->golds); - - /* The engravings */ - if (!write_engravings(fd, &pt->nengraving, &pt->engravings)) - return FALSE; - - Free(pt); - } - - Free(maze->parts); - maze->parts = (mazepart **)0; - maze->numpart = 0; - return TRUE; -} - -/* - * Here we write the structure of the room level in the specified file (fd). - */ -static boolean -write_rooms(fd, lev) -int fd; -splev *lev; -{ - short i,j, size; - room *pt; - - if (!write_common_data(fd, SP_LEV_ROOMS, &(lev->init_lev), lev->flags)) - return FALSE; - - /* Random registers */ - - Write(fd, &lev->nrobjects, sizeof(lev->nrobjects)); - if (lev->nrobjects) - Write(fd, lev->robjects, lev->nrobjects); - Write(fd, &lev->nrmonst, sizeof(lev->nrmonst)); - if (lev->nrmonst) - Write(fd, lev->rmonst, lev->nrmonst); - - Write(fd, &(lev->nroom), sizeof(lev->nroom)); - /* Number of rooms */ - for(i=0;inroom;i++) { - pt = lev->rooms[i]; - - /* Room characteristics */ - - size = (short) (pt->name ? strlen(pt->name) : 0); - Write(fd, &size, sizeof(size)); - if (size) - Write(fd, pt->name, size); - - size = (short) (pt->parent ? strlen(pt->parent) : 0); - Write(fd, &size, sizeof(size)); - if (size) - Write(fd, pt->parent, size); - - Write(fd, &(pt->x), sizeof(pt->x)); - Write(fd, &(pt->y), sizeof(pt->y)); - Write(fd, &(pt->w), sizeof(pt->w)); - Write(fd, &(pt->h), sizeof(pt->h)); - Write(fd, &(pt->xalign), sizeof(pt->xalign)); - Write(fd, &(pt->yalign), sizeof(pt->yalign)); - Write(fd, &(pt->rtype), sizeof(pt->rtype)); - Write(fd, &(pt->chance), sizeof(pt->chance)); - Write(fd, &(pt->rlit), sizeof(pt->rlit)); - Write(fd, &(pt->filled), sizeof(pt->filled)); - - /* the doors */ - Write(fd, &(pt->ndoor), sizeof(pt->ndoor)); - for(j=0;jndoor;j++) - Write(fd, pt->doors[j], sizeof(room_door)); - - /* The stairs */ - Write(fd, &(pt->nstair), sizeof(pt->nstair)); - for(j=0;jnstair;j++) - Write(fd, pt->stairs[j], sizeof(stair)); - - /* The altars */ - Write(fd, &(pt->naltar), sizeof(pt->naltar)); - for(j=0;jnaltar;j++) - Write(fd, pt->altars[j], sizeof(altar)); - - /* The fountains */ - Write(fd, &(pt->nfountain), sizeof(pt->nfountain)); - for(j=0;jnfountain;j++) - Write(fd, pt->fountains[j], sizeof(fountain)); - - /* The sinks */ - Write(fd, &(pt->nsink), sizeof(pt->nsink)); - for(j=0;jnsink;j++) - Write(fd, pt->sinks[j], sizeof(sink)); - - /* The pools */ - Write(fd, &(pt->npool), sizeof(pt->npool)); - for(j=0;jnpool;j++) - Write(fd, pt->pools[j], sizeof(pool)); - - /* The traps */ - Write(fd, &(pt->ntrap), sizeof(pt->ntrap)); - for(j=0;jntrap;j++) - Write(fd, pt->traps[j], sizeof(trap)); - - /* The monsters */ - if (!write_monsters(fd, &pt->nmonster, &pt->monsters)) - return FALSE; - - /* The objects */ - if (!write_objects(fd, &pt->nobject, &pt->objects)) - return FALSE; - - /* The gold piles */ - Write(fd, &(pt->ngold), sizeof(pt->ngold)); - for(j=0;jngold;j++) - Write(fd, pt->golds[j], sizeof(gold)); - - /* The engravings */ - if (!write_engravings(fd, &pt->nengraving, &pt->engravings)) - return FALSE; - - } - - /* The corridors */ - Write(fd, &lev->ncorr, sizeof(lev->ncorr)); - for (i=0; i < lev->ncorr; i++) - Write(fd, lev->corrs[i], sizeof(corridor)); - return TRUE; -} - -/* - * Release memory allocated to a rooms-style special level; maze-style - * levels have the fields freed as they're written; monsters, objects, and - * engravings are freed as written for both styles, so not handled here. - */ -void -free_rooms(lev) -splev *lev; -{ - room *r; - int j, n = lev->nroom; - - while(n--) { - r = lev->rooms[n]; - Free(r->name); - Free(r->parent); - if ((j = r->ndoor) != 0) { - while(j--) - Free(r->doors[j]); - Free(r->doors); - } - if ((j = r->nstair) != 0) { - while(j--) - Free(r->stairs[j]); - Free(r->stairs); - } - if ((j = r->naltar) != 0) { - while (j--) - Free(r->altars[j]); - Free(r->altars); - } - if ((j = r->nfountain) != 0) { - while(j--) - Free(r->fountains[j]); - Free(r->fountains); - } - if ((j = r->nsink) != 0) { - while(j--) - Free(r->sinks[j]); - Free(r->sinks); - } - if ((j = r->npool) != 0) { - while(j--) - Free(r->pools[j]); - Free(r->pools); - } - if ((j = r->ntrap) != 0) { - while (j--) - Free(r->traps[j]); - Free(r->traps); - } - if ((j = r->ngold) != 0) { - while(j--) - Free(r->golds[j]); - Free(r->golds); - } - Free(r); - lev->rooms[n] = (room *)0; - } - Free(lev->rooms); - lev->rooms = (room **)0; - lev->nroom = 0; - - for (j = 0; j < lev->ncorr; j++) { - Free(lev->corrs[j]); - lev->corrs[j] = (corridor *)0; - } - Free(lev->corrs); - lev->corrs = (corridor **)0; - lev->ncorr = 0; - - Free(lev->robjects); - lev->robjects = (char *)0; - lev->nrobjects = 0; - Free(lev->rmonst); - lev->rmonst = (char *)0; - lev->nrmonst = 0; -} #ifdef STRICT_REF_DEF /* From 79eb17a0a717ffc27794e3dbe082bf31e3ab34a4 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 18 Feb 2015 21:46:42 +0200 Subject: [PATCH 211/354] New level compiler: des-file changes --- dat/Arch.des | 356 +++++++------- dat/Barb.des | 292 ++++++------ dat/Caveman.des | 254 +++++----- dat/Healer.des | 370 +++++++-------- dat/Knight.des | 306 ++++++------ dat/Monk.des | 332 +++++++------ dat/Priest.des | 290 ++++++------ dat/Ranger.des | 292 ++++++------ dat/Rogue.des | 436 ++++++++--------- dat/Samurai.des | 332 ++++++------- dat/Tourist.des | 328 ++++++------- dat/Valkyrie.des | 275 ++++++----- dat/Wizard.des | 370 ++++++++------- dat/bigroom.des | 430 ++++++++--------- dat/castle.des | 245 +++++----- dat/endgame.des | 622 ++++++++++++------------ dat/gehennom.des | 538 ++++++++++----------- dat/knox.des | 80 ++-- dat/medusa.des | 196 ++++---- dat/mines.des | 1174 +++++++++++++++++++++++++--------------------- dat/oracle.des | 86 ++-- dat/sokoban.des | 382 +++++++-------- dat/tower.des | 98 ++-- dat/yendor.des | 122 ++--- 24 files changed, 4197 insertions(+), 4009 deletions(-) diff --git a/dat/Arch.des b/dat/Arch.des index 3c1ccfaf0..4ea3a818b 100644 --- a/dat/Arch.des +++ b/dat/Arch.des @@ -70,25 +70,25 @@ DOOR:locked,(24,14) DOOR:closed,(31,14) DOOR:locked,(49,14) # Lord Carnarvon -MONSTER:'@',"Lord Carnarvon",(25,10) +MONSTER:('@',"Lord Carnarvon"),(25,10) # The treasure of Lord Carnarvon -OBJECT:'(',"chest",(25,10) +OBJECT:('(',"chest"),(25,10) # student guards for the audience chamber -MONSTER:'@',"student",(26,09) -MONSTER:'@',"student",(27,09) -MONSTER:'@',"student",(28,09) -MONSTER:'@',"student",(26,10) -MONSTER:'@',"student",(28,10) -MONSTER:'@',"student",(26,11) -MONSTER:'@',"student",(27,11) -MONSTER:'@',"student",(28,11) +MONSTER:('@',"student"),(26,09) +MONSTER:('@',"student"),(27,09) +MONSTER:('@',"student"),(28,09) +MONSTER:('@',"student"),(26,10) +MONSTER:('@',"student"),(28,10) +MONSTER:('@',"student"),(26,11) +MONSTER:('@',"student"),(27,11) +MONSTER:('@',"student"),(28,11) # city watch guards in the antechambers -MONSTER:'@',"watchman",(50,06) -MONSTER:'@',"watchman",(50,14) +MONSTER:('@',"watchman"),(50,06) +MONSTER:('@',"watchman"),(50,14) # Eels in the moat -MONSTER:';',"giant eel",(20,10) -MONSTER:';',"giant eel",(45,04) -MONSTER:';',"giant eel",(33,16) +MONSTER:(';',"giant eel"),(20,10) +MONSTER:(';',"giant eel"),(45,04) +MONSTER:(';',"giant eel"),(33,16) # Non diggable walls NON_DIGGABLE:(00,00,75,19) # Random traps @@ -99,18 +99,18 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Monsters on siege duty. -MONSTER: 'S',random,(60,09) -MONSTER: 'M',random,(60,10) -MONSTER: 'S',random,(60,11) -MONSTER: 'S',random,(60,12) -MONSTER: 'M',random,(60,13) -MONSTER: 'S',random,(61,10) -MONSTER: 'S',random,(61,11) -MONSTER: 'S',random,(61,12) -MONSTER: 'S',random,(30,03) -MONSTER: 'M',random,(20,17) -MONSTER: 'S',random,(67,02) -MONSTER: 'S',random,(10,19) +MONSTER: 'S',(60,09) +MONSTER: 'M',(60,10) +MONSTER: 'S',(60,11) +MONSTER: 'S',(60,12) +MONSTER: 'M',(60,13) +MONSTER: 'S',(61,10) +MONSTER: 'S',(61,11) +MONSTER: 'S',(61,12) +MONSTER: 'S',(30,03) +MONSTER: 'M',(20,17) +MONSTER: 'S',(67,02) +MONSTER: 'S',(10,19) # # The "locate" level for the quest. @@ -151,13 +151,13 @@ REGION:(25,09,28,11),unlit,"temple" REGION:(25,13,28,16),lit,"temple" REGION:(30,04,30,16),lit,"ordinary" REGION:(32,04,32,16),unlit,"ordinary" -REGION:(33,04,53,04),unlit,"ordinary",unfilled,true +REGION:(33,04,53,04),unlit,"ordinary",unfilled,irregular REGION:(36,10,37,10),unlit,"ordinary" REGION:(39,09,39,11),unlit,"ordinary" -REGION:(36,06,42,08),unlit,"ordinary",unfilled,true -REGION:(36,12,42,14),unlit,"ordinary",unfilled,true +REGION:(36,06,42,08),unlit,"ordinary",unfilled,irregular +REGION:(36,12,42,14),unlit,"ordinary",unfilled,irregular REGION:(46,06,51,09),unlit,"ordinary" -REGION:(46,11,49,11),unlit,"ordinary",unfilled,true +REGION:(46,11,49,11),unlit,"ordinary",unfilled,irregular REGION:(48,13,51,14),unlit,"ordinary" # Doors DOOR:closed,(31,04) @@ -186,21 +186,21 @@ ALTAR:(26,15),align[2],altar # Non diggable walls NON_DIGGABLE:(00,00,75,19) # Objects -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Treasure? ENGRAVING:random,engrave,"X marks the spot." ENGRAVING:random,engrave,"X marks the spot." @@ -231,33 +231,33 @@ TRAP:"dart",random TRAP:"rolling boulder",(32,10) TRAP:"rolling boulder",(40,16) # Random monsters. -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'M',random,random -MONSTER:'M',"human mummy",random -MONSTER:'M',"human mummy",random -MONSTER:'M',"human mummy",random -MONSTER:'M',"human mummy",random -MONSTER:'M',"human mummy",random -MONSTER:'M',"human mummy",random -MONSTER:'M',"human mummy",random -MONSTER:'M',random,random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'M',random +MONSTER:('M',"human mummy"),random +MONSTER:('M',"human mummy"),random +MONSTER:('M',"human mummy"),random +MONSTER:('M',"human mummy"),random +MONSTER:('M',"human mummy"),random +MONSTER:('M',"human mummy"),random +MONSTER:('M',"human mummy"),random +MONSTER:'M',random # # The "goal" level for the quest. @@ -323,21 +323,21 @@ NON_DIGGABLE:(00,00,75,19) # The altar of Huhetotl. Unattended. ALTAR:(50,14),chaos,altar # Objects -OBJECT:'(',"crystal ball",(50,14),blessed,5,"The Orb of Detection" -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:('(',"crystal ball"),(50,14),blessed,5,name:"The Orb of Detection" +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -347,34 +347,34 @@ TRAP:random,random TRAP:random,random TRAP:"rolling boulder",(46,14) # Random monsters. -MONSTER:'&',"Minion of Huhetotl",(50,14) -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'S',random,random -MONSTER:'M',"human mummy",random -MONSTER:'M',"human mummy",random -MONSTER:'M',"human mummy",random -MONSTER:'M',"human mummy",random -MONSTER:'M',"human mummy",random -MONSTER:'M',"human mummy",random -MONSTER:'M',"human mummy",random -MONSTER:'M',"human mummy",random -MONSTER:'M',random,random +MONSTER:('&',"Minion of Huhetotl"),(50,14) +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:'S',random +MONSTER:('M',"human mummy"),random +MONSTER:('M',"human mummy"),random +MONSTER:('M',"human mummy"),random +MONSTER:('M',"human mummy"),random +MONSTER:('M',"human mummy"),random +MONSTER:('M',"human mummy"),random +MONSTER:('M',"human mummy"),random +MONSTER:('M',"human mummy"),random +MONSTER:'M',random # # The "fill" levels for the quest. @@ -387,76 +387,88 @@ MONSTER:'M',random,random LEVEL: "Arc-fila" # -ROOM: "ordinary" , random, random, random, random -STAIR: random, up -OBJECT: random,random,random -MONSTER: 'S', random, random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, up + OBJECT: random,random + MONSTER: 'S', random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random,random,random -MONSTER: 'S', random, random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random,random + MONSTER: 'S', random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -OBJECT: random,random,random -MONSTER: 'S', random, random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + OBJECT: random,random + MONSTER: 'S', random +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, down -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'S', random, random -MONSTER: 'M', "human mummy", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, down + OBJECT: random, random + TRAP: random, random + MONSTER: 'S', random + MONSTER: ('M', "human mummy"), random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'S', random, random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random, random + TRAP: random, random + MONSTER: 'S', random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'S', random, random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + MONSTER: 'S', random +} RANDOM_CORRIDORS LEVEL: "Arc-filb" # -ROOM: "ordinary" , random, random, random, random -STAIR: random, up -OBJECT: random,random,random -MONSTER: 'M', random, random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, up + OBJECT: random,random + MONSTER: 'M', random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random,random,random -MONSTER: 'M', random, random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random,random + MONSTER: 'M', random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -OBJECT: random,random,random -MONSTER: 'M', random, random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + OBJECT: random,random + MONSTER: 'M', random +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, down -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'S', random, random -MONSTER: 'M', "human mummy", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, down + OBJECT: random, random + TRAP: random, random + MONSTER: 'S', random + MONSTER: ('M', "human mummy"), random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'S', random, random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random, random + TRAP: random, random + MONSTER: 'S', random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'S', random, random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + MONSTER: 'S', random +} RANDOM_CORRIDORS diff --git a/dat/Barb.des b/dat/Barb.des index 29a612015..ea8ab9738 100644 --- a/dat/Barb.des +++ b/dat/Barb.des @@ -60,38 +60,38 @@ DOOR:open,(23,13) DOOR:open,(25,10) DOOR:open,(28,05) # Elder -MONSTER:'@',"Pelias",(10,07) +MONSTER:('@',"Pelias"),(10,07) # The treasure of Pelias -OBJECT:'(',"chest",(09,05) +OBJECT:('(',"chest"),(09,05) # chieftain guards for the audience chamber -MONSTER:'@',"chieftain",(10,05) -MONSTER:'@',"chieftain",(10,09) -MONSTER:'@',"chieftain",(11,05) -MONSTER:'@',"chieftain",(11,09) -MONSTER:'@',"chieftain",(14,05) -MONSTER:'@',"chieftain",(14,09) -MONSTER:'@',"chieftain",(16,05) -MONSTER:'@',"chieftain",(16,09) +MONSTER:('@',"chieftain"),(10,05) +MONSTER:('@',"chieftain"),(10,09) +MONSTER:('@',"chieftain"),(11,05) +MONSTER:('@',"chieftain"),(11,09) +MONSTER:('@',"chieftain"),(14,05) +MONSTER:('@',"chieftain"),(14,09) +MONSTER:('@',"chieftain"),(16,05) +MONSTER:('@',"chieftain"),(16,09) # Non diggable walls NON_DIGGABLE:(00,00,75,19) # One trap to keep the ogres at bay. TRAP:"spiked pit",(37,07) # Eels in the river -MONSTER:';',"giant eel",(36,01) -MONSTER:';',"giant eel",(37,09) -MONSTER:';',"giant eel",(39,15) +MONSTER:(';',"giant eel"),(36,01) +MONSTER:(';',"giant eel"),(37,09) +MONSTER:(';',"giant eel"),(39,15) # Monsters on siege duty. -MONSTER:'O',"ogre",(40,08),hostile -MONSTER:'O',"ogre",(41,06),hostile -MONSTER:'O',"ogre",(41,07),hostile -MONSTER:'O',"ogre",(41,08),hostile -MONSTER:'O',"ogre",(41,09),hostile -MONSTER:'O',"ogre",(41,10),hostile -MONSTER:'O',"ogre",(42,06),hostile -MONSTER:'O',"ogre",(42,07),hostile -MONSTER:'O',"ogre",(42,08),hostile -MONSTER:'O',"ogre",(42,09),hostile -MONSTER:'O',"ogre",(42,10),hostile +MONSTER:('O',"ogre"),(40,08),hostile +MONSTER:('O',"ogre"),(41,06),hostile +MONSTER:('O',"ogre"),(41,07),hostile +MONSTER:('O',"ogre"),(41,08),hostile +MONSTER:('O',"ogre"),(41,09),hostile +MONSTER:('O',"ogre"),(41,10),hostile +MONSTER:('O',"ogre"),(42,06),hostile +MONSTER:('O',"ogre"),(42,07),hostile +MONSTER:('O',"ogre"),(42,08),hostile +MONSTER:('O',"ogre"),(42,09),hostile +MONSTER:('O',"ogre"),(42,10),hostile # # The "locate" level for the quest. @@ -148,21 +148,21 @@ DOOR:locked,(55,06) STAIR:(05,02),up STAIR:(70,13),down # Objects -OBJECT:random,random,(42,03) -OBJECT:random,random,(42,03) -OBJECT:random,random,(42,03) -OBJECT:random,random,(41,03) -OBJECT:random,random,(41,03) -OBJECT:random,random,(41,03) -OBJECT:random,random,(41,03) -OBJECT:random,random,(41,08) -OBJECT:random,random,(41,08) -OBJECT:random,random,(42,08) -OBJECT:random,random,(42,08) -OBJECT:random,random,(42,08) -OBJECT:random,random,(71,13) -OBJECT:random,random,(71,13) -OBJECT:random,random,(71,13) +OBJECT:random,(42,03) +OBJECT:random,(42,03) +OBJECT:random,(42,03) +OBJECT:random,(41,03) +OBJECT:random,(41,03) +OBJECT:random,(41,03) +OBJECT:random,(41,03) +OBJECT:random,(41,08) +OBJECT:random,(41,08) +OBJECT:random,(42,08) +OBJECT:random,(42,08) +OBJECT:random,(42,08) +OBJECT:random,(71,13) +OBJECT:random,(71,13) +OBJECT:random,(71,13) # Random traps TRAP:"spiked pit",(10,13) TRAP:"spiked pit",(21,07) @@ -173,33 +173,33 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'O',"ogre",(12,09),hostile -MONSTER:'O',"ogre",(18,11),hostile -MONSTER:'O',"ogre",(45,05),hostile -MONSTER:'O',"ogre",(45,06),hostile -MONSTER:'O',"ogre",(47,05),hostile -MONSTER:'O',"ogre",(46,05),hostile -MONSTER:'O',"ogre",(56,03),hostile -MONSTER:'O',"ogre",(56,04),hostile -MONSTER:'O',"ogre",(56,05),hostile -MONSTER:'O',"ogre",(56,06),hostile -MONSTER:'O',"ogre",(57,03),hostile -MONSTER:'O',"ogre",(57,04),hostile -MONSTER:'O',"ogre",(57,05),hostile -MONSTER:'O',"ogre",(57,06),hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',random,random,hostile -MONSTER:'T',random,random,hostile -MONSTER:'T',"rock troll",(46,06),hostile -MONSTER:'T',"rock troll",(47,06),hostile -MONSTER:'T',"rock troll",(56,07),hostile -MONSTER:'T',"rock troll",(57,07),hostile -MONSTER:'T',"rock troll",(70,13),hostile -MONSTER:'T',"rock troll",random,hostile -MONSTER:'T',"rock troll",random,hostile -MONSTER:'T',random,random,hostile +MONSTER:('O',"ogre"),(12,09),hostile +MONSTER:('O',"ogre"),(18,11),hostile +MONSTER:('O',"ogre"),(45,05),hostile +MONSTER:('O',"ogre"),(45,06),hostile +MONSTER:('O',"ogre"),(47,05),hostile +MONSTER:('O',"ogre"),(46,05),hostile +MONSTER:('O',"ogre"),(56,03),hostile +MONSTER:('O',"ogre"),(56,04),hostile +MONSTER:('O',"ogre"),(56,05),hostile +MONSTER:('O',"ogre"),(56,06),hostile +MONSTER:('O',"ogre"),(57,03),hostile +MONSTER:('O',"ogre"),(57,04),hostile +MONSTER:('O',"ogre"),(57,05),hostile +MONSTER:('O',"ogre"),(57,06),hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:'O',random,hostile +MONSTER:'T',random,hostile +MONSTER:('T',"rock troll"),(46,06),hostile +MONSTER:('T',"rock troll"),(47,06),hostile +MONSTER:('T',"rock troll"),(56,07),hostile +MONSTER:('T',"rock troll"),(57,07),hostile +MONSTER:('T',"rock troll"),(70,13),hostile +MONSTER:('T',"rock troll"),random,hostile +MONSTER:('T',"rock troll"),random,hostile +MONSTER:'T',random,hostile # # The "goal" level for the quest. @@ -244,21 +244,21 @@ STAIR:(36,05),up ALTAR:(63,04),noncoaligned,altar NON_DIGGABLE:(00,00,75,19) # Objects -OBJECT:'*',"luckstone",(63,04),blessed,0,"The Heart of Ahriman" -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:('*',"luckstone"),(63,04),blessed,0,name:"The Heart of Ahriman" +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -267,34 +267,34 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'@',"Thoth Amon",(63,04),hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',"ogre",random,hostile -MONSTER:'O',random,random,hostile -MONSTER:'O',random,random,hostile -MONSTER:'T',"rock troll",random,hostile -MONSTER:'T',"rock troll",random,hostile -MONSTER:'T',"rock troll",random,hostile -MONSTER:'T',"rock troll",random,hostile -MONSTER:'T',"rock troll",random,hostile -MONSTER:'T',"rock troll",random,hostile -MONSTER:'T',"rock troll",random,hostile -MONSTER:'T',"rock troll",random,hostile -MONSTER:'T',random,random,hostile +MONSTER:('@',"Thoth Amon"),(63,04),hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:('O',"ogre"),random,hostile +MONSTER:'O',random,hostile +MONSTER:'O',random,hostile +MONSTER:('T',"rock troll"),random,hostile +MONSTER:('T',"rock troll"),random,hostile +MONSTER:('T',"rock troll"),random,hostile +MONSTER:('T',"rock troll"),random,hostile +MONSTER:('T',"rock troll"),random,hostile +MONSTER:('T',"rock troll"),random,hostile +MONSTER:('T',"rock troll"),random,hostile +MONSTER:('T',"rock troll"),random,hostile +MONSTER:'T',random,hostile WALLIFY # @@ -307,64 +307,64 @@ WALLIFY # MAZE: "Bar-fila" , ' ' -INIT_MAP: '.' , '.' , true , true , unlit , false +INIT_MAP: mines, '.' , '.' , true , true , unlit , false NOMAP # STAIR: random, up STAIR: random, down # -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # TRAP: random, random TRAP: random, random TRAP: random, random TRAP: random, random # -MONSTER: 'O', "ogre", random, hostile -MONSTER: 'O', "ogre", random, hostile -MONSTER: 'O', random, random, hostile -MONSTER: 'T', "rock troll", random, hostile +MONSTER: ('O', "ogre"), random, hostile +MONSTER: ('O', "ogre"), random, hostile +MONSTER: 'O', random, hostile +MONSTER: ('T', "rock troll"), random, hostile MAZE: "Bar-filb" , ' ' -INIT_MAP: '.' , ' ' , true , true , unlit , true +INIT_MAP: mines, '.' , ' ' , true , true , unlit , true NOMAP # STAIR: random, up STAIR: random, down # -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # TRAP: random, random TRAP: random, random TRAP: random, random TRAP: random, random # -MONSTER: 'O', "ogre", random, hostile -MONSTER: 'O', "ogre", random, hostile -MONSTER: 'O', "ogre", random, hostile -MONSTER: 'O', "ogre", random, hostile -MONSTER: 'O', "ogre", random, hostile -MONSTER: 'O', "ogre", random, hostile -MONSTER: 'O', "ogre", random, hostile -MONSTER: 'O', random , random, hostile -MONSTER: 'T', "rock troll", random, hostile -MONSTER: 'T', "rock troll", random, hostile -MONSTER: 'T', "rock troll", random, hostile -MONSTER: 'T', random , random, hostile +MONSTER: ('O', "ogre"), random, hostile +MONSTER: ('O', "ogre"), random, hostile +MONSTER: ('O', "ogre"), random, hostile +MONSTER: ('O', "ogre"), random, hostile +MONSTER: ('O', "ogre"), random, hostile +MONSTER: ('O', "ogre"), random, hostile +MONSTER: ('O', "ogre"), random, hostile +MONSTER: 'O' , random, hostile +MONSTER: ('T', "rock troll"), random, hostile +MONSTER: ('T', "rock troll"), random, hostile +MONSTER: ('T', "rock troll"), random, hostile +MONSTER: 'T' , random, hostile diff --git a/dat/Caveman.des b/dat/Caveman.des index f9617c86f..0a84e6c25 100644 --- a/dat/Caveman.des +++ b/dat/Caveman.des @@ -37,14 +37,14 @@ MAP ENDMAP # Dungeon Description REGION:(00,00,75,19),unlit,"ordinary" -REGION:(13,01,40,05),lit,"temple",unfilled,true +REGION:(13,01,40,05),lit,"temple",unfilled,irregular # The occupied rooms. -REGION:(02,01,08,03),lit,"ordinary",unfilled,true -REGION:(01,11,06,14),lit,"ordinary",unfilled,true -REGION:(13,08,18,10),lit,"ordinary",unfilled,true -REGION:(05,17,14,18),lit,"ordinary",unfilled,true -REGION:(17,16,23,18),lit,"ordinary",unfilled,true -REGION:(35,16,44,18),lit,"ordinary",unfilled,true +REGION:(02,01,08,03),lit,"ordinary",unfilled,irregular +REGION:(01,11,06,14),lit,"ordinary",unfilled,irregular +REGION:(13,08,18,10),lit,"ordinary",unfilled,irregular +REGION:(05,17,14,18),lit,"ordinary",unfilled,irregular +REGION:(17,16,23,18),lit,"ordinary",unfilled,irregular +REGION:(35,16,44,18),lit,"ordinary",unfilled,irregular # Stairs STAIR:(02,03),down # Portal arrival point @@ -54,18 +54,18 @@ DOOR:locked,(19,06) # The temple altar (this will force a priest(ess) to be created) ALTAR:(36,02),coaligned,shrine # Shaman Karnov -MONSTER:'@',"Shaman Karnov",(35,02) +MONSTER:('@',"Shaman Karnov"),(35,02) # The treasure of Shaman Karnov -OBJECT:'(',"chest",(34,02) +OBJECT:('(',"chest"),(34,02) # neanderthal guards for the audience chamber -MONSTER:'@',"neanderthal",(20,03) -MONSTER:'@',"neanderthal",(20,02) -MONSTER:'@',"neanderthal",(20,01) -MONSTER:'@',"neanderthal",(21,03) -MONSTER:'@',"neanderthal",(21,02) -MONSTER:'@',"neanderthal",(21,01) -MONSTER:'@',"neanderthal",(22,01) -MONSTER:'@',"neanderthal",(26,09) +MONSTER:('@',"neanderthal"),(20,03) +MONSTER:('@',"neanderthal"),(20,02) +MONSTER:('@',"neanderthal"),(20,01) +MONSTER:('@',"neanderthal"),(21,03) +MONSTER:('@',"neanderthal"),(21,02) +MONSTER:('@',"neanderthal"),(21,01) +MONSTER:('@',"neanderthal"),(22,01) +MONSTER:('@',"neanderthal"),(26,09) # Non diggable walls NON_DIGGABLE:(00,00,75,19) # Random traps @@ -76,18 +76,18 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Monsters on siege duty (in the outer caves). -MONSTER: 'h',"bugbear",(47,02),hostile -MONSTER: 'h',"bugbear",(48,03),hostile -MONSTER: 'h',"bugbear",(49,04),hostile -MONSTER: 'h',"bugbear",(67,03),hostile -MONSTER: 'h',"bugbear",(69,04),hostile -MONSTER: 'h',"bugbear",(51,13),hostile -MONSTER: 'h',"bugbear",(53,14),hostile -MONSTER: 'h',"bugbear",(55,15),hostile -MONSTER: 'h',"bugbear",(63,10),hostile -MONSTER: 'h',"bugbear",(65,09),hostile -MONSTER: 'h',"bugbear",(67,10),hostile -MONSTER: 'h',"bugbear",(69,11),hostile +MONSTER: ('h',"bugbear"),(47,02),hostile +MONSTER: ('h',"bugbear"),(48,03),hostile +MONSTER: ('h',"bugbear"),(49,04),hostile +MONSTER: ('h',"bugbear"),(67,03),hostile +MONSTER: ('h',"bugbear"),(69,04),hostile +MONSTER: ('h',"bugbear"),(51,13),hostile +MONSTER: ('h',"bugbear"),(53,14),hostile +MONSTER: ('h',"bugbear"),(55,15),hostile +MONSTER: ('h',"bugbear"),(63,10),hostile +MONSTER: ('h',"bugbear"),(65,09),hostile +MONSTER: ('h',"bugbear"),(67,10),hostile +MONSTER: ('h',"bugbear"),(69,11),hostile WALLIFY # @@ -124,7 +124,7 @@ MAP ENDMAP # Dungeon Description REGION:(00,00,75,19),unlit,"ordinary" -REGION:(52,06,73,15),lit,"ordinary",unfilled,true +REGION:(52,06,73,15),lit,"ordinary",unfilled,irregular # Doors DOOR:locked,(28,11) # Stairs @@ -133,21 +133,21 @@ STAIR:(73,10),down # Non diggable walls NON_DIGGABLE:(00,00,75,19) # Objects -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -156,33 +156,33 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'h',"bugbear",(02,10),hostile -MONSTER:'h',"bugbear",(03,11),hostile -MONSTER:'h',"bugbear",(04,12),hostile -MONSTER:'h',"bugbear",(02,11),hostile -MONSTER:'h',"bugbear",(16,16),hostile -MONSTER:'h',"bugbear",(17,17),hostile -MONSTER:'h',"bugbear",(18,18),hostile -MONSTER:'h',"bugbear",(19,16),hostile -MONSTER:'h',"bugbear",(30,06),hostile -MONSTER:'h',"bugbear",(31,07),hostile -MONSTER:'h',"bugbear",(32,08),hostile -MONSTER:'h',"bugbear",(33,06),hostile -MONSTER:'h',"bugbear",(34,07),hostile -MONSTER:'h',"bugbear",random,hostile -MONSTER:'h',"bugbear",random,hostile -MONSTER:'h',"bugbear",random,hostile -MONSTER:'h',"bugbear",random,hostile -MONSTER:'h',random,random,hostile -MONSTER:'H',random,random,hostile -MONSTER:'H',"hill giant",(03,12),hostile -MONSTER:'H',"hill giant",(20,17),hostile -MONSTER:'H',"hill giant",(35,08),hostile -MONSTER:'H',"hill giant",random,hostile -MONSTER:'H',"hill giant",random,hostile -MONSTER:'H',"hill giant",random,hostile -MONSTER:'H',"hill giant",random,hostile -MONSTER:'H',random,random,hostile +MONSTER:('h',"bugbear"),(02,10),hostile +MONSTER:('h',"bugbear"),(03,11),hostile +MONSTER:('h',"bugbear"),(04,12),hostile +MONSTER:('h',"bugbear"),(02,11),hostile +MONSTER:('h',"bugbear"),(16,16),hostile +MONSTER:('h',"bugbear"),(17,17),hostile +MONSTER:('h',"bugbear"),(18,18),hostile +MONSTER:('h',"bugbear"),(19,16),hostile +MONSTER:('h',"bugbear"),(30,06),hostile +MONSTER:('h',"bugbear"),(31,07),hostile +MONSTER:('h',"bugbear"),(32,08),hostile +MONSTER:('h',"bugbear"),(33,06),hostile +MONSTER:('h',"bugbear"),(34,07),hostile +MONSTER:('h',"bugbear"),random,hostile +MONSTER:('h',"bugbear"),random,hostile +MONSTER:('h',"bugbear"),random,hostile +MONSTER:('h',"bugbear"),random,hostile +MONSTER:'h',random,hostile +MONSTER:'H',random,hostile +MONSTER:('H',"hill giant"),(03,12),hostile +MONSTER:('H',"hill giant"),(20,17),hostile +MONSTER:('H',"hill giant"),(35,08),hostile +MONSTER:('H',"hill giant"),random,hostile +MONSTER:('H',"hill giant"),random,hostile +MONSTER:('H',"hill giant"),random,hostile +MONSTER:('H',"hill giant"),random,hostile +MONSTER:'H',random,hostile WALLIFY # @@ -224,26 +224,26 @@ STAIR:random,up # Non diggable walls NON_DIGGABLE:(00,00,75,19) # Objects -OBJECT:')',"mace",(23,10),blessed,0,"The Sceptre of Might" -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:(')',"mace"),(23,10),blessed,0,name:"The Sceptre of Might" +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # monsters. -MONSTER:'D',"Chromatic Dragon",(23,10),asleep -MONSTER:'F',"shrieker",(26,13) -MONSTER:'F',"shrieker",(25,8) -MONSTER:'F',"shrieker",(45,11) +MONSTER:('D',"Chromatic Dragon"),(23,10),asleep +MONSTER:('F',"shrieker"),(26,13) +MONSTER:('F',"shrieker"),(25,8) +MONSTER:('F',"shrieker"),(45,11) WALLIFY # @@ -256,63 +256,63 @@ WALLIFY # MAZE: "Cav-fila" , ' ' -INIT_MAP: '.' , ' ' , true , true , random , true +INIT_MAP: mines, '.' , ' ' , true , true , random , true NOMAP # STAIR: random, up STAIR: random, down # -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # TRAP: random, random TRAP: random, random TRAP: random, random TRAP: random, random # -MONSTER: 'h', "bugbear", random, hostile -MONSTER: 'h', "bugbear", random, hostile -MONSTER: 'h', "bugbear", random, hostile -MONSTER: 'h', "bugbear", random, hostile -MONSTER: 'h', "bugbear", random, hostile -MONSTER: 'h', random, random, hostile -MONSTER: 'H', "hill giant", random, hostile +MONSTER: ('h', "bugbear"), random, hostile +MONSTER: ('h', "bugbear"), random, hostile +MONSTER: ('h', "bugbear"), random, hostile +MONSTER: ('h', "bugbear"), random, hostile +MONSTER: ('h', "bugbear"), random, hostile +MONSTER: 'h', random, hostile +MONSTER: ('H', "hill giant"), random, hostile MAZE: "Cav-filb" , ' ' -INIT_MAP: '.' , ' ' , true , true , random , true +INIT_MAP: mines, '.' , ' ' , true , true , random , true NOMAP # STAIR: random, up STAIR: random, down # -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # TRAP: random, random TRAP: random, random TRAP: random, random TRAP: random, random # -MONSTER: 'h', "bugbear", random, hostile -MONSTER: 'h', "bugbear", random, hostile -MONSTER: 'h', "bugbear", random, hostile -MONSTER: 'h', "bugbear", random, hostile -MONSTER: 'h', random, random, hostile -MONSTER: 'h', random, random, hostile -MONSTER: 'H', "hill giant", random, hostile -MONSTER: 'H', "hill giant", random, hostile +MONSTER: ('h', "bugbear"), random, hostile +MONSTER: ('h', "bugbear"), random, hostile +MONSTER: ('h', "bugbear"), random, hostile +MONSTER: ('h', "bugbear"), random, hostile +MONSTER: 'h', random, hostile +MONSTER: 'h', random, hostile +MONSTER: ('H', "hill giant"), random, hostile +MONSTER: ('H', "hill giant"), random, hostile diff --git a/dat/Healer.des b/dat/Healer.des index 3a93adc4f..dcbb01b2a 100644 --- a/dat/Healer.des +++ b/dat/Healer.des @@ -57,18 +57,18 @@ DOOR:closed,(47,08) DOOR:closed,(48,12) DOOR:locked,(50,10) # Hippocrates -MONSTER:'@',"Hippocrates",(37,10) +MONSTER:('@',"Hippocrates"),(37,10) # The treasure of Hippocrates -OBJECT:'(',"chest",(37,10) +OBJECT:('(',"chest"),(37,10) # intern guards for the audience chamber -MONSTER:'@',"attendant",(29,08) -MONSTER:'@',"attendant",(29,09) -MONSTER:'@',"attendant",(29,10) -MONSTER:'@',"attendant",(29,11) -MONSTER:'@',"attendant",(40,09) -MONSTER:'@',"attendant",(40,10) -MONSTER:'@',"attendant",(40,11) -MONSTER:'@',"attendant",(40,13) +MONSTER:('@',"attendant"),(29,08) +MONSTER:('@',"attendant"),(29,09) +MONSTER:('@',"attendant"),(29,10) +MONSTER:('@',"attendant"),(29,11) +MONSTER:('@',"attendant"),(40,09) +MONSTER:('@',"attendant"),(40,10) +MONSTER:('@',"attendant"),(40,11) +MONSTER:('@',"attendant"),(40,13) # Non diggable walls NON_DIGGABLE:(00,00,75,19) # Random traps @@ -79,29 +79,29 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Monsters on siege duty. -MONSTER: 'r',"rabid rat",random -MONSTER: 'r',"rabid rat",random -MONSTER: 'r',"rabid rat",random -MONSTER: 'r',"rabid rat",random -MONSTER: 'r',"rabid rat",random -MONSTER: 'r',"rabid rat",random -MONSTER: 'r',"rabid rat",random -MONSTER: 'r',"rabid rat",random -MONSTER: 'r',"rabid rat",random -MONSTER: 'r',"rabid rat",random -MONSTER: ';',"giant eel",random -MONSTER: ';',"shark",random -MONSTER: ';', random, random -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile +MONSTER: ('r',"rabid rat"),random +MONSTER: ('r',"rabid rat"),random +MONSTER: ('r',"rabid rat"),random +MONSTER: ('r',"rabid rat"),random +MONSTER: ('r',"rabid rat"),random +MONSTER: ('r',"rabid rat"),random +MONSTER: ('r',"rabid rat"),random +MONSTER: ('r',"rabid rat"),random +MONSTER: ('r',"rabid rat"),random +MONSTER: ('r',"rabid rat"),random +MONSTER: (';',"giant eel"),random +MONSTER: (';',"shark"),random +MONSTER: ';', random +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile # # The "locate" level for the quest. # @@ -112,7 +112,7 @@ MONSTER: 'S',random,random,hostile MAZE: "Hea-loca",' ' FLAGS: hardfloor # -INIT_MAP: '.' , 'P', true , true , lit , false +INIT_MAP: mines, '.' , 'P', true , true , lit , false GEOMETRY:center,center MAP PPPPPPPPPPPPP.......PPPPPPPPPPP @@ -142,21 +142,21 @@ NON_DIGGABLE:(11,02,21,07) # Altar in the temple. ALTAR:(13,05), chaos, shrine # Objects -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -165,41 +165,41 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'r',"rabid rat",random -MONSTER:'r',"rabid rat",random -MONSTER:'r',"rabid rat",random -MONSTER:'r',"rabid rat",random -MONSTER:'r',"rabid rat",random -MONSTER:'r',"rabid rat",random -MONSTER:'r',"rabid rat",random -MONSTER:'r',"rabid rat",random -MONSTER:'r',random,random,hostile -MONSTER:';',"giant eel",random -MONSTER:';',"giant eel",random -MONSTER:';',"giant eel",random -MONSTER:';',"giant eel",random -MONSTER:';',"giant eel",random -MONSTER:';',"electric eel",random -MONSTER:';',"electric eel",random -MONSTER:';',"kraken",random -MONSTER:';',"shark",random -MONSTER:';',"shark",random -MONSTER:';',random, random,hostile -MONSTER:';',random, random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile +MONSTER:('r',"rabid rat"),random +MONSTER:('r',"rabid rat"),random +MONSTER:('r',"rabid rat"),random +MONSTER:('r',"rabid rat"),random +MONSTER:('r',"rabid rat"),random +MONSTER:('r',"rabid rat"),random +MONSTER:('r',"rabid rat"),random +MONSTER:('r',"rabid rat"),random +MONSTER:'r',random,hostile +MONSTER:(';',"giant eel"),random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"electric eel"),random +MONSTER:(';',"electric eel"),random +MONSTER:(';',"kraken"),random +MONSTER:(';',"shark"),random +MONSTER:(';',"shark"),random +MONSTER:';', random,hostile +MONSTER:';', random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile # # The "goal" level for the quest. @@ -211,7 +211,7 @@ MONSTER: 'S',random,random,hostile MAZE: "Hea-goal", 'P' # -INIT_MAP: '.' , 'P' , false , true , lit , false +INIT_MAP: mines, '.' , 'P' , false , true , lit , false GEOMETRY:center,center MAP .P....................................PP. @@ -234,22 +234,22 @@ STAIR:(39,10),up # Non diggable walls NON_DIGGABLE:(00,00,40,11) # Objects -OBJECT:')',"quarterstaff",(20,06),blessed,0,"The Staff of Aesculapius" -OBJECT:'/',"lightning",(20,06) -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:(')',"quarterstaff"),(20,06),blessed,0,name:"The Staff of Aesculapius" +OBJECT:('/',"lightning"),(20,06) +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -258,38 +258,38 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'H',"Cyclops",(20,06),hostile -MONSTER:'r',"rabid rat",random -MONSTER:'r',"rabid rat",random -MONSTER:'r',"rabid rat",random -MONSTER:'r',random,random,hostile -MONSTER:'r',random,random,hostile -MONSTER:';',"giant eel",random -MONSTER:';',"giant eel",random -MONSTER:';',"giant eel",random -MONSTER:';',"giant eel",random -MONSTER:';',"giant eel",random -MONSTER:';',"giant eel",random -MONSTER:';',"electric eel",random -MONSTER:';',"electric eel",random -MONSTER:';',"shark",random -MONSTER:';',"shark",random -MONSTER:';',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile +MONSTER:('H',"Cyclops"),(20,06),hostile +MONSTER:('r',"rabid rat"),random +MONSTER:('r',"rabid rat"),random +MONSTER:('r',"rabid rat"),random +MONSTER:'r',random,hostile +MONSTER:'r',random,hostile +MONSTER:(';',"giant eel"),random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"electric eel"),random +MONSTER:(';',"electric eel"),random +MONSTER:(';',"shark"),random +MONSTER:(';',"shark"),random +MONSTER:';',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile # # The "fill" levels for the quest. @@ -301,34 +301,34 @@ MONSTER: 'S',random,random,hostile # MAZE: "Hea-fila" , 'P' -INIT_MAP: '.' , 'P' , false , true , lit , false +INIT_MAP: mines, '.' , 'P' , false , true , lit , false NOMAP # STAIR: random, up STAIR: random, down # -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # -MONSTER: 'r', "rabid rat", random -MONSTER: 'r', random, random,hostile -MONSTER: 'r', random, random,hostile -MONSTER: ';', "giant eel", random -MONSTER: ';', "giant eel", random -MONSTER: ';', "electric eel", random -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile +MONSTER: ('r', "rabid rat"), random +MONSTER: 'r', random,hostile +MONSTER: 'r', random,hostile +MONSTER: (';', "giant eel"), random +MONSTER: (';', "giant eel"), random +MONSTER: (';', "electric eel"), random +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile # TRAP: random, random TRAP: random, random @@ -336,42 +336,42 @@ TRAP: random, random TRAP: random, random MAZE: "Hea-filb" , 'P' -INIT_MAP: '.' , 'P' , false , true , lit , false +INIT_MAP: mines, '.' , 'P' , false , true , lit , false NOMAP # STAIR: random, up STAIR: random, down # -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # -MONSTER: 'r', "rabid rat", random -MONSTER: 'r', "rabid rat", random -MONSTER: 'r', random, random,hostile -MONSTER: 'r', random, random,hostile -MONSTER: ';', "giant eel", random -MONSTER: ';', "giant eel", random -MONSTER: ';', "giant eel", random -MONSTER: ';', "giant eel", random -MONSTER: ';', "giant eel", random -MONSTER: ';', "electric eel", random -MONSTER: ';', "electric eel", random -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'D',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile -MONSTER: 'S',random,random,hostile +MONSTER: ('r', "rabid rat"), random +MONSTER: ('r', "rabid rat"), random +MONSTER: 'r', random,hostile +MONSTER: 'r', random,hostile +MONSTER: (';', "giant eel"), random +MONSTER: (';', "giant eel"), random +MONSTER: (';', "giant eel"), random +MONSTER: (';', "giant eel"), random +MONSTER: (';', "giant eel"), random +MONSTER: (';', "electric eel"), random +MONSTER: (';', "electric eel"), random +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'D',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile +MONSTER: 'S',random,hostile # TRAP: random, random TRAP: random, random diff --git a/dat/Knight.des b/dat/Knight.des index 2be72af7d..5e22f43a9 100644 --- a/dat/Knight.des +++ b/dat/Knight.des @@ -13,7 +13,7 @@ MAZE: "Kni-strt",'.' FLAGS: noteleport,hardfloor # This is a kludge to init the level as a lit field. -INIT_MAP: '.' , '.' , false , false , lit , false +INIT_MAP: mines, '.' , '.' , false , false , lit , false GEOMETRY:center,center MAP .................................................. @@ -62,21 +62,21 @@ DOOR:closed,(45,03) DOOR:closed,(04,12) DOOR:closed,(45,12) # King Arthur -MONSTER:'@',"King Arthur",(09,07) +MONSTER:('@',"King Arthur"),(09,07) # The treasure of King Arthur -OBJECT:'(',"chest",(09,07) +OBJECT:('(',"chest"),(09,07) # knight guards for the watchrooms -MONSTER:'@',"knight",(04,02),peaceful -MONSTER:'@',"knight",(04,13),peaceful -MONSTER:'@',"knight",(45,02),peaceful -MONSTER:'@',"knight",(45,13),peaceful +MONSTER:('@',"knight"),(04,02),peaceful +MONSTER:('@',"knight"),(04,13),peaceful +MONSTER:('@',"knight"),(45,02),peaceful +MONSTER:('@',"knight"),(45,13),peaceful # page guards for the audience chamber -MONSTER:'@',"page",(16,06) -MONSTER:'@',"page",(18,06) -MONSTER:'@',"page",(20,06) -MONSTER:'@',"page",(16,09) -MONSTER:'@',"page",(18,09) -MONSTER:'@',"page",(20,09) +MONSTER:('@',"page"),(16,06) +MONSTER:('@',"page"),(18,06) +MONSTER:('@',"page"),(20,06) +MONSTER:('@',"page"),(16,09) +MONSTER:('@',"page"),(18,09) +MONSTER:('@',"page"),(20,09) # Non diggable walls NON_DIGGABLE:(00,00,49,15) # Random traps @@ -87,18 +87,18 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Monsters on siege duty. -MONSTER: 'i',"quasit",(14,00),hostile -MONSTER: 'i',"quasit",(16,00),hostile -MONSTER: 'i',"quasit",(18,00),hostile -MONSTER: 'i',"quasit",(20,00),hostile -MONSTER: 'i',"quasit",(22,00),hostile -MONSTER: 'i',"quasit",(24,00),hostile -MONSTER: 'i',"quasit",(26,00),hostile -MONSTER: 'i',"quasit",(28,00),hostile -MONSTER: 'i',"quasit",(30,00),hostile -MONSTER: 'i',"quasit",(32,00),hostile -MONSTER: 'i',"quasit",(34,00),hostile -MONSTER: 'i',"quasit",(36,00),hostile +MONSTER: ('i',"quasit"),(14,00),hostile +MONSTER: ('i',"quasit"),(16,00),hostile +MONSTER: ('i',"quasit"),(18,00),hostile +MONSTER: ('i',"quasit"),(20,00),hostile +MONSTER: ('i',"quasit"),(22,00),hostile +MONSTER: ('i',"quasit"),(24,00),hostile +MONSTER: ('i',"quasit"),(26,00),hostile +MONSTER: ('i',"quasit"),(28,00),hostile +MONSTER: ('i',"quasit"),(30,00),hostile +MONSTER: ('i',"quasit"),(32,00),hostile +MONSTER: ('i',"quasit"),(34,00),hostile +MONSTER: ('i',"quasit"),(36,00),hostile # # The "locate" level for the quest. @@ -109,7 +109,7 @@ MONSTER: 'i',"quasit",(36,00),hostile MAZE: "Kni-loca",' ' FLAGS: hardfloor -INIT_MAP: '.' , 'P' , false , true , lit , false +INIT_MAP: mines, '.' , 'P' , false , true , lit , false GEOMETRY:center,center MAP ...PPP.........PPPP..............PPPP... @@ -136,21 +136,21 @@ STAIR:(18,05),down # The altar atop the Tor and its attendant (creating altar makes the priest). ALTAR:(17,05),neutral,shrine # Objects -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps # All of the avenues are guarded by magic except for the East. # South @@ -210,33 +210,33 @@ TRAP:"anti magic",random TRAP:"anti magic",random TRAP:"anti magic",random # Random monsters. -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'j',random,random,hostile -MONSTER:'j',"ochre jelly",random,hostile -MONSTER:'j',"ochre jelly",random,hostile -MONSTER:'j',"ochre jelly",random,hostile -MONSTER:'j',"ochre jelly",random,hostile -MONSTER:'j',"ochre jelly",random,hostile -MONSTER:'j',"ochre jelly",random,hostile -MONSTER:'j',"ochre jelly",random,hostile -MONSTER:'j',random,random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:'i',random,hostile +MONSTER:'j',random,hostile +MONSTER:('j',"ochre jelly"),random,hostile +MONSTER:('j',"ochre jelly"),random,hostile +MONSTER:('j',"ochre jelly"),random,hostile +MONSTER:('j',"ochre jelly"),random,hostile +MONSTER:('j',"ochre jelly"),random,hostile +MONSTER:('j',"ochre jelly"),random,hostile +MONSTER:('j',"ochre jelly"),random,hostile +MONSTER:'j',random,hostile # # The "goal" level for the quest. @@ -278,28 +278,28 @@ STAIR:(03,08),up # Non diggable walls NON_DIGGABLE:(00,00,75,19) # Objects -OBJECT:'(',"mirror",(50,06),blessed,0,"The Magic Mirror of Merlin" -OBJECT:random,random,(33,01) -OBJECT:random,random,(33,02) -OBJECT:random,random,(33,03) -OBJECT:random,random,(33,04) -OBJECT:random,random,(33,05) -OBJECT:random,random,(34,01) -OBJECT:random,random,(34,02) -OBJECT:random,random,(34,03) -OBJECT:random,random,(34,04) -OBJECT:random,random,(34,05) -OBJECT:random,random,(35,01) -OBJECT:random,random,(35,02) -OBJECT:random,random,(35,03) -OBJECT:random,random,(35,04) -OBJECT:random,random,(35,05) -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:('(',"mirror"),(50,06),blessed,0,name:"The Magic Mirror of Merlin" +OBJECT:random,(33,01) +OBJECT:random,(33,02) +OBJECT:random,(33,03) +OBJECT:random,(33,04) +OBJECT:random,(33,05) +OBJECT:random,(34,01) +OBJECT:random,(34,02) +OBJECT:random,(34,03) +OBJECT:random,(34,04) +OBJECT:random,(34,05) +OBJECT:random,(35,01) +OBJECT:random,(35,02) +OBJECT:random,(35,03) +OBJECT:random,(35,04) +OBJECT:random,(35,05) +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:"spiked pit",(13,07) TRAP:"spiked pit",(12,08) @@ -310,34 +310,34 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'D',"Ixoth",(50,06),hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',"quasit",random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'j',"ochre jelly",random,hostile -MONSTER:'j',"ochre jelly",random,hostile -MONSTER:'j',"ochre jelly",random,hostile -MONSTER:'j',"ochre jelly",random,hostile -MONSTER:'j',"ochre jelly",random,hostile -MONSTER:'j',"ochre jelly",random,hostile -MONSTER:'j',"ochre jelly",random,hostile -MONSTER:'j',"ochre jelly",random,hostile -MONSTER:'j',random,random,hostile +MONSTER:('D',"Ixoth"),(50,06),hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:('i',"quasit"),random,hostile +MONSTER:'i',random,hostile +MONSTER:'i',random,hostile +MONSTER:('j',"ochre jelly"),random,hostile +MONSTER:('j',"ochre jelly"),random,hostile +MONSTER:('j',"ochre jelly"),random,hostile +MONSTER:('j',"ochre jelly"),random,hostile +MONSTER:('j',"ochre jelly"),random,hostile +MONSTER:('j',"ochre jelly"),random,hostile +MONSTER:('j',"ochre jelly"),random,hostile +MONSTER:('j',"ochre jelly"),random,hostile +MONSTER:'j',random,hostile # # The "fill" levels for the quest. @@ -349,27 +349,27 @@ MONSTER:'j',random,random,hostile # MAZE: "Kni-fila" , '.' -INIT_MAP: '.' , 'P' , false , true , lit , false +INIT_MAP: mines, '.' , 'P' , false , true , lit , false NOMAP # STAIR: random, up STAIR: random, down # -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # -MONSTER: 'i', "quasit", random, hostile -MONSTER: 'i', "quasit", random, hostile -MONSTER: 'i', "quasit", random, hostile -MONSTER: 'i', "quasit", random, hostile -MONSTER: 'i', random, random, hostile -MONSTER: 'j', "ochre jelly", random, hostile +MONSTER: ('i', "quasit"), random, hostile +MONSTER: ('i', "quasit"), random, hostile +MONSTER: ('i', "quasit"), random, hostile +MONSTER: ('i', "quasit"), random, hostile +MONSTER: 'i', random, hostile +MONSTER: ('j', "ochre jelly"), random, hostile # TRAP: random, random TRAP: random, random @@ -377,32 +377,32 @@ TRAP: random, random TRAP: random, random MAZE: "Kni-filb" , '.' -INIT_MAP: '.' , 'P' , false , true , lit , false +INIT_MAP: mines, '.' , 'P' , false , true , lit , false NOMAP # STAIR: random, up STAIR: random, down # -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # -MONSTER: 'i', "quasit", random, hostile -MONSTER: 'i', "quasit", random, hostile -MONSTER: 'i', "quasit", random, hostile -MONSTER: 'i', "quasit", random, hostile -MONSTER: 'i', random, random, hostile -MONSTER: 'j', "ochre jelly", random, hostile -MONSTER: 'j', "ochre jelly", random, hostile -MONSTER: 'j', "ochre jelly", random, hostile +MONSTER: ('i', "quasit"), random, hostile +MONSTER: ('i', "quasit"), random, hostile +MONSTER: ('i', "quasit"), random, hostile +MONSTER: ('i', "quasit"), random, hostile +MONSTER: 'i', random, hostile +MONSTER: ('j', "ochre jelly"), random, hostile +MONSTER: ('j', "ochre jelly"), random, hostile +MONSTER: ('j', "ochre jelly"), random, hostile # TRAP: random, random TRAP: random, random diff --git a/dat/Monk.des b/dat/Monk.des index fe75301d9..155b37040 100644 --- a/dat/Monk.des +++ b/dat/Monk.des @@ -64,17 +64,17 @@ DOOR:closed,(52,14) # Unattended Altar - unaligned due to conflict - player must align it. ALTAR:(28,09),noalign,altar # The Grand Master -MONSTER:'@',"Grand Master",(28,10) +MONSTER:('@',"Grand Master"),(28,10) # No treasure chest! # guards for the audience chamber -MONSTER:'@',"abbot",(32,07) -MONSTER:'@',"abbot",(32,08) -MONSTER:'@',"abbot",(32,11) -MONSTER:'@',"abbot",(32,12) -MONSTER:'@',"abbot",(33,07) -MONSTER:'@',"abbot",(33,08) -MONSTER:'@',"abbot",(33,11) -MONSTER:'@',"abbot",(33,12) +MONSTER:('@',"abbot"),(32,07) +MONSTER:('@',"abbot"),(32,08) +MONSTER:('@',"abbot"),(32,11) +MONSTER:('@',"abbot"),(32,12) +MONSTER:('@',"abbot"),(33,07) +MONSTER:('@',"abbot"),(33,08) +MONSTER:('@',"abbot"),(33,11) +MONSTER:('@',"abbot"),(33,12) # Non diggable walls NON_DIGGABLE:(00,00,75,19) # Random traps @@ -85,18 +85,18 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Monsters on siege duty. -MONSTER: 'E',"earth elemental",(37,01) -MONSTER: 'E',"earth elemental",(37,18) -MONSTER: 'E',"earth elemental",(03,03) -MONSTER: 'E',"earth elemental",(65,04) -MONSTER: 'E',"earth elemental",(12,11) -MONSTER: 'E',"earth elemental",(60,12) -MONSTER: 'E',"earth elemental",(14,08) -MONSTER: 'E',"earth elemental",(55,00) -MONSTER: 'X',"xorn",(18,18) -MONSTER: 'X',"xorn",(59,10) -MONSTER: 'X',"xorn",(13,09) -MONSTER: 'X',"xorn",(01,17) +MONSTER: ('E',"earth elemental"),(37,01) +MONSTER: ('E',"earth elemental"),(37,18) +MONSTER: ('E',"earth elemental"),(03,03) +MONSTER: ('E',"earth elemental"),(65,04) +MONSTER: ('E',"earth elemental"),(12,11) +MONSTER: ('E',"earth elemental"),(60,12) +MONSTER: ('E',"earth elemental"),(14,08) +MONSTER: ('E',"earth elemental"),(55,00) +MONSTER: ('X',"xorn"),(18,18) +MONSTER: ('X',"xorn"),(59,10) +MONSTER: ('X',"xorn"),(13,09) +MONSTER: ('X',"xorn"),(01,17) # # The "locate" level for the quest. @@ -133,7 +133,9 @@ MAP ------------------------------------------ ------ ENDMAP # Random Monsters -RANDOM_MONSTERS: 'E', 'X' +$monster = monster: { 'E', 'X' } +SHUFFLE: $monster + # Dungeon Description REGION:(00,00,75,20),lit,"ordinary" # Stairs @@ -142,21 +144,21 @@ STAIR:random,down # Non diggable walls NON_DIGGABLE:(00,00,75,20) # Objects -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -165,29 +167,29 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'X',"xorn",random -MONSTER: 'X',"xorn",random -MONSTER: 'X',"xorn",random -MONSTER: 'X',"xorn",random -MONSTER: 'X',"xorn",random -MONSTER: 'X',"xorn",random -MONSTER: 'X',"xorn",random -MONSTER: 'X',"xorn",random -MONSTER: 'X',"xorn",random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('X',"xorn"),random +MONSTER: ('X',"xorn"),random +MONSTER: ('X',"xorn"),random +MONSTER: ('X',"xorn"),random +MONSTER: ('X',"xorn"),random +MONSTER: ('X',"xorn"),random +MONSTER: ('X',"xorn"),random +MONSTER: ('X',"xorn"),random +MONSTER: ('X',"xorn"),random # # The "goal" level for the quest. @@ -198,7 +200,7 @@ MONSTER: 'X',"xorn",random # MAZE: "Mon-goal", ' ' -INIT_MAP: 'L' , '.' , false , false , unlit , false +INIT_MAP: mines, 'L' , '.' , false , false , unlit , false GEOMETRY:center,center MAP .L......L.LLL.......LL.... @@ -214,26 +216,28 @@ LL........................ .........LLL.........L.... ENDMAP # Dungeon Description -RANDOM_PLACES:(14,04),(13,07) +$place = { (14,04),(13,07) } +SHUFFLE: $place + REGION:(00,00,25,10),unlit,"ordinary" # Stairs STAIR:(20,05),up # Objects -OBJECT:'(',"lenses",place[0],blessed,0,"The Eyes of the Overworld" -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:('(',"lenses"),$place[0],blessed,0,name:"The Eyes of the Overworld" +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:"fire",random TRAP:"fire",random @@ -242,26 +246,26 @@ TRAP:"fire",random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'@',"Master Kaen",place[0] -ALTAR:place[0],noalign,altar -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'E',"earth elemental",random -MONSTER: 'X',"xorn",random -MONSTER: 'X',"xorn",random -MONSTER: 'X',"xorn",random -MONSTER: 'X',"xorn",random -MONSTER: 'X',"xorn",random -MONSTER: 'X',"xorn",random -MONSTER: 'X',"xorn",random -MONSTER: 'X',"xorn",random -MONSTER: 'X',"xorn",random +MONSTER:('@',"Master Kaen"),$place[0] +ALTAR:$place[0],noalign,altar +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('E',"earth elemental"),random +MONSTER: ('X',"xorn"),random +MONSTER: ('X',"xorn"),random +MONSTER: ('X',"xorn"),random +MONSTER: ('X',"xorn"),random +MONSTER: ('X',"xorn"),random +MONSTER: ('X',"xorn"),random +MONSTER: ('X',"xorn"),random +MONSTER: ('X',"xorn"),random +MONSTER: ('X',"xorn"),random # # The "fill" levels for the quest. @@ -274,82 +278,98 @@ MONSTER: 'X',"xorn",random LEVEL: "Mon-fila" # Random Monsters -RANDOM_MONSTERS: 'E', 'X' +$monster = monster: { 'E', 'X' } +SHUFFLE: $monster + # -ROOM: "ordinary" , random, random, random, random -STAIR: random, up -OBJECT: random,random,random -MONSTER: 'E', random, random, hostile +ROOM: "ordinary" , random, random, random, random { + STAIR: random, up + OBJECT: random,random + MONSTER: 'E', random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random,random,random -MONSTER: 'E', random, random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random,random + MONSTER: 'E', random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -OBJECT: random,random,random -MONSTER: 'X', "xorn", random -MONSTER: 'E', "earth elemental", random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + OBJECT: random,random + MONSTER: ('X', "xorn"), random + MONSTER: ('E', "earth elemental"), random +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, down -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'E', random, random, hostile -MONSTER: 'E', "earth elemental", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, down + OBJECT: random, random + TRAP: random, random + MONSTER: 'E', random, hostile + MONSTER: ('E', "earth elemental"), random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'X', random, random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random, random + TRAP: random, random + MONSTER: 'X', random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'E', "earth elemental", random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + MONSTER: ('E', "earth elemental"), random +} RANDOM_CORRIDORS LEVEL: "Mon-filb" # Random Monsters -RANDOM_MONSTERS: 'E', 'X' +$monster = monster: { 'E', 'X' } +SHUFFLE: $monster + # -ROOM: "ordinary" , random, random, random, random -STAIR: random, up -OBJECT: random,random,random -MONSTER: 'X', random, random, hostile +ROOM: "ordinary" , random, random, random, random { + STAIR: random, up + OBJECT: random,random + MONSTER: 'X', random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random,random,random -MONSTER: 'X', random, random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random,random + MONSTER: 'X', random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -OBJECT: random,random,random -MONSTER: 'E', random, random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + OBJECT: random,random + MONSTER: 'E', random, hostile +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, down -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'E', random, random, hostile -MONSTER: 'E', "earth elemental", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, down + OBJECT: random, random + TRAP: random, random + MONSTER: 'E', random, hostile + MONSTER: ('E', "earth elemental"), random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'X', random, random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random, random + TRAP: random, random + MONSTER: 'X', random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'E', "earth elemental", random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + MONSTER: ('E', "earth elemental"), random +} RANDOM_CORRIDORS diff --git a/dat/Priest.des b/dat/Priest.des index ea4aef3c5..21fd71600 100644 --- a/dat/Priest.des +++ b/dat/Priest.des @@ -64,18 +64,18 @@ DOOR:closed,(52,14) # Unattended Altar - unaligned due to conflict - player must align it. ALTAR:(28,09),noalign,altar # High Priest -MONSTER:'@',"Arch Priest",(28,10) +MONSTER:('@',"Arch Priest"),(28,10) # The treasure of High Priest -OBJECT:'(',"chest",(27,10) +OBJECT:('(',"chest"),(27,10) # knight guards for the audience chamber -MONSTER:'@',"acolyte",(32,07) -MONSTER:'@',"acolyte",(32,08) -MONSTER:'@',"acolyte",(32,11) -MONSTER:'@',"acolyte",(32,12) -MONSTER:'@',"acolyte",(33,07) -MONSTER:'@',"acolyte",(33,08) -MONSTER:'@',"acolyte",(33,11) -MONSTER:'@',"acolyte",(33,12) +MONSTER:('@',"acolyte"),(32,07) +MONSTER:('@',"acolyte"),(32,08) +MONSTER:('@',"acolyte"),(32,11) +MONSTER:('@',"acolyte"),(32,12) +MONSTER:('@',"acolyte"),(33,07) +MONSTER:('@',"acolyte"),(33,08) +MONSTER:('@',"acolyte"),(33,11) +MONSTER:('@',"acolyte"),(33,12) # Non diggable walls NON_DIGGABLE:(00,00,75,19) # Random traps @@ -86,18 +86,18 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Monsters on siege duty. -MONSTER: 'Z',"human zombie",(37,01) -MONSTER: 'Z',"human zombie",(37,18) -MONSTER: 'Z',"human zombie",(03,03) -MONSTER: 'Z',"human zombie",(65,04) -MONSTER: 'Z',"human zombie",(12,11) -MONSTER: 'Z',"human zombie",(60,12) -MONSTER: 'Z',"human zombie",(14,08) -MONSTER: 'Z',"human zombie",(55,00) -MONSTER: 'Z',"human zombie",(18,18) -MONSTER: 'Z',"human zombie",(59,10) -MONSTER: 'Z',"human zombie",(13,09) -MONSTER: 'Z',"human zombie",(01,17) +MONSTER: ('Z',"human zombie"),(37,01) +MONSTER: ('Z',"human zombie"),(37,18) +MONSTER: ('Z',"human zombie"),(03,03) +MONSTER: ('Z',"human zombie"),(65,04) +MONSTER: ('Z',"human zombie"),(12,11) +MONSTER: ('Z',"human zombie"),(60,12) +MONSTER: ('Z',"human zombie"),(14,08) +MONSTER: ('Z',"human zombie"),(55,00) +MONSTER: ('Z',"human zombie"),(18,18) +MONSTER: ('Z',"human zombie"),(59,10) +MONSTER: ('Z',"human zombie"),(13,09) +MONSTER: ('Z',"human zombie"),(01,17) # # The "locate" level for the quest. @@ -109,7 +109,7 @@ MONSTER: 'Z',"human zombie",(01,17) MAZE: "Pri-loca",' ' FLAGS: hardfloor # This is a kludge to init the level as a lit field. -INIT_MAP: '.' , '.' , false , false , lit , false +INIT_MAP: mines, '.' , '.' , false , false , lit , false GEOMETRY:center,center MAP ........................................ @@ -132,10 +132,10 @@ REGION:(00,00,09,13),unlit,"morgue" REGION:(09,00,30,01),unlit,"morgue" REGION:(09,12,30,13),unlit,"morgue" REGION:(31,00,39,13),unlit,"morgue" -REGION:(11,03,29,10),lit,"temple",filled,true +REGION:(11,03,29,10),lit,"temple",filled,irregular # The altar inside the temple ALTAR:(20,07),noalign,shrine -MONSTER:'@',"aligned priest",(20,07),noalign,hostile +MONSTER:('@',"aligned priest"),(20,07),noalign,hostile # Doors DOOR:locked,(10,06) DOOR:locked,(10,07) @@ -150,21 +150,21 @@ STAIR:(20,06),down # Non diggable walls NON_DIGGABLE:(10,02,30,13) # Objects (inside the antechambers). -OBJECT:random,random,(14,03) -OBJECT:random,random,(15,03) -OBJECT:random,random,(16,03) -OBJECT:random,random,(14,10) -OBJECT:random,random,(15,10) -OBJECT:random,random,(16,10) -OBJECT:random,random,(17,10) -OBJECT:random,random,(24,03) -OBJECT:random,random,(25,03) -OBJECT:random,random,(26,03) -OBJECT:random,random,(27,03) -OBJECT:random,random,(24,10) -OBJECT:random,random,(25,10) -OBJECT:random,random,(26,10) -OBJECT:random,random,(27,10) +OBJECT:random,(14,03) +OBJECT:random,(15,03) +OBJECT:random,(16,03) +OBJECT:random,(14,10) +OBJECT:random,(15,10) +OBJECT:random,(16,10) +OBJECT:random,(17,10) +OBJECT:random,(24,03) +OBJECT:random,(25,03) +OBJECT:random,(26,03) +OBJECT:random,(27,03) +OBJECT:random,(24,10) +OBJECT:random,(25,10) +OBJECT:random,(26,10) +OBJECT:random,(27,10) # Random traps TRAP:random,(15,04) TRAP:random,(25,04) @@ -183,7 +183,7 @@ TRAP:random,random # MAZE: "Pri-goal", ' ' -INIT_MAP: 'L' , '.' , false , false , unlit , false +INIT_MAP: mines, 'L' , '.' , false , false , unlit , false GEOMETRY:center,center MAP .L......L.LLL.......LL.... @@ -199,26 +199,28 @@ LL........................ .........LLL.........L.... ENDMAP # Dungeon Description -RANDOM_PLACES:(14,04),(13,07) +$place = { (14,04),(13,07) } +SHUFFLE: $place + REGION:(00,00,25,10),unlit,"ordinary" # Stairs STAIR:(20,05),up # Objects -OBJECT:'[',"helm of brilliance",place[0],blessed,0,"The Mitre of Holiness" -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:('[',"helm of brilliance"),$place[0],blessed,0,name:"The Mitre of Holiness" +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:"fire",random TRAP:"fire",random @@ -227,34 +229,34 @@ TRAP:"fire",random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'&',"Nalzok",place[0] -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',random,random -MONSTER:'Z',random,random -MONSTER:'W',"wraith",random -MONSTER:'W',"wraith",random -MONSTER:'W',"wraith",random -MONSTER:'W',"wraith",random -MONSTER:'W',"wraith",random -MONSTER:'W',"wraith",random -MONSTER:'W',"wraith",random -MONSTER:'W',"wraith",random -MONSTER:'W',random,random +MONSTER:('&',"Nalzok"),$place[0] +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:'Z',random +MONSTER:'Z',random +MONSTER:('W',"wraith"),random +MONSTER:('W',"wraith"),random +MONSTER:('W',"wraith"),random +MONSTER:('W',"wraith"),random +MONSTER:('W',"wraith"),random +MONSTER:('W',"wraith"),random +MONSTER:('W',"wraith"),random +MONSTER:('W',"wraith"),random +MONSTER:'W',random # # The "fill" levels for the quest. @@ -267,73 +269,85 @@ MONSTER:'W',random,random LEVEL: "Pri-fila" # -ROOM: "ordinary" , random, random, random, random -STAIR: random, up -OBJECT: random,random,random -MONSTER: 'Z', "human zombie", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, up + OBJECT: random,random + MONSTER: ('Z', "human zombie"), random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random,random,random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random,random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -OBJECT: random,random,random -MONSTER: 'Z', "human zombie", random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + OBJECT: random,random + MONSTER: ('Z', "human zombie"), random +} -ROOM: "morgue" , random, random, random, random -STAIR: random, down -OBJECT: random, random, random -TRAP: random, random +ROOM: "morgue" , random, random, random, random { + STAIR: random, down + OBJECT: random, random + TRAP: random, random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'W', "wraith", random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random, random + TRAP: random, random + MONSTER: ('W', "wraith"), random +} -ROOM: "morgue" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random +ROOM: "morgue" , random, random, random, random { + OBJECT: random, random + TRAP: random, random +} RANDOM_CORRIDORS LEVEL: "Pri-filb" # -ROOM: "ordinary" , random, random, random, random -STAIR: random, up -OBJECT: random,random,random -MONSTER: 'Z', "human zombie", random -MONSTER: 'W', "wraith", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, up + OBJECT: random,random + MONSTER: ('Z', "human zombie"), random + MONSTER: ('W', "wraith"), random +} -ROOM: "morgue" , random, random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random,random,random +ROOM: "morgue" , random, random, random, random { + OBJECT: random, random + OBJECT: random, random + OBJECT: random,random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -OBJECT: random,random,random -MONSTER: 'Z', "human zombie", random -MONSTER: 'W', "wraith", random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + OBJECT: random,random + MONSTER: ('Z', "human zombie"), random + MONSTER: ('W', "wraith"), random +} -ROOM: "morgue" , random, random, random, random -STAIR: random, down -OBJECT: random, random, random -OBJECT: random, random, random -TRAP: random, random +ROOM: "morgue" , random, random, random, random { + STAIR: random, down + OBJECT: random, random + OBJECT: random, random + TRAP: random, random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'Z', "human zombie", random -MONSTER: 'W', "wraith", random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random, random + TRAP: random, random + MONSTER: ('Z', "human zombie"), random + MONSTER: ('W', "wraith"), random +} -ROOM: "morgue" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random +ROOM: "morgue" , random, random, random, random { + OBJECT: random, random + TRAP: random, random +} RANDOM_CORRIDORS diff --git a/dat/Ranger.des b/dat/Ranger.des index d36559cb6..f44c28779 100644 --- a/dat/Ranger.des +++ b/dat/Ranger.des @@ -12,7 +12,7 @@ # MAZE: "Ran-strt",'.' FLAGS: noteleport,hardfloor,arboreal -INIT_MAP:'.','.',true,true,lit,false +INIT_MAP:mines,'.','.',true,true,lit,false GEOMETRY:left,center #1234567890123456789012345678901234567890123456789012345678901234567890 MAP @@ -45,18 +45,18 @@ STAIR:(10,10),down # Portal arrival point; just about anywhere on the right hand side of the map BRANCH:levregion(51,2,77,18),(0,0,40,20) # Orion -MONSTER:'@',"Orion",(20,10) +MONSTER:('@',"Orion"),(20,10) # The treasure of Orion -OBJECT:'(',"chest",(20,10) +OBJECT:('(',"chest"),(20,10) # Guards for the audience chamber -MONSTER:'@',"hunter",(19,09) -MONSTER:'@',"hunter",(20,09) -MONSTER:'@',"hunter",(21,09) -MONSTER:'@',"hunter",(19,10) -MONSTER:'@',"hunter",(21,10) -MONSTER:'@',"hunter",(19,11) -MONSTER:'@',"hunter",(20,11) -MONSTER:'@',"hunter",(21,11) +MONSTER:('@',"hunter"),(19,09) +MONSTER:('@',"hunter"),(20,09) +MONSTER:('@',"hunter"),(21,09) +MONSTER:('@',"hunter"),(19,10) +MONSTER:('@',"hunter"),(21,10) +MONSTER:('@',"hunter"),(19,11) +MONSTER:('@',"hunter"),(20,11) +MONSTER:('@',"hunter"),(21,11) # Non diggable walls NON_DIGGABLE:(00,00,40,20) # Traps @@ -67,33 +67,33 @@ TRAP:"spiked pit",random TRAP:"bear",random TRAP:"bear",random # Monsters on siege duty. -MONSTER: 'H',"minotaur",(33,09),hostile,asleep -MONSTER: 'C',"forest centaur",(19,03),hostile -MONSTER: 'C',"forest centaur",(19,04),hostile -MONSTER: 'C',"forest centaur",(19,05),hostile -MONSTER: 'C',"forest centaur",(21,03),hostile -MONSTER: 'C',"forest centaur",(21,04),hostile -MONSTER: 'C',"forest centaur",(21,05),hostile -MONSTER: 'C',"forest centaur",(01,09),hostile -MONSTER: 'C',"forest centaur",(02,09),hostile -MONSTER: 'C',"forest centaur",(03,09),hostile -MONSTER: 'C',"forest centaur",(01,11),hostile -MONSTER: 'C',"forest centaur",(02,11),hostile -MONSTER: 'C',"forest centaur",(03,11),hostile -MONSTER: 'C',"forest centaur",(19,15),hostile -MONSTER: 'C',"forest centaur",(19,16),hostile -MONSTER: 'C',"forest centaur",(19,17),hostile -MONSTER: 'C',"forest centaur",(21,15),hostile -MONSTER: 'C',"forest centaur",(21,16),hostile -MONSTER: 'C',"forest centaur",(21,17),hostile -MONSTER: 'C',"plains centaur",random,hostile -MONSTER: 'C',"plains centaur",random,hostile -MONSTER: 'C',"plains centaur",random,hostile -MONSTER: 'C',"plains centaur",random,hostile -MONSTER: 'C',"plains centaur",random,hostile -MONSTER: 'C',"plains centaur",random,hostile -MONSTER: 's',"scorpion",random,hostile -MONSTER: 's',"scorpion",random,hostile +MONSTER: ('H',"minotaur"),(33,09),hostile,asleep +MONSTER: ('C',"forest centaur"),(19,03),hostile +MONSTER: ('C',"forest centaur"),(19,04),hostile +MONSTER: ('C',"forest centaur"),(19,05),hostile +MONSTER: ('C',"forest centaur"),(21,03),hostile +MONSTER: ('C',"forest centaur"),(21,04),hostile +MONSTER: ('C',"forest centaur"),(21,05),hostile +MONSTER: ('C',"forest centaur"),(01,09),hostile +MONSTER: ('C',"forest centaur"),(02,09),hostile +MONSTER: ('C',"forest centaur"),(03,09),hostile +MONSTER: ('C',"forest centaur"),(01,11),hostile +MONSTER: ('C',"forest centaur"),(02,11),hostile +MONSTER: ('C',"forest centaur"),(03,11),hostile +MONSTER: ('C',"forest centaur"),(19,15),hostile +MONSTER: ('C',"forest centaur"),(19,16),hostile +MONSTER: ('C',"forest centaur"),(19,17),hostile +MONSTER: ('C',"forest centaur"),(21,15),hostile +MONSTER: ('C',"forest centaur"),(21,16),hostile +MONSTER: ('C',"forest centaur"),(21,17),hostile +MONSTER: ('C',"plains centaur"),random,hostile +MONSTER: ('C',"plains centaur"),random,hostile +MONSTER: ('C',"plains centaur"),random,hostile +MONSTER: ('C',"plains centaur"),random,hostile +MONSTER: ('C',"plains centaur"),random,hostile +MONSTER: ('C',"plains centaur"),random,hostile +MONSTER: ('s',"scorpion"),random,hostile +MONSTER: ('s',"scorpion"),random,hostile # @@ -137,14 +137,14 @@ STAIR:(27,18),down # Non diggable walls NON_DIGGABLE:(00,00,54,19) # Objects -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:"spiked pit",random TRAP:"spiked pit",random @@ -153,29 +153,29 @@ TRAP:"teleport",random TRAP:"arrow",random TRAP:"arrow",random # Random monsters. -MONSTER:'q',"wumpus",(27,18),hostile,asleep -MONSTER:'B',"giant bat",random,hostile -MONSTER:'B',"giant bat",random,hostile -MONSTER:'B',"giant bat",random,hostile -MONSTER:'B',"giant bat",random,hostile -MONSTER:'C',"forest centaur",random,hostile -MONSTER:'C',"forest centaur",random,hostile -MONSTER:'C',"forest centaur",random,hostile -MONSTER:'C',"forest centaur",random,hostile -MONSTER:'C',"mountain centaur",random,hostile -MONSTER:'C',"mountain centaur",random,hostile -MONSTER:'C',"mountain centaur",random,hostile -MONSTER:'C',"mountain centaur",random,hostile -MONSTER:'C',"mountain centaur",random,hostile -MONSTER:'C',"mountain centaur",random,hostile -MONSTER:'C',"mountain centaur",random,hostile -MONSTER:'C',"mountain centaur",random,hostile -MONSTER:'s',"scorpion",random,hostile -MONSTER:'s',"scorpion",random,hostile -MONSTER:'s',"scorpion",random,hostile -MONSTER:'s',"scorpion",random,hostile -MONSTER:'s',random,random,hostile -MONSTER:'s',random,random,hostile +MONSTER:('q',"wumpus"),(27,18),hostile,asleep +MONSTER:('B',"giant bat"),random,hostile +MONSTER:('B',"giant bat"),random,hostile +MONSTER:('B',"giant bat"),random,hostile +MONSTER:('B',"giant bat"),random,hostile +MONSTER:('C',"forest centaur"),random,hostile +MONSTER:('C',"forest centaur"),random,hostile +MONSTER:('C',"forest centaur"),random,hostile +MONSTER:('C',"forest centaur"),random,hostile +MONSTER:('C',"mountain centaur"),random,hostile +MONSTER:('C',"mountain centaur"),random,hostile +MONSTER:('C',"mountain centaur"),random,hostile +MONSTER:('C',"mountain centaur"),random,hostile +MONSTER:('C',"mountain centaur"),random,hostile +MONSTER:('C',"mountain centaur"),random,hostile +MONSTER:('C',"mountain centaur"),random,hostile +MONSTER:('C',"mountain centaur"),random,hostile +MONSTER:('s',"scorpion"),random,hostile +MONSTER:('s',"scorpion"),random,hostile +MONSTER:('s',"scorpion"),random,hostile +MONSTER:('s',"scorpion"),random,hostile +MONSTER:'s',random,hostile +MONSTER:'s',random,hostile # @@ -217,21 +217,21 @@ STAIR:(19,10),up # Non diggable walls NON_DIGGABLE:(00,00,75,19) # Objects -OBJECT:')',"bow",(37,10),blessed,0,"The Longbow of Diana" -OBJECT:'(',"chest",(37,10) -OBJECT:random,random,(36,09) -OBJECT:random,random,(36,10) -OBJECT:random,random,(36,11) -OBJECT:random,random,(37,09) -OBJECT:random,random,(37,11) -OBJECT:random,random,(38,09) -OBJECT:random,random,(38,10) -OBJECT:random,random,(38,11) -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:(')',"bow"),(37,10),blessed,0,name:"The Longbow of Diana" +OBJECT:('(',"chest"),(37,10) +OBJECT:random,(36,09) +OBJECT:random,(36,10) +OBJECT:random,(36,11) +OBJECT:random,(37,09) +OBJECT:random,(37,11) +OBJECT:random,(38,09) +OBJECT:random,(38,10) +OBJECT:random,(38,11) +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -255,34 +255,34 @@ DOOR:closed,(51,10) DOOR:locked,(53,08) DOOR:closed,(65,05) # Random monsters. -MONSTER:'s',"Scorpius",(37,10),hostile -MONSTER:'C',"forest centaur",(36,09),hostile -MONSTER:'C',"forest centaur",(36,10),hostile -MONSTER:'C',"forest centaur",(36,11),hostile -MONSTER:'C',"forest centaur",(37,09),hostile -MONSTER:'C',"forest centaur",(37,11),hostile -MONSTER:'C',"forest centaur",(38,09),hostile -MONSTER:'C',"mountain centaur",(38,10),hostile -MONSTER:'C',"mountain centaur",(38,11),hostile -MONSTER:'C',"mountain centaur",(02,02),hostile -MONSTER:'C',"mountain centaur",(71,02),hostile -MONSTER:'C',"mountain centaur",(02,16),hostile -MONSTER:'C',"mountain centaur",(71,16),hostile -MONSTER:'C',"forest centaur",random,hostile -MONSTER:'C',"forest centaur",random,hostile -MONSTER:'C',"mountain centaur",random,hostile -MONSTER:'C',"mountain centaur",random,hostile -MONSTER:'C',random,random,hostile -MONSTER:'C',random,random,hostile -MONSTER:'s',"scorpion",(03,02),hostile -MONSTER:'s',"scorpion",(72,02),hostile -MONSTER:'s',"scorpion",(03,17),hostile -MONSTER:'s',"scorpion",(72,17),hostile -MONSTER:'s',"scorpion",(41,10),hostile -MONSTER:'s',"scorpion",(33,09),hostile -MONSTER:'s',"scorpion",random,hostile -MONSTER:'s',"scorpion",random,hostile -MONSTER:'s',random,random,hostile +MONSTER:('s',"Scorpius"),(37,10),hostile +MONSTER:('C',"forest centaur"),(36,09),hostile +MONSTER:('C',"forest centaur"),(36,10),hostile +MONSTER:('C',"forest centaur"),(36,11),hostile +MONSTER:('C',"forest centaur"),(37,09),hostile +MONSTER:('C',"forest centaur"),(37,11),hostile +MONSTER:('C',"forest centaur"),(38,09),hostile +MONSTER:('C',"mountain centaur"),(38,10),hostile +MONSTER:('C',"mountain centaur"),(38,11),hostile +MONSTER:('C',"mountain centaur"),(02,02),hostile +MONSTER:('C',"mountain centaur"),(71,02),hostile +MONSTER:('C',"mountain centaur"),(02,16),hostile +MONSTER:('C',"mountain centaur"),(71,16),hostile +MONSTER:('C',"forest centaur"),random,hostile +MONSTER:('C',"forest centaur"),random,hostile +MONSTER:('C',"mountain centaur"),random,hostile +MONSTER:('C',"mountain centaur"),random,hostile +MONSTER:'C',random,hostile +MONSTER:'C',random,hostile +MONSTER:('s',"scorpion"),(03,02),hostile +MONSTER:('s',"scorpion"),(72,02),hostile +MONSTER:('s',"scorpion"),(03,17),hostile +MONSTER:('s',"scorpion"),(72,17),hostile +MONSTER:('s',"scorpion"),(41,10),hostile +MONSTER:('s',"scorpion"),(33,09),hostile +MONSTER:('s',"scorpion"),random,hostile +MONSTER:('s',"scorpion"),random,hostile +MONSTER:'s',random,hostile WALLIFY @@ -296,62 +296,62 @@ WALLIFY # MAZE: "Ran-fila" , ' ' -INIT_MAP: '.' , 'T', true, true, random, true +INIT_MAP: mines, '.' , 'T', true, true, random, true NOMAP # STAIR: random, up STAIR: random, down # -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # TRAP: random, random TRAP: random, random TRAP: random, random TRAP: random, random # -MONSTER: 'C', "mountain centaur", random, hostile -MONSTER: 'C', "mountain centaur", random, hostile -MONSTER: 'C', "forest centaur", random, hostile -MONSTER: 'C', "forest centaur", random, hostile -MONSTER: 'C', "forest centaur", random, hostile -MONSTER: 'C', random, random, hostile -MONSTER: 's', "scorpion", random, hostile +MONSTER: ('C', "mountain centaur"), random, hostile +MONSTER: ('C', "mountain centaur"), random, hostile +MONSTER: ('C', "forest centaur"), random, hostile +MONSTER: ('C', "forest centaur"), random, hostile +MONSTER: ('C', "forest centaur"), random, hostile +MONSTER: 'C', random, hostile +MONSTER: ('s', "scorpion"), random, hostile MAZE: "Ran-filb" , ' ' -INIT_MAP: '.' , ' ', true, true, random, true +INIT_MAP: mines, '.' , ' ', true, true, random, true NOMAP # STAIR: random, up STAIR: random, down # -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # TRAP: random, random TRAP: random, random TRAP: random, random TRAP: random, random # -MONSTER: 'C', "mountain centaur", random, hostile -MONSTER: 'C', "mountain centaur", random, hostile -MONSTER: 'C', "mountain centaur", random, hostile -MONSTER: 'C', "mountain centaur", random, hostile -MONSTER: 'C', random, random, hostile -MONSTER: 's', "scorpion", random, hostile -MONSTER: 's', "scorpion", random, hostile +MONSTER: ('C', "mountain centaur"), random, hostile +MONSTER: ('C', "mountain centaur"), random, hostile +MONSTER: ('C', "mountain centaur"), random, hostile +MONSTER: ('C', "mountain centaur"), random, hostile +MONSTER: 'C', random, hostile +MONSTER: ('s', "scorpion"), random, hostile +MONSTER: ('s', "scorpion"), random, hostile diff --git a/dat/Rogue.des b/dat/Rogue.des index 2d2c6a202..38921c371 100644 --- a/dat/Rogue.des +++ b/dat/Rogue.des @@ -41,11 +41,13 @@ ENDMAP #REGION:(00,00,75,20),lit,"ordinary" # The down stairs is at one of the 4 "exits". The others are mimics, # mimicing stairwells. -RANDOM_PLACES: (33,0), (0,12), (25,20), (75,05) -STAIR:place[0],down -MONSTER:'m',"giant mimic", place[1], m_feature "staircase down" -MONSTER:'m',"large mimic", place[2], m_feature "staircase down" -MONSTER:'m',"small mimic", place[3], m_feature "staircase down" +$place = { (33,0), (0,12), (25,20), (75,05) } +SHUFFLE: $place + +STAIR:$place[0],down +MONSTER:('m',"giant mimic"), $place[1], m_feature "staircase down" +MONSTER:('m',"large mimic"), $place[2], m_feature "staircase down" +MONSTER:('m',"small mimic"), $place[3], m_feature "staircase down" # Portal arrival point BRANCH:(19,09,19,09),(0,0,0,0) # Doors (secret) @@ -98,21 +100,21 @@ DOOR: closed, ( 6,18) DOOR: closed, (65,18) DOOR: closed, (68,18) # Master of Thieves -MONSTER:'@',"Master of Thieves",(36,11) +MONSTER:('@',"Master of Thieves"),(36,11) # The treasure of Master of Thieves -OBJECT:'(',"chest",(36,11) +OBJECT:('(',"chest"),(36,11) # thug guards, room #1 -MONSTER:'@',"thug",(28,10) -MONSTER:'@',"thug",(29,11) -MONSTER:'@',"thug",(30,09) -MONSTER:'@',"thug",(31,07) +MONSTER:('@',"thug"),(28,10) +MONSTER:('@',"thug"),(29,11) +MONSTER:('@',"thug"),(30,09) +MONSTER:('@',"thug"),(31,07) # thug guards, room #2 -MONSTER:'@',"thug",(31,13) -MONSTER:'@',"thug",(33,14) -MONSTER:'@',"thug",(30,15) +MONSTER:('@',"thug"),(31,13) +MONSTER:('@',"thug"),(33,14) +MONSTER:('@',"thug"),(30,15) #thug guards, room #3 -MONSTER:'@',"thug",(35,09) -MONSTER:'@',"thug",(36,13) +MONSTER:('@',"thug"),(35,09) +MONSTER:('@',"thug"),(36,13) # Non diggable walls NON_DIGGABLE:(00,00,75,20) # Random traps @@ -136,37 +138,37 @@ TRAP:random,random # Monsters to get in the way. # # West exit -MONSTER: 'l',"leprechaun",(01,12),hostile -MONSTER: 'n',"water nymph",(02,12),hostile +MONSTER: ('l',"leprechaun"),(01,12),hostile +MONSTER: ('n',"water nymph"),(02,12),hostile # North exit -MONSTER: 'n',"water nymph",(33,01),hostile -MONSTER: 'l',"leprechaun",(33,02),hostile +MONSTER: ('n',"water nymph"),(33,01),hostile +MONSTER: ('l',"leprechaun"),(33,02),hostile # East exit -MONSTER: 'n',"water nymph",(74,05),hostile -MONSTER: 'l',"leprechaun",(74,04),hostile +MONSTER: ('n',"water nymph"),(74,05),hostile +MONSTER: ('l',"leprechaun"),(74,04),hostile # South exit -MONSTER: 'l',"leprechaun",(25,19),hostile -MONSTER: 'n',"water nymph",(25,18),hostile +MONSTER: ('l',"leprechaun"),(25,19),hostile +MONSTER: ('n',"water nymph"),(25,18),hostile # Wandering the streets. What I'd really like for this is a random # location, but make sure we're on a given type, e.g. street (if they # existed, of course). -MONSTER: 'n',"water nymph",(07,05),hostile -MONSTER: 'l',"leprechaun",(28,06),hostile -MONSTER: 'n',"water nymph",(38,07),hostile -MONSTER: 'l',"leprechaun",(45,01),hostile -MONSTER: 'n',"water nymph",(59,07),hostile -MONSTER: 'l',"leprechaun",(62,14),hostile -MONSTER: 'n',"water nymph",(71,14),hostile -MONSTER: 'l',"leprechaun",(39,13),hostile -MONSTER: 'n',"water nymph",(18,14),hostile -MONSTER: ':',"chameleon",(19,08),hostile -MONSTER: ':',"chameleon",(22,08),hostile -MONSTER: ':',"chameleon",(16,08),hostile -MONSTER: ':',"chameleon",random,hostile -MONSTER: ':',"chameleon",random,hostile -MONSTER: ':',"chameleon",random,hostile -MONSTER: ':',"chameleon",random,hostile -MONSTER: ':',"chameleon",random,hostile +MONSTER: ('n',"water nymph"),(07,05),hostile +MONSTER: ('l',"leprechaun"),(28,06),hostile +MONSTER: ('n',"water nymph"),(38,07),hostile +MONSTER: ('l',"leprechaun"),(45,01),hostile +MONSTER: ('n',"water nymph"),(59,07),hostile +MONSTER: ('l',"leprechaun"),(62,14),hostile +MONSTER: ('n',"water nymph"),(71,14),hostile +MONSTER: ('l',"leprechaun"),(39,13),hostile +MONSTER: ('n',"water nymph"),(18,14),hostile +MONSTER: (':',"chameleon"),(19,08),hostile +MONSTER: (':',"chameleon"),(22,08),hostile +MONSTER: (':',"chameleon"),(16,08),hostile +MONSTER: (':',"chameleon"),random,hostile +MONSTER: (':',"chameleon"),random,hostile +MONSTER: (':',"chameleon"),random,hostile +MONSTER: (':',"chameleon"),random,hostile +MONSTER: (':',"chameleon"),random,hostile # # The "locate" level for the quest. @@ -212,21 +214,21 @@ STAIR:random,down # Non diggable walls NON_DIGGABLE:(00,00,75,20) # Objects -OBJECT:'?',"teleportation",(11,18),cursed,0 -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:('?',"teleportation"),(11,18),cursed,0 +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -235,39 +237,39 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',random,random,hostile -MONSTER:'N',"guardian naga",random,hostile -MONSTER:'N',"guardian naga",random,hostile -MONSTER:'N',"guardian naga",random,hostile -MONSTER:'N',"guardian naga",random,hostile -MONSTER:'N',"guardian naga",random,hostile -MONSTER:'N',"guardian naga",random,hostile -MONSTER:'N',"guardian naga",random,hostile -MONSTER:'N',random,random,hostile -MONSTER:'N',random,random,hostile -MONSTER:'N',random,random,hostile -MONSTER: ':',"chameleon",random,hostile -MONSTER: ':',"chameleon",random,hostile -MONSTER: ':',"chameleon",random,hostile -MONSTER: ':',"chameleon",random,hostile -MONSTER: ':',"chameleon",random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:'l',random,hostile +MONSTER:('N',"guardian naga"),random,hostile +MONSTER:('N',"guardian naga"),random,hostile +MONSTER:('N',"guardian naga"),random,hostile +MONSTER:('N',"guardian naga"),random,hostile +MONSTER:('N',"guardian naga"),random,hostile +MONSTER:('N',"guardian naga"),random,hostile +MONSTER:('N',"guardian naga"),random,hostile +MONSTER:'N',random,hostile +MONSTER:'N',random,hostile +MONSTER:'N',random,hostile +MONSTER: (':',"chameleon"),random,hostile +MONSTER: (':',"chameleon"),random,hostile +MONSTER: (':',"chameleon"),random,hostile +MONSTER: (':',"chameleon"),random,hostile +MONSTER: (':',"chameleon"),random,hostile # # The "goal" level for the quest. Teleportation and digging are @@ -315,21 +317,21 @@ NON_DIGGABLE:(00,00,75,20) # One trap to keep the gnomes at bay. TRAP:"spiked pit",(37,07) # Objects -OBJECT:'(',"skeleton key",(38,10),blessed,0,"The Master Key of Thievery" -OBJECT:'%',"tin",(26,12),"chameleon",0 -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:('(',"skeleton key"),(38,10),blessed,0,name:"The Master Key of Thievery" +OBJECT:('%',"tin"),(26,12),montype:"chameleon" +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -343,45 +345,45 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'@',"Master Assassin",(38,10),hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',"leprechaun",random,hostile -MONSTER:'l',random,random,hostile -MONSTER:'l',random,random,hostile -MONSTER:'N',"guardian naga",random,hostile -MONSTER:'N',"guardian naga",random,hostile -MONSTER:'N',"guardian naga",random,hostile -MONSTER:'N',"guardian naga",random,hostile -MONSTER:'N',"guardian naga",random,hostile -MONSTER:'N',"guardian naga",random,hostile -MONSTER:'N',"guardian naga",random,hostile -MONSTER:'N',"guardian naga",random,hostile -MONSTER:'N',random,random,hostile -MONSTER:'N',random,random,hostile -MONSTER:'N',random,random,hostile -MONSTER: ':',"chameleon",random,hostile -MONSTER: ':',"chameleon",random,hostile -MONSTER: ':',"chameleon",random,hostile -MONSTER: ':',"chameleon",random,hostile -MONSTER: ':',"chameleon",random,hostile -MONSTER:';',"shark",(51,14),hostile -MONSTER:';',"shark",(53,09),hostile -MONSTER:';',"shark",(55,15),hostile -MONSTER:';',"shark",(58,10),hostile +MONSTER:('@',"Master Assassin"),(38,10),hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:('l',"leprechaun"),random,hostile +MONSTER:'l',random,hostile +MONSTER:'l',random,hostile +MONSTER:('N',"guardian naga"),random,hostile +MONSTER:('N',"guardian naga"),random,hostile +MONSTER:('N',"guardian naga"),random,hostile +MONSTER:('N',"guardian naga"),random,hostile +MONSTER:('N',"guardian naga"),random,hostile +MONSTER:('N',"guardian naga"),random,hostile +MONSTER:('N',"guardian naga"),random,hostile +MONSTER:('N',"guardian naga"),random,hostile +MONSTER:'N',random,hostile +MONSTER:'N',random,hostile +MONSTER:'N',random,hostile +MONSTER: (':',"chameleon"),random,hostile +MONSTER: (':',"chameleon"),random,hostile +MONSTER: (':',"chameleon"),random,hostile +MONSTER: (':',"chameleon"),random,hostile +MONSTER: (':',"chameleon"),random,hostile +MONSTER:(';',"shark"),(51,14),hostile +MONSTER:(';',"shark"),(53,09),hostile +MONSTER:(';',"shark"),(55,15),hostile +MONSTER:(';',"shark"),(58,10),hostile # # The "fill" level for the quest. @@ -391,45 +393,51 @@ MONSTER:';',"shark",(58,10),hostile # LEVEL: "Rog-fila" # -ROOM: "ordinary" , random, random, random, random -STAIR: random, up -OBJECT: random,random,random -MONSTER: 'l', "leprechaun", random, hostile +ROOM: "ordinary" , random, random, random, random { + STAIR: random, up + OBJECT: random,random + MONSTER: ('l', "leprechaun"), random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random,random,random -MONSTER: 'l', "leprechaun", random, hostile -MONSTER: 'N', "guardian naga", random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random,random + MONSTER: ('l', "leprechaun"), random, hostile + MONSTER: ('N', "guardian naga"), random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -TRAP: random, random -OBJECT: random,random,random -MONSTER: 'n', "water nymph", random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + TRAP: random, random + OBJECT: random,random + MONSTER: ('n', "water nymph"), random, hostile +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, down -OBJECT: random, random, random -TRAP: random, random -TRAP: random, random -MONSTER: 'l', random, random, hostile -MONSTER: 'N', "guardian naga", random, hostile +ROOM: "ordinary" , random, random, random, random { + STAIR: random, down + OBJECT: random, random + TRAP: random, random + TRAP: random, random + MONSTER: 'l', random, hostile + MONSTER: ('N', "guardian naga"), random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -TRAP: random, random -TRAP: random, random -MONSTER: 'l', "leprechaun", random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random, random + TRAP: random, random + TRAP: random, random + MONSTER: ('l', "leprechaun"), random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -TRAP: random, random -MONSTER: 'l', "leprechaun", random, hostile -MONSTER: 'n', "water nymph", random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + TRAP: random, random + MONSTER: ('l', "leprechaun"), random, hostile + MONSTER: ('n', "water nymph"), random, hostile +} RANDOM_CORRIDORS @@ -438,44 +446,50 @@ RANDOM_CORRIDORS # LEVEL: "Rog-filb" # -ROOM: "ordinary" , random, random, random, random -STAIR: random, up -OBJECT: random,random,random -MONSTER: 'l', "leprechaun", random, hostile +ROOM: "ordinary" , random, random, random, random { + STAIR: random, up + OBJECT: random,random + MONSTER: ('l', "leprechaun"), random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random,random,random -MONSTER: 'l', "leprechaun", random, hostile -MONSTER: 'N', "guardian naga", random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random,random + MONSTER: ('l', "leprechaun"), random, hostile + MONSTER: ('N', "guardian naga"), random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -TRAP: random, random -OBJECT: random,random,random -MONSTER: 'n', "water nymph", random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + TRAP: random, random + OBJECT: random,random + MONSTER: ('n', "water nymph"), random, hostile +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, down -OBJECT: random, random, random -TRAP: random, random -TRAP: random, random -MONSTER: 'l', random, random, hostile -MONSTER: 'N', "guardian naga", random, hostile +ROOM: "ordinary" , random, random, random, random { + STAIR: random, down + OBJECT: random, random + TRAP: random, random + TRAP: random, random + MONSTER: 'l', random, hostile + MONSTER: ('N', "guardian naga"), random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -TRAP: random, random -TRAP: random, random -MONSTER: 'l', "leprechaun", random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random, random + TRAP: random, random + TRAP: random, random + MONSTER: ('l', "leprechaun"), random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -TRAP: random, random -MONSTER: 'l', "leprechaun", random, hostile -MONSTER: 'n', "water nymph", random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + TRAP: random, random + MONSTER: ('l', "leprechaun"), random, hostile + MONSTER: ('n', "water nymph"), random, hostile +} RANDOM_CORRIDORS diff --git a/dat/Samurai.des b/dat/Samurai.des index 565a2ed67..6dd53ac4f 100644 --- a/dat/Samurai.des +++ b/dat/Samurai.des @@ -54,18 +54,18 @@ DOOR:locked,(39,08) DOOR:closed,(50,04) DOOR:closed,(50,06) # Lord Sato -MONSTER:'@',"Lord Sato",(20,04) +MONSTER:('@',"Lord Sato"),(20,04) # The treasure of Lord Sato -OBJECT:'(',"chest",(20,04) +OBJECT:('(',"chest"),(20,04) # roshi guards for the audience chamber -MONSTER:'@',"roshi",(18,04) -MONSTER:'@',"roshi",(18,05) -MONSTER:'@',"roshi",(18,06) -MONSTER:'@',"roshi",(18,07) -MONSTER:'@',"roshi",(26,04) -MONSTER:'@',"roshi",(26,05) -MONSTER:'@',"roshi",(26,06) -MONSTER:'@',"roshi",(26,07) +MONSTER:('@',"roshi"),(18,04) +MONSTER:('@',"roshi"),(18,05) +MONSTER:('@',"roshi"),(18,06) +MONSTER:('@',"roshi"),(18,07) +MONSTER:('@',"roshi"),(26,04) +MONSTER:('@',"roshi"),(26,05) +MONSTER:('@',"roshi"),(26,06) +MONSTER:('@',"roshi"),(26,07) # Non diggable walls NON_DIGGABLE:(00,00,75,19) # Random traps @@ -76,19 +76,19 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Monsters on siege duty. -MONSTER: '@',"ninja",(64,00),hostile -MONSTER: 'd',"wolf",(65,01) -MONSTER: '@',"ninja",(67,02),hostile -MONSTER: '@',"ninja",(69,05),hostile -MONSTER: '@',"ninja",(69,06),hostile -MONSTER: 'd',"wolf",(69,07) -MONSTER: '@',"ninja",(70,06),hostile -MONSTER: '@',"ninja",(70,07),hostile -MONSTER: '@',"ninja",(72,01),hostile -MONSTER: 'd',"wolf",(75,09) -MONSTER: '@',"ninja",(73,05),hostile -MONSTER: '@',"ninja",(68,02),hostile -MONSTER:'E',"stalker",random +MONSTER: ('@',"ninja"),(64,00),hostile +MONSTER: ('d',"wolf"),(65,01) +MONSTER: ('@',"ninja"),(67,02),hostile +MONSTER: ('@',"ninja"),(69,05),hostile +MONSTER: ('@',"ninja"),(69,06),hostile +MONSTER: ('d',"wolf"),(69,07) +MONSTER: ('@',"ninja"),(70,06),hostile +MONSTER: ('@',"ninja"),(70,07),hostile +MONSTER: ('@',"ninja"),(72,01),hostile +MONSTER: ('d',"wolf"),(75,09) +MONSTER: ('@',"ninja"),(73,05),hostile +MONSTER: ('@',"ninja"),(68,02),hostile +MONSTER:('E',"stalker"),random # # The "locate" level for the quest. @@ -155,41 +155,41 @@ STAIR:(25,14),down # Non diggable walls NON_DIGGABLE:(00,00,75,19) # Objects -OBJECT:'*',random,(25,05) -OBJECT:'*',random,(26,05) -OBJECT:'*',random,(27,05) -OBJECT:'*',random,(28,05) -OBJECT:'*',random,(25,06) -OBJECT:'*',random,(26,06) -OBJECT:'*',random,(27,06) -OBJECT:'*',random,(28,06) +OBJECT:'*',(25,05) +OBJECT:'*',(26,05) +OBJECT:'*',(27,05) +OBJECT:'*',(28,05) +OBJECT:'*',(25,06) +OBJECT:'*',(26,06) +OBJECT:'*',(27,06) +OBJECT:'*',(28,06) # -OBJECT:'[',random,(40,05) -OBJECT:'[',random,(41,05) -OBJECT:'[',random,(42,05) -OBJECT:'[',random,(43,05) -OBJECT:'[',random,(40,06) -OBJECT:'[',random,(41,06) -OBJECT:'[',random,(42,06) -OBJECT:'[',random,(43,06) +OBJECT:'[',(40,05) +OBJECT:'[',(41,05) +OBJECT:'[',(42,05) +OBJECT:'[',(43,05) +OBJECT:'[',(40,06) +OBJECT:'[',(41,06) +OBJECT:'[',(42,06) +OBJECT:'[',(43,06) # -OBJECT:')',random,(27,13) -OBJECT:')',random,(28,13) -OBJECT:')',random,(29,13) -OBJECT:')',random,(30,13) -OBJECT:')',random,(27,14) -OBJECT:')',random,(28,14) -OBJECT:')',random,(29,14) -OBJECT:')',random,(30,14) +OBJECT:')',(27,13) +OBJECT:')',(28,13) +OBJECT:')',(29,13) +OBJECT:')',(30,13) +OBJECT:')',(27,14) +OBJECT:')',(28,14) +OBJECT:')',(29,14) +OBJECT:')',(30,14) # -OBJECT:'(',random,(37,13) -OBJECT:'(',random,(38,13) -OBJECT:'(',random,(39,13) -OBJECT:'(',random,(40,13) -OBJECT:'(',random,(37,14) -OBJECT:'(',random,(38,14) -OBJECT:'(',random,(39,14) -OBJECT:'(',random,(40,14) +OBJECT:'(',(37,13) +OBJECT:'(',(38,13) +OBJECT:'(',(39,13) +OBJECT:'(',(40,13) +OBJECT:'(',(37,14) +OBJECT:'(',(38,14) +OBJECT:'(',(39,14) +OBJECT:'(',(40,14) # Random traps TRAP:random,random TRAP:random,random @@ -198,40 +198,40 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'@',"ninja",(15,05),hostile -MONSTER:'@',"ninja",(16,05),hostile -MONSTER:'d',"wolf",(17,05) -MONSTER:'d',"wolf",(18,05) -MONSTER:'@',"ninja",(19,05),hostile -MONSTER:'d',"wolf",(15,14) -MONSTER:'d',"wolf",(16,14) -MONSTER:'@',"ninja",(17,14),hostile -MONSTER:'@',"ninja",(18,14),hostile -MONSTER:'d',"wolf",(56,05) -MONSTER:'@',"ninja",(57,05),hostile -MONSTER:'d',"wolf",(58,05) -MONSTER:'d',"wolf",(59,05) -MONSTER:'@',"ninja",(56,14),hostile -MONSTER:'d',"wolf",(57,14) -MONSTER:'@',"ninja",(58,14),hostile -MONSTER:'d',random,(59,14) -MONSTER:'d',"wolf",(60,14) -MONSTER:'E',"stalker",random -MONSTER:'E',"stalker",random -MONSTER:'E',"stalker",random -MONSTER:'E',"stalker",random -MONSTER:'E',"stalker",random -MONSTER:'E',"stalker",random -MONSTER:'E',"stalker",random -MONSTER:'E',"stalker",random -MONSTER:'E',"stalker",random +MONSTER:('@',"ninja"),(15,05),hostile +MONSTER:('@',"ninja"),(16,05),hostile +MONSTER:('d',"wolf"),(17,05) +MONSTER:('d',"wolf"),(18,05) +MONSTER:('@',"ninja"),(19,05),hostile +MONSTER:('d',"wolf"),(15,14) +MONSTER:('d',"wolf"),(16,14) +MONSTER:('@',"ninja"),(17,14),hostile +MONSTER:('@',"ninja"),(18,14),hostile +MONSTER:('d',"wolf"),(56,05) +MONSTER:('@',"ninja"),(57,05),hostile +MONSTER:('d',"wolf"),(58,05) +MONSTER:('d',"wolf"),(59,05) +MONSTER:('@',"ninja"),(56,14),hostile +MONSTER:('d',"wolf"),(57,14) +MONSTER:('@',"ninja"),(58,14),hostile +MONSTER:'d',(59,14) +MONSTER:('d',"wolf"),(60,14) +MONSTER:('E',"stalker"),random +MONSTER:('E',"stalker"),random +MONSTER:('E',"stalker"),random +MONSTER:('E',"stalker"),random +MONSTER:('E',"stalker"),random +MONSTER:('E',"stalker"),random +MONSTER:('E',"stalker"),random +MONSTER:('E',"stalker"),random +MONSTER:('E',"stalker"),random # "guards" for the central courtyard. -MONSTER:'@',"samurai",(30,05),hostile -MONSTER:'@',"samurai",(31,05),hostile -MONSTER:'@',"samurai",(32,05),hostile -MONSTER:'@',"samurai",(32,14),hostile -MONSTER:'@',"samurai",(33,14),hostile -MONSTER:'@',"samurai",(34,14),hostile +MONSTER:('@',"samurai"),(30,05),hostile +MONSTER:('@',"samurai"),(31,05),hostile +MONSTER:('@',"samurai"),(32,05),hostile +MONSTER:('@',"samurai"),(32,14),hostile +MONSTER:('@',"samurai"),(33,14),hostile +MONSTER:('@',"samurai"),(34,14),hostile # # The "goal" level for the quest. @@ -267,7 +267,9 @@ MAP ....................... ENDMAP # Dungeon Description -RANDOM_PLACES:(02,11),(42,09) +$place = { (02,11),(42,09) } +SHUFFLE: $place + REGION:(00,00,44,19),unlit,"ordinary" # Doors DOOR:closed,(19,10) @@ -275,25 +277,25 @@ DOOR:closed,(22,08) DOOR:closed,(22,12) DOOR:closed,(25,10) # Stairs -STAIR:place[0],up +STAIR:$place[0],up # Non diggable walls NON_DIGGABLE:(00,00,44,19) # Objects -OBJECT:')',"tsurugi",(22,10),blessed,0,"The Tsurugi of Muramasa" -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:(')',"tsurugi"),(22,10),blessed,0,name:"The Tsurugi of Muramasa" +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # TRAP:"board",(22,09) TRAP:"board",(24,10) @@ -306,32 +308,32 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'@',"Ashikaga Takauji",(22,10) -MONSTER:'@',"samurai",random,hostile -MONSTER:'@',"samurai",random,hostile -MONSTER:'@',"samurai",random,hostile -MONSTER:'@',"samurai",random,hostile -MONSTER:'@',"samurai",random,hostile -MONSTER:'@',"ninja",random,hostile -MONSTER:'@',"ninja",random,hostile -MONSTER:'@',"ninja",random,hostile -MONSTER:'@',"ninja",random,hostile -MONSTER:'@',"ninja",random,hostile -MONSTER:'d',"wolf",random -MONSTER:'d',"wolf",random -MONSTER:'d',"wolf",random -MONSTER:'d',"wolf",random -MONSTER:'d',random,random -MONSTER:'d',random,random -MONSTER:'E',"stalker",random -MONSTER:'E',"stalker",random -MONSTER:'E',"stalker",random -MONSTER:'E',"stalker",random -MONSTER:'E',"stalker",random -MONSTER:'E',"stalker",random -MONSTER:'E',"stalker",random -MONSTER:'E',"stalker",random -MONSTER:'E',"stalker",random +MONSTER:('@',"Ashikaga Takauji"),(22,10) +MONSTER:('@',"samurai"),random,hostile +MONSTER:('@',"samurai"),random,hostile +MONSTER:('@',"samurai"),random,hostile +MONSTER:('@',"samurai"),random,hostile +MONSTER:('@',"samurai"),random,hostile +MONSTER:('@',"ninja"),random,hostile +MONSTER:('@',"ninja"),random,hostile +MONSTER:('@',"ninja"),random,hostile +MONSTER:('@',"ninja"),random,hostile +MONSTER:('@',"ninja"),random,hostile +MONSTER:('d',"wolf"),random +MONSTER:('d',"wolf"),random +MONSTER:('d',"wolf"),random +MONSTER:('d',"wolf"),random +MONSTER:'d',random +MONSTER:'d',random +MONSTER:('E',"stalker"),random +MONSTER:('E',"stalker"),random +MONSTER:('E',"stalker"),random +MONSTER:('E',"stalker"),random +MONSTER:('E',"stalker"),random +MONSTER:('E',"stalker"),random +MONSTER:('E',"stalker"),random +MONSTER:('E',"stalker"),random +MONSTER:('E',"stalker"),random # @@ -344,29 +346,29 @@ MONSTER:'E',"stalker",random # MAZE: "Sam-fila", ' ' -INIT_MAP: '.' , 'P', true, true, random, true +INIT_MAP: mines, '.' , 'P', true, true, random, true NOMAP # STAIR: random, up STAIR: random, down # -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # -MONSTER: 'd', random, random -MONSTER: 'd', "wolf", random -MONSTER: 'd', "wolf", random -MONSTER: 'd', "wolf", random -MONSTER: 'd', "wolf", random -MONSTER: 'd', "wolf", random -MONSTER: 'E', "stalker", random +MONSTER: 'd', random +MONSTER: ('d', "wolf"), random +MONSTER: ('d', "wolf"), random +MONSTER: ('d', "wolf"), random +MONSTER: ('d', "wolf"), random +MONSTER: ('d', "wolf"), random +MONSTER: ('E', "stalker"), random # TRAP: random, random TRAP: random, random @@ -403,24 +405,24 @@ DOOR:closed,(43,08) STAIR: random, up STAIR: random, down # -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # -MONSTER: 'd', random, random -MONSTER: 'd', "wolf", random -MONSTER: 'd', "wolf", random -MONSTER: 'd', "wolf", random -MONSTER: 'd', "wolf", random -MONSTER: 'E', "stalker", random -MONSTER: 'E', "stalker", random -MONSTER: 'E', "stalker", random +MONSTER: 'd', random +MONSTER: ('d', "wolf"), random +MONSTER: ('d', "wolf"), random +MONSTER: ('d', "wolf"), random +MONSTER: ('d', "wolf"), random +MONSTER: ('E', "stalker"), random +MONSTER: ('E', "stalker"), random +MONSTER: ('E', "stalker"), random # TRAP: random, random TRAP: random, random diff --git a/dat/Tourist.des b/dat/Tourist.des index e9b1658e9..4f814dc34 100644 --- a/dat/Tourist.des +++ b/dat/Tourist.des @@ -72,54 +72,54 @@ DOOR:open,(16,17) DOOR:locked,(35,07) DOOR:locked,(36,07) # Monsters on siege duty. -MONSTER: 's',"giant spider",random -MONSTER: 's',"giant spider",random -MONSTER: 's',"giant spider",random -MONSTER: 's',"giant spider",random -MONSTER: 's',"giant spider",random -MONSTER: 's',"giant spider",random -MONSTER: 's',"giant spider",random -MONSTER: 's',"giant spider",random -MONSTER: 's',"giant spider",random -MONSTER: 's',"giant spider",random -MONSTER: 's',"giant spider",random -MONSTER: 's',"giant spider",random -MONSTER: 's',random,random -MONSTER: 's',random,random -MONSTER: 'C',"forest centaur",random -MONSTER: 'C',"forest centaur",random -MONSTER: 'C',"forest centaur",random -MONSTER: 'C',"forest centaur",random -MONSTER: 'C',"forest centaur",random -MONSTER: 'C',"forest centaur",random -MONSTER: 'C',"forest centaur",random -MONSTER: 'C',"forest centaur",random -MONSTER: 'C',random,random +MONSTER: ('s',"giant spider"),random +MONSTER: ('s',"giant spider"),random +MONSTER: ('s',"giant spider"),random +MONSTER: ('s',"giant spider"),random +MONSTER: ('s',"giant spider"),random +MONSTER: ('s',"giant spider"),random +MONSTER: ('s',"giant spider"),random +MONSTER: ('s',"giant spider"),random +MONSTER: ('s',"giant spider"),random +MONSTER: ('s',"giant spider"),random +MONSTER: ('s',"giant spider"),random +MONSTER: ('s',"giant spider"),random +MONSTER: 's',random +MONSTER: 's',random +MONSTER: ('C',"forest centaur"),random +MONSTER: ('C',"forest centaur"),random +MONSTER: ('C',"forest centaur"),random +MONSTER: ('C',"forest centaur"),random +MONSTER: ('C',"forest centaur"),random +MONSTER: ('C',"forest centaur"),random +MONSTER: ('C',"forest centaur"),random +MONSTER: ('C',"forest centaur"),random +MONSTER: 'C',random # Twoflower -MONSTER:'@',"Twoflower",(64,03) +MONSTER:('@',"Twoflower"),(64,03) # The treasure of Twoflower -OBJECT:'(',"chest",(64,03) +OBJECT:('(',"chest"),(64,03) # guides for the audience chamber -MONSTER:'@',"guide",(29,03) -MONSTER:'@',"guide",(32,04) -MONSTER:'@',"guide",(35,02) -MONSTER:'@',"guide",(38,03) -MONSTER:'@',"guide",(45,03) -MONSTER:'@',"guide",(48,02) -MONSTER:'@',"guide",(49,04) -MONSTER:'@',"guide",(51,03) -MONSTER:'@',"guide",(57,03) -MONSTER:'@',"guide",(62,04) -MONSTER:'@',"guide",(66,04) +MONSTER:('@',"guide"),(29,03) +MONSTER:('@',"guide"),(32,04) +MONSTER:('@',"guide"),(35,02) +MONSTER:('@',"guide"),(38,03) +MONSTER:('@',"guide"),(45,03) +MONSTER:('@',"guide"),(48,02) +MONSTER:('@',"guide"),(49,04) +MONSTER:('@',"guide"),(51,03) +MONSTER:('@',"guide"),(57,03) +MONSTER:('@',"guide"),(62,04) +MONSTER:('@',"guide"),(66,04) # path guards -MONSTER:'@',"watchman",(35,08) -MONSTER:'@',"watchman",(36,08) +MONSTER:('@',"watchman"),(35,08) +MONSTER:('@',"watchman"),(36,08) # river monsters -MONSTER:';',"giant eel",(62,12) -MONSTER:';',"piranha",(47,10) -MONSTER:';',"piranha",(29,11) -MONSTER:';',"kraken",(34,09) -MONSTER:';',"kraken",(37,09) +MONSTER:(';',"giant eel"),(62,12) +MONSTER:(';',"piranha"),(47,10) +MONSTER:(';',"piranha"),(29,11) +MONSTER:(';',"kraken"),(34,09) +MONSTER:(';',"kraken"),(37,09) # Random traps TRAP:random,random TRAP:random,random @@ -244,23 +244,23 @@ DOOR:closed,(60,16) DOOR:closed,(73,16) # Objects -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Toilet paper -OBJECT:'?',"blank paper",(71,12) -OBJECT:'?',"blank paper",(71,12) +OBJECT:('?',"blank paper"),(71,12) +OBJECT:('?',"blank paper"),(71,12) # Random traps TRAP:random,random TRAP:random,random @@ -272,24 +272,24 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',random,random -MONSTER:'s',random,random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:'s',random +MONSTER:'s',random # # The "goal" level for the quest. @@ -386,21 +386,21 @@ DOOR:random,(51,15) DOOR:open,(59,14) DOOR:open,(59,17) # Objects -OBJECT:'(',"credit card",(04,01),blessed,0,"The Platinum Yendorian Express Card" -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:('(',"credit card"),(04,01),blessed,0,name:"The Platinum Yendorian Express Card" +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -409,47 +409,47 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'@',"Master of Thieves",(04,01),hostile -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',"giant spider",random -MONSTER:'s',random,random -MONSTER:'s',random,random +MONSTER:('@',"Master of Thieves"),(04,01),hostile +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:('s',"giant spider"),random +MONSTER:'s',random +MONSTER:'s',random # ladies of the evening -MONSTER:'&',"succubus",(02,08) -MONSTER:'&',"succubus",(08,08) -MONSTER:'&',"incubus",(02,14) -MONSTER:'&',"incubus",(08,14) -MONSTER:'&',"incubus",(02,17) -MONSTER:'&',"incubus",(08,17) +MONSTER:('&',"succubus"),(02,08) +MONSTER:('&',"succubus"),(08,08) +MONSTER:('&',"incubus"),(02,14) +MONSTER:('&',"incubus"),(08,14) +MONSTER:('&',"incubus"),(02,17) +MONSTER:('&',"incubus"),(08,17) # Police station (with drunken prisoners) -MONSTER:'K',"Kop Kaptain",(24,09),hostile -MONSTER:'K',"Kop Lieutenant",(20,09),hostile -MONSTER:'K',"Kop Lieutenant",(22,11),hostile -MONSTER:'K',"Kop Lieutenant",(22,07),hostile -MONSTER:'K',"Keystone Kop",(19,07),hostile -MONSTER:'K',"Keystone Kop",(19,08),hostile -MONSTER:'K',"Keystone Kop",(22,09),hostile -MONSTER:'K',"Keystone Kop",(24,11),hostile -MONSTER:'K',"Keystone Kop",(19,11),hostile -MONSTER:'@',"prisoner",(19,13) -MONSTER:'@',"prisoner",(21,13) -MONSTER:'@',"prisoner",(24,13) +MONSTER:('K',"Kop Kaptain"),(24,09),hostile +MONSTER:('K',"Kop Lieutenant"),(20,09),hostile +MONSTER:('K',"Kop Lieutenant"),(22,11),hostile +MONSTER:('K',"Kop Lieutenant"),(22,07),hostile +MONSTER:('K',"Keystone Kop"),(19,07),hostile +MONSTER:('K',"Keystone Kop"),(19,08),hostile +MONSTER:('K',"Keystone Kop"),(22,09),hostile +MONSTER:('K',"Keystone Kop"),(24,11),hostile +MONSTER:('K',"Keystone Kop"),(19,11),hostile +MONSTER:('@',"prisoner"),(19,13) +MONSTER:('@',"prisoner"),(21,13) +MONSTER:('@',"prisoner"),(24,13) # -MONSTER:'@',"watchman",(33,10),hostile +MONSTER:('@',"watchman"),(33,10),hostile WALLIFY @@ -461,61 +461,61 @@ WALLIFY # MAZE: "Tou-fila" , ' ' -INIT_MAP: '.' , ' ', true, true, random, true +INIT_MAP: mines, '.' , ' ', true, true, random, true NOMAP # STAIR: random, up STAIR: random, down # -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # TRAP: random, random TRAP: random, random TRAP: random, random TRAP: random, random # -MONSTER: '@', "soldier", random, hostile -MONSTER: '@', "soldier", random, hostile -MONSTER: '@', "soldier", random, hostile -MONSTER: '@', "soldier", random, hostile -MONSTER: '@', "soldier", random, hostile -MONSTER: 'H', random, random, hostile -MONSTER: 'C', random, random, hostile +MONSTER: ('@', "soldier"), random, hostile +MONSTER: ('@', "soldier"), random, hostile +MONSTER: ('@', "soldier"), random, hostile +MONSTER: ('@', "soldier"), random, hostile +MONSTER: ('@', "soldier"), random, hostile +MONSTER: 'H', random, hostile +MONSTER: 'C', random, hostile MAZE: "Tou-filb" , ' ' -INIT_MAP: '.' , ' ', true, true, random, true +INIT_MAP: mines, '.' , ' ', true, true, random, true NOMAP # STAIR: random, up STAIR: random, down # -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # TRAP: random, random TRAP: random, random TRAP: random, random TRAP: random, random # -MONSTER: '@', "soldier", random, hostile -MONSTER: '@', "captain", random, hostile -MONSTER: '@', "captain", random, hostile -MONSTER: 'H', random, random, hostile -MONSTER: 'H', random, random, hostile -MONSTER: 'C', random, random, hostile -MONSTER: 's', random, random +MONSTER: ('@', "soldier"), random, hostile +MONSTER: ('@', "captain"), random, hostile +MONSTER: ('@', "captain"), random, hostile +MONSTER: 'H', random, hostile +MONSTER: 'H', random, hostile +MONSTER: 'C', random, hostile +MONSTER: 's', random diff --git a/dat/Valkyrie.des b/dat/Valkyrie.des index 04c401bde..520a0f8ba 100644 --- a/dat/Valkyrie.des +++ b/dat/Valkyrie.des @@ -12,7 +12,6 @@ # MAZE: "Val-strt",' ' FLAGS: noteleport,hardfloor -INIT_MAP: '.', 'I', true, true, lit, false, true GEOMETRY:center,center MAP IIIIIIPPPIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII @@ -48,18 +47,18 @@ FOUNTAIN:(53,02) DOOR:locked,(26,10) DOOR:locked,(43,10) # Norn -MONSTER:'@',"Norn",(35,10) +MONSTER:('@',"Norn"),(35,10) # The treasure of the Norn -OBJECT:'(',"chest",(36,10) +OBJECT:('(',"chest"),(36,10) # valkyrie guards for the audience chamber -MONSTER:'@',"warrior",(27,08) -MONSTER:'@',"warrior",(27,09) -MONSTER:'@',"warrior",(27,11) -MONSTER:'@',"warrior",(27,12) -MONSTER:'@',"warrior",(42,08) -MONSTER:'@',"warrior",(42,09) -MONSTER:'@',"warrior",(42,11) -MONSTER:'@',"warrior",(42,12) +MONSTER:('@',"warrior"),(27,08) +MONSTER:('@',"warrior"),(27,09) +MONSTER:('@',"warrior"),(27,11) +MONSTER:('@',"warrior"),(27,12) +MONSTER:('@',"warrior"),(42,08) +MONSTER:('@',"warrior"),(42,09) +MONSTER:('@',"warrior"),(42,11) +MONSTER:('@',"warrior"),(42,12) # Non diggable walls NON_DIGGABLE:(26,07,43,13) # Random traps @@ -70,18 +69,18 @@ TRAP:"fire",random TRAP:"fire",random TRAP:"fire",random # Monsters on siege duty. -MONSTER: 'a',"fire ant",(04,12) -MONSTER: 'a',"fire ant",(08,08) -MONSTER: 'a',"fire ant",(14,04) -MONSTER: 'a',"fire ant",(17,11) -MONSTER: 'a',"fire ant",(24,10) -MONSTER: 'a',"fire ant",(45,10) -MONSTER: 'a',"fire ant",(54,02) -MONSTER: 'a',"fire ant",(55,07) -MONSTER: 'a',"fire ant",(58,14) -MONSTER: 'a',"fire ant",(63,17) -MONSTER: 'H',"fire giant",(18,01),hostile -MONSTER: 'H',"fire giant",(10,16),hostile +MONSTER: ('a',"fire ant"),(04,12) +MONSTER: ('a',"fire ant"),(08,08) +MONSTER: ('a',"fire ant"),(14,04) +MONSTER: ('a',"fire ant"),(17,11) +MONSTER: ('a',"fire ant"),(24,10) +MONSTER: ('a',"fire ant"),(45,10) +MONSTER: ('a',"fire ant"),(54,02) +MONSTER: ('a',"fire ant"),(55,07) +MONSTER: ('a',"fire ant"),(58,14) +MONSTER: ('a',"fire ant"),(63,17) +MONSTER: ('H',"fire giant"),(18,01),hostile +MONSTER: ('H',"fire giant"),(10,16),hostile # # The "locate" level for the quest. @@ -92,7 +91,7 @@ MONSTER: 'H',"fire giant",(10,16),hostile MAZE: "Val-loca",' ' FLAGS: hardfloor -INIT_MAP: '.', 'I', true, true, lit, false, true +INIT_MAP: mines, '.', 'I', true, true, lit, false GEOMETRY:center,center MAP PPPP.... ....PPPPP. @@ -117,21 +116,21 @@ STAIR:(20,06),down # Non diggable walls NON_DIGGABLE:(00,00,39,12) # Objects -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:"fire",random TRAP:"fire",random @@ -140,33 +139,33 @@ TRAP:"fire",random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',random,random -MONSTER:'H',random,random,hostile -MONSTER:'H',"fire giant",random,hostile -MONSTER:'H',"fire giant",random,hostile -MONSTER:'H',"fire giant",random,hostile -MONSTER:'H',"fire giant",random,hostile -MONSTER:'H',"fire giant",random,hostile -MONSTER:'H',"fire giant",random,hostile -MONSTER:'H',"fire giant",random,hostile -MONSTER:'H',random,random,hostile +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:'a',random +MONSTER:'H',random,hostile +MONSTER:('H',"fire giant"),random,hostile +MONSTER:('H',"fire giant"),random,hostile +MONSTER:('H',"fire giant"),random,hostile +MONSTER:('H',"fire giant"),random,hostile +MONSTER:('H',"fire giant"),random,hostile +MONSTER:('H',"fire giant"),random,hostile +MONSTER:('H',"fire giant"),random,hostile +MONSTER:'H',random,hostile # # The "goal" level for the quest. @@ -177,7 +176,7 @@ MONSTER:'H',random,random,hostile # MAZE: "Val-goal", 'L' -INIT_MAP: '.', 'L', true, true, lit, false, true +INIT_MAP: mines, '.', 'L', true, true, lit, false GEOMETRY:center,center MAP .L............................LLLLL @@ -209,21 +208,21 @@ NON_DIGGABLE:(00,00,34,16) DRAWBRIDGE:(17,02),south,random DRAWBRIDGE:(17,14),north,open # Objects -OBJECT:'(',"crystal ball",(17,08),blessed,5,"The Orb of Fate" -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:('(',"crystal ball"),(17,08),blessed,5,name:"The Orb of Fate" +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Traps TRAP:"board",(13,08) TRAP:"board",(21,08) @@ -236,26 +235,26 @@ TRAP:"board",random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'H',"Lord Surtur",(17,08) -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',"fire ant",random -MONSTER:'a',random,random -MONSTER:'a',random,random -MONSTER:'H',"fire giant",(10,06),hostile -MONSTER:'H',"fire giant",(10,07),hostile -MONSTER:'H',"fire giant",(10,08),hostile -MONSTER:'H',"fire giant",(10,09),hostile -MONSTER:'H',"fire giant",(10,10),hostile -MONSTER:'H',"fire giant",(24,06),hostile -MONSTER:'H',"fire giant",(24,07),hostile -MONSTER:'H',"fire giant",(24,08),hostile -MONSTER:'H',"fire giant",(24,09),hostile -MONSTER:'H',"fire giant",(24,10),hostile -MONSTER:'H',"fire giant",random,hostile -MONSTER:'H',"fire giant",random,hostile -MONSTER:'H',random,random,hostile +MONSTER:('H',"Lord Surtur"),(17,08) +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:('a',"fire ant"),random +MONSTER:'a',random +MONSTER:'a',random +MONSTER:('H',"fire giant"),(10,06),hostile +MONSTER:('H',"fire giant"),(10,07),hostile +MONSTER:('H',"fire giant"),(10,08),hostile +MONSTER:('H',"fire giant"),(10,09),hostile +MONSTER:('H',"fire giant"),(10,10),hostile +MONSTER:('H',"fire giant"),(24,06),hostile +MONSTER:('H',"fire giant"),(24,07),hostile +MONSTER:('H',"fire giant"),(24,08),hostile +MONSTER:('H',"fire giant"),(24,09),hostile +MONSTER:('H',"fire giant"),(24,10),hostile +MONSTER:('H',"fire giant"),random,hostile +MONSTER:('H',"fire giant"),random,hostile +MONSTER:'H',random,hostile # # The "fill" levels for the quest. @@ -267,29 +266,29 @@ MONSTER:'H',random,random,hostile # MAZE: "Val-fila" , 'I' -INIT_MAP: '.', 'I', true, true, lit, false, true +INIT_MAP: mines, '.', 'I', true, true, lit, false NOMAP # STAIR: random, up STAIR: random, down # -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # -MONSTER: 'a', "fire ant", random -MONSTER: 'a', "fire ant", random -MONSTER: 'a', "fire ant", random -MONSTER: 'a', "fire ant", random -MONSTER: 'a', "fire ant", random -MONSTER: 'a', random, random -MONSTER: 'H', "fire giant", random, hostile +MONSTER: ('a', "fire ant"), random +MONSTER: ('a', "fire ant"), random +MONSTER: ('a', "fire ant"), random +MONSTER: ('a', "fire ant"), random +MONSTER: ('a', "fire ant"), random +MONSTER: 'a', random +MONSTER: ('H', "fire giant"), random, hostile # TRAP: random, random TRAP: random, random @@ -300,31 +299,31 @@ TRAP: random, random TRAP: random, random MAZE: "Val-filb" , 'L' -INIT_MAP: '.', 'L', true, true, lit, false, true +INIT_MAP: mines, '.', 'L', true, true, lit, false NOMAP # STAIR: random, up STAIR: random, down # -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # -MONSTER: 'a', "fire ant", random -MONSTER: 'a', "fire ant", random -MONSTER: 'a', "fire ant", random -MONSTER: 'a', random, random -MONSTER: 'H', "fire giant", random, hostile -MONSTER: 'H', "fire giant", random, hostile -MONSTER: 'H', "fire giant", random, hostile +MONSTER: ('a', "fire ant"), random +MONSTER: ('a', "fire ant"), random +MONSTER: ('a', "fire ant"), random +MONSTER: 'a', random +MONSTER: ('H', "fire giant"), random, hostile +MONSTER: ('H', "fire giant"), random, hostile +MONSTER: ('H', "fire giant"), random, hostile # TRAP: "fire", random TRAP: "fire", random diff --git a/dat/Wizard.des b/dat/Wizard.des index dae831ed4..d70be72d6 100644 --- a/dat/Wizard.des +++ b/dat/Wizard.des @@ -38,7 +38,7 @@ ENDMAP REGION:(00,00,75,19),lit,"ordinary" REGION:(35,00,49,03),unlit,"ordinary" REGION:(43,12,49,16),unlit,"ordinary" -REGION:(19,11,33,15),unlit,"ordinary",unfilled,true +REGION:(19,11,33,15),unlit,"ordinary",unfilled,irregular REGION:(30,10,31,10),unlit,"ordinary" # Stairs STAIR:(30,10),down @@ -54,22 +54,22 @@ DOOR:closed,(15,10) DOOR:locked,(19,10) DOOR:locked,(20,10) # Neferet the Green, the quest leader -MONSTER:'@',"Neferet the Green",(23,05) +MONSTER:('@',"Neferet the Green"),(23,05) # The treasure of the quest leader -OBJECT:'(',"chest",(24,05) +OBJECT:('(',"chest"),(24,05) # apprentice guards for the audience chamber -MONSTER:'@',"apprentice",(30,07) -MONSTER:'@',"apprentice",(24,06) -MONSTER:'@',"apprentice",(15,06) -MONSTER:'@',"apprentice",(15,12) -MONSTER:'@',"apprentice",(26,11) -MONSTER:'@',"apprentice",(27,11) -MONSTER:'@',"apprentice",(19,09) -MONSTER:'@',"apprentice",(20,09) +MONSTER:('@',"apprentice"),(30,07) +MONSTER:('@',"apprentice"),(24,06) +MONSTER:('@',"apprentice"),(15,06) +MONSTER:('@',"apprentice"),(15,12) +MONSTER:('@',"apprentice"),(26,11) +MONSTER:('@',"apprentice"),(27,11) +MONSTER:('@',"apprentice"),(19,09) +MONSTER:('@',"apprentice"),(20,09) # Eels in the pond -MONSTER:';',"giant eel",(62,14) -MONSTER:';',"giant eel",(69,15) -MONSTER:';',"giant eel",(67,17) +MONSTER:(';',"giant eel"),(62,14) +MONSTER:(';',"giant eel"),(69,15) +MONSTER:(';',"giant eel"),(67,17) # Non diggable walls NON_DIGGABLE:(00,00,75,19) # Random traps @@ -80,21 +80,21 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Monsters on siege duty. -MONSTER: 'B',random,(60,09),hostile -MONSTER: 'W',random,(60,10),hostile -MONSTER: 'B',random,(60,11),hostile -MONSTER: 'B',random,(60,12),hostile -MONSTER: 'i',random,(60,13),hostile -MONSTER: 'B',random,(61,10),hostile -MONSTER: 'B',random,(61,11),hostile -MONSTER: 'B',random,(61,12),hostile -MONSTER: 'B',random,(35,03),hostile -MONSTER: 'i',random,(35,17),hostile -MONSTER: 'B',random,(36,17),hostile -MONSTER: 'B',random,(34,16),hostile -MONSTER: 'i',random,(34,17),hostile -MONSTER: 'W',random,(67,02),hostile -MONSTER: 'B',random,(10,19),hostile +MONSTER: 'B',(60,09),hostile +MONSTER: 'W',(60,10),hostile +MONSTER: 'B',(60,11),hostile +MONSTER: 'B',(60,12),hostile +MONSTER: 'i',(60,13),hostile +MONSTER: 'B',(61,10),hostile +MONSTER: 'B',(61,11),hostile +MONSTER: 'B',(61,12),hostile +MONSTER: 'B',(35,03),hostile +MONSTER: 'i',(35,17),hostile +MONSTER: 'B',(36,17),hostile +MONSTER: 'B',(34,16),hostile +MONSTER: 'i',(34,17),hostile +MONSTER: 'W',(67,02),hostile +MONSTER: 'B',(10,19),hostile # # The "locate" level for the quest. @@ -153,21 +153,21 @@ STAIR:(48,10),down # Non diggable walls NON_DIGGABLE:(00,00,75,20) # Objects -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:"spiked pit",(24,02) TRAP:"spiked pit",(07,10) @@ -191,33 +191,33 @@ TRAP:"dart",random TRAP:"dart",random TRAP:"dart",random # Random monsters. -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'B',"vampire bat",random -MONSTER:'B',"vampire bat",random -MONSTER:'B',"vampire bat",random -MONSTER:'B',"vampire bat",random -MONSTER:'B',"vampire bat",random -MONSTER:'B',"vampire bat",random -MONSTER:'B',"vampire bat",random -MONSTER:'i',random,random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'i',random,hostile +MONSTER:'i',random,hostile +MONSTER:'i',random,hostile +MONSTER:'i',random,hostile +MONSTER:'i',random,hostile +MONSTER:'i',random,hostile +MONSTER:'i',random,hostile +MONSTER:('B',"vampire bat"),random +MONSTER:('B',"vampire bat"),random +MONSTER:('B',"vampire bat"),random +MONSTER:('B',"vampire bat"),random +MONSTER:('B',"vampire bat"),random +MONSTER:('B',"vampire bat"),random +MONSTER:('B',"vampire bat"),random +MONSTER:'i',random,hostile # # The "goal" level for the quest. @@ -293,21 +293,21 @@ NON_DIGGABLE:(00,00,75,19) # The altar. This is not a shrine. ALTAR:(16,11),noncoaligned,altar # Objects -OBJECT:'"',"amulet of ESP",(16,11),blessed,0,"The Eye of the Aethiopica" -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:('"',"amulet of ESP"),(16,11),blessed,0,name:"The Eye of the Aethiopica" +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -316,43 +316,43 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'@',"Dark One",(16,11) -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'B',random,random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'i',random,random,hostile -MONSTER:'B',"vampire bat",random -MONSTER:'B',"vampire bat",random -MONSTER:'B',"vampire bat",random -MONSTER:'B',"vampire bat",random -MONSTER:'B',"vampire bat",random -MONSTER:'B',"vampire bat",random -MONSTER:'B',"vampire bat",random -MONSTER:'B',"vampire bat",random -MONSTER:'i',random,random,hostile +MONSTER:('@',"Dark One"),(16,11) +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'B',random,hostile +MONSTER:'i',random,hostile +MONSTER:'i',random,hostile +MONSTER:'i',random,hostile +MONSTER:'i',random,hostile +MONSTER:'i',random,hostile +MONSTER:'i',random,hostile +MONSTER:'i',random,hostile +MONSTER:('B',"vampire bat"),random +MONSTER:('B',"vampire bat"),random +MONSTER:('B',"vampire bat"),random +MONSTER:('B',"vampire bat"),random +MONSTER:('B',"vampire bat"),random +MONSTER:('B',"vampire bat"),random +MONSTER:('B',"vampire bat"),random +MONSTER:('B',"vampire bat"),random +MONSTER:'i',random,hostile # Captive Monsters in the dungeon -MONSTER:'@',"rogue",(35,06),peaceful,"Pug" -MONSTER:'Y',"owlbear",(47,06),peaceful,asleep -MONSTER:'@',"wizard",(32,11),peaceful,asleep,"Newt" -MONSTER:'@',"Grey-elf",(44,11),peaceful -MONSTER:'H',"hill giant",(47,11),peaceful,asleep -MONSTER:'G',"gnomish wizard",(38,06),peaceful -MONSTER:'@',"prisoner",(35,11),peaceful -MONSTER:'@',"prisoner",(41,11),peaceful,asleep +MONSTER:('@',"rogue"),(35,06),peaceful,"Pug" +MONSTER:('Y',"owlbear"),(47,06),peaceful,asleep +MONSTER:('@',"wizard"),(32,11),peaceful,asleep,"Newt" +MONSTER:('@',"Grey-elf"),(44,11),peaceful +MONSTER:('H',"hill giant"),(47,11),peaceful,asleep +MONSTER:('G',"gnomish wizard"),(38,06),peaceful +MONSTER:('@',"prisoner"),(35,11),peaceful +MONSTER:('@',"prisoner"),(41,11),peaceful,asleep # # The "fill" levels for the quest. @@ -365,77 +365,89 @@ MONSTER:'@',"prisoner",(41,11),peaceful,asleep LEVEL: "Wiz-fila" # -ROOM: "ordinary" , random, random, random, random -STAIR: random, up -OBJECT: random,random,random -MONSTER: 'i', random, random, hostile +ROOM: "ordinary" , random, random, random, random { + STAIR: random, up + OBJECT: random,random + MONSTER: 'i', random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random,random,random -MONSTER: 'i', random, random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random,random + MONSTER: 'i', random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -OBJECT: random,random,random -MONSTER: 'B', "vampire bat", random -MONSTER: 'B', "vampire bat", random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + OBJECT: random,random + MONSTER: ('B', "vampire bat"), random + MONSTER: ('B', "vampire bat"), random +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, down -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'i', random, random, hostile -MONSTER: 'B', "vampire bat", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, down + OBJECT: random, random + TRAP: random, random + MONSTER: 'i', random, hostile + MONSTER: ('B', "vampire bat"), random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'i', random, random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random, random + TRAP: random, random + MONSTER: 'i', random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'B', "vampire bat", random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + MONSTER: ('B', "vampire bat"), random +} RANDOM_CORRIDORS LEVEL: "Wiz-filb" # -ROOM: "ordinary" , random, random, random, random -STAIR: random, up -OBJECT: random,random,random -MONSTER: 'X', random, random, hostile +ROOM: "ordinary" , random, random, random, random { + STAIR: random, up + OBJECT: random,random + MONSTER: 'X', random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random,random,random -MONSTER: 'i', random, random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random,random + MONSTER: 'i', random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -OBJECT: random,random,random -MONSTER: 'X', random, random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + OBJECT: random,random + MONSTER: 'X', random, hostile +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, down -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'i', random, random, hostile -MONSTER: 'B', "vampire bat", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, down + OBJECT: random, random + TRAP: random, random + MONSTER: 'i', random, hostile + MONSTER: ('B', "vampire bat"), random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'i', random, random, hostile +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random, random + TRAP: random, random + MONSTER: 'i', random, hostile +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -MONSTER: 'B', "vampire bat", random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + MONSTER: ('B', "vampire bat"), random +} RANDOM_CORRIDORS diff --git a/dat/bigroom.des b/dat/bigroom.des index 00ea47f32..a902cfc3a 100644 --- a/dat/bigroom.des +++ b/dat/bigroom.des @@ -38,21 +38,21 @@ STAIR:random,down # Non diggable walls NON_DIGGABLE:(00,00,74,17) # Objects -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -61,34 +61,34 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random # Here, just play with the lighting... @@ -130,21 +130,21 @@ STAIR:random,down # Non diggable walls NON_DIGGABLE:(00,00,74,17) # Objects -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -153,34 +153,34 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random # Now, let's get fancy... @@ -214,21 +214,21 @@ STAIR:random,down # Non diggable walls NON_DIGGABLE:(00,00,74,17) # Objects -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -237,34 +237,34 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:random,random,(01,01) -MONSTER:random,random,(13,01) -MONSTER:random,random,(25,01) -MONSTER:random,random,(37,01) -MONSTER:random,random,(49,01) -MONSTER:random,random,(61,01) -MONSTER:random,random,(73,01) -MONSTER:random,random,(07,07) -MONSTER:random,random,(13,07) -MONSTER:random,random,(25,07) -MONSTER:random,random,(37,07) -MONSTER:random,random,(49,07) -MONSTER:random,random,(61,07) -MONSTER:random,random,(67,07) -MONSTER:random,random,(07,09) -MONSTER:random,random,(13,09) -MONSTER:random,random,(25,09) -MONSTER:random,random,(37,09) -MONSTER:random,random,(49,09) -MONSTER:random,random,(61,09) -MONSTER:random,random,(67,09) -MONSTER:random,random,(01,16) -MONSTER:random,random,(13,16) -MONSTER:random,random,(25,16) -MONSTER:random,random,(37,16) -MONSTER:random,random,(49,16) -MONSTER:random,random,(61,16) -MONSTER:random,random,(73,16) +MONSTER:random,(01,01) +MONSTER:random,(13,01) +MONSTER:random,(25,01) +MONSTER:random,(37,01) +MONSTER:random,(49,01) +MONSTER:random,(61,01) +MONSTER:random,(73,01) +MONSTER:random,(07,07) +MONSTER:random,(13,07) +MONSTER:random,(25,07) +MONSTER:random,(37,07) +MONSTER:random,(49,07) +MONSTER:random,(61,07) +MONSTER:random,(67,07) +MONSTER:random,(07,09) +MONSTER:random,(13,09) +MONSTER:random,(25,09) +MONSTER:random,(37,09) +MONSTER:random,(49,09) +MONSTER:random,(61,09) +MONSTER:random,(67,09) +MONSTER:random,(01,16) +MONSTER:random,(13,16) +MONSTER:random,(25,16) +MONSTER:random,(37,16) +MONSTER:random,(49,16) +MONSTER:random,(61,16) +MONSTER:random,(73,16) MAZE:"bigrm-4",' ' GEOMETRY:center,center MAP @@ -300,21 +300,21 @@ FOUNTAIN:(05,15) FOUNTAIN:(69,02) FOUNTAIN:(69,15) # Objects -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -323,34 +323,34 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random # Try an oval room... @@ -385,21 +385,21 @@ STAIR:random,down # Non diggable walls NON_DIGGABLE:(00,00,72,18) # Objects -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -408,31 +408,31 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random diff --git a/dat/castle.des b/dat/castle.des index 1dd4fda78..17f5e9f5c 100644 --- a/dat/castle.des +++ b/dat/castle.des @@ -42,9 +42,15 @@ MAP ENDMAP # Random registers initialisation -RANDOM_OBJECTS:'[',')','*','%' -RANDOM_PLACES:(04,02),(58,02),(04,14),(58,14) -RANDOM_MONSTERS:'L','N','E','H','M','O','R','T','X','Z' +$object = object: { '[',')','*','%' } +SHUFFLE: $object + +$place = { (04,02),(58,02),(04,14),(58,14) } +SHUFFLE: $place + +$monster = monster: { 'L','N','E','H','M','O','R','T','X','Z' } +SHUFFLE: $monster + TELEPORT_REGION:levregion(01,00,10,20),(1,1,61,15),down TELEPORT_REGION:levregion(69,00,79,20),(1,1,61,15),up @@ -72,72 +78,73 @@ DOOR:closed,(55,13) # The drawbridge DRAWBRIDGE:(05,08),east,closed # Storeroom number 1 -OBJECT:object[0],random,(39,05) -OBJECT:object[0],random,(40,05) -OBJECT:object[0],random,(41,05) -OBJECT:object[0],random,(42,05) -OBJECT:object[0],random,(43,05) -OBJECT:object[0],random,(44,05) -OBJECT:object[0],random,(45,05) -OBJECT:object[0],random,(39,06) -OBJECT:object[0],random,(40,06) -OBJECT:object[0],random,(41,06) -OBJECT:object[0],random,(42,06) -OBJECT:object[0],random,(43,06) -OBJECT:object[0],random,(44,06) -OBJECT:object[0],random,(45,06) +OBJECT:$object[0],(39,05) +OBJECT:$object[0],(40,05) +OBJECT:$object[0],(41,05) +OBJECT:$object[0],(42,05) +OBJECT:$object[0],(43,05) +OBJECT:$object[0],(44,05) +OBJECT:$object[0],(45,05) +OBJECT:$object[0],(39,06) +OBJECT:$object[0],(40,06) +OBJECT:$object[0],(41,06) +OBJECT:$object[0],(42,06) +OBJECT:$object[0],(43,06) +OBJECT:$object[0],(44,06) +OBJECT:$object[0],(45,06) # Storeroom number 2 -OBJECT:object[1],random,(49,05) -OBJECT:object[1],random,(50,05) -OBJECT:object[1],random,(51,05) -OBJECT:object[1],random,(52,05) -OBJECT:object[1],random,(53,05) -OBJECT:object[1],random,(54,05) -OBJECT:object[1],random,(55,05) -OBJECT:object[1],random,(49,06) -OBJECT:object[1],random,(50,06) -OBJECT:object[1],random,(51,06) -OBJECT:object[1],random,(52,06) -OBJECT:object[1],random,(53,06) -OBJECT:object[1],random,(54,06) -OBJECT:object[1],random,(55,06) +OBJECT:$object[1],(49,05) +OBJECT:$object[1],(50,05) +OBJECT:$object[1],(51,05) +OBJECT:$object[1],(52,05) +OBJECT:$object[1],(53,05) +OBJECT:$object[1],(54,05) +OBJECT:$object[1],(55,05) +OBJECT:$object[1],(49,06) +OBJECT:$object[1],(50,06) +OBJECT:$object[1],(51,06) +OBJECT:$object[1],(52,06) +OBJECT:$object[1],(53,06) +OBJECT:$object[1],(54,06) +OBJECT:$object[1],(55,06) # Storeroom number 3 -OBJECT:object[2],random,(39,10) -OBJECT:object[2],random,(40,10) -OBJECT:object[2],random,(41,10) -OBJECT:object[2],random,(42,10) -OBJECT:object[2],random,(43,10) -OBJECT:object[2],random,(44,10) -OBJECT:object[2],random,(45,10) -OBJECT:object[2],random,(39,11) -OBJECT:object[2],random,(40,11) -OBJECT:object[2],random,(41,11) -OBJECT:object[2],random,(42,11) -OBJECT:object[2],random,(43,11) -OBJECT:object[2],random,(44,11) -OBJECT:object[2],random,(45,11) +OBJECT:$object[2],(39,10) +OBJECT:$object[2],(40,10) +OBJECT:$object[2],(41,10) +OBJECT:$object[2],(42,10) +OBJECT:$object[2],(43,10) +OBJECT:$object[2],(44,10) +OBJECT:$object[2],(45,10) +OBJECT:$object[2],(39,11) +OBJECT:$object[2],(40,11) +OBJECT:$object[2],(41,11) +OBJECT:$object[2],(42,11) +OBJECT:$object[2],(43,11) +OBJECT:$object[2],(44,11) +OBJECT:$object[2],(45,11) # Storeroom number 4 -OBJECT:object[3],random,(49,10) -OBJECT:object[3],random,(50,10) -OBJECT:object[3],random,(51,10) -OBJECT:object[3],random,(52,10) -OBJECT:object[3],random,(53,10) -OBJECT:object[3],random,(54,10) -OBJECT:object[3],random,(55,10) -OBJECT:object[3],random,(49,11) -OBJECT:object[3],random,(50,11) -OBJECT:object[3],random,(51,11) -OBJECT:object[3],random,(52,11) -OBJECT:object[3],random,(53,11) -OBJECT:object[3],random,(54,11) -OBJECT:object[3],random,(55,11) +OBJECT:$object[3],(49,10) +OBJECT:$object[3],(50,10) +OBJECT:$object[3],(51,10) +OBJECT:$object[3],(52,10) +OBJECT:$object[3],(53,10) +OBJECT:$object[3],(54,10) +OBJECT:$object[3],(55,10) +OBJECT:$object[3],(49,11) +OBJECT:$object[3],(50,11) +OBJECT:$object[3],(51,11) +OBJECT:$object[3],(52,11) +OBJECT:$object[3],(53,11) +OBJECT:$object[3],(54,11) +OBJECT:$object[3],(55,11) # THE WAND OF WISHING in 1 of the 4 towers -CONTAINER:'(',"chest",place[0] -OBJECT:'/',"wishing",contained +CONTAINER:('(',"chest"),$place[0] { +OBJECT:('/',"wishing") +} # Prevent monsters from eating it. (@'s never eat objects) -ENGRAVING:place[0],burn,"Elbereth" +ENGRAVING:$place[0],burn,"Elbereth" # The treasure of the lord -OBJECT:'(',"chest",(37,08) +OBJECT:('(',"chest"),(37,08) # Traps TRAP:"trap door",(40,08) TRAP:"trap door",(44,08) @@ -145,66 +152,66 @@ TRAP:"trap door",(48,08) TRAP:"trap door",(52,08) TRAP:"trap door",(55,08) # Soldiers guarding the entry hall -MONSTER:'@',"soldier",(08,06) -MONSTER:'@',"soldier",(09,05) -MONSTER:'@',"soldier",(11,05) -MONSTER:'@',"soldier",(12,06) -MONSTER:'@',"soldier",(08,10) -MONSTER:'@',"soldier",(09,11) -MONSTER:'@',"soldier",(11,11) -MONSTER:'@',"soldier",(12,10) -MONSTER:'@',"lieutenant",(09,08) +MONSTER:('@',"soldier"),(08,06) +MONSTER:('@',"soldier"),(09,05) +MONSTER:('@',"soldier"),(11,05) +MONSTER:('@',"soldier"),(12,06) +MONSTER:('@',"soldier"),(08,10) +MONSTER:('@',"soldier"),(09,11) +MONSTER:('@',"soldier"),(11,11) +MONSTER:('@',"soldier"),(12,10) +MONSTER:('@',"lieutenant"),(09,08) # Soldiers guarding the towers -MONSTER:'@',"soldier",(03,02) -MONSTER:'@',"soldier",(05,02) -MONSTER:'@',"soldier",(57,02) -MONSTER:'@',"soldier",(59,02) -MONSTER:'@',"soldier",(03,14) -MONSTER:'@',"soldier",(05,14) -MONSTER:'@',"soldier",(57,14) -MONSTER:'@',"soldier",(59,14) +MONSTER:('@',"soldier"),(03,02) +MONSTER:('@',"soldier"),(05,02) +MONSTER:('@',"soldier"),(57,02) +MONSTER:('@',"soldier"),(59,02) +MONSTER:('@',"soldier"),(03,14) +MONSTER:('@',"soldier"),(05,14) +MONSTER:('@',"soldier"),(57,14) +MONSTER:('@',"soldier"),(59,14) # The four dragons that are guarding the storerooms -MONSTER:'D',random,(47,05) -MONSTER:'D',random,(47,06) -MONSTER:'D',random,(47,10) -MONSTER:'D',random,(47,11) +MONSTER:'D',(47,05) +MONSTER:'D',(47,06) +MONSTER:'D',(47,10) +MONSTER:'D',(47,11) # Sea monsters in the moat -MONSTER:';',"giant eel",(05,07) -MONSTER:';',"giant eel",(05,09) -MONSTER:';',"giant eel",(57,07) -MONSTER:';',"giant eel",(57,09) -MONSTER:';',"shark",(05,00) -MONSTER:';',"shark",(05,16) -MONSTER:';',"shark",(57,00) -MONSTER:';',"shark",(57,16) +MONSTER:(';',"giant eel"),(05,07) +MONSTER:(';',"giant eel"),(05,09) +MONSTER:(';',"giant eel"),(57,07) +MONSTER:(';',"giant eel"),(57,09) +MONSTER:(';',"shark"),(05,00) +MONSTER:(';',"shark"),(05,16) +MONSTER:(';',"shark"),(57,00) +MONSTER:(';',"shark"),(57,16) # The throne room and the court monsters -MONSTER:monster[0],random,(27,05) -MONSTER:monster[1],random,(30,05) -MONSTER:monster[2],random,(33,05) -MONSTER:monster[3],random,(36,05) -MONSTER:monster[4],random,(28,06) -MONSTER:monster[5],random,(31,06) -MONSTER:monster[6],random,(34,06) -MONSTER:monster[7],random,(37,06) -MONSTER:monster[8],random,(27,07) -MONSTER:monster[9],random,(30,07) -MONSTER:monster[0],random,(33,07) -MONSTER:monster[1],random,(36,07) -MONSTER:monster[2],random,(28,08) -MONSTER:monster[3],random,(31,08) -MONSTER:monster[4],random,(34,08) -MONSTER:monster[5],random,(27,09) -MONSTER:monster[6],random,(30,09) -MONSTER:monster[7],random,(33,09) -MONSTER:monster[8],random,(36,09) -MONSTER:monster[9],random,(28,10) -MONSTER:monster[0],random,(31,10) -MONSTER:monster[1],random,(34,10) -MONSTER:monster[2],random,(37,10) -MONSTER:monster[3],random,(27,11) -MONSTER:monster[4],random,(30,11) -MONSTER:monster[5],random,(33,11) -MONSTER:monster[6],random,(36,11) +MONSTER:$monster[0],(27,05) +MONSTER:$monster[1],(30,05) +MONSTER:$monster[2],(33,05) +MONSTER:$monster[3],(36,05) +MONSTER:$monster[4],(28,06) +MONSTER:$monster[5],(31,06) +MONSTER:$monster[6],(34,06) +MONSTER:$monster[7],(37,06) +MONSTER:$monster[8],(27,07) +MONSTER:$monster[9],(30,07) +MONSTER:$monster[0],(33,07) +MONSTER:$monster[1],(36,07) +MONSTER:$monster[2],(28,08) +MONSTER:$monster[3],(31,08) +MONSTER:$monster[4],(34,08) +MONSTER:$monster[5],(27,09) +MONSTER:$monster[6],(30,09) +MONSTER:$monster[7],(33,09) +MONSTER:$monster[8],(36,09) +MONSTER:$monster[9],(28,10) +MONSTER:$monster[0],(31,10) +MONSTER:$monster[1],(34,10) +MONSTER:$monster[2],(37,10) +MONSTER:$monster[3],(27,11) +MONSTER:$monster[4],(30,11) +MONSTER:$monster[5],(33,11) +MONSTER:$monster[6],(36,11) # MazeWalks MAZEWALK:(00,10),west MAZEWALK:(62,06),east diff --git a/dat/endgame.des b/dat/endgame.des index 4758ff518..68c113b07 100644 --- a/dat/endgame.des +++ b/dat/endgame.des @@ -51,79 +51,79 @@ PORTAL:(0,0,75,19),(65,13,75,19),"air" # Some helpful monsters. Making sure a # pick axe and at least one wand of digging # are available. -MONSTER:'@',"Elvenking",(67,16) -MONSTER:'H',"minotaur",(67,14) +MONSTER:('@',"Elvenking"),(67,16) +MONSTER:('H',"minotaur"),(67,14) # An assortment of earth-appropriate nasties # in each cavern. -MONSTER:'E',"earth elemental",(52,13),hostile -MONSTER:'E',"earth elemental",(53,13),hostile -MONSTER:'T',"rock troll",(53,12) -MONSTER:'H',"stone giant",(54,12) +MONSTER:('E',"earth elemental"),(52,13),hostile +MONSTER:('E',"earth elemental"),(53,13),hostile +MONSTER:('T',"rock troll"),(53,12) +MONSTER:('H',"stone giant"),(54,12) # -MONSTER:'S',"pit viper",(70,05) -MONSTER:'&',"barbed devil",(69,06) -MONSTER:'H',"stone giant",(69,08) -MONSTER:''',"stone golem",(71,08) -MONSTER:'&',"pit fiend",(70,09) -MONSTER:'E',"earth elemental",(70,08),hostile +MONSTER:('S',"pit viper"),(70,05) +MONSTER:('&',"barbed devil"),(69,06) +MONSTER:('H',"stone giant"),(69,08) +MONSTER:(''',"stone golem"),(71,08) +MONSTER:('&',"pit fiend"),(70,09) +MONSTER:('E',"earth elemental"),(70,08),hostile # -MONSTER:'E',"earth elemental",(60,03),hostile -MONSTER:'H',"stone giant",(61,04) -MONSTER:'E',"earth elemental",(62,04),hostile -MONSTER:'E',"earth elemental",(61,05),hostile -MONSTER:'s',"scorpion",(62,05) -MONSTER:'p',"rock piercer",(63,05) +MONSTER:('E',"earth elemental"),(60,03),hostile +MONSTER:('H',"stone giant"),(61,04) +MONSTER:('E',"earth elemental"),(62,04),hostile +MONSTER:('E',"earth elemental"),(61,05),hostile +MONSTER:('s',"scorpion"),(62,05) +MONSTER:('p',"rock piercer"),(63,05) # -MONSTER:'U',"umber hulk",(40,05) -MONSTER:'v',"dust vortex",(42,05) -MONSTER:'T',"rock troll",(38,06) -MONSTER:'E',"earth elemental",(39,06),hostile -MONSTER:'E',"earth elemental",(41,06),hostile -MONSTER:'E',"earth elemental",(38,07),hostile -MONSTER:'H',"stone giant",(39,07) -MONSTER:'E',"earth elemental",(43,07),hostile -MONSTER:''',"stone golem",(37,08) -MONSTER:'S',"pit viper",(43,08) -MONSTER:'S',"pit viper",(43,09) -MONSTER:'T',"rock troll",(44,10) +MONSTER:('U',"umber hulk"),(40,05) +MONSTER:('v',"dust vortex"),(42,05) +MONSTER:('T',"rock troll"),(38,06) +MONSTER:('E',"earth elemental"),(39,06),hostile +MONSTER:('E',"earth elemental"),(41,06),hostile +MONSTER:('E',"earth elemental"),(38,07),hostile +MONSTER:('H',"stone giant"),(39,07) +MONSTER:('E',"earth elemental"),(43,07),hostile +MONSTER:(''',"stone golem"),(37,08) +MONSTER:('S',"pit viper"),(43,08) +MONSTER:('S',"pit viper"),(43,09) +MONSTER:('T',"rock troll"),(44,10) # -MONSTER:'E',"earth elemental",(02,01),hostile -MONSTER:'E',"earth elemental",(03,01),hostile -MONSTER:''',"stone golem",(01,02) -MONSTER:'E',"earth elemental",(02,02),hostile -MONSTER:'T',"rock troll",(04,03) -MONSTER:'T',"rock troll",(03,03) -MONSTER:'&',"pit fiend",(03,04) -MONSTER:'E',"earth elemental",(04,05),hostile -MONSTER:'S',"pit viper",(05,06) +MONSTER:('E',"earth elemental"),(02,01),hostile +MONSTER:('E',"earth elemental"),(03,01),hostile +MONSTER:(''',"stone golem"),(01,02) +MONSTER:('E',"earth elemental"),(02,02),hostile +MONSTER:('T',"rock troll"),(04,03) +MONSTER:('T',"rock troll"),(03,03) +MONSTER:('&',"pit fiend"),(03,04) +MONSTER:('E',"earth elemental"),(04,05),hostile +MONSTER:('S',"pit viper"),(05,06) # -MONSTER:'E',"earth elemental",(21,02),hostile -MONSTER:'E',"earth elemental",(21,03),hostile -MONSTER:'H',"minotaur",(21,04) -MONSTER:'E',"earth elemental",(21,05),hostile -MONSTER:'T',"rock troll",(22,05) -MONSTER:'E',"earth elemental",(22,06),hostile -MONSTER:'E',"earth elemental",(23,06),hostile +MONSTER:('E',"earth elemental"),(21,02),hostile +MONSTER:('E',"earth elemental"),(21,03),hostile +MONSTER:('H',"minotaur"),(21,04) +MONSTER:('E',"earth elemental"),(21,05),hostile +MONSTER:('T',"rock troll"),(22,05) +MONSTER:('E',"earth elemental"),(22,06),hostile +MONSTER:('E',"earth elemental"),(23,06),hostile # -MONSTER:'S',"pit viper",(14,08) -MONSTER:'&',"barbed devil",(14,09) -MONSTER:'E',"earth elemental",(13,10),hostile -MONSTER:'T',"rock troll",(12,11) -MONSTER:'E',"earth elemental",(14,12),hostile -MONSTER:'E',"earth elemental",(15,13),hostile -MONSTER:'H',"stone giant",(17,13) -MONSTER:''',"stone golem",(18,13) -MONSTER:'&',"pit fiend",(18,12) -MONSTER:'E',"earth elemental",(18,11),hostile -MONSTER:'E',"earth elemental",(18,10),hostile +MONSTER:('S',"pit viper"),(14,08) +MONSTER:('&',"barbed devil"),(14,09) +MONSTER:('E',"earth elemental"),(13,10),hostile +MONSTER:('T',"rock troll"),(12,11) +MONSTER:('E',"earth elemental"),(14,12),hostile +MONSTER:('E',"earth elemental"),(15,13),hostile +MONSTER:('H',"stone giant"),(17,13) +MONSTER:(''',"stone golem"),(18,13) +MONSTER:('&',"pit fiend"),(18,12) +MONSTER:('E',"earth elemental"),(18,11),hostile +MONSTER:('E',"earth elemental"),(18,10),hostile # -MONSTER:'&',"barbed devil",(02,16) -MONSTER:'E',"earth elemental",(03,16),hostile -MONSTER:'T',"rock troll",(02,17) -MONSTER:'E',"earth elemental",(04,17),hostile -MONSTER:'E',"earth elemental",(04,18),hostile +MONSTER:('&',"barbed devil"),(02,16) +MONSTER:('E',"earth elemental"),(03,16),hostile +MONSTER:('T',"rock troll"),(02,17) +MONSTER:('E',"earth elemental"),(04,17),hostile +MONSTER:('E',"earth elemental"),(04,18),hostile -OBJECT:'`',"boulder",random +OBJECT:('`',"boulder"),random MAZE:"air",' ' @@ -168,63 +168,63 @@ TELEPORT_REGION:levregion(01,00,24,20),levregion(25,00,79,20),up TELEPORT_REGION:levregion(56,00,79,20),levregion(01,00,55,20),down PORTAL:levregion(57,01,78,19),(0,0,0,0),"fire" REGION:(00,00,75,19),lit,"ordinary" -MONSTER:'E',"air elemental",random,hostile -MONSTER:'E',"air elemental",random,hostile -MONSTER:'E',"air elemental",random,hostile -MONSTER:'E',"air elemental",random,hostile -MONSTER:'E',"air elemental",random,hostile -MONSTER:'E',"air elemental",random,hostile -MONSTER:'E',"air elemental",random,hostile -MONSTER:'E',"air elemental",random,hostile -MONSTER:'E',"air elemental",random,hostile -MONSTER:'E',"air elemental",random,hostile -MONSTER:'E',"air elemental",random,hostile +MONSTER:('E',"air elemental"),random,hostile +MONSTER:('E',"air elemental"),random,hostile +MONSTER:('E',"air elemental"),random,hostile +MONSTER:('E',"air elemental"),random,hostile +MONSTER:('E',"air elemental"),random,hostile +MONSTER:('E',"air elemental"),random,hostile +MONSTER:('E',"air elemental"),random,hostile +MONSTER:('E',"air elemental"),random,hostile +MONSTER:('E',"air elemental"),random,hostile +MONSTER:('E',"air elemental"),random,hostile +MONSTER:('E',"air elemental"),random,hostile -MONSTER:'e',"floating eye",random,hostile -MONSTER:'e',"floating eye",random,hostile -MONSTER:'e',"floating eye",random,hostile +MONSTER:('e',"floating eye"),random,hostile +MONSTER:('e',"floating eye"),random,hostile +MONSTER:('e',"floating eye"),random,hostile -MONSTER:'y',"yellow light",random,hostile -MONSTER:'y',"yellow light",random,hostile -MONSTER:'y',"yellow light",random,hostile +MONSTER:('y',"yellow light"),random,hostile +MONSTER:('y',"yellow light"),random,hostile +MONSTER:('y',"yellow light"),random,hostile -MONSTER:'A',"couatl",random +MONSTER:('A',"couatl"),random -MONSTER:'D',random,random -MONSTER:'D',random,random -MONSTER:'D',random,random -MONSTER:'D',random,random -MONSTER:'D',random,random +MONSTER:'D',random +MONSTER:'D',random +MONSTER:'D',random +MONSTER:'D',random +MONSTER:'D',random -MONSTER:'E',random,random -MONSTER:'E',random,random -MONSTER:'E',random,random -MONSTER:'J',random,random -MONSTER:'J',random,random +MONSTER:'E',random +MONSTER:'E',random +MONSTER:'E',random +MONSTER:'J',random +MONSTER:'J',random -MONSTER:'&',"djinni",random,hostile -MONSTER:'&',"djinni",random,hostile -MONSTER:'&',"djinni",random,hostile +MONSTER:('&',"djinni"),random,hostile +MONSTER:('&',"djinni"),random,hostile +MONSTER:('&',"djinni"),random,hostile -MONSTER:'v',"fog cloud",random,hostile -MONSTER:'v',"fog cloud",random,hostile -MONSTER:'v',"fog cloud",random,hostile -MONSTER:'v',"fog cloud",random,hostile -MONSTER:'v',"fog cloud",random,hostile -MONSTER:'v',"fog cloud",random,hostile -MONSTER:'v',"fog cloud",random,hostile -MONSTER:'v',"fog cloud",random,hostile -MONSTER:'v',"fog cloud",random,hostile -MONSTER:'v',"energy vortex",random,hostile -MONSTER:'v',"energy vortex",random,hostile -MONSTER:'v',"energy vortex",random,hostile -MONSTER:'v',"energy vortex",random,hostile -MONSTER:'v',"energy vortex",random,hostile -MONSTER:'v',"steam vortex",random,hostile -MONSTER:'v',"steam vortex",random,hostile -MONSTER:'v',"steam vortex",random,hostile -MONSTER:'v',"steam vortex",random,hostile -MONSTER:'v',"steam vortex",random,hostile +MONSTER:('v',"fog cloud"),random,hostile +MONSTER:('v',"fog cloud"),random,hostile +MONSTER:('v',"fog cloud"),random,hostile +MONSTER:('v',"fog cloud"),random,hostile +MONSTER:('v',"fog cloud"),random,hostile +MONSTER:('v',"fog cloud"),random,hostile +MONSTER:('v',"fog cloud"),random,hostile +MONSTER:('v',"fog cloud"),random,hostile +MONSTER:('v',"fog cloud"),random,hostile +MONSTER:('v',"energy vortex"),random,hostile +MONSTER:('v',"energy vortex"),random,hostile +MONSTER:('v',"energy vortex"),random,hostile +MONSTER:('v',"energy vortex"),random,hostile +MONSTER:('v',"energy vortex"),random,hostile +MONSTER:('v',"steam vortex"),random,hostile +MONSTER:('v',"steam vortex"),random,hostile +MONSTER:('v',"steam vortex"),random,hostile +MONSTER:('v',"steam vortex"),random,hostile +MONSTER:('v',"steam vortex"),random,hostile MAZE:"fire",' ' @@ -301,81 +301,81 @@ TRAP:"fire",random TRAP:"fire",random TRAP:"fire",random # An assortment of fire-appropriate nasties -MONSTER:'D',"red dragon",random -MONSTER:'&',"balrog",random -MONSTER:'E',"fire elemental",random,hostile -MONSTER:'E',"fire elemental",random,hostile -MONSTER:'v',"fire vortex",random -MONSTER:'d',"hell hound",random +MONSTER:('D',"red dragon"),random +MONSTER:('&',"balrog"),random +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:('v',"fire vortex"),random +MONSTER:('d',"hell hound"),random # -MONSTER:'H',"fire giant",random -MONSTER:'&',"barbed devil",random -MONSTER:'d',"hell hound",random -MONSTER:''',"stone golem",random -MONSTER:'&',"pit fiend",random -MONSTER:'E',"fire elemental",random,hostile +MONSTER:('H',"fire giant"),random +MONSTER:('&',"barbed devil"),random +MONSTER:('d',"hell hound"),random +MONSTER:(''',"stone golem"),random +MONSTER:('&',"pit fiend"),random +MONSTER:('E',"fire elemental"),random,hostile # -MONSTER:'E',"fire elemental",random,hostile -MONSTER:'d',"hell hound",random -MONSTER:'E',"fire elemental",random,hostile -MONSTER:'E',"fire elemental",random,hostile -MONSTER:'s',"scorpion",random -MONSTER:'H',"fire giant",random +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:('d',"hell hound"),random +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:('s',"scorpion"),random +MONSTER:('H',"fire giant"),random # -MONSTER:'d',"hell hound",random -MONSTER:'v',"dust vortex",random -MONSTER:'v',"fire vortex",random -MONSTER:'E',"fire elemental",random,hostile -MONSTER:'E',"fire elemental",random,hostile -MONSTER:'E',"fire elemental",random,hostile -MONSTER:'d',"hell hound",random -MONSTER:'E',"fire elemental",random,hostile -MONSTER:''',"stone golem",random -MONSTER:'S',"pit viper",random -MONSTER:'S',"pit viper",random -MONSTER:'v',"fire vortex",random +MONSTER:('d',"hell hound"),random +MONSTER:('v',"dust vortex"),random +MONSTER:('v',"fire vortex"),random +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:('d',"hell hound"),random +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:(''',"stone golem"),random +MONSTER:('S',"pit viper"),random +MONSTER:('S',"pit viper"),random +MONSTER:('v',"fire vortex"),random # -MONSTER:'E',"fire elemental",random,hostile -MONSTER:'E',"fire elemental",random,hostile -MONSTER:'H',"fire giant",random -MONSTER:'E',"fire elemental",random,hostile -MONSTER:'v',"fire vortex",random -MONSTER:'v',"fire vortex",random -MONSTER:'&',"pit fiend",random -MONSTER:'E',"fire elemental",random,hostile -MONSTER:'S',"pit viper",random +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:('H',"fire giant"),random +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:('v',"fire vortex"),random +MONSTER:('v',"fire vortex"),random +MONSTER:('&',"pit fiend"),random +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:('S',"pit viper"),random # -MONSTER:':',"salamander",random,hostile -MONSTER:':',"salamander",random,hostile -MONSTER:'H',"minotaur",random -MONSTER:':',"salamander",random,hostile -MONSTER:'v',"steam vortex",random -MONSTER:':',"salamander",random,hostile -MONSTER:':',"salamander",random,hostile +MONSTER:(':',"salamander"),random,hostile +MONSTER:(':',"salamander"),random,hostile +MONSTER:('H',"minotaur"),random +MONSTER:(':',"salamander"),random,hostile +MONSTER:('v',"steam vortex"),random +MONSTER:(':',"salamander"),random,hostile +MONSTER:(':',"salamander"),random,hostile # -MONSTER:'H',"fire giant",random -MONSTER:'&',"barbed devil",random -MONSTER:'E',"fire elemental",random,hostile -MONSTER:'v',"fire vortex",random -MONSTER:'E',"fire elemental",random,hostile -MONSTER:'E',"fire elemental",random,hostile -MONSTER:'d',"hell hound",random -MONSTER:'H',"fire giant",random -MONSTER:'&',"pit fiend",random -MONSTER:'E',"fire elemental",random,hostile -MONSTER:'E',"fire elemental",random,hostile +MONSTER:('H',"fire giant"),random +MONSTER:('&',"barbed devil"),random +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:('v',"fire vortex"),random +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:('d',"hell hound"),random +MONSTER:('H',"fire giant"),random +MONSTER:('&',"pit fiend"),random +MONSTER:('E',"fire elemental"),random,hostile +MONSTER:('E',"fire elemental"),random,hostile # -MONSTER:'&',"barbed devil",random -MONSTER:':',"salamander",random,hostile -MONSTER:'v',"steam vortex",random -MONSTER:':',"salamander",random,hostile -MONSTER:':',"salamander",random,hostile +MONSTER:('&',"barbed devil"),random +MONSTER:(':',"salamander"),random,hostile +MONSTER:('v',"steam vortex"),random +MONSTER:(':',"salamander"),random,hostile +MONSTER:(':',"salamander"),random,hostile -OBJECT:'`',"boulder",random -OBJECT:'`',"boulder",random -OBJECT:'`',"boulder",random -OBJECT:'`',"boulder",random -OBJECT:'`',"boulder",random +OBJECT:('`',"boulder"),random +OBJECT:('`',"boulder"),random +OBJECT:('`',"boulder"),random +OBJECT:('`',"boulder"),random +OBJECT:('`',"boulder"),random MAZE:"water",' ' @@ -412,67 +412,67 @@ ENDMAP TELEPORT_REGION:(0,0,25,19),(0,0,0,0) PORTAL:(51,0,75,19),(0,0,0,0),"astral" # A fisherman's dream... -MONSTER:';',"giant eel",random -MONSTER:';',"giant eel",random -MONSTER:';',"giant eel",random -MONSTER:';',"giant eel",random -MONSTER:';',"giant eel",random -MONSTER:';',"giant eel",random -MONSTER:';',"giant eel",random -MONSTER:';',"giant eel",random -MONSTER:';',"electric eel",random -MONSTER:';',"electric eel",random -MONSTER:';',"electric eel",random -MONSTER:';',"electric eel",random -MONSTER:';',"electric eel",random -MONSTER:';',"electric eel",random -MONSTER:';',"electric eel",random -MONSTER:';',"electric eel",random -MONSTER:';',"kraken",random -MONSTER:';',"kraken",random -MONSTER:';',"kraken",random -MONSTER:';',"kraken",random -MONSTER:';',"kraken",random -MONSTER:';',"kraken",random -MONSTER:';',"kraken",random -MONSTER:';',"kraken",random -MONSTER:';',"kraken",random -MONSTER:';',"shark",random -MONSTER:';',"shark",random -MONSTER:';',"shark",random -MONSTER:';',"shark",random -MONSTER:';',"piranha",random -MONSTER:';',"piranha",random -MONSTER:';',"piranha",random -MONSTER:';',"piranha",random -MONSTER:';',"jellyfish",random -MONSTER:';',"jellyfish",random -MONSTER:';',"jellyfish",random -MONSTER:';',"jellyfish",random -MONSTER:';',random,random -MONSTER:';',random,random -MONSTER:';',random,random -MONSTER:';',random,random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"giant eel"),random +MONSTER:(';',"electric eel"),random +MONSTER:(';',"electric eel"),random +MONSTER:(';',"electric eel"),random +MONSTER:(';',"electric eel"),random +MONSTER:(';',"electric eel"),random +MONSTER:(';',"electric eel"),random +MONSTER:(';',"electric eel"),random +MONSTER:(';',"electric eel"),random +MONSTER:(';',"kraken"),random +MONSTER:(';',"kraken"),random +MONSTER:(';',"kraken"),random +MONSTER:(';',"kraken"),random +MONSTER:(';',"kraken"),random +MONSTER:(';',"kraken"),random +MONSTER:(';',"kraken"),random +MONSTER:(';',"kraken"),random +MONSTER:(';',"kraken"),random +MONSTER:(';',"shark"),random +MONSTER:(';',"shark"),random +MONSTER:(';',"shark"),random +MONSTER:(';',"shark"),random +MONSTER:(';',"piranha"),random +MONSTER:(';',"piranha"),random +MONSTER:(';',"piranha"),random +MONSTER:(';',"piranha"),random +MONSTER:(';',"jellyfish"),random +MONSTER:(';',"jellyfish"),random +MONSTER:(';',"jellyfish"),random +MONSTER:(';',"jellyfish"),random +MONSTER:';',random +MONSTER:';',random +MONSTER:';',random +MONSTER:';',random # These guys feel like home here -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile -MONSTER:'E',"water elemental",random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile +MONSTER:('E',"water elemental"),random,hostile MAZE:"astral",' ' @@ -504,13 +504,15 @@ MAP ----------------- ENDMAP # Rider locations -RANDOM_PLACES:(23,9),(37,14),(51,9) +$place = { (23,9),(37,14),(51,9) } +SHUFFLE: $place + # Where the player will land on arrival TELEPORT_REGION:(29,15,45,15),(30,15,44,15) # Lit courts -REGION:(01,05,16,14),lit,"ordinary",filled,true -REGION:(31,01,44,10),lit,"ordinary",filled,true -REGION:(61,05,74,14),lit,"ordinary",filled,true +REGION:(01,05,16,14),lit,"ordinary",filled,irregular +REGION:(31,01,44,10),lit,"ordinary",filled,irregular +REGION:(61,05,74,14),lit,"ordinary",filled,irregular # A Sanctum for each alignment # The shrines' alignments are shuffled for # each game @@ -535,29 +537,29 @@ NON_DIGGABLE:(00,00,74,19) NON_PASSWALL:(00,00,74,19) # Moloch's horde # West round room -MONSTER:'@',"aligned priest",(18,09),noalign,hostile -MONSTER:'@',"aligned priest",(19,08),noalign,hostile -MONSTER:'@',"aligned priest",(19,09),noalign,hostile -MONSTER:'@',"aligned priest",(19,10),noalign,hostile -MONSTER:'A',"Angel",(20,09),noalign,hostile -MONSTER:'A',"Angel",(20,10),noalign,hostile -MONSTER:'&',"Pestilence",place[0],hostile +MONSTER:('@',"aligned priest"),(18,09),noalign,hostile +MONSTER:('@',"aligned priest"),(19,08),noalign,hostile +MONSTER:('@',"aligned priest"),(19,09),noalign,hostile +MONSTER:('@',"aligned priest"),(19,10),noalign,hostile +MONSTER:('A',"Angel"),(20,09),noalign,hostile +MONSTER:('A',"Angel"),(20,10),noalign,hostile +MONSTER:('&',"Pestilence"),$place[0],hostile # South-central round room -MONSTER:'@',"aligned priest",(36,12),noalign,hostile -MONSTER:'@',"aligned priest",(37,12),noalign,hostile -MONSTER:'@',"aligned priest",(38,12),noalign,hostile -MONSTER:'@',"aligned priest",(36,13),noalign,hostile -MONSTER:'A',"Angel",(38,13),noalign,hostile -MONSTER:'A',"Angel",(37,13),noalign,hostile -MONSTER:'&',"Death",place[1],hostile +MONSTER:('@',"aligned priest"),(36,12),noalign,hostile +MONSTER:('@',"aligned priest"),(37,12),noalign,hostile +MONSTER:('@',"aligned priest"),(38,12),noalign,hostile +MONSTER:('@',"aligned priest"),(36,13),noalign,hostile +MONSTER:('A',"Angel"),(38,13),noalign,hostile +MONSTER:('A',"Angel"),(37,13),noalign,hostile +MONSTER:('&',"Death"),$place[1],hostile # East round room -MONSTER:'@',"aligned priest",(56,09),noalign,hostile -MONSTER:'@',"aligned priest",(55,08),noalign,hostile -MONSTER:'@',"aligned priest",(55,09),noalign,hostile -MONSTER:'@',"aligned priest",(55,10),noalign,hostile -MONSTER:'A',"Angel",(54,09),noalign,hostile -MONSTER:'A',"Angel",(54,10),noalign,hostile -MONSTER:'&',"Famine",place[2],hostile +MONSTER:('@',"aligned priest"),(56,09),noalign,hostile +MONSTER:('@',"aligned priest"),(55,08),noalign,hostile +MONSTER:('@',"aligned priest"),(55,09),noalign,hostile +MONSTER:('@',"aligned priest"),(55,10),noalign,hostile +MONSTER:('A',"Angel"),(54,09),noalign,hostile +MONSTER:('A',"Angel"),(54,10),noalign,hostile +MONSTER:('&',"Famine"),$place[2],hostile # # The aligned horde # @@ -567,52 +569,52 @@ MONSTER:'&',"Famine",place[2],hostile # but a place holder. # # West court -MONSTER:'@',"aligned priest",(12,07),chaos,hostile -MONSTER:'@',"aligned priest",(13,07),chaos,peaceful -MONSTER:'@',"aligned priest",(14,07),law,hostile -MONSTER:'@',"aligned priest",(12,11),law,peaceful -MONSTER:'@',"aligned priest",(13,11),neutral,hostile -MONSTER:'@',"aligned priest",(14,11),neutral,peaceful -MONSTER:'A',"Angel",(11,05),chaos,hostile -MONSTER:'A',"Angel",(12,05),chaos,peaceful -MONSTER:'A',"Angel",(13,05),law,hostile -MONSTER:'A',"Angel",(11,13),law,peaceful -MONSTER:'A',"Angel",(12,13),neutral,hostile -MONSTER:'A',"Angel",(13,13),neutral,peaceful +MONSTER:('@',"aligned priest"),(12,07),chaos,hostile +MONSTER:('@',"aligned priest"),(13,07),chaos,peaceful +MONSTER:('@',"aligned priest"),(14,07),law,hostile +MONSTER:('@',"aligned priest"),(12,11),law,peaceful +MONSTER:('@',"aligned priest"),(13,11),neutral,hostile +MONSTER:('@',"aligned priest"),(14,11),neutral,peaceful +MONSTER:('A',"Angel"),(11,05),chaos,hostile +MONSTER:('A',"Angel"),(12,05),chaos,peaceful +MONSTER:('A',"Angel"),(13,05),law,hostile +MONSTER:('A',"Angel"),(11,13),law,peaceful +MONSTER:('A',"Angel"),(12,13),neutral,hostile +MONSTER:('A',"Angel"),(13,13),neutral,peaceful # Central court -MONSTER:'@',"aligned priest",(32,09),chaos,hostile -MONSTER:'@',"aligned priest",(33,09),chaos,peaceful -MONSTER:'@',"aligned priest",(34,09),law,hostile -MONSTER:'@',"aligned priest",(40,09),law,peaceful -MONSTER:'@',"aligned priest",(41,09),neutral,hostile -MONSTER:'@',"aligned priest",(42,09),neutral,peaceful -MONSTER:'A',"Angel",(31,08),chaos,hostile -MONSTER:'A',"Angel",(32,08),chaos,peaceful -MONSTER:'A',"Angel",(31,09),law,hostile -MONSTER:'A',"Angel",(42,08),law,peaceful -MONSTER:'A',"Angel",(43,08),neutral,hostile -MONSTER:'A',"Angel",(43,09),neutral,peaceful +MONSTER:('@',"aligned priest"),(32,09),chaos,hostile +MONSTER:('@',"aligned priest"),(33,09),chaos,peaceful +MONSTER:('@',"aligned priest"),(34,09),law,hostile +MONSTER:('@',"aligned priest"),(40,09),law,peaceful +MONSTER:('@',"aligned priest"),(41,09),neutral,hostile +MONSTER:('@',"aligned priest"),(42,09),neutral,peaceful +MONSTER:('A',"Angel"),(31,08),chaos,hostile +MONSTER:('A',"Angel"),(32,08),chaos,peaceful +MONSTER:('A',"Angel"),(31,09),law,hostile +MONSTER:('A',"Angel"),(42,08),law,peaceful +MONSTER:('A',"Angel"),(43,08),neutral,hostile +MONSTER:('A',"Angel"),(43,09),neutral,peaceful # East court -MONSTER:'@',"aligned priest",(60,07),chaos,hostile -MONSTER:'@',"aligned priest",(61,07),chaos,peaceful -MONSTER:'@',"aligned priest",(62,07),law,hostile -MONSTER:'@',"aligned priest",(60,11),law,peaceful -MONSTER:'@',"aligned priest",(61,11),neutral,hostile -MONSTER:'@',"aligned priest",(62,11),neutral,peaceful -MONSTER:'A',"Angel",(61,05),chaos,hostile -MONSTER:'A',"Angel",(62,05),chaos,peaceful -MONSTER:'A',"Angel",(63,05),law,hostile -MONSTER:'A',"Angel",(61,13),law,peaceful -MONSTER:'A',"Angel",(62,13),neutral,hostile -MONSTER:'A',"Angel",(63,13),neutral,peaceful +MONSTER:('@',"aligned priest"),(60,07),chaos,hostile +MONSTER:('@',"aligned priest"),(61,07),chaos,peaceful +MONSTER:('@',"aligned priest"),(62,07),law,hostile +MONSTER:('@',"aligned priest"),(60,11),law,peaceful +MONSTER:('@',"aligned priest"),(61,11),neutral,hostile +MONSTER:('@',"aligned priest"),(62,11),neutral,peaceful +MONSTER:('A',"Angel"),(61,05),chaos,hostile +MONSTER:('A',"Angel"),(62,05),chaos,peaceful +MONSTER:('A',"Angel"),(63,05),law,hostile +MONSTER:('A',"Angel"),(61,13),law,peaceful +MONSTER:('A',"Angel"),(62,13),neutral,hostile +MONSTER:('A',"Angel"),(63,13),neutral,peaceful # # Assorted nasties -MONSTER:'L',random,random,hostile -MONSTER:'L',random,random,hostile -MONSTER:'L',random,random,hostile -MONSTER:'V',random,random,hostile -MONSTER:'V',random,random,hostile -MONSTER:'V',random,random,hostile -MONSTER:'D',random,random,hostile -MONSTER:'D',random,random,hostile -MONSTER:'D',random,random,hostile +MONSTER:'L',random,hostile +MONSTER:'L',random,hostile +MONSTER:'L',random,hostile +MONSTER:'V',random,hostile +MONSTER:'V',random,hostile +MONSTER:'V',random,hostile +MONSTER:'D',random,hostile +MONSTER:'D',random,hostile +MONSTER:'D',random,hostile diff --git a/dat/gehennom.des b/dat/gehennom.des index daba7f532..7ae2a9df4 100644 --- a/dat/gehennom.des +++ b/dat/gehennom.des @@ -35,9 +35,9 @@ ENDMAP # The shrine to Moloch. REGION:(01,06,05,14),lit,"temple" # The Morgues -REGION:(19,01,24,08),unlit,"morgue",filled,true -REGION:(09,14,16,18),unlit,"morgue",filled,true -REGION:(37,09,43,14),unlit,"morgue",filled,true +REGION:(19,01,24,08),unlit,"morgue",filled,irregular +REGION:(09,14,16,18),unlit,"morgue",filled,irregular +REGION:(37,09,43,14),unlit,"morgue",filled,irregular # Stairs STAIR:(01,01),down # Branch location @@ -60,60 +60,60 @@ NON_DIGGABLE:(00,00,75,19) # note: no priest(esse)s or monks - maybe Moloch has a *special* # fate reserved for members of *those* classes. # -OBJECT:'%',"corpse",random,"archeologist",0 -OBJECT:'%',"corpse",random,"archeologist",0 -OBJECT:'%',"corpse",random,"barbarian",0 -OBJECT:'%',"corpse",random,"barbarian",0 -OBJECT:'%',"corpse",random,"caveman",0 -OBJECT:'%',"corpse",random,"cavewoman",0 -OBJECT:'%',"corpse",random,"healer",0 -OBJECT:'%',"corpse",random,"healer",0 -OBJECT:'%',"corpse",random,"knight",0 -OBJECT:'%',"corpse",random,"knight",0 -OBJECT:'%',"corpse",random,"ranger",0 -OBJECT:'%',"corpse",random,"ranger",0 -OBJECT:'%',"corpse",random,"rogue",0 -OBJECT:'%',"corpse",random,"rogue",0 -OBJECT:'%',"corpse",random,"samurai",0 -OBJECT:'%',"corpse",random,"samurai",0 -OBJECT:'%',"corpse",random,"tourist",0 -OBJECT:'%',"corpse",random,"tourist",0 -OBJECT:'%',"corpse",random,"valkyrie",0 -OBJECT:'%',"corpse",random,"valkyrie",0 -OBJECT:'%',"corpse",random,"wizard",0 -OBJECT:'%',"corpse",random,"wizard",0 +OBJECT:('%',"corpse"),random,montype:"archeologist" +OBJECT:('%',"corpse"),random,montype:"archeologist" +OBJECT:('%',"corpse"),random,montype:"barbarian" +OBJECT:('%',"corpse"),random,montype:"barbarian" +OBJECT:('%',"corpse"),random,montype:"caveman" +OBJECT:('%',"corpse"),random,montype:"cavewoman" +OBJECT:('%',"corpse"),random,montype:"healer" +OBJECT:('%',"corpse"),random,montype:"healer" +OBJECT:('%',"corpse"),random,montype:"knight" +OBJECT:('%',"corpse"),random,montype:"knight" +OBJECT:('%',"corpse"),random,montype:"ranger" +OBJECT:('%',"corpse"),random,montype:"ranger" +OBJECT:('%',"corpse"),random,montype:"rogue" +OBJECT:('%',"corpse"),random,montype:"rogue" +OBJECT:('%',"corpse"),random,montype:"samurai" +OBJECT:('%',"corpse"),random,montype:"samurai" +OBJECT:('%',"corpse"),random,montype:"tourist" +OBJECT:('%',"corpse"),random,montype:"tourist" +OBJECT:('%',"corpse"),random,montype:"valkyrie" +OBJECT:('%',"corpse"),random,montype:"valkyrie" +OBJECT:('%',"corpse"),random,montype:"wizard" +OBJECT:('%',"corpse"),random,montype:"wizard" # # Some random weapons and armor. # -OBJECT:'[',random,random -OBJECT:'[',random,random -OBJECT:'[',random,random -OBJECT:'[',random,random -OBJECT:')',random,random -OBJECT:')',random,random -OBJECT:')',random,random -OBJECT:')',random,random +OBJECT:'[',random +OBJECT:'[',random +OBJECT:'[',random +OBJECT:'[',random +OBJECT:')',random +OBJECT:')',random +OBJECT:')',random +OBJECT:')',random # # Some random loot. # -OBJECT:'*',"ruby",random -OBJECT:'*',random,random -OBJECT:'*',random,random -OBJECT:'!',random,random -OBJECT:'!',random,random -OBJECT:'!',random,random -OBJECT:'?',random,random -OBJECT:'?',random,random -OBJECT:'?',random,random -OBJECT:'/',random,random -OBJECT:'/',random,random -OBJECT:'=',random,random -OBJECT:'=',random,random -OBJECT:'+',random,random -OBJECT:'+',random,random -OBJECT:'(',random,random -OBJECT:'(',random,random -OBJECT:'(',random,random +OBJECT:('*',"ruby"),random +OBJECT:'*',random +OBJECT:'*',random +OBJECT:'!',random +OBJECT:'!',random +OBJECT:'!',random +OBJECT:'?',random +OBJECT:'?',random +OBJECT:'?',random +OBJECT:'/',random +OBJECT:'/',random +OBJECT:'=',random +OBJECT:'=',random +OBJECT:'+',random +OBJECT:'+',random +OBJECT:'(',random +OBJECT:'(',random +OBJECT:'(',random # (Not so) Random traps. TRAP:"spiked pit", (05,02) @@ -130,36 +130,36 @@ TRAP:"magic", random # Random monsters. # The ghosts. -MONSTER:' ',"ghost",random -MONSTER:' ',"ghost",random -MONSTER:' ',"ghost",random -MONSTER:' ',"ghost",random -MONSTER:' ',"ghost",random -MONSTER:' ',"ghost",random +MONSTER:(' ',"ghost"),random +MONSTER:(' ',"ghost"),random +MONSTER:(' ',"ghost"),random +MONSTER:(' ',"ghost"),random +MONSTER:(' ',"ghost"),random +MONSTER:(' ',"ghost"),random # Add a few bats for atmosphere. -MONSTER:'B',"vampire bat",random -MONSTER:'B',"vampire bat",random -MONSTER:'B',"vampire bat",random +MONSTER:('B',"vampire bat"),random +MONSTER:('B',"vampire bat"),random +MONSTER:('B',"vampire bat"),random # And a lich for good measure. -MONSTER:'L',random,random +MONSTER:'L',random # Some undead nasties for good measure -MONSTER:'V',random,random -MONSTER:'V',random,random -MONSTER:'V',random,random -MONSTER:'Z',random,random -MONSTER:'Z',random,random -MONSTER:'Z',random,random -MONSTER:'Z',random,random -MONSTER:'M',random,random -MONSTER:'M',random,random -MONSTER:'M',random,random -MONSTER:'M',random,random +MONSTER:'V',random +MONSTER:'V',random +MONSTER:'V',random +MONSTER:'Z',random +MONSTER:'Z',random +MONSTER:'Z',random +MONSTER:'Z',random +MONSTER:'M',random +MONSTER:'M',random +MONSTER:'M',random +MONSTER:'M',random # # The Juiblex level # MAZE:"juiblex",' ' FLAGS:noteleport,shortsighted -INIT_MAP:'.','}',true,true,unlit,false +INIT_MAP:mines,'.','}',true,true,unlit,false # guarantee at least one open spot to ensure successful stair placement GEOMETRY:left,bottom MAP @@ -169,7 +169,7 @@ MAP }}}}.}}} }}}}}}}} ENDMAP -OBJECT:'`',"boulder",random +OBJECT:('`',"boulder"),random GEOMETRY:right,top MAP }}}}}}}} @@ -178,7 +178,7 @@ MAP }}...}}} }}}}}}}} ENDMAP -OBJECT:'`',"boulder",random +OBJECT:('`',"boulder"),random # lair GEOMETRY:center,center MAP @@ -202,8 +202,12 @@ MAP ..}}}}}.}}}}}.}}}}}.}}}}}.}}}}}.}}}}}.}}}}}.}}}}}.. ENDMAP # Random registers -RANDOM_MONSTERS:'j','b','P','F' -RANDOM_PLACES:(04,02),(46,02),(04,15),(46,15) +$monster = monster: { 'j','b','P','F' } +SHUFFLE: $monster + +$place = { (04,02),(46,02),(04,15),(46,15) } +SHUFFLE: $place + # Dungeon description REGION:(00,00,50,17),unlit,"swamp" MAZEWALK:(00,09),west @@ -213,57 +217,57 @@ STAIR:levregion(69,00,79,20),(0,0,50,17),up BRANCH:levregion(01,00,11,20),(0,0,50,17) TELEPORT_REGION:levregion(01,00,11,20),(0,0,50,17),up TELEPORT_REGION:levregion(69,00,79,20),(0,0,50,17),down -FOUNTAIN:place[0] -MONSTER:'m',"giant mimic",place[1],m_feature "fountain" -MONSTER:'m',"giant mimic",place[2],m_feature "fountain" -MONSTER:'m',"giant mimic",place[3],m_feature "fountain" +FOUNTAIN:$place[0] +MONSTER:('m',"giant mimic"),$place[1],m_feature "fountain" +MONSTER:('m',"giant mimic"),$place[2],m_feature "fountain" +MONSTER:('m',"giant mimic"),$place[3],m_feature "fountain" # The demon of the swamp -MONSTER:'&',"Juiblex",(25,08) +MONSTER:('&',"Juiblex"),(25,08) # And a couple demons -MONSTER:'i',"lemure",(43,08) -MONSTER:'i',"lemure",(44,08) -MONSTER:'i',"lemure",(45,08) +MONSTER:('i',"lemure"),(43,08) +MONSTER:('i',"lemure"),(44,08) +MONSTER:('i',"lemure"),(45,08) # Some liquids and gems -OBJECT:'*',random,(43,06) -OBJECT:'*',random,(45,06) -OBJECT:'!',random,(43,09) -OBJECT:'!',random,(44,09) -OBJECT:'!',random,(45,09) +OBJECT:'*',(43,06) +OBJECT:'*',(45,06) +OBJECT:'!',(43,09) +OBJECT:'!',(44,09) +OBJECT:'!',(45,09) # And lots of blobby monsters -MONSTER:monster[0],random,(25,06) -MONSTER:monster[1],random,(24,07) -MONSTER:monster[2],random,(26,07) -MONSTER:monster[3],random,(23,08) -MONSTER:monster[3],random,(27,08) -MONSTER:monster[2],random,(24,09) -MONSTER:monster[1],random,(26,09) -MONSTER:monster[0],random,(25,10) -MONSTER:'j',random,random -MONSTER:'j',random,random -MONSTER:'j',random,random -MONSTER:'j',random,random -MONSTER:'P',random,random -MONSTER:'P',random,random -MONSTER:'P',random,random -MONSTER:'P',random,random -MONSTER:'b',random,random -MONSTER:'b',random,random -MONSTER:'b',random,random -MONSTER:'F',random,random -MONSTER:'F',random,random -MONSTER:'F',random,random -MONSTER:'m',random,random -MONSTER:'m',random,random -MONSTER:';',"jellyfish",random -MONSTER:';',"jellyfish",random +MONSTER:$monster[0],(25,06) +MONSTER:$monster[1],(24,07) +MONSTER:$monster[2],(26,07) +MONSTER:$monster[3],(23,08) +MONSTER:$monster[3],(27,08) +MONSTER:$monster[2],(24,09) +MONSTER:$monster[1],(26,09) +MONSTER:$monster[0],(25,10) +MONSTER:'j',random +MONSTER:'j',random +MONSTER:'j',random +MONSTER:'j',random +MONSTER:'P',random +MONSTER:'P',random +MONSTER:'P',random +MONSTER:'P',random +MONSTER:'b',random +MONSTER:'b',random +MONSTER:'b',random +MONSTER:'F',random +MONSTER:'F',random +MONSTER:'F',random +MONSTER:'m',random +MONSTER:'m',random +MONSTER:(';',"jellyfish"),random +MONSTER:(';',"jellyfish"),random # Some random objects -OBJECT:'!',random,random -OBJECT:'!',random,random -OBJECT:'!',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'`',"boulder",random +OBJECT:'!',random +OBJECT:'!',random +OBJECT:'!',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:('`',"boulder"),random # Some traps TRAP:"sleep gas",random TRAP:"sleep gas",random @@ -305,30 +309,30 @@ STAIR:levregion(01,00,12,20),levregion(20,01,70,20),up BRANCH:levregion(01,00,12,20),levregion(20,01,70,20) TELEPORT_REGION:levregion(01,00,12,20),levregion(20,01,70,20) # Wall "ruins" -OBJECT:'`',"boulder",(19,02) -OBJECT:'`',"boulder",(20,02) -OBJECT:'`',"boulder",(21,02) -OBJECT:'`',"boulder",(36,02) -OBJECT:'`',"boulder",(36,03) -OBJECT:'`',"boulder",(06,04) -OBJECT:'`',"boulder",(05,05) -OBJECT:'`',"boulder",(06,05) -OBJECT:'`',"boulder",(07,05) -OBJECT:'`',"boulder",(39,05) -OBJECT:'`',"boulder",(08,08) -OBJECT:'`',"boulder",(09,08) -OBJECT:'`',"boulder",(10,08) -OBJECT:'`',"boulder",(11,08) -OBJECT:'`',"boulder",(06,10) -OBJECT:'`',"boulder",(05,11) -OBJECT:'`',"boulder",(06,11) -OBJECT:'`',"boulder",(07,11) -OBJECT:'`',"boulder",(21,11) -OBJECT:'`',"boulder",(21,12) -OBJECT:'`',"boulder",(13,13) -OBJECT:'`',"boulder",(14,13) -OBJECT:'`',"boulder",(15,13) -OBJECT:'`',"boulder",(14,14) +OBJECT:('`',"boulder"),(19,02) +OBJECT:('`',"boulder"),(20,02) +OBJECT:('`',"boulder"),(21,02) +OBJECT:('`',"boulder"),(36,02) +OBJECT:('`',"boulder"),(36,03) +OBJECT:('`',"boulder"),(06,04) +OBJECT:('`',"boulder"),(05,05) +OBJECT:('`',"boulder"),(06,05) +OBJECT:('`',"boulder"),(07,05) +OBJECT:('`',"boulder"),(39,05) +OBJECT:('`',"boulder"),(08,08) +OBJECT:('`',"boulder"),(09,08) +OBJECT:('`',"boulder"),(10,08) +OBJECT:('`',"boulder"),(11,08) +OBJECT:('`',"boulder"),(06,10) +OBJECT:('`',"boulder"),(05,11) +OBJECT:('`',"boulder"),(06,11) +OBJECT:('`',"boulder"),(07,11) +OBJECT:('`',"boulder"),(21,11) +OBJECT:('`',"boulder"),(21,12) +OBJECT:('`',"boulder"),(13,13) +OBJECT:('`',"boulder"),(14,13) +OBJECT:('`',"boulder"),(15,13) +OBJECT:('`',"boulder"),(14,14) # Doors DOOR:closed,(23,02) DOOR:open,(31,03) @@ -361,56 +365,56 @@ TRAP:"fire", random TRAP:"magic", random TRAP:"magic", random # Some random objects -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # The resident nasty -MONSTER:'&',"Orcus",(33,15) +MONSTER:('&',"Orcus"),(33,15) # And its preferred companions -MONSTER:'Z',"human zombie",(32,15) -MONSTER:' ',"shade",(32,14) -MONSTER:' ',"shade",(32,16) -MONSTER:'V',"vampire",(35,16) -MONSTER:'V',"vampire",(35,14) -MONSTER:'V',"vampire lord",(36,14) -MONSTER:'V',"vampire lord",(36,15) +MONSTER:('Z',"human zombie"),(32,15) +MONSTER:(' ',"shade"),(32,14) +MONSTER:(' ',"shade"),(32,16) +MONSTER:('V',"vampire"),(35,16) +MONSTER:('V',"vampire"),(35,14) +MONSTER:('V',"vampire lord"),(36,14) +MONSTER:('V',"vampire lord"),(36,15) # Randomly placed companions -MONSTER:'Z',"skeleton",random -MONSTER:'Z',"skeleton",random -MONSTER:'Z',"skeleton",random -MONSTER:'Z',"skeleton",random -MONSTER:'Z',"skeleton",random -MONSTER:' ',"shade",random -MONSTER:' ',"shade",random -MONSTER:' ',"shade",random -MONSTER:' ',"shade",random -MONSTER:'Z',"giant zombie",random -MONSTER:'Z',"giant zombie",random -MONSTER:'Z',"giant zombie",random -MONSTER:'Z',"ettin zombie",random -MONSTER:'Z',"ettin zombie",random -MONSTER:'Z',"ettin zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'Z',"human zombie",random -MONSTER:'V',"vampire",random -MONSTER:'V',"vampire",random -MONSTER:'V',"vampire",random -MONSTER:'V',"vampire lord",random -MONSTER:'V',"vampire lord",random +MONSTER:('Z',"skeleton"),random +MONSTER:('Z',"skeleton"),random +MONSTER:('Z',"skeleton"),random +MONSTER:('Z',"skeleton"),random +MONSTER:('Z',"skeleton"),random +MONSTER:(' ',"shade"),random +MONSTER:(' ',"shade"),random +MONSTER:(' ',"shade"),random +MONSTER:(' ',"shade"),random +MONSTER:('Z',"giant zombie"),random +MONSTER:('Z',"giant zombie"),random +MONSTER:('Z',"giant zombie"),random +MONSTER:('Z',"ettin zombie"),random +MONSTER:('Z',"ettin zombie"),random +MONSTER:('Z',"ettin zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('Z',"human zombie"),random +MONSTER:('V',"vampire"),random +MONSTER:('V',"vampire"),random +MONSTER:('V',"vampire"),random +MONSTER:('V',"vampire lord"),random +MONSTER:('V',"vampire lord"),random # A few more for the party -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random # # The Asmodeus Level # @@ -447,18 +451,18 @@ NON_DIGGABLE:(00,00,20,11) # Entire main area REGION:(01,01,20,10),unlit,"ordinary" # The fellow in residence -MONSTER:'&',"Asmodeus",(12,07) +MONSTER:('&',"Asmodeus"),(12,07) # Some random weapons and armor. -OBJECT:'[',random,random -OBJECT:'[',random,random -OBJECT:')',random,random -OBJECT:')',random,random -OBJECT:'*',random,random -OBJECT:'!',random,random -OBJECT:'!',random,random -OBJECT:'?',random,random -OBJECT:'?',random,random -OBJECT:'?',random,random +OBJECT:'[',random +OBJECT:'[',random +OBJECT:')',random +OBJECT:')',random +OBJECT:'*',random +OBJECT:'!',random +OBJECT:'!',random +OBJECT:'?',random +OBJECT:'?',random +OBJECT:'?',random # Some traps. TRAP:"spiked pit", (05,02) TRAP:"fire", (08,06) @@ -468,13 +472,13 @@ TRAP:"fire", random TRAP:"magic", random TRAP:"magic", random # Random monsters. -MONSTER:' ',"ghost",(11,07) -MONSTER:'&',"horned devil",(10,05) -MONSTER:'L',random,random +MONSTER:(' ',"ghost"),(11,07) +MONSTER:('&',"horned devil"),(10,05) +MONSTER:'L',random # Some Vampires for good measure -MONSTER:'V',random,random -MONSTER:'V',random,random -MONSTER:'V',random,random +MONSTER:'V',random +MONSTER:'V',random +MONSTER:'V',random # Second part GEOMETRY:half-right,center MAP @@ -488,9 +492,9 @@ MAZEWALK:(32,02),east # Non diggable walls NON_DIGGABLE:(00,00,32,04) DOOR:closed,(32,02) -MONSTER:'&',random,random -MONSTER:'&',random,random -MONSTER:'&',random,random +MONSTER:'&',random +MONSTER:'&',random +MONSTER:'&',random TRAP:"anti magic", random TRAP:"fire", random TRAP:"magic", random @@ -523,18 +527,18 @@ NON_DIGGABLE:(00,00,46,12) MAZEWALK:(00,06),west STAIR:(44,06),down # The fellow in residence -MONSTER:'&',"Baalzebub",(35,06) +MONSTER:('&',"Baalzebub"),(35,06) # Some random weapons and armor. -OBJECT:'[',random,random -OBJECT:'[',random,random -OBJECT:')',random,random -OBJECT:')',random,random -OBJECT:'*',random,random -OBJECT:'!',random,random -OBJECT:'!',random,random -OBJECT:'?',random,random -OBJECT:'?',random,random -OBJECT:'?',random,random +OBJECT:'[',random +OBJECT:'[',random +OBJECT:')',random +OBJECT:')',random +OBJECT:'*',random +OBJECT:'!',random +OBJECT:'!',random +OBJECT:'?',random +OBJECT:'?',random +OBJECT:'?',random # Some traps. TRAP:"spiked pit", random TRAP:"fire", random @@ -544,14 +548,14 @@ TRAP:"fire", random TRAP:"magic", random TRAP:"magic", random # Random monsters. -MONSTER:' ',"ghost",(37,07) -MONSTER:'&',"horned devil",(32,05) -MONSTER:'&',"barbed devil",(38,07) -MONSTER:'L',random,random +MONSTER:(' ',"ghost"),(37,07) +MONSTER:('&',"horned devil"),(32,05) +MONSTER:('&',"barbed devil"),(38,07) +MONSTER:'L',random # Some Vampires for good measure -MONSTER:'V',random,random -MONSTER:'V',random,random -MONSTER:'V',random,random +MONSTER:'V',random +MONSTER:'V',random +MONSTER:'V',random # # The Sanctum Level # @@ -582,7 +586,7 @@ MAP ENDMAP REGION:(15,07,21,10),lit,"temple" ALTAR:(18,08),noalign,sanctum -REGION:(41,06,48,11),unlit,"morgue",filled,true +REGION:(41,06,48,11),unlit,"morgue",filled,irregular # Non diggable walls NON_DIGGABLE:(00,00,75,19) # Invisible barrier separating the left & right halves of the level @@ -635,44 +639,44 @@ TRAP:"anti magic", random TRAP:"fire", random TRAP:"magic", random # Some random objects -OBJECT:'[',random,random -OBJECT:'[',random,random -OBJECT:'[',random,random -OBJECT:'[',random,random -OBJECT:')',random,random -OBJECT:')',random,random -OBJECT:'*',random,random -OBJECT:'!',random,random -OBJECT:'!',random,random -OBJECT:'!',random,random -OBJECT:'!',random,random -OBJECT:'?',random,random -OBJECT:'?',random,random -OBJECT:'?',random,random -OBJECT:'?',random,random -OBJECT:'?',random,random +OBJECT:'[',random +OBJECT:'[',random +OBJECT:'[',random +OBJECT:'[',random +OBJECT:')',random +OBJECT:')',random +OBJECT:'*',random +OBJECT:'!',random +OBJECT:'!',random +OBJECT:'!',random +OBJECT:'!',random +OBJECT:'?',random +OBJECT:'?',random +OBJECT:'?',random +OBJECT:'?',random +OBJECT:'?',random # Some monsters. -MONSTER:'&',"horned devil",(14,12),hostile -MONSTER:'&',"barbed devil",(18,08),hostile -MONSTER:'&',"erinys",(10,04),hostile -MONSTER:'&',"marilith",(07,09),hostile -MONSTER:'&',"nalfeshnee",(27,08),hostile +MONSTER:('&',"horned devil"),(14,12),hostile +MONSTER:('&',"barbed devil"),(18,08),hostile +MONSTER:('&',"erinys"),(10,04),hostile +MONSTER:('&',"marilith"),(07,09),hostile +MONSTER:('&',"nalfeshnee"),(27,08),hostile # Moloch's horde -MONSTER:'@',"aligned priest",(20,03),noalign,hostile -MONSTER:'@',"aligned priest",(15,04),noalign,hostile -MONSTER:'@',"aligned priest",(11,05),noalign,hostile -MONSTER:'@',"aligned priest",(11,07),noalign,hostile -MONSTER:'@',"aligned priest",(11,09),noalign,hostile -MONSTER:'@',"aligned priest",(11,12),noalign,hostile -MONSTER:'@',"aligned priest",(15,13),noalign,hostile -MONSTER:'@',"aligned priest",(17,13),noalign,hostile -MONSTER:'@',"aligned priest",(21,13),noalign,hostile +MONSTER:('@',"aligned priest"),(20,03),noalign,hostile +MONSTER:('@',"aligned priest"),(15,04),noalign,hostile +MONSTER:('@',"aligned priest"),(11,05),noalign,hostile +MONSTER:('@',"aligned priest"),(11,07),noalign,hostile +MONSTER:('@',"aligned priest"),(11,09),noalign,hostile +MONSTER:('@',"aligned priest"),(11,12),noalign,hostile +MONSTER:('@',"aligned priest"),(15,13),noalign,hostile +MONSTER:('@',"aligned priest"),(17,13),noalign,hostile +MONSTER:('@',"aligned priest"),(21,13),noalign,hostile # A few nasties -MONSTER:'L',random,random -MONSTER:'L',random,random -MONSTER:'V',random,random -MONSTER:'V',random,random -MONSTER:'V',random,random +MONSTER:'L',random +MONSTER:'L',random +MONSTER:'V',random +MONSTER:'V',random +MONSTER:'V',random STAIR:(63,15),up # Teleporting to this level is allowed after the invocation creates its # entrance. Force arrival in that case to be on rightmost third of level. diff --git a/dat/knox.des b/dat/knox.des index d9d1a2d4d..f9b9b3809 100644 --- a/dat/knox.des +++ b/dat/knox.des @@ -39,7 +39,7 @@ TELEPORT_REGION:(06,16,09,17),(0,0,0,0),up TELEPORT_REGION:(06,16,09,17),(0,0,0,0),down # Throne room, with Croesus on the throne REGION:(37,08,46,11),lit,"throne" -MONSTER:'@',"Croesus",(43,10),hostile +MONSTER:('@',"Croesus"),(43,10),hostile # The Vault # Using unfilled morgue for # identification in mkmaze.c @@ -50,12 +50,12 @@ REGION:(46,06,48,06),lit,"ordinary" REGION:(19,13,21,13),lit,"ordinary" REGION:(46,13,48,13),lit,"ordinary" # A welcoming committee -REGION:(03,10,07,13),lit,"zoo",filled,true +REGION:(03,10,07,13),lit,"zoo",filled,irregular # arrival chamber; needs to be a real room to control migrating monsters, # and `unfilled' is a kludge to force an ordinary room to remain a room REGION:(06,15,09,16),unlit,"ordinary",unfilled # Barracks -REGION:(62,03,71,04),lit,"barracks",filled,true +REGION:(62,03,71,04),lit,"barracks",filled,irregular # Doors DOOR:closed,(06,14) DOOR:closed,(09,03) @@ -67,43 +67,43 @@ DOOR:open,(68,11) DOOR:closed,(63,14) DOOR:closed,(66,14) # Soldiers guarding the fort -MONSTER:'@',"soldier",(12,14) -MONSTER:'@',"soldier",(12,13) -MONSTER:'@',"soldier",(11,10) -MONSTER:'@',"soldier",(13,02) -MONSTER:'@',"soldier",(14,03) -MONSTER:'@',"soldier",(20,02) -MONSTER:'@',"soldier",(30,02) -MONSTER:'@',"soldier",(40,02) -MONSTER:'@',"soldier",(30,16) -MONSTER:'@',"soldier",(32,16) -MONSTER:'@',"soldier",(40,16) -MONSTER:'@',"soldier",(54,16) -MONSTER:'@',"soldier",(54,14) -MONSTER:'@',"soldier",(54,13) -MONSTER:'@',"soldier",(57,10) -MONSTER:'@',"soldier",(57,09) -MONSTER:'@',"lieutenant",(15,08) +MONSTER:('@',"soldier"),(12,14) +MONSTER:('@',"soldier"),(12,13) +MONSTER:('@',"soldier"),(11,10) +MONSTER:('@',"soldier"),(13,02) +MONSTER:('@',"soldier"),(14,03) +MONSTER:('@',"soldier"),(20,02) +MONSTER:('@',"soldier"),(30,02) +MONSTER:('@',"soldier"),(40,02) +MONSTER:('@',"soldier"),(30,16) +MONSTER:('@',"soldier"),(32,16) +MONSTER:('@',"soldier"),(40,16) +MONSTER:('@',"soldier"),(54,16) +MONSTER:('@',"soldier"),(54,14) +MONSTER:('@',"soldier"),(54,13) +MONSTER:('@',"soldier"),(57,10) +MONSTER:('@',"soldier"),(57,09) +MONSTER:('@',"lieutenant"),(15,08) # Four dragons guarding each side -MONSTER:'D',random,(18,09) -MONSTER:'D',random,(49,10) -MONSTER:'D',random,(33,05) -MONSTER:'D',random,(33,14) +MONSTER:'D',(18,09) +MONSTER:'D',(49,10) +MONSTER:'D',(33,05) +MONSTER:'D',(33,14) # Eels in the moat -MONSTER:';',"giant eel",(17,08) -MONSTER:';',"giant eel",(17,11) -MONSTER:';',"giant eel",(48,08) -MONSTER:';',"giant eel",(48,11) +MONSTER:(';',"giant eel"),(17,08) +MONSTER:(';',"giant eel"),(17,11) +MONSTER:(';',"giant eel"),(48,08) +MONSTER:(';',"giant eel"),(48,11) # The corner rooms treasures -OBJECT:'*',"diamond",(19,06) -OBJECT:'*',"diamond",(20,06) -OBJECT:'*',"diamond",(21,06) -OBJECT:'*',"emerald",(19,13) -OBJECT:'*',"emerald",(20,13) -OBJECT:'*',"emerald",(21,13) -OBJECT:'*',"ruby",(46,06) -OBJECT:'*',"ruby",(47,06) -OBJECT:'*',"ruby",(48,06) -OBJECT:'*',"amethyst",(46,13) -OBJECT:'*',"amethyst",(47,13) -OBJECT:'*',"amethyst",(48,13) +OBJECT:('*',"diamond"),(19,06) +OBJECT:('*',"diamond"),(20,06) +OBJECT:('*',"diamond"),(21,06) +OBJECT:('*',"emerald"),(19,13) +OBJECT:('*',"emerald"),(20,13) +OBJECT:('*',"emerald"),(21,13) +OBJECT:('*',"ruby"),(46,06) +OBJECT:('*',"ruby"),(47,06) +OBJECT:('*',"ruby"),(48,06) +OBJECT:('*',"amethyst"),(46,13) +OBJECT:('*',"amethyst"),(47,13) +OBJECT:('*',"amethyst"),(48,13) diff --git a/dat/medusa.des b/dat/medusa.des index ae65ff6d5..48720d3ba 100644 --- a/dat/medusa.des +++ b/dat/medusa.des @@ -55,28 +55,29 @@ BRANCH:levregion(01,00,79,20),(30,06,46,13) # Non diggable walls NON_DIGGABLE:(30,06,46,13) # Objects -CONTAINER:'`',"statue",(36,10),uncursed,"knight",3,"Perseus" -OBJECT[75%]:'[',"shield of reflection",contained,cursed,+0 -OBJECT[25%]:'[',"levitation boots",contained,random,+0 -OBJECT[50%]:')',"scimitar",contained,blessed,+2 -OBJECT[50%]:'(',"sack",contained +CONTAINER:('`',"statue"),(36,10),uncursed,montype:"knight",3,name:"Perseus" { + [75%]: OBJECT:('[',"shield of reflection"),cursed,+0 + [25%]: OBJECT:('[',"levitation boots"),+0 + [50%]: OBJECT:(')',"scimitar"),blessed,+2 + [50%]: OBJECT:('(',"sack") +} # These aren't really containers, but specifying CONTAINER forces them to be # empty, since CONTAINERs contain only what is explicitly specified. -CONTAINER:'`',"statue",random -CONTAINER:'`',"statue",random -CONTAINER:'`',"statue",random -CONTAINER:'`',"statue",random -CONTAINER:'`',"statue",random -CONTAINER:'`',"statue",random -CONTAINER:'`',"statue",random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +CONTAINER:('`',"statue"),random { } +CONTAINER:('`',"statue"),random { } +CONTAINER:('`',"statue"),random { } +CONTAINER:('`',"statue"),random { } +CONTAINER:('`',"statue"),random { } +CONTAINER:('`',"statue"),random { } +CONTAINER:('`',"statue"),random { } +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -86,27 +87,27 @@ TRAP:random,random TRAP:"board",(38,07) TRAP:"board",(38,12) # Random monsters -MONSTER:'@',"Medusa",(36,10),asleep -MONSTER:';',"giant eel",(11,06) -MONSTER:';',"giant eel",(23,13) -MONSTER:';',"giant eel",(29,02) -MONSTER:';',"jellyfish",(02,02) -MONSTER:';',"jellyfish",(00,08) -MONSTER:';',"jellyfish",(04,18) -MONSTER:'T',"water troll",(51,03) -MONSTER:'T',"water troll",(64,11) -MONSTER:'S',random,(38,07) -MONSTER:'S',random,(38,12) -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random +MONSTER:('@',"Medusa"),(36,10),asleep +MONSTER:(';',"giant eel"),(11,06) +MONSTER:(';',"giant eel"),(23,13) +MONSTER:(';',"giant eel"),(29,02) +MONSTER:(';',"jellyfish"),(02,02) +MONSTER:(';',"jellyfish"),(00,08) +MONSTER:(';',"jellyfish"),(04,18) +MONSTER:('T',"water troll"),(51,03) +MONSTER:('T',"water troll"),(64,11) +MONSTER:'S',(38,07) +MONSTER:'S',(38,12) +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random MAZE:"medusa-2",' ' FLAGS: noteleport @@ -136,7 +137,7 @@ ENDMAP # Dungeon Description REGION:(00,00,74,19),lit,"ordinary" REGION:(02,03,05,16),unlit,"ordinary" -REGION:(61,03,72,16),unlit,"ordinary",unfilled,true +REGION:(61,03,72,16),unlit,"ordinary",unfilled,irregular REGION:(71,08,72,11),unlit,"ordinary" REGION:(67,08,69,11),lit,"ordinary" # Teleport: down to up stairs island, up to Medusa's island @@ -153,28 +154,29 @@ BRANCH:levregion(01,00,79,20),(59,01,73,17) NON_DIGGABLE:(01,02,06,17) NON_DIGGABLE:(60,02,73,17) # Objects -CONTAINER:'`',"statue",(68,10),uncursed,"knight",3,"Perseus" -OBJECT[25%]:'[',"shield of reflection",contained,cursed,+0 -OBJECT[75%]:'[',"levitation boots",contained,random,+0 -OBJECT[50%]:')',"scimitar",contained,blessed,+2 -OBJECT[50%]:'(',"sack",contained -CONTAINER:'`',"statue",(64,08) -CONTAINER:'`',"statue",(65,08) -CONTAINER:'`',"statue",(64,09) -CONTAINER:'`',"statue",(65,09) -CONTAINER:'`',"statue",(64,10) -CONTAINER:'`',"statue",(65,10) -CONTAINER:'`',"statue",(64,11) -CONTAINER:'`',"statue",(65,11) -OBJECT:'`',"boulder",(04,04) -OBJECT:'/',random,(52,09) -OBJECT:'`',"boulder",(52,09) -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +CONTAINER:('`',"statue"),(68,10),uncursed,montype:"knight",3,name:"Perseus" { + [25%]: OBJECT:('[',"shield of reflection"),cursed,+0 + [75%]: OBJECT:('[',"levitation boots"),+0 + [50%]: OBJECT:(')',"scimitar"),blessed,+2 + [50%]: OBJECT:('(',"sack") +} +CONTAINER:('`',"statue"),(64,08) { } +CONTAINER:('`',"statue"),(65,08) { } +CONTAINER:('`',"statue"),(64,09) { } +CONTAINER:('`',"statue"),(65,09) { } +CONTAINER:('`',"statue"),(64,10) { } +CONTAINER:('`',"statue"),(65,10) { } +CONTAINER:('`',"statue"),(64,11) { } +CONTAINER:('`',"statue"),(65,11) { } +OBJECT:('`',"boulder"),(04,04) +OBJECT:'/',(52,09) +OBJECT:('`',"boulder"),(52,09) +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Traps TRAP:"magic",(03,12) TRAP:random,random @@ -182,36 +184,36 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Monsters. -MONSTER:'@',"Medusa",(68,10),asleep -MONSTER:'g',"gremlin",(02,14) -MONSTER:'H',"titan",(02,05) -MONSTER:';',"electric eel",(10,13) -MONSTER:';',"electric eel",(11,13) -MONSTER:';',"electric eel",(10,14) -MONSTER:';',"electric eel",(11,14) -MONSTER:';',"electric eel",(10,15) -MONSTER:';',"electric eel",(11,15) -MONSTER:';',"jellyfish",(01,01) -MONSTER:';',"jellyfish",(00,08) -MONSTER:';',"jellyfish",(04,19) -MONSTER:''',"stone golem",(64,08),asleep -MONSTER:''',"stone golem",(65,08),asleep -MONSTER:''',"stone golem",(64,09),asleep -MONSTER:''',"stone golem",(65,09),asleep -MONSTER:'S',"cobra",(64,10),asleep -MONSTER:'S',"cobra",(65,10),asleep -MONSTER:'A',random,(72,08) -MONSTER:'y',"yellow light",(72,11),asleep -MONSTER:random,random,(17,07) -MONSTER:random,random,(28,11) -MONSTER:random,random,(32,13) -MONSTER:random,random,(49,09) -MONSTER:random,random,(48,07) -MONSTER:random,random,(65,03) -MONSTER:random,random,(70,04) -MONSTER:random,random,(70,15) -MONSTER:random,random,(65,16) -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random +MONSTER:('@',"Medusa"),(68,10),asleep +MONSTER:('g',"gremlin"),(02,14) +MONSTER:('H',"titan"),(02,05) +MONSTER:(';',"electric eel"),(10,13) +MONSTER:(';',"electric eel"),(11,13) +MONSTER:(';',"electric eel"),(10,14) +MONSTER:(';',"electric eel"),(11,14) +MONSTER:(';',"electric eel"),(10,15) +MONSTER:(';',"electric eel"),(11,15) +MONSTER:(';',"jellyfish"),(01,01) +MONSTER:(';',"jellyfish"),(00,08) +MONSTER:(';',"jellyfish"),(04,19) +MONSTER:(''',"stone golem"),(64,08),asleep +MONSTER:(''',"stone golem"),(65,08),asleep +MONSTER:(''',"stone golem"),(64,09),asleep +MONSTER:(''',"stone golem"),(65,09),asleep +MONSTER:('S',"cobra"),(64,10),asleep +MONSTER:('S',"cobra"),(65,10),asleep +MONSTER:'A',(72,08) +MONSTER:('y',"yellow light"),(72,11),asleep +MONSTER:random,(17,07) +MONSTER:random,(28,11) +MONSTER:random,(32,13) +MONSTER:random,(49,09) +MONSTER:random,(48,07) +MONSTER:random,(65,03) +MONSTER:random,(70,04) +MONSTER:random,(70,15) +MONSTER:random,(65,16) +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random diff --git a/dat/mines.des b/dat/mines.des index 8408bbd9d..e9038a200 100644 --- a/dat/mines.des +++ b/dat/mines.des @@ -12,33 +12,33 @@ # specific levels as defined below. # MAZE: "minefill" , ' ' -INIT_MAP: '.' , ' ' , true , true , random , true +INIT_MAP: mines, '.' , ' ' , true , true , random , true NOMAP # STAIR: random, up STAIR: random, down # -OBJECT: '*', random, random -OBJECT: '*', random, random -OBJECT: '*', random, random -OBJECT: '(', random, random -OBJECT: random, random, random -OBJECT: random, random, random -OBJECT: random, random, random +OBJECT: '*', random +OBJECT: '*', random +OBJECT: '*', random +OBJECT: '(', random +OBJECT: random, random +OBJECT: random, random +OBJECT: random, random # -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome lord", random -MONSTER: 'h', "dwarf", random -MONSTER: 'h', "dwarf", random -MONSTER: 'G', random, random -MONSTER: 'G', random, random -MONSTER: 'h', random, random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome lord"), random +MONSTER: ('h', "dwarf"), random +MONSTER: ('h', "dwarf"), random +MONSTER: 'G', random +MONSTER: 'G', random +MONSTER: 'h', random # TRAP: random, random TRAP: random, random @@ -53,78 +53,92 @@ TRAP: random, random # LEVEL: "minetn-1" -ROOM: "ordinary" , lit, (3,3), (center,center), (31,15) -NAME: "town" +ROOM: "ordinary" , lit, (3,3), (center,center), (31,15) { FOUNTAIN: (13, 7) FOUNTAIN: (20, 7) # The Town Watch -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watch captain", random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watch captain"), random, peaceful -SUBROOM: "shop" , lit, (2,2), (3,4), "town" -CHANCE: 90 -DOOR: false, closed, south, random +SUBROOM: "shop" [90%] , lit, (2,2), (3,4) { + ROOMDOOR: false, closed, south, random +} -SUBROOM: "tool shop", lit, (2,9), (3,4), "town" -CHANCE: 90 -DOOR: false, closed, north, random +SUBROOM: "tool shop" [90%], lit, (2,9), (3,4) { + ROOMDOOR: false, closed, north, random +} -SUBROOM: "ordinary", unlit, (6,2), (3,4), "town" -DOOR: false, closed, south, random +SUBROOM: "ordinary", unlit, (6,2), (3,4) { + ROOMDOOR: false, closed, south, random +} -SUBROOM: "ordinary", lit, (6,9), (3,4), "town" -DOOR: false, closed, north, random +SUBROOM: "ordinary", lit, (6,9), (3,4) { + ROOMDOOR: false, closed, north, random +} -SUBROOM: "food shop", lit, (10,2), (2,3), "town" -CHANCE: 90 -DOOR: false, closed, south, random +SUBROOM: "food shop" [90%], lit, (10,2), (2,3) { + ROOMDOOR: false, closed, south, random +} -SUBROOM: "candle shop", lit, (22,2), (3,3), "town" -DOOR: false, closed, south, random +SUBROOM: "candle shop", lit, (22,2), (3,3) { + ROOMDOOR: false, closed, south, random +} -SUBROOM: "ordinary", unlit, (10,10), (2,3), "town" -DOOR: false, locked, east, random -MONSTER: 'G', "gnome", random +SUBROOM: "ordinary", unlit, (10,10), (2,3) { + ROOMDOOR: false, locked, east, random + MONSTER: ('G', "gnome"), random +} -SUBROOM: "ordinary", lit, (19,2), (2,3), "town" -DOOR: false, locked, west, random -MONSTER: 'G', "gnome", random +SUBROOM: "ordinary", lit, (19,2), (2,3) { + ROOMDOOR: false, locked, west, random + MONSTER: ('G', "gnome"), random +} -SUBROOM: "temple", lit, (15,9), (4,4), "town" -DOOR: false, closed, north, random -ALTAR:(02,02),align[0],shrine -MONSTER: 'G', "gnomish wizard", random -MONSTER: 'G', "gnomish wizard", random +SUBROOM: "temple", lit, (15,9), (4,4) { + ROOMDOOR: false, closed, north, random + ALTAR:(02,02),align[0],shrine + MONSTER: ('G', "gnomish wizard"), random + MONSTER: ('G', "gnomish wizard"), random +} -SUBROOM: "ordinary", lit, (22,10), (2,3), "town" -DOOR: false, locked, west, random +SUBROOM: "ordinary", lit, (22,10), (2,3) { + ROOMDOOR: false, locked, west, random +} -SUBROOM: "ordinary", lit, (26,2), (3,3), "town" -DOOR: false, closed, south, random -MONSTER: 'G', "gnome lord", random +SUBROOM: "ordinary", lit, (26,2), (3,3) { + ROOMDOOR: false, closed, south, random + MONSTER: ('G', "gnome lord"), random +} -SUBROOM: "ordinary", unlit, (25,10), (4,3), "town" -DOOR: false, closed, north, random +SUBROOM: "ordinary", unlit, (25,10), (4,3) { + ROOMDOOR: false, closed, north, random +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, up +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, down -TRAP: random, random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, up +} -ROOM: "ordinary" , random, random, random, random -MONSTER: 'h', "dwarf", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, down + TRAP: random, random + MONSTER: ('G', "gnome"), random + MONSTER: ('G', "gnome"), random +} -ROOM: "ordinary" , random, random, random, random -TRAP: random, random -MONSTER: 'G', "gnome", random +ROOM: "ordinary" , random, random, random, random { + MONSTER: ('h', "dwarf"), random +} + +ROOM: "ordinary" , random, random, random, random { + TRAP: random, random + MONSTER: ('G', "gnome"), random +} RANDOM_CORRIDORS @@ -133,94 +147,113 @@ RANDOM_CORRIDORS # "Town Square" # LEVEL: "minetn-2" -ROOM: "ordinary" , lit, (3,3), (center,center), (31,15) -NAME: "town" +ROOM: "ordinary" , lit, (3,3), (center,center), (31,15) { FOUNTAIN: (17, 5) FOUNTAIN: (13, 8) # The Town Watch -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watch captain", random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watch captain"), random, peaceful -SUBROOM: "ordinary", random, (2,0), (2,2), "town" -DOOR: false, closed, west, random +SUBROOM: "ordinary", random, (2,0), (2,2) { + ROOMDOOR: false, closed, west, random +} -SUBROOM: "ordinary", unlit, (5,0), (2,2), "town" -DOOR: false, closed, south, random +SUBROOM: "ordinary", unlit, (5,0), (2,2) { + ROOMDOOR: false, closed, south, random +} -SUBROOM: "ordinary", random, (8,0), (2,2), "town" -DOOR: false, closed, east, random +SUBROOM: "ordinary", random, (8,0), (2,2) { + ROOMDOOR: false, closed, east, random +} -SUBROOM: "ordinary", lit, (16,0), (2,2), "town" -DOOR: false, closed, west, random +SUBROOM: "ordinary", lit, (16,0), (2,2) { + ROOMDOOR: false, closed, west, random +} -SUBROOM: "ordinary", unlit, (19,0), (2,2), "town" -DOOR: false, closed, south, random +SUBROOM: "ordinary", unlit, (19,0), (2,2) { + ROOMDOOR: false, closed, south, random +} -SUBROOM: "ordinary", random, (22,0), (2,2), "town" -DOOR: false, locked, south, random -MONSTER: 'G', "gnome", random +SUBROOM: "ordinary", random, (22,0), (2,2) { + ROOMDOOR: false, locked, south, random + MONSTER: ('G', "gnome"), random +} -SUBROOM: "ordinary", unlit, (25,0), (2,2), "town" -DOOR: false, closed, east, random +SUBROOM: "ordinary", unlit, (25,0), (2,2) { + ROOMDOOR: false, closed, east, random +} -SUBROOM: "ordinary", lit, (2,5), (2,2), "town" -DOOR: false, closed, north, random +SUBROOM: "ordinary", lit, (2,5), (2,2) { + ROOMDOOR: false, closed, north, random +} -SUBROOM: "ordinary", lit, (5,5), (2,2), "town" -DOOR: false, closed, south, random +SUBROOM: "ordinary", lit, (5,5), (2,2) { + ROOMDOOR: false, closed, south, random +} -SUBROOM: "ordinary", random, (8,5), (2,2), "town" -DOOR: false, locked, north, random -MONSTER: 'G', "gnome", random +SUBROOM: "ordinary", random, (8,5), (2,2) { + ROOMDOOR: false, locked, north, random + MONSTER: ('G', "gnome"), random +} -SUBROOM: "shop" , lit, (2,10), (4,3), "town" -CHANCE: 90 -DOOR: false, closed, west, random +SUBROOM: "shop" [90%] , lit, (2,10), (4,3) { + ROOMDOOR: false, closed, west, random +} -SUBROOM: "tool shop", lit, (23,10), (4,3), "town" -CHANCE: 90 -DOOR: false, closed, east, random +SUBROOM: "tool shop" [90%], lit, (23,10), (4,3) { + ROOMDOOR: false, closed, east, random +} -SUBROOM: "food shop", lit, (24,5), (3,4), "town" -CHANCE: 90 -DOOR: false, closed, north, random +SUBROOM: "food shop" [90%], lit, (24,5), (3,4) { + ROOMDOOR: false, closed, north, random +} -SUBROOM: "candle shop", lit, (11,10), (4,3), "town" -DOOR: false, closed, east, random +SUBROOM: "candle shop", lit, (11,10), (4,3) { + ROOMDOOR: false, closed, east, random +} -SUBROOM: "ordinary", unlit, (7,10), (3,3), "town" -DOOR: false, locked, north, random -MONSTER: 'G', "gnome", random +SUBROOM: "ordinary", unlit, (7,10), (3,3) { + ROOMDOOR: false, locked, north, random + MONSTER: ('G', "gnome"), random +} -SUBROOM: "temple", lit, (19,5), (4,4), "town" -DOOR: false, closed, north, random -ALTAR:(02,02),align[0],shrine -MONSTER: 'G', "gnomish wizard", random -MONSTER: 'G', "gnomish wizard", random +SUBROOM: "temple", lit, (19,5), (4,4) { + ROOMDOOR: false, closed, north, random + ALTAR:(02,02),align[0],shrine + MONSTER: ('G', "gnomish wizard"), random + MONSTER: ('G', "gnomish wizard"), random +} -SUBROOM: "ordinary", lit, (18,10), (4,3), "town" -DOOR: false, locked, west, random -MONSTER: 'G', "gnome lord", random +SUBROOM: "ordinary", lit, (18,10), (4,3) { + ROOMDOOR: false, locked, west, random + MONSTER: ('G', "gnome lord"), random +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, up +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, down -TRAP: random, random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, up +} -ROOM: "ordinary" , random, random, random, random -MONSTER: 'h', "dwarf", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, down + TRAP: random, random + MONSTER: ('G', "gnome"), random + MONSTER: ('G', "gnome"), random +} -ROOM: "ordinary" , random, random, random, random -TRAP: random, random -MONSTER: 'G', "gnome", random +ROOM: "ordinary" , random, random, random, random { + MONSTER: ('h', "dwarf"), random +} + +ROOM: "ordinary" , random, random, random, random { + TRAP: random, random + MONSTER: ('G', "gnome"), random +} RANDOM_CORRIDORS @@ -229,89 +262,106 @@ RANDOM_CORRIDORS # "Alley Town" # LEVEL: "minetn-3" -ROOM: "ordinary",lit,(3,3),(center,center),(31,15) -NAME: "town" +ROOM: "ordinary",lit,(3,3),(center,center),(31,15) { FOUNTAIN:(01,06) FOUNTAIN:(29,13) -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watch captain", random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watch captain"), random, peaceful -SUBROOM:"ordinary",random,(2,2),(2,2),"town" -DOOR: false,closed,south,random +SUBROOM:"ordinary",random,(2,2),(2,2) { + ROOMDOOR: false,closed,south,random +} -SUBROOM:"tool shop",lit,(5,3),(2,3),"town" -CHANCE: 30 -DOOR: false,closed,south,random +SUBROOM:"tool shop" [30%], lit,(5,3),(2,3) { + ROOMDOOR: false,closed,south,random +} -SUBROOM:"ordinary",random,(2,10),(2,3),"town" -DOOR: false, locked, north, random -MONSTER: 'G',random,random +SUBROOM:"ordinary",random,(2,10),(2,3) { + ROOMDOOR: false, locked, north, random + MONSTER: 'G',random +} -SUBROOM:"ordinary",random,(5,9),(2,2),"town" -DOOR: false,closed,north,random +SUBROOM:"ordinary",random,(5,9),(2,2) { + ROOMDOOR: false,closed,north,random +} -SUBROOM:"temple",lit,(10,2),(3,4),"town" -DOOR: false,closed,east,random -ALTAR:(1,1),align[0],shrine -MONSTER: 'G', "gnomish wizard", random -MONSTER: 'G', "gnomish wizard", random +SUBROOM:"temple",lit,(10,2),(3,4) { + ROOMDOOR: false,closed,east,random + ALTAR:(1,1),align[0],shrine + MONSTER: ('G', "gnomish wizard"), random + MONSTER: ('G', "gnomish wizard"), random +} -SUBROOM:"ordinary",random,(11,7),(2,2),"town" -DOOR: false,closed,west,random +SUBROOM:"ordinary",random,(11,7),(2,2) { + ROOMDOOR: false,closed,west,random +} -SUBROOM:"shop",lit,(10,10),(3,3),"town" -DOOR:false,closed,west,random +SUBROOM:"shop",lit,(10,10),(3,3) { + ROOMDOOR:false,closed,west,random +} -SUBROOM:"ordinary",random,(14,8),(2,2),"town" -DOOR:false,locked,north,random -MONSTER: 'G',random,random +SUBROOM:"ordinary",random,(14,8),(2,2) { + ROOMDOOR:false,locked,north,random + MONSTER: 'G',random +} -SUBROOM:"ordinary",random,(14,11),(2,2),"town" -DOOR:false,closed,south,random +SUBROOM:"ordinary",random,(14,11),(2,2) { + ROOMDOOR:false,closed,south,random +} -SUBROOM:"tool shop",lit,(17,10),(3,3),"town" -CHANCE:40 -DOOR:false,closed,north,random +SUBROOM:"tool shop" [40%],lit,(17,10),(3,3) { + ROOMDOOR:false,closed,north,random +} -SUBROOM:"ordinary",random,(21,11),(2,2),"town" -DOOR:false,locked,east,random -MONSTER:'G',random,random +SUBROOM:"ordinary",random,(21,11),(2,2) { + ROOMDOOR:false,locked,east,random + MONSTER:'G',random +} -SUBROOM:"food shop",lit,(26,8),(3,2),"town" -CHANCE:90 -DOOR:false,closed,west,random +SUBROOM:"food shop" [90%],lit,(26,8),(3,2) { + ROOMDOOR:false,closed,west,random +} -SUBROOM:"ordinary",random,(16,2),(2,2),"town" -DOOR:false,closed,west,random +SUBROOM:"ordinary",random,(16,2),(2,2) { + ROOMDOOR:false,closed,west,random +} -SUBROOM:"ordinary",random,(19,2),(2,2),"town" -DOOR:false,closed,north,random +SUBROOM:"ordinary",random,(19,2),(2,2) { + ROOMDOOR:false,closed,north,random +} -SUBROOM:"wand shop",lit,(19,5),(3,2),"town" -CHANCE:30 -DOOR:false,closed,west,random +SUBROOM:"wand shop" [30%],lit,(19,5),(3,2) { + ROOMDOOR:false,closed,west,random +} -SUBROOM: "candle shop",lit,(25,2),(3,3),"town" -DOOR:false,closed,south,random +SUBROOM: "candle shop",lit,(25,2),(3,3) { + ROOMDOOR:false,closed,south,random +} -ROOM: "ordinary", random, random, random, random -STAIR: random, up +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, down -TRAP: random, random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random +ROOM: "ordinary", random, random, random, random { + STAIR: random, up +} -ROOM: "ordinary" , random, random, random, random -MONSTER: 'h', "dwarf", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, down + TRAP: random, random + MONSTER: ('G', "gnome"), random + MONSTER: ('G', "gnome"), random +} -ROOM: "ordinary" , random, random, random, random -TRAP: random, random -MONSTER: 'G', "gnome", random +ROOM: "ordinary" , random, random, random, random { + MONSTER: ('h', "dwarf"), random +} + +ROOM: "ordinary" , random, random, random, random { + TRAP: random, random + MONSTER: ('G', "gnome"), random +} RANDOM_CORRIDORS @@ -320,80 +370,94 @@ RANDOM_CORRIDORS # "College Town" # LEVEL: "minetn-4" -ROOM: "ordinary",lit,(3,3),(center,center),(30,15) -NAME: "town" +ROOM: "ordinary",lit,(3,3),(center,center),(30,15) { FOUNTAIN:(08,07) FOUNTAIN:(18,07) -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watch captain", random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watch captain"), random, peaceful -SUBROOM:"book shop",lit,(4,2),(3,3),"town" -DOOR: false,closed,south,random +SUBROOM:"book shop",lit,(4,2),(3,3) { + ROOMDOOR: false,closed,south,random +} -SUBROOM:"ordinary",random,(8,2),(2,2),"town" -DOOR: false,closed,south,random +SUBROOM:"ordinary",random,(8,2),(2,2) { + ROOMDOOR: false,closed,south,random +} -SUBROOM:"temple",lit,(11,3),(5,4),"town" -DOOR: false,closed,south,random -ALTAR:(2,1),align[0],shrine -MONSTER: 'G', "gnomish wizard", random -MONSTER: 'G', "gnomish wizard", random +SUBROOM:"temple",lit,(11,3),(5,4) { + ROOMDOOR: false,closed,south,random + ALTAR:(2,1),align[0],shrine + MONSTER: ('G', "gnomish wizard"), random + MONSTER: ('G', "gnomish wizard"), random +} -SUBROOM:"ordinary",random,(19,2),(2,2),"town" -DOOR: false,closed,south,random -MONSTER: 'G', random, random +SUBROOM:"ordinary",random,(19,2),(2,2) { + ROOMDOOR: false,closed,south,random + MONSTER: 'G', random +} -SUBROOM:"candle shop",lit,(22,2),(3,3),"town" -DOOR:false,closed,south,random +SUBROOM:"candle shop",lit,(22,2),(3,3) { + ROOMDOOR:false,closed,south,random +} -SUBROOM:"ordinary",random,(26,2),(2,2),"town" -DOOR:false,locked,east,random -MONSTER: 'G',random,random +SUBROOM:"ordinary",random,(26,2),(2,2) { + ROOMDOOR:false,locked,east,random + MONSTER: 'G',random +} -SUBROOM:"tool shop",lit,(4,10),(3,3),"town" -CHANCE:90 -DOOR:false,closed,north,random +SUBROOM:"tool shop" [90%],lit,(4,10),(3,3) { + ROOMDOOR:false,closed,north,random +} -SUBROOM:"ordinary",random,(8,11),(2,2),"town" -DOOR:false,locked,south,random -MONSTER: 'k',"kobold shaman",random -MONSTER: 'k',"kobold shaman",random -MONSTER: 'f',"kitten",random -MONSTER: 'f',random,random +SUBROOM:"ordinary",random,(8,11),(2,2) { + ROOMDOOR:false,locked,south,random + MONSTER: ('k',"kobold shaman"),random + MONSTER: ('k',"kobold shaman"),random + MONSTER: ('f',"kitten"),random + MONSTER: 'f',random +} -SUBROOM:"food shop",lit,(11,11),(3,2),"town" -CHANCE:90 -DOOR:false,closed,east,random +SUBROOM:"food shop" [90%],lit,(11,11),(3,2) { + ROOMDOOR:false,closed,east,random +} -SUBROOM:"ordinary",random,(17,11),(2,2),"town" -DOOR:false,closed,west,random +SUBROOM:"ordinary",random,(17,11),(2,2) { + ROOMDOOR:false,closed,west,random +} -SUBROOM:"ordinary",random,(20,10),(2,2),"town" -DOOR:false,locked,north,random -MONSTER:'G',random,random +SUBROOM:"ordinary",random,(20,10),(2,2) { + ROOMDOOR:false,locked,north,random + MONSTER:'G',random +} -SUBROOM:"shop",lit,(23,10),(3,3),"town" -CHANCE:90 -DOOR:false,closed,north,random +SUBROOM:"shop" [90%],lit,(23,10),(3,3) { + ROOMDOOR:false,closed,north,random +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, up +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, down -TRAP: random, random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, up +} -ROOM: "ordinary" , random, random, random, random -MONSTER: 'h', "dwarf", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, down + TRAP: random, random + MONSTER: ('G', "gnome"), random + MONSTER: ('G', "gnome"), random +} -ROOM: "ordinary" , random, random, random, random -TRAP: random, random -MONSTER: 'G', "gnome", random +ROOM: "ordinary" , random, random, random, random { + MONSTER: ('h', "dwarf"), random +} + +ROOM: "ordinary" , random, random, random, random { + TRAP: random, random + MONSTER: ('G', "gnome"), random +} RANDOM_CORRIDORS @@ -442,22 +506,22 @@ REGION:(37,13,39,17),lit,"ordinary" REGION:(36,14,40,17),lit,"ordinary" REGION:(59,02,72,10),lit,"ordinary" -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watch captain", random, peaceful -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome lord", random -MONSTER: 'G', "gnome lord", random -MONSTER: 'h', "dwarf", random -MONSTER: 'h', "dwarf", random -MONSTER: 'h', "dwarf", random +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watch captain"), random, peaceful +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome lord"), random +MONSTER: ('G', "gnome lord"), random +MONSTER: ('h', "dwarf"), random +MONSTER: ('h', "dwarf"), random +MONSTER: ('h', "dwarf"), random # The shops REGION:(25,17,28,19),lit,"candle shop" @@ -471,14 +535,14 @@ DOOR:closed,(07,11) # Gnome homes DOOR:closed,(04,14) DOOR:locked,(01,17) -MONSTER: 'G', "gnomish wizard", (02,19) +MONSTER: ('G', "gnomish wizard"), (02,19) DOOR:locked,(20,16) -MONSTER: 'G', random, (20,18) +MONSTER: 'G', (20,18) DOOR:random,(21,14) DOOR:random,(25,14) DOOR:random,(42,08) DOOR:locked,(40,05) -MONSTER: 'G', random, (38,07) +MONSTER: 'G', (38,07) DOOR:random,(59,03) DOOR:random,(58,06) DOOR:random,(63,03) @@ -487,15 +551,15 @@ DOOR:locked,(71,03) DOOR:locked,(71,06) DOOR:closed,(69,04) DOOR:closed,(67,16) -MONSTER: 'G', "gnomish wizard", (67,14) -OBJECT: '=', random, (70,14) +MONSTER: ('G', "gnomish wizard"), (67,14) +OBJECT: '=', (70,14) DOOR:locked,(69,18) -MONSTER: 'G', "gnome lord", (71,19) +MONSTER: ('G', "gnome lord"), (71,19) DOOR:locked,(73,18) -OBJECT: '(', "chest", (73,19) +OBJECT: ('(', "chest"), (73,19) DOOR:locked,(50,06) -OBJECT: '(', random, (50,03) -OBJECT: '`', "statue", (38,15), "gnome king", 1 +OBJECT: '(', (50,03) +OBJECT: ('`', "statue"), (38,15), montype:"gnome king", 1 # Temple REGION:(29,02,33,04),lit,"temple" DOOR:closed,(31,05) @@ -505,7 +569,7 @@ ALTAR:(31,03),align[0],shrine # "Bustling Town" by Kelly Bailey # MAZE: "minetn-6",' ' -INIT_MAP:'.','-',true,true,lit,true +INIT_MAP:mines,'.','-',true,true,lit,true GEOMETRY:center,top MAP .-----................----------------.- @@ -557,135 +621,153 @@ DOOR:closed,(31,3) DOOR:closed,(35,3) DOOR:closed,(33,7) -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", (14,6) -MONSTER: 'G', "gnome lord", (14,5) -MONSTER: 'G', "gnome", (27,8) -MONSTER: 'G', "gnome lord", random -MONSTER: 'G', "gnome lord", random -MONSTER: 'h', "dwarf", random -MONSTER: 'h', "dwarf", random -MONSTER: 'h', "dwarf", random -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watch captain", random, peaceful -MONSTER: '@', "watch captain", random, peaceful +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), random +MONSTER: ('G', "gnome"), (14,6) +MONSTER: ('G', "gnome lord"), (14,5) +MONSTER: ('G', "gnome"), (27,8) +MONSTER: ('G', "gnome lord"), random +MONSTER: ('G', "gnome lord"), random +MONSTER: ('h', "dwarf"), random +MONSTER: ('h', "dwarf"), random +MONSTER: ('h', "dwarf"), random +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watch captain"), random, peaceful +MONSTER: ('@', "watch captain"), random, peaceful # "Bazaar Town" by Kelly Bailey # LEVEL: "minetn-7" -ROOM: "ordinary" , lit, (3,3), (center,center), (30,15) -NAME: "town" +ROOM: "ordinary" , lit, (3,3), (center,center), (30,15) { FOUNTAIN: (12, 07) FOUNTAIN: (11, 13) -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watchman", random, peaceful -MONSTER: '@', "watch captain", random, peaceful -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome lord",random -MONSTER:'Y',"monkey",random -MONSTER:'Y',"monkey",random +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watch captain"), random, peaceful +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome lord"),random +MONSTER:('Y',"monkey"),random +MONSTER:('Y',"monkey"),random -SUBROOM: "ordinary", random, (2,2), (4,2), "town" -DOOR: false, closed, south, random +SUBROOM: "ordinary", random, (2,2), (4,2) { + ROOMDOOR: false, closed, south, random +} -SUBROOM: "ordinary", random, (7,2), (2,2), "town" -DOOR: false, closed, north, random +SUBROOM: "ordinary", random, (7,2), (2,2) { + ROOMDOOR: false, closed, north, random +} -SUBROOM: "ordinary", random, (7,5), (2,2), "town" -DOOR: false, closed, south, random +SUBROOM: "ordinary", random, (7,5), (2,2) { + ROOMDOOR: false, closed, south, random +} -SUBROOM: "ordinary", lit, (10,2), (3,4), "town" -MONSTER:'G',"gnome",random -MONSTER:'Y',"monkey",random -MONSTER:'Y',"monkey",random -MONSTER:'Y',"monkey",random -DOOR: false, closed, south, random +SUBROOM: "ordinary", lit, (10,2), (3,4) { + MONSTER:('G',"gnome"),random + MONSTER:('Y',"monkey"),random + MONSTER:('Y',"monkey"),random + MONSTER:('Y',"monkey"),random + ROOMDOOR: false, closed, south, random +} -SUBROOM: "ordinary", random, (14,2), (4,2), "town" -DOOR: false, closed, south, 0 -MONSTER: 'n', random, random +SUBROOM: "ordinary", random, (14,2), (4,2) { + ROOMDOOR: false, closed, south, 0 + MONSTER: 'n', random +} -SUBROOM: "ordinary", random, (16,5), (2,2), "town" -DOOR: false, closed, south, random +SUBROOM: "ordinary", random, (16,5), (2,2) { + ROOMDOOR: false, closed, south, random +} -SUBROOM: "ordinary", unlit, (19,2), (2,2), "town" -DOOR: false, locked, east, random -MONSTER: 'G',"gnome king",random +SUBROOM: "ordinary", unlit, (19,2), (2,2) { + ROOMDOOR: false, locked, east, random + MONSTER: ('G',"gnome king"),random +} -SUBROOM: "food shop", lit, (19,5), (2,3), "town" -CHANCE: 50 -DOOR: false, closed, south, random +SUBROOM: "food shop" [50%], lit, (19,5), (2,3) { + ROOMDOOR: false, closed, south, random +} -SUBROOM: "ordinary", random, (2,7), (2,2), "town" -DOOR: false, closed, east, random +SUBROOM: "ordinary", random, (2,7), (2,2) { + ROOMDOOR: false, closed, east, random +} -SUBROOM: "tool shop", lit, (2,10), (2,3), "town" -CHANCE: 50 -DOOR: false, closed, south, random +SUBROOM: "tool shop" [50%], lit, (2,10), (2,3) { + ROOMDOOR: false, closed, south, random +} -SUBROOM: "candle shop", lit, (5,10),(3,3), "town" -DOOR: false, closed, north, random +SUBROOM: "candle shop", lit, (5,10),(3,3) { + ROOMDOOR: false, closed, north, random +} -SUBROOM: "ordinary", random, (11,10), (2,2), "town" -DOOR: false, locked, west, random -MONSTER: 'G',random,random +SUBROOM: "ordinary", random, (11,10), (2,2) { + ROOMDOOR: false, locked, west, random + MONSTER: 'G',random +} -SUBROOM: "shop", lit, (14,10), (2,3), "town" -CHANCE: 60 -DOOR: false, closed, north, random +SUBROOM: "shop" [60%], lit, (14,10), (2,3) { + ROOMDOOR: false, closed, north, random +} -SUBROOM: "ordinary", random, (17,11), (4,2), "town" -DOOR: false, closed, north, random +SUBROOM: "ordinary", random, (17,11), (4,2) { + ROOMDOOR: false, closed, north, random +} -SUBROOM: "ordinary", random, (22,11), (2,2), "town" -DOOR: false, closed, south, random -SINK: (00,00) +SUBROOM: "ordinary", random, (22,11), (2,2) { + ROOMDOOR: false, closed, south, random + SINK: (00,00) +} -SUBROOM: "food shop", lit, (25,11), (3,2), "town" -CHANCE: 50 -DOOR: false, closed, east, random +SUBROOM: "food shop" [50%], lit, (25,11), (3,2) { + ROOMDOOR: false, closed, east, random +} -SUBROOM: "tool shop", lit, (25,2), (3,3), "town" -CHANCE: 30 -DOOR: false, closed, west, random +SUBROOM: "tool shop" [30%], lit, (25,2), (3,3) { + ROOMDOOR: false, closed, west, random +} -SUBROOM: "temple", lit, (24,6), (4,4), "town" -DOOR: false, closed, west, random -ALTAR:(02,01),align[0],shrine -MONSTER: 'G', "gnomish wizard", random -MONSTER: 'G', "gnomish wizard", random +SUBROOM: "temple", lit, (24,6), (4,4) { + ROOMDOOR: false, closed, west, random + ALTAR:(02,01),align[0],shrine + MONSTER: ('G', "gnomish wizard"), random + MONSTER: ('G', "gnomish wizard"), random +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, up +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, down -TRAP: random, random -MONSTER: 'G', "gnome", random -MONSTER: 'G', "gnome", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, up +} -ROOM: "ordinary" , random, random, random, random -MONSTER: 'h', "dwarf", random - -ROOM: "ordinary" , random, random, random, random -TRAP: random, random -MONSTER: 'G', "gnome", random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, down + TRAP: random, random + MONSTER: ('G', "gnome"), random + MONSTER: ('G', "gnome"), random +} + +ROOM: "ordinary" , random, random, random, random { + MONSTER: ('h', "dwarf"), random +} + +ROOM: "ordinary" , random, random, random, random { + TRAP: random, random + MONSTER: ('G', "gnome"), random +} RANDOM_CORRIDORS - + # Mine end level variant 1 # "Mimic of the Mines" @@ -715,8 +797,10 @@ MAP ENDMAP # Dungeon Description -RANDOM_PLACES:(08,16),(13,07),(21,08),(41,14),(50,04),(50,16),(66,01) -REGION:(26,01,32,01),unlit,"ordinary",filled,true +$place = { (08,16),(13,07),(21,08),(41,14),(50,04),(50,16),(66,01) } +SHUFFLE: $place + +REGION:(26,01,32,01),unlit,"ordinary",filled,irregular REGION:(20,08,21,08),unlit,"ordinary" REGION:(23,08,25,08),unlit,"ordinary" # Secret doors @@ -732,42 +816,42 @@ STAIR:(36,04),up # Non diggable walls NON_DIGGABLE:(00,00,74,17) # Niches -# Note: place[6] empty -OBJECT:'*',"diamond",place[0] -OBJECT:'*',"emerald",place[0] -OBJECT:'*',"worthless piece of violet glass",place[0] -MONSTER:'m',random,place[0], m_object "luckstone" -OBJECT:'*',"worthless piece of white glass",place[1] -OBJECT:'*',"emerald",place[1] -OBJECT:'*',"amethyst",place[1] -MONSTER:'m',random,place[1], m_object "loadstone" -OBJECT:'*',"diamond",place[2] -OBJECT:'*',"worthless piece of green glass",place[2] -OBJECT:'*',"amethyst",place[2] -MONSTER:'m',random,place[2], m_object "flint" -OBJECT:'*',"worthless piece of white glass",place[3] -OBJECT:'*',"emerald",place[3] -OBJECT:'*',"worthless piece of violet glass",place[3] -MONSTER:'m',random,place[3], m_object "touchstone" -OBJECT:'*',"worthless piece of red glass",place[4] -OBJECT:'*',"ruby",place[4] -OBJECT:'*',"loadstone",place[4] -OBJECT:'*',"ruby",place[5] -OBJECT:'*',"worthless piece of red glass",place[5] -OBJECT:'*',"luckstone",place[5] +# Note: $place[6] empty +OBJECT:('*',"diamond"),$place[0] +OBJECT:('*',"emerald"),$place[0] +OBJECT:('*',"worthless piece of violet glass"),$place[0] +MONSTER:'m',$place[0], m_object "luckstone" +OBJECT:('*',"worthless piece of white glass"),$place[1] +OBJECT:('*',"emerald"),$place[1] +OBJECT:('*',"amethyst"),$place[1] +MONSTER:'m',$place[1], m_object "loadstone" +OBJECT:('*',"diamond"),$place[2] +OBJECT:('*',"worthless piece of green glass"),$place[2] +OBJECT:('*',"amethyst"),$place[2] +MONSTER:'m',$place[2], m_object "flint" +OBJECT:('*',"worthless piece of white glass"),$place[3] +OBJECT:('*',"emerald"),$place[3] +OBJECT:('*',"worthless piece of violet glass"),$place[3] +MONSTER:'m',$place[3], m_object "touchstone" +OBJECT:('*',"worthless piece of red glass"),$place[4] +OBJECT:('*',"ruby"),$place[4] +OBJECT:('*',"loadstone"),$place[4] +OBJECT:('*',"ruby"),$place[5] +OBJECT:('*',"worthless piece of red glass"),$place[5] +OBJECT:('*',"luckstone"),$place[5] # Random objects -OBJECT:'*',random,random -OBJECT:'*',random,random -OBJECT:'*',random,random -OBJECT:'*',random,random -OBJECT:'*',random,random -OBJECT:'*',random,random -OBJECT:'*',random,random -OBJECT:'(',random,random -OBJECT:'(',random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:'*',random +OBJECT:'*',random +OBJECT:'*',random +OBJECT:'*',random +OBJECT:'*',random +OBJECT:'*',random +OBJECT:'*',random +OBJECT:'(',random +OBJECT:'(',random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -776,27 +860,27 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters -MONSTER:'G',"gnome king",random -MONSTER:'G',"gnome lord",random -MONSTER:'G',"gnome lord",random -MONSTER:'G',"gnome lord",random -MONSTER:'G',"gnomish wizard",random -MONSTER:'G',"gnomish wizard",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'h',"hobbit",random -MONSTER:'h',"hobbit",random -MONSTER:'h',"dwarf",random -MONSTER:'h',"dwarf",random -MONSTER:'h',"dwarf",random -MONSTER:'h',random,random +MONSTER:('G',"gnome king"),random +MONSTER:('G',"gnome lord"),random +MONSTER:('G',"gnome lord"),random +MONSTER:('G',"gnome lord"),random +MONSTER:('G',"gnomish wizard"),random +MONSTER:('G',"gnomish wizard"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('h',"hobbit"),random +MONSTER:('h',"hobbit"),random +MONSTER:('h',"dwarf"),random +MONSTER:('h',"dwarf"),random +MONSTER:('h',"dwarf"),random +MONSTER:'h',random # Mine end level variant 2 @@ -849,47 +933,47 @@ NON_DIGGABLE:(53,14,61,14) # the Trespassers sign is a long-running joke ENGRAVING:(12,03),engrave,"You are now entering the Gnome King's wine cellar." ENGRAVING:(12,04),engrave,"Trespassers will be persecuted!" -OBJECT:'!',"booze",(10,07) -OBJECT:'!',"booze",(10,07) -OBJECT:'!',random,(10,07) -OBJECT:'!',"booze",(10,08) -OBJECT:'!',"booze",(10,08) -OBJECT:'!',random,(10,08) -OBJECT:'!',"booze",(10,09) -OBJECT:'!',"booze",(10,09) -OBJECT:'!',"object detection",(10,09) +OBJECT:('!',"booze"),(10,07) +OBJECT:('!',"booze"),(10,07) +OBJECT:'!',(10,07) +OBJECT:('!',"booze"),(10,08) +OBJECT:('!',"booze"),(10,08) +OBJECT:'!',(10,08) +OBJECT:('!',"booze"),(10,09) +OBJECT:('!',"booze"),(10,09) +OBJECT:('!',"object detection"),(10,09) # Objects # The Treasure chamber... -OBJECT:'*',"diamond",(69,04) -OBJECT:'*',random,(69,04) -OBJECT:'*',"diamond",(69,04) -OBJECT:'*',random,(69,04) -OBJECT:'*',"emerald",(70,04) -OBJECT:'*',random,(70,04) -OBJECT:'*',"emerald",(70,04) -OBJECT:'*',random,(70,04) -OBJECT:'*',"emerald",(69,05) -OBJECT:'*',random,(69,05) -OBJECT:'*',"ruby",(69,05) -OBJECT:'*',random,(69,05) -OBJECT:'*',"ruby",(70,05) -OBJECT:'*',"amethyst",(70,05) -OBJECT:'*',random,(70,05) -OBJECT:'*',"amethyst",(70,05) -OBJECT:'*',"luckstone",(70,05) +OBJECT:('*',"diamond"),(69,04) +OBJECT:'*',(69,04) +OBJECT:('*',"diamond"),(69,04) +OBJECT:'*',(69,04) +OBJECT:('*',"emerald"),(70,04) +OBJECT:'*',(70,04) +OBJECT:('*',"emerald"),(70,04) +OBJECT:'*',(70,04) +OBJECT:('*',"emerald"),(69,05) +OBJECT:'*',(69,05) +OBJECT:('*',"ruby"),(69,05) +OBJECT:'*',(69,05) +OBJECT:('*',"ruby"),(70,05) +OBJECT:('*',"amethyst"),(70,05) +OBJECT:'*',(70,05) +OBJECT:('*',"amethyst"),(70,05) +OBJECT:('*',"luckstone"),(70,05) # Scattered gems... -OBJECT:'*',random,random -OBJECT:'*',random,random -OBJECT:'*',random,random -OBJECT:'*',random,random -OBJECT:'*',random,random -OBJECT:'*',random,random -OBJECT:'*',random,random -OBJECT:'(',random,random -OBJECT:'(',random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:'*',random +OBJECT:'*',random +OBJECT:'*',random +OBJECT:'*',random +OBJECT:'*',random +OBJECT:'*',random +OBJECT:'*',random +OBJECT:'(',random +OBJECT:'(',random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random # Random traps TRAP:random,random TRAP:random,random @@ -898,27 +982,27 @@ TRAP:random,random TRAP:random,random TRAP:random,random # Random monsters. -MONSTER:'G',"gnome king",random -MONSTER:'G',"gnome lord",random -MONSTER:'G',"gnome lord",random -MONSTER:'G',"gnome lord",random -MONSTER:'G',"gnomish wizard",random -MONSTER:'G',"gnomish wizard",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'G',"gnome",random -MONSTER:'h',"hobbit",random -MONSTER:'h',"hobbit",random -MONSTER:'h',"dwarf",random -MONSTER:'h',"dwarf",random -MONSTER:'h',"dwarf",random -MONSTER:'h',random,random +MONSTER:('G',"gnome king"),random +MONSTER:('G',"gnome lord"),random +MONSTER:('G',"gnome lord"),random +MONSTER:('G',"gnome lord"),random +MONSTER:('G',"gnomish wizard"),random +MONSTER:('G',"gnomish wizard"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('h',"hobbit"),random +MONSTER:('h',"hobbit"),random +MONSTER:('h',"dwarf"),random +MONSTER:('h',"dwarf"),random +MONSTER:('h',"dwarf"),random +MONSTER:'h',random # "Catacombs" by Kelly Bailey @@ -947,7 +1031,9 @@ MAP --|. - - - - - - - -- - - - -- . - - - --- - - - . . - - - - -- - - - - - - ENDMAP -RANDOM_PLACES:(1,15),(68,6),(1,13) +$place = { (1,15),(68,6),(1,13) } +SHUFFLE: $place + NON_DIGGABLE:(67,3,73,7) NON_DIGGABLE:(0,12,2,16) FOUNTAIN:(12,08) @@ -962,36 +1048,36 @@ MAZEWALK:(36,8),west STAIR:(42,8),up # Objects -OBJECT:'*',"diamond",random -OBJECT:'*',random,random -OBJECT:'*',"diamond",random -OBJECT:'*',random,random -OBJECT:'*',"emerald",random -OBJECT:'*',random,random -OBJECT:'*',"emerald",random -OBJECT:'*',random,random -OBJECT:'*',"emerald",random -OBJECT:'*',random,random -OBJECT:'*',"ruby",random -OBJECT:'*',random,random -OBJECT:'*',"ruby",random -OBJECT:'*',"amethyst",random -OBJECT:'*',random,random -OBJECT:'*',"amethyst",random -OBJECT:'*',"luckstone",place[0] -OBJECT:'*',"flint",place[1] -OBJECT:'?',random,random -OBJECT:'?',random,random -OBJECT:'?',random,random -OBJECT:'?',random,random -OBJECT:'?',random,random -OBJECT:'+',random,random -OBJECT:'+',random,random -OBJECT:'+',random,random -OBJECT:'+',random,random -OBJECT:random,random,random -OBJECT:random,random,random -OBJECT:random,random,random +OBJECT:('*',"diamond"),random +OBJECT:'*',random +OBJECT:('*',"diamond"),random +OBJECT:'*',random +OBJECT:('*',"emerald"),random +OBJECT:'*',random +OBJECT:('*',"emerald"),random +OBJECT:'*',random +OBJECT:('*',"emerald"),random +OBJECT:'*',random +OBJECT:('*',"ruby"),random +OBJECT:'*',random +OBJECT:('*',"ruby"),random +OBJECT:('*',"amethyst"),random +OBJECT:'*',random +OBJECT:('*',"amethyst"),random +OBJECT:('*',"luckstone"),$place[0] +OBJECT:('*',"flint"),$place[1] +OBJECT:'?',random +OBJECT:'?',random +OBJECT:'?',random +OBJECT:'?',random +OBJECT:'?',random +OBJECT:'+',random +OBJECT:'+',random +OBJECT:'+',random +OBJECT:'+',random +OBJECT:random,random +OBJECT:random,random +OBJECT:random,random TRAP:random,random TRAP:random,random TRAP:random,random @@ -1000,25 +1086,25 @@ TRAP:random,random TRAP:random,random TRAP:random,random # One-time annoyance factor -TRAP:"level teleport",place[0] -TRAP:"level teleport",place[1] -MONSTER:'M',random,random -MONSTER:'M',random,random -MONSTER:'M',random,random -MONSTER:'M',random,random -MONSTER:'M',random,random -MONSTER:'M',"ettin mummy",random -MONSTER:'V',random,random -MONSTER:'Z',random,random -MONSTER:'Z',random,random -MONSTER:'Z',random,random -MONSTER:'Z',random,random -MONSTER:'Z',random,random -MONSTER:'V',random,random -MONSTER:'e',random,random -MONSTER:'e',random,random -MONSTER:'e',random,random -MONSTER:'e',random,random +TRAP:"level teleport",$place[0] +TRAP:"level teleport",$place[1] +MONSTER:'M',random +MONSTER:'M',random +MONSTER:'M',random +MONSTER:'M',random +MONSTER:'M',random +MONSTER:('M',"ettin mummy"),random +MONSTER:'V',random +MONSTER:'Z',random +MONSTER:'Z',random +MONSTER:'Z',random +MONSTER:'Z',random +MONSTER:'Z',random +MONSTER:'V',random +MONSTER:'e',random +MONSTER:'e',random +MONSTER:'e',random +MONSTER:'e',random # end mines.des diff --git a/dat/oracle.des b/dat/oracle.des index 72da0401f..2b7fd8c33 100644 --- a/dat/oracle.des +++ b/dat/oracle.des @@ -8,51 +8,57 @@ LEVEL: "oracle" -ROOM: "ordinary" , lit, (3,3), (center,center), (11,9) -NAME: "central" -OBJECT:'`',"statue",(0,0),"forest centaur",1 -OBJECT:'`',"statue",(0,8),"mountain centaur",1 -OBJECT:'`',"statue",(10,0),"mountain centaur",1 -OBJECT:'`',"statue",(10,8),"forest centaur",1 -OBJECT:'`',"statue",(5,1),"plains centaur",1 -OBJECT:'`',"statue",(5,7),"plains centaur",1 -OBJECT:'`',"statue",(2,4),"plains centaur",1 -OBJECT:'`',"statue",(8,4),"plains centaur",1 -MONSTER: random, random, random -MONSTER: random, random, random +ROOM: "ordinary" , lit, (3,3), (center,center), (11,9) { + OBJECT:('`',"statue"),(0,0),montype:'C',1 + OBJECT:('`',"statue"),(0,8),montype:'C',1 + OBJECT:('`',"statue"),(10,0),montype:'C',1 + OBJECT:('`',"statue"),(10,8),montype:'C',1 + OBJECT:('`',"statue"),(5,1),montype:'C',1 + OBJECT:('`',"statue"),(5,7),montype:'C',1 + OBJECT:('`',"statue"),(2,4),montype:'C',1 + OBJECT:('`',"statue"),(8,4),montype:'C',1 + MONSTER: random, random + MONSTER: random, random -SUBROOM: "delphi" , lit , (4,3) , (3,3), "central" -FOUNTAIN: (0, 1) -FOUNTAIN: (1, 0) -FOUNTAIN: (1, 2) -FOUNTAIN: (2, 1) -MONSTER: '@', "Oracle", (1,1) -DOOR: false , nodoor , random, random + SUBROOM: "delphi" , lit , (4,3) , (3,3) { + FOUNTAIN: (0, 1) + FOUNTAIN: (1, 0) + FOUNTAIN: (1, 2) + FOUNTAIN: (2, 1) + MONSTER: ('@', "Oracle"), (1,1) + ROOMDOOR: false , nodoor , random, random + } +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, up -OBJECT: random,random,random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, up + OBJECT: random,random +} -ROOM: "ordinary" , random, random, random, random -STAIR: random, down -OBJECT: random, random, random -TRAP: random, random -MONSTER: random, random, random -MONSTER: random, random, random +ROOM: "ordinary" , random, random, random, random { + STAIR: random, down + OBJECT: random, random + TRAP: random, random + MONSTER: random, random + MONSTER: random, random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -OBJECT: random, random, random -MONSTER: random, random, random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + OBJECT: random, random + MONSTER: random, random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -MONSTER: random, random, random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + MONSTER: random, random +} -ROOM: "ordinary" , random, random, random, random -OBJECT: random, random, random -TRAP: random, random -MONSTER: random, random, random +ROOM: "ordinary" , random, random, random, random { + OBJECT: random, random + TRAP: random, random + MONSTER: random, random +} RANDOM_CORRIDORS diff --git a/dat/sokoban.des b/dat/sokoban.des index 21eb63de5..f5aa0bdff 100644 --- a/dat/sokoban.des +++ b/dat/sokoban.des @@ -60,18 +60,18 @@ NON_DIGGABLE:(00,00,13,12) NON_PASSWALL:(00,00,13,12) # Boulders -OBJECT:'`',"boulder",(02,02) -OBJECT:'`',"boulder",(02,03) +OBJECT:('`',"boulder"),(02,02) +OBJECT:('`',"boulder"),(02,03) # -OBJECT:'`',"boulder",(10,02) -OBJECT:'`',"boulder",(09,03) -OBJECT:'`',"boulder",(10,04) +OBJECT:('`',"boulder"),(10,02) +OBJECT:('`',"boulder"),(09,03) +OBJECT:('`',"boulder"),(10,04) # -OBJECT:'`',"boulder",(08,07) -OBJECT:'`',"boulder",(09,08) -OBJECT:'`',"boulder",(09,09) -OBJECT:'`',"boulder",(08,10) -OBJECT:'`',"boulder",(10,10) +OBJECT:('`',"boulder"),(08,07) +OBJECT:('`',"boulder"),(09,08) +OBJECT:('`',"boulder"),(09,09) +OBJECT:('`',"boulder"),(08,10) +OBJECT:('`',"boulder"),(10,10) # Traps TRAP:"pit",(03,06) @@ -85,16 +85,16 @@ TRAP:"pit",(06,10) TRAP:"pit",(07,10) # A little help -OBJECT:'?',"earth",(02,11) -OBJECT:'?',"earth",(03,11) +OBJECT:('?',"earth"),(02,11) +OBJECT:('?',"earth"),(03,11) # Random objects -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'=',random,random -OBJECT:'/',random,random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'=',random +OBJECT:'/',random MAZE:"soko4-2",' ' @@ -121,20 +121,20 @@ NON_DIGGABLE:(00,00,14,10) NON_PASSWALL:(00,00,14,10) # Boulders -OBJECT:'`',"boulder",(05,02) -OBJECT:'`',"boulder",(06,02) -OBJECT:'`',"boulder",(06,03) -OBJECT:'`',"boulder",(07,03) +OBJECT:('`',"boulder"),(05,02) +OBJECT:('`',"boulder"),(06,02) +OBJECT:('`',"boulder"),(06,03) +OBJECT:('`',"boulder"),(07,03) # -OBJECT:'`',"boulder",(09,05) -OBJECT:'`',"boulder",(10,03) -OBJECT:'`',"boulder",(11,02) -OBJECT:'`',"boulder",(12,03) +OBJECT:('`',"boulder"),(09,05) +OBJECT:('`',"boulder"),(10,03) +OBJECT:('`',"boulder"),(11,02) +OBJECT:('`',"boulder"),(12,03) # -OBJECT:'`',"boulder",(07,08) -OBJECT:'`',"boulder",(08,08) -OBJECT:'`',"boulder",(09,08) -OBJECT:'`',"boulder",(10,08) +OBJECT:('`',"boulder"),(07,08) +OBJECT:('`',"boulder"),(08,08) +OBJECT:('`',"boulder"),(09,08) +OBJECT:('`',"boulder"),(10,08) # Traps TRAP:"pit",(01,02) @@ -149,16 +149,16 @@ TRAP:"pit",(05,08) TRAP:"pit",(06,08) # A little help -OBJECT:'?',"earth",(01,09) -OBJECT:'?',"earth",(02,09) +OBJECT:('?',"earth"),(01,09) +OBJECT:('?',"earth"),(02,09) # Random objects -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'=',random,random -OBJECT:'/',random,random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'=',random +OBJECT:'/',random ### Second level ### @@ -188,29 +188,29 @@ NON_DIGGABLE:(00,00,28,11) NON_PASSWALL:(00,00,28,11) # Boulders -OBJECT:'`',"boulder",(03,02) -OBJECT:'`',"boulder",(04,02) +OBJECT:('`',"boulder"),(03,02) +OBJECT:('`',"boulder"),(04,02) # -OBJECT:'`',"boulder",(06,02) -OBJECT:'`',"boulder",(06,03) -OBJECT:'`',"boulder",(07,02) +OBJECT:('`',"boulder"),(06,02) +OBJECT:('`',"boulder"),(06,03) +OBJECT:('`',"boulder"),(07,02) # -OBJECT:'`',"boulder",(03,06) -OBJECT:'`',"boulder",(02,07) -OBJECT:'`',"boulder",(03,07) -OBJECT:'`',"boulder",(03,08) -OBJECT:'`',"boulder",(02,09) -OBJECT:'`',"boulder",(03,09) -OBJECT:'`',"boulder",(04,09) +OBJECT:('`',"boulder"),(03,06) +OBJECT:('`',"boulder"),(02,07) +OBJECT:('`',"boulder"),(03,07) +OBJECT:('`',"boulder"),(03,08) +OBJECT:('`',"boulder"),(02,09) +OBJECT:('`',"boulder"),(03,09) +OBJECT:('`',"boulder"),(04,09) # -OBJECT:'`',"boulder",(06,07) -OBJECT:'`',"boulder",(06,09) -OBJECT:'`',"boulder",(08,07) -OBJECT:'`',"boulder",(08,10) -OBJECT:'`',"boulder",(09,08) -OBJECT:'`',"boulder",(09,09) -OBJECT:'`',"boulder",(10,07) -OBJECT:'`',"boulder",(10,10) +OBJECT:('`',"boulder"),(06,07) +OBJECT:('`',"boulder"),(06,09) +OBJECT:('`',"boulder"),(08,07) +OBJECT:('`',"boulder"),(08,10) +OBJECT:('`',"boulder"),(09,08) +OBJECT:('`',"boulder"),(09,09) +OBJECT:('`',"boulder"),(10,07) +OBJECT:('`',"boulder"),(10,10) # Traps TRAP:"hole",(12,10) @@ -230,12 +230,12 @@ TRAP:"hole",(25,10) TRAP:"hole",(26,10) # Random objects -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'=',random,random -OBJECT:'/',random,random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'=',random +OBJECT:'/',random MAZE:"soko3-2",' ' @@ -266,22 +266,22 @@ NON_DIGGABLE:(00,00,25,13) NON_PASSWALL:(00,00,25,13) # Boulders -OBJECT:'`',"boulder",(02,03) -OBJECT:'`',"boulder",(08,03) -OBJECT:'`',"boulder",(09,04) -OBJECT:'`',"boulder",(02,05) -OBJECT:'`',"boulder",(04,05) -OBJECT:'`',"boulder",(09,05) -OBJECT:'`',"boulder",(02,06) -OBJECT:'`',"boulder",(05,06) -OBJECT:'`',"boulder",(06,07) -OBJECT:'`',"boulder",(03,08) -OBJECT:'`',"boulder",(07,08) -OBJECT:'`',"boulder",(05,09) -OBJECT:'`',"boulder",(10,09) -OBJECT:'`',"boulder",(07,10) -OBJECT:'`',"boulder",(10,10) -OBJECT:'`',"boulder",(03,11) +OBJECT:('`',"boulder"),(02,03) +OBJECT:('`',"boulder"),(08,03) +OBJECT:('`',"boulder"),(09,04) +OBJECT:('`',"boulder"),(02,05) +OBJECT:('`',"boulder"),(04,05) +OBJECT:('`',"boulder"),(09,05) +OBJECT:('`',"boulder"),(02,06) +OBJECT:('`',"boulder"),(05,06) +OBJECT:('`',"boulder"),(06,07) +OBJECT:('`',"boulder"),(03,08) +OBJECT:('`',"boulder"),(07,08) +OBJECT:('`',"boulder"),(05,09) +OBJECT:('`',"boulder"),(10,09) +OBJECT:('`',"boulder"),(07,10) +OBJECT:('`',"boulder"),(10,10) +OBJECT:('`',"boulder"),(03,11) # Traps TRAP:"hole",(12,10) @@ -298,12 +298,12 @@ TRAP:"hole",(22,10) TRAP:"hole",(23,10) # Random objects -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'=',random,random -OBJECT:'/',random,random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'=',random +OBJECT:'/',random ### Third level ### @@ -333,23 +333,23 @@ NON_DIGGABLE:(00,00,19,11) NON_PASSWALL:(00,00,19,11) # Boulders -OBJECT:'`',"boulder",(02,02) -OBJECT:'`',"boulder",(03,02) +OBJECT:('`',"boulder"),(02,02) +OBJECT:('`',"boulder"),(03,02) # -OBJECT:'`',"boulder",(05,03) -OBJECT:'`',"boulder",(07,03) -OBJECT:'`',"boulder",(07,02) -OBJECT:'`',"boulder",(08,02) +OBJECT:('`',"boulder"),(05,03) +OBJECT:('`',"boulder"),(07,03) +OBJECT:('`',"boulder"),(07,02) +OBJECT:('`',"boulder"),(08,02) # -OBJECT:'`',"boulder",(10,03) -OBJECT:'`',"boulder",(11,03) +OBJECT:('`',"boulder"),(10,03) +OBJECT:('`',"boulder"),(11,03) # -OBJECT:'`',"boulder",(02,07) -OBJECT:'`',"boulder",(02,08) -OBJECT:'`',"boulder",(03,09) +OBJECT:('`',"boulder"),(02,07) +OBJECT:('`',"boulder"),(02,08) +OBJECT:('`',"boulder"),(03,09) # -OBJECT:'`',"boulder",(05,07) -OBJECT:'`',"boulder",(06,06) +OBJECT:('`',"boulder"),(05,07) +OBJECT:('`',"boulder"),(06,06) # Traps TRAP:"hole",(08,09) @@ -364,12 +364,12 @@ TRAP:"hole",(16,09) TRAP:"hole",(17,09) # Random objects -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'=',random,random -OBJECT:'/',random,random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'=',random +OBJECT:'/',random MAZE:"soko2-2",' ' @@ -399,22 +399,22 @@ NON_DIGGABLE:(00,00,19,12) NON_PASSWALL:(00,00,19,12) # Boulders -OBJECT:'`',"boulder",(04,02) -OBJECT:'`',"boulder",(04,03) -OBJECT:'`',"boulder",(05,03) -OBJECT:'`',"boulder",(07,03) -OBJECT:'`',"boulder",(08,03) -OBJECT:'`',"boulder",(02,04) -OBJECT:'`',"boulder",(03,04) -OBJECT:'`',"boulder",(05,05) -OBJECT:'`',"boulder",(06,06) -OBJECT:'`',"boulder",(09,06) -OBJECT:'`',"boulder",(03,07) -OBJECT:'`',"boulder",(04,07) -OBJECT:'`',"boulder",(07,07) -OBJECT:'`',"boulder",(06,09) -OBJECT:'`',"boulder",(05,10) -OBJECT:'`',"boulder",(05,11) +OBJECT:('`',"boulder"),(04,02) +OBJECT:('`',"boulder"),(04,03) +OBJECT:('`',"boulder"),(05,03) +OBJECT:('`',"boulder"),(07,03) +OBJECT:('`',"boulder"),(08,03) +OBJECT:('`',"boulder"),(02,04) +OBJECT:('`',"boulder"),(03,04) +OBJECT:('`',"boulder"),(05,05) +OBJECT:('`',"boulder"),(06,06) +OBJECT:('`',"boulder"),(09,06) +OBJECT:('`',"boulder"),(03,07) +OBJECT:('`',"boulder"),(04,07) +OBJECT:('`',"boulder"),(07,07) +OBJECT:('`',"boulder"),(06,09) +OBJECT:('`',"boulder"),(05,10) +OBJECT:('`',"boulder"),(05,11) # Traps TRAP:"hole",(07,11) @@ -430,12 +430,12 @@ TRAP:"hole",(16,11) TRAP:"hole",(17,11) # Random objects -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'=',random,random -OBJECT:'/',random,random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'=',random +OBJECT:'/',random ### Top (last) level of Sokoban ### @@ -463,34 +463,36 @@ MAP |...|----- --|.....| ----- ------- ENDMAP -RANDOM_PLACES:(16,11),(16,13),(16,15) +$place = { (16,11),(16,13),(16,15) } +SHUFFLE: $place + STAIR:(01,01),down REGION:(00,00,25,17),lit,"ordinary" NON_DIGGABLE:(00,00,25,17) NON_PASSWALL:(00,00,25,17) # Boulders -OBJECT:'`',"boulder",(03,05) -OBJECT:'`',"boulder",(05,05) -OBJECT:'`',"boulder",(07,05) -OBJECT:'`',"boulder",(09,05) -OBJECT:'`',"boulder",(11,05) +OBJECT:('`',"boulder"),(03,05) +OBJECT:('`',"boulder"),(05,05) +OBJECT:('`',"boulder"),(07,05) +OBJECT:('`',"boulder"),(09,05) +OBJECT:('`',"boulder"),(11,05) # -OBJECT:'`',"boulder",(04,07) -OBJECT:'`',"boulder",(04,08) -OBJECT:'`',"boulder",(06,07) -OBJECT:'`',"boulder",(09,07) -OBJECT:'`',"boulder",(11,07) +OBJECT:('`',"boulder"),(04,07) +OBJECT:('`',"boulder"),(04,08) +OBJECT:('`',"boulder"),(06,07) +OBJECT:('`',"boulder"),(09,07) +OBJECT:('`',"boulder"),(11,07) # -OBJECT:'`',"boulder",(03,12) -OBJECT:'`',"boulder",(04,10) -OBJECT:'`',"boulder",(05,12) -OBJECT:'`',"boulder",(06,10) -OBJECT:'`',"boulder",(07,11) -OBJECT:'`',"boulder",(08,10) -OBJECT:'`',"boulder",(09,12) +OBJECT:('`',"boulder"),(03,12) +OBJECT:('`',"boulder"),(04,10) +OBJECT:('`',"boulder"),(05,12) +OBJECT:('`',"boulder"),(06,10) +OBJECT:('`',"boulder"),(07,11) +OBJECT:('`',"boulder"),(08,10) +OBJECT:('`',"boulder"),(09,12) # -OBJECT:'`',"boulder",(03,14) +OBJECT:('`',"boulder"),(03,14) # Traps TRAP:"hole",(08,01) @@ -510,25 +512,25 @@ TRAP:"hole",(21,01) TRAP:"hole",(22,01) TRAP:"hole",(23,01) -MONSTER:'m',"giant mimic", random, m_object "boulder" -MONSTER:'m',"giant mimic", random, m_object "boulder" +MONSTER:('m',"giant mimic"), random, m_object "boulder" +MONSTER:('m',"giant mimic"), random, m_object "boulder" # Random objects -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'=',random,random -OBJECT:'/',random,random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'=',random +OBJECT:'/',random # Rewards DOOR:locked,(23,13) DOOR:closed,(17,11) DOOR:closed,(17,13) DOOR:closed,(17,15) -REGION:(18,10,22,16),lit,"zoo",filled,true -OBJECT:'(',"bag of holding",place[0] -ENGRAVING:place[0],burn,"Elbereth" +REGION:(18,10,22,16),lit,"zoo",filled,irregular +OBJECT:('(',"bag of holding"),$place[0] +ENGRAVING:$place[0],burn,"Elbereth" MAZE:"soko1-2",' ' @@ -554,35 +556,37 @@ MAP |..|..| --|.....| ------- ------- ENDMAP -RANDOM_PLACES:(16,10),(16,12),(16,14) +$place = { (16,10),(16,12),(16,14) } +SHUFFLE: $place + STAIR:(06,15),down REGION:(00,00,25,16),lit,"ordinary" NON_DIGGABLE:(00,00,25,16) NON_PASSWALL:(00,00,25,16) # Boulders -OBJECT:'`',"boulder",(04,04) -OBJECT:'`',"boulder",(02,06) -OBJECT:'`',"boulder",(03,06) -OBJECT:'`',"boulder",(04,07) -OBJECT:'`',"boulder",(05,07) -OBJECT:'`',"boulder",(02,08) -OBJECT:'`',"boulder",(05,08) -OBJECT:'`',"boulder",(03,09) -OBJECT:'`',"boulder",(04,09) -OBJECT:'`',"boulder",(03,10) -OBJECT:'`',"boulder",(05,10) -OBJECT:'`',"boulder",(06,12) +OBJECT:('`',"boulder"),(04,04) +OBJECT:('`',"boulder"),(02,06) +OBJECT:('`',"boulder"),(03,06) +OBJECT:('`',"boulder"),(04,07) +OBJECT:('`',"boulder"),(05,07) +OBJECT:('`',"boulder"),(02,08) +OBJECT:('`',"boulder"),(05,08) +OBJECT:('`',"boulder"),(03,09) +OBJECT:('`',"boulder"),(04,09) +OBJECT:('`',"boulder"),(03,10) +OBJECT:('`',"boulder"),(05,10) +OBJECT:('`',"boulder"),(06,12) # -OBJECT:'`',"boulder",(07,14) +OBJECT:('`',"boulder"),(07,14) # -OBJECT:'`',"boulder",(11,05) -OBJECT:'`',"boulder",(12,06) -OBJECT:'`',"boulder",(10,07) -OBJECT:'`',"boulder",(11,07) -OBJECT:'`',"boulder",(10,08) -OBJECT:'`',"boulder",(12,09) -OBJECT:'`',"boulder",(11,10) +OBJECT:('`',"boulder"),(11,05) +OBJECT:('`',"boulder"),(12,06) +OBJECT:('`',"boulder"),(10,07) +OBJECT:('`',"boulder"),(11,07) +OBJECT:('`',"boulder"),(10,08) +OBJECT:('`',"boulder"),(12,09) +OBJECT:('`',"boulder"),(11,10) # Traps TRAP:"hole",(05,01) @@ -604,22 +608,22 @@ TRAP:"hole",(20,01) TRAP:"hole",(21,01) TRAP:"hole",(22,01) -MONSTER:'m',"giant mimic", random, m_object "boulder" -MONSTER:'m',"giant mimic", random, m_object "boulder" +MONSTER:('m',"giant mimic"), random, m_object "boulder" +MONSTER:('m',"giant mimic"), random, m_object "boulder" # Random objects -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'%',random,random -OBJECT:'=',random,random -OBJECT:'/',random,random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'%',random +OBJECT:'=',random +OBJECT:'/',random # Rewards DOOR:locked,(23,12) DOOR:closed,(17,10) DOOR:closed,(17,12) DOOR:closed,(17,14) -REGION:(18,09,22,15),lit,"zoo",filled,true -OBJECT:'"',"amulet of reflection",place[0] -ENGRAVING:place[0],burn,"Elbereth" +REGION:(18,09,22,15),lit,"zoo",filled,irregular +OBJECT:('"',"amulet of reflection"),$place[0] +ENGRAVING:$place[0],burn,"Elbereth" diff --git a/dat/tower.des b/dat/tower.des index eb017247d..b87f102f5 100644 --- a/dat/tower.des +++ b/dat/tower.des @@ -23,13 +23,13 @@ MAP ENDMAP LADDER:(11,05),down # The lord and his court -MONSTER:'V',"Vlad the Impaler",(06,05) -MONSTER:'V',random,(03,09) -MONSTER:'V',random,(07,09) -MONSTER:'V',random,(11,09) -MONSTER:'V',random,(03,01) -MONSTER:'V',random,(07,01) -MONSTER:'V',random,(11,01) +MONSTER:('V',"Vlad the Impaler"),(06,05) +MONSTER:'V',(03,09) +MONSTER:'V',(07,09) +MONSTER:'V',(11,09) +MONSTER:'V',(03,01) +MONSTER:'V',(07,01) +MONSTER:'V',(11,01) # The doors DOOR:closed,(08,03) DOOR:closed,(10,03) @@ -39,13 +39,13 @@ DOOR:locked,(08,07) DOOR:locked,(10,07) DOOR:closed,(03,06) # treasures -OBJECT:'(',"chest",(07,05) -OBJECT:'(',"chest",(03,09) -OBJECT:'(',"chest",(07,09) -OBJECT:'(',"chest",(11,09) -OBJECT:'(',"chest",(03,01) -OBJECT:'(',"chest",(07,01) -OBJECT:'(',"chest",(11,01) +OBJECT:('(',"chest"),(07,05) +OBJECT:('(',"chest"),(03,09) +OBJECT:('(',"chest"),(07,09) +OBJECT:('(',"chest"),(11,09) +OBJECT:('(',"chest"),(03,01) +OBJECT:('(',"chest"),(07,01) +OBJECT:('(',"chest"),(11,01) # We have to protect the tower against outside attacks NON_DIGGABLE:(00,00,14,10) @@ -68,24 +68,27 @@ MAP --- --- --- ENDMAP # Random places are the 10 niches -RANDOM_PLACES:(03,01),(07,01),(11,01),(01,03),(13,03), - (01,07),(13,07),(03,09),(07,09),(11,09) +$place = { (03,01),(07,01),(11,01),(01,03),(13,03), + (01,07),(13,07),(03,09),(07,09),(11,09) } +SHUFFLE: $place LADDER:(11,05),up LADDER:(03,07),down DOOR:locked,(10,04) DOOR:locked,(09,07) -MONSTER:'&',random,place[0] -MONSTER:'&',random,place[1] -MONSTER:'d',"hell hound pup",place[2] -MONSTER:'d',"hell hound pup",place[3] -MONSTER:'d',"winter wolf",place[4] -CONTAINER:'(',"chest",place[5] -OBJECT:'"',"amulet of life saving",contained -CONTAINER:'(',"chest",place[6] -OBJECT:'"',"amulet of strangulation",contained -OBJECT:'[',"water walking boots",place[7] -OBJECT:'[',"crystal plate mail",place[8] -OBJECT:'+',"invisibility",place[9] +MONSTER:'&',$place[0] +MONSTER:'&',$place[1] +MONSTER:('d',"hell hound pup"),$place[2] +MONSTER:('d',"hell hound pup"),$place[3] +MONSTER:('d',"winter wolf"),$place[4] +CONTAINER:('(',"chest"),$place[5] { + OBJECT:('"',"amulet of life saving") +} +CONTAINER:('(',"chest"),$place[6] { + OBJECT:('"',"amulet of strangulation") +} +OBJECT:('[',"water walking boots"),$place[7] +OBJECT:('[',"crystal plate mail"),$place[8] +OBJECT:('+',"invisibility"),$place[9] # Walls in the tower are non diggable NON_DIGGABLE:(00,00,14,10) @@ -110,29 +113,30 @@ MAP --------------- ENDMAP # Random places are the 10 niches -RANDOM_PLACES:(05,01),(09,01),(13,01),(03,03),(15,03), - (03,07),(15,07),(05,09),(09,09),(13,09) +$place = { (05,01),(09,01),(13,01),(03,03),(15,03), + (03,07),(15,07),(05,09),(09,09),(13,09) } +SHUFFLE: $place BRANCH:(02,05,02,05),(00,00,00,00) LADDER:(05,07),up # Entry door is, of course, locked DOOR:locked,(14,05) # Let's put a dragon behind the door, just for the fun... -MONSTER:'D',random,(13,05) -MONSTER:random,random,(12,04) -MONSTER:random,random,(12,06) -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -MONSTER:random,random,random -OBJECT:')',"long sword",place[0] -TRAP:random,place[0] -OBJECT:'(',"lock pick",place[1] -TRAP:random,place[1] -OBJECT:'[',"elven cloak",place[2] -TRAP:random,place[2] -OBJECT:'(',"blindfold",place[3] -TRAP:random,place[3] +MONSTER:'D',(13,05) +MONSTER:random,(12,04) +MONSTER:random,(12,06) +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +MONSTER:random,random +OBJECT:(')',"long sword"),$place[0] +TRAP:random,$place[0] +OBJECT:('(',"lock pick"),$place[1] +TRAP:random,$place[1] +OBJECT:('[',"elven cloak"),$place[2] +TRAP:random,$place[2] +OBJECT:('(',"blindfold"),$place[3] +TRAP:random,$place[3] # Walls in the tower are non diggable NON_DIGGABLE:(00,00,18,12) diff --git a/dat/yendor.des b/dat/yendor.des index 6bef30231..dcb77c986 100644 --- a/dat/yendor.des +++ b/dat/yendor.des @@ -48,29 +48,29 @@ NON_PASSWALL:(11,00,21,00) NON_PASSWALL:(11,10,27,12) NON_PASSWALL:(21,00,27,10) # The wizard and his guards -MONSTER:'@',"Wizard of Yendor",(16,05),asleep -MONSTER:'d',"hell hound",(15,05) -MONSTER:'V',"vampire lord",(17,05) +MONSTER:('@',"Wizard of Yendor"),(16,05),asleep +MONSTER:('d',"hell hound"),(15,05) +MONSTER:('V',"vampire lord"),(17,05) # The local treasure -OBJECT:'+',"Book of the Dead",(16,05) +OBJECT:('+',"Book of the Dead"),(16,05) # Surrounding terror -MONSTER:';',"kraken",(14,02) -MONSTER:';',"giant eel",(17,02) -MONSTER:';',"kraken",(13,04) -MONSTER:';',"giant eel",(13,06) -MONSTER:';',"kraken",(19,04) -MONSTER:';',"giant eel",(19,06) -MONSTER:';',"kraken",(15,08) -MONSTER:';',"giant eel",(17,08) -MONSTER:';',"piranha",(15,02) -MONSTER:';',"piranha",(19,08) +MONSTER:(';',"kraken"),(14,02) +MONSTER:(';',"giant eel"),(17,02) +MONSTER:(';',"kraken"),(13,04) +MONSTER:(';',"giant eel"),(13,06) +MONSTER:(';',"kraken"),(19,04) +MONSTER:(';',"giant eel"),(19,06) +MONSTER:(';',"kraken"),(15,08) +MONSTER:(';',"giant eel"),(17,08) +MONSTER:(';',"piranha"),(15,02) +MONSTER:(';',"piranha"),(19,08) # Random monsters -MONSTER:'D',random,random -MONSTER:'H',random,random -MONSTER:'&',random,random -MONSTER:'&',random,random -MONSTER:'&',random,random -MONSTER:'&',random,random +MONSTER:'D',random +MONSTER:'H',random +MONSTER:'&',random +MONSTER:'&',random +MONSTER:'&',random +MONSTER:'&',random # And to make things a little harder. TRAP:"board",(16,04) TRAP:"board",(16,06) @@ -82,14 +82,14 @@ TRAP:"sleep gas",random TRAP:"anti magic",random TRAP:"magic",random # Some random loot. -OBJECT:'*',"ruby",random -OBJECT:'!',random,random -OBJECT:'!',random,random -OBJECT:'?',random,random -OBJECT:'?',random,random -OBJECT:'+',random,random -OBJECT:'+',random,random -OBJECT:'+',random,random +OBJECT:('*',"ruby"),random +OBJECT:'!',random +OBJECT:'!',random +OBJECT:'?',random +OBJECT:'?',random +OBJECT:'+',random +OBJECT:'+',random +OBJECT:'+',random # The middle wizard level. @@ -136,13 +136,13 @@ TRAP:"sleep gas",random TRAP:"anti magic",random TRAP:"magic",random # Some random loot. -OBJECT:'!',random,random -OBJECT:'!',random,random -OBJECT:'?',random,random -OBJECT:'?',random,random -OBJECT:'+',random,random +OBJECT:'!',random +OBJECT:'!',random +OBJECT:'?',random +OBJECT:'?',random +OBJECT:'+',random # treasures -OBJECT:'"',random,(04,06) +OBJECT:'"',(04,06) # The bottom wizard level. @@ -191,33 +191,33 @@ NON_PASSWALL:(06,00,27,02) NON_PASSWALL:(16,02,27,12) NON_PASSWALL:(06,12,16,12) # -MONSTER:'L',random,(10,07) -MONSTER:'V',"vampire lord",(12,07) +MONSTER:'L',(10,07) +MONSTER:('V',"vampire lord"),(12,07) # Some surrounding horrors -MONSTER:';',"kraken",(08,05) -MONSTER:';',"giant eel",(08,08) -MONSTER:';',"kraken",(14,05) -MONSTER:';',"giant eel",(14,08) +MONSTER:(';',"kraken"),(08,05) +MONSTER:(';',"giant eel"),(08,08) +MONSTER:(';',"kraken"),(14,05) +MONSTER:(';',"giant eel"),(14,08) # Other monsters -MONSTER:'L',random,random -MONSTER:'D',random,random -MONSTER:'D',random,(26,09) -MONSTER:'&',random,random -MONSTER:'&',random,random -MONSTER:'&',random,random +MONSTER:'L',random +MONSTER:'D',random +MONSTER:'D',(26,09) +MONSTER:'&',random +MONSTER:'&',random +MONSTER:'&',random # And to make things a little harder. TRAP:"board",(10,07) TRAP:"board",(12,07) TRAP:"board",(11,06) TRAP:"board",(11,08) # Some loot -OBJECT:')',random,random -OBJECT:'!',random,random -OBJECT:'?',random,random -OBJECT:'?',random,random -OBJECT:'(',random,random +OBJECT:')',random +OBJECT:'!',random +OBJECT:'?',random +OBJECT:'?',random +OBJECT:'(',random # treasures -OBJECT:'"',random,(11,07) +OBJECT:'"',(11,07) # The former decoy wizard levels. @@ -241,10 +241,10 @@ BRANCH:levregion(01,00,79,20),(0,0,8,7) TELEPORT_REGION:levregion(01,00,79,20),(2,2,6,6) PORTAL:(4,4,4,4),(0,0,0,0),"wizard3" MAZEWALK:(08,05),east -REGION:(04,03,06,06),unlit,"ordinary",unfilled,true -MONSTER:'L',random,(04,04) -MONSTER:'V',"vampire lord",(03,04) -MONSTER:';',"kraken",(06,06) +REGION:(04,03,06,06),unlit,"ordinary",unfilled,irregular +MONSTER:'L',(04,04) +MONSTER:('V',"vampire lord"),(03,04) +MONSTER:(';',"kraken"),(06,06) # And to make things a little harder. TRAP:"board",(04,03) TRAP:"board",(04,05) @@ -269,14 +269,14 @@ STAIR:levregion(01,00,79,20),(0,0,8,7),down BRANCH:levregion(01,00,79,20),(0,0,8,7) TELEPORT_REGION:levregion(01,00,79,20),(2,2,6,6) MAZEWALK:(08,05),east -REGION:(04,03,06,06),unlit,"ordinary",unfilled,true -MONSTER:'L',random,(04,04) -MONSTER:'V',"vampire lord",(03,04) -MONSTER:';',"kraken",(06,06) +REGION:(04,03,06,06),unlit,"ordinary",unfilled,irregular +MONSTER:'L',(04,04) +MONSTER:('V',"vampire lord"),(03,04) +MONSTER:(';',"kraken"),(06,06) # And to make things a little harder. TRAP:"board",(04,03) TRAP:"board",(04,05) TRAP:"board",(03,04) TRAP:"board",(05,04) # treasures -OBJECT:'"',random,(04,04) +OBJECT:'"',(04,04) From c9d5bb9d68f7824029c0249a5a2ed0e9d640c858 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 19 Feb 2015 18:01:29 +0200 Subject: [PATCH 212/354] Fix some level flags, sokoban premapping --- dat/sokoban.des | 16 ++++++++-------- include/sp_lev.h | 5 ++--- src/mkmaze.c | 4 ---- src/sp_lev.c | 9 --------- util/lev_comp.l | 1 - 5 files changed, 10 insertions(+), 25 deletions(-) diff --git a/dat/sokoban.des b/dat/sokoban.des index f5aa0bdff..6b2d2b862 100644 --- a/dat/sokoban.des +++ b/dat/sokoban.des @@ -35,7 +35,7 @@ ### Bottom (first) level of Sokoban ### MAZE:"soko4-1",' ' -FLAGS:noteleport,hardfloor +FLAGS:noteleport,hardfloor,premapped GEOMETRY:center,center #12345678901234567890123456789012345678901234567890 MAP @@ -98,7 +98,7 @@ OBJECT:'/',random MAZE:"soko4-2",' ' -FLAGS:noteleport,hardfloor +FLAGS:noteleport,hardfloor,premapped GEOMETRY:center,center #12345678901234567890123456789012345678901234567890 MAP @@ -163,7 +163,7 @@ OBJECT:'/',random ### Second level ### MAZE:"soko3-1",' ' -FLAGS:noteleport +FLAGS:noteleport,premapped GEOMETRY:center,center #12345678901234567890123456789012345678901234567890 MAP @@ -239,7 +239,7 @@ OBJECT:'/',random MAZE:"soko3-2",' ' -FLAGS:noteleport +FLAGS:noteleport,premapped GEOMETRY:center,center #12345678901234567890123456789012345678901234567890 MAP @@ -308,7 +308,7 @@ OBJECT:'/',random ### Third level ### MAZE:"soko2-1",' ' -FLAGS:noteleport +FLAGS:noteleport,premapped GEOMETRY:center,center #12345678901234567890123456789012345678901234567890 MAP @@ -373,7 +373,7 @@ OBJECT:'/',random MAZE:"soko2-2",' ' -FLAGS:noteleport +FLAGS:noteleport,premapped GEOMETRY:center,center #12345678901234567890123456789012345678901234567890 MAP @@ -440,7 +440,7 @@ OBJECT:'/',random ### Top (last) level of Sokoban ### MAZE:"soko1-1",' ' -FLAGS:noteleport +FLAGS:noteleport,premapped GEOMETRY:center,center #12345678901234567890123456789012345678901234567890 MAP @@ -534,7 +534,7 @@ ENGRAVING:$place[0],burn,"Elbereth" MAZE:"soko1-2",' ' -FLAGS:noteleport +FLAGS:noteleport,premapped GEOMETRY:center,center #12345678901234567890123456789012345678901234567890 MAP diff --git a/include/sp_lev.h b/include/sp_lev.h index f2c61625b..f5905bac5 100644 --- a/include/sp_lev.h +++ b/include/sp_lev.h @@ -25,10 +25,9 @@ #define SHORTSIGHTED 0x00000008L #define ARBOREAL 0x00000010L #define MAZELEVEL 0x00000020L -#define PREMAPPED 0x00000040L +#define PREMAPPED 0x00000040L /* premapped level & sokoban rules */ #define SHROUD 0x00000080L -#define STORMY 0x00000100L -#define GRAVEYARD 0x00000200L +#define GRAVEYARD 0x00000100L /* different level layout initializers */ diff --git a/src/mkmaze.c b/src/mkmaze.c index 4270ba783..c8ae88f99 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -406,10 +406,6 @@ fixup_special() place_lregion(0,0,0,0,0,0,0,0,LR_BRANCH,(d_level *)0); } - /* KMH -- Sokoban levels */ - if(In_sokoban(&u.uz)) - sokoban_detect(); - /* Still need to add some stuff to level file */ if (Is_medusa_level(&u.uz)) { struct obj *otmp; diff --git a/src/sp_lev.c b/src/sp_lev.c index 0650a7bd1..fa2aa8984 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -2792,17 +2792,10 @@ spo_level_flags(coder) if (flags & NOMMAP) level.flags.nommap = 1; if (flags & SHORTSIGHTED) level.flags.shortsighted = 1; if (flags & ARBOREAL) level.flags.arboreal = 1; - /* - if (flags & NOFLIPX) coder->allow_flips &= ~1; - if (flags & NOFLIPY) coder->allow_flips &= ~2; if (flags & MAZELEVEL) level.flags.is_maze_lev = 1; if (flags & PREMAPPED) coder->premapped = TRUE; if (flags & SHROUD) level.flags.hero_memory = 0; - if (flags & STORMY) level.flags.stormy = 1; if (flags & GRAVEYARD) level.flags.graveyard = 1; - if (flags & SKYMAP) level.flags.sky = 1; - if (flags & FLAG_RNDVAULT) coder->allow_flips = 0; - */ opvar_free(flagdata); } @@ -5048,8 +5041,6 @@ next_opcode: remove_boundary_syms(); wallification(1, 0, COLNO-1, ROWNO-1); - /*flip_level_rnd(coder->allow_flips);*/ - count_features(); if (coder->premapped) sokoban_detect(); diff --git a/util/lev_comp.l b/util/lev_comp.l index 02ca2d4ee..b41397030 100644 --- a/util/lev_comp.l +++ b/util/lev_comp.l @@ -292,7 +292,6 @@ shortsighted { savetoken(yytext); yylval.i=SHORTSIGHTED; return FLAG_TYPE; } mazelevel { savetoken(yytext); yylval.i=MAZELEVEL; return FLAG_TYPE; } premapped { savetoken(yytext); yylval.i=PREMAPPED; return FLAG_TYPE; } shroud { savetoken(yytext); yylval.i=SHROUD; return FLAG_TYPE; } -stormy { savetoken(yytext); yylval.i=STORMY; return FLAG_TYPE; } graveyard { savetoken(yytext); yylval.i=GRAVEYARD; return FLAG_TYPE; } [0-9]+d[0-9]+ { char *p = strchr(yytext, 'd'); savetoken(yytext); From b5dd0c18949cf6d512c5b5c4a83d0a114962ae57 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 19 Feb 2015 20:47:08 +0200 Subject: [PATCH 213/354] Make sokoban prize not depend on the map layout --- dat/sokoban.des | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dat/sokoban.des b/dat/sokoban.des index 6b2d2b862..c2394448f 100644 --- a/dat/sokoban.des +++ b/dat/sokoban.des @@ -529,7 +529,11 @@ DOOR:closed,(17,11) DOOR:closed,(17,13) DOOR:closed,(17,15) REGION:(18,10,22,16),lit,"zoo",filled,irregular -OBJECT:('(',"bag of holding"),$place[0] +IF [50%] { + OBJECT:('(',"bag of holding"),$place[0] +} ELSE { + OBJECT:('"',"amulet of reflection"),$place[0] +} ENGRAVING:$place[0],burn,"Elbereth" @@ -625,5 +629,9 @@ DOOR:closed,(17,10) DOOR:closed,(17,12) DOOR:closed,(17,14) REGION:(18,09,22,15),lit,"zoo",filled,irregular -OBJECT:('"',"amulet of reflection"),$place[0] +IF [50%] { + OBJECT:('(',"bag of holding"),$place[0] +} ELSE { + OBJECT:('"',"amulet of reflection"),$place[0] +} ENGRAVING:$place[0],burn,"Elbereth" From 56699486a0c3a22f4a9bb9d727b3f65023d6235c Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 25 Feb 2015 20:35:25 +0200 Subject: [PATCH 214/354] Catch up with post-343 lev_comp changes - Iced pools vs. iced moats - allow making map outer edges nonpasswall & nondiggable, so eg. xorns cannot be teleported there --- dat/Valkyrie.des | 7 ++++-- dat/sokoban.des | 16 ++++++------- dat/tower.des | 6 ++--- include/sp_lev.h | 7 +++--- src/sp_lev.c | 59 +++++++++++++++++++++++++++++++++--------------- util/lev_comp.l | 2 ++ 6 files changed, 63 insertions(+), 34 deletions(-) diff --git a/dat/Valkyrie.des b/dat/Valkyrie.des index 520a0f8ba..0dbd3bd05 100644 --- a/dat/Valkyrie.des +++ b/dat/Valkyrie.des @@ -11,7 +11,7 @@ # and receive your quest assignment. # MAZE: "Val-strt",' ' -FLAGS: noteleport,hardfloor +FLAGS: noteleport,hardfloor,icedpools GEOMETRY:center,center MAP IIIIIIPPPIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII @@ -90,7 +90,7 @@ MONSTER: ('H',"fire giant"),(10,16),hostile # MAZE: "Val-loca",' ' -FLAGS: hardfloor +FLAGS: hardfloor,icedpools INIT_MAP: mines, '.', 'I', true, true, lit, false GEOMETRY:center,center MAP @@ -176,6 +176,7 @@ MONSTER:'H',random,hostile # MAZE: "Val-goal", 'L' +FLAGS: icedpools INIT_MAP: mines, '.', 'L', true, true, lit, false GEOMETRY:center,center MAP @@ -266,6 +267,7 @@ MONSTER:'H',random,hostile # MAZE: "Val-fila" , 'I' +FLAGS: icedpools INIT_MAP: mines, '.', 'I', true, true, lit, false NOMAP # @@ -299,6 +301,7 @@ TRAP: random, random TRAP: random, random MAZE: "Val-filb" , 'L' +FLAGS: icedpools INIT_MAP: mines, '.', 'L', true, true, lit, false NOMAP # diff --git a/dat/sokoban.des b/dat/sokoban.des index c2394448f..343e895d6 100644 --- a/dat/sokoban.des +++ b/dat/sokoban.des @@ -35,7 +35,7 @@ ### Bottom (first) level of Sokoban ### MAZE:"soko4-1",' ' -FLAGS:noteleport,hardfloor,premapped +FLAGS:noteleport,hardfloor,premapped,solidify GEOMETRY:center,center #12345678901234567890123456789012345678901234567890 MAP @@ -98,7 +98,7 @@ OBJECT:'/',random MAZE:"soko4-2",' ' -FLAGS:noteleport,hardfloor,premapped +FLAGS:noteleport,hardfloor,premapped,solidify GEOMETRY:center,center #12345678901234567890123456789012345678901234567890 MAP @@ -163,7 +163,7 @@ OBJECT:'/',random ### Second level ### MAZE:"soko3-1",' ' -FLAGS:noteleport,premapped +FLAGS:noteleport,premapped,solidify GEOMETRY:center,center #12345678901234567890123456789012345678901234567890 MAP @@ -239,7 +239,7 @@ OBJECT:'/',random MAZE:"soko3-2",' ' -FLAGS:noteleport,premapped +FLAGS:noteleport,premapped,solidify GEOMETRY:center,center #12345678901234567890123456789012345678901234567890 MAP @@ -308,7 +308,7 @@ OBJECT:'/',random ### Third level ### MAZE:"soko2-1",' ' -FLAGS:noteleport,premapped +FLAGS:noteleport,premapped,solidify GEOMETRY:center,center #12345678901234567890123456789012345678901234567890 MAP @@ -373,7 +373,7 @@ OBJECT:'/',random MAZE:"soko2-2",' ' -FLAGS:noteleport,premapped +FLAGS:noteleport,premapped,solidify GEOMETRY:center,center #12345678901234567890123456789012345678901234567890 MAP @@ -440,7 +440,7 @@ OBJECT:'/',random ### Top (last) level of Sokoban ### MAZE:"soko1-1",' ' -FLAGS:noteleport,premapped +FLAGS:noteleport,premapped,solidify GEOMETRY:center,center #12345678901234567890123456789012345678901234567890 MAP @@ -538,7 +538,7 @@ ENGRAVING:$place[0],burn,"Elbereth" MAZE:"soko1-2",' ' -FLAGS:noteleport,premapped +FLAGS:noteleport,premapped,solidify GEOMETRY:center,center #12345678901234567890123456789012345678901234567890 MAP diff --git a/dat/tower.des b/dat/tower.des index b87f102f5..eeef1f46b 100644 --- a/dat/tower.des +++ b/dat/tower.des @@ -6,7 +6,7 @@ # # Upper stage of Vlad's tower MAZE:"tower1",' ' -FLAGS: noteleport,hardfloor +FLAGS: noteleport,hardfloor,solidify GEOMETRY:half-left,center MAP --- --- --- @@ -52,7 +52,7 @@ NON_DIGGABLE:(00,00,14,10) # Intermediate stage of Vlad's tower MAZE:"tower2",' ' -FLAGS: noteleport,hardfloor +FLAGS: noteleport,hardfloor,solidify GEOMETRY:half-left,center MAP --- --- --- @@ -95,7 +95,7 @@ NON_DIGGABLE:(00,00,14,10) # Bottom most stage of Vlad's tower MAZE:"tower3",' ' -FLAGS: noteleport,hardfloor +FLAGS: noteleport,hardfloor,solidify GEOMETRY:half-left,center MAP --- --- --- diff --git a/include/sp_lev.h b/include/sp_lev.h index f5905bac5..3d4d961c6 100644 --- a/include/sp_lev.h +++ b/include/sp_lev.h @@ -28,7 +28,8 @@ #define PREMAPPED 0x00000040L /* premapped level & sokoban rules */ #define SHROUD 0x00000080L #define GRAVEYARD 0x00000100L - +#define ICEDPOOLS 0x00000200L /* for ice locations: ICED_POOL vs ICED_MOAT */ +#define SOLIDIFY 0x00000400L /* outer areas are nondiggable & nonpasswall */ /* different level layout initializers */ #define LVLINIT_NONE 0 @@ -278,8 +279,8 @@ struct sp_frame { struct sp_coder { struct splevstack *stack; struct sp_frame *frame; - /*int allow_flips;*/ int premapped; + boolean solidify; struct mkroom *croom; struct mkroom *tmproomlist[MAX_NESTED_ROOMS+1]; boolean failed_room[MAX_NESTED_ROOMS+1]; @@ -331,7 +332,7 @@ typedef struct { char fg, bg; boolean smoothed, joined; xchar lit, walled; - boolean icedpools; /* for ice locations: ICED_POOL vs ICED_MOAT */ + boolean icedpools; } lev_init; typedef struct { diff --git a/src/sp_lev.c b/src/sp_lev.c index fa2aa8984..46334a4ab 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -60,7 +60,9 @@ extern struct engr *head_engr; extern int min_rx, max_rx, min_ry, max_ry; /* from mkmap.c */ +/* positions touched by level elements explicitly defined in the des-file */ static char SpLev_Map[COLNO][ROWNO]; + static aligntyp ralign[3] = { AM_CHAOTIC, AM_NEUTRAL, AM_LAWFUL }; static NEARDATA xchar xstart, ystart; static NEARDATA char xsize, ysize; @@ -78,6 +80,8 @@ struct mkroom * FDECL(build_room, (room *, struct mkroom *)); char *lev_message = 0; lev_region *lregions = 0; int num_lregions = 0; +boolean splev_init_present = FALSE; +boolean icedpools = FALSE; struct obj *container_obj[MAX_CONTAINMENT]; int container_idx = 0; @@ -86,6 +90,16 @@ struct monst *invent_carrying_monster = NULL; #define SPLEV_STACK_RESERVE 128 +void +solidify_map() +{ + xchar x, y; + for (x = 0; x < COLNO; x++) + for (y = 0; y < ROWNO; y++) + if (IS_STWALL(levl[x][y].typ) && !SpLev_Map[x][y]) + levl[x][y].wall_info |= (W_NONDIGGABLE|W_NONPASSWALL); +} + void splev_stack_init(st) struct splevstack *st; @@ -502,7 +516,7 @@ remove_boundary_syms() if (has_bounds) { for(x = 0; x < x_maze_max; x++) for(y = 0; y < y_maze_max; y++) - if ((levl[x][y].typ == CROSSWALL) && !SpLev_Map[x][y]) + if ((levl[x][y].typ == CROSSWALL) && SpLev_Map[x][y]) levl[x][y].typ = ROOM; } } @@ -1504,7 +1518,7 @@ struct mkroom *croom; if (o->corpsenm != NON_PM) { if (o->corpsenm == NON_PM - 1) set_corpsenm(otmp, rndmonnum()); - else set_corpsenm(otmp, o->corpsenm); + else set_corpsenm(otmp, o->corpsenm); } /* set_corpsenm() took care of egg hatch and corpse timers */ @@ -1603,11 +1617,14 @@ struct mkroom *croom; for (wastyp = otmp->corpsenm; i < 1000 ; i++, wastyp = rndmonnum()) { /* makemon without rndmonst() might create a group */ was = makemon(&mons[wastyp], 0, 0, MM_NOCOUNTBIRTH); - if (was && !resists_ston(was)) { + if (was) { + if (!resists_ston(was)) { (void) propagate(wastyp, TRUE, FALSE); break; + } + mongone(was); + was = NULL; } - mongone(was); } if (was) { set_corpsenm(otmp, wastyp); @@ -2166,7 +2183,7 @@ fill_empty_maze() for(x = 2; x < x_maze_max; x++) for(y = 0; y < y_maze_max; y++) - if(!SpLev_Map[x][y]) mapcount--; + if(SpLev_Map[x][y]) mapcount--; if ((mapcount > (int) (mapcountmax / 10))) { mapfact = (int) ((mapcount * 100L) / mapcountmax); @@ -2321,6 +2338,7 @@ lev_init *linit; case LVLINIT_MINES: if (linit->lit == -1) linit->lit = rn2(2); if (linit->filling > -1) lvlfill_solid(linit->filling, 0); + linit->icedpools = icedpools; mkmap(linit); break; } @@ -2796,6 +2814,8 @@ spo_level_flags(coder) if (flags & PREMAPPED) coder->premapped = TRUE; if (flags & SHROUD) level.flags.hero_memory = 0; if (flags & GRAVEYARD) level.flags.graveyard = 1; + if (flags & ICEDPOOLS) icedpools = TRUE; + if (flags & SOLIDIFY) coder->solidify = TRUE; opvar_free(flagdata); } @@ -2816,6 +2836,8 @@ spo_initlevel(coder) !OV_pop_i(filling) || !OV_pop_i(init_style)) return; + splev_init_present = TRUE; + init_lev.init_style = OV_i(init_style); init_lev.fg = OV_i(fg); init_lev.bg = OV_i(bg); @@ -2978,16 +3000,10 @@ spo_stair(coder) if (!OV_pop_i(up) || !OV_pop_c(coord)) return; - if (coder->croom) { - get_location_coord(&x, &y, DRY, coder->croom, OV_i(coord)); - mkstairs(x,y,(char)OV_i(up), coder->croom); - SpLev_Map[x][y] = 1; - } else { - get_location_coord(&x, &y, DRY, coder->croom, OV_i(coord)); - if ((badtrap = t_at(x,y)) != 0) deltrap(badtrap); - mkstairs(x, y, (char)OV_i(up), coder->croom); - SpLev_Map[x][y] = 1; - } + get_location_coord(&x, &y, DRY, coder->croom, OV_i(coord)); + if ((badtrap = t_at(x,y)) != 0) deltrap(badtrap); + mkstairs(x, y, (char)OV_i(up), coder->croom); + SpLev_Map[x][y] = 1; opvar_free(coord); opvar_free(up); @@ -3647,7 +3663,7 @@ sel_set_door(dx,dy,arg) typ = D_CLOSED; } levl[x][y].doormask = typ; - /*SpLev_Map[x][y] = 1;*/ + SpLev_Map[x][y] = 1; /* Now the complicated part, list it with each subroom */ /* The dog move and mail daemon routines use this */ @@ -4166,7 +4182,7 @@ redo_maploc: break; case 1: switch((int) halign) { - case LEFT: xstart = 3; break; + case LEFT: xstart = splev_init_present ? 1 : 3; break; case H_LEFT: xstart = 2+((x_maze_max-2-xsize)/4); break; case CENTER: xstart = 2+((x_maze_max-2-xsize)/2); break; case H_RIGHT: xstart = 2+((x_maze_max-2-xsize)*3/4); break; @@ -4220,6 +4236,7 @@ redo_maploc: levl[x][y].horizontal = 0; levl[x][y].roomno = 0; levl[x][y].edge = 0; + SpLev_Map[x][y] = 1; /* * Set secret doors to closed (why not trapped too?). Set * the horizontal bit. @@ -4240,6 +4257,8 @@ redo_maploc: levl[x][y].horizontal = 1; else if(levl[x][y].typ == LAVAPOOL) levl[x][y].lit = 1; + else if (splev_init_present && levl[x][y].typ == ICE) + levl[x][y].icedpool = icedpools ? ICED_POOL : ICED_MOAT; } if (coder->lvl_is_joined) remove_rooms(xstart, ystart, xstart+xsize, ystart+ysize); @@ -4488,12 +4507,15 @@ sp_lev *lvl; coder->frame = frame_new(0); coder->stack = NULL; coder->premapped = FALSE; - /*coder->allow_flips = 3;*/ + coder->solidify = FALSE; coder->croom = NULL; coder->n_subroom = 1; coder->exit_script = FALSE; coder->lvl_is_joined = 0; + splev_init_present = FALSE; + icedpools = FALSE; + if (wizard) { char *met = nh_getenv("SPCODER_MAX_RUNTIME"); if (met && met[0] == '1') max_execution = (1<<30) - 1; @@ -5044,6 +5066,7 @@ next_opcode: count_features(); if (coder->premapped) sokoban_detect(); + if (coder->solidify) solidify_map(); if (coder->frame) { struct sp_frame *tmpframe; diff --git a/util/lev_comp.l b/util/lev_comp.l index b41397030..bba52c270 100644 --- a/util/lev_comp.l +++ b/util/lev_comp.l @@ -293,6 +293,8 @@ mazelevel { savetoken(yytext); yylval.i=MAZELEVEL; return FLAG_TYPE; } premapped { savetoken(yytext); yylval.i=PREMAPPED; return FLAG_TYPE; } shroud { savetoken(yytext); yylval.i=SHROUD; return FLAG_TYPE; } graveyard { savetoken(yytext); yylval.i=GRAVEYARD; return FLAG_TYPE; } +icedpools { savetoken(yytext); yylval.i=ICEDPOOLS; return FLAG_TYPE; } +solidify { savetoken(yytext); yylval.i=SOLIDIFY; return FLAG_TYPE; } [0-9]+d[0-9]+ { char *p = strchr(yytext, 'd'); savetoken(yytext); if (p) { From 379c23096afdcf0bbe504604539b27004785f385 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 17 Mar 2015 21:22:43 +0200 Subject: [PATCH 215/354] More getpos improvements Look up remembered dungeon features, not user-visible glyphs, and ignore uninteresting features (room, corridor and wall tiles). Original patch by Patric Mueller, from UnNetHack --- doc/fixes35.0 | 1 + src/do_name.c | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 250b09d85..53a9d784e 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1089,6 +1089,7 @@ change command X to twoweapon toggle pressing @ when cursor positioning moves cursor on top of hero pressing # when cursor positioning toggles automatic description of features under the cursor +cursor positioning ignores uninteresting dungeon features Platform- and/or Interface-Specific New Features diff --git a/src/do_name.c b/src/do_name.c index 37daffbc4..47012d3f3 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -204,9 +204,25 @@ const char *goal; lo_x = (pass == 0 && ty == lo_y) ? cx + 1 : 1; hi_x = (pass == 1 && ty == hi_y) ? cx : COLNO - 1; for (tx = lo_x; tx <= hi_x; tx++) { - k = levl[tx][ty].glyph; + /* look at dungeon feature, not at user-visible glyph */ + k = back_to_glyph(tx,ty); + /* uninteresting background glyph */ if (glyph_is_cmap(k) && - matching[glyph_to_cmap(k)]) { + (IS_DOOR(levl[tx][ty].typ) || + glyph_to_cmap(k) == S_room || + glyph_to_cmap(k) == S_corr || + glyph_to_cmap(k) == S_litcorr)) { + /* what the hero remembers to be at tx,ty */ + k = glyph_at(tx, ty); + } + if (glyph_is_cmap(k) && + matching[glyph_to_cmap(k)] && + levl[tx][ty].seenv && + (!IS_WALL(levl[tx][ty].typ)) && + (levl[tx][ty].typ != SDOOR) && + glyph_to_cmap(k) != S_room && + glyph_to_cmap(k) != S_corr && + glyph_to_cmap(k) != S_litcorr) { cx = tx, cy = ty; if (msg_given) { clear_nhwindow(WIN_MESSAGE); From c80828fe7aff35131cb4b36267858718662126c0 Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 17 Mar 2015 22:40:57 -0400 Subject: [PATCH 216/354] Start to prepare dat/history for release This gets the history started. Please review/correct/improve and fill in the various items I've flagged. --- dat/history | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 64 insertions(+), 3 deletions(-) diff --git a/dat/history b/dat/history index b97c99039..0e15a079c 100644 --- a/dat/history +++ b/dat/history @@ -1,4 +1,4 @@ -NetHack History file for release 3.4 +NetHack History file for release 3.6 Behold, mortal, the origins of NetHack... @@ -120,7 +120,6 @@ publicly available web-site listing all the bugs that had been discovered. Despite that constantly growing bug list, 3.3 proved stable enough to last for more than a year and a half. - The 3.4 development team initially consisted of Michael Allison, Ken Arromdee, David Cohrs, Jessie Collet, Kevin Hugo, Ken Lorber, Dean Luick, Pat Rankin, Mike Stephenson, Janet Walz, and Paul Winner, with Warwick Allison joining @@ -150,7 +149,69 @@ Amiga port of 3.5 after Janne Salmijarvi resurrected it for 3.3.1. Christian `Marvin' Bressler maintained 3.5 for the Atari after he resurrected it for 3.3.1. -There is a NetHack web site maintained by Ken Lorber at http://www.nethack.org/. +The release of NetHack 3.4.3 in December 2003 marked the beginning of a +long release hiatus. 3.4.3 proved to be a remarkably stable version that +provided continued enjoyment by the community for more than a decade. The +devteam slowly and quietly continued to work on the game behind the scenes +during the tenure of 3.4.3. It was during that same period that several new +variants emerged within the NetHack community. Notably sporkhack by +Derek S. Ray, unnethack by Patric Mueller, nitrohack and its successors +originally by Daniel Thaler and then by Alex Smith, and +Dynahack by Tung Nguyen. Some of those variants continue to be developed, +maintained, and enjoyed by the community to this day. + +In September 2014, an interim snapshot of the code under development was +released publicly by other parties. Since that code was a work-in-progress +and had not gone through a period of debugging, it was decided that the +version numbers present on that code snapshot would be retired and never +used in an official NetHack release. An announcement was posted on the +devteam's official nethack.org website to that effect, stating that there +would never be a 3.4.4, 3.5, or 3.5.0 official release version. + +In January 2015, preparation began for the release of NetHack 3.6. + +At the beginning of development for what would eventually get released +as 3.6.0, the development team consisted of Michael Allison, +Warwick Allison, Ken Arromdee, David Cohrs, Jessie Collet, Ken Lorber, +Dean Luick, Pat Rankin, Mike Stephenson, Janet Walz, and Paul Winner. + +Leading up to the release of 3.6.0 in early 2015, new members Sean Hunt, +Pasi Kallinen, and Derek S. Ray joined the NetHack development team. + +3.6.0 - insert apprpriate description of 3.6.0 here + +The development team, as well as Steve VanDevender and Kevin Smolkowski +ensured that NetHack 3.6.0 continued to operate on various Unix flavors +as well as maintaining the X11 interface. + +Ken Lorber, Haoyang Wang, Pat Rankin, and Dean Luick maintained the port +of NetHack 3.6.0 for Mac. + +Michael Allison, Derek S. Ray, Yitzhak Sapir, Alex Kompel, and David Cohrs +maintained the port of NetHack 3.6.0 for Microsoft Windows. + +Jeff Bailey created and maintained a port of NetHack 3.6.0 for Chrome. + +Alex Kompel maintained a port of NetHack 3.6.0 to Windows Phone. ? + +This version of the game is special in a particular way. Near the end of +the development of 3.6, one of the significant inspirations for many of the +humorous and fun features found in the game, author Terry Pratchett, +passed away. This version of the game is dedicated to + + +An official NetHack web site continues to be maintained by Ken Lorber at +http://www.nethack.org/. + +-- +SHOUT-OUTS + +The devteam would like to give a special "shout-out" to thank the generous +people primarily responsible for the public NetHack servers available for +playing the game at nethack.alt.org and devnull.net. In addition to providing +a way for the public to play a game of NetHack from almost anywhere, they +have hosted annual NetHack tournaments for many, many years. + write up something for Robin, M. Drew Streib, Pasi Kallinen - - - - - - - - - - From e93add8cb8e0ed782ec6da0beebf4d18d5c6f59a Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 18 Mar 2015 21:40:54 +0200 Subject: [PATCH 217/354] Prevent segfault, water_damage may get a NULL obj --- src/trap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/trap.c b/src/trap.c index 36c1ee632..bc8f0c746 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3159,6 +3159,8 @@ boolean force; { boolean exploded = FALSE; + if (!obj) return ER_NOTHING; + if (snuff_lit(obj)) return ER_DAMAGED; From debdf7ca48fc7b9c8b7b3698147d05312a605092 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 18 Mar 2015 22:05:10 +0200 Subject: [PATCH 218/354] Move some hard-coded string arrays into data files. Random epitaphs, engravings and hallucinatory monsters now live in text data files. --- dat/bogusmon.txt | 177 ++++++++++++++++++++++++++++++++++++++++++ dat/engrave.txt | 45 +++++++++++ dat/epitaph.txt | 32 ++++++++ doc/makedefs.6 | 9 +++ include/extern.h | 5 +- include/global.h | 3 + src/do_name.c | 115 ++++++--------------------- src/eat.c | 2 +- src/engrave.c | 73 +++-------------- src/explode.c | 4 +- src/fountain.c | 2 +- src/muse.c | 2 +- src/pickup.c | 2 +- src/potion.c | 2 +- src/priest.c | 5 +- src/rumors.c | 40 ++++++++++ src/sounds.c | 2 +- src/timeout.c | 2 +- src/trap.c | 2 +- src/zap.c | 2 +- sys/unix/Makefile.dat | 11 ++- sys/unix/Makefile.top | 11 ++- util/makedefs.c | 46 ++++++++++- 23 files changed, 420 insertions(+), 174 deletions(-) create mode 100644 dat/bogusmon.txt create mode 100644 dat/engrave.txt create mode 100644 dat/epitaph.txt diff --git a/dat/bogusmon.txt b/dat/bogusmon.txt new file mode 100644 index 000000000..8c7aba45b --- /dev/null +++ b/dat/bogusmon.txt @@ -0,0 +1,177 @@ +# Hallucinatory monsters +# +# +# prefix codes: +# dash - female, personal name +# underscore _ female, general name +# plus + male, personal name +# vertical bar | male, general name +# equals = gender not specified, personal name + +# misc. +jumbo shrimp +giant pigmy +gnu +killer penguin +giant cockroach +giant slug +maggot +pterodactyl +tyrannosaurus rex +basilisk +beholder +nightmare +efreeti +marid +rot grub +bookworm +master lichen +shadow +hologram +jester +attorney +sleazoid +killer tomato +amazon +robot +battlemech +rhinovirus +harpy +lion-dog +rat-ant +Y2K bug + +# Quendor (Zork, &c.) +grue +Christmas-tree monster +luck sucker +paskald +brogmoid +dornbeast + +# Moria +Ancient Multi-Hued Dragon ++Evil Iggy + +# Rogue +emu +kestrel +xeroc +venus flytrap + +# Wizardry +creeping coins + +# Greek legend +hydra +siren + +# Monty Python +killer bunny + +# The Princess Bride +rodent of unusual size + +# Wallace & Gromit +were-rabbit + +# "Only you can prevent forest fires! ++Smokey Bear + +# Discworld +Luggage + +# Lord of the Rings +Ent + +# Xanth +tangle tree +nickelpede +wiggle + +# Lewis Carroll +white rabbit +snark + +# Dr. Dolittle +pushmi-pullyu + +# The Smurfs +smurf + +# Star Trek +tribble +Klingon +Borg + +# Star Wars +Ewok + +# Tonari no Totoro +Totoro + +# Nausicaa +ohmu + +# Sailor Moon +youma + +# Pokemon (Meowth) +nyaasu + +# monster movies +-Godzilla ++King Kong + +# old L of SH +earthquake beast + +# Robotech +Invid + +# The Terminator +Terminator + +# Bubblegum Crisis +boomer + +# Dr. Who ("Exterminate!") +Dalek + +# HGttG +microscopic space fleet +Ravenous Bugblatter Beast of Traal + +# TMNT +teenage mutant ninja turtle + +# Usagi Yojimbo +samurai rabbit + +# Cerebus +aardvark + +# Little Shop of Horrors +=Audrey II + +# 50's rock 'n' roll +witch doctor +one-eyed one-horned flying purple people eater + +# saccharine kiddy TV ++Barney the dinosaur + +# Angband ++Morgoth + +# Babylon 5 +Vorlon + +# King Arthur +questing beast + +# Movie +Predator + +# common pest +mother-in-law diff --git a/dat/engrave.txt b/dat/engrave.txt new file mode 100644 index 000000000..6827c8a9a --- /dev/null +++ b/dat/engrave.txt @@ -0,0 +1,45 @@ +# Random engravings on the floor +# +Elbereth +# trap engravings +Vlad was here +ad aerarium + +# take-offs and other famous engravings +Owlbreath +Galadriel +Kilroy was here + +# Journey to the Center of the Earth +A.S. -> +<- A.S. +# Adventure +You won't get it up the steps +# Inferno +Lasciate ogni speranza o voi ch'entrate. +# Prisoner +Well Come +# So Long... +We apologize for the inconvenience. +# Thriller +See you next Wednesday +# Smokey Stover +notary sojak + +For a good time call 8?7-5309 +# Various zoos around the world +Please don't feed the animals. +# A palindrome +Madam, in Eden, I'm Adam. +# Siskel & Ebert +Two thumbs up! +# The First C Program +Hello, World! +^?MAIL +# AOL +You've got mail! +^. +# Clueless +As if! +# 200x incarnation of Dr.Who +BAD WOLF diff --git a/dat/epitaph.txt b/dat/epitaph.txt new file mode 100644 index 000000000..79019ea45 --- /dev/null +++ b/dat/epitaph.txt @@ -0,0 +1,32 @@ +# Epitaphs for random headstones +# +# +Rest in peace +R.I.P. +Rest In Pieces +Note -- there are NO valuable items in this grave +1994-1995. The Longest-Lived Hacker Ever +The Grave of the Unknown Hacker +We weren't sure who this was, but we buried him here anyway +Sparky -- he was a very good dog +Beware of Electric Third Rail +Made in Taiwan +Og friend. Og good dude. Og died. Og now food +Beetlejuice Beetlejuice Beetlejuice +Look out below! +Please don't dig me up. I'm perfectly happy down here. -- Resident +Postman, please note forwarding address: Gehennom, Asmodeus's Fortress, fifth lemure on the left +Mary had a little lamb/Its fleece was white as snow/When Mary was in trouble/The lamb was first to go +Be careful, or this could happen to you! +Soon you'll join this fellow in hell! -- the Wizard of Yendor +Caution! This grave contains toxic waste +Sum quod eris +Here lies an Atheist, all dressed up and no place to go +Here lies Ezekiel, age 102. The good die young. +Here lies my wife: Here let her lie! Now she's at rest and so am I. +Here lies Johnny Yeast. Pardon me for not rising. +He always lied while on the earth and now he's lying in it +I made an ash of myself +Soon ripe. Soon rotten. Soon gone. But not forgotten. +Here lies the body of Jonathan Blake. Stepped on the gas instead of the brake. +Go away! diff --git a/doc/makedefs.6 b/doc/makedefs.6 index 7b850108c..61bd7c741 100644 --- a/doc/makedefs.6 +++ b/doc/makedefs.6 @@ -105,6 +105,15 @@ Generate the file. .br .TP +.B -s +Generate the +.I bogusmon +, +.I engrave +and +.IR epitaph files. +.br +.TP .B -h Generate the .B oracles diff --git a/include/extern.h b/include/extern.h index fc3952804..23d10d324 100644 --- a/include/extern.h +++ b/include/extern.h @@ -387,7 +387,7 @@ E char *FDECL(Adjmonnam, (struct monst *,const char *)); E char *FDECL(Amonnam, (struct monst *)); E char *FDECL(a_monnam, (struct monst *)); E char *FDECL(distant_monnam, (struct monst *,int,char *)); -E const char *NDECL(rndmonnam); +E char *FDECL(rndmonnam, (char *)); E const char *FDECL(hcolor, (const char *)); E const char *NDECL(rndcolor); E const char *NDECL(roguename); @@ -1174,7 +1174,7 @@ E struct obj *FDECL(mkobj_at, (CHAR_P,int,int,BOOLEAN_P)); E struct obj *FDECL(mksobj_at, (int,int,int,BOOLEAN_P,BOOLEAN_P)); E struct obj *FDECL(mkobj, (CHAR_P,BOOLEAN_P)); E int NDECL(rndmonnum); -E boolean FDECL(bogon_is_pname, (const char *)); +E boolean FDECL(bogon_is_pname, (CHAR_P)); E struct obj *FDECL(splitobj, (struct obj *,long)); E void FDECL(replace_object, (struct obj *,struct obj *)); E void FDECL(bill_dummy_object, (struct obj *)); @@ -1931,6 +1931,7 @@ E const char *NDECL(Goodbye); /* ### rumors.c ### */ E char *FDECL(getrumor, (int,char *, BOOLEAN_P)); +E char *FDECL(get_rnd_text, (const char *, char *)); E void FDECL(outrumor, (int,int)); E void FDECL(outoracle, (BOOLEAN_P, BOOLEAN_P)); E void FDECL(save_oracles, (int,int)); diff --git a/include/global.h b/include/global.h index 6179409bb..a67066d64 100644 --- a/include/global.h +++ b/include/global.h @@ -30,6 +30,9 @@ #define OPTIONFILE "opthelp" /* file explaining runtime options */ #define OPTIONS_USED "options" /* compile-time options, for #version */ #define SYMBOLS "symbols" /* replacement symbol sets */ +#define EPITAPHFILE "epitaph" /* random epitaphs on graves */ +#define ENGRAVEFILE "engrave" /* random engravings on the floor */ +#define BOGUSMONFILE "bogusmon" /* hallucinatory monsters */ #define LEV_EXT ".lev" /* extension for special level files */ diff --git a/src/do_name.c b/src/do_name.c index 47012d3f3..0f837c9d4 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -809,10 +809,10 @@ boolean called; /* Put the actual monster name or type into the buffer now */ /* Be sure to remember whether the buffer starts with a name */ if (do_hallu) { - const char *rname = rndmonnam(); - + char rnamecode; + char *rname = rndmonnam(&rnamecode); Strcat(buf, rname); - name_at_start = bogon_is_pname(rname); + name_at_start = bogon_is_pname(rnamecode); } else if (has_mname(mtmp)) { char *name = MNAME(mtmp); @@ -1006,113 +1006,44 @@ char *outbuf; return outbuf; } -/* - * Name prefix codes (same as shknam.c): - * dash - female, personal name - * underscore _ female, general name - * plus + male, personal name - * vertical bar | male, general name - * equals = gender not specified, personal name - */ - -static const char * const bogusmons[] = { - "jumbo shrimp", "giant pigmy", "gnu", "killer penguin", - "giant cockroach", "giant slug", "maggot", "pterodactyl", - "tyrannosaurus rex", "basilisk", "beholder", "nightmare", - "efreeti", "marid", "rot grub", "bookworm", "master lichen", - "shadow", "hologram", "jester", "attorney", "sleazoid", - "killer tomato", "amazon", "robot", "battlemech", - "rhinovirus", "harpy", "lion-dog", "rat-ant", "Y2K bug", - /* misc. */ - "grue", "Christmas-tree monster", "luck sucker", "paskald", - "brogmoid", "dornbeast", /* Quendor (Zork, &c.) */ - "Ancient Multi-Hued Dragon", "+Evil Iggy", - /* Moria */ - "emu", "kestrel", "xeroc", "venus flytrap", - /* Rogue */ - "creeping coins", /* Wizardry */ - "hydra", "siren", /* Greek legend */ - "killer bunny", /* Monty Python */ - "rodent of unusual size", /* The Princess Bride */ - "were-rabbit", /* Wallace & Gromit */ - "+Smokey Bear", /* "Only you can prevent forest fires!" */ - "Luggage", /* Discworld */ - "Ent", /* Lord of the Rings */ - "tangle tree", "nickelpede", "wiggle", /* Xanth */ - "white rabbit", "snark", /* Lewis Carroll */ - "pushmi-pullyu", /* Dr. Dolittle */ - "smurf", /* The Smurfs */ - "tribble", "Klingon", "Borg", /* Star Trek */ - "Ewok", /* Star Wars */ - "Totoro", /* Tonari no Totoro */ - "ohmu", /* Nausicaa */ - "youma", /* Sailor Moon */ - "nyaasu", /* Pokemon (Meowth) */ - "-Godzilla", "+King Kong", /* monster movies */ - "earthquake beast", /* old L of SH */ - "Invid", /* Robotech */ - "Terminator", /* The Terminator */ - "boomer", /* Bubblegum Crisis */ - "Dalek", /* Dr. Who ("Exterminate!") */ - "microscopic space fleet", "Ravenous Bugblatter Beast of Traal", - /* HGttG */ - "teenage mutant ninja turtle", /* TMNT */ - "samurai rabbit", /* Usagi Yojimbo */ - "aardvark", /* Cerebus */ - "=Audrey II", /* Little Shop of Horrors */ - "witch doctor", "one-eyed one-horned flying purple people eater", - /* 50's rock 'n' roll */ - "+Barney the dinosaur", /* saccharine kiddy TV */ - "+Morgoth", /* Angband */ - "Vorlon", /* Babylon 5 */ - "questing beast", /* King Arthur */ - "Predator", /* Movie */ - "mother-in-law" /* common pest */ -}; - - +#define BOGUSMONSIZE 100 /* arbitrary */ /* return a random monster name, for hallucination */ -const char * -rndmonnam() +char * +rndmonnam(code) +char *code; { - const char *mname; + static char buf[BUFSZ]; + char *mname = buf; int name; + if (code) *code = '\0'; + do { - name = rn1(SPECIAL_PM + SIZE(bogusmons) - LOW_PM, LOW_PM); + name = rn1(SPECIAL_PM + BOGUSMONSIZE - LOW_PM, LOW_PM); } while (name < SPECIAL_PM && (type_is_pname(&mons[name]) || (mons[name].geno & G_NOGEN))); if (name >= SPECIAL_PM) { - mname = bogusmons[name - SPECIAL_PM]; + get_rnd_text(BOGUSMONFILE, buf); /* strip prefix if present */ - if (!letter(*mname)) ++mname; + if (!letter(*mname)) { + if (code) *code = *mname; + ++mname; + } } else { - mname = mons[name].mname; + Strcpy(buf, mons[name].mname); } return mname; } +#undef BOGUSMONSIZE /* scan bogusmons to check whether this name is in the list and has a prefix */ boolean -bogon_is_pname(mname) -const char *mname; +bogon_is_pname(code) +char code; { - const char *bname; - int name; - - if (!mname || !*mname) return FALSE; - if (!strncmpi(mname, "the ", 4)) mname += 4; - /* scan the bogusmons[] list; case sensitive here */ - for (name = 0; name < SIZE(bogusmons); name++) { - bname = bogusmons[name]; - /* we can skip all ordinary entries */ - if (letter(*bname)) continue; - /* starts with a classification code; does rest of name match? */ - if (!strcmp(mname, bname + 1)) - return index("-+=", *bname) ? TRUE : FALSE; - } - return FALSE; + if (!code) return FALSE; + return index("-+=", code) ? TRUE : FALSE; } const char * diff --git a/src/eat.c b/src/eat.c index 983f6bcec..a5b413772 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1252,7 +1252,7 @@ const char *mesg; what = "chicken"; which = 1; /* suppress pluralization */ } else if (Hallucination) { - what = rndmonnam(); + what = rndmonnam(NULL); } else { what = mons[mnum].mname; if (the_unique_pm(&mons[mnum])) which = 2; diff --git a/src/engrave.c b/src/engrave.c index ebfcd0829..5a8aa38f3 100644 --- a/src/engrave.c +++ b/src/engrave.c @@ -9,33 +9,6 @@ STATIC_VAR NEARDATA struct engr *head_engr; -/* random engravings */ -static const char *random_mesg[] = { - "Elbereth", - /* trap engravings */ - "Vlad was here", "ad aerarium", - /* take-offs and other famous engravings */ - "Owlbreath", "Galadriel", - "Kilroy was here", - "A.S. ->", "<- A.S.", /* Journey to the Center of the Earth */ - "You won't get it up the steps", /* Adventure */ - "Lasciate ogni speranza o voi ch'entrate.", /* Inferno */ - "Well Come", /* Prisoner */ - "We apologize for the inconvenience.", /* So Long... */ - "See you next Wednesday", /* Thriller */ - "notary sojak", /* Smokey Stover */ - "For a good time call 8?7-5309", - "Please don't feed the animals.", /* Various zoos around the world */ - "Madam, in Eden, I'm Adam.", /* A palindrome */ - "Two thumbs up!", /* Siskel & Ebert */ - "Hello, World!", /* The First C Program */ -#ifdef MAIL - "You've got mail!", /* AOL */ -#endif - "As if!", /* Clueless */ - "BAD WOLF", /* 200x incarnation of Dr.Who */ -}; - char * random_engraving(outbuf) char *outbuf; @@ -44,8 +17,10 @@ char *outbuf; /* a random engraving may come from the "rumors" file, or from the list above */ - if (!rn2(4) || !(rumor = getrumor(0, outbuf, TRUE)) || !*rumor) - Strcpy(outbuf, random_mesg[rn2(SIZE(random_mesg))]); + if (!rn2(4) || !(rumor = getrumor(0, outbuf, TRUE)) || !*rumor) { + char buf[BUFSZ]; + Strcpy(outbuf, get_rnd_text(ENGRAVEFILE, buf)); + } wipeout_text(outbuf, (int)(strlen(outbuf) / 4), 0); return outbuf; @@ -1232,39 +1207,6 @@ struct engr *ep; } -/* Epitaphs for random headstones */ -static const char *epitaphs[] = { - "Rest in peace", - "R.I.P.", - "Rest In Pieces", - "Note -- there are NO valuable items in this grave", - "1994-1995. The Longest-Lived Hacker Ever", - "The Grave of the Unknown Hacker", - "We weren't sure who this was, but we buried him here anyway", - "Sparky -- he was a very good dog", - "Beware of Electric Third Rail", - "Made in Taiwan", - "Og friend. Og good dude. Og died. Og now food", - "Beetlejuice Beetlejuice Beetlejuice", - "Look out below!", - "Please don't dig me up. I'm perfectly happy down here. -- Resident", - "Postman, please note forwarding address: Gehennom, Asmodeus's Fortress, fifth lemure on the left", - "Mary had a little lamb/Its fleece was white as snow/When Mary was in trouble/The lamb was first to go", - "Be careful, or this could happen to you!", - "Soon you'll join this fellow in hell! -- the Wizard of Yendor", - "Caution! This grave contains toxic waste", - "Sum quod eris", - "Here lies an Atheist, all dressed up and no place to go", - "Here lies Ezekiel, age 102. The good die young.", - "Here lies my wife: Here let her lie! Now she's at rest and so am I.", - "Here lies Johnny Yeast. Pardon me for not rising.", - "He always lied while on the earth and now he's lying in it", - "I made an ash of myself", - "Soon ripe. Soon rotten. Soon gone. But not forgotten.", - "Here lies the body of Jonathan Blake. Stepped on the gas instead of the brake.", - "Go away!" -}; - /* Create a headstone at the given location. * The caller is responsible for newsym(x, y). */ @@ -1280,9 +1222,12 @@ const char *str; levl[x][y].typ = GRAVE; /* Engrave the headstone */ - if (!str) str = epitaphs[rn2(SIZE(epitaphs))]; del_engr_at(x, y); - make_engr_at(x, y, str, 0L, HEADSTONE); + if (str) make_engr_at(x, y, str, 0L, HEADSTONE); + else { + char buf[BUFSZ]; + make_engr_at(x, y, get_rnd_text(EPITAPHFILE, buf), 0L, HEADSTONE); + } return; } diff --git a/src/explode.c b/src/explode.c index 65dbe82a5..905b7b94b 100644 --- a/src/explode.c +++ b/src/explode.c @@ -283,7 +283,7 @@ int expltype; so avoid any which begins with a capital letter) */ do { Sprintf(hallu_buf, "%s explosion", - s_suffix(rndmonnam())); + s_suffix(rndmonnam(NULL))); } while (*hallu_buf != lowc(*hallu_buf)); str = hallu_buf; } @@ -365,7 +365,7 @@ int expltype; if (do_hallu) { /* (see explanation above) */ do { Sprintf(hallu_buf, "%s explosion", - s_suffix(rndmonnam())); + s_suffix(rndmonnam(NULL))); } while (*hallu_buf != lowc(*hallu_buf)); str = hallu_buf; } diff --git a/src/fountain.c b/src/fountain.c index e87748e0a..88fb6e2a4 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -39,7 +39,7 @@ dowatersnakes() /* Fountain of snakes! */ if (!(mvitals[PM_WATER_MOCCASIN].mvflags & G_GONE)) { if (!Blind) pline("An endless stream of %s pours forth!", - Hallucination ? makeplural(rndmonnam()) : "snakes"); + Hallucination ? makeplural(rndmonnam(NULL)) : "snakes"); else You_hear("%s hissing!", something); while(num-- > 0) diff --git a/src/muse.c b/src/muse.c index 855a91887..9ea9c1d14 100644 --- a/src/muse.c +++ b/src/muse.c @@ -88,7 +88,7 @@ struct obj *obj; if (vis) { pline("As %s opens the bottle, an enormous %s emerges!", mon_nam(mon), - Hallucination ? rndmonnam() : (const char *)"ghost"); + Hallucination ? rndmonnam(NULL) : (const char *)"ghost"); pline("%s is frightened to death, and unable to move.", Monnam(mon)); } diff --git a/src/pickup.c b/src/pickup.c index 3eba9874f..1d78dea76 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -2040,7 +2040,7 @@ struct obj *box; (void) add_to_container(box, deadcat); } pline_The("%s inside the box is dead!", - Hallucination ? rndmonnam() : "housecat"); + Hallucination ? rndmonnam(NULL) : "housecat"); } box->owt = weight(box); return; diff --git a/src/potion.c b/src/potion.c index d4bfcdad3..0af019181 100644 --- a/src/potion.c +++ b/src/potion.c @@ -371,7 +371,7 @@ ghost_from_bottle() return; } pline("As you open the bottle, an enormous %s emerges!", - Hallucination ? rndmonnam() : (const char *)"ghost"); + Hallucination ? rndmonnam(NULL) : (const char *)"ghost"); if(flags.verbose) You("are frightened to death, and unable to move."); nomul(-3); diff --git a/src/priest.c b/src/priest.c index 1ef7ea286..a28f2b8d4 100644 --- a/src/priest.c +++ b/src/priest.c @@ -284,13 +284,14 @@ char *pname; /* caller-supplied output buffer */ boolean do_hallu = Hallucination, aligned_priest = mon->data == &mons[PM_ALIGNED_PRIEST], high_priest = mon->data == &mons[PM_HIGH_PRIEST]; - const char *what = do_hallu ? rndmonnam() : mon->data->mname; + char whatcode = '\0'; + const char *what = do_hallu ? rndmonnam(&whatcode) : mon->data->mname; if (!mon->ispriest && !mon->isminion) /* should never happen... */ return strcpy(pname, what); /* caller must be confused */ *pname = '\0'; - if (!do_hallu || !bogon_is_pname(what)) Strcat(pname, "the "); + if (!do_hallu || !bogon_is_pname(whatcode)) Strcat(pname, "the "); if (mon->minvis) Strcat(pname, "invisible "); if (mon->isminion && EMIN(mon)->renegade) Strcat(pname, "renegade "); diff --git a/src/rumors.c b/src/rumors.c index 081b81d8d..4bcb5c177 100644 --- a/src/rumors.c +++ b/src/rumors.c @@ -266,6 +266,46 @@ rumor_check() } } + +/* Gets a random line of text from file 'fname', and returns it. */ +char * +get_rnd_text(fname, buf) +const char *fname; +char *buf; +{ + dlb *fh; + + buf[0] = '\0'; + + fh = dlb_fopen(fname, "r"); + + if (fh) { + /* TODO: cache sizetxt, starttxt, endtxt. maybe cache file contents? */ + long sizetxt = 0, starttxt = 0, endtxt = 0, tidbit = 0; + char *endp, line[BUFSZ], xbuf[BUFSZ]; + (void) dlb_fgets(line, sizeof line, fh); /* skip "don't edit" comment */ + + (void) dlb_fseek(fh, 0L, SEEK_CUR); + starttxt = dlb_ftell(fh); + (void) dlb_fseek(fh, 0L, SEEK_END); + endtxt = dlb_ftell(fh); + sizetxt = endtxt - starttxt; + tidbit = Rand() % sizetxt; + + (void) dlb_fseek(fh, starttxt + tidbit, SEEK_SET); + (void) dlb_fgets(line, sizeof line, fh); + if (!dlb_fgets(line, sizeof line, fh)) { + (void) dlb_fseek(fh, starttxt, SEEK_SET); + (void) dlb_fgets(line, sizeof line, fh); + } + if ((endp = index(line, '\n')) != 0) *endp = 0; + Strcat(buf, xcrypt(line, xbuf)); + (void) dlb_fclose(fh); + } else impossible("Can't open file %s!", fname); + return buf; +} + + void outrumor(truth, mechanism) int truth; /* 1=true, -1=false, 0=either */ diff --git a/src/sounds.c b/src/sounds.c index 3b2ee2f56..6204847e8 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1006,7 +1006,7 @@ dochat() if (!Blind) { if (Hallucination) { /* if you're hallucinating, you can't tell it's a statue */ - pline_The("%s seems not to notice you.", rndmonnam()); + pline_The("%s seems not to notice you.", rndmonnam(NULL)); } else { pline_The("statue seems not to notice you."); diff --git a/src/timeout.c b/src/timeout.c index 481b16ae7..e47d863fb 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -164,7 +164,7 @@ slime_dialogue() if (!Blind) /* [what if you're already green?] */ pline(buf, hcolor(NH_GREEN)); } else - pline(buf, an(Hallucination ? rndmonnam() : "green slime")); + pline(buf, an(Hallucination ? rndmonnam(NULL) : "green slime")); } else pline1(buf); } diff --git a/src/trap.c b/src/trap.c index bc8f0c746..beb24ad9a 100644 --- a/src/trap.c +++ b/src/trap.c @@ -621,7 +621,7 @@ int *fail_reason; "statue"); pline("%s %s!", upstart(statuename), comes_to_life); } else if (Hallucination) { /* They don't know it's a statue */ - pline_The("%s suddenly seems more animated.", rndmonnam()); + pline_The("%s suddenly seems more animated.", rndmonnam(NULL)); } else if (cause == ANIMATE_SHATTER) { if (cansee(x, y)) Sprintf(statuename, "%s%s", shk_your(tmpbuf, statue), diff --git a/src/zap.c b/src/zap.c index 5f39fc30e..3134c8b88 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1799,7 +1799,7 @@ struct obj *obj, *otmp; if (break_statue(obj)) { if (cansee(obj->ox, obj->oy)) { if (Hallucination) - pline_The("%s shatters.", rndmonnam()); + pline_The("%s shatters.", rndmonnam(NULL)); else pline_The("statue shatters."); } else diff --git a/sys/unix/Makefile.dat b/sys/unix/Makefile.dat index ad9cb6e2d..17c543897 100644 --- a/sys/unix/Makefile.dat +++ b/sys/unix/Makefile.dat @@ -9,7 +9,7 @@ NHSROOT=.. # SHELL=E:/GEMINI2/MUPFEL.TTP # UUDECODE=uudecode -VARDAT = data rumors quest.dat oracles options +VARDAT = bogusmon data engrave epitaph rumors quest.dat oracles options all: $(VARDAT) spec_levs quest_levs dungeon @@ -98,6 +98,15 @@ quest.dat: quest.txt ../util/makedefs oracles: oracles.txt ../util/makedefs ../util/makedefs -h +engrave: engrave.txt ../util/makedefs + ../util/makedefs -s + +epitaph: epitaph.txt ../util/makedefs + ../util/makedefs -s + +bogusmon: bogusmon.txt ../util/makedefs + ../util/makedefs -s + # note: 'options' should have already been made when include/date.h was created options: ../util/makedefs ../util/makedefs -v diff --git a/sys/unix/Makefile.top b/sys/unix/Makefile.top index f9e474a5b..77cd28fa1 100644 --- a/sys/unix/Makefile.top +++ b/sys/unix/Makefile.top @@ -56,7 +56,7 @@ VARDIR = $(HACKDIR) # for Gnome # VARDATND = x11tiles pet_mark.xbm rip.xpm mapbg.xpm -VARDATD = data oracles options quest.dat rumors +VARDATD = bogusmon data engrave epitaph oracles options quest.dat rumors VARDAT = $(VARDATD) $(VARDATND) # Some versions of make use the SHELL environment variable as the shell @@ -109,6 +109,15 @@ manpages: data: $(GAME) ( cd dat ; $(MAKE) data ) +engrave: $(GAME) + ( cd dat ; $(MAKE) engrave ) + +bogusmon: $(GAME) + ( cd dat ; $(MAKE) bogusmon ) + +epitaph: $(GAME) + ( cd dat ; $(MAKE) epitaph ) + rumors: $(GAME) ( cd dat ; $(MAKE) rumors ) diff --git a/util/makedefs.c b/util/makedefs.c index f4ca9febb..8555178e1 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -169,6 +169,7 @@ static char *FDECL(bannerc_string, (char *,const char *)); static char *FDECL(xcrypt, (const char *)); static unsigned long FDECL(read_rumors_file, (const char *,int *,long *,unsigned long)); +static void FDECL(do_rnd_access_file, (const char *)); static boolean FDECL(d_filter, (char *)); static boolean FDECL(h_filter, (char *)); static boolean FDECL(ranged_attk,(struct permonst*)); @@ -213,7 +214,7 @@ extern unsigned _stklen = STKSIZ; int main(void) { - const char *def_options = "odemvpqrhz"; + const char *def_options = "odemvpqrshz"; char buf[100]; int len; @@ -329,6 +330,11 @@ char *options; case 'r': case 'R': do_rumors(); break; + case 's': + case 'S': do_rnd_access_file(EPITAPHFILE); + do_rnd_access_file(ENGRAVEFILE); + do_rnd_access_file(BOGUSMONFILE); + break; case 'h': case 'H': do_oracles(); break; @@ -870,6 +876,44 @@ unsigned long old_rumor_offset; return rumor_offset; } + +void +do_rnd_access_file(fname) +const char *fname; +{ + Sprintf(filename, DATA_IN_TEMPLATE, fname); + Strcat(filename, ".txt"); + if (!(ifp = fopen(filename, RDTMODE))) { + perror(filename); + exit(EXIT_FAILURE); + } + filename[0]='\0'; +#ifdef FILE_PREFIX + Strcat(filename, file_prefix); +#endif + Sprintf(eos(filename), DATA_TEMPLATE, fname); + if (!(ofp = fopen(filename, WRTMODE))) { + perror(filename); + exit(EXIT_FAILURE); + } + Fprintf(ofp,"%s",Dont_Edit_Data); + + tfp = getfp(DATA_TEMPLATE, "grep.tmp", WRTMODE); + grep0(ifp, tfp); + ifp = getfp(DATA_TEMPLATE, "grep.tmp", RDTMODE); + + while (fgets(in_line, sizeof in_line, ifp) != 0) { + if (in_line[0] == '#') continue; /* discard comments */ + if (in_line[0] == '\n') continue; /* and empty lines */ + (void) fputs(xcrypt(in_line), ofp); + } + Fclose(ifp); + Fclose(ofp); + + delete_file(DATA_TEMPLATE, "grep.tmp"); + return; +} + void do_rumors() { From 4b0a1af482553c806cfb62d37cedad49c8066fea Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 18 Mar 2015 19:21:29 -0700 Subject: [PATCH 219/354] xlogfile tweak to avoid forcing ANSI C Avoid the C89/C90 feature of implicit concatentation of string literals. XLOG_SEP handling becomes clumsier but will work with pre-ANSI compilers. --- src/topten.c | 95 +++++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 45 deletions(-) diff --git a/src/topten.c b/src/topten.c index cc4aefbe1..12adcc449 100644 --- a/src/topten.c +++ b/src/topten.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 topten.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 topten.c $NHDT-Date: 1426731079 2015/03/19 02:11:19 $ $NHDT-Branch: harder_d8 $:$NHDT-Revision: 1.25 $ */ /* NetHack 3.5 topten.c $Date: 2012/01/24 04:26:15 $ $Revision: 1.23 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -66,8 +66,8 @@ STATIC_DCL void FDECL(discardexcess, (FILE *)); STATIC_DCL void FDECL(readentry, (FILE *,struct toptenentry *)); STATIC_DCL void FDECL(writeentry, (FILE *,struct toptenentry *)); STATIC_DCL void FDECL(writexlentry, (FILE*, struct toptenentry *)); -STATIC_DCL long FDECL(encodeconduct, (void)); -STATIC_DCL long FDECL(encodeachieve, (void)); +STATIC_DCL long NDECL(encodeconduct); +STATIC_DCL long NDECL(encodeachieve); STATIC_DCL void FDECL(free_ttlist, (struct toptenentry *)); STATIC_DCL int FDECL(classmon, (char *,BOOLEAN_P)); STATIC_DCL int FDECL(score_wanted, @@ -295,53 +295,58 @@ struct toptenentry *tt; #endif } -#define XLOG_SEP "\t" /* xlogfile field separator. */ /* as tab is never used in eg. plname or death, no need to mangle those. */ STATIC_OVL void writexlentry(rfile,tt) FILE *rfile; struct toptenentry *tt; { - char buf[DTHSZ+1]; - (void)fprintf(rfile, - "version=%d.%d.%d" - XLOG_SEP "points=%ld" - XLOG_SEP "deathdnum=%d" - XLOG_SEP "deathlev=%d" - XLOG_SEP "maxlvl=%d" - XLOG_SEP "hp=%d" - XLOG_SEP "maxhp=%d" - XLOG_SEP "deaths=%d" - XLOG_SEP "deathdate=%d" - XLOG_SEP "birthdate=%d" - XLOG_SEP "uid=%d", - tt->ver_major, tt->ver_minor, tt->patchlevel, - tt->points, tt->deathdnum, tt->deathlev, - tt->maxlvl, tt->hp, tt->maxhp, tt->deaths, - tt->deathdate, tt->birthdate, tt->uid); - (void)fprintf(rfile, - XLOG_SEP "role=%s" - XLOG_SEP "race=%s" - XLOG_SEP "gender=%s" - XLOG_SEP "align=%s", - tt->plrole, tt->plrace, tt->plgend, tt->plalign); - (void)fprintf(rfile, XLOG_SEP "name=%s", plname); - (void)fprintf(rfile, XLOG_SEP "death=%s", tt->death); - (void)fprintf(rfile, XLOG_SEP "conduct=0x%lx", encodeconduct()); - (void)fprintf(rfile, XLOG_SEP "turns=%ld", moves); - (void)fprintf(rfile, XLOG_SEP "achieve=0x%lx", encodeachieve()); - (void)fprintf(rfile, XLOG_SEP "realtime=%ld", (long)u.urealtime.realtime); - (void)fprintf(rfile, XLOG_SEP "starttime=%ld", (long)ubirthday); - (void)fprintf(rfile, XLOG_SEP "endtime=%ld", (long)u.urealtime.endtime); - (void)fprintf(rfile, XLOG_SEP "gender0=%s", genders[flags.initgend].filecode); - (void)fprintf(rfile, XLOG_SEP "align0=%s", - aligns[1 - u.ualignbase[A_ORIGINAL]].filecode); - fprintf(rfile, "\n"); -} -#undef XLOG_SEP +#define Fprintf (void)fprintf +#define XLOG_SEP '\t' /* xlogfile field separator. */ + char buf[BUFSZ]; -long -encodeconduct(void) + Sprintf(buf, "version=%d.%d.%d", + tt->ver_major, tt->ver_minor, tt->patchlevel); + Sprintf(eos(buf), "%cpoints=%ld%cdeathdnum=%d%cdeathlev=%d", + XLOG_SEP, tt->points, + XLOG_SEP, tt->deathdnum, + XLOG_SEP, tt->deathlev); + Sprintf(eos(buf), "%cmaxlvl=%d%chp=%d%cmaxhp=%d", + XLOG_SEP, tt->maxlvl, + XLOG_SEP, tt->hp, + XLOG_SEP, tt->maxhp); + Sprintf(eos(buf), "%cdeaths=%d%cdeathdate=%ld%cbirthdate=%ld%cuid=%d", + XLOG_SEP, tt->deaths, + XLOG_SEP, tt->deathdate, + XLOG_SEP, tt->birthdate, + XLOG_SEP, tt->uid); + Fprintf(rfile, "%s", buf); + Sprintf(buf, "%crole=%s%crace=%s%cgender=%s%calign=%s", + XLOG_SEP, tt->plrole, + XLOG_SEP, tt->plrace, + XLOG_SEP, tt->plgend, + XLOG_SEP, tt->plalign); + Fprintf(rfile, "%s%cname=%s%cdeath=%s", + buf, /* (already includes separator) */ + XLOG_SEP, plname, + XLOG_SEP, tt->death); + Fprintf(rfile, "%cconduct=0x%lx%cturns=%ld%cachieve=0x%lx", + XLOG_SEP, encodeconduct(), + XLOG_SEP, moves, + XLOG_SEP, encodeachieve()); + Fprintf(rfile, "%crealtime=%ld%cstarttime=%ld%cendtime%ld", + XLOG_SEP, (long)u.urealtime.realtime, + XLOG_SEP, (long)ubirthday, + XLOG_SEP, (long)u.urealtime.endtime); + Fprintf(rfile, "%cgender0=%s%calign0=%s", + XLOG_SEP, genders[flags.initgend].filecode, + XLOG_SEP, aligns[1 - u.ualignbase[A_ORIGINAL]].filecode); + Fprintf(rfile, "\n"); +#undef XLOG_SEP +} + +STATIC_OVL long +encodeconduct() { long e = 0L; @@ -361,8 +366,8 @@ encodeconduct(void) return e; } -long -encodeachieve(void) +STATIC_OVL long +encodeachieve() { long r = 0L; From 357115ae80d443f4404c58f84065353d8dc6d179 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 18 Mar 2015 19:24:43 -0700 Subject: [PATCH 220/354] add bogusmon,engrave,epitaph to dat/.gitignore --- dat/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dat/.gitignore b/dat/.gitignore index 88e516283..1784229ab 100644 --- a/dat/.gitignore +++ b/dat/.gitignore @@ -5,6 +5,9 @@ rip.xpm pet_mark.xbm quest.dat rumors +bogusmon +engrave +epitaph x11tiles *.lev spec_levs From d182920655aea1f5c723977f9ea9e99b7f998b7c Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 18 Mar 2015 23:00:46 -0400 Subject: [PATCH 221/354] update cmdline Makefile --- sys/winnt/Makefile.msc | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 847aa3797..4be6dd3ab 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -305,6 +305,9 @@ PDBFILE= /PDB:"$(O)$(GAME).PDB" MAPFILE= /MAP:"$(O)$(GAME).MAP" INCLDIR= /I..\include +ldebug=/DEBUG +cdebug = -Zi -Od + !IF ("$(ldebug)" != "") !IF ("$(ldebug)" != "/RELEASE") ldebug = /DEBUG @@ -341,14 +344,14 @@ LIBS= user32.lib winmm.lib $(ZLIB) !IF ("$(GRAPHICAL)"=="Y") cflagsGame = $(cdebug) $(cflags2) $(guiflags) $(INCLDIR) \ - $(WINPFLAG) $(DLBFLG) $(GAMEPDBFILE) $(GAMEMAPFILE) -lflagsGame = $(ldebug) $(lflags) $(guilibs) + $(WINPFLAG) $(DLBFLG) +lflagsGame = $(ldebug) $(lflags) $(guilibs) $(GAMEPDBFILE) $(GAMEMAPFILE) !ELSE cflagsGame = $(cdebug) $(cflags2) $(conflags) $(INCLDIR) \ - $(WINPFLAG) $(DLBFLG) $(GAMEPDBFILE) $(GAMEMAPFILE) -lflagsGame = $(ldebug) $(lflags) $(conlibs) + $(WINPFLAG) $(DLBFLG) +lflagsGame = $(ldebug) $(lflags) $(conlibs) $(GAMEPDBFILE) $(GAMEMAPFILE) !ENDIF @@ -607,6 +610,7 @@ all : install install: envchk $(GAME) $(O)install.tag @echo Done. + $(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \ $(DAT)\oracles $(DAT)\quest.dat $(O)sp_lev.tag $(DLB) ! IF ("$(USE_DLB)"=="Y") @@ -840,6 +844,14 @@ $(INCL)\vis_tab.h: $(U)makedefs.exe $(SRC)\vis_tab.c: $(U)makedefs.exe $(U)makedefs -z +$(DAT)\engrave: $(DAT)\engrave.txt $(U)makedefs.exe + ../util/makedefs -s +$(DAT)\epitaph: $(DAT)\epitaph.txt $(U)makedefs.exe + ../util/makedefs -s +$(DAT)\bogusmon: $(DAT)\bogusmon.txt $(U)makedefs.exe + ../util/makedefs -s + + #========================================== # uudecode utility and uuencoded targets #========================================== @@ -1081,7 +1093,7 @@ $(DAT)\porthelp: $(NTSYS)\porthelp nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \ $(DAT)\quest.dat $(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp \ $(DAT)\history $(DAT)\opthelp $(DAT)\wizhelp $(DAT)\dungeon $(DAT)\porthelp \ - $(DAT)\license $(O)sp_lev.tag + $(DAT)\license $(DAT)\engrave $(DAT)\epitaph $(DAT)\bogusmon $(O)sp_lev.tag cd $(DAT) echo data >dlb.lst echo oracles >>dlb.lst @@ -1091,6 +1103,9 @@ nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \ if exist porthelp echo porthelp >>dlb.lst echo quest.dat >>dlb.lst echo rumors >>dlb.lst + echo engrave >>dlb.lst + echo epitaph >>dlb.lst + echo bogusmon >>dlb.lst echo help >>dlb.lst echo hh >>dlb.lst echo cmdhelp >>dlb.lst @@ -1238,6 +1253,9 @@ spotless: clean if exist $(U)*.map del $(U)*.map if exist $(DAT)\data del $(DAT)\data if exist $(DAT)\rumors del $(DAT)\rumors + if exist $(DAT)\engrave del $(DAT)\engrave + if exist $(DAT)\epitaph del $(DAT)\epitaph + if exist $(DAT)\bogusmon del $(DAT)\bogusmon if exist $(DAT)\???-fil?.lev del $(DAT)\???-fil?.lev if exist $(DAT)\???-goal.lev del $(DAT)\???-goal.lev if exist $(DAT)\???-loca.lev del $(DAT)\???-loca.lev From 3cc3709d9535fc9d3b34b0b45a436a8a707eb35e Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 19 Mar 2015 17:41:14 +0200 Subject: [PATCH 222/354] Save xlogfile time_t fields correctly --- include/decl.h | 1 + include/patchlevel.h | 2 +- include/you.h | 1 - src/allmain.c | 6 +++--- src/decl.c | 1 + src/end.c | 2 +- src/restore.c | 15 ++++++++++----- src/save.c | 4 +++- src/topten.c | 8 ++++---- src/u_init.c | 1 + 10 files changed, 25 insertions(+), 16 deletions(-) diff --git a/include/decl.h b/include/decl.h index 2071277dc..bacff08d9 100644 --- a/include/decl.h +++ b/include/decl.h @@ -244,6 +244,7 @@ E NEARDATA anything zeroany; /* init'd and defined in decl.c */ #include "you.h" E NEARDATA struct you u; E NEARDATA time_t ubirthday; +E NEARDATA struct u_realtime urealtime; #include "onames.h" #ifndef PM_H /* (pm.h has already been included via youprop.h) */ diff --git a/include/patchlevel.h b/include/patchlevel.h index 00411a2c2..02b8b3bfa 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -14,7 +14,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 56 +#define EDITLEVEL 57 #define COPYRIGHT_BANNER_A \ "NetHack, Copyright 1985-2012" diff --git a/include/you.h b/include/you.h index 81aba0ba4..0fc5c6073 100644 --- a/include/you.h +++ b/include/you.h @@ -327,7 +327,6 @@ struct you { unsigned udg_cnt; /* how long you have been demigod */ struct u_achieve uachieve; /* achievements */ - struct u_realtime urealtime; struct u_event uevent; /* certain events have happened */ struct u_have uhave; /* you're carrying special objects */ struct u_conduct uconduct; /* KMH, conduct */ diff --git a/src/allmain.c b/src/allmain.c index eb1f2b69b..45c319037 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -533,11 +533,11 @@ newgame() #endif program_state.something_worth_saving++; /* useful data now exists */ - u.urealtime.realtime = (time_t)0L; + urealtime.realtime = (time_t)0L; #if defined(BSD) && !defined(POSIX_TYPES) - (void) time((long *)&u.urealtime.restored); + (void) time((long *)&urealtime.restored); #else - (void) time(&u.urealtime.restored); + (void) time(&urealtime.restored); #endif /* Success! */ diff --git a/src/decl.c b/src/decl.c index 6c83f0f14..d0d29a35f 100644 --- a/src/decl.c +++ b/src/decl.c @@ -136,6 +136,7 @@ NEARDATA struct sysflag sysflags = DUMMY; NEARDATA struct instance_flags iflags = DUMMY; NEARDATA struct you u = DUMMY; NEARDATA time_t ubirthday = DUMMY; +NEARDATA struct u_realtime urealtime = DUMMY; schar lastseentyp[COLNO][ROWNO] = {DUMMY}; /* last seen/touched dungeon typ */ diff --git a/src/end.c b/src/end.c index 111fd1b3a..7ada39767 100644 --- a/src/end.c +++ b/src/end.c @@ -911,7 +911,7 @@ die: topten figure it out separately and possibly getting different time or even day if player is slow responding to --More-- */ endtime = getnow(); - u.urealtime.realtime += (endtime - u.urealtime.restored); + urealtime.realtime += (endtime - urealtime.restored); /* Sometimes you die on the first move. Life's not fair. * On those rare occasions you get hosed immediately, go out diff --git a/src/restore.c b/src/restore.c index 9f336d3ad..4e4502b53 100644 --- a/src/restore.c +++ b/src/restore.c @@ -551,13 +551,18 @@ unsigned int *stuckid, *steedid; amii_setpens(amii_numcolors); /* use colors from save file */ #endif mread(fd, (genericptr_t) &u, sizeof(struct you)); - mread(fd, (genericptr_t) timebuf, 14); - timebuf[14] = '\0'; - ubirthday = time_from_yyyymmddhhmmss(timebuf); + +#define ReadTimebuf(foo) mread(fd, (genericptr_t) timebuf, 14); \ + timebuf[14] = '\0'; \ + foo = time_from_yyyymmddhhmmss(timebuf); + + ReadTimebuf(ubirthday); + ReadTimebuf(urealtime.realtime); + ReadTimebuf(urealtime.restored); #if defined(BSD) && !defined(POSIX_TYPES) - (void) time((long *)&u.urealtime.restored); + (void) time((long *)&urealtime.restored); #else - (void) time(&u.urealtime.restored); + (void) time(&urealtime.restored); #endif diff --git a/src/save.c b/src/save.c index 964847190..807ecd7dc 100644 --- a/src/save.c +++ b/src/save.c @@ -307,9 +307,11 @@ register int fd, mode; #ifdef SYSFLAGS bwrite(fd, (genericptr_t) &sysflags, sizeof(struct sysflag)); #endif - u.urealtime.realtime += (getnow() - u.urealtime.restored); + urealtime.realtime += (getnow() - urealtime.restored); bwrite(fd, (genericptr_t) &u, sizeof(struct you)); bwrite(fd, yyyymmddhhmmss(ubirthday), 14); + bwrite(fd, yyyymmddhhmmss(urealtime.realtime), 14); + bwrite(fd, yyyymmddhhmmss(urealtime.restored), 14); save_killers(fd, mode); /* must come before migrating_objs and migrating_mons are freed */ diff --git a/src/topten.c b/src/topten.c index 12adcc449..b68ad1bce 100644 --- a/src/topten.c +++ b/src/topten.c @@ -334,10 +334,10 @@ struct toptenentry *tt; XLOG_SEP, encodeconduct(), XLOG_SEP, moves, XLOG_SEP, encodeachieve()); - Fprintf(rfile, "%crealtime=%ld%cstarttime=%ld%cendtime%ld", - XLOG_SEP, (long)u.urealtime.realtime, + Fprintf(rfile, "%crealtime=%ld%cstarttime=%ld%cendtime=%ld", + XLOG_SEP, (long)urealtime.realtime, XLOG_SEP, (long)ubirthday, - XLOG_SEP, (long)u.urealtime.endtime); + XLOG_SEP, (long)urealtime.endtime); Fprintf(rfile, "%cgender0=%s%calign0=%s", XLOG_SEP, genders[flags.initgend].filecode, XLOG_SEP, aligns[1 - u.ualignbase[A_ORIGINAL]].filecode); @@ -480,7 +480,7 @@ time_t when; t0->birthdate = yyyymmdd(ubirthday); t0->deathdate = yyyymmdd(when); t0->tt_next = 0; - u.urealtime.endtime = when; + urealtime.endtime = when; #ifdef UPDATE_RECORD_IN_PLACE t0->fpos = -1L; #endif diff --git a/src/u_init.c b/src/u_init.c index bfe54671c..79954841c 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -500,6 +500,7 @@ u_init() (void) memset((genericptr_t)&u, 0, sizeof(u)); u.ustuck = (struct monst *)0; (void) memset((genericptr_t)&ubirthday, 0, sizeof(ubirthday)); + (void) memset((genericptr_t)&urealtime, 0, sizeof(urealtime)); #if 0 /* documentation of more zero values as desirable */ u.usick_cause[0] = 0; From f5ea4e0d1f4eef04d12bbd765cc5e3a3153b78d3 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 19 Mar 2015 18:43:35 +0200 Subject: [PATCH 223/354] Add lots of new hallu monsters --- dat/bogusmon.txt | 306 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 305 insertions(+), 1 deletion(-) diff --git a/dat/bogusmon.txt b/dat/bogusmon.txt index 8c7aba45b..2ec3e7fe7 100644 --- a/dat/bogusmon.txt +++ b/dat/bogusmon.txt @@ -40,6 +40,39 @@ harpy lion-dog rat-ant Y2K bug +angry mariachi +arch-pedant +bluebird of happiness +cardboard golem +duct tape golem +diagonally moving grid bug +evil overlord +newsgroup troll +ninja pirate zombie robot +octarine dragon +gonzo journalist +lag monster +loan shark +possessed waffle iron +poultrygeist +stuffed raccoon puppet +viking +wee green blobbie +wereplatypus +hag of bolding +blancmange +raging nerd +spelling bee +land octopus +frog prince +pigasus +_Semigorgon +conventioneer +large microbat +small megabat +uberhulk +tofurkey ++Dudley # Quendor (Zork, &c.) grue @@ -53,7 +86,13 @@ dornbeast Ancient Multi-Hued Dragon +Evil Iggy -# Rogue +# Rogue V5 http://rogue.rogueforge.net/vade-mecum/ +rattlesnake +ice monster +phantom +quagga +aquator +griffin emu kestrel xeroc @@ -175,3 +214,268 @@ Predator # common pest mother-in-law + +# Actual creatures +praying mantis +beluga whale +chicken +coelacanth +star-nosed mole +lungfish +slow loris +sea cucumber +tapeworm +liger +velociraptor +corpulent porpoise + +# european cryptids +wolpertinger +elwedritsche +skvader ++Nessie +tatzelwurm +dahu + +# fictitious beasts +dropbear +wild haggis +jackalope +flying pig +hippocampus +hippogriff +kelpie + +# Unusually animate body parts +bouncing eye +floating nose +wandering eye + +# Computerese +buffer overflow +dangling pointer +walking disk drive +floating point +regex engine +netsplit +wiki +peer +COBOL + +# bugs +bohrbug +mandelbug +schroedinbug +heisenbug + +# DooM +cacodemon +scrag + +# MST3K ++Crow T. Robot + +# Items and stuff +chess pawn +chocolate pudding +ooblecks +terracotta warrior +hearse +roomba +miniature blimp +dust speck + +# DnD monster +gazebo + +# SciFi elements +gray goo +magnetic monopole +first category perpetual motion device + +# Ultima ++Lord British + +# They Might Be Giants +particle man + +# Robot Finds Kitten +kitten prospecting robot + +# Typography +guillemet +solidus +obelus + +# Their actual character +apostrophe golem +voluptuous ampersand + +# Web comics and animation ++Bob the angry flower ++Strong Bad ++Magical Trevor + +# KoL +one-winged dewinged stab-bat + +# deities +Invisible Pink Unicorn +Flying Spaghetti Monster + +# Monkey Island +three-headed monkey ++El Pollo Diablo + +# modern folklore +little green man + +# Portal +weighted Companion Cube + +# /b/ +/b/tard + +# South Park +manbearpig + +# internet memes +bonsai-kitten +tie-thulu ++Domo-kun +looooooooooooong cat +nyan cat + +# the Internet is made for cat pix +ceiling cat +basement cat +monorail cat + +# POWDER +tridude + +# Radomir Dopieralski +orcus cosmicus + +# Angband +yeek +quylthulg +Greater Hell Beast + +# Souljazz ++Vendor of Yizard + +# Dungeon Crawl Stone Soup ++Sigmund +lernaean hydra ++Ijyb ++Gloorx Vloq ++Blork the orc + +# Wil Wheaton, John Scalzi +unicorn pegasus kitten + +# Minecraft +enderman + +# Pun +wight supremacist + +# Starcraft 2 +zergling + +# Feelings +existential angst +figment of your imagination +flash of insight + +# Fish +ghoti + +# Roald Dahl +vermicious knid + +# Carcassonne +meeple + +# The Wombles +womble + +# Fraggle Rock +fraggle + +# soundex and typos of monsters +gloating eye +flush golem +martyr orc +mortar orc +acid blog +acute blob +aria elemental +aliasing priest +aligned parasite +aligned parquet +aligned proctor +baby balky dragon +baby blues dragon +baby caricature +baby crochet +baby grainy dragon +baby bong worm +baby long word +baby parable worm +barfed devil +beer wight +boor wight +brawny mold +rave spider +clue golem +bust vortex +errata elemental +elastic eel +electrocardiogram eel +fir elemental +tire elemental +flamingo sphere +fallacy golem +frizzed centaur +forest centerfold +fierceness sphere +frosted giant +geriatric snake +gnat ant +giant bath +grant beetle +grind bug +giant mango +glossy golem +gnome laureate +gnome dummy +gooier ooze +green slide +guardian nacho +hell hound pun +high purist +hairnet devil +ice trowel +killer beet +feather golem +lounge worm +mountain lymph +pager golem +pie fiend +prophylactic worm +sock mole +rogue piercer +seesawing sphere +simile mimic +moldier ant +stain vortex +scone giant +umbrella hulk +vampire mace +verbal jabberwock +water lemon +water melon +winged grizzly +yellow wight From 1fd371600d7eb6dca8414044e41ab23542bb6ac8 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 19 Mar 2015 21:13:24 +0200 Subject: [PATCH 224/354] Add some new random engravings --- dat/engrave.txt | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/dat/engrave.txt b/dat/engrave.txt index 6827c8a9a..6390c3ee1 100644 --- a/dat/engrave.txt +++ b/dat/engrave.txt @@ -43,3 +43,40 @@ You've got mail! As if! # 200x incarnation of Dr.Who BAD WOLF + +# Gang tag +Arooo! Werewolves of Yendor! + +# Strategy and pun +Dig for Victory here + +# Pompeii +Gaius Julius Primigenius was here. Why are you late? + +# Helpful guiding +Don't go this way +Go left ---> +<--- Go right +X marks the spot +X <--- You are here. +Here be dragons +Save now, and do your homework! +There was a hole here. It's gone now. +The Vibrating Square +This is a pit! +This is not the dungeon you are looking for. +Watch out, there's a gnome with a wand of death behind that door! + +# Misc fun +This square deliberately left blank. + +# Viking graffiti +Haermund Hardaxe carved these runes + +# Advertising +Need a light? Come visit the Minetown branch of Izchak's Lighting Store! +Snakes on the Astral Plane - Soon in a dungeon near you +You are the one millionth visitor to this place! Please wait 200 turns for your wand of wishing. + +# DnD +Warning, Exploding runes! From 384f519cc868692de840abcb6b092cd8e72cfd41 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 19 Mar 2015 22:01:16 +0200 Subject: [PATCH 225/354] Add lots of new random epitaphs --- dat/epitaph.txt | 364 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 364 insertions(+) diff --git a/dat/epitaph.txt b/dat/epitaph.txt index 79019ea45..58bb62228 100644 --- a/dat/epitaph.txt +++ b/dat/epitaph.txt @@ -30,3 +30,367 @@ I made an ash of myself Soon ripe. Soon rotten. Soon gone. But not forgotten. Here lies the body of Jonathan Blake. Stepped on the gas instead of the brake. Go away! +Alas fair Death, 'twas missed in life - some peace and quiet from my wife +Applaud, my friends, the comedy is finished. +At last... a nice long sleep. +Audi Partem Alteram +Basil, assaulted by bears +Burninated +Confusion will be my epitaph +Do not open until Christmas +Don't be daft, they couldn't hit an elephant at this dist- +Don't forget to stop and smell the roses +Don't let this happen to you! +Dulce et decorum est pro patria mori +Et in Arcadia ego +Fatty and skinny went to bed. Fatty rolled over and skinny was dead. Skinny Smith 1983-2000. +Finally I am becoming stupider no more +Follow me to hell +...for famous men have the whole earth as their memorial +Game over, man. Game over. +Go away! I'm trying to take a nap in here! Bloody adventurers... +Gone fishin' +Good night, sweet prince: And flights of angels sing thee to thy rest! +Go Team Ant! +He farmed his way here +Here lies a programmer. Killed by a fatal error. +Here lies Bob - decided to try an acid blob +Here lies Dudley, killed by another %&#@#& newt. +Here lies Gregg, choked on an egg +Here lies Lies. It's True +Here lies The Lady's maid, died of a Vorpal Blade +Here lies the left foot of Jack, killed by a land mine. Let us know if you find any more of him +He waited too long +I'd rather be sailing +If a man's deeds do not outlive him, of what value is a mark in stone? +I'm gonna make it! +I took both pills! +I will survive! +Killed by a black dragon -- This grave is empty +Let me out of here! +Lookin' good, Medusa. +Mrs. Smith, choked on an apple. She left behind grieving husband, daughter, and granddaughter. +Nobody believed her when she said her feet were killing her +No! I don't want to see my damn conduct! +One corpse, sans head +On the whole, I'd rather be in Minetown +On vacation +Oops. +Out to Lunch +SOLD +Someone set us up the bomb! +Take my stuff, I don't need it anymore +Taking a year dead for tax reasons +The reports of my demise are completely accurate +(This space for sale) +This was actually just a pit, but since there was a corpse, we filled it +This way to the crypt +Tu quoque, Brute? +VACANCY +Welcome! +Wish you were here! +Yea, it got me too +You should see the other guy +...and they made me engrave my own headstone too! +...but the blood has stopped pumping and I am left to decay... + +A masochist is never satisfied. +Ach, 'twas a wee monster in the loch +Adapt. Enjoy. Survive. +Adventure, hah! Excitement, hah! +After all, what are friends for... +After this, nothing will shock me +After three days, fish and guests stink +Age and treachery will always overcome youth and skill +Ageing is not so bad. The real killer is when you stop. +Ain't I a stinker? +Algernon +All else failed... +All hail RNG +All right, we'll call it a draw! +All's well that end well +Alone at last! +Always attack a floating eye from behind! +Am I having fun yet? +And I can still crawl, I'm not dead yet! +And all I wanted was a free lunch +And all of the signs were right there on your face +And don't give me that innocent look either! +And everyone died. Boo hoo hoo. +And here I go again... +And nobody cares until somebody famous dies... +And so it ends? +And so... it begins. +And sometimes the bear eats you. +And then 'e nailed me 'ead to the floor! +And they said it couldn't be done! +And what do I look like? The living? +And yes, it was ALL his fault! +And you said it was pretty here... +Another lost soul +Any day above ground is a good day! +Any more of this and I'll die of a stroke before I'm 30. +Anybody seen my head? +Anyone for deathmatch? +Anything for a change. +Anything that kills you makes you ... well, dead +Anything worth doing is worth overdoing. +Are unicorns supposedly peaceful if you're a virgin? Hah! +Are we all being disintegrated, or is it just me? +At least I'm good at something +Attempted suicide +Auri sacra fames +Auribus teneo lupum +Be prepared +Beauty survives +Been Here. Now Gone. Had a Good Time. +Been through Hell, eh? What did you bring me? +Beg your pardon, didn't recognize you, I've changed a lot. +Being dead builds character +Beloved daughter, a treasure, buried here. +Best friends come and go... Mine just die. +Better be dead than a fat slave +Better luck next time +Beware of Discordians bearing answers +Beware the ... +Bloody Hell... +Bloody barbarians! +Blown upward out of sight: He sought the leak by candlelight +Brains... Brains... Fresh human brains... +Buried the cat. Took an hour. Damn thing kept fighting. +But I disarmed the trap! +CONNECT 1964 - NO CARRIER 1994 +Call me if you need my phone number! +Can YOU fly? +Can you believe that thing is STILL moving? +Can you come up with some better ending for this? +Can you feel anything when I do this? +Can you give me mouth to mouth, you just took my breath away. +Can't I just have a LITTLE peril? +Can't eat, can't sleep, had to bury the husband here. +Can't you hit me?! +Chaos, panic and disorder. My work here is done. +Check enclosed. +Check this out! It's my brain! +Chivalry is only reasonably dead +Coffin for sale. Lifetime guarantee. +Come Monday, I'll be all right. +Come and see the violence inherent in the system +Come back here! I'll bite your bloody knees off! +Commodore Business Machines, Inc. Died for our sins. +Complain to one who can help you +Confess my sins to god? Which one? +Confusion will be my epitaph +Cooties? Ain't no cooties on me! +Could somebody get this noose off me? +Could you check again? My name MUST be there. +Could you please take a breath mint? +Couldn't I be sedated for this? +Courage is looking at your setbacks with serenity +Cover me, I'm going in! +Crash course in brain surgery +Cross my fingers for me. +Curse god and die +Cut to fit +De'Ath +Dead Again? Pardon me for not getting it right the first time! +Dead and loving every moment! +Dear wife of mine. Died of a broken heart, after I took it out of her. +Don't tread on me! +Dragon? What dragon? +Drawn and quartered +Either I'm dead or my watch has stopped. +Eliza -- Was I really alive, or did I just think I was? +Elvis +Enter not into the path of the wicked +Eris? I don't need Eris +Eternal Damnation, Come and stay a long while! +Even The Dead pay taxes (and they aren't Grateful). +Even a tomb stone will say good things when you're down! +Ever notice that live is evil backwards? +Every day is starting to look like Monday +Every day, in every way, I am getting better and better. +Every survival kit should include a sense of humor +Evil I did dwell; lewd did I live +Ex post fucto +Excellent day to have a rotten day. +Excuse me for not standing up. +Experience isn't everything. First, You've got to survive +First shalt thou pull out the Holy Pin +For a Breath, I Tarry... +For recreational use only. +For sale: One soul, slightly used. Asking for 3 wishes. +For some moments in life, there are no words. +Forget Disney World, I'm going to Hell! +Forget about the dog, Beware of my wife. +Funeral - Real fun. +Gawd, it's depressing in here, isn't it? +Genuine Exploding Gravestone. (c)Acme Gravestones Inc. +Get back here! I'm not finished yet... +Go ahead, I dare you to! +Go ahead, it's either you or him. +Goldilocks -- This casket is just right +Gone But Not Forgotten +Gone Underground For Good +Gone away owin' more than he could pay. +Gone, but not forgiven +Got a life. Didn't know what to do with it. +Grave? But I was cremated! +Greetings from Hell - Wish you were here. +HELP! It's dark in here... Oh, my eyes are closed - sorry +Ha! I NEVER pay income tax! +Have you come to raise the dead? +Having a good time can be deadly. +Having a great time. Where am I exactly?? +He died of the flux. +He died today... May we rest in peace! +He got the upside, I got the downside. +He lost his face when he was beheaded. +He missed me first. +He's not dead, he just smells that way. +Help! I've fallen and I can't get up! +Help, I can't wake up! +Here lies Pinocchio +Here lies the body of John Round. Lost at sea and never found. +Here there be dragons +Hey, I didn't write this stuff! +Hodie mihi, cras tibi +Hold my calls +Home Sweet Hell +Humpty Dumpty, a Bad Egg. He was pushed off the wall. +I KNEW this would happen if I lived long enough. +I TOLD you I was sick! +I ain't broke but I am badly bent. +I ain't old. I'm chronologically advantaged. +I am NOT a vampire. I just like to bite..nibble, really! +I am here. Wish you were fine. +I am not dead yet, but watch for further reports. +I believe them bones are me. +I broke his brain. +I can feel it. My mind. It's going. I can feel it. +I can't go to Hell. They're afraid I'm gonna take over! +I can't go to hell, they don't want me. +I didn't believe in reincarnation the last time, either. +I didn't mean it when I said 'Bite me' +I died laughing +I disbelieved in reincarnation in my last life, too. +I hacked myself to death +I have all the time in the world +I knew I'd find a use for this gravestone! +I know my mind. And it's around here someplace. +I lied! I'll never be alright! +I like it better in the dark. +I like to be here when I can. +I may rise but I refuse to shine. +I never get any either. +I said hit HIM with the fireball, not me! +I told you I would never say goodbye. +I used to be amusing. Now I'm just disgusting. +I used up all my sick days, so now I'm calling in dead. +I was killed by +I was somebody. Who, is no business of yours. +I will not go quietly. +I'd give you a piece of my mind... but I can't find it. +I'd rather be breathing +I'll be back! +I'll be mellow when I'm dead. For now, let's PARTY! +I'm doing this only for tax purposes. +I'm not afraid of Death! What's he gonna do? Kill me? +I'm not getting enough money, so I'm not going to engrave anything useful here. +I'm not saying anything. +I'm weeth stupeed ---> +If you thought you had problems... +Ignorance kills daily. +Ignore me... I'm just here for my looks! +Ilene Toofar -- Fell off a cliff +Is that all? +Is there life before Death? +Is this a joke, or a grave matter? +It happens sometimes. People just explode. +It must be Thursday. I never could get the hang of Thursdays. +It wasn't a fair fight +It wasn't so easy. +It's Loot, Pillage and THEN Burn... +Just doing my job here +Killed by diarrhea of mouth and constipation of brain. +Let her RIP +Let it be; I am dead. +Let's play Hide the Corpse +Life is NOT a dream +Madge Ination -- It wasn't all in my head +Meet me in Heaven +Move on, there's nothing to see here. +Mr. Flintstone -- Yabba-dabba-done +My heart is not in this +No one ever died from it +No, you want room 12A, next door. +Nope. No trap on that chest. I swear. +Not again! +Not every soil can bear all things +Now I have a life +Now I lay thee down to sleep... wanna join me? +OK, here is a question: Where ARE your tanlines? +Obesa Cantavit +Oh! An untimely death. +Oh, by the way, how was my funeral? +Oh, honey..I missed you! She said, and fired again. +Ok, so the light does go off. Now let me out of here. +One stone brain +Ooh! Somebody STOP me! +Oops! +Out for the night. Leave a message. +Ow! Do that again! +Pardon my dust. +Part of me still works. +Please, not in front of those orcs! +Prepare to meet me in Heaven +R2D2 -- Rest, Tin Piece +Relax. Nothing ever happens on the first level. +Res omnia mea culpa est +Rest In Pieces +Rest, rest, perturbed spirit. +Rip Torn +She always said her feet were killing her but nobody believed her. +She died of a chest cold. +So let it be written, so let it be done! +So then I says, How do I know you're the real angel of death? +Some patients insist on dying. +Some people have it dead easy, don't they? +Some things are better left buried. +Sure, trust me, I'm a lawyer... +Thank God I wore my corset, because I think my sides have split. +That is all +The Gods DO have a sense of humor: I'm living proof! +The frog's dead. He Kermitted suicide. +This dungeon is a pushover +This elevator doesn't go to Heaven +This gravestone is shareware. To register, please send me 10 zorkmids +This gravestone provided by The Yendorian Grave Services Inc. +This is not an important part of my life. +This one's on me. +This side up +Tim Burr -- Smashed by a tree +Tone it down a bit, I'm trying to get some rest here. +Virtually Alive +We Will Meet Again. +Weep not, he is at rest +Welcome to Dante's. What level please? +Well, at least they listened to my sermon... +Went to be an angel. +What are you doing over there? +What are you smiling at? +What can you say, Death's got appeal...! +What health care? +What pit? +When the gods want to punish you, they answer your prayers. +Where e'er you be let your wind go free. Keeping it in was the death of me! +Where's my refund? +Will let you know for sure in a day or two... +Wizards are wimps +Worms at work, do not disturb! +Would you mind moving a bit? I'm short of breath down here. +Would you quit being evil over my shoulder? +Ya really had me going baby, but now I'm gone. +Yes Dear, just a few more minutes... +You said it wasn't poisonous! +You set my heart aflame. You gave me heartburn. From f2dc48086f4c36102a1bbeee713e2006e2a1660b Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 19 Mar 2015 15:54:17 -0700 Subject: [PATCH 226/354] acid explosion messages from water_damage() Restore the variant phrasing used when more than one stack of potions of acid explode while being inflicted with water damage. First message: "a potion explodes" or "some potions explode"; second and subsequent messages: "another potion explodes" or "more potions explode". This trivial feature stopped working when erosion handling was overhauled and old water_damage was split into current water_damage_chain+water_damage. Augment the message so that vague "potion" is only used when the object's dknown flag isn't set (ie, object hasn't been seen yet). Use " potion" or "potion of acid" otherwise, depending upon whether such potions have been fully discovered. --- src/trap.c | 56 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/src/trap.c b/src/trap.c index beb24ad9a..a0c6fa1b1 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 trap.c $NHDT-Date: 1426558928 2015/03/17 02:22:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.195 $ */ +/* NetHack 3.5 trap.c $NHDT-Date: 1426805491 2015/03/19 22:51:31 $ $NHDT-Branch: water_damage $:$NHDT-Revision: 1.198 $ */ /* NetHack 3.5 trap.c $Date: 2013/03/14 01:58:21 $ $Revision: 1.179 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3145,6 +3145,14 @@ struct obj *obj; erode_obj(obj, NULL, ERODE_CORRODE, EF_GREASE | EF_VERBOSE); } +/* context for water_damage(), managed by water_damage_chain(); + when more than one stack of potions of acid explode while processing + a chain of objects, use alternate phrasing after the first message */ +static struct h2o_ctx { + int dkn_boom, unk_boom; /* track dknown, !dknown separately */ + boolean ctx_valid; +} acid_ctx = { 0, 0, FALSE }; + /* Get an object wet and damage it appropriately. * "ostr", if present, is used instead of the object name in some * messages. @@ -3157,8 +3165,6 @@ struct obj *obj; const char *ostr; boolean force; { - boolean exploded = FALSE; - if (!obj) return ER_NOTHING; if (snuff_lit(obj)) @@ -3203,18 +3209,36 @@ boolean force; return ER_DAMAGED; } else if (obj->oclass == POTION_CLASS) { if (obj->otyp == POT_ACID) { - char *bufp, buf[BUFSZ]; - boolean one = (obj->quan == 1L); - boolean update = carried(obj); + char *bufp; + boolean one = (obj->quan == 1L), + update = carried(obj), + exploded = FALSE; - bufp = strcpy(buf, "potion"); - if (!one) bufp = makeplural(bufp); - /* [should we damage player/monster?] */ + if (Blind && !carried(obj)) obj->dknown = 0; + if (acid_ctx.ctx_valid) + exploded = ((obj->dknown ? acid_ctx.dkn_boom + : acid_ctx.unk_boom) > 0); + /* First message is + * "a [potion| potion|potion of acid] explodes" + * depending on obj->dknown (potion has been seen) and + * objects[POT_ACID].oc_name_known (fully discovered), + * or "some {plural version} explode" when relevant. + * Second and subsequent messages for same chain and + * matching dknown status are + * "another [potion| &c] explodes" or plural + * variant. + */ + bufp = simpleonames(obj); pline("%s %s %s!", /* "A potion explodes!" */ !exploded ? (one ? "A" : "Some") : - (one ? "Another" : "More"), + (one ? "Another" : "More"), bufp, vtense(bufp, "explode")); - exploded = TRUE; + if (acid_ctx.ctx_valid) { + if (obj->dknown) + acid_ctx.dkn_boom++; + else + acid_ctx.unk_boom++; + } setnotworn(obj); delobj(obj); if (update) @@ -3246,10 +3270,20 @@ struct obj *obj; boolean here; { struct obj *otmp; + + /* initialize acid context: so far, neither seen (dknown) potions of + acid nor unseen have exploded during this water damage sequence */ + acid_ctx.dkn_boom = acid_ctx.unk_boom = 0; + acid_ctx.ctx_valid = TRUE; + for (; obj; obj = otmp) { otmp = here ? obj->nexthere : obj->nobj; water_damage(obj, NULL, FALSE); } + + /* reset acid context */ + acid_ctx.dkn_boom = acid_ctx.unk_boom = 0; + acid_ctx.ctx_valid = FALSE; } /* From b1835cc65d23c033c800abfbc3b4f66b73cc8792 Mon Sep 17 00:00:00 2001 From: "Derek S. Ray" Date: Sun, 22 Feb 2015 16:47:40 -0500 Subject: [PATCH 227/354] Swap out Frontier Town with Orctown --- dat/mines.des | 199 +++++++++++++++++++++++++++++--------------------- 1 file changed, 116 insertions(+), 83 deletions(-) diff --git a/dat/mines.des b/dat/mines.des index e9038a200..8382ac777 100644 --- a/dat/mines.des +++ b/dat/mines.des @@ -48,99 +48,132 @@ TRAP: random, random TRAP: random, random +# A tragic accident has occurred in Frontier Town.... +# # Minetown variant 1 -# "Frontier Town" +# Orcish Town - a variant of Frontier Town that has been +# overrun by orcs. Note the barricades (iron bars). # LEVEL: "minetn-1" +FLAGS:mazelevel +INIT_MAP:mines,'.',' ',true,true,random,true +GEOMETRY:center,center +MAP +..................................... +.----------------F------------------. +.|.................................|. +.|.-------------......------------.|. +.|.|...|...|...|......|..|...|...|.|. +.F.|...|...|...|......|..|...|...|.|. +.|.|...|...|...|......|..|...|...|.F. +.|.|...|...|----......------------.|. +.|.---------.......................|. +.|.................................|. +.|.---------.....--...--...........|. +.|.|...|...|----.|.....|.---------.|. +.|.|...|...|...|.|.....|.|..|....|.|. +.|.|...|...|...|.|.....|.|..|....|.|. +.|.|...|...|...|.|.....|.|..|....|.|. +.|.-------------.-------.---------.|. +.|.................................F. +.-----------F------------F----------. +..................................... +ENDMAP -ROOM: "ordinary" , lit, (3,3), (center,center), (31,15) { -FOUNTAIN: (13, 7) -FOUNTAIN: (20, 7) +# Don't let the player fall into his likely death +TELEPORT_REGION:levregion(01,01,20,19),levregion(20,00,70,19) +REGION:(00,00,36,16),lit,"ordinary" +STAIR:levregion(01,03,20,19),(00,00,36,15),up +STAIR:levregion(61,03,75,19),(00,00,36,15),down -# The Town Watch -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watch captain"), random, peaceful +# shame we can't make polluted fountains +FOUNTAIN:(16,09) +FOUNTAIN:(25,09) -SUBROOM: "shop" [90%] , lit, (2,2), (3,4) { - ROOMDOOR: false, closed, south, random +# the altar's defiled; useful for BUC but never coaligned +ALTAR:(20,13),noalign,shrine + +# set up the shop doors; could be broken down +DOOR:random,(5,8) +DOOR:random,(9,8) +DOOR:random,(13,7) +DOOR:random,(22,5) +DOOR:random,(27,7) +DOOR:random,(31,7) +DOOR:random,(5,10) +DOOR:random,(9,10) +DOOR:random,(15,13) +DOOR:random,(25,13) +DOOR:random,(31,11) + +# knock a few holes in the shop interior walls +REPLACE_TERRAIN:(07,04,11,06),'|','.',18% +REPLACE_TERRAIN:(25,04,29,06),'|','.',18% +REPLACE_TERRAIN:(07,12,11,14),'|','.',18% +REPLACE_TERRAIN:(28,12,28,14),'|','.',33% + +# One spot each in most shops... +$place = { (05,04),(09,05),(13,04),(26,04),(31,05),(30,14),(05,14),(10,13),(26,14),(27,13) } +SHUFFLE:$place + +# scatter some bodies +OBJECT:('%',"corpse"),(20,12),montype:"aligned priest" +OBJECT:('%',"corpse"),$place[0],montype:"shopkeeper" +OBJECT:('%',"corpse"),$place[1],montype:"shopkeeper" +OBJECT:('%',"corpse"),$place[2],montype:"shopkeeper" +OBJECT:('%',"corpse"),$place[3],montype:"shopkeeper" +OBJECT:('%',"corpse"),$place[4],montype:"shopkeeper" +OBJECT:('%',"corpse"),random,montype:"watchman" +OBJECT:('%',"corpse"),random,montype:"watchman" +OBJECT:('%',"corpse"),random,montype:"watchman" +OBJECT:('%',"corpse"),random,montype:"watchman" +OBJECT:('%',"corpse"),random,montype:"watch captain" + +# Rubble! +LOOP [9 + 2d5] { + OBJECT[90%]:('`',"boulder"),random + OBJECT:('*',"rock"),random } -SUBROOM: "tool shop" [90%], lit, (2,9), (3,4) { - ROOMDOOR: false, closed, north, random +# Guarantee 7 candles since we won't have Izchak available +OBJECT:('(',"wax candle"),$place[0],quantity:1d2 +OBJECT:('(',"wax candle"),$place[1],quantity:2d2 +OBJECT:('(',"wax candle"),$place[2],quantity:1d2 +OBJECT:('(',"tallow candle"),$place[3],quantity:1d3 +OBJECT:('(',"tallow candle"),$place[2],quantity:1d2 +OBJECT:('(',"tallow candle"),$place[0],quantity:1d2 + +# go ahead and leave a lamp next to one corpse to be suggestive +# and some empty wands... +OBJECT:('(',"oil lamp"),$place[2] +OBJECT:('/',"striking"),$place[1],uncursed,0 +OBJECT:('/',"striking"),$place[3],uncursed,0 +OBJECT:('/',"striking"),$place[4],uncursed,0 +OBJECT:('/',"magic missile"),$place[4],uncursed,0 +OBJECT:('/',"magic missile"),$place[0],uncursed,0 + +# the Orcish Army + +$inside = selection: floodfill(18,8) +$near_temple = selection: filter(fillrect(17,8, 23,14), $inside) + +LOOP [5 + 1d10] { + MONSTER[50%]: ('o', "orc-captain"), rndcoord($inside), hostile + MONSTER[80%]: ('o', "Uruk-hai"), rndcoord($inside), hostile + MONSTER: ('o', "Mordor orc"), rndcoord($inside), hostile +} +# shamans can be hanging out in/near the temple +LOOP [2d3] { + MONSTER: ('o', "orc shaman"), rndcoord($near_temple), hostile +} +# these are not such a big deal +# to run into outside the bars +LOOP [9 + 2d5] { + MONSTER[90%]: ('o', "hill orc"), random, hostile + MONSTER: ('o', "goblin"), random, hostile } -SUBROOM: "ordinary", unlit, (6,2), (3,4) { - ROOMDOOR: false, closed, south, random -} - -SUBROOM: "ordinary", lit, (6,9), (3,4) { - ROOMDOOR: false, closed, north, random -} - -SUBROOM: "food shop" [90%], lit, (10,2), (2,3) { - ROOMDOOR: false, closed, south, random -} - -SUBROOM: "candle shop", lit, (22,2), (3,3) { - ROOMDOOR: false, closed, south, random -} - -SUBROOM: "ordinary", unlit, (10,10), (2,3) { - ROOMDOOR: false, locked, east, random - MONSTER: ('G', "gnome"), random -} - -SUBROOM: "ordinary", lit, (19,2), (2,3) { - ROOMDOOR: false, locked, west, random - MONSTER: ('G', "gnome"), random -} - -SUBROOM: "temple", lit, (15,9), (4,4) { - ROOMDOOR: false, closed, north, random - ALTAR:(02,02),align[0],shrine - MONSTER: ('G', "gnomish wizard"), random - MONSTER: ('G', "gnomish wizard"), random -} - -SUBROOM: "ordinary", lit, (22,10), (2,3) { - ROOMDOOR: false, locked, west, random -} - -SUBROOM: "ordinary", lit, (26,2), (3,3) { - ROOMDOOR: false, closed, south, random - MONSTER: ('G', "gnome lord"), random -} - -SUBROOM: "ordinary", unlit, (25,10), (4,3) { - ROOMDOOR: false, closed, north, random -} - -} - -ROOM: "ordinary" , random, random, random, random { - STAIR: random, up -} - -ROOM: "ordinary" , random, random, random, random { - STAIR: random, down - TRAP: random, random - MONSTER: ('G', "gnome"), random - MONSTER: ('G', "gnome"), random -} - -ROOM: "ordinary" , random, random, random, random { - MONSTER: ('h', "dwarf"), random -} - -ROOM: "ordinary" , random, random, random, random { - TRAP: random, random - MONSTER: ('G', "gnome"), random -} - -RANDOM_CORRIDORS +WALLIFY:(1,0, 70,20) # Minetown variant 2 From 7f03ee4216ada055018a2f4cf5b56db2b7f7f26c Mon Sep 17 00:00:00 2001 From: "Derek S. Ray" Date: Sun, 22 Feb 2015 18:53:30 -0500 Subject: [PATCH 228/354] Changes for Win32; update precompiled files Also fix Orctown probabilities; fixed support for snprintf; update Win32 makefile to allow level compiler use Conflicts: win/win32/levstuff.mak --- .gitignore | 1 + dat/mines.des | 23 +- include/ntconf.h | 7 + src/sp_lev.c | 17 +- sys/share/lev_comp.h | 518 ++- sys/share/lev_lex.c | 2393 +++++++++--- sys/share/lev_yacc.c | 8384 +++++++++++++++++++++++++++++----------- util/lev_main.c | 8 +- win/win32/levstuff.mak | 51 +- 9 files changed, 8416 insertions(+), 2986 deletions(-) diff --git a/.gitignore b/.gitignore index 302497de0..4f8be313f 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ Makefile # Win32-specific ignores binary/ build/ +ipch/ Nethack.sln Nethack.sdf Nethack.opensdf diff --git a/dat/mines.des b/dat/mines.des index 8382ac777..151026ff1 100644 --- a/dat/mines.des +++ b/dat/mines.des @@ -131,7 +131,7 @@ OBJECT:('%',"corpse"),random,montype:"watch captain" # Rubble! LOOP [9 + 2d5] { - OBJECT[90%]:('`',"boulder"),random + [90%]: OBJECT:('`',"boulder"),random OBJECT:('*',"rock"),random } @@ -158,9 +158,15 @@ $inside = selection: floodfill(18,8) $near_temple = selection: filter(fillrect(17,8, 23,14), $inside) LOOP [5 + 1d10] { - MONSTER[50%]: ('o', "orc-captain"), rndcoord($inside), hostile - MONSTER[80%]: ('o', "Uruk-hai"), rndcoord($inside), hostile - MONSTER: ('o', "Mordor orc"), rndcoord($inside), hostile + IF [50%] { + MONSTER: ('o', "orc-captain"), rndcoord($inside), hostile + } ELSE { + IF [80%] { + MONSTER: ('o', "Uruk-hai"), rndcoord($inside), hostile + } ELSE { + MONSTER: ('o', "Mordor orc"), rndcoord($inside), hostile + } + } } # shamans can be hanging out in/near the temple LOOP [2d3] { @@ -169,11 +175,14 @@ LOOP [2d3] { # these are not such a big deal # to run into outside the bars LOOP [9 + 2d5] { - MONSTER[90%]: ('o', "hill orc"), random, hostile - MONSTER: ('o', "goblin"), random, hostile + IF [90%] { + MONSTER: ('o', "hill orc"), random, hostile + } ELSE { + MONSTER: ('o', "goblin"), random, hostile + } } -WALLIFY:(1,0, 70,20) +WALLIFY # Minetown variant 2 diff --git a/include/ntconf.h b/include/ntconf.h index 95a506635..6a22e1cf3 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -124,8 +124,15 @@ extern void FDECL(interject, (int)); #define strncmpi(a,b,c) strnicmp(a,b,c) #endif +/* Visual Studio defines this in their own headers, which we don't use */ +#ifndef snprintf +#define snprintf _snprintf +#pragma warning(disable:4996) /* deprecation warning suggesting snprintf_s */ +#endif + #include #include +#include #ifdef __BORLANDC__ #undef randomize #undef random diff --git a/src/sp_lev.c b/src/sp_lev.c index 46334a4ab..c779d700e 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -3440,20 +3440,21 @@ line_dist_coord(x1,y1, x2,y2, x3,y3) { long px = x2-x1; long py = y2-y1; + long s = px*px + py*py; + long x, y, dx, dy, dist = 0; + float u = 0; if (x1 == x2 && y1 == y2) return isqrt(dist2(x1,y1, x3,y3)); - long s = px*px + py*py; - float u = ((x3 - x1) * px + (y3 - y1) * py) / (float)s; - + u = ((x3 - x1) * px + (y3 - y1) * py) / (float)s; if (u > 1) u = 1; else if (u < 0) u = 0; - long x = x1 + u * px; - long y = y1 + u * py; - long dx = x - x3; - long dy = y - y3; - long dist = isqrt(dx*dx + dy*dy); + x = x1 + u * px; + y = y1 + u * py; + dx = x - x3; + dy = y - y3; + dist = isqrt(dx*dx + dy*dy); return dist; } diff --git a/sys/share/lev_comp.h b/sys/share/lev_comp.h index 8152d608a..2ea389931 100644 --- a/sys/share/lev_comp.h +++ b/sys/share/lev_comp.h @@ -1,79 +1,451 @@ -#define CHAR 257 -#define INTEGER 258 -#define BOOLEAN 259 -#define PERCENT 260 -#define MESSAGE_ID 261 -#define MAZE_ID 262 -#define LEVEL_ID 263 -#define LEV_INIT_ID 264 -#define GEOMETRY_ID 265 -#define NOMAP_ID 266 -#define OBJECT_ID 267 -#define COBJECT_ID 268 -#define MONSTER_ID 269 -#define TRAP_ID 270 -#define DOOR_ID 271 -#define DRAWBRIDGE_ID 272 -#define MAZEWALK_ID 273 -#define WALLIFY_ID 274 -#define REGION_ID 275 -#define FILLING 276 -#define RANDOM_OBJECTS_ID 277 -#define RANDOM_MONSTERS_ID 278 -#define RANDOM_PLACES_ID 279 -#define ALTAR_ID 280 -#define LADDER_ID 281 -#define STAIR_ID 282 -#define NON_DIGGABLE_ID 283 -#define NON_PASSWALL_ID 284 -#define ROOM_ID 285 -#define PORTAL_ID 286 -#define TELEPRT_ID 287 -#define BRANCH_ID 288 -#define LEV 289 -#define CHANCE_ID 290 -#define CORRIDOR_ID 291 -#define GOLD_ID 292 -#define ENGRAVING_ID 293 -#define FOUNTAIN_ID 294 -#define POOL_ID 295 -#define SINK_ID 296 -#define NONE 297 -#define RAND_CORRIDOR_ID 298 -#define DOOR_STATE 299 -#define LIGHT_STATE 300 -#define CURSE_TYPE 301 -#define ENGRAVING_TYPE 302 -#define DIRECTION 303 -#define RANDOM_TYPE 304 -#define O_REGISTER 305 -#define M_REGISTER 306 -#define P_REGISTER 307 -#define A_REGISTER 308 -#define ALIGNMENT 309 -#define LEFT_OR_RIGHT 310 -#define CENTER 311 -#define TOP_OR_BOT 312 -#define ALTAR_TYPE 313 -#define UP_OR_DOWN 314 -#define SUBROOM_ID 315 -#define NAME_ID 316 -#define FLAGS_ID 317 -#define FLAG_TYPE 318 -#define MON_ATTITUDE 319 -#define MON_ALERTNESS 320 -#define MON_APPEARANCE 321 -#define CONTAINED 322 -#define STRING 323 -#define MAP_ID 324 -typedef union + +/* A Bison parser, made by GNU Bison 2.4.1. */ + +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, 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 of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + CHAR = 258, + INTEGER = 259, + BOOLEAN = 260, + PERCENT = 261, + SPERCENT = 262, + MINUS_INTEGER = 263, + PLUS_INTEGER = 264, + MAZE_GRID_ID = 265, + SOLID_FILL_ID = 266, + MINES_ID = 267, + ROGUELEV_ID = 268, + MESSAGE_ID = 269, + MAZE_ID = 270, + LEVEL_ID = 271, + LEV_INIT_ID = 272, + GEOMETRY_ID = 273, + NOMAP_ID = 274, + OBJECT_ID = 275, + COBJECT_ID = 276, + MONSTER_ID = 277, + TRAP_ID = 278, + DOOR_ID = 279, + DRAWBRIDGE_ID = 280, + object_ID = 281, + monster_ID = 282, + terrain_ID = 283, + MAZEWALK_ID = 284, + WALLIFY_ID = 285, + REGION_ID = 286, + FILLING = 287, + IRREGULAR = 288, + JOINED = 289, + ALTAR_ID = 290, + LADDER_ID = 291, + STAIR_ID = 292, + NON_DIGGABLE_ID = 293, + NON_PASSWALL_ID = 294, + ROOM_ID = 295, + PORTAL_ID = 296, + TELEPRT_ID = 297, + BRANCH_ID = 298, + LEV = 299, + MINERALIZE_ID = 300, + CORRIDOR_ID = 301, + GOLD_ID = 302, + ENGRAVING_ID = 303, + FOUNTAIN_ID = 304, + POOL_ID = 305, + SINK_ID = 306, + NONE = 307, + RAND_CORRIDOR_ID = 308, + DOOR_STATE = 309, + LIGHT_STATE = 310, + CURSE_TYPE = 311, + ENGRAVING_TYPE = 312, + DIRECTION = 313, + RANDOM_TYPE = 314, + RANDOM_TYPE_BRACKET = 315, + A_REGISTER = 316, + ALIGNMENT = 317, + LEFT_OR_RIGHT = 318, + CENTER = 319, + TOP_OR_BOT = 320, + ALTAR_TYPE = 321, + UP_OR_DOWN = 322, + SUBROOM_ID = 323, + NAME_ID = 324, + FLAGS_ID = 325, + FLAG_TYPE = 326, + MON_ATTITUDE = 327, + MON_ALERTNESS = 328, + MON_APPEARANCE = 329, + ROOMDOOR_ID = 330, + IF_ID = 331, + ELSE_ID = 332, + TERRAIN_ID = 333, + HORIZ_OR_VERT = 334, + REPLACE_TERRAIN_ID = 335, + EXIT_ID = 336, + SHUFFLE_ID = 337, + QUANTITY_ID = 338, + BURIED_ID = 339, + LOOP_ID = 340, + FOR_ID = 341, + TO_ID = 342, + SWITCH_ID = 343, + CASE_ID = 344, + BREAK_ID = 345, + DEFAULT_ID = 346, + ERODED_ID = 347, + TRAPPED_ID = 348, + RECHARGED_ID = 349, + INVIS_ID = 350, + GREASED_ID = 351, + FEMALE_ID = 352, + CANCELLED_ID = 353, + REVIVED_ID = 354, + AVENGE_ID = 355, + FLEEING_ID = 356, + BLINDED_ID = 357, + PARALYZED_ID = 358, + STUNNED_ID = 359, + CONFUSED_ID = 360, + SEENTRAPS_ID = 361, + ALL_ID = 362, + MONTYPE_ID = 363, + GRAVE_ID = 364, + ERODEPROOF_ID = 365, + FUNCTION_ID = 366, + MSG_OUTPUT_TYPE = 367, + COMPARE_TYPE = 368, + UNKNOWN_TYPE = 369, + rect_ID = 370, + fillrect_ID = 371, + line_ID = 372, + randline_ID = 373, + grow_ID = 374, + selection_ID = 375, + flood_ID = 376, + rndcoord_ID = 377, + circle_ID = 378, + ellipse_ID = 379, + filter_ID = 380, + complement_ID = 381, + gradient_ID = 382, + GRADIENT_TYPE = 383, + LIMITED = 384, + HUMIDITY_TYPE = 385, + STRING = 386, + MAP_ID = 387, + NQSTRING = 388, + VARSTRING = 389, + CFUNC = 390, + CFUNC_INT = 391, + CFUNC_STR = 392, + CFUNC_COORD = 393, + CFUNC_REGION = 394, + VARSTRING_INT = 395, + VARSTRING_INT_ARRAY = 396, + VARSTRING_STRING = 397, + VARSTRING_STRING_ARRAY = 398, + VARSTRING_VAR = 399, + VARSTRING_VAR_ARRAY = 400, + VARSTRING_COORD = 401, + VARSTRING_COORD_ARRAY = 402, + VARSTRING_REGION = 403, + VARSTRING_REGION_ARRAY = 404, + VARSTRING_MAPCHAR = 405, + VARSTRING_MAPCHAR_ARRAY = 406, + VARSTRING_MONST = 407, + VARSTRING_MONST_ARRAY = 408, + VARSTRING_OBJ = 409, + VARSTRING_OBJ_ARRAY = 410, + VARSTRING_SEL = 411, + VARSTRING_SEL_ARRAY = 412, + METHOD_INT = 413, + METHOD_INT_ARRAY = 414, + METHOD_STRING = 415, + METHOD_STRING_ARRAY = 416, + METHOD_VAR = 417, + METHOD_VAR_ARRAY = 418, + METHOD_COORD = 419, + METHOD_COORD_ARRAY = 420, + METHOD_REGION = 421, + METHOD_REGION_ARRAY = 422, + METHOD_MAPCHAR = 423, + METHOD_MAPCHAR_ARRAY = 424, + METHOD_MONST = 425, + METHOD_MONST_ARRAY = 426, + METHOD_OBJ = 427, + METHOD_OBJ_ARRAY = 428, + METHOD_SEL = 429, + METHOD_SEL_ARRAY = 430, + DICE = 431 + }; +#endif +/* Tokens. */ +#define CHAR 258 +#define INTEGER 259 +#define BOOLEAN 260 +#define PERCENT 261 +#define SPERCENT 262 +#define MINUS_INTEGER 263 +#define PLUS_INTEGER 264 +#define MAZE_GRID_ID 265 +#define SOLID_FILL_ID 266 +#define MINES_ID 267 +#define ROGUELEV_ID 268 +#define MESSAGE_ID 269 +#define MAZE_ID 270 +#define LEVEL_ID 271 +#define LEV_INIT_ID 272 +#define GEOMETRY_ID 273 +#define NOMAP_ID 274 +#define OBJECT_ID 275 +#define COBJECT_ID 276 +#define MONSTER_ID 277 +#define TRAP_ID 278 +#define DOOR_ID 279 +#define DRAWBRIDGE_ID 280 +#define object_ID 281 +#define monster_ID 282 +#define terrain_ID 283 +#define MAZEWALK_ID 284 +#define WALLIFY_ID 285 +#define REGION_ID 286 +#define FILLING 287 +#define IRREGULAR 288 +#define JOINED 289 +#define ALTAR_ID 290 +#define LADDER_ID 291 +#define STAIR_ID 292 +#define NON_DIGGABLE_ID 293 +#define NON_PASSWALL_ID 294 +#define ROOM_ID 295 +#define PORTAL_ID 296 +#define TELEPRT_ID 297 +#define BRANCH_ID 298 +#define LEV 299 +#define MINERALIZE_ID 300 +#define CORRIDOR_ID 301 +#define GOLD_ID 302 +#define ENGRAVING_ID 303 +#define FOUNTAIN_ID 304 +#define POOL_ID 305 +#define SINK_ID 306 +#define NONE 307 +#define RAND_CORRIDOR_ID 308 +#define DOOR_STATE 309 +#define LIGHT_STATE 310 +#define CURSE_TYPE 311 +#define ENGRAVING_TYPE 312 +#define DIRECTION 313 +#define RANDOM_TYPE 314 +#define RANDOM_TYPE_BRACKET 315 +#define A_REGISTER 316 +#define ALIGNMENT 317 +#define LEFT_OR_RIGHT 318 +#define CENTER 319 +#define TOP_OR_BOT 320 +#define ALTAR_TYPE 321 +#define UP_OR_DOWN 322 +#define SUBROOM_ID 323 +#define NAME_ID 324 +#define FLAGS_ID 325 +#define FLAG_TYPE 326 +#define MON_ATTITUDE 327 +#define MON_ALERTNESS 328 +#define MON_APPEARANCE 329 +#define ROOMDOOR_ID 330 +#define IF_ID 331 +#define ELSE_ID 332 +#define TERRAIN_ID 333 +#define HORIZ_OR_VERT 334 +#define REPLACE_TERRAIN_ID 335 +#define EXIT_ID 336 +#define SHUFFLE_ID 337 +#define QUANTITY_ID 338 +#define BURIED_ID 339 +#define LOOP_ID 340 +#define FOR_ID 341 +#define TO_ID 342 +#define SWITCH_ID 343 +#define CASE_ID 344 +#define BREAK_ID 345 +#define DEFAULT_ID 346 +#define ERODED_ID 347 +#define TRAPPED_ID 348 +#define RECHARGED_ID 349 +#define INVIS_ID 350 +#define GREASED_ID 351 +#define FEMALE_ID 352 +#define CANCELLED_ID 353 +#define REVIVED_ID 354 +#define AVENGE_ID 355 +#define FLEEING_ID 356 +#define BLINDED_ID 357 +#define PARALYZED_ID 358 +#define STUNNED_ID 359 +#define CONFUSED_ID 360 +#define SEENTRAPS_ID 361 +#define ALL_ID 362 +#define MONTYPE_ID 363 +#define GRAVE_ID 364 +#define ERODEPROOF_ID 365 +#define FUNCTION_ID 366 +#define MSG_OUTPUT_TYPE 367 +#define COMPARE_TYPE 368 +#define UNKNOWN_TYPE 369 +#define rect_ID 370 +#define fillrect_ID 371 +#define line_ID 372 +#define randline_ID 373 +#define grow_ID 374 +#define selection_ID 375 +#define flood_ID 376 +#define rndcoord_ID 377 +#define circle_ID 378 +#define ellipse_ID 379 +#define filter_ID 380 +#define complement_ID 381 +#define gradient_ID 382 +#define GRADIENT_TYPE 383 +#define LIMITED 384 +#define HUMIDITY_TYPE 385 +#define STRING 386 +#define MAP_ID 387 +#define NQSTRING 388 +#define VARSTRING 389 +#define CFUNC 390 +#define CFUNC_INT 391 +#define CFUNC_STR 392 +#define CFUNC_COORD 393 +#define CFUNC_REGION 394 +#define VARSTRING_INT 395 +#define VARSTRING_INT_ARRAY 396 +#define VARSTRING_STRING 397 +#define VARSTRING_STRING_ARRAY 398 +#define VARSTRING_VAR 399 +#define VARSTRING_VAR_ARRAY 400 +#define VARSTRING_COORD 401 +#define VARSTRING_COORD_ARRAY 402 +#define VARSTRING_REGION 403 +#define VARSTRING_REGION_ARRAY 404 +#define VARSTRING_MAPCHAR 405 +#define VARSTRING_MAPCHAR_ARRAY 406 +#define VARSTRING_MONST 407 +#define VARSTRING_MONST_ARRAY 408 +#define VARSTRING_OBJ 409 +#define VARSTRING_OBJ_ARRAY 410 +#define VARSTRING_SEL 411 +#define VARSTRING_SEL_ARRAY 412 +#define METHOD_INT 413 +#define METHOD_INT_ARRAY 414 +#define METHOD_STRING 415 +#define METHOD_STRING_ARRAY 416 +#define METHOD_VAR 417 +#define METHOD_VAR_ARRAY 418 +#define METHOD_COORD 419 +#define METHOD_COORD_ARRAY 420 +#define METHOD_REGION 421 +#define METHOD_REGION_ARRAY 422 +#define METHOD_MAPCHAR 423 +#define METHOD_MAPCHAR_ARRAY 424 +#define METHOD_MONST 425 +#define METHOD_MONST_ARRAY 426 +#define METHOD_OBJ 427 +#define METHOD_OBJ_ARRAY 428 +#define METHOD_SEL 429 +#define METHOD_SEL_ARRAY 430 +#define DICE 431 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE { - int i; + +/* Line 1676 of yacc.c */ +#line 146 "lev_comp.y" + + long i; char* map; struct { - xchar room; - xchar wall; - xchar door; + long room; + long wall; + long door; } corpos; + struct { + long area; + long x1; + long y1; + long x2; + long y2; + } lregn; + struct { + long x; + long y; + } crd; + struct { + long ter; + long lit; + } terr; + struct { + long height; + long width; + } sze; + struct { + long die; + long num; + } dice; + struct { + long cfunc; + char *varstr; + } meth; + + + +/* Line 1676 of yacc.c */ +#line 443 "y.tab.h" } YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + extern YYSTYPE yylval; + + diff --git a/sys/share/lev_lex.c b/sys/share/lev_lex.c index 929d3b3b7..b4cb65d97 100644 --- a/sys/share/lev_lex.c +++ b/sys/share/lev_lex.c @@ -1,14 +1,66 @@ -/* A lexical scanner for NetHack generated by flex */ +/* A lexical scanner generated by flex */ /* Scanner skeleton version: - * flexhack.skl 3.3.0 (from .../flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47) + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ */ -#define FLEXHACK_SCANNER + +#define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#include "config.h" -#define yyconst const /* some code inserted by flex will refer to yyconst */ +#include + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include +#include + +/* 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 +#include +#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 @@ -53,12 +105,28 @@ extern FILE *yyin, *yyout; #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 */ \ } \ @@ -138,11 +206,13 @@ static YY_BUFFER_STATE yy_current_buffer = 0; */ #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. */ @@ -155,19 +225,23 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void FDECL(yyrestart, (FILE *)); +void yyrestart YY_PROTO(( FILE *input_file )); -void FDECL(yy_switch_to_buffer, (YY_BUFFER_STATE)); -void NDECL(yy_load_buffer_state); -YY_BUFFER_STATE FDECL(yy_create_buffer, (FILE *,int)); -void FDECL(yy_delete_buffer, (YY_BUFFER_STATE)); -void FDECL(yy_init_buffer, (YY_BUFFER_STATE,FILE *)); -void FDECL(yy_flush_buffer, (YY_BUFFER_STATE)); +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 ) -static genericptr_t FDECL(yy_flex_alloc, (yy_size_t)); -static genericptr_t FDECL(yy_flex_realloc2, (genericptr_t,yy_size_t,int)); -static void FDECL(yy_flex_free, (genericptr_t)); +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 @@ -193,10 +267,10 @@ typedef int yy_state_type; extern char *yytext; #define yytext_ptr yytext -static yy_state_type NDECL(yy_get_previous_state); -static yy_state_type FDECL(yy_try_NUL_trans, (yy_state_type)); -static int NDECL(yy_get_next_buffer); -static void FDECL(yy_fatal_error, (const char *)); +static 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. @@ -208,81 +282,124 @@ static void FDECL(yy_fatal_error, (const char *)); *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 113 -#define YY_END_OF_BUFFER 114 -static yyconst short int yy_accept[643] = +#define YY_NUM_RULES 195 +#define YY_END_OF_BUFFER 196 +static yyconst short int yy_accept[1038] = { 0, - 0, 0, 0, 0, 114, 112, 109, 108, 112, 112, - 112, 112, 106, 4, 112, 112, 112, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, - 112, 2, 112, 109, 112, 112, 106, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 109, - 108, 0, 107, 0, 0, 106, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 196, 194, 190, 189, 194, 194, + 194, 194, 194, 194, 193, 179, 187, 194, 188, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 194, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 190, 194, 193, 2, 194, 190, 194, 194, 193, 179, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 190, 194, 193, 190, 189, 183, + 0, 180, 181, 0, 0, 177, 193, 176, 178, 179, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 87, 0, 0, 3, 0, 2, 2, 0, 109, 0, - 106, 0, 0, 0, 0, 0, 0, 0, 0, 2, - 0, 0, 111, 0, 111, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 193, 185, 184, 182, 186, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 39, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 55, 193, 193, 0, 0, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 72, 0, 0, 67, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 65, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, - 17, 0, 0, 0, 0, 0, 40, 0, 0, 0, - 6, 0, 0, 42, 0, 0, 0, 33, 0, 0, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 153, 193, 193, 190, 0, 0, + 3, 193, 2, 2, 0, 190, 0, 177, 193, 176, + 179, 193, 193, 193, 193, 193, 39, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 190, 0, 2, 0, + 0, 193, 192, 0, 192, 174, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 54, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 0, 36, 32, 0, 0, 0, 16, 0, 0, 105, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, - 0, 0, 0, 0, 0, 0, 88, 91, 51, 0, - 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, - 0, 94, 0, 0, 0, 0, 0, 0, 55, 0, - 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, - 0, 90, 0, 0, 0, 53, 12, 0, 0, 0, - 0, 0, 25, 0, 0, 0, 0, 0, 0, 10, - 0, 0, 0, 0, 8, 0, 0, 0, 7, 0, - 0, 0, 0, 0, 0, 27, 0, 0, 0, 59, + 193, 193, 0, 193, 103, 193, 83, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 79, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 81, 193, 193, 193, 138, + 193, 193, 193, 193, 127, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 16, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 125, 193, 193, 193, - 86, 0, 0, 80, 0, 95, 0, 0, 0, 74, - 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 50, 0, 0, 0, 58, 0, 64, 0, 0, - 0, 52, 0, 0, 68, 0, 0, 30, 43, 0, - 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, - 0, 0, 13, 28, 0, 21, 0, 0, 0, 0, - 79, 0, 66, 49, 62, 46, 0, 0, 98, 0, - 69, 0, 0, 0, 0, 0, 47, 0, 0, 0, - 0, 0, 0, 48, 102, 0, 0, 56, 0, 54, + 193, 193, 193, 193, 193, 80, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 191, 193, 193, + 193, 58, 193, 193, 193, 22, 193, 40, 193, 41, + 193, 193, 193, 193, 49, 193, 193, 193, 193, 56, + 6, 193, 193, 193, 53, 193, 193, 193, 36, 193, + 193, 193, 193, 42, 193, 35, 193, 193, 193, 193, + 193, 21, 193, 0, 175, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 159, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 154, 157, 113, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 0, 0, 85, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 5, 15, 0, 0, 0, - 37, 0, 20, 0, 96, 0, 0, 92, 0, 0, - 0, 78, 0, 0, 0, 0, 57, 73, 71, 0, - 0, 0, 84, 0, 0, 0, 0, 39, 0, 0, - 31, 11, 9, 19, 0, 0, 0, 0, 0, 0, - 0, 103, 0, 0, 0, 0, 0, 0, 0, 0, - 83, 0, 0, 77, 0, 97, 70, 14, 0, 41, - 0, 0, 0, 0, 0, 0, 0, 75, 99, 61, - 0, 101, 44, 81, 82, 0, 0, 0, 18, 0, + 193, 193, 69, 193, 193, 193, 193, 193, 193, 193, + 120, 193, 193, 67, 193, 193, 193, 193, 160, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 118, 193, + 193, 193, 106, 193, 193, 193, 193, 193, 193, 193, + 65, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 156, + 193, 193, 193, 193, 193, 115, 15, 0, 193, 193, + 193, 193, 193, 193, 2, 0, 28, 193, 59, 193, + 193, 193, 193, 193, 13, 193, 193, 193, 50, 193, + 193, 7, 193, 193, 193, 193, 5, 193, 193, 193, - 0, 0, 0, 0, 0, 0, 63, 0, 100, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, - 35, 0, 0, 0, 0, 0, 76, 104, 0, 0, - 0, 24, 0, 0, 0, 22, 0, 0, 23, 29, - 38, 0 + 193, 193, 193, 193, 193, 193, 30, 193, 193, 193, + 193, 193, 119, 152, 193, 193, 193, 146, 193, 193, + 161, 193, 193, 193, 193, 193, 140, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 155, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 11, 193, 193, 193, 193, 193, 193, 193, 112, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 124, 193, 12, 193, 193, 193, 193, 193, + 193, 193, 82, 114, 193, 193, 193, 193, 193, 193, + + 193, 193, 128, 193, 193, 193, 193, 193, 33, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 29, 193, + 193, 193, 193, 193, 193, 17, 31, 193, 27, 193, + 193, 193, 193, 57, 193, 193, 193, 193, 145, 96, + 193, 193, 126, 110, 86, 193, 122, 72, 107, 193, + 193, 193, 164, 193, 193, 87, 193, 93, 129, 193, + 74, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 134, 193, 193, 108, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 109, 167, 193, 193, + 16, 193, 193, 193, 193, 77, 193, 116, 193, 193, + + 193, 193, 193, 111, 193, 193, 193, 151, 172, 193, + 78, 193, 193, 193, 193, 193, 193, 193, 193, 1, + 193, 57, 193, 193, 193, 60, 193, 193, 193, 193, + 193, 193, 193, 4, 193, 19, 193, 193, 193, 193, + 193, 62, 43, 193, 46, 26, 193, 162, 98, 193, + 193, 193, 193, 73, 158, 193, 193, 97, 193, 193, + 193, 92, 193, 193, 193, 193, 144, 193, 193, 193, + 135, 193, 193, 193, 193, 193, 20, 63, 139, 137, + 193, 193, 193, 193, 193, 193, 193, 117, 193, 131, + 95, 193, 150, 193, 193, 193, 193, 100, 47, 89, + + 193, 193, 193, 193, 193, 26, 193, 45, 193, 193, + 34, 61, 14, 8, 25, 193, 193, 193, 193, 193, + 23, 193, 168, 193, 193, 193, 101, 193, 66, 193, + 75, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 149, 9, 193, 193, 193, 193, 143, 193, 85, + 68, 193, 71, 193, 193, 193, 193, 163, 130, 133, + 193, 105, 18, 193, 51, 193, 193, 193, 193, 193, + 193, 94, 141, 193, 193, 70, 173, 121, 193, 166, + 193, 91, 132, 84, 147, 148, 170, 193, 193, 99, + 171, 90, 193, 64, 193, 10, 136, 24, 52, 193, + + 193, 193, 193, 193, 76, 88, 123, 104, 193, 165, + 102, 193, 193, 193, 193, 193, 193, 193, 193, 37, + 38, 193, 193, 193, 142, 169, 193, 193, 193, 193, + 193, 193, 193, 48, 32, 44, 0 } ; static yyconst int yy_ec[256] = @@ -290,17 +407,17 @@ static yyconst int yy_ec[256] = 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, 5, 1, 6, 7, 1, 8, 1, 9, 1, - 1, 1, 10, 1, 11, 12, 1, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 14, 1, 1, - 1, 1, 1, 1, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 1, 31, 32, 33, 34, 35, 36, 1, 37, 38, - 39, 40, 41, 1, 42, 1, 43, 44, 45, 46, + 1, 5, 6, 7, 8, 9, 10, 1, 11, 1, + 1, 1, 12, 1, 13, 14, 1, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 1, 1, 16, + 17, 18, 1, 1, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 1, 48, 1, 49, 50, 51, 52, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 1, 59, 60, 61, 62, 63, 64, 1, - 1, 1, 12, 12, 12, 1, 1, 1, 1, 1, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 14, 14, 14, 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, @@ -317,267 +434,410 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst int yy_meta[65] = +static yyconst int yy_meta[75] = { 0, - 1, 2, 3, 2, 2, 1, 2, 1, 1, 2, - 2, 2, 2, 1, 2, 2, 2, 1, 1, 2, - 1, 2, 2, 1, 2, 2, 1, 1, 1, 2, - 1, 2, 2, 1, 1, 2, 1, 1, 1, 2, - 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, 3, 2, 2, 1, 1, 2, 1, 1, + 1, 2, 4, 2, 4, 1, 1, 1, 5, 5, + 5, 6, 6, 5, 6, 5, 5, 6, 5, 5, + 5, 6, 6, 5, 6, 6, 5, 5, 5, 6, + 5, 6, 5, 6, 1, 2, 1, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 5, 6, 6, + 6, 5, 6, 6 } ; -static yyconst short int yy_base[648] = +static yyconst short int yy_base[1045] = { 0, - 0, 58, 83, 62, 799, 800, 65, 800, 795, 791, - 756, 782, 781, 800, 767, 761, 44, 43, 763, 42, - 62, 762, 60, 63, 68, 773, 759, 92, 91, 91, - 772, 71, 72, 76, 87, 55, 84, 77, 61, 96, - 103, 95, 104, 103, 108, 111, 99, 107, 739, 782, - 151, 800, 781, 169, 173, 179, 182, 185, 194, 197, - 755, 180, 185, 193, 181, 194, 202, 214, 241, 75, - 800, 776, 800, 772, 771, 766, 745, 762, 761, 136, - 746, 759, 752, 757, 737, 741, 743, 745, 749, 731, - 727, 732, 735, 735, 151, 737, 162, 732, 738, 729, + 0, 73, 102, 77, 1276, 1277, 75, 1277, 1272, 1257, + 1266, 0, 1226, 1256, 1255, 78, 66, 1252, 1251, 1237, + 1230, 57, 63, 59, 64, 101, 0, 63, 79, 119, + 94, 1245, 1231, 128, 127, 126, 1244, 104, 109, 118, + 133, 94, 139, 151, 1196, 95, 111, 1198, 157, 146, + 163, 100, 164, 1191, 166, 169, 178, 56, 1206, 1205, + 219, 1254, 216, 1277, 1253, 243, 248, 251, 264, 223, + 168, 120, 241, 229, 267, 1240, 249, 289, 294, 152, + 299, 308, 221, 296, 343, 360, 301, 260, 1277, 1277, + 1247, 1277, 0, 1242, 1241, 1236, 0, 1235, 1277, 277, - 729, 741, 739, 728, 738, 726, 225, 224, 143, 707, - 696, 706, 192, 687, 690, 687, 689, 701, 686, 162, - 683, 677, 680, 679, 689, 683, 682, 181, 675, 670, - 199, 672, 687, 221, 672, 674, 667, 229, 676, 680, - 683, 682, 668, 674, 666, 211, 659, 662, 657, 235, - 800, 658, 714, 800, 204, 800, 800, 713, 277, 264, - 274, 269, 279, 274, 282, 287, 285, 295, 293, 800, - 712, 0, 800, 705, 704, 697, 683, 682, 676, 677, - 676, 670, 674, 683, 675, 675, 683, 667, 681, 679, - 678, 664, 663, 675, 678, 650, 672, 664, 656, 670, + 1234, 1277, 1277, 1277, 1277, 1210, 296, 1210, 303, 1222, + 1212, 1225, 1206, 1217, 1214, 1221, 250, 1207, 1205, 1207, + 1217, 0, 1208, 1212, 1193, 1199, 1187, 1193, 1197, 1196, + 1196, 160, 1198, 263, 1193, 308, 1191, 1184, 1190, 1202, + 1200, 1192, 227, 0, 1199, 1187, 192, 340, 301, 1143, + 1165, 1154, 1160, 1163, 303, 1143, 1147, 1143, 1146, 1145, + 1157, 1139, 1141, 321, 1137, 1131, 1128, 1133, 1132, 1138, + 1142, 1133, 1135, 1133, 1133, 217, 304, 311, 341, 1122, + 1125, 1133, 1118, 188, 334, 1137, 350, 26, 1125, 1124, + 1124, 1115, 363, 1125, 1129, 1115, 1131, 1126, 1129, 326, - 664, 659, 660, 661, 652, 663, 651, 654, 295, 630, - 635, 620, 629, 622, 614, 616, 611, 618, 614, 608, - 611, 607, 612, 604, 604, 607, 601, 600, 601, 599, - 604, 609, 610, 594, 800, 593, 594, 800, 599, 604, - 593, 605, 595, 587, 585, 591, 587, 588, 273, 581, - 594, 593, 583, 593, 592, 590, 585, 589, 574, 581, - 570, 800, 583, 567, 577, 576, 565, 256, 306, 301, - 598, 304, 309, 315, 800, 593, 606, 605, 606, 597, - 800, 603, 603, 585, 583, 596, 800, 572, 594, 586, - 575, 595, 576, 800, 578, 309, 590, 800, 591, 576, + 363, 1122, 1124, 1120, 1112, 366, 357, 283, 1104, 1103, + 1105, 1106, 336, 376, 0, 1103, 325, 433, 1165, 1164, + 1277, 366, 1277, 1277, 1163, 440, 444, 447, 1150, 0, + 406, 422, 339, 430, 438, 140, 1149, 439, 424, 441, + 425, 444, 448, 450, 303, 451, 475, 0, 1277, 1160, + 0, 454, 1277, 1151, 1150, 1145, 1140, 1126, 1138, 1133, + 1117, 1118, 1134, 1116, 1110, 1127, 1113, 1110, 1122, 0, + 1114, 1124, 1113, 1121, 1102, 1103, 1118, 1116, 1104, 1114, + 1099, 1112, 1097, 1110, 1113, 1083, 1107, 1099, 1090, 1105, + 1099, 1095, 1093, 1099, 1093, 1094, 1084, 1081, 1095, 1081, - 575, 800, 800, 572, 573, 571, 800, 577, 307, 800, - 543, 539, 538, 549, 548, 534, 547, 535, 544, 800, - 543, 529, 541, 536, 543, 538, 800, 800, 800, 541, - 536, 535, 570, 532, 528, 800, 531, 530, 533, 519, - 522, 800, 512, 513, 520, 513, 526, 511, 800, 517, - 512, 520, 800, 517, 516, 505, 500, 499, 498, 502, - 507, 800, 497, 501, 493, 800, 800, 550, 318, 537, - 321, 331, 800, 529, 531, 526, 530, 516, 511, 800, - 530, 511, 516, 511, 800, 526, 519, 520, 800, 515, - 522, 503, 509, 507, 505, 800, 503, 502, 510, 800, + 1082, 1085, 466, 1059, 0, 1064, 0, 1049, 1058, 1048, + 1050, 1041, 1045, 1043, 1037, 1045, 425, 1052, 1034, 1038, + 1049, 1032, 1038, 1033, 1042, 1028, 1032, 0, 1025, 1024, + 1034, 1024, 1037, 1021, 1038, 424, 1033, 1022, 420, 1035, + 1012, 1028, 1029, 1023, 1011, 0, 1021, 1024, 1014, 0, + 1007, 1008, 1016, 1019, 0, 1012, 1017, 1006, 1018, 1008, + 1013, 1012, 407, 1011, 995, 1002, 998, 999, 438, 991, + 1005, 1004, 994, 1006, 1003, 992, 990, 994, 998, 429, + 980, 991, 991, 995, 976, 993, 977, 980, 988, 974, + 436, 982, 970, 988, 974, 969, 0, 970, 980, 963, - 800, 482, 470, 800, 480, 800, 471, 469, 465, 800, - 477, 473, 470, 474, 456, 800, 472, 196, 463, 462, - 466, 468, 452, 452, 464, 463, 466, 459, 448, 448, - 462, 800, 457, 442, 454, 800, 446, 800, 438, 439, - 451, 800, 437, 442, 800, 465, 335, 800, 800, 466, - 464, 469, 468, 467, 458, 473, 800, 461, 467, 454, - 463, 451, 800, 800, 440, 800, 454, 449, 442, 435, - 800, 431, 800, 800, 800, 800, 420, 419, 800, 427, - 800, 426, 421, 414, 423, 418, 800, 406, 406, 421, - 406, 410, 407, 800, 800, 408, 403, 800, 398, 800, + 974, 967, 972, 960, 959, 0, 491, 481, 486, 995, + 487, 490, 488, 471, 489, 491, 507, 1277, 989, 1003, + 994, 0, 1003, 994, 981, 0, 999, 0, 999, 0, + 980, 978, 977, 991, 0, 990, 964, 988, 980, 0, + 968, 989, 971, 968, 0, 971, 486, 983, 0, 984, + 969, 968, 981, 977, 974, 0, 961, 963, 974, 960, + 974, 0, 965, 511, 1277, 929, 924, 923, 935, 932, + 933, 918, 932, 931, 919, 928, 927, 0, 926, 925, + 910, 916, 922, 917, 913, 903, 918, 0, 0, 0, + 906, 920, 915, 914, 906, 464, 912, 907, 911, 905, - 404, 407, 800, 410, 409, 800, 329, 436, 423, 435, - 424, 423, 413, 419, 423, 800, 800, 426, 414, 342, - 800, 412, 800, 390, 800, 396, 395, 800, 393, 391, - 382, 800, 381, 378, 389, 374, 800, 800, 800, 383, - 376, 378, 800, 382, 384, 383, 397, 800, 406, 405, - 800, 800, 800, 800, 410, 388, 394, 393, 405, 394, - 377, 800, 372, 371, 355, 365, 355, 357, 365, 352, - 800, 361, 350, 800, 358, 800, 800, 800, 388, 800, - 390, 390, 373, 375, 378, 386, 369, 800, 800, 800, - 338, 800, 800, 800, 800, 342, 336, 335, 800, 369, + 908, 893, 0, 946, 904, 883, 899, 888, 899, 900, + 0, 899, 883, 0, 897, 900, 886, 889, 0, 463, + 879, 877, 871, 877, 885, 878, 891, 876, 0, 882, + 877, 885, 0, 875, 881, 884, 864, 882, 465, 881, + 0, 869, 858, 859, 863, 872, 856, 870, 874, 870, + 852, 857, 849, 865, 860, 849, 852, 864, 848, 0, + 845, 850, 852, 458, 851, 0, 1277, 904, 509, 887, + 514, 516, 518, 517, 1277, 902, 0, 878, 0, 876, + 880, 871, 864, 859, 0, 879, 870, 858, 0, 864, + 858, 0, 874, 867, 872, 867, 0, 862, 869, 849, - 368, 362, 360, 372, 373, 370, 800, 341, 800, 340, - 367, 359, 347, 335, 350, 346, 342, 316, 315, 800, - 800, 338, 327, 312, 310, 311, 800, 800, 236, 210, - 188, 800, 161, 138, 123, 800, 101, 69, 800, 800, - 800, 800, 372, 375, 377, 379, 382 + 856, 854, 852, 862, 849, 851, 0, 847, 853, 845, + 850, 852, 0, 0, 822, 810, 820, 0, 819, 818, + 0, 809, 807, 816, 807, 800, 0, 812, 812, 808, + 809, 794, 808, 792, 788, 482, 0, 804, 804, 802, + 788, 791, 798, 798, 777, 796, 475, 788, 784, 786, + 788, 775, 791, 787, 788, 788, 771, 771, 784, 770, + 782, 0, 781, 769, 783, 776, 764, 765, 779, 0, + 774, 758, 752, 770, 759, 765, 761, 763, 758, 752, + 768, 763, 0, 752, 0, 745, 745, 744, 743, 743, + 756, 756, 753, 0, 753, 752, 747, 750, 735, 741, + + 738, 742, 0, 747, 763, 521, 522, 525, 0, 764, + 762, 756, 766, 765, 764, 757, 753, 769, 0, 757, + 763, 755, 748, 758, 745, 0, 0, 733, 0, 757, + 743, 734, 80, 0, 386, 510, 500, 498, 0, 0, + 498, 501, 0, 0, 0, 494, 0, 0, 0, 493, + 495, 504, 0, 506, 507, 0, 495, 0, 0, 511, + 0, 508, 507, 503, 517, 515, 515, 512, 507, 509, + 519, 523, 514, 0, 518, 524, 0, 508, 510, 528, + 523, 511, 516, 530, 524, 523, 0, 0, 526, 523, + 0, 514, 520, 526, 523, 0, 530, 548, 539, 529, + + 544, 531, 537, 0, 533, 543, 544, 0, 0, 545, + 0, 551, 542, 553, 553, 554, 555, 541, 561, 0, + 596, 597, 598, 591, 579, 0, 594, 585, 586, 588, + 578, 588, 594, 0, 597, 0, 600, 589, 606, 580, + 593, 0, 0, 592, 0, 0, 571, 0, 0, 579, + 580, 581, 583, 0, 0, 573, 569, 0, 578, 571, + 574, 0, 588, 588, 581, 577, 0, 586, 598, 585, + 0, 583, 597, 583, 600, 600, 0, 0, 0, 0, + 597, 592, 603, 597, 605, 586, 607, 1277, 608, 0, + 0, 610, 0, 614, 601, 610, 606, 0, 0, 0, + + 615, 616, 617, 617, 611, 657, 637, 0, 649, 650, + 0, 0, 0, 0, 0, 632, 658, 637, 646, 642, + 0, 633, 0, 630, 631, 622, 0, 622, 0, 626, + 0, 635, 620, 633, 624, 642, 639, 627, 632, 642, + 630, 0, 0, 637, 643, 633, 648, 0, 649, 0, + 0, 650, 0, 639, 642, 649, 646, 0, 0, 0, + 655, 0, 0, 685, 0, 686, 690, 692, 676, 690, + 678, 0, 0, 647, 662, 0, 0, 0, 649, 0, + 658, 0, 0, 0, 0, 0, 0, 657, 652, 0, + 0, 0, 654, 0, 654, 0, 0, 0, 0, 693, + + 694, 689, 690, 704, 0, 0, 0, 0, 675, 0, + 0, 676, 707, 701, 705, 697, 709, 683, 684, 0, + 0, 715, 719, 712, 0, 0, 707, 714, 709, 707, + 712, 713, 709, 0, 0, 0, 1277, 746, 748, 754, + 757, 763, 768, 773 } ; -static yyconst short int yy_def[648] = +static yyconst short int yy_def[1045] = { 0, - 642, 1, 1, 3, 642, 642, 642, 642, 642, 643, - 644, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 645, - 642, 642, 642, 646, 646, 646, 646, 646, 646, 646, - 642, 60, 60, 60, 60, 60, 60, 60, 645, 642, - 642, 643, 642, 642, 647, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 1037, 1, 1, 3, 1037, 1037, 1037, 1037, 1037, 1037, + 1038, 1039, 1040, 1037, 1041, 1041, 1037, 1037, 1037, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1037, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1037, 1042, 1041, 1037, 1037, 1043, 1043, 1043, 1041, 69, + 69, 69, 69, 1041, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 1043, 1042, 69, 1037, 1037, 1037, + 1038, 1037, 1039, 1037, 1044, 1037, 1041, 1041, 1037, 1041, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 645, 642, 642, 642, 642, 642, 60, 60, - 60, 60, 60, 642, 60, 60, 60, 60, 60, 642, - 645, 69, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 1041, 1037, 1037, 1037, 1037, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1037, 1037, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 60, 60, - 642, 60, 60, 60, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1037, 1042, 1042, + 1037, 1041, 1037, 1037, 1037, 1043, 1043, 1043, 69, 69, + 69, 69, 69, 1041, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 1043, 86, 1037, 1042, + 86, 69, 1037, 1037, 1037, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 60, 642, - 60, 60, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 1041, 1041, 1037, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 60, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 69, 69, 1041, + 69, 69, 69, 69, 69, 69, 69, 1037, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1037, 1037, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 642, 642, 642, 642, 642, 642, 60, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1037, 1037, 69, 1041, + 69, 69, 69, 69, 1037, 1037, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 0, 642, 642, 642, 642, 642 + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + + 1041, 1041, 1041, 1041, 1041, 69, 69, 69, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 69, 69, 69, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1037, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + + 1041, 1041, 1041, 1041, 1041, 69, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1041, 1041, 1041, 1041, 1041, 1041, 0, 1037, 1037, 1037, + 1037, 1037, 1037, 1037 } ; -static yyconst short int yy_nxt[865] = +static yyconst short int yy_nxt[1352] = { 0, - 6, 7, 8, 9, 7, 10, 6, 6, 11, 12, - 12, 6, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 6, 22, 6, 6, 23, 24, 25, 26, 27, - 28, 29, 30, 6, 6, 31, 6, 6, 32, 6, - 6, 6, 33, 34, 35, 36, 37, 38, 6, 39, - 6, 6, 6, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 6, 49, 50, 79, 70, 84, 69, 70, - 85, 81, 80, 82, 89, 107, 70, 91, 90, 70, - 86, 92, 94, 108, 51, 52, 53, 54, 51, 55, - 87, 93, 56, 56, 55, 57, 95, 58, 59, 60, + 6, 7, 8, 9, 7, 10, 11, 6, 12, 6, + 13, 14, 15, 6, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 27, 27, 29, + 30, 31, 32, 33, 27, 34, 35, 36, 27, 27, + 37, 27, 27, 27, 38, 6, 6, 27, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 27, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 27, 27, 27, 61, 108, 88, 61, 61, 88, + 62, 85, 102, 103, 86, 110, 122, 99, 113, 109, + 114, 360, 100, 116, 123, 111, 117, 124, 112, 361, - 641, 61, 62, 128, 55, 63, 98, 55, 64, 104, - 99, 122, 65, 101, 66, 67, 123, 129, 68, 126, - 100, 105, 55, 102, 103, 109, 124, 127, 640, 113, - 110, 111, 114, 117, 115, 112, 118, 116, 130, 125, - 119, 137, 131, 120, 134, 135, 132, 139, 121, 141, - 143, 138, 133, 145, 639, 148, 142, 149, 144, 136, - 146, 140, 150, 179, 151, 155, 180, 147, 638, 92, - 70, 157, 158, 159, 642, 157, 158, 195, 196, 93, - 642, 157, 158, 642, 157, 158, 642, 157, 158, 637, - 198, 161, 199, 210, 161, 642, 157, 158, 642, 157, + 115, 125, 118, 63, 64, 65, 66, 87, 147, 67, + 843, 126, 131, 68, 69, 67, 70, 214, 148, 215, + 71, 72, 73, 119, 74, 75, 132, 76, 77, 101, + 76, 78, 79, 120, 229, 80, 121, 127, 81, 82, + 76, 128, 83, 178, 76, 129, 135, 67, 143, 194, + 136, 130, 138, 139, 229, 107, 166, 179, 144, 167, + 137, 145, 168, 195, 140, 141, 229, 142, 149, 84, + 150, 272, 180, 76, 151, 152, 181, 155, 153, 154, + 156, 159, 229, 157, 134, 160, 158, 169, 161, 162, + 285, 286, 163, 187, 188, 164, 147, 232, 170, 173, - 158, 160, 160, 211, 223, 165, 160, 166, 85, 97, - 162, 90, 88, 642, 160, 160, 167, 224, 163, 636, - 104, 642, 642, 160, 78, 80, 168, 103, 169, 107, - 642, 209, 105, 268, 232, 160, 108, 108, 215, 233, - 635, 191, 642, 170, 171, 172, 236, 172, 216, 482, - 172, 172, 172, 172, 483, 172, 172, 172, 367, 368, - 172, 237, 172, 172, 634, 172, 172, 259, 240, 260, - 172, 246, 172, 172, 247, 241, 172, 242, 70, 264, - 172, 159, 265, 248, 249, 160, 161, 250, 266, 251, - 160, 271, 642, 270, 183, 160, 272, 642, 160, 309, + 171, 165, 189, 174, 172, 183, 148, 175, 190, 184, + 176, 191, 196, 185, 200, 192, 197, 205, 201, 186, + 218, 206, 202, 218, 207, 193, 219, 203, 204, 198, + 211, 208, 99, 209, 222, 229, 210, 231, 128, 246, + 212, 351, 129, 213, 88, 224, 225, 226, 130, 1037, + 224, 225, 1037, 224, 225, 229, 299, 352, 113, 233, + 234, 88, 300, 229, 88, 228, 224, 225, 227, 337, + 115, 227, 237, 109, 101, 227, 229, 227, 230, 338, + 123, 229, 229, 229, 229, 270, 99, 229, 271, 229, + 229, 100, 229, 229, 229, 288, 235, 229, 289, 117, - 160, 269, 642, 160, 189, 642, 160, 642, 160, 273, - 642, 309, 203, 642, 160, 642, 160, 348, 274, 349, - 369, 642, 160, 642, 284, 160, 390, 160, 278, 642, - 160, 371, 642, 633, 642, 310, 160, 642, 391, 160, - 372, 632, 160, 642, 631, 630, 642, 310, 373, 642, - 160, 396, 160, 447, 507, 629, 160, 642, 557, 642, - 628, 627, 626, 642, 625, 523, 624, 623, 558, 622, - 559, 560, 72, 72, 72, 74, 74, 153, 153, 153, - 160, 160, 174, 174, 621, 620, 619, 618, 617, 616, - 615, 614, 613, 612, 611, 610, 609, 608, 607, 606, + 229, 229, 229, 229, 229, 236, 229, 238, 229, 227, + 229, 125, 239, 229, 258, 229, 128, 229, 259, 252, + 240, 126, 229, 128, 241, 242, 130, 240, 101, 415, + 143, 229, 291, 130, 261, 229, 243, 244, 262, 245, + 144, 292, 392, 145, 218, 224, 225, 247, 211, 303, + 248, 393, 339, 229, 148, 312, 340, 304, 212, 313, + 305, 213, 249, 250, 251, 314, 341, 251, 306, 323, + 342, 251, 251, 251, 251, 409, 343, 378, 251, 251, + 251, 324, 325, 251, 398, 251, 251, 379, 251, 251, + 251, 405, 406, 251, 353, 354, 251, 251, 251, 407, - 605, 604, 603, 602, 601, 600, 599, 598, 597, 596, - 595, 594, 593, 592, 591, 590, 589, 588, 587, 586, - 585, 584, 583, 582, 581, 580, 579, 578, 577, 576, - 575, 574, 573, 572, 571, 570, 569, 568, 567, 566, - 565, 564, 563, 562, 561, 556, 555, 554, 553, 552, - 551, 550, 549, 548, 547, 546, 545, 544, 543, 542, - 541, 540, 539, 538, 537, 536, 535, 534, 533, 532, - 531, 530, 529, 528, 527, 526, 525, 524, 523, 522, - 521, 520, 519, 518, 517, 516, 515, 514, 513, 512, - 511, 510, 509, 508, 506, 505, 504, 503, 502, 501, + 251, 355, 251, 357, 399, 251, 344, 345, 346, 280, + 358, 366, 359, 380, 367, 99, 387, 381, 388, 390, + 231, 844, 391, 368, 369, 389, 400, 251, 370, 401, + 371, 251, 382, 402, 218, 403, 229, 218, 229, 229, + 219, 88, 224, 225, 226, 1037, 224, 225, 1037, 224, + 225, 410, 229, 229, 267, 229, 411, 101, 229, 408, + 277, 228, 229, 412, 229, 229, 413, 280, 229, 414, + 464, 500, 282, 522, 523, 295, 218, 224, 225, 247, + 416, 477, 248, 496, 540, 229, 478, 417, 528, 501, + 529, 497, 552, 567, 568, 229, 541, 280, 553, 569, - 500, 499, 498, 497, 496, 495, 494, 493, 492, 491, - 490, 489, 488, 487, 486, 485, 484, 481, 480, 479, - 478, 477, 476, 475, 474, 473, 472, 471, 470, 469, - 468, 467, 466, 465, 464, 463, 462, 461, 460, 459, - 458, 457, 456, 455, 454, 453, 452, 451, 450, 449, - 448, 446, 367, 445, 444, 443, 442, 441, 440, 439, - 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, - 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, - 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, - 408, 407, 406, 405, 404, 403, 402, 401, 400, 399, + 229, 229, 229, 229, 229, 229, 458, 598, 422, 575, + 576, 431, 465, 571, 572, 464, 639, 660, 702, 599, + 574, 229, 661, 229, 678, 703, 573, 679, 229, 640, + 229, 229, 229, 756, 767, 229, 229, 706, 707, 229, + 768, 845, 846, 708, 577, 757, 847, 822, 823, 848, + 821, 607, 849, 850, 851, 852, 853, 465, 854, 855, + 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, + 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, + 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, + 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, - 398, 397, 396, 395, 394, 393, 392, 389, 388, 387, - 386, 385, 384, 383, 382, 381, 380, 379, 378, 377, - 376, 375, 374, 373, 370, 366, 365, 364, 363, 362, - 361, 360, 359, 358, 357, 356, 355, 354, 353, 352, - 351, 350, 347, 346, 345, 344, 343, 342, 341, 340, - 339, 338, 337, 336, 335, 334, 333, 332, 331, 330, - 329, 328, 327, 326, 325, 324, 323, 322, 321, 320, - 319, 318, 317, 316, 315, 314, 313, 312, 311, 308, - 307, 306, 305, 304, 303, 302, 301, 300, 299, 298, - 297, 296, 295, 294, 293, 292, 291, 290, 289, 288, + 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, + 229, 229, 229, 907, 908, 909, 910, 911, 842, 912, + 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, + 906, 933, 934, 935, 936, 937, 938, 939, 940, 941, + 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, + 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 229, 963, 964, 965, 966, 967, 968, 969, 970, + 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, + 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, - 287, 286, 285, 284, 283, 282, 281, 280, 279, 278, - 277, 276, 275, 275, 170, 157, 154, 267, 263, 262, - 261, 258, 257, 256, 255, 254, 253, 252, 245, 244, - 243, 239, 238, 235, 234, 231, 230, 229, 228, 227, - 226, 225, 222, 221, 220, 219, 218, 217, 214, 213, - 212, 208, 207, 206, 205, 204, 203, 202, 201, 200, - 197, 194, 193, 192, 191, 190, 189, 188, 187, 186, - 185, 184, 183, 182, 181, 178, 177, 176, 76, 175, - 173, 73, 164, 156, 154, 152, 106, 97, 96, 88, - 83, 78, 77, 76, 76, 75, 73, 71, 642, 5, + 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 91, 91, 91, 91, + 91, 91, 93, 93, 94, 94, 842, 94, 94, 94, + 97, 97, 97, 220, 220, 220, 220, 220, 220, 227, + 227, 227, 227, 254, 254, 841, 254, 254, 254, 840, + 839, 838, 837, 836, 835, 834, 833, 832, 831, 830, + 829, 828, 827, 826, 825, 824, 820, 819, 818, 817, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642 + 816, 815, 814, 813, 812, 811, 810, 809, 808, 807, + 806, 805, 804, 803, 802, 801, 800, 799, 798, 797, + 796, 795, 794, 793, 792, 791, 790, 789, 788, 787, + 786, 785, 784, 783, 782, 781, 780, 779, 778, 777, + 776, 775, 774, 773, 772, 771, 770, 769, 766, 765, + 764, 763, 762, 761, 760, 759, 758, 755, 754, 753, + 752, 751, 750, 749, 748, 747, 746, 745, 744, 743, + 742, 741, 740, 739, 738, 737, 736, 735, 734, 733, + 732, 731, 730, 729, 728, 727, 726, 725, 724, 723, + 722, 721, 720, 719, 718, 717, 716, 715, 714, 713, + + 712, 711, 710, 709, 575, 705, 567, 704, 701, 700, + 699, 698, 697, 696, 695, 694, 693, 692, 691, 690, + 689, 688, 687, 686, 685, 684, 683, 682, 681, 680, + 677, 676, 675, 674, 673, 672, 671, 670, 669, 668, + 667, 666, 665, 664, 663, 662, 659, 658, 657, 656, + 655, 654, 653, 652, 651, 650, 649, 648, 647, 646, + 645, 644, 643, 642, 641, 638, 637, 636, 635, 634, + 633, 632, 631, 630, 629, 628, 627, 626, 625, 624, + 623, 622, 621, 620, 619, 618, 617, 616, 615, 614, + 613, 612, 611, 610, 609, 608, 607, 606, 605, 604, + + 603, 602, 601, 600, 597, 596, 595, 594, 593, 592, + 591, 590, 589, 588, 587, 586, 585, 584, 583, 582, + 581, 580, 579, 578, 577, 570, 566, 565, 564, 563, + 562, 561, 560, 559, 558, 557, 556, 555, 554, 551, + 550, 549, 548, 547, 546, 545, 544, 543, 542, 539, + 538, 537, 536, 535, 534, 533, 532, 531, 530, 527, + 526, 525, 524, 445, 521, 520, 519, 518, 517, 516, + 515, 514, 513, 512, 511, 510, 509, 508, 507, 506, + 505, 504, 503, 502, 499, 498, 495, 494, 493, 492, + 491, 490, 489, 488, 487, 486, 485, 484, 483, 482, + + 481, 480, 479, 476, 475, 474, 473, 472, 471, 470, + 469, 468, 467, 466, 463, 462, 461, 460, 459, 458, + 457, 456, 455, 454, 453, 452, 451, 450, 449, 448, + 447, 446, 445, 444, 443, 442, 441, 440, 439, 438, + 437, 436, 435, 434, 433, 432, 431, 430, 429, 428, + 427, 426, 425, 424, 423, 422, 421, 420, 419, 256, + 418, 418, 249, 229, 229, 224, 221, 221, 404, 397, + 396, 395, 394, 386, 385, 384, 383, 377, 376, 375, + 374, 373, 372, 365, 364, 363, 362, 356, 350, 349, + 348, 347, 336, 335, 334, 333, 332, 331, 330, 329, + + 328, 327, 326, 322, 321, 320, 319, 318, 317, 316, + 315, 311, 310, 309, 308, 307, 302, 301, 298, 297, + 296, 295, 294, 293, 290, 287, 284, 283, 282, 281, + 280, 279, 278, 277, 276, 275, 274, 273, 272, 269, + 268, 267, 266, 265, 264, 263, 260, 257, 256, 98, + 96, 255, 253, 92, 229, 223, 221, 217, 216, 199, + 182, 177, 146, 134, 133, 107, 106, 105, 104, 98, + 96, 95, 92, 90, 89, 1037, 5, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037 } ; -static yyconst short int yy_chk[865] = +static yyconst short int yy_chk[1352] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -585,95 +845,149 @@ static yyconst short int yy_chk[865] = 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, 17, 7, 20, 4, 7, - 20, 18, 17, 18, 23, 32, 70, 24, 23, 70, - 21, 24, 25, 32, 2, 3, 3, 3, 4, 3, - 21, 24, 3, 3, 3, 3, 25, 3, 3, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 22, 7, 2, 4, 7, + 2, 4, 17, 17, 4, 23, 28, 16, 24, 22, + 24, 188, 16, 25, 28, 23, 25, 29, 23, 188, - 638, 3, 3, 39, 3, 3, 28, 3, 3, 30, - 28, 36, 3, 29, 3, 3, 36, 39, 3, 38, - 28, 30, 3, 29, 29, 33, 37, 38, 637, 34, - 33, 33, 34, 35, 34, 33, 35, 34, 40, 37, - 35, 42, 40, 35, 41, 41, 40, 43, 35, 44, - 45, 42, 40, 46, 635, 47, 44, 47, 45, 41, - 46, 43, 48, 80, 48, 51, 80, 46, 634, 51, - 54, 54, 54, 54, 55, 55, 55, 95, 95, 51, - 56, 56, 56, 57, 57, 57, 58, 58, 58, 633, - 97, 56, 97, 109, 57, 59, 59, 59, 60, 60, + 24, 29, 25, 2, 3, 3, 3, 4, 38, 3, + 733, 29, 31, 3, 3, 3, 3, 58, 38, 58, + 3, 3, 3, 26, 3, 3, 31, 3, 3, 16, + 3, 3, 3, 26, 72, 3, 26, 30, 3, 3, + 3, 30, 3, 46, 3, 30, 34, 3, 36, 52, + 34, 30, 35, 35, 236, 72, 42, 46, 36, 42, + 34, 36, 42, 52, 35, 35, 80, 35, 39, 3, + 39, 236, 47, 3, 39, 39, 47, 40, 39, 39, + 40, 41, 71, 40, 80, 41, 40, 43, 41, 41, + 132, 132, 41, 50, 50, 41, 147, 71, 43, 44, - 60, 62, 65, 109, 120, 62, 63, 64, 62, 65, - 58, 64, 63, 63, 64, 66, 66, 120, 60, 631, - 67, 64, 66, 67, 59, 60, 66, 66, 68, 107, - 67, 108, 67, 155, 128, 68, 108, 107, 113, 128, - 630, 155, 68, 69, 69, 69, 131, 69, 113, 418, - 69, 69, 69, 69, 418, 69, 69, 69, 268, 268, - 69, 131, 69, 69, 629, 69, 69, 146, 134, 146, - 69, 138, 69, 69, 138, 134, 69, 134, 159, 150, - 69, 159, 150, 138, 138, 160, 161, 138, 150, 138, - 162, 164, 160, 163, 164, 161, 165, 162, 159, 209, + 43, 41, 50, 44, 43, 49, 147, 44, 50, 49, + 44, 51, 53, 49, 55, 51, 53, 56, 55, 49, + 61, 56, 55, 61, 56, 51, 61, 55, 55, 53, + 57, 56, 70, 56, 63, 83, 56, 70, 63, 83, + 57, 184, 63, 57, 66, 66, 66, 66, 63, 67, + 67, 67, 68, 68, 68, 73, 143, 184, 74, 73, + 74, 88, 143, 77, 88, 68, 69, 69, 69, 176, + 74, 69, 77, 73, 70, 69, 69, 69, 69, 176, + 77, 75, 69, 69, 69, 117, 100, 69, 117, 69, + 69, 100, 69, 69, 69, 134, 75, 69, 134, 75, - 163, 162, 161, 165, 166, 159, 167, 163, 166, 168, - 165, 309, 167, 167, 169, 166, 168, 249, 169, 249, - 269, 169, 270, 168, 272, 272, 296, 269, 270, 270, - 273, 273, 272, 626, 269, 209, 274, 273, 296, 369, - 274, 625, 371, 274, 624, 623, 369, 309, 369, 371, - 507, 371, 372, 372, 447, 622, 447, 507, 520, 372, - 619, 618, 617, 447, 616, 507, 615, 614, 520, 613, - 520, 520, 643, 643, 643, 644, 644, 645, 645, 645, - 646, 646, 647, 647, 612, 611, 610, 608, 606, 605, - 604, 603, 602, 601, 600, 598, 597, 596, 591, 587, + 69, 69, 69, 78, 69, 75, 69, 78, 79, 69, + 84, 78, 79, 81, 107, 87, 79, 245, 107, 87, + 79, 78, 82, 87, 81, 81, 79, 87, 100, 245, + 82, 69, 136, 87, 109, 69, 81, 81, 109, 81, + 82, 136, 208, 82, 85, 85, 85, 85, 84, 148, + 85, 208, 177, 233, 148, 155, 177, 149, 84, 155, + 149, 84, 86, 86, 86, 155, 177, 86, 149, 164, + 178, 86, 86, 86, 86, 233, 178, 200, 86, 86, + 86, 164, 164, 86, 213, 86, 86, 200, 86, 86, + 86, 217, 217, 86, 185, 185, 86, 86, 86, 222, - 586, 585, 584, 583, 582, 581, 579, 575, 573, 572, - 570, 569, 568, 567, 566, 565, 564, 563, 561, 560, - 559, 558, 557, 556, 555, 550, 549, 547, 546, 545, - 544, 542, 541, 540, 536, 535, 534, 533, 531, 530, - 529, 527, 526, 524, 522, 519, 518, 515, 514, 513, - 512, 511, 510, 509, 508, 505, 504, 502, 501, 499, - 497, 496, 493, 492, 491, 490, 489, 488, 486, 485, - 484, 483, 482, 480, 478, 477, 472, 470, 469, 468, - 467, 465, 462, 461, 460, 459, 458, 456, 455, 454, - 453, 452, 451, 450, 446, 444, 443, 441, 440, 439, + 86, 185, 86, 187, 213, 86, 179, 179, 179, 222, + 187, 193, 187, 201, 193, 231, 206, 201, 206, 207, + 231, 735, 207, 193, 193, 206, 214, 86, 193, 214, + 193, 86, 201, 214, 218, 214, 232, 218, 239, 241, + 218, 226, 226, 226, 226, 227, 227, 227, 228, 228, + 228, 234, 235, 238, 234, 240, 235, 231, 242, 232, + 238, 228, 243, 241, 244, 246, 243, 239, 252, 244, + 303, 339, 240, 363, 363, 242, 247, 247, 247, 247, + 246, 317, 247, 336, 380, 414, 317, 252, 369, 339, + 369, 336, 391, 407, 407, 408, 380, 252, 391, 408, - 437, 435, 434, 433, 431, 430, 429, 428, 427, 426, - 425, 424, 423, 422, 421, 420, 419, 417, 415, 414, - 413, 412, 411, 409, 408, 407, 405, 403, 402, 399, - 398, 397, 395, 394, 393, 392, 391, 390, 388, 387, - 386, 384, 383, 382, 381, 379, 378, 377, 376, 375, - 374, 370, 368, 365, 364, 363, 361, 360, 359, 358, - 357, 356, 355, 354, 352, 351, 350, 348, 347, 346, - 345, 344, 343, 341, 340, 339, 338, 337, 335, 334, - 333, 332, 331, 330, 326, 325, 324, 323, 322, 321, - 319, 318, 317, 316, 315, 314, 313, 312, 311, 308, + 409, 411, 413, 415, 412, 416, 414, 447, 409, 417, + 417, 411, 303, 412, 413, 464, 496, 520, 564, 447, + 416, 417, 520, 569, 539, 564, 415, 539, 571, 496, + 572, 574, 573, 636, 647, 706, 707, 571, 573, 708, + 647, 736, 737, 574, 569, 636, 738, 707, 708, 741, + 706, 572, 742, 746, 750, 751, 752, 464, 754, 755, + 757, 760, 762, 763, 764, 765, 766, 767, 768, 769, + 770, 771, 772, 773, 775, 776, 778, 779, 780, 781, + 782, 783, 784, 785, 786, 789, 790, 792, 793, 794, + 795, 797, 798, 799, 800, 801, 802, 803, 805, 806, - 306, 305, 304, 301, 300, 299, 297, 295, 293, 292, - 291, 290, 289, 288, 286, 285, 284, 283, 282, 280, - 279, 278, 277, 276, 271, 267, 266, 265, 264, 263, - 261, 260, 259, 258, 257, 256, 255, 254, 253, 252, - 251, 250, 248, 247, 246, 245, 244, 243, 242, 241, - 240, 239, 237, 236, 234, 233, 232, 231, 230, 229, - 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, - 218, 217, 216, 215, 214, 213, 212, 211, 210, 208, - 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, - 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, + 807, 810, 812, 813, 814, 815, 816, 817, 818, 819, + 821, 822, 823, 824, 825, 827, 828, 829, 821, 830, + 831, 832, 833, 835, 837, 838, 839, 840, 841, 844, + 847, 850, 851, 852, 853, 856, 857, 859, 860, 861, + 823, 863, 864, 865, 866, 868, 869, 870, 872, 873, + 874, 875, 876, 881, 882, 883, 884, 885, 886, 887, + 889, 892, 894, 895, 896, 897, 901, 902, 903, 904, + 905, 906, 907, 909, 910, 916, 917, 918, 919, 920, + 922, 924, 925, 926, 928, 930, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 944, 945, 946, 947, - 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, - 177, 176, 175, 174, 171, 158, 153, 152, 149, 148, - 147, 145, 144, 143, 142, 141, 140, 139, 137, 136, - 135, 133, 132, 130, 129, 127, 126, 125, 124, 123, - 122, 121, 119, 118, 117, 116, 115, 114, 112, 111, - 110, 106, 105, 104, 103, 102, 101, 100, 99, 98, - 96, 94, 93, 92, 91, 90, 89, 88, 87, 86, - 85, 84, 83, 82, 81, 79, 78, 77, 76, 75, - 74, 72, 61, 53, 50, 49, 31, 27, 26, 22, - 19, 16, 15, 13, 12, 11, 10, 9, 5, 642, + 949, 952, 954, 955, 956, 957, 961, 964, 966, 967, + 968, 969, 970, 971, 974, 975, 979, 981, 988, 989, + 993, 995, 1000, 1001, 1002, 1003, 1004, 1009, 1012, 1013, + 1014, 1015, 1016, 1017, 1018, 1019, 1022, 1023, 1024, 1027, + 1028, 1029, 1030, 1031, 1032, 1033, 1038, 1038, 1038, 1038, + 1038, 1038, 1039, 1039, 1040, 1040, 732, 1040, 1040, 1040, + 1041, 1041, 1041, 1042, 1042, 1042, 1042, 1042, 1042, 1043, + 1043, 1043, 1043, 1044, 1044, 731, 1044, 1044, 1044, 730, + 728, 725, 724, 723, 722, 721, 720, 718, 717, 716, + 715, 714, 713, 712, 711, 710, 705, 704, 702, 701, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, - 642, 642, 642, 642 + 700, 699, 698, 697, 696, 695, 693, 692, 691, 690, + 689, 688, 687, 686, 684, 682, 681, 680, 679, 678, + 677, 676, 675, 674, 673, 672, 671, 669, 668, 667, + 666, 665, 664, 663, 661, 660, 659, 658, 657, 656, + 655, 654, 653, 652, 651, 650, 649, 648, 646, 645, + 644, 643, 642, 641, 640, 639, 638, 635, 634, 633, + 632, 631, 630, 629, 628, 626, 625, 624, 623, 622, + 620, 619, 617, 616, 615, 612, 611, 610, 609, 608, + 606, 605, 604, 603, 602, 601, 600, 599, 598, 596, + 595, 594, 593, 591, 590, 588, 587, 586, 584, 583, + + 582, 581, 580, 578, 576, 570, 568, 565, 563, 562, + 561, 559, 558, 557, 556, 555, 554, 553, 552, 551, + 550, 549, 548, 547, 546, 545, 544, 543, 542, 540, + 538, 537, 536, 535, 534, 532, 531, 530, 528, 527, + 526, 525, 524, 523, 522, 521, 518, 517, 516, 515, + 513, 512, 510, 509, 508, 507, 506, 505, 504, 502, + 501, 500, 499, 498, 497, 495, 494, 493, 492, 491, + 487, 486, 485, 484, 483, 482, 481, 480, 479, 477, + 476, 475, 474, 473, 472, 471, 470, 469, 468, 467, + 466, 463, 461, 460, 459, 458, 457, 455, 454, 453, + + 452, 451, 450, 448, 446, 444, 443, 442, 441, 439, + 438, 437, 436, 434, 433, 432, 431, 429, 427, 425, + 424, 423, 421, 420, 419, 410, 405, 404, 403, 402, + 401, 400, 399, 398, 396, 395, 394, 393, 392, 390, + 389, 388, 387, 386, 385, 384, 383, 382, 381, 379, + 378, 377, 376, 375, 374, 373, 372, 371, 370, 368, + 367, 366, 365, 364, 362, 361, 360, 359, 358, 357, + 356, 354, 353, 352, 351, 349, 348, 347, 345, 344, + 343, 342, 341, 340, 338, 337, 335, 334, 333, 332, + 331, 330, 329, 327, 326, 325, 324, 323, 322, 321, + + 320, 319, 318, 316, 315, 314, 313, 312, 311, 310, + 309, 308, 306, 304, 302, 301, 300, 299, 298, 297, + 296, 295, 294, 293, 292, 291, 290, 289, 288, 287, + 286, 285, 284, 283, 282, 281, 280, 279, 278, 277, + 276, 275, 274, 273, 272, 271, 269, 268, 267, 266, + 265, 264, 263, 262, 261, 260, 259, 258, 257, 256, + 255, 254, 250, 237, 229, 225, 220, 219, 216, 212, + 211, 210, 209, 205, 204, 203, 202, 199, 198, 197, + 196, 195, 194, 192, 191, 190, 189, 186, 183, 182, + 181, 180, 175, 174, 173, 172, 171, 170, 169, 168, + + 167, 166, 165, 163, 162, 161, 160, 159, 158, 157, + 156, 154, 153, 152, 151, 150, 146, 145, 142, 141, + 140, 139, 138, 137, 135, 133, 131, 130, 129, 128, + 127, 126, 125, 124, 123, 121, 120, 119, 118, 116, + 115, 114, 113, 112, 111, 110, 108, 106, 101, 98, + 96, 95, 94, 91, 76, 65, 62, 60, 59, 54, + 48, 45, 37, 33, 32, 21, 20, 19, 18, 15, + 14, 13, 11, 10, 9, 5, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 1037 } ; static yy_state_type yy_last_accepting_state; @@ -685,10 +999,12 @@ static char *yy_last_accepting_cpos; #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET char *yytext; +#line 1 "lev_comp.l" #define INITIAL 0 -/* NetHack 3.5 lev_comp.l $Date: 2009/05/11 22:53:51 $ $Revision: 1.12 $ */ -/* SCCS Id: @(#)lev_lex.c 3.5 2002/03/27 */ +#line 2 "lev_comp.l" +/* SCCS Id: @(#)lev_lex.c 3.4 2002/03/27 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -753,37 +1069,105 @@ int FDECL(yyoutput, (int)); void FDECL(init_yyin, (FILE *)); void FDECL(init_yyout, (FILE *)); +long NDECL(handle_varstring_check); +long FDECL(corefunc_str_check, (char *, long)); + +extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); + +extern struct lc_vardefs *variable_definitions; + +extern long FDECL(method_defined, (char *, long, long *)); + +void FDECL(savetoken, (char *)); +void NDECL(newline); +void FDECL(advancepos, (char *)); + /* * This doesn't always get put in lev_comp.h * (esp. when using older versions of bison). */ extern YYSTYPE yylval; -int nh_line_number = 1, colon_line_number = 1; +int nh_line_number = 1; +int token_start_pos = 0; +char curr_token[512]; static char map[4096]; static int map_cnt = 0; +FILE *orig_yyin = NULL; + +#define ST_RET(x) do { savetoken(yytext); return x; } while (0); +#define ST_RETF(y, x) do { savetoken(yytext); y; return x; } while (0); + #define MAPC 1 +#line 1105 "lex.yy.c" /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP -extern int NDECL(yywrap); +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif #endif #ifndef YY_NO_UNPUT -static void FDECL(yyunput, (int,char *)); +static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef yytext_ptr -static void FDECL(yy_flex_strncpy, (char *,const char *,int)); +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT -static int NDECL(input); +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static 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_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#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. */ @@ -840,6 +1224,13 @@ static int NDECL(input); #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. */ @@ -858,14 +1249,15 @@ static int NDECL(input); (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION -int NDECL(yylex); -int yylex() +YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; +#line 102 "lev_comp.l" +#line 1261 "lex.yy.c" if ( yy_init ) { @@ -917,13 +1309,13 @@ yy_match: 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 >= 643 ) + if ( yy_current_state >= 1038 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 800 ); + while ( yy_base[yy_current_state] != 1277 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -951,7 +1343,9 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP +#line 103 "lev_comp.l" { + savetoken(yytext); BEGIN(INITIAL); yylval.map = (char *) alloc(map_cnt + 1); (void) strncpy(yylval.map, map, map_cnt); @@ -962,464 +1356,1004 @@ YY_RULE_SETUP YY_BREAK case 2: YY_RULE_SETUP +#line 112 "lev_comp.l" { int len = yyleng; + savetoken(yytext); /* convert \r\n to \n */ if (len >= 2 && yytext[len - 2] == '\r') len -= 1; - nh_line_number++; (void) strncpy(map + map_cnt, yytext, len); map_cnt += len; map[map_cnt - 1] = '\n'; map[map_cnt] = '\0'; + newline(); } YY_BREAK case 3: YY_RULE_SETUP -{ nh_line_number++; } +#line 123 "lev_comp.l" +{ savetoken(yytext); newline(); } YY_BREAK case 4: YY_RULE_SETUP -{ colon_line_number = nh_line_number; return ':'; } +#line 124 "lev_comp.l" +ST_RET(MESSAGE_ID); YY_BREAK case 5: YY_RULE_SETUP -return MESSAGE_ID; +#line 125 "lev_comp.l" +ST_RET(NOMAP_ID); YY_BREAK case 6: YY_RULE_SETUP -return MAZE_ID; +#line 126 "lev_comp.l" +ST_RET(MAZE_ID); YY_BREAK case 7: YY_RULE_SETUP -return NOMAP_ID; +#line 127 "lev_comp.l" +ST_RET(LEVEL_ID); YY_BREAK case 8: YY_RULE_SETUP -return LEVEL_ID; +#line 128 "lev_comp.l" +ST_RET(LEV_INIT_ID); YY_BREAK case 9: YY_RULE_SETUP -return LEV_INIT_ID; +#line 129 "lev_comp.l" +ST_RET(MAZE_GRID_ID); YY_BREAK case 10: YY_RULE_SETUP -return FLAGS_ID; +#line 130 "lev_comp.l" +ST_RET(SOLID_FILL_ID); YY_BREAK case 11: YY_RULE_SETUP -return GEOMETRY_ID; +#line 131 "lev_comp.l" +ST_RET(MINES_ID); YY_BREAK case 12: YY_RULE_SETUP -{ BEGIN(MAPC); nh_line_number++; } +#line 132 "lev_comp.l" +ST_RET(ROGUELEV_ID); YY_BREAK case 13: YY_RULE_SETUP -return OBJECT_ID; +#line 133 "lev_comp.l" +ST_RET(FLAGS_ID); YY_BREAK case 14: YY_RULE_SETUP -return COBJECT_ID; +#line 134 "lev_comp.l" +ST_RET(GEOMETRY_ID); YY_BREAK case 15: YY_RULE_SETUP -return MONSTER_ID; +#line 135 "lev_comp.l" +{ savetoken(yytext); BEGIN(MAPC); newline(); } YY_BREAK case 16: YY_RULE_SETUP -return TRAP_ID; +#line 136 "lev_comp.l" +ST_RET(object_ID); YY_BREAK case 17: YY_RULE_SETUP -return DOOR_ID; +#line 137 "lev_comp.l" +ST_RET(OBJECT_ID); YY_BREAK case 18: YY_RULE_SETUP -return DRAWBRIDGE_ID; +#line 138 "lev_comp.l" +ST_RET(COBJECT_ID); YY_BREAK case 19: YY_RULE_SETUP -return MAZEWALK_ID; +#line 139 "lev_comp.l" +ST_RET(MONSTER_ID); YY_BREAK case 20: YY_RULE_SETUP -return WALLIFY_ID; +#line 140 "lev_comp.l" +ST_RET(monster_ID); YY_BREAK case 21: YY_RULE_SETUP -return REGION_ID; +#line 141 "lev_comp.l" +ST_RET(TRAP_ID); YY_BREAK case 22: YY_RULE_SETUP -return RANDOM_OBJECTS_ID; +#line 142 "lev_comp.l" +ST_RET(DOOR_ID); YY_BREAK case 23: YY_RULE_SETUP -return RANDOM_MONSTERS_ID; +#line 143 "lev_comp.l" +ST_RET(ROOMDOOR_ID); YY_BREAK case 24: YY_RULE_SETUP -return RANDOM_PLACES_ID; +#line 144 "lev_comp.l" +ST_RET(DRAWBRIDGE_ID); YY_BREAK case 25: YY_RULE_SETUP -return ALTAR_ID; +#line 145 "lev_comp.l" +ST_RET(MAZEWALK_ID); YY_BREAK case 26: YY_RULE_SETUP -return LADDER_ID; +#line 146 "lev_comp.l" +ST_RET(WALLIFY_ID); YY_BREAK case 27: YY_RULE_SETUP -return STAIR_ID; +#line 147 "lev_comp.l" +ST_RET(REGION_ID); YY_BREAK case 28: YY_RULE_SETUP -return PORTAL_ID; +#line 148 "lev_comp.l" +ST_RET(ALTAR_ID); YY_BREAK case 29: YY_RULE_SETUP -return TELEPRT_ID; +#line 149 "lev_comp.l" +ST_RET(LADDER_ID); YY_BREAK case 30: YY_RULE_SETUP -return BRANCH_ID; +#line 150 "lev_comp.l" +ST_RET(STAIR_ID); YY_BREAK case 31: YY_RULE_SETUP -return FOUNTAIN_ID; +#line 151 "lev_comp.l" +ST_RET(PORTAL_ID); YY_BREAK case 32: YY_RULE_SETUP -return SINK_ID; +#line 152 "lev_comp.l" +ST_RET(TELEPRT_ID); YY_BREAK case 33: YY_RULE_SETUP -return POOL_ID; +#line 153 "lev_comp.l" +ST_RET(BRANCH_ID); YY_BREAK case 34: YY_RULE_SETUP -return NON_DIGGABLE_ID; +#line 154 "lev_comp.l" +ST_RET(FOUNTAIN_ID); YY_BREAK case 35: YY_RULE_SETUP -return NON_PASSWALL_ID; +#line 155 "lev_comp.l" +ST_RET(SINK_ID); YY_BREAK case 36: YY_RULE_SETUP -return ROOM_ID; +#line 156 "lev_comp.l" +ST_RET(POOL_ID); YY_BREAK case 37: YY_RULE_SETUP -return SUBROOM_ID; +#line 157 "lev_comp.l" +ST_RET(NON_DIGGABLE_ID); YY_BREAK case 38: YY_RULE_SETUP -return RAND_CORRIDOR_ID; +#line 158 "lev_comp.l" +ST_RET(NON_PASSWALL_ID); YY_BREAK case 39: YY_RULE_SETUP -return CORRIDOR_ID; +#line 159 "lev_comp.l" +ST_RET(IF_ID); YY_BREAK case 40: YY_RULE_SETUP -return GOLD_ID; +#line 160 "lev_comp.l" +ST_RET(ELSE_ID); YY_BREAK case 41: YY_RULE_SETUP -return ENGRAVING_ID; +#line 161 "lev_comp.l" +ST_RET(EXIT_ID); YY_BREAK case 42: YY_RULE_SETUP -return NAME_ID; +#line 162 "lev_comp.l" +ST_RET(ROOM_ID); YY_BREAK case 43: YY_RULE_SETUP -return CHANCE_ID; +#line 163 "lev_comp.l" +ST_RET(SUBROOM_ID); YY_BREAK case 44: YY_RULE_SETUP -return LEV; +#line 164 "lev_comp.l" +ST_RET(RAND_CORRIDOR_ID); YY_BREAK case 45: YY_RULE_SETUP -{ yylval.i=D_ISOPEN; return DOOR_STATE; } +#line 165 "lev_comp.l" +ST_RET(CORRIDOR_ID); YY_BREAK case 46: YY_RULE_SETUP -{ yylval.i=D_CLOSED; return DOOR_STATE; } +#line 166 "lev_comp.l" +ST_RET(TERRAIN_ID); YY_BREAK case 47: YY_RULE_SETUP -{ yylval.i=D_LOCKED; return DOOR_STATE; } +#line 167 "lev_comp.l" +ST_RET(terrain_ID); YY_BREAK case 48: YY_RULE_SETUP -{ yylval.i=D_NODOOR; return DOOR_STATE; } +#line 168 "lev_comp.l" +ST_RET(REPLACE_TERRAIN_ID); YY_BREAK case 49: YY_RULE_SETUP -{ yylval.i=D_BROKEN; return DOOR_STATE; } +#line 169 "lev_comp.l" +ST_RET(GOLD_ID); YY_BREAK case 50: YY_RULE_SETUP -{ yylval.i=W_NORTH; return DIRECTION; } +#line 170 "lev_comp.l" +ST_RET(GRAVE_ID); YY_BREAK case 51: YY_RULE_SETUP -{ yylval.i=W_EAST; return DIRECTION; } +#line 171 "lev_comp.l" +ST_RET(ENGRAVING_ID); YY_BREAK case 52: YY_RULE_SETUP -{ yylval.i=W_SOUTH; return DIRECTION; } +#line 172 "lev_comp.l" +ST_RET(MINERALIZE_ID); YY_BREAK case 53: YY_RULE_SETUP -{ yylval.i=W_WEST; return DIRECTION; } +#line 173 "lev_comp.l" +ST_RET(NAME_ID); YY_BREAK case 54: YY_RULE_SETUP -{ yylval.i = -1; return RANDOM_TYPE; } +#line 174 "lev_comp.l" +ST_RET(FOR_ID); YY_BREAK case 55: YY_RULE_SETUP -{ yylval.i = -2; return NONE; } +#line 175 "lev_comp.l" +ST_RET(TO_ID); YY_BREAK case 56: YY_RULE_SETUP -return O_REGISTER; +#line 176 "lev_comp.l" +ST_RET(LOOP_ID); YY_BREAK case 57: YY_RULE_SETUP -return M_REGISTER; +#line 177 "lev_comp.l" +ST_RET(SWITCH_ID); YY_BREAK case 58: YY_RULE_SETUP -return P_REGISTER; +#line 178 "lev_comp.l" +ST_RET(CASE_ID); YY_BREAK case 59: YY_RULE_SETUP -return A_REGISTER; +#line 179 "lev_comp.l" +ST_RET(BREAK_ID); YY_BREAK case 60: YY_RULE_SETUP -{ yylval.i=1; return LEFT_OR_RIGHT; } +#line 180 "lev_comp.l" +ST_RET(DEFAULT_ID); YY_BREAK case 61: YY_RULE_SETUP -{ yylval.i=2; return LEFT_OR_RIGHT; } +#line 181 "lev_comp.l" +ST_RET(FUNCTION_ID); YY_BREAK case 62: YY_RULE_SETUP -{ yylval.i=3; return CENTER; } +#line 182 "lev_comp.l" +ST_RET(SHUFFLE_ID); YY_BREAK case 63: YY_RULE_SETUP -{ yylval.i=4; return LEFT_OR_RIGHT; } +#line 183 "lev_comp.l" +ST_RET(MONTYPE_ID); YY_BREAK case 64: YY_RULE_SETUP -{ yylval.i=5; return LEFT_OR_RIGHT; } +#line 184 "lev_comp.l" +ST_RET(selection_ID); YY_BREAK case 65: YY_RULE_SETUP -{ yylval.i=1; return TOP_OR_BOT; } +#line 185 "lev_comp.l" +ST_RET(rect_ID); YY_BREAK case 66: YY_RULE_SETUP -{ yylval.i=5; return TOP_OR_BOT; } +#line 186 "lev_comp.l" +ST_RET(fillrect_ID); YY_BREAK case 67: YY_RULE_SETUP -{ yylval.i=1; return LIGHT_STATE; } +#line 187 "lev_comp.l" +ST_RET(line_ID); YY_BREAK case 68: YY_RULE_SETUP -{ yylval.i=0; return LIGHT_STATE; } +#line 188 "lev_comp.l" +ST_RET(randline_ID); YY_BREAK case 69: YY_RULE_SETUP -{ yylval.i=0; return FILLING; } +#line 189 "lev_comp.l" +ST_RET(grow_ID); YY_BREAK case 70: YY_RULE_SETUP -{ yylval.i=1; return FILLING; } +#line 190 "lev_comp.l" +ST_RET(flood_ID); YY_BREAK case 71: YY_RULE_SETUP -{ yylval.i= AM_NONE; return ALIGNMENT; } +#line 191 "lev_comp.l" +ST_RET(rndcoord_ID); YY_BREAK case 72: YY_RULE_SETUP -{ yylval.i= AM_LAWFUL; return ALIGNMENT; } +#line 192 "lev_comp.l" +ST_RET(circle_ID); YY_BREAK case 73: YY_RULE_SETUP -{ yylval.i= AM_NEUTRAL; return ALIGNMENT; } +#line 193 "lev_comp.l" +ST_RET(ellipse_ID); YY_BREAK case 74: YY_RULE_SETUP -{ yylval.i= AM_CHAOTIC; return ALIGNMENT; } +#line 194 "lev_comp.l" +ST_RET(filter_ID); YY_BREAK case 75: YY_RULE_SETUP -{ yylval.i= AM_SPLEV_CO; return ALIGNMENT; } +#line 195 "lev_comp.l" +ST_RET(gradient_ID); YY_BREAK case 76: YY_RULE_SETUP -{ yylval.i= AM_SPLEV_NONCO; return ALIGNMENT; } +#line 196 "lev_comp.l" +ST_RET(complement_ID); YY_BREAK case 77: YY_RULE_SETUP -{ yylval.i=1; return MON_ATTITUDE; } +#line 197 "lev_comp.l" +{ savetoken(yytext); yylval.i=SEL_GRADIENT_RADIAL; return GRADIENT_TYPE; } YY_BREAK case 78: YY_RULE_SETUP -{ yylval.i=0; return MON_ATTITUDE; } +#line 198 "lev_comp.l" +{ savetoken(yytext); yylval.i=SEL_GRADIENT_SQUARE; return GRADIENT_TYPE; } YY_BREAK case 79: YY_RULE_SETUP -{ yylval.i=1; return MON_ALERTNESS; } +#line 199 "lev_comp.l" +{ savetoken(yytext); yylval.i=DRY; return HUMIDITY_TYPE; } YY_BREAK case 80: YY_RULE_SETUP -{ yylval.i=0; return MON_ALERTNESS; } +#line 200 "lev_comp.l" +{ savetoken(yytext); yylval.i=WET; return HUMIDITY_TYPE; } YY_BREAK case 81: YY_RULE_SETUP -{ yylval.i= M_AP_FURNITURE; return MON_APPEARANCE; } +#line 201 "lev_comp.l" +{ savetoken(yytext); yylval.i=HOT; return HUMIDITY_TYPE; } YY_BREAK case 82: YY_RULE_SETUP -{ yylval.i= M_AP_MONSTER; return MON_APPEARANCE; } +#line 202 "lev_comp.l" +{ savetoken(yytext); yylval.i=SOLID; return HUMIDITY_TYPE; } YY_BREAK case 83: YY_RULE_SETUP -{ yylval.i= M_AP_OBJECT; return MON_APPEARANCE; } +#line 203 "lev_comp.l" +{ savetoken(yytext); yylval.i=ANY_LOC; return HUMIDITY_TYPE; } YY_BREAK case 84: YY_RULE_SETUP -{ yylval.i=2; return ALTAR_TYPE; } +#line 204 "lev_comp.l" +ST_RET(LEV); YY_BREAK case 85: YY_RULE_SETUP -{ yylval.i=1; return ALTAR_TYPE; } +#line 205 "lev_comp.l" +ST_RET(QUANTITY_ID); YY_BREAK case 86: YY_RULE_SETUP -{ yylval.i=0; return ALTAR_TYPE; } +#line 206 "lev_comp.l" +ST_RET(BURIED_ID); YY_BREAK case 87: YY_RULE_SETUP -{ yylval.i=1; return UP_OR_DOWN; } +#line 207 "lev_comp.l" +ST_RET(ERODED_ID); YY_BREAK case 88: YY_RULE_SETUP -{ yylval.i=0; return UP_OR_DOWN; } +#line 208 "lev_comp.l" +ST_RET(ERODEPROOF_ID); YY_BREAK case 89: YY_RULE_SETUP -{ yylval.i=0; return BOOLEAN; } +#line 209 "lev_comp.l" +ST_RET(TRAPPED_ID); YY_BREAK case 90: YY_RULE_SETUP -{ yylval.i=1; return BOOLEAN; } +#line 210 "lev_comp.l" +ST_RET(RECHARGED_ID); YY_BREAK case 91: YY_RULE_SETUP -{ yylval.i=DUST; return ENGRAVING_TYPE; } +#line 211 "lev_comp.l" +ST_RET(INVIS_ID); YY_BREAK case 92: YY_RULE_SETUP -{ yylval.i=ENGRAVE; return ENGRAVING_TYPE; } +#line 212 "lev_comp.l" +ST_RET(GREASED_ID); YY_BREAK case 93: YY_RULE_SETUP -{ yylval.i=BURN; return ENGRAVING_TYPE; } +#line 213 "lev_comp.l" +ST_RET(FEMALE_ID); YY_BREAK case 94: YY_RULE_SETUP -{ yylval.i=MARK; return ENGRAVING_TYPE; } +#line 214 "lev_comp.l" +ST_RET(CANCELLED_ID); YY_BREAK case 95: YY_RULE_SETUP -{ yylval.i=ENGR_BLOOD; return ENGRAVING_TYPE; } +#line 215 "lev_comp.l" +ST_RET(REVIVED_ID); YY_BREAK case 96: YY_RULE_SETUP -{ yylval.i=1; return CURSE_TYPE; } +#line 216 "lev_comp.l" +ST_RET(AVENGE_ID); YY_BREAK case 97: YY_RULE_SETUP -{ yylval.i=2; return CURSE_TYPE; } +#line 217 "lev_comp.l" +ST_RET(FLEEING_ID); YY_BREAK case 98: YY_RULE_SETUP -{ yylval.i=3; return CURSE_TYPE; } +#line 218 "lev_comp.l" +ST_RET(BLINDED_ID); YY_BREAK case 99: YY_RULE_SETUP -{ return CONTAINED; } +#line 219 "lev_comp.l" +ST_RET(PARALYZED_ID); YY_BREAK case 100: YY_RULE_SETUP -{ yylval.i=NOTELEPORT; return FLAG_TYPE; } +#line 220 "lev_comp.l" +ST_RET(STUNNED_ID); YY_BREAK case 101: YY_RULE_SETUP -{ yylval.i=HARDFLOOR; return FLAG_TYPE; } +#line 221 "lev_comp.l" +ST_RET(CONFUSED_ID); YY_BREAK case 102: YY_RULE_SETUP -{ yylval.i=NOMMAP; return FLAG_TYPE; } +#line 222 "lev_comp.l" +ST_RET(SEENTRAPS_ID); YY_BREAK case 103: YY_RULE_SETUP -{ yylval.i=ARBOREAL; return FLAG_TYPE; } /* KMH */ +#line 223 "lev_comp.l" +ST_RET(ALL_ID); YY_BREAK case 104: YY_RULE_SETUP -{ yylval.i=SHORTSIGHTED; return FLAG_TYPE; } +#line 224 "lev_comp.l" +ST_RETF((yylval.i=1), HORIZ_OR_VERT); YY_BREAK case 105: YY_RULE_SETUP -{ yylval.i = atoi(yytext + 1); return PERCENT; } +#line 225 "lev_comp.l" +{ savetoken(yytext); yylval.i=2; return HORIZ_OR_VERT; } YY_BREAK case 106: YY_RULE_SETUP -{ yylval.i=atoi(yytext); return INTEGER; } +#line 226 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_ISOPEN; return DOOR_STATE; } YY_BREAK case 107: YY_RULE_SETUP -{ yytext[yyleng-1] = 0; /* Discard the trailing \" */ +#line 227 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_CLOSED; return DOOR_STATE; } + YY_BREAK +case 108: +YY_RULE_SETUP +#line 228 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_LOCKED; return DOOR_STATE; } + YY_BREAK +case 109: +YY_RULE_SETUP +#line 229 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_NODOOR; return DOOR_STATE; } + YY_BREAK +case 110: +YY_RULE_SETUP +#line 230 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_BROKEN; return DOOR_STATE; } + YY_BREAK +case 111: +YY_RULE_SETUP +#line 231 "lev_comp.l" +{ savetoken(yytext); yylval.i=D_SECRET; return DOOR_STATE; } + YY_BREAK +case 112: +YY_RULE_SETUP +#line 232 "lev_comp.l" +{ savetoken(yytext); yylval.i=W_NORTH; return DIRECTION; } + YY_BREAK +case 113: +YY_RULE_SETUP +#line 233 "lev_comp.l" +{ savetoken(yytext); yylval.i=W_EAST; return DIRECTION; } + YY_BREAK +case 114: +YY_RULE_SETUP +#line 234 "lev_comp.l" +{ savetoken(yytext); yylval.i=W_SOUTH; return DIRECTION; } + YY_BREAK +case 115: +YY_RULE_SETUP +#line 235 "lev_comp.l" +{ savetoken(yytext); yylval.i=W_WEST; return DIRECTION; } + YY_BREAK +case 116: +YY_RULE_SETUP +#line 236 "lev_comp.l" +{ savetoken(yytext); yylval.i = -1; return RANDOM_TYPE; } + YY_BREAK +case 117: +YY_RULE_SETUP +#line 237 "lev_comp.l" +{ savetoken(yytext); yylval.i = -1; return RANDOM_TYPE_BRACKET; } + YY_BREAK +case 118: +YY_RULE_SETUP +#line 238 "lev_comp.l" +{ savetoken(yytext); yylval.i = -2; return NONE; } + YY_BREAK +case 119: +YY_RULE_SETUP +#line 239 "lev_comp.l" +ST_RET(A_REGISTER); + YY_BREAK +case 120: +YY_RULE_SETUP +#line 240 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return LEFT_OR_RIGHT; } + YY_BREAK +case 121: +YY_RULE_SETUP +#line 241 "lev_comp.l" +{ savetoken(yytext); yylval.i=2; return LEFT_OR_RIGHT; } + YY_BREAK +case 122: +YY_RULE_SETUP +#line 242 "lev_comp.l" +{ savetoken(yytext); yylval.i=3; return CENTER; } + YY_BREAK +case 123: +YY_RULE_SETUP +#line 243 "lev_comp.l" +{ savetoken(yytext); yylval.i=4; return LEFT_OR_RIGHT; } + YY_BREAK +case 124: +YY_RULE_SETUP +#line 244 "lev_comp.l" +{ savetoken(yytext); yylval.i=5; return LEFT_OR_RIGHT; } + YY_BREAK +case 125: +YY_RULE_SETUP +#line 245 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return TOP_OR_BOT; } + YY_BREAK +case 126: +YY_RULE_SETUP +#line 246 "lev_comp.l" +{ savetoken(yytext); yylval.i=5; return TOP_OR_BOT; } + YY_BREAK +case 127: +YY_RULE_SETUP +#line 247 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return LIGHT_STATE; } + YY_BREAK +case 128: +YY_RULE_SETUP +#line 248 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return LIGHT_STATE; } + YY_BREAK +case 129: +YY_RULE_SETUP +#line 249 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return FILLING; } + YY_BREAK +case 130: +YY_RULE_SETUP +#line 250 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return FILLING; } + YY_BREAK +case 131: +YY_RULE_SETUP +#line 251 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return IRREGULAR; } + YY_BREAK +case 132: +YY_RULE_SETUP +#line 252 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return IRREGULAR; } + YY_BREAK +case 133: +YY_RULE_SETUP +#line 253 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return JOINED; } + YY_BREAK +case 134: +YY_RULE_SETUP +#line 254 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return JOINED; } + YY_BREAK +case 135: +YY_RULE_SETUP +#line 255 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return LIMITED; } + YY_BREAK +case 136: +YY_RULE_SETUP +#line 256 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return LIMITED; } + YY_BREAK +case 137: +YY_RULE_SETUP +#line 257 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_NONE; return ALIGNMENT; } + YY_BREAK +case 138: +YY_RULE_SETUP +#line 258 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_LAWFUL; return ALIGNMENT; } + YY_BREAK +case 139: +YY_RULE_SETUP +#line 259 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_NEUTRAL; return ALIGNMENT; } + YY_BREAK +case 140: +YY_RULE_SETUP +#line 260 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_CHAOTIC; return ALIGNMENT; } + YY_BREAK +case 141: +YY_RULE_SETUP +#line 261 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_SPLEV_CO; return ALIGNMENT; } + YY_BREAK +case 142: +YY_RULE_SETUP +#line 262 "lev_comp.l" +{ savetoken(yytext); yylval.i= AM_SPLEV_NONCO; return ALIGNMENT; } + YY_BREAK +case 143: +YY_RULE_SETUP +#line 263 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return MON_ATTITUDE; } + YY_BREAK +case 144: +YY_RULE_SETUP +#line 264 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return MON_ATTITUDE; } + YY_BREAK +case 145: +YY_RULE_SETUP +#line 265 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return MON_ALERTNESS; } + YY_BREAK +case 146: +YY_RULE_SETUP +#line 266 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return MON_ALERTNESS; } + YY_BREAK +case 147: +YY_RULE_SETUP +#line 267 "lev_comp.l" +{ savetoken(yytext); yylval.i= M_AP_FURNITURE; return MON_APPEARANCE; } + YY_BREAK +case 148: +YY_RULE_SETUP +#line 268 "lev_comp.l" +{ savetoken(yytext); yylval.i= M_AP_MONSTER; return MON_APPEARANCE; } + YY_BREAK +case 149: +YY_RULE_SETUP +#line 269 "lev_comp.l" +{ savetoken(yytext); yylval.i= M_AP_OBJECT; return MON_APPEARANCE; } + YY_BREAK +case 150: +YY_RULE_SETUP +#line 270 "lev_comp.l" +{ savetoken(yytext); yylval.i=2; return ALTAR_TYPE; } + YY_BREAK +case 151: +YY_RULE_SETUP +#line 271 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return ALTAR_TYPE; } + YY_BREAK +case 152: +YY_RULE_SETUP +#line 272 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return ALTAR_TYPE; } + YY_BREAK +case 153: +YY_RULE_SETUP +#line 273 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return UP_OR_DOWN; } + YY_BREAK +case 154: +YY_RULE_SETUP +#line 274 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return UP_OR_DOWN; } + YY_BREAK +case 155: +YY_RULE_SETUP +#line 275 "lev_comp.l" +{ savetoken(yytext); yylval.i=0; return BOOLEAN; } + YY_BREAK +case 156: +YY_RULE_SETUP +#line 276 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return BOOLEAN; } + YY_BREAK +case 157: +YY_RULE_SETUP +#line 277 "lev_comp.l" +{ savetoken(yytext); yylval.i=DUST; return ENGRAVING_TYPE; } + YY_BREAK +case 158: +YY_RULE_SETUP +#line 278 "lev_comp.l" +{ savetoken(yytext); yylval.i=ENGRAVE; return ENGRAVING_TYPE; } + YY_BREAK +case 159: +YY_RULE_SETUP +#line 279 "lev_comp.l" +{ savetoken(yytext); yylval.i=BURN; return ENGRAVING_TYPE; } + YY_BREAK +case 160: +YY_RULE_SETUP +#line 280 "lev_comp.l" +{ savetoken(yytext); yylval.i=MARK; return ENGRAVING_TYPE; } + YY_BREAK +case 161: +YY_RULE_SETUP +#line 281 "lev_comp.l" +{ savetoken(yytext); yylval.i=ENGR_BLOOD; return ENGRAVING_TYPE; } + YY_BREAK +case 162: +YY_RULE_SETUP +#line 282 "lev_comp.l" +{ savetoken(yytext); yylval.i=1; return CURSE_TYPE; } + YY_BREAK +case 163: +YY_RULE_SETUP +#line 283 "lev_comp.l" +{ savetoken(yytext); yylval.i=2; return CURSE_TYPE; } + YY_BREAK +case 164: +YY_RULE_SETUP +#line 284 "lev_comp.l" +{ savetoken(yytext); yylval.i=3; return CURSE_TYPE; } + YY_BREAK +case 165: +YY_RULE_SETUP +#line 285 "lev_comp.l" +{ savetoken(yytext); yylval.i=NOTELEPORT; return FLAG_TYPE; } + YY_BREAK +case 166: +YY_RULE_SETUP +#line 286 "lev_comp.l" +{ savetoken(yytext); yylval.i=HARDFLOOR; return FLAG_TYPE; } + YY_BREAK +case 167: +YY_RULE_SETUP +#line 287 "lev_comp.l" +{ savetoken(yytext); yylval.i=NOMMAP; return FLAG_TYPE; } + YY_BREAK +case 168: +YY_RULE_SETUP +#line 288 "lev_comp.l" +{ savetoken(yytext); yylval.i=ARBOREAL; return FLAG_TYPE; } /* KMH */ + YY_BREAK +case 169: +YY_RULE_SETUP +#line 289 "lev_comp.l" +{ savetoken(yytext); yylval.i=SHORTSIGHTED; return FLAG_TYPE; } + YY_BREAK +case 170: +YY_RULE_SETUP +#line 290 "lev_comp.l" +{ savetoken(yytext); yylval.i=MAZELEVEL; return FLAG_TYPE; } + YY_BREAK +case 171: +YY_RULE_SETUP +#line 291 "lev_comp.l" +{ savetoken(yytext); yylval.i=PREMAPPED; return FLAG_TYPE; } + YY_BREAK +case 172: +YY_RULE_SETUP +#line 292 "lev_comp.l" +{ savetoken(yytext); yylval.i=SHROUD; return FLAG_TYPE; } + YY_BREAK +case 173: +YY_RULE_SETUP +#line 293 "lev_comp.l" +{ savetoken(yytext); yylval.i=GRAVEYARD; return FLAG_TYPE; } + YY_BREAK +case 174: +YY_RULE_SETUP +#line 294 "lev_comp.l" +{ char *p = strchr(yytext, 'd'); + savetoken(yytext); + if (p) { + *p = '\0'; + p++; + yylval.dice.num=atoi(yytext); + yylval.dice.die=atoi(p); + } else { yylval.dice.num = yylval.dice.die = 1; } + return DICE; + } + YY_BREAK +case 175: +YY_RULE_SETUP +#line 304 "lev_comp.l" +{ savetoken(yytext); yylval.i = atoi(yytext + 1); + if (yylval.i < 0 || yylval.i > 100) + lc_error("Unexpected percentile '%li%%'", yylval.i); + return PERCENT; } + YY_BREAK +case 176: +YY_RULE_SETUP +#line 308 "lev_comp.l" +{ savetoken(yytext); yylval.i=atoi(yytext); return MINUS_INTEGER; } + YY_BREAK +case 177: +YY_RULE_SETUP +#line 309 "lev_comp.l" +{ savetoken(yytext); yylval.i=atoi(yytext); return PLUS_INTEGER; } + YY_BREAK +case 178: +YY_RULE_SETUP +#line 310 "lev_comp.l" +{ savetoken(yytext); yylval.i = atoi(yytext); + if (yylval.i < 0 || yylval.i > 100) + lc_error("Unexpected percentile '%li%%'", yylval.i); + return SPERCENT; } + YY_BREAK +case 179: +YY_RULE_SETUP +#line 314 "lev_comp.l" +{ savetoken(yytext); yylval.i=atoi(yytext); return INTEGER; } + YY_BREAK +case 180: +YY_RULE_SETUP +#line 315 "lev_comp.l" +{ savetoken(yytext); + yytext[yyleng-1] = 0; /* Discard the trailing \" */ yylval.map = (char *) alloc(strlen(yytext+1)+1); Strcpy(yylval.map, yytext+1); /* Discard the first \" */ return STRING; } YY_BREAK -case 108: +case 181: YY_RULE_SETUP -{ nh_line_number++; } +#line 320 "lev_comp.l" +{ savetoken(yytext); return handle_varstring_check(); } YY_BREAK -case 109: +case 182: YY_RULE_SETUP -; +#line 321 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JE; return COMPARE_TYPE; } YY_BREAK -case 110: +case 183: YY_RULE_SETUP -{ yylval.i = yytext[2]; return CHAR; } +#line 322 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } YY_BREAK -case 111: +case 184: YY_RULE_SETUP -{ yylval.i = yytext[1]; return CHAR; } +#line 323 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } YY_BREAK -case 112: +case 185: YY_RULE_SETUP -{ return yytext[0]; } +#line 324 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JLE; return COMPARE_TYPE; } YY_BREAK -case 113: +case 186: YY_RULE_SETUP +#line 325 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JGE; return COMPARE_TYPE; } + YY_BREAK +case 187: +YY_RULE_SETUP +#line 326 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JL; return COMPARE_TYPE; } + YY_BREAK +case 188: +YY_RULE_SETUP +#line 327 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JG; return COMPARE_TYPE; } + YY_BREAK +case 189: +YY_RULE_SETUP +#line 328 "lev_comp.l" +{ newline(); } + YY_BREAK +case 190: +YY_RULE_SETUP +#line 329 "lev_comp.l" +{ advancepos(yytext); } + YY_BREAK +case 191: +YY_RULE_SETUP +#line 330 "lev_comp.l" +{ savetoken(yytext); yylval.i = yytext[2]; return CHAR; } + YY_BREAK +case 192: +YY_RULE_SETUP +#line 331 "lev_comp.l" +{ savetoken(yytext); yylval.i = yytext[1]; return CHAR; } + YY_BREAK +case 193: +YY_RULE_SETUP +#line 332 "lev_comp.l" +ST_RET(UNKNOWN_TYPE); + YY_BREAK +case 194: +YY_RULE_SETUP +#line 333 "lev_comp.l" +{ savetoken(yytext); return yytext[0]; } + YY_BREAK +case 195: +YY_RULE_SETUP +#line 334 "lev_comp.l" ECHO; YY_BREAK +#line 2357 "lex.yy.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(MAPC): yyterminate(); @@ -1431,6 +2365,7 @@ case YY_STATE_EOF(MAPC): /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { @@ -1576,7 +2511,7 @@ static int yy_get_next_buffer() { /* 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 singled characater, the EOB, so + /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; @@ -1603,7 +2538,7 @@ static int yy_get_next_buffer() /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ - yy_n_chars = 0; + yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { @@ -1625,7 +2560,6 @@ static int yy_get_next_buffer() if ( b->yy_is_our_buffer ) { - int old_size = b->yy_buf_size + 2; int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) @@ -1635,8 +2569,8 @@ static int yy_get_next_buffer() b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yy_flex_realloc2( (genericptr_t) b->yy_ch_buf, - b->yy_buf_size + 2, old_size ); + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ @@ -1659,6 +2593,8 @@ static int yy_get_next_buffer() /* 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 ) @@ -1711,7 +2647,7 @@ static yy_state_type yy_get_previous_state() 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 >= 643 ) + if ( yy_current_state >= 1038 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1727,8 +2663,12 @@ static yy_state_type yy_get_previous_state() * next_state = yy_try_NUL_trans( current_state ); */ +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; +#endif { register int yy_is_jam; register char *yy_cp = yy_c_buf_p; @@ -1742,20 +2682,24 @@ yy_state_type yy_current_state; 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 >= 643 ) + if ( yy_current_state >= 1038 ) 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 == 642); + yy_is_jam = (yy_current_state == 1037); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else static void yyunput( c, yy_bp ) int c; register char *yy_bp; +#endif { register char *yy_cp = yy_c_buf_p; @@ -1776,7 +2720,8 @@ register char *yy_bp; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); - yy_n_chars = yy_current_buffer->yy_buf_size; + 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" ); @@ -1792,7 +2737,11 @@ register char *yy_bp; #endif /* ifndef YY_NO_UNPUT */ +#ifdef __cplusplus +static int yyinput() +#else static int input() +#endif { int c; @@ -1810,32 +2759,44 @@ static int input() else { /* need more input */ - yytext_ptr = yy_c_buf_p; + 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() ) - { - yy_c_buf_p = - yytext_ptr + YY_MORE_ADJ; return EOF; - } if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else return input(); +#endif } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + yy_c_buf_p = yytext_ptr + offset; break; - - case EOB_ACT_LAST_MATCH: - YY_FATAL_ERROR( - "unexpected last match in input()" ); } } } @@ -1850,8 +2811,12 @@ static int input() } +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else void yyrestart( input_file ) FILE *input_file; +#endif { if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); @@ -1861,8 +2826,12 @@ FILE *input_file; } +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else void yy_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; +#endif { if ( yy_current_buffer == new_buffer ) return; @@ -1887,7 +2856,11 @@ YY_BUFFER_STATE new_buffer; } +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else void 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; @@ -1896,9 +2869,13 @@ void yy_load_buffer_state() } +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else YY_BUFFER_STATE yy_create_buffer( file, size ) FILE *file; int size; +#endif { YY_BUFFER_STATE b; @@ -1923,8 +2900,12 @@ int size; } +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else void yy_delete_buffer( b ) YY_BUFFER_STATE b; +#endif { if ( ! b ) return; @@ -1933,31 +2914,37 @@ YY_BUFFER_STATE b; yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yy_flex_free( (genericptr_t) b->yy_ch_buf ); + yy_flex_free( (void *) b->yy_ch_buf ); - yy_flex_free( (genericptr_t) b ); + yy_flex_free( (void *) b ); } #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE -extern int FDECL(isatty, (int)); +extern int isatty YY_PROTO(( int )); #endif #endif +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else void 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; -#ifdef YY_ALWAYS_INTERACTIVE +#if YY_ALWAYS_INTERACTIVE b->yy_is_interactive = 1; #else -#ifdef YY_NEVER_INTERACTIVE +#if YY_NEVER_INTERACTIVE b->yy_is_interactive = 0; #else b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; @@ -1966,9 +2953,17 @@ FILE *file; } +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else void 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 @@ -1988,13 +2983,162 @@ YY_BUFFER_STATE b; } +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_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_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_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_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_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_PROTOS +static void yy_push_state( int new_state ) +#else +static 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 ); + + else + yy_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_STATE +static 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_STATE +static 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_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else static void yy_fatal_error( msg ) -const char msg[]; +char msg[]; +#endif { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); @@ -2010,7 +3154,7 @@ const char msg[]; { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n - YY_MORE_ADJ; \ + yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ @@ -2021,10 +3165,14 @@ const char msg[]; /* Internal utility routines. */ #ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else static void yy_flex_strncpy( s1, s2, n ) char *s1; -const char *s2; +yyconst char *s2; int n; +#endif { register int i; for ( i = 0; i < n; ++i ) @@ -2032,38 +3180,69 @@ int n; } #endif - -static genericptr_t yy_flex_alloc( size ) -yy_size_t size; +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif { - return (genericptr_t) alloc((unsigned)size); - } + register int n; + for ( n = 0; s[n]; ++n ) + ; -/* we want to avoid use of realloc(), so we require that caller supply the - size of the old block of memory */ -static genericptr_t yy_flex_realloc2( ptr, size, old_size ) -genericptr_t ptr; + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) yy_size_t size; -int old_size; +#endif { - genericptr_t outptr = yy_flex_alloc(size); - - if (ptr) { - char *p = (char *) outptr, *q = (char *) ptr; - - while (--old_size >= 0) *p++ = *q++; - yy_flex_free(ptr); - } - return outptr; + return (void *) malloc( size ); } +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static 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_PROTOS +static void yy_flex_free( void *ptr ) +#else static void yy_flex_free( ptr ) -genericptr_t ptr; +void *ptr; +#endif { free( ptr ); } -/*flexhack.skl*/ +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 334 "lev_comp.l" #ifdef AMIGA long *alloc(n) @@ -2083,6 +3262,7 @@ FILE *input_f; else #endif yyin = input_f; + if (!orig_yyin) orig_yyin = yyin; } /* analogous routine (for completeness) */ void init_yyout( output_f ) @@ -2091,4 +3271,51 @@ FILE *output_f; yyout = output_f; } +long +handle_varstring_check() +{ + struct lc_vardefs *vd; + yylval.map = (char *) alloc(strlen(yytext)+1); + Strcpy(yylval.map, yytext); + if ((vd = vardef_defined(variable_definitions, yytext, 1))) { + long l = vd->var_type; + long a = ((l & SPOVAR_ARRAY) == SPOVAR_ARRAY); + l = (l & ~SPOVAR_ARRAY); + if (l == SPOVAR_INT) return (a ? VARSTRING_INT_ARRAY : VARSTRING_INT); + if (l == SPOVAR_STRING) return (a ? VARSTRING_STRING_ARRAY : VARSTRING_STRING); + if (l == SPOVAR_VARIABLE) return (a ? VARSTRING_VAR_ARRAY : VARSTRING_VAR); + if (l == SPOVAR_COORD) return (a ? VARSTRING_COORD_ARRAY : VARSTRING_COORD); + if (l == SPOVAR_REGION) return (a ? VARSTRING_REGION_ARRAY : VARSTRING_REGION); + if (l == SPOVAR_MAPCHAR) return (a ? VARSTRING_MAPCHAR_ARRAY : VARSTRING_MAPCHAR); + if (l == SPOVAR_MONST) return (a ? VARSTRING_MONST_ARRAY : VARSTRING_MONST); + if (l == SPOVAR_OBJ) return (a ? VARSTRING_OBJ_ARRAY : VARSTRING_OBJ); + if (l == SPOVAR_SEL) return (a ? VARSTRING_SEL_ARRAY : VARSTRING_SEL); + } + return VARSTRING; +} + + +void +newline() +{ + nh_line_number++; + token_start_pos = 0; + memset(curr_token, 0, 512); +} + +void +savetoken(s) +char *s; +{ + sprintf(curr_token, "%s", s); + advancepos(s); +} + +void +advancepos(s) +char *s; +{ + token_start_pos += strlen(s); +} + /*lev_comp.l*/ diff --git a/sys/share/lev_yacc.c b/sys/share/lev_yacc.c index 02aaf1938..f247c880b 100644 --- a/sys/share/lev_yacc.c +++ b/sys/share/lev_yacc.c @@ -1,15 +1,76 @@ -#ifndef lint -static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define yyclearin (yychar=(-1)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING (yyerrflag!=0) -#define YYPREFIX "yy" -/* NetHack 3.5 lev_comp.y $Date: 2009/05/11 22:53:51 $ $Revision: 1.10 $ */ -/* SCCS Id: @(#)lev_yacc.c 3.5 2007/08/01 */ + +/* A Bison parser, made by GNU Bison 2.4.1. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, 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 of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.4.1" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Copy the first part of user declarations. */ + +/* Line 189 of yacc.c */ +#line 1 "lev_comp.y" + +/* SCCS Id: @(#)lev_yacc.c 3.4 2000/01/17 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -34,7 +95,6 @@ static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #include "hack.h" #include "sp_lev.h" -#define MAX_REGISTERS 10 #define ERR (-1) /* many types of things are put in chars for transference to NetHack. * since some systems will use signed chars, limit everybody to the @@ -42,11 +102,16 @@ static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; */ #define MAX_OF_TYPE 128 +#define MAX_NESTED_IFS 20 +#define MAX_SWITCH_CASES 20 + #define New(type) \ (type *) memset((genericptr_t)alloc(sizeof(type)), 0, sizeof(type)) #define NewTab(type, size) (type **) alloc(sizeof(type *) * size) #define Free(ptr) free((genericptr_t)ptr) +extern void VDECL(lc_error, (const char *, ...)); +extern void VDECL(lc_warning, (const char *, ...)); extern void FDECL(yyerror, (const char *)); extern void FDECL(yywarning, (const char *)); extern int NDECL(yylex); @@ -60,2392 +125,6131 @@ extern int FDECL(get_object_id, (char *,CHAR_P)); extern boolean FDECL(check_monster_char, (CHAR_P)); extern boolean FDECL(check_object_char, (CHAR_P)); extern char FDECL(what_map_char, (CHAR_P)); -extern void FDECL(scan_map, (char *)); -extern void NDECL(wallify_map); -extern boolean NDECL(check_subrooms); -extern void FDECL(check_coord, (int,int,const char *)); -extern void NDECL(store_part); -extern void NDECL(store_room); -extern boolean FDECL(write_level_file, (char *,splev *,specialmaze *)); -extern void FDECL(free_rooms, (splev *)); +extern void FDECL(scan_map, (char *, sp_lev *)); +extern void FDECL(add_opcode, (sp_lev *, int, genericptr_t)); +extern genericptr_t FDECL(get_last_opcode_data1, (sp_lev *, int)); +extern genericptr_t FDECL(get_last_opcode_data2, (sp_lev *, int,int)); +extern boolean FDECL(check_subrooms, (sp_lev *)); +extern boolean FDECL(write_level_file, (char *,sp_lev *)); +extern struct opvar *FDECL(set_opvar_int, (struct opvar *, long)); +extern void VDECL(add_opvars, (sp_lev *, const char *, ...)); +extern void FDECL(start_level_def, (sp_lev * *, char *)); -static struct reg { - int x1, y1; - int x2, y2; -} current_region; +extern struct lc_funcdefs *FDECL(funcdef_new,(long,char *)); +extern void FDECL(funcdef_free_all,(struct lc_funcdefs *)); +extern struct lc_funcdefs *FDECL(funcdef_defined,(struct lc_funcdefs *,char *, int)); +extern char *FDECL(funcdef_paramtypes, (struct lc_funcdefs *)); +extern char *FDECL(decode_parm_str, (char *)); -static struct coord { - int x; - int y; -} current_coord, current_align; +extern struct lc_vardefs *FDECL(vardef_new,(long,char *)); +extern void FDECL(vardef_free_all,(struct lc_vardefs *)); +extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); -static struct size { - int height; - int width; -} current_size; +extern void NDECL(break_stmt_start); +extern void FDECL(break_stmt_end, (sp_lev *)); +extern void FDECL(break_stmt_new, (sp_lev *, long)); -char tmpmessage[256]; -digpos *tmppass[32]; -char *tmpmap[ROWNO]; +extern void FDECL(splev_add_from, (sp_lev *, sp_lev *)); -digpos *tmpdig[MAX_OF_TYPE]; -region *tmpreg[MAX_OF_TYPE]; -lev_region *tmplreg[MAX_OF_TYPE]; -door *tmpdoor[MAX_OF_TYPE]; -drawbridge *tmpdb[MAX_OF_TYPE]; -walk *tmpwalk[MAX_OF_TYPE]; +extern void FDECL(check_vardef_type, (struct lc_vardefs *, char *, long)); +extern void FDECL(vardef_used, (struct lc_vardefs *, char *)); +extern struct lc_vardefs *FDECL(add_vardef_type, (struct lc_vardefs *, char *, long)); -room_door *tmprdoor[MAX_OF_TYPE]; -trap *tmptrap[MAX_OF_TYPE]; -monster *tmpmonst[MAX_OF_TYPE]; -object *tmpobj[MAX_OF_TYPE]; -altar *tmpaltar[MAX_OF_TYPE]; -lad *tmplad[MAX_OF_TYPE]; -stair *tmpstair[MAX_OF_TYPE]; -gold *tmpgold[MAX_OF_TYPE]; -engraving *tmpengraving[MAX_OF_TYPE]; -fountain *tmpfountain[MAX_OF_TYPE]; -sink *tmpsink[MAX_OF_TYPE]; -pool *tmppool[MAX_OF_TYPE]; +extern int FDECL(reverse_jmp_opcode, (int)); -mazepart *tmppart[10]; -room *tmproom[MAXNROFROOMS*2]; -corridor *tmpcor[MAX_OF_TYPE]; +struct coord { + long x; + long y; +}; -static specialmaze maze; -static splev special_lev; -static lev_init init_lev; +struct forloopdef { + char *varname; + long jmp_point; +}; +static struct forloopdef forloop_list[MAX_NESTED_IFS]; +static short n_forloops = 0; -static char olist[MAX_REGISTERS], mlist[MAX_REGISTERS]; -static struct coord plist[MAX_REGISTERS]; -int n_olist = 0, n_mlist = 0, n_plist = 0; +sp_lev *splev = NULL; -unsigned int nlreg = 0, nreg = 0, ndoor = 0, ntrap = 0, nmons = 0, nobj = 0; -unsigned int ndb = 0, nwalk = 0, npart = 0, ndig = 0, nlad = 0, nstair = 0; -unsigned int naltar = 0, ncorridor = 0, nrooms = 0, ngold = 0, nengraving = 0; -unsigned int nfountain = 0, npool = 0, nsink = 0, npass = 0; +static struct opvar *if_list[MAX_NESTED_IFS]; -static int lev_flags = 0; +static short n_if_list = 0; unsigned int max_x_map, max_y_map; +int obj_containment = 0; -static xchar in_room; +int in_container_obj = 0; + +/* integer value is possibly an inconstant value (eg. dice notation or a variable) */ +int is_inconstant_number = 0; + +int in_switch_statement = 0; +static struct opvar *switch_check_jump = NULL; +static struct opvar *switch_default_case = NULL; +static struct opvar *switch_case_list[MAX_SWITCH_CASES]; +static long switch_case_value[MAX_SWITCH_CASES]; +int n_switch_case_list = 0; + +int allow_break_statements = 0; +struct lc_breakdef *break_list = NULL; + +extern struct lc_vardefs *variable_definitions; + + +struct lc_vardefs *function_tmp_var_defs = NULL; +extern struct lc_funcdefs *function_definitions; +struct lc_funcdefs *curr_function = NULL; +struct lc_funcdefs_parm * curr_function_param = NULL; +int in_function_definition = 0; +sp_lev *function_splev_backup = NULL; extern int fatal_error; -extern int want_warnings; +extern int got_errors; +extern int line_number; extern const char *fname; -typedef union +extern char curr_token[512]; + + + +/* Line 189 of yacc.c */ +#line 218 "y.tab.c" + +/* 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 + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + CHAR = 258, + INTEGER = 259, + BOOLEAN = 260, + PERCENT = 261, + SPERCENT = 262, + MINUS_INTEGER = 263, + PLUS_INTEGER = 264, + MAZE_GRID_ID = 265, + SOLID_FILL_ID = 266, + MINES_ID = 267, + ROGUELEV_ID = 268, + MESSAGE_ID = 269, + MAZE_ID = 270, + LEVEL_ID = 271, + LEV_INIT_ID = 272, + GEOMETRY_ID = 273, + NOMAP_ID = 274, + OBJECT_ID = 275, + COBJECT_ID = 276, + MONSTER_ID = 277, + TRAP_ID = 278, + DOOR_ID = 279, + DRAWBRIDGE_ID = 280, + object_ID = 281, + monster_ID = 282, + terrain_ID = 283, + MAZEWALK_ID = 284, + WALLIFY_ID = 285, + REGION_ID = 286, + FILLING = 287, + IRREGULAR = 288, + JOINED = 289, + ALTAR_ID = 290, + LADDER_ID = 291, + STAIR_ID = 292, + NON_DIGGABLE_ID = 293, + NON_PASSWALL_ID = 294, + ROOM_ID = 295, + PORTAL_ID = 296, + TELEPRT_ID = 297, + BRANCH_ID = 298, + LEV = 299, + MINERALIZE_ID = 300, + CORRIDOR_ID = 301, + GOLD_ID = 302, + ENGRAVING_ID = 303, + FOUNTAIN_ID = 304, + POOL_ID = 305, + SINK_ID = 306, + NONE = 307, + RAND_CORRIDOR_ID = 308, + DOOR_STATE = 309, + LIGHT_STATE = 310, + CURSE_TYPE = 311, + ENGRAVING_TYPE = 312, + DIRECTION = 313, + RANDOM_TYPE = 314, + RANDOM_TYPE_BRACKET = 315, + A_REGISTER = 316, + ALIGNMENT = 317, + LEFT_OR_RIGHT = 318, + CENTER = 319, + TOP_OR_BOT = 320, + ALTAR_TYPE = 321, + UP_OR_DOWN = 322, + SUBROOM_ID = 323, + NAME_ID = 324, + FLAGS_ID = 325, + FLAG_TYPE = 326, + MON_ATTITUDE = 327, + MON_ALERTNESS = 328, + MON_APPEARANCE = 329, + ROOMDOOR_ID = 330, + IF_ID = 331, + ELSE_ID = 332, + TERRAIN_ID = 333, + HORIZ_OR_VERT = 334, + REPLACE_TERRAIN_ID = 335, + EXIT_ID = 336, + SHUFFLE_ID = 337, + QUANTITY_ID = 338, + BURIED_ID = 339, + LOOP_ID = 340, + FOR_ID = 341, + TO_ID = 342, + SWITCH_ID = 343, + CASE_ID = 344, + BREAK_ID = 345, + DEFAULT_ID = 346, + ERODED_ID = 347, + TRAPPED_ID = 348, + RECHARGED_ID = 349, + INVIS_ID = 350, + GREASED_ID = 351, + FEMALE_ID = 352, + CANCELLED_ID = 353, + REVIVED_ID = 354, + AVENGE_ID = 355, + FLEEING_ID = 356, + BLINDED_ID = 357, + PARALYZED_ID = 358, + STUNNED_ID = 359, + CONFUSED_ID = 360, + SEENTRAPS_ID = 361, + ALL_ID = 362, + MONTYPE_ID = 363, + GRAVE_ID = 364, + ERODEPROOF_ID = 365, + FUNCTION_ID = 366, + MSG_OUTPUT_TYPE = 367, + COMPARE_TYPE = 368, + UNKNOWN_TYPE = 369, + rect_ID = 370, + fillrect_ID = 371, + line_ID = 372, + randline_ID = 373, + grow_ID = 374, + selection_ID = 375, + flood_ID = 376, + rndcoord_ID = 377, + circle_ID = 378, + ellipse_ID = 379, + filter_ID = 380, + complement_ID = 381, + gradient_ID = 382, + GRADIENT_TYPE = 383, + LIMITED = 384, + HUMIDITY_TYPE = 385, + STRING = 386, + MAP_ID = 387, + NQSTRING = 388, + VARSTRING = 389, + CFUNC = 390, + CFUNC_INT = 391, + CFUNC_STR = 392, + CFUNC_COORD = 393, + CFUNC_REGION = 394, + VARSTRING_INT = 395, + VARSTRING_INT_ARRAY = 396, + VARSTRING_STRING = 397, + VARSTRING_STRING_ARRAY = 398, + VARSTRING_VAR = 399, + VARSTRING_VAR_ARRAY = 400, + VARSTRING_COORD = 401, + VARSTRING_COORD_ARRAY = 402, + VARSTRING_REGION = 403, + VARSTRING_REGION_ARRAY = 404, + VARSTRING_MAPCHAR = 405, + VARSTRING_MAPCHAR_ARRAY = 406, + VARSTRING_MONST = 407, + VARSTRING_MONST_ARRAY = 408, + VARSTRING_OBJ = 409, + VARSTRING_OBJ_ARRAY = 410, + VARSTRING_SEL = 411, + VARSTRING_SEL_ARRAY = 412, + METHOD_INT = 413, + METHOD_INT_ARRAY = 414, + METHOD_STRING = 415, + METHOD_STRING_ARRAY = 416, + METHOD_VAR = 417, + METHOD_VAR_ARRAY = 418, + METHOD_COORD = 419, + METHOD_COORD_ARRAY = 420, + METHOD_REGION = 421, + METHOD_REGION_ARRAY = 422, + METHOD_MAPCHAR = 423, + METHOD_MAPCHAR_ARRAY = 424, + METHOD_MONST = 425, + METHOD_MONST_ARRAY = 426, + METHOD_OBJ = 427, + METHOD_OBJ_ARRAY = 428, + METHOD_SEL = 429, + METHOD_SEL_ARRAY = 430, + DICE = 431 + }; +#endif +/* Tokens. */ +#define CHAR 258 +#define INTEGER 259 +#define BOOLEAN 260 +#define PERCENT 261 +#define SPERCENT 262 +#define MINUS_INTEGER 263 +#define PLUS_INTEGER 264 +#define MAZE_GRID_ID 265 +#define SOLID_FILL_ID 266 +#define MINES_ID 267 +#define ROGUELEV_ID 268 +#define MESSAGE_ID 269 +#define MAZE_ID 270 +#define LEVEL_ID 271 +#define LEV_INIT_ID 272 +#define GEOMETRY_ID 273 +#define NOMAP_ID 274 +#define OBJECT_ID 275 +#define COBJECT_ID 276 +#define MONSTER_ID 277 +#define TRAP_ID 278 +#define DOOR_ID 279 +#define DRAWBRIDGE_ID 280 +#define object_ID 281 +#define monster_ID 282 +#define terrain_ID 283 +#define MAZEWALK_ID 284 +#define WALLIFY_ID 285 +#define REGION_ID 286 +#define FILLING 287 +#define IRREGULAR 288 +#define JOINED 289 +#define ALTAR_ID 290 +#define LADDER_ID 291 +#define STAIR_ID 292 +#define NON_DIGGABLE_ID 293 +#define NON_PASSWALL_ID 294 +#define ROOM_ID 295 +#define PORTAL_ID 296 +#define TELEPRT_ID 297 +#define BRANCH_ID 298 +#define LEV 299 +#define MINERALIZE_ID 300 +#define CORRIDOR_ID 301 +#define GOLD_ID 302 +#define ENGRAVING_ID 303 +#define FOUNTAIN_ID 304 +#define POOL_ID 305 +#define SINK_ID 306 +#define NONE 307 +#define RAND_CORRIDOR_ID 308 +#define DOOR_STATE 309 +#define LIGHT_STATE 310 +#define CURSE_TYPE 311 +#define ENGRAVING_TYPE 312 +#define DIRECTION 313 +#define RANDOM_TYPE 314 +#define RANDOM_TYPE_BRACKET 315 +#define A_REGISTER 316 +#define ALIGNMENT 317 +#define LEFT_OR_RIGHT 318 +#define CENTER 319 +#define TOP_OR_BOT 320 +#define ALTAR_TYPE 321 +#define UP_OR_DOWN 322 +#define SUBROOM_ID 323 +#define NAME_ID 324 +#define FLAGS_ID 325 +#define FLAG_TYPE 326 +#define MON_ATTITUDE 327 +#define MON_ALERTNESS 328 +#define MON_APPEARANCE 329 +#define ROOMDOOR_ID 330 +#define IF_ID 331 +#define ELSE_ID 332 +#define TERRAIN_ID 333 +#define HORIZ_OR_VERT 334 +#define REPLACE_TERRAIN_ID 335 +#define EXIT_ID 336 +#define SHUFFLE_ID 337 +#define QUANTITY_ID 338 +#define BURIED_ID 339 +#define LOOP_ID 340 +#define FOR_ID 341 +#define TO_ID 342 +#define SWITCH_ID 343 +#define CASE_ID 344 +#define BREAK_ID 345 +#define DEFAULT_ID 346 +#define ERODED_ID 347 +#define TRAPPED_ID 348 +#define RECHARGED_ID 349 +#define INVIS_ID 350 +#define GREASED_ID 351 +#define FEMALE_ID 352 +#define CANCELLED_ID 353 +#define REVIVED_ID 354 +#define AVENGE_ID 355 +#define FLEEING_ID 356 +#define BLINDED_ID 357 +#define PARALYZED_ID 358 +#define STUNNED_ID 359 +#define CONFUSED_ID 360 +#define SEENTRAPS_ID 361 +#define ALL_ID 362 +#define MONTYPE_ID 363 +#define GRAVE_ID 364 +#define ERODEPROOF_ID 365 +#define FUNCTION_ID 366 +#define MSG_OUTPUT_TYPE 367 +#define COMPARE_TYPE 368 +#define UNKNOWN_TYPE 369 +#define rect_ID 370 +#define fillrect_ID 371 +#define line_ID 372 +#define randline_ID 373 +#define grow_ID 374 +#define selection_ID 375 +#define flood_ID 376 +#define rndcoord_ID 377 +#define circle_ID 378 +#define ellipse_ID 379 +#define filter_ID 380 +#define complement_ID 381 +#define gradient_ID 382 +#define GRADIENT_TYPE 383 +#define LIMITED 384 +#define HUMIDITY_TYPE 385 +#define STRING 386 +#define MAP_ID 387 +#define NQSTRING 388 +#define VARSTRING 389 +#define CFUNC 390 +#define CFUNC_INT 391 +#define CFUNC_STR 392 +#define CFUNC_COORD 393 +#define CFUNC_REGION 394 +#define VARSTRING_INT 395 +#define VARSTRING_INT_ARRAY 396 +#define VARSTRING_STRING 397 +#define VARSTRING_STRING_ARRAY 398 +#define VARSTRING_VAR 399 +#define VARSTRING_VAR_ARRAY 400 +#define VARSTRING_COORD 401 +#define VARSTRING_COORD_ARRAY 402 +#define VARSTRING_REGION 403 +#define VARSTRING_REGION_ARRAY 404 +#define VARSTRING_MAPCHAR 405 +#define VARSTRING_MAPCHAR_ARRAY 406 +#define VARSTRING_MONST 407 +#define VARSTRING_MONST_ARRAY 408 +#define VARSTRING_OBJ 409 +#define VARSTRING_OBJ_ARRAY 410 +#define VARSTRING_SEL 411 +#define VARSTRING_SEL_ARRAY 412 +#define METHOD_INT 413 +#define METHOD_INT_ARRAY 414 +#define METHOD_STRING 415 +#define METHOD_STRING_ARRAY 416 +#define METHOD_VAR 417 +#define METHOD_VAR_ARRAY 418 +#define METHOD_COORD 419 +#define METHOD_COORD_ARRAY 420 +#define METHOD_REGION 421 +#define METHOD_REGION_ARRAY 422 +#define METHOD_MAPCHAR 423 +#define METHOD_MAPCHAR_ARRAY 424 +#define METHOD_MONST 425 +#define METHOD_MONST_ARRAY 426 +#define METHOD_OBJ 427 +#define METHOD_OBJ_ARRAY 428 +#define METHOD_SEL 429 +#define METHOD_SEL_ARRAY 430 +#define DICE 431 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE { - int i; + +/* Line 214 of yacc.c */ +#line 146 "lev_comp.y" + + long i; char* map; struct { - xchar room; - xchar wall; - xchar door; + long room; + long wall; + long door; } corpos; + struct { + long area; + long x1; + long y1; + long x2; + long y2; + } lregn; + struct { + long x; + long y; + } crd; + struct { + long ter; + long lit; + } terr; + struct { + long height; + long width; + } sze; + struct { + long die; + long num; + } dice; + struct { + long cfunc; + char *varstr; + } meth; + + + +/* Line 214 of yacc.c */ +#line 645 "y.tab.c" } YYSTYPE; -#define CHAR 257 -#define INTEGER 258 -#define BOOLEAN 259 -#define PERCENT 260 -#define MESSAGE_ID 261 -#define MAZE_ID 262 -#define LEVEL_ID 263 -#define LEV_INIT_ID 264 -#define GEOMETRY_ID 265 -#define NOMAP_ID 266 -#define OBJECT_ID 267 -#define COBJECT_ID 268 -#define MONSTER_ID 269 -#define TRAP_ID 270 -#define DOOR_ID 271 -#define DRAWBRIDGE_ID 272 -#define MAZEWALK_ID 273 -#define WALLIFY_ID 274 -#define REGION_ID 275 -#define FILLING 276 -#define RANDOM_OBJECTS_ID 277 -#define RANDOM_MONSTERS_ID 278 -#define RANDOM_PLACES_ID 279 -#define ALTAR_ID 280 -#define LADDER_ID 281 -#define STAIR_ID 282 -#define NON_DIGGABLE_ID 283 -#define NON_PASSWALL_ID 284 -#define ROOM_ID 285 -#define PORTAL_ID 286 -#define TELEPRT_ID 287 -#define BRANCH_ID 288 -#define LEV 289 -#define CHANCE_ID 290 -#define CORRIDOR_ID 291 -#define GOLD_ID 292 -#define ENGRAVING_ID 293 -#define FOUNTAIN_ID 294 -#define POOL_ID 295 -#define SINK_ID 296 -#define NONE 297 -#define RAND_CORRIDOR_ID 298 -#define DOOR_STATE 299 -#define LIGHT_STATE 300 -#define CURSE_TYPE 301 -#define ENGRAVING_TYPE 302 -#define DIRECTION 303 -#define RANDOM_TYPE 304 -#define O_REGISTER 305 -#define M_REGISTER 306 -#define P_REGISTER 307 -#define A_REGISTER 308 -#define ALIGNMENT 309 -#define LEFT_OR_RIGHT 310 -#define CENTER 311 -#define TOP_OR_BOT 312 -#define ALTAR_TYPE 313 -#define UP_OR_DOWN 314 -#define SUBROOM_ID 315 -#define NAME_ID 316 -#define FLAGS_ID 317 -#define FLAG_TYPE 318 -#define MON_ATTITUDE 319 -#define MON_ALERTNESS 320 -#define MON_APPEARANCE 321 -#define CONTAINED 322 -#define STRING 323 -#define MAP_ID 324 -#define YYERRCODE 256 -short yylhs[] = { -1, - 0, 0, 36, 36, 37, 37, 38, 39, 32, 23, - 23, 23, 14, 14, 19, 19, 20, 20, 40, 40, - 45, 42, 42, 46, 46, 43, 43, 49, 49, 44, - 44, 51, 52, 52, 53, 53, 35, 50, 50, 56, - 54, 10, 10, 59, 59, 57, 57, 60, 60, 58, - 58, 55, 55, 61, 61, 61, 61, 61, 61, 61, - 61, 61, 61, 61, 61, 61, 62, 63, 64, 15, - 15, 13, 13, 12, 12, 31, 11, 11, 41, 41, - 75, 76, 76, 79, 1, 1, 2, 2, 77, 77, - 80, 80, 80, 47, 47, 48, 48, 81, 83, 81, - 78, 78, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 99, 65, 98, 98, 100, 100, 100, 100, - 100, 66, 66, 102, 101, 103, 103, 104, 104, 104, - 104, 105, 105, 106, 107, 107, 108, 108, 108, 85, - 67, 86, 92, 93, 94, 74, 109, 88, 110, 89, - 111, 113, 90, 114, 91, 112, 112, 22, 22, 69, - 70, 71, 95, 96, 87, 68, 72, 73, 25, 25, - 25, 28, 28, 28, 33, 33, 34, 34, 3, 3, - 4, 4, 21, 21, 21, 97, 97, 97, 5, 5, - 6, 6, 7, 7, 7, 8, 8, 117, 29, 26, - 9, 82, 24, 27, 30, 16, 16, 17, 17, 18, - 18, 116, 115, -}; -short yylen[] = { 2, - 0, 1, 1, 2, 1, 1, 5, 7, 3, 0, - 13, 15, 1, 1, 0, 3, 3, 1, 0, 2, - 3, 0, 2, 3, 3, 0, 1, 1, 2, 1, - 1, 1, 0, 2, 5, 5, 7, 2, 2, 12, - 12, 0, 2, 5, 1, 5, 1, 5, 1, 5, - 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 3, 9, 1, - 1, 1, 1, 1, 1, 5, 1, 1, 1, 2, - 3, 1, 2, 5, 1, 1, 1, 1, 0, 2, - 3, 3, 3, 1, 3, 1, 3, 1, 0, 4, - 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 10, 0, 2, 2, 2, 2, 2, - 3, 2, 2, 0, 9, 1, 1, 0, 7, 5, - 5, 1, 1, 1, 1, 1, 0, 2, 2, 5, - 6, 7, 5, 1, 5, 5, 0, 8, 0, 8, - 0, 0, 8, 0, 6, 0, 2, 1, 10, 3, - 3, 3, 3, 3, 8, 7, 5, 7, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 2, 4, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, - 4, 1, 1, 1, 1, 1, 1, 0, 1, 1, - 1, 5, 9, -}; -short yydefred[] = { 0, - 0, 0, 0, 0, 0, 2, 0, 5, 6, 0, - 0, 0, 0, 0, 4, 215, 0, 9, 0, 0, - 0, 0, 0, 0, 16, 0, 0, 0, 0, 22, - 77, 78, 76, 0, 0, 0, 0, 82, 7, 0, - 89, 0, 20, 0, 17, 0, 21, 0, 80, 0, - 83, 0, 0, 0, 0, 0, 23, 27, 0, 52, - 52, 0, 85, 86, 0, 0, 0, 0, 0, 90, - 0, 0, 0, 0, 32, 8, 30, 0, 29, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 154, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 103, 104, 106, 113, - 114, 119, 120, 118, 102, 105, 107, 108, 109, 110, - 111, 112, 115, 116, 117, 121, 122, 214, 0, 24, - 213, 0, 25, 192, 0, 191, 0, 0, 34, 0, - 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 0, - 88, 87, 84, 91, 93, 0, 92, 0, 212, 219, - 0, 132, 133, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 199, 200, 0, - 198, 0, 0, 196, 197, 0, 0, 0, 0, 0, - 0, 0, 157, 0, 168, 173, 174, 159, 161, 164, - 216, 217, 0, 0, 170, 95, 97, 201, 202, 0, - 0, 0, 0, 70, 71, 0, 68, 172, 171, 67, - 0, 0, 0, 183, 0, 182, 0, 184, 180, 0, - 179, 0, 181, 190, 0, 189, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 100, 0, 0, 0, 0, 0, 150, 0, 0, 153, - 0, 0, 205, 0, 203, 0, 204, 155, 0, 0, - 0, 156, 0, 0, 0, 177, 220, 221, 0, 45, - 0, 0, 47, 0, 0, 0, 36, 35, 0, 0, - 222, 0, 188, 187, 134, 0, 186, 185, 0, 151, - 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 162, 165, 0, 0, 0, 0, 0, 0, 0, 0, - 209, 0, 210, 0, 152, 0, 0, 0, 207, 206, - 176, 0, 0, 0, 0, 178, 0, 49, 0, 0, - 0, 51, 0, 0, 0, 72, 73, 0, 13, 14, - 0, 0, 123, 0, 0, 175, 211, 0, 158, 160, - 0, 163, 0, 0, 0, 0, 0, 0, 74, 75, - 0, 0, 0, 137, 136, 0, 125, 0, 0, 0, - 167, 44, 0, 0, 46, 0, 0, 37, 69, 12, - 0, 135, 0, 0, 0, 0, 0, 0, 41, 0, - 40, 143, 142, 144, 0, 0, 0, 126, 223, 195, - 0, 48, 43, 50, 0, 0, 128, 129, 0, 130, - 127, 169, 146, 145, 0, 0, 0, 131, 0, 0, - 140, 141, 0, 148, 149, 139, -}; -short yydgoto[] = { 3, - 65, 163, 265, 135, 210, 240, 306, 371, 307, 439, - 33, 411, 388, 391, 246, 233, 171, 319, 13, 25, - 396, 223, 21, 132, 262, 263, 129, 257, 258, 136, - 4, 5, 339, 335, 243, 6, 7, 8, 9, 28, - 39, 44, 56, 76, 29, 57, 130, 133, 58, 59, - 77, 78, 139, 60, 80, 61, 325, 384, 322, 380, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 40, 41, 50, 69, 42, 70, - 167, 168, 204, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 224, 433, 417, 448, - 172, 362, 416, 432, 445, 446, 466, 471, 277, 279, - 280, 402, 375, 281, 225, 214, 215, -}; -short yysindex[] = { -149, - -5, 1, 0, -269, -269, 0, -149, 0, 0, -242, - -242, 12, -154, -154, 0, 0, 50, 0, -200, 41, - -137, -137, -232, 103, 0, -103, 99, -132, -137, 0, - 0, 0, 0, -200, 126, -141, 128, 0, 0, -132, - 0, -136, 0, -251, 0, -68, 0, -158, 0, -139, - 0, 129, 132, 134, 135, -100, 0, 0, -253, 0, - 0, 151, 0, 0, 155, 144, 146, 147, -109, 0, - -51, -50, -260, -260, 0, 0, 0, -83, 0, -165, - -165, -49, -162, -51, -50, 174, -44, -44, -44, -44, - 159, 160, 161, 0, 162, 163, 166, 167, 168, 170, - 171, 172, 173, 175, 176, 177, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 165, 0, - 0, 183, 0, 0, 188, 0, 192, 179, 0, 180, - 181, 182, 185, 186, 187, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 197, - 0, 0, 0, 0, 0, -12, 0, 0, 0, 0, - 189, 0, 0, 190, 191, -212, 46, 46, 210, 46, - 46, 58, 210, 210, -37, -37, -37, -230, 46, 46, - -51, -50, -193, -193, 211, -237, 46, -4, 46, 46, - -242, -6, 212, 213, -221, -233, -258, 0, 0, 214, - 0, 164, 215, 0, 0, 216, 3, 218, 219, 226, - 267, 96, 0, 312, 0, 0, 0, 0, 0, 0, - 0, 0, 313, 317, 0, 0, 0, 0, 0, 319, - 322, 110, 325, 0, 0, 326, 0, 0, 0, 0, - 329, 130, 174, 0, 296, 0, 365, 0, 0, 321, - 0, 369, 0, 0, 376, 0, 46, 178, 119, 120, - 383, -193, -208, 115, 193, 403, 404, 136, 409, 410, - 411, 46, -161, -1, 28, 412, -35, -212, -193, 416, - 0, 194, -257, 200, -228, 46, 0, 366, 417, 0, - 202, 418, 0, 388, 0, 423, 0, 0, 448, 235, - -37, 0, -37, -37, -37, 0, 0, 0, 454, 0, - 241, 456, 0, 244, 459, 228, 0, 0, 488, 493, - 0, 449, 0, 0, 0, 458, 0, 0, 494, 0, - 0, -212, 497, -260, 291, -259, 294, 49, 509, 510, - 0, 0, -242, 511, 40, 512, 42, 514, -148, -219, - 0, 517, 0, 46, 0, 304, 519, 471, 0, 0, - 0, 521, 252, -242, 524, 0, 311, 0, -158, 526, - 316, 0, 318, 527, -227, 0, 0, 531, 0, 0, - 533, 38, 0, 534, 303, 0, 0, 323, 0, 0, - 268, 0, 542, 540, 42, 544, 543, -242, 0, 0, - 545, -227, 330, 0, 0, 546, 0, 333, 548, 549, - 0, 0, -162, 550, 0, 337, 550, 0, 0, 0, - -263, 0, 552, 547, 339, 341, 559, 345, 0, 567, - 0, 0, 0, 0, 565, 570, -108, 0, 0, 0, - 574, 0, 0, 0, -235, -225, 0, 0, -242, 0, - 0, 0, 0, 0, 575, 576, 576, 0, -225, -262, - 0, 0, 576, 0, 0, 0, -}; -short yyrindex[] = { 616, - 0, 0, 0, -129, 349, 0, 621, 0, 0, 0, - 0, 0, -210, 406, 0, 0, 0, 0, 0, 0, - -98, 408, 0, 282, 0, 0, 0, 0, 367, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, - 0, 0, 0, 57, 0, 0, 0, 0, 0, 539, - 0, 0, 0, 0, 0, 4, 0, 0, 123, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 169, 0, - 0, 0, 0, 0, 0, 0, 0, 89, 0, 426, - 445, 0, 0, 0, 0, 0, 564, 564, 564, 564, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 203, 0, - 0, 242, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 506, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 572, 0, 0, 0, - 0, 0, 0, 0, 607, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 6, 0, 0, 641, 0, - 0, 0, 0, 148, 0, 0, 148, 0, 0, 0, - 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 109, 109, 0, 0, 0, - 0, 0, 109, 0, 0, 0, -}; -short yygindex[] = { 0, - 245, 205, 0, -60, -267, -181, 195, 0, 0, 196, - 0, 223, 0, 0, 0, 0, 91, 0, 631, 603, - 0, -169, 625, 437, 0, 0, 441, 0, 0, -10, - 0, 0, 0, 0, 361, 642, 0, 0, 0, 20, - 610, 0, 0, 0, 0, 0, -72, -70, 592, 0, - 0, 0, 0, 0, 593, 0, 0, 248, 0, 0, - 0, 0, 0, 0, 587, 588, 590, 591, 594, 0, - 0, 597, 604, 605, 0, 0, 0, 0, 0, 0, - 419, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -170, 0, 0, 0, - 573, 0, 0, 0, 0, 207, -419, -415, 0, 0, - 0, 0, 0, 0, -63, -77, 0, -}; -#define YYTABLESIZE 935 -short yytable[] = { 17, - 18, 79, 217, 33, 242, 138, 213, 216, 169, 219, - 220, 164, 241, 137, 165, 228, 229, 230, 234, 235, - 329, 244, 463, 131, 31, 52, 53, 231, 248, 249, - 409, 54, 463, 54, 474, 128, 467, 442, 321, 389, - 443, 30, 124, 134, 369, 264, 333, 12, 43, 473, - 10, 472, 10, 370, 10, 10, 26, 476, 11, 444, - 475, 55, 16, 55, 16, 16, 245, 324, 464, 19, - 259, 32, 260, 232, 365, 337, 410, 166, 464, 379, - 16, 383, 254, 255, 390, 166, 208, 444, 31, 331, - 302, 209, 366, 23, 16, 303, 297, 222, 26, 304, - 305, 87, 88, 89, 90, 140, 238, 330, 147, 20, - 239, 316, 1, 2, 96, 218, 141, 24, 236, 226, - 227, 237, 28, 27, 142, 340, 104, 105, 106, 143, - 144, 15, 37, 38, 15, 15, 15, 66, 67, 68, - 317, 349, 318, 350, 351, 352, 34, 42, 161, 162, - 145, 63, 64, 35, 386, 387, 36, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 19, 19, 81, 46, - 96, 97, 98, 99, 100, 169, 101, 102, 103, 174, - 175, 47, 104, 105, 106, 48, 71, 51, 62, 72, - 250, 73, 74, 393, 82, 303, 266, 75, 83, 304, - 305, 84, 94, 85, 86, 128, 131, 138, 191, 160, - 457, 458, 459, 166, 16, 170, 176, 177, 178, 179, - 180, 415, 327, 181, 182, 183, 192, 184, 185, 186, - 187, 193, 188, 189, 190, 194, 195, 196, 197, 198, - 202, 96, 199, 200, 201, 203, 205, 206, 207, 217, - 242, 221, 251, 247, 268, 252, 253, 267, 269, 270, - 271, 272, 273, 79, 79, 33, 33, 138, 138, 274, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 18, 334, 367, 338, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 33, 138, 138, 138, 138, 138, - 138, 138, 320, 138, 124, 124, 275, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 26, 26, - 138, 138, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 323, 124, 124, 124, 124, 124, 124, 124, 11, - 124, 211, 376, 378, 212, 382, 221, 26, 15, 211, - 31, 31, 212, 276, 26, 278, 282, 124, 124, 414, - 283, 211, 284, 400, 212, 285, 19, 286, 287, 288, - 147, 147, 289, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 28, 28, 292, 290, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 427, 147, 147, - 147, 147, 147, 147, 147, 10, 147, 19, 293, 42, - 42, 294, 295, 28, 42, 42, 42, 42, 42, 296, - 28, 299, 300, 147, 147, 38, 301, 42, 308, 42, - 81, 81, 42, 81, 81, 298, 461, 42, 42, 42, - 42, 42, 42, 42, 39, 42, 310, 311, 468, 312, - 309, 332, 313, 314, 315, 326, 331, 336, 341, 343, - 342, 344, 42, 42, 94, 94, 346, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 345, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 347, 348, 94, 94, 94, 94, 353, 354, 355, - 94, 356, 357, 96, 96, 98, 96, 96, 96, 96, - 96, 96, 96, 96, 96, 96, 96, 94, 96, 96, - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, - 358, 359, 96, 96, 96, 96, 360, 364, 101, 96, - 366, 361, 18, 18, 18, 18, 18, 18, 368, 99, - 363, 372, 373, 374, 377, 381, 96, 385, 18, 18, - 392, 394, 395, 397, 398, 399, 18, 401, 403, 405, - 408, 193, 18, 406, 412, 407, 413, 418, 419, 18, - 420, 421, 422, 423, 425, 428, 426, 449, 430, 431, - 434, 435, 436, 438, 440, 447, 18, 450, 451, 452, - 11, 11, 11, 453, 11, 11, 166, 454, 455, 15, - 15, 15, 15, 456, 462, 1, 11, 11, 469, 470, - 3, 218, 441, 404, 11, 15, 15, 437, 19, 19, - 11, 19, 19, 15, 429, 14, 45, 11, 22, 15, - 194, 460, 261, 19, 19, 256, 15, 328, 15, 49, - 79, 19, 424, 81, 11, 107, 108, 19, 109, 110, - 173, 465, 111, 15, 19, 112, 10, 10, 10, 19, - 19, 291, 113, 114, 0, 0, 0, 0, 0, 0, - 0, 19, 10, 10, 19, 19, 0, 38, 38, 0, - 10, 0, 19, 0, 0, 0, 10, 0, 19, 0, - 0, 0, 0, 10, 0, 19, 39, 39, 0, 0, - 38, 0, 0, 0, 0, 0, 38, 0, 0, 0, - 10, 0, 19, 38, 0, 0, 0, 0, 0, 39, - 0, 0, 0, 0, 0, 39, 0, 0, 0, 0, - 38, 0, 39, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, - 0, 0, 0, 0, 0, 0, 0, 98, 98, 0, - 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, - 98, 0, 98, 98, 98, 98, 98, 98, 98, 98, - 0, 98, 98, 98, 0, 0, 0, 98, 98, 98, - 101, 101, 0, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 0, 0, 0, 0, 101, 101, - 101, 101, 101, 0, 101, 101, 101, 0, 0, 0, - 101, 101, 101, 193, 193, 0, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 0, 0, 0, - 0, 193, 193, 193, 193, 193, 0, 193, 193, 193, - 0, 0, 0, 193, 193, 193, 0, 0, 166, 166, - 0, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 0, 0, 0, 0, 166, 166, 166, 166, - 166, 0, 166, 166, 166, 0, 0, 0, 166, 166, - 166, 0, 194, 194, 0, 194, 194, 194, 194, 194, - 194, 194, 194, 194, 194, 194, 0, 0, 0, 0, - 194, 194, 194, 194, 194, 0, 194, 194, 194, 0, - 0, 0, 194, 194, 194, -}; -short yycheck[] = { 10, - 11, 0, 40, 0, 40, 0, 177, 178, 86, 180, - 181, 84, 194, 74, 85, 185, 186, 187, 189, 190, - 288, 259, 258, 257, 257, 277, 278, 258, 199, 200, - 258, 285, 258, 285, 297, 257, 456, 301, 40, 259, - 304, 22, 0, 304, 304, 304, 304, 317, 29, 469, - 261, 467, 58, 313, 265, 266, 0, 473, 58, 323, - 323, 315, 323, 315, 323, 323, 304, 40, 304, 58, - 304, 304, 306, 304, 342, 304, 304, 40, 304, 40, - 323, 40, 304, 305, 304, 40, 299, 323, 0, 41, - 272, 304, 44, 44, 323, 304, 267, 40, 58, 308, - 309, 267, 268, 269, 270, 271, 300, 289, 0, 264, - 304, 282, 262, 263, 280, 179, 282, 318, 191, 183, - 184, 192, 0, 261, 290, 296, 292, 293, 294, 295, - 296, 261, 265, 266, 264, 265, 266, 277, 278, 279, - 302, 311, 304, 313, 314, 315, 44, 0, 311, 312, - 316, 310, 311, 257, 303, 304, 58, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 265, 266, 0, 44, - 280, 281, 282, 283, 284, 253, 286, 287, 288, 89, - 90, 323, 292, 293, 294, 58, 58, 324, 257, 58, - 201, 58, 58, 364, 44, 304, 207, 298, 44, 308, - 309, 58, 0, 58, 58, 257, 257, 291, 44, 259, - 319, 320, 321, 40, 323, 260, 58, 58, 58, 58, - 58, 392, 258, 58, 58, 58, 44, 58, 58, 58, - 58, 44, 58, 58, 58, 44, 58, 58, 58, 58, - 44, 0, 58, 58, 58, 258, 58, 58, 58, 40, - 40, 289, 259, 258, 91, 44, 44, 44, 44, 44, - 258, 44, 44, 262, 263, 262, 263, 262, 263, 44, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 0, 293, 344, 295, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 291, 290, 291, 292, 293, 294, - 295, 296, 304, 298, 262, 263, 40, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 262, 263, - 315, 316, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 304, 290, 291, 292, 293, 294, 295, 296, 0, - 298, 304, 353, 304, 307, 304, 289, 291, 0, 304, - 262, 263, 307, 258, 298, 44, 44, 315, 316, 322, - 44, 304, 44, 374, 307, 44, 0, 258, 44, 44, - 262, 263, 44, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 262, 263, 91, 258, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 408, 290, 291, - 292, 293, 294, 295, 296, 0, 298, 0, 44, 262, - 263, 91, 44, 291, 267, 268, 269, 270, 271, 44, - 298, 303, 303, 315, 316, 0, 44, 280, 314, 282, - 262, 263, 285, 265, 266, 258, 447, 290, 291, 292, - 293, 294, 295, 296, 0, 298, 44, 44, 459, 314, - 258, 258, 44, 44, 44, 44, 41, 258, 93, 258, - 44, 44, 315, 316, 262, 263, 44, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 91, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 44, 258, 291, 292, 293, 294, 44, 258, 44, - 298, 258, 44, 262, 263, 0, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 315, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 303, 44, 291, 292, 293, 294, 44, 44, 0, 298, - 44, 93, 261, 262, 263, 264, 265, 266, 258, 44, - 93, 258, 44, 44, 44, 44, 315, 44, 277, 278, - 44, 258, 44, 93, 44, 314, 285, 44, 258, 44, - 44, 0, 291, 258, 44, 258, 44, 44, 276, 298, - 258, 314, 41, 44, 41, 41, 44, 41, 259, 44, - 258, 44, 44, 44, 258, 44, 315, 259, 258, 41, - 261, 262, 263, 259, 265, 266, 0, 41, 44, 261, - 262, 263, 264, 44, 41, 0, 277, 278, 44, 44, - 0, 58, 427, 379, 285, 277, 278, 423, 262, 263, - 291, 265, 266, 285, 412, 5, 34, 298, 14, 291, - 0, 447, 206, 277, 278, 205, 298, 287, 7, 40, - 59, 285, 405, 61, 315, 69, 69, 291, 69, 69, - 88, 455, 69, 315, 298, 69, 261, 262, 263, 262, - 263, 253, 69, 69, -1, -1, -1, -1, -1, -1, - -1, 315, 277, 278, 277, 278, -1, 262, 263, -1, - 285, -1, 285, -1, -1, -1, 291, -1, 291, -1, - -1, -1, -1, 298, -1, 298, 262, 263, -1, -1, - 285, -1, -1, -1, -1, -1, 291, -1, -1, -1, - 315, -1, 315, 298, -1, -1, -1, -1, -1, 285, - -1, -1, -1, -1, -1, 291, -1, -1, -1, -1, - 315, -1, 298, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 315, - -1, -1, -1, -1, -1, -1, -1, 262, 263, -1, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, -1, 277, 278, 279, 280, 281, 282, 283, 284, - -1, 286, 287, 288, -1, -1, -1, 292, 293, 294, - 262, 263, -1, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, -1, -1, -1, -1, 280, 281, - 282, 283, 284, -1, 286, 287, 288, -1, -1, -1, - 292, 293, 294, 262, 263, -1, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, -1, -1, -1, - -1, 280, 281, 282, 283, 284, -1, 286, 287, 288, - -1, -1, -1, 292, 293, 294, -1, -1, 262, 263, - -1, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, -1, -1, -1, -1, 280, 281, 282, 283, - 284, -1, 286, 287, 288, -1, -1, -1, 292, 293, - 294, -1, 262, 263, -1, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, -1, -1, -1, -1, - 280, 281, 282, 283, 284, -1, 286, 287, 288, -1, - -1, -1, 292, 293, 294, -}; -#define YYFINAL 3 -#ifndef YYDEBUG -#define YYDEBUG 0 +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 #endif -#define YYMAXTOKEN 324 + + +/* Copy the second part of user declarations. */ + + +/* Line 264 of yacc.c */ +#line 657 "y.tab.c" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef 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 /* 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 /* 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 int +YYID (int yyi) +#else +static int +YYID (yyi) + int yyi; +#endif +{ + return yyi; +} +#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 /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* 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 /* 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 safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to 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 /* 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_alloc; + YYSTYPE yyvs_alloc; +}; + +/* 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 with + N 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 do + not 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. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 9 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 1031 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 194 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 160 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 406 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 866 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 431 + +#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, 189, 193, 2, + 133, 134, 187, 185, 131, 186, 191, 188, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 132, 2, + 2, 190, 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, 135, 2, 136, 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, 137, 192, 138, 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, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184 +}; + #if YYDEBUG -char *yyname[] = { -"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"'('","')'",0,0,"','",0,0,0,0,0,0,0,0,0,0,0,0,0,"':'",0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'['",0,"']'",0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"CHAR", -"INTEGER","BOOLEAN","PERCENT","MESSAGE_ID","MAZE_ID","LEVEL_ID","LEV_INIT_ID", -"GEOMETRY_ID","NOMAP_ID","OBJECT_ID","COBJECT_ID","MONSTER_ID","TRAP_ID", -"DOOR_ID","DRAWBRIDGE_ID","MAZEWALK_ID","WALLIFY_ID","REGION_ID","FILLING", -"RANDOM_OBJECTS_ID","RANDOM_MONSTERS_ID","RANDOM_PLACES_ID","ALTAR_ID", -"LADDER_ID","STAIR_ID","NON_DIGGABLE_ID","NON_PASSWALL_ID","ROOM_ID", -"PORTAL_ID","TELEPRT_ID","BRANCH_ID","LEV","CHANCE_ID","CORRIDOR_ID","GOLD_ID", -"ENGRAVING_ID","FOUNTAIN_ID","POOL_ID","SINK_ID","NONE","RAND_CORRIDOR_ID", -"DOOR_STATE","LIGHT_STATE","CURSE_TYPE","ENGRAVING_TYPE","DIRECTION", -"RANDOM_TYPE","O_REGISTER","M_REGISTER","P_REGISTER","A_REGISTER","ALIGNMENT", -"LEFT_OR_RIGHT","CENTER","TOP_OR_BOT","ALTAR_TYPE","UP_OR_DOWN","SUBROOM_ID", -"NAME_ID","FLAGS_ID","FLAG_TYPE","MON_ATTITUDE","MON_ALERTNESS", -"MON_APPEARANCE","CONTAINED","STRING","MAP_ID", +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 4, 6, 8, 11, 15, 19, 25, + 27, 29, 35, 41, 45, 62, 63, 66, 67, 70, + 71, 74, 76, 78, 79, 83, 87, 89, 90, 93, + 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, + 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, + 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, + 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, + 177, 179, 181, 183, 185, 187, 189, 191, 193, 195, + 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, + 217, 219, 221, 223, 225, 227, 229, 231, 235, 239, + 245, 249, 255, 261, 267, 271, 275, 281, 287, 293, + 301, 309, 317, 323, 325, 329, 331, 335, 337, 341, + 343, 347, 349, 353, 355, 359, 361, 365, 366, 367, + 376, 381, 383, 384, 386, 388, 394, 398, 399, 400, + 410, 411, 414, 415, 421, 422, 427, 429, 432, 434, + 441, 442, 446, 447, 454, 455, 460, 461, 466, 468, + 469, 474, 478, 480, 484, 488, 494, 500, 508, 513, + 514, 525, 526, 539, 540, 543, 549, 551, 557, 559, + 565, 567, 573, 575, 585, 591, 593, 595, 597, 599, + 601, 605, 607, 609, 611, 619, 625, 627, 629, 631, + 633, 637, 638, 644, 649, 650, 654, 656, 658, 660, + 662, 665, 667, 669, 671, 673, 675, 679, 683, 687, + 689, 691, 695, 697, 699, 703, 707, 708, 714, 717, + 718, 722, 724, 728, 730, 734, 738, 740, 742, 746, + 748, 750, 752, 756, 758, 760, 762, 768, 776, 782, + 791, 793, 797, 803, 809, 817, 825, 832, 838, 839, + 842, 846, 850, 854, 856, 862, 872, 878, 882, 886, + 887, 898, 899, 901, 909, 915, 921, 925, 931, 939, + 949, 951, 953, 955, 957, 959, 960, 963, 965, 969, + 971, 973, 975, 977, 979, 981, 983, 985, 987, 989, + 991, 993, 997, 999, 1001, 1006, 1008, 1010, 1015, 1017, + 1019, 1024, 1026, 1031, 1037, 1039, 1043, 1045, 1049, 1051, + 1053, 1058, 1068, 1070, 1072, 1077, 1079, 1085, 1087, 1089, + 1094, 1096, 1098, 1104, 1106, 1108, 1110, 1115, 1117, 1119, + 1125, 1127, 1129, 1133, 1135, 1137, 1141, 1143, 1148, 1152, + 1156, 1160, 1164, 1168, 1172, 1174, 1176, 1180, 1182, 1186, + 1187, 1189, 1191, 1193, 1195, 1199, 1200, 1202, 1204, 1207, + 1210, 1215, 1222, 1227, 1234, 1241, 1248, 1255, 1258, 1265, + 1274, 1283, 1294, 1309, 1312, 1314, 1318, 1320, 1324, 1326, + 1328, 1330, 1332, 1334, 1336, 1338, 1340, 1342, 1344, 1346, + 1348, 1350, 1352, 1354, 1356, 1358, 1369 }; -char *yyrule[] = { -"$accept : file", -"file :", -"file : levels", -"levels : level", -"levels : level levels", -"level : maze_level", -"level : room_level", -"maze_level : maze_def flags lev_init messages regions", -"room_level : level_def flags lev_init messages rreg_init rooms corridors_def", -"level_def : LEVEL_ID ':' string", -"lev_init :", -"lev_init : LEV_INIT_ID ':' CHAR ',' CHAR ',' BOOLEAN ',' BOOLEAN ',' light_state ',' walled", -"lev_init : LEV_INIT_ID ':' CHAR ',' CHAR ',' BOOLEAN ',' BOOLEAN ',' light_state ',' walled ',' BOOLEAN", -"walled : BOOLEAN", -"walled : RANDOM_TYPE", -"flags :", -"flags : FLAGS_ID ':' flag_list", -"flag_list : FLAG_TYPE ',' flag_list", -"flag_list : FLAG_TYPE", -"messages :", -"messages : message messages", -"message : MESSAGE_ID ':' STRING", -"rreg_init :", -"rreg_init : rreg_init init_rreg", -"init_rreg : RANDOM_OBJECTS_ID ':' object_list", -"init_rreg : RANDOM_MONSTERS_ID ':' monster_list", -"rooms :", -"rooms : roomlist", -"roomlist : aroom", -"roomlist : aroom roomlist", -"corridors_def : random_corridors", -"corridors_def : corridors", -"random_corridors : RAND_CORRIDOR_ID", -"corridors :", -"corridors : corridors corridor", -"corridor : CORRIDOR_ID ':' corr_spec ',' corr_spec", -"corridor : CORRIDOR_ID ':' corr_spec ',' INTEGER", -"corr_spec : '(' INTEGER ',' DIRECTION ',' door_pos ')'", -"aroom : room_def room_details", -"aroom : subroom_def room_details", -"subroom_def : SUBROOM_ID ':' room_type ',' light_state ',' subroom_pos ',' room_size ',' string roomfill", -"room_def : ROOM_ID ':' room_type ',' light_state ',' room_pos ',' room_align ',' room_size roomfill", -"roomfill :", -"roomfill : ',' BOOLEAN", -"room_pos : '(' INTEGER ',' INTEGER ')'", -"room_pos : RANDOM_TYPE", -"subroom_pos : '(' INTEGER ',' INTEGER ')'", -"subroom_pos : RANDOM_TYPE", -"room_align : '(' h_justif ',' v_justif ')'", -"room_align : RANDOM_TYPE", -"room_size : '(' INTEGER ',' INTEGER ')'", -"room_size : RANDOM_TYPE", -"room_details :", -"room_details : room_details room_detail", -"room_detail : room_name", -"room_detail : room_chance", -"room_detail : room_door", -"room_detail : monster_detail", -"room_detail : object_detail", -"room_detail : trap_detail", -"room_detail : altar_detail", -"room_detail : fountain_detail", -"room_detail : sink_detail", -"room_detail : pool_detail", -"room_detail : gold_detail", -"room_detail : engraving_detail", -"room_detail : stair_detail", -"room_name : NAME_ID ':' string", -"room_chance : CHANCE_ID ':' INTEGER", -"room_door : DOOR_ID ':' secret ',' door_state ',' door_wall ',' door_pos", -"secret : BOOLEAN", -"secret : RANDOM_TYPE", -"door_wall : DIRECTION", -"door_wall : RANDOM_TYPE", -"door_pos : INTEGER", -"door_pos : RANDOM_TYPE", -"maze_def : MAZE_ID ':' string ',' filling", -"filling : CHAR", -"filling : RANDOM_TYPE", -"regions : aregion", -"regions : aregion regions", -"aregion : map_definition reg_init map_details", -"map_definition : NOMAP_ID", -"map_definition : map_geometry MAP_ID", -"map_geometry : GEOMETRY_ID ':' h_justif ',' v_justif", -"h_justif : LEFT_OR_RIGHT", -"h_justif : CENTER", -"v_justif : TOP_OR_BOT", -"v_justif : CENTER", -"reg_init :", -"reg_init : reg_init init_reg", -"init_reg : RANDOM_OBJECTS_ID ':' object_list", -"init_reg : RANDOM_PLACES_ID ':' place_list", -"init_reg : RANDOM_MONSTERS_ID ':' monster_list", -"object_list : object", -"object_list : object ',' object_list", -"monster_list : monster", -"monster_list : monster ',' monster_list", -"place_list : place", -"$$1 :", -"place_list : place $$1 ',' place_list", -"map_details :", -"map_details : map_details map_detail", -"map_detail : monster_detail", -"map_detail : object_detail", -"map_detail : door_detail", -"map_detail : trap_detail", -"map_detail : drawbridge_detail", -"map_detail : region_detail", -"map_detail : stair_region", -"map_detail : portal_region", -"map_detail : teleprt_region", -"map_detail : branch_region", -"map_detail : altar_detail", -"map_detail : fountain_detail", -"map_detail : mazewalk_detail", -"map_detail : wallify_detail", -"map_detail : ladder_detail", -"map_detail : stair_detail", -"map_detail : gold_detail", -"map_detail : engraving_detail", -"map_detail : diggable_detail", -"map_detail : passwall_detail", -"$$2 :", -"monster_detail : MONSTER_ID chance ':' monster_c ',' m_name ',' coordinate $$2 monster_infos", -"monster_infos :", -"monster_infos : monster_infos monster_info", -"monster_info : ',' string", -"monster_info : ',' MON_ATTITUDE", -"monster_info : ',' MON_ALERTNESS", -"monster_info : ',' alignment", -"monster_info : ',' MON_APPEARANCE string", -"object_detail : OBJECT_ID object_desc", -"object_detail : COBJECT_ID object_desc", -"$$3 :", -"object_desc : chance ':' object_c ',' o_name $$3 ',' object_where object_infos", -"object_where : coordinate", -"object_where : CONTAINED", -"object_infos :", -"object_infos : ',' curse_state ',' monster_id ',' enchantment optional_name", -"object_infos : ',' curse_state ',' enchantment optional_name", -"object_infos : ',' monster_id ',' enchantment optional_name", -"curse_state : RANDOM_TYPE", -"curse_state : CURSE_TYPE", -"monster_id : STRING", -"enchantment : RANDOM_TYPE", -"enchantment : INTEGER", -"optional_name :", -"optional_name : ',' NONE", -"optional_name : ',' STRING", -"door_detail : DOOR_ID ':' door_state ',' coordinate", -"trap_detail : TRAP_ID chance ':' trap_name ',' coordinate", -"drawbridge_detail : DRAWBRIDGE_ID ':' coordinate ',' DIRECTION ',' door_state", -"mazewalk_detail : MAZEWALK_ID ':' coordinate ',' DIRECTION", -"wallify_detail : WALLIFY_ID", -"ladder_detail : LADDER_ID ':' coordinate ',' UP_OR_DOWN", -"stair_detail : STAIR_ID ':' coordinate ',' UP_OR_DOWN", -"$$4 :", -"stair_region : STAIR_ID ':' lev_region $$4 ',' lev_region ',' UP_OR_DOWN", -"$$5 :", -"portal_region : PORTAL_ID ':' lev_region $$5 ',' lev_region ',' string", -"$$6 :", -"$$7 :", -"teleprt_region : TELEPRT_ID ':' lev_region $$6 ',' lev_region $$7 teleprt_detail", -"$$8 :", -"branch_region : BRANCH_ID ':' lev_region $$8 ',' lev_region", -"teleprt_detail :", -"teleprt_detail : ',' UP_OR_DOWN", -"lev_region : region", -"lev_region : LEV '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'", -"fountain_detail : FOUNTAIN_ID ':' coordinate", -"sink_detail : SINK_ID ':' coordinate", -"pool_detail : POOL_ID ':' coordinate", -"diggable_detail : NON_DIGGABLE_ID ':' region", -"passwall_detail : NON_PASSWALL_ID ':' region", -"region_detail : REGION_ID ':' region ',' light_state ',' room_type prefilled", -"altar_detail : ALTAR_ID ':' coordinate ',' alignment ',' altar_type", -"gold_detail : GOLD_ID ':' amount ',' coordinate", -"engraving_detail : ENGRAVING_ID ':' coordinate ',' engraving_type ',' string", -"monster_c : monster", -"monster_c : RANDOM_TYPE", -"monster_c : m_register", -"object_c : object", -"object_c : RANDOM_TYPE", -"object_c : o_register", -"m_name : string", -"m_name : RANDOM_TYPE", -"o_name : string", -"o_name : RANDOM_TYPE", -"trap_name : string", -"trap_name : RANDOM_TYPE", -"room_type : string", -"room_type : RANDOM_TYPE", -"prefilled :", -"prefilled : ',' FILLING", -"prefilled : ',' FILLING ',' BOOLEAN", -"coordinate : coord", -"coordinate : p_register", -"coordinate : RANDOM_TYPE", -"door_state : DOOR_STATE", -"door_state : RANDOM_TYPE", -"light_state : LIGHT_STATE", -"light_state : RANDOM_TYPE", -"alignment : ALIGNMENT", -"alignment : a_register", -"alignment : RANDOM_TYPE", -"altar_type : ALTAR_TYPE", -"altar_type : RANDOM_TYPE", -"p_register : P_REGISTER '[' INTEGER ']'", -"o_register : O_REGISTER '[' INTEGER ']'", -"m_register : M_REGISTER '[' INTEGER ']'", -"a_register : A_REGISTER '[' INTEGER ']'", -"place : coord", -"monster : CHAR", -"object : CHAR", -"string : STRING", -"amount : INTEGER", -"amount : RANDOM_TYPE", -"chance :", -"chance : PERCENT", -"engraving_type : ENGRAVING_TYPE", -"engraving_type : RANDOM_TYPE", -"coord : '(' INTEGER ',' INTEGER ')'", -"region : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'", + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = +{ + 195, 0, -1, -1, 196, -1, 197, -1, 197, 196, + -1, 198, 205, 207, -1, 16, 132, 139, -1, 15, + 132, 139, 131, 199, -1, 59, -1, 3, -1, 17, + 132, 11, 131, 297, -1, 17, 132, 10, 131, 3, + -1, 17, 132, 13, -1, 17, 132, 12, 131, 3, + 131, 3, 131, 5, 131, 5, 131, 316, 131, 204, + 203, -1, -1, 131, 129, -1, -1, 131, 323, -1, + -1, 131, 3, -1, 5, -1, 59, -1, -1, 70, + 132, 206, -1, 71, 131, 206, -1, 71, -1, -1, + 209, 207, -1, 137, 207, 138, -1, 250, -1, 200, + -1, 305, -1, 306, -1, 292, -1, 252, -1, 215, + -1, 214, -1, 300, -1, 264, -1, 284, -1, 308, + -1, 309, -1, 294, -1, 307, -1, 230, -1, 240, + -1, 242, -1, 246, -1, 244, -1, 227, -1, 237, + -1, 223, -1, 226, -1, 287, -1, 269, -1, 285, + -1, 272, -1, 278, -1, 301, -1, 296, -1, 290, + -1, 251, -1, 302, -1, 257, -1, 255, -1, 295, + -1, 299, -1, 298, -1, 288, -1, 289, -1, 291, + -1, 283, -1, 286, -1, 149, -1, 151, -1, 153, + -1, 155, -1, 157, -1, 159, -1, 161, -1, 163, + -1, 165, -1, 148, -1, 150, -1, 152, -1, 154, + -1, 156, -1, 158, -1, 160, -1, 162, -1, 164, + -1, 210, -1, 211, -1, 142, -1, 142, -1, 211, + -1, 82, 132, 210, -1, 212, 190, 335, -1, 212, + 190, 120, 132, 344, -1, 212, 190, 334, -1, 212, + 190, 350, 132, 328, -1, 212, 190, 349, 132, 330, + -1, 212, 190, 348, 132, 332, -1, 212, 190, 323, + -1, 212, 190, 326, -1, 212, 190, 137, 221, 138, + -1, 212, 190, 137, 220, 138, -1, 212, 190, 137, + 219, 138, -1, 212, 190, 350, 132, 137, 218, 138, + -1, 212, 190, 349, 132, 137, 217, 138, -1, 212, + 190, 348, 132, 137, 216, 138, -1, 212, 190, 137, + 222, 138, -1, 333, -1, 216, 131, 333, -1, 331, + -1, 217, 131, 331, -1, 329, -1, 218, 131, 329, + -1, 327, -1, 219, 131, 327, -1, 324, -1, 220, + 131, 324, -1, 335, -1, 221, 131, 335, -1, 334, + -1, 222, 131, 334, -1, -1, -1, 111, 141, 133, + 224, 339, 134, 225, 208, -1, 141, 133, 342, 134, + -1, 81, -1, -1, 6, -1, 6, -1, 135, 335, + 113, 335, 136, -1, 135, 335, 136, -1, -1, -1, + 88, 231, 135, 322, 136, 232, 137, 233, 138, -1, + -1, 234, 233, -1, -1, 89, 346, 132, 235, 207, + -1, -1, 91, 132, 236, 207, -1, 90, -1, 191, + 191, -1, 87, -1, 86, 213, 190, 335, 238, 335, + -1, -1, 239, 241, 208, -1, -1, 85, 135, 322, + 136, 243, 208, -1, -1, 229, 132, 245, 209, -1, + -1, 76, 229, 247, 248, -1, 208, -1, -1, 208, + 249, 77, 208, -1, 14, 132, 334, -1, 53, -1, + 53, 132, 346, -1, 53, 132, 59, -1, 46, 132, + 253, 131, 253, -1, 46, 132, 253, 131, 346, -1, + 133, 4, 131, 58, 131, 268, 134, -1, 311, 228, + 131, 316, -1, -1, 68, 132, 254, 131, 261, 131, + 263, 312, 256, 208, -1, -1, 40, 132, 254, 131, + 260, 131, 262, 131, 263, 312, 258, 208, -1, -1, + 131, 5, -1, 133, 4, 131, 4, 134, -1, 59, + -1, 133, 4, 131, 4, 134, -1, 59, -1, 133, + 270, 131, 271, 134, -1, 59, -1, 133, 4, 131, + 4, 134, -1, 59, -1, 75, 132, 265, 131, 315, + 131, 266, 131, 268, -1, 24, 132, 315, 131, 344, + -1, 5, -1, 59, -1, 267, -1, 59, -1, 58, + -1, 58, 192, 267, -1, 4, -1, 59, -1, 19, + -1, 18, 132, 270, 131, 271, 259, 140, -1, 18, + 132, 323, 259, 140, -1, 63, -1, 64, -1, 65, + -1, 64, -1, 22, 132, 274, -1, -1, 22, 132, + 274, 273, 208, -1, 330, 131, 323, 275, -1, -1, + 275, 131, 276, -1, 334, -1, 72, -1, 73, -1, + 318, -1, 74, 334, -1, 97, -1, 95, -1, 98, + -1, 99, -1, 100, -1, 101, 132, 322, -1, 102, + 132, 322, -1, 103, 132, 322, -1, 104, -1, 105, + -1, 106, 132, 277, -1, 139, -1, 107, -1, 139, + 192, 277, -1, 20, 132, 280, -1, -1, 21, 132, + 280, 279, 208, -1, 332, 281, -1, -1, 281, 131, + 282, -1, 56, -1, 108, 132, 330, -1, 347, -1, + 69, 132, 334, -1, 83, 132, 322, -1, 84, -1, + 55, -1, 92, 132, 322, -1, 110, -1, 54, -1, + 93, -1, 94, 132, 322, -1, 95, -1, 96, -1, + 323, -1, 23, 132, 310, 131, 323, -1, 25, 132, + 323, 131, 58, 131, 315, -1, 29, 132, 323, 131, + 58, -1, 29, 132, 323, 131, 58, 131, 5, 203, + -1, 30, -1, 30, 132, 344, -1, 36, 132, 323, + 131, 67, -1, 37, 132, 323, 131, 67, -1, 37, + 132, 352, 131, 352, 131, 67, -1, 41, 132, 352, + 131, 352, 131, 139, -1, 42, 132, 352, 131, 352, + 293, -1, 43, 132, 352, 131, 352, -1, -1, 131, + 67, -1, 49, 132, 344, -1, 51, 132, 344, -1, + 50, 132, 344, -1, 3, -1, 133, 3, 131, 316, + 134, -1, 80, 132, 326, 131, 328, 131, 328, 131, + 7, -1, 78, 132, 344, 131, 328, -1, 38, 132, + 326, -1, 39, 132, 326, -1, -1, 31, 132, 326, + 131, 316, 131, 311, 312, 303, 304, -1, -1, 208, + -1, 35, 132, 323, 131, 317, 131, 319, -1, 109, + 132, 323, 131, 334, -1, 109, 132, 323, 131, 59, + -1, 109, 132, 323, -1, 47, 132, 335, 131, 323, + -1, 48, 132, 323, 131, 351, 131, 334, -1, 45, + 132, 322, 131, 322, 131, 322, 131, 322, -1, 45, + -1, 139, -1, 59, -1, 139, -1, 59, -1, -1, + 131, 313, -1, 314, -1, 314, 131, 313, -1, 32, + -1, 33, -1, 34, -1, 54, -1, 59, -1, 55, + -1, 59, -1, 62, -1, 320, -1, 59, -1, 62, + -1, 320, -1, 61, 132, 59, -1, 66, -1, 59, + -1, 61, 135, 4, 136, -1, 139, -1, 150, -1, + 151, 135, 335, 136, -1, 335, -1, 324, -1, 122, + 133, 344, 134, -1, 154, -1, 155, 135, 335, 136, + -1, 133, 4, 131, 4, 134, -1, 59, -1, 60, + 325, 136, -1, 130, -1, 130, 131, 325, -1, 327, + -1, 156, -1, 157, 135, 335, 136, -1, 133, 4, + 131, 4, 131, 4, 131, 4, 134, -1, 329, -1, + 158, -1, 159, 135, 335, 136, -1, 3, -1, 133, + 3, 131, 316, 134, -1, 331, -1, 160, -1, 161, + 135, 335, 136, -1, 139, -1, 3, -1, 133, 3, + 131, 139, 134, -1, 59, -1, 333, -1, 162, -1, + 163, 135, 335, 136, -1, 139, -1, 3, -1, 133, + 3, 131, 139, 134, -1, 59, -1, 321, -1, 334, + 191, 321, -1, 4, -1, 345, -1, 133, 8, 134, + -1, 148, -1, 149, 135, 335, 136, -1, 335, 185, + 335, -1, 335, 186, 335, -1, 335, 187, 335, -1, + 335, 188, 335, -1, 335, 189, 335, -1, 133, 335, + 134, -1, 144, -1, 145, -1, 212, 132, 336, -1, + 337, -1, 338, 131, 337, -1, -1, 338, -1, 335, + -1, 334, -1, 340, -1, 341, 131, 340, -1, -1, + 341, -1, 323, -1, 115, 326, -1, 116, 326, -1, + 117, 323, 186, 323, -1, 118, 323, 186, 323, 131, + 335, -1, 119, 133, 344, 134, -1, 119, 133, 267, + 131, 344, 134, -1, 125, 133, 7, 131, 344, 134, + -1, 125, 133, 344, 131, 344, 134, -1, 125, 133, + 328, 131, 344, 134, -1, 121, 323, -1, 123, 133, + 323, 131, 335, 134, -1, 123, 133, 323, 131, 335, + 131, 32, 134, -1, 124, 133, 323, 131, 335, 131, + 335, 134, -1, 124, 133, 323, 131, 335, 131, 335, + 131, 32, 134, -1, 127, 133, 128, 131, 133, 335, + 186, 335, 201, 134, 131, 323, 202, 134, -1, 126, + 343, -1, 164, -1, 133, 344, 134, -1, 343, -1, + 343, 193, 344, -1, 184, -1, 8, -1, 9, -1, + 4, -1, 8, -1, 9, -1, 4, -1, 345, -1, + 26, -1, 20, -1, 27, -1, 22, -1, 28, -1, + 78, -1, 57, -1, 59, -1, 353, -1, 44, 133, + 4, 131, 4, 131, 4, 131, 4, 134, -1, 133, + 4, 131, 4, 131, 4, 131, 4, 134, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 273, 273, 274, 277, 278, 281, 303, 308, 324, + 328, 334, 343, 352, 356, 382, 385, 392, 396, 403, + 406, 413, 414, 418, 421, 427, 431, 438, 441, 447, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 499, 500, 501, 502, 503, 504, + 505, 506, 507, 510, 511, 512, 513, 514, 515, 516, + 517, 518, 521, 522, 523, 526, 527, 530, 542, 548, + 554, 560, 566, 572, 578, 584, 590, 597, 604, 611, + 618, 625, 632, 641, 646, 653, 658, 665, 670, 677, + 681, 687, 692, 699, 703, 709, 713, 720, 742, 719, + 756, 801, 808, 811, 817, 823, 827, 836, 840, 835, + 897, 898, 902, 901, 914, 913, 928, 938, 939, 942, + 975, 974, 1000, 999, 1029, 1028, 1059, 1058, 1084, 1093, + 1092, 1119, 1125, 1129, 1133, 1139, 1146, 1155, 1163, 1174, + 1173, 1189, 1188, 1205, 1208, 1214, 1224, 1230, 1239, 1245, + 1250, 1256, 1261, 1267, 1276, 1282, 1283, 1286, 1287, 1290, + 1294, 1300, 1301, 1304, 1310, 1316, 1324, 1325, 1328, 1329, + 1332, 1337, 1336, 1350, 1357, 1363, 1371, 1376, 1381, 1386, + 1391, 1396, 1401, 1406, 1411, 1416, 1421, 1426, 1431, 1436, + 1441, 1446, 1453, 1460, 1464, 1477, 1484, 1483, 1499, 1507, + 1513, 1521, 1526, 1531, 1536, 1541, 1546, 1551, 1556, 1561, + 1566, 1577, 1582, 1587, 1592, 1597, 1604, 1610, 1637, 1642, + 1649, 1653, 1659, 1665, 1671, 1681, 1691, 1706, 1716, 1719, + 1725, 1731, 1737, 1743, 1748, 1755, 1761, 1767, 1773, 1780, + 1779, 1803, 1806, 1812, 1818, 1822, 1827, 1834, 1840, 1847, + 1851, 1857, 1865, 1868, 1878, 1882, 1885, 1891, 1895, 1902, + 1906, 1910, 1916, 1917, 1920, 1921, 1924, 1925, 1926, 1932, + 1933, 1934, 1940, 1941, 1944, 1953, 1958, 1965, 1975, 1981, + 1985, 1989, 1996, 2005, 2011, 2015, 2021, 2025, 2033, 2037, + 2044, 2053, 2064, 2068, 2075, 2084, 2093, 2104, 2108, 2115, + 2124, 2133, 2142, 2151, 2157, 2161, 2168, 2177, 2187, 2196, + 2205, 2212, 2213, 2219, 2220, 2221, 2222, 2230, 2238, 2239, + 2240, 2241, 2242, 2243, 2246, 2252, 2260, 2289, 2290, 2293, + 2294, 2297, 2301, 2308, 2315, 2326, 2329, 2337, 2341, 2345, + 2349, 2353, 2358, 2362, 2366, 2370, 2374, 2378, 2382, 2386, + 2390, 2394, 2398, 2402, 2406, 2413, 2419, 2423, 2429, 2435, + 2436, 2437, 2440, 2444, 2448, 2452, 2458, 2459, 2462, 2463, + 2466, 2467, 2470, 2471, 2474, 2478, 2496 }; #endif -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 + +#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", "CHAR", "INTEGER", "BOOLEAN", "PERCENT", + "SPERCENT", "MINUS_INTEGER", "PLUS_INTEGER", "MAZE_GRID_ID", + "SOLID_FILL_ID", "MINES_ID", "ROGUELEV_ID", "MESSAGE_ID", "MAZE_ID", + "LEVEL_ID", "LEV_INIT_ID", "GEOMETRY_ID", "NOMAP_ID", "OBJECT_ID", + "COBJECT_ID", "MONSTER_ID", "TRAP_ID", "DOOR_ID", "DRAWBRIDGE_ID", + "object_ID", "monster_ID", "terrain_ID", "MAZEWALK_ID", "WALLIFY_ID", + "REGION_ID", "FILLING", "IRREGULAR", "JOINED", "ALTAR_ID", "LADDER_ID", + "STAIR_ID", "NON_DIGGABLE_ID", "NON_PASSWALL_ID", "ROOM_ID", "PORTAL_ID", + "TELEPRT_ID", "BRANCH_ID", "LEV", "MINERALIZE_ID", "CORRIDOR_ID", + "GOLD_ID", "ENGRAVING_ID", "FOUNTAIN_ID", "POOL_ID", "SINK_ID", "NONE", + "RAND_CORRIDOR_ID", "DOOR_STATE", "LIGHT_STATE", "CURSE_TYPE", + "ENGRAVING_TYPE", "DIRECTION", "RANDOM_TYPE", "RANDOM_TYPE_BRACKET", + "A_REGISTER", "ALIGNMENT", "LEFT_OR_RIGHT", "CENTER", "TOP_OR_BOT", + "ALTAR_TYPE", "UP_OR_DOWN", "SUBROOM_ID", "NAME_ID", "FLAGS_ID", + "FLAG_TYPE", "MON_ATTITUDE", "MON_ALERTNESS", "MON_APPEARANCE", + "ROOMDOOR_ID", "IF_ID", "ELSE_ID", "TERRAIN_ID", "HORIZ_OR_VERT", + "REPLACE_TERRAIN_ID", "EXIT_ID", "SHUFFLE_ID", "QUANTITY_ID", + "BURIED_ID", "LOOP_ID", "FOR_ID", "TO_ID", "SWITCH_ID", "CASE_ID", + "BREAK_ID", "DEFAULT_ID", "ERODED_ID", "TRAPPED_ID", "RECHARGED_ID", + "INVIS_ID", "GREASED_ID", "FEMALE_ID", "CANCELLED_ID", "REVIVED_ID", + "AVENGE_ID", "FLEEING_ID", "BLINDED_ID", "PARALYZED_ID", "STUNNED_ID", + "CONFUSED_ID", "SEENTRAPS_ID", "ALL_ID", "MONTYPE_ID", "GRAVE_ID", + "ERODEPROOF_ID", "FUNCTION_ID", "MSG_OUTPUT_TYPE", "COMPARE_TYPE", + "UNKNOWN_TYPE", "rect_ID", "fillrect_ID", "line_ID", "randline_ID", + "grow_ID", "selection_ID", "flood_ID", "rndcoord_ID", "circle_ID", + "ellipse_ID", "filter_ID", "complement_ID", "gradient_ID", + "GRADIENT_TYPE", "LIMITED", "HUMIDITY_TYPE", "','", "':'", "'('", "')'", + "'['", "']'", "'{'", "'}'", "STRING", "MAP_ID", "NQSTRING", "VARSTRING", + "CFUNC", "CFUNC_INT", "CFUNC_STR", "CFUNC_COORD", "CFUNC_REGION", + "VARSTRING_INT", "VARSTRING_INT_ARRAY", "VARSTRING_STRING", + "VARSTRING_STRING_ARRAY", "VARSTRING_VAR", "VARSTRING_VAR_ARRAY", + "VARSTRING_COORD", "VARSTRING_COORD_ARRAY", "VARSTRING_REGION", + "VARSTRING_REGION_ARRAY", "VARSTRING_MAPCHAR", "VARSTRING_MAPCHAR_ARRAY", + "VARSTRING_MONST", "VARSTRING_MONST_ARRAY", "VARSTRING_OBJ", + "VARSTRING_OBJ_ARRAY", "VARSTRING_SEL", "VARSTRING_SEL_ARRAY", + "METHOD_INT", "METHOD_INT_ARRAY", "METHOD_STRING", "METHOD_STRING_ARRAY", + "METHOD_VAR", "METHOD_VAR_ARRAY", "METHOD_COORD", "METHOD_COORD_ARRAY", + "METHOD_REGION", "METHOD_REGION_ARRAY", "METHOD_MAPCHAR", + "METHOD_MAPCHAR_ARRAY", "METHOD_MONST", "METHOD_MONST_ARRAY", + "METHOD_OBJ", "METHOD_OBJ_ARRAY", "METHOD_SEL", "METHOD_SEL_ARRAY", + "DICE", "'+'", "'-'", "'*'", "'/'", "'%'", "'='", "'.'", "'|'", "'&'", + "$accept", "file", "levels", "level", "level_def", "mazefiller", + "lev_init", "opt_limited", "opt_coord_or_var", "opt_fillchar", "walled", + "flags", "flag_list", "levstatements", "stmt_block", "levstatement", + "any_var_array", "any_var", "any_var_or_arr", "any_var_or_unk", + "shuffle_detail", "variable_define", "encodeobj_list", + "encodemonster_list", "mapchar_list", "encoderegion_list", + "encodecoord_list", "integer_list", "string_list", "function_define", + "$@1", "$@2", "function_call", "exitstatement", "opt_percent", + "comparestmt", "switchstatement", "$@3", "$@4", "switchcases", + "switchcase", "$@5", "$@6", "breakstatement", "for_to_span", + "forstmt_start", "forstatement", "$@7", "loopstatement", "$@8", + "chancestatement", "$@9", "ifstatement", "$@10", "if_ending", "$@11", + "message", "random_corridors", "corridor", "corr_spec", "room_begin", + "subroom_def", "$@12", "room_def", "$@13", "roomfill", "room_pos", + "subroom_pos", "room_align", "room_size", "door_detail", "secret", + "door_wall", "dir_list", "door_pos", "map_definition", "h_justif", + "v_justif", "monster_detail", "$@14", "monster_desc", "monster_infos", + "monster_info", "seen_trap_mask", "object_detail", "$@15", "object_desc", + "object_infos", "object_info", "trap_detail", "drawbridge_detail", + "mazewalk_detail", "wallify_detail", "ladder_detail", "stair_detail", + "stair_region", "portal_region", "teleprt_region", "branch_region", + "teleprt_detail", "fountain_detail", "sink_detail", "pool_detail", + "terrain_type", "replace_terrain_detail", "terrain_detail", + "diggable_detail", "passwall_detail", "region_detail", "@16", + "region_detail_end", "altar_detail", "grave_detail", "gold_detail", + "engraving_detail", "mineralize", "trap_name", "room_type", + "optroomregionflags", "roomregionflags", "roomregionflag", "door_state", + "light_state", "alignment", "alignment_prfx", "altar_type", "a_register", + "string_or_var", "integer_or_var", "coord_or_var", "encodecoord", + "humidity_flags", "region_or_var", "encoderegion", "mapchar_or_var", + "mapchar", "monster_or_var", "encodemonster", "object_or_var", + "encodeobj", "string_expr", "math_expr_var", "func_param_type", + "func_param_part", "func_param_list", "func_params_list", + "func_call_param_part", "func_call_param_list", "func_call_params_list", + "ter_selection_x", "ter_selection", "dice", "all_integers", + "all_ints_push", "objectid", "monsterid", "terrainid", "engraving_type", + "lev_region", "region", 0 +}; #endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token 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, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 44, 58, 40, 41, 91, 93, 123, 125, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 43, 45, 42, 47, 37, + 61, 46, 124, 38 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint16 yyr1[] = +{ + 0, 194, 195, 195, 196, 196, 197, 198, 198, 199, + 199, 200, 200, 200, 200, 201, 201, 202, 202, 203, + 203, 204, 204, 205, 205, 206, 206, 207, 207, 208, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 210, 210, 210, 210, 210, 210, + 210, 210, 210, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 212, 212, 212, 213, 213, 214, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 216, 216, 217, 217, 218, 218, 219, + 219, 220, 220, 221, 221, 222, 222, 224, 225, 223, + 226, 227, 228, 228, 229, 229, 229, 231, 232, 230, + 233, 233, 235, 234, 236, 234, 237, 238, 238, 239, + 241, 240, 243, 242, 245, 244, 247, 246, 248, 249, + 248, 250, 251, 251, 251, 252, 252, 253, 254, 256, + 255, 258, 257, 259, 259, 260, 260, 261, 261, 262, + 262, 263, 263, 264, 264, 265, 265, 266, 266, 267, + 267, 268, 268, 269, 269, 269, 270, 270, 271, 271, + 272, 273, 272, 274, 275, 275, 276, 276, 276, 276, + 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, + 276, 276, 277, 277, 277, 278, 279, 278, 280, 281, + 281, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 283, 284, 285, 285, + 286, 286, 287, 288, 289, 290, 291, 292, 293, 293, + 294, 295, 296, 297, 297, 298, 299, 300, 301, 303, + 302, 304, 304, 305, 306, 306, 306, 307, 308, 309, + 309, 310, 310, 311, 311, 312, 312, 313, 313, 314, + 314, 314, 315, 315, 316, 316, 317, 317, 317, 318, + 318, 318, 319, 319, 320, 321, 321, 321, 322, 323, + 323, 323, 323, 324, 324, 324, 325, 325, 326, 326, + 326, 327, 328, 328, 328, 329, 329, 330, 330, 330, + 331, 331, 331, 331, 332, 332, 332, 333, 333, 333, + 333, 334, 334, 335, 335, 335, 335, 335, 335, 335, + 335, 335, 335, 335, 336, 336, 337, 338, 338, 339, + 339, 340, 340, 341, 341, 342, 342, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 344, 344, 345, 346, + 346, 346, 347, 347, 347, 347, 348, 348, 349, 349, + 350, 350, 351, 351, 352, 352, 353 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 0, 1, 1, 2, 3, 3, 5, 1, + 1, 5, 5, 3, 16, 0, 2, 0, 2, 0, + 2, 1, 1, 0, 3, 3, 1, 0, 2, 3, + 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, 3, 3, 5, + 3, 5, 5, 5, 3, 3, 5, 5, 5, 7, + 7, 7, 5, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 0, 0, 8, + 4, 1, 0, 1, 1, 5, 3, 0, 0, 9, + 0, 2, 0, 5, 0, 4, 1, 2, 1, 6, + 0, 3, 0, 6, 0, 4, 0, 4, 1, 0, + 4, 3, 1, 3, 3, 5, 5, 7, 4, 0, + 10, 0, 12, 0, 2, 5, 1, 5, 1, 5, + 1, 5, 1, 9, 5, 1, 1, 1, 1, 1, + 3, 1, 1, 1, 7, 5, 1, 1, 1, 1, + 3, 0, 5, 4, 0, 3, 1, 1, 1, 1, + 2, 1, 1, 1, 1, 1, 3, 3, 3, 1, + 1, 3, 1, 1, 3, 3, 0, 5, 2, 0, + 3, 1, 3, 1, 3, 3, 1, 1, 3, 1, + 1, 1, 3, 1, 1, 1, 5, 7, 5, 8, + 1, 3, 5, 5, 7, 7, 6, 5, 0, 2, + 3, 3, 3, 1, 5, 9, 5, 3, 3, 0, + 10, 0, 1, 7, 5, 5, 3, 5, 7, 9, + 1, 1, 1, 1, 1, 0, 2, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 1, 1, 4, 1, 1, 4, 1, 1, + 4, 1, 4, 5, 1, 3, 1, 3, 1, 1, + 4, 9, 1, 1, 4, 1, 5, 1, 1, 4, + 1, 1, 5, 1, 1, 1, 4, 1, 1, 5, + 1, 1, 3, 1, 1, 3, 1, 4, 3, 3, + 3, 3, 3, 3, 1, 1, 3, 1, 3, 0, + 1, 1, 1, 1, 3, 0, 1, 1, 2, 2, + 4, 6, 4, 6, 6, 6, 6, 2, 6, 8, + 8, 10, 14, 2, 1, 3, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 10, 9 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint16 yydefact[] = +{ + 2, 0, 0, 0, 3, 4, 23, 0, 0, 1, + 5, 0, 27, 0, 7, 0, 134, 0, 0, 0, + 193, 0, 0, 0, 0, 0, 0, 0, 250, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 280, + 0, 0, 0, 0, 0, 0, 162, 0, 0, 0, + 0, 0, 131, 0, 0, 0, 137, 146, 0, 0, + 0, 0, 94, 83, 74, 84, 75, 85, 76, 86, + 77, 87, 78, 88, 79, 89, 80, 90, 81, 91, + 82, 31, 6, 27, 92, 93, 0, 37, 36, 52, + 53, 50, 0, 45, 51, 150, 46, 47, 49, 48, + 30, 62, 35, 65, 64, 39, 55, 57, 58, 72, + 40, 56, 73, 54, 69, 70, 61, 71, 34, 43, + 66, 60, 68, 67, 38, 59, 63, 32, 33, 44, + 41, 42, 0, 26, 24, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, + 0, 95, 96, 0, 0, 0, 0, 343, 0, 346, + 0, 388, 0, 344, 365, 28, 0, 154, 0, 10, + 9, 8, 0, 305, 306, 0, 341, 161, 0, 0, + 0, 13, 314, 0, 196, 197, 0, 0, 311, 0, + 0, 173, 309, 338, 340, 0, 337, 335, 0, 225, + 229, 334, 226, 331, 333, 0, 330, 328, 0, 200, + 0, 327, 282, 281, 0, 292, 293, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 384, 367, 386, 251, 0, 319, 0, 0, + 318, 0, 0, 0, 0, 0, 0, 404, 267, 268, + 284, 283, 0, 132, 0, 0, 0, 0, 0, 308, + 0, 0, 0, 0, 260, 262, 261, 391, 389, 390, + 164, 163, 0, 185, 186, 0, 0, 0, 0, 97, + 0, 0, 0, 276, 127, 0, 0, 0, 0, 136, + 0, 0, 0, 0, 0, 362, 361, 363, 366, 0, + 397, 399, 396, 398, 400, 401, 0, 0, 0, 104, + 105, 100, 98, 0, 0, 0, 0, 27, 151, 25, + 0, 0, 0, 0, 0, 316, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 228, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 368, 369, 0, 0, 0, + 377, 0, 0, 0, 383, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 133, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 158, 157, 0, 0, 152, 0, 0, 0, 359, + 345, 353, 0, 0, 348, 349, 350, 351, 352, 0, + 130, 0, 343, 0, 0, 0, 0, 121, 119, 125, + 123, 0, 0, 0, 155, 0, 0, 342, 12, 263, + 0, 11, 0, 0, 315, 0, 0, 0, 199, 198, + 173, 174, 195, 0, 0, 0, 227, 0, 0, 202, + 204, 246, 184, 0, 248, 0, 0, 189, 0, 0, + 0, 0, 325, 0, 0, 323, 0, 0, 322, 0, + 0, 385, 387, 0, 0, 294, 295, 0, 298, 0, + 296, 0, 297, 252, 0, 0, 253, 0, 176, 0, + 0, 0, 0, 0, 258, 257, 0, 0, 165, 166, + 277, 402, 403, 0, 178, 0, 0, 0, 0, 0, + 266, 0, 0, 148, 0, 0, 138, 275, 274, 0, + 357, 360, 0, 347, 135, 364, 99, 0, 0, 108, + 0, 107, 0, 106, 0, 112, 0, 103, 0, 102, + 0, 101, 29, 307, 0, 0, 317, 310, 0, 312, + 0, 0, 336, 394, 392, 393, 240, 237, 231, 0, + 0, 236, 0, 241, 0, 243, 244, 0, 239, 230, + 245, 395, 233, 0, 329, 203, 0, 0, 370, 0, + 0, 0, 372, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 320, 0, 0, 0, 0, 0, 0, 0, + 0, 168, 0, 0, 0, 256, 0, 0, 0, 0, + 0, 0, 0, 0, 153, 147, 149, 0, 0, 0, + 128, 0, 120, 122, 124, 126, 0, 113, 0, 115, + 0, 117, 0, 0, 313, 194, 339, 0, 0, 0, + 0, 0, 332, 0, 247, 19, 0, 190, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 285, 0, + 303, 302, 273, 0, 0, 254, 0, 180, 0, 0, + 255, 259, 0, 0, 278, 0, 182, 0, 285, 188, + 0, 187, 160, 0, 140, 354, 355, 356, 358, 0, + 0, 111, 0, 110, 0, 109, 0, 0, 234, 235, + 238, 242, 232, 0, 299, 207, 208, 0, 212, 211, + 213, 214, 215, 0, 0, 0, 219, 220, 0, 205, + 209, 300, 206, 0, 249, 371, 373, 0, 378, 0, + 374, 0, 324, 376, 375, 0, 0, 0, 269, 304, + 0, 0, 0, 0, 0, 0, 191, 192, 0, 0, + 0, 169, 0, 0, 0, 0, 0, 140, 129, 114, + 116, 118, 264, 0, 0, 210, 0, 0, 0, 0, + 20, 0, 0, 326, 0, 0, 289, 290, 291, 286, + 287, 271, 0, 0, 175, 0, 285, 279, 167, 177, + 0, 0, 183, 265, 0, 144, 139, 141, 0, 301, + 216, 217, 218, 223, 222, 221, 379, 0, 380, 349, + 0, 0, 272, 270, 0, 0, 0, 171, 0, 170, + 142, 27, 0, 0, 0, 0, 0, 321, 288, 0, + 406, 179, 0, 181, 27, 145, 0, 224, 381, 16, + 0, 405, 172, 143, 0, 0, 0, 17, 21, 22, + 19, 0, 0, 14, 18, 382 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 3, 4, 5, 6, 191, 81, 836, 862, 734, + 860, 12, 134, 82, 338, 83, 84, 85, 86, 173, + 87, 88, 636, 638, 640, 423, 424, 425, 426, 89, + 409, 699, 90, 91, 389, 92, 93, 174, 627, 766, + 767, 844, 831, 94, 525, 95, 96, 188, 97, 522, + 98, 336, 99, 296, 402, 518, 100, 101, 102, 281, + 272, 103, 801, 104, 842, 352, 500, 516, 679, 688, + 105, 295, 690, 468, 758, 106, 210, 450, 107, 359, + 229, 585, 729, 815, 108, 356, 219, 355, 579, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 615, + 119, 120, 121, 441, 122, 123, 124, 125, 126, 791, + 823, 127, 128, 129, 130, 131, 234, 273, 748, 789, + 790, 237, 487, 491, 730, 672, 492, 196, 278, 253, + 212, 346, 259, 260, 477, 478, 230, 231, 220, 221, + 315, 279, 697, 530, 531, 532, 317, 318, 319, 254, + 376, 183, 291, 582, 333, 334, 335, 513, 266, 267 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -654 +static const yytype_int16 yypact[] = +{ + 137, 7, 27, 83, -654, 137, 24, -15, 37, -654, + -654, 91, 733, -10, -654, 113, -654, 99, 131, 133, + -654, 161, 164, 166, 174, 183, 199, 214, 231, 233, + 239, 241, 243, 245, 247, 250, 268, 269, 275, 276, + 281, 295, 305, 317, 322, 323, 325, 326, 327, 28, + 340, 343, -654, 345, 205, 757, -654, -654, 346, 49, + 66, 265, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, 733, -654, -654, 190, -654, -654, -654, + -654, -654, 353, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, 59, 308, -654, -31, 406, 351, 58, 58, + 144, -11, 57, -18, -18, 672, -57, -18, -18, 248, + -57, -57, -6, -1, -1, -1, 66, 303, 66, -18, + 672, 672, 672, 319, -6, 51, -654, 672, -57, 751, + 66, -654, -654, 279, 339, -18, 355, -654, 29, -654, + 344, -654, 198, -654, 56, -654, 18, -654, 359, -654, + -654, -654, 113, -654, -654, 360, -654, 309, 368, 371, + 372, -654, -654, 374, -654, -654, 375, 503, -654, 378, + 379, 383, -654, -654, -654, 506, -654, -654, 402, -654, + -654, -654, -654, -654, -654, 537, -654, -654, 413, 404, + 418, -654, -654, -654, 420, -654, -654, 427, 439, 446, + -57, -57, -18, -18, 417, -18, 436, 445, 449, 672, + 450, 508, -654, -654, 391, -654, 582, -654, 453, 458, + -654, 459, 460, 466, 599, 473, 474, -654, -654, -654, + -654, -654, 475, 601, 608, 482, 483, 489, 490, 387, + 618, 526, 208, 529, -654, -654, -654, -654, -654, -654, + -654, -654, 530, -654, -654, 534, 359, 538, 539, -654, + 523, 66, 66, 540, -654, 548, 342, 66, 66, -654, + 66, 66, 66, 66, 66, 309, 387, -654, 542, 549, + -654, -654, -654, -654, -654, -654, 554, 60, 32, -654, + -654, 309, 387, 555, 556, 558, 733, 733, -654, -654, + 66, -31, 671, 46, 698, 571, 567, 672, 573, 66, + 215, 700, 566, 581, 66, 587, 359, 589, 66, 359, + -18, -18, 672, 663, 664, -654, -654, 541, 544, 521, + -654, -18, -18, 307, -654, 595, 590, 672, 597, 66, + 67, 186, 659, 730, 604, 669, -1, 8, -654, 606, + 607, -1, -1, -1, 66, 609, 89, -18, 141, 12, + 57, 665, -654, 52, 52, -654, 156, 605, -38, 697, + -654, -654, 331, 347, 168, 168, -654, -654, -654, 56, + -654, 672, 612, -52, -50, 4, 140, -654, -654, 309, + 387, 55, 127, 158, -654, 611, 358, -654, -654, -654, + 743, -654, 628, 374, -654, 626, 761, 430, -654, -654, + 383, -654, -654, 627, 464, 266, -654, 638, 492, -654, + -654, -654, -654, 636, 654, -18, -18, 600, 673, 666, + 675, 676, -654, 679, 438, -654, 667, 681, -654, 685, + 686, -654, -654, 799, 522, -654, -654, 689, -654, 687, + -654, 693, -654, -654, 694, 824, -654, 699, -654, 825, + 701, 67, 827, 702, 703, -654, 704, 779, -654, -654, + -654, -654, -654, 707, -654, 836, 710, 712, 786, 861, + -654, 734, 359, -654, 678, 66, -654, -654, 309, 735, + -654, 739, 732, -654, -654, -654, -654, 867, 740, -654, + -8, -654, 66, -654, -31, -654, 21, -654, 25, -654, + 54, -654, -654, -654, 741, 873, -654, -654, 744, -654, + 737, 745, -654, -654, -654, -654, -654, -654, -654, 748, + 769, -654, 771, -654, 788, -654, -654, 790, -654, -654, + -654, -654, -654, 784, -654, 792, 57, 919, -654, 794, + 868, 672, -654, 66, 66, 672, 796, 66, 672, 672, + 795, 798, -654, -6, 926, 90, 927, -49, 865, 802, + 13, -654, 803, 797, 870, -654, 66, 804, -31, 807, + 15, 254, 359, 52, -654, -654, 387, 805, 224, 697, + -654, -29, -654, -654, 387, 309, 151, -654, 159, -654, + 171, -654, 67, 808, -654, -654, -654, -31, 66, 66, + 66, 144, -654, 594, -654, 809, 66, -654, 810, 258, + 337, 811, 67, 528, 812, 813, 66, 937, 817, 814, + -654, -654, -654, 818, 939, -654, 947, -654, 289, 821, + -654, -654, 822, 85, 309, 950, -654, 951, 817, -654, + 826, -654, -654, 828, 160, -654, -654, -654, -654, 359, + 21, -654, 25, -654, 54, -654, 829, 953, 309, -654, + -654, -654, -654, 149, -654, -654, -654, -31, -654, -654, + -654, -654, -654, 830, 832, 833, -654, -654, 834, -654, + -654, -654, 309, 957, -654, 387, -654, 924, -654, 66, + -654, 835, -654, -654, -654, 409, 837, 419, -654, -654, + 963, 839, 838, 840, 15, 66, -654, -654, 841, 842, + 843, -654, 85, 954, 329, 845, 844, 160, -654, -654, + -654, -654, -654, 847, 914, 309, 66, 66, 66, -44, + -654, 846, 304, -654, 66, 975, -654, -654, -654, -654, + 850, 359, 852, 980, -654, 215, 817, -654, -654, -654, + 981, 359, -654, -654, 854, -654, -654, -654, 982, -654, + -654, -654, -654, -654, 800, -654, -654, 956, -654, 217, + 855, 419, -654, -654, 986, 857, 859, -654, 860, -654, + -654, 733, 864, -44, 862, 869, 863, -654, -654, 866, + -654, -654, 359, -654, 733, -654, 67, -654, -654, -654, + 871, -654, -654, -654, 872, -18, 68, 874, -654, -654, + 809, -18, 875, -654, -654, -654 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -654, -654, 994, -654, -654, -654, -654, -654, -654, 146, + -654, -654, 815, -83, -290, 668, 848, 946, -390, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, 959, -654, -654, -654, 244, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, 614, + 849, -654, -654, -654, -654, 562, -654, -654, -654, 260, + -654, -654, -654, -531, 253, -654, 338, 223, -654, -654, + -654, -654, -654, 187, -654, -654, 880, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, -654, -654, -654, + -654, -654, -654, -654, -654, -654, -654, 421, -653, 200, + -654, -385, -492, -654, -654, -654, 369, 682, -168, -136, + -312, 583, 150, -308, -386, -485, -418, -473, 596, -459, + -132, -55, -654, 396, -654, -654, 610, -654, -654, 781, + -135, 576, -392, -654, -654, -654, -654, -654, -124, -654 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -202 +static const yytype_int16 yytable[] = +{ + 185, 211, 300, 197, 509, 182, 401, 238, 239, 611, + 255, 261, 262, 265, 549, 517, 427, 520, 521, 529, + 428, 527, 177, 283, 213, 284, 285, 286, 223, 275, + 276, 277, 297, 177, 16, 761, 177, 305, 320, 303, + 321, 202, 203, 263, 322, 323, 324, 551, 232, 439, + 329, 202, 203, 270, 331, 472, 293, 472, 213, 657, + 177, 213, 189, 813, 422, 641, 456, 498, 305, 459, + 177, 514, 677, 858, 686, 639, 256, 202, 203, 538, + 214, 540, 674, 9, 224, 644, 539, 637, 541, 756, + 691, 202, 203, 287, 11, 814, 325, 288, 289, 257, + 258, 193, 667, 282, 206, 644, 367, 368, 193, 370, + 294, 235, 194, 195, 214, 207, 236, 214, 190, 194, + 195, 132, 485, 306, 13, 207, 486, 859, 233, 316, + 223, 332, 274, 271, 407, 542, 208, 209, 326, 7, + 206, 499, 543, 827, 757, 515, 678, 223, 687, 670, + 706, 327, 1, 2, 215, 328, 671, 193, 225, 8, + 216, 472, 178, 60, 226, 327, 179, 180, 194, 195, + 741, 193, 208, 209, 257, 258, 14, 179, 180, 440, + 179, 180, 194, 195, 133, 519, 224, 519, 215, 178, + 176, 215, 546, 178, 216, 193, 429, 216, 511, 178, + 512, 654, 181, 224, 179, 180, 194, 195, 179, 180, + 475, 476, 445, 181, 179, 180, 181, 217, 218, 771, + 217, 218, 280, 15, 460, 461, 506, 462, 633, 770, + 632, 135, 624, 712, 469, 470, 471, 693, 479, 529, + 181, 769, 482, 523, 181, 488, 406, 489, 490, 764, + 181, 765, 412, 413, 435, 414, 415, 416, 417, 418, + 225, 510, 497, 136, 548, 137, 226, 503, 504, 505, + 563, 544, 306, 430, 564, 565, 528, 225, 545, 448, + 449, 774, 700, 226, 604, 436, 536, 227, 228, 701, + 702, 519, 263, 138, 447, 550, 139, 703, 140, 454, + 268, 269, 704, 458, 227, 228, 141, 202, 203, 705, + 472, 308, 467, 689, 473, 142, 475, 476, 298, 580, + 566, 567, 568, 287, 484, 202, 203, 288, 289, 588, + 589, 143, 692, 287, 309, 569, 330, 288, 289, 397, + 170, 310, 311, 312, 313, 314, 144, 524, 835, 570, + 571, -15, 204, 205, 854, 312, 313, 314, 572, 573, + 574, 575, 576, 145, 316, 146, 202, 203, 695, 696, + 206, 147, 804, 148, 577, 149, 578, 150, 290, 151, + 186, 264, 152, 310, 311, 312, 313, 314, 206, 737, + 365, 366, 738, 310, 311, 312, 313, 314, 184, 207, + 153, 154, 208, 209, 312, 313, 314, 155, 156, 768, + 202, 203, 635, 157, 204, 205, 198, 199, 200, 201, + 208, 209, 240, 241, 242, 243, 244, 158, 245, 206, + 246, 247, 248, 249, 250, 817, 280, 159, 818, 192, + 474, 596, 348, 310, 311, 312, 313, 314, 682, 160, + 181, 786, 787, 788, 161, 162, 658, 163, 164, 165, + 661, 208, 209, 664, 665, 475, 476, 533, 739, 301, + 626, 252, 167, 206, 302, 168, 411, 169, 175, 307, + 709, 710, 711, 534, 207, 187, 684, 634, 304, 310, + 311, 312, 313, 314, 553, 340, 337, 202, 203, 342, + 341, 822, 343, 344, 345, 208, 209, 348, 347, 353, + 350, 829, 348, 349, 351, 708, 310, 311, 312, 313, + 314, 732, 310, 311, 312, 313, 314, 310, 311, 312, + 313, 314, 310, 311, 312, 313, 314, 354, 659, 660, + 357, -201, 663, 310, 311, 312, 313, 314, 358, 360, + 369, 361, 852, 240, 241, 242, 243, 244, 362, 245, + 206, 246, 247, 248, 249, 250, 559, 202, 203, 371, + 363, 251, 310, 311, 312, 313, 314, 364, 372, 467, + 202, 203, 373, 375, 377, 775, 378, 797, 379, 380, + 381, 382, 208, 209, 310, 784, 312, 313, 314, 383, + 562, 735, 252, 384, 385, 386, 387, 388, 810, 811, + 812, 745, 390, 391, 392, 310, 311, 312, 313, 314, + 393, 394, 395, 240, 241, 242, 243, 244, 584, 245, + 206, 246, 247, 248, 249, 250, 240, 241, 242, 243, + 244, 251, 245, 206, 246, 247, 248, 249, 250, 310, + 311, 312, 313, 314, 251, 713, 714, 396, 602, 405, + 398, 399, 208, 209, 742, 400, 715, 716, 717, 403, + 404, 408, 252, 419, 438, 208, 209, 310, 311, 312, + 313, 314, 410, 420, 782, 252, 421, 431, 432, 718, + 433, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 442, 443, 444, 446, 451, 452, 310, 311, 312, + 313, 314, 453, 310, 311, 312, 313, 314, 455, 857, + 457, 463, 464, 480, 481, 864, 493, 465, 483, 819, + 466, 202, 203, 193, 494, 495, 496, 501, 502, 16, + 507, 526, -159, 537, 194, 195, 554, 17, 845, 552, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 555, + 557, 853, 27, 28, 29, 558, 561, 586, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 583, 39, 40, + 41, 42, 43, 44, 45, 587, 46, 240, 241, 242, + 243, 244, 590, 245, 206, 246, 247, 248, 249, 250, + 592, 47, 597, 601, 591, 251, 593, 594, 48, 49, + 595, 50, 598, 51, 52, 53, 599, 600, 54, 55, + 603, 56, 604, 57, 605, 606, 208, 209, 607, 609, + 608, 612, 610, 613, 614, 616, 252, 617, 618, 62, + 619, 620, 58, 621, 59, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 622, 596, 623, 630, 628, 60, 625, + 629, 631, 642, 256, 61, 62, 643, 645, 644, 646, + 647, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 171, + 64, 648, 66, 649, 68, 63, 70, 65, 72, 67, + 74, 69, 76, 71, 78, 73, 80, 75, 652, 77, + 650, 79, 651, 653, 655, 656, 467, 662, 666, 667, + 669, 673, 675, 676, 674, 683, 680, 681, 685, 707, + 733, 746, 694, 751, 736, 740, 743, 744, 747, 750, + 749, 752, 754, 755, 759, 760, 781, 762, 773, 763, + 780, 803, 776, 772, 777, 778, 779, 792, 785, 783, + 793, 795, 794, 809, 800, 798, 799, 805, 808, 820, + 816, 821, 806, 824, 825, 828, 830, 832, 834, 837, + 839, 840, 833, 841, 843, 846, 848, 850, 849, 10, + 851, 172, 855, 856, 434, 861, 863, 339, 166, 865, + 508, 807, 560, 292, 796, 802, 753, 299, 826, 222, + 847, 838, 731, 437, 668, 698, 556, 547, 0, 535, + 374, 581 +}; + +static const yytype_int16 yycheck[] = +{ + 83, 137, 170, 135, 396, 60, 296, 143, 144, 501, + 145, 147, 148, 149, 432, 400, 328, 403, 404, 409, + 328, 59, 4, 159, 3, 160, 161, 162, 3, 153, + 154, 155, 167, 4, 6, 688, 4, 8, 20, 175, + 22, 59, 60, 44, 26, 27, 28, 433, 59, 3, + 186, 59, 60, 59, 186, 3, 5, 3, 3, 590, + 4, 3, 3, 107, 4, 550, 356, 59, 8, 359, + 4, 59, 59, 5, 59, 548, 133, 59, 60, 131, + 59, 131, 131, 0, 59, 134, 138, 546, 138, 4, + 621, 59, 60, 4, 70, 139, 78, 8, 9, 156, + 157, 139, 131, 158, 122, 134, 242, 243, 139, 245, + 59, 54, 150, 151, 59, 133, 59, 59, 59, 150, + 151, 131, 55, 178, 139, 133, 59, 59, 139, 184, + 3, 186, 133, 139, 302, 131, 154, 155, 120, 132, + 122, 133, 138, 796, 59, 133, 133, 3, 133, 59, + 642, 133, 15, 16, 133, 137, 66, 139, 133, 132, + 139, 3, 133, 135, 139, 133, 148, 149, 150, 151, + 662, 139, 154, 155, 156, 157, 139, 148, 149, 133, + 148, 149, 150, 151, 71, 133, 59, 133, 133, 133, + 141, 133, 137, 133, 139, 139, 328, 139, 57, 133, + 59, 586, 184, 59, 148, 149, 150, 151, 148, 149, + 158, 159, 347, 184, 148, 149, 184, 162, 163, 704, + 162, 163, 133, 132, 360, 361, 394, 362, 540, 702, + 538, 132, 522, 651, 369, 371, 372, 623, 373, 629, + 184, 700, 377, 87, 184, 59, 301, 61, 62, 89, + 184, 91, 307, 308, 337, 310, 311, 312, 313, 314, + 133, 397, 386, 132, 137, 132, 139, 391, 392, 393, + 4, 131, 327, 328, 8, 9, 408, 133, 138, 64, + 65, 132, 131, 139, 135, 340, 421, 160, 161, 138, + 131, 133, 44, 132, 349, 137, 132, 138, 132, 354, + 150, 151, 131, 358, 160, 161, 132, 59, 60, 138, + 3, 113, 58, 59, 7, 132, 158, 159, 168, 455, + 54, 55, 56, 4, 379, 59, 60, 8, 9, 465, + 466, 132, 622, 4, 136, 69, 186, 8, 9, 131, + 135, 185, 186, 187, 188, 189, 132, 191, 131, 83, + 84, 134, 63, 64, 846, 187, 188, 189, 92, 93, + 94, 95, 96, 132, 419, 132, 59, 60, 144, 145, + 122, 132, 764, 132, 108, 132, 110, 132, 59, 132, + 190, 133, 132, 185, 186, 187, 188, 189, 122, 131, + 240, 241, 134, 185, 186, 187, 188, 189, 133, 133, + 132, 132, 154, 155, 187, 188, 189, 132, 132, 699, + 59, 60, 544, 132, 63, 64, 10, 11, 12, 13, + 154, 155, 115, 116, 117, 118, 119, 132, 121, 122, + 123, 124, 125, 126, 127, 131, 133, 132, 134, 131, + 133, 3, 4, 185, 186, 187, 188, 189, 616, 132, + 184, 32, 33, 34, 132, 132, 591, 132, 132, 132, + 595, 154, 155, 598, 599, 158, 159, 136, 131, 190, + 525, 164, 132, 122, 135, 132, 134, 132, 132, 135, + 648, 649, 650, 136, 133, 132, 618, 542, 133, 185, + 186, 187, 188, 189, 136, 135, 137, 59, 60, 131, + 191, 791, 131, 131, 130, 154, 155, 4, 133, 3, + 131, 801, 4, 135, 131, 647, 185, 186, 187, 188, + 189, 653, 185, 186, 187, 188, 189, 185, 186, 187, + 188, 189, 185, 186, 187, 188, 189, 135, 593, 594, + 3, 137, 597, 185, 186, 187, 188, 189, 135, 131, + 133, 131, 842, 115, 116, 117, 118, 119, 131, 121, + 122, 123, 124, 125, 126, 127, 136, 59, 60, 133, + 131, 133, 185, 186, 187, 188, 189, 131, 133, 58, + 59, 60, 133, 133, 193, 717, 4, 755, 135, 131, + 131, 131, 154, 155, 185, 186, 187, 188, 189, 133, + 136, 656, 164, 4, 131, 131, 131, 6, 776, 777, + 778, 666, 4, 131, 131, 185, 186, 187, 188, 189, + 131, 131, 4, 115, 116, 117, 118, 119, 136, 121, + 122, 123, 124, 125, 126, 127, 115, 116, 117, 118, + 119, 133, 121, 122, 123, 124, 125, 126, 127, 185, + 186, 187, 188, 189, 133, 61, 62, 131, 136, 136, + 131, 131, 154, 155, 136, 131, 72, 73, 74, 131, + 131, 131, 164, 131, 3, 154, 155, 185, 186, 187, + 188, 189, 134, 134, 739, 164, 132, 132, 132, 95, + 132, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 3, 131, 136, 131, 5, 140, 185, 186, 187, + 188, 189, 131, 185, 186, 187, 188, 189, 131, 855, + 131, 58, 58, 128, 134, 861, 67, 186, 131, 784, + 186, 59, 60, 139, 4, 131, 67, 131, 131, 6, + 131, 136, 77, 131, 150, 151, 3, 14, 831, 138, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 131, + 134, 844, 29, 30, 31, 4, 139, 131, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 139, 45, 46, + 47, 48, 49, 50, 51, 131, 53, 115, 116, 117, + 118, 119, 192, 121, 122, 123, 124, 125, 126, 127, + 134, 68, 135, 4, 131, 133, 131, 131, 75, 76, + 131, 78, 131, 80, 81, 82, 131, 131, 85, 86, + 131, 88, 135, 90, 131, 131, 154, 155, 4, 4, + 131, 4, 131, 131, 131, 131, 164, 58, 131, 142, + 4, 131, 109, 131, 111, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 77, 3, 131, 134, 132, 135, 191, + 131, 4, 131, 133, 141, 142, 3, 140, 134, 134, + 132, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 142, + 149, 132, 151, 132, 153, 148, 155, 150, 157, 152, + 159, 154, 161, 156, 163, 158, 165, 160, 134, 162, + 132, 164, 132, 131, 5, 131, 58, 131, 133, 131, + 4, 4, 67, 131, 131, 131, 139, 67, 131, 131, + 131, 4, 137, 4, 134, 134, 134, 134, 131, 131, + 136, 4, 131, 131, 4, 4, 32, 131, 5, 131, + 3, 7, 132, 134, 132, 132, 132, 4, 131, 134, + 131, 131, 134, 59, 131, 134, 134, 132, 131, 4, + 134, 131, 138, 131, 4, 4, 132, 5, 32, 134, + 4, 134, 192, 134, 134, 131, 134, 134, 129, 5, + 134, 55, 131, 131, 336, 131, 860, 192, 49, 134, + 396, 767, 450, 164, 754, 762, 678, 169, 795, 139, + 833, 821, 653, 341, 603, 629, 443, 431, -1, 419, + 249, 455 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint16 yystos[] = +{ + 0, 15, 16, 195, 196, 197, 198, 132, 132, 0, + 196, 70, 205, 139, 139, 132, 6, 14, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 29, 30, 31, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, + 46, 47, 48, 49, 50, 51, 53, 68, 75, 76, + 78, 80, 81, 82, 85, 86, 88, 90, 109, 111, + 135, 141, 142, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 200, 207, 209, 210, 211, 212, 214, 215, 223, + 226, 227, 229, 230, 237, 239, 240, 242, 244, 246, + 250, 251, 252, 255, 257, 264, 269, 272, 278, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 294, + 295, 296, 298, 299, 300, 301, 302, 305, 306, 307, + 308, 309, 131, 71, 206, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 229, 132, 132, 132, + 135, 142, 211, 213, 231, 132, 141, 4, 133, 148, + 149, 184, 335, 345, 133, 207, 190, 132, 241, 3, + 59, 199, 131, 139, 150, 151, 321, 334, 10, 11, + 12, 13, 59, 60, 63, 64, 122, 133, 154, 155, + 270, 323, 324, 3, 59, 133, 139, 162, 163, 280, + 332, 333, 280, 3, 59, 133, 139, 160, 161, 274, + 330, 331, 59, 139, 310, 54, 59, 315, 323, 323, + 115, 116, 117, 118, 119, 121, 123, 124, 125, 126, + 127, 133, 164, 323, 343, 344, 133, 156, 157, 326, + 327, 323, 323, 44, 133, 323, 352, 353, 326, 326, + 59, 139, 254, 311, 133, 352, 352, 352, 322, 335, + 133, 253, 335, 323, 344, 344, 344, 4, 8, 9, + 59, 346, 254, 5, 59, 265, 247, 344, 326, 210, + 322, 190, 135, 323, 133, 8, 335, 135, 113, 136, + 185, 186, 187, 188, 189, 334, 335, 340, 341, 342, + 20, 22, 26, 27, 28, 78, 120, 133, 137, 323, + 326, 334, 335, 348, 349, 350, 245, 137, 208, 206, + 135, 191, 131, 131, 131, 130, 325, 133, 4, 135, + 131, 131, 259, 3, 135, 281, 279, 3, 135, 273, + 131, 131, 131, 131, 131, 326, 326, 323, 323, 133, + 323, 133, 133, 133, 343, 133, 344, 193, 4, 135, + 131, 131, 131, 133, 4, 131, 131, 131, 6, 228, + 4, 131, 131, 131, 131, 4, 131, 131, 131, 131, + 131, 208, 248, 131, 131, 136, 335, 322, 131, 224, + 134, 134, 335, 335, 335, 335, 335, 335, 335, 131, + 134, 132, 4, 219, 220, 221, 222, 324, 327, 334, + 335, 132, 132, 132, 209, 207, 335, 321, 3, 3, + 133, 297, 3, 131, 136, 344, 131, 335, 64, 65, + 271, 5, 140, 131, 335, 131, 208, 131, 335, 208, + 323, 323, 344, 58, 58, 186, 186, 58, 267, 344, + 323, 323, 3, 7, 133, 158, 159, 328, 329, 344, + 128, 134, 344, 131, 335, 55, 59, 316, 59, 61, + 62, 317, 320, 67, 4, 131, 67, 352, 59, 133, + 260, 131, 131, 352, 352, 352, 322, 131, 253, 346, + 323, 57, 59, 351, 59, 133, 261, 315, 249, 133, + 328, 328, 243, 87, 191, 238, 136, 59, 334, 212, + 337, 338, 339, 136, 136, 340, 344, 131, 131, 138, + 131, 138, 131, 138, 131, 138, 137, 332, 137, 330, + 137, 328, 138, 136, 3, 131, 325, 134, 4, 136, + 259, 139, 136, 4, 8, 9, 54, 55, 56, 69, + 83, 84, 92, 93, 94, 95, 96, 108, 110, 282, + 323, 345, 347, 139, 136, 275, 131, 131, 323, 323, + 192, 131, 134, 131, 131, 131, 3, 135, 131, 131, + 131, 4, 136, 131, 135, 131, 131, 4, 131, 4, + 131, 316, 4, 131, 131, 293, 131, 58, 131, 4, + 131, 131, 77, 131, 208, 191, 335, 232, 132, 131, + 134, 4, 327, 324, 335, 334, 216, 333, 217, 331, + 218, 329, 131, 3, 134, 140, 134, 132, 132, 132, + 132, 132, 134, 131, 315, 5, 131, 267, 344, 335, + 335, 344, 131, 335, 344, 344, 133, 131, 311, 4, + 59, 66, 319, 4, 131, 67, 131, 59, 133, 262, + 139, 67, 322, 131, 334, 131, 59, 133, 263, 59, + 266, 267, 208, 328, 137, 144, 145, 336, 337, 225, + 131, 138, 131, 138, 131, 138, 316, 131, 334, 322, + 322, 322, 330, 61, 62, 72, 73, 74, 95, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 276, + 318, 320, 334, 131, 203, 335, 134, 131, 134, 131, + 134, 316, 136, 134, 134, 335, 4, 131, 312, 136, + 131, 4, 4, 270, 131, 131, 4, 59, 268, 4, + 4, 312, 131, 131, 89, 91, 233, 234, 208, 333, + 331, 329, 134, 5, 132, 334, 132, 132, 132, 132, + 3, 32, 335, 134, 186, 131, 32, 33, 34, 313, + 314, 303, 4, 131, 134, 131, 263, 322, 134, 134, + 131, 256, 268, 7, 346, 132, 138, 233, 131, 59, + 322, 322, 322, 107, 139, 277, 134, 131, 134, 335, + 4, 131, 208, 304, 131, 4, 271, 312, 4, 208, + 132, 236, 5, 192, 32, 131, 201, 134, 313, 4, + 134, 134, 258, 134, 235, 207, 131, 277, 134, 129, + 134, 134, 208, 207, 316, 131, 131, 323, 5, 59, + 204, 131, 202, 203, 323, 134 +}; + +#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 temporarily + to 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 ends + the 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 know + we 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 /* 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 void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (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 void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +#else +static void +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + 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 void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_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++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + YYFPRINTF (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 that + multiple parsers can coexist. */ int yydebug; -int yynerrs; -int yyerrflag; +#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 only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_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_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (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' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static 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 unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (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 token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_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 are + constructed 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"); +# endif + char *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 in + YYCHECK. */ + 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 translation + produced 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 void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (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 __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + +/* The lookahead symbol. */ int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; + +/* The semantic value of the lookahead symbol. */ YYSTYPE yylval; -short yyss[YYSTACKSIZE]; -YYSTYPE yyvs[YYSTACKSIZE]; -#define yystacksize YYSTACKSIZE -/*lev_comp.y*/ -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) int -yyparse() +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif { - register int yym, yyn, yystate; -#if YYDEBUG - register char *yys; - extern char *getenv(); - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } + + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; + + 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 stack + so 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 stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif + /* 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 of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be 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_RELOCATE + goto 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_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (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; } - if ((yyn = yysindex[yystate]) != 0 && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); - if (yyerrflag > 0) --yyerrflag; - goto yyloop; + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; } - if ((yyn = yyrindex[yystate]) != 0 && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) + + if (yychar <= YYEOF) { - yyn = yytable[yyn]; - goto yyreduce; + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); } - if (yyerrflag) goto yyinrecovery; -#ifdef lint - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#ifdef lint + 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 to + detect 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; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + 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; -#endif -yyerrlab: - ++yynerrs; -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yyssp]) != 0 && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); -#endif - if (yyssp >= yyss + yystacksize - 1) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); -#endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - yyval = yyvsp[1-yym]; - switch (yyn) - { -case 7: -{ - unsigned i; + 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 Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 6: + +/* Line 1455 of yacc.c */ +#line 282 "lev_comp.y" + { if (fatal_error > 0) { (void) fprintf(stderr, - "%s : %d errors detected. No output created!\n", - fname, fatal_error); - } else { - maze.flags = yyvsp[-3].i; - (void) memcpy((genericptr_t)&(maze.init_lev), - (genericptr_t)&(init_lev), - sizeof(lev_init)); - maze.numpart = npart; - maze.parts = NewTab(mazepart, npart); - for(i=0;i 0) { - (void) fprintf(stderr, - "%s : %d errors detected. No output created!\n", - fname, fatal_error); - } else { - special_lev.flags = (long) yyvsp[-5].i; - (void) memcpy( - (genericptr_t)&(special_lev.init_lev), - (genericptr_t)&(init_lev), - sizeof(lev_init)); - special_lev.nroom = nrooms; - special_lev.rooms = NewTab(room, nrooms); - for(i=0; i 8) - yyerror("Level names limited to 8 characters."); - yyval.map = yyvsp[0].map; - special_lev.nrmonst = special_lev.nrobjects = 0; - n_mlist = n_olist = 0; - } -break; -case 10: -{ - /* in case we're processing multiple files, - explicitly clear any stale settings */ - (void) memset((genericptr_t) &init_lev, 0, - sizeof init_lev); - init_lev.init_present = FALSE; - yyval.i = 0; - } -break; -case 11: -{ - init_lev.init_present = TRUE; - init_lev.fg = what_map_char((char) yyvsp[-10].i); - if (init_lev.fg == INVALID_TYPE) - yyerror("Invalid foreground type."); - init_lev.bg = what_map_char((char) yyvsp[-8].i); - if (init_lev.bg == INVALID_TYPE) - yyerror("Invalid background type."); - init_lev.smoothed = yyvsp[-6].i; - init_lev.joined = yyvsp[-4].i; - if (init_lev.joined && - init_lev.fg != CORR && init_lev.fg != ROOM) - yyerror("Invalid foreground type for joined map."); - init_lev.lit = yyvsp[-2].i; - init_lev.walled = yyvsp[0].i; - init_lev.icedpools = FALSE; - yyval.i = 1; - } -break; -case 12: -{ - init_lev.init_present = TRUE; - init_lev.fg = what_map_char((char) yyvsp[-12].i); - if (init_lev.fg == INVALID_TYPE) - yyerror("Invalid foreground type."); - init_lev.bg = what_map_char((char) yyvsp[-10].i); - if (init_lev.bg == INVALID_TYPE) - yyerror("Invalid background type."); - init_lev.smoothed = yyvsp[-8].i; - init_lev.joined = yyvsp[-6].i; - if (init_lev.joined && - init_lev.fg != CORR && init_lev.fg != ROOM) - yyerror("Invalid foreground type for joined map."); - init_lev.lit = yyvsp[-4].i; - init_lev.walled = yyvsp[-2].i; - init_lev.icedpools = yyvsp[0].i; - yyval.i = 1; - } -break; -case 15: -{ - yyval.i = 0; - } -break; -case 16: -{ - yyval.i = lev_flags; - lev_flags = 0; /* clear for next user */ - } -break; -case 17: -{ - lev_flags |= yyvsp[-2].i; - } -break; -case 18: -{ - lev_flags |= yyvsp[0].i; - } -break; -case 21: -{ - int i, j; + case 7: - i = (int) strlen(yyvsp[0].map) + 1; - j = (int) strlen(tmpmessage); - if (i + j > 255) { - yyerror("Message string too long (>256 characters)"); - } else { - if (j) tmpmessage[j++] = '\n'; - (void) strncpy(tmpmessage+j, yyvsp[0].map, i - 1); - tmpmessage[j + i - 1] = 0; - } - Free(yyvsp[0].map); +/* Line 1455 of yacc.c */ +#line 304 "lev_comp.y" + { + start_level_def(&splev, (yyvsp[(3) - (3)].map)); + (yyval.map) = (yyvsp[(3) - (3)].map); } -break; -case 24: -{ - if(special_lev.nrobjects) { - yyerror("Object registers already initialized!"); - } else { - special_lev.nrobjects = n_olist; - special_lev.robjects = (char *) alloc(n_olist); - (void) memcpy((genericptr_t)special_lev.robjects, - (genericptr_t)olist, n_olist); - } + break; + + case 8: + +/* Line 1455 of yacc.c */ +#line 309 "lev_comp.y" + { + start_level_def(&splev, (yyvsp[(3) - (5)].map)); + if ((yyvsp[(5) - (5)].i) == -1) { + add_opvars(splev, "iiiiiiiio", LVLINIT_MAZEGRID,HWALL,0,0, 0,0,0,0, SPO_INITLEVEL); + } else { + long bg = what_map_char((char) (yyvsp[(5) - (5)].i)); + add_opvars(splev, "iiiiiiiio", LVLINIT_SOLIDFILL, bg, 0,0, 0,0,0,0, SPO_INITLEVEL); + } + add_opvars(splev, "io", MAZELEVEL, SPO_LEVEL_FLAGS); + max_x_map = COLNO-1; + max_y_map = ROWNO; + (yyval.map) = (yyvsp[(3) - (5)].map); } -break; -case 25: -{ - if(special_lev.nrmonst) { - yyerror("Monster registers already initialized!"); - } else { - special_lev.nrmonst = n_mlist; - special_lev.rmonst = (char *) alloc(n_mlist); - (void) memcpy((genericptr_t)special_lev.rmonst, - (genericptr_t)mlist, n_mlist); - } + break; + + case 9: + +/* Line 1455 of yacc.c */ +#line 325 "lev_comp.y" + { + (yyval.i) = -1; } -break; -case 26: -{ - tmproom[nrooms] = New(room); - tmproom[nrooms]->name = (char *) 0; - tmproom[nrooms]->parent = (char *) 0; - tmproom[nrooms]->rtype = 0; - tmproom[nrooms]->rlit = 0; - tmproom[nrooms]->xalign = ERR; - tmproom[nrooms]->yalign = ERR; - tmproom[nrooms]->x = 0; - tmproom[nrooms]->y = 0; - tmproom[nrooms]->w = 2; - tmproom[nrooms]->h = 2; - in_room = 1; + break; + + case 10: + +/* Line 1455 of yacc.c */ +#line 329 "lev_comp.y" + { + (yyval.i) = what_map_char((char) (yyvsp[(1) - (1)].i)); } -break; -case 32: -{ - tmpcor[0] = New(corridor); - tmpcor[0]->src.room = -1; - ncorridor = 1; + break; + + case 11: + +/* Line 1455 of yacc.c */ +#line 335 "lev_comp.y" + { + long filling = (yyvsp[(5) - (5)].terr).ter; + if (filling == INVALID_TYPE || filling >= MAX_TYPE) + lc_error("INIT_MAP: Invalid fill char type."); + add_opvars(splev, "iiiiiiiio", LVLINIT_SOLIDFILL,filling,0,(long)(yyvsp[(5) - (5)].terr).lit, 0,0,0,0, SPO_INITLEVEL); + max_x_map = COLNO-1; + max_y_map = ROWNO; } -break; -case 35: -{ - tmpcor[ncorridor] = New(corridor); - tmpcor[ncorridor]->src.room = yyvsp[-2].corpos.room; - tmpcor[ncorridor]->src.wall = yyvsp[-2].corpos.wall; - tmpcor[ncorridor]->src.door = yyvsp[-2].corpos.door; - tmpcor[ncorridor]->dest.room = yyvsp[0].corpos.room; - tmpcor[ncorridor]->dest.wall = yyvsp[0].corpos.wall; - tmpcor[ncorridor]->dest.door = yyvsp[0].corpos.door; - ncorridor++; - if (ncorridor >= MAX_OF_TYPE) { - yyerror("Too many corridors in level!"); - ncorridor--; - } + break; + + case 12: + +/* Line 1455 of yacc.c */ +#line 344 "lev_comp.y" + { + long filling = what_map_char((char) (yyvsp[(5) - (5)].i)); + if (filling == INVALID_TYPE || filling >= MAX_TYPE) + lc_error("INIT_MAP: Invalid fill char type."); + add_opvars(splev, "iiiiiiiio", LVLINIT_MAZEGRID,filling,0,0, 0,0,0,0, SPO_INITLEVEL); + max_x_map = COLNO-1; + max_y_map = ROWNO; } -break; -case 36: -{ - tmpcor[ncorridor] = New(corridor); - tmpcor[ncorridor]->src.room = yyvsp[-2].corpos.room; - tmpcor[ncorridor]->src.wall = yyvsp[-2].corpos.wall; - tmpcor[ncorridor]->src.door = yyvsp[-2].corpos.door; - tmpcor[ncorridor]->dest.room = -1; - tmpcor[ncorridor]->dest.wall = yyvsp[0].i; - ncorridor++; - if (ncorridor >= MAX_OF_TYPE) { - yyerror("Too many corridors in level!"); - ncorridor--; - } + break; + + case 13: + +/* Line 1455 of yacc.c */ +#line 353 "lev_comp.y" + { + add_opvars(splev, "iiiiiiiio", LVLINIT_ROGUE,0,0,0,0,0,0,0, SPO_INITLEVEL); } -break; -case 37: -{ - if ((unsigned) yyvsp[-5].i >= nrooms) - yyerror("Wrong room number!"); - yyval.corpos.room = yyvsp[-5].i; - yyval.corpos.wall = yyvsp[-3].i; - yyval.corpos.door = yyvsp[-1].i; - } -break; -case 38: -{ - store_room(); - } -break; -case 39: -{ - store_room(); - } -break; -case 40: -{ - tmproom[nrooms] = New(room); - tmproom[nrooms]->parent = yyvsp[-1].map; - tmproom[nrooms]->name = (char *) 0; - tmproom[nrooms]->rtype = yyvsp[-9].i; - tmproom[nrooms]->rlit = yyvsp[-7].i; - tmproom[nrooms]->filled = yyvsp[0].i; - tmproom[nrooms]->xalign = ERR; - tmproom[nrooms]->yalign = ERR; - tmproom[nrooms]->x = current_coord.x; - tmproom[nrooms]->y = current_coord.y; - tmproom[nrooms]->w = current_size.width; - tmproom[nrooms]->h = current_size.height; - in_room = 1; - } -break; -case 41: -{ - tmproom[nrooms] = New(room); - tmproom[nrooms]->name = (char *) 0; - tmproom[nrooms]->parent = (char *) 0; - tmproom[nrooms]->rtype = yyvsp[-9].i; - tmproom[nrooms]->rlit = yyvsp[-7].i; - tmproom[nrooms]->filled = yyvsp[0].i; - tmproom[nrooms]->xalign = current_align.x; - tmproom[nrooms]->yalign = current_align.y; - tmproom[nrooms]->x = current_coord.x; - tmproom[nrooms]->y = current_coord.y; - tmproom[nrooms]->w = current_size.width; - tmproom[nrooms]->h = current_size.height; - in_room = 1; - } -break; -case 42: -{ - yyval.i = 1; - } -break; -case 43: -{ - yyval.i = yyvsp[0].i; - } -break; -case 44: -{ - if ( yyvsp[-3].i < 1 || yyvsp[-3].i > 5 || - yyvsp[-1].i < 1 || yyvsp[-1].i > 5 ) { - yyerror("Room position should be between 1 & 5!"); - } else { - current_coord.x = yyvsp[-3].i; - current_coord.y = yyvsp[-1].i; - } - } -break; -case 45: -{ - current_coord.x = current_coord.y = ERR; - } -break; -case 46: -{ - if ( yyvsp[-3].i < 0 || yyvsp[-1].i < 0) { - yyerror("Invalid subroom position !"); - } else { - current_coord.x = yyvsp[-3].i; - current_coord.y = yyvsp[-1].i; - } - } -break; -case 47: -{ - current_coord.x = current_coord.y = ERR; - } -break; -case 48: -{ - current_align.x = yyvsp[-3].i; - current_align.y = yyvsp[-1].i; - } -break; -case 49: -{ - current_align.x = current_align.y = ERR; - } -break; -case 50: -{ - current_size.width = yyvsp[-3].i; - current_size.height = yyvsp[-1].i; - } -break; -case 51: -{ - current_size.height = current_size.width = ERR; - } -break; -case 67: -{ - if (tmproom[nrooms]->name) - yyerror("This room already has a name!"); - else - tmproom[nrooms]->name = yyvsp[0].map; - } -break; -case 68: -{ - if (tmproom[nrooms]->chance) - yyerror("This room already assigned a chance!"); - else if (tmproom[nrooms]->rtype == OROOM) - yyerror("Only typed rooms can have a chance!"); - else if (yyvsp[0].i < 1 || yyvsp[0].i > 99) - yyerror("The chance is supposed to be percentile."); - else - tmproom[nrooms]->chance = yyvsp[0].i; - } -break; -case 69: -{ - /* ERR means random here */ - if (yyvsp[-2].i == ERR && yyvsp[0].i != ERR) { - yyerror("If the door wall is random, so must be its pos!"); - } else { - tmprdoor[ndoor] = New(room_door); - tmprdoor[ndoor]->secret = yyvsp[-6].i; - tmprdoor[ndoor]->mask = yyvsp[-4].i; - tmprdoor[ndoor]->wall = yyvsp[-2].i; - tmprdoor[ndoor]->pos = yyvsp[0].i; - ndoor++; - if (ndoor >= MAX_OF_TYPE) { - yyerror("Too many doors in room!"); - ndoor--; - } - } - } -break; -case 76: -{ - maze.filling = (schar) yyvsp[0].i; - if (index(yyvsp[-2].map, '.')) - yyerror("Invalid dot ('.') in level name."); - if ((int) strlen(yyvsp[-2].map) > 8) - yyerror("Level names limited to 8 characters."); - yyval.map = yyvsp[-2].map; - in_room = 0; - n_plist = n_mlist = n_olist = 0; - } -break; -case 77: -{ - yyval.i = get_floor_type((char)yyvsp[0].i); - } -break; -case 78: -{ - yyval.i = -1; - } -break; -case 81: -{ - store_part(); - } -break; -case 82: -{ - tmppart[npart] = New(mazepart); - tmppart[npart]->halign = 1; - tmppart[npart]->valign = 1; - tmppart[npart]->nrobjects = 0; - tmppart[npart]->nloc = 0; - tmppart[npart]->nrmonst = 0; - tmppart[npart]->xsize = 1; - tmppart[npart]->ysize = 1; - tmppart[npart]->map = (char **) alloc(sizeof(char *)); - tmppart[npart]->map[0] = (char *) alloc(1); - tmppart[npart]->map[0][0] = STONE; + break; + + case 14: + +/* Line 1455 of yacc.c */ +#line 357 "lev_comp.y" + { + long fg = what_map_char((char) (yyvsp[(5) - (16)].i)); + long bg = what_map_char((char) (yyvsp[(7) - (16)].i)); + long smoothed = (yyvsp[(9) - (16)].i); + long joined = (yyvsp[(11) - (16)].i); + long lit = (yyvsp[(13) - (16)].i); + long walled = (yyvsp[(15) - (16)].i); + long filling = (yyvsp[(16) - (16)].i); + if (fg == INVALID_TYPE || fg >= MAX_TYPE) + lc_error("INIT_MAP: Invalid foreground type."); + if (bg == INVALID_TYPE || bg >= MAX_TYPE) + lc_error("INIT_MAP: Invalid background type."); + if (joined && fg != CORR && fg != ROOM) + lc_error("INIT_MAP: Invalid foreground type for joined map."); + + if (filling == INVALID_TYPE) + lc_error("INIT_MAP: Invalid fill char type."); + + add_opvars(splev, "iiiiiiiio", LVLINIT_MINES,filling,walled,lit, joined,smoothed,bg,fg, SPO_INITLEVEL); max_x_map = COLNO-1; max_y_map = ROWNO; } -break; -case 83: -{ - tmppart[npart] = New(mazepart); - tmppart[npart]->halign = yyvsp[-1].i % 10; - tmppart[npart]->valign = yyvsp[-1].i / 10; - tmppart[npart]->nrobjects = 0; - tmppart[npart]->nloc = 0; - tmppart[npart]->nrmonst = 0; - scan_map(yyvsp[0].map); - Free(yyvsp[0].map); - } -break; -case 84: -{ - yyval.i = yyvsp[-2].i + (yyvsp[0].i * 10); - } -break; -case 91: -{ - if (tmppart[npart]->nrobjects) { - yyerror("Object registers already initialized!"); - } else { - tmppart[npart]->robjects = (char *)alloc(n_olist); - (void) memcpy((genericptr_t)tmppart[npart]->robjects, - (genericptr_t)olist, n_olist); - tmppart[npart]->nrobjects = n_olist; - } - } -break; -case 92: -{ - if (tmppart[npart]->nloc) { - yyerror("Location registers already initialized!"); - } else { - register int i; - tmppart[npart]->rloc_x = (char *) alloc(n_plist); - tmppart[npart]->rloc_y = (char *) alloc(n_plist); - for(i=0;irloc_x[i] = plist[i].x; - tmppart[npart]->rloc_y[i] = plist[i].y; - } - tmppart[npart]->nloc = n_plist; - } - } -break; -case 93: -{ - if (tmppart[npart]->nrmonst) { - yyerror("Monster registers already initialized!"); - } else { - tmppart[npart]->rmonst = (char *) alloc(n_mlist); - (void) memcpy((genericptr_t)tmppart[npart]->rmonst, - (genericptr_t)mlist, n_mlist); - tmppart[npart]->nrmonst = n_mlist; - } - } -break; -case 94: -{ - if (n_olist < MAX_REGISTERS) - olist[n_olist++] = yyvsp[0].i; - else - yyerror("Object list too long!"); - } -break; -case 95: -{ - if (n_olist < MAX_REGISTERS) - olist[n_olist++] = yyvsp[-2].i; - else - yyerror("Object list too long!"); - } -break; -case 96: -{ - if (n_mlist < MAX_REGISTERS) - mlist[n_mlist++] = yyvsp[0].i; - else - yyerror("Monster list too long!"); - } -break; -case 97: -{ - if (n_mlist < MAX_REGISTERS) - mlist[n_mlist++] = yyvsp[-2].i; - else - yyerror("Monster list too long!"); - } -break; -case 98: -{ - if (n_plist < MAX_REGISTERS) - plist[n_plist++] = current_coord; - else - yyerror("Location list too long!"); - } -break; -case 99: -{ - if (n_plist < MAX_REGISTERS) - plist[n_plist++] = current_coord; - else - yyerror("Location list too long!"); - } -break; -case 123: -{ - tmpmonst[nmons] = New(monster); - tmpmonst[nmons]->x = current_coord.x; - tmpmonst[nmons]->y = current_coord.y; - tmpmonst[nmons]->class = yyvsp[-4].i; - tmpmonst[nmons]->peaceful = -1; /* no override */ - tmpmonst[nmons]->asleep = -1; - tmpmonst[nmons]->align = - MAX_REGISTERS - 2; - tmpmonst[nmons]->name.str = 0; - tmpmonst[nmons]->appear = 0; - tmpmonst[nmons]->appear_as.str = 0; - tmpmonst[nmons]->chance = yyvsp[-6].i; - tmpmonst[nmons]->id = NON_PM; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Monster"); - if (yyvsp[-2].map) { - int token = get_monster_id(yyvsp[-2].map, (char) yyvsp[-4].i); - if (token == ERR) - yywarning( - "Invalid monster name! Making random monster."); - else - tmpmonst[nmons]->id = token; - Free(yyvsp[-2].map); - } - } -break; -case 124: -{ - if (++nmons >= MAX_OF_TYPE) { - yyerror("Too many monsters in room or mazepart!"); - nmons--; - } - } -break; -case 127: -{ - tmpmonst[nmons]->name.str = yyvsp[0].map; - } -break; -case 128: -{ - tmpmonst[nmons]->peaceful = yyvsp[0].i; - } -break; -case 129: -{ - tmpmonst[nmons]->asleep = yyvsp[0].i; - } -break; -case 130: -{ - tmpmonst[nmons]->align = yyvsp[0].i; - } -break; -case 131: -{ - tmpmonst[nmons]->appear = yyvsp[-1].i; - tmpmonst[nmons]->appear_as.str = yyvsp[0].map; - } -break; -case 132: -{ - } -break; -case 133: -{ - /* 1: is contents of preceeding object with 2 */ - /* 2: is a container */ - /* 0: neither */ - tmpobj[nobj-1]->containment = 2; - } -break; -case 134: -{ - tmpobj[nobj] = New(object); - tmpobj[nobj]->class = yyvsp[-2].i; - tmpobj[nobj]->corpsenm = NON_PM; - tmpobj[nobj]->curse_state = -1; - tmpobj[nobj]->name.str = 0; - tmpobj[nobj]->chance = yyvsp[-4].i; - tmpobj[nobj]->id = -1; - if (yyvsp[0].map) { - int token = get_object_id(yyvsp[0].map, yyvsp[-2].i); - if (token == ERR) - yywarning( - "Illegal object name! Making random object."); - else - tmpobj[nobj]->id = token; - Free(yyvsp[0].map); - } - } -break; -case 135: -{ - if (++nobj >= MAX_OF_TYPE) { - yyerror("Too many objects in room or mazepart!"); - nobj--; - } - } -break; -case 136: -{ - tmpobj[nobj]->containment = 0; - tmpobj[nobj]->x = current_coord.x; - tmpobj[nobj]->y = current_coord.y; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Object"); - } -break; -case 137: -{ - tmpobj[nobj]->containment = 1; - /* random coordinate, will be overridden anyway */ - tmpobj[nobj]->x = -MAX_REGISTERS-1; - tmpobj[nobj]->y = -MAX_REGISTERS-1; - } -break; -case 138: -{ - tmpobj[nobj]->spe = -127; - /* Note below: we're trying to make as many of these optional as - * possible. We clearly can't make curse_state, enchantment, and - * monster_id _all_ optional, since ",random" would be ambiguous. - * We can't even just make enchantment mandatory, since if we do that - * alone, ",random" requires too much lookahead to parse. - */ - } -break; -case 139: -{ - } -break; -case 140: -{ - } -break; -case 141: -{ - } -break; -case 142: -{ - tmpobj[nobj]->curse_state = -1; - } -break; -case 143: -{ - tmpobj[nobj]->curse_state = yyvsp[0].i; - } -break; -case 144: -{ - int token = get_monster_id(yyvsp[0].map, (char)0); - if (token == ERR) /* "random" */ - tmpobj[nobj]->corpsenm = NON_PM - 1; - else - tmpobj[nobj]->corpsenm = token; - Free(yyvsp[0].map); - } -break; -case 145: -{ - tmpobj[nobj]->spe = -127; - } -break; -case 146: -{ - tmpobj[nobj]->spe = yyvsp[0].i; - } -break; -case 148: -{ - } -break; -case 149: -{ - tmpobj[nobj]->name.str = yyvsp[0].map; - } -break; -case 150: -{ - tmpdoor[ndoor] = New(door); - tmpdoor[ndoor]->x = current_coord.x; - tmpdoor[ndoor]->y = current_coord.y; - tmpdoor[ndoor]->mask = yyvsp[-2].i; - if(current_coord.x >= 0 && current_coord.y >= 0 && - tmpmap[current_coord.y][current_coord.x] != DOOR && - tmpmap[current_coord.y][current_coord.x] != SDOOR) - yyerror("Door decl doesn't match the map"); - ndoor++; - if (ndoor >= MAX_OF_TYPE) { - yyerror("Too many doors in mazepart!"); - ndoor--; - } - } -break; -case 151: -{ - tmptrap[ntrap] = New(trap); - tmptrap[ntrap]->x = current_coord.x; - tmptrap[ntrap]->y = current_coord.y; - tmptrap[ntrap]->type = yyvsp[-2].i; - tmptrap[ntrap]->chance = yyvsp[-4].i; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Trap"); - if (++ntrap >= MAX_OF_TYPE) { - yyerror("Too many traps in room or mazepart!"); - ntrap--; - } - } -break; -case 152: -{ - int x, y, dir; + break; - tmpdb[ndb] = New(drawbridge); - x = tmpdb[ndb]->x = current_coord.x; - y = tmpdb[ndb]->y = current_coord.y; - /* convert dir from a DIRECTION to a DB_DIR */ - dir = yyvsp[-2].i; - switch(dir) { - case W_NORTH: dir = DB_NORTH; y--; break; - case W_SOUTH: dir = DB_SOUTH; y++; break; - case W_EAST: dir = DB_EAST; x++; break; - case W_WEST: dir = DB_WEST; x--; break; - default: - yyerror("Invalid drawbridge direction"); - break; - } - tmpdb[ndb]->dir = dir; - if (current_coord.x >= 0 && current_coord.y >= 0 && - !IS_WALL(tmpmap[y][x])) { - char ebuf[60]; - Sprintf(ebuf, - "Wall needed for drawbridge (%02d, %02d)", - current_coord.x, current_coord.y); - yyerror(ebuf); - } + case 15: - if ( yyvsp[0].i == D_ISOPEN ) - tmpdb[ndb]->db_open = 1; - else if ( yyvsp[0].i == D_CLOSED ) - tmpdb[ndb]->db_open = 0; - else if (yyvsp[0].i == -1) /* RANDOM_TYPE */ - tmpdb[ndb]->db_open = 127; /* random */ - else - yyerror("A drawbridge can only be open, closed, or random!"); - ndb++; - if (ndb >= MAX_OF_TYPE) { - yyerror("Too many drawbridges in mazepart!"); - ndb--; +/* Line 1455 of yacc.c */ +#line 382 "lev_comp.y" + { + (yyval.i) = 0; + } + break; + + case 16: + +/* Line 1455 of yacc.c */ +#line 386 "lev_comp.y" + { + (yyval.i) = (yyvsp[(2) - (2)].i); + } + break; + + case 17: + +/* Line 1455 of yacc.c */ +#line 392 "lev_comp.y" + { + add_opvars(splev, "o", SPO_COPY); + (yyval.i) = 0; + } + break; + + case 18: + +/* Line 1455 of yacc.c */ +#line 397 "lev_comp.y" + { + (yyval.i) = 1; + } + break; + + case 19: + +/* Line 1455 of yacc.c */ +#line 403 "lev_comp.y" + { + (yyval.i) = -1; + } + break; + + case 20: + +/* Line 1455 of yacc.c */ +#line 407 "lev_comp.y" + { + (yyval.i) = what_map_char((char) (yyvsp[(2) - (2)].i)); + } + break; + + case 23: + +/* Line 1455 of yacc.c */ +#line 418 "lev_comp.y" + { + add_opvars(splev, "io", 0, SPO_LEVEL_FLAGS); + } + break; + + case 24: + +/* Line 1455 of yacc.c */ +#line 422 "lev_comp.y" + { + add_opvars(splev, "io", (yyvsp[(3) - (3)].i), SPO_LEVEL_FLAGS); + } + break; + + case 25: + +/* Line 1455 of yacc.c */ +#line 428 "lev_comp.y" + { + (yyval.i) = ((yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i)); + } + break; + + case 26: + +/* Line 1455 of yacc.c */ +#line 432 "lev_comp.y" + { + (yyval.i) = (yyvsp[(1) - (1)].i); + } + break; + + case 27: + +/* Line 1455 of yacc.c */ +#line 438 "lev_comp.y" + { + (yyval.i) = 0; + } + break; + + case 28: + +/* Line 1455 of yacc.c */ +#line 442 "lev_comp.y" + { + (yyval.i) = 1 + (yyvsp[(2) - (2)].i); + } + break; + + case 29: + +/* Line 1455 of yacc.c */ +#line 448 "lev_comp.y" + { + (yyval.i) = (yyvsp[(2) - (3)].i); + } + break; + + case 97: + +/* Line 1455 of yacc.c */ +#line 531 "lev_comp.y" + { + struct lc_vardefs *vd; + if ((vd = vardef_defined(variable_definitions, (yyvsp[(3) - (3)].map), 1))) { + if (!(vd->var_type & SPOVAR_ARRAY)) + lc_error("Trying to shuffle non-array variable '%s'", (yyvsp[(3) - (3)].map)); + } else lc_error("Trying to shuffle undefined variable '%s'", (yyvsp[(3) - (3)].map)); + add_opvars(splev, "so", (yyvsp[(3) - (3)].map), SPO_SHUFFLE_ARRAY); + Free((yyvsp[(3) - (3)].map)); + } + break; + + case 98: + +/* Line 1455 of yacc.c */ +#line 543 "lev_comp.y" + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), SPOVAR_INT); + add_opvars(splev, "iso", 0, (yyvsp[(1) - (3)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (3)].map)); + } + break; + + case 99: + +/* Line 1455 of yacc.c */ +#line 549 "lev_comp.y" + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_SEL); + add_opvars(splev, "iso", 0, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (5)].map)); + } + break; + + case 100: + +/* Line 1455 of yacc.c */ +#line 555 "lev_comp.y" + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), SPOVAR_STRING); + add_opvars(splev, "iso", 0, (yyvsp[(1) - (3)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (3)].map)); + } + break; + + case 101: + +/* Line 1455 of yacc.c */ +#line 561 "lev_comp.y" + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_MAPCHAR); + add_opvars(splev, "iso", 0, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (5)].map)); + } + break; + + case 102: + +/* Line 1455 of yacc.c */ +#line 567 "lev_comp.y" + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_MONST); + add_opvars(splev, "iso", 0, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (5)].map)); + } + break; + + case 103: + +/* Line 1455 of yacc.c */ +#line 573 "lev_comp.y" + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_OBJ); + add_opvars(splev, "iso", 0, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (5)].map)); + } + break; + + case 104: + +/* Line 1455 of yacc.c */ +#line 579 "lev_comp.y" + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), SPOVAR_COORD); + add_opvars(splev, "iso", 0, (yyvsp[(1) - (3)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (3)].map)); + } + break; + + case 105: + +/* Line 1455 of yacc.c */ +#line 585 "lev_comp.y" + { + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), SPOVAR_REGION); + add_opvars(splev, "iso", 0, (yyvsp[(1) - (3)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (3)].map)); + } + break; + + case 106: + +/* Line 1455 of yacc.c */ +#line 591 "lev_comp.y" + { + long n_items = (yyvsp[(4) - (5)].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_INT|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (5)].map)); + } + break; + + case 107: + +/* Line 1455 of yacc.c */ +#line 598 "lev_comp.y" + { + long n_items = (yyvsp[(4) - (5)].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_COORD|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (5)].map)); + } + break; + + case 108: + +/* Line 1455 of yacc.c */ +#line 605 "lev_comp.y" + { + long n_items = (yyvsp[(4) - (5)].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_REGION|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (5)].map)); + } + break; + + case 109: + +/* Line 1455 of yacc.c */ +#line 612 "lev_comp.y" + { + long n_items = (yyvsp[(6) - (7)].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (7)].map), SPOVAR_MAPCHAR|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[(1) - (7)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (7)].map)); + } + break; + + case 110: + +/* Line 1455 of yacc.c */ +#line 619 "lev_comp.y" + { + long n_items = (yyvsp[(6) - (7)].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (7)].map), SPOVAR_MONST|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[(1) - (7)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (7)].map)); + } + break; + + case 111: + +/* Line 1455 of yacc.c */ +#line 626 "lev_comp.y" + { + long n_items = (yyvsp[(6) - (7)].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (7)].map), SPOVAR_OBJ|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[(1) - (7)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (7)].map)); + } + break; + + case 112: + +/* Line 1455 of yacc.c */ +#line 633 "lev_comp.y" + { + long n_items = (yyvsp[(4) - (5)].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_STRING|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); + Free((yyvsp[(1) - (5)].map)); + } + break; + + case 113: + +/* Line 1455 of yacc.c */ +#line 642 "lev_comp.y" + { + add_opvars(splev, "O", (yyvsp[(1) - (1)].i)); + (yyval.i) = 1; + } + break; + + case 114: + +/* Line 1455 of yacc.c */ +#line 647 "lev_comp.y" + { + add_opvars(splev, "O", (yyvsp[(3) - (3)].i)); + (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + } + break; + + case 115: + +/* Line 1455 of yacc.c */ +#line 654 "lev_comp.y" + { + add_opvars(splev, "M", (yyvsp[(1) - (1)].i)); + (yyval.i) = 1; + } + break; + + case 116: + +/* Line 1455 of yacc.c */ +#line 659 "lev_comp.y" + { + add_opvars(splev, "M", (yyvsp[(3) - (3)].i)); + (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + } + break; + + case 117: + +/* Line 1455 of yacc.c */ +#line 666 "lev_comp.y" + { + add_opvars(splev, "m", (yyvsp[(1) - (1)].i)); + (yyval.i) = 1; + } + break; + + case 118: + +/* Line 1455 of yacc.c */ +#line 671 "lev_comp.y" + { + add_opvars(splev, "m", (yyvsp[(3) - (3)].i)); + (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + } + break; + + case 119: + +/* Line 1455 of yacc.c */ +#line 678 "lev_comp.y" + { + (yyval.i) = 1; + } + break; + + case 120: + +/* Line 1455 of yacc.c */ +#line 682 "lev_comp.y" + { + (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + } + break; + + case 121: + +/* Line 1455 of yacc.c */ +#line 688 "lev_comp.y" + { + add_opvars(splev, "c", (yyvsp[(1) - (1)].i)); + (yyval.i) = 1; + } + break; + + case 122: + +/* Line 1455 of yacc.c */ +#line 693 "lev_comp.y" + { + add_opvars(splev, "c", (yyvsp[(3) - (3)].i)); + (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + } + break; + + case 123: + +/* Line 1455 of yacc.c */ +#line 700 "lev_comp.y" + { + (yyval.i) = 1; + } + break; + + case 124: + +/* Line 1455 of yacc.c */ +#line 704 "lev_comp.y" + { + (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + } + break; + + case 125: + +/* Line 1455 of yacc.c */ +#line 710 "lev_comp.y" + { + (yyval.i) = 1; + } + break; + + case 126: + +/* Line 1455 of yacc.c */ +#line 714 "lev_comp.y" + { + (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + } + break; + + case 127: + +/* Line 1455 of yacc.c */ +#line 720 "lev_comp.y" + { + struct lc_funcdefs *funcdef; + + if (in_function_definition) + lc_error("Recursively defined functions not allowed (function %s).", (yyvsp[(2) - (3)].map)); + + in_function_definition++; + + if (funcdef_defined(function_definitions, (yyvsp[(2) - (3)].map), 1)) + lc_error("Function '%s' already defined once.", (yyvsp[(2) - (3)].map)); + + funcdef = funcdef_new(-1, (yyvsp[(2) - (3)].map)); + funcdef->next = function_definitions; + function_definitions = funcdef; + function_splev_backup = splev; + splev = &(funcdef->code); + Free((yyvsp[(2) - (3)].map)); + curr_function = funcdef; + function_tmp_var_defs = variable_definitions; + variable_definitions = NULL; + } + break; + + case 128: + +/* Line 1455 of yacc.c */ +#line 742 "lev_comp.y" + { + /* nothing */ + } + break; + + case 129: + +/* Line 1455 of yacc.c */ +#line 746 "lev_comp.y" + { + add_opvars(splev, "io", 0, SPO_RETURN); + splev = function_splev_backup; + in_function_definition--; + curr_function = NULL; + vardef_free_all(variable_definitions); + variable_definitions = function_tmp_var_defs; + } + break; + + case 130: + +/* Line 1455 of yacc.c */ +#line 757 "lev_comp.y" + { + struct lc_funcdefs *tmpfunc; + tmpfunc = funcdef_defined(function_definitions, (yyvsp[(1) - (4)].map), 1); + if (tmpfunc) { + long l; + long nparams = strlen( (yyvsp[(3) - (4)].map) ); + char *fparamstr = funcdef_paramtypes(tmpfunc); + if (strcmp((yyvsp[(3) - (4)].map), fparamstr)) { + char *tmps = strdup(decode_parm_str(fparamstr)); + lc_error("Function '%s' requires params '%s', got '%s' instead.", (yyvsp[(1) - (4)].map), tmps, decode_parm_str((yyvsp[(3) - (4)].map))); + Free(tmps); + } + Free(fparamstr); + Free((yyvsp[(3) - (4)].map)); + if (!(tmpfunc->n_called)) { + /* we haven't called the function yet, so insert it in the code */ + struct opvar *jmp = New(struct opvar); + set_opvar_int(jmp, splev->n_opcodes+1); + add_opcode(splev, SPO_PUSH, jmp); + add_opcode(splev, SPO_JMP, NULL); /* we must jump past it first, then CALL it, due to RETURN. */ + + tmpfunc->addr = splev->n_opcodes; + + { /* init function parameter variables */ + struct lc_funcdefs_parm *tfp = tmpfunc->params; + while (tfp) { + add_opvars(splev, "iso", 0, tfp->name, SPO_VAR_INIT); + tfp = tfp->next; + } + } + + splev_add_from(splev, &(tmpfunc->code)); + set_opvar_int(jmp, splev->n_opcodes - jmp->vardata.l); + } + l = tmpfunc->addr - splev->n_opcodes - 2; + add_opvars(splev, "iio", nparams, l, SPO_CALL); + tmpfunc->n_called++; + } else { + lc_error("Function '%s' not defined.", (yyvsp[(1) - (4)].map)); + } + Free((yyvsp[(1) - (4)].map)); + } + break; + + case 131: + +/* Line 1455 of yacc.c */ +#line 802 "lev_comp.y" + { + add_opcode(splev, SPO_EXIT, NULL); + } + break; + + case 132: + +/* Line 1455 of yacc.c */ +#line 808 "lev_comp.y" + { + (yyval.i) = 100; + } + break; + + case 133: + +/* Line 1455 of yacc.c */ +#line 812 "lev_comp.y" + { + (yyval.i) = (yyvsp[(1) - (1)].i); + } + break; + + case 134: + +/* Line 1455 of yacc.c */ +#line 818 "lev_comp.y" + { + /* val > rn2(100) */ + add_opvars(splev, "iio", (long)(yyvsp[(1) - (1)].i), 100, SPO_RN2); + (yyval.i) = SPO_JG; + } + break; + + case 135: + +/* Line 1455 of yacc.c */ +#line 824 "lev_comp.y" + { + (yyval.i) = (yyvsp[(3) - (5)].i); + } + break; + + case 136: + +/* Line 1455 of yacc.c */ +#line 828 "lev_comp.y" + { + /* boolean, explicit foo != 0 */ + add_opvars(splev, "i", 0); + (yyval.i) = SPO_JNE; + } + break; + + case 137: + +/* Line 1455 of yacc.c */ +#line 836 "lev_comp.y" + { + is_inconstant_number = 0; + } + break; + + case 138: + +/* Line 1455 of yacc.c */ +#line 840 "lev_comp.y" + { + struct opvar *chkjmp; + if (in_switch_statement > 0) + lc_error("Cannot nest switch-statements."); + + in_switch_statement++; + + n_switch_case_list = 0; + switch_default_case = NULL; + + if (!is_inconstant_number) + add_opvars(splev, "o", SPO_RN2); + is_inconstant_number = 0; + + chkjmp = New(struct opvar); + set_opvar_int(chkjmp, splev->n_opcodes+1); + switch_check_jump = chkjmp; + add_opcode(splev, SPO_PUSH, chkjmp); + add_opcode(splev, SPO_JMP, NULL); + break_stmt_start(); + } + break; + + case 139: + +/* Line 1455 of yacc.c */ +#line 862 "lev_comp.y" + { + struct opvar *endjump = New(struct opvar); + int i; + + set_opvar_int(endjump, splev->n_opcodes+1); + + add_opcode(splev, SPO_PUSH, endjump); + add_opcode(splev, SPO_JMP, NULL); + + set_opvar_int(switch_check_jump, splev->n_opcodes - switch_check_jump->vardata.l); + + for (i = 0; i < n_switch_case_list; i++) { + add_opvars(splev, "oio", SPO_COPY, switch_case_value[i], SPO_CMP); + set_opvar_int(switch_case_list[i], switch_case_list[i]->vardata.l - splev->n_opcodes-1); + add_opcode(splev, SPO_PUSH, switch_case_list[i]); + add_opcode(splev, SPO_JE, NULL); + } + + if (switch_default_case) { + set_opvar_int(switch_default_case, switch_default_case->vardata.l - splev->n_opcodes-1); + add_opcode(splev, SPO_PUSH, switch_default_case); + add_opcode(splev, SPO_JMP, NULL); + } + + set_opvar_int(endjump, splev->n_opcodes - endjump->vardata.l); + + break_stmt_end(splev); + + add_opcode(splev, SPO_POP, NULL); /* get rid of the value in stack */ + in_switch_statement--; + + + } + break; + + case 142: + +/* Line 1455 of yacc.c */ +#line 902 "lev_comp.y" + { + if (n_switch_case_list < MAX_SWITCH_CASES) { + struct opvar *tmppush = New(struct opvar); + set_opvar_int(tmppush, splev->n_opcodes); + switch_case_value[n_switch_case_list] = (yyvsp[(2) - (3)].i); + switch_case_list[n_switch_case_list++] = tmppush; + } else lc_error("Too many cases in a switch."); + } + break; + + case 143: + +/* Line 1455 of yacc.c */ +#line 911 "lev_comp.y" + { + } + break; + + case 144: + +/* Line 1455 of yacc.c */ +#line 914 "lev_comp.y" + { + struct opvar *tmppush = New(struct opvar); + + if (switch_default_case) + lc_error("Switch default case already used."); + + set_opvar_int(tmppush, splev->n_opcodes); + switch_default_case = tmppush; + } + break; + + case 145: + +/* Line 1455 of yacc.c */ +#line 924 "lev_comp.y" + { + } + break; + + case 146: + +/* Line 1455 of yacc.c */ +#line 929 "lev_comp.y" + { + if (!allow_break_statements) + lc_error("Cannot use BREAK outside a statement block."); + else { + break_stmt_new(splev, splev->n_opcodes); + } + } + break; + + case 149: + +/* Line 1455 of yacc.c */ +#line 943 "lev_comp.y" + { + char buf[256], buf2[256]; + + if (n_forloops >= MAX_NESTED_IFS) { + lc_error("FOR: Too deeply nested loops."); + n_forloops = MAX_NESTED_IFS - 1; + } + + /* first, define a variable for the for-loop end value */ + snprintf(buf, 255, "%s end", (yyvsp[(2) - (6)].map)); + /* the value of which is already in stack (the 2nd math_expr) */ + add_opvars(splev, "iso", 0, buf, SPO_VAR_INIT); + + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(2) - (6)].map), SPOVAR_INT); + /* define the for-loop variable. value is in stack (1st math_expr) */ + add_opvars(splev, "iso", 0, (yyvsp[(2) - (6)].map), SPO_VAR_INIT); + + /* calculate value for the loop "step" variable */ + snprintf(buf2, 255, "%s step", (yyvsp[(2) - (6)].map)); + add_opvars(splev, "vvo", buf, (yyvsp[(2) - (6)].map), SPO_MATH_SUB); /* end - start */ + add_opvars(splev, "o", SPO_MATH_SIGN); /* sign of that */ + add_opvars(splev, "iso", 0, buf2, SPO_VAR_INIT); /* save the sign into the step var */ + + forloop_list[n_forloops].varname = strdup((yyvsp[(2) - (6)].map)); + forloop_list[n_forloops].jmp_point = splev->n_opcodes; + + n_forloops++; + Free((yyvsp[(2) - (6)].map)); + } + break; + + case 150: + +/* Line 1455 of yacc.c */ +#line 975 "lev_comp.y" + { + /* nothing */ + break_stmt_start(); + } + break; + + case 151: + +/* Line 1455 of yacc.c */ +#line 980 "lev_comp.y" + { + char buf[256], buf2[256]; + n_forloops--; + snprintf(buf, 255, "%s step", forloop_list[n_forloops].varname); + snprintf(buf2, 255, "%s end", forloop_list[n_forloops].varname); + /* compare for-loop var to end value */ + add_opvars(splev, "vvo", forloop_list[n_forloops].varname, buf2, SPO_CMP); + /* var + step */ + add_opvars(splev, "vvo", buf, + forloop_list[n_forloops].varname, SPO_MATH_ADD); + /* for-loop var = (for-loop var + step) */ + add_opvars(splev, "iso", 0, forloop_list[n_forloops].varname, SPO_VAR_INIT); + /* jump back if compared values were not equal */ + add_opvars(splev, "io", forloop_list[n_forloops].jmp_point - splev->n_opcodes - 1, SPO_JNE); + Free(forloop_list[n_forloops].varname); + break_stmt_end(splev); + } + break; + + case 152: + +/* Line 1455 of yacc.c */ +#line 1000 "lev_comp.y" + { + struct opvar *tmppush = New(struct opvar); + + if (n_if_list >= MAX_NESTED_IFS) { + lc_error("LOOP: Too deeply nested conditionals."); + n_if_list = MAX_NESTED_IFS - 1; + } + set_opvar_int(tmppush, splev->n_opcodes); + if_list[n_if_list++] = tmppush; + + add_opvars(splev, "o", SPO_DEC); + break_stmt_start(); + } + break; + + case 153: + +/* Line 1455 of yacc.c */ +#line 1014 "lev_comp.y" + { + struct opvar *tmppush; + + add_opvars(splev, "oio", SPO_COPY, 0, SPO_CMP); + + tmppush = (struct opvar *) if_list[--n_if_list]; + set_opvar_int(tmppush, tmppush->vardata.l - splev->n_opcodes-1); + add_opcode(splev, SPO_PUSH, tmppush); + add_opcode(splev, SPO_JG, NULL); + add_opcode(splev, SPO_POP, NULL); /* get rid of the count value in stack */ + break_stmt_end(splev); + } + break; + + case 154: + +/* Line 1455 of yacc.c */ +#line 1029 "lev_comp.y" + { + struct opvar *tmppush2 = New(struct opvar); + + if (n_if_list >= MAX_NESTED_IFS) { + lc_error("IF: Too deeply nested conditionals."); + n_if_list = MAX_NESTED_IFS - 1; + } + + add_opcode(splev, SPO_CMP, NULL); + + set_opvar_int(tmppush2, splev->n_opcodes+1); + + if_list[n_if_list++] = tmppush2; + + add_opcode(splev, SPO_PUSH, tmppush2); + + add_opcode(splev, reverse_jmp_opcode( (yyvsp[(1) - (2)].i) ), NULL); + + } + break; + + case 155: + +/* Line 1455 of yacc.c */ +#line 1049 "lev_comp.y" + { + if (n_if_list > 0) { + struct opvar *tmppush; + tmppush = (struct opvar *) if_list[--n_if_list]; + set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); + } else lc_error("IF: Huh?! No start address?"); + } + break; + + case 156: + +/* Line 1455 of yacc.c */ +#line 1059 "lev_comp.y" + { + struct opvar *tmppush2 = New(struct opvar); + + if (n_if_list >= MAX_NESTED_IFS) { + lc_error("IF: Too deeply nested conditionals."); + n_if_list = MAX_NESTED_IFS - 1; + } + + add_opcode(splev, SPO_CMP, NULL); + + set_opvar_int(tmppush2, splev->n_opcodes+1); + + if_list[n_if_list++] = tmppush2; + + add_opcode(splev, SPO_PUSH, tmppush2); + + add_opcode(splev, reverse_jmp_opcode( (yyvsp[(2) - (2)].i) ), NULL); + + } + break; + + case 157: + +/* Line 1455 of yacc.c */ +#line 1079 "lev_comp.y" + { + /* do nothing */ + } + break; + + case 158: + +/* Line 1455 of yacc.c */ +#line 1085 "lev_comp.y" + { + if (n_if_list > 0) { + struct opvar *tmppush; + tmppush = (struct opvar *) if_list[--n_if_list]; + set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); + } else lc_error("IF: Huh?! No start address?"); + } + break; + + case 159: + +/* Line 1455 of yacc.c */ +#line 1093 "lev_comp.y" + { + if (n_if_list > 0) { + struct opvar *tmppush = New(struct opvar); + struct opvar *tmppush2; + + set_opvar_int(tmppush, splev->n_opcodes+1); + add_opcode(splev, SPO_PUSH, tmppush); + + add_opcode(splev, SPO_JMP, NULL); + + tmppush2 = (struct opvar *) if_list[--n_if_list]; + + set_opvar_int(tmppush2, splev->n_opcodes - tmppush2->vardata.l); + if_list[n_if_list++] = tmppush; + } else lc_error("IF: Huh?! No else-part address?"); + } + break; + + case 160: + +/* Line 1455 of yacc.c */ +#line 1110 "lev_comp.y" + { + if (n_if_list > 0) { + struct opvar *tmppush; + tmppush = (struct opvar *) if_list[--n_if_list]; + set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); + } else lc_error("IF: Huh?! No end address?"); + } + break; + + case 161: + +/* Line 1455 of yacc.c */ +#line 1120 "lev_comp.y" + { + add_opvars(splev, "o", SPO_MESSAGE); + } + break; + + case 162: + +/* Line 1455 of yacc.c */ +#line 1126 "lev_comp.y" + { + add_opvars(splev, "iiiiiio", -1, 0, -1, -1, -1, -1, SPO_CORRIDOR); + } + break; + + case 163: + +/* Line 1455 of yacc.c */ +#line 1130 "lev_comp.y" + { + add_opvars(splev, "iiiiiio", -1, (yyvsp[(3) - (3)].i), -1, -1, -1, -1, SPO_CORRIDOR); + } + break; + + case 164: + +/* Line 1455 of yacc.c */ +#line 1134 "lev_comp.y" + { + add_opvars(splev, "iiiiiio", -1, -1, -1, -1, -1, -1, SPO_CORRIDOR); + } + break; + + case 165: + +/* Line 1455 of yacc.c */ +#line 1140 "lev_comp.y" + { + add_opvars(splev, "iiiiiio", + (yyvsp[(3) - (5)].corpos).room, (yyvsp[(3) - (5)].corpos).door, (yyvsp[(3) - (5)].corpos).wall, + (yyvsp[(5) - (5)].corpos).room, (yyvsp[(5) - (5)].corpos).door, (yyvsp[(5) - (5)].corpos).wall, + SPO_CORRIDOR); + } + break; + + case 166: + +/* Line 1455 of yacc.c */ +#line 1147 "lev_comp.y" + { + add_opvars(splev, "iiiiiio", + (yyvsp[(3) - (5)].corpos).room, (yyvsp[(3) - (5)].corpos).door, (yyvsp[(3) - (5)].corpos).wall, + -1, -1, (long)(yyvsp[(5) - (5)].i), + SPO_CORRIDOR); + } + break; + + case 167: + +/* Line 1455 of yacc.c */ +#line 1156 "lev_comp.y" + { + (yyval.corpos).room = (yyvsp[(2) - (7)].i); + (yyval.corpos).wall = (yyvsp[(4) - (7)].i); + (yyval.corpos).door = (yyvsp[(6) - (7)].i); + } + break; + + case 168: + +/* Line 1455 of yacc.c */ +#line 1164 "lev_comp.y" + { + if (((yyvsp[(2) - (4)].i) < 100) && ((yyvsp[(1) - (4)].i) == OROOM)) + lc_error("Only typed rooms can have a chance."); + else { + add_opvars(splev, "iii", (long)(yyvsp[(1) - (4)].i), (long)(yyvsp[(2) - (4)].i), (long)(yyvsp[(4) - (4)].i)); + } + } + break; + + case 169: + +/* Line 1455 of yacc.c */ +#line 1174 "lev_comp.y" + { + long flags = (yyvsp[(8) - (8)].i); + if (flags == -1) flags = (1 << 0); + add_opvars(splev, "iiiiiiio", flags, ERR, ERR, + (yyvsp[(5) - (8)].crd).x, (yyvsp[(5) - (8)].crd).y, (yyvsp[(7) - (8)].sze).width, (yyvsp[(7) - (8)].sze).height, SPO_SUBROOM); + break_stmt_start(); + } + break; + + case 170: + +/* Line 1455 of yacc.c */ +#line 1182 "lev_comp.y" + { + break_stmt_end(splev); + add_opcode(splev, SPO_ENDROOM, NULL); + } + break; + + case 171: + +/* Line 1455 of yacc.c */ +#line 1189 "lev_comp.y" + { + long flags = (yyvsp[(8) - (10)].i); + if (flags == -1) flags = (1 << 0); + add_opvars(splev, "iiiiiiio", flags, + (yyvsp[(7) - (10)].crd).x, (yyvsp[(7) - (10)].crd).y, (yyvsp[(5) - (10)].crd).x, (yyvsp[(5) - (10)].crd).y, + (yyvsp[(9) - (10)].sze).width, (yyvsp[(9) - (10)].sze).height, SPO_ROOM); + break_stmt_start(); + } + break; + + case 172: + +/* Line 1455 of yacc.c */ +#line 1198 "lev_comp.y" + { + break_stmt_end(splev); + add_opcode(splev, SPO_ENDROOM, NULL); + } + break; + + case 173: + +/* Line 1455 of yacc.c */ +#line 1205 "lev_comp.y" + { + (yyval.i) = 1; + } + break; + + case 174: + +/* Line 1455 of yacc.c */ +#line 1209 "lev_comp.y" + { + (yyval.i) = (yyvsp[(2) - (2)].i); + } + break; + + case 175: + +/* Line 1455 of yacc.c */ +#line 1215 "lev_comp.y" + { + if ( (yyvsp[(2) - (5)].i) < 1 || (yyvsp[(2) - (5)].i) > 5 || + (yyvsp[(4) - (5)].i) < 1 || (yyvsp[(4) - (5)].i) > 5 ) { + lc_error("Room positions should be between 1-5: (%li,%li)!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i)); + } else { + (yyval.crd).x = (yyvsp[(2) - (5)].i); + (yyval.crd).y = (yyvsp[(4) - (5)].i); } + } + break; + + case 176: + +/* Line 1455 of yacc.c */ +#line 1225 "lev_comp.y" + { + (yyval.crd).x = (yyval.crd).y = ERR; + } + break; + + case 177: + +/* Line 1455 of yacc.c */ +#line 1231 "lev_comp.y" + { + if ( (yyvsp[(2) - (5)].i) < 0 || (yyvsp[(4) - (5)].i) < 0) { + lc_error("Invalid subroom position (%li,%li)!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i)); + } else { + (yyval.crd).x = (yyvsp[(2) - (5)].i); + (yyval.crd).y = (yyvsp[(4) - (5)].i); + } + } + break; + + case 178: + +/* Line 1455 of yacc.c */ +#line 1240 "lev_comp.y" + { + (yyval.crd).x = (yyval.crd).y = ERR; + } + break; + + case 179: + +/* Line 1455 of yacc.c */ +#line 1246 "lev_comp.y" + { + (yyval.crd).x = (yyvsp[(2) - (5)].i); + (yyval.crd).y = (yyvsp[(4) - (5)].i); + } + break; + + case 180: + +/* Line 1455 of yacc.c */ +#line 1251 "lev_comp.y" + { + (yyval.crd).x = (yyval.crd).y = ERR; + } + break; + + case 181: + +/* Line 1455 of yacc.c */ +#line 1257 "lev_comp.y" + { + (yyval.sze).width = (yyvsp[(2) - (5)].i); + (yyval.sze).height = (yyvsp[(4) - (5)].i); + } + break; + + case 182: + +/* Line 1455 of yacc.c */ +#line 1262 "lev_comp.y" + { + (yyval.sze).height = (yyval.sze).width = ERR; + } + break; + + case 183: + +/* Line 1455 of yacc.c */ +#line 1268 "lev_comp.y" + { + /* ERR means random here */ + if ((yyvsp[(7) - (9)].i) == ERR && (yyvsp[(9) - (9)].i) != ERR) { + lc_error("If the door wall is random, so must be its pos!"); + } else { + add_opvars(splev, "iiiio", (long)(yyvsp[(9) - (9)].i), (long)(yyvsp[(5) - (9)].i), (long)(yyvsp[(3) - (9)].i), (long)(yyvsp[(7) - (9)].i), SPO_ROOM_DOOR); + } + } + break; + + case 184: + +/* Line 1455 of yacc.c */ +#line 1277 "lev_comp.y" + { + add_opvars(splev, "io", (long)(yyvsp[(3) - (5)].i), SPO_DOOR); + } + break; + + case 189: + +/* Line 1455 of yacc.c */ +#line 1291 "lev_comp.y" + { + (yyval.i) = (yyvsp[(1) - (1)].i); + } + break; + + case 190: + +/* Line 1455 of yacc.c */ +#line 1295 "lev_comp.y" + { + (yyval.i) = ((yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i)); + } + break; + + case 193: + +/* Line 1455 of yacc.c */ +#line 1305 "lev_comp.y" + { + add_opvars(splev, "ciisiio", 0, 0, 1, (char *)0, 0, 0, SPO_MAP); + max_x_map = COLNO-1; + max_y_map = ROWNO; + } + break; + + case 194: + +/* Line 1455 of yacc.c */ +#line 1311 "lev_comp.y" + { + add_opvars(splev, "cii", SP_COORD_PACK(((yyvsp[(3) - (7)].i)),((yyvsp[(5) - (7)].i))), 1, (long)(yyvsp[(6) - (7)].i)); + scan_map((yyvsp[(7) - (7)].map), splev); + Free((yyvsp[(7) - (7)].map)); + } + break; + + case 195: + +/* Line 1455 of yacc.c */ +#line 1317 "lev_comp.y" + { + add_opvars(splev, "ii", 2, (long)(yyvsp[(4) - (5)].i)); + scan_map((yyvsp[(5) - (5)].map), splev); + Free((yyvsp[(5) - (5)].map)); + } + break; + + case 200: + +/* Line 1455 of yacc.c */ +#line 1333 "lev_comp.y" + { + add_opvars(splev, "io", 0, SPO_MONSTER); + } + break; + + case 201: + +/* Line 1455 of yacc.c */ +#line 1337 "lev_comp.y" + { + add_opvars(splev, "io", 1, SPO_MONSTER); + in_container_obj++; + break_stmt_start(); + } + break; + + case 202: + +/* Line 1455 of yacc.c */ +#line 1343 "lev_comp.y" + { + break_stmt_end(splev); + in_container_obj--; + add_opvars(splev, "o", SPO_END_MONINVENT); + } + break; + + case 203: + +/* Line 1455 of yacc.c */ +#line 1351 "lev_comp.y" + { + /* nothing */ + } + break; + + case 204: + +/* Line 1455 of yacc.c */ +#line 1357 "lev_comp.y" + { + struct opvar *stopit = New(struct opvar); + set_opvar_int(stopit, SP_M_V_END); + add_opcode(splev, SPO_PUSH, stopit); + (yyval.i) = 0x0000; + } + break; + + case 205: + +/* Line 1455 of yacc.c */ +#line 1364 "lev_comp.y" + { + if (( (yyvsp[(1) - (3)].i) & (yyvsp[(3) - (3)].i) )) + lc_error("MONSTER extra info defined twice."); + (yyval.i) = ( (yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i) ); + } + break; + + case 206: + +/* Line 1455 of yacc.c */ +#line 1372 "lev_comp.y" + { + add_opvars(splev, "i", SP_M_V_NAME); + (yyval.i) = 0x0001; + } + break; + + case 207: + +/* Line 1455 of yacc.c */ +#line 1377 "lev_comp.y" + { + add_opvars(splev, "ii", (long)(yyvsp[(1) - (1)].i), SP_M_V_PEACEFUL); + (yyval.i) = 0x0002; + } + break; + + case 208: + +/* Line 1455 of yacc.c */ +#line 1382 "lev_comp.y" + { + add_opvars(splev, "ii", (long)(yyvsp[(1) - (1)].i), SP_M_V_ASLEEP); + (yyval.i) = 0x0004; + } + break; + + case 209: + +/* Line 1455 of yacc.c */ +#line 1387 "lev_comp.y" + { + add_opvars(splev, "ii", (long)(yyvsp[(1) - (1)].i), SP_M_V_ALIGN); + (yyval.i) = 0x0008; + } + break; + + case 210: + +/* Line 1455 of yacc.c */ +#line 1392 "lev_comp.y" + { + add_opvars(splev, "ii", (long)(yyvsp[(1) - (2)].i), SP_M_V_APPEAR); + (yyval.i) = 0x0010; + } + break; + + case 211: + +/* Line 1455 of yacc.c */ +#line 1397 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_M_V_FEMALE); + (yyval.i) = 0x0020; + } + break; + + case 212: + +/* Line 1455 of yacc.c */ +#line 1402 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_M_V_INVIS); + (yyval.i) = 0x0040; + } + break; + + case 213: + +/* Line 1455 of yacc.c */ +#line 1407 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_M_V_CANCELLED); + (yyval.i) = 0x0080; + } + break; + + case 214: + +/* Line 1455 of yacc.c */ +#line 1412 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_M_V_REVIVED); + (yyval.i) = 0x0100; + } + break; + + case 215: + +/* Line 1455 of yacc.c */ +#line 1417 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_M_V_AVENGE); + (yyval.i) = 0x0200; + } + break; + + case 216: + +/* Line 1455 of yacc.c */ +#line 1422 "lev_comp.y" + { + add_opvars(splev, "i", SP_M_V_FLEEING); + (yyval.i) = 0x0400; + } + break; + + case 217: + +/* Line 1455 of yacc.c */ +#line 1427 "lev_comp.y" + { + add_opvars(splev, "i", SP_M_V_BLINDED); + (yyval.i) = 0x0800; + } + break; + + case 218: + +/* Line 1455 of yacc.c */ +#line 1432 "lev_comp.y" + { + add_opvars(splev, "i", SP_M_V_PARALYZED); + (yyval.i) = 0x1000; + } + break; + + case 219: + +/* Line 1455 of yacc.c */ +#line 1437 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_M_V_STUNNED); + (yyval.i) = 0x2000; + } + break; + + case 220: + +/* Line 1455 of yacc.c */ +#line 1442 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_M_V_CONFUSED); + (yyval.i) = 0x4000; + } + break; + + case 221: + +/* Line 1455 of yacc.c */ +#line 1447 "lev_comp.y" + { + add_opvars(splev, "ii", (long)(yyvsp[(3) - (3)].i), SP_M_V_SEENTRAPS); + (yyval.i) = 0x8000; + } + break; + + case 222: + +/* Line 1455 of yacc.c */ +#line 1454 "lev_comp.y" + { + int token = get_trap_type((yyvsp[(1) - (1)].map)); + if (token == ERR || token == 0) + lc_error("Unknown trap type '%s'!", (yyvsp[(1) - (1)].map)); + (yyval.i) = (1L << (token - 1)); + } + break; + + case 223: + +/* Line 1455 of yacc.c */ +#line 1461 "lev_comp.y" + { + (yyval.i) = (long) ~0; + } + break; + + case 224: + +/* Line 1455 of yacc.c */ +#line 1465 "lev_comp.y" + { + int token = get_trap_type((yyvsp[(1) - (3)].map)); + if (token == ERR || token == 0) + lc_error("Unknown trap type '%s'!", (yyvsp[(1) - (3)].map)); + + if ((1L << (token - 1)) & (yyvsp[(3) - (3)].i)) + lc_error("Monster seen_traps, trap '%s' listed twice.", (yyvsp[(1) - (3)].map)); + + (yyval.i) = ((1L << (token - 1)) | (yyvsp[(3) - (3)].i)); + } + break; + + case 225: + +/* Line 1455 of yacc.c */ +#line 1478 "lev_comp.y" + { + long cnt = 0; + if (in_container_obj) cnt |= SP_OBJ_CONTENT; + add_opvars(splev, "io", cnt, SPO_OBJECT); + } + break; + + case 226: + +/* Line 1455 of yacc.c */ +#line 1484 "lev_comp.y" + { + long cnt = SP_OBJ_CONTAINER; + if (in_container_obj) cnt |= SP_OBJ_CONTENT; + add_opvars(splev, "io", cnt, SPO_OBJECT); + in_container_obj++; + break_stmt_start(); + } + break; + + case 227: + +/* Line 1455 of yacc.c */ +#line 1492 "lev_comp.y" + { + break_stmt_end(splev); + in_container_obj--; + add_opcode(splev, SPO_POP_CONTAINER, NULL); + } + break; + + case 228: + +/* Line 1455 of yacc.c */ +#line 1500 "lev_comp.y" + { + if (( (yyvsp[(2) - (2)].i) & 0x4000) && in_container_obj) lc_error("Object cannot have a coord when contained."); + else if (!( (yyvsp[(2) - (2)].i) & 0x4000) && !in_container_obj) lc_error("Object needs a coord when not contained."); + } + break; + + case 229: + +/* Line 1455 of yacc.c */ +#line 1507 "lev_comp.y" + { + struct opvar *stopit = New(struct opvar); + set_opvar_int(stopit, SP_O_V_END); + add_opcode(splev, SPO_PUSH, stopit); + (yyval.i) = 0x00; + } + break; + + case 230: + +/* Line 1455 of yacc.c */ +#line 1514 "lev_comp.y" + { + if (( (yyvsp[(1) - (3)].i) & (yyvsp[(3) - (3)].i) )) + lc_error("OBJECT extra info '%s' defined twice.", curr_token); + (yyval.i) = ( (yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i) ); + } + break; + + case 231: + +/* Line 1455 of yacc.c */ +#line 1522 "lev_comp.y" + { + add_opvars(splev, "ii", (long)(yyvsp[(1) - (1)].i), SP_O_V_CURSE); + (yyval.i) = 0x0001; + } + break; + + case 232: + +/* Line 1455 of yacc.c */ +#line 1527 "lev_comp.y" + { + add_opvars(splev, "i", SP_O_V_CORPSENM); + (yyval.i) = 0x0002; + } + break; + + case 233: + +/* Line 1455 of yacc.c */ +#line 1532 "lev_comp.y" + { + add_opvars(splev, "i", SP_O_V_SPE); + (yyval.i) = 0x0004; + } + break; + + case 234: + +/* Line 1455 of yacc.c */ +#line 1537 "lev_comp.y" + { + add_opvars(splev, "i", SP_O_V_NAME); + (yyval.i) = 0x0008; + } + break; + + case 235: + +/* Line 1455 of yacc.c */ +#line 1542 "lev_comp.y" + { + add_opvars(splev, "i", SP_O_V_QUAN); + (yyval.i) = 0x0010; + } + break; + + case 236: + +/* Line 1455 of yacc.c */ +#line 1547 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_O_V_BURIED); + (yyval.i) = 0x0020; + } + break; + + case 237: + +/* Line 1455 of yacc.c */ +#line 1552 "lev_comp.y" + { + add_opvars(splev, "ii", (long)(yyvsp[(1) - (1)].i), SP_O_V_LIT); + (yyval.i) = 0x0040; + } + break; + + case 238: + +/* Line 1455 of yacc.c */ +#line 1557 "lev_comp.y" + { + add_opvars(splev, "i", SP_O_V_ERODED); + (yyval.i) = 0x0080; + } + break; + + case 239: + +/* Line 1455 of yacc.c */ +#line 1562 "lev_comp.y" + { + add_opvars(splev, "ii", -1, SP_O_V_ERODED); + (yyval.i) = 0x0080; + } + break; + + case 240: + +/* Line 1455 of yacc.c */ +#line 1567 "lev_comp.y" + { + if ((yyvsp[(1) - (1)].i) == D_LOCKED) { + add_opvars(splev, "ii", 1, SP_O_V_LOCKED); + (yyval.i) = 0x0100; + } else if ((yyvsp[(1) - (1)].i) == D_BROKEN) { + add_opvars(splev, "ii", 1, SP_O_V_BROKEN); + (yyval.i) = 0x0200; + } else + lc_error("OBJECT state can only be locked or broken."); + } + break; + + case 241: + +/* Line 1455 of yacc.c */ +#line 1578 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_O_V_TRAPPED); + (yyval.i) = 0x0400; + } + break; + + case 242: + +/* Line 1455 of yacc.c */ +#line 1583 "lev_comp.y" + { + add_opvars(splev, "i", SP_O_V_RECHARGED); + (yyval.i) = 0x0800; + } + break; + + case 243: + +/* Line 1455 of yacc.c */ +#line 1588 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_O_V_INVIS); + (yyval.i) = 0x1000; + } + break; + + case 244: + +/* Line 1455 of yacc.c */ +#line 1593 "lev_comp.y" + { + add_opvars(splev, "ii", 1, SP_O_V_GREASED); + (yyval.i) = 0x2000; + } + break; + + case 245: + +/* Line 1455 of yacc.c */ +#line 1598 "lev_comp.y" + { + add_opvars(splev, "i", SP_O_V_COORD); + (yyval.i) = 0x4000; + } + break; + + case 246: + +/* Line 1455 of yacc.c */ +#line 1605 "lev_comp.y" + { + add_opvars(splev, "io", (long)(yyvsp[(3) - (5)].i), SPO_TRAP); + } + break; + + case 247: + +/* Line 1455 of yacc.c */ +#line 1611 "lev_comp.y" + { + long d, state = 0; + /* convert dir from a DIRECTION to a DB_DIR */ + d = (yyvsp[(5) - (7)].i); + switch(d) { + case W_NORTH: d = DB_NORTH; break; + case W_SOUTH: d = DB_SOUTH; break; + case W_EAST: d = DB_EAST; break; + case W_WEST: d = DB_WEST; break; + default: + lc_error("Invalid drawbridge direction."); + break; + } + + if ( (yyvsp[(7) - (7)].i) == D_ISOPEN ) + state = 1; + else if ( (yyvsp[(7) - (7)].i) == D_CLOSED ) + state = 0; + else if ( (yyvsp[(7) - (7)].i) == -1 ) + state = -1; + else + lc_error("A drawbridge can only be open, closed or random!"); + add_opvars(splev, "iio", state, d, SPO_DRAWBRIDGE); } -break; -case 153: -{ - tmpwalk[nwalk] = New(walk); - tmpwalk[nwalk]->x = current_coord.x; - tmpwalk[nwalk]->y = current_coord.y; - tmpwalk[nwalk]->dir = yyvsp[0].i; - nwalk++; - if (nwalk >= MAX_OF_TYPE) { - yyerror("Too many mazewalks in mazepart!"); - nwalk--; - } - } -break; -case 154: -{ - wallify_map(); - } -break; -case 155: -{ - tmplad[nlad] = New(lad); - tmplad[nlad]->x = current_coord.x; - tmplad[nlad]->y = current_coord.y; - tmplad[nlad]->up = yyvsp[0].i; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Ladder"); - nlad++; - if (nlad >= MAX_OF_TYPE) { - yyerror("Too many ladders in mazepart!"); - nlad--; - } - } -break; -case 156: -{ - tmpstair[nstair] = New(stair); - tmpstair[nstair]->x = current_coord.x; - tmpstair[nstair]->y = current_coord.y; - tmpstair[nstair]->up = yyvsp[0].i; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Stairway"); - nstair++; - if (nstair >= MAX_OF_TYPE) { - yyerror("Too many stairs in room or mazepart!"); - nstair--; - } - } -break; -case 157: -{ - tmplreg[nlreg] = New(lev_region); - tmplreg[nlreg]->in_islev = yyvsp[0].i; - tmplreg[nlreg]->inarea.x1 = current_region.x1; - tmplreg[nlreg]->inarea.y1 = current_region.y1; - tmplreg[nlreg]->inarea.x2 = current_region.x2; - tmplreg[nlreg]->inarea.y2 = current_region.y2; - } -break; -case 158: -{ - tmplreg[nlreg]->del_islev = yyvsp[-2].i; - tmplreg[nlreg]->delarea.x1 = current_region.x1; - tmplreg[nlreg]->delarea.y1 = current_region.y1; - tmplreg[nlreg]->delarea.x2 = current_region.x2; - tmplreg[nlreg]->delarea.y2 = current_region.y2; - if(yyvsp[0].i) - tmplreg[nlreg]->rtype = LR_UPSTAIR; - else - tmplreg[nlreg]->rtype = LR_DOWNSTAIR; - tmplreg[nlreg]->rname.str = 0; - nlreg++; - if (nlreg >= MAX_OF_TYPE) { - yyerror("Too many levregions in mazepart!"); - nlreg--; - } - } -break; -case 159: -{ - tmplreg[nlreg] = New(lev_region); - tmplreg[nlreg]->in_islev = yyvsp[0].i; - tmplreg[nlreg]->inarea.x1 = current_region.x1; - tmplreg[nlreg]->inarea.y1 = current_region.y1; - tmplreg[nlreg]->inarea.x2 = current_region.x2; - tmplreg[nlreg]->inarea.y2 = current_region.y2; - } -break; -case 160: -{ - tmplreg[nlreg]->del_islev = yyvsp[-2].i; - tmplreg[nlreg]->delarea.x1 = current_region.x1; - tmplreg[nlreg]->delarea.y1 = current_region.y1; - tmplreg[nlreg]->delarea.x2 = current_region.x2; - tmplreg[nlreg]->delarea.y2 = current_region.y2; - tmplreg[nlreg]->rtype = LR_PORTAL; - tmplreg[nlreg]->rname.str = yyvsp[0].map; - nlreg++; - if (nlreg >= MAX_OF_TYPE) { - yyerror("Too many levregions in mazepart!"); - nlreg--; - } - } -break; -case 161: -{ - tmplreg[nlreg] = New(lev_region); - tmplreg[nlreg]->in_islev = yyvsp[0].i; - tmplreg[nlreg]->inarea.x1 = current_region.x1; - tmplreg[nlreg]->inarea.y1 = current_region.y1; - tmplreg[nlreg]->inarea.x2 = current_region.x2; - tmplreg[nlreg]->inarea.y2 = current_region.y2; - } -break; -case 162: -{ - tmplreg[nlreg]->del_islev = yyvsp[0].i; - tmplreg[nlreg]->delarea.x1 = current_region.x1; - tmplreg[nlreg]->delarea.y1 = current_region.y1; - tmplreg[nlreg]->delarea.x2 = current_region.x2; - tmplreg[nlreg]->delarea.y2 = current_region.y2; - } -break; -case 163: -{ - switch(yyvsp[0].i) { - case -1: tmplreg[nlreg]->rtype = LR_TELE; break; - case 0: tmplreg[nlreg]->rtype = LR_DOWNTELE; break; - case 1: tmplreg[nlreg]->rtype = LR_UPTELE; break; - } - tmplreg[nlreg]->rname.str = 0; - nlreg++; - if (nlreg >= MAX_OF_TYPE) { - yyerror("Too many levregions in mazepart!"); - nlreg--; - } - } -break; -case 164: -{ - tmplreg[nlreg] = New(lev_region); - tmplreg[nlreg]->in_islev = yyvsp[0].i; - tmplreg[nlreg]->inarea.x1 = current_region.x1; - tmplreg[nlreg]->inarea.y1 = current_region.y1; - tmplreg[nlreg]->inarea.x2 = current_region.x2; - tmplreg[nlreg]->inarea.y2 = current_region.y2; - } -break; -case 165: -{ - tmplreg[nlreg]->del_islev = yyvsp[0].i; - tmplreg[nlreg]->delarea.x1 = current_region.x1; - tmplreg[nlreg]->delarea.y1 = current_region.y1; - tmplreg[nlreg]->delarea.x2 = current_region.x2; - tmplreg[nlreg]->delarea.y2 = current_region.y2; - tmplreg[nlreg]->rtype = LR_BRANCH; - tmplreg[nlreg]->rname.str = 0; - nlreg++; - if (nlreg >= MAX_OF_TYPE) { - yyerror("Too many levregions in mazepart!"); - nlreg--; - } - } -break; -case 166: -{ - yyval.i = -1; - } -break; -case 167: -{ - yyval.i = yyvsp[0].i; - } -break; -case 168: -{ - yyval.i = 0; - } -break; -case 169: -{ -/* This series of if statements is a hack for MSC 5.1. It seems that its - tiny little brain cannot compile if these are all one big if statement. */ - if (yyvsp[-7].i <= 0 || yyvsp[-7].i >= COLNO) - yyerror("Region out of level range!"); - else if (yyvsp[-5].i < 0 || yyvsp[-5].i >= ROWNO) - yyerror("Region out of level range!"); - else if (yyvsp[-3].i <= 0 || yyvsp[-3].i >= COLNO) - yyerror("Region out of level range!"); - else if (yyvsp[-1].i < 0 || yyvsp[-1].i >= ROWNO) - yyerror("Region out of level range!"); - current_region.x1 = yyvsp[-7].i; - current_region.y1 = yyvsp[-5].i; - current_region.x2 = yyvsp[-3].i; - current_region.y2 = yyvsp[-1].i; - yyval.i = 1; - } -break; -case 170: -{ - tmpfountain[nfountain] = New(fountain); - tmpfountain[nfountain]->x = current_coord.x; - tmpfountain[nfountain]->y = current_coord.y; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Fountain"); - nfountain++; - if (nfountain >= MAX_OF_TYPE) { - yyerror("Too many fountains in room or mazepart!"); - nfountain--; - } - } -break; -case 171: -{ - tmpsink[nsink] = New(sink); - tmpsink[nsink]->x = current_coord.x; - tmpsink[nsink]->y = current_coord.y; - nsink++; - if (nsink >= MAX_OF_TYPE) { - yyerror("Too many sinks in room!"); - nsink--; - } - } -break; -case 172: -{ - tmppool[npool] = New(pool); - tmppool[npool]->x = current_coord.x; - tmppool[npool]->y = current_coord.y; - npool++; - if (npool >= MAX_OF_TYPE) { - yyerror("Too many pools in room!"); - npool--; - } - } -break; -case 173: -{ - tmpdig[ndig] = New(digpos); - tmpdig[ndig]->x1 = current_region.x1; - tmpdig[ndig]->y1 = current_region.y1; - tmpdig[ndig]->x2 = current_region.x2; - tmpdig[ndig]->y2 = current_region.y2; - ndig++; - if (ndig >= MAX_OF_TYPE) { - yyerror("Too many diggables in mazepart!"); - ndig--; - } - } -break; -case 174: -{ - tmppass[npass] = New(digpos); - tmppass[npass]->x1 = current_region.x1; - tmppass[npass]->y1 = current_region.y1; - tmppass[npass]->x2 = current_region.x2; - tmppass[npass]->y2 = current_region.y2; - npass++; - if (npass >= 32) { - yyerror("Too many passwalls in mazepart!"); - npass--; - } - } -break; -case 175: -{ - tmpreg[nreg] = New(region); - tmpreg[nreg]->x1 = current_region.x1; - tmpreg[nreg]->y1 = current_region.y1; - tmpreg[nreg]->x2 = current_region.x2; - tmpreg[nreg]->y2 = current_region.y2; - tmpreg[nreg]->rlit = yyvsp[-3].i; - tmpreg[nreg]->rtype = yyvsp[-1].i; - if(yyvsp[0].i & 1) tmpreg[nreg]->rtype += MAXRTYPE+1; - tmpreg[nreg]->rirreg = ((yyvsp[0].i & 2) != 0); - if(current_region.x1 > current_region.x2 || - current_region.y1 > current_region.y2) - yyerror("Region start > end!"); - if(tmpreg[nreg]->rtype == VAULT && - (tmpreg[nreg]->rirreg || - (tmpreg[nreg]->x2 - tmpreg[nreg]->x1 != 1) || - (tmpreg[nreg]->y2 - tmpreg[nreg]->y1 != 1))) - yyerror("Vaults must be exactly 2x2!"); - if(want_warnings && !tmpreg[nreg]->rirreg && - current_region.x1 > 0 && current_region.y1 > 0 && - current_region.x2 < (int)max_x_map && - current_region.y2 < (int)max_y_map) { - /* check for walls in the room */ - char ebuf[60]; - register int x, y, nrock = 0; + break; - for(y=current_region.y1; y<=current_region.y2; y++) - for(x=current_region.x1; - x<=current_region.x2; x++) - if(IS_ROCK(tmpmap[y][x]) || - IS_DOOR(tmpmap[y][x])) nrock++; - if(nrock) { - Sprintf(ebuf, - "Rock in room (%02d,%02d,%02d,%02d)?!", - current_region.x1, current_region.y1, - current_region.x2, current_region.y2); - yywarning(ebuf); - } - if ( - !IS_ROCK(tmpmap[current_region.y1-1][current_region.x1-1]) || - !IS_ROCK(tmpmap[current_region.y2+1][current_region.x1-1]) || - !IS_ROCK(tmpmap[current_region.y1-1][current_region.x2+1]) || - !IS_ROCK(tmpmap[current_region.y2+1][current_region.x2+1])) { - Sprintf(ebuf, - "NonRock edge in room (%02d,%02d,%02d,%02d)?!", - current_region.x1, current_region.y1, - current_region.x2, current_region.y2); - yywarning(ebuf); - } - } else if(tmpreg[nreg]->rirreg && - !IS_ROOM(tmpmap[current_region.y1][current_region.x1])) { - char ebuf[60]; - Sprintf(ebuf, - "Rock in irregular room (%02d,%02d)?!", - current_region.x1, current_region.y1); - yyerror(ebuf); - } - nreg++; - if (nreg >= MAX_OF_TYPE) { - yyerror("Too many regions in mazepart!"); - nreg--; - } + case 248: + +/* Line 1455 of yacc.c */ +#line 1638 "lev_comp.y" + { + add_opvars(splev, "iiio", + (long)(yyvsp[(5) - (5)].i), 1, 0, SPO_MAZEWALK); } -break; -case 176: -{ - tmpaltar[naltar] = New(altar); - tmpaltar[naltar]->x = current_coord.x; - tmpaltar[naltar]->y = current_coord.y; - tmpaltar[naltar]->align = yyvsp[-2].i; - tmpaltar[naltar]->shrine = yyvsp[0].i; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Altar"); - naltar++; - if (naltar >= MAX_OF_TYPE) { - yyerror("Too many altars in room or mazepart!"); - naltar--; - } + break; + + case 249: + +/* Line 1455 of yacc.c */ +#line 1643 "lev_comp.y" + { + add_opvars(splev, "iiio", + (long)(yyvsp[(5) - (8)].i), (long)(yyvsp[(7) - (8)].i), (long)(yyvsp[(8) - (8)].i), SPO_MAZEWALK); } -break; -case 177: -{ - tmpgold[ngold] = New(gold); - tmpgold[ngold]->x = current_coord.x; - tmpgold[ngold]->y = current_coord.y; - tmpgold[ngold]->amount = yyvsp[-2].i; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Gold"); - ngold++; - if (ngold >= MAX_OF_TYPE) { - yyerror("Too many golds in room or mazepart!"); - ngold--; - } + break; + + case 250: + +/* Line 1455 of yacc.c */ +#line 1650 "lev_comp.y" + { + add_opvars(splev, "rio", SP_REGION_PACK(-1,-1,-1,-1), 0, SPO_WALLIFY); } -break; -case 178: -{ - tmpengraving[nengraving] = New(engraving); - tmpengraving[nengraving]->x = current_coord.x; - tmpengraving[nengraving]->y = current_coord.y; - tmpengraving[nengraving]->engr.str = yyvsp[0].map; - tmpengraving[nengraving]->etype = yyvsp[-2].i; - if (!in_room) - check_coord(current_coord.x, current_coord.y, - "Engraving"); - nengraving++; - if (nengraving >= MAX_OF_TYPE) { - yyerror("Too many engravings in room or mazepart!"); - nengraving--; - } + break; + + case 251: + +/* Line 1455 of yacc.c */ +#line 1654 "lev_comp.y" + { + add_opvars(splev, "io", 1, SPO_WALLIFY); } -break; -case 180: -{ - yyval.i = - MAX_REGISTERS - 1; + break; + + case 252: + +/* Line 1455 of yacc.c */ +#line 1660 "lev_comp.y" + { + add_opvars(splev, "io", (long)(yyvsp[(5) - (5)].i), SPO_LADDER); } -break; -case 183: -{ - yyval.i = - MAX_REGISTERS - 1; + break; + + case 253: + +/* Line 1455 of yacc.c */ +#line 1666 "lev_comp.y" + { + add_opvars(splev, "io", (long)(yyvsp[(5) - (5)].i), SPO_STAIR); } -break; -case 186: -{ - yyval.map = (char *) 0; + break; + + case 254: + +/* Line 1455 of yacc.c */ +#line 1672 "lev_comp.y" + { + add_opvars(splev, "iiiii iiiii iiso", + (yyvsp[(3) - (7)].lregn).x1, (yyvsp[(3) - (7)].lregn).y1, (yyvsp[(3) - (7)].lregn).x2, (yyvsp[(3) - (7)].lregn).y2, (yyvsp[(3) - (7)].lregn).area, + (yyvsp[(5) - (7)].lregn).x1, (yyvsp[(5) - (7)].lregn).y1, (yyvsp[(5) - (7)].lregn).x2, (yyvsp[(5) - (7)].lregn).y2, (yyvsp[(5) - (7)].lregn).area, + (long)(((yyvsp[(7) - (7)].i)) ? LR_UPSTAIR : LR_DOWNSTAIR), + 0, (char *)0, SPO_LEVREGION); } -break; -case 188: -{ - yyval.map = (char *) 0; + break; + + case 255: + +/* Line 1455 of yacc.c */ +#line 1682 "lev_comp.y" + { + add_opvars(splev, "iiiii iiiii iiso", + (yyvsp[(3) - (7)].lregn).x1, (yyvsp[(3) - (7)].lregn).y1, (yyvsp[(3) - (7)].lregn).x2, (yyvsp[(3) - (7)].lregn).y2, (yyvsp[(3) - (7)].lregn).area, + (yyvsp[(5) - (7)].lregn).x1, (yyvsp[(5) - (7)].lregn).y1, (yyvsp[(5) - (7)].lregn).x2, (yyvsp[(5) - (7)].lregn).y2, (yyvsp[(5) - (7)].lregn).area, + LR_PORTAL, 0, (yyvsp[(7) - (7)].map), SPO_LEVREGION); + Free((yyvsp[(7) - (7)].map)); } -break; -case 189: -{ - int token = get_trap_type(yyvsp[0].map); + break; + + case 256: + +/* Line 1455 of yacc.c */ +#line 1692 "lev_comp.y" + { + long rtype = 0; + switch((yyvsp[(6) - (6)].i)) { + case -1: rtype = LR_TELE; break; + case 0: rtype = LR_DOWNTELE; break; + case 1: rtype = LR_UPTELE; break; + } + add_opvars(splev, "iiiii iiiii iiso", + (yyvsp[(3) - (6)].lregn).x1, (yyvsp[(3) - (6)].lregn).y1, (yyvsp[(3) - (6)].lregn).x2, (yyvsp[(3) - (6)].lregn).y2, (yyvsp[(3) - (6)].lregn).area, + (yyvsp[(5) - (6)].lregn).x1, (yyvsp[(5) - (6)].lregn).y1, (yyvsp[(5) - (6)].lregn).x2, (yyvsp[(5) - (6)].lregn).y2, (yyvsp[(5) - (6)].lregn).area, + rtype, 0, (char *)0, SPO_LEVREGION); + } + break; + + case 257: + +/* Line 1455 of yacc.c */ +#line 1707 "lev_comp.y" + { + add_opvars(splev, "iiiii iiiii iiso", + (yyvsp[(3) - (5)].lregn).x1, (yyvsp[(3) - (5)].lregn).y1, (yyvsp[(3) - (5)].lregn).x2, (yyvsp[(3) - (5)].lregn).y2, (yyvsp[(3) - (5)].lregn).area, + (yyvsp[(5) - (5)].lregn).x1, (yyvsp[(5) - (5)].lregn).y1, (yyvsp[(5) - (5)].lregn).x2, (yyvsp[(5) - (5)].lregn).y2, (yyvsp[(5) - (5)].lregn).area, + (long)LR_BRANCH, 0, (char *)0, SPO_LEVREGION); + } + break; + + case 258: + +/* Line 1455 of yacc.c */ +#line 1716 "lev_comp.y" + { + (yyval.i) = -1; + } + break; + + case 259: + +/* Line 1455 of yacc.c */ +#line 1720 "lev_comp.y" + { + (yyval.i) = (yyvsp[(2) - (2)].i); + } + break; + + case 260: + +/* Line 1455 of yacc.c */ +#line 1726 "lev_comp.y" + { + add_opvars(splev, "o", SPO_FOUNTAIN); + } + break; + + case 261: + +/* Line 1455 of yacc.c */ +#line 1732 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SINK); + } + break; + + case 262: + +/* Line 1455 of yacc.c */ +#line 1738 "lev_comp.y" + { + add_opvars(splev, "o", SPO_POOL); + } + break; + + case 263: + +/* Line 1455 of yacc.c */ +#line 1744 "lev_comp.y" + { + (yyval.terr).lit = -2; + (yyval.terr).ter = what_map_char((char) (yyvsp[(1) - (1)].i)); + } + break; + + case 264: + +/* Line 1455 of yacc.c */ +#line 1749 "lev_comp.y" + { + (yyval.terr).lit = (yyvsp[(4) - (5)].i); + (yyval.terr).ter = what_map_char((char) (yyvsp[(2) - (5)].i)); + } + break; + + case 265: + +/* Line 1455 of yacc.c */ +#line 1756 "lev_comp.y" + { + add_opvars(splev, "io", (yyvsp[(9) - (9)].i), SPO_REPLACETERRAIN); + } + break; + + case 266: + +/* Line 1455 of yacc.c */ +#line 1762 "lev_comp.y" + { + add_opvars(splev, "o", SPO_TERRAIN); + } + break; + + case 267: + +/* Line 1455 of yacc.c */ +#line 1768 "lev_comp.y" + { + add_opvars(splev, "o", SPO_NON_DIGGABLE); + } + break; + + case 268: + +/* Line 1455 of yacc.c */ +#line 1774 "lev_comp.y" + { + add_opvars(splev, "o", SPO_NON_PASSWALL); + } + break; + + case 269: + +/* Line 1455 of yacc.c */ +#line 1780 "lev_comp.y" + { + long irr; + long rt = (yyvsp[(7) - (8)].i); + long flags = (yyvsp[(8) - (8)].i); + if (flags == -1) flags = (1 << 0); + if (!(( flags ) & 1)) rt += MAXRTYPE+1; + irr = ((( flags ) & 2) != 0); + add_opvars(splev, "iiio", + (long)(yyvsp[(5) - (8)].i), rt, flags, SPO_REGION); + (yyval.i) = (irr || (flags & 1) || rt != OROOM); + break_stmt_start(); + } + break; + + case 270: + +/* Line 1455 of yacc.c */ +#line 1793 "lev_comp.y" + { + break_stmt_end(splev); + if ( (yyvsp[(9) - (10)].i) ) { + add_opcode(splev, SPO_ENDROOM, NULL); + } else if ( (yyvsp[(10) - (10)].i) ) + lc_error("Cannot use lev statements in non-permanent REGION"); + } + break; + + case 271: + +/* Line 1455 of yacc.c */ +#line 1803 "lev_comp.y" + { + (yyval.i) = 0; + } + break; + + case 272: + +/* Line 1455 of yacc.c */ +#line 1807 "lev_comp.y" + { + (yyval.i) = (yyvsp[(1) - (1)].i); + } + break; + + case 273: + +/* Line 1455 of yacc.c */ +#line 1813 "lev_comp.y" + { + add_opvars(splev, "iio", (long)(yyvsp[(7) - (7)].i), (long)(yyvsp[(5) - (7)].i), SPO_ALTAR); + } + break; + + case 274: + +/* Line 1455 of yacc.c */ +#line 1819 "lev_comp.y" + { + add_opvars(splev, "io", 2, SPO_GRAVE); + } + break; + + case 275: + +/* Line 1455 of yacc.c */ +#line 1823 "lev_comp.y" + { + add_opvars(splev, "sio", + (char *)0, 1, SPO_GRAVE); + } + break; + + case 276: + +/* Line 1455 of yacc.c */ +#line 1828 "lev_comp.y" + { + add_opvars(splev, "sio", + (char *)0, 0, SPO_GRAVE); + } + break; + + case 277: + +/* Line 1455 of yacc.c */ +#line 1835 "lev_comp.y" + { + add_opvars(splev, "o", SPO_GOLD); + } + break; + + case 278: + +/* Line 1455 of yacc.c */ +#line 1841 "lev_comp.y" + { + add_opvars(splev, "io", + (long)(yyvsp[(5) - (7)].i), SPO_ENGRAVING); + } + break; + + case 279: + +/* Line 1455 of yacc.c */ +#line 1848 "lev_comp.y" + { + add_opvars(splev, "o", SPO_MINERALIZE); + } + break; + + case 280: + +/* Line 1455 of yacc.c */ +#line 1852 "lev_comp.y" + { + add_opvars(splev, "iiiio", -1L, -1L, -1L, -1L, SPO_MINERALIZE); + } + break; + + case 281: + +/* Line 1455 of yacc.c */ +#line 1858 "lev_comp.y" + { + int token = get_trap_type((yyvsp[(1) - (1)].map)); if (token == ERR) - yyerror("Unknown trap type!"); - yyval.i = token; - Free(yyvsp[0].map); + lc_error("Unknown trap type '%s'!", (yyvsp[(1) - (1)].map)); + (yyval.i) = token; + Free((yyvsp[(1) - (1)].map)); } -break; -case 191: -{ - int token = get_room_type(yyvsp[0].map); + break; + + case 283: + +/* Line 1455 of yacc.c */ +#line 1869 "lev_comp.y" + { + int token = get_room_type((yyvsp[(1) - (1)].map)); if (token == ERR) { - yywarning("Unknown room type! Making ordinary room..."); - yyval.i = OROOM; + lc_warning("Unknown room type \"%s\"! Making ordinary room...", (yyvsp[(1) - (1)].map)); + (yyval.i) = OROOM; } else - yyval.i = token; - Free(yyvsp[0].map); + (yyval.i) = token; + Free((yyvsp[(1) - (1)].map)); } -break; -case 193: -{ - yyval.i = 0; + break; + + case 285: + +/* Line 1455 of yacc.c */ +#line 1882 "lev_comp.y" + { + (yyval.i) = -1; } -break; -case 194: -{ - yyval.i = yyvsp[0].i; + break; + + case 286: + +/* Line 1455 of yacc.c */ +#line 1886 "lev_comp.y" + { + (yyval.i) = (yyvsp[(2) - (2)].i); } -break; -case 195: -{ - yyval.i = yyvsp[-2].i + (yyvsp[0].i << 1); + break; + + case 287: + +/* Line 1455 of yacc.c */ +#line 1892 "lev_comp.y" + { + (yyval.i) = (yyvsp[(1) - (1)].i); } -break; -case 198: -{ - current_coord.x = current_coord.y = -MAX_REGISTERS-1; + break; + + case 288: + +/* Line 1455 of yacc.c */ +#line 1896 "lev_comp.y" + { + (yyval.i) = (yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i); } -break; -case 205: -{ - yyval.i = - MAX_REGISTERS - 1; + break; + + case 289: + +/* Line 1455 of yacc.c */ +#line 1903 "lev_comp.y" + { + (yyval.i) = ((yyvsp[(1) - (1)].i) << 0); } -break; -case 208: -{ - if ( yyvsp[-1].i >= MAX_REGISTERS ) - yyerror("Register Index overflow!"); + break; + + case 290: + +/* Line 1455 of yacc.c */ +#line 1907 "lev_comp.y" + { + (yyval.i) = ((yyvsp[(1) - (1)].i) << 1); + } + break; + + case 291: + +/* Line 1455 of yacc.c */ +#line 1911 "lev_comp.y" + { + (yyval.i) = ((yyvsp[(1) - (1)].i) << 2); + } + break; + + case 298: + +/* Line 1455 of yacc.c */ +#line 1927 "lev_comp.y" + { + (yyval.i) = - MAX_REGISTERS - 1; + } + break; + + case 301: + +/* Line 1455 of yacc.c */ +#line 1935 "lev_comp.y" + { + (yyval.i) = - MAX_REGISTERS - 1; + } + break; + + case 304: + +/* Line 1455 of yacc.c */ +#line 1945 "lev_comp.y" + { + if ( (yyvsp[(3) - (4)].i) >= 3 ) + lc_error("Register Index overflow!"); else - current_coord.x = current_coord.y = - yyvsp[-1].i - 1; + (yyval.i) = - (yyvsp[(3) - (4)].i) - 1; } -break; -case 209: -{ - if ( yyvsp[-1].i >= MAX_REGISTERS ) - yyerror("Register Index overflow!"); - else - yyval.i = - yyvsp[-1].i - 1; + break; + + case 305: + +/* Line 1455 of yacc.c */ +#line 1954 "lev_comp.y" + { + add_opvars(splev, "s", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); } -break; -case 210: -{ - if ( yyvsp[-1].i >= MAX_REGISTERS ) - yyerror("Register Index overflow!"); - else - yyval.i = - yyvsp[-1].i - 1; + break; + + case 306: + +/* Line 1455 of yacc.c */ +#line 1959 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_STRING); + vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); } -break; -case 211: -{ - if ( yyvsp[-1].i >= 3 ) - yyerror("Register Index overflow!"); - else - yyval.i = - yyvsp[-1].i - 1; + break; + + case 307: + +/* Line 1455 of yacc.c */ +#line 1966 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_STRING|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); + Free((yyvsp[(1) - (4)].map)); } -break; -case 213: -{ - if (check_monster_char((char) yyvsp[0].i)) - yyval.i = yyvsp[0].i ; + break; + + case 308: + +/* Line 1455 of yacc.c */ +#line 1976 "lev_comp.y" + { + /* nothing */ + } + break; + + case 309: + +/* Line 1455 of yacc.c */ +#line 1982 "lev_comp.y" + { + add_opvars(splev, "c", (yyvsp[(1) - (1)].i)); + } + break; + + case 310: + +/* Line 1455 of yacc.c */ +#line 1986 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SEL_RNDCOORD); + } + break; + + case 311: + +/* Line 1455 of yacc.c */ +#line 1990 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_COORD); + vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); + } + break; + + case 312: + +/* Line 1455 of yacc.c */ +#line 1997 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_COORD|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); + Free((yyvsp[(1) - (4)].map)); + } + break; + + case 313: + +/* Line 1455 of yacc.c */ +#line 2006 "lev_comp.y" + { + if ((yyvsp[(2) - (5)].i) < 0 || (yyvsp[(4) - (5)].i) < 0 || (yyvsp[(2) - (5)].i) >= COLNO || (yyvsp[(4) - (5)].i) >= ROWNO) + lc_error("Coordinates (%li,%li) out of map range!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i)); + (yyval.i) = SP_COORD_PACK((yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i)); + } + break; + + case 314: + +/* Line 1455 of yacc.c */ +#line 2012 "lev_comp.y" + { + (yyval.i) = SP_COORD_PACK_RANDOM(0); + } + break; + + case 315: + +/* Line 1455 of yacc.c */ +#line 2016 "lev_comp.y" + { + (yyval.i) = SP_COORD_PACK_RANDOM( (yyvsp[(2) - (3)].i) ); + } + break; + + case 316: + +/* Line 1455 of yacc.c */ +#line 2022 "lev_comp.y" + { + (yyval.i) = (yyvsp[(1) - (1)].i); + } + break; + + case 317: + +/* Line 1455 of yacc.c */ +#line 2026 "lev_comp.y" + { + if (((yyvsp[(1) - (3)].i) & (yyvsp[(3) - (3)].i))) + lc_warning("Humidity flag used twice."); + (yyval.i) = ((yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i)); + } + break; + + case 318: + +/* Line 1455 of yacc.c */ +#line 2034 "lev_comp.y" + { + /* nothing */ + } + break; + + case 319: + +/* Line 1455 of yacc.c */ +#line 2038 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_REGION); + vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); + } + break; + + case 320: + +/* Line 1455 of yacc.c */ +#line 2045 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_REGION|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); + Free((yyvsp[(1) - (4)].map)); + } + break; + + case 321: + +/* Line 1455 of yacc.c */ +#line 2054 "lev_comp.y" + { + long r = SP_REGION_PACK((yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); + if ( (yyvsp[(2) - (9)].i) > (yyvsp[(6) - (9)].i) || (yyvsp[(4) - (9)].i) > (yyvsp[(8) - (9)].i) ) + lc_error("Region start > end: (%li,%li,%li,%li)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); + + add_opvars(splev, "r", r); + (yyval.i) = r; + } + break; + + case 322: + +/* Line 1455 of yacc.c */ +#line 2065 "lev_comp.y" + { + add_opvars(splev, "m", (yyvsp[(1) - (1)].i)); + } + break; + + case 323: + +/* Line 1455 of yacc.c */ +#line 2069 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_MAPCHAR); + vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); + } + break; + + case 324: + +/* Line 1455 of yacc.c */ +#line 2076 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_MAPCHAR|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); + Free((yyvsp[(1) - (4)].map)); + } + break; + + case 325: + +/* Line 1455 of yacc.c */ +#line 2085 "lev_comp.y" + { + if (what_map_char((char) (yyvsp[(1) - (1)].i)) != INVALID_TYPE) + (yyval.i) = SP_MAPCHAR_PACK(what_map_char((char) (yyvsp[(1) - (1)].i)), -2); + else { + lc_error("Unknown map char type '%c'!", (yyvsp[(1) - (1)].i)); + (yyval.i) = SP_MAPCHAR_PACK(STONE, -2); + } + } + break; + + case 326: + +/* Line 1455 of yacc.c */ +#line 2094 "lev_comp.y" + { + if (what_map_char((char) (yyvsp[(2) - (5)].i)) != INVALID_TYPE) + (yyval.i) = SP_MAPCHAR_PACK(what_map_char((char) (yyvsp[(2) - (5)].i)), (yyvsp[(4) - (5)].i)); + else { + lc_error("Unknown map char type '%c'!", (yyvsp[(2) - (5)].i)); + (yyval.i) = SP_MAPCHAR_PACK(STONE, (yyvsp[(4) - (5)].i)); + } + } + break; + + case 327: + +/* Line 1455 of yacc.c */ +#line 2105 "lev_comp.y" + { + add_opvars(splev, "M", (yyvsp[(1) - (1)].i)); + } + break; + + case 328: + +/* Line 1455 of yacc.c */ +#line 2109 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_MONST); + vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); + } + break; + + case 329: + +/* Line 1455 of yacc.c */ +#line 2116 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_MONST|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); + Free((yyvsp[(1) - (4)].map)); + } + break; + + case 330: + +/* Line 1455 of yacc.c */ +#line 2125 "lev_comp.y" + { + long m = get_monster_id((yyvsp[(1) - (1)].map), (char)0); + if (m == ERR) { + lc_error("Unknown monster \"%s\"!", (yyvsp[(1) - (1)].map)); + (yyval.i) = -1; + } else + (yyval.i) = SP_MONST_PACK(m, def_monsyms[(int)mons[m].mlet].sym); + } + break; + + case 331: + +/* Line 1455 of yacc.c */ +#line 2134 "lev_comp.y" + { + if (check_monster_char((char) (yyvsp[(1) - (1)].i))) + (yyval.i) = SP_MONST_PACK(-1, (yyvsp[(1) - (1)].i)); + else { + lc_error("Unknown monster class '%c'!", (yyvsp[(1) - (1)].i)); + (yyval.i) = -1; + } + } + break; + + case 332: + +/* Line 1455 of yacc.c */ +#line 2143 "lev_comp.y" + { + long m = get_monster_id((yyvsp[(4) - (5)].map), (char) (yyvsp[(2) - (5)].i)); + if (m == ERR) { + lc_error("Unknown monster ('%c', \"%s\")!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].map)); + (yyval.i) = -1; + } else + (yyval.i) = SP_MONST_PACK(m, (yyvsp[(2) - (5)].i)); + } + break; + + case 333: + +/* Line 1455 of yacc.c */ +#line 2152 "lev_comp.y" + { + (yyval.i) = -1; + } + break; + + case 334: + +/* Line 1455 of yacc.c */ +#line 2158 "lev_comp.y" + { + add_opvars(splev, "O", (yyvsp[(1) - (1)].i)); + } + break; + + case 335: + +/* Line 1455 of yacc.c */ +#line 2162 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_OBJ); + vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); + } + break; + + case 336: + +/* Line 1455 of yacc.c */ +#line 2169 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_OBJ|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); + Free((yyvsp[(1) - (4)].map)); + } + break; + + case 337: + +/* Line 1455 of yacc.c */ +#line 2178 "lev_comp.y" + { + long m = get_object_id((yyvsp[(1) - (1)].map), (char)0); + if (m == ERR) { + lc_error("Unknown object \"%s\"!", (yyvsp[(1) - (1)].map)); + (yyval.i) = -1; + } else + (yyval.i) = SP_OBJ_PACK(m, 1); /* obj class != 0 to force generation of a specific item */ + + } + break; + + case 338: + +/* Line 1455 of yacc.c */ +#line 2188 "lev_comp.y" + { + if (check_object_char((char) (yyvsp[(1) - (1)].i))) + (yyval.i) = SP_OBJ_PACK(-1, (yyvsp[(1) - (1)].i)); else { - yyerror("Unknown monster class!"); - yyval.i = ERR; + lc_error("Unknown object class '%c'!", (yyvsp[(1) - (1)].i)); + (yyval.i) = -1; } } -break; -case 214: -{ - char c = yyvsp[0].i; - if (check_object_char(c)) - yyval.i = c; - else { - yyerror("Unknown char class!"); - yyval.i = ERR; - } + break; + + case 339: + +/* Line 1455 of yacc.c */ +#line 2197 "lev_comp.y" + { + long m = get_object_id((yyvsp[(4) - (5)].map), (char) (yyvsp[(2) - (5)].i)); + if (m == ERR) { + lc_error("Unknown object ('%c', \"%s\")!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].map)); + (yyval.i) = -1; + } else + (yyval.i) = SP_OBJ_PACK(m, (yyvsp[(2) - (5)].i)); } -break; -case 218: -{ - yyval.i = 100; /* default is 100% */ + break; + + case 340: + +/* Line 1455 of yacc.c */ +#line 2206 "lev_comp.y" + { + (yyval.i) = -1; } -break; -case 219: -{ - if (yyvsp[0].i <= 0 || yyvsp[0].i > 100) - yyerror("Expected percentile chance."); - yyval.i = yyvsp[0].i; + break; + + case 341: + +/* Line 1455 of yacc.c */ +#line 2212 "lev_comp.y" + { } + break; + + case 342: + +/* Line 1455 of yacc.c */ +#line 2214 "lev_comp.y" + { + add_opvars(splev, "o", SPO_MATH_ADD); } -break; -case 222: -{ - if (!in_room && !init_lev.init_present && - (yyvsp[-3].i < 0 || yyvsp[-3].i > (int)max_x_map || - yyvsp[-1].i < 0 || yyvsp[-1].i > (int)max_y_map)) - yyerror("Coordinates out of map range!"); - current_coord.x = yyvsp[-3].i; - current_coord.y = yyvsp[-1].i; + break; + + case 343: + +/* Line 1455 of yacc.c */ +#line 2219 "lev_comp.y" + { add_opvars(splev, "i", (yyvsp[(1) - (1)].i) ); } + break; + + case 344: + +/* Line 1455 of yacc.c */ +#line 2220 "lev_comp.y" + { is_inconstant_number = 1; } + break; + + case 345: + +/* Line 1455 of yacc.c */ +#line 2221 "lev_comp.y" + { add_opvars(splev, "i", (yyvsp[(2) - (3)].i) ); } + break; + + case 346: + +/* Line 1455 of yacc.c */ +#line 2223 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_INT); + vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); + is_inconstant_number = 1; } -break; -case 223: -{ + break; + + case 347: + +/* Line 1455 of yacc.c */ +#line 2231 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_INT|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); + Free((yyvsp[(1) - (4)].map)); + is_inconstant_number = 1; + } + break; + + case 348: + +/* Line 1455 of yacc.c */ +#line 2238 "lev_comp.y" + { add_opvars(splev, "o", SPO_MATH_ADD); } + break; + + case 349: + +/* Line 1455 of yacc.c */ +#line 2239 "lev_comp.y" + { add_opvars(splev, "o", SPO_MATH_SUB); } + break; + + case 350: + +/* Line 1455 of yacc.c */ +#line 2240 "lev_comp.y" + { add_opvars(splev, "o", SPO_MATH_MUL); } + break; + + case 351: + +/* Line 1455 of yacc.c */ +#line 2241 "lev_comp.y" + { add_opvars(splev, "o", SPO_MATH_DIV); } + break; + + case 352: + +/* Line 1455 of yacc.c */ +#line 2242 "lev_comp.y" + { add_opvars(splev, "o", SPO_MATH_MOD); } + break; + + case 353: + +/* Line 1455 of yacc.c */ +#line 2243 "lev_comp.y" + { } + break; + + case 354: + +/* Line 1455 of yacc.c */ +#line 2247 "lev_comp.y" + { + if (!strcmp("int", (yyvsp[(1) - (1)].map)) || !strcmp("integer", (yyvsp[(1) - (1)].map))) { + (yyval.i) = (int)'i'; + } else lc_error("Unknown function parameter type '%s'", (yyvsp[(1) - (1)].map)); + } + break; + + case 355: + +/* Line 1455 of yacc.c */ +#line 2253 "lev_comp.y" + { + if (!strcmp("str", (yyvsp[(1) - (1)].map)) || !strcmp("string", (yyvsp[(1) - (1)].map))) { + (yyval.i) = (int)'s'; + } else lc_error("Unknown function parameter type '%s'", (yyvsp[(1) - (1)].map)); + } + break; + + case 356: + +/* Line 1455 of yacc.c */ +#line 2261 "lev_comp.y" + { + struct lc_funcdefs_parm *tmp = New(struct lc_funcdefs_parm); + + if (!curr_function) + lc_error("Function parameters outside function definition."); + else if (!tmp) + lc_error("Could not alloc function params."); + else { + tmp->name = strdup((yyvsp[(1) - (3)].map)); + tmp->parmtype = (char) (yyvsp[(3) - (3)].i); + tmp->next = curr_function->params; + curr_function->params = tmp; + curr_function->n_params++; + { + long vt; + switch (tmp->parmtype) { + case 'i': vt = SPOVAR_INT; break; + case 's': vt = SPOVAR_STRING; break; + default: lc_error("Unknown func param conversion."); break; + } + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), vt); + } + } + Free((yyvsp[(1) - (3)].map)); + } + break; + + case 361: + +/* Line 1455 of yacc.c */ +#line 2298 "lev_comp.y" + { + (yyval.i) = (int)'i'; + } + break; + + case 362: + +/* Line 1455 of yacc.c */ +#line 2302 "lev_comp.y" + { + (yyval.i) = (int)'s'; + } + break; + + case 363: + +/* Line 1455 of yacc.c */ +#line 2309 "lev_comp.y" + { + char tmpbuf[2]; + tmpbuf[0] = (char) (yyvsp[(1) - (1)].i); + tmpbuf[1] = '\0'; + (yyval.map) = strdup(tmpbuf); + } + break; + + case 364: + +/* Line 1455 of yacc.c */ +#line 2316 "lev_comp.y" + { + long len = strlen( (yyvsp[(1) - (3)].map) ); + char *tmp = (char *)alloc(len + 2); + sprintf(tmp, "%c%s", (char) (yyvsp[(3) - (3)].i), (yyvsp[(1) - (3)].map) ); + Free( (yyvsp[(1) - (3)].map) ); + (yyval.map) = tmp; + } + break; + + case 365: + +/* Line 1455 of yacc.c */ +#line 2326 "lev_comp.y" + { + (yyval.map) = strdup(""); + } + break; + + case 366: + +/* Line 1455 of yacc.c */ +#line 2330 "lev_comp.y" + { + char *tmp = strdup( (yyvsp[(1) - (1)].map) ); + Free( (yyvsp[(1) - (1)].map) ); + (yyval.map) = tmp; + } + break; + + case 367: + +/* Line 1455 of yacc.c */ +#line 2338 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SEL_POINT); + } + break; + + case 368: + +/* Line 1455 of yacc.c */ +#line 2342 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SEL_RECT); + } + break; + + case 369: + +/* Line 1455 of yacc.c */ +#line 2346 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SEL_FILLRECT); + } + break; + + case 370: + +/* Line 1455 of yacc.c */ +#line 2350 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SEL_LINE); + } + break; + + case 371: + +/* Line 1455 of yacc.c */ +#line 2354 "lev_comp.y" + { + /* randline (x1,y1),(x2,y2), roughness */ + add_opvars(splev, "o", SPO_SEL_RNDLINE); + } + break; + + case 372: + +/* Line 1455 of yacc.c */ +#line 2359 "lev_comp.y" + { + add_opvars(splev, "io", W_ANY, SPO_SEL_GROW); + } + break; + + case 373: + +/* Line 1455 of yacc.c */ +#line 2363 "lev_comp.y" + { + add_opvars(splev, "io", (yyvsp[(3) - (6)].i), SPO_SEL_GROW); + } + break; + + case 374: + +/* Line 1455 of yacc.c */ +#line 2367 "lev_comp.y" + { + add_opvars(splev, "iio", (yyvsp[(3) - (6)].i), SPOFILTER_PERCENT, SPO_SEL_FILTER); + } + break; + + case 375: + +/* Line 1455 of yacc.c */ +#line 2371 "lev_comp.y" + { + add_opvars(splev, "io", SPOFILTER_SELECTION, SPO_SEL_FILTER); + } + break; + + case 376: + +/* Line 1455 of yacc.c */ +#line 2375 "lev_comp.y" + { + add_opvars(splev, "io", SPOFILTER_MAPCHAR, SPO_SEL_FILTER); + } + break; + + case 377: + +/* Line 1455 of yacc.c */ +#line 2379 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SEL_FLOOD); + } + break; + + case 378: + +/* Line 1455 of yacc.c */ +#line 2383 "lev_comp.y" + { + add_opvars(splev, "oio", SPO_COPY, 1, SPO_SEL_ELLIPSE); + } + break; + + case 379: + +/* Line 1455 of yacc.c */ +#line 2387 "lev_comp.y" + { + add_opvars(splev, "oio", SPO_COPY, (yyvsp[(7) - (8)].i), SPO_SEL_ELLIPSE); + } + break; + + case 380: + +/* Line 1455 of yacc.c */ +#line 2391 "lev_comp.y" + { + add_opvars(splev, "io", 1, SPO_SEL_ELLIPSE); + } + break; + + case 381: + +/* Line 1455 of yacc.c */ +#line 2395 "lev_comp.y" + { + add_opvars(splev, "io", (yyvsp[(9) - (10)].i), SPO_SEL_ELLIPSE); + } + break; + + case 382: + +/* Line 1455 of yacc.c */ +#line 2399 "lev_comp.y" + { + add_opvars(splev, "iio", (yyvsp[(9) - (14)].i), (yyvsp[(3) - (14)].i), SPO_SEL_GRADIENT); + } + break; + + case 383: + +/* Line 1455 of yacc.c */ +#line 2403 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SEL_COMPLEMENT); + } + break; + + case 384: + +/* Line 1455 of yacc.c */ +#line 2407 "lev_comp.y" + { + check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_SEL); + vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); + add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); + Free((yyvsp[(1) - (1)].map)); + } + break; + + case 385: + +/* Line 1455 of yacc.c */ +#line 2414 "lev_comp.y" + { + /* nothing */ + } + break; + + case 386: + +/* Line 1455 of yacc.c */ +#line 2420 "lev_comp.y" + { + /* nothing */ + } + break; + + case 387: + +/* Line 1455 of yacc.c */ +#line 2424 "lev_comp.y" + { + add_opvars(splev, "o", SPO_SEL_ADD); + } + break; + + case 388: + +/* Line 1455 of yacc.c */ +#line 2430 "lev_comp.y" + { + add_opvars(splev, "iio", (yyvsp[(1) - (1)].dice).num, (yyvsp[(1) - (1)].dice).die, SPO_DICE); + } + break; + + case 392: + +/* Line 1455 of yacc.c */ +#line 2441 "lev_comp.y" + { + add_opvars(splev, "i", (yyvsp[(1) - (1)].i) ); + } + break; + + case 393: + +/* Line 1455 of yacc.c */ +#line 2445 "lev_comp.y" + { + add_opvars(splev, "i", (yyvsp[(1) - (1)].i) ); + } + break; + + case 394: + +/* Line 1455 of yacc.c */ +#line 2449 "lev_comp.y" + { + add_opvars(splev, "i", (yyvsp[(1) - (1)].i) ); + } + break; + + case 395: + +/* Line 1455 of yacc.c */ +#line 2453 "lev_comp.y" + { + /* nothing */ + } + break; + + case 404: + +/* Line 1455 of yacc.c */ +#line 2475 "lev_comp.y" + { + (yyval.lregn) = (yyvsp[(1) - (1)].lregn); + } + break; + + case 405: + +/* Line 1455 of yacc.c */ +#line 2479 "lev_comp.y" + { + if ((yyvsp[(3) - (10)].i) <= 0 || (yyvsp[(3) - (10)].i) >= COLNO) + lc_error("Region (%li,%li,%li,%li) out of level range (x1)!", (yyvsp[(3) - (10)].i), (yyvsp[(5) - (10)].i), (yyvsp[(7) - (10)].i), (yyvsp[(9) - (10)].i)); + else if ((yyvsp[(5) - (10)].i) < 0 || (yyvsp[(5) - (10)].i) >= ROWNO) + lc_error("Region (%li,%li,%li,%li) out of level range (y1)!", (yyvsp[(3) - (10)].i), (yyvsp[(5) - (10)].i), (yyvsp[(7) - (10)].i), (yyvsp[(9) - (10)].i)); + else if ((yyvsp[(7) - (10)].i) <= 0 || (yyvsp[(7) - (10)].i) >= COLNO) + lc_error("Region (%li,%li,%li,%li) out of level range (x2)!", (yyvsp[(3) - (10)].i), (yyvsp[(5) - (10)].i), (yyvsp[(7) - (10)].i), (yyvsp[(9) - (10)].i)); + else if ((yyvsp[(9) - (10)].i) < 0 || (yyvsp[(9) - (10)].i) >= ROWNO) + lc_error("Region (%li,%li,%li,%li) out of level range (y2)!", (yyvsp[(3) - (10)].i), (yyvsp[(5) - (10)].i), (yyvsp[(7) - (10)].i), (yyvsp[(9) - (10)].i)); + (yyval.lregn).x1 = (yyvsp[(3) - (10)].i); + (yyval.lregn).y1 = (yyvsp[(5) - (10)].i); + (yyval.lregn).x2 = (yyvsp[(7) - (10)].i); + (yyval.lregn).y2 = (yyvsp[(9) - (10)].i); + (yyval.lregn).area = 1; + } + break; + + case 406: + +/* Line 1455 of yacc.c */ +#line 2497 "lev_comp.y" + { /* This series of if statements is a hack for MSC 5.1. It seems that its tiny little brain cannot compile if these are all one big if statement. */ - if (yyvsp[-7].i < 0 || yyvsp[-7].i > (int)max_x_map) - yyerror("Region out of map range!"); - else if (yyvsp[-5].i < 0 || yyvsp[-5].i > (int)max_y_map) - yyerror("Region out of map range!"); - else if (yyvsp[-3].i < 0 || yyvsp[-3].i > (int)max_x_map) - yyerror("Region out of map range!"); - else if (yyvsp[-1].i < 0 || yyvsp[-1].i > (int)max_y_map) - yyerror("Region out of map range!"); - current_region.x1 = yyvsp[-7].i; - current_region.y1 = yyvsp[-5].i; - current_region.x2 = yyvsp[-3].i; - current_region.y2 = yyvsp[-1].i; + if ((yyvsp[(2) - (9)].i) < 0 || (yyvsp[(2) - (9)].i) > (int)max_x_map) + lc_error("Region (%li,%li,%li,%li) out of map range (x1)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); + else if ((yyvsp[(4) - (9)].i) < 0 || (yyvsp[(4) - (9)].i) > (int)max_y_map) + lc_error("Region (%li,%li,%li,%li) out of map range (y1)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); + else if ((yyvsp[(6) - (9)].i) < 0 || (yyvsp[(6) - (9)].i) > (int)max_x_map) + lc_error("Region (%li,%li,%li,%li) out of map range (x2)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); + else if ((yyvsp[(8) - (9)].i) < 0 || (yyvsp[(8) - (9)].i) > (int)max_y_map) + lc_error("Region (%li,%li,%li,%li) out of map range (y2)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); + (yyval.lregn).area = 0; + (yyval.lregn).x1 = (yyvsp[(2) - (9)].i); + (yyval.lregn).y1 = (yyvsp[(4) - (9)].i); + (yyval.lregn).x2 = (yyvsp[(6) - (9)].i); + (yyval.lregn).y2 = (yyvsp[(8) - (9)].i); } -break; + break; + + + +/* Line 1455 of yacc.c */ +#line 6040 "y.tab.c" + default: break; } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) + 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 state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (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 - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; } - if ((yyn = yygindex[yym]) != 0 && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yyssp, yystate); -#endif - if (yyssp >= yyss + yystacksize - 1) + + + + if (yyerrstatus == 3) { - goto yyoverflow; + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - return (1); -yyaccept: - return (0); + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this 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); + } + + *++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; + +#if !defined(yyoverflow) || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); } + + + +/* Line 1675 of yacc.c */ +#line 2517 "lev_comp.y" + + +/*lev_comp.y*/ + diff --git a/util/lev_main.c b/util/lev_main.c index 1045bdf34..ce31bb0c8 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -697,7 +697,7 @@ funcdef_defined(f, name, casesense) if (casesense) { if (!strcmp(name, f->name)) return f; } else { - if (!strcasecmp(name, f->name)) return f; + if (!strcmpi(name, f->name)) return f; } f = f->next; } @@ -748,7 +748,7 @@ vardef_defined(f, name, casesense) if (casesense) { if (!strcmp(name, f->name)) return f; } else { - if (!strcasecmp(name, f->name)) return f; + if (!strcmpi(name, f->name)) return f; } f = f->next; } @@ -988,7 +988,7 @@ char c; /* didn't find it; lets try case insensitive search */ for (i = LOW_PM; i < NUMMONS; i++) if (!class || class == mons[i].mlet) - if (!strcasecmp(s, mons[i].mname)) { + if (!strcmpi(s, mons[i].mname)) { if (be_verbose) lc_warning("Monster type \"%s\" matches \"%s\".", s, mons[i].mname); return i; @@ -1020,7 +1020,7 @@ char c; /* class */ for (i = class ? bases[class] : 0; i < NUM_OBJECTS; i++) { if (class && objects[i].oc_class != class) break; objname = obj_descr[i].oc_name; - if (objname && !strcasecmp(s, objname)) { + if (objname && !strcmpi(s, objname)) { if (be_verbose) lc_warning("Object type \"%s\" matches \"%s\".", s, objname); return i; diff --git a/win/win32/levstuff.mak b/win/win32/levstuff.mak index cf749c6ce..2a01e3f1e 100644 --- a/win/win32/levstuff.mak +++ b/win/win32/levstuff.mak @@ -1,26 +1,20 @@ -# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ -# $Date:2002/01/22 22:54:54 $ $Revision: 1.2 $ -#YACC = byacc.exe -#LEX = flex.exe -#YTABC = y_tab.c -#YTABH = y_tab.h -#LEXYYC = lexyy.c - -!IF "$(YACC)"!="" -@echo Yacc-alike set to $(YACC) -@echo YTABC set to $(YTABC) -@echo YTABH set to $(YTABH) -!ENDIF - -!IF "$(LEX)"!="" -@echo Lex-alike set to $(LEX) -@echo LEXYYC set to $(LEXYYC) -!ENDIF +# Uncomment as appropriate for your form of YACC/LEX. +# +#YACC = yacc.exe +#YACC = byacc.exe +YACC = bison.exe -y +# +#LEX = lex.exe +LEX = flex.exe +# these won't have an impact unless YACC/LEX are defined +YTABC = y.tab.c +YTABH = y.tab.h +LEXYYC = lex.yy.c default: all -all: ..\util\lev_yacc.c ..\util\lev_lex.c +all: tools ..\util\lev_yacc.c ..\util\lev_lex.c rebuild: clean all @@ -29,15 +23,29 @@ clean: -del ..\util\lev_yacc.c -del ..\include\lev_comp.h +tools: +!IFDEF YACC + @echo Yacc-alike set to $(YACC) + @echo YTABC set to $(YTABC) + @echo YTABH set to $(YTABH) +!ENDIF + +!IFDEF LEX + @echo Lex-alike set to $(LEX) + @echo LEXYYC set to $(LEXYYC) +!ENDIF + #========================================== # Level Compiler Stuff #========================================== + ..\util\lev_yacc.c ..\include\lev_comp.h: ..\util\lev_comp.y -!IF "$(YACC)"=="" +!IFNDEF YACC @echo Using pre-built lev_yacc.c and lev_comp.h @copy ..\sys\share\lev_yacc.c ..\util\lev_yacc.c @copy ..\sys\share\lev_comp.h ..\include\lev_comp.h !ELSE + @echo Generating lev_yacc.c and lev_comp.h chdir ..\util $(YACC) -d lev_comp.y copy $(YTABC) $@ @@ -48,10 +56,11 @@ clean: !ENDIF ..\util\lev_lex.c: ..\util\lev_comp.l -!IF "$(LEX)"=="" +!IFNDEF LEX @echo Using pre-built lev_lex.c @copy ..\sys\share\lev_lex.c $@ !ELSE + @echo Generating lev_lex.c chdir ..\util $(LEX) lev_comp.l copy $(LEXYYC) $@ From 2ec4ff0b8c35be3f4a44b4928ee72199df46a40c Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 20 Mar 2015 19:25:19 +0200 Subject: [PATCH 229/354] Fix C343-108 (e- leaves prompt on screen) You'll get "You mime eating something." --- include/extern.h | 1 + src/hacklib.c | 33 +++++++++++++++++++++++++++++++++ src/invent.c | 10 +++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/include/extern.h b/include/extern.h index 23d10d324..1ba3e110f 100644 --- a/include/extern.h +++ b/include/extern.h @@ -813,6 +813,7 @@ E void FDECL(copynchars, (char *,const char *,int)); E char FDECL(chrcasecpy, (int,int)); E char *FDECL(strcasecpy, (char *,const char *)); E char *FDECL(s_suffix, (const char *)); +E char *FDECL(ing_suffix, (const char *)); E char *FDECL(xcrypt, (const char *,char *)); E boolean FDECL(onlyspace, (const char *)); E char *FDECL(tabexpand, (char *)); diff --git a/src/hacklib.c b/src/hacklib.c index fd4273074..005aa02b9 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -235,6 +235,39 @@ s_suffix(s) /* return a name converted to possessive */ return buf; } +char * +ing_suffix(s) + const char *s; +{ + const char *vowel = "aeiouy"; + static char buf[BUFSZ]; + char onoff[10]; + char *p; + Strcpy(buf, s); + p = eos(buf); + onoff[0] = *p = *(p+1) = '\0'; + if ((strlen(buf) > 4) && + (!strcmpi(p-3, " on") || + !strcmpi(p-4, " off") || + !strcmpi(p-5, " with"))) { + p = strrchr(buf, ' '); + Strcpy(onoff, p); + } + if (!index(vowel, *(p-1)) && index(vowel, *(p-2)) && !index(vowel, *(p-3))) { + /* tip -> tipp + ing */ + *p = *(p-1); + *(p+1) = '\0'; + } else if (!strcmpi(p-2, "ie")) { /* vie -> vy + ing */ + *(p-2) = 'y'; + *(p-1) = '\0'; + } else if (*(p-1) == 'e') /* grease -> greas + ing */ + *(p-1) = '\0'; + Strcat(buf, "ing"); + if (onoff[0]) Strcat(buf, onoff); + return buf; +} + + char * xcrypt(str, buf) /* trivial text encryption routine (see makedefs) */ const char *str; diff --git a/src/invent.c b/src/invent.c index 24213c7e3..66e7e7307 100644 --- a/src/invent.c +++ b/src/invent.c @@ -972,7 +972,15 @@ register const char *let,*word; return((struct obj *)0); } if(ilet == '-') { - return(allownone ? &zeroobj : (struct obj *) 0); + if (!allownone) { + strcpy(buf, word); + if ((bp = strstr(buf, " or ")) != NULL) { + *bp = '\0'; + bp = (rn2(2) ? buf : (bp + 4)); + } else bp = buf; + You("mime %s something.", ing_suffix(bp)); + } + return(allownone ? &zeroobj : (struct obj *) 0); } if(ilet == def_oc_syms[COIN_CLASS].sym) { if (!usegold) { From 66d642fad92368e8b8a7fb3f6fb42357845db5fa Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 20 Mar 2015 22:06:28 -0400 Subject: [PATCH 230/354] more mswin cmdline Makefile tweaks --- sys/winnt/Makefile.msc | 223 +++++++++++++---------------------------- 1 file changed, 70 insertions(+), 153 deletions(-) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 4be6dd3ab..0216092cc 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -13,8 +13,10 @@ # #============================================================================== # This is used for building two versions of NetHack: +# # A tty port utilizing the Win32 Console I/O subsystem, Console # NetHack; +# # A Win32 native port built on the Windows API, Graphical NetHack or # NetHackW. # @@ -186,38 +188,11 @@ guilibs = $(winlibs) # Exe File Info. #========================================== -# Yacc/Lex ... if you got 'em. # -# If you have yacc and lex programs (or work-alike such as bison -# and flex), comment out the upper two macros and uncomment -# the lower two. -# - -DO_YACC = YACC_MSG -DO_LEX = LEX_MSG -#DO_YACC = YACC_ACT -#DO_LEX = LEX_ACT - -# - Specify your yacc and lex programs (or work-alikes) here. - -#YACC = bison -y -YACC = byacc -#YACC = yacc - -#LEX = lex -LEX = flex - -# -# - Specify your flex skeleton file (if needed). -# - -FLEXSKEL = -#FLEXSKEL = -S../tools/flex.ske - -YTABC = y_tab.c -YTABH = y_tab.h -LEXYYC = lexyy.c - +# For the level compiler bits, +# we just defer to win\win32\dgnstuff.mak +# and win\win32\levstuff.mak +# # # Optional high-quality BSD random number generation routines # (see pcconf.h). Set to nothing if not used. @@ -305,9 +280,6 @@ PDBFILE= /PDB:"$(O)$(GAME).PDB" MAPFILE= /MAP:"$(O)$(GAME).MAP" INCLDIR= /I..\include -ldebug=/DEBUG -cdebug = -Zi -Od - !IF ("$(ldebug)" != "") !IF ("$(ldebug)" != "/RELEASE") ldebug = /DEBUG @@ -344,14 +316,14 @@ LIBS= user32.lib winmm.lib $(ZLIB) !IF ("$(GRAPHICAL)"=="Y") cflagsGame = $(cdebug) $(cflags2) $(guiflags) $(INCLDIR) \ - $(WINPFLAG) $(DLBFLG) -lflagsGame = $(ldebug) $(lflags) $(guilibs) $(GAMEPDBFILE) $(GAMEMAPFILE) + $(WINPFLAG) $(DLBFLG) $(GAMEPDBFILE) $(GAMEMAPFILE) +lflagsGame = $(ldebug) $(lflags) $(guilibs) !ELSE cflagsGame = $(cdebug) $(cflags2) $(conflags) $(INCLDIR) \ - $(WINPFLAG) $(DLBFLG) -lflagsGame = $(ldebug) $(lflags) $(conlibs) $(GAMEPDBFILE) $(GAMEMAPFILE) + $(WINPFLAG) $(DLBFLG) $(GAMEPDBFILE) $(GAMEMAPFILE) +lflagsGame = $(ldebug) $(lflags) $(conlibs) !ENDIF @@ -454,19 +426,20 @@ U = $(UTIL)^\ MAKESRC = $(U)makedefs.c -SPLEVSRC = $(U)lev_yacc.c $(U)lev_$(LEX).c $(U)lev_main.c $(U)panic.c - -DGNCOMPSRC = $(U)dgn_yacc.c $(U)dgn_$(LEX).c $(U)dgn_main.c - MAKEOBJS = $(O)makedefs.o $(O)monst.o $(O)objects.o -SPLEVOBJS = $(O)lev_yacc.o $(O)lev_$(LEX).o $(O)lev_main.o \ +#SPLEVOBJS = $(O)lev_yacc.o $(O)lev_lex.o $(O)lev_main.o \ +# $(O)alloc.o $(O)decl.o $(O)drawing.o \ +# $(O)monst.o $(O)objects.o $(O)panic.o + +SPLEVOBJS = $(O)lev_yacc.o $(O)lev_lex.o $(O)lev_main.o \ $(O)alloc.o $(O)decl.o $(O)drawing.o \ $(O)monst.o $(O)objects.o $(O)panic.o -DGNCOMPOBJS = $(O)dgn_yacc.o $(O)dgn_$(LEX).o $(O)dgn_main.o \ +DGNCOMPOBJS = $(O)dgn_yacc.o $(O)dgn_lex.o $(O)dgn_main.o \ $(O)alloc.o $(O)panic.o + RECOVOBJS = $(O)recover.o TILEFILES = $(WSHR)\monsters.txt $(WSHR)\objects.txt $(WSHR)\other.txt @@ -610,7 +583,6 @@ all : install install: envchk $(GAME) $(O)install.tag @echo Done. - $(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \ $(DAT)\oracles $(DAT)\quest.dat $(O)sp_lev.tag $(DLB) ! IF ("$(USE_DLB)"=="Y") @@ -845,11 +817,11 @@ $(SRC)\vis_tab.c: $(U)makedefs.exe $(U)makedefs -z $(DAT)\engrave: $(DAT)\engrave.txt $(U)makedefs.exe - ../util/makedefs -s + ..\util\makedefs -s $(DAT)\epitaph: $(DAT)\epitaph.txt $(U)makedefs.exe - ../util/makedefs -s + ..\util\makedefs -s $(DAT)\bogusmon: $(DAT)\bogusmon.txt $(U)makedefs.exe - ../util/makedefs -s + ..\util\makedefs -s #========================================== @@ -902,71 +874,55 @@ $(WIN32)\splash.bmp: $(U)uudecode.exe $(WIN32)\splash.uu ..\..\util\uudecode.exe splash.uu chdir ..\..\src -#========================================== +#================================================= # Level Compiler Stuff -#========================================== +#================================================= +# +# defer to the steps in ..\win\win32\levstuff.mak +# -LEVCFLAGS=-c -nologo -DWINVER=0x0400 -DWIN32 -D_WIN32 \ - -D_MT -MT -I..\include -nologo -Z7 -Od -DDLB +$(U)lev_yacc.c $(INCL)\lev_comp.h: $(U)lev_comp.y + nmake -nologo -f ..\win\win32\levstuff.mak default + +LEVCFLAGS=-c -nologo -DWIN32 -D_WIN32 -I$(INCL) -nologo -Z7 -Od -DDLB + +$(O)lev_yacc.o: $(HACK_H) $(SP_LEV_H) $(INCL)\lev_comp.h $(U)lev_yacc.c + $(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_yacc.c + +$(O)lev_lex.o: $(HACK_H) $(INCL)\lev_comp.h $(SP_LEV_H) \ + $(U)lev_lex.c + $(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_lex.c + +$(O)lev_main.o: $(U)lev_main.c $(HACK_H) $(SP_LEV_H) + $(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_main.c $(U)levcomp.exe: $(SPLEVOBJS) @echo Linking $@... - @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk + echo $(link) + echo $(lflagsUtil) + $(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk $(SPLEVOBJS:^ =^ ) << -$(O)lev_yacc.o: $(HACK_H) $(SP_LEV_H) $(INCL)\lev_comp.h $(U)lev_yacc.c - @$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_yacc.c - -$(O)lev_$(LEX).o: $(HACK_H) $(INCL)\lev_comp.h $(SP_LEV_H) \ - $(U)lev_$(LEX).c - @$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_$(LEX).c - -$(O)lev_main.o: $(U)lev_main.c $(HACK_H) $(SP_LEV_H) - @$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_main.c - - -$(U)lev_yacc.c $(INCL)\lev_comp.h : $(U)lev_comp.y -! IF "$(DO_YACC)"=="YACC_ACT" - chdir $(UTIL) - $(YACC) -d lev_comp.y - copy $(YTABC) lev_yacc.c - copy $(YTABH) $(INCL)\lev_comp.h - @del $(YTABC) - @del $(YTABH) - chdir $(SRC) -! ELSE - @echo $(U)lev_comp.y has changed. - @echo To update $(U)lev_yacc.c and $(INCL)\lev_comp.h run $(YACC). - @echo --- - @echo For now, we will copy the prebuilt lev_yacc.c and - @echo lev_comp.h from $(SSYS) into $(UTIL) and use them. - @copy $(SSYS)\lev_yacc.c $(U)lev_yacc.c >nul - @copy $(SSYS)\lev_comp.h $(INCL)\lev_comp.h >nul - @echo /**/ >>$(U)lev_yacc.c - @echo /**/ >>$(INCL)\lev_comp.h -! ENDIF - -$(U)lev_$(LEX).c: $(U)lev_comp.l -! IF "$(DO_LEX)"=="LEX_ACT" - chdir $(UTIL) - $(LEX) $(FLEXSKEL) lev_comp.l - copy $(LEXYYC) $@ - @del $(LEXYYC) - chdir $(SRC) -! ELSE - @echo $(U)lev_comp.l has changed. To update $@ run $(LEX). - @echo --- - @echo For now, we will copy the prebuilt lev_lex.c - @echo from $(SSYS) into $(UTIL) and use it. - @copy $(SSYS)\lev_lex.c $@ >nul - @echo /**/ >>$@ -! ENDIF - -#========================================== +#================================================= # Dungeon Compiler Stuff -#========================================== +#================================================= +# +# defer to the steps in ..\win\win32\dgnstuff.mak +# +$(U)dgn_yacc.c $(INCL)\dgn_comp.h : $(U)dgn_comp.y + nmake -nologo -f ..\win\win32\dgnstuff.mak default + +$(O)dgn_yacc.o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h $(U)dgn_yacc.c + @$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_yacc.c + +$(O)dgn_lex.o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h \ + $(U)dgn_lex.c + @$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_lex.c + +$(O)dgn_main.o: $(HACK_H) $(U)dgn_main.c + @$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_main.c $(U)dgncomp.exe: $(DGNCOMPOBJS) @echo Linking $@... @@ -975,56 +931,9 @@ $(U)dgncomp.exe: $(DGNCOMPOBJS) ) << -$(O)dgn_yacc.o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h $(U)dgn_yacc.c - @$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_yacc.c - -$(O)dgn_$(LEX).o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h \ - $(U)dgn_$(LEX).c - @$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_$(LEX).c - -$(O)dgn_main.o: $(HACK_H) $(U)dgn_main.c - @$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_main.c - -$(U)dgn_yacc.c $(INCL)\dgn_comp.h : $(U)dgn_comp.y -! IF "$(DO_YACC)"=="YACC_ACT" - chdir $(UTIL) - $(YACC) -d dgn_comp.y - copy $(YTABC) dgn_yacc.c - copy $(YTABH) $(INCL)\dgn_comp.h - @del $(YTABC) - @del $(YTABH) - chdir $(SRC) -! ELSE - @echo $(U)dgn_comp.y has changed. To update dgn_yacc.c and - @echo $(INCL)\dgn_comp.h run $(YACC). - @echo --- - @echo For now, we will copy the prebuilt $(U)dgn_yacc.c and - @echo dgn_comp.h from $(SSYS) into $(UTIL) and use them. - @copy $(SSYS)\dgn_yacc.c $(U)dgn_yacc.c >nul - @copy $(SSYS)\dgn_comp.h $(INCL)\dgn_comp.h >nul - @echo /**/ >>$(U)dgn_yacc.c - @echo /**/ >>$(INCL)\dgn_comp.h -! ENDIF - -$(U)dgn_$(LEX).c: $(U)dgn_comp.l -! IF "$(DO_LEX)"=="LEX_ACT" - chdir $(UTIL) - $(LEX) $(FLEXSKEL) dgn_comp.l - copy $(LEXYYC) $@ - @del $(LEXYYC) - chdir $(SRC) -! ELSE - @echo $(U)dgn_comp.l has changed. To update $@ run $(LEX). - @echo --- - @echo For now, we will copy the prebuilt dgn_lex.c - @echo from $(SSYS) into $(UTIL) and use it. - @copy $(SSYS)\dgn_lex.c $@ >nul - @echo /**/ >>$@ -! ENDIF - -#========================================== +#================================================= # Create directory for holding object files -#========================================== +#================================================= $(O)obj.tag: @if not exist $(OBJ)\*.* echo creating directory $(OBJ) @@ -1062,7 +971,7 @@ envchk: #========================================== #=========================================== -# Header files NOT distributed in ..\include +# Header files NOT distributed in $(INCL) #=========================================== $(INCL)\win32api.h: $(NTSYS)\win32api.h @@ -1339,6 +1248,14 @@ clean: if exist $(O)sp_lev.tag del $(O)sp_lev.tag if exist $(O)uudecode.MAP del $(O)uudecode.MAP if exist $(O)uudecode.PDB del $(O)uudecode.PDB + rem + rem defer to the steps in ..\win\win32\levstuff.mak + rem + nmake -nologo -f ..\win\win32\levstuff.mak clean + rem + rem defer to the steps in ..\win\win32\dgnstuff.mak + rem + nmake -nologo -f ..\win\win32\dgnstuff.mak clean ! IF ("$(WINPFLAG)"!="") if exist $(TILEBMP16) del $(TILEBMP16) From 3434a157f816de2c9b47eb3360ff93f763081708 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 21 Mar 2015 11:03:54 +0200 Subject: [PATCH 231/354] More C343-108: Handle "rub on the stone" --- src/invent.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/invent.c b/src/invent.c index 66e7e7307..12f0ef1b3 100644 --- a/src/invent.c +++ b/src/invent.c @@ -973,12 +973,18 @@ register const char *let,*word; } if(ilet == '-') { if (!allownone) { + char *suf = NULL; strcpy(buf, word); + if ((bp = strstr(buf, " on the ")) != NULL) { /* rub on the stone[s] */ + *bp = '\0'; + suf = (bp + 1); + } if ((bp = strstr(buf, " or ")) != NULL) { *bp = '\0'; bp = (rn2(2) ? buf : (bp + 4)); } else bp = buf; - You("mime %s something.", ing_suffix(bp)); + You("mime %s something%s%s.", ing_suffix(bp), + suf ? " " : "", suf ? suf : ""); } return(allownone ? &zeroobj : (struct obj *) 0); } From 6fcc030f37c07aacef9251ad62b2f91fecfe8f0c Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 21 Mar 2015 13:40:07 +0200 Subject: [PATCH 232/354] Make HoOA alignment change depend on object ID The same Helm of opposite alignment will always make the same alignment change for neutrals. --- src/do_wear.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/do_wear.c b/src/do_wear.c index 9925ceaf0..39d3b6c3f 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -391,7 +391,7 @@ Helmet_on(VOID_ARGS) properties, including levitation; uarmh could get dropped or destroyed here */ uchangealign((u.ualign.type != A_NEUTRAL) ? -u.ualign.type : - rn2(2) ? A_CHAOTIC : A_LAWFUL, 1); + (uarmh->o_id % 2) ? A_CHAOTIC : A_LAWFUL, 1); /* makeknown(uarmh->otyp); -- moved below, after xname() */ /*FALLTHRU*/ case DUNCE_CAP: From e3eb74166fc238a55e8c1dcc0332155855b7ce92 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 21 Mar 2015 10:46:11 -0400 Subject: [PATCH 233/354] obj change to support some upcoming work This is an enabling patch for upcoming work. It breaks save/bones so editlevel is incremented. I'd like to a second overloadable int field in struct obj, instead of just the one that is typically overloaded - corpsenm. The second one can be used for things that are being tallied up as opposed to a static one time assignment for reference/linkage purposes. The differentiation will allow both uses to co-exist for the same object. --- include/obj.h | 5 +++-- include/patchlevel.h | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/obj.h b/include/obj.h index f4fd78007..7af927919 100644 --- a/include/obj.h +++ b/include/obj.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 obj.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 obj.h $NHDT-Date: 1426949157 2015/03/21 14:45:57 $ $NHDT-Branch: master $:$NHDT-Revision: 1.36 $ */ /* NetHack 3.5 obj.h $Date: 2012/01/10 17:47:16 $ $Revision: 1.31 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -107,9 +107,10 @@ struct obj { int corpsenm; /* type of corpse is mons[corpsenm] */ #define leashmon corpsenm /* gets m_id of attached pet */ -#define spestudied corpsenm /* # of times a spellbook has been studied */ #define fromsink corpsenm /* a potion from a sink */ #define record_achieve_special corpsenm + int usecount; /* overloaded for various things that tally */ +#define spestudied usecount /* # of times a spellbook has been studied */ unsigned oeaten; /* nutrition left in food, if partly eaten */ long age; /* creation date */ long owornmask; diff --git a/include/patchlevel.h b/include/patchlevel.h index 02b8b3bfa..eab90e89f 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 patchlevel.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 patchlevel.h $NHDT-Date: 1426948844 2015/03/21 14:40:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.95 $ */ /* NetHack 3.5 patchlevel.h $Date: 2012/04/14 08:31:03 $ $Revision: 1.93 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -14,10 +14,10 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 57 +#define EDITLEVEL 58 #define COPYRIGHT_BANNER_A \ -"NetHack, Copyright 1985-2012" +"NetHack, Copyright 1985-2015" #define COPYRIGHT_BANNER_B \ " By Stichting Mathematisch Centrum and M. Stephenson." /* COPYRIGHT_BANNER_C is generated by makedefs into date.h */ From c9df82fb42aa95c2b1c220c28197953c68725825 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 21 Mar 2015 16:49:31 +0200 Subject: [PATCH 234/354] Update hacklib func comment doc --- src/hacklib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hacklib.c b/src/hacklib.c index 005aa02b9..1c091b8f6 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -26,6 +26,7 @@ NetHack, except that rounddiv may call panic(). char chrcasecpy (int,int) char * strcasecpy (char *,const char *) char * s_suffix (const char *) + char * ing_suffix (const char *) char * xcrypt (const char *, char *) boolean onlyspace (const char *) char * tabexpand (char *) From b3ca446426a61daa70914c15392b36e1f373b0fe Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 21 Mar 2015 20:22:34 +0200 Subject: [PATCH 235/354] Change strcmpi to strcasecmp --- util/lev_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/lev_main.c b/util/lev_main.c index ce31bb0c8..1045bdf34 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -697,7 +697,7 @@ funcdef_defined(f, name, casesense) if (casesense) { if (!strcmp(name, f->name)) return f; } else { - if (!strcmpi(name, f->name)) return f; + if (!strcasecmp(name, f->name)) return f; } f = f->next; } @@ -748,7 +748,7 @@ vardef_defined(f, name, casesense) if (casesense) { if (!strcmp(name, f->name)) return f; } else { - if (!strcmpi(name, f->name)) return f; + if (!strcasecmp(name, f->name)) return f; } f = f->next; } @@ -988,7 +988,7 @@ char c; /* didn't find it; lets try case insensitive search */ for (i = LOW_PM; i < NUMMONS; i++) if (!class || class == mons[i].mlet) - if (!strcmpi(s, mons[i].mname)) { + if (!strcasecmp(s, mons[i].mname)) { if (be_verbose) lc_warning("Monster type \"%s\" matches \"%s\".", s, mons[i].mname); return i; @@ -1020,7 +1020,7 @@ char c; /* class */ for (i = class ? bases[class] : 0; i < NUM_OBJECTS; i++) { if (class && objects[i].oc_class != class) break; objname = obj_descr[i].oc_name; - if (objname && !strcmpi(s, objname)) { + if (objname && !strcasecmp(s, objname)) { if (be_verbose) lc_warning("Object type \"%s\" matches \"%s\".", s, objname); return i; From e554cba0acca79983560ab67f5f05b200643e835 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 21 Mar 2015 20:37:44 +0200 Subject: [PATCH 236/354] Update precompiled lex/yacc files --- sys/share/lev_comp.h | 404 ++-- sys/share/lev_lex.c | 3061 +++++++++++++++-------------- sys/share/lev_yacc.c | 4390 ++++++++++++++++++------------------------ 3 files changed, 3778 insertions(+), 4077 deletions(-) diff --git a/sys/share/lev_comp.h b/sys/share/lev_comp.h index 2ea389931..bdfa23854 100644 --- a/sys/share/lev_comp.h +++ b/sys/share/lev_comp.h @@ -1,21 +1,19 @@ +/* A Bison parser, made by GNU Bison 3.0.2. */ -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, 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 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -28,192 +26,200 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ +#ifndef YY_YY_Y_TAB_H_INCLUDED +# define YY_YY_Y_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int yydebug; +#endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - CHAR = 258, - INTEGER = 259, - BOOLEAN = 260, - PERCENT = 261, - SPERCENT = 262, - MINUS_INTEGER = 263, - PLUS_INTEGER = 264, - MAZE_GRID_ID = 265, - SOLID_FILL_ID = 266, - MINES_ID = 267, - ROGUELEV_ID = 268, - MESSAGE_ID = 269, - MAZE_ID = 270, - LEVEL_ID = 271, - LEV_INIT_ID = 272, - GEOMETRY_ID = 273, - NOMAP_ID = 274, - OBJECT_ID = 275, - COBJECT_ID = 276, - MONSTER_ID = 277, - TRAP_ID = 278, - DOOR_ID = 279, - DRAWBRIDGE_ID = 280, - object_ID = 281, - monster_ID = 282, - terrain_ID = 283, - MAZEWALK_ID = 284, - WALLIFY_ID = 285, - REGION_ID = 286, - FILLING = 287, - IRREGULAR = 288, - JOINED = 289, - ALTAR_ID = 290, - LADDER_ID = 291, - STAIR_ID = 292, - NON_DIGGABLE_ID = 293, - NON_PASSWALL_ID = 294, - ROOM_ID = 295, - PORTAL_ID = 296, - TELEPRT_ID = 297, - BRANCH_ID = 298, - LEV = 299, - MINERALIZE_ID = 300, - CORRIDOR_ID = 301, - GOLD_ID = 302, - ENGRAVING_ID = 303, - FOUNTAIN_ID = 304, - POOL_ID = 305, - SINK_ID = 306, - NONE = 307, - RAND_CORRIDOR_ID = 308, - DOOR_STATE = 309, - LIGHT_STATE = 310, - CURSE_TYPE = 311, - ENGRAVING_TYPE = 312, - DIRECTION = 313, - RANDOM_TYPE = 314, - RANDOM_TYPE_BRACKET = 315, - A_REGISTER = 316, - ALIGNMENT = 317, - LEFT_OR_RIGHT = 318, - CENTER = 319, - TOP_OR_BOT = 320, - ALTAR_TYPE = 321, - UP_OR_DOWN = 322, - SUBROOM_ID = 323, - NAME_ID = 324, - FLAGS_ID = 325, - FLAG_TYPE = 326, - MON_ATTITUDE = 327, - MON_ALERTNESS = 328, - MON_APPEARANCE = 329, - ROOMDOOR_ID = 330, - IF_ID = 331, - ELSE_ID = 332, - TERRAIN_ID = 333, - HORIZ_OR_VERT = 334, - REPLACE_TERRAIN_ID = 335, - EXIT_ID = 336, - SHUFFLE_ID = 337, - QUANTITY_ID = 338, - BURIED_ID = 339, - LOOP_ID = 340, - FOR_ID = 341, - TO_ID = 342, - SWITCH_ID = 343, - CASE_ID = 344, - BREAK_ID = 345, - DEFAULT_ID = 346, - ERODED_ID = 347, - TRAPPED_ID = 348, - RECHARGED_ID = 349, - INVIS_ID = 350, - GREASED_ID = 351, - FEMALE_ID = 352, - CANCELLED_ID = 353, - REVIVED_ID = 354, - AVENGE_ID = 355, - FLEEING_ID = 356, - BLINDED_ID = 357, - PARALYZED_ID = 358, - STUNNED_ID = 359, - CONFUSED_ID = 360, - SEENTRAPS_ID = 361, - ALL_ID = 362, - MONTYPE_ID = 363, - GRAVE_ID = 364, - ERODEPROOF_ID = 365, - FUNCTION_ID = 366, - MSG_OUTPUT_TYPE = 367, - COMPARE_TYPE = 368, - UNKNOWN_TYPE = 369, - rect_ID = 370, - fillrect_ID = 371, - line_ID = 372, - randline_ID = 373, - grow_ID = 374, - selection_ID = 375, - flood_ID = 376, - rndcoord_ID = 377, - circle_ID = 378, - ellipse_ID = 379, - filter_ID = 380, - complement_ID = 381, - gradient_ID = 382, - GRADIENT_TYPE = 383, - LIMITED = 384, - HUMIDITY_TYPE = 385, - STRING = 386, - MAP_ID = 387, - NQSTRING = 388, - VARSTRING = 389, - CFUNC = 390, - CFUNC_INT = 391, - CFUNC_STR = 392, - CFUNC_COORD = 393, - CFUNC_REGION = 394, - VARSTRING_INT = 395, - VARSTRING_INT_ARRAY = 396, - VARSTRING_STRING = 397, - VARSTRING_STRING_ARRAY = 398, - VARSTRING_VAR = 399, - VARSTRING_VAR_ARRAY = 400, - VARSTRING_COORD = 401, - VARSTRING_COORD_ARRAY = 402, - VARSTRING_REGION = 403, - VARSTRING_REGION_ARRAY = 404, - VARSTRING_MAPCHAR = 405, - VARSTRING_MAPCHAR_ARRAY = 406, - VARSTRING_MONST = 407, - VARSTRING_MONST_ARRAY = 408, - VARSTRING_OBJ = 409, - VARSTRING_OBJ_ARRAY = 410, - VARSTRING_SEL = 411, - VARSTRING_SEL_ARRAY = 412, - METHOD_INT = 413, - METHOD_INT_ARRAY = 414, - METHOD_STRING = 415, - METHOD_STRING_ARRAY = 416, - METHOD_VAR = 417, - METHOD_VAR_ARRAY = 418, - METHOD_COORD = 419, - METHOD_COORD_ARRAY = 420, - METHOD_REGION = 421, - METHOD_REGION_ARRAY = 422, - METHOD_MAPCHAR = 423, - METHOD_MAPCHAR_ARRAY = 424, - METHOD_MONST = 425, - METHOD_MONST_ARRAY = 426, - METHOD_OBJ = 427, - METHOD_OBJ_ARRAY = 428, - METHOD_SEL = 429, - METHOD_SEL_ARRAY = 430, - DICE = 431 - }; + enum yytokentype + { + CHAR = 258, + INTEGER = 259, + BOOLEAN = 260, + PERCENT = 261, + SPERCENT = 262, + MINUS_INTEGER = 263, + PLUS_INTEGER = 264, + MAZE_GRID_ID = 265, + SOLID_FILL_ID = 266, + MINES_ID = 267, + ROGUELEV_ID = 268, + MESSAGE_ID = 269, + MAZE_ID = 270, + LEVEL_ID = 271, + LEV_INIT_ID = 272, + GEOMETRY_ID = 273, + NOMAP_ID = 274, + OBJECT_ID = 275, + COBJECT_ID = 276, + MONSTER_ID = 277, + TRAP_ID = 278, + DOOR_ID = 279, + DRAWBRIDGE_ID = 280, + object_ID = 281, + monster_ID = 282, + terrain_ID = 283, + MAZEWALK_ID = 284, + WALLIFY_ID = 285, + REGION_ID = 286, + FILLING = 287, + IRREGULAR = 288, + JOINED = 289, + ALTAR_ID = 290, + LADDER_ID = 291, + STAIR_ID = 292, + NON_DIGGABLE_ID = 293, + NON_PASSWALL_ID = 294, + ROOM_ID = 295, + PORTAL_ID = 296, + TELEPRT_ID = 297, + BRANCH_ID = 298, + LEV = 299, + MINERALIZE_ID = 300, + CORRIDOR_ID = 301, + GOLD_ID = 302, + ENGRAVING_ID = 303, + FOUNTAIN_ID = 304, + POOL_ID = 305, + SINK_ID = 306, + NONE = 307, + RAND_CORRIDOR_ID = 308, + DOOR_STATE = 309, + LIGHT_STATE = 310, + CURSE_TYPE = 311, + ENGRAVING_TYPE = 312, + DIRECTION = 313, + RANDOM_TYPE = 314, + RANDOM_TYPE_BRACKET = 315, + A_REGISTER = 316, + ALIGNMENT = 317, + LEFT_OR_RIGHT = 318, + CENTER = 319, + TOP_OR_BOT = 320, + ALTAR_TYPE = 321, + UP_OR_DOWN = 322, + SUBROOM_ID = 323, + NAME_ID = 324, + FLAGS_ID = 325, + FLAG_TYPE = 326, + MON_ATTITUDE = 327, + MON_ALERTNESS = 328, + MON_APPEARANCE = 329, + ROOMDOOR_ID = 330, + IF_ID = 331, + ELSE_ID = 332, + TERRAIN_ID = 333, + HORIZ_OR_VERT = 334, + REPLACE_TERRAIN_ID = 335, + EXIT_ID = 336, + SHUFFLE_ID = 337, + QUANTITY_ID = 338, + BURIED_ID = 339, + LOOP_ID = 340, + FOR_ID = 341, + TO_ID = 342, + SWITCH_ID = 343, + CASE_ID = 344, + BREAK_ID = 345, + DEFAULT_ID = 346, + ERODED_ID = 347, + TRAPPED_ID = 348, + RECHARGED_ID = 349, + INVIS_ID = 350, + GREASED_ID = 351, + FEMALE_ID = 352, + CANCELLED_ID = 353, + REVIVED_ID = 354, + AVENGE_ID = 355, + FLEEING_ID = 356, + BLINDED_ID = 357, + PARALYZED_ID = 358, + STUNNED_ID = 359, + CONFUSED_ID = 360, + SEENTRAPS_ID = 361, + ALL_ID = 362, + MONTYPE_ID = 363, + GRAVE_ID = 364, + ERODEPROOF_ID = 365, + FUNCTION_ID = 366, + MSG_OUTPUT_TYPE = 367, + COMPARE_TYPE = 368, + UNKNOWN_TYPE = 369, + rect_ID = 370, + fillrect_ID = 371, + line_ID = 372, + randline_ID = 373, + grow_ID = 374, + selection_ID = 375, + flood_ID = 376, + rndcoord_ID = 377, + circle_ID = 378, + ellipse_ID = 379, + filter_ID = 380, + complement_ID = 381, + gradient_ID = 382, + GRADIENT_TYPE = 383, + LIMITED = 384, + HUMIDITY_TYPE = 385, + STRING = 386, + MAP_ID = 387, + NQSTRING = 388, + VARSTRING = 389, + CFUNC = 390, + CFUNC_INT = 391, + CFUNC_STR = 392, + CFUNC_COORD = 393, + CFUNC_REGION = 394, + VARSTRING_INT = 395, + VARSTRING_INT_ARRAY = 396, + VARSTRING_STRING = 397, + VARSTRING_STRING_ARRAY = 398, + VARSTRING_VAR = 399, + VARSTRING_VAR_ARRAY = 400, + VARSTRING_COORD = 401, + VARSTRING_COORD_ARRAY = 402, + VARSTRING_REGION = 403, + VARSTRING_REGION_ARRAY = 404, + VARSTRING_MAPCHAR = 405, + VARSTRING_MAPCHAR_ARRAY = 406, + VARSTRING_MONST = 407, + VARSTRING_MONST_ARRAY = 408, + VARSTRING_OBJ = 409, + VARSTRING_OBJ_ARRAY = 410, + VARSTRING_SEL = 411, + VARSTRING_SEL_ARRAY = 412, + METHOD_INT = 413, + METHOD_INT_ARRAY = 414, + METHOD_STRING = 415, + METHOD_STRING_ARRAY = 416, + METHOD_VAR = 417, + METHOD_VAR_ARRAY = 418, + METHOD_COORD = 419, + METHOD_COORD_ARRAY = 420, + METHOD_REGION = 421, + METHOD_REGION_ARRAY = 422, + METHOD_MAPCHAR = 423, + METHOD_MAPCHAR_ARRAY = 424, + METHOD_MONST = 425, + METHOD_MONST_ARRAY = 426, + METHOD_OBJ = 427, + METHOD_OBJ_ARRAY = 428, + METHOD_SEL = 429, + METHOD_SEL_ARRAY = 430, + DICE = 431 + }; #endif /* Tokens. */ #define CHAR 258 @@ -391,15 +397,12 @@ #define METHOD_SEL_ARRAY 430 #define DICE 431 - - - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { - -/* Line 1676 of yacc.c */ -#line 146 "lev_comp.y" +#line 148 "lev_comp.y" /* yacc.c:1909 */ long i; char* map; @@ -436,16 +439,15 @@ typedef union YYSTYPE char *varstr; } meth; - - -/* Line 1676 of yacc.c */ -#line 443 "y.tab.h" -} YYSTYPE; +#line 443 "y.tab.h" /* yacc.c:1909 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif + extern YYSTYPE yylval; +int yyparse (void); +#endif /* !YY_YY_Y_TAB_H_INCLUDED */ diff --git a/sys/share/lev_lex.c b/sys/share/lev_lex.c index b4cb65d97..91f13e8f8 100644 --- a/sys/share/lev_lex.c +++ b/sys/share/lev_lex.c @@ -1,67 +1,113 @@ -/* 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 $ - */ +#line 3 "lex.yy.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 39 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ #include +#include +#include +#include +/* end standard C headers. */ -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 #endif +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ #ifdef __cplusplus -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) -#define YY_USE_PROTOS #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#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 @@ -76,71 +122,79 @@ * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ -#define BEGIN yy_start = 1 + 2 * +#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 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_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t yyleng; -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 YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + +/* 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; \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - 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; - +#define unput(c) yyunput( c, (yytext_ptr) ) +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; @@ -156,7 +210,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t 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 @@ -177,12 +231,16 @@ struct yy_buffer_state */ int yy_at_bol; + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + /* 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 @@ -196,28 +254,38 @@ struct yy_buffer_state * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 - }; -static YY_BUFFER_STATE yy_current_buffer = 0; + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* 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". + * + * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER yy_current_buffer +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* 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; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t 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_init = 0; /* 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 @@ -225,184 +293,211 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart YY_PROTO(( FILE *input_file )); +void yyrestart (FILE *input_file ); +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); +void yy_delete_buffer (YY_BUFFER_STATE b ); +void yy_flush_buffer (YY_BUFFER_STATE b ); +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state (void ); -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 ) +static void yyensure_buffer_stack (void ); +static void yy_load_buffer_state (void ); +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); -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 )); +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) -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 * )); +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); + +void *yyalloc (yy_size_t ); +void *yyrealloc (void *,yy_size_t ); +void yyfree (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; \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->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; \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ typedef 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 yytext -static 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[] )); +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (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; \ + (yytext_ptr) = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; + (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 195 -#define YY_END_OF_BUFFER 196 -static yyconst short int yy_accept[1038] = +#define YY_NUM_RULES 197 +#define YY_END_OF_BUFFER 198 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[1049] = { 0, - 0, 0, 0, 0, 196, 194, 190, 189, 194, 194, - 194, 194, 194, 194, 193, 179, 187, 194, 188, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 194, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 190, 194, 193, 2, 194, 190, 194, 194, 193, 179, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 190, 194, 193, 190, 189, 183, - 0, 180, 181, 0, 0, 177, 193, 176, 178, 179, + 0, 0, 0, 0, 198, 196, 192, 191, 196, 196, + 196, 196, 196, 196, 195, 181, 189, 196, 190, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 196, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 192, 196, 195, 2, 196, 192, 196, 196, 195, 181, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 192, 196, 195, 192, 191, 185, + 0, 182, 183, 0, 0, 179, 195, 178, 180, 181, - 193, 185, 184, 182, 186, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 39, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 55, 193, 193, 0, 0, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 195, 187, 186, 184, 188, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 39, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 55, 195, 195, 0, 0, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 153, 193, 193, 190, 0, 0, - 3, 193, 2, 2, 0, 190, 0, 177, 193, 176, - 179, 193, 193, 193, 193, 193, 39, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 190, 0, 2, 0, - 0, 193, 192, 0, 192, 174, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 54, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 153, 195, 195, 192, 0, + 0, 3, 195, 2, 2, 0, 192, 0, 179, 195, + 178, 181, 195, 195, 195, 195, 195, 39, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 192, 0, 2, + 0, 0, 195, 194, 0, 194, 176, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 54, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, - 193, 193, 0, 193, 103, 193, 83, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 79, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 81, 193, 193, 193, 138, - 193, 193, 193, 193, 127, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 16, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 125, 193, 193, 193, + 195, 195, 195, 0, 195, 103, 195, 83, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 79, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 81, 195, 195, 195, + 195, 138, 195, 195, 195, 195, 127, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 16, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 125, 195, - 193, 193, 193, 193, 193, 80, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 191, 193, 193, - 193, 58, 193, 193, 193, 22, 193, 40, 193, 41, - 193, 193, 193, 193, 49, 193, 193, 193, 193, 56, - 6, 193, 193, 193, 53, 193, 193, 193, 36, 193, - 193, 193, 193, 42, 193, 35, 193, 193, 193, 193, - 193, 21, 193, 0, 175, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 159, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 154, 157, 113, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 195, 195, 195, 195, 195, 195, 195, 80, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 193, + 195, 195, 195, 58, 195, 195, 195, 22, 195, 40, + 195, 41, 195, 195, 195, 195, 49, 195, 195, 195, + 195, 56, 6, 195, 195, 195, 53, 195, 195, 195, + 36, 195, 195, 195, 195, 42, 195, 35, 195, 195, + 195, 195, 195, 21, 195, 0, 177, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 159, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 154, + 157, 113, 195, 195, 195, 195, 195, 195, 195, 195, - 193, 193, 69, 193, 193, 193, 193, 193, 193, 193, - 120, 193, 193, 67, 193, 193, 193, 193, 160, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 118, 193, - 193, 193, 106, 193, 193, 193, 193, 193, 193, 193, - 65, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 156, - 193, 193, 193, 193, 193, 115, 15, 0, 193, 193, - 193, 193, 193, 193, 2, 0, 28, 193, 59, 193, - 193, 193, 193, 193, 13, 193, 193, 193, 50, 193, - 193, 7, 193, 193, 193, 193, 5, 193, 193, 193, + 195, 195, 195, 195, 69, 195, 195, 195, 195, 195, + 195, 195, 195, 120, 195, 195, 67, 195, 195, 195, + 195, 160, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 118, 195, 195, 195, 106, 195, 195, 195, 195, + 195, 195, 195, 65, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 156, 195, 195, 195, 195, 195, 115, 15, + 0, 195, 195, 195, 195, 195, 195, 2, 0, 28, + 195, 59, 195, 195, 195, 195, 195, 13, 195, 195, + 195, 50, 195, 195, 7, 195, 195, 195, 195, 5, - 193, 193, 193, 193, 193, 193, 30, 193, 193, 193, - 193, 193, 119, 152, 193, 193, 193, 146, 193, 193, - 161, 193, 193, 193, 193, 193, 140, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 155, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 11, 193, 193, 193, 193, 193, 193, 193, 112, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 124, 193, 12, 193, 193, 193, 193, 193, - 193, 193, 82, 114, 193, 193, 193, 193, 193, 193, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 30, + 195, 195, 195, 195, 195, 119, 152, 195, 195, 195, + 146, 195, 195, 161, 195, 195, 195, 195, 195, 140, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 155, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 11, 195, 195, 195, 195, + 195, 195, 195, 112, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 124, 195, 12, 195, + 195, 195, 195, 195, 195, 195, 82, 114, 195, 195, - 193, 193, 128, 193, 193, 193, 193, 193, 33, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 29, 193, - 193, 193, 193, 193, 193, 17, 31, 193, 27, 193, - 193, 193, 193, 57, 193, 193, 193, 193, 145, 96, - 193, 193, 126, 110, 86, 193, 122, 72, 107, 193, - 193, 193, 164, 193, 193, 87, 193, 93, 129, 193, - 74, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 134, 193, 193, 108, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 109, 167, 193, 193, - 16, 193, 193, 193, 193, 77, 193, 116, 193, 193, + 195, 195, 195, 195, 195, 195, 128, 195, 195, 195, + 195, 195, 33, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 29, 195, 195, 195, 195, 195, 195, 17, + 31, 195, 27, 195, 195, 195, 195, 57, 195, 195, + 195, 195, 145, 96, 195, 195, 126, 110, 86, 195, + 122, 72, 107, 195, 195, 195, 164, 195, 195, 87, + 195, 93, 129, 195, 74, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 134, 195, + 195, 108, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 109, 167, 195, 195, 16, 195, 195, 195, 195, - 193, 193, 193, 111, 193, 193, 193, 151, 172, 193, - 78, 193, 193, 193, 193, 193, 193, 193, 193, 1, - 193, 57, 193, 193, 193, 60, 193, 193, 193, 193, - 193, 193, 193, 4, 193, 19, 193, 193, 193, 193, - 193, 62, 43, 193, 46, 26, 193, 162, 98, 193, - 193, 193, 193, 73, 158, 193, 193, 97, 193, 193, - 193, 92, 193, 193, 193, 193, 144, 193, 193, 193, - 135, 193, 193, 193, 193, 193, 20, 63, 139, 137, - 193, 193, 193, 193, 193, 193, 193, 117, 193, 131, - 95, 193, 150, 193, 193, 193, 193, 100, 47, 89, + 77, 195, 116, 195, 195, 195, 195, 195, 111, 195, + 195, 195, 151, 172, 195, 195, 78, 195, 195, 195, + 195, 195, 195, 195, 195, 1, 195, 57, 195, 195, + 195, 60, 195, 195, 195, 195, 195, 195, 195, 4, + 195, 19, 195, 195, 195, 195, 195, 62, 43, 195, + 46, 26, 195, 162, 98, 195, 195, 195, 195, 73, + 158, 195, 195, 97, 195, 195, 195, 92, 195, 195, + 195, 195, 144, 195, 195, 195, 195, 135, 195, 195, + 195, 195, 195, 20, 63, 139, 137, 195, 195, 195, + 195, 195, 195, 195, 117, 195, 131, 95, 195, 150, - 193, 193, 193, 193, 193, 26, 193, 45, 193, 193, - 34, 61, 14, 8, 25, 193, 193, 193, 193, 193, - 23, 193, 168, 193, 193, 193, 101, 193, 66, 193, - 75, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 149, 9, 193, 193, 193, 193, 143, 193, 85, - 68, 193, 71, 193, 193, 193, 193, 163, 130, 133, - 193, 105, 18, 193, 51, 193, 193, 193, 193, 193, - 193, 94, 141, 193, 193, 70, 173, 121, 193, 166, - 193, 91, 132, 84, 147, 148, 170, 193, 193, 99, - 171, 90, 193, 64, 193, 10, 136, 24, 52, 193, + 195, 195, 195, 195, 195, 100, 47, 89, 195, 195, + 195, 195, 195, 26, 195, 45, 195, 195, 34, 61, + 14, 8, 25, 195, 195, 195, 195, 195, 23, 195, + 168, 195, 195, 195, 101, 195, 66, 195, 75, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 149, 9, 195, 195, 195, 195, 143, 195, 85, 68, + 195, 71, 195, 195, 195, 195, 175, 163, 130, 133, + 195, 105, 18, 195, 51, 195, 195, 195, 195, 195, + 195, 94, 141, 195, 195, 70, 173, 121, 195, 166, + 195, 174, 91, 132, 84, 147, 148, 170, 195, 195, - 193, 193, 193, 193, 76, 88, 123, 104, 193, 165, - 102, 193, 193, 193, 193, 193, 193, 193, 193, 37, - 38, 193, 193, 193, 142, 169, 193, 193, 193, 193, - 193, 193, 193, 48, 32, 44, 0 + 99, 171, 90, 195, 64, 195, 10, 136, 24, 52, + 195, 195, 195, 195, 195, 76, 88, 123, 104, 195, + 165, 102, 195, 195, 195, 195, 195, 195, 195, 195, + 37, 38, 195, 195, 195, 142, 169, 195, 195, 195, + 195, 195, 195, 195, 48, 32, 44, 0 } ; -static yyconst int yy_ec[256] = +static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, @@ -434,7 +529,7 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst int yy_meta[75] = +static yyconst flex_int32_t yy_meta[75] = { 0, 1, 2, 3, 2, 2, 1, 1, 2, 1, 1, 1, 2, 4, 2, 4, 1, 1, 1, 5, 5, @@ -446,245 +541,247 @@ static yyconst int yy_meta[75] = 6, 5, 6, 6 } ; -static yyconst short int yy_base[1045] = +static yyconst flex_int16_t yy_base[1056] = { 0, - 0, 73, 102, 77, 1276, 1277, 75, 1277, 1272, 1257, - 1266, 0, 1226, 1256, 1255, 78, 66, 1252, 1251, 1237, - 1230, 57, 63, 59, 64, 101, 0, 63, 79, 119, - 94, 1245, 1231, 128, 127, 126, 1244, 104, 109, 118, - 133, 94, 139, 151, 1196, 95, 111, 1198, 157, 146, - 163, 100, 164, 1191, 166, 169, 178, 56, 1206, 1205, - 219, 1254, 216, 1277, 1253, 243, 248, 251, 264, 223, - 168, 120, 241, 229, 267, 1240, 249, 289, 294, 152, - 299, 308, 221, 296, 343, 360, 301, 260, 1277, 1277, - 1247, 1277, 0, 1242, 1241, 1236, 0, 1235, 1277, 277, + 0, 73, 102, 77, 1287, 1288, 75, 1288, 1283, 1268, + 1277, 0, 1237, 1267, 1266, 78, 66, 1263, 1262, 1248, + 1241, 57, 63, 59, 64, 101, 0, 63, 79, 119, + 94, 1256, 1242, 128, 127, 126, 1255, 104, 109, 118, + 133, 94, 139, 151, 1207, 95, 132, 1209, 157, 164, + 154, 100, 166, 1202, 173, 175, 176, 56, 1217, 1216, + 239, 1265, 226, 1288, 1264, 252, 248, 258, 271, 157, + 162, 120, 248, 216, 274, 1251, 201, 249, 296, 140, + 306, 301, 176, 265, 346, 352, 369, 232, 1288, 1288, + 1258, 1288, 0, 1253, 1252, 1247, 0, 1246, 1288, 278, - 1234, 1277, 1277, 1277, 1277, 1210, 296, 1210, 303, 1222, - 1212, 1225, 1206, 1217, 1214, 1221, 250, 1207, 1205, 1207, - 1217, 0, 1208, 1212, 1193, 1199, 1187, 1193, 1197, 1196, - 1196, 160, 1198, 263, 1193, 308, 1191, 1184, 1190, 1202, - 1200, 1192, 227, 0, 1199, 1187, 192, 340, 301, 1143, - 1165, 1154, 1160, 1163, 303, 1143, 1147, 1143, 1146, 1145, - 1157, 1139, 1141, 321, 1137, 1131, 1128, 1133, 1132, 1138, - 1142, 1133, 1135, 1133, 1133, 217, 304, 311, 341, 1122, - 1125, 1133, 1118, 188, 334, 1137, 350, 26, 1125, 1124, - 1124, 1115, 363, 1125, 1129, 1115, 1131, 1126, 1129, 326, + 1245, 1288, 1288, 1288, 1288, 1221, 246, 1221, 234, 1233, + 1223, 1236, 1217, 1228, 1225, 1232, 260, 1218, 1216, 1218, + 1228, 0, 1219, 1223, 1204, 1210, 1198, 1204, 1208, 1207, + 1207, 246, 1209, 270, 1204, 301, 1202, 1195, 1201, 1213, + 1211, 1203, 306, 0, 1210, 1198, 347, 208, 301, 1154, + 1176, 1165, 1171, 1174, 317, 1154, 1158, 1154, 1157, 1156, + 1168, 1150, 1152, 338, 1148, 1142, 1139, 1144, 1143, 1149, + 1153, 1144, 1146, 1144, 1144, 300, 348, 280, 337, 1150, + 1132, 1135, 1143, 1128, 217, 345, 1147, 314, 26, 1135, + 1134, 1134, 1125, 360, 1135, 1139, 1125, 1141, 1136, 1139, - 363, 1122, 1124, 1120, 1112, 366, 357, 283, 1104, 1103, - 1105, 1106, 336, 376, 0, 1103, 325, 433, 1165, 1164, - 1277, 366, 1277, 1277, 1163, 440, 444, 447, 1150, 0, - 406, 422, 339, 430, 438, 140, 1149, 439, 424, 441, - 425, 444, 448, 450, 303, 451, 475, 0, 1277, 1160, - 0, 454, 1277, 1151, 1150, 1145, 1140, 1126, 1138, 1133, - 1117, 1118, 1134, 1116, 1110, 1127, 1113, 1110, 1122, 0, - 1114, 1124, 1113, 1121, 1102, 1103, 1118, 1116, 1104, 1114, - 1099, 1112, 1097, 1110, 1113, 1083, 1107, 1099, 1090, 1105, - 1099, 1095, 1093, 1099, 1093, 1094, 1084, 1081, 1095, 1081, + 356, 359, 1132, 1134, 1130, 1122, 372, 259, 325, 1114, + 1113, 1115, 1116, 366, 376, 0, 1113, 349, 435, 1175, + 1174, 1288, 397, 1288, 1288, 1173, 442, 446, 449, 1160, + 0, 423, 404, 424, 316, 439, 440, 1159, 305, 441, + 442, 444, 445, 447, 448, 170, 450, 484, 0, 1288, + 1170, 0, 456, 1288, 1161, 1160, 1155, 1150, 1136, 1148, + 1143, 1127, 1128, 1144, 1126, 1120, 1137, 1123, 1120, 1132, + 0, 1124, 1134, 1123, 1131, 1112, 1113, 1128, 1126, 1114, + 1124, 1109, 1122, 1107, 1120, 1123, 1093, 1117, 1109, 1100, + 1115, 1109, 1105, 1103, 1109, 1103, 1104, 1094, 1091, 1105, - 1082, 1085, 466, 1059, 0, 1064, 0, 1049, 1058, 1048, - 1050, 1041, 1045, 1043, 1037, 1045, 425, 1052, 1034, 1038, - 1049, 1032, 1038, 1033, 1042, 1028, 1032, 0, 1025, 1024, - 1034, 1024, 1037, 1021, 1038, 424, 1033, 1022, 420, 1035, - 1012, 1028, 1029, 1023, 1011, 0, 1021, 1024, 1014, 0, - 1007, 1008, 1016, 1019, 0, 1012, 1017, 1006, 1018, 1008, - 1013, 1012, 407, 1011, 995, 1002, 998, 999, 438, 991, - 1005, 1004, 994, 1006, 1003, 992, 990, 994, 998, 429, - 980, 991, 991, 995, 976, 993, 977, 980, 988, 974, - 436, 982, 970, 988, 974, 969, 0, 970, 980, 963, + 1091, 1092, 1095, 462, 1069, 0, 1074, 0, 1059, 1068, + 1058, 1060, 1051, 1055, 1053, 1047, 1055, 416, 1062, 1044, + 1048, 1059, 1042, 1048, 1043, 1052, 1038, 1042, 0, 1035, + 1034, 1044, 1034, 1047, 1031, 1048, 416, 1043, 1032, 427, + 1045, 1022, 1038, 1039, 1033, 1021, 0, 1036, 1030, 1033, + 1023, 0, 1016, 1017, 1025, 1028, 0, 1021, 1026, 1015, + 1027, 1017, 1022, 1021, 402, 1020, 1004, 1011, 1007, 1008, + 440, 1000, 1014, 1013, 1003, 1015, 1012, 1001, 999, 1003, + 1007, 426, 989, 1000, 1000, 1004, 985, 1002, 986, 989, + 997, 983, 438, 991, 979, 997, 983, 978, 0, 979, - 974, 967, 972, 960, 959, 0, 491, 481, 486, 995, - 487, 490, 488, 471, 489, 491, 507, 1277, 989, 1003, - 994, 0, 1003, 994, 981, 0, 999, 0, 999, 0, - 980, 978, 977, 991, 0, 990, 964, 988, 980, 0, - 968, 989, 971, 968, 0, 971, 486, 983, 0, 984, - 969, 968, 981, 977, 974, 0, 961, 963, 974, 960, - 974, 0, 965, 511, 1277, 929, 924, 923, 935, 932, - 933, 918, 932, 931, 919, 928, 927, 0, 926, 925, - 910, 916, 922, 917, 913, 903, 918, 0, 0, 0, - 906, 920, 915, 914, 906, 464, 912, 907, 911, 905, + 989, 972, 983, 976, 981, 969, 968, 0, 495, 487, + 481, 1004, 488, 490, 492, 493, 495, 496, 512, 1288, + 998, 1012, 1003, 0, 1012, 1003, 990, 0, 1008, 0, + 1008, 0, 989, 987, 986, 1000, 0, 999, 973, 997, + 989, 0, 977, 998, 980, 977, 0, 980, 490, 992, + 0, 993, 978, 977, 990, 986, 983, 0, 970, 972, + 983, 969, 983, 0, 974, 476, 1288, 938, 933, 932, + 944, 941, 942, 927, 941, 940, 928, 937, 936, 0, + 935, 934, 919, 925, 931, 926, 922, 912, 927, 0, + 0, 0, 915, 929, 924, 923, 915, 464, 921, 916, - 908, 893, 0, 946, 904, 883, 899, 888, 899, 900, - 0, 899, 883, 0, 897, 900, 886, 889, 0, 463, - 879, 877, 871, 877, 885, 878, 891, 876, 0, 882, - 877, 885, 0, 875, 881, 884, 864, 882, 465, 881, - 0, 869, 858, 859, 863, 872, 856, 870, 874, 870, - 852, 857, 849, 865, 860, 849, 852, 864, 848, 0, - 845, 850, 852, 458, 851, 0, 1277, 904, 509, 887, - 514, 516, 518, 517, 1277, 902, 0, 878, 0, 876, - 880, 871, 864, 859, 0, 879, 870, 858, 0, 864, - 858, 0, 874, 867, 872, 867, 0, 862, 869, 849, + 920, 914, 917, 902, 0, 955, 913, 892, 908, 900, + 896, 907, 908, 0, 907, 891, 0, 905, 908, 894, + 897, 0, 465, 887, 885, 879, 885, 893, 886, 899, + 884, 0, 890, 885, 893, 0, 883, 889, 892, 872, + 890, 458, 889, 0, 877, 866, 867, 871, 880, 864, + 878, 882, 878, 860, 865, 857, 873, 868, 857, 860, + 872, 856, 0, 853, 858, 860, 467, 859, 0, 1288, + 912, 507, 895, 516, 517, 521, 519, 1288, 910, 0, + 886, 0, 884, 888, 879, 872, 867, 0, 887, 878, + 866, 0, 872, 866, 0, 882, 875, 880, 875, 0, - 856, 854, 852, 862, 849, 851, 0, 847, 853, 845, - 850, 852, 0, 0, 822, 810, 820, 0, 819, 818, - 0, 809, 807, 816, 807, 800, 0, 812, 812, 808, - 809, 794, 808, 792, 788, 482, 0, 804, 804, 802, - 788, 791, 798, 798, 777, 796, 475, 788, 784, 786, - 788, 775, 791, 787, 788, 788, 771, 771, 784, 770, - 782, 0, 781, 769, 783, 776, 764, 765, 779, 0, - 774, 758, 752, 770, 759, 765, 761, 763, 758, 752, - 768, 763, 0, 752, 0, 745, 745, 744, 743, 743, - 756, 756, 753, 0, 753, 752, 747, 750, 735, 741, + 870, 877, 857, 864, 862, 860, 870, 857, 859, 0, + 855, 861, 853, 858, 860, 0, 0, 830, 818, 828, + 0, 827, 826, 0, 817, 815, 824, 815, 808, 0, + 820, 820, 816, 817, 802, 816, 800, 796, 485, 0, + 812, 812, 810, 796, 799, 806, 806, 785, 804, 478, + 796, 792, 794, 790, 795, 782, 798, 794, 795, 795, + 778, 778, 791, 777, 789, 0, 788, 776, 790, 783, + 771, 772, 786, 0, 781, 765, 759, 777, 766, 772, + 768, 770, 765, 759, 775, 770, 0, 759, 0, 752, + 752, 751, 750, 750, 763, 763, 491, 0, 761, 760, - 738, 742, 0, 747, 763, 521, 522, 525, 0, 764, - 762, 756, 766, 765, 764, 757, 753, 769, 0, 757, - 763, 755, 748, 758, 745, 0, 0, 733, 0, 757, - 743, 734, 80, 0, 386, 510, 500, 498, 0, 0, - 498, 501, 0, 0, 0, 494, 0, 0, 0, 493, - 495, 504, 0, 506, 507, 0, 495, 0, 0, 511, - 0, 508, 507, 503, 517, 515, 515, 512, 507, 509, - 519, 523, 514, 0, 518, 524, 0, 508, 510, 528, - 523, 511, 516, 530, 524, 523, 0, 0, 526, 523, - 0, 514, 520, 526, 523, 0, 530, 548, 539, 529, + 755, 758, 743, 749, 746, 750, 0, 755, 771, 524, + 526, 532, 0, 772, 770, 764, 774, 773, 772, 765, + 761, 777, 0, 765, 771, 763, 756, 766, 750, 0, + 0, 720, 0, 88, 261, 336, 519, 0, 515, 523, + 514, 509, 0, 0, 507, 508, 0, 0, 0, 501, + 0, 0, 0, 500, 502, 511, 0, 512, 513, 0, + 501, 0, 0, 517, 0, 514, 513, 509, 523, 521, + 521, 518, 513, 515, 525, 516, 530, 521, 0, 525, + 531, 0, 515, 517, 535, 530, 518, 523, 537, 531, + 530, 0, 0, 533, 530, 0, 521, 527, 533, 530, - 544, 531, 537, 0, 533, 543, 544, 0, 0, 545, - 0, 551, 542, 553, 553, 554, 555, 541, 561, 0, - 596, 597, 598, 591, 579, 0, 594, 585, 586, 588, - 578, 588, 594, 0, 597, 0, 600, 589, 606, 580, - 593, 0, 0, 592, 0, 0, 571, 0, 0, 579, - 580, 581, 583, 0, 0, 573, 569, 0, 578, 571, - 574, 0, 588, 588, 581, 577, 0, 586, 598, 585, - 0, 583, 597, 583, 600, 600, 0, 0, 0, 0, - 597, 592, 603, 597, 605, 586, 607, 1277, 608, 0, - 0, 610, 0, 614, 601, 610, 606, 0, 0, 0, + 0, 537, 555, 546, 536, 551, 538, 544, 0, 540, + 550, 551, 0, 0, 552, 556, 0, 559, 550, 561, + 561, 562, 563, 549, 569, 0, 604, 605, 606, 599, + 587, 0, 602, 593, 594, 596, 586, 596, 602, 0, + 605, 0, 608, 597, 614, 588, 601, 0, 0, 600, + 0, 0, 579, 0, 0, 587, 588, 589, 591, 0, + 0, 581, 577, 0, 586, 579, 582, 0, 596, 596, + 589, 585, 0, 594, 595, 607, 594, 0, 592, 606, + 592, 609, 609, 0, 0, 0, 0, 606, 601, 612, + 606, 614, 595, 616, 1288, 617, 0, 0, 619, 0, - 615, 616, 617, 617, 611, 657, 637, 0, 649, 650, - 0, 0, 0, 0, 0, 632, 658, 637, 646, 642, - 0, 633, 0, 630, 631, 622, 0, 622, 0, 626, - 0, 635, 620, 633, 624, 642, 639, 627, 632, 642, - 630, 0, 0, 637, 643, 633, 648, 0, 649, 0, - 0, 650, 0, 639, 642, 649, 646, 0, 0, 0, - 655, 0, 0, 685, 0, 686, 690, 692, 676, 690, - 678, 0, 0, 647, 662, 0, 0, 0, 649, 0, - 658, 0, 0, 0, 0, 0, 0, 657, 652, 0, - 0, 0, 654, 0, 654, 0, 0, 0, 0, 693, + 623, 610, 619, 615, 603, 0, 0, 0, 625, 626, + 627, 627, 621, 667, 647, 0, 659, 660, 0, 0, + 0, 0, 0, 642, 668, 647, 656, 652, 0, 643, + 0, 640, 641, 632, 0, 632, 0, 636, 0, 645, + 630, 643, 634, 652, 635, 650, 638, 643, 653, 641, + 0, 0, 648, 654, 644, 659, 0, 660, 0, 0, + 661, 0, 650, 653, 660, 657, 0, 0, 0, 0, + 666, 0, 0, 696, 0, 697, 701, 703, 687, 701, + 689, 0, 0, 658, 673, 0, 0, 0, 660, 0, + 669, 0, 0, 0, 0, 0, 0, 0, 668, 663, - 694, 689, 690, 704, 0, 0, 0, 0, 675, 0, - 0, 676, 707, 701, 705, 697, 709, 683, 684, 0, - 0, 715, 719, 712, 0, 0, 707, 714, 709, 707, - 712, 713, 709, 0, 0, 0, 1277, 746, 748, 754, - 757, 763, 768, 773 + 0, 0, 0, 665, 0, 665, 0, 0, 0, 0, + 704, 705, 700, 701, 715, 0, 0, 0, 0, 686, + 0, 0, 687, 718, 712, 716, 708, 720, 694, 695, + 0, 0, 726, 730, 723, 0, 0, 718, 725, 720, + 718, 723, 724, 720, 0, 0, 0, 1288, 757, 759, + 765, 768, 774, 779, 784 } ; -static yyconst short int yy_def[1045] = +static yyconst flex_int16_t yy_def[1056] = { 0, - 1037, 1, 1, 3, 1037, 1037, 1037, 1037, 1037, 1037, - 1038, 1039, 1040, 1037, 1041, 1041, 1037, 1037, 1037, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1037, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1037, 1042, 1041, 1037, 1037, 1043, 1043, 1043, 1041, 69, - 69, 69, 69, 1041, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 1043, 1042, 69, 1037, 1037, 1037, - 1038, 1037, 1039, 1037, 1044, 1037, 1041, 1041, 1037, 1041, + 1048, 1, 1, 3, 1048, 1048, 1048, 1048, 1048, 1048, + 1049, 1050, 1051, 1048, 1052, 1052, 1048, 1048, 1048, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1048, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1048, 1053, 1052, 1048, 1048, 1054, 1054, 1054, 1052, 69, + 69, 69, 69, 1052, 69, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 1054, 1053, 69, 1048, 1048, 1048, + 1049, 1048, 1050, 1048, 1055, 1048, 1052, 1052, 1048, 1052, - 1041, 1037, 1037, 1037, 1037, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1037, 1037, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1052, 1048, 1048, 1048, 1048, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1048, 1048, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1037, 1042, 1042, - 1037, 1041, 1037, 1037, 1037, 1043, 1043, 1043, 69, 69, - 69, 69, 69, 1041, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 1043, 86, 1037, 1042, - 86, 69, 1037, 1037, 1037, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1048, 1053, + 1053, 1048, 1052, 1048, 1048, 1048, 1054, 1054, 1054, 69, + 69, 69, 69, 69, 1052, 69, 69, 69, 69, 69, + 69, 69, 69, 69, 69, 69, 69, 1054, 86, 1048, + 1053, 86, 69, 1048, 1048, 1048, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, - 1041, 1041, 1037, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1052, 1052, 1052, 1048, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 69, 69, 1041, - 69, 69, 69, 69, 69, 69, 69, 1037, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1037, 1037, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 69, + 69, 1052, 69, 69, 69, 69, 69, 69, 69, 1048, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1048, 1048, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1037, 1037, 69, 1041, - 69, 69, 69, 69, 1037, 1037, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1048, + 1048, 69, 1052, 69, 69, 69, 69, 1048, 1048, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, - 1041, 1041, 1041, 1041, 1041, 69, 69, 69, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 69, + 69, 69, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 69, 69, 69, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1037, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 69, 69, 69, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1048, 1052, 1052, 1052, 1052, 1052, - 1041, 1041, 1041, 1041, 1041, 69, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 69, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - 1041, 1041, 1041, 1041, 1041, 1041, 0, 1037, 1037, 1037, - 1037, 1037, 1037, 1037 + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 1052, 1052, 1052, 1052, 0, 1048, 1048, + 1048, 1048, 1048, 1048, 1048 } ; -static yyconst short int yy_nxt[1352] = +static yyconst flex_int16_t yy_nxt[1363] = { 0, 6, 7, 8, 9, 7, 10, 11, 6, 12, 6, 13, 14, 15, 6, 16, 17, 18, 19, 20, 21, @@ -695,149 +792,150 @@ static yyconst short int yy_nxt[1352] = 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 27, 27, 27, 61, 108, 88, 61, 61, 88, 62, 85, 102, 103, 86, 110, 122, 99, 113, 109, - 114, 360, 100, 116, 123, 111, 117, 124, 112, 361, + 114, 362, 100, 116, 123, 111, 117, 124, 112, 363, 115, 125, 118, 63, 64, 65, 66, 87, 147, 67, - 843, 126, 131, 68, 69, 67, 70, 214, 148, 215, + 846, 126, 131, 68, 69, 67, 70, 215, 148, 216, 71, 72, 73, 119, 74, 75, 132, 76, 77, 101, - 76, 78, 79, 120, 229, 80, 121, 127, 81, 82, - 76, 128, 83, 178, 76, 129, 135, 67, 143, 194, - 136, 130, 138, 139, 229, 107, 166, 179, 144, 167, - 137, 145, 168, 195, 140, 141, 229, 142, 149, 84, - 150, 272, 180, 76, 151, 152, 181, 155, 153, 154, - 156, 159, 229, 157, 134, 160, 158, 169, 161, 162, - 285, 286, 163, 187, 188, 164, 147, 232, 170, 173, + 76, 78, 79, 120, 230, 80, 121, 127, 81, 82, + 76, 128, 83, 178, 76, 129, 135, 67, 143, 195, + 136, 130, 138, 139, 230, 107, 166, 179, 144, 167, + 137, 145, 168, 196, 140, 141, 99, 142, 149, 84, + 150, 232, 134, 76, 151, 152, 230, 155, 153, 154, + 156, 159, 180, 157, 230, 160, 158, 169, 161, 162, + 230, 233, 163, 181, 247, 164, 417, 182, 170, 173, - 171, 165, 189, 174, 172, 183, 148, 175, 190, 184, - 176, 191, 196, 185, 200, 192, 197, 205, 201, 186, - 218, 206, 202, 218, 207, 193, 219, 203, 204, 198, - 211, 208, 99, 209, 222, 229, 210, 231, 128, 246, - 212, 351, 129, 213, 88, 224, 225, 226, 130, 1037, - 224, 225, 1037, 224, 225, 229, 299, 352, 113, 233, - 234, 88, 300, 229, 88, 228, 224, 225, 227, 337, - 115, 227, 237, 109, 101, 227, 229, 227, 230, 338, - 123, 229, 229, 229, 229, 270, 99, 229, 271, 229, - 229, 100, 229, 229, 229, 288, 235, 229, 289, 117, + 171, 165, 192, 174, 172, 184, 193, 175, 101, 185, + 176, 188, 189, 186, 197, 230, 194, 304, 198, 187, + 190, 201, 148, 206, 238, 202, 191, 207, 212, 203, + 208, 199, 123, 88, 204, 205, 88, 209, 213, 210, + 219, 214, 211, 219, 223, 113, 220, 235, 128, 1048, + 225, 226, 129, 88, 225, 226, 227, 115, 130, 1048, + 225, 226, 230, 230, 259, 262, 234, 239, 260, 263, + 353, 125, 229, 225, 226, 228, 286, 287, 228, 230, + 109, 126, 228, 230, 228, 231, 354, 99, 230, 230, + 230, 230, 100, 847, 230, 271, 230, 230, 272, 230, - 229, 229, 229, 229, 229, 236, 229, 238, 229, 227, - 229, 125, 239, 229, 258, 229, 128, 229, 259, 252, - 240, 126, 229, 128, 241, 242, 130, 240, 101, 415, - 143, 229, 291, 130, 261, 229, 243, 244, 262, 245, - 144, 292, 392, 145, 218, 224, 225, 247, 211, 303, - 248, 393, 339, 229, 148, 312, 340, 304, 212, 313, - 305, 213, 249, 250, 251, 314, 341, 251, 306, 323, - 342, 251, 251, 251, 251, 409, 343, 378, 251, 251, - 251, 324, 325, 251, 398, 251, 251, 379, 251, 251, - 251, 405, 406, 251, 353, 354, 251, 251, 251, 407, + 230, 230, 289, 236, 230, 290, 117, 230, 230, 230, + 230, 230, 237, 230, 240, 230, 228, 212, 128, 230, + 230, 392, 241, 143, 393, 292, 278, 213, 130, 101, + 214, 242, 243, 144, 293, 300, 145, 412, 230, 343, + 268, 301, 230, 244, 245, 344, 246, 219, 225, 226, + 248, 147, 338, 249, 250, 251, 252, 305, 848, 252, + 306, 148, 339, 252, 252, 252, 252, 359, 307, 313, + 252, 252, 252, 314, 360, 252, 361, 252, 252, 315, + 252, 252, 252, 230, 394, 252, 324, 253, 252, 252, + 252, 128, 252, 395, 252, 241, 340, 252, 325, 326, - 251, 355, 251, 357, 399, 251, 344, 345, 346, 280, - 358, 366, 359, 380, 367, 99, 387, 381, 388, 390, - 231, 844, 391, 368, 369, 389, 400, 251, 370, 401, - 371, 251, 382, 402, 218, 403, 229, 218, 229, 229, - 219, 88, 224, 225, 226, 1037, 224, 225, 1037, 224, - 225, 410, 229, 229, 267, 229, 411, 101, 229, 408, - 277, 228, 229, 412, 229, 229, 413, 280, 229, 414, - 464, 500, 282, 522, 523, 295, 218, 224, 225, 247, - 416, 477, 248, 496, 540, 229, 478, 417, 528, 501, - 529, 497, 552, 567, 568, 229, 541, 280, 553, 569, + 341, 130, 345, 346, 347, 355, 356, 380, 368, 382, + 342, 369, 357, 383, 400, 407, 408, 381, 230, 252, + 370, 371, 389, 252, 390, 372, 402, 373, 384, 403, + 409, 391, 99, 404, 401, 405, 219, 232, 230, 219, + 281, 410, 220, 88, 225, 226, 227, 1048, 225, 226, + 1048, 225, 226, 230, 230, 230, 230, 413, 230, 230, + 411, 230, 230, 229, 230, 415, 466, 416, 525, 526, + 230, 273, 479, 283, 101, 498, 296, 480, 502, 418, + 466, 543, 414, 499, 281, 219, 225, 226, 248, 419, + 531, 249, 532, 544, 555, 230, 503, 570, 571, 281, - 229, 229, 229, 229, 229, 229, 458, 598, 422, 575, - 576, 431, 465, 571, 572, 464, 639, 660, 702, 599, - 574, 229, 661, 229, 678, 703, 573, 679, 229, 640, - 229, 229, 229, 756, 767, 229, 229, 706, 707, 229, - 768, 845, 846, 708, 577, 757, 847, 822, 823, 848, - 821, 607, 849, 850, 851, 852, 853, 465, 854, 855, + 556, 230, 230, 424, 230, 572, 230, 230, 467, 230, + 230, 601, 433, 574, 578, 579, 642, 682, 575, 664, + 683, 230, 467, 602, 665, 577, 230, 706, 460, 643, + 230, 230, 576, 230, 707, 230, 760, 771, 230, 710, + 230, 711, 580, 772, 815, 712, 230, 816, 761, 849, + 850, 828, 610, 827, 851, 829, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, - 229, 229, 229, 907, 908, 909, 910, 911, 842, 912, - 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 906, 907, 908, 909, 910, 911, 912, 913, 230, 230, + 230, 915, 916, 917, 918, 919, 848, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, - 906, 933, 934, 935, 936, 937, 938, 939, 940, 941, + 933, 934, 935, 936, 937, 938, 939, 940, 914, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, - 962, 229, 963, 964, 965, 966, 967, 968, 969, 970, - 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, + 972, 230, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, - 1031, 1032, 1033, 1034, 1035, 1036, 91, 91, 91, 91, - 91, 91, 93, 93, 94, 94, 842, 94, 94, 94, - 97, 97, 97, 220, 220, 220, 220, 220, 220, 227, - 227, 227, 227, 254, 254, 841, 254, 254, 254, 840, - 839, 838, 837, 836, 835, 834, 833, 832, 831, 830, - 829, 828, 827, 826, 825, 824, 820, 819, 818, 817, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 91, 91, 91, + 91, 91, 91, 93, 93, 94, 94, 845, 94, 94, + 94, 97, 97, 97, 221, 221, 221, 221, 221, 221, + 228, 228, 228, 228, 255, 255, 844, 255, 255, 255, + 843, 842, 841, 840, 839, 838, 837, 836, 835, 834, - 816, 815, 814, 813, 812, 811, 810, 809, 808, 807, - 806, 805, 804, 803, 802, 801, 800, 799, 798, 797, - 796, 795, 794, 793, 792, 791, 790, 789, 788, 787, - 786, 785, 784, 783, 782, 781, 780, 779, 778, 777, - 776, 775, 774, 773, 772, 771, 770, 769, 766, 765, - 764, 763, 762, 761, 760, 759, 758, 755, 754, 753, - 752, 751, 750, 749, 748, 747, 746, 745, 744, 743, - 742, 741, 740, 739, 738, 737, 736, 735, 734, 733, - 732, 731, 730, 729, 728, 727, 726, 725, 724, 723, - 722, 721, 720, 719, 718, 717, 716, 715, 714, 713, + 833, 832, 831, 830, 826, 825, 824, 823, 822, 821, + 820, 819, 818, 817, 814, 813, 812, 811, 810, 809, + 808, 807, 806, 805, 804, 803, 802, 801, 800, 799, + 798, 797, 796, 795, 794, 793, 792, 791, 790, 789, + 788, 787, 786, 785, 784, 783, 782, 781, 780, 779, + 778, 777, 776, 775, 774, 773, 770, 769, 768, 767, + 766, 765, 764, 763, 762, 759, 758, 757, 756, 755, + 754, 753, 752, 751, 750, 749, 748, 747, 746, 745, + 744, 743, 742, 741, 740, 739, 738, 737, 736, 735, + 734, 733, 732, 731, 730, 729, 728, 727, 726, 725, - 712, 711, 710, 709, 575, 705, 567, 704, 701, 700, - 699, 698, 697, 696, 695, 694, 693, 692, 691, 690, - 689, 688, 687, 686, 685, 684, 683, 682, 681, 680, - 677, 676, 675, 674, 673, 672, 671, 670, 669, 668, - 667, 666, 665, 664, 663, 662, 659, 658, 657, 656, - 655, 654, 653, 652, 651, 650, 649, 648, 647, 646, - 645, 644, 643, 642, 641, 638, 637, 636, 635, 634, - 633, 632, 631, 630, 629, 628, 627, 626, 625, 624, - 623, 622, 621, 620, 619, 618, 617, 616, 615, 614, - 613, 612, 611, 610, 609, 608, 607, 606, 605, 604, + 724, 723, 722, 721, 720, 719, 718, 717, 716, 715, + 714, 713, 578, 709, 570, 708, 705, 704, 703, 702, + 701, 700, 699, 698, 697, 696, 695, 694, 693, 692, + 691, 690, 689, 688, 687, 686, 685, 684, 681, 680, + 679, 678, 677, 676, 675, 674, 673, 672, 671, 670, + 669, 668, 667, 666, 663, 662, 661, 660, 659, 658, + 657, 656, 655, 654, 653, 652, 651, 650, 649, 648, + 647, 646, 645, 644, 641, 640, 639, 638, 637, 636, + 635, 634, 633, 632, 631, 630, 629, 628, 627, 626, + 625, 624, 623, 622, 621, 620, 619, 618, 617, 616, - 603, 602, 601, 600, 597, 596, 595, 594, 593, 592, - 591, 590, 589, 588, 587, 586, 585, 584, 583, 582, - 581, 580, 579, 578, 577, 570, 566, 565, 564, 563, - 562, 561, 560, 559, 558, 557, 556, 555, 554, 551, - 550, 549, 548, 547, 546, 545, 544, 543, 542, 539, - 538, 537, 536, 535, 534, 533, 532, 531, 530, 527, - 526, 525, 524, 445, 521, 520, 519, 518, 517, 516, - 515, 514, 513, 512, 511, 510, 509, 508, 507, 506, - 505, 504, 503, 502, 499, 498, 495, 494, 493, 492, - 491, 490, 489, 488, 487, 486, 485, 484, 483, 482, + 615, 614, 613, 612, 611, 610, 609, 608, 607, 606, + 605, 604, 603, 600, 599, 598, 597, 596, 595, 594, + 593, 592, 591, 590, 589, 588, 587, 586, 585, 584, + 583, 582, 581, 580, 573, 569, 568, 567, 566, 565, + 564, 563, 562, 561, 560, 559, 558, 557, 554, 553, + 552, 551, 550, 549, 548, 547, 546, 545, 542, 541, + 540, 539, 538, 537, 536, 535, 534, 533, 530, 529, + 528, 527, 447, 524, 523, 522, 521, 520, 519, 518, + 517, 516, 515, 514, 513, 512, 511, 510, 509, 508, + 507, 506, 505, 504, 501, 500, 497, 496, 495, 494, - 481, 480, 479, 476, 475, 474, 473, 472, 471, 470, - 469, 468, 467, 466, 463, 462, 461, 460, 459, 458, - 457, 456, 455, 454, 453, 452, 451, 450, 449, 448, - 447, 446, 445, 444, 443, 442, 441, 440, 439, 438, - 437, 436, 435, 434, 433, 432, 431, 430, 429, 428, - 427, 426, 425, 424, 423, 422, 421, 420, 419, 256, - 418, 418, 249, 229, 229, 224, 221, 221, 404, 397, - 396, 395, 394, 386, 385, 384, 383, 377, 376, 375, - 374, 373, 372, 365, 364, 363, 362, 356, 350, 349, - 348, 347, 336, 335, 334, 333, 332, 331, 330, 329, + 493, 492, 491, 490, 489, 488, 487, 486, 485, 484, + 483, 482, 481, 478, 477, 476, 475, 474, 473, 472, + 471, 470, 469, 468, 465, 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, + 439, 438, 437, 436, 435, 434, 433, 432, 431, 430, + 429, 428, 427, 426, 425, 424, 423, 422, 421, 257, + 420, 420, 250, 230, 230, 225, 222, 222, 406, 399, + 398, 397, 396, 388, 387, 386, 385, 379, 378, 377, + 376, 375, 374, 367, 366, 365, 364, 358, 352, 351, - 328, 327, 326, 322, 321, 320, 319, 318, 317, 316, - 315, 311, 310, 309, 308, 307, 302, 301, 298, 297, - 296, 295, 294, 293, 290, 287, 284, 283, 282, 281, - 280, 279, 278, 277, 276, 275, 274, 273, 272, 269, - 268, 267, 266, 265, 264, 263, 260, 257, 256, 98, - 96, 255, 253, 92, 229, 223, 221, 217, 216, 199, - 182, 177, 146, 134, 133, 107, 106, 105, 104, 98, - 96, 95, 92, 90, 89, 1037, 5, 1037, 1037, 1037, - 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, - 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 350, 349, 348, 337, 336, 335, 334, 333, 332, 331, + 330, 329, 328, 327, 323, 322, 321, 320, 319, 318, + 317, 316, 312, 311, 310, 309, 308, 303, 302, 299, + 298, 297, 296, 295, 294, 291, 288, 285, 284, 283, + 282, 281, 280, 279, 278, 277, 276, 275, 274, 273, + 270, 269, 268, 267, 266, 265, 264, 261, 258, 257, + 98, 96, 256, 254, 92, 230, 224, 222, 218, 217, + 200, 183, 177, 146, 134, 133, 107, 106, 105, 104, + 98, 96, 95, 92, 90, 89, 1048, 5, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, - 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, - 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, - 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, - 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, - 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, - 1037 + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048 } ; -static yyconst short int yy_chk[1352] = +static yyconst flex_int16_t yy_chk[1363] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -848,151 +946,155 @@ static yyconst short int yy_chk[1352] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 22, 7, 2, 4, 7, 2, 4, 17, 17, 4, 23, 28, 16, 24, 22, - 24, 188, 16, 25, 28, 23, 25, 29, 23, 188, + 24, 189, 16, 25, 28, 23, 25, 29, 23, 189, 24, 29, 25, 2, 3, 3, 3, 4, 38, 3, - 733, 29, 31, 3, 3, 3, 3, 58, 38, 58, + 734, 29, 31, 3, 3, 3, 3, 58, 38, 58, 3, 3, 3, 26, 3, 3, 31, 3, 3, 16, 3, 3, 3, 26, 72, 3, 26, 30, 3, 3, 3, 30, 3, 46, 3, 30, 34, 3, 36, 52, - 34, 30, 35, 35, 236, 72, 42, 46, 36, 42, - 34, 36, 42, 52, 35, 35, 80, 35, 39, 3, - 39, 236, 47, 3, 39, 39, 47, 40, 39, 39, - 40, 41, 71, 40, 80, 41, 40, 43, 41, 41, - 132, 132, 41, 50, 50, 41, 147, 71, 43, 44, + 34, 30, 35, 35, 80, 72, 42, 46, 36, 42, + 34, 36, 42, 52, 35, 35, 70, 35, 39, 3, + 39, 70, 80, 3, 39, 39, 71, 40, 39, 39, + 40, 41, 47, 40, 246, 41, 40, 43, 41, 41, + 83, 71, 41, 47, 83, 41, 246, 47, 43, 44, - 43, 41, 50, 44, 43, 49, 147, 44, 50, 49, - 44, 51, 53, 49, 55, 51, 53, 56, 55, 49, - 61, 56, 55, 61, 56, 51, 61, 55, 55, 53, - 57, 56, 70, 56, 63, 83, 56, 70, 63, 83, - 57, 184, 63, 57, 66, 66, 66, 66, 63, 67, - 67, 67, 68, 68, 68, 73, 143, 184, 74, 73, - 74, 88, 143, 77, 88, 68, 69, 69, 69, 176, - 74, 69, 77, 73, 70, 69, 69, 69, 69, 176, - 77, 75, 69, 69, 69, 117, 100, 69, 117, 69, - 69, 100, 69, 69, 69, 134, 75, 69, 134, 75, + 43, 41, 51, 44, 43, 49, 51, 44, 70, 49, + 44, 50, 50, 49, 53, 77, 51, 148, 53, 49, + 50, 55, 148, 56, 77, 55, 50, 56, 57, 55, + 56, 53, 77, 88, 55, 55, 88, 56, 57, 56, + 61, 57, 56, 61, 63, 74, 61, 74, 63, 67, + 67, 67, 63, 66, 66, 66, 66, 74, 63, 68, + 68, 68, 73, 78, 107, 109, 73, 78, 107, 109, + 185, 78, 68, 69, 69, 69, 132, 132, 69, 84, + 73, 78, 69, 69, 69, 69, 185, 100, 75, 69, + 69, 69, 100, 735, 69, 117, 69, 69, 117, 69, - 69, 69, 69, 78, 69, 75, 69, 78, 79, 69, - 84, 78, 79, 81, 107, 87, 79, 245, 107, 87, - 79, 78, 82, 87, 81, 81, 79, 87, 100, 245, - 82, 69, 136, 87, 109, 69, 81, 81, 109, 81, - 82, 136, 208, 82, 85, 85, 85, 85, 84, 148, - 85, 208, 177, 233, 148, 155, 177, 149, 84, 155, - 149, 84, 86, 86, 86, 155, 177, 86, 149, 164, - 178, 86, 86, 86, 86, 233, 178, 200, 86, 86, - 86, 164, 164, 86, 213, 86, 86, 200, 86, 86, - 86, 217, 217, 86, 185, 185, 86, 86, 86, 222, + 69, 69, 134, 75, 69, 134, 75, 69, 69, 69, + 79, 69, 75, 69, 79, 82, 69, 84, 79, 239, + 81, 208, 79, 82, 208, 136, 239, 84, 79, 100, + 84, 81, 81, 82, 136, 143, 82, 235, 69, 178, + 235, 143, 69, 81, 81, 178, 81, 85, 85, 85, + 85, 147, 176, 85, 86, 86, 86, 149, 736, 86, + 149, 147, 176, 86, 86, 86, 86, 188, 149, 155, + 86, 86, 86, 155, 188, 86, 188, 86, 86, 155, + 86, 86, 86, 87, 209, 86, 164, 87, 86, 86, + 86, 87, 86, 209, 86, 87, 177, 86, 164, 164, - 86, 185, 86, 187, 213, 86, 179, 179, 179, 222, - 187, 193, 187, 201, 193, 231, 206, 201, 206, 207, - 231, 735, 207, 193, 193, 206, 214, 86, 193, 214, - 193, 86, 201, 214, 218, 214, 232, 218, 239, 241, - 218, 226, 226, 226, 226, 227, 227, 227, 228, 228, - 228, 234, 235, 238, 234, 240, 235, 231, 242, 232, - 238, 228, 243, 241, 244, 246, 243, 239, 252, 244, - 303, 339, 240, 363, 363, 242, 247, 247, 247, 247, - 246, 317, 247, 336, 380, 414, 317, 252, 369, 339, - 369, 336, 391, 407, 407, 408, 380, 252, 391, 408, + 177, 87, 179, 179, 179, 186, 186, 201, 194, 202, + 177, 194, 186, 202, 214, 218, 218, 201, 233, 86, + 194, 194, 207, 86, 207, 194, 215, 194, 202, 215, + 223, 207, 232, 215, 214, 215, 219, 232, 234, 219, + 223, 233, 219, 227, 227, 227, 227, 228, 228, 228, + 229, 229, 229, 236, 237, 240, 241, 236, 242, 243, + 234, 244, 245, 229, 247, 244, 304, 245, 365, 365, + 253, 237, 318, 241, 232, 337, 243, 318, 340, 247, + 466, 382, 242, 337, 240, 248, 248, 248, 248, 253, + 371, 248, 371, 382, 393, 411, 340, 409, 409, 253, - 409, 411, 413, 415, 412, 416, 414, 447, 409, 417, - 417, 411, 303, 412, 413, 464, 496, 520, 564, 447, - 416, 417, 520, 569, 539, 564, 415, 539, 571, 496, - 572, 574, 573, 636, 647, 706, 707, 571, 573, 708, - 647, 736, 737, 574, 569, 636, 738, 707, 708, 741, - 706, 572, 742, 746, 750, 751, 752, 464, 754, 755, - 757, 760, 762, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 773, 775, 776, 778, 779, 780, 781, - 782, 783, 784, 785, 786, 789, 790, 792, 793, 794, - 795, 797, 798, 799, 800, 801, 802, 803, 805, 806, + 393, 410, 413, 411, 414, 410, 415, 416, 304, 417, + 418, 449, 413, 414, 419, 419, 498, 542, 415, 523, + 542, 572, 466, 449, 523, 418, 419, 567, 416, 498, + 574, 575, 417, 577, 567, 576, 639, 650, 710, 574, + 711, 576, 572, 650, 697, 577, 712, 697, 639, 737, + 739, 711, 575, 710, 740, 712, 741, 742, 745, 746, + 750, 754, 755, 756, 758, 759, 761, 764, 766, 767, + 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, + 778, 780, 781, 783, 784, 785, 786, 787, 788, 789, + 790, 791, 794, 795, 797, 798, 799, 800, 802, 803, - 807, 810, 812, 813, 814, 815, 816, 817, 818, 819, - 821, 822, 823, 824, 825, 827, 828, 829, 821, 830, - 831, 832, 833, 835, 837, 838, 839, 840, 841, 844, - 847, 850, 851, 852, 853, 856, 857, 859, 860, 861, - 823, 863, 864, 865, 866, 868, 869, 870, 872, 873, - 874, 875, 876, 881, 882, 883, 884, 885, 886, 887, - 889, 892, 894, 895, 896, 897, 901, 902, 903, 904, - 905, 906, 907, 909, 910, 916, 917, 918, 919, 920, - 922, 924, 925, 926, 928, 930, 932, 933, 934, 935, - 936, 937, 938, 939, 940, 941, 944, 945, 946, 947, + 804, 805, 806, 807, 808, 810, 811, 812, 815, 816, + 818, 819, 820, 821, 822, 823, 824, 825, 827, 828, + 829, 830, 831, 833, 834, 835, 827, 836, 837, 838, + 839, 841, 843, 844, 845, 846, 847, 850, 853, 856, + 857, 858, 859, 862, 863, 865, 866, 867, 829, 869, + 870, 871, 872, 874, 875, 876, 877, 879, 880, 881, + 882, 883, 888, 889, 890, 891, 892, 893, 894, 896, + 899, 901, 902, 903, 904, 905, 909, 910, 911, 912, + 913, 914, 915, 917, 918, 924, 925, 926, 927, 928, + 930, 932, 933, 934, 936, 938, 940, 941, 942, 943, - 949, 952, 954, 955, 956, 957, 961, 964, 966, 967, - 968, 969, 970, 971, 974, 975, 979, 981, 988, 989, - 993, 995, 1000, 1001, 1002, 1003, 1004, 1009, 1012, 1013, - 1014, 1015, 1016, 1017, 1018, 1019, 1022, 1023, 1024, 1027, - 1028, 1029, 1030, 1031, 1032, 1033, 1038, 1038, 1038, 1038, - 1038, 1038, 1039, 1039, 1040, 1040, 732, 1040, 1040, 1040, - 1041, 1041, 1041, 1042, 1042, 1042, 1042, 1042, 1042, 1043, - 1043, 1043, 1043, 1044, 1044, 731, 1044, 1044, 1044, 730, - 728, 725, 724, 723, 722, 721, 720, 718, 717, 716, - 715, 714, 713, 712, 711, 710, 705, 704, 702, 701, + 944, 945, 946, 947, 948, 949, 950, 953, 954, 955, + 956, 958, 961, 963, 964, 965, 966, 971, 974, 976, + 977, 978, 979, 980, 981, 984, 985, 989, 991, 999, + 1000, 1004, 1006, 1011, 1012, 1013, 1014, 1015, 1020, 1023, + 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1033, 1034, 1035, + 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1049, 1049, 1049, + 1049, 1049, 1049, 1050, 1050, 1051, 1051, 732, 1051, 1051, + 1051, 1052, 1052, 1052, 1053, 1053, 1053, 1053, 1053, 1053, + 1054, 1054, 1054, 1054, 1055, 1055, 729, 1055, 1055, 1055, + 728, 727, 726, 725, 724, 722, 721, 720, 719, 718, - 700, 699, 698, 697, 696, 695, 693, 692, 691, 690, - 689, 688, 687, 686, 684, 682, 681, 680, 679, 678, - 677, 676, 675, 674, 673, 672, 671, 669, 668, 667, - 666, 665, 664, 663, 661, 660, 659, 658, 657, 656, - 655, 654, 653, 652, 651, 650, 649, 648, 646, 645, - 644, 643, 642, 641, 640, 639, 638, 635, 634, 633, - 632, 631, 630, 629, 628, 626, 625, 624, 623, 622, - 620, 619, 617, 616, 615, 612, 611, 610, 609, 608, - 606, 605, 604, 603, 602, 601, 600, 599, 598, 596, - 595, 594, 593, 591, 590, 588, 587, 586, 584, 583, + 717, 716, 715, 714, 709, 708, 706, 705, 704, 703, + 702, 701, 700, 699, 696, 695, 694, 693, 692, 691, + 690, 688, 686, 685, 684, 683, 682, 681, 680, 679, + 678, 677, 676, 675, 673, 672, 671, 670, 669, 668, + 667, 665, 664, 663, 662, 661, 660, 659, 658, 657, + 656, 655, 654, 653, 652, 651, 649, 648, 647, 646, + 645, 644, 643, 642, 641, 638, 637, 636, 635, 634, + 633, 632, 631, 629, 628, 627, 626, 625, 623, 622, + 620, 619, 618, 615, 614, 613, 612, 611, 609, 608, + 607, 606, 605, 604, 603, 602, 601, 599, 598, 597, - 582, 581, 580, 578, 576, 570, 568, 565, 563, 562, - 561, 559, 558, 557, 556, 555, 554, 553, 552, 551, - 550, 549, 548, 547, 546, 545, 544, 543, 542, 540, - 538, 537, 536, 535, 534, 532, 531, 530, 528, 527, - 526, 525, 524, 523, 522, 521, 518, 517, 516, 515, - 513, 512, 510, 509, 508, 507, 506, 505, 504, 502, - 501, 500, 499, 498, 497, 495, 494, 493, 492, 491, - 487, 486, 485, 484, 483, 482, 481, 480, 479, 477, - 476, 475, 474, 473, 472, 471, 470, 469, 468, 467, - 466, 463, 461, 460, 459, 458, 457, 455, 454, 453, + 596, 594, 593, 591, 590, 589, 587, 586, 585, 584, + 583, 581, 579, 573, 571, 568, 566, 565, 564, 562, + 561, 560, 559, 558, 557, 556, 555, 554, 553, 552, + 551, 550, 549, 548, 547, 546, 545, 543, 541, 540, + 539, 538, 537, 535, 534, 533, 531, 530, 529, 528, + 527, 526, 525, 524, 521, 520, 519, 518, 516, 515, + 513, 512, 511, 510, 509, 508, 507, 506, 504, 503, + 502, 501, 500, 499, 497, 496, 495, 494, 493, 489, + 488, 487, 486, 485, 484, 483, 482, 481, 479, 478, + 477, 476, 475, 474, 473, 472, 471, 470, 469, 468, - 452, 451, 450, 448, 446, 444, 443, 442, 441, 439, - 438, 437, 436, 434, 433, 432, 431, 429, 427, 425, - 424, 423, 421, 420, 419, 410, 405, 404, 403, 402, - 401, 400, 399, 398, 396, 395, 394, 393, 392, 390, - 389, 388, 387, 386, 385, 384, 383, 382, 381, 379, - 378, 377, 376, 375, 374, 373, 372, 371, 370, 368, - 367, 366, 365, 364, 362, 361, 360, 359, 358, 357, - 356, 354, 353, 352, 351, 349, 348, 347, 345, 344, - 343, 342, 341, 340, 338, 337, 335, 334, 333, 332, - 331, 330, 329, 327, 326, 325, 324, 323, 322, 321, + 465, 463, 462, 461, 460, 459, 457, 456, 455, 454, + 453, 452, 450, 448, 446, 445, 444, 443, 441, 440, + 439, 438, 436, 435, 434, 433, 431, 429, 427, 426, + 425, 423, 422, 421, 412, 407, 406, 405, 404, 403, + 402, 401, 400, 398, 397, 396, 395, 394, 392, 391, + 390, 389, 388, 387, 386, 385, 384, 383, 381, 380, + 379, 378, 377, 376, 375, 374, 373, 372, 370, 369, + 368, 367, 366, 364, 363, 362, 361, 360, 359, 358, + 356, 355, 354, 353, 351, 350, 349, 348, 346, 345, + 344, 343, 342, 341, 339, 338, 336, 335, 334, 333, - 320, 319, 318, 316, 315, 314, 313, 312, 311, 310, - 309, 308, 306, 304, 302, 301, 300, 299, 298, 297, - 296, 295, 294, 293, 292, 291, 290, 289, 288, 287, - 286, 285, 284, 283, 282, 281, 280, 279, 278, 277, - 276, 275, 274, 273, 272, 271, 269, 268, 267, 266, - 265, 264, 263, 262, 261, 260, 259, 258, 257, 256, - 255, 254, 250, 237, 229, 225, 220, 219, 216, 212, - 211, 210, 209, 205, 204, 203, 202, 199, 198, 197, - 196, 195, 194, 192, 191, 190, 189, 186, 183, 182, - 181, 180, 175, 174, 173, 172, 171, 170, 169, 168, + 332, 331, 330, 328, 327, 326, 325, 324, 323, 322, + 321, 320, 319, 317, 316, 315, 314, 313, 312, 311, + 310, 309, 307, 305, 303, 302, 301, 300, 299, 298, + 297, 296, 295, 294, 293, 292, 291, 290, 289, 288, + 287, 286, 285, 284, 283, 282, 281, 280, 279, 278, + 277, 276, 275, 274, 273, 272, 270, 269, 268, 267, + 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, + 256, 255, 251, 238, 230, 226, 221, 220, 217, 213, + 212, 211, 210, 206, 205, 204, 203, 200, 199, 198, + 197, 196, 195, 193, 192, 191, 190, 187, 184, 183, - 167, 166, 165, 163, 162, 161, 160, 159, 158, 157, - 156, 154, 153, 152, 151, 150, 146, 145, 142, 141, - 140, 139, 138, 137, 135, 133, 131, 130, 129, 128, - 127, 126, 125, 124, 123, 121, 120, 119, 118, 116, - 115, 114, 113, 112, 111, 110, 108, 106, 101, 98, - 96, 95, 94, 91, 76, 65, 62, 60, 59, 54, - 48, 45, 37, 33, 32, 21, 20, 19, 18, 15, - 14, 13, 11, 10, 9, 5, 1037, 1037, 1037, 1037, - 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, - 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, + 182, 181, 180, 175, 174, 173, 172, 171, 170, 169, + 168, 167, 166, 165, 163, 162, 161, 160, 159, 158, + 157, 156, 154, 153, 152, 151, 150, 146, 145, 142, + 141, 140, 139, 138, 137, 135, 133, 131, 130, 129, + 128, 127, 126, 125, 124, 123, 121, 120, 119, 118, + 116, 115, 114, 113, 112, 111, 110, 108, 106, 101, + 98, 96, 95, 94, 91, 76, 65, 62, 60, 59, + 54, 48, 45, 37, 33, 32, 21, 20, 19, 18, + 15, 14, 13, 11, 10, 9, 5, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, - 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, - 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, - 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, - 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, - 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, - 1037 + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; +extern int yy_flex_debug; +int yy_flex_debug = 0; + /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ @@ -1002,9 +1104,10 @@ static char *yy_last_accepting_cpos; #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "lev_comp.l" -#define INITIAL 0 #line 2 "lev_comp.l" -/* SCCS Id: @(#)lev_lex.c 3.4 2002/03/27 */ +/* NetHack 3.5 lev_comp.l $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev_comp.l $Date: 2009/05/06 10:54:31 $ $Revision: 1.9 $ */ +/* SCCS Id: @(#)lev_lex.c 3.5 2002/03/27 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -1099,9 +1202,54 @@ FILE *orig_yyin = NULL; #define ST_RET(x) do { savetoken(yytext); return x; } while (0); #define ST_RETF(y, x) do { savetoken(yytext); y; return x; } while (0); + +#line 1207 "lex.yy.c" + +#define INITIAL 0 #define MAPC 1 -#line 1105 "lex.yy.c" +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy (void ); + +int yyget_debug (void ); + +void yyset_debug (int debug_flag ); + +YY_EXTRA_TYPE yyget_extra (void ); + +void yyset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in (void ); + +void yyset_in (FILE * in_str ); + +FILE *yyget_out (void ); + +void yyset_out (FILE * out_str ); + +yy_size_t yyget_leng (void ); + +char *yyget_text (void ); + +int yyget_lineno (void ); + +void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1109,79 +1257,48 @@ FILE *orig_yyin = NULL; #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); +extern "C" int yywrap (void ); #else -extern int yywrap YY_PROTO(( void )); +extern int yywrap (void ); #endif #endif -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - + static void yyunput (int c,char *buf_ptr ); + #ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); +static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT + #ifdef __cplusplus -static int yyinput YY_PROTO(( void )); +static int yyinput (void ); #else -static int input YY_PROTO(( void )); -#endif +static int input (void ); #endif -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static 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_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#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 +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #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 ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1189,9 +1306,10 @@ YY_MALLOC_DECL */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ - int c = '*', n; \ + int c = '*'; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1201,9 +1319,22 @@ YY_MALLOC_DECL YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); + 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();" - @@ -1224,12 +1355,18 @@ YY_MALLOC_DECL #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif +/* end tables serialization structures and prototypes */ + /* 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 +#define YY_DECL_IS_OURS 1 + +extern int yylex (void); + +#define YY_DECL int yylex (void) +#endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. @@ -1245,30 +1382,28 @@ YY_MALLOC_DECL #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ - yy_current_buffer->yy_at_bol = \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION +/** The main scanner function which does all the work. + */ YY_DECL - { +{ register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; - -#line 102 "lev_comp.l" - -#line 1261 "lex.yy.c" - - if ( yy_init ) + + if ( !(yy_init) ) { - yy_init = 0; + (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif - if ( ! yy_start ) - yy_start = 1; /* first start state */ + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; @@ -1276,74 +1411,79 @@ YY_DECL if ( ! yyout ) yyout = stdout; - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); } + yy_load_buffer_state( ); + } + + { +#line 104 "lev_comp.l" + +#line 1427 "lex.yy.c" + while ( 1 ) /* loops until end-of-file is reached */ { - yy_cp = yy_c_buf_p; + yy_cp = (yy_c_buf_p); /* Support of yytext. */ - *yy_cp = yy_hold_char; + *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_start); yy_current_state += YY_AT_BOL(); yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = 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 >= 1038 ) + if ( yy_current_state >= 1049 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 1277 ); + while ( yy_base[yy_current_state] != 1288 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; - do_action: /* This label is used only to access EOF actions. */ - switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP -#line 103 "lev_comp.l" +#line 105 "lev_comp.l" { savetoken(yytext); BEGIN(INITIAL); @@ -1355,8 +1495,9 @@ YY_RULE_SETUP } YY_BREAK case 2: +/* rule 2 can match eol */ YY_RULE_SETUP -#line 112 "lev_comp.l" +#line 114 "lev_comp.l" { int len = yyleng; savetoken(yytext); @@ -1370,863 +1511,875 @@ YY_RULE_SETUP } YY_BREAK case 3: +/* rule 3 can match eol */ YY_RULE_SETUP -#line 123 "lev_comp.l" +#line 125 "lev_comp.l" { savetoken(yytext); newline(); } YY_BREAK case 4: YY_RULE_SETUP -#line 124 "lev_comp.l" +#line 126 "lev_comp.l" ST_RET(MESSAGE_ID); YY_BREAK case 5: YY_RULE_SETUP -#line 125 "lev_comp.l" +#line 127 "lev_comp.l" ST_RET(NOMAP_ID); YY_BREAK case 6: YY_RULE_SETUP -#line 126 "lev_comp.l" +#line 128 "lev_comp.l" ST_RET(MAZE_ID); YY_BREAK case 7: YY_RULE_SETUP -#line 127 "lev_comp.l" +#line 129 "lev_comp.l" ST_RET(LEVEL_ID); YY_BREAK case 8: YY_RULE_SETUP -#line 128 "lev_comp.l" +#line 130 "lev_comp.l" ST_RET(LEV_INIT_ID); YY_BREAK case 9: YY_RULE_SETUP -#line 129 "lev_comp.l" +#line 131 "lev_comp.l" ST_RET(MAZE_GRID_ID); YY_BREAK case 10: YY_RULE_SETUP -#line 130 "lev_comp.l" +#line 132 "lev_comp.l" ST_RET(SOLID_FILL_ID); YY_BREAK case 11: YY_RULE_SETUP -#line 131 "lev_comp.l" +#line 133 "lev_comp.l" ST_RET(MINES_ID); YY_BREAK case 12: YY_RULE_SETUP -#line 132 "lev_comp.l" +#line 134 "lev_comp.l" ST_RET(ROGUELEV_ID); YY_BREAK case 13: YY_RULE_SETUP -#line 133 "lev_comp.l" +#line 135 "lev_comp.l" ST_RET(FLAGS_ID); YY_BREAK case 14: YY_RULE_SETUP -#line 134 "lev_comp.l" +#line 136 "lev_comp.l" ST_RET(GEOMETRY_ID); YY_BREAK case 15: +/* rule 15 can match eol */ YY_RULE_SETUP -#line 135 "lev_comp.l" +#line 137 "lev_comp.l" { savetoken(yytext); BEGIN(MAPC); newline(); } YY_BREAK case 16: YY_RULE_SETUP -#line 136 "lev_comp.l" +#line 138 "lev_comp.l" ST_RET(object_ID); YY_BREAK case 17: YY_RULE_SETUP -#line 137 "lev_comp.l" +#line 139 "lev_comp.l" ST_RET(OBJECT_ID); YY_BREAK case 18: YY_RULE_SETUP -#line 138 "lev_comp.l" +#line 140 "lev_comp.l" ST_RET(COBJECT_ID); YY_BREAK case 19: YY_RULE_SETUP -#line 139 "lev_comp.l" +#line 141 "lev_comp.l" ST_RET(MONSTER_ID); YY_BREAK case 20: YY_RULE_SETUP -#line 140 "lev_comp.l" +#line 142 "lev_comp.l" ST_RET(monster_ID); YY_BREAK case 21: YY_RULE_SETUP -#line 141 "lev_comp.l" +#line 143 "lev_comp.l" ST_RET(TRAP_ID); YY_BREAK case 22: YY_RULE_SETUP -#line 142 "lev_comp.l" +#line 144 "lev_comp.l" ST_RET(DOOR_ID); YY_BREAK case 23: YY_RULE_SETUP -#line 143 "lev_comp.l" +#line 145 "lev_comp.l" ST_RET(ROOMDOOR_ID); YY_BREAK case 24: YY_RULE_SETUP -#line 144 "lev_comp.l" +#line 146 "lev_comp.l" ST_RET(DRAWBRIDGE_ID); YY_BREAK case 25: YY_RULE_SETUP -#line 145 "lev_comp.l" +#line 147 "lev_comp.l" ST_RET(MAZEWALK_ID); YY_BREAK case 26: YY_RULE_SETUP -#line 146 "lev_comp.l" +#line 148 "lev_comp.l" ST_RET(WALLIFY_ID); YY_BREAK case 27: YY_RULE_SETUP -#line 147 "lev_comp.l" +#line 149 "lev_comp.l" ST_RET(REGION_ID); YY_BREAK case 28: YY_RULE_SETUP -#line 148 "lev_comp.l" +#line 150 "lev_comp.l" ST_RET(ALTAR_ID); YY_BREAK case 29: YY_RULE_SETUP -#line 149 "lev_comp.l" +#line 151 "lev_comp.l" ST_RET(LADDER_ID); YY_BREAK case 30: YY_RULE_SETUP -#line 150 "lev_comp.l" +#line 152 "lev_comp.l" ST_RET(STAIR_ID); YY_BREAK case 31: YY_RULE_SETUP -#line 151 "lev_comp.l" +#line 153 "lev_comp.l" ST_RET(PORTAL_ID); YY_BREAK case 32: YY_RULE_SETUP -#line 152 "lev_comp.l" +#line 154 "lev_comp.l" ST_RET(TELEPRT_ID); YY_BREAK case 33: YY_RULE_SETUP -#line 153 "lev_comp.l" +#line 155 "lev_comp.l" ST_RET(BRANCH_ID); YY_BREAK case 34: YY_RULE_SETUP -#line 154 "lev_comp.l" +#line 156 "lev_comp.l" ST_RET(FOUNTAIN_ID); YY_BREAK case 35: YY_RULE_SETUP -#line 155 "lev_comp.l" +#line 157 "lev_comp.l" ST_RET(SINK_ID); YY_BREAK case 36: YY_RULE_SETUP -#line 156 "lev_comp.l" +#line 158 "lev_comp.l" ST_RET(POOL_ID); YY_BREAK case 37: YY_RULE_SETUP -#line 157 "lev_comp.l" +#line 159 "lev_comp.l" ST_RET(NON_DIGGABLE_ID); YY_BREAK case 38: YY_RULE_SETUP -#line 158 "lev_comp.l" +#line 160 "lev_comp.l" ST_RET(NON_PASSWALL_ID); YY_BREAK case 39: YY_RULE_SETUP -#line 159 "lev_comp.l" +#line 161 "lev_comp.l" ST_RET(IF_ID); YY_BREAK case 40: YY_RULE_SETUP -#line 160 "lev_comp.l" +#line 162 "lev_comp.l" ST_RET(ELSE_ID); YY_BREAK case 41: YY_RULE_SETUP -#line 161 "lev_comp.l" +#line 163 "lev_comp.l" ST_RET(EXIT_ID); YY_BREAK case 42: YY_RULE_SETUP -#line 162 "lev_comp.l" +#line 164 "lev_comp.l" ST_RET(ROOM_ID); YY_BREAK case 43: YY_RULE_SETUP -#line 163 "lev_comp.l" +#line 165 "lev_comp.l" ST_RET(SUBROOM_ID); YY_BREAK case 44: YY_RULE_SETUP -#line 164 "lev_comp.l" +#line 166 "lev_comp.l" ST_RET(RAND_CORRIDOR_ID); YY_BREAK case 45: YY_RULE_SETUP -#line 165 "lev_comp.l" +#line 167 "lev_comp.l" ST_RET(CORRIDOR_ID); YY_BREAK case 46: YY_RULE_SETUP -#line 166 "lev_comp.l" +#line 168 "lev_comp.l" ST_RET(TERRAIN_ID); YY_BREAK case 47: YY_RULE_SETUP -#line 167 "lev_comp.l" +#line 169 "lev_comp.l" ST_RET(terrain_ID); YY_BREAK case 48: YY_RULE_SETUP -#line 168 "lev_comp.l" +#line 170 "lev_comp.l" ST_RET(REPLACE_TERRAIN_ID); YY_BREAK case 49: YY_RULE_SETUP -#line 169 "lev_comp.l" +#line 171 "lev_comp.l" ST_RET(GOLD_ID); YY_BREAK case 50: YY_RULE_SETUP -#line 170 "lev_comp.l" +#line 172 "lev_comp.l" ST_RET(GRAVE_ID); YY_BREAK case 51: YY_RULE_SETUP -#line 171 "lev_comp.l" +#line 173 "lev_comp.l" ST_RET(ENGRAVING_ID); YY_BREAK case 52: YY_RULE_SETUP -#line 172 "lev_comp.l" +#line 174 "lev_comp.l" ST_RET(MINERALIZE_ID); YY_BREAK case 53: YY_RULE_SETUP -#line 173 "lev_comp.l" +#line 175 "lev_comp.l" ST_RET(NAME_ID); YY_BREAK case 54: YY_RULE_SETUP -#line 174 "lev_comp.l" +#line 176 "lev_comp.l" ST_RET(FOR_ID); YY_BREAK case 55: YY_RULE_SETUP -#line 175 "lev_comp.l" +#line 177 "lev_comp.l" ST_RET(TO_ID); YY_BREAK case 56: YY_RULE_SETUP -#line 176 "lev_comp.l" +#line 178 "lev_comp.l" ST_RET(LOOP_ID); YY_BREAK case 57: YY_RULE_SETUP -#line 177 "lev_comp.l" +#line 179 "lev_comp.l" ST_RET(SWITCH_ID); YY_BREAK case 58: YY_RULE_SETUP -#line 178 "lev_comp.l" +#line 180 "lev_comp.l" ST_RET(CASE_ID); YY_BREAK case 59: YY_RULE_SETUP -#line 179 "lev_comp.l" +#line 181 "lev_comp.l" ST_RET(BREAK_ID); YY_BREAK case 60: YY_RULE_SETUP -#line 180 "lev_comp.l" +#line 182 "lev_comp.l" ST_RET(DEFAULT_ID); YY_BREAK case 61: YY_RULE_SETUP -#line 181 "lev_comp.l" +#line 183 "lev_comp.l" ST_RET(FUNCTION_ID); YY_BREAK case 62: YY_RULE_SETUP -#line 182 "lev_comp.l" +#line 184 "lev_comp.l" ST_RET(SHUFFLE_ID); YY_BREAK case 63: YY_RULE_SETUP -#line 183 "lev_comp.l" +#line 185 "lev_comp.l" ST_RET(MONTYPE_ID); YY_BREAK case 64: YY_RULE_SETUP -#line 184 "lev_comp.l" +#line 186 "lev_comp.l" ST_RET(selection_ID); YY_BREAK case 65: YY_RULE_SETUP -#line 185 "lev_comp.l" +#line 187 "lev_comp.l" ST_RET(rect_ID); YY_BREAK case 66: YY_RULE_SETUP -#line 186 "lev_comp.l" +#line 188 "lev_comp.l" ST_RET(fillrect_ID); YY_BREAK case 67: YY_RULE_SETUP -#line 187 "lev_comp.l" +#line 189 "lev_comp.l" ST_RET(line_ID); YY_BREAK case 68: YY_RULE_SETUP -#line 188 "lev_comp.l" +#line 190 "lev_comp.l" ST_RET(randline_ID); YY_BREAK case 69: YY_RULE_SETUP -#line 189 "lev_comp.l" +#line 191 "lev_comp.l" ST_RET(grow_ID); YY_BREAK case 70: YY_RULE_SETUP -#line 190 "lev_comp.l" +#line 192 "lev_comp.l" ST_RET(flood_ID); YY_BREAK case 71: YY_RULE_SETUP -#line 191 "lev_comp.l" +#line 193 "lev_comp.l" ST_RET(rndcoord_ID); YY_BREAK case 72: YY_RULE_SETUP -#line 192 "lev_comp.l" +#line 194 "lev_comp.l" ST_RET(circle_ID); YY_BREAK case 73: YY_RULE_SETUP -#line 193 "lev_comp.l" +#line 195 "lev_comp.l" ST_RET(ellipse_ID); YY_BREAK case 74: YY_RULE_SETUP -#line 194 "lev_comp.l" +#line 196 "lev_comp.l" ST_RET(filter_ID); YY_BREAK case 75: YY_RULE_SETUP -#line 195 "lev_comp.l" +#line 197 "lev_comp.l" ST_RET(gradient_ID); YY_BREAK case 76: YY_RULE_SETUP -#line 196 "lev_comp.l" +#line 198 "lev_comp.l" ST_RET(complement_ID); YY_BREAK case 77: YY_RULE_SETUP -#line 197 "lev_comp.l" +#line 199 "lev_comp.l" { savetoken(yytext); yylval.i=SEL_GRADIENT_RADIAL; return GRADIENT_TYPE; } YY_BREAK case 78: YY_RULE_SETUP -#line 198 "lev_comp.l" +#line 200 "lev_comp.l" { savetoken(yytext); yylval.i=SEL_GRADIENT_SQUARE; return GRADIENT_TYPE; } YY_BREAK case 79: YY_RULE_SETUP -#line 199 "lev_comp.l" +#line 201 "lev_comp.l" { savetoken(yytext); yylval.i=DRY; return HUMIDITY_TYPE; } YY_BREAK case 80: YY_RULE_SETUP -#line 200 "lev_comp.l" +#line 202 "lev_comp.l" { savetoken(yytext); yylval.i=WET; return HUMIDITY_TYPE; } YY_BREAK case 81: YY_RULE_SETUP -#line 201 "lev_comp.l" +#line 203 "lev_comp.l" { savetoken(yytext); yylval.i=HOT; return HUMIDITY_TYPE; } YY_BREAK case 82: YY_RULE_SETUP -#line 202 "lev_comp.l" +#line 204 "lev_comp.l" { savetoken(yytext); yylval.i=SOLID; return HUMIDITY_TYPE; } YY_BREAK case 83: YY_RULE_SETUP -#line 203 "lev_comp.l" +#line 205 "lev_comp.l" { savetoken(yytext); yylval.i=ANY_LOC; return HUMIDITY_TYPE; } YY_BREAK case 84: YY_RULE_SETUP -#line 204 "lev_comp.l" +#line 206 "lev_comp.l" ST_RET(LEV); YY_BREAK case 85: YY_RULE_SETUP -#line 205 "lev_comp.l" +#line 207 "lev_comp.l" ST_RET(QUANTITY_ID); YY_BREAK case 86: YY_RULE_SETUP -#line 206 "lev_comp.l" +#line 208 "lev_comp.l" ST_RET(BURIED_ID); YY_BREAK case 87: YY_RULE_SETUP -#line 207 "lev_comp.l" +#line 209 "lev_comp.l" ST_RET(ERODED_ID); YY_BREAK case 88: YY_RULE_SETUP -#line 208 "lev_comp.l" +#line 210 "lev_comp.l" ST_RET(ERODEPROOF_ID); YY_BREAK case 89: YY_RULE_SETUP -#line 209 "lev_comp.l" +#line 211 "lev_comp.l" ST_RET(TRAPPED_ID); YY_BREAK case 90: YY_RULE_SETUP -#line 210 "lev_comp.l" +#line 212 "lev_comp.l" ST_RET(RECHARGED_ID); YY_BREAK case 91: YY_RULE_SETUP -#line 211 "lev_comp.l" +#line 213 "lev_comp.l" ST_RET(INVIS_ID); YY_BREAK case 92: YY_RULE_SETUP -#line 212 "lev_comp.l" +#line 214 "lev_comp.l" ST_RET(GREASED_ID); YY_BREAK case 93: YY_RULE_SETUP -#line 213 "lev_comp.l" +#line 215 "lev_comp.l" ST_RET(FEMALE_ID); YY_BREAK case 94: YY_RULE_SETUP -#line 214 "lev_comp.l" +#line 216 "lev_comp.l" ST_RET(CANCELLED_ID); YY_BREAK case 95: YY_RULE_SETUP -#line 215 "lev_comp.l" +#line 217 "lev_comp.l" ST_RET(REVIVED_ID); YY_BREAK case 96: YY_RULE_SETUP -#line 216 "lev_comp.l" +#line 218 "lev_comp.l" ST_RET(AVENGE_ID); YY_BREAK case 97: YY_RULE_SETUP -#line 217 "lev_comp.l" +#line 219 "lev_comp.l" ST_RET(FLEEING_ID); YY_BREAK case 98: YY_RULE_SETUP -#line 218 "lev_comp.l" +#line 220 "lev_comp.l" ST_RET(BLINDED_ID); YY_BREAK case 99: YY_RULE_SETUP -#line 219 "lev_comp.l" +#line 221 "lev_comp.l" ST_RET(PARALYZED_ID); YY_BREAK case 100: YY_RULE_SETUP -#line 220 "lev_comp.l" +#line 222 "lev_comp.l" ST_RET(STUNNED_ID); YY_BREAK case 101: YY_RULE_SETUP -#line 221 "lev_comp.l" +#line 223 "lev_comp.l" ST_RET(CONFUSED_ID); YY_BREAK case 102: YY_RULE_SETUP -#line 222 "lev_comp.l" +#line 224 "lev_comp.l" ST_RET(SEENTRAPS_ID); YY_BREAK case 103: YY_RULE_SETUP -#line 223 "lev_comp.l" +#line 225 "lev_comp.l" ST_RET(ALL_ID); YY_BREAK case 104: YY_RULE_SETUP -#line 224 "lev_comp.l" +#line 226 "lev_comp.l" ST_RETF((yylval.i=1), HORIZ_OR_VERT); YY_BREAK case 105: YY_RULE_SETUP -#line 225 "lev_comp.l" +#line 227 "lev_comp.l" { savetoken(yytext); yylval.i=2; return HORIZ_OR_VERT; } YY_BREAK case 106: YY_RULE_SETUP -#line 226 "lev_comp.l" +#line 228 "lev_comp.l" { savetoken(yytext); yylval.i=D_ISOPEN; return DOOR_STATE; } YY_BREAK case 107: YY_RULE_SETUP -#line 227 "lev_comp.l" +#line 229 "lev_comp.l" { savetoken(yytext); yylval.i=D_CLOSED; return DOOR_STATE; } YY_BREAK case 108: YY_RULE_SETUP -#line 228 "lev_comp.l" +#line 230 "lev_comp.l" { savetoken(yytext); yylval.i=D_LOCKED; return DOOR_STATE; } YY_BREAK case 109: YY_RULE_SETUP -#line 229 "lev_comp.l" +#line 231 "lev_comp.l" { savetoken(yytext); yylval.i=D_NODOOR; return DOOR_STATE; } YY_BREAK case 110: YY_RULE_SETUP -#line 230 "lev_comp.l" +#line 232 "lev_comp.l" { savetoken(yytext); yylval.i=D_BROKEN; return DOOR_STATE; } YY_BREAK case 111: YY_RULE_SETUP -#line 231 "lev_comp.l" +#line 233 "lev_comp.l" { savetoken(yytext); yylval.i=D_SECRET; return DOOR_STATE; } YY_BREAK case 112: YY_RULE_SETUP -#line 232 "lev_comp.l" +#line 234 "lev_comp.l" { savetoken(yytext); yylval.i=W_NORTH; return DIRECTION; } YY_BREAK case 113: YY_RULE_SETUP -#line 233 "lev_comp.l" +#line 235 "lev_comp.l" { savetoken(yytext); yylval.i=W_EAST; return DIRECTION; } YY_BREAK case 114: YY_RULE_SETUP -#line 234 "lev_comp.l" +#line 236 "lev_comp.l" { savetoken(yytext); yylval.i=W_SOUTH; return DIRECTION; } YY_BREAK case 115: YY_RULE_SETUP -#line 235 "lev_comp.l" +#line 237 "lev_comp.l" { savetoken(yytext); yylval.i=W_WEST; return DIRECTION; } YY_BREAK case 116: YY_RULE_SETUP -#line 236 "lev_comp.l" +#line 238 "lev_comp.l" { savetoken(yytext); yylval.i = -1; return RANDOM_TYPE; } YY_BREAK case 117: YY_RULE_SETUP -#line 237 "lev_comp.l" +#line 239 "lev_comp.l" { savetoken(yytext); yylval.i = -1; return RANDOM_TYPE_BRACKET; } YY_BREAK case 118: YY_RULE_SETUP -#line 238 "lev_comp.l" +#line 240 "lev_comp.l" { savetoken(yytext); yylval.i = -2; return NONE; } YY_BREAK case 119: YY_RULE_SETUP -#line 239 "lev_comp.l" +#line 241 "lev_comp.l" ST_RET(A_REGISTER); YY_BREAK case 120: YY_RULE_SETUP -#line 240 "lev_comp.l" +#line 242 "lev_comp.l" { savetoken(yytext); yylval.i=1; return LEFT_OR_RIGHT; } YY_BREAK case 121: YY_RULE_SETUP -#line 241 "lev_comp.l" +#line 243 "lev_comp.l" { savetoken(yytext); yylval.i=2; return LEFT_OR_RIGHT; } YY_BREAK case 122: YY_RULE_SETUP -#line 242 "lev_comp.l" +#line 244 "lev_comp.l" { savetoken(yytext); yylval.i=3; return CENTER; } YY_BREAK case 123: YY_RULE_SETUP -#line 243 "lev_comp.l" +#line 245 "lev_comp.l" { savetoken(yytext); yylval.i=4; return LEFT_OR_RIGHT; } YY_BREAK case 124: YY_RULE_SETUP -#line 244 "lev_comp.l" +#line 246 "lev_comp.l" { savetoken(yytext); yylval.i=5; return LEFT_OR_RIGHT; } YY_BREAK case 125: YY_RULE_SETUP -#line 245 "lev_comp.l" +#line 247 "lev_comp.l" { savetoken(yytext); yylval.i=1; return TOP_OR_BOT; } YY_BREAK case 126: YY_RULE_SETUP -#line 246 "lev_comp.l" +#line 248 "lev_comp.l" { savetoken(yytext); yylval.i=5; return TOP_OR_BOT; } YY_BREAK case 127: YY_RULE_SETUP -#line 247 "lev_comp.l" +#line 249 "lev_comp.l" { savetoken(yytext); yylval.i=1; return LIGHT_STATE; } YY_BREAK case 128: YY_RULE_SETUP -#line 248 "lev_comp.l" +#line 250 "lev_comp.l" { savetoken(yytext); yylval.i=0; return LIGHT_STATE; } YY_BREAK case 129: YY_RULE_SETUP -#line 249 "lev_comp.l" +#line 251 "lev_comp.l" { savetoken(yytext); yylval.i=1; return FILLING; } YY_BREAK case 130: YY_RULE_SETUP -#line 250 "lev_comp.l" +#line 252 "lev_comp.l" { savetoken(yytext); yylval.i=0; return FILLING; } YY_BREAK case 131: YY_RULE_SETUP -#line 251 "lev_comp.l" +#line 253 "lev_comp.l" { savetoken(yytext); yylval.i=0; return IRREGULAR; } YY_BREAK case 132: YY_RULE_SETUP -#line 252 "lev_comp.l" +#line 254 "lev_comp.l" { savetoken(yytext); yylval.i=1; return IRREGULAR; } YY_BREAK case 133: YY_RULE_SETUP -#line 253 "lev_comp.l" +#line 255 "lev_comp.l" { savetoken(yytext); yylval.i=1; return JOINED; } YY_BREAK case 134: YY_RULE_SETUP -#line 254 "lev_comp.l" +#line 256 "lev_comp.l" { savetoken(yytext); yylval.i=0; return JOINED; } YY_BREAK case 135: YY_RULE_SETUP -#line 255 "lev_comp.l" +#line 257 "lev_comp.l" { savetoken(yytext); yylval.i=1; return LIMITED; } YY_BREAK case 136: YY_RULE_SETUP -#line 256 "lev_comp.l" +#line 258 "lev_comp.l" { savetoken(yytext); yylval.i=0; return LIMITED; } YY_BREAK case 137: YY_RULE_SETUP -#line 257 "lev_comp.l" +#line 259 "lev_comp.l" { savetoken(yytext); yylval.i= AM_NONE; return ALIGNMENT; } YY_BREAK case 138: YY_RULE_SETUP -#line 258 "lev_comp.l" +#line 260 "lev_comp.l" { savetoken(yytext); yylval.i= AM_LAWFUL; return ALIGNMENT; } YY_BREAK case 139: YY_RULE_SETUP -#line 259 "lev_comp.l" +#line 261 "lev_comp.l" { savetoken(yytext); yylval.i= AM_NEUTRAL; return ALIGNMENT; } YY_BREAK case 140: YY_RULE_SETUP -#line 260 "lev_comp.l" +#line 262 "lev_comp.l" { savetoken(yytext); yylval.i= AM_CHAOTIC; return ALIGNMENT; } YY_BREAK case 141: YY_RULE_SETUP -#line 261 "lev_comp.l" +#line 263 "lev_comp.l" { savetoken(yytext); yylval.i= AM_SPLEV_CO; return ALIGNMENT; } YY_BREAK case 142: YY_RULE_SETUP -#line 262 "lev_comp.l" +#line 264 "lev_comp.l" { savetoken(yytext); yylval.i= AM_SPLEV_NONCO; return ALIGNMENT; } YY_BREAK case 143: YY_RULE_SETUP -#line 263 "lev_comp.l" +#line 265 "lev_comp.l" { savetoken(yytext); yylval.i=1; return MON_ATTITUDE; } YY_BREAK case 144: YY_RULE_SETUP -#line 264 "lev_comp.l" +#line 266 "lev_comp.l" { savetoken(yytext); yylval.i=0; return MON_ATTITUDE; } YY_BREAK case 145: YY_RULE_SETUP -#line 265 "lev_comp.l" +#line 267 "lev_comp.l" { savetoken(yytext); yylval.i=1; return MON_ALERTNESS; } YY_BREAK case 146: YY_RULE_SETUP -#line 266 "lev_comp.l" +#line 268 "lev_comp.l" { savetoken(yytext); yylval.i=0; return MON_ALERTNESS; } YY_BREAK case 147: YY_RULE_SETUP -#line 267 "lev_comp.l" +#line 269 "lev_comp.l" { savetoken(yytext); yylval.i= M_AP_FURNITURE; return MON_APPEARANCE; } YY_BREAK case 148: YY_RULE_SETUP -#line 268 "lev_comp.l" +#line 270 "lev_comp.l" { savetoken(yytext); yylval.i= M_AP_MONSTER; return MON_APPEARANCE; } YY_BREAK case 149: YY_RULE_SETUP -#line 269 "lev_comp.l" +#line 271 "lev_comp.l" { savetoken(yytext); yylval.i= M_AP_OBJECT; return MON_APPEARANCE; } YY_BREAK case 150: YY_RULE_SETUP -#line 270 "lev_comp.l" +#line 272 "lev_comp.l" { savetoken(yytext); yylval.i=2; return ALTAR_TYPE; } YY_BREAK case 151: YY_RULE_SETUP -#line 271 "lev_comp.l" +#line 273 "lev_comp.l" { savetoken(yytext); yylval.i=1; return ALTAR_TYPE; } YY_BREAK case 152: YY_RULE_SETUP -#line 272 "lev_comp.l" +#line 274 "lev_comp.l" { savetoken(yytext); yylval.i=0; return ALTAR_TYPE; } YY_BREAK case 153: YY_RULE_SETUP -#line 273 "lev_comp.l" +#line 275 "lev_comp.l" { savetoken(yytext); yylval.i=1; return UP_OR_DOWN; } YY_BREAK case 154: YY_RULE_SETUP -#line 274 "lev_comp.l" +#line 276 "lev_comp.l" { savetoken(yytext); yylval.i=0; return UP_OR_DOWN; } YY_BREAK case 155: YY_RULE_SETUP -#line 275 "lev_comp.l" +#line 277 "lev_comp.l" { savetoken(yytext); yylval.i=0; return BOOLEAN; } YY_BREAK case 156: YY_RULE_SETUP -#line 276 "lev_comp.l" +#line 278 "lev_comp.l" { savetoken(yytext); yylval.i=1; return BOOLEAN; } YY_BREAK case 157: YY_RULE_SETUP -#line 277 "lev_comp.l" +#line 279 "lev_comp.l" { savetoken(yytext); yylval.i=DUST; return ENGRAVING_TYPE; } YY_BREAK case 158: YY_RULE_SETUP -#line 278 "lev_comp.l" +#line 280 "lev_comp.l" { savetoken(yytext); yylval.i=ENGRAVE; return ENGRAVING_TYPE; } YY_BREAK case 159: YY_RULE_SETUP -#line 279 "lev_comp.l" +#line 281 "lev_comp.l" { savetoken(yytext); yylval.i=BURN; return ENGRAVING_TYPE; } YY_BREAK case 160: YY_RULE_SETUP -#line 280 "lev_comp.l" +#line 282 "lev_comp.l" { savetoken(yytext); yylval.i=MARK; return ENGRAVING_TYPE; } YY_BREAK case 161: YY_RULE_SETUP -#line 281 "lev_comp.l" +#line 283 "lev_comp.l" { savetoken(yytext); yylval.i=ENGR_BLOOD; return ENGRAVING_TYPE; } YY_BREAK case 162: YY_RULE_SETUP -#line 282 "lev_comp.l" +#line 284 "lev_comp.l" { savetoken(yytext); yylval.i=1; return CURSE_TYPE; } YY_BREAK case 163: YY_RULE_SETUP -#line 283 "lev_comp.l" +#line 285 "lev_comp.l" { savetoken(yytext); yylval.i=2; return CURSE_TYPE; } YY_BREAK case 164: YY_RULE_SETUP -#line 284 "lev_comp.l" +#line 286 "lev_comp.l" { savetoken(yytext); yylval.i=3; return CURSE_TYPE; } YY_BREAK case 165: YY_RULE_SETUP -#line 285 "lev_comp.l" +#line 287 "lev_comp.l" { savetoken(yytext); yylval.i=NOTELEPORT; return FLAG_TYPE; } YY_BREAK case 166: YY_RULE_SETUP -#line 286 "lev_comp.l" +#line 288 "lev_comp.l" { savetoken(yytext); yylval.i=HARDFLOOR; return FLAG_TYPE; } YY_BREAK case 167: YY_RULE_SETUP -#line 287 "lev_comp.l" +#line 289 "lev_comp.l" { savetoken(yytext); yylval.i=NOMMAP; return FLAG_TYPE; } YY_BREAK case 168: YY_RULE_SETUP -#line 288 "lev_comp.l" +#line 290 "lev_comp.l" { savetoken(yytext); yylval.i=ARBOREAL; return FLAG_TYPE; } /* KMH */ YY_BREAK case 169: YY_RULE_SETUP -#line 289 "lev_comp.l" +#line 291 "lev_comp.l" { savetoken(yytext); yylval.i=SHORTSIGHTED; return FLAG_TYPE; } YY_BREAK case 170: YY_RULE_SETUP -#line 290 "lev_comp.l" +#line 292 "lev_comp.l" { savetoken(yytext); yylval.i=MAZELEVEL; return FLAG_TYPE; } YY_BREAK case 171: YY_RULE_SETUP -#line 291 "lev_comp.l" +#line 293 "lev_comp.l" { savetoken(yytext); yylval.i=PREMAPPED; return FLAG_TYPE; } YY_BREAK case 172: YY_RULE_SETUP -#line 292 "lev_comp.l" +#line 294 "lev_comp.l" { savetoken(yytext); yylval.i=SHROUD; return FLAG_TYPE; } YY_BREAK case 173: YY_RULE_SETUP -#line 293 "lev_comp.l" +#line 295 "lev_comp.l" { savetoken(yytext); yylval.i=GRAVEYARD; return FLAG_TYPE; } YY_BREAK case 174: YY_RULE_SETUP -#line 294 "lev_comp.l" +#line 296 "lev_comp.l" +{ savetoken(yytext); yylval.i=ICEDPOOLS; return FLAG_TYPE; } + YY_BREAK +case 175: +YY_RULE_SETUP +#line 297 "lev_comp.l" +{ savetoken(yytext); yylval.i=SOLIDIFY; return FLAG_TYPE; } + YY_BREAK +case 176: +YY_RULE_SETUP +#line 298 "lev_comp.l" { char *p = strchr(yytext, 'd'); savetoken(yytext); if (p) { @@ -2238,122 +2391,124 @@ YY_RULE_SETUP return DICE; } YY_BREAK -case 175: +case 177: YY_RULE_SETUP -#line 304 "lev_comp.l" +#line 308 "lev_comp.l" { savetoken(yytext); yylval.i = atoi(yytext + 1); if (yylval.i < 0 || yylval.i > 100) lc_error("Unexpected percentile '%li%%'", yylval.i); return PERCENT; } YY_BREAK -case 176: -YY_RULE_SETUP -#line 308 "lev_comp.l" -{ savetoken(yytext); yylval.i=atoi(yytext); return MINUS_INTEGER; } - YY_BREAK -case 177: -YY_RULE_SETUP -#line 309 "lev_comp.l" -{ savetoken(yytext); yylval.i=atoi(yytext); return PLUS_INTEGER; } - YY_BREAK case 178: YY_RULE_SETUP -#line 310 "lev_comp.l" +#line 312 "lev_comp.l" +{ savetoken(yytext); yylval.i=atoi(yytext); return MINUS_INTEGER; } + YY_BREAK +case 179: +YY_RULE_SETUP +#line 313 "lev_comp.l" +{ savetoken(yytext); yylval.i=atoi(yytext); return PLUS_INTEGER; } + YY_BREAK +case 180: +YY_RULE_SETUP +#line 314 "lev_comp.l" { savetoken(yytext); yylval.i = atoi(yytext); if (yylval.i < 0 || yylval.i > 100) lc_error("Unexpected percentile '%li%%'", yylval.i); return SPERCENT; } YY_BREAK -case 179: +case 181: YY_RULE_SETUP -#line 314 "lev_comp.l" +#line 318 "lev_comp.l" { savetoken(yytext); yylval.i=atoi(yytext); return INTEGER; } YY_BREAK -case 180: +case 182: +/* rule 182 can match eol */ YY_RULE_SETUP -#line 315 "lev_comp.l" +#line 319 "lev_comp.l" { savetoken(yytext); yytext[yyleng-1] = 0; /* Discard the trailing \" */ yylval.map = (char *) alloc(strlen(yytext+1)+1); Strcpy(yylval.map, yytext+1); /* Discard the first \" */ return STRING; } YY_BREAK -case 181: -YY_RULE_SETUP -#line 320 "lev_comp.l" -{ savetoken(yytext); return handle_varstring_check(); } - YY_BREAK -case 182: -YY_RULE_SETUP -#line 321 "lev_comp.l" -{ savetoken(yytext); yylval.i = SPO_JE; return COMPARE_TYPE; } - YY_BREAK case 183: YY_RULE_SETUP -#line 322 "lev_comp.l" -{ savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } +#line 324 "lev_comp.l" +{ savetoken(yytext); return handle_varstring_check(); } YY_BREAK case 184: YY_RULE_SETUP -#line 323 "lev_comp.l" -{ savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } +#line 325 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JE; return COMPARE_TYPE; } YY_BREAK case 185: YY_RULE_SETUP -#line 324 "lev_comp.l" -{ savetoken(yytext); yylval.i = SPO_JLE; return COMPARE_TYPE; } +#line 326 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } YY_BREAK case 186: YY_RULE_SETUP -#line 325 "lev_comp.l" -{ savetoken(yytext); yylval.i = SPO_JGE; return COMPARE_TYPE; } +#line 327 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JNE; return COMPARE_TYPE; } YY_BREAK case 187: YY_RULE_SETUP -#line 326 "lev_comp.l" -{ savetoken(yytext); yylval.i = SPO_JL; return COMPARE_TYPE; } +#line 328 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JLE; return COMPARE_TYPE; } YY_BREAK case 188: YY_RULE_SETUP -#line 327 "lev_comp.l" -{ savetoken(yytext); yylval.i = SPO_JG; return COMPARE_TYPE; } +#line 329 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JGE; return COMPARE_TYPE; } YY_BREAK case 189: YY_RULE_SETUP -#line 328 "lev_comp.l" -{ newline(); } +#line 330 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JL; return COMPARE_TYPE; } YY_BREAK case 190: YY_RULE_SETUP -#line 329 "lev_comp.l" -{ advancepos(yytext); } +#line 331 "lev_comp.l" +{ savetoken(yytext); yylval.i = SPO_JG; return COMPARE_TYPE; } YY_BREAK case 191: +/* rule 191 can match eol */ YY_RULE_SETUP -#line 330 "lev_comp.l" -{ savetoken(yytext); yylval.i = yytext[2]; return CHAR; } +#line 332 "lev_comp.l" +{ newline(); } YY_BREAK case 192: YY_RULE_SETUP -#line 331 "lev_comp.l" -{ savetoken(yytext); yylval.i = yytext[1]; return CHAR; } +#line 333 "lev_comp.l" +{ advancepos(yytext); } YY_BREAK case 193: YY_RULE_SETUP -#line 332 "lev_comp.l" -ST_RET(UNKNOWN_TYPE); +#line 334 "lev_comp.l" +{ savetoken(yytext); yylval.i = yytext[2]; return CHAR; } YY_BREAK case 194: YY_RULE_SETUP -#line 333 "lev_comp.l" -{ savetoken(yytext); return yytext[0]; } +#line 335 "lev_comp.l" +{ savetoken(yytext); yylval.i = yytext[1]; return CHAR; } YY_BREAK case 195: YY_RULE_SETUP -#line 334 "lev_comp.l" +#line 336 "lev_comp.l" +ST_RET(UNKNOWN_TYPE); + YY_BREAK +case 196: +YY_RULE_SETUP +#line 337 "lev_comp.l" +{ savetoken(yytext); return yytext[0]; } + YY_BREAK +case 197: +YY_RULE_SETUP +#line 338 "lev_comp.l" ECHO; YY_BREAK -#line 2357 "lex.yy.c" +#line 2512 "lex.yy.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(MAPC): yyterminate(); @@ -2361,26 +2516,26 @@ case YY_STATE_EOF(MAPC): 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; + 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_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + if ( YY_CURRENT_BUFFER_LVALUE->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 + * 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; + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position @@ -2390,13 +2545,13 @@ case YY_STATE_EOF(MAPC): * 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] ) + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->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_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have @@ -2409,30 +2564,30 @@ case YY_STATE_EOF(MAPC): yy_next_state = yy_try_NUL_trans( yy_current_state ); - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; + yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { - yy_cp = yy_c_buf_p; + yy_cp = (yy_c_buf_p); goto yy_find_action; } } - else switch ( yy_get_next_buffer() ) + else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { - yy_did_buffer_switch_on_eof = 0; + (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap() ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -2443,7 +2598,7 @@ case YY_STATE_EOF(MAPC): * YY_NULL, it'll still work - another * YY_NULL will get returned. */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; @@ -2451,30 +2606,30 @@ case YY_STATE_EOF(MAPC): else { - if ( ! yy_did_buffer_switch_on_eof ) + 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_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; + 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_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; @@ -2485,8 +2640,8 @@ case YY_STATE_EOF(MAPC): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ - } /* end of yylex */ - + } /* end of user's declarations */ +} /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -2495,21 +2650,20 @@ case YY_STATE_EOF(MAPC): * 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; +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->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] ) + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->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 ) + if ( YY_CURRENT_BUFFER_LVALUE->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 ) + 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. @@ -2529,38 +2683,34 @@ static int yy_get_next_buffer() /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + 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 ) + if ( YY_CURRENT_BUFFER_LVALUE->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; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_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; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); + (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -2569,8 +2719,7 @@ static int yy_get_next_buffer() 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 ); + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ @@ -2580,35 +2729,35 @@ static int yy_get_next_buffer() YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = yy_current_buffer->yy_buf_size - + num_to_read = YY_CURRENT_BUFFER_LVALUE->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_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); - yy_current_buffer->yy_n_chars = yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } - if ( yy_n_chars == 0 ) + if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); + yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } @@ -2616,153 +2765,146 @@ static int yy_get_next_buffer() else ret_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; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->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() - { + static yy_state_type yy_get_previous_state (void) +{ register yy_state_type yy_current_state; register char *yy_cp; - - yy_current_state = yy_start; + + yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + 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); if ( yy_accept[yy_current_state] ) { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = 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 >= 1038 ) + if ( yy_current_state >= 1049 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } 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_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; + register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = 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 >= 1038 ) + if ( yy_current_state >= 1049 ) 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 == 1037); + yy_is_jam = (yy_current_state == 1048); - return yy_is_jam ? 0 : yy_current_state; - } + return yy_is_jam ? 0 : yy_current_state; +} - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; + *yy_cp = (yy_hold_char); - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->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 yy_size_t number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - while ( source > yy_current_buffer->yy_ch_buf ) + while ( source > YY_CURRENT_BUFFER_LVALUE->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; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - +#ifndef YY_NO_INPUT #ifdef __cplusplus -static int yyinput() + static int yyinput (void) #else -static int input() + static int input (void) #endif - { + +{ int c; + + *(yy_c_buf_p) = (yy_hold_char); - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_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] ) + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ - *yy_c_buf_p = '\0'; + *(yy_c_buf_p) = '\0'; else { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); - switch ( yy_get_next_buffer() ) + switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() @@ -2776,16 +2918,16 @@ static int input() */ /* Reset buffer status. */ - yyrestart( yyin ); + yyrestart(yyin ); - /* fall through */ + /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap() ) + if ( yywrap( ) ) return EOF; - if ( ! yy_did_buffer_switch_on_eof ) + if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); @@ -2795,91 +2937,94 @@ static int input() } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; + (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; + 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'); + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); } + yy_init_buffer(YY_CURRENT_BUFFER,input_file ); + yy_load_buffer_state( ); +} -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void 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_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) return; - if ( yy_current_buffer ) + 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_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } - yy_current_buffer = new_buffer; - yy_load_buffer_state(); + YY_CURRENT_BUFFER_LVALUE = 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; - } + (yy_did_buffer_switch_on_eof) = 1; +} +static void yy_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void 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_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) +{ YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -2888,80 +3033,71 @@ int 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 ); + b->yy_ch_buf = (char *) yyalloc(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 ); + yy_init_buffer(b,file ); return b; - } +} - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * + */ + void yy_delete_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) return; - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); + yyfree((void *) b->yy_ch_buf ); - yy_flex_free( (void *) b ); - } + yyfree((void *) b ); +} +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); +{ + int oerrno = errno; + + yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void yy_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) return; b->yy_n_chars = 0; @@ -2978,29 +3114,125 @@ YY_BUFFER_STATE b; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == yy_current_buffer ) - yy_load_buffer_state(); + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void yypop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (void) +{ + yy_size_t num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; } + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +{ 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 ) ); + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); @@ -3014,56 +3246,51 @@ yy_size_t size; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - yy_switch_to_buffer( b ); + yy_switch_to_buffer(b ); return b; - } -#endif +} +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) +{ + + return yy_scan_bytes(yystr,strlen(yystr) ); +} -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_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_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +{ YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; - + yy_size_t i; + /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); + n = _yybytes_len + 2; + buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = yy_scan_buffer( buf, n ); + b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); @@ -3073,78 +3300,17 @@ int len; b->yy_is_our_buffer = 1; return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static 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 ); - - else - yy_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_STATE -static 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_STATE -static 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_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); - } - - +} /* Redefine yyless() so it works in section 3 code. */ @@ -3153,68 +3319,177 @@ char msg[]; 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; \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ } \ while ( 0 ) +/* Accessor methods (get/set functions) to struct members. */ -/* Internal utility routines. */ +/** Get the current line number. + * + */ +int yyget_lineno (void) +{ + + return yylineno; +} + +/** Get the input stream. + * + */ +FILE *yyget_in (void) +{ + return yyin; +} + +/** Get the output stream. + * + */ +FILE *yyget_out (void) +{ + return yyout; +} + +/** Get the length of the current token. + * + */ +yy_size_t yyget_leng (void) +{ + return yyleng; +} + +/** Get the current token. + * + */ + +char *yyget_text (void) +{ + return yytext; +} + +/** Set the current line number. + * @param line_number + * + */ +void yyset_lineno (int line_number ) +{ + + yylineno = line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * in_str ) +{ + yyin = in_str ; +} + +void yyset_out (FILE * out_str ) +{ + yyout = out_str ; +} + +int yyget_debug (void) +{ + return yy_flex_debug; +} + +void yyset_debug (int bdebug ) +{ + yy_flex_debug = bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = (FILE *) 0; + yyout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } + + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ #ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; - } +} #endif #ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { +static int yy_flex_strlen (yyconst char * s ) +{ register int n; for ( n = 0; s[n]; ++n ) ; return n; - } +} #endif - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { +void *yyalloc (yy_size_t size ) +{ return (void *) malloc( size ); - } +} -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { +void *yyrealloc (void * ptr, yy_size_t size ) +{ /* 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 @@ -3223,26 +3498,17 @@ yy_size_t size; * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); - } +} -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } +void yyfree (void * ptr ) +{ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 337 "lev_comp.l" -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 334 "lev_comp.l" #ifdef AMIGA long *alloc(n) @@ -3319,3 +3585,4 @@ char *s; } /*lev_comp.l*/ + diff --git a/sys/share/lev_yacc.c b/sys/share/lev_yacc.c index f247c880b..376c48759 100644 --- a/sys/share/lev_yacc.c +++ b/sys/share/lev_yacc.c @@ -1,21 +1,19 @@ +/* A Bison parser, made by GNU Bison 3.0.2. */ -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, 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 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -28,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -46,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.1" +#define YYBISON_VERSION "3.0.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -60,17 +58,15 @@ /* Pull parsers. */ #define YYPULL 1 -/* Using locations. */ -#define YYLSP_NEEDED 0 /* Copy the first part of user declarations. */ +#line 1 "lev_comp.y" /* yacc.c:339 */ -/* Line 189 of yacc.c */ -#line 1 "lev_comp.y" - -/* SCCS Id: @(#)lev_yacc.c 3.4 2000/01/17 */ +/* NetHack 3.5 lev_comp.y $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev_comp.y $Date: 2009/05/06 10:54:31 $ $Revision: 1.8 $ */ +/* SCCS Id: @(#)lev_yacc.c 3.5 2007/08/01 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -212,14 +208,15 @@ extern const char *fname; extern char curr_token[512]; +#line 212 "y.tab.c" /* yacc.c:339 */ -/* Line 189 of yacc.c */ -#line 218 "y.tab.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif +# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE @@ -229,193 +226,198 @@ extern char curr_token[512]; # define YYERROR_VERBOSE 0 #endif -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 +/* In a future release of Bison, this section will be replaced + by #include "y.tab.h". */ +#ifndef YY_YY_Y_TAB_H_INCLUDED +# define YY_YY_Y_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int yydebug; #endif - -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - CHAR = 258, - INTEGER = 259, - BOOLEAN = 260, - PERCENT = 261, - SPERCENT = 262, - MINUS_INTEGER = 263, - PLUS_INTEGER = 264, - MAZE_GRID_ID = 265, - SOLID_FILL_ID = 266, - MINES_ID = 267, - ROGUELEV_ID = 268, - MESSAGE_ID = 269, - MAZE_ID = 270, - LEVEL_ID = 271, - LEV_INIT_ID = 272, - GEOMETRY_ID = 273, - NOMAP_ID = 274, - OBJECT_ID = 275, - COBJECT_ID = 276, - MONSTER_ID = 277, - TRAP_ID = 278, - DOOR_ID = 279, - DRAWBRIDGE_ID = 280, - object_ID = 281, - monster_ID = 282, - terrain_ID = 283, - MAZEWALK_ID = 284, - WALLIFY_ID = 285, - REGION_ID = 286, - FILLING = 287, - IRREGULAR = 288, - JOINED = 289, - ALTAR_ID = 290, - LADDER_ID = 291, - STAIR_ID = 292, - NON_DIGGABLE_ID = 293, - NON_PASSWALL_ID = 294, - ROOM_ID = 295, - PORTAL_ID = 296, - TELEPRT_ID = 297, - BRANCH_ID = 298, - LEV = 299, - MINERALIZE_ID = 300, - CORRIDOR_ID = 301, - GOLD_ID = 302, - ENGRAVING_ID = 303, - FOUNTAIN_ID = 304, - POOL_ID = 305, - SINK_ID = 306, - NONE = 307, - RAND_CORRIDOR_ID = 308, - DOOR_STATE = 309, - LIGHT_STATE = 310, - CURSE_TYPE = 311, - ENGRAVING_TYPE = 312, - DIRECTION = 313, - RANDOM_TYPE = 314, - RANDOM_TYPE_BRACKET = 315, - A_REGISTER = 316, - ALIGNMENT = 317, - LEFT_OR_RIGHT = 318, - CENTER = 319, - TOP_OR_BOT = 320, - ALTAR_TYPE = 321, - UP_OR_DOWN = 322, - SUBROOM_ID = 323, - NAME_ID = 324, - FLAGS_ID = 325, - FLAG_TYPE = 326, - MON_ATTITUDE = 327, - MON_ALERTNESS = 328, - MON_APPEARANCE = 329, - ROOMDOOR_ID = 330, - IF_ID = 331, - ELSE_ID = 332, - TERRAIN_ID = 333, - HORIZ_OR_VERT = 334, - REPLACE_TERRAIN_ID = 335, - EXIT_ID = 336, - SHUFFLE_ID = 337, - QUANTITY_ID = 338, - BURIED_ID = 339, - LOOP_ID = 340, - FOR_ID = 341, - TO_ID = 342, - SWITCH_ID = 343, - CASE_ID = 344, - BREAK_ID = 345, - DEFAULT_ID = 346, - ERODED_ID = 347, - TRAPPED_ID = 348, - RECHARGED_ID = 349, - INVIS_ID = 350, - GREASED_ID = 351, - FEMALE_ID = 352, - CANCELLED_ID = 353, - REVIVED_ID = 354, - AVENGE_ID = 355, - FLEEING_ID = 356, - BLINDED_ID = 357, - PARALYZED_ID = 358, - STUNNED_ID = 359, - CONFUSED_ID = 360, - SEENTRAPS_ID = 361, - ALL_ID = 362, - MONTYPE_ID = 363, - GRAVE_ID = 364, - ERODEPROOF_ID = 365, - FUNCTION_ID = 366, - MSG_OUTPUT_TYPE = 367, - COMPARE_TYPE = 368, - UNKNOWN_TYPE = 369, - rect_ID = 370, - fillrect_ID = 371, - line_ID = 372, - randline_ID = 373, - grow_ID = 374, - selection_ID = 375, - flood_ID = 376, - rndcoord_ID = 377, - circle_ID = 378, - ellipse_ID = 379, - filter_ID = 380, - complement_ID = 381, - gradient_ID = 382, - GRADIENT_TYPE = 383, - LIMITED = 384, - HUMIDITY_TYPE = 385, - STRING = 386, - MAP_ID = 387, - NQSTRING = 388, - VARSTRING = 389, - CFUNC = 390, - CFUNC_INT = 391, - CFUNC_STR = 392, - CFUNC_COORD = 393, - CFUNC_REGION = 394, - VARSTRING_INT = 395, - VARSTRING_INT_ARRAY = 396, - VARSTRING_STRING = 397, - VARSTRING_STRING_ARRAY = 398, - VARSTRING_VAR = 399, - VARSTRING_VAR_ARRAY = 400, - VARSTRING_COORD = 401, - VARSTRING_COORD_ARRAY = 402, - VARSTRING_REGION = 403, - VARSTRING_REGION_ARRAY = 404, - VARSTRING_MAPCHAR = 405, - VARSTRING_MAPCHAR_ARRAY = 406, - VARSTRING_MONST = 407, - VARSTRING_MONST_ARRAY = 408, - VARSTRING_OBJ = 409, - VARSTRING_OBJ_ARRAY = 410, - VARSTRING_SEL = 411, - VARSTRING_SEL_ARRAY = 412, - METHOD_INT = 413, - METHOD_INT_ARRAY = 414, - METHOD_STRING = 415, - METHOD_STRING_ARRAY = 416, - METHOD_VAR = 417, - METHOD_VAR_ARRAY = 418, - METHOD_COORD = 419, - METHOD_COORD_ARRAY = 420, - METHOD_REGION = 421, - METHOD_REGION_ARRAY = 422, - METHOD_MAPCHAR = 423, - METHOD_MAPCHAR_ARRAY = 424, - METHOD_MONST = 425, - METHOD_MONST_ARRAY = 426, - METHOD_OBJ = 427, - METHOD_OBJ_ARRAY = 428, - METHOD_SEL = 429, - METHOD_SEL_ARRAY = 430, - DICE = 431 - }; + enum yytokentype + { + CHAR = 258, + INTEGER = 259, + BOOLEAN = 260, + PERCENT = 261, + SPERCENT = 262, + MINUS_INTEGER = 263, + PLUS_INTEGER = 264, + MAZE_GRID_ID = 265, + SOLID_FILL_ID = 266, + MINES_ID = 267, + ROGUELEV_ID = 268, + MESSAGE_ID = 269, + MAZE_ID = 270, + LEVEL_ID = 271, + LEV_INIT_ID = 272, + GEOMETRY_ID = 273, + NOMAP_ID = 274, + OBJECT_ID = 275, + COBJECT_ID = 276, + MONSTER_ID = 277, + TRAP_ID = 278, + DOOR_ID = 279, + DRAWBRIDGE_ID = 280, + object_ID = 281, + monster_ID = 282, + terrain_ID = 283, + MAZEWALK_ID = 284, + WALLIFY_ID = 285, + REGION_ID = 286, + FILLING = 287, + IRREGULAR = 288, + JOINED = 289, + ALTAR_ID = 290, + LADDER_ID = 291, + STAIR_ID = 292, + NON_DIGGABLE_ID = 293, + NON_PASSWALL_ID = 294, + ROOM_ID = 295, + PORTAL_ID = 296, + TELEPRT_ID = 297, + BRANCH_ID = 298, + LEV = 299, + MINERALIZE_ID = 300, + CORRIDOR_ID = 301, + GOLD_ID = 302, + ENGRAVING_ID = 303, + FOUNTAIN_ID = 304, + POOL_ID = 305, + SINK_ID = 306, + NONE = 307, + RAND_CORRIDOR_ID = 308, + DOOR_STATE = 309, + LIGHT_STATE = 310, + CURSE_TYPE = 311, + ENGRAVING_TYPE = 312, + DIRECTION = 313, + RANDOM_TYPE = 314, + RANDOM_TYPE_BRACKET = 315, + A_REGISTER = 316, + ALIGNMENT = 317, + LEFT_OR_RIGHT = 318, + CENTER = 319, + TOP_OR_BOT = 320, + ALTAR_TYPE = 321, + UP_OR_DOWN = 322, + SUBROOM_ID = 323, + NAME_ID = 324, + FLAGS_ID = 325, + FLAG_TYPE = 326, + MON_ATTITUDE = 327, + MON_ALERTNESS = 328, + MON_APPEARANCE = 329, + ROOMDOOR_ID = 330, + IF_ID = 331, + ELSE_ID = 332, + TERRAIN_ID = 333, + HORIZ_OR_VERT = 334, + REPLACE_TERRAIN_ID = 335, + EXIT_ID = 336, + SHUFFLE_ID = 337, + QUANTITY_ID = 338, + BURIED_ID = 339, + LOOP_ID = 340, + FOR_ID = 341, + TO_ID = 342, + SWITCH_ID = 343, + CASE_ID = 344, + BREAK_ID = 345, + DEFAULT_ID = 346, + ERODED_ID = 347, + TRAPPED_ID = 348, + RECHARGED_ID = 349, + INVIS_ID = 350, + GREASED_ID = 351, + FEMALE_ID = 352, + CANCELLED_ID = 353, + REVIVED_ID = 354, + AVENGE_ID = 355, + FLEEING_ID = 356, + BLINDED_ID = 357, + PARALYZED_ID = 358, + STUNNED_ID = 359, + CONFUSED_ID = 360, + SEENTRAPS_ID = 361, + ALL_ID = 362, + MONTYPE_ID = 363, + GRAVE_ID = 364, + ERODEPROOF_ID = 365, + FUNCTION_ID = 366, + MSG_OUTPUT_TYPE = 367, + COMPARE_TYPE = 368, + UNKNOWN_TYPE = 369, + rect_ID = 370, + fillrect_ID = 371, + line_ID = 372, + randline_ID = 373, + grow_ID = 374, + selection_ID = 375, + flood_ID = 376, + rndcoord_ID = 377, + circle_ID = 378, + ellipse_ID = 379, + filter_ID = 380, + complement_ID = 381, + gradient_ID = 382, + GRADIENT_TYPE = 383, + LIMITED = 384, + HUMIDITY_TYPE = 385, + STRING = 386, + MAP_ID = 387, + NQSTRING = 388, + VARSTRING = 389, + CFUNC = 390, + CFUNC_INT = 391, + CFUNC_STR = 392, + CFUNC_COORD = 393, + CFUNC_REGION = 394, + VARSTRING_INT = 395, + VARSTRING_INT_ARRAY = 396, + VARSTRING_STRING = 397, + VARSTRING_STRING_ARRAY = 398, + VARSTRING_VAR = 399, + VARSTRING_VAR_ARRAY = 400, + VARSTRING_COORD = 401, + VARSTRING_COORD_ARRAY = 402, + VARSTRING_REGION = 403, + VARSTRING_REGION_ARRAY = 404, + VARSTRING_MAPCHAR = 405, + VARSTRING_MAPCHAR_ARRAY = 406, + VARSTRING_MONST = 407, + VARSTRING_MONST_ARRAY = 408, + VARSTRING_OBJ = 409, + VARSTRING_OBJ_ARRAY = 410, + VARSTRING_SEL = 411, + VARSTRING_SEL_ARRAY = 412, + METHOD_INT = 413, + METHOD_INT_ARRAY = 414, + METHOD_STRING = 415, + METHOD_STRING_ARRAY = 416, + METHOD_VAR = 417, + METHOD_VAR_ARRAY = 418, + METHOD_COORD = 419, + METHOD_COORD_ARRAY = 420, + METHOD_REGION = 421, + METHOD_REGION_ARRAY = 422, + METHOD_MAPCHAR = 423, + METHOD_MAPCHAR_ARRAY = 424, + METHOD_MONST = 425, + METHOD_MONST_ARRAY = 426, + METHOD_OBJ = 427, + METHOD_OBJ_ARRAY = 428, + METHOD_SEL = 429, + METHOD_SEL_ARRAY = 430, + DICE = 431 + }; #endif /* Tokens. */ #define CHAR 258 @@ -593,15 +595,12 @@ extern char curr_token[512]; #define METHOD_SEL_ARRAY 430 #define DICE 431 - - - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +typedef union YYSTYPE YYSTYPE; +union YYSTYPE { - -/* Line 214 of yacc.c */ -#line 146 "lev_comp.y" +#line 148 "lev_comp.y" /* yacc.c:355 */ long i; char* map; @@ -638,22 +637,22 @@ typedef union YYSTYPE char *varstr; } meth; - - -/* Line 214 of yacc.c */ -#line 645 "y.tab.c" -} YYSTYPE; +#line 641 "y.tab.c" /* yacc.c:355 */ +}; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif +extern YYSTYPE yylval; + +int yyparse (void); + +#endif /* !YY_YY_Y_TAB_H_INCLUDED */ + /* Copy the second part of user declarations. */ - -/* Line 264 of yacc.c */ -#line 657 "y.tab.c" +#line 656 "y.tab.c" /* yacc.c:358 */ #ifdef short # undef short @@ -667,11 +666,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -691,8 +687,7 @@ typedef short int yytype_int16; # 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) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -703,41 +698,70 @@ typedef short int yytype_int16; #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ -# if YYENABLE_NLS +# if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ -# define YY_(msgid) msgid +# define YY_(Msgid) Msgid +# endif +#endif + +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) +# define YYUSE(E) ((void) (E)) #else -# define YYUSE(e) /* empty */ +# define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + #if ! defined yyoverflow || YYERROR_VERBOSE @@ -756,11 +780,11 @@ YYID (yyi) # 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) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # endif @@ -768,8 +792,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (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 safely @@ -783,25 +807,23 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS 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) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -811,7 +833,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -829,42 +851,46 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) -/* Copy COUNT objects from FROM to TO. The source and destination do - not 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 +# define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + /* YYFINAL -- State number of the termination state. */ #define YYFINAL 9 /* YYLAST -- Last index in YYTABLE. */ @@ -876,17 +902,19 @@ union yyalloc #define YYNNTS 160 /* YYNRULES -- Number of rules. */ #define YYNRULES 406 -/* YYNRULES -- Number of states. */ +/* YYNSTATES -- Number of states. */ #define YYNSTATES 866 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 431 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -936,244 +964,54 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 4, 6, 8, 11, 15, 19, 25, - 27, 29, 35, 41, 45, 62, 63, 66, 67, 70, - 71, 74, 76, 78, 79, 83, 87, 89, 90, 93, - 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, - 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, - 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, - 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, - 177, 179, 181, 183, 185, 187, 189, 191, 193, 195, - 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, - 217, 219, 221, 223, 225, 227, 229, 231, 235, 239, - 245, 249, 255, 261, 267, 271, 275, 281, 287, 293, - 301, 309, 317, 323, 325, 329, 331, 335, 337, 341, - 343, 347, 349, 353, 355, 359, 361, 365, 366, 367, - 376, 381, 383, 384, 386, 388, 394, 398, 399, 400, - 410, 411, 414, 415, 421, 422, 427, 429, 432, 434, - 441, 442, 446, 447, 454, 455, 460, 461, 466, 468, - 469, 474, 478, 480, 484, 488, 494, 500, 508, 513, - 514, 525, 526, 539, 540, 543, 549, 551, 557, 559, - 565, 567, 573, 575, 585, 591, 593, 595, 597, 599, - 601, 605, 607, 609, 611, 619, 625, 627, 629, 631, - 633, 637, 638, 644, 649, 650, 654, 656, 658, 660, - 662, 665, 667, 669, 671, 673, 675, 679, 683, 687, - 689, 691, 695, 697, 699, 703, 707, 708, 714, 717, - 718, 722, 724, 728, 730, 734, 738, 740, 742, 746, - 748, 750, 752, 756, 758, 760, 762, 768, 776, 782, - 791, 793, 797, 803, 809, 817, 825, 832, 838, 839, - 842, 846, 850, 854, 856, 862, 872, 878, 882, 886, - 887, 898, 899, 901, 909, 915, 921, 925, 931, 939, - 949, 951, 953, 955, 957, 959, 960, 963, 965, 969, - 971, 973, 975, 977, 979, 981, 983, 985, 987, 989, - 991, 993, 997, 999, 1001, 1006, 1008, 1010, 1015, 1017, - 1019, 1024, 1026, 1031, 1037, 1039, 1043, 1045, 1049, 1051, - 1053, 1058, 1068, 1070, 1072, 1077, 1079, 1085, 1087, 1089, - 1094, 1096, 1098, 1104, 1106, 1108, 1110, 1115, 1117, 1119, - 1125, 1127, 1129, 1133, 1135, 1137, 1141, 1143, 1148, 1152, - 1156, 1160, 1164, 1168, 1172, 1174, 1176, 1180, 1182, 1186, - 1187, 1189, 1191, 1193, 1195, 1199, 1200, 1202, 1204, 1207, - 1210, 1215, 1222, 1227, 1234, 1241, 1248, 1255, 1258, 1265, - 1274, 1283, 1294, 1309, 1312, 1314, 1318, 1320, 1324, 1326, - 1328, 1330, 1332, 1334, 1336, 1338, 1340, 1342, 1344, 1346, - 1348, 1350, 1352, 1354, 1356, 1358, 1369 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 195, 0, -1, -1, 196, -1, 197, -1, 197, 196, - -1, 198, 205, 207, -1, 16, 132, 139, -1, 15, - 132, 139, 131, 199, -1, 59, -1, 3, -1, 17, - 132, 11, 131, 297, -1, 17, 132, 10, 131, 3, - -1, 17, 132, 13, -1, 17, 132, 12, 131, 3, - 131, 3, 131, 5, 131, 5, 131, 316, 131, 204, - 203, -1, -1, 131, 129, -1, -1, 131, 323, -1, - -1, 131, 3, -1, 5, -1, 59, -1, -1, 70, - 132, 206, -1, 71, 131, 206, -1, 71, -1, -1, - 209, 207, -1, 137, 207, 138, -1, 250, -1, 200, - -1, 305, -1, 306, -1, 292, -1, 252, -1, 215, - -1, 214, -1, 300, -1, 264, -1, 284, -1, 308, - -1, 309, -1, 294, -1, 307, -1, 230, -1, 240, - -1, 242, -1, 246, -1, 244, -1, 227, -1, 237, - -1, 223, -1, 226, -1, 287, -1, 269, -1, 285, - -1, 272, -1, 278, -1, 301, -1, 296, -1, 290, - -1, 251, -1, 302, -1, 257, -1, 255, -1, 295, - -1, 299, -1, 298, -1, 288, -1, 289, -1, 291, - -1, 283, -1, 286, -1, 149, -1, 151, -1, 153, - -1, 155, -1, 157, -1, 159, -1, 161, -1, 163, - -1, 165, -1, 148, -1, 150, -1, 152, -1, 154, - -1, 156, -1, 158, -1, 160, -1, 162, -1, 164, - -1, 210, -1, 211, -1, 142, -1, 142, -1, 211, - -1, 82, 132, 210, -1, 212, 190, 335, -1, 212, - 190, 120, 132, 344, -1, 212, 190, 334, -1, 212, - 190, 350, 132, 328, -1, 212, 190, 349, 132, 330, - -1, 212, 190, 348, 132, 332, -1, 212, 190, 323, - -1, 212, 190, 326, -1, 212, 190, 137, 221, 138, - -1, 212, 190, 137, 220, 138, -1, 212, 190, 137, - 219, 138, -1, 212, 190, 350, 132, 137, 218, 138, - -1, 212, 190, 349, 132, 137, 217, 138, -1, 212, - 190, 348, 132, 137, 216, 138, -1, 212, 190, 137, - 222, 138, -1, 333, -1, 216, 131, 333, -1, 331, - -1, 217, 131, 331, -1, 329, -1, 218, 131, 329, - -1, 327, -1, 219, 131, 327, -1, 324, -1, 220, - 131, 324, -1, 335, -1, 221, 131, 335, -1, 334, - -1, 222, 131, 334, -1, -1, -1, 111, 141, 133, - 224, 339, 134, 225, 208, -1, 141, 133, 342, 134, - -1, 81, -1, -1, 6, -1, 6, -1, 135, 335, - 113, 335, 136, -1, 135, 335, 136, -1, -1, -1, - 88, 231, 135, 322, 136, 232, 137, 233, 138, -1, - -1, 234, 233, -1, -1, 89, 346, 132, 235, 207, - -1, -1, 91, 132, 236, 207, -1, 90, -1, 191, - 191, -1, 87, -1, 86, 213, 190, 335, 238, 335, - -1, -1, 239, 241, 208, -1, -1, 85, 135, 322, - 136, 243, 208, -1, -1, 229, 132, 245, 209, -1, - -1, 76, 229, 247, 248, -1, 208, -1, -1, 208, - 249, 77, 208, -1, 14, 132, 334, -1, 53, -1, - 53, 132, 346, -1, 53, 132, 59, -1, 46, 132, - 253, 131, 253, -1, 46, 132, 253, 131, 346, -1, - 133, 4, 131, 58, 131, 268, 134, -1, 311, 228, - 131, 316, -1, -1, 68, 132, 254, 131, 261, 131, - 263, 312, 256, 208, -1, -1, 40, 132, 254, 131, - 260, 131, 262, 131, 263, 312, 258, 208, -1, -1, - 131, 5, -1, 133, 4, 131, 4, 134, -1, 59, - -1, 133, 4, 131, 4, 134, -1, 59, -1, 133, - 270, 131, 271, 134, -1, 59, -1, 133, 4, 131, - 4, 134, -1, 59, -1, 75, 132, 265, 131, 315, - 131, 266, 131, 268, -1, 24, 132, 315, 131, 344, - -1, 5, -1, 59, -1, 267, -1, 59, -1, 58, - -1, 58, 192, 267, -1, 4, -1, 59, -1, 19, - -1, 18, 132, 270, 131, 271, 259, 140, -1, 18, - 132, 323, 259, 140, -1, 63, -1, 64, -1, 65, - -1, 64, -1, 22, 132, 274, -1, -1, 22, 132, - 274, 273, 208, -1, 330, 131, 323, 275, -1, -1, - 275, 131, 276, -1, 334, -1, 72, -1, 73, -1, - 318, -1, 74, 334, -1, 97, -1, 95, -1, 98, - -1, 99, -1, 100, -1, 101, 132, 322, -1, 102, - 132, 322, -1, 103, 132, 322, -1, 104, -1, 105, - -1, 106, 132, 277, -1, 139, -1, 107, -1, 139, - 192, 277, -1, 20, 132, 280, -1, -1, 21, 132, - 280, 279, 208, -1, 332, 281, -1, -1, 281, 131, - 282, -1, 56, -1, 108, 132, 330, -1, 347, -1, - 69, 132, 334, -1, 83, 132, 322, -1, 84, -1, - 55, -1, 92, 132, 322, -1, 110, -1, 54, -1, - 93, -1, 94, 132, 322, -1, 95, -1, 96, -1, - 323, -1, 23, 132, 310, 131, 323, -1, 25, 132, - 323, 131, 58, 131, 315, -1, 29, 132, 323, 131, - 58, -1, 29, 132, 323, 131, 58, 131, 5, 203, - -1, 30, -1, 30, 132, 344, -1, 36, 132, 323, - 131, 67, -1, 37, 132, 323, 131, 67, -1, 37, - 132, 352, 131, 352, 131, 67, -1, 41, 132, 352, - 131, 352, 131, 139, -1, 42, 132, 352, 131, 352, - 293, -1, 43, 132, 352, 131, 352, -1, -1, 131, - 67, -1, 49, 132, 344, -1, 51, 132, 344, -1, - 50, 132, 344, -1, 3, -1, 133, 3, 131, 316, - 134, -1, 80, 132, 326, 131, 328, 131, 328, 131, - 7, -1, 78, 132, 344, 131, 328, -1, 38, 132, - 326, -1, 39, 132, 326, -1, -1, 31, 132, 326, - 131, 316, 131, 311, 312, 303, 304, -1, -1, 208, - -1, 35, 132, 323, 131, 317, 131, 319, -1, 109, - 132, 323, 131, 334, -1, 109, 132, 323, 131, 59, - -1, 109, 132, 323, -1, 47, 132, 335, 131, 323, - -1, 48, 132, 323, 131, 351, 131, 334, -1, 45, - 132, 322, 131, 322, 131, 322, 131, 322, -1, 45, - -1, 139, -1, 59, -1, 139, -1, 59, -1, -1, - 131, 313, -1, 314, -1, 314, 131, 313, -1, 32, - -1, 33, -1, 34, -1, 54, -1, 59, -1, 55, - -1, 59, -1, 62, -1, 320, -1, 59, -1, 62, - -1, 320, -1, 61, 132, 59, -1, 66, -1, 59, - -1, 61, 135, 4, 136, -1, 139, -1, 150, -1, - 151, 135, 335, 136, -1, 335, -1, 324, -1, 122, - 133, 344, 134, -1, 154, -1, 155, 135, 335, 136, - -1, 133, 4, 131, 4, 134, -1, 59, -1, 60, - 325, 136, -1, 130, -1, 130, 131, 325, -1, 327, - -1, 156, -1, 157, 135, 335, 136, -1, 133, 4, - 131, 4, 131, 4, 131, 4, 134, -1, 329, -1, - 158, -1, 159, 135, 335, 136, -1, 3, -1, 133, - 3, 131, 316, 134, -1, 331, -1, 160, -1, 161, - 135, 335, 136, -1, 139, -1, 3, -1, 133, 3, - 131, 139, 134, -1, 59, -1, 333, -1, 162, -1, - 163, 135, 335, 136, -1, 139, -1, 3, -1, 133, - 3, 131, 139, 134, -1, 59, -1, 321, -1, 334, - 191, 321, -1, 4, -1, 345, -1, 133, 8, 134, - -1, 148, -1, 149, 135, 335, 136, -1, 335, 185, - 335, -1, 335, 186, 335, -1, 335, 187, 335, -1, - 335, 188, 335, -1, 335, 189, 335, -1, 133, 335, - 134, -1, 144, -1, 145, -1, 212, 132, 336, -1, - 337, -1, 338, 131, 337, -1, -1, 338, -1, 335, - -1, 334, -1, 340, -1, 341, 131, 340, -1, -1, - 341, -1, 323, -1, 115, 326, -1, 116, 326, -1, - 117, 323, 186, 323, -1, 118, 323, 186, 323, 131, - 335, -1, 119, 133, 344, 134, -1, 119, 133, 267, - 131, 344, 134, -1, 125, 133, 7, 131, 344, 134, - -1, 125, 133, 344, 131, 344, 134, -1, 125, 133, - 328, 131, 344, 134, -1, 121, 323, -1, 123, 133, - 323, 131, 335, 134, -1, 123, 133, 323, 131, 335, - 131, 32, 134, -1, 124, 133, 323, 131, 335, 131, - 335, 134, -1, 124, 133, 323, 131, 335, 131, 335, - 131, 32, 134, -1, 127, 133, 128, 131, 133, 335, - 186, 335, 201, 134, 131, 323, 202, 134, -1, 126, - 343, -1, 164, -1, 133, 344, 134, -1, 343, -1, - 343, 193, 344, -1, 184, -1, 8, -1, 9, -1, - 4, -1, 8, -1, 9, -1, 4, -1, 345, -1, - 26, -1, 20, -1, 27, -1, 22, -1, 28, -1, - 78, -1, 57, -1, 59, -1, 353, -1, 44, 133, - 4, 131, 4, 131, 4, 131, 4, 134, -1, 133, - 4, 131, 4, 131, 4, 131, 4, 134, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 273, 273, 274, 277, 278, 281, 303, 308, 324, - 328, 334, 343, 352, 356, 382, 385, 392, 396, 403, - 406, 413, 414, 418, 421, 427, 431, 438, 441, 447, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, - 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, - 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, - 493, 494, 495, 496, 499, 500, 501, 502, 503, 504, - 505, 506, 507, 510, 511, 512, 513, 514, 515, 516, - 517, 518, 521, 522, 523, 526, 527, 530, 542, 548, - 554, 560, 566, 572, 578, 584, 590, 597, 604, 611, - 618, 625, 632, 641, 646, 653, 658, 665, 670, 677, - 681, 687, 692, 699, 703, 709, 713, 720, 742, 719, - 756, 801, 808, 811, 817, 823, 827, 836, 840, 835, - 897, 898, 902, 901, 914, 913, 928, 938, 939, 942, - 975, 974, 1000, 999, 1029, 1028, 1059, 1058, 1084, 1093, - 1092, 1119, 1125, 1129, 1133, 1139, 1146, 1155, 1163, 1174, - 1173, 1189, 1188, 1205, 1208, 1214, 1224, 1230, 1239, 1245, - 1250, 1256, 1261, 1267, 1276, 1282, 1283, 1286, 1287, 1290, - 1294, 1300, 1301, 1304, 1310, 1316, 1324, 1325, 1328, 1329, - 1332, 1337, 1336, 1350, 1357, 1363, 1371, 1376, 1381, 1386, - 1391, 1396, 1401, 1406, 1411, 1416, 1421, 1426, 1431, 1436, - 1441, 1446, 1453, 1460, 1464, 1477, 1484, 1483, 1499, 1507, - 1513, 1521, 1526, 1531, 1536, 1541, 1546, 1551, 1556, 1561, - 1566, 1577, 1582, 1587, 1592, 1597, 1604, 1610, 1637, 1642, - 1649, 1653, 1659, 1665, 1671, 1681, 1691, 1706, 1716, 1719, - 1725, 1731, 1737, 1743, 1748, 1755, 1761, 1767, 1773, 1780, - 1779, 1803, 1806, 1812, 1818, 1822, 1827, 1834, 1840, 1847, - 1851, 1857, 1865, 1868, 1878, 1882, 1885, 1891, 1895, 1902, - 1906, 1910, 1916, 1917, 1920, 1921, 1924, 1925, 1926, 1932, - 1933, 1934, 1940, 1941, 1944, 1953, 1958, 1965, 1975, 1981, - 1985, 1989, 1996, 2005, 2011, 2015, 2021, 2025, 2033, 2037, - 2044, 2053, 2064, 2068, 2075, 2084, 2093, 2104, 2108, 2115, - 2124, 2133, 2142, 2151, 2157, 2161, 2168, 2177, 2187, 2196, - 2205, 2212, 2213, 2219, 2220, 2221, 2222, 2230, 2238, 2239, - 2240, 2241, 2242, 2243, 2246, 2252, 2260, 2289, 2290, 2293, - 2294, 2297, 2301, 2308, 2315, 2326, 2329, 2337, 2341, 2345, - 2349, 2353, 2358, 2362, 2366, 2370, 2374, 2378, 2382, 2386, - 2390, 2394, 2398, 2402, 2406, 2413, 2419, 2423, 2429, 2435, - 2436, 2437, 2440, 2444, 2448, 2452, 2458, 2459, 2462, 2463, - 2466, 2467, 2470, 2471, 2474, 2478, 2496 + 0, 275, 275, 276, 279, 280, 283, 305, 310, 326, + 330, 336, 345, 354, 358, 384, 387, 394, 398, 405, + 408, 415, 416, 420, 423, 429, 433, 440, 443, 449, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 512, 513, 514, 515, 516, 517, 518, + 519, 520, 523, 524, 525, 528, 529, 532, 544, 550, + 556, 562, 568, 574, 580, 586, 592, 599, 606, 613, + 620, 627, 634, 643, 648, 655, 660, 667, 672, 679, + 683, 689, 694, 701, 705, 711, 715, 722, 744, 721, + 758, 803, 810, 813, 819, 825, 829, 838, 842, 837, + 899, 900, 904, 903, 916, 915, 930, 940, 941, 944, + 977, 976, 1002, 1001, 1031, 1030, 1061, 1060, 1086, 1095, + 1094, 1121, 1127, 1131, 1135, 1141, 1148, 1157, 1165, 1176, + 1175, 1191, 1190, 1207, 1210, 1216, 1226, 1232, 1241, 1247, + 1252, 1258, 1263, 1269, 1278, 1284, 1285, 1288, 1289, 1292, + 1296, 1302, 1303, 1306, 1312, 1318, 1326, 1327, 1330, 1331, + 1334, 1339, 1338, 1352, 1359, 1365, 1373, 1378, 1383, 1388, + 1393, 1398, 1403, 1408, 1413, 1418, 1423, 1428, 1433, 1438, + 1443, 1448, 1455, 1462, 1466, 1479, 1486, 1485, 1501, 1509, + 1515, 1523, 1528, 1533, 1538, 1543, 1548, 1553, 1558, 1563, + 1568, 1579, 1584, 1589, 1594, 1599, 1606, 1612, 1639, 1644, + 1651, 1655, 1661, 1667, 1673, 1683, 1693, 1708, 1718, 1721, + 1727, 1733, 1739, 1745, 1750, 1757, 1763, 1769, 1775, 1782, + 1781, 1805, 1808, 1814, 1820, 1824, 1829, 1836, 1842, 1849, + 1853, 1859, 1867, 1870, 1880, 1884, 1887, 1893, 1897, 1904, + 1908, 1912, 1918, 1919, 1922, 1923, 1926, 1927, 1928, 1934, + 1935, 1936, 1942, 1943, 1946, 1955, 1960, 1967, 1977, 1983, + 1987, 1991, 1998, 2007, 2013, 2017, 2023, 2027, 2035, 2039, + 2046, 2055, 2066, 2070, 2077, 2086, 2095, 2106, 2110, 2117, + 2126, 2135, 2144, 2153, 2159, 2163, 2170, 2179, 2189, 2198, + 2207, 2214, 2215, 2221, 2222, 2223, 2224, 2232, 2240, 2241, + 2242, 2243, 2244, 2245, 2248, 2254, 2262, 2291, 2292, 2295, + 2296, 2299, 2303, 2310, 2317, 2328, 2331, 2339, 2343, 2347, + 2351, 2355, 2360, 2364, 2368, 2372, 2376, 2380, 2384, 2388, + 2392, 2396, 2400, 2404, 2408, 2415, 2421, 2425, 2431, 2437, + 2438, 2439, 2442, 2446, 2450, 2454, 2460, 2461, 2464, 2465, + 2468, 2469, 2472, 2473, 2476, 2480, 2498 }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +#if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = @@ -1255,13 +1093,13 @@ static const char *const yytname[] = "func_call_param_part", "func_call_param_list", "func_call_params_list", "ter_selection_x", "ter_selection", "dice", "all_integers", "all_ints_push", "objectid", "monsterid", "terrainid", "engraving_type", - "lev_region", "region", 0 + "lev_region", "region", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -1287,216 +1125,18 @@ static const yytype_uint16 yytoknum[] = }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint16 yyr1[] = -{ - 0, 194, 195, 195, 196, 196, 197, 198, 198, 199, - 199, 200, 200, 200, 200, 201, 201, 202, 202, 203, - 203, 204, 204, 205, 205, 206, 206, 207, 207, 208, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 210, 210, 210, 210, 210, 210, - 210, 210, 210, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 212, 212, 212, 213, 213, 214, 215, 215, - 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 215, 215, 216, 216, 217, 217, 218, 218, 219, - 219, 220, 220, 221, 221, 222, 222, 224, 225, 223, - 226, 227, 228, 228, 229, 229, 229, 231, 232, 230, - 233, 233, 235, 234, 236, 234, 237, 238, 238, 239, - 241, 240, 243, 242, 245, 244, 247, 246, 248, 249, - 248, 250, 251, 251, 251, 252, 252, 253, 254, 256, - 255, 258, 257, 259, 259, 260, 260, 261, 261, 262, - 262, 263, 263, 264, 264, 265, 265, 266, 266, 267, - 267, 268, 268, 269, 269, 269, 270, 270, 271, 271, - 272, 273, 272, 274, 275, 275, 276, 276, 276, 276, - 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, - 276, 276, 277, 277, 277, 278, 279, 278, 280, 281, - 281, 282, 282, 282, 282, 282, 282, 282, 282, 282, - 282, 282, 282, 282, 282, 282, 283, 284, 285, 285, - 286, 286, 287, 288, 289, 290, 291, 292, 293, 293, - 294, 295, 296, 297, 297, 298, 299, 300, 301, 303, - 302, 304, 304, 305, 306, 306, 306, 307, 308, 309, - 309, 310, 310, 311, 311, 312, 312, 313, 313, 314, - 314, 314, 315, 315, 316, 316, 317, 317, 317, 318, - 318, 318, 319, 319, 320, 321, 321, 321, 322, 323, - 323, 323, 323, 324, 324, 324, 325, 325, 326, 326, - 326, 327, 328, 328, 328, 329, 329, 330, 330, 330, - 331, 331, 331, 331, 332, 332, 332, 333, 333, 333, - 333, 334, 334, 335, 335, 335, 335, 335, 335, 335, - 335, 335, 335, 335, 336, 336, 337, 338, 338, 339, - 339, 340, 340, 341, 341, 342, 342, 343, 343, 343, - 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, - 343, 343, 343, 343, 343, 343, 344, 344, 345, 346, - 346, 346, 347, 347, 347, 347, 348, 348, 349, 349, - 350, 350, 351, 351, 352, 352, 353 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 1, 1, 2, 3, 3, 5, 1, - 1, 5, 5, 3, 16, 0, 2, 0, 2, 0, - 2, 1, 1, 0, 3, 3, 1, 0, 2, 3, - 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, 3, 3, 5, - 3, 5, 5, 5, 3, 3, 5, 5, 5, 7, - 7, 7, 5, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 1, 3, 1, 3, 0, 0, 8, - 4, 1, 0, 1, 1, 5, 3, 0, 0, 9, - 0, 2, 0, 5, 0, 4, 1, 2, 1, 6, - 0, 3, 0, 6, 0, 4, 0, 4, 1, 0, - 4, 3, 1, 3, 3, 5, 5, 7, 4, 0, - 10, 0, 12, 0, 2, 5, 1, 5, 1, 5, - 1, 5, 1, 9, 5, 1, 1, 1, 1, 1, - 3, 1, 1, 1, 7, 5, 1, 1, 1, 1, - 3, 0, 5, 4, 0, 3, 1, 1, 1, 1, - 2, 1, 1, 1, 1, 1, 3, 3, 3, 1, - 1, 3, 1, 1, 3, 3, 0, 5, 2, 0, - 3, 1, 3, 1, 3, 3, 1, 1, 3, 1, - 1, 1, 3, 1, 1, 1, 5, 7, 5, 8, - 1, 3, 5, 5, 7, 7, 6, 5, 0, 2, - 3, 3, 3, 1, 5, 9, 5, 3, 3, 0, - 10, 0, 1, 7, 5, 5, 3, 5, 7, 9, - 1, 1, 1, 1, 1, 0, 2, 1, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 1, 1, 4, 1, 1, 4, 1, 1, - 4, 1, 4, 5, 1, 3, 1, 3, 1, 1, - 4, 9, 1, 1, 4, 1, 5, 1, 1, 4, - 1, 1, 5, 1, 1, 1, 4, 1, 1, 5, - 1, 1, 3, 1, 1, 3, 1, 4, 3, 3, - 3, 3, 3, 3, 1, 1, 3, 1, 3, 0, - 1, 1, 1, 1, 3, 0, 1, 1, 2, 2, - 4, 6, 4, 6, 6, 6, 6, 2, 6, 8, - 8, 10, 14, 2, 1, 3, 1, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 10, 9 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint16 yydefact[] = -{ - 2, 0, 0, 0, 3, 4, 23, 0, 0, 1, - 5, 0, 27, 0, 7, 0, 134, 0, 0, 0, - 193, 0, 0, 0, 0, 0, 0, 0, 250, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 280, - 0, 0, 0, 0, 0, 0, 162, 0, 0, 0, - 0, 0, 131, 0, 0, 0, 137, 146, 0, 0, - 0, 0, 94, 83, 74, 84, 75, 85, 76, 86, - 77, 87, 78, 88, 79, 89, 80, 90, 81, 91, - 82, 31, 6, 27, 92, 93, 0, 37, 36, 52, - 53, 50, 0, 45, 51, 150, 46, 47, 49, 48, - 30, 62, 35, 65, 64, 39, 55, 57, 58, 72, - 40, 56, 73, 54, 69, 70, 61, 71, 34, 43, - 66, 60, 68, 67, 38, 59, 63, 32, 33, 44, - 41, 42, 0, 26, 24, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, - 0, 95, 96, 0, 0, 0, 0, 343, 0, 346, - 0, 388, 0, 344, 365, 28, 0, 154, 0, 10, - 9, 8, 0, 305, 306, 0, 341, 161, 0, 0, - 0, 13, 314, 0, 196, 197, 0, 0, 311, 0, - 0, 173, 309, 338, 340, 0, 337, 335, 0, 225, - 229, 334, 226, 331, 333, 0, 330, 328, 0, 200, - 0, 327, 282, 281, 0, 292, 293, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 384, 367, 386, 251, 0, 319, 0, 0, - 318, 0, 0, 0, 0, 0, 0, 404, 267, 268, - 284, 283, 0, 132, 0, 0, 0, 0, 0, 308, - 0, 0, 0, 0, 260, 262, 261, 391, 389, 390, - 164, 163, 0, 185, 186, 0, 0, 0, 0, 97, - 0, 0, 0, 276, 127, 0, 0, 0, 0, 136, - 0, 0, 0, 0, 0, 362, 361, 363, 366, 0, - 397, 399, 396, 398, 400, 401, 0, 0, 0, 104, - 105, 100, 98, 0, 0, 0, 0, 27, 151, 25, - 0, 0, 0, 0, 0, 316, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 228, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 368, 369, 0, 0, 0, - 377, 0, 0, 0, 383, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 133, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 158, 157, 0, 0, 152, 0, 0, 0, 359, - 345, 353, 0, 0, 348, 349, 350, 351, 352, 0, - 130, 0, 343, 0, 0, 0, 0, 121, 119, 125, - 123, 0, 0, 0, 155, 0, 0, 342, 12, 263, - 0, 11, 0, 0, 315, 0, 0, 0, 199, 198, - 173, 174, 195, 0, 0, 0, 227, 0, 0, 202, - 204, 246, 184, 0, 248, 0, 0, 189, 0, 0, - 0, 0, 325, 0, 0, 323, 0, 0, 322, 0, - 0, 385, 387, 0, 0, 294, 295, 0, 298, 0, - 296, 0, 297, 252, 0, 0, 253, 0, 176, 0, - 0, 0, 0, 0, 258, 257, 0, 0, 165, 166, - 277, 402, 403, 0, 178, 0, 0, 0, 0, 0, - 266, 0, 0, 148, 0, 0, 138, 275, 274, 0, - 357, 360, 0, 347, 135, 364, 99, 0, 0, 108, - 0, 107, 0, 106, 0, 112, 0, 103, 0, 102, - 0, 101, 29, 307, 0, 0, 317, 310, 0, 312, - 0, 0, 336, 394, 392, 393, 240, 237, 231, 0, - 0, 236, 0, 241, 0, 243, 244, 0, 239, 230, - 245, 395, 233, 0, 329, 203, 0, 0, 370, 0, - 0, 0, 372, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 320, 0, 0, 0, 0, 0, 0, 0, - 0, 168, 0, 0, 0, 256, 0, 0, 0, 0, - 0, 0, 0, 0, 153, 147, 149, 0, 0, 0, - 128, 0, 120, 122, 124, 126, 0, 113, 0, 115, - 0, 117, 0, 0, 313, 194, 339, 0, 0, 0, - 0, 0, 332, 0, 247, 19, 0, 190, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 285, 0, - 303, 302, 273, 0, 0, 254, 0, 180, 0, 0, - 255, 259, 0, 0, 278, 0, 182, 0, 285, 188, - 0, 187, 160, 0, 140, 354, 355, 356, 358, 0, - 0, 111, 0, 110, 0, 109, 0, 0, 234, 235, - 238, 242, 232, 0, 299, 207, 208, 0, 212, 211, - 213, 214, 215, 0, 0, 0, 219, 220, 0, 205, - 209, 300, 206, 0, 249, 371, 373, 0, 378, 0, - 374, 0, 324, 376, 375, 0, 0, 0, 269, 304, - 0, 0, 0, 0, 0, 0, 191, 192, 0, 0, - 0, 169, 0, 0, 0, 0, 0, 140, 129, 114, - 116, 118, 264, 0, 0, 210, 0, 0, 0, 0, - 20, 0, 0, 326, 0, 0, 289, 290, 291, 286, - 287, 271, 0, 0, 175, 0, 285, 279, 167, 177, - 0, 0, 183, 265, 0, 144, 139, 141, 0, 301, - 216, 217, 218, 223, 222, 221, 379, 0, 380, 349, - 0, 0, 272, 270, 0, 0, 0, 171, 0, 170, - 142, 27, 0, 0, 0, 0, 0, 321, 288, 0, - 406, 179, 0, 181, 27, 145, 0, 224, 381, 16, - 0, 405, 172, 143, 0, 0, 0, 17, 21, 22, - 19, 0, 0, 14, 18, 382 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 3, 4, 5, 6, 191, 81, 836, 862, 734, - 860, 12, 134, 82, 338, 83, 84, 85, 86, 173, - 87, 88, 636, 638, 640, 423, 424, 425, 426, 89, - 409, 699, 90, 91, 389, 92, 93, 174, 627, 766, - 767, 844, 831, 94, 525, 95, 96, 188, 97, 522, - 98, 336, 99, 296, 402, 518, 100, 101, 102, 281, - 272, 103, 801, 104, 842, 352, 500, 516, 679, 688, - 105, 295, 690, 468, 758, 106, 210, 450, 107, 359, - 229, 585, 729, 815, 108, 356, 219, 355, 579, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 615, - 119, 120, 121, 441, 122, 123, 124, 125, 126, 791, - 823, 127, 128, 129, 130, 131, 234, 273, 748, 789, - 790, 237, 487, 491, 730, 672, 492, 196, 278, 253, - 212, 346, 259, 260, 477, 478, 230, 231, 220, 221, - 315, 279, 697, 530, 531, 532, 317, 318, 319, 254, - 376, 183, 291, 582, 333, 334, 335, 513, 266, 267 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ #define YYPACT_NINF -654 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-654))) + +#define YYTABLE_NINF -202 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { 137, 7, 27, 83, -654, 137, 24, -15, 37, -654, @@ -1588,7 +1228,101 @@ static const yytype_int16 yypact[] = 809, -18, 875, -654, -654, -654 }; -/* YYPGOTO[NTERM-NUM]. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint16 yydefact[] = +{ + 2, 0, 0, 0, 3, 4, 23, 0, 0, 1, + 5, 0, 27, 0, 7, 0, 134, 0, 0, 0, + 193, 0, 0, 0, 0, 0, 0, 0, 250, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 280, + 0, 0, 0, 0, 0, 0, 162, 0, 0, 0, + 0, 0, 131, 0, 0, 0, 137, 146, 0, 0, + 0, 0, 94, 83, 74, 84, 75, 85, 76, 86, + 77, 87, 78, 88, 79, 89, 80, 90, 81, 91, + 82, 31, 6, 27, 92, 93, 0, 37, 36, 52, + 53, 50, 0, 45, 51, 150, 46, 47, 49, 48, + 30, 62, 35, 65, 64, 39, 55, 57, 58, 72, + 40, 56, 73, 54, 69, 70, 61, 71, 34, 43, + 66, 60, 68, 67, 38, 59, 63, 32, 33, 44, + 41, 42, 0, 26, 24, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, + 0, 95, 96, 0, 0, 0, 0, 343, 0, 346, + 0, 388, 0, 344, 365, 28, 0, 154, 0, 10, + 9, 8, 0, 305, 306, 0, 341, 161, 0, 0, + 0, 13, 314, 0, 196, 197, 0, 0, 311, 0, + 0, 173, 309, 338, 340, 0, 337, 335, 0, 225, + 229, 334, 226, 331, 333, 0, 330, 328, 0, 200, + 0, 327, 282, 281, 0, 292, 293, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 384, 367, 386, 251, 0, 319, 0, 0, + 318, 0, 0, 0, 0, 0, 0, 404, 267, 268, + 284, 283, 0, 132, 0, 0, 0, 0, 0, 308, + 0, 0, 0, 0, 260, 262, 261, 391, 389, 390, + 164, 163, 0, 185, 186, 0, 0, 0, 0, 97, + 0, 0, 0, 276, 127, 0, 0, 0, 0, 136, + 0, 0, 0, 0, 0, 362, 361, 363, 366, 0, + 397, 399, 396, 398, 400, 401, 0, 0, 0, 104, + 105, 100, 98, 0, 0, 0, 0, 27, 151, 25, + 0, 0, 0, 0, 0, 316, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 228, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 368, 369, 0, 0, 0, + 377, 0, 0, 0, 383, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 133, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 158, 157, 0, 0, 152, 0, 0, 0, 359, + 345, 353, 0, 0, 348, 349, 350, 351, 352, 0, + 130, 0, 343, 0, 0, 0, 0, 121, 119, 125, + 123, 0, 0, 0, 155, 0, 0, 342, 12, 263, + 0, 11, 0, 0, 315, 0, 0, 0, 199, 198, + 173, 174, 195, 0, 0, 0, 227, 0, 0, 202, + 204, 246, 184, 0, 248, 0, 0, 189, 0, 0, + 0, 0, 325, 0, 0, 323, 0, 0, 322, 0, + 0, 385, 387, 0, 0, 294, 295, 0, 298, 0, + 296, 0, 297, 252, 0, 0, 253, 0, 176, 0, + 0, 0, 0, 0, 258, 257, 0, 0, 165, 166, + 277, 402, 403, 0, 178, 0, 0, 0, 0, 0, + 266, 0, 0, 148, 0, 0, 138, 275, 274, 0, + 357, 360, 0, 347, 135, 364, 99, 0, 0, 108, + 0, 107, 0, 106, 0, 112, 0, 103, 0, 102, + 0, 101, 29, 307, 0, 0, 317, 310, 0, 312, + 0, 0, 336, 394, 392, 393, 240, 237, 231, 0, + 0, 236, 0, 241, 0, 243, 244, 0, 239, 230, + 245, 395, 233, 0, 329, 203, 0, 0, 370, 0, + 0, 0, 372, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 320, 0, 0, 0, 0, 0, 0, 0, + 0, 168, 0, 0, 0, 256, 0, 0, 0, 0, + 0, 0, 0, 0, 153, 147, 149, 0, 0, 0, + 128, 0, 120, 122, 124, 126, 0, 113, 0, 115, + 0, 117, 0, 0, 313, 194, 339, 0, 0, 0, + 0, 0, 332, 0, 247, 19, 0, 190, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 285, 0, + 303, 302, 273, 0, 0, 254, 0, 180, 0, 0, + 255, 259, 0, 0, 278, 0, 182, 0, 285, 188, + 0, 187, 160, 0, 140, 354, 355, 356, 358, 0, + 0, 111, 0, 110, 0, 109, 0, 0, 234, 235, + 238, 242, 232, 0, 299, 207, 208, 0, 212, 211, + 213, 214, 215, 0, 0, 0, 219, 220, 0, 205, + 209, 300, 206, 0, 249, 371, 373, 0, 378, 0, + 374, 0, 324, 376, 375, 0, 0, 0, 269, 304, + 0, 0, 0, 0, 0, 0, 191, 192, 0, 0, + 0, 169, 0, 0, 0, 0, 0, 140, 129, 114, + 116, 118, 264, 0, 0, 210, 0, 0, 0, 0, + 20, 0, 0, 326, 0, 0, 289, 290, 291, 286, + 287, 271, 0, 0, 175, 0, 285, 279, 167, 177, + 0, 0, 183, 265, 0, 144, 139, 141, 0, 301, + 216, 217, 218, 223, 222, 221, 379, 0, 380, 349, + 0, 0, 272, 270, 0, 0, 0, 171, 0, 170, + 142, 27, 0, 0, 0, 0, 0, 321, 288, 0, + 406, 179, 0, 181, 27, 145, 0, 224, 381, 16, + 0, 405, 172, 143, 0, 0, 0, 17, 21, 22, + 19, 0, 0, 14, 18, 382 +}; + + /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -654, -654, 994, -654, -654, -654, -654, -654, -654, 146, @@ -1609,11 +1343,30 @@ static const yytype_int16 yypgoto[] = -135, 576, -392, -654, -654, -654, -654, -654, -124, -654 }; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -202 + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 3, 4, 5, 6, 191, 81, 836, 862, 734, + 860, 12, 134, 82, 338, 83, 84, 85, 86, 173, + 87, 88, 636, 638, 640, 423, 424, 425, 426, 89, + 409, 699, 90, 91, 389, 92, 93, 174, 627, 766, + 767, 844, 831, 94, 525, 95, 96, 188, 97, 522, + 98, 336, 99, 296, 402, 518, 100, 101, 102, 281, + 272, 103, 801, 104, 842, 352, 500, 516, 679, 688, + 105, 295, 690, 468, 758, 106, 210, 450, 107, 359, + 229, 585, 729, 815, 108, 356, 219, 355, 579, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 615, + 119, 120, 121, 441, 122, 123, 124, 125, 126, 791, + 823, 127, 128, 129, 130, 131, 234, 273, 748, 789, + 790, 237, 487, 491, 730, 672, 492, 196, 278, 253, + 212, 346, 259, 260, 477, 478, 230, 231, 220, 221, + 315, 279, 697, 530, 531, 532, 317, 318, 319, 254, + 376, 183, 291, 582, 333, 334, 335, 513, 266, 267 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 185, 211, 300, 197, 509, 182, 401, 238, 239, 611, @@ -1830,8 +1583,8 @@ static const yytype_int16 yycheck[] = 249, 455 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { 0, 15, 16, 195, 196, 197, 198, 132, 132, 0, @@ -1923,95 +1676,133 @@ static const yytype_uint16 yystos[] = 204, 131, 202, 203, 323, 134 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint16 yyr1[] = +{ + 0, 194, 195, 195, 196, 196, 197, 198, 198, 199, + 199, 200, 200, 200, 200, 201, 201, 202, 202, 203, + 203, 204, 204, 205, 205, 206, 206, 207, 207, 208, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 210, 210, 210, 210, 210, 210, + 210, 210, 210, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 212, 212, 212, 213, 213, 214, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, + 215, 215, 215, 216, 216, 217, 217, 218, 218, 219, + 219, 220, 220, 221, 221, 222, 222, 224, 225, 223, + 226, 227, 228, 228, 229, 229, 229, 231, 232, 230, + 233, 233, 235, 234, 236, 234, 237, 238, 238, 239, + 241, 240, 243, 242, 245, 244, 247, 246, 248, 249, + 248, 250, 251, 251, 251, 252, 252, 253, 254, 256, + 255, 258, 257, 259, 259, 260, 260, 261, 261, 262, + 262, 263, 263, 264, 264, 265, 265, 266, 266, 267, + 267, 268, 268, 269, 269, 269, 270, 270, 271, 271, + 272, 273, 272, 274, 275, 275, 276, 276, 276, 276, + 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, + 276, 276, 277, 277, 277, 278, 279, 278, 280, 281, + 281, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 283, 284, 285, 285, + 286, 286, 287, 288, 289, 290, 291, 292, 293, 293, + 294, 295, 296, 297, 297, 298, 299, 300, 301, 303, + 302, 304, 304, 305, 306, 306, 306, 307, 308, 309, + 309, 310, 310, 311, 311, 312, 312, 313, 313, 314, + 314, 314, 315, 315, 316, 316, 317, 317, 317, 318, + 318, 318, 319, 319, 320, 321, 321, 321, 322, 323, + 323, 323, 323, 324, 324, 324, 325, 325, 326, 326, + 326, 327, 328, 328, 328, 329, 329, 330, 330, 330, + 331, 331, 331, 331, 332, 332, 332, 333, 333, 333, + 333, 334, 334, 335, 335, 335, 335, 335, 335, 335, + 335, 335, 335, 335, 336, 336, 337, 338, 338, 339, + 339, 340, 340, 341, 341, 342, 342, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, + 343, 343, 343, 343, 343, 343, 344, 344, 345, 346, + 346, 346, 347, 347, 347, 347, 348, 348, 349, 349, + 350, 350, 351, 351, 352, 352, 353 +}; -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 0, 1, 1, 2, 3, 3, 5, 1, + 1, 5, 5, 3, 16, 0, 2, 0, 2, 0, + 2, 1, 1, 0, 3, 3, 1, 0, 2, 3, + 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, 3, 3, 5, + 3, 5, 5, 5, 3, 3, 5, 5, 5, 7, + 7, 7, 5, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 0, 0, 8, + 4, 1, 0, 1, 1, 5, 3, 0, 0, 9, + 0, 2, 0, 5, 0, 4, 1, 2, 1, 6, + 0, 3, 0, 6, 0, 4, 0, 4, 1, 0, + 4, 3, 1, 3, 3, 5, 5, 7, 4, 0, + 10, 0, 12, 0, 2, 5, 1, 5, 1, 5, + 1, 5, 1, 9, 5, 1, 1, 1, 1, 1, + 3, 1, 1, 1, 7, 5, 1, 1, 1, 1, + 3, 0, 5, 4, 0, 3, 1, 1, 1, 1, + 2, 1, 1, 1, 1, 1, 3, 3, 3, 1, + 1, 3, 1, 1, 3, 3, 0, 5, 2, 0, + 3, 1, 3, 1, 3, 3, 1, 1, 3, 1, + 1, 1, 3, 1, 1, 1, 5, 7, 5, 8, + 1, 3, 5, 5, 7, 7, 6, 5, 0, 2, + 3, 3, 3, 1, 5, 9, 5, 3, 3, 0, + 10, 0, 1, 7, 5, 5, 3, 5, 7, 9, + 1, 1, 1, 1, 1, 0, 2, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 1, 1, 4, 1, 1, 4, 1, 1, + 4, 1, 4, 5, 1, 3, 1, 3, 1, 1, + 4, 9, 1, 1, 4, 1, 5, 1, 1, 4, + 1, 1, 5, 1, 1, 1, 4, 1, 1, 5, + 1, 1, 3, 1, 1, 3, 1, 4, 3, 3, + 3, 3, 3, 3, 1, 1, 3, 1, 3, 0, + 1, 1, 1, 1, 3, 0, 1, 1, 2, 2, + 4, 6, 4, 6, 6, 6, 6, 2, 6, 8, + 8, 10, 14, 2, 1, 3, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 10, 9 +}; -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ +#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 -#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 \ - { \ +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 -#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 ends - the 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 know - we 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 @@ -2021,54 +1812,46 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (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)) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +# 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 (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { + FILE *yyo = yyoutput; + YYUSE (yyo); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -2076,22 +1859,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); @@ -2102,16 +1874,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -2122,49 +1886,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { + unsigned long int yylno = yyrline[yyrule]; 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); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -2178,7 +1935,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -2193,7 +1950,6 @@ int yydebug; # define YYMAXDEPTH 10000 #endif - #if YYERROR_VERBOSE @@ -2202,15 +1958,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -2226,16 +1975,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -2265,27 +2006,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; + 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 (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -2296,161 +2037,160 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) { - int yyn = yypact[yystate]; + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) { - 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; + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + 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 yyx; -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed 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"); -# endif - char *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 in - YYCHECK. */ - 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 translation - produced 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; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; } #endif /* YYERROR_VERBOSE */ - /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (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; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ + /* The lookahead symbol. */ @@ -2458,49 +2198,26 @@ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; - /* Number of syntax errors so far. */ int yynerrs; +/*----------. +| yyparse. | +`----------*/ -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (void) -#else -int -yyparse () - -#endif -#endif { - - int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + 'yyss': related to states. + 'yyvs': related to semantic values. - Refer to the stacks thru separate pointers, to allow yyoverflow + Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ @@ -2518,7 +2235,7 @@ yyparse () int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ - int yytoken; + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; @@ -2536,9 +2253,8 @@ yyparse () Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); @@ -2547,14 +2263,6 @@ yyparse () yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - goto yysetstate; /*------------------------------------------------------------. @@ -2575,23 +2283,23 @@ yyparse () #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); - yyss = yyss1; - yyvs = yyvs1; + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -2599,22 +2307,22 @@ yyparse () # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -2623,10 +2331,10 @@ yyparse () yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -2646,7 +2354,7 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -2655,7 +2363,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (); } if (yychar <= YYEOF) @@ -2677,8 +2385,8 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; + if (yytable_value_is_error (yyn)) + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -2695,7 +2403,9 @@ yybackup: yychar = YYEMPTY; yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; @@ -2718,7 +2428,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -2732,126 +2442,116 @@ yyreduce: switch (yyn) { case 6: - -/* Line 1455 of yacc.c */ -#line 282 "lev_comp.y" +#line 284 "lev_comp.y" /* yacc.c:1646 */ { if (fatal_error > 0) { (void) fprintf(stderr, "%s: %d errors detected for level \"%s\". No output created!\n", - fname, fatal_error, (yyvsp[(1) - (3)].map)); + fname, fatal_error, (yyvsp[-2].map)); fatal_error = 0; got_errors++; } else if (!got_errors) { - if (!write_level_file((yyvsp[(1) - (3)].map), splev)) { - lc_error("Can't write output file for '%s'!", (yyvsp[(1) - (3)].map)); + if (!write_level_file((yyvsp[-2].map), splev)) { + lc_error("Can't write output file for '%s'!", (yyvsp[-2].map)); exit(EXIT_FAILURE); } } - Free((yyvsp[(1) - (3)].map)); + Free((yyvsp[-2].map)); Free(splev); splev = NULL; vardef_free_all(variable_definitions); variable_definitions = NULL; } +#line 2466 "y.tab.c" /* yacc.c:1646 */ break; case 7: - -/* Line 1455 of yacc.c */ -#line 304 "lev_comp.y" +#line 306 "lev_comp.y" /* yacc.c:1646 */ { - start_level_def(&splev, (yyvsp[(3) - (3)].map)); - (yyval.map) = (yyvsp[(3) - (3)].map); + start_level_def(&splev, (yyvsp[0].map)); + (yyval.map) = (yyvsp[0].map); } +#line 2475 "y.tab.c" /* yacc.c:1646 */ break; case 8: - -/* Line 1455 of yacc.c */ -#line 309 "lev_comp.y" +#line 311 "lev_comp.y" /* yacc.c:1646 */ { - start_level_def(&splev, (yyvsp[(3) - (5)].map)); - if ((yyvsp[(5) - (5)].i) == -1) { + start_level_def(&splev, (yyvsp[-2].map)); + if ((yyvsp[0].i) == -1) { add_opvars(splev, "iiiiiiiio", LVLINIT_MAZEGRID,HWALL,0,0, 0,0,0,0, SPO_INITLEVEL); } else { - long bg = what_map_char((char) (yyvsp[(5) - (5)].i)); + long bg = what_map_char((char) (yyvsp[0].i)); add_opvars(splev, "iiiiiiiio", LVLINIT_SOLIDFILL, bg, 0,0, 0,0,0,0, SPO_INITLEVEL); } add_opvars(splev, "io", MAZELEVEL, SPO_LEVEL_FLAGS); max_x_map = COLNO-1; max_y_map = ROWNO; - (yyval.map) = (yyvsp[(3) - (5)].map); + (yyval.map) = (yyvsp[-2].map); } +#line 2493 "y.tab.c" /* yacc.c:1646 */ break; case 9: - -/* Line 1455 of yacc.c */ -#line 325 "lev_comp.y" +#line 327 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = -1; } +#line 2501 "y.tab.c" /* yacc.c:1646 */ break; case 10: - -/* Line 1455 of yacc.c */ -#line 329 "lev_comp.y" +#line 331 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = what_map_char((char) (yyvsp[(1) - (1)].i)); + (yyval.i) = what_map_char((char) (yyvsp[0].i)); } +#line 2509 "y.tab.c" /* yacc.c:1646 */ break; case 11: - -/* Line 1455 of yacc.c */ -#line 335 "lev_comp.y" +#line 337 "lev_comp.y" /* yacc.c:1646 */ { - long filling = (yyvsp[(5) - (5)].terr).ter; + long filling = (yyvsp[0].terr).ter; if (filling == INVALID_TYPE || filling >= MAX_TYPE) lc_error("INIT_MAP: Invalid fill char type."); - add_opvars(splev, "iiiiiiiio", LVLINIT_SOLIDFILL,filling,0,(long)(yyvsp[(5) - (5)].terr).lit, 0,0,0,0, SPO_INITLEVEL); + add_opvars(splev, "iiiiiiiio", LVLINIT_SOLIDFILL,filling,0,(long)(yyvsp[0].terr).lit, 0,0,0,0, SPO_INITLEVEL); max_x_map = COLNO-1; max_y_map = ROWNO; } +#line 2522 "y.tab.c" /* yacc.c:1646 */ break; case 12: - -/* Line 1455 of yacc.c */ -#line 344 "lev_comp.y" +#line 346 "lev_comp.y" /* yacc.c:1646 */ { - long filling = what_map_char((char) (yyvsp[(5) - (5)].i)); + long filling = what_map_char((char) (yyvsp[0].i)); if (filling == INVALID_TYPE || filling >= MAX_TYPE) lc_error("INIT_MAP: Invalid fill char type."); add_opvars(splev, "iiiiiiiio", LVLINIT_MAZEGRID,filling,0,0, 0,0,0,0, SPO_INITLEVEL); max_x_map = COLNO-1; max_y_map = ROWNO; } +#line 2535 "y.tab.c" /* yacc.c:1646 */ break; case 13: - -/* Line 1455 of yacc.c */ -#line 353 "lev_comp.y" +#line 355 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiiiiiio", LVLINIT_ROGUE,0,0,0,0,0,0,0, SPO_INITLEVEL); } +#line 2543 "y.tab.c" /* yacc.c:1646 */ break; case 14: - -/* Line 1455 of yacc.c */ -#line 357 "lev_comp.y" +#line 359 "lev_comp.y" /* yacc.c:1646 */ { - long fg = what_map_char((char) (yyvsp[(5) - (16)].i)); - long bg = what_map_char((char) (yyvsp[(7) - (16)].i)); - long smoothed = (yyvsp[(9) - (16)].i); - long joined = (yyvsp[(11) - (16)].i); - long lit = (yyvsp[(13) - (16)].i); - long walled = (yyvsp[(15) - (16)].i); - long filling = (yyvsp[(16) - (16)].i); + long fg = what_map_char((char) (yyvsp[-11].i)); + long bg = what_map_char((char) (yyvsp[-9].i)); + long smoothed = (yyvsp[-7].i); + long joined = (yyvsp[-5].i); + long lit = (yyvsp[-3].i); + long walled = (yyvsp[-1].i); + long filling = (yyvsp[0].i); if (fg == INVALID_TYPE || fg >= MAX_TYPE) lc_error("INIT_MAP: Invalid foreground type."); if (bg == INVALID_TYPE || bg >= MAX_TYPE) @@ -2866,487 +2566,441 @@ yyreduce: max_x_map = COLNO-1; max_y_map = ROWNO; } +#line 2570 "y.tab.c" /* yacc.c:1646 */ break; case 15: - -/* Line 1455 of yacc.c */ -#line 382 "lev_comp.y" +#line 384 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 0; } +#line 2578 "y.tab.c" /* yacc.c:1646 */ break; case 16: - -/* Line 1455 of yacc.c */ -#line 386 "lev_comp.y" +#line 388 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(2) - (2)].i); + (yyval.i) = (yyvsp[0].i); } +#line 2586 "y.tab.c" /* yacc.c:1646 */ break; case 17: - -/* Line 1455 of yacc.c */ -#line 392 "lev_comp.y" +#line 394 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_COPY); (yyval.i) = 0; } +#line 2595 "y.tab.c" /* yacc.c:1646 */ break; case 18: - -/* Line 1455 of yacc.c */ -#line 397 "lev_comp.y" +#line 399 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 1; } +#line 2603 "y.tab.c" /* yacc.c:1646 */ break; case 19: - -/* Line 1455 of yacc.c */ -#line 403 "lev_comp.y" +#line 405 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = -1; } +#line 2611 "y.tab.c" /* yacc.c:1646 */ break; case 20: - -/* Line 1455 of yacc.c */ -#line 407 "lev_comp.y" +#line 409 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = what_map_char((char) (yyvsp[(2) - (2)].i)); + (yyval.i) = what_map_char((char) (yyvsp[0].i)); } +#line 2619 "y.tab.c" /* yacc.c:1646 */ break; case 23: - -/* Line 1455 of yacc.c */ -#line 418 "lev_comp.y" +#line 420 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", 0, SPO_LEVEL_FLAGS); } +#line 2627 "y.tab.c" /* yacc.c:1646 */ break; case 24: - -/* Line 1455 of yacc.c */ -#line 422 "lev_comp.y" +#line 424 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "io", (yyvsp[(3) - (3)].i), SPO_LEVEL_FLAGS); + add_opvars(splev, "io", (yyvsp[0].i), SPO_LEVEL_FLAGS); } +#line 2635 "y.tab.c" /* yacc.c:1646 */ break; case 25: - -/* Line 1455 of yacc.c */ -#line 428 "lev_comp.y" +#line 430 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = ((yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i)); + (yyval.i) = ((yyvsp[-2].i) | (yyvsp[0].i)); } +#line 2643 "y.tab.c" /* yacc.c:1646 */ break; case 26: - -/* Line 1455 of yacc.c */ -#line 432 "lev_comp.y" +#line 434 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(1) - (1)].i); + (yyval.i) = (yyvsp[0].i); } +#line 2651 "y.tab.c" /* yacc.c:1646 */ break; case 27: - -/* Line 1455 of yacc.c */ -#line 438 "lev_comp.y" +#line 440 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 0; } +#line 2659 "y.tab.c" /* yacc.c:1646 */ break; case 28: - -/* Line 1455 of yacc.c */ -#line 442 "lev_comp.y" +#line 444 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = 1 + (yyvsp[(2) - (2)].i); + (yyval.i) = 1 + (yyvsp[0].i); } +#line 2667 "y.tab.c" /* yacc.c:1646 */ break; case 29: - -/* Line 1455 of yacc.c */ -#line 448 "lev_comp.y" +#line 450 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(2) - (3)].i); + (yyval.i) = (yyvsp[-1].i); } +#line 2675 "y.tab.c" /* yacc.c:1646 */ break; case 97: - -/* Line 1455 of yacc.c */ -#line 531 "lev_comp.y" +#line 533 "lev_comp.y" /* yacc.c:1646 */ { struct lc_vardefs *vd; - if ((vd = vardef_defined(variable_definitions, (yyvsp[(3) - (3)].map), 1))) { + if ((vd = vardef_defined(variable_definitions, (yyvsp[0].map), 1))) { if (!(vd->var_type & SPOVAR_ARRAY)) - lc_error("Trying to shuffle non-array variable '%s'", (yyvsp[(3) - (3)].map)); - } else lc_error("Trying to shuffle undefined variable '%s'", (yyvsp[(3) - (3)].map)); - add_opvars(splev, "so", (yyvsp[(3) - (3)].map), SPO_SHUFFLE_ARRAY); - Free((yyvsp[(3) - (3)].map)); + lc_error("Trying to shuffle non-array variable '%s'", (yyvsp[0].map)); + } else lc_error("Trying to shuffle undefined variable '%s'", (yyvsp[0].map)); + add_opvars(splev, "so", (yyvsp[0].map), SPO_SHUFFLE_ARRAY); + Free((yyvsp[0].map)); } +#line 2689 "y.tab.c" /* yacc.c:1646 */ break; case 98: - -/* Line 1455 of yacc.c */ -#line 543 "lev_comp.y" +#line 545 "lev_comp.y" /* yacc.c:1646 */ { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), SPOVAR_INT); - add_opvars(splev, "iso", 0, (yyvsp[(1) - (3)].map), SPO_VAR_INIT); - Free((yyvsp[(1) - (3)].map)); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), SPOVAR_INT); + add_opvars(splev, "iso", 0, (yyvsp[-2].map), SPO_VAR_INIT); + Free((yyvsp[-2].map)); } +#line 2699 "y.tab.c" /* yacc.c:1646 */ break; case 99: - -/* Line 1455 of yacc.c */ -#line 549 "lev_comp.y" +#line 551 "lev_comp.y" /* yacc.c:1646 */ { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_SEL); - add_opvars(splev, "iso", 0, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); - Free((yyvsp[(1) - (5)].map)); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_SEL); + add_opvars(splev, "iso", 0, (yyvsp[-4].map), SPO_VAR_INIT); + Free((yyvsp[-4].map)); } +#line 2709 "y.tab.c" /* yacc.c:1646 */ break; case 100: - -/* Line 1455 of yacc.c */ -#line 555 "lev_comp.y" +#line 557 "lev_comp.y" /* yacc.c:1646 */ { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), SPOVAR_STRING); - add_opvars(splev, "iso", 0, (yyvsp[(1) - (3)].map), SPO_VAR_INIT); - Free((yyvsp[(1) - (3)].map)); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), SPOVAR_STRING); + add_opvars(splev, "iso", 0, (yyvsp[-2].map), SPO_VAR_INIT); + Free((yyvsp[-2].map)); } +#line 2719 "y.tab.c" /* yacc.c:1646 */ break; case 101: - -/* Line 1455 of yacc.c */ -#line 561 "lev_comp.y" +#line 563 "lev_comp.y" /* yacc.c:1646 */ { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_MAPCHAR); - add_opvars(splev, "iso", 0, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); - Free((yyvsp[(1) - (5)].map)); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_MAPCHAR); + add_opvars(splev, "iso", 0, (yyvsp[-4].map), SPO_VAR_INIT); + Free((yyvsp[-4].map)); } +#line 2729 "y.tab.c" /* yacc.c:1646 */ break; case 102: - -/* Line 1455 of yacc.c */ -#line 567 "lev_comp.y" +#line 569 "lev_comp.y" /* yacc.c:1646 */ { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_MONST); - add_opvars(splev, "iso", 0, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); - Free((yyvsp[(1) - (5)].map)); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_MONST); + add_opvars(splev, "iso", 0, (yyvsp[-4].map), SPO_VAR_INIT); + Free((yyvsp[-4].map)); } +#line 2739 "y.tab.c" /* yacc.c:1646 */ break; case 103: - -/* Line 1455 of yacc.c */ -#line 573 "lev_comp.y" +#line 575 "lev_comp.y" /* yacc.c:1646 */ { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_OBJ); - add_opvars(splev, "iso", 0, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); - Free((yyvsp[(1) - (5)].map)); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_OBJ); + add_opvars(splev, "iso", 0, (yyvsp[-4].map), SPO_VAR_INIT); + Free((yyvsp[-4].map)); } +#line 2749 "y.tab.c" /* yacc.c:1646 */ break; case 104: - -/* Line 1455 of yacc.c */ -#line 579 "lev_comp.y" +#line 581 "lev_comp.y" /* yacc.c:1646 */ { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), SPOVAR_COORD); - add_opvars(splev, "iso", 0, (yyvsp[(1) - (3)].map), SPO_VAR_INIT); - Free((yyvsp[(1) - (3)].map)); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), SPOVAR_COORD); + add_opvars(splev, "iso", 0, (yyvsp[-2].map), SPO_VAR_INIT); + Free((yyvsp[-2].map)); } +#line 2759 "y.tab.c" /* yacc.c:1646 */ break; case 105: - -/* Line 1455 of yacc.c */ -#line 585 "lev_comp.y" +#line 587 "lev_comp.y" /* yacc.c:1646 */ { - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), SPOVAR_REGION); - add_opvars(splev, "iso", 0, (yyvsp[(1) - (3)].map), SPO_VAR_INIT); - Free((yyvsp[(1) - (3)].map)); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), SPOVAR_REGION); + add_opvars(splev, "iso", 0, (yyvsp[-2].map), SPO_VAR_INIT); + Free((yyvsp[-2].map)); } +#line 2769 "y.tab.c" /* yacc.c:1646 */ break; case 106: - -/* Line 1455 of yacc.c */ -#line 591 "lev_comp.y" +#line 593 "lev_comp.y" /* yacc.c:1646 */ { - long n_items = (yyvsp[(4) - (5)].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_INT|SPOVAR_ARRAY); - add_opvars(splev, "iso", n_items, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); - Free((yyvsp[(1) - (5)].map)); + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_INT|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[-4].map), SPO_VAR_INIT); + Free((yyvsp[-4].map)); } +#line 2780 "y.tab.c" /* yacc.c:1646 */ break; case 107: - -/* Line 1455 of yacc.c */ -#line 598 "lev_comp.y" +#line 600 "lev_comp.y" /* yacc.c:1646 */ { - long n_items = (yyvsp[(4) - (5)].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_COORD|SPOVAR_ARRAY); - add_opvars(splev, "iso", n_items, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); - Free((yyvsp[(1) - (5)].map)); + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_COORD|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[-4].map), SPO_VAR_INIT); + Free((yyvsp[-4].map)); } +#line 2791 "y.tab.c" /* yacc.c:1646 */ break; case 108: - -/* Line 1455 of yacc.c */ -#line 605 "lev_comp.y" +#line 607 "lev_comp.y" /* yacc.c:1646 */ { - long n_items = (yyvsp[(4) - (5)].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_REGION|SPOVAR_ARRAY); - add_opvars(splev, "iso", n_items, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); - Free((yyvsp[(1) - (5)].map)); + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_REGION|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[-4].map), SPO_VAR_INIT); + Free((yyvsp[-4].map)); } +#line 2802 "y.tab.c" /* yacc.c:1646 */ break; case 109: - -/* Line 1455 of yacc.c */ -#line 612 "lev_comp.y" +#line 614 "lev_comp.y" /* yacc.c:1646 */ { - long n_items = (yyvsp[(6) - (7)].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (7)].map), SPOVAR_MAPCHAR|SPOVAR_ARRAY); - add_opvars(splev, "iso", n_items, (yyvsp[(1) - (7)].map), SPO_VAR_INIT); - Free((yyvsp[(1) - (7)].map)); + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-6].map), SPOVAR_MAPCHAR|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[-6].map), SPO_VAR_INIT); + Free((yyvsp[-6].map)); } +#line 2813 "y.tab.c" /* yacc.c:1646 */ break; case 110: - -/* Line 1455 of yacc.c */ -#line 619 "lev_comp.y" +#line 621 "lev_comp.y" /* yacc.c:1646 */ { - long n_items = (yyvsp[(6) - (7)].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (7)].map), SPOVAR_MONST|SPOVAR_ARRAY); - add_opvars(splev, "iso", n_items, (yyvsp[(1) - (7)].map), SPO_VAR_INIT); - Free((yyvsp[(1) - (7)].map)); + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-6].map), SPOVAR_MONST|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[-6].map), SPO_VAR_INIT); + Free((yyvsp[-6].map)); } +#line 2824 "y.tab.c" /* yacc.c:1646 */ break; case 111: - -/* Line 1455 of yacc.c */ -#line 626 "lev_comp.y" +#line 628 "lev_comp.y" /* yacc.c:1646 */ { - long n_items = (yyvsp[(6) - (7)].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (7)].map), SPOVAR_OBJ|SPOVAR_ARRAY); - add_opvars(splev, "iso", n_items, (yyvsp[(1) - (7)].map), SPO_VAR_INIT); - Free((yyvsp[(1) - (7)].map)); + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-6].map), SPOVAR_OBJ|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[-6].map), SPO_VAR_INIT); + Free((yyvsp[-6].map)); } +#line 2835 "y.tab.c" /* yacc.c:1646 */ break; case 112: - -/* Line 1455 of yacc.c */ -#line 633 "lev_comp.y" +#line 635 "lev_comp.y" /* yacc.c:1646 */ { - long n_items = (yyvsp[(4) - (5)].i); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (5)].map), SPOVAR_STRING|SPOVAR_ARRAY); - add_opvars(splev, "iso", n_items, (yyvsp[(1) - (5)].map), SPO_VAR_INIT); - Free((yyvsp[(1) - (5)].map)); + long n_items = (yyvsp[-1].i); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_STRING|SPOVAR_ARRAY); + add_opvars(splev, "iso", n_items, (yyvsp[-4].map), SPO_VAR_INIT); + Free((yyvsp[-4].map)); } +#line 2846 "y.tab.c" /* yacc.c:1646 */ break; case 113: - -/* Line 1455 of yacc.c */ -#line 642 "lev_comp.y" +#line 644 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "O", (yyvsp[(1) - (1)].i)); + add_opvars(splev, "O", (yyvsp[0].i)); (yyval.i) = 1; } +#line 2855 "y.tab.c" /* yacc.c:1646 */ break; case 114: - -/* Line 1455 of yacc.c */ -#line 647 "lev_comp.y" +#line 649 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "O", (yyvsp[(3) - (3)].i)); - (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + add_opvars(splev, "O", (yyvsp[0].i)); + (yyval.i) = 1 + (yyvsp[-2].i); } +#line 2864 "y.tab.c" /* yacc.c:1646 */ break; case 115: - -/* Line 1455 of yacc.c */ -#line 654 "lev_comp.y" +#line 656 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "M", (yyvsp[(1) - (1)].i)); + add_opvars(splev, "M", (yyvsp[0].i)); (yyval.i) = 1; } +#line 2873 "y.tab.c" /* yacc.c:1646 */ break; case 116: - -/* Line 1455 of yacc.c */ -#line 659 "lev_comp.y" +#line 661 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "M", (yyvsp[(3) - (3)].i)); - (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + add_opvars(splev, "M", (yyvsp[0].i)); + (yyval.i) = 1 + (yyvsp[-2].i); } +#line 2882 "y.tab.c" /* yacc.c:1646 */ break; case 117: - -/* Line 1455 of yacc.c */ -#line 666 "lev_comp.y" +#line 668 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "m", (yyvsp[(1) - (1)].i)); + add_opvars(splev, "m", (yyvsp[0].i)); (yyval.i) = 1; } +#line 2891 "y.tab.c" /* yacc.c:1646 */ break; case 118: - -/* Line 1455 of yacc.c */ -#line 671 "lev_comp.y" +#line 673 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "m", (yyvsp[(3) - (3)].i)); - (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + add_opvars(splev, "m", (yyvsp[0].i)); + (yyval.i) = 1 + (yyvsp[-2].i); } +#line 2900 "y.tab.c" /* yacc.c:1646 */ break; case 119: - -/* Line 1455 of yacc.c */ -#line 678 "lev_comp.y" +#line 680 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 1; } +#line 2908 "y.tab.c" /* yacc.c:1646 */ break; case 120: - -/* Line 1455 of yacc.c */ -#line 682 "lev_comp.y" +#line 684 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + (yyval.i) = 1 + (yyvsp[-2].i); } +#line 2916 "y.tab.c" /* yacc.c:1646 */ break; case 121: - -/* Line 1455 of yacc.c */ -#line 688 "lev_comp.y" +#line 690 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "c", (yyvsp[(1) - (1)].i)); + add_opvars(splev, "c", (yyvsp[0].i)); (yyval.i) = 1; } +#line 2925 "y.tab.c" /* yacc.c:1646 */ break; case 122: - -/* Line 1455 of yacc.c */ -#line 693 "lev_comp.y" +#line 695 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "c", (yyvsp[(3) - (3)].i)); - (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + add_opvars(splev, "c", (yyvsp[0].i)); + (yyval.i) = 1 + (yyvsp[-2].i); } +#line 2934 "y.tab.c" /* yacc.c:1646 */ break; case 123: - -/* Line 1455 of yacc.c */ -#line 700 "lev_comp.y" +#line 702 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 1; } +#line 2942 "y.tab.c" /* yacc.c:1646 */ break; case 124: - -/* Line 1455 of yacc.c */ -#line 704 "lev_comp.y" +#line 706 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + (yyval.i) = 1 + (yyvsp[-2].i); } +#line 2950 "y.tab.c" /* yacc.c:1646 */ break; case 125: - -/* Line 1455 of yacc.c */ -#line 710 "lev_comp.y" +#line 712 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 1; } +#line 2958 "y.tab.c" /* yacc.c:1646 */ break; case 126: - -/* Line 1455 of yacc.c */ -#line 714 "lev_comp.y" +#line 716 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = 1 + (yyvsp[(1) - (3)].i); + (yyval.i) = 1 + (yyvsp[-2].i); } +#line 2966 "y.tab.c" /* yacc.c:1646 */ break; case 127: - -/* Line 1455 of yacc.c */ -#line 720 "lev_comp.y" +#line 722 "lev_comp.y" /* yacc.c:1646 */ { struct lc_funcdefs *funcdef; if (in_function_definition) - lc_error("Recursively defined functions not allowed (function %s).", (yyvsp[(2) - (3)].map)); + lc_error("Recursively defined functions not allowed (function %s).", (yyvsp[-1].map)); in_function_definition++; - if (funcdef_defined(function_definitions, (yyvsp[(2) - (3)].map), 1)) - lc_error("Function '%s' already defined once.", (yyvsp[(2) - (3)].map)); + if (funcdef_defined(function_definitions, (yyvsp[-1].map), 1)) + lc_error("Function '%s' already defined once.", (yyvsp[-1].map)); - funcdef = funcdef_new(-1, (yyvsp[(2) - (3)].map)); + funcdef = funcdef_new(-1, (yyvsp[-1].map)); funcdef->next = function_definitions; function_definitions = funcdef; function_splev_backup = splev; splev = &(funcdef->code); - Free((yyvsp[(2) - (3)].map)); + Free((yyvsp[-1].map)); curr_function = funcdef; function_tmp_var_defs = variable_definitions; variable_definitions = NULL; } +#line 2992 "y.tab.c" /* yacc.c:1646 */ break; case 128: - -/* Line 1455 of yacc.c */ -#line 742 "lev_comp.y" +#line 744 "lev_comp.y" /* yacc.c:1646 */ { /* nothing */ } +#line 3000 "y.tab.c" /* yacc.c:1646 */ break; case 129: - -/* Line 1455 of yacc.c */ -#line 746 "lev_comp.y" +#line 748 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", 0, SPO_RETURN); splev = function_splev_backup; @@ -3355,26 +3009,25 @@ yyreduce: vardef_free_all(variable_definitions); variable_definitions = function_tmp_var_defs; } +#line 3013 "y.tab.c" /* yacc.c:1646 */ break; case 130: - -/* Line 1455 of yacc.c */ -#line 757 "lev_comp.y" +#line 759 "lev_comp.y" /* yacc.c:1646 */ { struct lc_funcdefs *tmpfunc; - tmpfunc = funcdef_defined(function_definitions, (yyvsp[(1) - (4)].map), 1); + tmpfunc = funcdef_defined(function_definitions, (yyvsp[-3].map), 1); if (tmpfunc) { long l; - long nparams = strlen( (yyvsp[(3) - (4)].map) ); + long nparams = strlen( (yyvsp[-1].map) ); char *fparamstr = funcdef_paramtypes(tmpfunc); - if (strcmp((yyvsp[(3) - (4)].map), fparamstr)) { + if (strcmp((yyvsp[-1].map), fparamstr)) { char *tmps = strdup(decode_parm_str(fparamstr)); - lc_error("Function '%s' requires params '%s', got '%s' instead.", (yyvsp[(1) - (4)].map), tmps, decode_parm_str((yyvsp[(3) - (4)].map))); + lc_error("Function '%s' requires params '%s', got '%s' instead.", (yyvsp[-3].map), tmps, decode_parm_str((yyvsp[-1].map))); Free(tmps); } Free(fparamstr); - Free((yyvsp[(3) - (4)].map)); + Free((yyvsp[-1].map)); if (!(tmpfunc->n_called)) { /* we haven't called the function yet, so insert it in the code */ struct opvar *jmp = New(struct opvar); @@ -3399,83 +3052,75 @@ yyreduce: add_opvars(splev, "iio", nparams, l, SPO_CALL); tmpfunc->n_called++; } else { - lc_error("Function '%s' not defined.", (yyvsp[(1) - (4)].map)); + lc_error("Function '%s' not defined.", (yyvsp[-3].map)); } - Free((yyvsp[(1) - (4)].map)); + Free((yyvsp[-3].map)); } +#line 3060 "y.tab.c" /* yacc.c:1646 */ break; case 131: - -/* Line 1455 of yacc.c */ -#line 802 "lev_comp.y" +#line 804 "lev_comp.y" /* yacc.c:1646 */ { add_opcode(splev, SPO_EXIT, NULL); } +#line 3068 "y.tab.c" /* yacc.c:1646 */ break; case 132: - -/* Line 1455 of yacc.c */ -#line 808 "lev_comp.y" +#line 810 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 100; } +#line 3076 "y.tab.c" /* yacc.c:1646 */ break; case 133: - -/* Line 1455 of yacc.c */ -#line 812 "lev_comp.y" +#line 814 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(1) - (1)].i); + (yyval.i) = (yyvsp[0].i); } +#line 3084 "y.tab.c" /* yacc.c:1646 */ break; case 134: - -/* Line 1455 of yacc.c */ -#line 818 "lev_comp.y" +#line 820 "lev_comp.y" /* yacc.c:1646 */ { /* val > rn2(100) */ - add_opvars(splev, "iio", (long)(yyvsp[(1) - (1)].i), 100, SPO_RN2); + add_opvars(splev, "iio", (long)(yyvsp[0].i), 100, SPO_RN2); (yyval.i) = SPO_JG; } +#line 3094 "y.tab.c" /* yacc.c:1646 */ break; case 135: - -/* Line 1455 of yacc.c */ -#line 824 "lev_comp.y" +#line 826 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(3) - (5)].i); + (yyval.i) = (yyvsp[-2].i); } +#line 3102 "y.tab.c" /* yacc.c:1646 */ break; case 136: - -/* Line 1455 of yacc.c */ -#line 828 "lev_comp.y" +#line 830 "lev_comp.y" /* yacc.c:1646 */ { /* boolean, explicit foo != 0 */ add_opvars(splev, "i", 0); (yyval.i) = SPO_JNE; } +#line 3112 "y.tab.c" /* yacc.c:1646 */ break; case 137: - -/* Line 1455 of yacc.c */ -#line 836 "lev_comp.y" +#line 838 "lev_comp.y" /* yacc.c:1646 */ { is_inconstant_number = 0; } +#line 3120 "y.tab.c" /* yacc.c:1646 */ break; case 138: - -/* Line 1455 of yacc.c */ -#line 840 "lev_comp.y" +#line 842 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *chkjmp; if (in_switch_statement > 0) @@ -3497,12 +3142,11 @@ yyreduce: add_opcode(splev, SPO_JMP, NULL); break_stmt_start(); } +#line 3146 "y.tab.c" /* yacc.c:1646 */ break; case 139: - -/* Line 1455 of yacc.c */ -#line 862 "lev_comp.y" +#line 864 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *endjump = New(struct opvar); int i; @@ -3536,34 +3180,31 @@ yyreduce: } +#line 3184 "y.tab.c" /* yacc.c:1646 */ break; case 142: - -/* Line 1455 of yacc.c */ -#line 902 "lev_comp.y" +#line 904 "lev_comp.y" /* yacc.c:1646 */ { if (n_switch_case_list < MAX_SWITCH_CASES) { struct opvar *tmppush = New(struct opvar); set_opvar_int(tmppush, splev->n_opcodes); - switch_case_value[n_switch_case_list] = (yyvsp[(2) - (3)].i); + switch_case_value[n_switch_case_list] = (yyvsp[-1].i); switch_case_list[n_switch_case_list++] = tmppush; } else lc_error("Too many cases in a switch."); } +#line 3197 "y.tab.c" /* yacc.c:1646 */ break; case 143: - -/* Line 1455 of yacc.c */ -#line 911 "lev_comp.y" +#line 913 "lev_comp.y" /* yacc.c:1646 */ { } +#line 3204 "y.tab.c" /* yacc.c:1646 */ break; case 144: - -/* Line 1455 of yacc.c */ -#line 914 "lev_comp.y" +#line 916 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *tmppush = New(struct opvar); @@ -3573,20 +3214,18 @@ yyreduce: set_opvar_int(tmppush, splev->n_opcodes); switch_default_case = tmppush; } +#line 3218 "y.tab.c" /* yacc.c:1646 */ break; case 145: - -/* Line 1455 of yacc.c */ -#line 924 "lev_comp.y" +#line 926 "lev_comp.y" /* yacc.c:1646 */ { } +#line 3225 "y.tab.c" /* yacc.c:1646 */ break; case 146: - -/* Line 1455 of yacc.c */ -#line 929 "lev_comp.y" +#line 931 "lev_comp.y" /* yacc.c:1646 */ { if (!allow_break_statements) lc_error("Cannot use BREAK outside a statement block."); @@ -3594,12 +3233,11 @@ yyreduce: break_stmt_new(splev, splev->n_opcodes); } } +#line 3237 "y.tab.c" /* yacc.c:1646 */ break; case 149: - -/* Line 1455 of yacc.c */ -#line 943 "lev_comp.y" +#line 945 "lev_comp.y" /* yacc.c:1646 */ { char buf[256], buf2[256]; @@ -3609,42 +3247,40 @@ yyreduce: } /* first, define a variable for the for-loop end value */ - snprintf(buf, 255, "%s end", (yyvsp[(2) - (6)].map)); + snprintf(buf, 255, "%s end", (yyvsp[-4].map)); /* the value of which is already in stack (the 2nd math_expr) */ add_opvars(splev, "iso", 0, buf, SPO_VAR_INIT); - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(2) - (6)].map), SPOVAR_INT); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-4].map), SPOVAR_INT); /* define the for-loop variable. value is in stack (1st math_expr) */ - add_opvars(splev, "iso", 0, (yyvsp[(2) - (6)].map), SPO_VAR_INIT); + add_opvars(splev, "iso", 0, (yyvsp[-4].map), SPO_VAR_INIT); /* calculate value for the loop "step" variable */ - snprintf(buf2, 255, "%s step", (yyvsp[(2) - (6)].map)); - add_opvars(splev, "vvo", buf, (yyvsp[(2) - (6)].map), SPO_MATH_SUB); /* end - start */ + snprintf(buf2, 255, "%s step", (yyvsp[-4].map)); + add_opvars(splev, "vvo", buf, (yyvsp[-4].map), SPO_MATH_SUB); /* end - start */ add_opvars(splev, "o", SPO_MATH_SIGN); /* sign of that */ add_opvars(splev, "iso", 0, buf2, SPO_VAR_INIT); /* save the sign into the step var */ - forloop_list[n_forloops].varname = strdup((yyvsp[(2) - (6)].map)); + forloop_list[n_forloops].varname = strdup((yyvsp[-4].map)); forloop_list[n_forloops].jmp_point = splev->n_opcodes; n_forloops++; - Free((yyvsp[(2) - (6)].map)); + Free((yyvsp[-4].map)); } +#line 3271 "y.tab.c" /* yacc.c:1646 */ break; case 150: - -/* Line 1455 of yacc.c */ -#line 975 "lev_comp.y" +#line 977 "lev_comp.y" /* yacc.c:1646 */ { /* nothing */ break_stmt_start(); } +#line 3280 "y.tab.c" /* yacc.c:1646 */ break; case 151: - -/* Line 1455 of yacc.c */ -#line 980 "lev_comp.y" +#line 982 "lev_comp.y" /* yacc.c:1646 */ { char buf[256], buf2[256]; n_forloops--; @@ -3662,12 +3298,11 @@ yyreduce: Free(forloop_list[n_forloops].varname); break_stmt_end(splev); } +#line 3302 "y.tab.c" /* yacc.c:1646 */ break; case 152: - -/* Line 1455 of yacc.c */ -#line 1000 "lev_comp.y" +#line 1002 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *tmppush = New(struct opvar); @@ -3681,12 +3316,11 @@ yyreduce: add_opvars(splev, "o", SPO_DEC); break_stmt_start(); } +#line 3320 "y.tab.c" /* yacc.c:1646 */ break; case 153: - -/* Line 1455 of yacc.c */ -#line 1014 "lev_comp.y" +#line 1016 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *tmppush; @@ -3699,12 +3333,11 @@ yyreduce: add_opcode(splev, SPO_POP, NULL); /* get rid of the count value in stack */ break_stmt_end(splev); } +#line 3337 "y.tab.c" /* yacc.c:1646 */ break; case 154: - -/* Line 1455 of yacc.c */ -#line 1029 "lev_comp.y" +#line 1031 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *tmppush2 = New(struct opvar); @@ -3721,15 +3354,14 @@ yyreduce: add_opcode(splev, SPO_PUSH, tmppush2); - add_opcode(splev, reverse_jmp_opcode( (yyvsp[(1) - (2)].i) ), NULL); + add_opcode(splev, reverse_jmp_opcode( (yyvsp[-1].i) ), NULL); } +#line 3361 "y.tab.c" /* yacc.c:1646 */ break; case 155: - -/* Line 1455 of yacc.c */ -#line 1049 "lev_comp.y" +#line 1051 "lev_comp.y" /* yacc.c:1646 */ { if (n_if_list > 0) { struct opvar *tmppush; @@ -3737,12 +3369,11 @@ yyreduce: set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); } else lc_error("IF: Huh?! No start address?"); } +#line 3373 "y.tab.c" /* yacc.c:1646 */ break; case 156: - -/* Line 1455 of yacc.c */ -#line 1059 "lev_comp.y" +#line 1061 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *tmppush2 = New(struct opvar); @@ -3759,24 +3390,22 @@ yyreduce: add_opcode(splev, SPO_PUSH, tmppush2); - add_opcode(splev, reverse_jmp_opcode( (yyvsp[(2) - (2)].i) ), NULL); + add_opcode(splev, reverse_jmp_opcode( (yyvsp[0].i) ), NULL); } +#line 3397 "y.tab.c" /* yacc.c:1646 */ break; case 157: - -/* Line 1455 of yacc.c */ -#line 1079 "lev_comp.y" +#line 1081 "lev_comp.y" /* yacc.c:1646 */ { /* do nothing */ } +#line 3405 "y.tab.c" /* yacc.c:1646 */ break; case 158: - -/* Line 1455 of yacc.c */ -#line 1085 "lev_comp.y" +#line 1087 "lev_comp.y" /* yacc.c:1646 */ { if (n_if_list > 0) { struct opvar *tmppush; @@ -3784,12 +3413,11 @@ yyreduce: set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); } else lc_error("IF: Huh?! No start address?"); } +#line 3417 "y.tab.c" /* yacc.c:1646 */ break; case 159: - -/* Line 1455 of yacc.c */ -#line 1093 "lev_comp.y" +#line 1095 "lev_comp.y" /* yacc.c:1646 */ { if (n_if_list > 0) { struct opvar *tmppush = New(struct opvar); @@ -3806,12 +3434,11 @@ yyreduce: if_list[n_if_list++] = tmppush; } else lc_error("IF: Huh?! No else-part address?"); } +#line 3438 "y.tab.c" /* yacc.c:1646 */ break; case 160: - -/* Line 1455 of yacc.c */ -#line 1110 "lev_comp.y" +#line 1112 "lev_comp.y" /* yacc.c:1646 */ { if (n_if_list > 0) { struct opvar *tmppush; @@ -3819,591 +3446,535 @@ yyreduce: set_opvar_int(tmppush, splev->n_opcodes - tmppush->vardata.l); } else lc_error("IF: Huh?! No end address?"); } +#line 3450 "y.tab.c" /* yacc.c:1646 */ break; case 161: - -/* Line 1455 of yacc.c */ -#line 1120 "lev_comp.y" +#line 1122 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_MESSAGE); } +#line 3458 "y.tab.c" /* yacc.c:1646 */ break; case 162: - -/* Line 1455 of yacc.c */ -#line 1126 "lev_comp.y" +#line 1128 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiiiio", -1, 0, -1, -1, -1, -1, SPO_CORRIDOR); } +#line 3466 "y.tab.c" /* yacc.c:1646 */ break; case 163: - -/* Line 1455 of yacc.c */ -#line 1130 "lev_comp.y" +#line 1132 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "iiiiiio", -1, (yyvsp[(3) - (3)].i), -1, -1, -1, -1, SPO_CORRIDOR); + add_opvars(splev, "iiiiiio", -1, (yyvsp[0].i), -1, -1, -1, -1, SPO_CORRIDOR); } +#line 3474 "y.tab.c" /* yacc.c:1646 */ break; case 164: - -/* Line 1455 of yacc.c */ -#line 1134 "lev_comp.y" +#line 1136 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiiiio", -1, -1, -1, -1, -1, -1, SPO_CORRIDOR); } +#line 3482 "y.tab.c" /* yacc.c:1646 */ break; case 165: - -/* Line 1455 of yacc.c */ -#line 1140 "lev_comp.y" +#line 1142 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiiiio", - (yyvsp[(3) - (5)].corpos).room, (yyvsp[(3) - (5)].corpos).door, (yyvsp[(3) - (5)].corpos).wall, - (yyvsp[(5) - (5)].corpos).room, (yyvsp[(5) - (5)].corpos).door, (yyvsp[(5) - (5)].corpos).wall, + (yyvsp[-2].corpos).room, (yyvsp[-2].corpos).door, (yyvsp[-2].corpos).wall, + (yyvsp[0].corpos).room, (yyvsp[0].corpos).door, (yyvsp[0].corpos).wall, SPO_CORRIDOR); } +#line 3493 "y.tab.c" /* yacc.c:1646 */ break; case 166: - -/* Line 1455 of yacc.c */ -#line 1147 "lev_comp.y" +#line 1149 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiiiio", - (yyvsp[(3) - (5)].corpos).room, (yyvsp[(3) - (5)].corpos).door, (yyvsp[(3) - (5)].corpos).wall, - -1, -1, (long)(yyvsp[(5) - (5)].i), + (yyvsp[-2].corpos).room, (yyvsp[-2].corpos).door, (yyvsp[-2].corpos).wall, + -1, -1, (long)(yyvsp[0].i), SPO_CORRIDOR); } +#line 3504 "y.tab.c" /* yacc.c:1646 */ break; case 167: - -/* Line 1455 of yacc.c */ -#line 1156 "lev_comp.y" +#line 1158 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.corpos).room = (yyvsp[(2) - (7)].i); - (yyval.corpos).wall = (yyvsp[(4) - (7)].i); - (yyval.corpos).door = (yyvsp[(6) - (7)].i); + (yyval.corpos).room = (yyvsp[-5].i); + (yyval.corpos).wall = (yyvsp[-3].i); + (yyval.corpos).door = (yyvsp[-1].i); } +#line 3514 "y.tab.c" /* yacc.c:1646 */ break; case 168: - -/* Line 1455 of yacc.c */ -#line 1164 "lev_comp.y" +#line 1166 "lev_comp.y" /* yacc.c:1646 */ { - if (((yyvsp[(2) - (4)].i) < 100) && ((yyvsp[(1) - (4)].i) == OROOM)) + if (((yyvsp[-2].i) < 100) && ((yyvsp[-3].i) == OROOM)) lc_error("Only typed rooms can have a chance."); else { - add_opvars(splev, "iii", (long)(yyvsp[(1) - (4)].i), (long)(yyvsp[(2) - (4)].i), (long)(yyvsp[(4) - (4)].i)); + add_opvars(splev, "iii", (long)(yyvsp[-3].i), (long)(yyvsp[-2].i), (long)(yyvsp[0].i)); } } +#line 3526 "y.tab.c" /* yacc.c:1646 */ break; case 169: - -/* Line 1455 of yacc.c */ -#line 1174 "lev_comp.y" +#line 1176 "lev_comp.y" /* yacc.c:1646 */ { - long flags = (yyvsp[(8) - (8)].i); + long flags = (yyvsp[0].i); if (flags == -1) flags = (1 << 0); add_opvars(splev, "iiiiiiio", flags, ERR, ERR, - (yyvsp[(5) - (8)].crd).x, (yyvsp[(5) - (8)].crd).y, (yyvsp[(7) - (8)].sze).width, (yyvsp[(7) - (8)].sze).height, SPO_SUBROOM); + (yyvsp[-3].crd).x, (yyvsp[-3].crd).y, (yyvsp[-1].sze).width, (yyvsp[-1].sze).height, SPO_SUBROOM); break_stmt_start(); } +#line 3538 "y.tab.c" /* yacc.c:1646 */ break; case 170: - -/* Line 1455 of yacc.c */ -#line 1182 "lev_comp.y" +#line 1184 "lev_comp.y" /* yacc.c:1646 */ { break_stmt_end(splev); add_opcode(splev, SPO_ENDROOM, NULL); } +#line 3547 "y.tab.c" /* yacc.c:1646 */ break; case 171: - -/* Line 1455 of yacc.c */ -#line 1189 "lev_comp.y" +#line 1191 "lev_comp.y" /* yacc.c:1646 */ { - long flags = (yyvsp[(8) - (10)].i); + long flags = (yyvsp[-2].i); if (flags == -1) flags = (1 << 0); add_opvars(splev, "iiiiiiio", flags, - (yyvsp[(7) - (10)].crd).x, (yyvsp[(7) - (10)].crd).y, (yyvsp[(5) - (10)].crd).x, (yyvsp[(5) - (10)].crd).y, - (yyvsp[(9) - (10)].sze).width, (yyvsp[(9) - (10)].sze).height, SPO_ROOM); + (yyvsp[-3].crd).x, (yyvsp[-3].crd).y, (yyvsp[-5].crd).x, (yyvsp[-5].crd).y, + (yyvsp[-1].sze).width, (yyvsp[-1].sze).height, SPO_ROOM); break_stmt_start(); } +#line 3560 "y.tab.c" /* yacc.c:1646 */ break; case 172: - -/* Line 1455 of yacc.c */ -#line 1198 "lev_comp.y" +#line 1200 "lev_comp.y" /* yacc.c:1646 */ { break_stmt_end(splev); add_opcode(splev, SPO_ENDROOM, NULL); } +#line 3569 "y.tab.c" /* yacc.c:1646 */ break; case 173: - -/* Line 1455 of yacc.c */ -#line 1205 "lev_comp.y" +#line 1207 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 1; } +#line 3577 "y.tab.c" /* yacc.c:1646 */ break; case 174: - -/* Line 1455 of yacc.c */ -#line 1209 "lev_comp.y" +#line 1211 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(2) - (2)].i); + (yyval.i) = (yyvsp[0].i); } +#line 3585 "y.tab.c" /* yacc.c:1646 */ break; case 175: - -/* Line 1455 of yacc.c */ -#line 1215 "lev_comp.y" +#line 1217 "lev_comp.y" /* yacc.c:1646 */ { - if ( (yyvsp[(2) - (5)].i) < 1 || (yyvsp[(2) - (5)].i) > 5 || - (yyvsp[(4) - (5)].i) < 1 || (yyvsp[(4) - (5)].i) > 5 ) { - lc_error("Room positions should be between 1-5: (%li,%li)!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i)); + if ( (yyvsp[-3].i) < 1 || (yyvsp[-3].i) > 5 || + (yyvsp[-1].i) < 1 || (yyvsp[-1].i) > 5 ) { + lc_error("Room positions should be between 1-5: (%li,%li)!", (yyvsp[-3].i), (yyvsp[-1].i)); } else { - (yyval.crd).x = (yyvsp[(2) - (5)].i); - (yyval.crd).y = (yyvsp[(4) - (5)].i); + (yyval.crd).x = (yyvsp[-3].i); + (yyval.crd).y = (yyvsp[-1].i); } } +#line 3599 "y.tab.c" /* yacc.c:1646 */ break; case 176: - -/* Line 1455 of yacc.c */ -#line 1225 "lev_comp.y" +#line 1227 "lev_comp.y" /* yacc.c:1646 */ { (yyval.crd).x = (yyval.crd).y = ERR; } +#line 3607 "y.tab.c" /* yacc.c:1646 */ break; case 177: - -/* Line 1455 of yacc.c */ -#line 1231 "lev_comp.y" +#line 1233 "lev_comp.y" /* yacc.c:1646 */ { - if ( (yyvsp[(2) - (5)].i) < 0 || (yyvsp[(4) - (5)].i) < 0) { - lc_error("Invalid subroom position (%li,%li)!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i)); + if ( (yyvsp[-3].i) < 0 || (yyvsp[-1].i) < 0) { + lc_error("Invalid subroom position (%li,%li)!", (yyvsp[-3].i), (yyvsp[-1].i)); } else { - (yyval.crd).x = (yyvsp[(2) - (5)].i); - (yyval.crd).y = (yyvsp[(4) - (5)].i); + (yyval.crd).x = (yyvsp[-3].i); + (yyval.crd).y = (yyvsp[-1].i); } } +#line 3620 "y.tab.c" /* yacc.c:1646 */ break; case 178: - -/* Line 1455 of yacc.c */ -#line 1240 "lev_comp.y" +#line 1242 "lev_comp.y" /* yacc.c:1646 */ { (yyval.crd).x = (yyval.crd).y = ERR; } +#line 3628 "y.tab.c" /* yacc.c:1646 */ break; case 179: - -/* Line 1455 of yacc.c */ -#line 1246 "lev_comp.y" +#line 1248 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.crd).x = (yyvsp[(2) - (5)].i); - (yyval.crd).y = (yyvsp[(4) - (5)].i); + (yyval.crd).x = (yyvsp[-3].i); + (yyval.crd).y = (yyvsp[-1].i); } +#line 3637 "y.tab.c" /* yacc.c:1646 */ break; case 180: - -/* Line 1455 of yacc.c */ -#line 1251 "lev_comp.y" +#line 1253 "lev_comp.y" /* yacc.c:1646 */ { (yyval.crd).x = (yyval.crd).y = ERR; } +#line 3645 "y.tab.c" /* yacc.c:1646 */ break; case 181: - -/* Line 1455 of yacc.c */ -#line 1257 "lev_comp.y" +#line 1259 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.sze).width = (yyvsp[(2) - (5)].i); - (yyval.sze).height = (yyvsp[(4) - (5)].i); + (yyval.sze).width = (yyvsp[-3].i); + (yyval.sze).height = (yyvsp[-1].i); } +#line 3654 "y.tab.c" /* yacc.c:1646 */ break; case 182: - -/* Line 1455 of yacc.c */ -#line 1262 "lev_comp.y" +#line 1264 "lev_comp.y" /* yacc.c:1646 */ { (yyval.sze).height = (yyval.sze).width = ERR; } +#line 3662 "y.tab.c" /* yacc.c:1646 */ break; case 183: - -/* Line 1455 of yacc.c */ -#line 1268 "lev_comp.y" +#line 1270 "lev_comp.y" /* yacc.c:1646 */ { /* ERR means random here */ - if ((yyvsp[(7) - (9)].i) == ERR && (yyvsp[(9) - (9)].i) != ERR) { + if ((yyvsp[-2].i) == ERR && (yyvsp[0].i) != ERR) { lc_error("If the door wall is random, so must be its pos!"); } else { - add_opvars(splev, "iiiio", (long)(yyvsp[(9) - (9)].i), (long)(yyvsp[(5) - (9)].i), (long)(yyvsp[(3) - (9)].i), (long)(yyvsp[(7) - (9)].i), SPO_ROOM_DOOR); + add_opvars(splev, "iiiio", (long)(yyvsp[0].i), (long)(yyvsp[-4].i), (long)(yyvsp[-6].i), (long)(yyvsp[-2].i), SPO_ROOM_DOOR); } } +#line 3675 "y.tab.c" /* yacc.c:1646 */ break; case 184: - -/* Line 1455 of yacc.c */ -#line 1277 "lev_comp.y" +#line 1279 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "io", (long)(yyvsp[(3) - (5)].i), SPO_DOOR); + add_opvars(splev, "io", (long)(yyvsp[-2].i), SPO_DOOR); } +#line 3683 "y.tab.c" /* yacc.c:1646 */ break; case 189: - -/* Line 1455 of yacc.c */ -#line 1291 "lev_comp.y" +#line 1293 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(1) - (1)].i); + (yyval.i) = (yyvsp[0].i); } +#line 3691 "y.tab.c" /* yacc.c:1646 */ break; case 190: - -/* Line 1455 of yacc.c */ -#line 1295 "lev_comp.y" +#line 1297 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = ((yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i)); + (yyval.i) = ((yyvsp[-2].i) | (yyvsp[0].i)); } +#line 3699 "y.tab.c" /* yacc.c:1646 */ break; case 193: - -/* Line 1455 of yacc.c */ -#line 1305 "lev_comp.y" +#line 1307 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ciisiio", 0, 0, 1, (char *)0, 0, 0, SPO_MAP); max_x_map = COLNO-1; max_y_map = ROWNO; } +#line 3709 "y.tab.c" /* yacc.c:1646 */ break; case 194: - -/* Line 1455 of yacc.c */ -#line 1311 "lev_comp.y" +#line 1313 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "cii", SP_COORD_PACK(((yyvsp[(3) - (7)].i)),((yyvsp[(5) - (7)].i))), 1, (long)(yyvsp[(6) - (7)].i)); - scan_map((yyvsp[(7) - (7)].map), splev); - Free((yyvsp[(7) - (7)].map)); + add_opvars(splev, "cii", SP_COORD_PACK(((yyvsp[-4].i)),((yyvsp[-2].i))), 1, (long)(yyvsp[-1].i)); + scan_map((yyvsp[0].map), splev); + Free((yyvsp[0].map)); } +#line 3719 "y.tab.c" /* yacc.c:1646 */ break; case 195: - -/* Line 1455 of yacc.c */ -#line 1317 "lev_comp.y" +#line 1319 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "ii", 2, (long)(yyvsp[(4) - (5)].i)); - scan_map((yyvsp[(5) - (5)].map), splev); - Free((yyvsp[(5) - (5)].map)); + add_opvars(splev, "ii", 2, (long)(yyvsp[-1].i)); + scan_map((yyvsp[0].map), splev); + Free((yyvsp[0].map)); } +#line 3729 "y.tab.c" /* yacc.c:1646 */ break; case 200: - -/* Line 1455 of yacc.c */ -#line 1333 "lev_comp.y" +#line 1335 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", 0, SPO_MONSTER); } +#line 3737 "y.tab.c" /* yacc.c:1646 */ break; case 201: - -/* Line 1455 of yacc.c */ -#line 1337 "lev_comp.y" +#line 1339 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", 1, SPO_MONSTER); in_container_obj++; break_stmt_start(); } +#line 3747 "y.tab.c" /* yacc.c:1646 */ break; case 202: - -/* Line 1455 of yacc.c */ -#line 1343 "lev_comp.y" +#line 1345 "lev_comp.y" /* yacc.c:1646 */ { break_stmt_end(splev); in_container_obj--; add_opvars(splev, "o", SPO_END_MONINVENT); } +#line 3757 "y.tab.c" /* yacc.c:1646 */ break; case 203: - -/* Line 1455 of yacc.c */ -#line 1351 "lev_comp.y" +#line 1353 "lev_comp.y" /* yacc.c:1646 */ { /* nothing */ } +#line 3765 "y.tab.c" /* yacc.c:1646 */ break; case 204: - -/* Line 1455 of yacc.c */ -#line 1357 "lev_comp.y" +#line 1359 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *stopit = New(struct opvar); set_opvar_int(stopit, SP_M_V_END); add_opcode(splev, SPO_PUSH, stopit); (yyval.i) = 0x0000; } +#line 3776 "y.tab.c" /* yacc.c:1646 */ break; case 205: - -/* Line 1455 of yacc.c */ -#line 1364 "lev_comp.y" +#line 1366 "lev_comp.y" /* yacc.c:1646 */ { - if (( (yyvsp[(1) - (3)].i) & (yyvsp[(3) - (3)].i) )) + if (( (yyvsp[-2].i) & (yyvsp[0].i) )) lc_error("MONSTER extra info defined twice."); - (yyval.i) = ( (yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i) ); + (yyval.i) = ( (yyvsp[-2].i) | (yyvsp[0].i) ); } +#line 3786 "y.tab.c" /* yacc.c:1646 */ break; case 206: - -/* Line 1455 of yacc.c */ -#line 1372 "lev_comp.y" +#line 1374 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", SP_M_V_NAME); (yyval.i) = 0x0001; } +#line 3795 "y.tab.c" /* yacc.c:1646 */ break; case 207: - -/* Line 1455 of yacc.c */ -#line 1377 "lev_comp.y" +#line 1379 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "ii", (long)(yyvsp[(1) - (1)].i), SP_M_V_PEACEFUL); + add_opvars(splev, "ii", (long)(yyvsp[0].i), SP_M_V_PEACEFUL); (yyval.i) = 0x0002; } +#line 3804 "y.tab.c" /* yacc.c:1646 */ break; case 208: - -/* Line 1455 of yacc.c */ -#line 1382 "lev_comp.y" +#line 1384 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "ii", (long)(yyvsp[(1) - (1)].i), SP_M_V_ASLEEP); + add_opvars(splev, "ii", (long)(yyvsp[0].i), SP_M_V_ASLEEP); (yyval.i) = 0x0004; } +#line 3813 "y.tab.c" /* yacc.c:1646 */ break; case 209: - -/* Line 1455 of yacc.c */ -#line 1387 "lev_comp.y" +#line 1389 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "ii", (long)(yyvsp[(1) - (1)].i), SP_M_V_ALIGN); + add_opvars(splev, "ii", (long)(yyvsp[0].i), SP_M_V_ALIGN); (yyval.i) = 0x0008; } +#line 3822 "y.tab.c" /* yacc.c:1646 */ break; case 210: - -/* Line 1455 of yacc.c */ -#line 1392 "lev_comp.y" +#line 1394 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "ii", (long)(yyvsp[(1) - (2)].i), SP_M_V_APPEAR); + add_opvars(splev, "ii", (long)(yyvsp[-1].i), SP_M_V_APPEAR); (yyval.i) = 0x0010; } +#line 3831 "y.tab.c" /* yacc.c:1646 */ break; case 211: - -/* Line 1455 of yacc.c */ -#line 1397 "lev_comp.y" +#line 1399 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", 1, SP_M_V_FEMALE); (yyval.i) = 0x0020; } +#line 3840 "y.tab.c" /* yacc.c:1646 */ break; case 212: - -/* Line 1455 of yacc.c */ -#line 1402 "lev_comp.y" +#line 1404 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", 1, SP_M_V_INVIS); (yyval.i) = 0x0040; } +#line 3849 "y.tab.c" /* yacc.c:1646 */ break; case 213: - -/* Line 1455 of yacc.c */ -#line 1407 "lev_comp.y" +#line 1409 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", 1, SP_M_V_CANCELLED); (yyval.i) = 0x0080; } +#line 3858 "y.tab.c" /* yacc.c:1646 */ break; case 214: - -/* Line 1455 of yacc.c */ -#line 1412 "lev_comp.y" +#line 1414 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", 1, SP_M_V_REVIVED); (yyval.i) = 0x0100; } +#line 3867 "y.tab.c" /* yacc.c:1646 */ break; case 215: - -/* Line 1455 of yacc.c */ -#line 1417 "lev_comp.y" +#line 1419 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", 1, SP_M_V_AVENGE); (yyval.i) = 0x0200; } +#line 3876 "y.tab.c" /* yacc.c:1646 */ break; case 216: - -/* Line 1455 of yacc.c */ -#line 1422 "lev_comp.y" +#line 1424 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", SP_M_V_FLEEING); (yyval.i) = 0x0400; } +#line 3885 "y.tab.c" /* yacc.c:1646 */ break; case 217: - -/* Line 1455 of yacc.c */ -#line 1427 "lev_comp.y" +#line 1429 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", SP_M_V_BLINDED); (yyval.i) = 0x0800; } +#line 3894 "y.tab.c" /* yacc.c:1646 */ break; case 218: - -/* Line 1455 of yacc.c */ -#line 1432 "lev_comp.y" +#line 1434 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", SP_M_V_PARALYZED); (yyval.i) = 0x1000; } +#line 3903 "y.tab.c" /* yacc.c:1646 */ break; case 219: - -/* Line 1455 of yacc.c */ -#line 1437 "lev_comp.y" +#line 1439 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", 1, SP_M_V_STUNNED); (yyval.i) = 0x2000; } +#line 3912 "y.tab.c" /* yacc.c:1646 */ break; case 220: - -/* Line 1455 of yacc.c */ -#line 1442 "lev_comp.y" +#line 1444 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", 1, SP_M_V_CONFUSED); (yyval.i) = 0x4000; } +#line 3921 "y.tab.c" /* yacc.c:1646 */ break; case 221: - -/* Line 1455 of yacc.c */ -#line 1447 "lev_comp.y" +#line 1449 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "ii", (long)(yyvsp[(3) - (3)].i), SP_M_V_SEENTRAPS); + add_opvars(splev, "ii", (long)(yyvsp[0].i), SP_M_V_SEENTRAPS); (yyval.i) = 0x8000; } +#line 3930 "y.tab.c" /* yacc.c:1646 */ break; case 222: - -/* Line 1455 of yacc.c */ -#line 1454 "lev_comp.y" +#line 1456 "lev_comp.y" /* yacc.c:1646 */ { - int token = get_trap_type((yyvsp[(1) - (1)].map)); + int token = get_trap_type((yyvsp[0].map)); if (token == ERR || token == 0) - lc_error("Unknown trap type '%s'!", (yyvsp[(1) - (1)].map)); + lc_error("Unknown trap type '%s'!", (yyvsp[0].map)); (yyval.i) = (1L << (token - 1)); } +#line 3941 "y.tab.c" /* yacc.c:1646 */ break; case 223: - -/* Line 1455 of yacc.c */ -#line 1461 "lev_comp.y" +#line 1463 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = (long) ~0; } +#line 3949 "y.tab.c" /* yacc.c:1646 */ break; case 224: - -/* Line 1455 of yacc.c */ -#line 1465 "lev_comp.y" +#line 1467 "lev_comp.y" /* yacc.c:1646 */ { - int token = get_trap_type((yyvsp[(1) - (3)].map)); + int token = get_trap_type((yyvsp[-2].map)); if (token == ERR || token == 0) - lc_error("Unknown trap type '%s'!", (yyvsp[(1) - (3)].map)); + lc_error("Unknown trap type '%s'!", (yyvsp[-2].map)); - if ((1L << (token - 1)) & (yyvsp[(3) - (3)].i)) - lc_error("Monster seen_traps, trap '%s' listed twice.", (yyvsp[(1) - (3)].map)); + if ((1L << (token - 1)) & (yyvsp[0].i)) + lc_error("Monster seen_traps, trap '%s' listed twice.", (yyvsp[-2].map)); - (yyval.i) = ((1L << (token - 1)) | (yyvsp[(3) - (3)].i)); + (yyval.i) = ((1L << (token - 1)) | (yyvsp[0].i)); } +#line 3964 "y.tab.c" /* yacc.c:1646 */ break; case 225: - -/* Line 1455 of yacc.c */ -#line 1478 "lev_comp.y" +#line 1480 "lev_comp.y" /* yacc.c:1646 */ { long cnt = 0; if (in_container_obj) cnt |= SP_OBJ_CONTENT; add_opvars(splev, "io", cnt, SPO_OBJECT); } +#line 3974 "y.tab.c" /* yacc.c:1646 */ break; case 226: - -/* Line 1455 of yacc.c */ -#line 1484 "lev_comp.y" +#line 1486 "lev_comp.y" /* yacc.c:1646 */ { long cnt = SP_OBJ_CONTAINER; if (in_container_obj) cnt |= SP_OBJ_CONTENT; @@ -4411,225 +3982,204 @@ yyreduce: in_container_obj++; break_stmt_start(); } +#line 3986 "y.tab.c" /* yacc.c:1646 */ break; case 227: - -/* Line 1455 of yacc.c */ -#line 1492 "lev_comp.y" +#line 1494 "lev_comp.y" /* yacc.c:1646 */ { break_stmt_end(splev); in_container_obj--; add_opcode(splev, SPO_POP_CONTAINER, NULL); } +#line 3996 "y.tab.c" /* yacc.c:1646 */ break; case 228: - -/* Line 1455 of yacc.c */ -#line 1500 "lev_comp.y" +#line 1502 "lev_comp.y" /* yacc.c:1646 */ { - if (( (yyvsp[(2) - (2)].i) & 0x4000) && in_container_obj) lc_error("Object cannot have a coord when contained."); - else if (!( (yyvsp[(2) - (2)].i) & 0x4000) && !in_container_obj) lc_error("Object needs a coord when not contained."); + if (( (yyvsp[0].i) & 0x4000) && in_container_obj) lc_error("Object cannot have a coord when contained."); + else if (!( (yyvsp[0].i) & 0x4000) && !in_container_obj) lc_error("Object needs a coord when not contained."); } +#line 4005 "y.tab.c" /* yacc.c:1646 */ break; case 229: - -/* Line 1455 of yacc.c */ -#line 1507 "lev_comp.y" +#line 1509 "lev_comp.y" /* yacc.c:1646 */ { struct opvar *stopit = New(struct opvar); set_opvar_int(stopit, SP_O_V_END); add_opcode(splev, SPO_PUSH, stopit); (yyval.i) = 0x00; } +#line 4016 "y.tab.c" /* yacc.c:1646 */ break; case 230: - -/* Line 1455 of yacc.c */ -#line 1514 "lev_comp.y" +#line 1516 "lev_comp.y" /* yacc.c:1646 */ { - if (( (yyvsp[(1) - (3)].i) & (yyvsp[(3) - (3)].i) )) + if (( (yyvsp[-2].i) & (yyvsp[0].i) )) lc_error("OBJECT extra info '%s' defined twice.", curr_token); - (yyval.i) = ( (yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i) ); + (yyval.i) = ( (yyvsp[-2].i) | (yyvsp[0].i) ); } +#line 4026 "y.tab.c" /* yacc.c:1646 */ break; case 231: - -/* Line 1455 of yacc.c */ -#line 1522 "lev_comp.y" +#line 1524 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "ii", (long)(yyvsp[(1) - (1)].i), SP_O_V_CURSE); + add_opvars(splev, "ii", (long)(yyvsp[0].i), SP_O_V_CURSE); (yyval.i) = 0x0001; } +#line 4035 "y.tab.c" /* yacc.c:1646 */ break; case 232: - -/* Line 1455 of yacc.c */ -#line 1527 "lev_comp.y" +#line 1529 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", SP_O_V_CORPSENM); (yyval.i) = 0x0002; } +#line 4044 "y.tab.c" /* yacc.c:1646 */ break; case 233: - -/* Line 1455 of yacc.c */ -#line 1532 "lev_comp.y" +#line 1534 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", SP_O_V_SPE); (yyval.i) = 0x0004; } +#line 4053 "y.tab.c" /* yacc.c:1646 */ break; case 234: - -/* Line 1455 of yacc.c */ -#line 1537 "lev_comp.y" +#line 1539 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", SP_O_V_NAME); (yyval.i) = 0x0008; } +#line 4062 "y.tab.c" /* yacc.c:1646 */ break; case 235: - -/* Line 1455 of yacc.c */ -#line 1542 "lev_comp.y" +#line 1544 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", SP_O_V_QUAN); (yyval.i) = 0x0010; } +#line 4071 "y.tab.c" /* yacc.c:1646 */ break; case 236: - -/* Line 1455 of yacc.c */ -#line 1547 "lev_comp.y" +#line 1549 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", 1, SP_O_V_BURIED); (yyval.i) = 0x0020; } +#line 4080 "y.tab.c" /* yacc.c:1646 */ break; case 237: - -/* Line 1455 of yacc.c */ -#line 1552 "lev_comp.y" +#line 1554 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "ii", (long)(yyvsp[(1) - (1)].i), SP_O_V_LIT); + add_opvars(splev, "ii", (long)(yyvsp[0].i), SP_O_V_LIT); (yyval.i) = 0x0040; } +#line 4089 "y.tab.c" /* yacc.c:1646 */ break; case 238: - -/* Line 1455 of yacc.c */ -#line 1557 "lev_comp.y" +#line 1559 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", SP_O_V_ERODED); (yyval.i) = 0x0080; } +#line 4098 "y.tab.c" /* yacc.c:1646 */ break; case 239: - -/* Line 1455 of yacc.c */ -#line 1562 "lev_comp.y" +#line 1564 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", -1, SP_O_V_ERODED); (yyval.i) = 0x0080; } +#line 4107 "y.tab.c" /* yacc.c:1646 */ break; case 240: - -/* Line 1455 of yacc.c */ -#line 1567 "lev_comp.y" +#line 1569 "lev_comp.y" /* yacc.c:1646 */ { - if ((yyvsp[(1) - (1)].i) == D_LOCKED) { + if ((yyvsp[0].i) == D_LOCKED) { add_opvars(splev, "ii", 1, SP_O_V_LOCKED); (yyval.i) = 0x0100; - } else if ((yyvsp[(1) - (1)].i) == D_BROKEN) { + } else if ((yyvsp[0].i) == D_BROKEN) { add_opvars(splev, "ii", 1, SP_O_V_BROKEN); (yyval.i) = 0x0200; } else lc_error("OBJECT state can only be locked or broken."); } +#line 4122 "y.tab.c" /* yacc.c:1646 */ break; case 241: - -/* Line 1455 of yacc.c */ -#line 1578 "lev_comp.y" +#line 1580 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", 1, SP_O_V_TRAPPED); (yyval.i) = 0x0400; } +#line 4131 "y.tab.c" /* yacc.c:1646 */ break; case 242: - -/* Line 1455 of yacc.c */ -#line 1583 "lev_comp.y" +#line 1585 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", SP_O_V_RECHARGED); (yyval.i) = 0x0800; } +#line 4140 "y.tab.c" /* yacc.c:1646 */ break; case 243: - -/* Line 1455 of yacc.c */ -#line 1588 "lev_comp.y" +#line 1590 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", 1, SP_O_V_INVIS); (yyval.i) = 0x1000; } +#line 4149 "y.tab.c" /* yacc.c:1646 */ break; case 244: - -/* Line 1455 of yacc.c */ -#line 1593 "lev_comp.y" +#line 1595 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "ii", 1, SP_O_V_GREASED); (yyval.i) = 0x2000; } +#line 4158 "y.tab.c" /* yacc.c:1646 */ break; case 245: - -/* Line 1455 of yacc.c */ -#line 1598 "lev_comp.y" +#line 1600 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "i", SP_O_V_COORD); (yyval.i) = 0x4000; } +#line 4167 "y.tab.c" /* yacc.c:1646 */ break; case 246: - -/* Line 1455 of yacc.c */ -#line 1605 "lev_comp.y" +#line 1607 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "io", (long)(yyvsp[(3) - (5)].i), SPO_TRAP); + add_opvars(splev, "io", (long)(yyvsp[-2].i), SPO_TRAP); } +#line 4175 "y.tab.c" /* yacc.c:1646 */ break; case 247: - -/* Line 1455 of yacc.c */ -#line 1611 "lev_comp.y" +#line 1613 "lev_comp.y" /* yacc.c:1646 */ { long d, state = 0; /* convert dir from a DIRECTION to a DB_DIR */ - d = (yyvsp[(5) - (7)].i); + d = (yyvsp[-2].i); switch(d) { case W_NORTH: d = DB_NORTH; break; case W_SOUTH: d = DB_SOUTH; break; @@ -4640,1018 +4190,921 @@ yyreduce: break; } - if ( (yyvsp[(7) - (7)].i) == D_ISOPEN ) + if ( (yyvsp[0].i) == D_ISOPEN ) state = 1; - else if ( (yyvsp[(7) - (7)].i) == D_CLOSED ) + else if ( (yyvsp[0].i) == D_CLOSED ) state = 0; - else if ( (yyvsp[(7) - (7)].i) == -1 ) + else if ( (yyvsp[0].i) == -1 ) state = -1; else lc_error("A drawbridge can only be open, closed or random!"); add_opvars(splev, "iio", state, d, SPO_DRAWBRIDGE); } +#line 4204 "y.tab.c" /* yacc.c:1646 */ break; case 248: - -/* Line 1455 of yacc.c */ -#line 1638 "lev_comp.y" +#line 1640 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiio", - (long)(yyvsp[(5) - (5)].i), 1, 0, SPO_MAZEWALK); + (long)(yyvsp[0].i), 1, 0, SPO_MAZEWALK); } +#line 4213 "y.tab.c" /* yacc.c:1646 */ break; case 249: - -/* Line 1455 of yacc.c */ -#line 1643 "lev_comp.y" +#line 1645 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiio", - (long)(yyvsp[(5) - (8)].i), (long)(yyvsp[(7) - (8)].i), (long)(yyvsp[(8) - (8)].i), SPO_MAZEWALK); + (long)(yyvsp[-3].i), (long)(yyvsp[-1].i), (long)(yyvsp[0].i), SPO_MAZEWALK); } +#line 4222 "y.tab.c" /* yacc.c:1646 */ break; case 250: - -/* Line 1455 of yacc.c */ -#line 1650 "lev_comp.y" +#line 1652 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "rio", SP_REGION_PACK(-1,-1,-1,-1), 0, SPO_WALLIFY); } +#line 4230 "y.tab.c" /* yacc.c:1646 */ break; case 251: - -/* Line 1455 of yacc.c */ -#line 1654 "lev_comp.y" +#line 1656 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", 1, SPO_WALLIFY); } +#line 4238 "y.tab.c" /* yacc.c:1646 */ break; case 252: - -/* Line 1455 of yacc.c */ -#line 1660 "lev_comp.y" +#line 1662 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "io", (long)(yyvsp[(5) - (5)].i), SPO_LADDER); + add_opvars(splev, "io", (long)(yyvsp[0].i), SPO_LADDER); } +#line 4246 "y.tab.c" /* yacc.c:1646 */ break; case 253: - -/* Line 1455 of yacc.c */ -#line 1666 "lev_comp.y" +#line 1668 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "io", (long)(yyvsp[(5) - (5)].i), SPO_STAIR); + add_opvars(splev, "io", (long)(yyvsp[0].i), SPO_STAIR); } +#line 4254 "y.tab.c" /* yacc.c:1646 */ break; case 254: - -/* Line 1455 of yacc.c */ -#line 1672 "lev_comp.y" +#line 1674 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiii iiiii iiso", - (yyvsp[(3) - (7)].lregn).x1, (yyvsp[(3) - (7)].lregn).y1, (yyvsp[(3) - (7)].lregn).x2, (yyvsp[(3) - (7)].lregn).y2, (yyvsp[(3) - (7)].lregn).area, - (yyvsp[(5) - (7)].lregn).x1, (yyvsp[(5) - (7)].lregn).y1, (yyvsp[(5) - (7)].lregn).x2, (yyvsp[(5) - (7)].lregn).y2, (yyvsp[(5) - (7)].lregn).area, - (long)(((yyvsp[(7) - (7)].i)) ? LR_UPSTAIR : LR_DOWNSTAIR), + (yyvsp[-4].lregn).x1, (yyvsp[-4].lregn).y1, (yyvsp[-4].lregn).x2, (yyvsp[-4].lregn).y2, (yyvsp[-4].lregn).area, + (yyvsp[-2].lregn).x1, (yyvsp[-2].lregn).y1, (yyvsp[-2].lregn).x2, (yyvsp[-2].lregn).y2, (yyvsp[-2].lregn).area, + (long)(((yyvsp[0].i)) ? LR_UPSTAIR : LR_DOWNSTAIR), 0, (char *)0, SPO_LEVREGION); } +#line 4266 "y.tab.c" /* yacc.c:1646 */ break; case 255: - -/* Line 1455 of yacc.c */ -#line 1682 "lev_comp.y" +#line 1684 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiii iiiii iiso", - (yyvsp[(3) - (7)].lregn).x1, (yyvsp[(3) - (7)].lregn).y1, (yyvsp[(3) - (7)].lregn).x2, (yyvsp[(3) - (7)].lregn).y2, (yyvsp[(3) - (7)].lregn).area, - (yyvsp[(5) - (7)].lregn).x1, (yyvsp[(5) - (7)].lregn).y1, (yyvsp[(5) - (7)].lregn).x2, (yyvsp[(5) - (7)].lregn).y2, (yyvsp[(5) - (7)].lregn).area, - LR_PORTAL, 0, (yyvsp[(7) - (7)].map), SPO_LEVREGION); - Free((yyvsp[(7) - (7)].map)); + (yyvsp[-4].lregn).x1, (yyvsp[-4].lregn).y1, (yyvsp[-4].lregn).x2, (yyvsp[-4].lregn).y2, (yyvsp[-4].lregn).area, + (yyvsp[-2].lregn).x1, (yyvsp[-2].lregn).y1, (yyvsp[-2].lregn).x2, (yyvsp[-2].lregn).y2, (yyvsp[-2].lregn).area, + LR_PORTAL, 0, (yyvsp[0].map), SPO_LEVREGION); + Free((yyvsp[0].map)); } +#line 4278 "y.tab.c" /* yacc.c:1646 */ break; case 256: - -/* Line 1455 of yacc.c */ -#line 1692 "lev_comp.y" +#line 1694 "lev_comp.y" /* yacc.c:1646 */ { long rtype = 0; - switch((yyvsp[(6) - (6)].i)) { + switch((yyvsp[0].i)) { case -1: rtype = LR_TELE; break; case 0: rtype = LR_DOWNTELE; break; case 1: rtype = LR_UPTELE; break; } add_opvars(splev, "iiiii iiiii iiso", - (yyvsp[(3) - (6)].lregn).x1, (yyvsp[(3) - (6)].lregn).y1, (yyvsp[(3) - (6)].lregn).x2, (yyvsp[(3) - (6)].lregn).y2, (yyvsp[(3) - (6)].lregn).area, - (yyvsp[(5) - (6)].lregn).x1, (yyvsp[(5) - (6)].lregn).y1, (yyvsp[(5) - (6)].lregn).x2, (yyvsp[(5) - (6)].lregn).y2, (yyvsp[(5) - (6)].lregn).area, + (yyvsp[-3].lregn).x1, (yyvsp[-3].lregn).y1, (yyvsp[-3].lregn).x2, (yyvsp[-3].lregn).y2, (yyvsp[-3].lregn).area, + (yyvsp[-1].lregn).x1, (yyvsp[-1].lregn).y1, (yyvsp[-1].lregn).x2, (yyvsp[-1].lregn).y2, (yyvsp[-1].lregn).area, rtype, 0, (char *)0, SPO_LEVREGION); } +#line 4295 "y.tab.c" /* yacc.c:1646 */ break; case 257: - -/* Line 1455 of yacc.c */ -#line 1707 "lev_comp.y" +#line 1709 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiii iiiii iiso", - (yyvsp[(3) - (5)].lregn).x1, (yyvsp[(3) - (5)].lregn).y1, (yyvsp[(3) - (5)].lregn).x2, (yyvsp[(3) - (5)].lregn).y2, (yyvsp[(3) - (5)].lregn).area, - (yyvsp[(5) - (5)].lregn).x1, (yyvsp[(5) - (5)].lregn).y1, (yyvsp[(5) - (5)].lregn).x2, (yyvsp[(5) - (5)].lregn).y2, (yyvsp[(5) - (5)].lregn).area, + (yyvsp[-2].lregn).x1, (yyvsp[-2].lregn).y1, (yyvsp[-2].lregn).x2, (yyvsp[-2].lregn).y2, (yyvsp[-2].lregn).area, + (yyvsp[0].lregn).x1, (yyvsp[0].lregn).y1, (yyvsp[0].lregn).x2, (yyvsp[0].lregn).y2, (yyvsp[0].lregn).area, (long)LR_BRANCH, 0, (char *)0, SPO_LEVREGION); } +#line 4306 "y.tab.c" /* yacc.c:1646 */ break; case 258: - -/* Line 1455 of yacc.c */ -#line 1716 "lev_comp.y" +#line 1718 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = -1; } +#line 4314 "y.tab.c" /* yacc.c:1646 */ break; case 259: - -/* Line 1455 of yacc.c */ -#line 1720 "lev_comp.y" +#line 1722 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(2) - (2)].i); + (yyval.i) = (yyvsp[0].i); } +#line 4322 "y.tab.c" /* yacc.c:1646 */ break; case 260: - -/* Line 1455 of yacc.c */ -#line 1726 "lev_comp.y" +#line 1728 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_FOUNTAIN); } +#line 4330 "y.tab.c" /* yacc.c:1646 */ break; case 261: - -/* Line 1455 of yacc.c */ -#line 1732 "lev_comp.y" +#line 1734 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_SINK); } +#line 4338 "y.tab.c" /* yacc.c:1646 */ break; case 262: - -/* Line 1455 of yacc.c */ -#line 1738 "lev_comp.y" +#line 1740 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_POOL); } +#line 4346 "y.tab.c" /* yacc.c:1646 */ break; case 263: - -/* Line 1455 of yacc.c */ -#line 1744 "lev_comp.y" +#line 1746 "lev_comp.y" /* yacc.c:1646 */ { (yyval.terr).lit = -2; - (yyval.terr).ter = what_map_char((char) (yyvsp[(1) - (1)].i)); + (yyval.terr).ter = what_map_char((char) (yyvsp[0].i)); } +#line 4355 "y.tab.c" /* yacc.c:1646 */ break; case 264: - -/* Line 1455 of yacc.c */ -#line 1749 "lev_comp.y" +#line 1751 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.terr).lit = (yyvsp[(4) - (5)].i); - (yyval.terr).ter = what_map_char((char) (yyvsp[(2) - (5)].i)); + (yyval.terr).lit = (yyvsp[-1].i); + (yyval.terr).ter = what_map_char((char) (yyvsp[-3].i)); } +#line 4364 "y.tab.c" /* yacc.c:1646 */ break; case 265: - -/* Line 1455 of yacc.c */ -#line 1756 "lev_comp.y" +#line 1758 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "io", (yyvsp[(9) - (9)].i), SPO_REPLACETERRAIN); + add_opvars(splev, "io", (yyvsp[0].i), SPO_REPLACETERRAIN); } +#line 4372 "y.tab.c" /* yacc.c:1646 */ break; case 266: - -/* Line 1455 of yacc.c */ -#line 1762 "lev_comp.y" +#line 1764 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_TERRAIN); } +#line 4380 "y.tab.c" /* yacc.c:1646 */ break; case 267: - -/* Line 1455 of yacc.c */ -#line 1768 "lev_comp.y" +#line 1770 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_NON_DIGGABLE); } +#line 4388 "y.tab.c" /* yacc.c:1646 */ break; case 268: - -/* Line 1455 of yacc.c */ -#line 1774 "lev_comp.y" +#line 1776 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_NON_PASSWALL); } +#line 4396 "y.tab.c" /* yacc.c:1646 */ break; case 269: - -/* Line 1455 of yacc.c */ -#line 1780 "lev_comp.y" +#line 1782 "lev_comp.y" /* yacc.c:1646 */ { long irr; - long rt = (yyvsp[(7) - (8)].i); - long flags = (yyvsp[(8) - (8)].i); + long rt = (yyvsp[-1].i); + long flags = (yyvsp[0].i); if (flags == -1) flags = (1 << 0); if (!(( flags ) & 1)) rt += MAXRTYPE+1; irr = ((( flags ) & 2) != 0); add_opvars(splev, "iiio", - (long)(yyvsp[(5) - (8)].i), rt, flags, SPO_REGION); + (long)(yyvsp[-3].i), rt, flags, SPO_REGION); (yyval.i) = (irr || (flags & 1) || rt != OROOM); break_stmt_start(); } +#line 4413 "y.tab.c" /* yacc.c:1646 */ break; case 270: - -/* Line 1455 of yacc.c */ -#line 1793 "lev_comp.y" +#line 1795 "lev_comp.y" /* yacc.c:1646 */ { break_stmt_end(splev); - if ( (yyvsp[(9) - (10)].i) ) { + if ( (yyvsp[-1].i) ) { add_opcode(splev, SPO_ENDROOM, NULL); - } else if ( (yyvsp[(10) - (10)].i) ) + } else if ( (yyvsp[0].i) ) lc_error("Cannot use lev statements in non-permanent REGION"); } +#line 4425 "y.tab.c" /* yacc.c:1646 */ break; case 271: - -/* Line 1455 of yacc.c */ -#line 1803 "lev_comp.y" +#line 1805 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = 0; } +#line 4433 "y.tab.c" /* yacc.c:1646 */ break; case 272: - -/* Line 1455 of yacc.c */ -#line 1807 "lev_comp.y" +#line 1809 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(1) - (1)].i); + (yyval.i) = (yyvsp[0].i); } +#line 4441 "y.tab.c" /* yacc.c:1646 */ break; case 273: - -/* Line 1455 of yacc.c */ -#line 1813 "lev_comp.y" +#line 1815 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "iio", (long)(yyvsp[(7) - (7)].i), (long)(yyvsp[(5) - (7)].i), SPO_ALTAR); + add_opvars(splev, "iio", (long)(yyvsp[0].i), (long)(yyvsp[-2].i), SPO_ALTAR); } +#line 4449 "y.tab.c" /* yacc.c:1646 */ break; case 274: - -/* Line 1455 of yacc.c */ -#line 1819 "lev_comp.y" +#line 1821 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", 2, SPO_GRAVE); } +#line 4457 "y.tab.c" /* yacc.c:1646 */ break; case 275: - -/* Line 1455 of yacc.c */ -#line 1823 "lev_comp.y" +#line 1825 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "sio", (char *)0, 1, SPO_GRAVE); } +#line 4466 "y.tab.c" /* yacc.c:1646 */ break; case 276: - -/* Line 1455 of yacc.c */ -#line 1828 "lev_comp.y" +#line 1830 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "sio", (char *)0, 0, SPO_GRAVE); } +#line 4475 "y.tab.c" /* yacc.c:1646 */ break; case 277: - -/* Line 1455 of yacc.c */ -#line 1835 "lev_comp.y" +#line 1837 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_GOLD); } +#line 4483 "y.tab.c" /* yacc.c:1646 */ break; case 278: - -/* Line 1455 of yacc.c */ -#line 1841 "lev_comp.y" +#line 1843 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", - (long)(yyvsp[(5) - (7)].i), SPO_ENGRAVING); + (long)(yyvsp[-2].i), SPO_ENGRAVING); } +#line 4492 "y.tab.c" /* yacc.c:1646 */ break; case 279: - -/* Line 1455 of yacc.c */ -#line 1848 "lev_comp.y" +#line 1850 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_MINERALIZE); } +#line 4500 "y.tab.c" /* yacc.c:1646 */ break; case 280: - -/* Line 1455 of yacc.c */ -#line 1852 "lev_comp.y" +#line 1854 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "iiiio", -1L, -1L, -1L, -1L, SPO_MINERALIZE); } +#line 4508 "y.tab.c" /* yacc.c:1646 */ break; case 281: - -/* Line 1455 of yacc.c */ -#line 1858 "lev_comp.y" +#line 1860 "lev_comp.y" /* yacc.c:1646 */ { - int token = get_trap_type((yyvsp[(1) - (1)].map)); + int token = get_trap_type((yyvsp[0].map)); if (token == ERR) - lc_error("Unknown trap type '%s'!", (yyvsp[(1) - (1)].map)); + lc_error("Unknown trap type '%s'!", (yyvsp[0].map)); (yyval.i) = token; - Free((yyvsp[(1) - (1)].map)); + Free((yyvsp[0].map)); } +#line 4520 "y.tab.c" /* yacc.c:1646 */ break; case 283: - -/* Line 1455 of yacc.c */ -#line 1869 "lev_comp.y" +#line 1871 "lev_comp.y" /* yacc.c:1646 */ { - int token = get_room_type((yyvsp[(1) - (1)].map)); + int token = get_room_type((yyvsp[0].map)); if (token == ERR) { - lc_warning("Unknown room type \"%s\"! Making ordinary room...", (yyvsp[(1) - (1)].map)); + lc_warning("Unknown room type \"%s\"! Making ordinary room...", (yyvsp[0].map)); (yyval.i) = OROOM; } else (yyval.i) = token; - Free((yyvsp[(1) - (1)].map)); + Free((yyvsp[0].map)); } +#line 4534 "y.tab.c" /* yacc.c:1646 */ break; case 285: - -/* Line 1455 of yacc.c */ -#line 1882 "lev_comp.y" +#line 1884 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = -1; } +#line 4542 "y.tab.c" /* yacc.c:1646 */ break; case 286: - -/* Line 1455 of yacc.c */ -#line 1886 "lev_comp.y" +#line 1888 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(2) - (2)].i); + (yyval.i) = (yyvsp[0].i); } +#line 4550 "y.tab.c" /* yacc.c:1646 */ break; case 287: - -/* Line 1455 of yacc.c */ -#line 1892 "lev_comp.y" +#line 1894 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(1) - (1)].i); + (yyval.i) = (yyvsp[0].i); } +#line 4558 "y.tab.c" /* yacc.c:1646 */ break; case 288: - -/* Line 1455 of yacc.c */ -#line 1896 "lev_comp.y" +#line 1898 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i); + (yyval.i) = (yyvsp[-2].i) | (yyvsp[0].i); } +#line 4566 "y.tab.c" /* yacc.c:1646 */ break; case 289: - -/* Line 1455 of yacc.c */ -#line 1903 "lev_comp.y" +#line 1905 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = ((yyvsp[(1) - (1)].i) << 0); + (yyval.i) = ((yyvsp[0].i) << 0); } +#line 4574 "y.tab.c" /* yacc.c:1646 */ break; case 290: - -/* Line 1455 of yacc.c */ -#line 1907 "lev_comp.y" +#line 1909 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = ((yyvsp[(1) - (1)].i) << 1); + (yyval.i) = ((yyvsp[0].i) << 1); } +#line 4582 "y.tab.c" /* yacc.c:1646 */ break; case 291: - -/* Line 1455 of yacc.c */ -#line 1911 "lev_comp.y" +#line 1913 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = ((yyvsp[(1) - (1)].i) << 2); + (yyval.i) = ((yyvsp[0].i) << 2); } +#line 4590 "y.tab.c" /* yacc.c:1646 */ break; case 298: - -/* Line 1455 of yacc.c */ -#line 1927 "lev_comp.y" +#line 1929 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = - MAX_REGISTERS - 1; } +#line 4598 "y.tab.c" /* yacc.c:1646 */ break; case 301: - -/* Line 1455 of yacc.c */ -#line 1935 "lev_comp.y" +#line 1937 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = - MAX_REGISTERS - 1; } +#line 4606 "y.tab.c" /* yacc.c:1646 */ break; case 304: - -/* Line 1455 of yacc.c */ -#line 1945 "lev_comp.y" +#line 1947 "lev_comp.y" /* yacc.c:1646 */ { - if ( (yyvsp[(3) - (4)].i) >= 3 ) + if ( (yyvsp[-1].i) >= 3 ) lc_error("Register Index overflow!"); else - (yyval.i) = - (yyvsp[(3) - (4)].i) - 1; + (yyval.i) = - (yyvsp[-1].i) - 1; } +#line 4617 "y.tab.c" /* yacc.c:1646 */ break; case 305: - -/* Line 1455 of yacc.c */ -#line 1954 "lev_comp.y" +#line 1956 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "s", (yyvsp[(1) - (1)].map)); - Free((yyvsp[(1) - (1)].map)); + add_opvars(splev, "s", (yyvsp[0].map)); + Free((yyvsp[0].map)); } +#line 4626 "y.tab.c" /* yacc.c:1646 */ break; case 306: - -/* Line 1455 of yacc.c */ -#line 1959 "lev_comp.y" +#line 1961 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_STRING); - vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); - add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); - Free((yyvsp[(1) - (1)].map)); + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_STRING); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", (yyvsp[0].map)); + Free((yyvsp[0].map)); } +#line 4637 "y.tab.c" /* yacc.c:1646 */ break; case 307: - -/* Line 1455 of yacc.c */ -#line 1966 "lev_comp.y" +#line 1968 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_STRING|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); - add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); - Free((yyvsp[(1) - (4)].map)); + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_STRING|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", (yyvsp[-3].map)); + Free((yyvsp[-3].map)); } +#line 4648 "y.tab.c" /* yacc.c:1646 */ break; case 308: - -/* Line 1455 of yacc.c */ -#line 1976 "lev_comp.y" +#line 1978 "lev_comp.y" /* yacc.c:1646 */ { /* nothing */ } +#line 4656 "y.tab.c" /* yacc.c:1646 */ break; case 309: - -/* Line 1455 of yacc.c */ -#line 1982 "lev_comp.y" +#line 1984 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "c", (yyvsp[(1) - (1)].i)); + add_opvars(splev, "c", (yyvsp[0].i)); } +#line 4664 "y.tab.c" /* yacc.c:1646 */ break; case 310: - -/* Line 1455 of yacc.c */ -#line 1986 "lev_comp.y" +#line 1988 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_SEL_RNDCOORD); } +#line 4672 "y.tab.c" /* yacc.c:1646 */ break; case 311: - -/* Line 1455 of yacc.c */ -#line 1990 "lev_comp.y" +#line 1992 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_COORD); - vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); - add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); - Free((yyvsp[(1) - (1)].map)); + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_COORD); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", (yyvsp[0].map)); + Free((yyvsp[0].map)); } +#line 4683 "y.tab.c" /* yacc.c:1646 */ break; case 312: - -/* Line 1455 of yacc.c */ -#line 1997 "lev_comp.y" +#line 1999 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_COORD|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); - add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); - Free((yyvsp[(1) - (4)].map)); + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_COORD|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", (yyvsp[-3].map)); + Free((yyvsp[-3].map)); } +#line 4694 "y.tab.c" /* yacc.c:1646 */ break; case 313: - -/* Line 1455 of yacc.c */ -#line 2006 "lev_comp.y" +#line 2008 "lev_comp.y" /* yacc.c:1646 */ { - if ((yyvsp[(2) - (5)].i) < 0 || (yyvsp[(4) - (5)].i) < 0 || (yyvsp[(2) - (5)].i) >= COLNO || (yyvsp[(4) - (5)].i) >= ROWNO) - lc_error("Coordinates (%li,%li) out of map range!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i)); - (yyval.i) = SP_COORD_PACK((yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].i)); + if ((yyvsp[-3].i) < 0 || (yyvsp[-1].i) < 0 || (yyvsp[-3].i) >= COLNO || (yyvsp[-1].i) >= ROWNO) + lc_error("Coordinates (%li,%li) out of map range!", (yyvsp[-3].i), (yyvsp[-1].i)); + (yyval.i) = SP_COORD_PACK((yyvsp[-3].i), (yyvsp[-1].i)); } +#line 4704 "y.tab.c" /* yacc.c:1646 */ break; case 314: - -/* Line 1455 of yacc.c */ -#line 2012 "lev_comp.y" +#line 2014 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = SP_COORD_PACK_RANDOM(0); } +#line 4712 "y.tab.c" /* yacc.c:1646 */ break; case 315: - -/* Line 1455 of yacc.c */ -#line 2016 "lev_comp.y" +#line 2018 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = SP_COORD_PACK_RANDOM( (yyvsp[(2) - (3)].i) ); + (yyval.i) = SP_COORD_PACK_RANDOM( (yyvsp[-1].i) ); } +#line 4720 "y.tab.c" /* yacc.c:1646 */ break; case 316: - -/* Line 1455 of yacc.c */ -#line 2022 "lev_comp.y" +#line 2024 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.i) = (yyvsp[(1) - (1)].i); + (yyval.i) = (yyvsp[0].i); } +#line 4728 "y.tab.c" /* yacc.c:1646 */ break; case 317: - -/* Line 1455 of yacc.c */ -#line 2026 "lev_comp.y" +#line 2028 "lev_comp.y" /* yacc.c:1646 */ { - if (((yyvsp[(1) - (3)].i) & (yyvsp[(3) - (3)].i))) + if (((yyvsp[-2].i) & (yyvsp[0].i))) lc_warning("Humidity flag used twice."); - (yyval.i) = ((yyvsp[(1) - (3)].i) | (yyvsp[(3) - (3)].i)); + (yyval.i) = ((yyvsp[-2].i) | (yyvsp[0].i)); } +#line 4738 "y.tab.c" /* yacc.c:1646 */ break; case 318: - -/* Line 1455 of yacc.c */ -#line 2034 "lev_comp.y" +#line 2036 "lev_comp.y" /* yacc.c:1646 */ { /* nothing */ } +#line 4746 "y.tab.c" /* yacc.c:1646 */ break; case 319: - -/* Line 1455 of yacc.c */ -#line 2038 "lev_comp.y" +#line 2040 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_REGION); - vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); - add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); - Free((yyvsp[(1) - (1)].map)); + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_REGION); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", (yyvsp[0].map)); + Free((yyvsp[0].map)); } +#line 4757 "y.tab.c" /* yacc.c:1646 */ break; case 320: - -/* Line 1455 of yacc.c */ -#line 2045 "lev_comp.y" +#line 2047 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_REGION|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); - add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); - Free((yyvsp[(1) - (4)].map)); + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_REGION|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", (yyvsp[-3].map)); + Free((yyvsp[-3].map)); } +#line 4768 "y.tab.c" /* yacc.c:1646 */ break; case 321: - -/* Line 1455 of yacc.c */ -#line 2054 "lev_comp.y" +#line 2056 "lev_comp.y" /* yacc.c:1646 */ { - long r = SP_REGION_PACK((yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); - if ( (yyvsp[(2) - (9)].i) > (yyvsp[(6) - (9)].i) || (yyvsp[(4) - (9)].i) > (yyvsp[(8) - (9)].i) ) - lc_error("Region start > end: (%li,%li,%li,%li)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); + long r = SP_REGION_PACK((yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + if ( (yyvsp[-7].i) > (yyvsp[-3].i) || (yyvsp[-5].i) > (yyvsp[-1].i) ) + lc_error("Region start > end: (%li,%li,%li,%li)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); add_opvars(splev, "r", r); (yyval.i) = r; } +#line 4781 "y.tab.c" /* yacc.c:1646 */ break; case 322: - -/* Line 1455 of yacc.c */ -#line 2065 "lev_comp.y" +#line 2067 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "m", (yyvsp[(1) - (1)].i)); + add_opvars(splev, "m", (yyvsp[0].i)); } +#line 4789 "y.tab.c" /* yacc.c:1646 */ break; case 323: - -/* Line 1455 of yacc.c */ -#line 2069 "lev_comp.y" +#line 2071 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_MAPCHAR); - vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); - add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); - Free((yyvsp[(1) - (1)].map)); + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_MAPCHAR); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", (yyvsp[0].map)); + Free((yyvsp[0].map)); } +#line 4800 "y.tab.c" /* yacc.c:1646 */ break; case 324: - -/* Line 1455 of yacc.c */ -#line 2076 "lev_comp.y" +#line 2078 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_MAPCHAR|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); - add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); - Free((yyvsp[(1) - (4)].map)); + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_MAPCHAR|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", (yyvsp[-3].map)); + Free((yyvsp[-3].map)); } +#line 4811 "y.tab.c" /* yacc.c:1646 */ break; case 325: - -/* Line 1455 of yacc.c */ -#line 2085 "lev_comp.y" +#line 2087 "lev_comp.y" /* yacc.c:1646 */ { - if (what_map_char((char) (yyvsp[(1) - (1)].i)) != INVALID_TYPE) - (yyval.i) = SP_MAPCHAR_PACK(what_map_char((char) (yyvsp[(1) - (1)].i)), -2); + if (what_map_char((char) (yyvsp[0].i)) != INVALID_TYPE) + (yyval.i) = SP_MAPCHAR_PACK(what_map_char((char) (yyvsp[0].i)), -2); else { - lc_error("Unknown map char type '%c'!", (yyvsp[(1) - (1)].i)); + lc_error("Unknown map char type '%c'!", (yyvsp[0].i)); (yyval.i) = SP_MAPCHAR_PACK(STONE, -2); } } +#line 4824 "y.tab.c" /* yacc.c:1646 */ break; case 326: - -/* Line 1455 of yacc.c */ -#line 2094 "lev_comp.y" +#line 2096 "lev_comp.y" /* yacc.c:1646 */ { - if (what_map_char((char) (yyvsp[(2) - (5)].i)) != INVALID_TYPE) - (yyval.i) = SP_MAPCHAR_PACK(what_map_char((char) (yyvsp[(2) - (5)].i)), (yyvsp[(4) - (5)].i)); + if (what_map_char((char) (yyvsp[-3].i)) != INVALID_TYPE) + (yyval.i) = SP_MAPCHAR_PACK(what_map_char((char) (yyvsp[-3].i)), (yyvsp[-1].i)); else { - lc_error("Unknown map char type '%c'!", (yyvsp[(2) - (5)].i)); - (yyval.i) = SP_MAPCHAR_PACK(STONE, (yyvsp[(4) - (5)].i)); + lc_error("Unknown map char type '%c'!", (yyvsp[-3].i)); + (yyval.i) = SP_MAPCHAR_PACK(STONE, (yyvsp[-1].i)); } } +#line 4837 "y.tab.c" /* yacc.c:1646 */ break; case 327: - -/* Line 1455 of yacc.c */ -#line 2105 "lev_comp.y" +#line 2107 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "M", (yyvsp[(1) - (1)].i)); + add_opvars(splev, "M", (yyvsp[0].i)); } +#line 4845 "y.tab.c" /* yacc.c:1646 */ break; case 328: - -/* Line 1455 of yacc.c */ -#line 2109 "lev_comp.y" +#line 2111 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_MONST); - vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); - add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); - Free((yyvsp[(1) - (1)].map)); + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_MONST); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", (yyvsp[0].map)); + Free((yyvsp[0].map)); } +#line 4856 "y.tab.c" /* yacc.c:1646 */ break; case 329: - -/* Line 1455 of yacc.c */ -#line 2116 "lev_comp.y" +#line 2118 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_MONST|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); - add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); - Free((yyvsp[(1) - (4)].map)); + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_MONST|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", (yyvsp[-3].map)); + Free((yyvsp[-3].map)); } +#line 4867 "y.tab.c" /* yacc.c:1646 */ break; case 330: - -/* Line 1455 of yacc.c */ -#line 2125 "lev_comp.y" +#line 2127 "lev_comp.y" /* yacc.c:1646 */ { - long m = get_monster_id((yyvsp[(1) - (1)].map), (char)0); + long m = get_monster_id((yyvsp[0].map), (char)0); if (m == ERR) { - lc_error("Unknown monster \"%s\"!", (yyvsp[(1) - (1)].map)); + lc_error("Unknown monster \"%s\"!", (yyvsp[0].map)); (yyval.i) = -1; } else (yyval.i) = SP_MONST_PACK(m, def_monsyms[(int)mons[m].mlet].sym); } +#line 4880 "y.tab.c" /* yacc.c:1646 */ break; case 331: - -/* Line 1455 of yacc.c */ -#line 2134 "lev_comp.y" +#line 2136 "lev_comp.y" /* yacc.c:1646 */ { - if (check_monster_char((char) (yyvsp[(1) - (1)].i))) - (yyval.i) = SP_MONST_PACK(-1, (yyvsp[(1) - (1)].i)); + if (check_monster_char((char) (yyvsp[0].i))) + (yyval.i) = SP_MONST_PACK(-1, (yyvsp[0].i)); else { - lc_error("Unknown monster class '%c'!", (yyvsp[(1) - (1)].i)); + lc_error("Unknown monster class '%c'!", (yyvsp[0].i)); (yyval.i) = -1; } } +#line 4893 "y.tab.c" /* yacc.c:1646 */ break; case 332: - -/* Line 1455 of yacc.c */ -#line 2143 "lev_comp.y" +#line 2145 "lev_comp.y" /* yacc.c:1646 */ { - long m = get_monster_id((yyvsp[(4) - (5)].map), (char) (yyvsp[(2) - (5)].i)); + long m = get_monster_id((yyvsp[-1].map), (char) (yyvsp[-3].i)); if (m == ERR) { - lc_error("Unknown monster ('%c', \"%s\")!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].map)); + lc_error("Unknown monster ('%c', \"%s\")!", (yyvsp[-3].i), (yyvsp[-1].map)); (yyval.i) = -1; } else - (yyval.i) = SP_MONST_PACK(m, (yyvsp[(2) - (5)].i)); + (yyval.i) = SP_MONST_PACK(m, (yyvsp[-3].i)); } +#line 4906 "y.tab.c" /* yacc.c:1646 */ break; case 333: - -/* Line 1455 of yacc.c */ -#line 2152 "lev_comp.y" +#line 2154 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = -1; } +#line 4914 "y.tab.c" /* yacc.c:1646 */ break; case 334: - -/* Line 1455 of yacc.c */ -#line 2158 "lev_comp.y" +#line 2160 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "O", (yyvsp[(1) - (1)].i)); + add_opvars(splev, "O", (yyvsp[0].i)); } +#line 4922 "y.tab.c" /* yacc.c:1646 */ break; case 335: - -/* Line 1455 of yacc.c */ -#line 2162 "lev_comp.y" +#line 2164 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_OBJ); - vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); - add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); - Free((yyvsp[(1) - (1)].map)); + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_OBJ); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", (yyvsp[0].map)); + Free((yyvsp[0].map)); } +#line 4933 "y.tab.c" /* yacc.c:1646 */ break; case 336: - -/* Line 1455 of yacc.c */ -#line 2169 "lev_comp.y" +#line 2171 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_OBJ|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); - add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); - Free((yyvsp[(1) - (4)].map)); + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_OBJ|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", (yyvsp[-3].map)); + Free((yyvsp[-3].map)); } +#line 4944 "y.tab.c" /* yacc.c:1646 */ break; case 337: - -/* Line 1455 of yacc.c */ -#line 2178 "lev_comp.y" +#line 2180 "lev_comp.y" /* yacc.c:1646 */ { - long m = get_object_id((yyvsp[(1) - (1)].map), (char)0); + long m = get_object_id((yyvsp[0].map), (char)0); if (m == ERR) { - lc_error("Unknown object \"%s\"!", (yyvsp[(1) - (1)].map)); + lc_error("Unknown object \"%s\"!", (yyvsp[0].map)); (yyval.i) = -1; } else (yyval.i) = SP_OBJ_PACK(m, 1); /* obj class != 0 to force generation of a specific item */ } +#line 4958 "y.tab.c" /* yacc.c:1646 */ break; case 338: - -/* Line 1455 of yacc.c */ -#line 2188 "lev_comp.y" +#line 2190 "lev_comp.y" /* yacc.c:1646 */ { - if (check_object_char((char) (yyvsp[(1) - (1)].i))) - (yyval.i) = SP_OBJ_PACK(-1, (yyvsp[(1) - (1)].i)); + if (check_object_char((char) (yyvsp[0].i))) + (yyval.i) = SP_OBJ_PACK(-1, (yyvsp[0].i)); else { - lc_error("Unknown object class '%c'!", (yyvsp[(1) - (1)].i)); + lc_error("Unknown object class '%c'!", (yyvsp[0].i)); (yyval.i) = -1; } } +#line 4971 "y.tab.c" /* yacc.c:1646 */ break; case 339: - -/* Line 1455 of yacc.c */ -#line 2197 "lev_comp.y" +#line 2199 "lev_comp.y" /* yacc.c:1646 */ { - long m = get_object_id((yyvsp[(4) - (5)].map), (char) (yyvsp[(2) - (5)].i)); + long m = get_object_id((yyvsp[-1].map), (char) (yyvsp[-3].i)); if (m == ERR) { - lc_error("Unknown object ('%c', \"%s\")!", (yyvsp[(2) - (5)].i), (yyvsp[(4) - (5)].map)); + lc_error("Unknown object ('%c', \"%s\")!", (yyvsp[-3].i), (yyvsp[-1].map)); (yyval.i) = -1; } else - (yyval.i) = SP_OBJ_PACK(m, (yyvsp[(2) - (5)].i)); + (yyval.i) = SP_OBJ_PACK(m, (yyvsp[-3].i)); } +#line 4984 "y.tab.c" /* yacc.c:1646 */ break; case 340: - -/* Line 1455 of yacc.c */ -#line 2206 "lev_comp.y" +#line 2208 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = -1; } +#line 4992 "y.tab.c" /* yacc.c:1646 */ break; case 341: - -/* Line 1455 of yacc.c */ -#line 2212 "lev_comp.y" +#line 2214 "lev_comp.y" /* yacc.c:1646 */ { } +#line 4998 "y.tab.c" /* yacc.c:1646 */ break; case 342: - -/* Line 1455 of yacc.c */ -#line 2214 "lev_comp.y" +#line 2216 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_MATH_ADD); } +#line 5006 "y.tab.c" /* yacc.c:1646 */ break; case 343: - -/* Line 1455 of yacc.c */ -#line 2219 "lev_comp.y" - { add_opvars(splev, "i", (yyvsp[(1) - (1)].i) ); } +#line 2221 "lev_comp.y" /* yacc.c:1646 */ + { add_opvars(splev, "i", (yyvsp[0].i) ); } +#line 5012 "y.tab.c" /* yacc.c:1646 */ break; case 344: - -/* Line 1455 of yacc.c */ -#line 2220 "lev_comp.y" +#line 2222 "lev_comp.y" /* yacc.c:1646 */ { is_inconstant_number = 1; } +#line 5018 "y.tab.c" /* yacc.c:1646 */ break; case 345: - -/* Line 1455 of yacc.c */ -#line 2221 "lev_comp.y" - { add_opvars(splev, "i", (yyvsp[(2) - (3)].i) ); } +#line 2223 "lev_comp.y" /* yacc.c:1646 */ + { add_opvars(splev, "i", (yyvsp[-1].i) ); } +#line 5024 "y.tab.c" /* yacc.c:1646 */ break; case 346: - -/* Line 1455 of yacc.c */ -#line 2223 "lev_comp.y" +#line 2225 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_INT); - vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); - add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); - Free((yyvsp[(1) - (1)].map)); + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_INT); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", (yyvsp[0].map)); + Free((yyvsp[0].map)); is_inconstant_number = 1; } +#line 5036 "y.tab.c" /* yacc.c:1646 */ break; case 347: - -/* Line 1455 of yacc.c */ -#line 2231 "lev_comp.y" +#line 2233 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (4)].map), SPOVAR_INT|SPOVAR_ARRAY); - vardef_used(variable_definitions, (yyvsp[(1) - (4)].map)); - add_opvars(splev, "v", (yyvsp[(1) - (4)].map)); - Free((yyvsp[(1) - (4)].map)); + check_vardef_type(variable_definitions, (yyvsp[-3].map), SPOVAR_INT|SPOVAR_ARRAY); + vardef_used(variable_definitions, (yyvsp[-3].map)); + add_opvars(splev, "v", (yyvsp[-3].map)); + Free((yyvsp[-3].map)); is_inconstant_number = 1; } +#line 5048 "y.tab.c" /* yacc.c:1646 */ break; case 348: - -/* Line 1455 of yacc.c */ -#line 2238 "lev_comp.y" +#line 2240 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_MATH_ADD); } +#line 5054 "y.tab.c" /* yacc.c:1646 */ break; case 349: - -/* Line 1455 of yacc.c */ -#line 2239 "lev_comp.y" +#line 2241 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_MATH_SUB); } +#line 5060 "y.tab.c" /* yacc.c:1646 */ break; case 350: - -/* Line 1455 of yacc.c */ -#line 2240 "lev_comp.y" +#line 2242 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_MATH_MUL); } +#line 5066 "y.tab.c" /* yacc.c:1646 */ break; case 351: - -/* Line 1455 of yacc.c */ -#line 2241 "lev_comp.y" +#line 2243 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_MATH_DIV); } +#line 5072 "y.tab.c" /* yacc.c:1646 */ break; case 352: - -/* Line 1455 of yacc.c */ -#line 2242 "lev_comp.y" +#line 2244 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_MATH_MOD); } +#line 5078 "y.tab.c" /* yacc.c:1646 */ break; case 353: - -/* Line 1455 of yacc.c */ -#line 2243 "lev_comp.y" +#line 2245 "lev_comp.y" /* yacc.c:1646 */ { } +#line 5084 "y.tab.c" /* yacc.c:1646 */ break; case 354: - -/* Line 1455 of yacc.c */ -#line 2247 "lev_comp.y" +#line 2249 "lev_comp.y" /* yacc.c:1646 */ { - if (!strcmp("int", (yyvsp[(1) - (1)].map)) || !strcmp("integer", (yyvsp[(1) - (1)].map))) { + if (!strcmp("int", (yyvsp[0].map)) || !strcmp("integer", (yyvsp[0].map))) { (yyval.i) = (int)'i'; - } else lc_error("Unknown function parameter type '%s'", (yyvsp[(1) - (1)].map)); + } else lc_error("Unknown function parameter type '%s'", (yyvsp[0].map)); } +#line 5094 "y.tab.c" /* yacc.c:1646 */ break; case 355: - -/* Line 1455 of yacc.c */ -#line 2253 "lev_comp.y" +#line 2255 "lev_comp.y" /* yacc.c:1646 */ { - if (!strcmp("str", (yyvsp[(1) - (1)].map)) || !strcmp("string", (yyvsp[(1) - (1)].map))) { + if (!strcmp("str", (yyvsp[0].map)) || !strcmp("string", (yyvsp[0].map))) { (yyval.i) = (int)'s'; - } else lc_error("Unknown function parameter type '%s'", (yyvsp[(1) - (1)].map)); + } else lc_error("Unknown function parameter type '%s'", (yyvsp[0].map)); } +#line 5104 "y.tab.c" /* yacc.c:1646 */ break; case 356: - -/* Line 1455 of yacc.c */ -#line 2261 "lev_comp.y" +#line 2263 "lev_comp.y" /* yacc.c:1646 */ { struct lc_funcdefs_parm *tmp = New(struct lc_funcdefs_parm); @@ -5660,8 +5113,8 @@ yyreduce: else if (!tmp) lc_error("Could not alloc function params."); else { - tmp->name = strdup((yyvsp[(1) - (3)].map)); - tmp->parmtype = (char) (yyvsp[(3) - (3)].i); + tmp->name = strdup((yyvsp[-2].map)); + tmp->parmtype = (char) (yyvsp[0].i); tmp->next = curr_function->params; curr_function->params = tmp; curr_function->n_params++; @@ -5672,373 +5125,348 @@ yyreduce: case 's': vt = SPOVAR_STRING; break; default: lc_error("Unknown func param conversion."); break; } - variable_definitions = add_vardef_type(variable_definitions, (yyvsp[(1) - (3)].map), vt); + variable_definitions = add_vardef_type(variable_definitions, (yyvsp[-2].map), vt); } } - Free((yyvsp[(1) - (3)].map)); + Free((yyvsp[-2].map)); } +#line 5134 "y.tab.c" /* yacc.c:1646 */ break; case 361: - -/* Line 1455 of yacc.c */ -#line 2298 "lev_comp.y" +#line 2300 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = (int)'i'; } +#line 5142 "y.tab.c" /* yacc.c:1646 */ break; case 362: - -/* Line 1455 of yacc.c */ -#line 2302 "lev_comp.y" +#line 2304 "lev_comp.y" /* yacc.c:1646 */ { (yyval.i) = (int)'s'; } +#line 5150 "y.tab.c" /* yacc.c:1646 */ break; case 363: - -/* Line 1455 of yacc.c */ -#line 2309 "lev_comp.y" +#line 2311 "lev_comp.y" /* yacc.c:1646 */ { char tmpbuf[2]; - tmpbuf[0] = (char) (yyvsp[(1) - (1)].i); + tmpbuf[0] = (char) (yyvsp[0].i); tmpbuf[1] = '\0'; (yyval.map) = strdup(tmpbuf); } +#line 5161 "y.tab.c" /* yacc.c:1646 */ break; case 364: - -/* Line 1455 of yacc.c */ -#line 2316 "lev_comp.y" +#line 2318 "lev_comp.y" /* yacc.c:1646 */ { - long len = strlen( (yyvsp[(1) - (3)].map) ); + long len = strlen( (yyvsp[-2].map) ); char *tmp = (char *)alloc(len + 2); - sprintf(tmp, "%c%s", (char) (yyvsp[(3) - (3)].i), (yyvsp[(1) - (3)].map) ); - Free( (yyvsp[(1) - (3)].map) ); + sprintf(tmp, "%c%s", (char) (yyvsp[0].i), (yyvsp[-2].map) ); + Free( (yyvsp[-2].map) ); (yyval.map) = tmp; } +#line 5173 "y.tab.c" /* yacc.c:1646 */ break; case 365: - -/* Line 1455 of yacc.c */ -#line 2326 "lev_comp.y" +#line 2328 "lev_comp.y" /* yacc.c:1646 */ { (yyval.map) = strdup(""); } +#line 5181 "y.tab.c" /* yacc.c:1646 */ break; case 366: - -/* Line 1455 of yacc.c */ -#line 2330 "lev_comp.y" +#line 2332 "lev_comp.y" /* yacc.c:1646 */ { - char *tmp = strdup( (yyvsp[(1) - (1)].map) ); - Free( (yyvsp[(1) - (1)].map) ); + char *tmp = strdup( (yyvsp[0].map) ); + Free( (yyvsp[0].map) ); (yyval.map) = tmp; } +#line 5191 "y.tab.c" /* yacc.c:1646 */ break; case 367: - -/* Line 1455 of yacc.c */ -#line 2338 "lev_comp.y" +#line 2340 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_SEL_POINT); } +#line 5199 "y.tab.c" /* yacc.c:1646 */ break; case 368: - -/* Line 1455 of yacc.c */ -#line 2342 "lev_comp.y" +#line 2344 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_SEL_RECT); } +#line 5207 "y.tab.c" /* yacc.c:1646 */ break; case 369: - -/* Line 1455 of yacc.c */ -#line 2346 "lev_comp.y" +#line 2348 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_SEL_FILLRECT); } +#line 5215 "y.tab.c" /* yacc.c:1646 */ break; case 370: - -/* Line 1455 of yacc.c */ -#line 2350 "lev_comp.y" +#line 2352 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_SEL_LINE); } +#line 5223 "y.tab.c" /* yacc.c:1646 */ break; case 371: - -/* Line 1455 of yacc.c */ -#line 2354 "lev_comp.y" +#line 2356 "lev_comp.y" /* yacc.c:1646 */ { /* randline (x1,y1),(x2,y2), roughness */ add_opvars(splev, "o", SPO_SEL_RNDLINE); } +#line 5232 "y.tab.c" /* yacc.c:1646 */ break; case 372: - -/* Line 1455 of yacc.c */ -#line 2359 "lev_comp.y" +#line 2361 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", W_ANY, SPO_SEL_GROW); } +#line 5240 "y.tab.c" /* yacc.c:1646 */ break; case 373: - -/* Line 1455 of yacc.c */ -#line 2363 "lev_comp.y" +#line 2365 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "io", (yyvsp[(3) - (6)].i), SPO_SEL_GROW); + add_opvars(splev, "io", (yyvsp[-3].i), SPO_SEL_GROW); } +#line 5248 "y.tab.c" /* yacc.c:1646 */ break; case 374: - -/* Line 1455 of yacc.c */ -#line 2367 "lev_comp.y" +#line 2369 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "iio", (yyvsp[(3) - (6)].i), SPOFILTER_PERCENT, SPO_SEL_FILTER); + add_opvars(splev, "iio", (yyvsp[-3].i), SPOFILTER_PERCENT, SPO_SEL_FILTER); } +#line 5256 "y.tab.c" /* yacc.c:1646 */ break; case 375: - -/* Line 1455 of yacc.c */ -#line 2371 "lev_comp.y" +#line 2373 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", SPOFILTER_SELECTION, SPO_SEL_FILTER); } +#line 5264 "y.tab.c" /* yacc.c:1646 */ break; case 376: - -/* Line 1455 of yacc.c */ -#line 2375 "lev_comp.y" +#line 2377 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", SPOFILTER_MAPCHAR, SPO_SEL_FILTER); } +#line 5272 "y.tab.c" /* yacc.c:1646 */ break; case 377: - -/* Line 1455 of yacc.c */ -#line 2379 "lev_comp.y" +#line 2381 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_SEL_FLOOD); } +#line 5280 "y.tab.c" /* yacc.c:1646 */ break; case 378: - -/* Line 1455 of yacc.c */ -#line 2383 "lev_comp.y" +#line 2385 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "oio", SPO_COPY, 1, SPO_SEL_ELLIPSE); } +#line 5288 "y.tab.c" /* yacc.c:1646 */ break; case 379: - -/* Line 1455 of yacc.c */ -#line 2387 "lev_comp.y" +#line 2389 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "oio", SPO_COPY, (yyvsp[(7) - (8)].i), SPO_SEL_ELLIPSE); + add_opvars(splev, "oio", SPO_COPY, (yyvsp[-1].i), SPO_SEL_ELLIPSE); } +#line 5296 "y.tab.c" /* yacc.c:1646 */ break; case 380: - -/* Line 1455 of yacc.c */ -#line 2391 "lev_comp.y" +#line 2393 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "io", 1, SPO_SEL_ELLIPSE); } +#line 5304 "y.tab.c" /* yacc.c:1646 */ break; case 381: - -/* Line 1455 of yacc.c */ -#line 2395 "lev_comp.y" +#line 2397 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "io", (yyvsp[(9) - (10)].i), SPO_SEL_ELLIPSE); + add_opvars(splev, "io", (yyvsp[-1].i), SPO_SEL_ELLIPSE); } +#line 5312 "y.tab.c" /* yacc.c:1646 */ break; case 382: - -/* Line 1455 of yacc.c */ -#line 2399 "lev_comp.y" +#line 2401 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "iio", (yyvsp[(9) - (14)].i), (yyvsp[(3) - (14)].i), SPO_SEL_GRADIENT); + add_opvars(splev, "iio", (yyvsp[-5].i), (yyvsp[-11].i), SPO_SEL_GRADIENT); } +#line 5320 "y.tab.c" /* yacc.c:1646 */ break; case 383: - -/* Line 1455 of yacc.c */ -#line 2403 "lev_comp.y" +#line 2405 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_SEL_COMPLEMENT); } +#line 5328 "y.tab.c" /* yacc.c:1646 */ break; case 384: - -/* Line 1455 of yacc.c */ -#line 2407 "lev_comp.y" +#line 2409 "lev_comp.y" /* yacc.c:1646 */ { - check_vardef_type(variable_definitions, (yyvsp[(1) - (1)].map), SPOVAR_SEL); - vardef_used(variable_definitions, (yyvsp[(1) - (1)].map)); - add_opvars(splev, "v", (yyvsp[(1) - (1)].map)); - Free((yyvsp[(1) - (1)].map)); + check_vardef_type(variable_definitions, (yyvsp[0].map), SPOVAR_SEL); + vardef_used(variable_definitions, (yyvsp[0].map)); + add_opvars(splev, "v", (yyvsp[0].map)); + Free((yyvsp[0].map)); } +#line 5339 "y.tab.c" /* yacc.c:1646 */ break; case 385: - -/* Line 1455 of yacc.c */ -#line 2414 "lev_comp.y" +#line 2416 "lev_comp.y" /* yacc.c:1646 */ { /* nothing */ } +#line 5347 "y.tab.c" /* yacc.c:1646 */ break; case 386: - -/* Line 1455 of yacc.c */ -#line 2420 "lev_comp.y" +#line 2422 "lev_comp.y" /* yacc.c:1646 */ { /* nothing */ } +#line 5355 "y.tab.c" /* yacc.c:1646 */ break; case 387: - -/* Line 1455 of yacc.c */ -#line 2424 "lev_comp.y" +#line 2426 "lev_comp.y" /* yacc.c:1646 */ { add_opvars(splev, "o", SPO_SEL_ADD); } +#line 5363 "y.tab.c" /* yacc.c:1646 */ break; case 388: - -/* Line 1455 of yacc.c */ -#line 2430 "lev_comp.y" +#line 2432 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "iio", (yyvsp[(1) - (1)].dice).num, (yyvsp[(1) - (1)].dice).die, SPO_DICE); + add_opvars(splev, "iio", (yyvsp[0].dice).num, (yyvsp[0].dice).die, SPO_DICE); } +#line 5371 "y.tab.c" /* yacc.c:1646 */ break; case 392: - -/* Line 1455 of yacc.c */ -#line 2441 "lev_comp.y" +#line 2443 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "i", (yyvsp[(1) - (1)].i) ); + add_opvars(splev, "i", (yyvsp[0].i) ); } +#line 5379 "y.tab.c" /* yacc.c:1646 */ break; case 393: - -/* Line 1455 of yacc.c */ -#line 2445 "lev_comp.y" +#line 2447 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "i", (yyvsp[(1) - (1)].i) ); + add_opvars(splev, "i", (yyvsp[0].i) ); } +#line 5387 "y.tab.c" /* yacc.c:1646 */ break; case 394: - -/* Line 1455 of yacc.c */ -#line 2449 "lev_comp.y" +#line 2451 "lev_comp.y" /* yacc.c:1646 */ { - add_opvars(splev, "i", (yyvsp[(1) - (1)].i) ); + add_opvars(splev, "i", (yyvsp[0].i) ); } +#line 5395 "y.tab.c" /* yacc.c:1646 */ break; case 395: - -/* Line 1455 of yacc.c */ -#line 2453 "lev_comp.y" +#line 2455 "lev_comp.y" /* yacc.c:1646 */ { /* nothing */ } +#line 5403 "y.tab.c" /* yacc.c:1646 */ break; case 404: - -/* Line 1455 of yacc.c */ -#line 2475 "lev_comp.y" +#line 2477 "lev_comp.y" /* yacc.c:1646 */ { - (yyval.lregn) = (yyvsp[(1) - (1)].lregn); + (yyval.lregn) = (yyvsp[0].lregn); } +#line 5411 "y.tab.c" /* yacc.c:1646 */ break; case 405: - -/* Line 1455 of yacc.c */ -#line 2479 "lev_comp.y" +#line 2481 "lev_comp.y" /* yacc.c:1646 */ { - if ((yyvsp[(3) - (10)].i) <= 0 || (yyvsp[(3) - (10)].i) >= COLNO) - lc_error("Region (%li,%li,%li,%li) out of level range (x1)!", (yyvsp[(3) - (10)].i), (yyvsp[(5) - (10)].i), (yyvsp[(7) - (10)].i), (yyvsp[(9) - (10)].i)); - else if ((yyvsp[(5) - (10)].i) < 0 || (yyvsp[(5) - (10)].i) >= ROWNO) - lc_error("Region (%li,%li,%li,%li) out of level range (y1)!", (yyvsp[(3) - (10)].i), (yyvsp[(5) - (10)].i), (yyvsp[(7) - (10)].i), (yyvsp[(9) - (10)].i)); - else if ((yyvsp[(7) - (10)].i) <= 0 || (yyvsp[(7) - (10)].i) >= COLNO) - lc_error("Region (%li,%li,%li,%li) out of level range (x2)!", (yyvsp[(3) - (10)].i), (yyvsp[(5) - (10)].i), (yyvsp[(7) - (10)].i), (yyvsp[(9) - (10)].i)); - else if ((yyvsp[(9) - (10)].i) < 0 || (yyvsp[(9) - (10)].i) >= ROWNO) - lc_error("Region (%li,%li,%li,%li) out of level range (y2)!", (yyvsp[(3) - (10)].i), (yyvsp[(5) - (10)].i), (yyvsp[(7) - (10)].i), (yyvsp[(9) - (10)].i)); - (yyval.lregn).x1 = (yyvsp[(3) - (10)].i); - (yyval.lregn).y1 = (yyvsp[(5) - (10)].i); - (yyval.lregn).x2 = (yyvsp[(7) - (10)].i); - (yyval.lregn).y2 = (yyvsp[(9) - (10)].i); + if ((yyvsp[-7].i) <= 0 || (yyvsp[-7].i) >= COLNO) + lc_error("Region (%li,%li,%li,%li) out of level range (x1)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-5].i) < 0 || (yyvsp[-5].i) >= ROWNO) + lc_error("Region (%li,%li,%li,%li) out of level range (y1)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-3].i) <= 0 || (yyvsp[-3].i) >= COLNO) + lc_error("Region (%li,%li,%li,%li) out of level range (x2)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-1].i) < 0 || (yyvsp[-1].i) >= ROWNO) + lc_error("Region (%li,%li,%li,%li) out of level range (y2)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + (yyval.lregn).x1 = (yyvsp[-7].i); + (yyval.lregn).y1 = (yyvsp[-5].i); + (yyval.lregn).x2 = (yyvsp[-3].i); + (yyval.lregn).y2 = (yyvsp[-1].i); (yyval.lregn).area = 1; } +#line 5431 "y.tab.c" /* yacc.c:1646 */ break; case 406: - -/* Line 1455 of yacc.c */ -#line 2497 "lev_comp.y" +#line 2499 "lev_comp.y" /* yacc.c:1646 */ { /* This series of if statements is a hack for MSC 5.1. It seems that its tiny little brain cannot compile if these are all one big if statement. */ - if ((yyvsp[(2) - (9)].i) < 0 || (yyvsp[(2) - (9)].i) > (int)max_x_map) - lc_error("Region (%li,%li,%li,%li) out of map range (x1)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); - else if ((yyvsp[(4) - (9)].i) < 0 || (yyvsp[(4) - (9)].i) > (int)max_y_map) - lc_error("Region (%li,%li,%li,%li) out of map range (y1)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); - else if ((yyvsp[(6) - (9)].i) < 0 || (yyvsp[(6) - (9)].i) > (int)max_x_map) - lc_error("Region (%li,%li,%li,%li) out of map range (x2)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); - else if ((yyvsp[(8) - (9)].i) < 0 || (yyvsp[(8) - (9)].i) > (int)max_y_map) - lc_error("Region (%li,%li,%li,%li) out of map range (y2)!", (yyvsp[(2) - (9)].i), (yyvsp[(4) - (9)].i), (yyvsp[(6) - (9)].i), (yyvsp[(8) - (9)].i)); + if ((yyvsp[-7].i) < 0 || (yyvsp[-7].i) > (int)max_x_map) + lc_error("Region (%li,%li,%li,%li) out of map range (x1)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-5].i) < 0 || (yyvsp[-5].i) > (int)max_y_map) + lc_error("Region (%li,%li,%li,%li) out of map range (y1)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-3].i) < 0 || (yyvsp[-3].i) > (int)max_x_map) + lc_error("Region (%li,%li,%li,%li) out of map range (x2)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); + else if ((yyvsp[-1].i) < 0 || (yyvsp[-1].i) > (int)max_y_map) + lc_error("Region (%li,%li,%li,%li) out of map range (y2)!", (yyvsp[-7].i), (yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].i)); (yyval.lregn).area = 0; - (yyval.lregn).x1 = (yyvsp[(2) - (9)].i); - (yyval.lregn).y1 = (yyvsp[(4) - (9)].i); - (yyval.lregn).x2 = (yyvsp[(6) - (9)].i); - (yyval.lregn).y2 = (yyvsp[(8) - (9)].i); + (yyval.lregn).x1 = (yyvsp[-7].i); + (yyval.lregn).y1 = (yyvsp[-5].i); + (yyval.lregn).x2 = (yyvsp[-3].i); + (yyval.lregn).y2 = (yyvsp[-1].i); } +#line 5453 "y.tab.c" /* yacc.c:1646 */ break; - -/* Line 1455 of yacc.c */ -#line 6040 "y.tab.c" +#line 5457 "y.tab.c" /* yacc.c:1646 */ default: break; } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -6047,7 +5475,7 @@ yyreduce: *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -6062,10 +5490,14 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -6073,37 +5505,36 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) { - 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; - } + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; } +# undef YYSYNTAX_ERROR #endif } @@ -6112,20 +5543,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -6144,7 +5575,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -6157,35 +5588,37 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + 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; - } - } + if (!yypact_value_is_default (yyn)) + { + 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; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp); + yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ @@ -6209,7 +5642,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -6221,16 +5654,21 @@ yyexhaustedlab: yyreturn: if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + } + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow @@ -6241,15 +5679,9 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - - -/* Line 1675 of yacc.c */ -#line 2517 "lev_comp.y" +#line 2519 "lev_comp.y" /* yacc.c:1906 */ /*lev_comp.y*/ - From 41ac4aef9272d17525c19fe91d118d210ece05ac Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 21 Mar 2015 15:38:31 -0400 Subject: [PATCH 237/354] fix SYSCF so that things build when first defined Things won't build for ports that first define SYSCF. This moves assure_syscf_file() from unixmain.c to files.c and adjusts extern.h to get it out from under #ifdef UNIX. The call to assure_syscf_file() in options.c was only #ifdef SYSCF, SYSCF_FILE and not UNIX, so new ports #defining SYSCF would get an erro. assure_syscf_file() will be utilized by mswin when SYSCF is defined. --- include/extern.h | 8 ++++---- include/ntconf.h | 5 ++++- src/files.c | 25 ++++++++++++++++++++++++- sys/share/pcmain.c | 7 +++++-- sys/unix/unixmain.c | 18 +----------------- 5 files changed, 38 insertions(+), 25 deletions(-) diff --git a/include/extern.h b/include/extern.h index 1ba3e110f..da9bf7eff 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 extern.h $NHDT-Date: 1426496453 2015/03/16 09:00:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.407 $ */ +/* NetHack 3.5 extern.h $NHDT-Date: 1426966688 2015/03/21 19:38:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.411 $ */ /* NetHack 3.5 extern.h $Date: 2013/11/05 00:57:53 $ $Revision: 1.380 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -739,6 +739,9 @@ E void FDECL(free_saved_games, (char**)); #ifdef SELF_RECOVER E boolean NDECL(recover_savefile); #endif +#ifdef SYSCF_FILE +E void NDECL(assure_syscf_file); +#endif #ifdef HOLD_LOCKFILE_OPEN E void NDECL(really_close); #endif @@ -2288,9 +2291,6 @@ E void NDECL(port_help); E void FDECL(sethanguphandler, (void (*)(int))); E boolean NDECL(authorize_wizard_mode); E boolean FDECL(check_user_string, (char *)); -# ifdef SYSCF_FILE -E void NDECL(assure_syscf_file); -# endif #endif /* UNIX */ /* ### unixtty.c ### */ diff --git a/include/ntconf.h b/include/ntconf.h index 95a506635..b51459151 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 ntconf.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 ntconf.h $NHDT-Date: 1426966690 2015/03/21 19:38:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.37 $ */ /* NetHack 3.5 ntconf.h $Date: 2012/01/15 19:11:38 $ $Revision: 1.35 $ */ /* SCCS Id: @(#)ntconf.h 3.5 2002/03/10 */ /* Copyright (c) NetHack PC Development Team 1993, 1994. */ @@ -25,6 +25,9 @@ #define SELF_RECOVER /* Allow the game itself to recover from an aborted game */ +#define SYSCF /* Use a global configuration */ +#define SYSCF_FILE "sysconf" /* Use a file to hold the SYSCF configuration */ + #define USER_SOUNDS #ifdef WIN32CON diff --git a/src/files.c b/src/files.c index a6f17b906..e85a85ae4 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 files.c $NHDT-Date: 1426544796 2015/03/16 22:26:36 $ $NHDT-Branch: master $:$NHDT-Revision: 1.134 $ */ +/* NetHack 3.5 files.c $NHDT-Date: 1426966692 2015/03/21 19:38:12 $ $NHDT-Branch: master $:$NHDT-Revision: 1.135 $ */ /* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3199,6 +3199,29 @@ int ifd, ofd; /* ---------- END INTERNAL RECOVER ----------- */ #endif /*SELF_RECOVER*/ +/* ---------- OTHER ----------- */ + +#ifdef SYSCF +# ifdef SYSCF_FILE +void +assure_syscf_file() { + /* All we really care about is the end result - can we read the file? + * So just check that directly. */ + int fd; + fd = open(SYSCF_FILE, O_RDONLY); + if(fd >= 0){ + /* readable */ + close(fd); + return; + } + raw_printf("Unable to open SYSCF_FILE.\n"); + exit(EXIT_FAILURE); +} + +# endif /* SYSCF_FILE */ +#endif /* SYSCF */ + + #ifdef DEBUG /* used by debugpline() to decide whether to issue a message from a partiular source file; caller passes __FILE__ and we check diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 6635c56ad..67ae57dba 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -1,9 +1,9 @@ -/* NetHack 3.5 pcmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pcmain.c $NHDT-Date: 1426966701 2015/03/21 19:38:21 $ $NHDT-Branch: master $:$NHDT-Revision: 1.51 $ */ /* NetHack 3.5 pcmain.c $Date: 2012/01/20 03:41:31 $ $Revision: 1.48 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ -/* main.c - MSDOS, OS/2, ST, Amiga, and NT NetHack */ +/* main.c - MSDOS, OS/2, ST, Amiga, and Windows NetHack */ #include "hack.h" #include "dlb.h" @@ -244,6 +244,9 @@ char *argv[]; #if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS) chdirx(hackdir,0); +#endif +#ifdef SYSCF + initoptions(); #endif prscore(argc, argv); nethack_exit(EXIT_SUCCESS); diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index c470dc6e0..f7f1ac87e 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 unixmain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 unixmain.c $NHDT-Date: 1426966705 2015/03/21 19:38:25 $ $NHDT-Branch: master $:$NHDT-Revision: 1.44 $ */ /* NetHack 3.5 unixmain.c $Date: 2012/01/27 20:15:31 $ $Revision: 1.42 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -648,20 +648,4 @@ get_unix_pw() return pw; } -#ifdef SYSCF_FILE -void -assure_syscf_file(){ - /* All we really care about is the end result - can we read the file? - * So just check that directly. */ - int fd; - fd = open(SYSCF_FILE, O_RDONLY); - if(fd >= 0){ - /* readable */ - close(fd); - return; - } - raw_printf("Unable to open SYSCF_FILE.\n"); - exit(EXIT_FAILURE); -} -#endif /*unixmain.c*/ From 734d118d39c3fca6b3267e2ade39601c285631db Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 21 Mar 2015 15:50:03 -0400 Subject: [PATCH 238/354] a sys/winnt/Makefile.msc update --- sys/winnt/Makefile.msc | 92 ++++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 43 deletions(-) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 0216092cc..a1dfdbcd8 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -1,4 +1,4 @@ -# NetHack 3.5 Makefile.msc $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +# NetHack 3.5 Makefile.msc $NHDT-Date: 1426967393 2015/03/21 19:49:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.72 $ */ # Copyright (c) NetHack PC Development Team 1993-2015 # #============================================================================== @@ -79,6 +79,13 @@ TARGET_CPU=x86 GAMEDIR = ..\binary # Game directory +# +#--------------------------------------------------------------- +# 4. Do you want debug information in the executable? +# + +DEBUGINFO = Y + # This marks the end of the BUILD DECISIONS section. #============================================================================== # @@ -111,7 +118,7 @@ DOC = ..\doc # NetHack documentation files UTIL = ..\util # Utility source SRC = ..\src # Main source SSYS = ..\sys\share # Shared system files -NTSYS = ..\sys\winnt # NT Win32 specific files +MSWSYS= ..\sys\winnt # mswin specific files TTY = ..\win\tty # window port files (tty) WIN32 = ..\win\win32 # window port files (Win32) WSHR = ..\win\share # Tile support files @@ -144,7 +151,7 @@ TARGET_CPU=x86 # -Zd - generate only public symbols and line numbers for debugging # -GS - enable security checks # -ccommon=-c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -c +ccommon=-c $(CDBFLAG) -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -c lflags=/INCREMENTAL:NO /NOLOGO !IF "$(TARGET_CPU)" == "x86" @@ -201,18 +208,6 @@ guilibs = $(winlibs) RANDOM = $(OBJ)\random.o #RANDOM = -# -# Uncomment the next 2 lines _ONLY_ if you DO NOT want any -# debug capability in the object files, or in the NetHack executable. -# Comment them if you want debug capability. - -#ldebug = -#cdebug = - -# -# Compiler and Linker flags -# - PRECOMPHEAD = N # set to Y if you want to use precomp. headers # @@ -276,10 +271,20 @@ DLBFLG = #========================================== #========================================== -PDBFILE= /PDB:"$(O)$(GAME).PDB" -MAPFILE= /MAP:"$(O)$(GAME).MAP" INCLDIR= /I..\include +!IF "$(DEBUGINFO)" == "Y" +CDBGFLAG=-Zi +LDBGFLAG=/debug +cdebug = -Zi -Od +ldebug = /DEBUG +!ELSE +CDBGFLAG= +LDBGFLAG= +ldebug = +cdebug = +!ENDIF + !IF ("$(ldebug)" != "") !IF ("$(ldebug)" != "/RELEASE") ldebug = /DEBUG @@ -316,14 +321,14 @@ LIBS= user32.lib winmm.lib $(ZLIB) !IF ("$(GRAPHICAL)"=="Y") cflagsGame = $(cdebug) $(cflags2) $(guiflags) $(INCLDIR) \ - $(WINPFLAG) $(DLBFLG) $(GAMEPDBFILE) $(GAMEMAPFILE) -lflagsGame = $(ldebug) $(lflags) $(guilibs) + $(WINPFLAG) $(DLBFLG) +lflagsGame = $(ldebug) $(lflags) $(guilibs) $(GAMEPDBFILE) $(GAMEMAPFILE) !ELSE cflagsGame = $(cdebug) $(cflags2) $(conflags) $(INCLDIR) \ - $(WINPFLAG) $(DLBFLG) $(GAMEPDBFILE) $(GAMEMAPFILE) -lflagsGame = $(ldebug) $(lflags) $(conlibs) + $(WINPFLAG) $(DLBFLG) +lflagsGame = $(ldebug) $(lflags) $(conlibs) $(GAMEPDBFILE) $(GAMEMAPFILE) !ENDIF @@ -362,10 +367,10 @@ DLB = # Rules for files in sys\winnt #========================================== -{$(NTSYS)}.c{$(OBJ)}.o: +{$(MSWSYS)}.c{$(OBJ)}.o: @$(CC) $(cflagsUtil) -Fo$@ $< -{$(NTSYS)}.h{$(INCL)}.h: +{$(MSWSYS)}.h{$(INCL)}.h: @copy $< $@ #========================================== @@ -410,7 +415,7 @@ DLB = # referenced later on in the Makefile. # -DEFFILE = $(NTSYS)\$(GAME).def +DEFFILE = $(MSWSYS)\$(GAME).def # # Shorten up the location for some files @@ -595,15 +600,16 @@ $(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \ copy $(DAT)\*.lev $(GAMEDIR) if exist $(GAMEDIR)\makefile del $(GAMEDIR)\makefile ! ENDIF + if not exist $(GAMEDIR)\sysconf copy $(MSWSYS)\sysconf $(GAMEDIR) if exist $(DAT)\symbols copy $(DAT)\symbols $(GAMEDIR) if exist $(DOC)\guidebook.txt copy $(DOC)\guidebook.txt $(GAMEDIR)\Guidebook.txt if exist $(DOC)\nethack.txt copy $(DOC)\nethack.txt $(GAMEDIR)\NetHack.txt @if exist $(O)$(GAME).PDB copy $(O)$(GAME).pdb $(GAMEDIR)\$(GAME).pdb @if exist $(GAMEDIR)\$(GAME).PDB echo NOTE: You may want to remove $(GAMEDIR)\$(GAME).pdb to conserve space - -copy $(NTSYS)\defaults.nh $(GAMEDIR)\defaults.nh + -copy $(MSWSYS)\defaults.nh $(GAMEDIR)\defaults.nh echo install done > $@ -# copy $(NTSYS)\winnt.hlp $(GAMEDIR) +# copy $(MSWSYS)\winnt.hlp $(GAMEDIR) recover: $(U)recover.exe if exist $(U)recover.exe copy $(U)recover.exe $(GAMEDIR) @@ -662,8 +668,8 @@ $(NHRES): $(TILEBMP16) $(WIN32)\winhack.rc $(WIN32)\mnsel.bmp \ $(WIN32)\splash.bmp @$(rc) -r -fo$@ -i$(WIN32) -dNDEBUG $(WIN32)\winhack.rc !ELSE -$(NHRES): $(NTSYS)\console.rc $(NTSYS)\NetHack.ico - @$(rc) -r -fo$@ -i$(NTSYS) -dNDEBUG $(NTSYS)\console.rc +$(NHRES): $(MSWSYS)\console.rc $(MSWSYS)\NetHack.ico + @$(rc) -r -fo$@ -i$(MSWSYS) -dNDEBUG $(MSWSYS)\console.rc !ENDIF #========================================== @@ -834,12 +840,12 @@ $(U)uudecode.exe: $(O)uudecode.o $(O)uudecode.o: $(SSYS)\uudecode.c @$(CC) $(cflagsUtil) /D_CRT_SECURE_NO_DEPRECATE -Fo$@ $(SSYS)\uudecode.c -$(NTSYS)\NetHack.ico : $(U)uudecode.exe $(NTSYS)\nhico.uu - chdir $(NTSYS) +$(MSWSYS)\NetHack.ico : $(U)uudecode.exe $(MSWSYS)\nhico.uu + chdir $(MSWSYS) ..\..\util\uudecode.exe nhico.uu chdir ..\..\src -$(WIN32)\NetHack.ico : $(U)uudecode.exe $(NTSYS)\nhico.uu +$(WIN32)\NetHack.ico : $(U)uudecode.exe $(MSWSYS)\nhico.uu chdir $(WIN32) ..\..\util\uudecode.exe ../../sys/winnt/nhico.uu chdir ..\..\src @@ -974,8 +980,8 @@ envchk: # Header files NOT distributed in $(INCL) #=========================================== -$(INCL)\win32api.h: $(NTSYS)\win32api.h - copy $(NTSYS)\win32api.h $@ +$(INCL)\win32api.h: $(MSWSYS)\win32api.h + copy $(MSWSYS)\win32api.h $@ #========================================== @@ -996,8 +1002,8 @@ $(O)dlb.o: $(O)dlb_main.o $(O)alloc.o $(O)panic.o $(INCL)\dlb.h $(O)dlb_main.o: $(UTIL)\dlb_main.c $(INCL)\config.h $(INCL)\dlb.h @$(CC) $(cflagsUtil) /Fo$@ $(UTIL)\dlb_main.c -$(DAT)\porthelp: $(NTSYS)\porthelp - @copy $(NTSYS)\porthelp $@ >nul +$(DAT)\porthelp: $(MSWSYS)\porthelp + @copy $(MSWSYS)\porthelp $@ >nul nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \ $(DAT)\quest.dat $(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp \ @@ -1292,14 +1298,14 @@ $(DAT)\dungeon: $(O)utility.tag $(DAT)\dungeon.def # NT dependencies # -$(O)nttty.o: $(HACK_H) $(TILE_H) $(INCL)\win32api.h $(NTSYS)\nttty.c - @$(CC) $(cflagsUtil) -I$(WSHR) -Fo$@ $(NTSYS)\nttty.c -$(O)nhkeys.o: $(HACK_H) $(TILE_H) $(INCL)\win32api.h $(NTSYS)\nhkeys.c - @$(CC) $(cflagsUtil) -I$(WSHR) -Fo$@ $(NTSYS)\nhkeys.c -$(O)winnt.o: $(HACK_H) $(INCL)\win32api.h $(NTSYS)\winnt.c - @$(CC) $(cflagsUtil) -Fo$@ $(NTSYS)\winnt.c -$(O)ntsound.o: $(HACK_H) $(NTSYS)\ntsound.c - @$(CC) $(cflagsUtil) -Fo$@ $(NTSYS)\ntsound.c +$(O)nttty.o: $(HACK_H) $(TILE_H) $(INCL)\win32api.h $(MSWSYS)\nttty.c + @$(CC) $(cflagsUtil) -I$(WSHR) -Fo$@ $(MSWSYS)\nttty.c +$(O)nhkeys.o: $(HACK_H) $(TILE_H) $(INCL)\win32api.h $(MSWSYS)\nhkeys.c + @$(CC) $(cflagsUtil) -I$(WSHR) -Fo$@ $(MSWSYS)\nhkeys.c +$(O)winnt.o: $(HACK_H) $(INCL)\win32api.h $(MSWSYS)\winnt.c + @$(CC) $(cflagsUtil) -Fo$@ $(MSWSYS)\winnt.c +$(O)ntsound.o: $(HACK_H) $(MSWSYS)\ntsound.c + @$(CC) $(cflagsUtil) -Fo$@ $(MSWSYS)\ntsound.c # # util dependencies From b8515fb5fdbb8efe4d8db4bcfe35dfe454f2ef3e Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 21 Mar 2015 15:54:30 -0400 Subject: [PATCH 239/354] throw in a windows sysconf skeleton --- sys/winnt/sysconf | 78 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sys/winnt/sysconf diff --git a/sys/winnt/sysconf b/sys/winnt/sysconf new file mode 100644 index 000000000..67c0b814d --- /dev/null +++ b/sys/winnt/sysconf @@ -0,0 +1,78 @@ +# +# NetHack 3.5 sysconf $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 sysconf $Date: 2012/01/27 20:15:31 $ $Revision: 1.6 $ +# +# Sample sysconf file. +# The sysconf file is only used if NetHack is compiled with SYSCF defined. +# This file uses the same syntax as nethack.cf. + +# Which users can use WIZARD (debugging) mode (the -D flag). +# A value of * allows anyone to enter debugging mode. +WIZARDS=* + +# Users allowed to use the ! (shell escape) command or to suspend the game. +# Uses the same syntax as the WIZARDS option above. +#SHELLERS= + +# Show debugging information originating from these source files. +# Use '*' for all, or list source files separated by spaces. +# Only available if game has been compiled with DEBUG. +#DEBUGFILES=* + +# Limit the number of simultaneous games (see also nethack.sh). +#MAXPLAYERS=10 + +# If not null, added to string "To get local support, " in the support +# information help. +#SUPPORT=call Izchak at extension 42. + +# Uncomment the next line to disable the SEDUCE option. +#SEDUCE=0 + +# Record (high score) file options. +# CAUTION: changing these after people have started playing games can +# lead to lost high scores! +# Maximum entries for one person. +#PERSMAX=10 +# Maximum entries in the record file. +#ENTRYMAX=100 +# Minimum points to get an entry. +#POINTSMIN=1 +# Determine identity of "person" in the score file with name (0) or +# numeric (1) user id. +#PERS_IS_UID=1 + +# Maximum number of score file entries to use for random statue names +#MAX_STATUENAME_RANK=10 + +# *** LOCATIONS *** +# IMPORTANT: If you change any of these locations, the directories they +# point at must exist. NetHack will not create them for you. +# +# HACKDIR is the default location for everything. +# Note: On Windows HACKDIR defaults to the location +# of the NetHack.exe or NetHackw.exe file so +# setting HACKDIR below to override that is +# not usually necessary or recommended. +#HACKDIR=c:\games\nethack +# +# The location that users can adjust their config file startup options +#CONFIGDIR=c:\games\nethack +# +# The location that level files in progress are stored (default=HACKDIR, writeable) +#LEVELDIR=c:\nethack\levels +# +# The location where saved games are kept (default=HACKDIR, writeable) +#SAVEDIR=c:\nethack\save +# +# The location that bones files are kept (default=HACKDIR, writeable) +#BONESDIR=c:\nethack\save +# +# The location that file synchronization locks are stored (default=HACKDIR, writeable) +#LOCKDIR=c:\nethack\levels +# +# The location that a record of game aborts and self-diagnosed game problems +# is kept (default=HACKDIR, writeable) +#TROUBLEDIR=c:\nethack\trouble + + From 349e264ac3eccab996cc065867cd2808785d9e32 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 21 Mar 2015 16:01:03 -0400 Subject: [PATCH 240/354] remove a troublesome line of code Whenever SYSCF was enabled on Windows, the option processing would go bonkers with illegal options at startup. I noticed it months ago, and Derek had it happen the other evening. It turns out, the hard-coded 'defaults.nh' setting was being overwritten with the name sysconf on the first SET_IN_SYS pass, so all subsequent passes were re-opening the SYSC_FILE instead of the user config file. I opted to take it out as I couldn't ascertain why it was there in the first place. --- src/files.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/files.c b/src/files.c index e85a85ae4..eeebd6e08 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 files.c $NHDT-Date: 1426966692 2015/03/21 19:38:12 $ $NHDT-Branch: master $:$NHDT-Revision: 1.135 $ */ +/* NetHack 3.5 files.c $NHDT-Date: 1426968058 2015/03/21 20:00:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.136 $ */ /* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1858,7 +1858,6 @@ int src; } else #endif if ((fp = fopenp(filename, "r")) != (FILE *)0) { - configfile = filename; return(fp); #if defined(UNIX) || defined(VMS) } else { From af9af8b7018f481588098974872b887bd8ad63cc Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 21 Mar 2015 16:17:17 -0400 Subject: [PATCH 241/354] put mystery line back but !WIN32 Since that line of code is used by a lot of different ports, I decided to recant its removal and just add #ifdef to ensure it isn't compiled on WIN32. I think other ports might encounter the same issue where the first pass with filename set to 'sysconf', is then going to overwrite the hard-coded user config file name, but I can't fix or test those so for those ports, it will be now be back the way it was. --- src/files.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/files.c b/src/files.c index eeebd6e08..b9942246a 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 files.c $NHDT-Date: 1426968058 2015/03/21 20:00:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.136 $ */ +/* NetHack 3.5 files.c $NHDT-Date: 1426969026 2015/03/21 20:17:06 $ $NHDT-Branch: master $:$NHDT-Revision: 1.137 $ */ /* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1858,6 +1858,9 @@ int src; } else #endif if ((fp = fopenp(filename, "r")) != (FILE *)0) { +#ifndef WIN32 + configfile = filename; +#endif return(fp); #if defined(UNIX) || defined(VMS) } else { From 91b13d939a7c4e5409cff4b855127b558c2fcd27 Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 21 Mar 2015 15:36:47 -0700 Subject: [PATCH 242/354] wishing fix for "eyes" No, not a blindness cure. :-} Post-3.4.3 revisions to makesingular() inadvertently made it impossible to successfully wish for "the Eyes of the Overworld" because the string got changed into "the Eye of the Overworld" which doesn't match anything. So don't singularize "eyes". (After this fix, wishing for "the Eyes of the Aethiopica" no longer yields the Eye of same, but I think that's the correct behavior.) --- src/objnam.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/objnam.c b/src/objnam.c index fe692b226..898dfb60a 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 objnam.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 objnam.c $NHDT-Date: 1426977394 2015/03/21 22:36:34 $ $NHDT-Branch: master $:$NHDT-Revision: 1.108 $ */ /* NetHack 3.5 objnam.c $Date: 2011/10/27 02:24:54 $ $Revision: 1.101 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1682,7 +1682,7 @@ static struct sing_plur one_off[] = { static const char *const as_is[] = { /* makesingular() leaves these plural due to how they're used */ "boots", "shoes", - "gloves", "lenses", "scales", + "gloves", "lenses", "scales", "eyes", "gauntlets", "iron bars", /* both singular and plural are spelled the same */ From 86959fe242fe238ab8266345acd1c34ba985850d Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 21 Mar 2015 19:24:08 -0700 Subject: [PATCH 243/354] fix "mysterious force" probabilities in do.c comment Reported by Alex, the probabilites shown in the comment about the effect of the mysterious force have been wrong ever since they were added 20 or so years ago. Lawfuls and neutrals are much more likely to go down just one level rather than 2 or 3. --- src/do.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/do.c b/src/do.c index 34635af72..b387752d6 100644 --- a/src/do.c +++ b/src/do.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 do.c $NHDT-Date: 1426497723 2015/03/16 09:22:03 $ $NHDT-Branch: H3724 $:$NHDT-Revision: 1.109 $ */ +/* NetHack 3.5 do.c $NHDT-Date: 1426991040 2015/03/22 02:24:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.111 $ */ /* NetHack 3.5 do.c $Date: 2014/11/18 03:10:39 $ $Revision: 1.101 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1014,15 +1014,18 @@ boolean at_stairs, falling, portal; /* If you have the amulet and are trying to get out of Gehennom, going * up a set of stairs sometimes does some very strange things! - * Biased against law and towards chaos, but not nearly as strongly - * as it used to be (prior to 3.2.0). - * Odds: old new - * "up" L N C "up" L N C - * +1 75.0 75.0 75.0 +1 75.0 75.0 75.0 - * 0 0.0 12.5 25.0 0 6.25 8.33 12.5 - * -1 8.33 4.17 0.0 -1 6.25 8.33 12.5 - * -2 8.33 4.17 0.0 -2 6.25 8.33 0.0 - * -3 8.33 4.17 0.0 -3 6.25 0.0 0.0 + * Biased against law and towards chaos. (The chance to be sent + * down multiple levels when attempting to go up are significantly + * less than the corresponding comment in older versions indicated + * due to overlooking the effect of the call to assign_rnd_lvl().) + * + * Odds for making it to the next level up, or of being sent down: + * "up" L N C + * +1 75.0 75.0 75.0 + * 0 6.25 8.33 12.5 + * -1 11.46 12.50 12.5 + * -2 5.21 4.17 0.0 + * -3 2.08 0.0 0.0 */ if (Inhell && up && u.uhave.amulet && !newdungeon && !portal && (dunlev(&u.uz) < dunlevs_in_dungeon(&u.uz)-3)) { From c3c968f87cc04ee155b970c927cbf2b109b76f16 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 22 Mar 2015 10:44:36 -0400 Subject: [PATCH 244/354] options and config file handling With SYSCF, the SYSCF_FILE name was overwriting the default config file name making it unavailable for subsequent user config file options handling. - Keep the name of the last config file successfully opened. - Do it without orphaning the default config file name needed for the next pass. --- include/decl.h | 3 ++- src/files.c | 55 +++++++++++++++++++++++++++++++++----------------- src/options.c | 10 ++++----- 3 files changed, 44 insertions(+), 24 deletions(-) diff --git a/include/decl.h b/include/decl.h index bacff08d9..5dea2ff43 100644 --- a/include/decl.h +++ b/include/decl.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 decl.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.50 $ */ +/* NetHack 3.5 decl.h $NHDT-Date: 1427035422 2015/03/22 14:43:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.56 $ */ /* NetHack 3.5 decl.h $Date: 2011/12/29 20:06:27 $ $Revision: 1.44 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -184,6 +184,7 @@ E NEARDATA struct kinfo { E long done_money; E const char *configfile; +E char lastconfigfile[BUFSZ]; /* used for messaging */ E NEARDATA char plname[PL_NSIZ]; E NEARDATA char dogname[]; E NEARDATA char catname[]; diff --git a/src/files.c b/src/files.c index b9942246a..e638fa640 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 files.c $NHDT-Date: 1426969026 2015/03/21 20:17:06 $ $NHDT-Branch: master $:$NHDT-Revision: 1.137 $ */ +/* NetHack 3.5 files.c $NHDT-Date: 1427035432 2015/03/22 14:43:52 $ $NHDT-Branch: master $:$NHDT-Revision: 1.138 $ */ /* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1811,6 +1811,8 @@ const char *configfile = # endif #endif +/* used for messaging */ +char lastconfigfile[BUFSZ]; #ifdef MSDOS /* conflict with speed-dial under windows @@ -1857,10 +1859,9 @@ int src; /* fall through to standard names */ } else #endif - if ((fp = fopenp(filename, "r")) != (FILE *)0) { -#ifndef WIN32 - configfile = filename; -#endif + (void) strncpy(lastconfigfile, filename, BUFSZ-1); + lastconfigfile[BUFSZ-1] = '\0'; + if ((fp = fopenp(lastconfigfile, "r")) != (FILE *)0) { return(fp); #if defined(UNIX) || defined(VMS) } else { @@ -1874,24 +1875,32 @@ int src; } #if defined(MICRO) || defined(MAC) || defined(__BEOS__) || defined(WIN32) - if ((fp = fopenp(fqname(configfile, CONFIGPREFIX, 0), "r")) - != (FILE *)0) + (void) strncpy(lastconfigfile, + fqname(configfile, CONFIGPREFIX, 0), BUFSZ-1); + lastconfigfile[BUFSZ-1] = '\0'; + if ((fp = fopenp(lastconfigfile, "r")) != (FILE *)0) { return(fp); + } # ifdef MSDOS - else if ((fp = fopenp(fqname(backward_compat_configfile, - CONFIGPREFIX, 0), "r")) != (FILE *)0) + (void) strncpy(lastconfigfile, + fqname(backward_compat_configfile, CONFIGPREFIX, 0), + BUFSZ-1); + lastconfigfile[BUFSZ-1] = '\0'; + else if ((fp = fopenp(fqname(lastconfigfile, "r")) != (FILE *)0) return(fp); # endif #else /* constructed full path names don't need fqname() */ # ifdef VMS - if ((fp = fopenp(fqname("nethackini", CONFIGPREFIX, 0), "r")) - != (FILE *)0) { - configfile = "nethackini"; + (void) strncpy(lastconfigfile, fqname("nethackini", CONFIGPREFIX, 0), + BUFSZ-1); + lastconfigfile[BUFSZ-1] = '\0'; + if ((fp = fopenp(lastconfigfile, "r")) != (FILE *)0) { return(fp); } - if ((fp = fopenp("sys$login:nethack.ini", "r")) != (FILE *)0) { - configfile = "nethack.ini"; + (void) strncpy(lastconfigfile,"sys$login:nethack.ini", BUFSZ-1); + lastconfigfile[BUFSZ-1] = '\0'; + if ((fp = fopenp(lastconfigfile, "r")) != (FILE *)0) { return(fp); } @@ -1900,6 +1909,9 @@ int src; Strcpy(tmp_config, "NetHack.cnf"); else Sprintf(tmp_config, "%s%s", envp, "NetHack.cnf"); + + (void) strncpy(lastconfigfile, tmp_config, BUFSZ-1); + lastconfigfile[BUFSZ-1] = '\0'; if ((fp = fopenp(tmp_config, "r")) != (FILE *)0) return(fp); # else /* should be only UNIX left */ @@ -1908,18 +1920,25 @@ int src; Strcpy(tmp_config, ".nethackrc"); else Sprintf(tmp_config, "%s/%s", envp, ".nethackrc"); - if ((fp = fopenp(tmp_config, "r")) != (FILE *)0) + + (void) strncpy(lastconfigfile, tmp_config, BUFSZ-1); + lastconfigfile[BUFSZ-1] = '\0'; + if ((fp = fopenp(lastconfigfile, "r")) != (FILE *)0) return(fp); # if defined(__APPLE__) /* try an alternative */ if (envp) { Sprintf(tmp_config, "%s/%s", envp, "Library/Preferences/NetHack Defaults"); - if ((fp = fopenp(tmp_config, "r")) != (FILE *)0) + (void) strncpy(lastconfigfile, tmp_config, BUFSZ-1); + lastconfigfile[BUFSZ-1] = '\0'; + if ((fp = fopenp(lastconfigfile, "r")) != (FILE *)0) return(fp); Sprintf(tmp_config, "%s/%s", envp, "Library/Preferences/NetHack Defaults.txt"); - if ((fp = fopenp(tmp_config, "r")) != (FILE *)0) + (void) strncpy(lastconfigfile, tmp_config, BUFSZ-1); + lastconfigfile[BUFSZ-1] = '\0'; + if ((fp = fopenp(lastconfigfile, "r")) != (FILE *)0) return(fp); } # endif @@ -1934,7 +1953,7 @@ int src; # endif details = ""; raw_printf("Couldn't open default config file %s %s(%d).", - tmp_config, details, errno); + lastconfigfile, details, errno); wait_synch(); } # endif /* Unix */ diff --git a/src/options.c b/src/options.c index 98ab3724b..c21010ab1 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 options.c $NHDT-Date: 1425083082 2015/02/28 00:24:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.158 $ */ +/* NetHack 3.5 options.c $NHDT-Date: 1427035440 2015/03/22 14:44:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.163 $ */ /* NetHack 3.5 options.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.153 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -798,10 +798,10 @@ rejectoption(optname) const char *optname; { #ifdef MICRO - pline("\"%s\" settable only from %s.", optname, configfile); + pline("\"%s\" settable only from %s.", optname, lastconfigfile); #else pline("%s can be set only from NETHACKOPTIONS or %s.", optname, - configfile); + lastconfigfile); #endif } @@ -821,7 +821,7 @@ const char *opts; #endif if(from_file) - raw_printf("Bad syntax in OPTIONS in %s: %s.", configfile, opts); + raw_printf("Bad syntax in OPTIONS in %s: %s.", lastconfigfile, opts); else raw_printf("Bad syntax in NETHACKOPTIONS: %s.", opts); @@ -4070,7 +4070,7 @@ option_help() winid datawin; datawin = create_nhwindow(NHW_TEXT); - Sprintf(buf, "Set options as OPTIONS= in %s", configfile); + Sprintf(buf, "Set options as OPTIONS= in %s", lastconfigfile); opt_intro[CONFIG_SLOT] = (const char *) buf; for (i = 0; opt_intro[i]; i++) putstr(datawin, 0, opt_intro[i]); From 74c5f489aebba3d8d39b9acc5e46135ce3926ddc Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 22 Mar 2015 11:11:41 -0400 Subject: [PATCH 245/354] adjust PREFIXES_IN_USE for SYSCF --- include/decl.h | 9 +++++---- src/decl.c | 6 ++++-- src/files.c | 14 +++++++++++--- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/include/decl.h b/include/decl.h index 5dea2ff43..15191842e 100644 --- a/include/decl.h +++ b/include/decl.h @@ -1,4 +1,4 @@ -/* NetHack 3.5 decl.h $NHDT-Date: 1427035422 2015/03/22 14:43:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.56 $ */ +/* NetHack 3.5 decl.h $NHDT-Date: 1425081976 2015/02/28 00:06:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.50 $ */ /* NetHack 3.5 decl.h $Date: 2011/12/29 20:06:27 $ $Revision: 1.44 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -363,9 +363,10 @@ E const char * const monexplain[], invisexplain[], * const oclass_names[]; #define DATAPREFIX 4 /* this one must match hardcoded value in dlb.c */ #define SCOREPREFIX 5 #define LOCKPREFIX 6 -#define CONFIGPREFIX 7 -#define TROUBLEPREFIX 8 -#define PREFIX_COUNT 9 +#define SYSCONFPREFIX 7 +#define CONFIGPREFIX 8 +#define TROUBLEPREFIX 9 +#define PREFIX_COUNT 10 /* used in files.c; xxconf.h can override if needed */ # ifndef FQN_MAX_FILENAME #define FQN_MAX_FILENAME 512 diff --git a/src/decl.c b/src/decl.c index d0d29a35f..75203c056 100644 --- a/src/decl.c +++ b/src/decl.c @@ -268,12 +268,14 @@ char toplines[TBUFSZ]; struct tc_gbl_data tc_gbl_data = { 0,0, 0,0 }; /* AS,AE, LI,CO */ char *fqn_prefix[PREFIX_COUNT] = { (char *)0, (char *)0, (char *)0, (char *)0, - (char *)0, (char *)0, (char *)0, (char *)0, (char *)0 }; + (char *)0, (char *)0, (char *)0, (char *)0, + (char *)0 , (char *)0 }; #ifdef PREFIXES_IN_USE char *fqn_prefix_names[PREFIX_COUNT] = { "hackdir", "leveldir", "savedir", "bonesdir", "datadir", "scoredir", - "lockdir", "configdir", "troubledir" }; + "lockdir", "sysconfdir", "configdir", + "troubledir" }; #endif NEARDATA struct savefile_info sfcap = { diff --git a/src/files.c b/src/files.c index e638fa640..ace417e7d 100644 --- a/src/files.c +++ b/src/files.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 files.c $NHDT-Date: 1427035432 2015/03/22 14:43:52 $ $NHDT-Branch: master $:$NHDT-Revision: 1.138 $ */ +/* NetHack 3.5 files.c $NHDT-Date: 1426969026 2015/03/21 20:17:06 $ $NHDT-Branch: master $:$NHDT-Revision: 1.137 $ */ /* NetHack 3.5 files.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.124 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -362,7 +362,9 @@ char *reasonbuf; /* reasonbuf must be at least BUFSZ, supplied by caller */ #if defined(NOCWD_ASSUMPTIONS) for (prefcnt = 1; prefcnt < PREFIX_COUNT; prefcnt++) { /* don't test writing to configdir or datadir; they're readonly */ - if (prefcnt == CONFIGPREFIX || prefcnt == DATAPREFIX) continue; + if (prefcnt == SYSCONFPREFIX || + prefcnt == CONFIGPREFIX || + prefcnt == DATAPREFIX) continue; filename = fqname("validate", prefcnt, 3); if ((fp = fopen(filename, "w"))) { fclose(fp); @@ -1858,6 +1860,12 @@ int src; wait_synch(); /* fall through to standard names */ } else +#endif +#ifdef PREFIXES_IN_USE + if (src == SET_IN_SYS) { + (void) strncpy(lastconfigfile, + fqname(filename, SYSCONFPREFIX, 0), BUFSZ-1); + } else #endif (void) strncpy(lastconfigfile, filename, BUFSZ-1); lastconfigfile[BUFSZ-1] = '\0'; @@ -1886,7 +1894,7 @@ int src; fqname(backward_compat_configfile, CONFIGPREFIX, 0), BUFSZ-1); lastconfigfile[BUFSZ-1] = '\0'; - else if ((fp = fopenp(fqname(lastconfigfile, "r")) != (FILE *)0) + else if ((fp = fopenp(lastconfigfile, "r")) != (FILE *)0) return(fp); # endif #else From 3b064145a37df3c4a16e6c8cbff3b28c8fa0e0a3 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 22 Mar 2015 15:05:18 -0400 Subject: [PATCH 246/354] File for explaining code quirks/features/caveats - added NOCWD_ASSUMPTIONS and PREFIXES_IN_USE section. --- DEVEL/code_features.txt | 55 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 DEVEL/code_features.txt diff --git a/DEVEL/code_features.txt b/DEVEL/code_features.txt new file mode 100644 index 000000000..08c42c9d7 --- /dev/null +++ b/DEVEL/code_features.txt @@ -0,0 +1,55 @@ +$NHDT-Date: 1426969026 2015/03/21 20:17:06 $ $NHDT-Branch: master $:$NHDT-Revision: 1.137 $ +code_features.txt + +Developer-useful info about code features, assumptions, purpose, +rationale, etc. + +============================================== +PREFIXES_IN_USE and NOCWD_ASSUMPTIONS + +Those provide a storage mechanism for holding the paths to various different +types of files. Those paths are stored in the fqn_prefix[] array. They are a +mechanism for enabling separation of the different files that NetHack needs. + +The prefixes are added to the beginning of file names by various routines in +files.c immediately prior to opening one of the types of files that the game +uses. + +They aren't about config file options (although config file options would be +one way to set non-default values for some of the paths in the fqn_prefix[] +array). Obviously the very first path needed (now sysconfdir, previously +configdir) isn't viable for setting via config file options, but the game +still needs to hunt it down "someplace." When the "someplace" is figured +out, that place (path) would be stored in fqn_prefix[SYSCONPREFIX]. How it +gets stored in fqn_prefix[SYSCONPREFIX] is up to us as developers. + +Any of the fqn_prefix[] entries can be set somehow. It could be done in port +startup code; in options processing; in config file processing; by +translating a system environment variable such as USERPROFILE; whatever +you/we want. The point is that NOCWD_ASSUMPTIONS and PREFIXES_IN_USE are +there to ensure that there is a place to store that path information. The +code to *utilize* the information is already in files.c (see fqname()). + +There is a fqn_prefix[] entry for holding the path to each of the following: + PREFIX NAME +0 HACKPREFIX hackdir +1 LEVELPREFIX leveldir location to create level files +2 SAVEPREFIX savedir location to create/read saved games +3 BONESPREFIX bonesir location to create/read bones +4 DATAPREFIX datadir location to read data.base etc. +5 SCOREPREFIX scoredir location to read/write scorefile +6 LOCKPREFIX lockdir location to create/read lock files +7 SYSCONFPREFIX sysconfdir location to read SYSCF_FILE +8 CONFIGPREFIX configdir location to read user configuration file +9 TROUBLEPREFIX troubledir location to place panic files etc. + +To recap, they are about enabling "different paths for different things", and +separation of: +- read-only stuff from read-write stuff. +- sysadmin stuff from user-writeable stuff. +etc. + +=================== NEXT FEATURE ========================== + + + From 0e6355e01718fbe71065ec6ebc86511ce42373c7 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 22 Mar 2015 18:04:18 -0400 Subject: [PATCH 247/354] Add note about feature alert mechanism --- DEVEL/code_features.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/DEVEL/code_features.txt b/DEVEL/code_features.txt index 08c42c9d7..414a51dbf 100644 --- a/DEVEL/code_features.txt +++ b/DEVEL/code_features.txt @@ -4,6 +4,34 @@ code_features.txt Developer-useful info about code features, assumptions, purpose, rationale, etc. +============================================== +FEATURE_NOTICE Alerts for a Release + +There is a code mechanism for alterting players to a change in behavior +over prior versions of the game. + +Here's how to do it: + o Where the change in behavior needs to alert the player, + - Add an 'if statement' to invoke the alert behavior + if the condition is met, for example + if (flags.suppress_alert < FEATURE_NOTICE_VER(3.6.0)) + pline("Note: and explain the change here."); + - The example above will alert the users for a new feature + added in 3.6.0 via a one-liner via pline(), but you + could get more elaborate (just make sure it is all done + in the 'if' code block.. + +Once the user finds the alert no longer useful, or becoming +annoying, they can set the "suppress_alert" option. + - The user can only set the suppress_alert to the current + version, not future versions. That restriction is done + so that the feature can be used for new things in new + releases. + - The suppression can be done interactively mid game with + the 'O' command, or via + OPTIONS=suppress_alert:3.6.0 + in the user's config file. + ============================================== PREFIXES_IN_USE and NOCWD_ASSUMPTIONS From a948e6aafbe828a16891b25c75f12c2d73521644 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 22 Mar 2015 18:11:49 -0400 Subject: [PATCH 248/354] remove stale feature alert This old feature alert from 3.3.0 is pretty stale, so remove if from the code because everybody has probably suppressed it by now. /* Because 'Q' used to be quit... */ if (flags.suppress_alert < FEATURE_NOTICE_VER(3,3,0)) pline("Note: Please use #quit if you wish to exit the game."); --- src/wield.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/wield.c b/src/wield.c index 9e1447bff..c70bec601 100644 --- a/src/wield.c +++ b/src/wield.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 wield.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 wield.c $NHDT-Date: 1427062304 2015/03/22 22:11:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.34 $ */ /* NetHack 3.5 wield.c $Date: 2009/05/06 10:48:14 $ $Revision: 1.31 $ */ /* SCCS Id: @(#)wield.c 3.5 2009/01/20 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ @@ -349,10 +349,6 @@ dowieldquiver() /* will_weld(), touch_petrifies(), etc. */ multi = 0; - /* Because 'Q' used to be quit... */ - if (flags.suppress_alert < FEATURE_NOTICE_VER(3,3,0)) - pline("Note: Please use #quit if you wish to exit the game."); - /* Prompt for a new quiver */ if (!(newquiver = getobj(quivee_types, "ready"))) /* Cancelled */ From 7b571b72f28d61894638f5e66831b93ec2ebed59 Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 22 Mar 2015 18:22:36 -0700 Subject: [PATCH 249/354] {DEC,IBM,MAC}graphics (1 of 2: core) DECgraphics, IBMgraphics, and MACgraphics used to be recognized when at least 3 letters were supplied back when they were true boolean options. When they got demoted to shortcuts for the symset option, they started needing 10 (DEC and IBM) or all 11 (MAC), otherwise triggering "bad syntax in NETHACKOPTIONS" (or config file). Revert to having the first three letters be sufficient. --- src/options.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/options.c b/src/options.c index c21010ab1..147e0a701 100644 --- a/src/options.c +++ b/src/options.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 options.c $NHDT-Date: 1427035440 2015/03/22 14:44:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.163 $ */ +/* NetHack 3.5 options.c $NHDT-Date: 1427073746 2015/03/23 01:22:26 $ $NHDT-Branch: master $:$NHDT-Revision: 1.164 $ */ /* NetHack 3.5 options.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.153 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2484,7 +2484,7 @@ goodfruit: #if defined(BACKWARD_COMPAT) fullname = "DECgraphics"; - if (match_optname(opts, fullname, 10, TRUE)) { + if (match_optname(opts, fullname, 3, TRUE)) { boolean badflag = FALSE; if (duplicate) complain_about_duplicate(opts,1); if (!negated) { @@ -2508,7 +2508,7 @@ goodfruit: return; } fullname = "IBMgraphics"; - if (match_optname(opts, fullname, 10, TRUE)) { + if (match_optname(opts, fullname, 3, TRUE)) { const char *sym_name = fullname; boolean badflag = FALSE; if (duplicate) complain_about_duplicate(opts,1); @@ -2542,7 +2542,7 @@ goodfruit: #endif #ifdef MAC_GRAPHICS_ENV fullname = "MACgraphics"; - if (match_optname(opts, fullname, 11, TRUE)) { + if (match_optname(opts, fullname, 3, TRUE)) { boolean badflag = FALSE; if (duplicate) complain_about_duplicate(opts,1); if (!negated) { From 97ffd73addcdb6855ded7a71fdb2339ad636ec3e Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 22 Mar 2015 18:29:37 -0700 Subject: [PATCH 250/354] {DEC,IBM,MAC}graphics (2 of 2: unixmain) Unix command line processing required that the initial 'd' of "-DECgraphics" be lowercase so that it wouldn't conflict with -D for wizard mode. This retains -D for wizard mode and now also recognizes "-debug" (case insensitive, but full 5 letters necessary) for the same thing, and allows "-DECgraphics" to be capitalized as it is throughout the rest of the program (actual matching is case-insensitive, so "-dec" and "-decgraphics" still work. It now requires that anything after "DEC" match the rest of that string instead of accepting "-DECanthing" as a synonym for "-DECgraphics". Likewise for "-IBMgraphics": when more than 3 letters are supplied, the extra ones must be an initial substring of "graphics" rather than arbitrary characters. The raw_printf() warnings don't actually work as intended, but that isn't a change from the old behavior so I've left them in for now. --- sys/unix/unixmain.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index f7f1ac87e..b31032efb 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 unixmain.c $NHDT-Date: 1426966705 2015/03/21 19:38:25 $ $NHDT-Branch: master $:$NHDT-Revision: 1.44 $ */ +/* NetHack 3.5 unixmain.c $NHDT-Date: 1427074144 2015/03/23 01:29:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.45 $ */ /* NetHack 3.5 unixmain.c $Date: 2012/01/27 20:15:31 $ $Revision: 1.42 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -324,7 +324,7 @@ process_options(argc, argv) int argc; char *argv[]; { - int i; + int i, l; /* * Process options. @@ -332,11 +332,25 @@ char *argv[]; while(argc > 1 && argv[1][0] == '-'){ argv++; argc--; + l = (int)strlen(*argv); + /* must supply at least 4 chars to match "-XXXgraphics" */ + if (l < 4) l = 4; + switch(argv[0][1]){ case 'D': - wizard = TRUE, discover = FALSE; + case 'd': + if ((argv[0][1] == 'D' && !argv[0][2]) + || !strcmpi(*argv, "-debug")) { + wizard = TRUE, discover = FALSE; + } else if (!strncmpi(*argv, "-DECgraphics", l)) { + load_symset("DECGraphics", PRIMARY); + switch_symbols(TRUE); + } else { + raw_printf("Unknown option: %s", *argv); + } break; case 'X': + discover = TRUE, wizard = FALSE; break; #ifdef NEWS @@ -356,17 +370,12 @@ char *argv[]; break; case 'I': case 'i': - if (!strncmpi(argv[0]+1, "IBM", 3)) { + if (!strncmpi(*argv, "-IBMgraphics", l)) { load_symset("IBMGraphics", PRIMARY); load_symset("RogueIBM", ROGUESET); switch_symbols(TRUE); - } - break; - /* case 'D': */ - case 'd': - if (!strncmpi(argv[0]+1, "DEC", 3)) { - load_symset("DECGraphics", PRIMARY); - switch_symbols(TRUE); + } else { + raw_printf("Unknown option: %s", *argv); } break; case 'p': /* profession (role) */ From e41b3f71435a4471ba4c2baf41743d2789b676fb Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sat, 21 Mar 2015 11:55:30 -0400 Subject: [PATCH 251/354] Fix use-after-frees on dipped objects. --- src/fountain.c | 16 +++++++++------- src/potion.c | 6 +++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/fountain.c b/src/fountain.c index 88fb6e2a4..405fac4a3 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 fountain.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 fountain.c $NHDT-Date: 1426953330 2015/03/21 15:55:30 $ $NHDT-Branch: master $:$NHDT-Revision: 1.40 $ */ /* NetHack 3.5 fountain.c $Date: 2011/08/20 00:22:20 $ $Revision: 1.32 $ */ /* Copyright Scott R. Turner, srt@ucla, 10/27/86 */ /* NetHack may be freely redistributed. See license for details. */ @@ -402,12 +402,14 @@ register struct obj *obj; if(in_town(u.ux, u.uy)) (void) angry_guards(FALSE); return; - } else if (water_damage(obj, NULL, TRUE) != ER_NOTHING) { - if (obj->otyp == POT_ACID) { /* Acid and water don't mix */ - useup(obj); - return; - } else if (!rn2(2)) /* no further effect */ - return; + } else { + int er = water_damage(obj, NULL, TRUE); + if (obj->otyp == POT_ACID && er != ER_DESTROYED) { /* Acid and water don't mix */ + useup(obj); + return; + } else if (er != ER_NOTHING && !rn2(2)) { /* no further effect */ + return; + } } switch (rnd(30)) { diff --git a/src/potion.c b/src/potion.c index 0af019181..d9e5e9ca8 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 potion.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 potion.c $NHDT-Date: 1426953330 2015/03/21 15:55:30 $ $NHDT-Branch: master $:$NHDT-Revision: 1.99 $ */ /* NetHack 3.5 potion.c $Date: 2013/11/05 00:57:55 $ $Revision: 1.91 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1664,8 +1664,8 @@ dodip() rider_cant_reach(); /* not skilled enough to reach */ } else { if (obj->otyp == POT_ACID) obj->in_use = 1; - (void) water_damage(obj, 0, TRUE); - if (obj->in_use) useup(obj); + if (water_damage(obj, 0, TRUE) != ER_DESTROYED && obj->in_use) + useup(obj); } return 1; } From 4c2df285b4288388415bf1f626f162fe58569ca0 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 23 Mar 2015 19:24:56 -0400 Subject: [PATCH 252/354] an easy fix for strcmpi and we move on Here in branch paxed-new_lev_comp-B (branched from paxed-new_lev_comp) is a simple fix for the strcmpi issue. The bottom section of lev_main.c has a bunch of forced linkages to names from NetHack etc. #ifdef STRICT_REF_DEF bunch of stuff #endif This change to lev_main should make everything work for those that don't supply a compiler library version of strcmpi() With this patch, those people can just add a -DSTRICT_REF_DEF to their compile line for lev_main.c. This would close the issue in a simple way, and doesn't require linking in anything new to the level compiler, or modifying any port's Makefiles etc. --- util/lev_main.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/util/lev_main.c b/util/lev_main.c index 1045bdf34..7d559905b 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -697,7 +697,7 @@ funcdef_defined(f, name, casesense) if (casesense) { if (!strcmp(name, f->name)) return f; } else { - if (!strcasecmp(name, f->name)) return f; + if (!strcmpi(name, f->name)) return f; } f = f->next; } @@ -748,7 +748,7 @@ vardef_defined(f, name, casesense) if (casesense) { if (!strcmp(name, f->name)) return f; } else { - if (!strcasecmp(name, f->name)) return f; + if (!strcmpi(name, f->name)) return f; } f = f->next; } @@ -988,7 +988,7 @@ char c; /* didn't find it; lets try case insensitive search */ for (i = LOW_PM; i < NUMMONS; i++) if (!class || class == mons[i].mlet) - if (!strcasecmp(s, mons[i].mname)) { + if (!strcmpi(s, mons[i].mname)) { if (be_verbose) lc_warning("Monster type \"%s\" matches \"%s\".", s, mons[i].mname); return i; @@ -1020,7 +1020,7 @@ char c; /* class */ for (i = class ? bases[class] : 0; i < NUM_OBJECTS; i++) { if (class && objects[i].oc_class != class) break; objname = obj_descr[i].oc_name; - if (objname && !strcasecmp(s, objname)) { + if (objname && !strcmpi(s, objname)) { if (be_verbose) lc_warning("Object type \"%s\" matches \"%s\".", s, objname); return i; @@ -1381,6 +1381,24 @@ struct window_procs windowprocs; # ifdef DEFINE_OSPEED short ospeed; # endif +# ifndef STRNCMPI +int +strncmpi(s1, s2, n) /* case insensitive counted string comparison */ + register const char *s1, *s2; + register int n; /*(should probably be size_t, which is usually unsigned)*/ +{ /*{ aka strncasecmp }*/ + register char t1, t2; + + while (n--) { + if (!*s2) return (*s1 != 0); /* s1 >= s2 */ + else if (!*s1) return -1; /* s1 < s2 */ + t1 = lowc(*s1++); + t2 = lowc(*s2++); + if (t1 != t2) return (t1 > t2) ? 1 : -1; + } + return 0; /* s1 == s2 */ +} +# endif /* STRNCMPI */ #endif /* STRICT_REF_DEF */ /*lev_main.c*/ From c49dbcc5b305718d476e3616e40b5ca40bb07a02 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 23 Mar 2015 19:50:36 -0400 Subject: [PATCH 253/354] include this also --- util/lev_main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/util/lev_main.c b/util/lev_main.c index 7d559905b..5a9060f7b 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 lev_main.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev_main.c $NHDT-Date: 1427154631 2015/03/23 23:50:31 $ $NHDT-Branch: paxed-new_lev_comp-B $:$NHDT-Revision: 1.27 $ */ /* NetHack 3.5 lev_main.c $Date: 2012/01/12 04:48:12 $ $Revision: 1.20 $ */ /* SCCS Id: @(#)lev_main.c 3.5 2007/01/17 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ @@ -1382,6 +1382,13 @@ struct window_procs windowprocs; short ospeed; # endif # ifndef STRNCMPI +char +lowc(c) /* force 'c' into lowercase */ + char c; +{ + return((char)(('A' <= c && c <= 'Z') ? (c | 040) : c)); +} + int strncmpi(s1, s2, n) /* case insensitive counted string comparison */ register const char *s1, *s2; From f9d22e02cde30762b403eebf47c109e700321bd4 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 23 Mar 2015 21:29:06 -0400 Subject: [PATCH 254/354] lev_main's own internal case-insensitive compare TEST SUITE int case_insensitive_comp(const char *, const char *); /* define your built-in compiler library variation here */ /* #define BUILTIN(a,b) strcasecmp(a,b) */ /* #define BUILTIN(a,b) stricmp(a,b) */ int main(int argc, char *argv[]) { const char *t1 = "NetHack"; const char *t2 = "nethack"; const char *t3 = "Fred"; const char *t4 = "Barney lived next door"; /* try the results with built-in strcmpi first */ printf("builtin:\tcompare <%s> to <%s>, result %d.\n", t1, t2, BUILTIN(t1,t2)); printf("builtin:\tcompare <%s> to <%s>, result %d.\n", t3, t4, BUILTIN(t3,t4)); /* try the results with case_insensitive_comp 2nd */ printf("ours:\tcompare <%s> to <%s>, result %d.\n", t1, t2, case_insensitive_comp(t1,t2)); printf("ours:\tcompare <%s> to <%s>, result %d.\n", t3, t4, case_insensitive_comp(t3,t4)); } int case_insensitive_comp(s1, s2) const char *s1; const char *s2; { unsigned char u1, u2; for ( ; ; s1++, s2++) { u1 = tolower((unsigned char) *s1); u2 = tolower((unsigned char) *s2); if ((u1 == '\0') || (u1 != u2)) { break; } } return u1-u2; } ======================== END TEST SUITE =========================== --- util/lev_main.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/util/lev_main.c b/util/lev_main.c index 5a9060f7b..89da3df26 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 lev_main.c $NHDT-Date: 1427154631 2015/03/23 23:50:31 $ $NHDT-Branch: paxed-new_lev_comp-B $:$NHDT-Revision: 1.27 $ */ +/* NetHack 3.5 lev_main.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ /* NetHack 3.5 lev_main.c $Date: 2012/01/12 04:48:12 $ $Revision: 1.20 $ */ /* SCCS Id: @(#)lev_main.c 3.5 2007/01/17 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ @@ -115,6 +115,7 @@ void FDECL(add_opcode, (sp_lev *, int, genericptr_t)); static boolean FDECL(write_common_data, (int,sp_lev *)); static boolean FDECL(write_maze, (int,sp_lev *)); static void NDECL(init_obj_classes); +static int NDECL(case_insensitive_comp, (const char *, const char *)); void VDECL(lc_error, (const char *, ...)); void VDECL(add_opvars, (sp_lev *, const char *, ...)); @@ -1343,6 +1344,23 @@ sp_lev *lvl; return TRUE; } +static int +case_insensitive_comp(s1, s2) +const char *s1; +const char *s2; +{ + unsigned char u1, u2; + + for ( ; ; s1++, s2++) { + u1 = tolower((unsigned char) *s1); + u2 = tolower((unsigned char) *s2); + if ((u1 == '\0') || (u1 != u2)) { + break; + } + } + return u1-u2; +} + #ifdef STRICT_REF_DEF /* From c4009b781cf7bb305d9df6e830c8e6ba7d2fbb78 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 23 Mar 2015 21:34:28 -0400 Subject: [PATCH 255/354] Actually use the new routines in lev_main --- util/lev_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/lev_main.c b/util/lev_main.c index 89da3df26..7a653407b 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -698,7 +698,7 @@ funcdef_defined(f, name, casesense) if (casesense) { if (!strcmp(name, f->name)) return f; } else { - if (!strcmpi(name, f->name)) return f; + if (!case_insensitive_comp(name, f->name)) return f; } f = f->next; } @@ -749,7 +749,7 @@ vardef_defined(f, name, casesense) if (casesense) { if (!strcmp(name, f->name)) return f; } else { - if (!strcmpi(name, f->name)) return f; + if (!case_insensitive_comp(name, f->name)) return f; } f = f->next; } @@ -989,7 +989,7 @@ char c; /* didn't find it; lets try case insensitive search */ for (i = LOW_PM; i < NUMMONS; i++) if (!class || class == mons[i].mlet) - if (!strcmpi(s, mons[i].mname)) { + if (!case_insensitive_comp(s, mons[i].mname)) { if (be_verbose) lc_warning("Monster type \"%s\" matches \"%s\".", s, mons[i].mname); return i; @@ -1021,7 +1021,7 @@ char c; /* class */ for (i = class ? bases[class] : 0; i < NUM_OBJECTS; i++) { if (class && objects[i].oc_class != class) break; objname = obj_descr[i].oc_name; - if (objname && !strcmpi(s, objname)) { + if (objname && !case_insensitive_comp(s, objname)) { if (be_verbose) lc_warning("Object type \"%s\" matches \"%s\".", s, objname); return i; From b1547c47709e726d385f4fe03f14240c85d80c26 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 23 Mar 2015 21:41:20 -0400 Subject: [PATCH 256/354] include header file in lev_main.c options.c depends on ctype.h and uses tolower() so no sense getting into a discussion about use of _that_ --- util/lev_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/lev_main.c b/util/lev_main.c index 7a653407b..1f46d595b 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 lev_main.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev_main.c $NHDT-Date: 1427161270 2015/03/24 01:41:10 $ $NHDT-Branch: paxed-new_lev_comp-B $:$NHDT-Revision: 1.30 $ */ /* NetHack 3.5 lev_main.c $Date: 2012/01/12 04:48:12 $ $Revision: 1.20 $ */ /* SCCS Id: @(#)lev_main.c 3.5 2007/01/17 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ @@ -19,6 +19,7 @@ #ifdef STRICT_REF_DEF #include "tcap.h" #endif +#include #ifdef MAC # if defined(__SC__) || defined(__MRC__) From 8785f73b7f24db646d2bd1c46c019b217e27a3a5 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 24 Mar 2015 19:28:27 +0200 Subject: [PATCH 257/354] Use the correct declaration macro --- util/lev_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/lev_main.c b/util/lev_main.c index 1f46d595b..8e785c598 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -116,7 +116,7 @@ void FDECL(add_opcode, (sp_lev *, int, genericptr_t)); static boolean FDECL(write_common_data, (int,sp_lev *)); static boolean FDECL(write_maze, (int,sp_lev *)); static void NDECL(init_obj_classes); -static int NDECL(case_insensitive_comp, (const char *, const char *)); +static int FDECL(case_insensitive_comp, (const char *, const char *)); void VDECL(lc_error, (const char *, ...)); void VDECL(add_opvars, (sp_lev *, const char *, ...)); From dfe967732d181df07a26814848ed4bb285d6781f Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 24 Mar 2015 21:14:49 +0200 Subject: [PATCH 258/354] Add more hallu sounds monsters make when hit --- src/sounds.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sounds.c b/src/sounds.c index 6204847e8..d8d78b4cc 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -304,7 +304,11 @@ dosounds() static const char * const h_sounds[] = { "beep", "boing", "sing", "belche", "creak", "cough", "rattle", - "ululate", "pop", "jingle", "sniffle", "tinkle", "eep" + "ululate", "pop", "jingle", "sniffle", "tinkle", "eep", + "clatter", "hum", "sizzle", "twitter", "wheeze", "rustle", + "honk", "lisp", "yodel", "coo", "burp", "moo", "boom", + "murmur", "oink", "quack", "rumble", "twang", "bellow", + "toot", "gargle", "hoot", "warble" }; const char * From d787f45dcbec5b1ab3bd8bec062107c22511b625 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 24 Mar 2015 22:01:29 +0200 Subject: [PATCH 259/354] Add an option to give feedback when bumping walls Boolean option "mention_walls", defaults to off. Useful for blind players. --- doc/Guidebook.mn | 2 ++ doc/fixes35.0 | 2 +- include/flag.h | 1 + src/hack.c | 9 +++++++-- src/options.c | 1 + 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 0b2e5cf3b..04cb9ea5f 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2053,6 +2053,8 @@ Enable mail delivery during the game (default on). .lp "male " An obsolete synonym for ``gender:male''. Cannot be set with the `O' command. +.lp mention_walls +Give feedback when walking against a wall (default off). .lp menustyle Controls the interface used when you need to choose various objects (in response to the Drop command, for instance). The value specified should diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 5d9f4707a..d1cd02932 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -879,7 +879,7 @@ abuse wisdom in keeping with Rider eating message message inconsistency: death message "swallowed whole" was preceded by "You bite into" improve the messaging when a monster you can't see is causing an obstruction - +add option mention_walls, which gives feedback when bumping against a wall Platform- and/or Interface-Specific Fixes ----------------------------------------- diff --git a/include/flag.h b/include/flag.h index aaff7431c..add59340e 100644 --- a/include/flag.h +++ b/include/flag.h @@ -189,6 +189,7 @@ struct instance_flags { boolean deferred_X; /* deferred entry into explore mode */ boolean num_pad; /* use numbers for movement commands */ boolean news; /* print news */ + boolean mention_walls; /* give feedback when bumping walls */ boolean menu_tab_sep; /* Use tabs to separate option menu fields */ boolean menu_requested; /* Flag for overloaded use of 'm' prefix * on some non-move commands */ diff --git a/src/hack.c b/src/hack.c index 1edfb9f4e..7f15af6ee 100644 --- a/src/hack.c +++ b/src/hack.c @@ -630,8 +630,11 @@ int mode; if (Passes_walls && may_passwall(x,y)) { ; /* do nothing */ } else if (tmpr->typ == IRONBARS) { - if (!(Passes_walls || passes_bars(youmonst.data))) + if (!(Passes_walls || passes_bars(youmonst.data))) { + if (iflags.mention_walls) + You("cannot pass through the bars."); return FALSE; + } } else if (tunnels(youmonst.data) && !needspick(youmonst.data)) { /* Eat the rock. */ if (mode == DO_MOVE && still_chewing(x,y)) return FALSE; @@ -646,8 +649,10 @@ int mode; if (Is_stronghold(&u.uz) && is_db_wall(x,y)) pline_The("drawbridge is up!"); /* sokoban restriction stays even after puzzle is solved */ - if (Passes_walls && !may_passwall(x,y) && In_sokoban(&u.uz)) + else if (Passes_walls && !may_passwall(x,y) && In_sokoban(&u.uz)) pline_The("Sokoban walls resist your ability."); + else if (iflags.mention_walls) + pline("It's a wall."); } return FALSE; } diff --git a/src/options.c b/src/options.c index 147e0a701..d1f5b26de 100644 --- a/src/options.c +++ b/src/options.c @@ -139,6 +139,7 @@ static struct Bool_Opt #else {"mail", (boolean *)0, TRUE, SET_IN_FILE}, #endif + {"mention_walls", &iflags.mention_walls, FALSE, SET_IN_GAME}, /* for menu debugging only*/ {"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME}, {"mouse_support", &iflags.wc_mouse_support, TRUE, DISP_IN_GAME}, /*WC*/ From 2ae33fa514490047598db89e9a02be9afe236e25 Mon Sep 17 00:00:00 2001 From: keni Date: Tue, 24 Mar 2015 18:29:02 -0400 Subject: [PATCH 260/354] NHsubst bugfixes and hack for whitespace errors. --- DEVEL/hooksdir/NHsubst | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/DEVEL/hooksdir/NHsubst b/DEVEL/hooksdir/NHsubst index 2c0c3c774..1039c21e6 100755 --- a/DEVEL/hooksdir/NHsubst +++ b/DEVEL/hooksdir/NHsubst @@ -13,7 +13,8 @@ my $rawin = 0; # feed diff to stdin for testing (do NOT set $debug=1) # this first block because it's expensive and dumpfile() hangs with $rawin. my $sink = ($^O eq "MSWin32") ? "NUL" : "/dev/null"; my $dbgfile = ($^O eq "MSWin32") ? "$ENV{TEMP}.$$" : "/tmp/trace.$$"; -open TRACE, ">>", ($debug==0)? $sink : $dbgfile; +open TRACE, ">>", $rawin?"/dev/tty":(($debug==0)? $sink : $dbgfile); +print TRACE "TEST TRACE\n"; if($debug){ print TRACE "START CLIENT ARGV:\n"; print TRACE "[0] $0\n"; @@ -233,7 +234,7 @@ sub merge_one_line_maybe { $theirval = $1; } } - +print TRACE "MID: $ourstype/$oursval $theirtype/$theirval\n"; # are we done? if(pos($ours)==length $ours && pos($theirs) == length $theirs){ $more = 0; @@ -245,6 +246,12 @@ sub merge_one_line_maybe { # now see if ours and their match or can be resolved # text if($ourstype == 3 && $theirtype == 3){ +#mismatch is \s vs \s\s - where is this coming from? + # HACK - hopefully temporary + if($oursval =~ m/^\s+$/ && $theirval =~ m/^\s+$/){ + $out .= $oursval; + next; + } if($oursval eq $theirval){ $out .= $oursval; next; @@ -273,6 +280,7 @@ sub merge_one_line_maybe { # return undef if we can't merge the values; $NAME: VALUE $ or $NAME$ (as appropriate) if we can. sub merge_one_var_maybe { my($varname, $oursval, $theirval) = @_; +print TRACE "MVM: -$varname-$oursval-$theirval-\n"; my $resolvedas; { no strict; @@ -309,12 +317,28 @@ sub Date { sub Branch { my($PREFIX, $varname, $mine, $theirs) = @_; - return "\$$PREFIX-$varname: $mine \$"; + $mine =~ s/^\s+//; $mine =~ s/\s+$//; + $theirs =~ s/^\s+//; $theirs =~ s/\s+$//; + return "\$$PREFIX-$varname: $mine \$" if(length $mine); + return "\$$PREFIX-$varname: $theirs \$" if(length $theirs); + return "\$$PREFIX-$varname\$" if(length $theirs); } sub Revision { my($PREFIX, $varname, $mine, $theirs) = @_; - return "\$$PREFIX-$varname: $mine \$"; + my($m) = ($mine =~ m/1.(\d+)/); + my($t) = ($theirs =~ m/1.(\d+)/); + if($m > 0 && $t > 0){ + my $q = ($m > $t) ? $m : $t; + return "\$$PREFIX-$varname: 1.$q \$"; + } + if($m > 0){ + return "\$$PREFIX-$varname: 1.$m \$"; + } + if($t > 0){ + return "\$$PREFIX-$varname: 1.$t \$"; + } + return "\$$PREFIX-$varname\$"; } __END__ @@ -364,3 +388,10 @@ $TEST-Branch: mine $ === $TEST-Branch: theirs $ >>> d3 + +TEST 8: +<<< d1 +/* NetHack 3.5 objnam.c $TEST-Date$ $TEST-Branch$:$TEST-Revision$ */ +=== +/* NetHack 3.5 objnam.c $TEST-Date: 1426977394 2015/03/21 22:36:34 $ $TEST-Branch: master $:$TEST-Revision: 1.108 $ */ +>>> d3 From a1cc33d6aed8cec411339736375fc231c2da9699 Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 24 Mar 2015 19:20:14 -0400 Subject: [PATCH 261/354] fix invalid pointer dereference in morguemon On 3/23/2015 6:41 PM, a bug reporter wrote: > If the game generates a graveyard, the graveyard places a normal > demon, but all normal demons are extinct at the time, then morguemon (at > mkroom.c line 423) indexes mons with NON_PM (the return value of > ndemon() if it can't find a reference), which is an invalid pointer > dereference. According to the testbench, this mostly seems to happen on > dlvl 12. This fixes the code violation, but the logic will now drop down to the ghost/wraith/zombie code when that happens. Is that desireable, or should something else happen (for variety)? --- doc/fixes35.0 | 2 ++ src/mkroom.c | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index d1cd02932..34a6ac9b4 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -880,6 +880,8 @@ message inconsistency: death message "swallowed whole" was preceded by "You bite into" improve the messaging when a monster you can't see is causing an obstruction add option mention_walls, which gives feedback when bumping against a wall +fix invalid pointer dereference in morguemon if ndemon returns NON_PM + Platform- and/or Interface-Specific Fixes ----------------------------------------- diff --git a/src/mkroom.c b/src/mkroom.c index 7f94076e7..2581ce996 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mkroom.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 mkroom.c $NHDT-Date: 1427239202 2015/03/24 23:20:02 $ $NHDT-Branch: master $:$NHDT-Revision: 1.16 $ */ /* NetHack 3.5 mkroom.c $Date: 2012/01/10 17:47:19 $ $Revision: 1.15 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -408,9 +408,17 @@ morguemon() { register int i = rn2(100), hd = rn2(level_difficulty()); - if(hd > 10 && i < 10) - return((Inhell || In_endgame(&u.uz)) ? mkclass(S_DEMON,0) : - &mons[ndemon(A_NONE)]); + if(hd > 10 && i < 10) { + if (Inhell || In_endgame(&u.uz)) { + return(mkclass(S_DEMON,0)); + } else { + int ndemon_res = ndemon(A_NONE); + if (ndemon_res != NON_PM) + return(&mons[ndemon_res]); + /* else do what? As is, it will drop to ghost/wraith/zombie */ + } + } + if(hd > 8 && i > 85) return(mkclass(S_VAMPIRE,0)); From a355911c2c98c5dba8428046b4033c820b46998c Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 24 Mar 2015 22:07:16 -0400 Subject: [PATCH 262/354] no hiding under nothing On 3/23/2015 6:41 PM, a bug reporter wrote: > When you're hiding under an item (e.g. via garter snake polyform), and > that item gets polyshuddered into nonexistence, you continue hiding > (under nothing). This addresses the "hiding under nothing" bug, but does not address this flavor comment also included in the report: > (Incidentally, it's a bit weird that you use > to aim at items that are > flavorwise above you at the time.) --- doc/fixes35.0 | 2 ++ src/zap.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 34a6ac9b4..f22cdc80d 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -881,6 +881,8 @@ message inconsistency: death message "swallowed whole" was preceded improve the messaging when a monster you can't see is causing an obstruction add option mention_walls, which gives feedback when bumping against a wall fix invalid pointer dereference in morguemon if ndemon returns NON_PM +after object loss through polyshudder don't get left hiding under nothing + if you're polymorphed into a hider Platform- and/or Interface-Specific Fixes diff --git a/src/zap.c b/src/zap.c index 3134c8b88..fcf0047bf 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 zap.c $NHDT-Date: 1426465444 2015/03/16 00:24:04 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.195 $ */ +/* NetHack 3.5 zap.c $NHDT-Date: 1427249230 2015/03/25 02:07:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.197 $ */ /* NetHack 3.5 zap.c $Date: 2013/11/05 00:57:56 $ $Revision: 1.183 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1750,8 +1750,14 @@ struct obj *obj, *otmp; if (Is_box(obj)) (void) boxlock(obj, otmp); if (obj_shudders(obj)) { + boolean cover = ((obj->ox == u.ux && obj->oy == u.uy) && + u.uundetected && + hides_under(youmonst.data)); + if (cansee(obj->ox, obj->oy)) learn_it = TRUE; do_osshock(obj); + /* eek - your cover might have been blown */ + if (cover) (void) hideunder(&youmonst); break; } obj = poly_obj(obj, STRANGE_OBJECT); From 907a2dfee0f81a9f9d5f7eaa764a21d776117de5 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Wed, 25 Mar 2015 14:34:03 -0400 Subject: [PATCH 263/354] Fix a memory leak on termination. Found by Alex Smith. --- src/save.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/save.c b/src/save.c index 807ecd7dc..f94b1857c 100644 --- a/src/save.c +++ b/src/save.c @@ -1316,6 +1316,7 @@ freedynamicdata() /* level-specific data */ free_timers(RANGE_LEVEL); free_light_sources(RANGE_LEVEL); + clear_regions(); freemonchn(fmon); free_worm(); /* release worm segment information */ freetrapchn(ftrap); From f41c51aef064b9399684da428c540bcb26a57b8e Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 25 Mar 2015 22:13:28 +0200 Subject: [PATCH 264/354] Show object symbols in menu headings ... in menus where those object symbols act as menu accelerators. Toggleable via "menu_objsyms" boolean option, defaults to off. --- doc/Guidebook.mn | 3 +++ doc/fixes35.0 | 2 ++ include/extern.h | 2 +- include/flag.h | 1 + src/invent.c | 26 +++++++++++++++++++------- src/o_init.c | 8 ++++---- src/options.c | 1 + src/pickup.c | 10 +++++++--- 8 files changed, 38 insertions(+), 15 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 04cb9ea5f..14aa20239 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2100,6 +2100,9 @@ Default '|'. Menu character accelerator to goto the next menu page. Implemented by the Amiga, Gem and tty ports. Default '>'. +.lp menu_objsyms +Show object symbols in menu headings in menus where +the object symbols act as menu accelerators (default off). .lp menu_previous_page Menu character accelerator to goto the previous menu page. Implemented by the Amiga, Gem and tty ports. diff --git a/doc/fixes35.0 b/doc/fixes35.0 index f22cdc80d..a639b1ff6 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -883,6 +883,8 @@ add option mention_walls, which gives feedback when bumping against a wall fix invalid pointer dereference in morguemon if ndemon returns NON_PM after object loss through polyshudder don't get left hiding under nothing if you're polymorphed into a hider +show object symbols in menu headings in menus where those object symbols + act as menu accelerators, toggleable via "menu_objsyms" option Platform- and/or Interface-Specific Fixes diff --git a/include/extern.h b/include/extern.h index da9bf7eff..30e6c6d43 100644 --- a/include/extern.h +++ b/include/extern.h @@ -911,7 +911,7 @@ E int NDECL(dopramulet); E int NDECL(doprtool); E int NDECL(doprinuse); E void FDECL(useupf, (struct obj *,long)); -E char *FDECL(let_to_name, (CHAR_P,BOOLEAN_P)); +E char *FDECL(let_to_name, (CHAR_P,BOOLEAN_P,BOOLEAN_P)); E void NDECL(free_invbuf); E void NDECL(reassign); E int NDECL(doorganize); diff --git a/include/flag.h b/include/flag.h index add59340e..e7ebafa26 100644 --- a/include/flag.h +++ b/include/flag.h @@ -191,6 +191,7 @@ struct instance_flags { boolean news; /* print news */ boolean mention_walls; /* give feedback when bumping walls */ boolean menu_tab_sep; /* Use tabs to separate option menu fields */ + boolean menu_head_objsym; /* Show obj symbol in menu headings */ boolean menu_requested; /* Flag for overloaded use of 'm' prefix * on some non-move commands */ boolean renameallowed; /* can change hero name during role selection */ diff --git a/src/invent.c b/src/invent.c index 12f0ef1b3..e5100ee5e 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1789,7 +1789,7 @@ nextclass: if (!flags.sortpack || otmp->oclass == *invlet) { if (flags.sortpack && !classcount) { add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings, - let_to_name(*invlet, FALSE), MENU_UNSELECTED); + let_to_name(*invlet, FALSE, (want_reply && iflags.menu_head_objsym)), MENU_UNSELECTED); classcount++; } any.a_char = ilet; @@ -1863,7 +1863,7 @@ char avoidlet; if (flags.sortpack && !classcount) { any = zeroany; /* zero */ add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings, - let_to_name(*invlet, FALSE), MENU_UNSELECTED); + let_to_name(*invlet, FALSE, FALSE), MENU_UNSELECTED); classcount++; } any.a_char = ilet; @@ -1991,7 +1991,7 @@ dounpaid() if (otmp->unpaid) { if (!flags.sortpack || otmp->oclass == *invlet) { if (flags.sortpack && !classcount) { - putstr(win, 0, let_to_name(*invlet, TRUE)); + putstr(win, 0, let_to_name(*invlet, TRUE, FALSE)); classcount++; } @@ -2009,7 +2009,7 @@ dounpaid() if (count > num_so_far) { /* something unpaid is contained */ if (flags.sortpack) - putstr(win, 0, let_to_name(CONTAINED_SYM, TRUE)); + putstr(win, 0, let_to_name(CONTAINED_SYM, TRUE, FALSE)); /* * Search through the container objects in the inventory for * unpaid items. The top level inventory items have already @@ -2701,10 +2701,12 @@ static NEARDATA char *invbuf = (char *)0; static NEARDATA unsigned invbufsiz = 0; char * -let_to_name(let,unpaid) +let_to_name(let,unpaid,showsym) char let; -boolean unpaid; +boolean unpaid,showsym; { + const char *ocsymfmt = " ('%c')"; + const int invbuf_sympadding = 8; /* arbitrary */ const char *class_name; const char *pos; int oclass = (let >= 1 && let < MAXOCLASSES) ? let : 0; @@ -2717,7 +2719,8 @@ boolean unpaid; else class_name = names[0]; - len = strlen(class_name) + (unpaid ? sizeof "unpaid_" : sizeof ""); + len = strlen(class_name) + (unpaid ? sizeof "unpaid_" : sizeof "") + + (oclass ? (strlen(ocsymfmt)+invbuf_sympadding) : 0); if (len > invbufsiz) { if (invbuf) free((genericptr_t)invbuf); invbufsiz = len + 10; /* add slop to reduce incremental realloc */ @@ -2727,6 +2730,15 @@ boolean unpaid; Strcat(strcpy(invbuf, "Unpaid "), class_name); else Strcpy(invbuf, class_name); + if ((oclass != 0) && showsym) { + char *bp = eos(invbuf); + int mlen = invbuf_sympadding - strlen(class_name); + while (--mlen > 0) { + *bp = ' '; bp++; + } + *bp = '\0'; + Sprintf(eos(invbuf), ocsymfmt, def_oc_syms[oclass].sym); + } return invbuf; } diff --git a/src/o_init.c b/src/o_init.c index 4ae8892e9..3d95a0d6f 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -446,7 +446,7 @@ dodiscovered() /* free after Robert Viduya */ if ((dis = disco[i]) != 0 && interesting_to_discover(dis)) { ct++; if (oclass != prev_class) { - putstr(tmpwin, iflags.menu_headings, let_to_name(oclass, FALSE)); + putstr(tmpwin, iflags.menu_headings, let_to_name(oclass, FALSE, FALSE)); prev_class = oclass; } Sprintf(buf, "%s %s",(objects[dis].oc_pre_discovered ? "*" : " "), @@ -472,7 +472,7 @@ char *buf; { char *s; - Strcpy(buf, let_to_name(oclass, FALSE)); + Strcpy(buf, let_to_name(oclass, FALSE, FALSE)); for (s = buf; *s; ++s) *s = lowc(*s); return buf; } @@ -615,7 +615,7 @@ doclassdisco() break; default: oclass = def_char_to_objclass(c); - Sprintf(buf, "Discovered %s", let_to_name(oclass, FALSE)); + Sprintf(buf, "Discovered %s", let_to_name(oclass, FALSE, FALSE)); putstr(tmpwin, iflags.menu_headings, buf); for (i = bases[(int)oclass]; i < NUM_OBJECTS && objects[i].oc_class == oclass; ++i) { @@ -672,7 +672,7 @@ rename_disco() if (oclass != prev_class) { any.a_int = 0; add_menu(tmpwin, NO_GLYPH, &any, ' ', iflags.menu_headings, - ATR_NONE, let_to_name(oclass, FALSE), MENU_UNSELECTED); + ATR_NONE, let_to_name(oclass, FALSE, FALSE), MENU_UNSELECTED); prev_class = oclass; } any.a_int = dis; diff --git a/src/options.c b/src/options.c index d1f5b26de..285603351 100644 --- a/src/options.c +++ b/src/options.c @@ -142,6 +142,7 @@ static struct Bool_Opt {"mention_walls", &iflags.mention_walls, FALSE, SET_IN_GAME}, /* for menu debugging only*/ {"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME}, + {"menu_objsyms", &iflags.menu_head_objsym, FALSE, SET_IN_GAME}, {"mouse_support", &iflags.wc_mouse_support, TRUE, DISP_IN_GAME}, /*WC*/ #ifdef NEWS {"news", &iflags.news, TRUE, DISP_IN_GAME}, diff --git a/src/pickup.c b/src/pickup.c index 1d78dea76..476d85798 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -769,7 +769,9 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */ if (sorted && !printed_type_name) { any = zeroany; add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings, - let_to_name(*pack, FALSE), MENU_UNSELECTED); + let_to_name(*pack, FALSE, + (how != PICK_NONE) && iflags.menu_head_objsym), + MENU_UNSELECTED); printed_type_name = TRUE; } @@ -928,8 +930,10 @@ int how; /* type of query */ any.a_int = curr->oclass; add_menu(win, NO_GLYPH, &any, invlet++, def_oc_syms[(int)objects[curr->otyp].oc_class].sym, - ATR_NONE, let_to_name(*pack, FALSE), - MENU_UNSELECTED); + ATR_NONE, + let_to_name(*pack, FALSE, + (how != PICK_NONE) && iflags.menu_head_objsym), + MENU_UNSELECTED); collected_type_name = TRUE; } } From 12ca92aa4236133e776411ddab81cbde05a9adaa Mon Sep 17 00:00:00 2001 From: "Derek S. Ray" Date: Wed, 25 Mar 2015 17:07:10 -0400 Subject: [PATCH 265/354] Fix 'fetch' syntax, include sparkly 'git log' trick And bolt a couple more Win32-folders onto .gitignore. --- .gitignore | 2 ++ DEVEL/git_recipes.txt | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 302497de0..db40c9ab4 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,8 @@ core Makefile # Win32-specific ignores +Debug/ +Release/ binary/ build/ Nethack.sln diff --git a/DEVEL/git_recipes.txt b/DEVEL/git_recipes.txt index 88af7f927..5e8d872f9 100644 --- a/DEVEL/git_recipes.txt +++ b/DEVEL/git_recipes.txt @@ -32,6 +32,10 @@ you specify: -pretty=one: format output as a single line for each entry (branch): show the commits from (branch) instead of the current one +[*] git log --pretty=one --decorate --graph --all + +(This is best explained by executing and looking at the output.) + [*] git add (filename) [*] git nhadd (filename) @@ -101,10 +105,10 @@ the prior commit. [/end area-of-concern] -[*] git fetch [-a] +[*] git fetch [--all] Retrieve commits from the remote repository to your machine. -Including -a will get commits for all branches. +Including --all will get commits for all branches. Does NOT merge them into your local repository. From b1df164a3befaaec7d1bc902200cd8f9ef1867b1 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 25 Mar 2015 18:04:50 -0700 Subject: [PATCH 266/354] fix acid_damage() crash My dog bit an acid blob and triggered a crash, caught by SYSCF panictrace but yielding confusing information. The backtrace included a call from 'rustm()+N' that turned out to be passivemm(), which was deferencing a null pointer since no weapon was involved. --- src/trap.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/trap.c b/src/trap.c index a0c6fa1b1..47d8d99b2 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 trap.c $NHDT-Date: 1426805491 2015/03/19 22:51:31 $ $NHDT-Branch: water_damage $:$NHDT-Revision: 1.198 $ */ +/* NetHack 3.5 trap.c $NHDT-Date: 1427331767 2015/03/26 01:02:47 $ $NHDT-Branch: master $:$NHDT-Revision: 1.199 $ */ /* NetHack 3.5 trap.c $Date: 2013/03/14 01:58:21 $ $Revision: 1.179 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3118,13 +3118,17 @@ acid_damage(obj) struct obj *obj; { /* Scrolls but not spellbooks can be erased by acid. */ - struct monst *victim = - carried(obj) ? &youmonst : mcarried(obj) ? obj->ocarry : NULL; - boolean vismon = victim && (victim != &youmonst) && canseemon(victim); + struct monst *victim; + boolean vismon; - if (obj->greased) + if (!obj) return; + + victim = carried(obj) ? &youmonst : mcarried(obj) ? obj->ocarry : NULL; + vismon = victim && (victim != &youmonst) && canseemon(victim); + + if (obj->greased) { grease_protect(obj, NULL, victim); - else if (obj->oclass == SCROLL_CLASS && obj->otyp != SCR_BLANK_PAPER) { + } else if (obj->oclass == SCROLL_CLASS && obj->otyp != SCR_BLANK_PAPER) { if (obj->otyp != SCR_BLANK_PAPER #ifdef MAIL && obj->otyp != SCR_MAIL From f4776d515d6ce22cb5c83fc01b5297005c9d9706 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 26 Mar 2015 08:44:24 +0200 Subject: [PATCH 267/354] Fix typos in fixes35.0 --- doc/fixes35.0 | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index a639b1ff6..6c43632a4 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -63,7 +63,7 @@ wizard mode: avoid division by 0 crash for level teleport in the endgame if don't #sit on an object in a pit if you're only on the precipice fix message when pushing a boulder into a pool while riding plural of "Nazgul" is "Nazgul" not "Nazguls" -trap messages referring to named steed were ackwardly worded when hallucination +trap messages referring to named steed were awkwardly worded when hallucination overrode use of the name some actions such as eating corpses off the floor didn't check whether hero could reach the bottom of a pit @@ -117,7 +117,7 @@ shopkeeper removal of trap from shop doorway yields an open door instead of a closed one if an intact open door is present guarantee that hostile djinn released from bottles really are hostile handle lava when removing or losing water walking boots -fix incomplete sentence occuring when unique monster's corpse fell down stairs +fix incomplete sentence occurring when unique monster's corpse fell down stairs fractured boulders or statues produced inconsistent object settings on the resulting rocks really fix rolling boulder bug C340-18, the previous "fix" reversed the test @@ -165,7 +165,7 @@ clean up messages when you stop levitation while riding a flying steed monsters evading a kick on noteleport levels would cause a "teleports" message interrupt current activity during certain stages of petrification or vomiting warning about bad food didn't recognize tin of Medusa meat -eating tainted Medusa corpse caused food poisioning instead of petrification +eating tainted Medusa corpse caused food poisoning instead of petrification avoid potential stale pointer use after magic bag explosion nymphs and monkeys can't steal rings worn under gloves monkeys can't steal rings worn under cursed weapon @@ -237,7 +237,7 @@ when there were multiple boulders at a location, moving one of them sometimes resulted in line-of-sight anomalies unicorn can't catch gems if it is asleep or paralyzed fix grammar when choking on gold -prevent lose-level+regain-level cycle from arbritrarily boosting HP and Pw +prevent lose-level+regain-level cycle from arbitrarily boosting HP and Pw prevent polymorphing into "new man" at low level from magnifying HP and Pw some messages which referred to "mirror" ought to have used "looking glass" incubi react to mirrors @@ -360,8 +360,8 @@ code handling a monster's use of potion or food to cure stoning or confusion properly handle destruction of equipment carried by monsters hit by disintegration breath; life-saving retained conferred properties of formerly worn items (loss of steed's saddle caused much confusion) -don't exercize or abuse wisdom when rumors get used for random graffiti -don't exercize wisdom twice for each minor oracle consultation +don't exercise or abuse wisdom when rumors get used for random graffiti +don't exercise wisdom twice for each minor oracle consultation don't welcome the hero to Delphi if the Oracle was angered before first entry create_object() created lizard corpses without timers and troll corpses with their revive timers, then changed the corpsenm field @@ -383,7 +383,7 @@ specifying role and/or race along with an invalid alignment for it/them in temple donation can recover protection previously stolen by attrcurse attack even when protection amount is so big that no increment would be given meditating monsters stop meditating when affected by something which wakes - sleeping mosnters + sleeping monsters monsters capable of hiding can't do so when trapped or while holding you limit recursive calls to spoteffects (poly'd hero fell into water, reverted to human because of it, fell into same water, then crawled out twice) @@ -474,7 +474,7 @@ suppress corpse from bones data if death is due to being dissolved in lava suppress "you rise from the dead" if game ends due to be turned into slime hero poly'd into stone golem and wielding cockatrice corpse casts stone-to- flesh at self to become flesh golem will revert to stone if no gloves -don't give erroneous " disppears" message for hero poly'd into quantum +don't give erroneous " disappears" message for hero poly'd into quantum mechanic who hits engulfer while swallowed and blinded demon lords/princes can't be summoned to the elemental or Astral planes feedback from casting spell of protection was wrong in some situations @@ -496,7 +496,7 @@ can't eat an artifact you're unable to touch attempting to kick beyond map edge performed an out of array bounds memory access; symptom seen was "show_glyph: bad pos" warning when blind attempting to engrave with an empty wand should always use a turn -don't access freed memory after engraving "wrests one last charnge" from wand +don't access freed memory after engraving "wrests one last charge" from wand a magic portal could be rendered inactive for the hero if a successful hangup save took place during level change; leaving the level by any means other than triggering the portal would reactivate it @@ -645,7 +645,7 @@ secret door detection's trap finding is no longer blocked by water or clouds potion thrown by monster which hit a long worm's tail gave feedback about hitting its head implement energy vortex's previously unused energy drain attack -changing alignment type resets alignment record to 0 (nomimally aligned) +changing alignment type resets alignment record to 0 (nominally aligned) jellyfish do not technically have a head while polymorphed, suppress attribute gain/lose earned by pre-poly exercise wizard mode #monpolycontrol prompting asked about "it" when monster was unseen @@ -670,7 +670,7 @@ if polymorph causes a monster to drop items, they won't be used up via monsters who ate green slime corpses weren't turned into green slime "hand slip" while naming an object would never pick 'z' as a substitute letter hero would "gladly take off " for nymph or succubus even while asleep -concealed mimic wasn't revealed if kicking attmpt yielded a clumsy miss +concealed mimic wasn't revealed if kicking attempt yielded a clumsy miss too accurate feedback given to a blinded hero when a monster summons insects if life-saved steed became untame, repeated "placing steed onto map?" warnings would be given as long as the hero remained mounted @@ -730,7 +730,7 @@ shouldn't have been able write scrolls by guessing type name when they're scrolls given names can be written by assigned name as well as by description fix writing feedback "the spellbook warps strangely, then turns parchment" make stone artifacts usually resist stone-to-flesh -when reading an unknown scroll and learning it, discovery of teleporation was +when reading an unknown scroll and learning it, discovery of teleportation was too late if hero happened to land on another scroll of teleportation using an unlocking tool on a closed door which was actually a mimic reported that there was no door to unlock instead of exposing the mimic @@ -760,7 +760,7 @@ for number_pad:2 (MSDOS compatibility), M-5 (Alt+5, or Shift+keypad5 using MSDOS/Windows keystroke hackery) didn't function as G movement prefix if an angry shopkeeper chased the hero to a different level and then got paid off, he'd dismiss kops on that other level but not on his shop level -objects inside the Wizard's Tower can't be teleport to outside and vica versa +objects inside the Wizard's Tower can't be teleport to outside and vice versa dying in lava and being life-saved or leaving bones would destroy ring of fire resistance if it happened to be made of wood, and also burn up scrolls of fire and spellbook of fireball @@ -786,7 +786,7 @@ when shop prices are adjusted, handle roundoff (integer truncation) better for hero poly'd into a monster form that lacks a weapon attack but has a claw attack, use wielded weapon even when claw attack isn't the very first rename the SLEEPING property and Sleeping attribute to SLEEPY and Sleepy, resp. -character escape sequence handling during options processing was vulernable +character escape sequence handling during options processing was vulnerable to malformed escapes and could potentially be abused to clobber the stack and launch a buffer overrun attack give alternate message for " turns to flee" when mon can't move @@ -815,7 +815,7 @@ hangup save made during magic mapping or detection performed while underwater could put hero on top of the water after restore fix bug preventing stone-resistant monsters w/o gloves from wielding cockatrices items conferring life drain resistance were affected by drain life spell -'a'pply command could be used to recogniize undiscovered potions of oil +'a'pply command could be used to recognize undiscovered potions of oil fix replacing an existing bones file in wizard mode [load?y, unlink?n, die?y, save?y, replace?y] for configurations using external file compression theft of worn armor with wear/unwear delay would interfere with completion of @@ -872,7 +872,7 @@ data.base "gelatinous cube" and "jack boot" have their own entries data.base "vampire bat" matched twice; use the bat entry data.base dagger attribution started with spaces instead of tabs remove 'if (Deaf)' guards preceding You_hear which already checks deafness -tse a menu to loot multiple containers +use a menu to loot multiple containers do_look() in post-3.4.3 used glyph prior to setting it in pager.c charge for a boulder that fills a pit in shop abuse wisdom in keeping with Rider eating message @@ -985,7 +985,7 @@ burying a punishment ball no longer ends your punishment add clicklook option to allow looking at things on the display by clicking right mouse button when floating mouse pointer over them Izchak's lighting store is now able to stock oil for your lamp -provide core support for saving of messsage history in save file +provide core support for saving of message history in save file the following actions can now be continued after save/restore: digging, eating, studying, removing armor hero-created and monster-created ice will eventually melt away From 4f0dc123c6accaa3b8be80fbc7a9328de41ea1c9 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 26 Mar 2015 11:41:05 +0200 Subject: [PATCH 268/354] Fix Guidebook typos --- doc/Guidebook.mn | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 14aa20239..32b894faa 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -714,7 +714,7 @@ via the ``#twoweapon'' extended command Since using this command by accident would be troublesome, you are asked to confirm your intent before switching to explore mode. By default the response 'y' acknowledges that intent. You can set the -.op paraniod_confirmation +.op paranoid_confirmation option to require a response of "yes" instead. .lp ^X Display basic information about your character. @@ -848,7 +848,7 @@ You probably shouldn't start off a new game by praying right away.) Since using this command by accident can cause trouble, there is an option to make you confirm your intent before praying. It is enabled by default, and you can reset the -.op paraniod_confirmation +.op paranoid_confirmation option to disable it. .lp #quit Quit the program without saving your game. @@ -856,7 +856,7 @@ Quit the program without saving your game. Since using this command by accident would throw away the current game, you are asked to confirm your intent before quitting. By default a response of 'y' acknowledges that intent. You can set the -.op paraniod_confirmation +.op paranoid_confirmation option to require a response of "yes" instead. .lp #ride Ride (or stop riding) a monster. @@ -1138,7 +1138,7 @@ In most circumstances, if you attempt to attack a peaceful monster by moving into its location, you'll be asked to confirm your intent. By default an answer of 'y' acknowledges that intent, which can be error prone if you're using 'y' to move. You can set the -.op paraniod_confirmation +.op paranoid_confirmation option to require a response of "yes" instead. .pg If you can't see a monster (if it is invisible, or if you are blinded), @@ -2175,7 +2175,7 @@ is the same as specifying 0. (Settings 2 and 4 are for compatibility with MSDOS or old PC Hack; in addition to the different behavior for `5', `Alt-5' acts as `G' and `Alt-0' acts as `I'. -Setting -1 is to accomodate some German keyboards which have the +Setting -1 is to accommodate some German keyboards which have the location of the `y' and `z' keys swapped.) When moving by numbers, to enter a count prefix for those commands which accept one (such as ``12s'' to search twelve times), precede it From 7d4298655d745d5d44bee098acbf59b2515b7e88 Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 26 Mar 2015 08:05:23 -0400 Subject: [PATCH 269/354] names of public servers and tournament contrib Changes to be committed: modified: dat/history --- dat/history | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dat/history b/dat/history index 0e15a079c..0a4a8471f 100644 --- a/dat/history +++ b/dat/history @@ -211,7 +211,8 @@ people primarily responsible for the public NetHack servers available for playing the game at nethack.alt.org and devnull.net. In addition to providing a way for the public to play a game of NetHack from almost anywhere, they have hosted annual NetHack tournaments for many, many years. - write up something for Robin, M. Drew Streib, Pasi Kallinen + On behalf of the NetHack community, thank you very much to +M. Drew Streib, Pasi Kallinen and Robin Bandy. - - - - - - - - - - From 9c29d74fedd98320762dbf79da460b8d822efa3d Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 26 Mar 2015 16:14:33 +0200 Subject: [PATCH 270/354] Fix typo in Guidebook.tex --- doc/Guidebook.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index c1cf2015e..e2d74df3a 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -2600,7 +2600,7 @@ is the same as specifying {\tt 0}. (Settings {\tt 2} and {\tt 4} are for compatibility with MSDOS or old PC Hack; in addition to the different behavior for `{\tt 5}', `{\tt Alt-5}' acts as `{\tt G}' and `{\tt Alt-0}' acts as `{\tt I}'. -Setting {\tt -1} is to accomodate some German keyboards which have the +Setting {\tt -1} is to accommodate some German keyboards which have the location of the `{\tt y}' and `{\tt z}' keys swapped.) When moving by numbers, to enter a count prefix for those commands which accept one (such as ``{\tt 12s}'' to search twelve times), precede it From 8c94f9337081b55c9a37df29ce01b4a1cf9f1abc Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 26 Mar 2015 16:46:41 +0200 Subject: [PATCH 271/354] Catch up and sync Guidebooks --- doc/Guidebook.mn | 8 +------- doc/Guidebook.tex | 41 ++++++++++++++++++++--------------------- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 32b894faa..4a0243fea 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -710,12 +710,6 @@ the exchange still takes place. .lp X Toggle two-weapon combat, if your character can do it. Also available via the ``#twoweapon'' extended command -.lp "" -Since using this command by accident would be troublesome, you are asked -to confirm your intent before switching to explore mode. By default -the response 'y' acknowledges that intent. You can set the -.op paranoid_confirmation -option to require a response of "yes" instead. .lp ^X Display basic information about your character. .lp "" @@ -2994,7 +2988,7 @@ command-line switch or with the .op playmode:explore option. The other is to issue the ``#exploremode'' extended command while already playing the game. Starting a new game in explore mode provides your -character with a wand of wishing in initial inventory; switching via `X' +character with a wand of wishing in initial inventory; switching during play does not. The other benefits of explore mode are left for the trepid reader to discover. .pg diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index e2d74df3a..6d3774946 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -862,13 +862,8 @@ two-weapon combat. Note that if one of these slots is empty, the exchange still takes place. %.lp \item[\tb{X}] -Enter explore (discovery) mode, explained in its own section later.\\ -%.lp "" -Since using this command by accident would be troublesome, you are asked -to confirm your intent before switching to explore mode. By default -the response `{\tt y}' acknowledges that intent. You can set the -{\it paranoid\_confirmation\/} -option to require a response of ``yes'' instead. +Toggle two-weapon combat, if your character can do it. Also available +via the ``#twoweapon'' extended command %.lp \item[\tb{\^{}X}] Display basic information about your character.\\ @@ -2275,8 +2270,7 @@ each entry. Such a sequence can be continued to multiple lines by putting a `{\tt \verb+\+}' at the end of each line to be continued. %.pg -If your copy of the game included the compile time AUTOPICKUP\_EXCEPTIONS -option, then any line starting with ``{\tt AUTOPICKUP\_EXCEPTION=}'' +Any line starting with ``{\tt AUTOPICKUP\_EXCEPTION=}'' is taken as defining an exception to the ``{\tt pickup\_types}'' option. There is a section of this Guidebook that discusses that. @@ -2327,6 +2321,9 @@ or make ready with the `Q' command instead. If no weapon is found or the option is false, the `t' (throw) command is executed instead. (default false) %.lp +\item[\ib{bones}] +Allow saving and loading bones files. (default true) +%.lp \item[\ib{boulder}] Set the character used to display boulders (default is rock class symbol). %.lp @@ -2475,6 +2472,9 @@ Enable mail delivery during the game (default on). An obsolete synonym for ``{\tt gender:male}''. Cannot be set with the `{\tt O}' command. %.lp +\item[\ib{mention\_walls}] +Give feedback when walking against a wall (default off). +%.lp \item[\ib{menustyle}] Controls the interface used when you need to choose various objects (in response to the Drop command, for instance). The value specified should @@ -2520,13 +2520,16 @@ Default `\verb+|+'. Menu character accelerator to goto the next menu page. Implemented by the Amiga, Gem and tty ports. Default `\verb+>+'. +\item[\ib{menu\_objsyms}] +Show object symbols in menu headings in menus where +the object symbols act as menu accelerators (default off). \item[\ib{menu\_previous\_page}] Menu character accelerator to goto the previous menu page. Implemented by the Amiga, Gem and tty ports. Default `\verb+<+'. \item[\ib{menu\_search}] Menu character accelerator to search for a menu item. -Implemented by the Amiga, Gem and X11 ports. +Implemented by the Amiga, Gem, X11 and tty ports. Default `:'. \item[\ib{menu\_select\_all}] Menu character accelerator to select all items in a menu. @@ -2678,10 +2681,8 @@ match an autopickup exception. Default is on. %.lp \item[\ib{pickup\_types}] Specify the object types to be picked up when ``{\it autopickup\/}'' -is on. Default is all types. If your copy of the game has the -compile time option AUTOPICKUP\_EXCEPTIONS included, -you may be able to use ``{\it autopickup\_exception\/}'' configuration -file lines to further refine ``{\it autopickup\/}'' behavior. +is on. Default is all types. You can use ``{\it autopickup\_exception\/}'' +configuration file lines to further refine ``{\it autopickup\/}'' behavior. %.lp \item[\ib{pile\_limit}] When walking across a pile of objects on the floor, threshold at which @@ -3074,10 +3075,8 @@ Cannot be set with the `{\tt O}' command. \subsection*{Configuring autopickup exceptions} %.pg -There is a compile time option called AUTOPICKUP_EXCEPTIONS. -If your copy of the game was built with that option defined, you can -further refine the behavior of the ``{\tt autopickup}'' option beyond -what is available through the ``{\tt pickup\_types}'' option. +You can further refine the behavior of the ``{\tt autopickup}'' option +beyond what is available through the ``{\tt pickup\_types}'' option. %.pg By placing ``{\tt autopickup\_exception}'' lines in your configuration @@ -3505,9 +3504,9 @@ There are two ways of enabling explore mode. One is to start the game with the {\tt -X} command-line switch or with the {\it playmode:explore\/} -option. The other is to issue the `{\tt X}' command while already -playing the game. Starting a new game in explore mode provides your -character with a wand of wishing in initial inventory; switching via `X' +option. The other is to issue the `{\tt #exploremode}' extended command while +already playing the game. Starting a new game in explore mode provides your +character with a wand of wishing in initial inventory; switching during play does not. The other benefits of explore mode are left for the trepid reader to discover. From 896fb1524900b4aada80b1a2727cf2189db6591f Mon Sep 17 00:00:00 2001 From: nhmall Date: Thu, 26 Mar 2015 12:40:22 -0400 Subject: [PATCH 272/354] sync docs Pasi pointed it out that the SYSCF stuff was only added to Guidebook.mn not Guidebook.tex --- doc/Guidebook.tex | 64 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index c1cf2015e..6a7524bcc 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -2224,7 +2224,8 @@ command allows you to view all options and change most of them. You can also set options automatically by placing them in the ``NETHACKOPTIONS'' environment variable or in a configuration file. Some versions of {\it NetHack\/} also have front-end programs that allow -you to set options before starting the game. +you to set options before starting the game or a global configuration +for system administrators. %.hn 2 \subsection*{Using the NETHACKOPTIONS environment variable} @@ -3459,6 +3460,65 @@ If this is the case, disable the number\_pad option and use the traditional Rogue-like commands. \elist +%.hn2 +\subsection*{Global Configuration for System Administrators} + +%.pg +If NetHack is compiled with teh SYSCF option, a system administrator +should set up a global configuration; this is a file in the +same format as the traditional per-user configuration file (see above). + +This file should be named sysconf and placed in the same directory as +the other NetHack support files. +The options recognized in this file are listed below. Any option not +set uses a compiled-in default (which may not be appropriate for your +system). + +%.pg +\blist{} +%.lp +\item[\ib{WIZARDS}] +A space-separated list of user name who are allowed to play in wizard +mode (the debugging mode, not the magic-useing role). A value of a single +asterisk (*) allows anyone to start a game in wizard mode. +%.lp +\item[\ib{SHELLERS}] +A list of users who are allowed to use the shell escape command (!). +The syntax is the same as WIZARDS. +%.lp +\item[\ib{MAXPLAYERS}] +Limit the maximum number of games taht can be running at the same time. +%.lp +\item[\ib{SUPPORT}] +A string explainign how to get local support (no default value). +%.lp +\item[\ib{RECOVER}] +A string explaining how to recover a game on this system (no default value). +%.lp +\item[\ib{SEDUCE}] +0 or 1 to disable or enable, respectively, the SEDUCE option (see the source) +for details on this function. +\elist + +%.pg +The following options affect the score file: +\blist {} +%.pg +%.lp +\item[\ib{PERSMAX}] +Maximum number of entries for one person +%.lp +\item[\ib{ENTRYMAX}] +Maximum number of entries in the score file +%.lp +\item[\ib{POINTSMIN}] +Minimum number of points to get an entry in the score file. +%.lp +\item[\ib{PERS_IS_UID}] +0 or 1 to use user names or numeric userids, respectively, to identify +unique people for the score file +\elist + %.hn 1 \section{Scoring} @@ -3782,7 +3842,7 @@ resurrected it for 3.3.1. %.pg \medskip -\nd There is a NetHack web site maintained by {\it Ken Lorber} at +\nd The official NetHack web site is maintained by {\it Ken Lorber} at {\catcode`\#=11 \special{html:}} http:{\tt /}{\tt /}www.nethack.org{\tt /}. From ed85d3f1586910c1ef2a049047db0212eaf72a6d Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 27 Mar 2015 00:21:40 -0700 Subject: [PATCH 273/354] objnam formatting for bag of tricks Bag of tricks that had been used at least once was being described as "empty" regardless of charge count, because it always fails the Has_contents() test. After half this patch fixed that, it started being flagged as "empty" as soon as the last charge was used rather than after attempting to use it again after that, since 'cknown' was being set whenever it was used. Only set that flag when applying the bag has been observed to fail. --- src/makemon.c | 6 +----- src/objnam.c | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/makemon.c b/src/makemon.c index 6ce548ea0..799438c2e 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 makemon.c $NHDT-Date: 1426465436 2015/03/16 00:23:56 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.74 $ */ +/* NetHack 3.5 makemon.c $NHDT-Date: 1427440865 2015/03/27 07:21:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.75 $ */ /* NetHack 3.5 makemon.c $Date: 2012/01/29 00:34:33 $ $Revision: 1.69 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1884,10 +1884,6 @@ int *seencount; /* secondary output */ } while (--creatcnt > 0); if (seecount) { if (seencount) *seencount += seecount; - /* don't set contents-known flag if we just used last charge - (such suppression doesn't actually gain us much since - player can now deduce that the bag has become empty) */ - if (bag->spe > 0) bag->cknown = 1; if (bag->dknown) makeknown(BAG_OF_TRICKS); } else if (!tipping) { pline1(!moncount ? nothing_happens : "Nothing seems to happen."); diff --git a/src/objnam.c b/src/objnam.c index 898dfb60a..54923ce1e 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 objnam.c $NHDT-Date: 1426977394 2015/03/21 22:36:34 $ $NHDT-Branch: master $:$NHDT-Revision: 1.108 $ */ +/* NetHack 3.5 objnam.c $NHDT-Date: 1427440866 2015/03/27 07:21:06 $ $NHDT-Branch: master $:$NHDT-Revision: 1.109 $ */ /* NetHack 3.5 objnam.c $Date: 2011/10/27 02:24:54 $ $Revision: 1.101 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -651,8 +651,9 @@ register struct obj *obj; */ register char *bp = xname(obj); - if (iflags.override_ID) known = cknown = bknown = lknown = TRUE; - else { + if (iflags.override_ID) { + known = cknown = bknown = lknown = TRUE; + } else { known = obj->known; cknown = obj->cknown; bknown = obj->bknown; @@ -685,7 +686,15 @@ register struct obj *obj; /* "empty" goes at the beginning, but item count goes at the end */ if (cknown && - (Is_container(obj) || obj->otyp == STATUE) && !Has_contents(obj)) + /* bag of tricks: include "empty" prefix if it's known to + be empty but its precise number of charges isn't known + (when that is known, suffix of "(n:0)" will be appended, + making the prefix be redundant; note that 'known' flag + isn't set when emptiness gets discovered because then + charging magic would yield known number of new charges) */ + (obj->otyp == BAG_OF_TRICKS ? (obj->spe == 0 && !obj->known) : + /* not bag of tricks: empty if container which has no contents */ + (Is_container(obj) || obj->otyp == STATUE) && !Has_contents(obj))) Strcat(prefix, "empty "); if (bknown && From 08654c213cc810f283669dcb6c72ae9805d06711 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 27 Mar 2015 15:12:04 +0200 Subject: [PATCH 274/354] Fix passing non-static buffer out of scope --- src/pager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pager.c b/src/pager.c index bb1c82e72..f2f5b9968 100644 --- a/src/pager.c +++ b/src/pager.c @@ -447,7 +447,8 @@ const char **firstmatch; { boolean need_to_look = FALSE; int glyph; - char look_buf[BUFSZ], prefix[BUFSZ]; + static char look_buf[BUFSZ]; + char prefix[BUFSZ]; int found = 0; /* count of matching syms found */ int i; int skipped_venom = 0; From 911a3756c6dba95d7b6039f1a740ff278b269943 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 27 Mar 2015 15:29:54 +0200 Subject: [PATCH 275/354] TTY: Guard against impossible x coord If a menu item was longer than terminal width, the menu wasn't cleared away after it was finished with. This easily happened when an inventory item was named. --- win/tty/wintty.c | 1 + 1 file changed, 1 insertion(+) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 553553744..f3cc97eb5 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1809,6 +1809,7 @@ tty_display_nhwindow(window, blocking) cw->offx = (uchar) (int) max((int) 10, (int) (ttyDisplay->cols - cw->maxcol - 1)); #endif + if(cw->offx < 0) cw->offx = 0; if(cw->type == NHW_MENU) cw->offy = 0; if(ttyDisplay->toplin == 1) From 2e2d020a591a9a831827f0eb44fae56d29a1a220 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 27 Mar 2015 16:08:06 +0200 Subject: [PATCH 276/354] Show t-shirt text at end of game inventory disclose Restricting the text display only to the end of game disclose, so it doesn't clutter the inventory during gameplay and so that the readability of t-shirts is not given away. --- include/extern.h | 1 + src/objnam.c | 5 ++++ src/read.c | 61 +++++++++++++++++++++++++++--------------------- 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/include/extern.h b/include/extern.h index 30e6c6d43..d6347207c 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1824,6 +1824,7 @@ E long NDECL(random); /* ### read.c ### */ E void FDECL(learnscroll, (struct obj *)); +E char *FDECL(tshirt_text, (struct obj *, char *)); E int NDECL(doread); E boolean FDECL(is_chargeable, (struct obj *)); E void FDECL(recharge, (struct obj *,int)); diff --git a/src/objnam.c b/src/objnam.c index 54923ce1e..f40222c3b 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -489,6 +489,11 @@ register struct obj *obj; } if (pluralize) Strcpy(buf, makeplural(buf)); + if (obj->otyp == T_SHIRT && program_state.gameover) { + char tmpbuf[BUFSZ]; + Sprintf(eos(buf), " with text \"%s\"", tshirt_text(obj, tmpbuf)); + } + if (has_oname(obj) && dknown) { Strcat(buf, " named "); nameit: diff --git a/src/read.c b/src/read.c index 9be9f9390..26e9f2f62 100644 --- a/src/read.c +++ b/src/read.c @@ -53,6 +53,39 @@ struct obj *sobj; (void) learnscrolltyp(sobj->otyp); } +char * +tshirt_text(tshirt, buf) +struct obj *tshirt; +char *buf; +{ + static const char *shirt_msgs[] = { /* Scott Bigham */ + "I explored the Dungeons of Doom and all I got was this lousy T-shirt!", + "Is that Mjollnir in your pocket or are you just happy to see me?", + "It's not the size of your sword, it's how #enhance'd you are with it.", + "Madame Elvira's House O' Succubi Lifetime Customer", + "Madame Elvira's House O' Succubi Employee of the Month", + "Ludios Vault Guards Do It In Small, Dark Rooms", + "Yendor Military Soldiers Do It In Large Groups", + "I survived Yendor Military Boot Camp", + "Ludios Accounting School Intra-Mural Lacrosse Team", + "Oracle(TM) Fountains 10th Annual Wet T-Shirt Contest", + "Hey, black dragon! Disintegrate THIS!", + "I'm With Stupid -->", + "Don't blame me, I voted for Izchak!", + "Don't Panic", /* HHGTTG */ + "Furinkan High School Athletic Dept.", /* Ranma 1/2 */ + "Hel-LOOO, Nurse!", /* Animaniacs */ + }; + int erosion; + Strcpy(buf, shirt_msgs[tshirt->o_id % SIZE(shirt_msgs)]); + erosion = greatest_erosion(tshirt); + if (erosion) + wipeout_text(buf, + (int)(strlen(buf) * erosion / (2*MAX_ERODE)), + tshirt->o_id ^ (unsigned)ubirthday); + return buf; +} + int doread() { @@ -73,27 +106,7 @@ doread() useup(scroll); return(1); } else if (scroll->otyp == T_SHIRT) { - static const char *shirt_msgs[] = { /* Scott Bigham */ - "I explored the Dungeons of Doom and all I got was this lousy T-shirt!", - "Is that Mjollnir in your pocket or are you just happy to see me?", - "It's not the size of your sword, it's how #enhance'd you are with it.", - "Madame Elvira's House O' Succubi Lifetime Customer", - "Madame Elvira's House O' Succubi Employee of the Month", - "Ludios Vault Guards Do It In Small, Dark Rooms", - "Yendor Military Soldiers Do It In Large Groups", - "I survived Yendor Military Boot Camp", - "Ludios Accounting School Intra-Mural Lacrosse Team", - "Oracle(TM) Fountains 10th Annual Wet T-Shirt Contest", - "Hey, black dragon! Disintegrate THIS!", - "I'm With Stupid -->", - "Don't blame me, I voted for Izchak!", - "Don't Panic", /* HHGTTG */ - "Furinkan High School Athletic Dept.", /* Ranma 1/2 */ - "Hel-LOOO, Nurse!", /* Animaniacs */ - }; char buf[BUFSZ]; - int erosion; - if (Blind) { You_cant("feel any Braille writing."); return 0; @@ -108,13 +121,7 @@ doread() u.uconduct.literate++; if(flags.verbose) pline("It reads:"); - Strcpy(buf, shirt_msgs[scroll->o_id % SIZE(shirt_msgs)]); - erosion = greatest_erosion(scroll); - if (erosion) - wipeout_text(buf, - (int)(strlen(buf) * erosion / (2*MAX_ERODE)), - scroll->o_id ^ (unsigned)ubirthday); - pline("\"%s\"", buf); + pline("\"%s\"", tshirt_text(scroll, buf)); return 1; } else if (scroll->oclass != SCROLL_CLASS && scroll->oclass != SPBOOK_CLASS) { From 870b124f14194f50bf4cb4383d646b0874b688d7 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 27 Mar 2015 21:04:01 +0200 Subject: [PATCH 277/354] Allow reading many more items You can now also read alchemy smocks, credit cards, cans of grease, magic markers, gold, the Orb of Fate, and candy bars. --- include/obj.h | 11 +++++ src/invent.c | 4 +- src/read.c | 131 ++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 134 insertions(+), 12 deletions(-) diff --git a/include/obj.h b/include/obj.h index 7af927919..44876bcb4 100644 --- a/include/obj.h +++ b/include/obj.h @@ -303,6 +303,17 @@ struct obj { || (otmp)->otyp == WAX_CANDLE\ || (otmp)->otyp == POT_OIL) +/* things that can be read */ +#define is_readable(otmp) ((otmp)->otyp == FORTUNE_COOKIE\ + || (otmp)->otyp == T_SHIRT\ + || (otmp)->otyp == ALCHEMY_SMOCK\ + || (otmp)->otyp == CREDIT_CARD\ + || (otmp)->otyp == CAN_OF_GREASE\ + || (otmp)->otyp == MAGIC_MARKER\ + || (otmp)->oclass == COIN_CLASS\ + || (otmp)->oartifact == ART_ORB_OF_FATE\ + || (otmp)->otyp == CANDY_BAR) + /* special stones */ #define is_graystone(obj) ((obj)->otyp == LUCKSTONE || \ (obj)->otyp == LOADSTONE || \ diff --git a/src/invent.c b/src/invent.c index e5100ee5e..2cc9e9004 100644 --- a/src/invent.c +++ b/src/invent.c @@ -915,8 +915,8 @@ register const char *let,*word; /* "ugly check" for reading fortune cookies, part 2 */ if ((!strcmp(word, "read") - && (otmp->otyp == FORTUNE_COOKIE || otmp->otyp == T_SHIRT))) - allowall = TRUE; + && is_readable(otmp))) + allowall = usegold = TRUE; } } bp[foo] = 0; diff --git a/src/read.c b/src/read.c index 26e9f2f62..51a5b5295 100644 --- a/src/read.c +++ b/src/read.c @@ -53,6 +53,19 @@ struct obj *sobj; (void) learnscrolltyp(sobj->otyp); } +char * +erode_obj_text(otmp, buf) +struct obj *otmp; +char *buf; +{ + int erosion = greatest_erosion(otmp); + if (erosion) + wipeout_text(buf, + (int)(strlen(buf) * erosion / (2*MAX_ERODE)), + otmp->o_id ^ (unsigned)ubirthday); + return buf; +} + char * tshirt_text(tshirt, buf) struct obj *tshirt; @@ -76,14 +89,28 @@ char *buf; "Furinkan High School Athletic Dept.", /* Ranma 1/2 */ "Hel-LOOO, Nurse!", /* Animaniacs */ }; - int erosion; Strcpy(buf, shirt_msgs[tshirt->o_id % SIZE(shirt_msgs)]); - erosion = greatest_erosion(tshirt); - if (erosion) - wipeout_text(buf, - (int)(strlen(buf) * erosion / (2*MAX_ERODE)), - tshirt->o_id ^ (unsigned)ubirthday); - return buf; + return erode_obj_text(tshirt, buf); +} + +char * +apron_text(apron, buf) +struct obj *apron; +char *buf; +{ + static const char *apron_msgs[] = { + "Kiss the cook", + "I'm making SCIENCE!", + "Don't mess with the chef", + "Don't make me poison you", + "Gehennom's Kitchen", + "Rat: The other white meat", + "If you can't stand the heat, get out of Gehennom!", + "If we weren't meant to eat animals, why are they made out of meat?", + "If you don't like the food, I'll stab you", + }; + Strcpy(buf, apron_msgs[apron->o_id % SIZE(apron_msgs)]); + return erode_obj_text(apron, buf); } int @@ -105,14 +132,15 @@ doread() if (!Blind) u.uconduct.literate++; useup(scroll); return(1); - } else if (scroll->otyp == T_SHIRT) { + } else if (scroll->otyp == T_SHIRT || + scroll->otyp == ALCHEMY_SMOCK) { char buf[BUFSZ]; if (Blind) { You_cant("feel any Braille writing."); return 0; } /* can't read shirt worn under suit (under cloak is ok though) */ - if (uarm && scroll == uarmu) { + if (scroll->otyp == T_SHIRT && uarm && scroll == uarmu) { pline("%s shirt is obscured by %s%s.", scroll->unpaid ? "That" : "Your", shk_your(buf, uarm), suit_simple_name(uarm)); @@ -121,7 +149,90 @@ doread() u.uconduct.literate++; if(flags.verbose) pline("It reads:"); - pline("\"%s\"", tshirt_text(scroll, buf)); + pline("\"%s\"", (scroll->otyp == T_SHIRT) + ? tshirt_text(scroll, buf) + : apron_text(scroll, buf)); + return 1; + } else if (scroll->otyp == CREDIT_CARD) { + static const char *card_msgs[] = { + "Leprechaun Gold Tru$t - Shamrock Card", + "Magic Memory Vault Charge Card", + "Larn National Bank", /* Larn */ + "First Bank of Omega", /* Omega */ + "Bank of Zork - Frobozz Magic Card", /* Zork */ + "Ankh-Morpork Merchant's Guild Barter Card", + "Ankh-Morpork Thieves' Guild Unlimited Transaction Card", + "Ransmannsby Moneylenders Association", + "Bank of Gehennom - 99% Interest Card", + "Yendorian Express - Copper Card", + "Yendorian Express - Silver Card", + "Yendorian Express - Gold Card", + "Yendorian Express - Mithril Card", + "Yendorian Express - Platinum Card", /* must be last */ + }; + if (Blind) { + You("feel the embossed numbers:"); + } else { + if(flags.verbose) + pline("It reads:"); + pline("\"%s\"", scroll->oartifact ? card_msgs[SIZE(card_msgs)-1] + : card_msgs[scroll->o_id % (SIZE(card_msgs)-1)]); + } + /* Make a credit card number */ + pline("\"%d0%d %d%d1 0%d%d0\"", ((scroll->o_id % 89)+10), (scroll->o_id % 4), + (((scroll->o_id * 499) % 899999) + 100000), (scroll->o_id % 10), + (!(scroll->o_id % 3)), ((scroll->o_id * 7) % 10)); + u.uconduct.literate++; + return 1; + } else if (scroll->otyp == CAN_OF_GREASE) { + pline("This %s has no label.", singular(scroll, xname)); + return 0; + } else if (scroll->otyp == MAGIC_MARKER) { + if (Blind) { + You_cant("feel any Braille writing."); + return 0; + } + if (flags.verbose) + pline("It reads:"); + pline("\"Magic Marker(TM) Red Ink Marker Pen. Water Soluble.\""); + u.uconduct.literate++; + return 1; + } else if (scroll->oclass == COIN_CLASS) { + if (Blind) + You("feel the embossed words:"); + else if (flags.verbose) + You("read:"); + pline("\"1 Zorkmid. 857 GUE. In Frobs We Trust.\""); + u.uconduct.literate++; + return 1; + } else if (scroll->oartifact == ART_ORB_OF_FATE) { + if (Blind) + You("feel the engraved signature:"); + else pline("It is signed:"); + pline("\"Odin.\""); + u.uconduct.literate++; + return 1; + } else if (scroll->otyp == CANDY_BAR) { + static const char *wrapper_msgs[] = { + "Apollo", /* Lost */ + "Moon Crunchy", /* South Park */ + "Snacky Cake", + "Chocolate Nuggie", + "The Small Bar", + "Crispy Yum Yum", + "Nilla Crunchie", + "Berry Bar", + "Choco Nummer", + "Om-nom", /* Cat Macro */ + "Fruity Oaty", /* Serenity */ + "Wonka" /* Charlie and the Chocolate Factory */ + }; + if (Blind) { + You_cant("feel any Braille writing."); + return 0; + } + pline("The wrapper reads: \"%s\"", wrapper_msgs[scroll->o_id % SIZE(wrapper_msgs)]); + u.uconduct.literate++; return 1; } else if (scroll->oclass != SCROLL_CLASS && scroll->oclass != SPBOOK_CLASS) { From c5ea07356918d59dd5627f3a3ef4e199df40f433 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 27 Mar 2015 22:11:41 +0200 Subject: [PATCH 278/354] Update fixes35.0 with reading items --- doc/fixes35.0 | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 6c43632a4..1e4bdbe16 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1096,6 +1096,7 @@ pressing @ when cursor positioning moves cursor on top of hero pressing # when cursor positioning toggles automatic description of features under the cursor cursor positioning ignores uninteresting dungeon features +allow reading many more items Platform- and/or Interface-Specific New Features From 5c876419854eac8f219a888b9bcf66e57a2ede77 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 27 Mar 2015 22:13:35 +0200 Subject: [PATCH 279/354] Update fixes35.0 with t-shirt text disclose --- doc/fixes35.0 | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 1e4bdbe16..6b59f340f 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -885,6 +885,7 @@ after object loss through polyshudder don't get left hiding under nothing if you're polymorphed into a hider show object symbols in menu headings in menus where those object symbols act as menu accelerators, toggleable via "menu_objsyms" option +show t-shirt text at end of game inventory disclose Platform- and/or Interface-Specific Fixes From 5bb4a02ffe0502a4e5f850f51457c6c281400172 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 27 Mar 2015 23:29:30 +0200 Subject: [PATCH 280/354] Remember position of monster you hit with polearm If you hit a monster with a polearm, following polearm applications will try to automatically suggest the monster's position --- doc/fixes35.0 | 1 + include/context.h | 6 ++++++ include/patchlevel.h | 2 +- src/apply.c | 12 ++++++++++-- src/do.c | 1 + src/mon.c | 2 ++ src/restore.c | 4 ++++ src/save.c | 7 ++++++- 8 files changed, 31 insertions(+), 4 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 6b59f340f..601be2ee0 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -886,6 +886,7 @@ after object loss through polyshudder don't get left hiding under nothing show object symbols in menu headings in menus where those object symbols act as menu accelerators, toggleable via "menu_objsyms" option show t-shirt text at end of game inventory disclose +hitting with a polearm remembers the position of the last monster you hit Platform- and/or Interface-Specific Fixes diff --git a/include/context.h b/include/context.h index ebfe1ada7..7a73344af 100644 --- a/include/context.h +++ b/include/context.h @@ -73,6 +73,11 @@ struct warntype_info { short speciesidx; /* index of above in mons[] (for save/restore) */ }; +struct polearm_info { + struct monst *hitmon; /* the monster we tried to hit last */ + unsigned m_id; /* monster id of hitmon, in save file */ +}; + struct context_info { unsigned ident; /* social security number for each monster */ unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */ @@ -103,6 +108,7 @@ struct context_info { struct book_info spbook; struct takeoff_info takeoff; struct warntype_info warntype; + struct polearm_info polearm; }; extern NEARDATA struct context_info context; diff --git a/include/patchlevel.h b/include/patchlevel.h index eab90e89f..1b0ebf241 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -14,7 +14,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 58 +#define EDITLEVEL 59 #define COPYRIGHT_BANNER_A \ "NetHack, Copyright 1985-2015" diff --git a/src/apply.c b/src/apply.c index fd3193fb3..185ca80ad 100644 --- a/src/apply.c +++ b/src/apply.c @@ -2539,6 +2539,7 @@ use_pole(obj) int res = 0, typ, max_range, min_range, glyph; coord cc; struct monst *mtmp; + struct monst *hitm = context.polearm.hitmon; /* Are you allowed to use the pole? */ if (u.uswallow) { @@ -2553,8 +2554,13 @@ use_pole(obj) /* Prompt for a location */ pline(where_to_hit); - cc.x = u.ux; - cc.y = u.uy; + if (hitm && !DEADMONSTER(hitm) && cansee(hitm->mx, hitm->my)) { + cc.x = hitm->mx; + cc.y = hitm->my; + } else { + cc.x = u.ux; + cc.y = u.uy; + } if (getpos(&cc, TRUE, "the spot to hit") < 0) return res; /* ESC; uses turn iff polearm became wielded */ @@ -2596,11 +2602,13 @@ use_pole(obj) return res; } + context.polearm.hitmon = NULL; /* Attack the monster there */ bhitpos = cc; if ((mtmp = m_at(bhitpos.x, bhitpos.y)) != (struct monst *)0) { if (attack_checks(mtmp, uwep)) return res; if (overexertion()) return 1; /* burn nutrition; maybe pass out */ + context.polearm.hitmon = mtmp; check_caitiff(mtmp); notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my); (void) thitmonst(mtmp, uwep); diff --git a/src/do.c b/src/do.c index b387752d6..c690ad4fa 100644 --- a/src/do.c +++ b/src/do.c @@ -1402,6 +1402,7 @@ boolean at_stairs, falling, portal; /* assume this will always return TRUE when changing level */ (void) in_out_region(u.ux, u.uy); (void) pickup(1); + context.polearm.hitmon = NULL; } STATIC_OVL void diff --git a/src/mon.c b/src/mon.c index d9bc63d6d..607845e7a 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1237,6 +1237,8 @@ dmonsfree() for (mtmp = &fmon; *mtmp;) { freetmp = *mtmp; if (freetmp->mhp <= 0 && !freetmp->isgd) { + if (freetmp == context.polearm.hitmon) + context.polearm.hitmon = NULL; *mtmp = freetmp->nmon; dealloc_monst(freetmp); count++; diff --git a/src/restore.c b/src/restore.c index 4e4502b53..be1126be8 100644 --- a/src/restore.c +++ b/src/restore.c @@ -446,6 +446,10 @@ boolean ghostly; if (mtmp->isshk) restshk(mtmp, ghostly); if (mtmp->ispriest) restpriest(mtmp, ghostly); + if (!ghostly) { + if (mtmp->m_id == context.polearm.m_id) + context.polearm.hitmon = mtmp; + } mtmp2 = mtmp; } if(first && mtmp2->nmon){ diff --git a/src/save.c b/src/save.c index f94b1857c..4a4363e9e 100644 --- a/src/save.c +++ b/src/save.c @@ -1124,8 +1124,13 @@ register struct monst *mtmp; } if (mtmp->minvent) saveobjchn(fd,mtmp->minvent,mode); - if (release_data(mode)) + if (release_data(mode)) { + if (mtmp == context.polearm.hitmon) { + context.polearm.m_id = mtmp->m_id; + context.polearm.hitmon = NULL; + } dealloc_monst(mtmp); + } mtmp = mtmp2; } if (perform_bwrite(mode)) From 13645dcd2a2efa96403898fbeb361f296e55b271 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 00:32:54 +0200 Subject: [PATCH 281/354] Automatically find monster to target with polearm If there's only one suitable monster within range, automatically suggest it for targeting with the polearm --- src/apply.c | 51 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/src/apply.c b/src/apply.c index 185ca80ad..4d6899710 100644 --- a/src/apply.c +++ b/src/apply.c @@ -2531,6 +2531,28 @@ static const char cant_see_spot[] = "won't hit anything if you can't see that spot.", cant_reach[] = "can't reach that spot from here."; +/* find pos of monster in range, if only one monster */ +boolean +find_poleable_mon(pos, min_range, max_range) +coord *pos; +int min_range, max_range; +{ + struct monst *mtmp; + struct monst *selmon = NULL; + for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) + if (mtmp && !DEADMONSTER(mtmp) && !mtmp->mtame && + cansee(mtmp->mx, mtmp->my) && + distu(mtmp->mx, mtmp->my) <= max_range && + distu(mtmp->mx, mtmp->my) >= min_range) { + if (selmon) return FALSE; + selmon = mtmp; + } + if (!selmon) return FALSE; + pos->x = selmon->mx; + pos->y = selmon->my; + return TRUE; +} + /* Distance attacks by pole-weapons */ STATIC_OVL int use_pole(obj) @@ -2552,20 +2574,7 @@ use_pole(obj) } /* assert(obj == uwep); */ - /* Prompt for a location */ - pline(where_to_hit); - if (hitm && !DEADMONSTER(hitm) && cansee(hitm->mx, hitm->my)) { - cc.x = hitm->mx; - cc.y = hitm->my; - } else { - cc.x = u.ux; - cc.y = u.uy; - } - if (getpos(&cc, TRUE, "the spot to hit") < 0) - return res; /* ESC; uses turn iff polearm became wielded */ - - glyph = glyph_at(cc.x, cc.y); - /* + /* * Calculate allowable range (pole's reach is always 2 steps): * unskilled and basic: orthogonal direction, 4..4; * skilled: as basic, plus knight's jump position, 4..5; @@ -2585,6 +2594,20 @@ use_pole(obj) if (typ == P_NONE || P_SKILL(typ) <= P_BASIC) max_range = 4; else if (P_SKILL(typ) == P_SKILLED) max_range = 5; else max_range = 8; /* (P_SKILL(typ) >= P_EXPERT) */ + + /* Prompt for a location */ + pline(where_to_hit); + if (hitm && !DEADMONSTER(hitm) && cansee(hitm->mx, hitm->my)) { + cc.x = hitm->mx; + cc.y = hitm->my; + } else if (!find_poleable_mon(&cc, min_range, max_range)) { + cc.x = u.ux; + cc.y = u.uy; + } + if (getpos(&cc, TRUE, "the spot to hit") < 0) + return res; /* ESC; uses turn iff polearm became wielded */ + + glyph = glyph_at(cc.x, cc.y); if (distu(cc.x, cc.y) > max_range) { pline("Too far!"); return (res); From 76ee82b7d3061e60a8c121024bcc2b5fcc4c6517 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 27 Mar 2015 19:47:17 -0400 Subject: [PATCH 282/354] more doc updates Changes to be committed: modified: dat/history modified: doc/Guidebook.mn modified: doc/Guidebook.tex --- dat/history | 73 ++++++++++----------- doc/Guidebook.mn | 143 ++++++++++++++++++++++++++++++----------- doc/Guidebook.tex | 160 +++++++++++++++++++++++++++++++++++----------- 3 files changed, 265 insertions(+), 111 deletions(-) diff --git a/dat/history b/dat/history index 0a4a8471f..060982446 100644 --- a/dat/history +++ b/dat/history @@ -128,20 +128,20 @@ just before the release of NetHack 3.4.0 in March 2002. As with version 3.3, various people contributed to the game as a whole as well as supporting ports on the different platforms that NetHack runs on: -Pat Rankin maintained 3.5 for VMS. +Pat Rankin maintained 3.4 for VMS. -Michael Allison maintained NetHack 3.5 for the MS-DOS platform. +Michael Allison maintained NetHack 3.4 for the MS-DOS platform. Paul Winner and Yitzhak Sapir provided encouragement. Dean Luick, Mark Modrall, and Kevin Hugo maintained and enhanced the Macintosh port of 3.4. Michael Allison, David Cohrs, Alex Kompel, Dion Nicolaas, and Yitzhak Sapir -maintained and enhanced 3.5 for the Microsoft Windows platform. Alex Kompel +maintained and enhanced 3.4 for the Microsoft Windows platform. Alex Kompel contributed a new graphical interface for the Windows port. Alex Kompel also contributed a Windows CE port for 3.4.1. -Ron Van Iwaarden maintained 3.5 for OS/2. +Ron Van Iwaarden maintained 3.4 for OS/2. Janne Salmijarvi and Teemu Suikki maintained and enhanced the Amiga port of 3.5 after Janne Salmijarvi resurrected it for 3.3.1. @@ -174,7 +174,6 @@ At the beginning of development for what would eventually get released as 3.6.0, the development team consisted of Michael Allison, Warwick Allison, Ken Arromdee, David Cohrs, Jessie Collet, Ken Lorber, Dean Luick, Pat Rankin, Mike Stephenson, Janet Walz, and Paul Winner. - Leading up to the release of 3.6.0 in early 2015, new members Sean Hunt, Pasi Kallinen, and Derek S. Ray joined the NetHack development team. @@ -211,7 +210,8 @@ people primarily responsible for the public NetHack servers available for playing the game at nethack.alt.org and devnull.net. In addition to providing a way for the public to play a game of NetHack from almost anywhere, they have hosted annual NetHack tournaments for many, many years. - On behalf of the NetHack community, thank you very much to + +On behalf of the NetHack community, thank you very much to M. Drew Streib, Pasi Kallinen and Robin Bandy. - - - - - - - - - - @@ -221,11 +221,11 @@ particularly intriguing modification to help out with the game. The Gods of the Dungeon sometimes make note of the names of the worst of these miscreants in this, the list of Dungeoneers: - Adam Aronow Izchak Miller Mike Stephenson - Alex Kompel J. Ali Harlow Norm Meluch - Andreas Dorn Janet Walz Olaf Seibert - Andy Church Janne Salmijarvi Pasi Kallinen - Andy Swanson Jean-Christophe Collet Pat Rankin + Adam Aronow J. Ali Harlow Mike Stephenson + Alex Kompel Janet Walz Norm Meluch + Andreas Dorn Janne Salmijarvi Olaf Seibert + Andy Church Jean-Christophe Collet Pasi Kallinen + Andy Swanson Jeff Bailey Pat Rankin Ari Huttunen Jochen Erwied Paul Winner Barton House John Kallen Pierre Martineau Benson I. Margulies John Rupley Ralf Brown @@ -234,29 +234,30 @@ in this, the list of Dungeoneers: Bruce Cox Jon W{tte Richard Beigel Bruce Holloway Jonathan Handler Richard P. Hughey Bruce Mewborne Joshua Delahunty Rob Menke - Carl Schelin Keizo Yamamoto Robin Johnson - Chris Russo Ken Arnold Roderick Schertler - David Cohrs Ken Arromdee Roland McGrath - David Damerell Ken Lorber Ron Van Iwaarden - David Gentzel Ken Washikita Ronnen Miller - David Hairston Kevin Darcy Ross Brown - Dean Luick Kevin Hugo Sascha Wostmann - Del Lamb Kevin Sitze Scott Bigham - Derek S. Ray Kevin Smolkowski Scott R. Turner - Deron Meranda Kevin Sweet Sean Hunt - Dion Nicolaas Lars Huttar Stephen Spackman - Dylan O'Donnell Leon Arnott Stephen White - Eric Backus Malcolm Ryan Steve Creps - Eric Hendrickson Mark Gooderum Steve Linhart - Eric R. Smith Mark Modrall Steve VanDevender - Eric S. Raymond Marvin Bressler Teemu Suikki - Erik Andersen Matthew Day Tim Lennan - Frederick Roeber Merlyn LeRoy Timo Hakulinen - Gil Neiger Michael Allison Tom Almy - Greg Laskin Michael Feir Tom West - Greg Olson Michael Hamel Warren Cheung - Gregg Wonderly Michael Sokolov Warwick Allison - Hao-yang Wang Mike Engber Yitzhak Sapir - Helge Hafting Mike Gallop - Irina Rempt-Drijfhout Mike Passaretti + Carl Schelin Keizo Yamamoto Robin Bandy + Chris Russo Ken Arnold Robin Johnson + David Cohrs Ken Arromdee Roderick Schertler + David Damerell Ken Lorber Roland McGrath + David Gentzel Ken Washikita Ron Van Iwaarden + David Hairston Kevin Darcy Ronnen Miller + Dean Luick Kevin Hugo Ross Brown + Del Lamb Kevin Sitze Sascha Wostmann + Derek S. Ray Kevin Smolkowski Scott Bigham + Deron Meranda Kevin Sweet Scott R. Turner + Dion Nicolaas Lars Huttar Sean Hunt + Dylan O'Donnell Leon Arnott Stephen Spackman + Eric Backus M. Drew Streib Stephen White + Eric Hendrickson Malcolm Ryan Steve Creps + Eric R. Smith Mark Gooderum Steve Linhart + Eric S. Raymond Mark Modrall Steve VanDevender + Erik Andersen Marvin Bressler Teemu Suikki + Frederick Roeber Matthew Day Tim Lennan + Gil Neiger Merlyn LeRoy Timo Hakulinen + Greg Laskin Michael Allison Tom Almy + Greg Olson Michael Feir Tom West + Gregg Wonderly Michael Hamel Warren Cheung + Hao-yang Wang Michael Sokolov Warwick Allison + Helge Hafting Mike Engber Yitzhak Sapir + Irina Rempt-Drijfhout Mike Gallop + Izchak Miller Mike Passaretti diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 4a0243fea..e5faa97d2 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1,12 +1,12 @@ -.\" $NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ -.\" $Revision: 1.130 $ $Date: 2012/05/02 00:38:30 $ +.\" $NHDT-Branch: master $:$NHDT-Revision: 1.140 $ $NHDT-Date: 1427500010 2015/03/27 23:46:50 $ +.\" $Revision: 1.130 $ $Date: 2015/03/27 00:38:30 $ .ds h0 "NetHack Guidebook .ds h1 .ds h2 % .ds vr "NetHack 3.6 .ds f0 "\*(vr .ds f1 -.ds f2 "March 16, 2015 +.ds f2 "March 27, 2015 .\" labeled paragraph start (should be part of tmac.n, but I don't want to .\" make changes to that file) .\" .PS word @@ -3156,7 +3156,7 @@ available web-site listing all the bugs that had been discovered. Despite that constantly growing bug list, 3.3 proved stable enough to last for more than a year and a half. .pg -The 3.5 development team initially consisted of +The 3.4 development team initially consisted of \fBMichael Allison\fP, \fBKen Arromdee\fP, \fBDavid Cohrs\fP, \fBJessie Collet\fP, \fBKevin Hugo\fP, \fBKen Lorber\fP, \fBDean Luick\fP, \fBPat Rankin\fP, \fBMike Stephenson\fP, @@ -3166,16 +3166,16 @@ just before the release of NetHack 3.4.0 in March 2002. As with version 3.3, various people contributed to the game as a whole as well as supporting ports on the different platforms that NetHack runs on: .pg -\fBPat Rankin\fP maintained 3.5 for VMS. +\fBPat Rankin\fP maintained 3.4 for VMS. .pg -\fBMichael Allison\fP maintained NetHack 3.5 for the MS-DOS platform. \fBPaul Winner\fP +\fBMichael Allison\fP maintained NetHack 3.4 for the MS-DOS platform. \fBPaul Winner\fP and \fBYitzhak Sapir\fP provided encouragement. .pg \fBDean Luick\fP, \fBMark Modrall\fP, and \fBKevin Hugo\fP maintained and enhanced the Macintosh port of 3.4. .pg \fBMichael Allison\fP, \fBDavid Cohrs\fP, \fBAlex Kompel\fP, \fBDion Nicolaas\fP, and -\fBYitzhak Sapir\fP maintained and enhanced 3.5 for the Microsoft Windows platform. +\fBYitzhak Sapir\fP maintained and enhanced 3.4 for the Microsoft Windows platform. \fBAlex Kompel\fP contributed a new graphical interface for the Windows port. \fBAlex Kompel\fP also contributed a Windows CE port for 3.4.1. .pg @@ -3185,13 +3185,77 @@ early 2006. A great many thanks to Ron for keeping NetHack alive on OS/2 all these years. .pg \fBJanne Salmijarvi\fP and \fBTeemu Suikki\fP maintained and -enhanced the Amiga port of 3.5 after \fBJanne Salmijarvi\fP resurrected +enhanced the Amiga port of 3.4 after \fBJanne Salmijarvi\fP resurrected it for 3.3.1. .pg -\fBChristian ``Marvin'' Bressler\fP maintained 3.5 for the Atari after he +\fBChristian ``Marvin'' Bressler\fP maintained 3.4 for the Atari after he resurrected it for 3.3.1. .pg +The release of NetHack 3.4.3 in December 2003 marked the beginning of a +long release hiatus. 3.4.3 proved to be a remarkably stable version that +provided continued enjoyment by the community for more than a decade. The +devteam slowly and quietly continued to work on the game behind the scenes +during the tenure of 3.4.3. It was during that same period that several new +variants emerged within the NetHack community. Notably sporkhack by +\fBDerek S. Ray\fP, unnethack by \fBPatric Mueller\fP, nitrohack and its +successors originally by \fBDaniel Thaler\fP and then by \fBAlex Smith\fP, +and Dynahack by \fBTung Nguyen\fP. Some of those variants continue to be +developed, maintained, and enjoyed by the community to this day. +.pg +In September 2014, an interim snapshot of the code under development was +released publicly by other parties. Since that code was a work-in-progress +and had not gone through a period of debugging, it was decided that the +version numbers present on that code snapshot would be retired and never +used in an official NetHack release. An announcement was posted on the +devteam's official nethack.org website to that effect, stating that there +would never be a 3.4.4, 3.5, or 3.5.0 official release version. +.pg +In January 2015, preparation began for the release of NetHack 3.6 +.pg +At the beginning of development for what would eventually get released +as 3.6.0, the development team consisted of \fBWarwick Allison\fP, +\fBMichael Allison\fP, \fBKen Arromdee\fP, +\fBDavid Cohrs\fP, \fBJessie Collet\fP, +\fBKen Lorber\fP, \fBDean Luick\fP, \fBPat Rankin\fP, +\fBMike Stephenson\fP, \fBJanet Walz\fP, and \fBPaul Winner\fP. +Leading up to the release of 3.6.0 in early 2015, new members +\fBSean Hunt\fP, \fBPasi Kallinen\fP, and \fBDerek S. Ray\fP +joined the NetHack development team, +.pg +\fB3.6.0 TODO insert apprpriate description of 3.6.0 here +.pg +\fBThe development team, as well as \fBSteve VanDevender\fP and +\fBKevin Smolkowski\fP ensured that NetHack 3.6.0 continued to operate on +various Unix flavors as well as maintaining the X11 interface. +.pg +\fB\fBKen Lorber\fP, \fBHaoyang Wang\fP, \fBPat Rankin\fP, and \fBDean Luick\fP +maintained the port of NetHack 3.6.0 for Mac. +.pg +\fB\fBMichael Allison\fP, \fBDerek S. Ray\fP, \fBYitzhak Sapir\fP, +\fBAlex Kompel\fP, and \fBDavid Cohrs\fP maintained the port of +NetHack 3.6.0 for Microsoft Windows. +.pg +\fB\fBJeff Bailey\fP created and maintained a port of NetHack 3.6.0 for Chrome. +.pg +\fBTODO\fBAlex Kompel\fP maintained a port of NetHack 3.6.0 to Windows Phone. +.pg +\fBThis version of the game is special in a particular way. Near the end of +the development of 3.6, one of the significant inspirations for many of the +humorous and fun features found in the game, author \fBTerry Pratchett\fP, +passed away. This version of the game is dedicated to him. +.pg The official NetHack web site is maintained by \fBKen Lorber\fP at http://www.nethack.org/. +.pg +SHOUT-OUTS +.pg +The devteam would like to give a special "shout-out" to thank the generous +people primarily responsible for the public NetHack servers available for +playing the game at nethack.alt.org and devnull.net. In addition to providing +a way for the public to play a game of NetHack from almost anywhere, they +have hosted annual NetHack tournaments for many, many years. +.pg +On behalf of the NetHack community, thank you very much to +\fBM. Drew Streib\fP, \fBPasi Kallinen\fP and \fBRobin Bandy\fP. .pg - - - - - - - - - - .pg @@ -3204,11 +3268,11 @@ in this, the list of Dungeoneers: center; c c c. .\"TABLE_START -Adam Aronow Izchak Miller Mike Stephenson -Alex Kompel J. Ali Harlow Norm Meluch -Andreas Dorn Janet Walz Olaf Seibert -Andy Church Janne Salmijarvi Pasi Kallinen -Andy Swanson Jean-Christophe Collet Pat Rankin +Adam Aronow J. Ali Harlow Mike Stephenson +Alex Kompel Janet Walz Norm Meluch +Andreas Dorn Janne Salmijarvi Olaf Seibert +Andy Church Jean-Christophe Collet Pasi Kallinen +Andy Swanson Jeff Bailey Pat Rankin Ari Huttunen Jochen Erwied Paul Winner Barton House John Kallen Pierre Martineau Benson I. Margulies John Rupley Ralf Brown @@ -3217,31 +3281,32 @@ Boudewijn Waijers Johnny Lee Richard Addison Bruce Cox Jon W{tte Richard Beigel Bruce Holloway Jonathan Handler Richard P. Hughey Bruce Mewborne Joshua Delahunty Rob Menke -Carl Schelin Keizo Yamamoto Robin Johnson -Chris Russo Ken Arnold Roderick Schertler -David Cohrs Ken Arromdee Roland McGrath -David Damerell Ken Lorber Ron Van Iwaarden -David Gentzel Ken Washikita Ronnen Miller -David Hairston Kevin Darcy Ross Brown -Dean Luick Kevin Hugo Sascha Wostmann -Del Lamb Kevin Sitze Scott Bigham -Derek S. Ray Kevin Smolkowski Scott R. Turner -Deron Meranda Kevin Sweet Sean Hunt -Dion Nicolaas Lars Huttar Stephen Spackman -Dylan O'Donnell Leon Arnott Stephen White -Eric Backus Malcolm Ryan Steve Creps -Eric Hendrickson Mark Gooderum Steve Linhart -Eric R. Smith Mark Modrall Steve VanDevender -Eric S. Raymond Marvin Bressler Teemu Suikki -Erik Andersen Matthew Day Tim Lennan -Frederick Roeber Merlyn LeRoy Timo Hakulinen -Gil Neiger Michael Allison Tom Almy -Greg Laskin Michael Feir Tom West -Greg Olson Michael Hamel Warren Cheung -Gregg Wonderly Michael Sokolov Warwick Allison -Hao-yang Wang Mike Engber Yitzhak Sapir -Helge Hafting Mike Gallop -Irina Rempt-Drijfhout Mike Passaretti +Carl Schelin Keizo Yamamoto Robin Bandy +Chris Russo Ken Arnold Robin Johnson +David Cohrs Ken Arromdee Roderick Schertler +David Damerell Ken Lorber Roland McGrath +David Gentzel Ken Washikita Ron Van Iwaarden +David Hairston Kevin Darcy Ronnen Miller +Dean Luick Kevin Hugo Ross Brown +Del Lamb Kevin Sitze Sascha Wostmann +Derek S. Ray Kevin Smolkowski Scott Bigham +Deron Meranda Kevin Sweet Scott R. Turner +Dion Nicolaas Lars Huttar Sean Hunt +Dylan O'Donnell Leon Arnott Stephen Spackman +Eric Backus M. Drew Streib Stephen White +Eric Hendrickson Malcolm Ryan Steve Creps +Eric R. Smith Mark Gooderum Steve Linhart +Eric S. Raymond Mark Modrall Steve VanDevender +Erik Andersen Marvin Bressler Teemu Suikki +Frederick Roeber Matthew Day Tim Lennan +Gil Neiger Merlyn LeRoy Timo Hakulinen +Greg Laskin Michael Allison Tom Almy +Greg Olson Michael Feir Tom West +Gregg Wonderly Michael Hamel Warren Cheung +Hao-yang Wang Michael Sokolov Warwick Allison +Helge Hafting Mike Engber Yitzhak Sapir +Irina Rempt-Drijfhout Mike Gallop +Izchak Miller Mike Passaretti .\"TABLE_END Do not delete this line. .TE diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index d7b295519..0310aaeb1 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -33,7 +33,7 @@ \begin{document} % % input file: guidebook.mn -% $Revision: 1.122 $ $Date: 2015/03/16 06:00:00 $ +% $Revision: 1.122 $ $Date: 2015/03/27 06:00:00 $ % %.ds h0 " %.ds h1 %.ds h2 \% @@ -46,7 +46,7 @@ %.au \author{Eric S. Raymond\\ (Edited and expanded for 3.6)} -\date{March 16, 2015} +\date{March 27, 2015} \maketitle @@ -3787,7 +3787,7 @@ more than a year and a half. %.pg \medskip -The 3.5 development team initially consisted of +The 3.4 development team initially consisted of {\it Michael Allison}, {\it Ken Arromdee}, {\it David Cohrs}, {\it Jessie Collet}, {\it Kevin Hugo}, {\it Ken Lorber}, {\it Dean Luick}, {\it Pat Rankin}, {\it Mike Stephenson}, @@ -3802,11 +3802,11 @@ runs on: %.pg \medskip -\nd{\it Pat Rankin} maintained 3.5 for VMS. +\nd{\it Pat Rankin} maintained 3.4 for VMS. %.pg \medskip -\nd {\it Michael Allison} maintained NetHack 3.5 for the MS-DOS platform. +\nd {\it Michael Allison} maintained NetHack 3.4 for the MS-DOS platform. {\it Paul Winner} and {\it Yitzhak Sapir} provided encouragement. %.pg @@ -3836,9 +3836,82 @@ it for 3.3.1. %.pg \medskip -\nd {\it Christian ``Marvin'' Bressler} maintained 3.5 for the Atari after he +\nd {\it Christian ``Marvin'' Bressler} maintained 3.4 for the Atari after he resurrected it for 3.3.1. +%.pg +\medskip +The release of NetHack 3.4.3 in December 2003 marked the beginning of a +long release hiatus. 3.4.3 proved to be a remarkably stable version that +provided continued enjoyment by the community for more than a decade. The +devteam slowly and quietly continued to work on the game behind the scenes +during the tenure of 3.4.3. It was during that same period that several new +variants emerged within the NetHack community. Notably sporkhack by +Derek S. Ray, unnethack by Patric Mueller, nitrohack and its successors +originally by Daniel Thaler and then by Alex Smith, and +Dynahack by Tung Nguyen. Some of those variants continue to be developed, +maintained, and enjoyed by the community to this day. + +%.pg +\medskip +In September 2014, an interim snapshot of the code under development was +released publicly by other parties. Since that code was a work-in-progress +and had not gone through a period of debugging, it was decided that the +version numbers present on that code snapshot would be retired and never +used in an official NetHack release. An announcement was posted on the +devteam's official nethack.org website to that effect, stating that there +would never be a 3.4.4, 3.5, or 3.5.0 official release version. + +%.pg +\medskip +In January 2015, preparation began for the release of NetHack 3.6 + +%.pg +\medskip +At the beginning of development for what would eventually get released +as 3.6.0, the development team consisted of {\it Warwick Allison}, +{\it Michael Allison}, {\it Ken Arromdee}, +{\it David Cohrs}, {\it Jessie Collet}, +{\it Ken Lorber}, {\it Dean Luick}, {\it Pat Rankin}, +{\it Mike Stephenson}, {\it Janet Walz}, and {\it Paul Winner}. +Leading up to the release of 3.6.0 in early 2015, new members +{\it Sean Hunt}, {\it Pasi Kallinen}, and {\it Derek S. Ray} +joined the NetHack development team, + +%.pg +\medskip +3.6.0 TODO insert apprpriate description of 3.6.0 here + +%.pg +\medskip +The development team, as well as {\it Steve VanDevender} and +{\it Kevin Smolkowski} ensured that NetHack 3.6.0 continued to operate on +various Unix flavors as well as maintaining the X11 interface. + +{\it Ken Lorber}, {\it Haoyang Wang}, {\it Pat Rankin}, and {\it Dean Luick} +maintained the port of NetHack 3.6.0 for Mac. + +%.pg +\medskip +{\it Michael Allison}, {\it Derek S. Ray}, {\it Yitzhak Sapir}, +{\it Alex Kompel}, and {\it David Cohrs} maintained the port of +NetHack 3.6.0 for Microsoft Windows. + +%.pg +\medskip +{\it Jeff Bailey} created and maintained a port of NetHack 3.6.0 for Chrome. + +%.pg +\medskip +{\it Alex Kompel} maintained a port of NetHack 3.6.0 to Windows Phone. ? + +%.pg +\medskip +This version of the game is special in a particular way. Near the end of +the development of 3.6, one of the significant inspirations for many of the +humorous and fun features found in the game, author {\it Terry Pratchett}, +passed away. This version of the game is dedicated to him. + %.pg \medskip \nd The official NetHack web site is maintained by {\it Ken Lorber} at @@ -3848,6 +3921,20 @@ http:{\tt /}{\tt /}www.nethack.org{\tt /}. {\catcode`\#=11 \special{html:}} +%.pg +%.hn 2 +\subsection*{Shout Outs} +\nd The devteam would like to give a special "shout-out" to thank the generous +people primarily responsible for the public NetHack servers available for +playing the game at nethack.alt.org and devnull.net. In addition to providing +a way for the public to play a game of NetHack from almost anywhere, they +have hosted annual NetHack tournaments for many, many years. +%pg +\medskip +\nd On behalf of the NetHack community, thank you very much to +{\it M. Drew Streib}, {\it Pasi Kallinen} and {\it Robin Bandy}. + +.pg %.hn 3 \subsection*{Dungeoneers} \bigskip @@ -3860,11 +3947,11 @@ in this, the list of Dungeoneers: \begin{center} \begin{tabular}{lll} %TABLE_START -Adam Aronow & Izchak Miller & Mike Stephenson\\ -Alex Kompel & J. Ali Harlow & Norm Meluch\\ -Andreas Dorn & Janet Walz & Olaf Seibert\\ -Andy Church & Janne Salmij\"{a}rvi & Pasi Kallinen\\ -Andy Swanson & Jean-Christophe Collet & Pat Rankin\\ +Adam Aronow & J. Ali Harlow & Mike Stephenson\\ +Alex Kompel & Janet Walz & Norm Meluch\\ +Andreas Dorn & Janne Salmij\"{a}rvi & Olaf Seibert\\ +Andy Church & Jean-Christophe Collet & Pasi Kallinen\\ +Andy Swanson & Jeff Bailey & Pat Rankin\\ Ari Huttunen & Jochen Erwied & Paul Winner\\ Barton House & John Kallen & Pierre Martineau\\ Benson I. Margulies & John Rupley & Ralf Brown\\ @@ -3873,31 +3960,32 @@ Boudewijn Waijers & Johnny Lee & Richard Addison\\ Bruce Cox & Jon W\{tte & Richard Beigel\\ Bruce Holloway & Jonathan Handler & Richard P. Hughey\\ Bruce Mewborne & Joshua Delahunty & Rob Menke\\ -Carl Schelin & Keizo Yamamoto & Robin Johnson\\ -Chris Russo & Ken Arnold & Roderick Schertler\\ -David Cohrs & Ken Arromdee & Roland McGrath\\ -David Damerell & Ken Lorber & Ron Van Iwaarden\\ -David Gentzel & Ken Washikita & Ronnen Miller\\ -David Hairston & Kevin Darcy & Ross Brown\\ -Dean Luick & Kevin Hugo & Sascha Wostmann\\ -Del Lamb & Kevin Sitze & Scott Bigham\\ -Derek S. Ray & Kevin Smolkowski & Scott R. Turner\\ -Deron Meranda & Kevin Sweet & Sean Hunt\\ -Dion Nicolaas & Lars Huttar & Stephen Spackman\\ -Dylan O'Donnell & Leon Arnott & Stephen White\\ -Eric Backus & Malcolm Ryan & Steve Creps\\ -Eric Hendrickson & Mark Gooderum & Steve Linhart\\ -Eric R. Smith & Mark Modrall & Steve VanDevender\\ -Eric S. Raymond & Marvin Bressler & Teemu Suikki\\ -Erik Andersen & Matthew Day & Tim Lennan\\ -Frederick Roeber & Merlyn LeRoy & Timo Hakulinen\\ -Gil Neiger & Michael Allison & Tom Almy\\ -Greg Laskin & Michael Feir & Tom West\\ -Greg Olson & Michael Hamel & Warren Cheung\\ -Gregg Wonderly & Michael Sokolov & Warwick Allison\\ -Hao-yang Wang & Mike Engber & Yitzhak Sapir\\ -Helge Hafting & Mike Gallop\\ -Irina Rempt-Drijfhout & Mike Passaretti +Carl Schelin & Keizo Yamamoto & Robin Bandy\\ +Chris Russo & Ken Arnold & Robin Johnson\\ +David Cohrs & Ken Arromdee & Roderick Schertler\\ +David Damerell & Ken Lorber & Roland McGrath\\ +David Gentzel & Ken Washikita & Ron Van Iwaarden\\ +David Hairston & Kevin Darcy & Ronnen Miller\\ +Dean Luick & Kevin Hugo & Ross Brown\\ +Del Lamb & Kevin Sitze & Sascha Wostmann\\ +Derek S. Ray & Kevin Smolkowski & Scott Bigham\\ +Deron Meranda & Kevin Sweet & Scott R. Turner\\ +Dion Nicolaas & Lars Huttar & Sean Hunt\\ +Dylan O'Donnell & Leon Arnott & Stephen Spackman\\ +Eric Backus & M. Drew Streib & Stephen White\\ +Eric Hendrickson & Malcolm Ryan & Steve Creps\\ +Eric R. Smith & Mark Gooderum & Steve Linhart\\ +Eric S. Raymond & Mark Modrall & Steve VanDevender\\ +Erik Andersen & Marvin Bressler & Teemu Suikki\\ +Frederick Roeber & Matthew Day & Tim Lennan\\ +Gil Neiger & Merlyn LeRoy & Timo Hakulinen\\ +Greg Laskin & Michael Allison & Tom Almy\\ +Greg Olson & Michael Feir & Tom West\\ +Gregg Wonderly & Michael Hamel & Warren Cheung\\ +Hao-yang Wang & Michael Sokolov & Warwick Allison\\ +Helge Hafting & Mike Engber & Yitzhak Sapir\\ +Irina Rempt-Drijfhout & Mike Gallop\\ +Izchak Miller & Mike Passaretti %TABLE_END Do not delete this line. \end{tabular} \end{center} From 4a3a130795f786a3bb7406edf32c98a8e301bf9e Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 27 Mar 2015 19:56:04 -0400 Subject: [PATCH 283/354] subsitution gone amuck Changes to be committed: modified: doc/Guidebook.mn --- doc/Guidebook.mn | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index e5faa97d2..eb340dff5 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1,4 +1,4 @@ -.\" $NHDT-Branch: master $:$NHDT-Revision: 1.140 $ $NHDT-Date: 1427500010 2015/03/27 23:46:50 $ +.\" $NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$ .\" $Revision: 1.130 $ $Date: 2015/03/27 00:38:30 $ .ds h0 "NetHack Guidebook .ds h1 @@ -3228,16 +3228,16 @@ joined the NetHack development team, \fBKevin Smolkowski\fP ensured that NetHack 3.6.0 continued to operate on various Unix flavors as well as maintaining the X11 interface. .pg -\fB\fBKen Lorber\fP, \fBHaoyang Wang\fP, \fBPat Rankin\fP, and \fBDean Luick\fP +\fBKen Lorber\fP, \fBHaoyang Wang\fP, \fBPat Rankin\fP, and \fBDean Luick\fP maintained the port of NetHack 3.6.0 for Mac. .pg -\fB\fBMichael Allison\fP, \fBDerek S. Ray\fP, \fBYitzhak Sapir\fP, +\fBMichael Allison\fP, \fBDerek S. Ray\fP, \fBYitzhak Sapir\fP, \fBAlex Kompel\fP, and \fBDavid Cohrs\fP maintained the port of NetHack 3.6.0 for Microsoft Windows. .pg -\fB\fBJeff Bailey\fP created and maintained a port of NetHack 3.6.0 for Chrome. +\fBJeff Bailey\fP created and maintained a port of NetHack 3.6.0 for Chrome. .pg -\fBTODO\fBAlex Kompel\fP maintained a port of NetHack 3.6.0 to Windows Phone. +TODO \fBAlex Kompel\fP maintained a port of NetHack 3.6.0 to Windows Phone. .pg \fBThis version of the game is special in a particular way. Near the end of the development of 3.6, one of the significant inspirations for many of the From 45c5a796818fc064473146548a002f3292b73956 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 27 Mar 2015 18:24:53 -0700 Subject: [PATCH 284/354] tty menu hack for ':' Looting a container generates a menu which contains ': - look inside' but the recent change to make ':' be a menu command for selecting items which match a search string made it impossible to pick that item. (Well, I suppose you could enter a search string which matched it, but that's a nuisance compared to just directly picking a choice.) This makes menu selection for tty give precedence to menu choice characters over mapped menu commands when some character happens to be both. I'm not sure whether it ought to be expended to group accelerators too, so didn't do that. There's bound to be a better way to do this, but it works. --- win/tty/wintty.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index f3cc97eb5..afe0e204e 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 wintty.c $NHDT-Date: 1426465444 2015/03/16 00:24:04 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.71 $ */ +/* NetHack 3.5 wintty.c $NHDT-Date: 1427505884 2015/03/28 01:24:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.73 $ */ /* NetHack 3.5 wintty.c $Date: 2012/01/22 06:27:09 $ $Revision: 1.66 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -1391,10 +1391,11 @@ struct WinDesc *cw; { tty_menu_item *page_start, *page_end, *curr; long count; - int n, curr_page, page_lines; + int n, curr_page, page_lines, resp_len; boolean finished, counting, reset_count; char *cp, *rp, resp[QBUFSZ], gacc[QBUFSZ], - *msave, *morestr; + *msave, *morestr, really_morc; +#define MENU_EXPLICIT_CHOICE 0x7f /* pseudo menu manipulation char */ curr_page = page_lines = 0; page_start = page_end = 0; @@ -1501,6 +1502,8 @@ struct WinDesc *cw; page_lines = 0; } *rp = 0; + /* remember how many explicit menu choices there are */ + resp_len = (int)strlen(resp); /* corner window - clear extra lines from last page */ if (cw->offx) { @@ -1533,7 +1536,15 @@ struct WinDesc *cw; xwaitforspace(resp); } - morc = map_menu_cmd(morc); + really_morc = morc; /* (only used with MENU_EXPLICIT_CHOICE */ + if ((rp = index(resp, morc)) != 0 && rp < resp + resp_len) + /* explicit menu selection; don't override it if it also + happens to match a mapped menu command (such as ':' to + look inside a container vs ':' to search) */ + morc = MENU_EXPLICIT_CHOICE; + else + morc = map_menu_cmd(morc); + switch (morc) { case '0': /* special case: '0' is also the default ball class */ @@ -1664,6 +1675,9 @@ struct WinDesc *cw; } } break; + case MENU_EXPLICIT_CHOICE: + morc = really_morc; + /*FALLTHRU*/ default: if (cw->how == PICK_NONE || !index(resp, morc)) { /* unacceptable input received */ From 78452809bc28089847ddc0bcc18ab3b42ec88145 Mon Sep 17 00:00:00 2001 From: keni Date: Fri, 27 Mar 2015 21:31:25 -0400 Subject: [PATCH 285/354] regenerate Guidebook.txt --- doc/Guidebook.txt | 4164 +++++++++++++++++++++++++-------------------- 1 file changed, 2313 insertions(+), 1851 deletions(-) diff --git a/doc/Guidebook.txt b/doc/Guidebook.txt index 4318b8a5f..84a5395a6 100644 --- a/doc/Guidebook.txt +++ b/doc/Guidebook.txt @@ -13,25 +13,25 @@ Eric S. Raymond - (Extensively edited and expanded for 3.5) + (Edited and expanded for 3.6) 1. Introduction Recently, you have begun to find yourself unfulfilled and distant - in your daily occupation. Strange dreams of prospecting, steal- + in your daily occupation. Strange dreams of prospecting, steal†ing, crusading, and combat have haunted you in your sleep for - many months, but you aren't sure of the reason. You wonder + many months, but you aren’t sure of the reason. You wonder whether you have in fact been having those dreams all your life, and somehow managed to forget about them until now. Some nights - you awaken suddenly and cry out, terrified at the vivid recollec- - tion of the strange and powerful creatures that seem to be lurk- + you awaken suddenly and cry out, terrified at the vivid recollec†+ tion of the strange and powerful creatures that seem to be lurk†ing behind every corner of the dungeon in your dream. Could - these details haunting your dreams be real? As each night pass- + these details haunting your dreams be real? As each night pass†es, you feel the desire to enter the mysterious caverns near the ruins grow stronger. Each morning, however, you quickly put the - idea out of your head as you recall the tales of those who en- + idea out of your head as you recall the tales of those who en†tered the caverns before you and did not return. Eventually you can resist the yearning to seek out the fantastic place in your dreams no longer. After all, when other adventurers came back @@ -49,14 +49,14 @@ deep within the Mazes of Menace. Upon hearing the legends, you immediately realize that there is some profound and undiscovered reason that you are to descend into the caverns and seek out that - amulet of which they spoke. Even if the rumors of the amulet's + amulet of which they spoke. Even if the rumors of the amulet’s powers are untrue, you decide that you should at least be able to sell the tales of your adventures to the local minstrels for a tidy sum, especially if you encounter any of the terrifying and magical creatures of your dreams along the way. You spend one last night fortifying yourself at the local inn, becoming more and more depressed as you watch the odds of your success being - posted on the inn's walls getting lower and lower. + posted on the inn’s walls getting lower and lower. @@ -74,8 +74,8 @@ off for the dungeon. After several days of uneventful travel, you see the ancient ruins that mark the entrance to the Mazes of Menace. It is late at night, so you make camp at the entrance - and spend the night sleeping under the open skies. In the morn- - ing, you gather your gear, eat what may be your last meal out- + and spend the night sleeping under the open skies. In the morn†+ ing, you gather your gear, eat what may be your last meal out†side, and enter the dungeon... @@ -94,15 +94,15 @@ Barbarians are warriors out of the hinterland, hardened to battle. They begin their quests with naught but uncommon - strength, a trusty hauberk, and a great two-handed sword. + strength, a trusty hauberk, and a great twoâ€handed sword. Cavemen and Cavewomen start with exceptional strength but, unfortunately, with neolithic weapons. Healers are wise in medicine and apothecary. They know the - herbs and simples that can restore vitality, ease pain, anes- + herbs and simples that can restore vitality, ease pain, anes†thetize, and neutralize poisons; and with their instruments, they - can divine a being's state of health or sickness. Their medical + can divine a being’s state of health or sickness. Their medical practice earns them quite reasonable amounts of money, with which they enter the dungeon. @@ -115,7 +115,7 @@ without weapons as with. They wear no armor but make up for it with increased mobility. - Priests and Priestesses are clerics militant, crusaders ad- + Priests and Priestesses are clerics militant, crusaders ad†vancing the cause of righteousness with arms, armor, and arts thaumaturgic. Their ability to commune with deities via prayer occasionally extricates them from peril, but can also put them in @@ -126,7 +126,7 @@ as well as tracking and stealthy movement. - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -141,26 +141,26 @@ which they employ to great advantage. Samurai are the elite warriors of feudal Nippon. They are - lightly armored and quick, and wear the dai-sho, two swords of + lightly armored and quick, and wear the daiâ€sho, two swords of the deadliest keenness. Tourists start out with lots of gold (suitable for shopping with), a credit card, lots of food, some maps, and an expensive - camera. Most monsters don't like being photographed. + camera. Most monsters don’t like being photographed. Valkyries are hardy warrior women. Their upbringing in the harsh Northlands makes them strong, inures them to extremes of cold, and instills in them stealth and cunning. Wizards start out with a knowledge of magic, a selection of - magical items, and a particular affinity for dweomercraft. Al- - though seemingly weak and easy to overcome at first sight, an ex- + magical items, and a particular affinity for dweomercraft. Al†+ though seemingly weak and easy to overcome at first sight, an ex†perienced Wizard is a deadly foe. You may also choose the race of your character: Dwarves are smaller than humans or elves, but are stocky and - solid individuals. Dwarves' most notable trait is their great + solid individuals. Dwarves’ most notable trait is their great expertise in mining and metalwork. Dwarvish armor is said to be second in quality not even to the mithril armor of the Elves. @@ -169,7 +169,7 @@ often gives them an advantage in arms and armor. Gnomes are smaller than but generally similar to dwarves. - Gnomes are known to be expert miners, and it is known that a se- + Gnomes are known to be expert miners, and it is known that a se†cret underground mine complex built by this race exists within the Mazes of Menace, filled with both riches and danger. @@ -192,7 +192,7 @@ - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -202,63 +202,63 @@ - When NetHack's ancestor rogue first appeared, its screen + When NetHack’s ancestor rogue first appeared, its screen orientation was almost unique among computer fantasy games. Since then, screen orientation has become the norm rather than the exception; NetHack continues this fine tradition. Unlike - text adventure games that accept commands in pseudo-English sen- + text adventure games that accept commands in pseudoâ€English sen†tences and explain the results in words, NetHack commands are all one or two keystrokes and the results are displayed graphically on the screen. A minimum screen size of 24 lines by 80 columns is recommended; if the screen is larger, only a 21x80 section will be used for the map. - NetHack can even be played by blind players, with the assis- + NetHack can even be played by blind players, with the assis†tance of Braille readers or speech synthesisers. Instructions for configuring NetHack for the blind are included later in this document. NetHack generates a new dungeon every time you play it; even - the authors still find it an entertaining and exciting game de- + the authors still find it an entertaining and exciting game de†spite having won several times. NetHack offers a variety of display options. The options available to you will vary from port to port, depending on the capabilities of your hardware and software, and whether various - compile-time options were enabled when your executable was creat- - ed. The three possible display options are: a monochrome charac- - ter interface, a color character interface, and a graphical in- - terface using small pictures called tiles. The two character in- + compileâ€time options were enabled when your executable was creat†+ ed. The three possible display options are: a monochrome charac†+ ter interface, a color character interface, and a graphical in†+ terface using small pictures called tiles. The two character in†terfaces allow fonts with other characters to be substituted, but - the default assignments use standard ASCII characters to repre- - sent everything. There is no difference between the various dis- - play options with respect to game play. Because we cannot repro- - duce the tiles or colors in the Guidebook, and because it is com- + the default assignments use standard ASCII characters to repre†+ sent everything. There is no difference between the various dis†+ play options with respect to game play. Because we cannot repro†+ duce the tiles or colors in the Guidebook, and because it is com†mon to all ports, we will use the default ASCII characters from the monochrome character display when referring to things you might see on the screen during your game. In order to understand what is going on in NetHack, first you must understand what NetHack is doing with the screen. The - NetHack screen replaces the ``You see ...'' descriptions of text + NetHack screen replaces the ‘‘You see ...’’ descriptions of text adventure games. Figure 1 is a sample of what a NetHack screen might look like. The way the screen looks for you depends on your platform. - -------------------------------------------------------------------- + ──────────────────────────────────────────────────────────────────── The bat bites! - ------ - |....| ---------- + â€â€â€â€â€â€ + |....| â€â€â€â€â€â€â€â€â€â€ |.<..|####...@...$.| - |....-# |...B....+ + |....â€# |...B....+ |....| |.d......| - ------ -------|-- + â€â€â€â€â€â€ â€â€â€â€â€â€â€|â€â€ - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -273,7 +273,7 @@ Player the Rambler St:12 Dx:7 Co:18 In:11 Wi:9 Ch:15 Neutral Dlvl:1 $:0 HP:9(12) Pw:3(3) AC:10 Exp:1/19 T:257 Weak - -------------------------------------------------------------------- + ──────────────────────────────────────────────────────────────────── Figure 1 @@ -282,19 +282,19 @@ The bottom two lines of the screen contain several cryptic pieces of information describing your current status. If either status line becomes longer than the width of the screen, you - might not see all of it. Here are explanations of what the vari- + might not see all of it. Here are explanations of what the vari†ous status items mean (though your configuration may not have all the status items listed below): Rank - Your character's name and professional ranking (based on the + Your character’s name and professional ranking (based on the experience level, see below). Strength - A measure of your character's strength; one of your six ba- - sic attributes. A human character's attributes can range - from 3 to 18 inclusive; non-humans may exceed these limits - (occasionally you may get super-strengths of the form 18/xx, + A measure of your character’s strength; one of your six ba†+ sic attributes. A human character’s attributes can range + from 3 to 18 inclusive; nonâ€humans may exceed these limits + (occasionally you may get superâ€strengths of the form 18/xx, and magic can also cause attributes to exceed the normal limits). The higher your strength, the stronger you are. Strength affects how successfully you perform physical @@ -324,7 +324,7 @@ - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -336,17 +336,17 @@ Alignment Lawful, Neutral, or Chaotic. Often, Lawful is taken as good - and Chaotic as evil, but legal and ethical do not always co- + and Chaotic as evil, but legal and ethical do not always co†incide. Your alignment influences how other monsters react toward you. Monsters of a like alignment are more likely to - be non-aggressive, while those of an opposing alignment are + be nonâ€aggressive, while those of an opposing alignment are more likely to be seriously offended at your presence. Dungeon Level How deep you are in the dungeon. You start at level one and the number increases as you go deeper into the dungeon. Some levels are special, and are identified by a name and - not a number. The Amulet of Yendor is reputed to be some- + not a number. The Amulet of Yendor is reputed to be some†where beneath the twentieth level. Gold @@ -367,16 +367,16 @@ regenerate the amount available. Armor Class - A measure of how effectively your armor stops blows from un- - friendly creatures. The lower this number is, the more ef- - fective the armor; it is quite possible to have negative ar- + A measure of how effectively your armor stops blows from un†+ friendly creatures. The lower this number is, the more ef†+ fective the armor; it is quite possible to have negative ar†mor class. Experience Your current experience level and experience points. As you - adventure, you gain experience points. At certain experi- + adventure, you gain experience points. At certain experi†ence point totals, you gain an experience level. The more - experienced you are, the better you fight and withstand mag- + experienced you are, the better you fight and withstand mag†ical attacks. Many dungeons show only your experience level here. @@ -386,11 +386,11 @@ Hunger status Your current hunger status, ranging from Satiated down to - Fainting. If your hunger status is normal, it is not dis- + Fainting. If your hunger status is normal, it is not dis†played. - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -401,27 +401,27 @@ Additional status flags may appear after the hunger status: - Conf when you're confused, FoodPois or Ill when sick, Blind when - you can't see, Stun when stunned, and Hallu when hallucinating. + Conf when you’re confused, FoodPois or Ill when sick, Blind when + you can’t see, Stun when stunned, and Hallu when hallucinating. 3.2. The message line (top) - The top line of the screen is reserved for messages that de- + The top line of the screen is reserved for messages that de†scribe things that are impossible to represent visually. If you - see a ``--More--'' on the top line, this means that NetHack has + see a ‘‘â€â€Moreâ€â€â€™â€™ on the top line, this means that NetHack has another message to display on the screen, but it wants to make - certain that you've read the one that is there first. To read + certain that you’ve read the one that is there first. To read the next message, just press the space bar. 3.3. The map (rest of the screen) The rest of the screen is the map of the level as you have - explored it so far. Each symbol on the screen represents some- + explored it so far. Each symbol on the screen represents some†thing. You can set various graphics options to change some of the symbols the game uses; otherwise, the game will use default symbols. Here is a list of what the default symbols mean: - - and | + †and | The walls of a room, or an open door. Or a grave (|). . The floor of a room, ice, or a doorless doorway. @@ -456,7 +456,7 @@ - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -468,13 +468,13 @@ ! A potion. - ( A useful item (pick-axe, key, lamp...). + ( A useful item (pickâ€axe, key, lamp...). " An amulet or a spider web. * A gem or rock (possibly valuable, possibly worthless). - ` A boulder or statue. + ‘ A boulder or statue. 0 An iron ball. @@ -486,43 +486,43 @@ \ An opulent throne. - a-zA-Z and other symbols - Letters and certain other symbols represent the various in- + aâ€zAâ€Z and other symbols + Letters and certain other symbols represent the various in†habitants of the Mazes of Menace. Watch out, they can be nasty and vicious. Sometimes, however, they can be helpful. - I This marks the last known location of an invisible or other- + I This marks the last known location of an invisible or other†wise unseen monster. Note that the monster could have - moved. The 'F' and 'm' commands may be useful here. + moved. The ’F’ and ’m’ commands may be useful here. You need not memorize all these symbols; you can ask the - game what any symbol represents with the `/' command (see the + game what any symbol represents with the ‘/’ command (see the next section for more info). 4. Commands Commands are initiated by typing one or two characters. - Some commands, like ``search'', do not require that any more in- + Some commands, like ‘‘search’’, do not require that any more in†formation be collected by NetHack. Other commands might require additional information, for example a direction, or an object to be used. For those commands that require additional information, NetHack will present you with either a menu of choices or with a - command line prompt requesting information. Which you are pre- + command line prompt requesting information. Which you are pre†sented with will depend chiefly on how you have set the menustyle option. - For example, a common question, in the form ``What do you - want to use? [a-zA-Z ?*]'', asks you to choose an object you are - carrying. Here, ``a-zA-Z'' are the inventory letters of your - possible choices. Typing `?' gives you an inventory list of + For example, a common question, in the form ‘‘What do you + want to use? [aâ€zAâ€Z ?*]’’, asks you to choose an object you are + carrying. Here, ‘‘aâ€zAâ€Z’’ are the inventory letters of your + possible choices. Typing ‘?’ gives you an inventory list of these items, so you can see what each letter refers to. In this - example, there is also a `*' indicating that you may choose an - object not on the list, if you wanted to use something unexpect- - ed. Typing a `*' lists your entire inventory, so you can see the + example, there is also a ‘*’ indicating that you may choose an + object not on the list, if you wanted to use something unexpect†+ ed. Typing a ‘*’ lists your entire inventory, so you can see the - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -532,39 +532,39 @@ - inventory letters of every object you're carrying. Finally, if - you change your mind and decide you don't want to do this command + inventory letters of every object you’re carrying. Finally, if + you change your mind and decide you don’t want to do this command after all, you can press the ESC key to abort the command. You can put a number before some commands to repeat them - that many times; for example, ``10s'' will search ten times. If - you have the number_pad option set, you must type `n' to prefix a - count, so the example above would be typed ``n10s'' instead. - Commands for which counts make no sense ignore them. In addi- + that many times; for example, ‘‘10s’’ will search ten times. If + you have the number_pad option set, you must type ‘n’ to prefix a + count, so the example above would be typed ‘‘n10s’’ instead. + Commands for which counts make no sense ignore them. In addi†tion, movement commands can be prefixed for greater control (see below). To cancel a count or a prefix, press the ESC key. The list of commands is rather long, but it can be read at - any time during the game through the `?' command, which accesses - a menu of helpful texts. Here are the commands for your refer- + any time during the game through the ‘?’ command, which accesses + a menu of helpful texts. Here are the commands for your refer†ence: ? Help menu: display one of several help texts available. / Tell what a symbol represents. You may choose to specify a location or type a symbol (or even a whole word) to explain. - Specifying a location is done by moving the cursor to a par- - ticular spot on the map and then pressing one of `.', `,', - `;', or `:'. `.' will explain the symbol at the chosen lo- - cation, conditionally check for ``More info?'' depending up- + Specifying a location is done by moving the cursor to a par†+ ticular spot on the map and then pressing one of ‘.’, ‘,’, + ‘;’, or ‘:’. ‘.’ will explain the symbol at the chosen lo†+ cation, conditionally check for ‘‘More info?’’ depending up†on whether the help option is on, and then you will be asked - to pick another location; `,' will explain the symbol but - skip any additional information; `;' will skip additional - info and also not bother asking you to choose another loca- - tion to examine; `:' will show additional info, if any, + to pick another location; ‘,’ will explain the symbol but + skip any additional information; ‘;’ will skip additional + info and also not bother asking you to choose another loca†+ tion to examine; ‘:’ will show additional info, if any, without asking for confirmation. When picking a location, - pressing the ESC key will terminate this command, or press- - ing `?' will give a brief reminder about how it works. + pressing the ESC key will terminate this command, or press†+ ing ‘?’ will give a brief reminder about how it works. Specifying a name rather than a location always gives any additional information available about that name. @@ -574,21 +574,21 @@ < Go up to the previous level (if you are on a staircase or ladder). - > Go down to the next level (if you are on a staircase or lad- + > Go down to the next level (if you are on a staircase or lad†der). [yuhjklbn] Go one step in the direction indicated (see Figure 2). If you sense or remember a monster there, you will fight the - monster instead. Only these one-step movement commands + monster instead. Only these oneâ€step movement commands cause you to fight monsters; the others (below) are - ``safe.'' + ‘‘safe.’’ - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -600,7 +600,7 @@ y k u 7 8 9 \ | / \ | / - h- . -l 4- . -6 + h†. â€l 4†. â€6 / | \ / | \ b j n 1 2 3 (if number_pad is set) @@ -609,7 +609,7 @@ [YUHJKLBN] - Go in that direction until you hit a wall or run into some- + Go in that direction until you hit a wall or run into some†thing. m[yuhjklbn] @@ -626,35 +626,35 @@ g[yuhjklbn] Prefix: move until something interesting is found. - G[yuhjklbn] or [yuhjklbn] - Prefix: same as `g', but forking of corridors is not con- + G[yuhjklbn] or [yuhjklbn] + Prefix: same as ‘g’, but forking of corridors is not con†sidered interesting. - _ Travel to a map location via a shortest-path algorithm. The - shortest path is computed over map locations the hero knows - about (e.g. seen or previously traversed). If there is no - known path, a guess is made instead. Stops on most of the - same conditions as the `G' command, but without picking up - objects, similar to the `M' command. For ports with mouse - support, the command is also invoked when a mouse-click - takes place on a location other than the current position. + _ Travel to a map location via a shortestâ€path algorithm. + + The shortest path is computed over map locations the hero + knows about (e.g. seen or previously traversed). If there + is no known path, a guess is made instead. Stops on most of + the same conditions as the ‘G’ command, but without picking + up objects, similar to the ‘M’ command. For ports with + mouse support, the command is also invoked when a mouse†+ click takes place on a location other than the current posi†+ tion. . Rest, do nothing for one turn. - a Apply (use) a tool (pick-axe, key, lamp...). + a Apply (use) a tool (pickâ€axe, key, lamp...). - A Remove one or more worn items, such as armor. Use `T' (take - off) to take off only one piece of armor or `R' (remove) to - take off only one accessory. + A Remove one or more worn items, such as armor. + + Use ‘T’ (take off) to take off only one piece of armor or + ‘R’ (remove) to take off only one accessory. ^A Redo the previous command. - c Close a door. - - - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -664,63 +664,63 @@ - C Call (name) an individual monster. + c Close a door. + + C Call (name) a monster, an individual object, or a type of + object. + + Same as extended command ‘‘#name’’. ^C Panic button. Quit the game. - d Drop something. Ex. ``d7a'' means drop seven items of ob- - ject a. + d Drop something. - D Drop several things. In answer to the question ``What kinds - of things do you want to drop? [!%= BUCXaium]'' you should - type zero or more object symbols possibly followed by `a' - and/or `i' and/or `u' and/or `m'. In addition, one or more - of the blessed/uncursed/cursed groups may be typed. + Ex. ‘‘d7a’’ means drop seven items of object a. - DB - drop all objects known to be blessed. - DU - drop all objects known to be uncursed. - DC - drop all objects known to be cursed. - DX - drop all objects of unknown B/U/C status. - Da - drop all objects, without asking for confirmation. - Di - examine your inventory before dropping anything. - Du - drop only unpaid objects (when in a shop). - Dm - use a menu to pick which object(s) to drop. - D%u - drop only unpaid food. + D Drop several things. + + In answer to the question + + ‘‘What kinds of things do you want to drop? [!%= BUCXaium]’’ + + you should type zero or more object symbols possibly fol†+ lowed by ‘a’ and/or ‘i’ and/or ‘u’ and/or ‘m’. In addition, + one or more of the blessed/uncursed/cursed groups may be + typed. + + DB †drop all objects known to be blessed. + DU †drop all objects known to be uncursed. + DC †drop all objects known to be cursed. + DX †drop all objects of unknown B/U/C status. + Da †drop all objects, without asking for confirmation. + Di †examine your inventory before dropping anything. + Du †drop only unpaid objects (when in a shop). + Dm †use a menu to pick which object(s) to drop. + D%u †drop only unpaid food. ^D Kick something (usually a door). e Eat food. - E Engrave a message on the floor. Engraving the word - ``Elbereth'' will cause most monsters to not attack you - hand-to-hand (but if you attack, you will rub it out); this - is often useful to give yourself a breather. (This feature - may be compiled out of the game, so your version might not - have it.) + E Engrave a message on the floor. - E- - write in the dust with your fingers. + E††write in the dust with your fingers. - f Fire one of the objects placed in your quiver. You may se- - lect ammunition with a previous `Q' command, or let the com- - puter pick something appropriate if autoquiver is true. + Engraving the word ‘‘Elbereth’’ will cause most monsters to + not attack you handâ€toâ€hand (but if you attack, you will rub + it out); this is often useful to give yourself a breather. + (This feature may be compiled out of the game, so your ver†+ sion might not have it.) - i List your inventory (everything you're carrying). - - I List selected parts of your inventory. - - I* - list all gems in inventory; - Iu - list all unpaid items; - Ix - list all used up items that are on your shopping bill; - I$ - count your money. - - o Open a door. - - O Set options. A menu showing the current option values will - be displayed. You can change most values simply by select- - ing the menu entry for the given option (ie, by typing its + f Fire one of the objects placed in your quiver (or quiver + sack, or that you have at the ready). You may select ammu†+ nition with a previous ‘Q’ command, or let the computer pick + something appropriate if autoquiver is true. - NetHack 3.5 September 20, 2006 + + + NetHack 3.6 March 27, 2015 @@ -730,63 +730,63 @@ - letter or clicking upon it, depending on your user inter- - face). For the non-boolean choices, a further menu or - prompt will appear once you've closed this menu. The avail- - able options are listed later in this Guidebook. Options - are usually set before the game rather than with the `O' - command; see the section on options below. + i List your inventory (everything you’re carrying). + + I List selected parts of your inventory. + + I* †list all gems in inventory; + Iu †list all unpaid items; + Ix †list all used up items that are on your shopping bill; + I$ †count your money. + + o Open a door. + + O Set options. + + A menu showing the current option values will be displayed. + You can change most values simply by selecting the menu en†+ try for the given option (ie, by typing its letter or click†+ ing upon it, depending on your user interface). For the + nonâ€boolean choices, a further menu or prompt will appear + once you’ve closed this menu. The available options are + listed later in this Guidebook. Options are usually set be†+ fore the game rather than with the ‘O’ command; see the sec†+ tion on options below. p Pay your shopping bill. P Put on a ring or other accessory (amulet, blindfold). - ^P Repeat previous message. Subsequent ^P's repeat earlier - messages. The behavior can be varied via the msg_window op- - tion. + Use the ’W’ command to wear armor. + + ^P Repeat previous message. + + Subsequent ^P’s repeat earlier messages. The behavior can + be varied via the msg_window option. q Quaff (drink) something (potion, water, etc). - Q Select an object for your quiver. You can then throw this - using the `f' command. (In versions prior to 3.3 this was - the command to quit the game, which has now been moved to - `#quit'.) + Q Select an object for your quiver, quiver sack, or just gen†+ erally at the ready (only one of these is available at a + time). You can then throw this (or one of these) using the + ‘f’ command. (In versions prior to 3.3 this was the command + to quit the game, which has now been moved to ‘#quit’.) r Read a scroll or spellbook. R Remove an accessory (ring, amulet, etc). - ^R Redraw the screen. + If you’re wearing more than one, you’ll be prompted for + which one to remove. If you’re only wearing one, then by + default it will be removed without asking, but you can set + the paranoid_confirmation option to require a prompt. - s Search for secret doors and traps around you. It usually - takes several tries to find something. - - S Save (and suspend) the game. The game will be restored au- - tomatically the next time you play. - - t Throw an object or shoot a projectile. - - T Take off armor. - - ^T Teleport, if you have the ability. - - v Display version number. - - V Display the game history. - - w Wield weapon. - - w- - wield nothing, use your bare hands. - - W Wear armor. - - x Exchange your wielded weapon with the item in your alternate - weapon slot. The latter is used as your secondary weapon - when engaging in two-weapon combat. Note that if one of - these slots is empty, the exchange still takes place. + Use the ’T’ command to take off armor. - NetHack 3.5 September 20, 2006 + + + NetHack 3.6 March 27, 2015 @@ -796,16 +796,81 @@ - X Enter explore (discovery) mode, explained in its own section - later. + ^R Redraw the screen. - ^X Display your name, role, race, gender, and alignment as well - as the various deities in your game. + s Search for secret doors and traps around you. It usually + takes several tries to find something. - z Zap a wand. To aim at yourself, use `.' for the direction. + S Save (and suspend) the game. The game will be restored au†+ tomatically the next time you play. - Z Zap (cast) a spell. To cast at yourself, use `.' for the - direction. + t Throw an object or shoot a projectile. + + T Take off armor. + + If you’re wearing more than one piece, you’ll be prompted + for which one to take off. If you’re only wearing one, then + by default it will be taken off without asking, but you can + set the paranoid_confirmation option to require a prompt. + + Use the ’R’ command to remove accessories. + + ^T Teleport, if you have the ability. + + v Display version number. + + V Display the game history. + + w Wield weapon. + + w††wield nothing, use your bare hands. + + Some characters can wield two weapons and once; use the + ‘‘#twoweapon’’ extended command to do so. + + W Wear armor. + + Use the ’P’ command to put on accessories. + + x Exchange your wielded weapon with the item in your alternate + weapon slot. + + The latter is used as your secondary weapon when engaging in + twoâ€weapon combat. Note that if one of these slots is emp†+ ty, the exchange still takes place. + + X Toggle twoâ€weapon combat, if your character can do it. Also + available via the ‘‘#twoweapon’’ extended command + + ^X Display basic information about your character. + + Displays name, role, race, gender (unless role name makes + that redundant, such as Caveman or Priestess), and align†+ ment, along with your patron deity and his or her opposi†+ tion. It also shows most of the various items of informa†+ tion from the status line(s) in a less terse form, including + several additional things which don’t appear in the normal + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 14 + + + + status display due to space considerations. + + z Zap a wand. + + z. †to aim at yourself, use ‘.’ for the direction. + + Z Zap (cast) a spell. + + Z. †to cast at yourself, use ‘.’ for the direction. ^Z Suspend the game (UNIX(R) versions with job control only). @@ -813,8 +878,9 @@ ; Show what type of thing a visible symbol corresponds to. - , Pick up some things. May be preceded by `m' to force a se- - lection menu. + , Pick up some things from the floor beneath you. + + May be preceded by ‘m’ to force a selection menu. @ Toggle the autopickup option on and off. @@ -830,95 +896,29 @@ ( Tell what tools you are using. - * Tell what equipment you are using; combines the preceding - five type-specific commands into one. + * Tell what equipment you are using. + + Combines the preceding five typeâ€specific commands into one. $ Count your gold pieces. - + List the spells you know. Using this command, you can also - rearrange the order in which your spells are listed, either - by sorting the entire list or by picking one spell from the - menu then picking another to swap places with it. Swapping - pairs of spells changes their casting letters, so the change - lasts after the current `+' command finishes. Sorting the - whole list is temporary. To make the most recent sort order - persist beyond the current `+' command, choose the sort op- - tion again and then pick "reassign casting letters". (Any - spells learned after that will be added to the end of the - list rather than be inserted into the sorted ordering.) + + List the spells you know. + Using this command, you can also rearrange the order in + which your spells are listed, either by sorting the entire + list or by picking one spell from the menu then picking an†+ other to swap places with it. Swapping pairs of spells + changes their casting letters, so the change lasts after the + current ‘+’ command finishes. Sorting the whole list is + temporary. To make the most recent sort order persist be†+ yond the current ‘+’ command, choose the sort option again + and then pick "reassign casting letters". (Any spells __________ (R)UNIX is a registered trademark of AT&T. - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 14 - - - - \ Show what types of objects have been discovered. - - ! Escape to a shell. - - # Perform an extended command. As you can see, the authors of - NetHack used up all the letters, so this is a way to intro- - duce the less frequently used commands. What extended com- - mands are available depends on what features the game was - compiled with. - - #adjust - Adjust inventory letters (most useful when the fixinv option - is ``on''). This command allows you to move an item from - one particular inventory slot to another so that it has a - letter which is more meaningful for you or that it will ap- - pear in a particular location when inventory listings are - displayed. ``#adjust'' can also be used to split a stack of - objects; when choosing the item to adjust, enter a count - prior to its letter. - - #chat - Talk to someone. - - #conduct - List voluntary challenges you have maintained. See the sec- - tion below entitled ``Conduct'' for details. - - #dip Dip an object into something. - - #enhance - Advance or check weapon and spell skills. - - #force - Force a lock. - - #invoke - Invoke an object's special powers. - - #jump - Jump to another location. - - #loot - Loot a box or bag on the floor beneath you, or the saddle - from a horse standing next to you. - - #monster - Use a monster's special ability (when polymorphed into mon- - ster form). - - #name - Name an item or type of object. - - #offer - Offer a sacrifice to the gods. - - - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -928,63 +928,63 @@ - #pray - Pray to the gods for help. + learned after that will be added to the end of the list + rather than be inserted into the sorted ordering.) - #quit - Quit the program without saving your game. + \ Show what types of objects have been discovered. - #ride - Ride (or stop riding) a monster. + ‘ Show discovered types for one class of objects. - #rub Rub a lamp or a stone. + ! Escape to a shell. - #sit Sit down. + # Perform an extended command. - #tip Tip over a container to pour out its contents. + As you can see, the authors of NetHack used up all the let†+ ters, so this is a way to introduce the less frequently used + commands. What extended commands are available depends on + what features the game was compiled with. - #turn - Turn undead. + #adjust + Adjust inventory letters (most useful when the fixinv option + is ‘‘on’’). - #twoweapon - Toggle two-weapon combat on or off. Note that you must use - suitable weapons for this type of combat, or it will be au- - tomatically turned off. + This command allows you to move an item from one particular + inventory slot to another so that it has a letter which is + more meaningful for you or that it will appear in a particu†+ lar location when inventory listings are displayed. ‘‘#ad†+ just’’ can also be used to split a stack of objects; when + choosing the item to adjust, enter a count prior to its let†+ ter. - #untrap - Untrap something (trap, door, or chest). + #chat + Talk to someone. - #version - Print compile time options for this version of NetHack. + #conduct + List voluntary challenges you have maintained. - #wipe - Wipe off your face. + See the section below entitled ‘‘Conduct’’ for details. - #? Help menu: get the list of available extended commands. + #dip + Dip an object into something. - If your keyboard has a meta key (which, when pressed in com- - bination with another key, modifies it by setting the `meta' - [8th, or `high'] bit), you can invoke many extended commands by - meta-ing the first letter of the command. In NT, OS/2, and PC - NetHack, the `Alt' key can be used in this fashion. + #enhance + Advance or check weapon and spell skills. - M-? #? (not supported by all platforms) + #force + Force a lock. - M-2 #twoweapon (unless the number_pad option is enabled) + #invoke + Invoke an object’s special powers. - M-a #adjust + #jump + Jump to another location. - M-c #chat - - M-d #dip - - M-e #enhance - - M-f #force + #loot + Loot a box or bag on the floor beneath you, or the saddle + from a steed standing next to you. - - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -994,63 +994,63 @@ - M-i #invoke + #monster + Use a monster’s special ability (when polymorphed into mon†+ ster form). - M-j #jump + #name + Name a monster, an individual object, or a type of object. + Same as ‘C’. - M-l #loot + #offer + Offer a sacrifice to the gods. - M-m #monster + You’ll need to find an altar to have any chance at success. + Corpses of recently killed monsters are the fodder of + choice. - M-n #name + #pray + Pray to the gods for help. - M-o #offer + Praying too soon after receiving prior help is a bad idea. + (Hint: entering the dungeon alive is treated as having re†+ ceived help. You probably shouldn’t start off a new game by + praying right away.) Since using this command by accident + can cause trouble, there is an option to make you confirm + your intent before praying. It is enabled by default, and + you can reset the paranoid_confirmation option to disable + it. - M-p #pray + #quit + Quit the program without saving your game. - M-q #quit + Since using this command by accident would throw away the + current game, you are asked to confirm your intent before + quitting. By default a response of ’y’ acknowledges that + intent. You can set the paranoid_confirmation option to re†+ quire a response of "yes" instead. - M-r #rub + #ride + Ride (or stop riding) a monster. - M-s #sit + #rub + Rub a lamp or a stone. - M-t #turn + #sit + Sit down. - M-u #untrap + #terrain + Show bare map without displaying monsters, objects, or + traps. - M-v #version + #tip + Tip over a container (bag or box) to pour out its contents. - M-w #wipe - - If the number_pad option is on, some additional letter com- - mands are available: - - h Help menu: display one of several help texts available, - like ``?''. - - j Jump to another location. Same as ``#jump'' or ``M-j''. - - k Kick something (usually a door). Same as `^D'. - - l Loot a box or bag on the floor beneath you, or the saddle - from a horse standing next to you. Same as ``#loot'' or - ``M-l''. - - N Name an item or type of object. Same as ``#name'' or ``M- - n''. - - u Untrap a trap, door, or chest. Same as ``#untrap'' or ``M- - u''. + #turn + Turn undead. - 5. Rooms and corridors - - Rooms and corridors in the dungeon are either lit or dark. - Any lit areas within your line of sight will be displayed; dark - areas are only displayed if they are within one space of you. - - - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -1060,63 +1060,63 @@ - Walls and corridors remain on the map as you explore them. + #twoweapon + Toggle twoâ€weapon combat on or off. - Secret corridors are hidden. You can find them with the `s' - (search) command. + Note that you must use suitable weapons for this type of + combat, or it will be automatically turned off. - 5.1. Doorways + #untrap + Untrap something (trap, door, or chest). - Doorways connect rooms and corridors. Some doorways have no - doors; you can walk right through. Others have doors in them, - which may be open, closed, or locked. To open a closed door, use - the `o' (open) command; to close it again, use the `c' (close) - command. + In some circumstances it can also be used to rescue trapped + monsters. - You can get through a locked door by using a tool to pick - the lock with the `a' (apply) command, or by kicking it open with - the `^D' (kick) command. + #version + Print compile time options for this version of NetHack. - Open doors cannot be entered diagonally; you must approach - them straight on, horizontally or vertically. Doorways without - doors are not restricted in this fashion. + #wipe + Wipe off your face. - Doors can be useful for shutting out monsters. Most mon- - sters cannot open doors, although a few don't need to (ex. ghosts - can walk through doors). + #? + Help menu: get the list of available extended commands. - Secret doors are hidden. You can find them with the `s' - (search) command. Once found they are in all ways equivalent to - normal doors. + If your keyboard has a meta key (which, when pressed in com†+ bination with another key, modifies it by setting the ‘meta’ + [8th, or ‘high’] bit), you can invoke many extended commands by + metaâ€ing the first letter of the command. In NT, OS/2, PC and ST + NetHack, the ‘Alt’ key can be used in this fashion; on the Amiga, + set the altmeta option to get this behavior. On other systems, + if typing ‘Alt’ plus another key transmits a two character se†+ quence consisting of an Escape followed by the other key, you may + set the altmeta option to have nethack combine them into + meta+key. - 5.2. Traps (`^') + Mâ€? #? (not supported by all platforms) - There are traps throughout the dungeon to snare the unwary - delver. For example, you may suddenly fall into a pit and be - stuck for a few turns trying to climb out. Traps don't appear on - your map until you see one triggered by moving onto it, see some- - thing fall into it, or you discover it with the `s' (search) com- - mand. Monsters can fall prey to traps, too, which can be a very - useful defensive strategy. + Mâ€2 #twoweapon (unless the number_pad option is enabled) - There is a special pre-mapped branch of the dungeon based on - the classic computer game ``Sokoban.'' The goal is to push the - boulders into the pits or holes. With careful foresight, it is - possible to complete all of the levels according to the tradi- - tional rules of Sokoban. Some allowances are permitted in case - the player gets stuck; however, they will lower your luck. + Mâ€a #adjust - 5.3. Stairs (`<', `>') + Mâ€A #annotate (if supported) - In general, each level in the dungeon will have a staircase - going up (`<') to the previous level and another going down (`>') - to the next level. There are some exceptions though. For in- - stance, fairly early in the dungeon you will find a level with - two down staircases, one continuing into the dungeon and the oth- - er branching into an area known as the Gnomish Mines. Those + Mâ€c #chat + + Mâ€C #conduct + + Mâ€d #dip + + Mâ€e #enhance + + Mâ€f #force + + Mâ€i #invoke + + Mâ€j #jump - NetHack 3.5 September 20, 2006 + + NetHack 3.6 March 27, 2015 @@ -1126,63 +1126,63 @@ - mines eventually hit a dead end, so after exploring them (if you - choose to do so), you'll need to climb back up to the main dun- - geon. + Mâ€l #loot - When you traverse a set of stairs, or trigger a trap which - sends you to another level, the level you're leaving will be de- - activated and stored in a file on disk. If you're moving to a - previously visited level, it will be loaded from its file on disk - and reactivated. If you're moving to a level which has not yet - been visited, it will be created (from scratch for most random - levels, from a template for some ``special'' levels, or loaded - from the remains of an earlier game for a ``bones'' level as - briefly described below). Monsters are only active on the cur- - rent level; those on other levels are essentially placed into - stasis. + Mâ€m #monster - Ordinarily when you climb a set of stairs, you will arrive - on the corresponding staircase at your destination. However, - pets (see below) and some other monsters will follow along if - they're close enough when you travel up or down stairs, and occa- - sionally one of these creatures will displace you during the - climb. When that occurs, the pet or other monster will arrive on - the staircase and you will end up nearby. + Mâ€n #name - 5.4. Ladders (`<', `>') + Mâ€o #offer - Ladders serve the same purpose as staircases, and the two - types of inter-level connections are nearly indistinguishable - during game play. + Mâ€O #overview (if supported) - 5.5. Shops and shopping + Mâ€p #pray - Occasionally you will run across a room with a shopkeeper - near the door and many items lying on the floor. You can buy - items by picking them up and then using the `p' command. You can - inquire about the price of an item prior to picking it up by us- - ing the ``#chat'' command while standing on it. Using an item - prior to paying for it will incur a charge, and the shopkeeper - won't allow you to leave the shop until you have paid any debt - you owe. + Mâ€q #quit - You can sell items to a shopkeeper by dropping them to the - floor while inside a shop. You will either be offered an amount - of gold and asked whether you're willing to sell, or you'll be - told that the shopkeeper isn't interested (generally, your item - needs to be compatible with the type of merchandise carried by - the shop). + Mâ€r #rub - If you drop something in a shop by accident, the shopkeeper - will usually claim ownership without offering any compensation. - You'll have to buy it back if you want to reclaim it. + Mâ€R #ride (if supported) - Shopkeepers sometimes run out of money. When that happens, - you'll be offered credit instead of gold when you try to sell + Mâ€s #sit + + Mâ€t #turn + + Mâ€T #tip + + Mâ€u #untrap + + Mâ€v #version + + Mâ€w #wipe + + If the number_pad option is on, some additional letter com†+ mands are available: + + h Help menu: display one of several help texts available, + like ‘‘?’’. + + j Jump to another location. Same as ‘‘#jump’’ or ‘‘Mâ€j’’. + + k Kick something (usually a door). Same as ‘^D’. + + l Loot a box or bag on the floor beneath you, or the saddle + from a steed standing next to you. Same as ‘‘#loot’’ or + ‘‘Mâ€l’’. + + N Name a monster, an individual object, or a type of object. + Same as ‘‘#name’’ (or ‘‘Mâ€n’’) which is the same as the ‘C’ + command. + + u Untrap a trap, door, or chest. Same as ‘‘#untrap’’ or ‘‘M†+ u’’. - NetHack 3.5 September 20, 2006 + + + + + NetHack 3.6 March 27, 2015 @@ -1192,17 +1192,157 @@ + 5. Rooms and corridors + + Rooms and corridors in the dungeon are either lit or dark. + Any lit areas within your line of sight will be displayed; dark + areas are only displayed if they are within one space of you. + Walls and corridors remain on the map as you explore them. + + Secret corridors are hidden. You can find them with the ‘s’ + (search) command. + + 5.1. Doorways + + Doorways connect rooms and corridors. Some doorways have no + doors; you can walk right through. Others have doors in them, + which may be open, closed, or locked. To open a closed door, use + the ‘o’ (open) command; to close it again, use the ‘c’ (close) + command. + + You can get through a locked door by using a tool to pick + the lock with the ‘a’ (apply) command, or by kicking it open with + the ‘^D’ (kick) command. + + Open doors cannot be entered diagonally; you must approach + them straight on, horizontally or vertically. Doorways without + doors are not restricted in this fashion. + + Doors can be useful for shutting out monsters. Most mon†+ sters cannot open doors, although a few don’t need to (ex. ghosts + can walk through doors). + + Secret doors are hidden. You can find them with the ‘s’ + (search) command. Once found they are in all ways equivalent to + normal doors. + + 5.2. Traps (‘^’) + + There are traps throughout the dungeon to snare the unwary + delver. For example, you may suddenly fall into a pit and be + stuck for a few turns trying to climb out. Traps don’t appear on + your map until you see one triggered by moving onto it, see some†+ thing fall into it, or you discover it with the ‘s’ (search) com†+ mand. Monsters can fall prey to traps, too, which can be a very + useful defensive strategy. + + There is a special preâ€mapped branch of the dungeon based on + the classic computer game ‘‘Sokoban.’’ The goal is to push the + boulders into the pits or holes. With careful foresight, it is + possible to complete all of the levels according to the tradi†+ tional rules of Sokoban. Some allowances are permitted in case + the player gets stuck; however, they will lower your luck. + + + + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 20 + + + + 5.3. Stairs (‘<’, ‘>’) + + In general, each level in the dungeon will have a staircase + going up (‘<’) to the previous level and another going down (‘>’) + to the next level. There are some exceptions though. For in†+ stance, fairly early in the dungeon you will find a level with + two down staircases, one continuing into the dungeon and the oth†+ er branching into an area known as the Gnomish Mines. Those + mines eventually hit a dead end, so after exploring them (if you + choose to do so), you’ll need to climb back up to the main dun†+ geon. + + When you traverse a set of stairs, or trigger a trap which + sends you to another level, the level you’re leaving will be de†+ activated and stored in a file on disk. If you’re moving to a + previously visited level, it will be loaded from its file on disk + and reactivated. If you’re moving to a level which has not yet + been visited, it will be created (from scratch for most random + levels, from a template for some ‘‘special’’ levels, or loaded + from the remains of an earlier game for a ‘‘bones’’ level as + briefly described below). Monsters are only active on the cur†+ rent level; those on other levels are essentially placed into + stasis. + + Ordinarily when you climb a set of stairs, you will arrive + on the corresponding staircase at your destination. However, + pets (see below) and some other monsters will follow along if + they’re close enough when you travel up or down stairs, and occa†+ sionally one of these creatures will displace you during the + climb. When that occurs, the pet or other monster will arrive on + the staircase and you will end up nearby. + + 5.4. Ladders (‘<’, ‘>’) + + Ladders serve the same purpose as staircases, and the two + types of interâ€level connections are nearly indistinguishable + during game play. + + 5.5. Shops and shopping + + Occasionally you will run across a room with a shopkeeper + near the door and many items lying on the floor. You can buy + items by picking them up and then using the ‘p’ command. You can + inquire about the price of an item prior to picking it up by us†+ ing the ‘‘#chat’’ command while standing on it. Using an item + prior to paying for it will incur a charge, and the shopkeeper + won’t allow you to leave the shop until you have paid any debt + you owe. + + You can sell items to a shopkeeper by dropping them to the + floor while inside a shop. You will either be offered an amount + of gold and asked whether you’re willing to sell, or you’ll be + told that the shopkeeper isn’t interested (generally, your item + needs to be compatible with the type of merchandise carried by + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 21 + + + + the shop). + + If you drop something in a shop by accident, the shopkeeper + will usually claim ownership without offering any compensation. + You’ll have to buy it back if you want to reclaim it. + + Shopkeepers sometimes run out of money. When that happens, + you’ll be offered credit instead of gold when you try to sell something. Credit can be used to pay for purchases, but it is only good in the shop where it was obtained; other shopkeepers - won't honor it. (If you happen to find a "credit card" in the - dungeon, don't bother trying to use it in shops; shopkeepers will + won’t honor it. (If you happen to find a "credit card" in the + dungeon, don’t bother trying to use it in shops; shopkeepers will not accept it.) - The `$' command, which reports the amount of gold you are + The ‘$’ command, which reports the amount of gold you are carrying (in inventory, not inside bags or boxes), will also show - current shop debt or credit, if any. The `Iu' command lists un- - paid items (those which still belong to the shop) if you are car- - rying any. The `Ix' command shows an inventory-like display of + current shop debt or credit, if any. The ‘Iu’ command lists un†+ paid items (those which still belong to the shop) if you are car†+ rying any. The ‘Ix’ command shows an inventoryâ€like display of any unpaid items which have been used up, along with other shop fees, if any. @@ -1221,7 +1361,7 @@ * If a shop is "closed for inventory", it will not open of its own accord. - * Shops do not get restocked with new items, regardless of inven- + * Shops do not get restocked with new items, regardless of inven†tory depletion. @@ -1232,155 +1372,15 @@ magic items can help you locate them before they locate you (which some monsters can do very well). - The commands `/' and `;' may be used to obtain information - about those monsters who are displayed on the screen. The com- - mand `C' allows you to assign a name to a monster, which may be - useful to help distinguish one from another when multiple mon- - sters are present. Assigning a name which is just a space will - remove any prior name. - - The extended command ``#chat'' can be used to interact with - an adjacent monster. There is no actual dialog (in other words, - you don't get to choose what you'll say), but chatting with some - monsters such as a shopkeeper or the Oracle of Delphi can produce - useful results. + The commands ‘/’ and ‘;’ may be used to obtain information + about those monsters who are displayed on the screen. The com†+ mand ‘‘#name’’, or its synonym ‘C’, allows you to assign a name + to a monster, which may be useful to help distinguish one from + another when multiple monsters are present. Assigning a name + which is just a space will remove any prior name. - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 20 - - - - 6.1. Fighting - - If you see a monster and you wish to fight it, just attempt - to walk into it. Many monsters you find will mind their own - business unless you attack them. Some of them are very dangerous - when angered. Remember: discretion is the better part of valor. - - If you can't see a monster (if it is invisible, or if you - are blinded), the symbol `I' will be shown when you learn of its - presence. If you attempt to walk into it, you will try to fight - it just like a monster that you can see; of course, if the mon- - ster has moved, you will attack empty air. If you guess that the - monster has moved and you don't wish to fight, you can use the - `m' command to move without fighting; likewise, if you don't re- - member a monster but want to try fighting anyway, you can use the - `F' command. - - 6.2. Your pet - - You start the game with a little dog (`d'), cat (`f'), or - pony (`u'), which follows you about the dungeon and fights mon- - sters with you. Like you, your pet needs food to survive. It - usually feeds itself on fresh carrion and other meats. If you're - worried about it or want to train it, you can feed it, too, by - throwing it food. A properly trained pet can be very useful un- - der certain circumstances. - - Your pet also gains experience from killing monsters, and - can grow over time, gaining hit points and doing more damage. - Initially, your pet may even be better at killing things than - you, which makes pets useful for low-level characters. - - Your pet will follow you up and down staircases if it is - next to you when you move. Otherwise your pet will be stranded - and may become wild. Similarly, when you trigger certain types - of traps which alter your location (for instance, a trap door - which drops you to a lower dungeon level), any adjacent pet will - accompany you and any non-adjacent pet will be left behind. Your - pet may trigger such traps itself; you will not be carried along - with it even if adjacent at the time. - - 6.3. Steeds - - Some types of creatures in the dungeon can actually be rid- - den if you have the right equipment and skill. Convincing a wild - beast to let you saddle it up is difficult to say the least. - Many a dungeoneer has had to resort to magic and wizardry in or- - der to forge the alliance. Once you do have the beast under your - control however, you can easily climb in and out of the saddle - with the `#ride' command. Lead the beast around the dungeon when - riding, in the same manner as you would move yourself. It is the - beast that you will see displayed on the map. - - - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 21 - - - - Riding skill is managed by the `#enhance' command. See the - section on Weapon proficiency for more information about that. - - 6.4. Bones levels - - You may encounter the shades and corpses of other adventur- - ers (or even former incarnations of yourself!) and their personal - effects. Ghosts are hard to kill, but easy to avoid, since - they're slow and do little damage. You can plunder the deceased - adventurer's possessions; however, they are likely to be cursed. - Beware of whatever killed the former player; it is probably still - lurking around, gloating over its last victory. - - - 7. Objects - - When you find something in the dungeon, it is common to want - to pick it up. In NetHack, this is accomplished automatically by - walking over the object (unless you turn off the autopickup op- - tion (see below), or move with the `m' prefix (see above)), or - manually by using the `,' command. - - If you're carrying too many items, NetHack will tell you so - and you won't be able to pick up anything more. Otherwise, it - will add the object(s) to your pack and tell you what you just - picked up. - - As you add items to your inventory, you also add the weight - of that object to your load. The amount that you can carry de- - pends on your strength and your constitution. The stronger you - are, the less the additional load will affect you. There comes a - point, though, when the weight of all of that stuff you are car- - rying around with you through the dungeon will encumber you. - Your reactions will get slower and you'll burn calories faster, - requiring food more frequently to cope with it. Eventually, - you'll be so overloaded that you'll either have to discard some - of what you're carrying or collapse under its weight. - - NetHack will tell you how badly you have loaded yourself. - The symbols `Burdened', `Stressed', `Strained', `Overtaxed' and - `Overloaded' are displayed on the bottom line display to indicate - your condition. - - When you pick up an object, it is assigned an inventory let- - ter. Many commands that operate on objects must ask you to find - out which object you want to use. When NetHack asks you to - choose a particular object you are carrying, you are usually pre- - sented with a list of inventory letters to choose from (see Com- - mands, above). - - Some objects, such as weapons, are easily differentiated. - Others, like scrolls and potions, are given descriptions which - vary according to type. During a game, any two objects with the - same description are the same type. However, the descriptions - - - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -1390,63 +1390,63 @@ - will vary from game to game. + The extended command ‘‘#chat’’ can be used to interact with + an adjacent monster. There is no actual dialog (in other words, + you don’t get to choose what you’ll say), but chatting with some + monsters such as a shopkeeper or the Oracle of Delphi can produce + useful results. - When you use one of these objects, if its effect is obvious, - NetHack will remember what it is for you. If its effect isn't - extremely obvious, you will be asked what you want to call this - type of object so you will recognize it later. You can also use - the ``#name'' command for the same purpose at any time, to name - all objects of a particular type or just an individual object. - When you use ``#name'' on an object which has already been named, - specifying a space as the value will remove the prior name in- - stead of assigning a new one. + 6.1. Fighting - 7.1. Curses and Blessings + If you see a monster and you wish to fight it, just attempt + to walk into it. Many monsters you find will mind their own + business unless you attack them. Some of them are very dangerous + when angered. Remember: discretion is the better part of valor. - Any object that you find may be cursed, even if the object - is otherwise helpful. The most common effect of a curse is being - stuck with (and to) the item. Cursed weapons weld themselves to - your hand when wielded, so you cannot unwield them. Any cursed - item you wear is not removable by ordinary means. In addition, - cursed arms and armor usually, but not always, bear negative en- - chantments that make them less effective in combat. Other cursed - objects may act poorly or detrimentally in other ways. + In most circumstances, if you attempt to attack a peaceful + monster by moving into its location, you’ll be asked to confirm + your intent. By default an answer of ’y’ acknowledges that in†+ tent, which can be error prone if you’re using ’y’ to move. You + can set the paranoid_confirmation option to require a response of + "yes" instead. - Objects can also be blessed. Blessed items usually work - better or more beneficially than normal uncursed items. For ex- - ample, a blessed weapon will do more damage against demons. + If you can’t see a monster (if it is invisible, or if you + are blinded), the symbol ‘I’ will be shown when you learn of its + presence. If you attempt to walk into it, you will try to fight + it just like a monster that you can see; of course, if the mon†+ ster has moved, you will attack empty air. If you guess that the + monster has moved and you don’t wish to fight, you can use the + ‘m’ command to move without fighting; likewise, if you don’t re†+ member a monster but want to try fighting anyway, you can use the + ‘F’ command. - There are magical means of bestowing or removing curses upon - objects, so even if you are stuck with one, you can still have - the curse lifted and the item removed. Priests and Priestesses - have an innate sensitivity to this property in any object, so - they can more easily avoid cursed objects than other character - roles. + 6.2. Your pet - An item with unknown status will be reported in your inven- - tory with no prefix. An item which you know the state of will be - distinguished in your inventory by the presence of the word - ``cursed'', ``uncursed'' or ``blessed'' in the description of the - item. + You start the game with a little dog (‘d’), cat (‘f’), or + pony (‘u’), which follows you about the dungeon and fights mon†+ sters with you. Like you, your pet needs food to survive. It + usually feeds itself on fresh carrion and other meats. If you’re + worried about it or want to train it, you can feed it, too, by + throwing it food. A properly trained pet can be very useful un†+ der certain circumstances. - 7.2. Weapons (`)') + Your pet also gains experience from killing monsters, and + can grow over time, gaining hit points and doing more damage. + Initially, your pet may even be better at killing things than + you, which makes pets useful for lowâ€level characters. - Given a chance, most monsters in the Mazes of Menace will - gratuitously try to kill you. You need weapons for self-defense - (killing them first). Without a weapon, you do only 1-2 hit - points of damage (plus bonuses, if any). Monk characters are an - exception; they normally do much more damage with bare hands than - they do with weapons. - - There are wielded weapons, like maces and swords, and thrown - weapons, like arrows and spears. To hit monsters with a weapon, - you must wield it and attack them, or throw it at them. You can - simply elect to throw a spear. To shoot an arrow, you should - first wield a bow, then throw the arrow. Crossbows shoot + Your pet will follow you up and down staircases if it is + next to you when you move. Otherwise your pet will be stranded + and may become wild. Similarly, when you trigger certain types + of traps which alter your location (for instance, a trap door + which drops you to a lower dungeon level), any adjacent pet will + accompany you and any nonâ€adjacent pet will be left behind. Your + pet may trigger such traps itself; you will not be carried along + with it even if adjacent at the time. - NetHack 3.5 September 20, 2006 + + NetHack 3.6 March 27, 2015 @@ -1456,63 +1456,63 @@ - crossbow bolts. Slings hurl rocks and (other) stones (like - gems). + 6.3. Steeds - Enchanted weapons have a ``plus'' (or ``to hit enhancement'' - which can be either positive or negative) that adds to your - chance to hit and the damage you do to a monster. The only way - to determine a weapon's enchantment is to have it magically iden- - tified somehow. Most weapons are subject to some type of damage - like rust. Such ``erosion'' damage can be repaired. + Some types of creatures in the dungeon can actually be rid†+ den if you have the right equipment and skill. Convincing a wild + beast to let you saddle it up is difficult to say the least. + Many a dungeoneer has had to resort to magic and wizardry in or†+ der to forge the alliance. Once you do have the beast under your + control however, you can easily climb in and out of the saddle + with the ‘#ride’ command. Lead the beast around the dungeon when + riding, in the same manner as you would move yourself. It is the + beast that you will see displayed on the map. - The chance that an attack will successfully hit a monster, - and the amount of damage such a hit will do, depends upon many - factors. Among them are: type of weapon, quality of weapon (en- - chantment and/or erosion), experience level, strength, dexterity, - encumbrance, and proficiency (see below). The monster's armor - class - a general defense rating, not necessarily due to wearing - of armor - is a factor too; also, some monsters are particularly - vulnerable to certain types of weapons. + Riding skill is managed by the ‘#enhance’ command. See the + section on Weapon proficiency for more information about that. - Many weapons can be wielded in one hand; some require both - hands. When wielding a two-handed weapon, you can not wear a - shield, and vice versa. When wielding a one-handed weapon, you - can have another weapon ready to use by setting things up with - the `x' command, which exchanges your primary (the one being - wielded) and alternate weapons. And if you have proficiency in - the ``two weapon combat'' skill, you may wield both weapons si- - multaneously as primary and secondary; use the `#twoweapon' ex- - tended command to engage or disengage that. Only some types of - characters (barbarians, for instance) have the necessary skill - available. Even with that skill, using two weapons at once in- - curs a penalty in the chance to hit your target compared to using - just one weapon at a time. + 6.4. Bones levels - There might be times when you'd rather not wield any weapon - at all. To accomplish that, wield `-', or else use the `A' com- - mand which allows you to unwield the current weapon in addition - to taking off other worn items. - - Those of you in the audience who are AD&D players, be aware - that each weapon which existed in AD&D does roughly the same dam- - age to monsters in NetHack. Some of the more obscure weapons - (such as the aklys, lucern hammer, and bec-de-corbin) are defined - in an appendix to Unearthed Arcana, an AD&D supplement. - - The commands to use weapons are `w' (wield), `t' (throw), - `f' (fire, an alternative way of throwing), `Q' (quiver), `x' - (exchange), `#twoweapon', and `#enhance' (see below). - - 7.2.1. Throwing and shooting - - You can throw just about anything via the `t' command. It - will prompt for the item to throw; picking `?' will list things - in your inventory which are considered likely to be thrown, or - picking `*' will list your entire inventory. After you've chosen + You may encounter the shades and corpses of other adventur†+ ers (or even former incarnations of yourself!) and their personal + effects. Ghosts are hard to kill, but easy to avoid, since + they’re slow and do little damage. You can plunder the deceased + adventurer’s possessions; however, they are likely to be cursed. + Beware of whatever killed the former player; it is probably still + lurking around, gloating over its last victory. - NetHack 3.5 September 20, 2006 + 7. Objects + + When you find something in the dungeon, it is common to want + to pick it up. In NetHack, this is accomplished automatically by + walking over the object (unless you turn off the autopickup op†+ tion (see below), or move with the ‘m’ prefix (see above)), or + manually by using the ‘,’ command. + + If you’re carrying too many items, NetHack will tell you so + and you won’t be able to pick up anything more. Otherwise, it + will add the object(s) to your pack and tell you what you just + picked up. + + As you add items to your inventory, you also add the weight + of that object to your load. The amount that you can carry de†+ pends on your strength and your constitution. The stronger you + are, the less the additional load will affect you. There comes a + point, though, when the weight of all of that stuff you are car†+ rying around with you through the dungeon will encumber you. + Your reactions will get slower and you’ll burn calories faster, + requiring food more frequently to cope with it. Eventually, + you’ll be so overloaded that you’ll either have to discard some + of what you’re carrying or collapse under its weight. + + NetHack will tell you how badly you have loaded yourself. + The symbols ‘Burdened’, ‘Stressed’, ‘Strained’, ‘Overtaxed’ and + ‘Overloaded’ are displayed on the bottom line display to indicate + your condition. + + + NetHack 3.6 March 27, 2015 @@ -1522,63 +1522,63 @@ - what to throw, you will be prompted for a direction rather than - for a specific target. The distance something can be thrown de- - pends mainly on the type of object and your strength. Arrows can - be thrown by hand, but can be thrown much farther and will be - more likely to hit when thrown while you are wielding a bow. + When you pick up an object, it is assigned an inventory let†+ ter. Many commands that operate on objects must ask you to find + out which object you want to use. When NetHack asks you to + choose a particular object you are carrying, you are usually pre†+ sented with a list of inventory letters to choose from (see Com†+ mands, above). - You can simplify the throwing operation by using the `Q' - command to select your preferred ``missile'', then using the `f' - command to throw it. You'll be prompted for a direction as - above, but you don't have to specify which item to throw each - time you use `f'. There is also an option, autoquiver, which has - NetHack choose another item to automatically fill your quiver - when the inventory slot used for `Q' runs out. + Some objects, such as weapons, are easily differentiated. + Others, like scrolls and potions, are given descriptions which + vary according to type. During a game, any two objects with the + same description are the same type. However, the descriptions + will vary from game to game. - Some characters have the ability to fire a volley of multi- - ple items in a single turn. Knowing how to load several rounds - of ammunition at once -- or hold several missiles in your hand -- - and still hit a target is not an easy task. Rangers are among - those who are adept at this task, as are those with a high level - of proficiency in the relevant weapon skill (in bow skill if - you're wielding one to shoot arrows, in crossbow skill if you're - wielding one to shoot bolts, or in sling skill if you're wielding - one to shoot stones). The number of items that the character has - a chance to fire varies from turn to turn. You can explicitly - limit the number of shots by using a numeric prefix before the - `t' or `f' command. For example, ``2f'' (or ``n2f'' if using - number_pad mode) would ensure that at most 2 arrows are shot even - if you could have fired 3. If you specify a larger number than - would have been shot (``4f'' in this example), you'll just end up - shooting the same number (3, here) as if no limit had been speci- - fied. Once the volley is in motion, all of the items will travel - in the same direction; if the first ones kill a monster, the oth- - ers can still continue beyond that spot. + When you use one of these objects, if its effect is obvious, + NetHack will remember what it is for you. If its effect isn’t + extremely obvious, you will be asked what you want to call this + type of object so you will recognize it later. You can also use + the ‘‘#name’’ command, or its synonym ‘C’, for the same purpose + at any time, to name all objects of a particular type or just an + individual object. When you use ‘‘#name’’ on an object which has + already been named, specifying a space as the value will remove + the prior name instead of assigning a new one. - 7.2.2. Weapon proficiency + 7.1. Curses and Blessings - You will have varying degrees of skill in the weapons avail- - able. Weapon proficiency, or weapon skills, affect how well you - can use particular types of weapons, and you'll be able to im- - prove your skills as you progress through a game, depending on - your role, your experience level, and use of the weapons. + Any object that you find may be cursed, even if the object + is otherwise helpful. The most common effect of a curse is being + stuck with (and to) the item. Cursed weapons weld themselves to + your hand when wielded, so you cannot unwield them. Any cursed + item you wear is not removable by ordinary means. In addition, + cursed arms and armor usually, but not always, bear negative en†+ chantments that make them less effective in combat. Other cursed + objects may act poorly or detrimentally in other ways. - For the purposes of proficiency, weapons have been divided - up into various groups such as daggers, broadswords, and - polearms. Each role has a limit on what level of proficiency a - character can achieve for each group. For instance, wizards can - become highly skilled in daggers or staves but not in swords or - bows. + Objects can also be blessed. Blessed items usually work + better or more beneficially than normal uncursed items. For ex†+ ample, a blessed weapon will do more damage against demons. - The `#enhance' extended command is used to review current - weapons proficiency (also spell proficiency) and to choose which - skill(s) to improve when you've used one or more skills enough to - become eligible to do so. The skill rankings are ``none'' (some- - times also referred to as ``restricted'', because you won't be + There are magical means of bestowing or removing curses upon + objects, so even if you are stuck with one, you can still have + the curse lifted and the item removed. Priests and Priestesses + have an innate sensitivity to this property in any object, so + they can more easily avoid cursed objects than other character + roles. + + An item with unknown status will be reported in your inven†+ tory with no prefix. An item which you know the state of will be + distinguished in your inventory by the presence of the word + ‘‘cursed’’, ‘‘uncursed’’ or ‘‘blessed’’ in the description of the + item. - NetHack 3.5 September 20, 2006 + + + + + NetHack 3.6 March 27, 2015 @@ -1588,35 +1588,230 @@ - able to advance), ``unskilled'', ``basic'', ``skilled'', and - ``expert''. Restricted skills simply will not appear in the list - shown by `#enhance'. (Divine intervention might unrestrict a - particular skill, in which case it will start at unskilled and be - limited to basic.) Some characters can enhance their barehanded - combat or martial arts skill beyond expert to ``master'' or - ``grand master''. + 7.2. Weapons (‘)’) - Use of a weapon in which you're restricted or unskilled will + Given a chance, most monsters in the Mazes of Menace will + gratuitously try to kill you. You need weapons for selfâ€defense + (killing them first). Without a weapon, you do only 1â€2 hit + points of damage (plus bonuses, if any). Monk characters are an + exception; they normally do much more damage with bare hands than + they do with weapons. + + There are wielded weapons, like maces and swords, and thrown + weapons, like arrows and spears. To hit monsters with a weapon, + you must wield it and attack them, or throw it at them. You can + simply elect to throw a spear. To shoot an arrow, you should + first wield a bow, then throw the arrow. Crossbows shoot cross†+ bow bolts. Slings hurl rocks and (other) stones (like gems). + + Enchanted weapons have a ‘‘plus’’ (or ‘‘to hit enhancement’’ + which can be either positive or negative) that adds to your + chance to hit and the damage you do to a monster. The only way + to determine a weapon’s enchantment is to have it magically iden†+ tified somehow. Most weapons are subject to some type of damage + like rust. Such ‘‘erosion’’ damage can be repaired. + + The chance that an attack will successfully hit a monster, + and the amount of damage such a hit will do, depends upon many + factors. Among them are: type of weapon, quality of weapon (en†+ chantment and/or erosion), experience level, strength, dexterity, + encumbrance, and proficiency (see below). The monster’s armor + class †a general defense rating, not necessarily due to wearing + of armor †is a factor too; also, some monsters are particularly + vulnerable to certain types of weapons. + + Many weapons can be wielded in one hand; some require both + hands. When wielding a twoâ€handed weapon, you can not wear a + shield, and vice versa. When wielding a oneâ€handed weapon, you + can have another weapon ready to use by setting things up with + the ‘x’ command, which exchanges your primary (the one being + wielded) and alternate weapons. And if you have proficiency in + the ‘‘two weapon combat’’ skill, you may wield both weapons si†+ multaneously as primary and secondary; use the ‘#twoweapon’ ex†+ tended command to engage or disengage that. Only some types of + characters (barbarians, for instance) have the necessary skill + available. Even with that skill, using two weapons at once in†+ curs a penalty in the chance to hit your target compared to using + just one weapon at a time. + + There might be times when you’d rather not wield any weapon + at all. To accomplish that, wield ‘â€â€™, or else use the ‘A’ com†+ mand which allows you to unwield the current weapon in addition + to taking off other worn items. + + Those of you in the audience who are AD&D players, be aware + that each weapon which existed in AD&D does roughly the same dam†+ age to monsters in NetHack. Some of the more obscure weapons + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 26 + + + + (such as the aklys, lucern hammer, and becâ€deâ€corbin) are defined + in an appendix to Unearthed Arcana, an AD&D supplement. + + The commands to use weapons are ‘w’ (wield), ‘t’ (throw), + ‘f’ (fire, an alternative way of throwing), ‘Q’ (quiver), ‘x’ + (exchange), ‘#twoweapon’, and ‘#enhance’ (see below). + + 7.2.1. Throwing and shooting + + You can throw just about anything via the ‘t’ command. It + will prompt for the item to throw; picking ‘?’ will list things + in your inventory which are considered likely to be thrown, or + picking ‘*’ will list your entire inventory. After you’ve chosen + what to throw, you will be prompted for a direction rather than + for a specific target. The distance something can be thrown de†+ pends mainly on the type of object and your strength. Arrows can + be thrown by hand, but can be thrown much farther and will be + more likely to hit when thrown while you are wielding a bow. + + You can simplify the throwing operation by using the ‘Q’ + command to select your preferred ‘‘missile’’, then using the ‘f’ + command to throw it. You’ll be prompted for a direction as + above, but you don’t have to specify which item to throw each + time you use ‘f’. There is also an option, autoquiver, which has + NetHack choose another item to automatically fill your quiver (or + quiver sack, or have at the ready) when the inventory slot used + for ‘Q’ runs out. + + Some characters have the ability to fire a volley of multi†+ ple items in a single turn. Knowing how to load several rounds + of ammunition at once â€â€ or hold several missiles in your hand â€â€ + and still hit a target is not an easy task. Rangers are among + those who are adept at this task, as are those with a high level + of proficiency in the relevant weapon skill (in bow skill if + you’re wielding one to shoot arrows, in crossbow skill if you’re + wielding one to shoot bolts, or in sling skill if you’re wielding + one to shoot stones). The number of items that the character has + a chance to fire varies from turn to turn. You can explicitly + limit the number of shots by using a numeric prefix before the + ‘t’ or ‘f’ command. For example, ‘‘2f’’ (or ‘‘n2f’’ if using + number_pad mode) would ensure that at most 2 arrows are shot even + if you could have fired 3. If you specify a larger number than + would have been shot (‘‘4f’’ in this example), you’ll just end up + shooting the same number (3, here) as if no limit had been speci†+ fied. Once the volley is in motion, all of the items will travel + in the same direction; if the first ones kill a monster, the oth†+ ers can still continue beyond that spot. + + 7.2.2. Weapon proficiency + + You will have varying degrees of skill in the weapons avail†+ able. Weapon proficiency, or weapon skills, affect how well you + can use particular types of weapons, and you’ll be able to im†+ prove your skills as you progress through a game, depending on + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 27 + + + + your role, your experience level, and use of the weapons. + + For the purposes of proficiency, weapons have been divided + up into various groups such as daggers, broadswords, and + polearms. Each role has a limit on what level of proficiency a + character can achieve for each group. For instance, wizards can + become highly skilled in daggers or staves but not in swords or + bows. + + The ‘#enhance’ extended command is used to review current + weapons proficiency (also spell proficiency) and to choose which + skill(s) to improve when you’ve used one or more skills enough to + become eligible to do so. The skill rankings are ‘‘none’’ (some†+ times also referred to as ‘‘restricted’’, because you won’t be + able to advance), ‘‘unskilled’’, ‘‘basic’’, ‘‘skilled’’, and + ‘‘expert’’. Restricted skills simply will not appear in the list + shown by ‘#enhance’. (Divine intervention might unrestrict a + particular skill, in which case it will start at unskilled and be + limited to basic.) Some characters can enhance their barehanded + combat or martial arts skill beyond expert to ‘‘master’’ or + ‘‘grand master’’. + + Use of a weapon in which you’re restricted or unskilled will incur a modest penalty in the chance to hit a monster and also in - the amount of damage done when you do hit; at basic level, there - is no penalty or bonus; at skilled level, you receive a modest - bonus in the chance to hit and amount of damage done; at expert - level, the bonus is higher. A successful hit has a chance to - boost your training towards the next skill level (unless you've - already reached the limit for this skill). Once such training - reaches the threshold for that next level, you'll be told that - you feel more confident in your skills. At that point you can - use `#enhance' to increase one or more skills. Such skills are - not increased automatically because there is a limit to your to- - tal overall skills, so you need to actively choose which skills + the amount of damage done when you do hit; at basic level, there + is no penalty or bonus; at skilled level, you receive a modest + bonus in the chance to hit and amount of damage done; at expert + level, the bonus is higher. A successful hit has a chance to + boost your training towards the next skill level (unless you’ve + already reached the limit for this skill). Once such training + reaches the threshold for that next level, you’ll be told that + you feel more confident in your skills. At that point you can + use ‘#enhance’ to increase one or more skills. Such skills are + not increased automatically because there is a limit to your to†+ tal overall skills, so you need to actively choose which skills to enhance and which to ignore. - 7.3. Armor (`[') + 7.2.3. Twoâ€Weapon combat - Lots of unfriendly things lurk about; you need armor to pro- + Some characters can use two weapons at once. Setting things + up to do so can seem cumbersome but becomes second nature with + use. To wield two weapons, you need to use the ‘‘#twoweapon’’ + command. But first you need to have a weapon in each hand. + (Note that your two weapons are not fully equal; the one in the + hand you normally wield with is considered primary and the other + one is considered secondary. The most noticeable difference is + after you stopâ€â€or before you begin, for that matterâ€â€wielding + two weapons at once. The primary is your wielded weapon and the + secondary is just an item in your inventory that’s been designat†+ ed as alternate weapon.) + + If your primary weapon is wielded but your off hand is empty + or has the wrong weapon, use the sequence ’x’, ’w’, ’x’ to first + swap your primary into your off hand, wield whatever you want as + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 28 + + + + secondary weapon, then swap them both back into the intended + hands. If your secondary or alternate weapon is correct but your + primary one is not, simply use ’w’ to wield the primary. Lastly, + if neither hand holds the correct weapon, use ’w’, ’x’, ’w’ to + first wield the intended secondary, swap it to off hand, and then + wield the primary. + + The whole process can be simplified via use of the push†+ weapon option. When it is enabled, then using ’w’ to wield some†+ thing causes the currently wielded weapon to become your alter†+ nate weapon. So the sequence ’w’, ’w’ can be used to first wield + the weapon you intend to be secondary, and then wield the one you + want as primary which will push the first into secondary posi†+ tion. + + When in twoâ€weapon combat mode, using the ‘‘#twoweapon’’ + command toggles back to singleâ€weapon mode. Throwing or dropping + either of the weapons or having one of them be stolen or de†+ stroyed will also make you revert to singleâ€weapon combat. + + 7.3. Armor (‘[’) + + Lots of unfriendly things lurk about; you need armor to pro†tect yourself from their blows. Some types of armor offer better protection than others. Your armor class is a measure of this - protection. Armor class (AC) is measured as in AD&D, with 10 be- + protection. Armor class (AC) is measured as in AD&D, with 10 be†ing the equivalent of no armor, and lower numbers meaning better armor. Each suit of armor which exists in AD&D gives the same protection in NetHack. Here is an (incomplete) list of the armor @@ -1628,8 +1823,8 @@ bronze plate mail 4 splint mail 4 banded mail 4 - dwarvish mithril-coat 4 - elven mithril-coat 5 + dwarvish mithrilâ€coat 4 + elven mithrilâ€coat 5 chain mail 5 orcish chain mail 6 scale mail 6 @@ -1642,103 +1837,103 @@ You can also wear other pieces of armor (ex. helmets, boots, shields, cloaks) to lower your armor class even further, but you - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 26 - - - can only wear one item of each category (one suit of armor, one cloak, one helmet, one shield, and so on) at a time. + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 29 + + + If a piece of armor is enchanted, its armor protection will - be better (or worse) than normal, and its ``plus'' (or minus) + be better (or worse) than normal, and its ‘‘plus’’ (or minus) will subtract from your armor class. For example, a +1 chain mail would give you better protection than normal chain mail, lowering your armor class one unit further to 4. When you put on a piece of armor, you immediately find out the armor class and - any ``plusses'' it provides. Cursed pieces of armor usually have + any ‘‘plusses’’ it provides. Cursed pieces of armor usually have negative enchantments (minuses) in addition to being unremovable. Many types of armor are subject to some kind of damage like - rust. Such damage can be repaired. Some types of armor may in- + rust. Such damage can be repaired. Some types of armor may in†hibit spell casting. - The commands to use armor are `W' (wear) and `T' (take off). - The `A' command can also be used to take off armor as well as + The commands to use armor are ‘W’ (wear) and ‘T’ (take off). + The ‘A’ command can also be used to take off armor as well as other worn items. - 7.4. Food (`%') + 7.4. Food (‘%’) Food is necessary to survive. If you go too long without eating you will faint, and eventually die of starvation. Some types of food will spoil, and become unhealthy to eat, if not - protected. Food stored in ice boxes or tins (``cans'') will usu- + protected. Food stored in ice boxes or tins (‘‘cans’’) will usu†ally stay fresh, but ice boxes are heavy, and tins take a while to open. When you kill monsters, they usually leave corpses which are - also ``food.'' Many, but not all, of these are edible; some also + also ‘‘food.’’ Many, but not all, of these are edible; some also give you special powers when you eat them. A good rule of thumb - is ``you are what you eat.'' + is ‘‘you are what you eat.’’ - Some character roles and some monsters are vegetarian. Veg- + Some character roles and some monsters are vegetarian. Veg†etarian monsters will typically never eat animal corpses, while - vegetarian players can, but with some rather unpleasant side-ef- + vegetarian players can, but with some rather unpleasant sideâ€ef†fects. You can name one food item after something you like to eat with the fruit option. - The command to eat food is `e'. + The command to eat food is ‘e’. - 7.5. Scrolls (`?') + 7.5. Scrolls (‘?’) Scrolls are labeled with various titles, probably chosen by - ancient wizards for their amusement value (ex. ``READ ME,'' or - ``THANX MAUD'' backwards). Scrolls disappear after you read them + ancient wizards for their amusement value (ex. ‘‘READ ME,’’ or + ‘‘THANX MAUD’’ backwards). Scrolls disappear after you read them (except for blank ones, without magic spells on them). One of the most useful of these is the scroll of identify, which can be used to determine what another object is, whether it - is cursed or blessed, and how many uses it has left. Some - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 27 - - - - objects of subtle enchantment are difficult to identify without + is cursed or blessed, and how many uses it has left. Some ob†+ jects of subtle enchantment are difficult to identify without these. + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 30 + + + A mail daemon may run up and deliver mail to you as a scroll of mail (on versions compiled with this feature). To use this feature on versions where NetHack mail delivery is triggered by electronic mail appearing in your system mailbox, you must let - NetHack know where to look for new mail by setting the ``MAIL'' + NetHack know where to look for new mail by setting the ‘‘MAIL’’ environment variable to the file name of your mailbox. You may - also want to set the ``MAILREADER'' environment variable to the + also want to set the ‘‘MAILREADER’’ environment variable to the file name of your favorite reader, so NetHack can shell to it when you read the scroll. On versions of NetHack where mail is - randomly generated internal to the game, these environment vari- + randomly generated internal to the game, these environment vari†ables are ignored. You can disable the mail daemon by turning off the mail option. - The command to read a scroll is `r'. + The command to read a scroll is ‘r’. - 7.6. Potions (`!') + 7.6. Potions (‘!’) Potions are distinguished by the color of the liquid inside the flask. They disappear after you quaff them. @@ -1746,22 +1941,22 @@ Clear potions are potions of water. Sometimes these are blessed or cursed, resulting in holy or unholy water. Holy water is the bane of the undead, so potions of holy water are good - things to throw (`t') at them. It is also sometimes very useful - to dip (``#dip'') an object into a potion. + things to throw (‘t’) at them. It is also sometimes very useful + to dip (‘‘#dip’’) an object into a potion. - The command to drink a potion is `q' (quaff). + The command to drink a potion is ‘q’ (quaff). - 7.7. Wands (`/') + 7.7. Wands (‘/’) Magic wands usually have multiple magical charges. Some - wands are directional--you must give a direction in which to zap - them. You can also zap them at yourself (just give a `.' or `s' + wands are directional—you must give a direction in which to zap + them. You can also zap them at yourself (just give a ‘.’ or ‘s’ for the direction). Be warned, however, for this is often unwise. - Other wands are nondirectional--they don't require a direction. + Other wands are nondirectional—they don’t require a direction. The number of charges in a wand is random and decreases by one whenever you use it. - When the number of charges left in a wand becomes zero, at- + When the number of charges left in a wand becomes zero, at†tempts to use the wand will usually result in nothing happening. Occasionally, however, it may be possible to squeeze the last few mana points from an otherwise spent wand, destroying it in the @@ -1772,32 +1967,33 @@ In a truly desperate situation, when your back is up against the wall, you might decide to go for broke and break your wand. - This is not for the faint of heart. Doing so will almost cer- + This is not for the faint of heart. Doing so will almost cer†tainly cause a catastrophic release of magical energies. - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 28 - - - When you have fully identified a particular wand, inventory display will include additional information in parentheses: the + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 31 + + + number of times it has been recharged followed by a colon and then by its current number of charges. A current charge count of - -1 is a special case indicating that the wand has been cancelled. + â€1 is a special case indicating that the wand has been cancelled. - The command to use a wand is `z' (zap). To break one, use - the `a' (apply) command. + The command to use a wand is ‘z’ (zap). To break one, use + the ‘a’ (apply) command. - 7.8. Rings (`=') + 7.8. Rings (‘=’) - Rings are very useful items, since they are relatively per- + Rings are very useful items, since they are relatively per†manent magic, unlike the usually fleeting effects of potions, scrolls, and wands. @@ -1807,15 +2003,15 @@ Most rings also cause you to grow hungry more rapidly, the rate varying with the type of ring. - The commands to use rings are `P' (put on) and `R' (remove). + The commands to use rings are ‘P’ (put on) and ‘R’ (remove). - 7.9. Spellbooks (`+') + 7.9. Spellbooks (‘+’) Spellbooks are tomes of mighty magic. When studied with the - `r' (read) command, they transfer to the reader the knowledge of - a spell (and therefore eventually become unreadable) -- unless - the attempt backfires. Reading a cursed spellbook or one with - mystic runes beyond your ken can be harmful to your health! + ‘r’ (read) command, they transfer to the reader the knowledge of + a spell (and therefore eventually become unreadable) — unless the + attempt backfires. Reading a cursed spellbook or one with mystic + runes beyond your ken can be harmful to your health! A spell (even when learned) can also backfire when you cast it. If you attempt to cast a spell well above your experience @@ -1827,98 +2023,100 @@ Casting a spell calls forth magical energies and focuses them with your naked mind. Some of the magical energy released comes from within you, and casting several spells in a row may - tire you. Casting of spells also requires practice. With prac- + tire you. Casting of spells also requires practice. With prac†tice, your skill in each category of spell casting will improve. Over time, however, your memory of each spell will dim, and you will need to relearn it. - Some spells are directional--you must give a direction in + Some spells are directional—you must give a direction in which to cast them. You can also cast them at yourself (just - give a `.' or `s' for the direction). Be warned, however, for - this is often unwise. Other spells are nondirectional--they - don't require a direction. + give a ‘.’ or ‘s’ for the direction). Be warned, however, for + this is often unwise. Other spells are nondirectional—they don’t + require a direction. Just as weapons are divided into groups in which a character can become proficient (to varying degrees), spells are similarly - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 29 - - - grouped. Successfully casting a spell exercises its skill group; - using the `#enhance' command to advance a sufficiently exercised + using the ‘#enhance’ command to advance a sufficiently exercised + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 32 + + + skill will affect all spells within the group. Advanced skill may increase the potency of spells, reduce their risk of failure during casting attempts, and improve the accuracy of the estimate for how much longer they will be retained in your memory. Skill slots are shared with weapons skills. (See also the section on - ``Weapon proficiency''.) + ‘‘Weapon proficiency’’.) Casting a spell also requires flexible movement, and wearing various types of armor may interfere with that. The command to read a spellbook is the same as for scrolls, - `r' (read). The `+' command lists each spell you know along with + ‘r’ (read). The ‘+’ command lists each spell you know along with its level, skill category, chance of failure when casting, and an - estimate of how strongly it is remembered. The `Z' (cast) com- + estimate of how strongly it is remembered. The ‘Z’ (cast) com†mand casts a spell. - 7.10. Tools (`(') + 7.10. Tools (‘(’) Tools are miscellaneous objects with various purposes. Some tools have a limited number of uses, akin to wand charges. For - example, lamps burn out after a while. Other tools are contain- + example, lamps burn out after a while. Other tools are contain†ers, which objects can be placed into or taken out of. - The command to use tools is `a' (apply). + The command to use tools is ‘a’ (apply). 7.10.1. Containers You may encounter bags, boxes, and chests in your travels. - A tool of this sort can be opened with the ``#loot'' extended + A tool of this sort can be opened with the ‘‘#loot’’ extended command when you are standing on top of it (that is, on the same - floor spot), or with the `a' (apply) command when you are carry- + floor spot), or with the ‘a’ (apply) command when you are carry†ing it. However, chests are often locked, and are in any case unwieldy objects. You must set one down before unlocking it by - using a key or lock-picking tool with the `a' (apply) command, by - kicking it with the `^D' command, or by using a weapon to force - the lock with the ``#force'' extended command. + using a key or lockâ€picking tool with the ‘a’ (apply) command, by + kicking it with the ‘^D’ command, or by using a weapon to force + the lock with the ‘‘#force’’ extended command. Some chests are trapped, causing nasty things to happen when you unlock or open them. You can check for and try to deactivate - traps with the ``#untrap'' extended command. + traps with the ‘‘#untrap’’ extended command. - 7.11. Amulets (`"') + 7.11. Amulets (‘"’) Amulets are very similar to rings, and often more powerful. - Like rings, amulets have various magical properties, some benefi- + Like rings, amulets have various magical properties, some benefi†cial, some harmful, which are activated by putting them on. Only one amulet may be worn at a time, around your neck. - The commands to use amulets are the same as for rings, `P' - (put on) and `R' (remove). - - - - NetHack 3.5 September 20, 2006 + The commands to use amulets are the same as for rings, ‘P’ + (put on) and ‘R’ (remove). - NetHack Guidebook 30 + NetHack 3.6 March 27, 2015 - 7.12. Gems (`*') + + + NetHack Guidebook 33 + + + + 7.12. Gems (‘*’) Some gems are valuable, and can be sold for a lot of gold. They are also a far more efficient way of carrying your riches. @@ -1926,11 +2124,11 @@ you exit. Other small rocks are also categorized as gems, but they are - much less valuable. All rocks, however, can be used as projec- + much less valuable. All rocks, however, can be used as projec†tile weapons (if you have a sling). In the most desperate of cases, you can still throw them by hand. - 7.13. Large rocks (``') + 7.13. Large rocks (‘`’) Statues and boulders are not particularly useful, and are generally heavy. It is rumored that some statues are not what @@ -1939,7 +2137,7 @@ Very large humanoids (giants and their ilk) have been known to use boulders as weapons. - 7.14. Gold (`$') + 7.14. Gold (‘$’) Gold adds to your score, and you can buy things in shops with it. There are a number of monsters in the dungeon that may @@ -1955,7 +2153,7 @@ of these challenges, which can be checked at any time with the #conduct command or at the end of the game. When you perform an action which breaks a challenge, it will no longer be listed. - This gives players extra ``bragging rights'' for winning the game + This gives players extra ‘‘bragging rights’’ for winning the game with these challenges. Note that it is perfectly acceptable to win the game without resorting to these restrictions and that it is unusual for players to adhere to challenges the first time @@ -1965,37 +2163,37 @@ The most difficult of these is the foodless challenge. Although creatures can survive long periods of time without food, there is a physiological need for water; thus there is no restriction on - drinking beverages, even if they provide some minor food bene- + drinking beverages, even if they provide some minor food bene†fits. Calling upon your god for help with starvation does not violate any food challenges either. A strict vegan diet is one which avoids any food derived - from animals. The primary source of nutrition is fruits and veg- - etables. The corpses and tins of blobs (`b'), jellies (`j'), and + from animals. The primary source of nutrition is fruits and veg†+ etables. The corpses and tins of blobs (‘b’), jellies (‘j’), and - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 - NetHack Guidebook 31 + NetHack Guidebook 34 - fungi (`F') are also considered to be vegetable matter. Certain + fungi (‘F’) are also considered to be vegetable matter. Certain human food is prepared without animal products; namely, lembas - wafers, cram rations, food rations (gunyoki), K-rations, and C- + wafers, cram rations, food rations (gunyoki), Kâ€rations, and C†rations. Metal or another normally indigestible material eaten - while polymorphed into a creature that can digest it is also con- + while polymorphed into a creature that can digest it is also con†sidered vegan food. Note however that eating such items still counts against foodless conduct. - Vegetarians do not eat animals; however, they are less se- + Vegetarians do not eat animals; however, they are less se†lective about eating animal byproducts than vegans. In addition to the vegan items listed above, they may eat any kind of pudding - (`P') other than the black puddings, eggs and food made from eggs + (‘P’) other than the black puddings, eggs and food made from eggs (fortune cookies and pancakes), food made with milk (cream pies and candy bars), and lumps of royal jelly. Monks are expected to observe a vegetarian diet. @@ -2004,32 +2202,32 @@ foodless conducts. This includes tripe rations, the corpses or tins of any monsters not mentioned above, and the various other chunks of meat found in the dungeon. Swallowing and digesting a - monster while polymorphed is treated as if you ate the creature's - corpse. Eating leather, dragon hide, or bone items while poly- + monster while polymorphed is treated as if you ate the creature’s + corpse. Eating leather, dragon hide, or bone items while poly†morphed into a creature that can digest it, or eating monster brains while polymorphed into a mind flayer, is considered eating an animal, although wax is only an animal byproduct. Regardless of conduct, there will be some items which are indigestible, and others which are hazardous to eat. Using a - swallow-and-digest attack against a monster is equivalent to eat- - ing the monster's corpse. Please note that the term ``vegan'' is + swallowâ€andâ€digest attack against a monster is equivalent to eat†+ ing the monster’s corpse. Please note that the term ‘‘vegan’’ is used here only in the context of diet. You are still free to choose not to use or wear items derived from animals (e.g. leather, dragon hide, bone, horns, coral), but the game will not - keep track of this for you. Also note that ``milky'' potions may + keep track of this for you. Also note that ‘‘milky’’ potions may be a translucent white, but they do not contain milk, so they are - compatible with a vegan diet. Slime molds or player-defined - ``fruits'', although they could be anything from ``cherries'' to - ``pork chops'', are also assumed to be vegan. + compatible with a vegan diet. Slime molds or playerâ€defined + ‘‘fruits’’, although they could be anything from ‘‘cherries’’ to + ‘‘pork chops’’, are also assumed to be vegan. An atheist is one who rejects religion. This means that you cannot #pray, #offer sacrifices to any god, #turn undead, or #chat with a priest. Particularly selective readers may argue - that playing Monk or Priest characters should violate this con- + that playing Monk or Priest characters should violate this con†duct; that is a choice left to the player. Offering the Amulet of Yendor to your god is necessary to win the game and is not - counted against this conduct. You are also not penalized for be- + counted against this conduct. You are also not penalized for be†ing spoken to by an angry god, priest(ess), or other religious figure; a true atheist would hear the words but attach no special meaning to them. @@ -2040,13 +2238,13 @@ throw, fire, and kick weapons; use a wand, spell, or other type - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 - NetHack Guidebook 32 + NetHack Guidebook 35 @@ -2058,30 +2256,30 @@ possible to gain experience by other means. An illiterate character cannot read or write. This includes - reading a scroll, spellbook, fortune cookie message, or t-shirt; + reading a scroll, spellbook, fortune cookie message, or tâ€shirt; writing a scroll; or making an engraving of anything other than a - single ``x'' (the traditional signature of an illiterate person). + single ‘‘x’’ (the traditional signature of an illiterate person). Reading an engraving, or any item that is absolutely necessary to win the game, is not counted against this conduct. The identity of scrolls and spellbooks (and knowledge of spells) in your starting inventory is assumed to be learned from your teachers - prior to the start of the game and isn't counted. + prior to the start of the game and isn’t counted. There are several other challenges tracked by the game. It - is possible to eliminate one or more species of monsters by geno- + is possible to eliminate one or more species of monsters by geno†cide; playing without this feature is considered a challenge. When the game offers you an opportunity to genocide monsters, you - may respond with the monster type ``none'' if you want to de- + may respond with the monster type ‘‘none’’ if you want to de†cline. You can change the form of an item into another item of - the same type (``polypiling'') or the form of your own body into - another creature (``polyself'') by wand, spell, or potion of + the same type (‘‘polypiling’’) or the form of your own body into + another creature (‘‘polyself’’) by wand, spell, or potion of polymorph; avoiding these effects are each considered challenges. Polymorphing monsters, including pets, does not break either of these challenges. Finally, you may sometimes receive wishes; a game without an attempt to wish for any items is a challenge, as is a game without wishing for an artifact (even if the artifact immediately disappears). When the game offers you an opportunity - to make a wish for an item, you may choose ``nothing'' if you + to make a wish for an item, you may choose ‘‘nothing’’ if you want to decline. @@ -2094,217 +2292,19 @@ 9.1. Setting the options Options may be set in a number of ways. Within the game, - the `O' command allows you to view all options and change most of + the ‘O’ command allows you to view all options and change most of them. You can also set options automatically by placing them in the NETHACKOPTIONS environment variable or in a configuration - file. Some versions of NetHack also have front-end programs that - allow you to set options before starting the game. + file. Some versions of NetHack also have frontâ€end programs that + allow you to set options before starting the game or a global + configuration for system administrators. - 9.2. Using the NETHACKOPTIONS environment variable - The NETHACKOPTIONS variable is a comma-separated list of - initial values for the various options. Some can only be turned - NetHack 3.5 September 20, 2006 - - - - NetHack Guidebook 33 - - - - on or off. You turn one of these on by adding the name of the - option to the list, and turn it off by typing a `!' or ``no'' be- - fore the name. Others take a character string as a value. You - can set string options by typing the option name, a colon or - equals sign, and then the value of the string. The value is ter- - minated by the next comma or the end of string. - - For example, to set up an environment variable so that ``au- - toquiver'' is on, ``autopickup'' is off, the name is set to - ``Blue Meanie'', and the fruit is set to ``papaya'', you would - enter the command - - % setenv NETHACKOPTIONS "autoquiver,\!autopickup,name:Blue Meanie,fruit:papaya" - - in csh (note the need to escape the ! since it's special to the - shell), or - - $ NETHACKOPTIONS="autoquiver,!autopickup,name:Blue Meanie,fruit:papaya" - $ export NETHACKOPTIONS - - in sh or ksh. - - 9.3. Using a configuration file - - Any line in the configuration file starting with `#' is - treated as a comment. Any line in the configuration file start- - ing with ``OPTIONS='' may be filled out with options in the same - syntax as in NETHACKOPTIONS. Any line starting with ``SYMBOLS='' - is taken as defining the corresponding symbol in a different syn- - tax, a sequence of decimal numbers giving the character position - in the current font to be used in displaying each entry. Such a - sequence can be continued to multiple lines by putting a `\' at - the end of each line to be continued. - - If your copy of the game included the compile time AUTOPICK- - UP_EXCEPTIONS option, then any line starting with ``AUTOPICK- - UP_EXCEPTION='' is taken as defining an exception to the pick- - up_types option. There is a section of this Guidebook that dis- - cusses that. - - The default name of the configuration file varies on differ- - ent operating systems, but NETHACKOPTIONS can also be set to the - full name of a file you want to use (possibly preceded by an - `@'). - - 9.4. Customization options - - Here are explanations of what the various options do. Char- - acter strings that are too long may be truncated. Some of the - options listed may be inactive in your dungeon. - - acoustics - Enable messages about what your character hears (default on). - Note that this has nothing to do with your computer's audio - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 34 - - - - capabilities. - - align - Your starting alignment (align:lawful, align:neutral, or - align:chaotic). You may specify just the first letter. The - default is to randomly pick an appropriate alignment. If you - prefix a `!' or ``no'' to the value, you can exclude that - alignment from being picked randomly. Cannot be set with the - `O' command. - - autodig - Automatically dig if you are wielding a digging tool and moving - into a place that can be dug (default false). - - autopickup - Automatically pick up things onto which you move (default on). - See pickup_types to refine the behavior. - - autoquiver - This option controls what happens when you attempt the `f' - (fire) command with an empty quiver. When true, the computer - will fill your quiver with some suitable weapon. Note that it - will not take into account the blessed/cursed status, enchant- - ment, damage, or quality of the weapon; you are free to manual- - ly fill your quiver with the `Q' command instead. If no weapon - is found or the option is false, the `t' (throw) command is ex- - ecuted instead. (default false) - - boulder - Set the character used to display boulders (default is rock - class symbol). - - catname - Name your starting cat (ex. ``catname:Morris''). Cannot be set - with the `O' command. - - character - Pick your type of character (ex. ``character:Monk''); synonym - for ``role''. See ``name'' for an alternate method of specify- - ing your role. Normally only the first letter of the value is - examined; the string ``random'' is an exception. - - checkpoint - Save game state after each level change, for possible recovery - after program crash (default on). - - checkspace - Check free disk space before writing files to disk (default - on). You may have to turn this off if you have more than 2 GB - free space on the partition used for your save and level files. - Only applies when MFLOPPY was defined during compilation. - - clicklook - Allows looking at things on the screen by navigating the mouse - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 35 - - - - over them and clicking the right mouse button (default off). - - cmdassist - Have the game provide some additional command assistance for - new players if it detects some anticipated mistakes (default - on). - - confirm - Have user confirm attacks on pets, shopkeepers, and other - peaceable creatures (default on). - - disclose - Controls options for disclosing various information when the - game ends (defaults to all possibilities being disclosed). The - possibilities are: - - i - disclose your inventory. - a - disclose your attributes. - v - summarize monsters that have been vanquished. - g - list monster species that have been genocided. - c - display your conduct. - - Each disclosure possibility can optionally be preceded by a - prefix which let you refine how it behaves. Here are the valid - prefixes: - - y - prompt you and default to yes on the prompt. - n - prompt you and default to no on the prompt. - + - disclose it without prompting. - - - do not disclose it and do not prompt. - - (ex. ``disclose:yi na +v -g -c'') The example sets inventory to - prompt and default to yes, attributes to prompt and default to - no, vanquished to disclose without prompting, genocided to not - disclose and not to prompt, conduct to not disclose and not to - prompt. Note that the vanquished monsters list includes all - monsters killed by traps and each other as well as by you. - - dogname - Name your starting dog (ex. ``dogname:Fang''). Cannot be set - with the `O' command. - - extmenu - Changes the extended commands interface to pop-up a menu of - available commands. It is keystroke compatible with the tradi- - tional interface except that it does not require that you hit - Enter. It is implemented only by the tty port (default off), - when the game has been compiled to support tty graphics. - - female - An obsolete synonym for ``gender:female''. Cannot be set with - the `O' command. - - - - - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -2314,63 +2314,63 @@ - fixinv - An object's inventory letter sticks to it when it's dropped - (default on). If this is off, dropping an object shifts all - the remaining inventory letters. + 9.2. Using the NETHACKOPTIONS environment variable - fruit - Name a fruit after something you enjoy eating (ex. ``fruit:man- - go'') (default ``slime mold''). Basically a nostalgic whimsy - that NetHack uses from time to time. You should set this to - something you find more appetizing than slime mold. Apples, - oranges, pears, bananas, and melons already exist in NetHack, - so don't use those. + The NETHACKOPTIONS variable is a commaâ€separated list of + initial values for the various options. Some can only be turned + on or off. You turn one of these on by adding the name of the + option to the list, and turn it off by typing a ‘!’ or ‘‘no’’ be†+ fore the name. Others take a character string as a value. You + can set string options by typing the option name, a colon or + equals sign, and then the value of the string. The value is ter†+ minated by the next comma or the end of string. - gender - Your starting gender (gender:male or gender:female). You may - specify just the first letter. Although you can still denote - your gender using the ``male'' and ``female'' options, the - ``gender'' option will take precedence. The default is to ran- - domly pick an appropriate gender. If you prefix a `!' or - ``no'' to the value, you can exclude that gender from being - picked randomly. Cannot be set with the `O' command. + For example, to set up an environment variable so that ‘‘au†+ toquiver’’ is on, ‘‘autopickup’’ is off, the name is set to + ‘‘Blue Meanie’’, and the fruit is set to ‘‘papaya’’, you would + enter the command - help - If more information is available for an object looked at with - the `/' command, ask if you want to see it (default on). Turn- - ing help off makes just looking at things faster, since you - aren't interrupted with the ``More info?'' prompt, but it also - means that you might miss some interesting and/or important in- - formation. + % setenv NETHACKOPTIONS "autoquiver,\!autopickup,name:Blue Meanie,fruit:papaya" - horsename - Name your starting horse (ex. ``horsename:Trigger''). Cannot - be set with the `O' command. + in csh (note the need to escape the ! since it’s special to the + shell), or - ignintr - Ignore interrupt signals, including breaks (default off). + $ NETHACKOPTIONS="autoquiver,!autopickup,name:Blue Meanie,fruit:papaya" + $ export NETHACKOPTIONS - legacy - Display an introductory message when starting the game (default - on). + in sh or ksh. - lit_corridor - Show corridor squares seen by night vision or a light source - held by your character as lit (default off). + 9.3. Using a configuration file - lootabc - Use the old `a', `b', and `c' keyboard shortcuts when looting, - rather than the mnemonics `o', `i', and `b' (default off). + Any line in the configuration file starting with ‘#’ is + treated as a comment. Any line in the configuration file start†+ ing with ‘‘OPTIONS=’’ may be filled out with options in the same + syntax as in NETHACKOPTIONS. Any line starting with ‘‘SYMBOLS=’’ + is taken as defining the corresponding symbol in a different syn†+ tax, a sequence of decimal numbers giving the character position + in the current font to be used in displaying each entry. Such a + sequence can be continued to multiple lines by putting a ‘\’ at + the end of each line to be continued. - mail - Enable mail delivery during the game (default on). + Any line starting with ‘‘AUTOPICKUP_EXCEPTION=’’ is taken as + defining an exception to the pickup_types option. There is a + section of this Guidebook that discusses that. - male - An obsolete synonym for ``gender:male''. Cannot be set with + The default name of the configuration file varies on differ†+ ent operating systems, but NETHACKOPTIONS can also be set to the + full name of a file you want to use (possibly preceded by an + ‘@’). + + 9.4. Customization options + + Here are explanations of what the various options do. Char†+ acter strings that are too long may be truncated. Some of the + options listed may be inactive in your dungeon. - NetHack 3.5 September 20, 2006 + + + NetHack 3.6 March 27, 2015 @@ -2380,63 +2380,63 @@ - the `O' command. + acoustics + Enable messages about what your character hears (default on). + Note that this has nothing to do with your computer’s audio ca†+ pabilities. - menustyle - Controls the interface used when you need to choose various ob- - jects (in response to the Drop command, for instance). The - value specified should be the first letter of one of the fol- - lowing: traditional, combination, partial, or full. Tradi- - tional was the only interface available for earlier versions; - it consists of a prompt for object class characters, followed - by an object-by-object prompt for all items matching the se- - lected object class(es). Combination starts with a prompt for - object class(es) of interest, but then displays a menu of - matching objects rather than prompting one-by-one. Partial - skips the object class filtering and immediately displays a - menu of all objects. Full displays a menu of object classes - rather than a character prompt, and then a menu of matching ob- - jects for selection. + align + Your starting alignment (align:lawful, align:neutral, or + align:chaotic). You may specify just the first letter. The + default is to randomly pick an appropriate alignment. If you + prefix a ‘!’ or ‘‘no’’ to the value, you can exclude that + alignment from being picked randomly. Cannot be set with the + ‘O’ command. - menu_deselect_all - Menu character accelerator to deselect all items in a menu. - Implemented by the Amiga, Gem, X11 and tty ports. Default '-'. + autodig + Automatically dig if you are wielding a digging tool and moving + into a place that can be dug (default false). - menu_deselect_page - Menu character accelerator to deselect all items on this page - of a menu. Implemented by the Amiga, Gem and tty ports. De- - fault '\'. + autopickup + Automatically pick up things onto which you move (default on). + See pickup_types to refine the behavior. - menu_first_page - Menu character accelerator to jump to the first page in a menu. - Implemented by the Amiga, Gem and tty ports. Default '^'. + autoquiver + This option controls what happens when you attempt the ‘f’ + (fire) command with an empty quiver (or quiver sack or have + nothing at the ready). When true, the computer will fill your + quiver or quiver sack or make ready some suitable weapon. Note + that it will not take into account the blessed/cursed status, + enchantment, damage, or quality of the weapon; you are free to + manually fill your quiver or quiver sack or make ready with the + ‘Q’ command instead. If no weapon is found or the option is + false, the ‘t’ (throw) command is executed instead. (default + false) - menu_headings - Controls how the headings in a menu are highlighted. Values - are 'bold', 'inverse', or 'underline'. Not all ports can actu- - ally display all three types. + bones + Allow saving and loading bones files. (default true) - menu_invert_all - Menu character accelerator to invert all items in a menu. Im- - plemented by the Amiga, Gem, X11 and tty ports. Default '@'. + boulder + Set the character used to display boulders (default is rock + class symbol). - menu_invert_page - Menu character accelerator to invert all items on this page of - a menu. Implemented by the Amiga, Gem and tty ports. Default - '~'. + catname + Name your starting cat (ex. ‘‘catname:Morris’’). Cannot be set + with the ‘O’ command. - menu_last_page - Menu character accelerator to jump to the last page in a menu. - Implemented by the Amiga, Gem and tty ports. Default '|'. + character + Pick your type of character (ex. ‘‘character:Monk’’); synonym + for ‘‘role’’. See ‘‘name’’ for an alternate method of specify†+ ing your role. Normally only the first letter of the value is + examined; the string ‘‘random’’ is an exception. - menu_next_page - Menu character accelerator to goto the next menu page. Imple- - mented by the Amiga, Gem and tty ports. Default '>'. + checkpoint + Save game state after each level change, for possible recovery + after program crash (default on). - - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -2446,63 +2446,63 @@ - menu_previous_page - Menu character accelerator to goto the previous menu page. Im- - plemented by the Amiga, Gem and tty ports. Default '<'. + checkspace + Check free disk space before writing files to disk (default + on). You may have to turn this off if you have more than 2 GB + free space on the partition used for your save and level files. + Only applies when MFLOPPY was defined during compilation. - menu_search - Menu character accelerator to search for a menu item. Imple- - mented by the Amiga, Gem and X11 ports. Default ':'. + clicklook + Allows looking at things on the screen by navigating the mouse + over them and clicking the right mouse button (default off). - menu_select_all - Menu character accelerator to select all items in a menu. Im- - plemented by the Amiga, Gem, X11 and tty ports. Default '.'. + cmdassist + Have the game provide some additional command assistance for + new players if it detects some anticipated mistakes (default + on). - menu_select_page - Menu character accelerator to select all items on this page of - a menu. Implemented by the Amiga, Gem and tty ports. Default - ','. + confirm + Have user confirm attacks on pets, shopkeepers, and other + peaceable creatures (default on). - msghistory - The number of top line messages to save (and recall with ^P) - (default 20). Cannot be set with the `O' command. + disclose + Controls what information the program reveals when the game + ends. Value is a space separated list of prompting/category + pairs (default is ‘ni na nv ng nc no’, prompt with default re†+ sponse of ‘n’ for each candidate). The possibilities are: - msg_window - Allows you to change the way recalled messages are displayed. - (It is currently implemented for tty only.) The possible val- - ues are: + i †disclose your inventory; + a †disclose your attributes; + v †summarize monsters that have been vanquished; + g †list monster species that have been genocided; + c †display your conduct; + o †display dungeon overview. - s - single message (default, this was the behavior before 3.4.0). - c - combination, two messages as `single', then as `full'. - f - full window, oldest message first. - r - full window, newest message first. + Each disclosure possibility can optionally be preceded by a + prefix which lets you refine how it behaves. Here are the + valid prefixes: - For backward compatibility, no value needs to be specified - (which defaults to `full'), or it can be negated (which de- - faults to `single'). + y †prompt you and default to yes on the prompt; + n †prompt you and default to no on the prompt; + + †disclose it without prompting; + ††do not disclose it and do not prompt. - name - Set your character's name (defaults to your user name). You - can also set your character's role by appending a dash and one - or more letters of the role (that is, by suffixing one of -A -B - -C -H -K -M -P -Ra -Ro -S -T -V -W). If -@ is used for the - role, then a random one will be automatically chosen. Cannot - be set with the `O' command. + Omitted categories are implicitly added with ‘n’ prefix. Spec†+ ified categories with omitted prefix implicitly use ‘+’ prefix. + Order of the disclosure categories does not matter, program + display for endâ€ofâ€game disclosure follows a set sequence. - news - Read the NetHack news file, if present (default on). Since the - news is shown at the beginning of the game, there's no point in - setting this with the `O' command. + (ex. ‘‘disclose:yi na +v â€g o’’) The example sets inventory to + prompt and default to yes, attributes to prompt and default to + no, vanquished to disclose without prompting, genocided to not + disclose and not prompt, conduct to implicitly prompt and de†+ fault to no, and overview to disclose without prompting. - null - Send padding nulls to the terminal (default on). - - number_pad - Use digit keys instead of letters to move (default 0 or off). - Valid settings are: + Note that the vanquished monsters list includes all monsters + killed by traps and each other as well as by you. And the - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -2512,63 +2512,63 @@ - 0 - move by letters; `yuhjklbn'. - 1 - move by numbers; digit `5' acts as `G' movement prefix. - 2 - like 1 but `5' works as `g' prefix instead of as `G'. - 3 - move by numbers using phone keypad layout; 123 above, 789 below. - 4 - combines 3 with 2; phone layout plus MSDOS compatibility. - -1 - move by letters but use `z' to go northwest and `y' to zap wands. + dungeon overview shows all levels you had visited but does not + reveal things about them that you hadn’t discovered. - For backward compatibility, omitting a value is the same as - specifying 1 and negating number_pad is the same as specifying - 0. (Settings 2 and 4 are for compatibility with MSDOS or old - PC Hack; in addition to the different behavior for `5', `Alt-5' - acts as `G' and `Alt-0' acts as `I'. Setting -1 is to accomo- - date some German keyboards which have the location of the `y' - and `z' keys swapped.) When moving by numbers, to enter a - count prefix for those commands which accept one (such as - ``12s'' to search twelve times), precede it with the letter `n' - (``n12s''). + dogname + Name your starting dog (ex. ‘‘dogname:Fang’’). Cannot be set + with the ‘O’ command. - packorder - Specify the order to list object types in (default - ``")[%?+!=/(*`0_''). The value of this option should be a - string containing the symbols for the various object types. - Any omitted types are filled in at the end from the previous - order. + extmenu + Changes the extended commands interface to popâ€up a menu of + available commands. It is keystroke compatible with the tradi†+ tional interface except that it does not require that you hit + Enter. It is implemented only by the tty port (default off), + when the game has been compiled to support tty graphics. - perm_invent - If true, always display your current inventory in a window. - This only makes sense for windowing system interfaces that im- - plement this feature. + female + An obsolete synonym for ‘‘gender:female’’. Cannot be set with + the ‘O’ command. - pettype - Specify the type of your initial pet, if you are playing a - character class that uses multiple types of pets; or choose to - have no initial pet at all. Possible values are ``cat'', - ``dog'', ``horse'', and ``none''. If the choice is not allowed - for the role you are currently playing, it will be silently ig- - nored. For example, ``horse'' will only be honored when play- - ing a knight. Cannot be set with the `O' command. + fixinv + An object’s inventory letter sticks to it when it’s dropped + (default on). If this is off, dropping an object shifts all + the remaining inventory letters. - pickup_burden - When you pick up an item that would exceed this encumbrance - level (Unburdened, Burdened, streSsed, straiNed, overTaxed, or - overLoaded), you will be asked if you want to continue. (De- - fault `S'). + fruit + Name a fruit after something you enjoy eating (ex. ‘‘fruit:man†+ go’’) (default ‘‘slime mold’’). Basically a nostalgic whimsy + that NetHack uses from time to time. You should set this to + something you find more appetizing than slime mold. Apples, + oranges, pears, bananas, and melons already exist in NetHack, + so don’t use those. - pickup_thrown - If this option is on and autopickup is also on, try to pick up - things that you threw, even if they aren't in pickup_types or - match an autopickup exception. Default is on. + gender + Your starting gender (gender:male or gender:female). You may + specify just the first letter. Although you can still denote + your gender using the ‘‘male’’ and ‘‘female’’ options, the + ‘‘gender’’ option will take precedence. The default is to ran†+ domly pick an appropriate gender. If you prefix a ‘!’ or + ‘‘no’’ to the value, you can exclude that gender from being + picked randomly. Cannot be set with the ‘O’ command. - pickup_types - Specify the object types to be picked up when autopickup is on. - Default is all types. If your copy of the game has the compile - time option AUTOPICKUP_EXCEPTIONS included, you may be able to + help + If more information is available for an object looked at with + the ‘/’ command, ask if you want to see it (default on). Turn†+ ing help off makes just looking at things faster, since you + aren’t interrupted with the ‘‘More info?’’ prompt, but it also + means that you might miss some interesting and/or important in†+ formation. + + horsename + Name your starting horse (ex. ‘‘horsename:Trigger’’). Cannot + be set with the ‘O’ command. + + ignintr + Ignore interrupt signals, including breaks (default off). - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -2578,63 +2578,63 @@ - use autopickup_exception configuration file lines to further - refine autopickup behavior. + legacy + Display an introductory message when starting the game (default + on). - prayconfirm - Prompt for confirmation before praying (default on). + lit_corridor + Show corridor squares seen by night vision or a light source + held by your character as lit (default off). - pushweapon - Using the `w' (wield) command when already wielding something - pushes the old item into your alternate weapon slot (default - off). Likewise for the `a' (apply) command if it causes the - applied item to become wielded. + lootabc + Use the old ‘a’, ‘b’, and ‘c’ keyboard shortcuts when looting, + rather than the mnemonics ‘o’, ‘i’, and ‘b’ (default off). - race - Selects your race (for example, ``race:human''). Default is - random. If you prefix a `!' or ``no'' to the value, you can - exclude that race from being picked randomly. Cannot be set - with the `O' command. + mail + Enable mail delivery during the game (default on). - rest_on_space - Make the space bar a synonym for the `.' (rest) command (de- - fault off). + male + An obsolete synonym for ‘‘gender:male’’. Cannot be set with + the ‘O’ command. - role - Pick your type of character (ex. ``role:Samurai''); synonym for - ``character''. See ``name'' for an alternate method of speci- - fying your role. Normally only the first letter of the value - is examined; `r' is an exception with ``Rogue'', ``Ranger'', - and ``random'' values. If you prefix a `!' or ``no'' to the - value, you can exclude that role from being picked randomly. + mention_walls + Give feedback when walking against a wall (default off). - roguesymset - This option may be used to select one of the named symbol sets - found within ``symbols'' to alter the symbols displayed on the - screen on the rogue level. + menustyle + Controls the interface used when you need to choose various ob†+ jects (in response to the Drop command, for instance). The + value specified should be the first letter of one of the fol†+ lowing: traditional, combination, partial, or full. Tradi†+ tional was the only interface available for earlier versions; + it consists of a prompt for object class characters, followed + by an objectâ€byâ€object prompt for all items matching the se†+ lected object class(es). Combination starts with a prompt for + object class(es) of interest, but then displays a menu of + matching objects rather than prompting oneâ€byâ€one. Partial + skips the object class filtering and immediately displays a + menu of all objects. Full displays a menu of object classes + rather than a character prompt, and then a menu of matching ob†+ jects for selection. - rlecomp - When writing out a save file, perform run length compression of - the map. Not all ports support run length compression. It has - no effect on reading an existing save file. + menu_deselect_all + Menu character accelerator to deselect all items in a menu. + Implemented by the Amiga, Gem, X11 and tty ports. Default ’â€â€™. - runmode - Controls the amount of screen updating for the map window when - engaged in multi-turn movement (running via shift+direction or - control+direction and so forth, or via the travel command or - mouse click). The possible values are: + menu_deselect_page + Menu character accelerator to deselect all items on this page + of a menu. Implemented by the Amiga, Gem and tty ports. De†+ fault ’\’. - teleport - update the map after movement has finished; - run - update the map after every seven or so steps; - walk - update the map after each step; - crawl - like walk, but pause briefly after each step. + menu_first_page + Menu character accelerator to jump to the first page in a menu. + Implemented by the Amiga, Gem and tty ports. Default ’^’. - This option only affects the game's screen display, not the ac- - tual results of moving. The default is `run'; versions prior - to 3.4.1 used `teleport' only. Whether or not the effect is + menu_headings + Controls how the headings in a menu are highlighted. Values + are ’bold’, ’inverse’, or ’underline’. Not all ports can - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 @@ -2644,6 +2644,280 @@ + actually display all three types. + + menu_invert_all + Menu character accelerator to invert all items in a menu. Im†+ plemented by the Amiga, Gem, X11 and tty ports. Default ’@’. + + menu_invert_page + Menu character accelerator to invert all items on this page of + a menu. Implemented by the Amiga, Gem and tty ports. Default + ’~’. + + menu_last_page + Menu character accelerator to jump to the last page in a menu. + Implemented by the Amiga, Gem and tty ports. Default ’|’. + + menu_next_page + Menu character accelerator to goto the next menu page. Imple†+ mented by the Amiga, Gem and tty ports. Default ’>’. + + menu_objsyms + Show object symbols in menu headings in menus where the object + symbols act as menu accelerators (default off). + + menu_previous_page + Menu character accelerator to goto the previous menu page. Im†+ plemented by the Amiga, Gem and tty ports. Default ’<’. + + menu_search + Menu character accelerator to search for a menu item. Imple†+ mented by the Amiga, Gem, X11 and tty ports. Default ’:’. + + menu_select_all + Menu character accelerator to select all items in a menu. Im†+ plemented by the Amiga, Gem, X11 and tty ports. Default ’.’. + + menu_select_page + Menu character accelerator to select all items on this page of + a menu. Implemented by the Amiga, Gem and tty ports. Default + ’,’. + + msghistory + The number of top line messages to save (and recall with ^P) + (default 20). Cannot be set with the ‘O’ command. + + msg_window + Allows you to change the way recalled messages are displayed. + (It is currently implemented for tty only.) The possible val†+ ues are: + + s †single message (default; only choice prior to 3.4.0); + c †combination, two messages as ‘single’, then as ‘full’; + f †full window, oldest message first; + r †full window reversed, newest message first. + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 42 + + + + For backward compatibility, no value needs to be specified + (which defaults to ‘full’), or it can be negated (which de†+ faults to ‘single’). + + name + Set your character’s name (defaults to your user name). You + can also set your character’s role by appending a dash and one + or more letters of the role (that is, by suffixing one of â€A â€B + â€C â€H â€K â€M â€P â€Ra â€Ro â€S â€T â€V â€W). If â€@ is used for the + role, then a random one will be automatically chosen. Cannot + be set with the ‘O’ command. + + news + Read the NetHack news file, if present (default on). Since the + news is shown at the beginning of the game, there’s no point in + setting this with the ‘O’ command. + + null + Send padding nulls to the terminal (default on). + + number_pad + Use digit keys instead of letters to move (default 0 or off). + Valid settings are: + + 0 †move by letters; ‘yuhjklbn’ + 1 †move by numbers; digit ‘5’ acts as ‘G’ movement prefix + 2 †like 1 but ‘5’ works as ‘g’ prefix instead of as ‘G’ + 3 †by numbers using phone key layout; 123 above, 789 below + 4 †combines 3 with 2; phone layout plus MSDOS compatibility + â€1 †by letters but use ‘z’ to go northwest, ‘y’ to zap wands + + For backward compatibility, omitting a value is the same as + specifying 1 and negating number_pad is the same as specifying + 0. (Settings 2 and 4 are for compatibility with MSDOS or old + PC Hack; in addition to the different behavior for ‘5’, ‘Altâ€5’ + acts as ‘G’ and ‘Altâ€0’ acts as ‘I’. Setting â€1 is to accommo†+ date some German keyboards which have the location of the ‘y’ + and ‘z’ keys swapped.) When moving by numbers, to enter a + count prefix for those commands which accept one (such as + ‘‘12s’’ to search twelve times), precede it with the letter ‘n’ + (‘‘n12s’’). + + packorder + Specify the order to list object types in (default + ‘‘")[%?+!=/(*‘0_’’). The value of this option should be a + string containing the symbols for the various object types. + Any omitted types are filled in at the end from the previous + order. + + paranoid_confirmation + A space separated list of specific situations where alternate + prompting is desired. The default is paranoid_confirma†+ tion:pray. + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 43 + + + + Confirm †for any prompts which are set to require "yes" rather + than ’y’, also require "no" to reject instead of ac†+ cepting any nonâ€yes response as no + quit †require "yes" rather than ’y’ to confirm quitting the + game or switching into nonâ€scoring explore mode; + die †require "yes" rather than ’y’ to confirm dying (not + useful in normal play; applies to explore mode); + bones †require "yes" rather than ’y’ to confirm saving bones + data when dying in debug mode; + attack †require "yes" rather than ’y’ to confirm attacking a + peaceful monster; + pray †require ’y’ to confirm an attempt to pray rather than + immediately praying; on by default; + Remove †require selection from inventory for ’R’ and ’T’ com†+ mands even when wearing just one applicable item. + + By default, the pray choice is enabled, the others disabled. + To disable it without setting any of the other choices, use + ‘‘paranoid_confirmation:none’’. To keep it enabled while set†+ ting any of the others, include it in the list, such as ‘‘para†+ noid_confirmation:attack pray Remove’’. + + perm_invent + If true, always display your current inventory in a window. + This only makes sense for windowing system interfaces that im†+ plement this feature. + + pettype + Specify the type of your initial pet, if you are playing a + character class that uses multiple types of pets; or choose to + have no initial pet at all. Possible values are ‘‘cat’’, + ‘‘dog’’, ‘‘horse’’, and ‘‘none’’. If the choice is not allowed + for the role you are currently playing, it will be silently ig†+ nored. For example, ‘‘horse’’ will only be honored when play†+ ing a knight. Cannot be set with the ‘O’ command. + + pickup_burden + When you pick up an item that would exceed this encumbrance + level (Unencumbered, Burdened, streSsed, straiNed, overTaxed, + or overLoaded), you will be asked if you want to continue. + (Default ‘S’). + + pickup_thrown + If this option is on and autopickup is also on, try to pick up + things that you threw, even if they aren’t in pickup_types or + match an autopickup exception. Default is on. + + pickup_types + Specify the object types to be picked up when autopickup is on. + Default is all types. You can use autopickup_exception config†+ uration file lines to further refine autopickup behavior. + + pile_limit + When walking across a pile of objects on the floor, threshold + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 44 + + + + at which the message "there are few/several/many objects here" + is given instead of showing a popup list of those objects. A + value of 0 means "no limit" (always list the objects); a value + of 1 effectively means "never show the objects" since the pile + size will always be at least that big; default value is 5. + + playmode + Values are ‘normal’, ‘explore’, or ‘debug’. Allows selection + of explore mode (also known as discovery mode) or debug mode + (also known as wizard mode) instead of normal play. Debug mode + might only be allowed for someone logged in under a particular + user name (on multiâ€user systems) or specifying a particular + character name (on singleâ€user systems) or it might be disabled + entirely. Requesting it when not allowed or not possible re†+ sults in explore mode instead. Default is normal play. + + pushweapon + Using the ‘w’ (wield) command when already wielding something + pushes the old item into your alternate weapon slot (default + off). Likewise for the ‘a’ (apply) command if it causes the + applied item to become wielded. + + race + Selects your race (for example, ‘‘race:human’’). Default is + random. If you prefix a ‘!’ or ‘‘no’’ to the value, you can + exclude that race from being picked randomly. Cannot be set + with the ‘O’ command. + + rest_on_space + Make the space bar a synonym for the ‘.’ (rest) command (de†+ fault off). + + role + Pick your type of character (ex. ‘‘role:Samurai’’); synonym for + ‘‘character’’. See ‘‘name’’ for an alternate method of speci†+ fying your role. Normally only the first letter of the value + is examined; ‘r’ is an exception with ‘‘Rogue’’, ‘‘Ranger’’, + and ‘‘random’’ values. If you prefix a ‘!’ or ‘‘no’’ to the + value, you can exclude that role from being picked randomly. + + roguesymset + This option may be used to select one of the named symbol sets + found within ‘‘symbols’’ to alter the symbols displayed on the + screen on the rogue level. + + rlecomp + When writing out a save file, perform run length compression of + the map. Not all ports support run length compression. It has + no effect on reading an existing save file. + + runmode + Controls the amount of screen updating for the map window when + engaged in multiâ€turn movement (running via shift+direction or + control+direction and so forth, or via the travel command or + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 45 + + + + mouse click). The possible values are: + + teleport †update the map after movement has finished; + run †update the map after every seven or so steps; + walk †update the map after each step; + crawl †like walk, but pause briefly after each step. + + This option only affects the game’s screen display, not the ac†+ tual results of moving. The default is ‘run’; versions prior + to 3.4.1 used ‘teleport’ only. Whether or not the effect is noticeable will depend upon the window port used or on the type of terminal. @@ -2652,8 +2926,8 @@ scores Control what parts of the score list you are shown at the end - (ex. ``scores:5 top scores/4 around my score/own scores''). - Only the first letter of each category (`t', `a', or `o') is + (ex. ‘‘scores:5 top scores/4 around my score/own scores’’). + Only the first letter of each category (‘t’, ‘a’, or ‘o’) is necessary. showexp @@ -2662,7 +2936,7 @@ showrace Display yourself as the glyph for your race, rather than the - glyph for your role (default off). Note that this setting af- + glyph for your role (default off). Note that this setting af†fects only the appearance of the display, not the way the game treats you. @@ -2674,7 +2948,7 @@ Suppress terminal beeps (default on). sortpack - Sort the pack contents by type when displaying inventory (de- + Sort the pack contents by type when displaying inventory (de†fault on). sparkle @@ -2682,39 +2956,38 @@ hit by an attack to which it is resistant (default on). standout - Boldface monsters and ``--More--'' (default off). + Boldface monsters and ‘‘â€â€Moreâ€â€â€™â€™ (default off). suppress_alert This option may be set to a NetHack version level to suppress alert notification messages about feature changes for that and - prior versions (ex. ``suppress_alert:3.3.1''). + prior versions (ex. ‘‘suppress_alert:3.3.1’’). + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 46 + + symset This option may be used to select one of the named symbol sets - found within ``symbols'' to alter the symbols displayed on the + found within ‘‘symbols’’ to alter the symbols displayed on the screen. time Show the elapsed game time in turns on bottom line (default off). - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 42 - - - timed_delay - When pausing momentarily for display effect, such as with ex- + When pausing momentarily for display effect, such as with ex†plosions and moving objects, use a timer rather than sending - extra characters to the screen. (Applies to ``tty'' interface - only; ``X11'' interface always uses a timer based delay. The + extra characters to the screen. (Applies to ‘‘tty’’ interface + only; ‘‘X11’’ interface always uses a timer based delay. The default is on if configured into the program.) tombstone @@ -2722,7 +2995,7 @@ toptenwin Put the ending display in a NetHack window instead of on stdout - (default off). Setting this option makes the score list visi- + (default off). Setting this option makes the score list visi†ble when a windowing version of NetHack is started without a parent window, but it no longer leaves the score list around after game end on a terminal or emulating window. @@ -2736,13 +3009,13 @@ Provide more commentary during the game (default on). windowtype - Select which windowing system to use, such as ``tty'' or - ``X11'' (default depends on version). Cannot be set with the - `O' command. + Select which windowing system to use, such as ‘‘tty’’ or + ‘‘X11’’ (default depends on version). Cannot be set with the + ‘O’ command. zerocomp - When writing out a save file, perform zero-comp compression of - the contents. Not all ports support zero-comp compression. It + When writing out a save file, perform zeroâ€comp compression of + the contents. Not all ports support zeroâ€comp compression. It has no effect on reading an existing save file. 9.5. Window Port Customization options @@ -2753,29 +3026,29 @@ truncated. Not all window ports will adjust for all settings listed here. You can safely add any of these options to your config file, and if the window port is capable of adjusting to - suit your preferences, it will attempt to do so. If it can't it - will silently ignore it. You can find out if an option is sup- - ported by the window port that you are currently using by check- - ing to see if it shows up in the Options list. Some options are - dynamic and can be specified during the game with the `O' com- - mand. + suit your preferences, it will attempt to do so. If it can’t it + will silently ignore it. You can find out if an option is + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 47 + + + + supported by the window port that you are currently using by + checking to see if it shows up in the Options list. Some options + are dynamic and can be specified during the game with the ‘O’ + command. align_message Where to align or place the message window (top, bottom, left, or right) - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 43 - - - align_status Where to align or place the status window (top, bottom, left, or right). @@ -2788,12 +3061,12 @@ objects, and dungeon features eight_bit_tty - NetHack should pass eight-bit character values (for example, - specified with the traps option) straight through to your ter- + NetHack should pass eightâ€bit character values (for example, + specified with the traps option) straight through to your ter†minal (default off). font_map - NetHack should use a font by the chosen name for the map win- + NetHack should use a font by the chosen name for the map win†dow. font_menu @@ -2822,6 +3095,17 @@ font_size_status NetHack should use this size font for the status window. + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 48 + + + font_size_text NetHack should use this size font for text windows. @@ -2829,19 +3113,6 @@ NetHack should try and display on the entire screen rather than in a window. - - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 44 - - - hilite_pet Visually distinguish pets from similar animals (default off). The behavior of this option depends on the type of windowing @@ -2859,7 +3130,7 @@ Allow use of the mouse for input and travel. player_selection - NetHack should pop up dialog boxes, or use prompts for charac- + NetHack should pop up dialog boxes, or use prompts for charac†ter selection. popup_dialog @@ -2867,10 +3138,10 @@ preload_tiles NetHack should preload tiles into memory. For example, in the - protected mode MSDOS version, control whether tiles get pre- + protected mode MSDOS version, control whether tiles get pre†loaded into RAM at the start of the game. Doing so enhances - performance of the tile graphics, but uses more memory. (de- - fault on). Cannot be set with the `O' command. + performance of the tile graphics, but uses more memory. (de†+ fault on). Cannot be set with the ‘O’ command. scroll_amount NetHack should scroll the display by this number of cells when @@ -2889,6 +3160,18 @@ Display an onscreen keyboard. Handhelds are most likely to support this option. + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 49 + + + splash_screen NetHack should display an opening splash screen when it starts up (default yes). @@ -2896,18 +3179,6 @@ tiled_map NetHack should display a tiled map if it can. - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 45 - - - tile_file Specify the name of an alternative tile file to override the default. @@ -2927,14 +3198,14 @@ message window. windowcolors - NetHack should display windows with the specified fore- + NetHack should display windows with the specified fore†ground/background colors if it can. wraptext - NetHack port should wrap long lines of text if they don't fit + NetHack port should wrap long lines of text if they don’t fit in the visible area of the window. - 9.6. Platform-specific Customization options + 9.6. Platformâ€specific Customization options Here are explanations of options that are used by specific platforms or ports to customize and change the port behavior. @@ -2943,15 +3214,43 @@ Select an alternate keystroke handler dll to load (Win32 tty NetHack only). The name of the handler is specified without the .dll extension and without any path information. Cannot be - set with the `O' command. + set with the ‘O’ command. altmeta - (default on, AMIGA NetHack only). + On Amiga, this option controls whether typing ‘Alt’ plus anoth†+ er key functions as a metaâ€shift for that key (default on). + + altmeta + On other (nonâ€Amiga) systems where this option is available, it + can be set to tell nethack to convert a two character sequence + beginning with ESC into a metaâ€shifted version of the second + character (default off). + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 50 + + + + This conversion is only done for commands, not for other input + prompts. Note that typing one or more digits as a count prefix + prior to a commandâ€â€preceded by n if the number_pad option is + setâ€â€is also subject to this conversion, so attempting to abort + the count by typing ESC will leave nethack waiting for another + character to complete the two character sequence. Type a sec†+ ond ESC to finish cancelling such a count. At other prompts a + single ESC suffices. BIOS Use BIOS calls to update the screen display quickly and to read - the keyboard (allowing the use of arrow keys to move) on ma- - chines with an IBM PC compatible BIOS ROM (default off, OS/2, + the keyboard (allowing the use of arrow keys to move) on ma†+ chines with an IBM PC compatible BIOS ROM (default off, OS/2, PC, and ST NetHack only). flush @@ -2963,177 +3262,180 @@ page_wait (default on, Mac NetHack only). - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 46 - - - rawio - Force raw (non-cbreak) mode for faster output and more bullet- - proof input (MS-DOS sometimes treats `^P' as a printer toggle - without it) (default off, OS/2, PC, and ST NetHack only). - Note: DEC Rainbows hang if this is turned on. Cannot be set - with the `O' command. + Force raw (nonâ€cbreak) mode for faster output and more bullet†+ proof input (MSâ€DOS sometimes treats ‘^P’ as a printer toggle + without it) (default off, OS/2, PC, and ST NetHack only). + Note: DEC Rainbows hang if this is turned on. Cannot be set + with the ‘O’ command. soundcard - (default on, PC NetHack only). Cannot be set with the `O' com- + (default on, PC NetHack only). Cannot be set with the ‘O’ com†mand. subkeyvalue - (Win32 tty NetHack only). May be used to alter the value of + (Win32 tty NetHack only). May be used to alter the value of keystrokes that the operating system returns to NetHack to help - compensate for international keyboard issues. OPTIONS=subkey- - value:171/92 will return 92 to NetHack, if 171 was originally - going to be returned. You can use multiple subkeyvalue state- - ments in the config file if needed. Cannot be set with the `O' + compensate for international keyboard issues. OPTIONS=subkey†+ value:171/92 will return 92 to NetHack, if 171 was originally + going to be returned. You can use multiple subkeyvalue state†+ ments in the config file if needed. Cannot be set with the ‘O’ command. video - Set the video mode used (PC NetHack only). Values are `autode- - tect', `default', or `vga'. Setting `vga' (or `autodetect' - with vga hardware present) will cause the game to display - tiles. Cannot be set with the `O' command. + Set the video mode used (PC NetHack only). Values are ‘autode†+ tect’, ‘default’, or ‘vga’. Setting ‘vga’ (or ‘autodetect’ + with vga hardware present) will cause the game to display + tiles. Cannot be set with the ‘O’ command. videocolors - Set the color palette for PC systems using NO_TERMS (default - 4-2-6-1-5-3-15-12-10-14-9-13-11, (PC NetHack only). The order - of colors is red, green, brown, blue, magenta, cyan, - bright.white, bright.red, bright.green, yellow, bright.blue, - bright.magenta, and bright.cyan. Cannot be set with the `O' + Set the color palette for PC systems using NO_TERMS (default + 4â€2â€6â€1â€5â€3â€15â€12â€10â€14â€9â€13â€11, (PC NetHack only). The order + of colors is red, green, brown, blue, magenta, cyan, + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 51 + + + + bright.white, bright.red, bright.green, yellow, bright.blue, + bright.magenta, and bright.cyan. Cannot be set with the ‘O’ command. videoshades - Set the intensity level of the three gray scales available (de- + Set the intensity level of the three gray scales available (de†fault dark normal light, PC NetHack only). If the game display - is difficult to read, try adjusting these scales; if this does - not correct the problem, try !color. Cannot be set with the - `O' command. + is difficult to read, try adjusting these scales; if this does + not correct the problem, try !color. Cannot be set with the + ‘O’ command. 9.7. Configuring autopickup exceptions - There is an experimental compile time option called AU- - TOPICKUP_EXCEPTIONS. If your copy of the game was built with - that option defined, you can further refine the behavior of the - autopickup option beyond what is available through the pick- - up_types option. + You can further refine the behavior of the autopickup option + beyond what is available through the pickup_types option. By placing autopickup_exception lines in your configuration file, you can define patterns to be checked when the game is about to autopickup something. - - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 47 - - - autopickup_exception - Sets an exception to the pickup_types option. The autopick- - up_exception option should be followed by a string of 1-80 - characters to be used as a pattern to match against the singu- + Sets an exception to the pickup_types option. The autopick†+ up_exception option should be followed by a string of 1â€80 + characters to be used as a pattern to match against the singu†lar form of the description of an object at your location. - You may use the following special characters in a pattern: + You may use the following special characters in a pattern: - *--- matches 0 or more characters. - ?--- matches any single character. + * †matches zero or more characters; + ? †matches any single character. - In addition, some characters are treated specially if they - occur as the first character in the string pattern, specifically: + In addition, some characters are treated specially if they oc†+ cur as the first character in the pattern, specifically: - < - always pickup an object that matches the pattern that follows. - > - never pickup an object that matches the pattern that follows. + < †always pickup an object that matches rest of pattern; + > †never pickup an object that matches rest of pattern. - Can be set with the `O' command, but the setting is not pre- - served across saves and restores. + A ‘never pickup’ rule takes precedence over an ‘always pickup’ + rule if both match. - Here's a couple of examples of autopickup_exceptions: + Exceptions can be set with the ‘O’ command, but ones set that + way will not be preserved across saves and restores. + + Here are some examples: + + autopickup_exception="<*arrow" + autopickup_exception=">*corpse" + autopickup_exception=">* cursed*" + + The first example above will result in autopickup of any + type of arrow. The second example results in the exclusion of + any corpse from autopickup. The last example results in the ex†+ clusion of items known to be cursed from autopickup. + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 52 - autopickup_exception="<*arrow" - autopickup_exception=">*corpse" - autopickup_exception=">* cursed*" - The first example above will result in autopickup of any type of - arrow. The second example results in the exclusion of any corpse - from autopickup. The last example results in the exclusion of - items known to be cursed from autopickup. A `never pickup' rule - takes precedence over an `always pickup' rule if both match. 9.8. Configuring User Sounds - Some platforms allow you to define sound files to be played - when a message that matches a user-defined pattern is delivered + Some platforms allow you to define sound files to be played + when a message that matches a userâ€defined pattern is delivered to the message window. At this time the Qt port and the win32tty and win32gui ports support the use of user sounds. - The following config file entries are relevant to mapping + The following config file entries are relevant to mapping user sounds to messages: SOUNDDIR The directory that houses the sound files to be played. SOUND - An entry that maps a sound file to a user-specified message - pattern. Each SOUND entry is broken down into the following + An entry that maps a sound file to a userâ€specified message + pattern. Each SOUND entry is broken down into the following parts: - MESG - message window mapping (the only one supported in 3.5). - pattern - the pattern to match. - sound file - the sound file to play. - volume - the volume to be set while playing the sound file. + MESG †message window mapping (the only one supported in + 3.5); + pattern †the pattern to match; + sound file †the sound file to play; + volume †the volume to be set while playing the sound file. + The exact format for the pattern depends on whether the plat†+ form is built to use ‘‘regular expressions’’ or NetHack’s own + internal pattern matching facility. The ‘‘regular expressions’’ + matching can be much more sophisticated than the internal + NetHack pattern matching, but requires 3rd party libraries on + some platforms. There are plenty of references available else†+ where for explaining ‘‘regular expressions’’. You can verify + which pattern matching is used by your port with the #version + command. - NetHack 3.5 September 20, 2006 + NetHack’s internal pattern matching routine uses the following + special characters in its pattern matching: + * †matches 0 or more characters; + ? †matches any single character. + Here’s an example of a sound mapping using NetHack’s internal + pattern matching facility: + SOUND=MESG "*chime of a cash register*" "gong.wav" 50 - - NetHack Guidebook 48 - - - - The exact format for the pattern depends on whether the - platform is built to use ``regular expressions'' or NetHack's own - internal pattern matching facility. The ``regular expressions'' - matching can be much more sophisticated than the internal NetHack - pattern matching, but requires 3rd party libraries on some plat- - forms. There are plenty of references available elsewhere for - explaining ``regular expressions''. You can verify which pattern - matching is used by your port with the #version command. - - NetHack's internal pattern matching routine uses the follow- - ing special characters in its pattern matching: - - *--- matches 0 or more characters. - ?--- matches any single character. - - Here's an example of a sound mapping using NetHack's inter- - nal pattern matching facility: - - SOUND=MESG "*chime of a cash register*" "gong.wav" 50 - - specifies that any message with "chime of a cash register" con- - tained in it will trigger the playing of "gong.wav". You can - have multiple SOUND entries in your config file. + specifies that any message with "chime of a cash register" con†+ tained in it will trigger the playing of file gong.wav. You + can have multiple SOUND entries in your config file. 9.9. Modifying NetHack Symbols NetHack can load entire symbol sets from the symbol file. + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 53 + + + The options that are used to select a particular symbol set from the symbol file are: @@ -3141,13 +3443,13 @@ Set the name of the symbol set that you want to load. roguesymset - Set the name of the symbol set that you want to load for dis- + Set the name of the symbol set that you want to load for dis†play on the rogue level. You can also override one or more symbols using the SYMBOLS config file option. Symbols are specified as name:value pairs. - Note that NetHack escape-processes the value string in conven- - tional C fashion. This means that \ is a prefix to take the fol- + Note that NetHack escapeâ€processes the value string in conven†+ tional C fashion. This means that \ is a prefix to take the fol†lowing character literally. Thus \ needs to be represented as \\. The special escape form \m switches on the meta bit in the symbol value, and the \^ prefix causes the following character to be @@ -3155,26 +3457,13 @@ NetHack Symbols Default Symbol Name Description - ------------------------------------------------------------------------ + ──────────────────────────────────────────────────────────────────────── S_air (air) _ S_altar (altar) " S_amulet (amulet) - - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 49 - - - A S_angel (angelic being) a S_ant (ant or other insect) - ^ S_anti_magic_trap (anti-magic field) + ^ S_anti_magic_trap (antiâ€magic field) [ S_armor (suit or piece of armor) [ S_armour (suit or piece of armor) ^ S_arrow_trap (arrow trap) @@ -3182,37 +3471,50 @@ # S_bars (iron bars) B S_bat (bat or bird) ^ S_bear_trap (bear trap) - - S_blcorn (bottom left corner) + †S_blcorn (bottom left corner) b S_blob (blob) + S_book (spellbook) ) S_boomleft (boomerang open left) ( S_boomright (boomerang open right) - ` S_boulder (boulder) - - S_brcorn (bottom right corner) + ‘ S_boulder (boulder) + †S_brcorn (bottom right corner) C S_centaur (centaur) _ S_chain (iron chain) # S_cloud (cloud) c S_cockatrice (cockatrice) $ S_coin (pile of coins) # S_corr (corridor) - - S_crwall (wall) + †S_crwall (wall) ^ S_dart_trap (dart trap) & S_demon (major demon) * S_digbeam (dig beam) > S_dnladder (ladder down) + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 54 + + + > S_dnstair (staircase down) d S_dog (dog or other canine) D S_dragon (dragon) ; S_eel (sea monster) E S_elemental (elemental) / S_explode1 (explosion top left) - - S_explode2 (explosion top center) - `\' S_explode3 (explosion top right) + †S_explode2 (explosion top center) + ‘\’ S_explode3 (explosion top right) | S_explode4 (explosion middle left) S_explode5 (explosion middle center) | S_explode6 (explosion middle right) - `\' S_explode7 (explosion bottom left) - - S_explode8 (explosion bottom center) + ‘\’ S_explode7 (explosion bottom left) + †S_explode8 (explosion bottom center) / S_explode9 (explosion bottom right) e S_eye (eye or sphere) ^ S_falling_rock_trap (falling rock trap) @@ -3225,31 +3527,18 @@ * S_gem (gem or rock) S_ghost (ghost) H S_giant (giant humanoid) - - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 50 - - - G S_gnome (gnome) - ' S_golem (golem) + ’ S_golem (golem) | S_grave (grave) g S_gremlin (gremlin) - - S_hbeam (wall) + †S_hbeam (wall) # S_hcdbridge (horizontal raised drawbridge) + S_hcdoor (closed door) | S_hodoor (open door) ^ S_hole (hole) @ S_human (human or elf) h S_humanoid (humanoid) - - S_hwall (horizontal wall) + †S_hwall (horizontal wall) i S_imp (imp or minor demon) J S_jabberwock (jabberwock) j S_jelly (jelly) @@ -3263,9 +3552,22 @@ y S_light (light) # S_litcorr (lit corridor) : S_lizard (lizard) - `\' S_lslant (wall) + ‘\’ S_lslant (wall) ^ S_magic_portal (magic portal) ^ S_magic_trap (magic trap) + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 55 + + + m S_mimic (mimic) ] S_mimic_def (mimic) M S_mummy (mummy) @@ -3282,7 +3584,7 @@ q S_quadruped (quadruped) Q S_quantmech (quantum mechanic) = S_ring (ring) - ` S_rock (boulder or statue) + ‘ S_rock (boulder or statue) r S_rodent (rodent) ^ S_rolling_boulder_trap (rolling boulder trap) / S_rslant (wall) @@ -3291,19 +3593,6 @@ ? S_scroll (scroll) # S_sink (sink) ^ S_sleeping_gas_trap (sleeping gas trap) - - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 51 - - - S S_snake (snake) s S_spider (arachnid or centipede) ^ S_spiked_pit (spiked pit) @@ -3314,27 +3603,40 @@ * S_ss4 (magic shield 4 of 4) ^ S_statue_trap (statue trap) S_stone (dark part of a room) - - S_sw_bc (swallow bottom center) - `\' S_sw_bl (swallow bottom left) + †S_sw_bc (swallow bottom center) + ‘\’ S_sw_bl (swallow bottom left) / S_sw_br (swallow bottom right) | S_sw_ml (swallow middle left) | S_sw_mr (swallow middle right) - - S_sw_tc (swallow top center) + †S_sw_tc (swallow top center) / S_sw_tl (swallow top left) - `\' S_sw_tr (swallow top right) - - S_tdwall (wall) + ‘\’ S_sw_tr (swallow top right) + †S_tdwall (wall) ^ S_teleportation_trap (teleportation trap) S_throne (opulent throne) - - S_tlcorn (top left corner) + †S_tlcorn (top left corner) | S_tlwall (wall) - ( S_tool (useful item (pick-axe key lamp...)) + ( S_tool (useful item (pickâ€axe key lamp...)) ^ S_trap_door (trap door) t S_trapper (trapper or lurker above) - - S_trcorn (top right corner) + †S_trcorn (top right corner) # S_tree (tree) + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 56 + + + T S_troll (troll) | S_trwall (wall) - - S_tuwall (wall) + †S_tuwall (wall) U S_umber (umber hulk) u S_unicorn (unicorn or horse) < S_upladder (ladder up) @@ -3343,7 +3645,7 @@ | S_vbeam (wall) # S_vcdbridge (vertical raised drawbridge) + S_vcdoor (closed door) - - S_vodoor (open door) + †S_vodoor (open door) v S_vortex (vortex) | S_vwall (vertical wall) / S_wand (wand) @@ -3357,48 +3659,47 @@ X S_xorn (xorn) Y S_yeti (apelike creature) Z S_zombie (zombie) - - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 52 - - - z S_zruty (zruty) 9.10. Configuring NetHack for Play by the Blind NetHack can be set up to use only standard ASCII characters - for making maps of the dungeons. This makes the MS-DOS versions + for making maps of the dungeons. This makes the MSâ€DOS versions of NetHack completely accessible to the blind who use speech and/or Braille access technologies. Players will require a good - working knowledge of their screen-reader's review features, and + working knowledge of their screenâ€reader’s review features, and will have to know how to navigate horizontally and vertically - character by character. They will also find the search capabili- - ties of their screen-readers to be quite valuable. Be certain to + character by character. They will also find the search capabili†+ ties of their screenâ€readers to be quite valuable. Be certain to examine this Guidebook before playing so you have an idea what - the screen layout is like. You'll also need to be able to locate + the screen layout is like. You’ll also need to be able to locate the PC cursor. It is always where your character is located. - Merely searching for an @-sign will not always find your charac- + Merely searching for an @â€sign will not always find your charac†ter since there are other humanoids represented by the same sign. - Your screen-reader should also have a function which gives you + Your screenâ€reader should also have a function which gives you the row and column of your review cursor and the PC cursor. - These co-ordinates are often useful in giving players a better + These coâ€ordinates are often useful in giving players a better sense of the overall location of items on the screen. While it is not difficult for experienced users to edit the defaults.nh file to accomplish this, novices may find this task - somewhat daunting. Included within the ``symbols'' file of all + somewhat daunting. Included within the ‘‘symbols’’ file of all official distributions of NetHack is a symset called NHAccess. Selecting that symset in your configuration file will cause the game to run in a manner accessible to the blind. After you have gained some experience with the game and with editing files, you + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 57 + + + may want to alter settings via SYMBOLS= in your configuration file to better suit your preferences. The most crucial settings to make the game accessible are: @@ -3414,28 +3715,74 @@ This will assist in the interface to speech synthesizers. number_pad - A lot of speech access programs use the number-pad to review + A lot of speech access programs use the numberâ€pad to review the screen. If this is the case, disable the number_pad option - and use the traditional Rogue-like commands. + and use the traditional Rogueâ€like commands. + + 9.11. Global Configuration for System Administrators + + If NetHack is compiled with the SYSCF option, a system ad†+ ministrator should set up a global configuration; this is a file + in the same format as the traditional perâ€user configuration file + (see above). This file should be named sysconf and placed in the + same directory as the other NetHack support files. The options + recognized in this file are listed below. Any option not set us†+ es a compiledâ€in default (which may not be appropriate for your + system). + + WIZARDS A spaceâ€separated list of user names who are allowed to + play in wizard mode (the debugging mode, not the magicâ€using + role). A value of a single asterisk (*) allows anyone to start + a game in wizard mode. + + SHELLERS A list of users who are allowed to use the shell es†+ cape command (!). The syntax is the same as WIZARDS. + + MAXPLAYERS Limit the maximum number of games that can be run†+ ning at the same time. + + SUPPORT A string explaining how to get local support (no de†+ fault value). + + RECOVER A string explaining how to recover a game on this sys†+ tem (no default value). + + SEDUCE 0 or 1 to disable or enable, respectively, the SEDUCE + option (see the source for details on this function). + + The following options affect the score file: + + PERSMAX Maximum number of entries for one person. + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 58 + + + + ENTRYMAX Maximum number of entries in the score file. + + POINTSMIN Minimum number of points to get an entry in the score + file. + + PERS_IS_UID 0 or 1 to use user names or numeric userids, re†+ spectively, to identify unique people for the score file. + + MAX_STATUENAME_RANK Maximum number of score file entries to use + for random statue names (default is 10). 10. Scoring NetHack maintains a list of the top scores or scorers on your machine, depending on how it is set up. In the latter case, - each account on the machine can post only one non-winning score + each account on the machine can post only one nonâ€winning score on this list. If you score higher than someone else on this - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 53 - - - list, or better your previous score, you will be inserted in the proper place under your current name. How many scores are kept can also be set up when NetHack is compiled. @@ -3446,280 +3793,397 @@ your gold intact. If, however, you get killed in the Mazes of Menace, the guild will only hear about 90% of your gold when your corpse is discovered (adventurers have been known to collect - finder's fees). So, consider whether you want to take one last + finder’s fees). So, consider whether you want to take one last hit at that monster and possibly live, or quit and stop with whatever you have. If you quit, you keep all your gold, but if you swing and live, you might find more. If you just want to see what the current top players/games - list is, you can type nethack -s all on most versions. + list is, you can type nethack â€s all on most versions. 11. Explore mode NetHack is an intricate and difficult game. Novices might falter in fear, aware of their ignorance of the means to survive. - Well, fear not. Your dungeon may come equipped with an ``ex- - plore'' or ``discovery'' mode that enables you to keep old save - files and cheat death, at the paltry cost of not getting on the - high score list. + Well, fear not. Your dungeon comes equipped with an ‘‘explore’’ + or ‘‘discovery’’ mode that enables you to keep old save files and + cheat death, at the paltry cost of not getting on the high score + list. There are two ways of enabling explore mode. One is to - start the game with the -X switch. The other is to issue the `X' - command while already playing the game. The other benefits of - explore mode are left for the trepid reader to discover. + start the game with the â€X commandâ€line switch or with the play†+ mode:explore option. The other is to issue the ‘‘#exploremode’’ + extended command while already playing the game. Starting a new + game in explore mode provides your character with a wand of wish†+ ing in initial inventory; switching during play does not. The + other benefits of explore mode are left for the trepid reader to + discover. + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 59 + + + + 11.1. Debug mode + + Debug mode, also known as wizard mode, is undocumented aside + from this brief description. It is intended for tracking down + problems within the program rather than to provide godâ€like pow†+ ers to your character, and players who attempt debugging are ex†+ pected to figure out how to use it themselves. It is initiated + by starting the game with the â€D commandâ€line switch or with the + playmode:debug option. + + For some systems, the player must be logged in under a par†+ ticular user name to be allowed to use debug mode; for others, + the hero must be given a particular character name (but may be + any role; there’s no connection between ‘‘wizard mode’’ and the + Wizard role). And on any system, the program might have been + configured to omit debug mode entirely. Attempting to start a + game in debug mode when not allowed or not available will result + in falling back to explore mode instead. 12. Credits - The original hack game was modeled on the Berkeley UNIX - rogue game. Large portions of this paper were shamelessly - cribbed from A Guide to the Dungeons of Doom, by Michael C. Toy - and Kenneth C. R. C. Arnold. Small portions were adapted from + The original hack game was modeled on the Berkeley UNIX + rogue game. Large portions of this paper were shamelessly + cribbed from A Guide to the Dungeons of Doom, by Michael C. Toy + and Kenneth C. R. C. Arnold. Small portions were adapted from Further Exploration of the Dungeons of Doom, by Ken Arromdee. - NetHack is the product of literally dozens of people's work. - Main events in the course of the game development are described + NetHack is the product of literally dozens of people’s work. + Main events in the course of the game development are described below: - Jay Fenlason wrote the original Hack, with help from Kenny + Jay Fenlason wrote the original Hack, with help from Kenny Woodland, Mike Thome and Jon Payne. - Andries Brouwer did a major re-write, transforming Hack into - a very different game, and published (at least) three versions + Andries Brouwer did a major reâ€write, transforming Hack into + a very different game, and published (at least) three versions (1.0.1, 1.0.2, and 1.0.3) for UNIX machines to the Usenet. - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 54 - - - - Don G. Kneller ported Hack 1.0.3 to Microsoft C and MS-DOS, - producing PC HACK 1.01e, added support for DEC Rainbow graphics - in version 1.03g, and went on to produce at least four more ver- + Don G. Kneller ported Hack 1.0.3 to Microsoft C and MSâ€DOS, + producing PC HACK 1.01e, added support for DEC Rainbow graphics + in version 1.03g, and went on to produce at least four more ver†sions (3.0, 3.2, 3.51, and 3.6). - R. Black ported PC HACK 3.51 to Lattice C and the Atari + R. Black ported PC HACK 3.51 to Lattice C and the Atari 520/1040ST, producing ST Hack 1.03. Mike Stephenson merged these various versions back together, - incorporating many of the added features, and produced NetHack - 1.4. He then coordinated a cast of thousands in enhancing and - debugging NetHack 1.4 and released NetHack versions 2.2 and 2.3. + incorporating many of the added features, and produced NetHack + 1.4. He then coordinated a cast of thousands in enhancing and + debugging NetHack 1.4 and released NetHack versions 2.2 and 2.3. + + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 60 + + Later, Mike coordinated a major rewrite of the game, heading - a team which included Ken Arromdee, Jean-Christophe Collet, Steve - Creps, Eric Hendrickson, Izchak Miller, John Rupley, Mike Threep- + a team which included Ken Arromdee, Jeanâ€Christophe Collet, Steve + Creps, Eric Hendrickson, Izchak Miller, John Rupley, Mike Threep†oint, and Janet Walz, to produce NetHack 3.0c. - NetHack 3.0 was ported to the Atari by Eric R. Smith, to - OS/2 by Timo Hakulinen, and to VMS by David Gentzel. The three + NetHack 3.0 was ported to the Atari by Eric R. Smith, to + OS/2 by Timo Hakulinen, and to VMS by David Gentzel. The three of them and Kevin Darcy later joined the main development team to produce subsequent revisions of 3.0. - Olaf Seibert ported NetHack 2.3 and 3.0 to the Amiga. Norm - Meluch, Stephen Spackman and Pierre Martineau designed overlay - code for PC NetHack 3.0. Johnny Lee ported NetHack 3.0 to the - Macintosh. Along with various other Dungeoneers, they continued - to enhance the PC, Macintosh, and Amiga ports through the later + Olaf Seibert ported NetHack 2.3 and 3.0 to the Amiga. Norm + Meluch, Stephen Spackman and Pierre Martineau designed overlay + code for PC NetHack 3.0. Johnny Lee ported NetHack 3.0 to the + Macintosh. Along with various other Dungeoneers, they continued + to enhance the PC, Macintosh, and Amiga ports through the later revisions of 3.0. - Headed by Mike Stephenson and coordinated by Izchak Miller - and Janet Walz, the development team which now included Ken Ar- - romdee, David Cohrs, Jean-Christophe Collet, Kevin Darcy, Matt - Day, Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, Eric - Raymond, and Eric Smith undertook a radical revision of 3.0. - They re-structured the game's design, and re-wrote major parts of - the code. They added multiple dungeons, a new display, special - individual character quests, a new endgame and many other new + Headed by Mike Stephenson and coordinated by Izchak Miller + and Janet Walz, the development team which now included Ken Ar†+ romdee, David Cohrs, Jeanâ€Christophe Collet, Kevin Darcy, Matt + Day, Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, Eric + Raymond, and Eric Smith undertook a radical revision of 3.0. + They reâ€structured the game’s design, and reâ€wrote major parts of + the code. They added multiple dungeons, a new display, special + individual character quests, a new endgame and many other new features, and produced NetHack 3.1. - Ken Lorber, Gregg Wonderly and Greg Olson, with help from - Richard Addison, Mike Passaretti, and Olaf Seibert, developed + Ken Lorber, Gregg Wonderly and Greg Olson, with help from + Richard Addison, Mike Passaretti, and Olaf Seibert, developed NetHack 3.1 for the Amiga. - Norm Meluch and Kevin Smolkowski, with help from Carl Sche- + Norm Meluch and Kevin Smolkowski, with help from Carl Sche†lin, Stephen Spackman, Steve VanDevender, and Paul Winner, ported NetHack 3.1 to the PC. - Jon W{tte and Hao-yang Wang, with help from Ross Brown, Mike - Engber, David Hairston, Michael Hamel, Jonathan Handler, Johnny - Lee, Tim Lennan, Rob Menke, and Andy Swanson, developed NetHack - 3.1 for the Macintosh, porting it for MPW. Building on their de- + Jon W{tte and Haoâ€yang Wang, with help from Ross Brown, Mike + Engber, David Hairston, Michael Hamel, Jonathan Handler, Johnny + Lee, Tim Lennan, Rob Menke, and Andy Swanson, developed NetHack + 3.1 for the Macintosh, porting it for MPW. Building on their de†velopment, Barton House added a Think C port. - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 55 - - - - Timo Hakulinen ported NetHack 3.1 to OS/2. Eric Smith port- - ed NetHack 3.1 to the Atari. Pat Rankin, with help from Joshua - Delahunty, was responsible for the VMS version of NetHack 3.1. + Timo Hakulinen ported NetHack 3.1 to OS/2. Eric Smith port†+ ed NetHack 3.1 to the Atari. Pat Rankin, with help from Joshua + Delahunty, was responsible for the VMS version of NetHack 3.1. Michael Allison ported NetHack 3.1 to Windows NT. - Dean Luick, with help from David Cohrs, developed NetHack - 3.1 for X11. Warwick Allison wrote a tiled version of NetHack - for the Atari; he later contributed the tiles to the DevTeam and + Dean Luick, with help from David Cohrs, developed NetHack + 3.1 for X11. Warwick Allison wrote a tiled version of NetHack + for the Atari; he later contributed the tiles to the DevTeam and tile support was then added to other platforms. - The 3.2 development team, comprised of Michael Allison, Ken - Arromdee, David Cohrs, Jessie Collet, Steve Creps, Kevin Darcy, - Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, Eric - Smith, Mike Stephenson, Janet Walz, and Paul Winner, released + The 3.2 development team, comprised of Michael Allison, Ken + Arromdee, David Cohrs, Jessie Collet, Steve Creps, Kevin Darcy, + Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, Eric + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 61 + + + + Smith, Mike Stephenson, Janet Walz, and Paul Winner, released version 3.2 in April of 1996. Version 3.2 marked the tenth anniversary of the formation of - the development team. In a testament to their dedication to the - game, all thirteen members of the original development team re- - mained on the team at the start of work on that release. During - the interval between the release of 3.1.3 and 3.2, one of the - founding members of the development team, Dr. Izchak Miller, was - diagnosed with cancer and passed away. That release of the game + the development team. In a testament to their dedication to the + game, all thirteen members of the original development team re†+ mained on the team at the start of work on that release. During + the interval between the release of 3.1.3 and 3.2, one of the + founding members of the development team, Dr. Izchak Miller, was + diagnosed with cancer and passed away. That release of the game was dedicated to him by the development and porting teams. - During the lifespan of NetHack 3.1 and 3.2, several enthusi- - asts of the game added their own modifications to the game and - made these ``variants'' publicly available: + During the lifespan of NetHack 3.1 and 3.2, several enthusi†+ asts of the game added their own modifications to the game and + made these ‘‘variants’’ publicly available: - Tom Proudfoot and Yuval Oren created NetHack++, which was - quickly renamed NetHack--. Working independently, Stephen White - wrote NetHack Plus. Tom Proudfoot later merged NetHack Plus and - his own NetHack-- to produce SLASH. Larry Stewart-Zerba and War- - wick Allison improved the spell casting system with the Wizard - Patch. Warwick Allison also ported NetHack to use the Qt inter- + Tom Proudfoot and Yuval Oren created NetHack++, which was + quickly renamed NetHackâ€â€. Working independently, Stephen White + wrote NetHack Plus. Tom Proudfoot later merged NetHack Plus and + his own NetHackâ€â€ to produce SLASH. Larry Stewartâ€Zerba and War†+ wick Allison improved the spell casting system with the Wizard + Patch. Warwick Allison also ported NetHack to use the Qt inter†face. - Warren Cheung combined SLASH with the Wizard Patch to pro- - duce Slash'em, and with the help of Kevin Hugo, added more fea- - tures. Kevin later joined the DevTeam and incorporated the best + Warren Cheung combined SLASH with the Wizard Patch to pro†+ duce Slash’em, and with the help of Kevin Hugo, added more fea†+ tures. Kevin later joined the DevTeam and incorporated the best of these ideas in NetHack 3.3. The final update to 3.2 was the bug fix release 3.2.3, which - was released simultaneously with 3.3.0 in December 1999 just in + was released simultaneously with 3.3.0 in December 1999 just in time for the Year 2000. The 3.3 development team, consisting of Michael Allison, Ken - Arromdee, David Cohrs, Jessie Collet, Steve Creps, Kevin Darcy, - Timo Hakulinen, Kevin Hugo, Steve Linhart, Ken Lorber, Dean - Luick, Pat Rankin, Eric Smith, Mike Stephenson, Janet Walz, and - Paul Winner, released 3.3.0 in December 1999 and 3.3.1 in August + Arromdee, David Cohrs, Jessie Collet, Steve Creps, Kevin Darcy, + Timo Hakulinen, Kevin Hugo, Steve Linhart, Ken Lorber, Dean + Luick, Pat Rankin, Eric Smith, Mike Stephenson, Janet Walz, and + Paul Winner, released 3.3.0 in December 1999 and 3.3.1 in August of 2000. - - - - NetHack 3.5 September 20, 2006 - - - - - - NetHack Guidebook 56 - - - Version 3.3 offered many firsts. It was the first version to - separate race and profession. The Elf class was removed in pref- + separate race and profession. The Elf class was removed in pref†erence to an elf race, and the races of dwarves, gnomes, and orcs - made their first appearance in the game alongside the familiar - human race. Monk and Ranger roles joined Archeologists, Barbar- - ians, Cavemen, Healers, Knights, Priests, Rogues, Samurai, - Tourists, Valkyries and of course, Wizards. It was also the - first version to allow you to ride a steed, and was the first - version to have a publicly available web-site listing all the - bugs that had been discovered. Despite that constantly growing - bug list, 3.3 proved stable enough to last for more than a year + made their first appearance in the game alongside the familiar + human race. Monk and Ranger roles joined Archeologists, Barbar†+ ians, Cavemen, Healers, Knights, Priests, Rogues, Samurai, + Tourists, Valkyries and of course, Wizards. It was also the + first version to allow you to ride a steed, and was the first + version to have a publicly available webâ€site listing all the + bugs that had been discovered. Despite that constantly growing + bug list, 3.3 proved stable enough to last for more than a year and a half. - The 3.5 development team initially consisted of Michael Al- - lison, Ken Arromdee, David Cohrs, Jessie Collet, Kevin Hugo, Ken - Lorber, Dean Luick, Pat Rankin, Mike Stephenson, Janet Walz, and - Paul Winner, with Warwick Allison joining just before the re- + + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 62 + + + + The 3.4 development team initially consisted of Michael Al†+ lison, Ken Arromdee, David Cohrs, Jessie Collet, Kevin Hugo, Ken + Lorber, Dean Luick, Pat Rankin, Mike Stephenson, Janet Walz, and + Paul Winner, with Warwick Allison joining just before the re†lease of NetHack 3.4.0 in March 2002. - As with version 3.3, various people contributed to the game + As with version 3.3, various people contributed to the game as a whole as well as supporting ports on the different platforms that NetHack runs on: - Pat Rankin maintained 3.5 for VMS. + Pat Rankin maintained 3.4 for VMS. - Michael Allison maintained NetHack 3.5 for the MS-DOS plat- + Michael Allison maintained NetHack 3.4 for the MSâ€DOS plat†form. Paul Winner and Yitzhak Sapir provided encouragement. - Dean Luick, Mark Modrall, and Kevin Hugo maintained and en- + Dean Luick, Mark Modrall, and Kevin Hugo maintained and en†hanced the Macintosh port of 3.4. - Michael Allison, David Cohrs, Alex Kompel, Dion Nicolaas, - and Yitzhak Sapir maintained and enhanced 3.5 for the Microsoft - Windows platform. Alex Kompel contributed a new graphical inter- - face for the Windows port. Alex Kompel also contributed a Win- + Michael Allison, David Cohrs, Alex Kompel, Dion Nicolaas, + and Yitzhak Sapir maintained and enhanced 3.4 for the Microsoft + Windows platform. Alex Kompel contributed a new graphical inter†+ face for the Windows port. Alex Kompel also contributed a Win†dows CE port for 3.4.1. Ron Van Iwaarden was the sole maintainer of NetHack for OS/2 - the past several releases. Unfortunately Ron's last OS/2 machine - stopped working in early 2006. A great many thanks to Ron for + the past several releases. Unfortunately Ron’s last OS/2 machine + stopped working in early 2006. A great many thanks to Ron for keeping NetHack alive on OS/2 all these years. - Janne Salmijarvi and Teemu Suikki maintained and enhanced - the Amiga port of 3.5 after Janne Salmijarvi resurrected it for + Janne Salmijarvi and Teemu Suikki maintained and enhanced + the Amiga port of 3.4 after Janne Salmijarvi resurrected it for 3.3.1. - Christian ``Marvin'' Bressler maintained 3.5 for the Atari + Christian ‘‘Marvin’’ Bressler maintained 3.4 for the Atari after he resurrected it for 3.3.1. - There is a NetHack web site maintained by Ken Lorber at + The release of NetHack 3.4.3 in December 2003 marked the be†+ ginning of a long release hiatus. 3.4.3 proved to be a remarkably + stable version that provided continued enjoyment by the community + for more than a decade. The devteam slowly and quietly continued + to work on the game behind the scenes during the tenure of 3.4.3. + It was during that same period that several new variants emerged + within the NetHack community. Notably sporkhack by Derek S. Ray, + unnethack by Patric Mueller, nitrohack and its successors origi†+ nally by Daniel Thaler and then by Alex Smith, and Dynahack by + Tung Nguyen. Some of those variants continue to be developed, + maintained, and enjoyed by the community to this day. + + In September 2014, an interim snapshot of the code under de†+ velopment was released publicly by other parties. Since that code + was a workâ€inâ€progress and had not gone through a period of de†+ bugging, it was decided that the version numbers present on that + code snapshot would be retired and never used in an official + NetHack release. An announcement was posted on the devteam’s + + + NetHack 3.6 March 27, 2015 + + + + + + NetHack Guidebook 63 + + + + official nethack.org website to that effect, stating that there + would never be a 3.4.4, 3.5, or 3.5.0 official release version. + + In January 2015, preparation began for the release of + NetHack 3.6 + + At the beginning of development for what would eventually + get released as 3.6.0, the development team consisted of Warwick + Allison, Michael Allison, Ken Arromdee, David Cohrs, Jessie Col†+ let, Ken Lorber, Dean Luick, Pat Rankin, Mike Stephenson, Janet + Walz, and Paul Winner. Leading up to the release of 3.6.0 in + early 2015, new members Sean Hunt, Pasi Kallinen, and Derek S. + Ray joined the NetHack development team, + + 3.6.0 TODO insert apprpriate description of 3.6.0 here + + The development team, as well as Steve VanDevender and Kevin + Smolkowski ensured that NetHack 3.6.0 continued to operate on + various Unix flavors as well as maintaining the X11 interface. + + Ken Lorber, Haoyang Wang, Pat Rankin, and Dean Luick main†+ tained the port of NetHack 3.6.0 for Mac. + + Michael Allison, Derek S. Ray, Yitzhak Sapir, Alex Kompel, + and David Cohrs maintained the port of NetHack 3.6.0 for Mi†+ crosoft Windows. + + Jeff Bailey created and maintained a port of NetHack 3.6.0 + for Chrome. + + TODO Alex Kompel maintained a port of NetHack 3.6.0 to Win†+ dows Phone. + + This version of the game is special in a particular way. + Near the end of the development of 3.6, one of the significant + inspirations for many of the humorous and fun features found in + the game, author Terry Pratchett, passed away. This version of + the game is dedicated to him. + + The official NetHack web site is maintained by Ken Lorber at http://www.nethack.org/. - - - - - - - - - - - + SHOUTâ€OUTS + + The devteam would like to give a special "shoutâ€out" to + thank the generous people primarily responsible for the public + NetHack servers available for playing the game at nethack.alt.org + and devnull.net. In addition to providing a way for the public to + play a game of NetHack from almost anywhere, they have hosted an†+ nual NetHack tournaments for many, many years. + + On behalf of the NetHack community, thank you very much to + M. Drew Streib, Pasi Kallinen and Robin Bandy. - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 - NetHack Guidebook 57 + NetHack Guidebook 64 + ††††††††††+ From time to time, some depraved individual out there in netland sends a particularly intriguing modification to help out with the game. The Gods of the Dungeon sometimes make note of the names of the worst of these miscreants in this, the list of Dungeoneers: - Adam Aronow Izchak Miller Mike Passaretti - Alex Kompel J. Ali Harlow Mike Stephenson - Andreas Dorn Janet Walz Norm Meluch - Andy Church Janne Salmijarvi Olaf Seibert - Andy Swanson Jean-Christophe Collet Pasi Kallinen - Ari Huttunen Jochen Erwied Pat Rankin - Barton House John Kallen Paul Winner - Benson I. Margulies John Rupley Pierre Martineau - Bill Dyer John S. Bien Ralf Brown - Boudewijn Waijers Johnny Lee Ray Chason - Bruce Cox Jon W{tte Richard Addison - Bruce Holloway Jonathan Handler Richard Beigel - Bruce Mewborne Joshua Delahunty Richard P. Hughey - Carl Schelin Keizo Yamamoto Rob Menke + Adam Aronow J. Ali Harlow Mike Stephenson + Alex Kompel Janet Walz Norm Meluch + Andreas Dorn Janne Salmijarvi Olaf Seibert + Andy Church Jeanâ€Christophe Collet Pasi Kallinen + Andy Swanson Jeff Bailey Pat Rankin + Ari Huttunen Jochen Erwied Paul Winner + Barton House John Kallen Pierre Martineau + Benson I. Margulies John Rupley Ralf Brown + Bill Dyer John S. Bien Ray Chason + Boudewijn Waijers Johnny Lee Richard Addison + Bruce Cox Jon W{tte Richard Beigel + Bruce Holloway Jonathan Handler Richard P. Hughey + Bruce Mewborne Joshua Delahunty Rob Menke + Carl Schelin Keizo Yamamoto Robin Bandy Chris Russo Ken Arnold Robin Johnson David Cohrs Ken Arromdee Roderick Schertler David Damerell Ken Lorber Roland McGrath @@ -3727,10 +4191,11 @@ David Hairston Kevin Darcy Ronnen Miller Dean Luick Kevin Hugo Ross Brown Del Lamb Kevin Sitze Sascha Wostmann - Deron Meranda Kevin Smolkowski Scott Bigham - Dion Nicolaas Kevin Sweet Scott R. Turner - Dylan O'Donnell Lars Huttar Stephen Spackman - Eric Backus Leon Arnott Stephen White + Derek S. Ray Kevin Smolkowski Scott Bigham + Deron Meranda Kevin Sweet Scott R. Turner + Dion Nicolaas Lars Huttar Sean Hunt + Dylan O’Donnell Leon Arnott Stephen Spackman + Eric Backus M. Drew Streib Stephen White Eric Hendrickson Malcolm Ryan Steve Creps Eric R. Smith Mark Gooderum Steve Linhart Eric S. Raymond Mark Modrall Steve VanDevender @@ -3740,9 +4205,10 @@ Greg Laskin Michael Allison Tom Almy Greg Olson Michael Feir Tom West Gregg Wonderly Michael Hamel Warren Cheung - Hao-yang Wang Michael Sokolov Warwick Allison + Haoâ€yang Wang Michael Sokolov Warwick Allison Helge Hafting Mike Engber Yitzhak Sapir - Irina Rempt-Drijfhout Mike Gallop + Irina Remptâ€Drijfhout Mike Gallop + Izchak Miller Mike Passaretti Brand and product names are trademarks or registered trademarks of their respective holders. @@ -3752,11 +4218,7 @@ - - - - - NetHack 3.5 September 20, 2006 + NetHack 3.6 March 27, 2015 From cb79a82bfb1e64517ecf52bde6f915779123ad52 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 28 Mar 2015 00:49:38 -0400 Subject: [PATCH 286/354] fix up some syntax errors in Guidebook.tex --- doc/Guidebook.tex | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 0310aaeb1..af2023f14 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -863,7 +863,7 @@ the exchange still takes place. %.lp \item[\tb{X}] Toggle two-weapon combat, if your character can do it. Also available -via the ``#twoweapon'' extended command +via the ``{\tt \#twoweapon}'' extended command %.lp \item[\tb{\^{}X}] Display basic information about your character.\\ @@ -3564,7 +3564,7 @@ There are two ways of enabling explore mode. One is to start the game with the {\tt -X} command-line switch or with the {\it playmode:explore\/} -option. The other is to issue the `{\tt #exploremode}' extended command while +option. The other is to issue the `{\tt \#exploremode}' extended command while already playing the game. Starting a new game in explore mode provides your character with a wand of wishing in initial inventory; switching during play does not. The other benefits of explore mode are left for @@ -3929,12 +3929,11 @@ people primarily responsible for the public NetHack servers available for playing the game at nethack.alt.org and devnull.net. In addition to providing a way for the public to play a game of NetHack from almost anywhere, they have hosted annual NetHack tournaments for many, many years. -%pg -\medskip +%.pg \nd On behalf of the NetHack community, thank you very much to {\it M. Drew Streib}, {\it Pasi Kallinen} and {\it Robin Bandy}. -.pg +%.pg %.hn 3 \subsection*{Dungeoneers} \bigskip From ec456ade9f16f4fa1ca9ea460d1477b9c2206ac4 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 28 Mar 2015 01:06:28 -0400 Subject: [PATCH 287/354] a couple of substitution errors in Guidebook.tex --- doc/Guidebook.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index af2023f14..88e5a59b4 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -3817,7 +3817,7 @@ enhanced the Macintosh port of 3.4. %.pg \medskip \nd {\it Michael Allison}, {\it David Cohrs}, {\it Alex Kompel}, {\it Dion Nicolaas}, and -{\it Yitzhak Sapir} maintained and enhanced 3.5 for the Microsoft Windows platform. +{\it Yitzhak Sapir} maintained and enhanced 3.4 for the Microsoft Windows platform. {\it Alex Kompel} contributed a new graphical interface for the Windows port. {\it Alex Kompel} also contributed a Windows CE port for 3.4.1. @@ -3831,7 +3831,7 @@ all these years. %.pg \medskip \nd {\it Janne Salmij\"{a}rvi} and {\it Teemu Suikki} maintained -and enhanced the Amiga port of 3.5 after {\it Janne Salmij\"{a}rvi} resurrected +and enhanced the Amiga port of 3.4 after {\it Janne Salmij\"{a}rvi} resurrected it for 3.3.1. %.pg From c6faa08b8fb24f62a1fdd56e3bb8fe0c19f5335a Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 10:00:44 +0200 Subject: [PATCH 288/354] Add sysconf for linux-X11 --- sys/unix/hints/linux-x11 | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/unix/hints/linux-x11 b/sys/unix/hints/linux-x11 index e0d98badd..cf5dfb6f3 100644 --- a/sys/unix/hints/linux-x11 +++ b/sys/unix/hints/linux-x11 @@ -16,6 +16,7 @@ HACKDIR=$(PREFIX)/games/lib/$(GAME)dir SHELLDIR = $(PREFIX)/games CFLAGS=-O -I../include -DNOTPARMDECL $(CFLAGS1) $(CFLAGS3) +CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\" CFLAGS1=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\" CFLAGS3=-DX11_GRAPHICS -DDEFAULT_WINDOW_SYS=\"X11\" -DNOTTYGRAPHICS From c7d92a47e157a323ee9c425215e989d0666001d3 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 10:55:41 +0200 Subject: [PATCH 289/354] Remove migrating monster from polearm targeting --- src/dog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dog.c b/src/dog.c index d8ab09e4f..fcc258b86 100644 --- a/src/dog.c +++ b/src/dog.c @@ -685,6 +685,7 @@ migrate_to_level(mtmp, tolev, xyloc, cc) mtmp->mux = new_lev.dnum; mtmp->muy = new_lev.dlevel; mtmp->mx = mtmp->my = 0; /* this implies migration */ + if (mtmp == context.polearm.hitmon) context.polearm.hitmon = NULL; } /* return quality of food; the lower the better */ From 2fce0074b3948aea4b2356e803d7658b44eed9fb Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 13:32:24 +0200 Subject: [PATCH 290/354] Show legal polearm hit positions User can press $ to display valid positions when asked for a position to pick, and the positions will be hilighted --- doc/fixes35.0 | 1 + include/extern.h | 1 + src/apply.c | 40 ++++++++++++++++++++++++++++++++++++---- src/do_name.c | 31 ++++++++++++++++++++++++++++++- 4 files changed, 68 insertions(+), 5 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 601be2ee0..e6d5e1368 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -887,6 +887,7 @@ show object symbols in menu headings in menus where those object symbols act as menu accelerators, toggleable via "menu_objsyms" option show t-shirt text at end of game inventory disclose hitting with a polearm remembers the position of the last monster you hit +allow showing legal polearm positions when asked for location to hit Platform- and/or Interface-Specific Fixes diff --git a/include/extern.h b/include/extern.h index d6347207c..1cee0f651 100644 --- a/include/extern.h +++ b/include/extern.h @@ -364,6 +364,7 @@ E void NDECL(heal_legs); /* ### do_name.c ### */ E int FDECL(getpos, (coord *,BOOLEAN_P,const char *)); +E void FDECL(getpos_sethilite, (void (*f)(int) )); E void FDECL(new_mname, (struct monst *,int)); E void FDECL(free_mname, (struct monst *)); E void FDECL(new_oname, (struct obj *,int)); diff --git a/src/apply.c b/src/apply.c index 4d6899710..ae7565f17 100644 --- a/src/apply.c +++ b/src/apply.c @@ -2553,6 +2553,32 @@ int min_range, max_range; return TRUE; } +int polearm_range_min = -1; +int polearm_range_max = -1; + +void +display_polearm_positions(state) +int state; +{ + if (state == 0) { + tmp_at(DISP_BEAM, cmap_to_glyph(S_flashbeam)); + } else if (state == 1) { + int x,y, dx,dy; + for (dx = -4; dx <= 4; dx++) + for (dy = -4; dy <= 4; dy++) { + x = dx + (int)u.ux; + y = dy + (int)u.uy; + if (isok(x, y) && + distu(x, y) >= polearm_range_min && + distu(x, y) <= polearm_range_max) { + tmp_at(x, y); + } + } + } else { + tmp_at(DISP_END, 0); + } +} + /* Distance attacks by pole-weapons */ STATIC_OVL int use_pole(obj) @@ -2595,15 +2621,21 @@ use_pole(obj) else if (P_SKILL(typ) == P_SKILLED) max_range = 5; else max_range = 8; /* (P_SKILL(typ) >= P_EXPERT) */ + polearm_range_min = min_range; + polearm_range_max = max_range; + /* Prompt for a location */ pline(where_to_hit); - if (hitm && !DEADMONSTER(hitm) && cansee(hitm->mx, hitm->my)) { + cc.x = u.ux; + cc.y = u.uy; + if (!find_poleable_mon(&cc, min_range, max_range) && + hitm && !DEADMONSTER(hitm) && cansee(hitm->mx, hitm->my) && + distu(hitm->mx,hitm->my) <= max_range && + distu(hitm->mx,hitm->my) >= min_range) { cc.x = hitm->mx; cc.y = hitm->my; - } else if (!find_poleable_mon(&cc, min_range, max_range)) { - cc.x = u.ux; - cc.y = u.uy; } + getpos_sethilite(display_polearm_positions); if (getpos(&cc, TRUE, "the spot to hit") < 0) return res; /* ESC; uses turn iff polearm became wielded */ diff --git a/src/do_name.c b/src/do_name.c index 0f837c9d4..b5c2bb711 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -25,6 +25,17 @@ nextmbuf() return bufs[bufidx]; } +/* function for getpos() to highlight desired map locations. + * parameter value 0 = initialize, 1 = highlight, 2 = done + */ +void (*getpos_hilitefunc)(int) = NULL; +void +getpos_sethilite(f) +void (*f)(int); +{ + getpos_hilitefunc = f; +} + /* the response for '?' help request in getpos() */ STATIC_OVL void getpos_help(force, goal) @@ -41,6 +52,8 @@ const char *goal; putstr(tmpwin, 0, "Use [HJKL] to move the cursor 8 units at a time."); putstr(tmpwin, 0, "Or enter a background symbol (ex. <)."); putstr(tmpwin, 0, "Use @ to move the cursor on yourself."); + if (getpos_hilitefunc != NULL) + putstr(tmpwin, 0, "Use $ to display valid locations."); putstr(tmpwin, 0, "Use # to toggle automatic description."); /* disgusting hack; the alternate selection characters work for any getpos call, but they only matter for dowhatis (and doquickwhatis) */ @@ -69,6 +82,7 @@ const char *goal; boolean show_goal_msg = FALSE; static const char pick_chars[] = ".,;:"; const char *cp; + boolean hilite_state = FALSE; if (!goal) goal = "desired location"; if (flags.verbose) { @@ -92,7 +106,7 @@ const char *goal; curs(WIN_MAP, cx, cy); flush_screen(0); show_goal_msg = FALSE; - } else if (auto_msg && !msg_given) { + } else if (auto_msg && !msg_given && !hilite_state) { coord cc; int sym = 0; char tmpbuf[BUFSZ]; @@ -110,6 +124,13 @@ const char *goal; c = nh_poskey(&tx, &ty, &sidx); + if (hilite_state) { + (*getpos_hilitefunc)(2); + hilite_state = FALSE; + curs(WIN_MAP, cx, cy); + flush_screen(0); + } + if (auto_msg) msg_given = FALSE; @@ -174,6 +195,13 @@ const char *goal; /* update message window to reflect that we're still targetting */ show_goal_msg = TRUE; msg_given = TRUE; + } else if ((c == '$') && (getpos_hilitefunc != NULL)) { + if (!hilite_state) { + (*getpos_hilitefunc)(0); + (*getpos_hilitefunc)(1); + hilite_state = TRUE; + } + goto nxtc; } else if (c == '#') { auto_msg = !auto_msg; pline("Automatic description %sis %s.", @@ -269,6 +297,7 @@ const char *goal; if (msg_given) clear_nhwindow(WIN_MESSAGE); ccp->x = cx; ccp->y = cy; + getpos_hilitefunc = NULL; return result; } From b17ecb149b862e2a366c5e8bebf2cbf88470e46b Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 16:24:25 +0200 Subject: [PATCH 291/354] Use existing function to count containers --- src/pickup.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/pickup.c b/src/pickup.c index 476d85798..d2a76416c 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1498,6 +1498,7 @@ doloot() /* loot a container on the floor or loot saddle from mon. */ char qbuf[BUFSZ]; int prev_inquiry = 0; boolean prev_loot = FALSE; + int num_conts; if (check_capacity((char *)0)) { /* "Can't do that while carrying so much stuff." */ @@ -1518,15 +1519,11 @@ doloot() /* loot a container on the floor or loot saddle from mon. */ lootcont: - if (container_at(cc.x, cc.y, FALSE)) { + if ((num_conts = container_at(cc.x, cc.y, TRUE)) > 0) { boolean anyfound = FALSE; - int num_conts = 0; if (!able_to_loot(cc.x, cc.y, TRUE)) return 0; - for (cobj = level.objects[cc.x][cc.y]; cobj; cobj = cobj->nexthere) - if (Is_container(cobj)) num_conts++; - if (num_conts > 1) { /* use a menu to loot many containers */ int n, i; From c035402c14c001c0545e35b3b1f083e0fbdc0b42 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 28 Mar 2015 11:20:44 -0400 Subject: [PATCH 292/354] flavor enhance zap downwards/upwards when hiding Changes to be committed: modified: doc/fixes35.0 modified: include/extern.h modified: src/apply.c modified: src/zap.c On 3/23/2015 6:41 PM, a bug reporter wrote: > When you're hiding under an item (e.g. via garter snake polyform), and > that item gets polyshuddered into nonexistence, you continue hiding > (under nothing). This was addressed previously. > (Incidentally, it's a bit weird that you use > to aim at items that are > flavorwise above you at the time.) This addresses the flavorwise concern. --- doc/fixes35.0 | 2 ++ include/extern.h | 2 +- src/apply.c | 4 ++-- src/zap.c | 40 ++++++++++++++++++++++++++++++++-------- 4 files changed, 37 insertions(+), 11 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index e6d5e1368..2db942ec5 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1100,6 +1100,8 @@ pressing # when cursor positioning toggles automatic description of features under the cursor cursor positioning ignores uninteresting dungeon features allow reading many more items +when you're hiding under something a zap downward should not hit that + something, while a zap upward should Platform- and/or Interface-Specific New Features diff --git a/include/extern.h b/include/extern.h index 1cee0f651..38e751018 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2629,7 +2629,7 @@ E boolean FDECL(obj_resists, (struct obj *,int,int)); E boolean FDECL(obj_shudders, (struct obj *)); E void FDECL(do_osshock, (struct obj *)); E int FDECL(bhito, (struct obj *,struct obj *)); -E int FDECL(bhitpile, (struct obj *,int (*)(OBJ_P,OBJ_P),int,int)); +E int FDECL(bhitpile, (struct obj *,int (*)(OBJ_P,OBJ_P),int,int,SCHAR_P)); E int FDECL(zappable, (struct obj *)); E void FDECL(zapnodir, (struct obj *)); E int NDECL(dozap); diff --git a/src/apply.c b/src/apply.c index ae7565f17..2265ab519 100644 --- a/src/apply.c +++ b/src/apply.c @@ -3037,7 +3037,7 @@ do_break_wand(obj) /* if (context.botl) bot(); */ } if (affects_objects && level.objects[x][y]) { - (void) bhitpile(obj, bhito, x, y); + (void) bhitpile(obj, bhito, x, y, 0); if (context.botl) bot(); /* potion effects */ } } else { @@ -3054,7 +3054,7 @@ do_break_wand(obj) * since it's also used by retouch_equipment() for polyself.) */ if (affects_objects && level.objects[x][y]) { - (void) bhitpile(obj, bhito, x, y); + (void) bhitpile(obj, bhito, x, y, 0); if (context.botl) bot(); /* potion effects */ } damage = zapyourself(obj, FALSE); diff --git a/src/zap.c b/src/zap.c index fcf0047bf..3674e5a4a 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1750,9 +1750,9 @@ struct obj *obj, *otmp; if (Is_box(obj)) (void) boxlock(obj, otmp); if (obj_shudders(obj)) { - boolean cover = ((obj->ox == u.ux && obj->oy == u.uy) && - u.uundetected && - hides_under(youmonst.data)); + boolean cover = ((obj == level.objects[u.ux][u.uy]) && + u.uundetected && + hides_under(youmonst.data)); if (cansee(obj->ox, obj->oy)) learn_it = TRUE; do_osshock(obj); @@ -1892,10 +1892,11 @@ struct obj *obj, *otmp; /* returns nonzero if something was hit */ int -bhitpile(obj,fhito,tx,ty) +bhitpile(obj,fhito,tx,ty,zdir) struct obj *obj; int FDECL((*fhito), (OBJ_P,OBJ_P)); int tx, ty; + schar zdir; { int hitanything = 0; register struct obj *otmp, *next_obj; @@ -1917,7 +1918,14 @@ bhitpile(obj,fhito,tx,ty) for(otmp = level.objects[tx][ty]; otmp; otmp = next_obj) { /* Fix for polymorph bug, Tim Wright */ next_obj = otmp->nexthere; - hitanything += (*fhito)(otmp, obj); + /* + * game flavor: if you are hiding under something, + * a zap downwards shouldn't hit that obj, so honor that. + */ + if (!(u.uundetected && (zdir > 0) && + (otmp == level.objects[u.ux][u.uy]) && + hides_under(youmonst.data))) + hitanything += (*fhito)(otmp, obj); } if(poly_zapped >= 0) create_polymon(level.objects[tx][ty], poly_zapped); @@ -2568,7 +2576,7 @@ struct obj *obj; /* wand or spell */ if (u.dz < 0) { You("probe towards the %s.", ceiling(x,y)); } else { - ptmp += bhitpile(obj, bhito, x, y); + ptmp += bhitpile(obj, bhito, x, y, u.dz); You("probe beneath the %s.", surface(x,y)); ptmp += display_binventory(x, y, TRUE); } @@ -2688,7 +2696,7 @@ struct obj *obj; /* wand or spell */ if (u.dz > 0) { /* zapping downward */ - (void) bhitpile(obj, bhito, x, y); + (void) bhitpile(obj, bhito, x, y, u.dz); /* subset of engraving effects; none sets `disclose' */ if ((e = engr_at(x, y)) != 0 && e->engr_type != HEADSTONE) { @@ -2724,6 +2732,22 @@ struct obj *obj; /* wand or spell */ break; } } + } else if (u.dz < 0) { + /* zapping upward */ + + /* game flavor: if you're hiding under "something" + * a zap upward should hit that "something". + */ + if (u.uundetected && hides_under(youmonst.data)) { + int hitit = 0; + otmp = level.objects[u.ux][u.uy]; + + if (otmp) hitit = bhito(otmp, obj); + if (hitit) { + (void) hideunder(&youmonst); + disclose = TRUE; + } + } } return disclose; @@ -3095,7 +3119,7 @@ struct obj **pobj; /* object tossed/used, set to NULL } } if(fhito) { - if(bhitpile(obj,fhito,bhitpos.x,bhitpos.y)) + if(bhitpile(obj,fhito,bhitpos.x,bhitpos.y,0)) range--; } else { if(weapon == KICKED_WEAPON && From 0e4317fa6b2e121bee62abbe659e70f8bf827346 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 17:20:57 +0200 Subject: [PATCH 293/354] Balsa wands break easily --- src/apply.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/apply.c b/src/apply.c index ae7565f17..9bba15186 100644 --- a/src/apply.c +++ b/src/apply.c @@ -2891,6 +2891,7 @@ do_break_wand(obj) boolean fillmsg = FALSE; int expltype = EXPL_MAGICAL; char confirm[QBUFSZ], buf[BUFSZ]; + boolean is_fragile = (!strcmp(OBJ_DESCR(objects[obj->otyp]), "balsa")); if (yn(safe_qbuf(confirm, "Are you really sure you want to break ", "?", obj, yname, ysimple_name, "the wand")) == 'n') @@ -2899,7 +2900,7 @@ do_break_wand(obj) if (nohands(youmonst.data)) { You_cant("break %s without hands!", yname(obj)); return 0; - } else if (ACURR(A_STR) < 10) { + } else if (ACURR(A_STR) < (is_fragile ? 5 : 10)) { You("don't have the strength to break %s!", yname(obj)); return 0; } From 9a4fefb5ad0c07d6103f2e1e6acabe9a5e8f9478 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 19:21:49 +0200 Subject: [PATCH 294/354] Add missing prototype --- src/apply.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/apply.c b/src/apply.c index b65a2cabf..6f13d6623 100644 --- a/src/apply.c +++ b/src/apply.c @@ -27,6 +27,7 @@ STATIC_DCL void FDECL(use_trap, (struct obj *)); STATIC_DCL void FDECL(use_stone, (struct obj *)); STATIC_PTR int NDECL(set_trap); /* occupation callback */ STATIC_DCL int FDECL(use_whip, (struct obj *)); +STATIC_PTR void FDECL(display_polearm_positions, (int)); STATIC_DCL int FDECL(use_pole, (struct obj *)); STATIC_DCL int FDECL(use_cream_pie, (struct obj *)); STATIC_DCL int FDECL(use_grapple, (struct obj *)); From cbb155b0e67afa9c1c78bd9717a3cb1a9eefe1fd Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 19:31:01 +0200 Subject: [PATCH 295/354] YAFMs when trying to pick up terrain features --- doc/fixes35.0 | 1 + src/hack.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 2db942ec5..f2e1b2890 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -888,6 +888,7 @@ show object symbols in menu headings in menus where those object symbols show t-shirt text at end of game inventory disclose hitting with a polearm remembers the position of the last monster you hit allow showing legal polearm positions when asked for location to hit +add messages for trying to pick up some terrain features Platform- and/or Interface-Specific Fixes diff --git a/src/hack.c b/src/hack.c index 7f15af6ee..98e615ac8 100644 --- a/src/hack.c +++ b/src/hack.c @@ -2207,7 +2207,19 @@ dopickup() } } if (!OBJ_AT(u.ux, u.uy)) { - There("is nothing here to pick up."); + register struct rm *lev = &levl[u.ux][u.uy]; + if (IS_THRONE(lev->typ)) + pline("It must weigh%s a ton!", + lev->looted ? " almost" : ""); + else if (IS_SINK(lev->typ)) + pline_The("plumbing connects it to the floor."); + else if (IS_GRAVE(lev->typ)) + You("don't need a gravestone. Yet."); + else if (IS_FOUNTAIN(lev->typ)) + You("could drink the water..."); + else if (IS_DOOR(lev->typ) && (lev->doormask & D_ISOPEN)) + pline("It won't come off the hinges."); + else There("is nothing here to pick up."); return 0; } if (!can_reach_floor(TRUE)) { From cf7143094f54ab5eb2310c9109c5f415baf26d16 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 19:38:15 +0200 Subject: [PATCH 296/354] Feedback when boomerang hits sink --- doc/fixes35.0 | 1 + src/zap.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index f2e1b2890..1882ad286 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -889,6 +889,7 @@ show t-shirt text at end of game inventory disclose hitting with a polearm remembers the position of the last monster you hit allow showing legal polearm positions when asked for location to hit add messages for trying to pick up some terrain features +boomerang makes noise when hitting a sink Platform- and/or Interface-Specific Fixes diff --git a/src/zap.c b/src/zap.c index 3674e5a4a..b8c846be3 100644 --- a/src/zap.c +++ b/src/zap.c @@ -3283,8 +3283,10 @@ int dx, dy; } tmp_at(bhitpos.x, bhitpos.y); delay_output(); - if(IS_SINK(levl[bhitpos.x][bhitpos.y].typ)) + if(IS_SINK(levl[bhitpos.x][bhitpos.y].typ)) { + if (!Deaf) pline("Klonk!"); break; /* boomerang falls on sink */ + } /* ct==0, initial position, we want next delta to be same; ct==5, opposite position, repeat delta undoes first one */ if (ct % 5 != 0) i += (counterclockwise ? -1 : 1); From 4cd14a7a2a44537ea27329637e2d7f312862cea3 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Mar 2015 20:39:40 +0200 Subject: [PATCH 297/354] It's Wonka Bar, not just Wonka --- src/read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/read.c b/src/read.c index 51a5b5295..aa7a20508 100644 --- a/src/read.c +++ b/src/read.c @@ -225,7 +225,7 @@ doread() "Choco Nummer", "Om-nom", /* Cat Macro */ "Fruity Oaty", /* Serenity */ - "Wonka" /* Charlie and the Chocolate Factory */ + "Wonka Bar" /* Charlie and the Chocolate Factory */ }; if (Blind) { You_cant("feel any Braille writing."); From 011520d61a9fc5cb2d60cec139dd54905bef0d4a Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 28 Mar 2015 15:23:28 -0400 Subject: [PATCH 298/354] Guidebook transcription typo --- doc/Guidebook.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 88e5a59b4..79e39c599 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -3463,7 +3463,7 @@ Rogue-like commands. \subsection*{Global Configuration for System Administrators} %.pg -If NetHack is compiled with teh SYSCF option, a system administrator +If NetHack is compiled with the SYSCF option, a system administrator should set up a global configuration; this is a file in the same format as the traditional per-user configuration file (see above). From 35d80f5922dcb29386ec7a667250ab0175ee1146 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 28 Mar 2015 18:05:42 -0400 Subject: [PATCH 299/354] remove #ifdef TOURIST straggler Changes to be committed: modified: src/worn.c --- src/worn.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/worn.c b/src/worn.c index a542f3be4..70ba11b3a 100644 --- a/src/worn.c +++ b/src/worn.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 worn.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 worn.c $NHDT-Date: 1427580338 2015/03/28 22:05:38 $ $NHDT-Branch: master $:$NHDT-Revision: 1.35 $ */ /* NetHack 3.5 worn.c $Date: 2013/11/05 00:57:56 $ $Revision: 1.32 $ */ /* SCCS Id: @(#)worn.c 3.5 2009/02/28 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ @@ -591,9 +591,7 @@ long flag; case W_ARMS: return uarms; case W_ARMG: return uarmg; case W_ARMF: return uarmf; -#ifdef TOURIST case W_ARMU: return uarmu; -#endif default: impossible("bad flag in which_armor"); return 0; From e69b5ae944f4fc3fa8c87300a648d499eae6e7ff Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 28 Mar 2015 18:08:09 -0400 Subject: [PATCH 300/354] fix C343-357 Rust monsters may chew non-ferrous items Changes to be committed: modified: src/mon.c website should be updated to reflect this bug closure. C343-357 Rust monsters may chew non-ferrous items. --- src/mon.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mon.c b/src/mon.c index 607845e7a..41d17e671 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mon.c $NHDT-Date: 1426465438 2015/03/16 00:23:58 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.139 $ */ +/* NetHack 3.5 mon.c $NHDT-Date: 1427580482 2015/03/28 22:08:02 $ $NHDT-Branch: master $:$NHDT-Revision: 1.142 $ */ /* NetHack 3.5 mon.c $Date: 2012/05/16 02:15:10 $ $Revision: 1.126 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -615,7 +615,10 @@ meatmetal(mtmp) /* Eats topmost metal object if it is there */ for (otmp = level.objects[mtmp->mx][mtmp->my]; otmp; otmp = otmp->nexthere) { - if (mtmp->data == &mons[PM_RUST_MONSTER] && !is_rustprone(otmp)) + /* Don't eat indigestible/choking/inappropriate objects */ + if ((mtmp->data == &mons[PM_RUST_MONSTER] && !is_rustprone(otmp)) || + (otmp->otyp == AMULET_OF_STRANGULATION) || + (otmp->otyp == RIN_SLOW_DIGESTION)) continue; if (is_metallic(otmp) && !obj_resists(otmp, 5, 95) && touch_artifact(otmp,mtmp)) { @@ -632,9 +635,7 @@ meatmetal(mtmp) pline("%s spits %s out in disgust!", Monnam(mtmp), distant_name(otmp,doname)); } - /* KMH -- Don't eat indigestible/choking objects */ - } else if (otmp->otyp != AMULET_OF_STRANGULATION && - otmp->otyp != RIN_SLOW_DIGESTION) { + } else { if (cansee(mtmp->mx,mtmp->my) && flags.verbose) pline("%s eats %s!", Monnam(mtmp), distant_name(otmp,doname)); From 5855deae6e78d6eb0f30bb4bbc0cd91079bd8970 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 28 Mar 2015 18:20:19 -0400 Subject: [PATCH 301/354] doc/fixes update for C343-357 --- doc/fixes35.0 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 1882ad286..53fac6b5c 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -890,6 +890,8 @@ hitting with a polearm remembers the position of the last monster you hit allow showing legal polearm positions when asked for location to hit add messages for trying to pick up some terrain features boomerang makes noise when hitting a sink +non-pet rust monsters would eat rust-proofed non-digestibles but ignore + those non-digestibles otherwise Platform- and/or Interface-Specific Fixes From de2364da945d1a557658efde2047237ac6263aae Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 29 Mar 2015 14:56:23 +0300 Subject: [PATCH 302/354] Save playmode in xlogfile --- src/topten.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/topten.c b/src/topten.c index b68ad1bce..19eaa2ed2 100644 --- a/src/topten.c +++ b/src/topten.c @@ -66,6 +66,7 @@ STATIC_DCL void FDECL(discardexcess, (FILE *)); STATIC_DCL void FDECL(readentry, (FILE *,struct toptenentry *)); STATIC_DCL void FDECL(writeentry, (FILE *,struct toptenentry *)); STATIC_DCL void FDECL(writexlentry, (FILE*, struct toptenentry *)); +STATIC_DCL long NDECL(encodexlogflags); STATIC_DCL long NDECL(encodeconduct); STATIC_DCL long NDECL(encodeachieve); STATIC_DCL void FDECL(free_ttlist, (struct toptenentry *)); @@ -341,10 +342,23 @@ struct toptenentry *tt; Fprintf(rfile, "%cgender0=%s%calign0=%s", XLOG_SEP, genders[flags.initgend].filecode, XLOG_SEP, aligns[1 - u.ualignbase[A_ORIGINAL]].filecode); + Fprintf(rfile, "%cflags=0x%lx", + XLOG_SEP, encodexlogflags()); Fprintf(rfile, "\n"); #undef XLOG_SEP } +STATIC_OVL long +encodexlogflags() +{ + long e = 0L; + + if (wizard) e |= 1L << 0; + if (discover) e |= 1L << 1; + + return e; +} + STATIC_OVL long encodeconduct() { From 1e49567937fba71b7272c955595dcd513b7e9788 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 29 Mar 2015 15:49:01 +0300 Subject: [PATCH 303/354] Use dark gray color for black glyphs in TTY This is Michael Deutschmann's use_darkgray -patch. Adds a boolean option use_darkgray, settable in config file. This patch has been in use on NAO for years, and I have heard once someone say their terminal didn't support the dark gray color. --- dat/opthelp | 1 + doc/Guidebook.mn | 2 + doc/Guidebook.tex | 3 ++ doc/fixes35.0 | 1 + include/flag.h | 1 + include/winprocs.h | 3 +- src/options.c | 2 + win/tty/termcap.c | 128 +++++++++++++++++++++++++++++++++++++-------- win/tty/wintty.c | 2 +- 9 files changed, 118 insertions(+), 25 deletions(-) diff --git a/dat/opthelp b/dat/opthelp index 836e33d87..ce1d743cc 100644 --- a/dat/opthelp +++ b/dat/opthelp @@ -45,6 +45,7 @@ tombstone print tombstone when you die [TRUE] toptenwin print topten in a window rather than stdout [FALSE] travel enable the command to travel to a map location via [TRUE] a shortest-path algorithm, usually invoked by '_'. +use_darkgray use bold black instead of blue for black glyphs. [TRUE] use_inverse display detected monsters in highlighted manner [FALSE] verbose print more commentary during the game [TRUE] diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index eb340dff5..496d588de 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2453,6 +2453,8 @@ Specify the name of an alternative tile file to override the default. Specify the preferred height of each tile in a tile capable port. .lp tile_width Specify the preferred width of each tile in a tile capable port +.lp use_darkgray +Use bold black instead of blue for black glyphs (TTY only). .lp use_inverse NetHack should display inverse when the game specifies it. .lp vary_msgcount diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 79e39c599..6c3ccbded 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -2964,6 +2964,9 @@ Specify the preferred height of each tile in a tile capable port. \item[\ib{tile\_width}] Specify the preferred width of each tile in a tile capable port %.lp +\item[\ib{use\_darkgray}] +Use bold black instead of blue for black glyphs (TTY only). +%.lp \item[\ib{use\_inverse}] NetHack should display inverse when the game specifies it. %.lp diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 53fac6b5c..0d7fb3cde 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1143,6 +1143,7 @@ adopt/adapt/improve the Paranoid_Quit patch; default is paranoid_confirm:pray paranoid_confirm:Remove always pick from inventory for 'R' and 'T' adopt/adapt/improve Dungeon Overview Aardvark Joe's Extended Logfile +Michael Deutschmann's use_darkgray Code Cleanup and Reorganization diff --git a/include/flag.h b/include/flag.h index e7ebafa26..9eb7a68c6 100644 --- a/include/flag.h +++ b/include/flag.h @@ -295,6 +295,7 @@ struct instance_flags { boolean wc2_softkeyboard; /* use software keyboard */ boolean wc2_wraptext; /* wrap text */ boolean wc2_selectsaved; /* display a menu of user's saved games */ + boolean wc2_darkgray; /* try to use dark-gray color for black glyphs */ boolean cmdassist; /* provide detailed assistance for some commands */ boolean clicklook; /* allow right-clicking for look */ boolean obsolete; /* obsolete options can point at this, it isn't used */ diff --git a/include/winprocs.h b/include/winprocs.h index 72dad2315..398ba9cba 100644 --- a/include/winprocs.h +++ b/include/winprocs.h @@ -219,7 +219,8 @@ NEARDATA struct window_procs windowprocs; #define WC2_WRAPTEXT 0x04L /* 03 wrap long lines of text */ #define WC2_HILITE_STATUS 0x08L /* 04 hilite fields in status */ #define WC2_SELECTSAVED 0x10L /* 05 saved game selection menu */ - /* 27 free bits */ +#define WC2_DARKGRAY 0x20L /* 06 use bold black for black glyphs */ + /* 26 free bits */ #define ALIGN_LEFT 1 #define ALIGN_RIGHT 2 diff --git a/src/options.c b/src/options.c index 285603351..e1ff15ff0 100644 --- a/src/options.c +++ b/src/options.c @@ -201,6 +201,7 @@ static struct Bool_Opt {"tombstone",&flags.tombstone, TRUE, SET_IN_GAME}, {"toptenwin",&iflags.toptenwin, FALSE, SET_IN_GAME}, {"travel", &flags.travelcmd, TRUE, SET_IN_GAME}, + {"use_darkgray", &iflags.wc2_darkgray, TRUE, SET_IN_FILE}, #ifdef WIN32CON {"use_inverse", &iflags.wc_inverse, TRUE, SET_IN_GAME}, /*WC*/ #else @@ -4398,6 +4399,7 @@ struct wc_Opt wc2_options[] = { {"fullscreen", WC2_FULLSCREEN}, {"softkeyboard", WC2_SOFTKEYBOARD}, {"wraptext", WC2_WRAPTEXT}, + {"use_darkgray", WC2_DARKGRAY}, #ifdef STATUS_VIA_WINDOWPORT {"hilite_status", WC2_HILITE_STATUS}, #endif diff --git a/win/tty/termcap.c b/win/tty/termcap.c index b06a9abfe..1455bf21a 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -809,10 +809,9 @@ cl_eos() /* free after Robert Viduya */ extern char *tparm(); #endif -# ifdef COLOR_BLACK /* trust include file */ -#undef COLOR_BLACK -# else +# ifndef COLOR_BLACK /* trust include file */ # ifndef _M_UNIX /* guess BGR */ +#define COLOR_BLACK 0 #define COLOR_BLUE 1 #define COLOR_GREEN 2 #define COLOR_CYAN 3 @@ -821,6 +820,7 @@ extern char *tparm(); #define COLOR_YELLOW 6 #define COLOR_WHITE 7 # else /* guess RGB */ +#define COLOR_BLACK 0 #define COLOR_RED 1 #define COLOR_GREEN 2 #define COLOR_YELLOW 3 @@ -830,43 +830,125 @@ extern char *tparm(); #define COLOR_WHITE 7 # endif # endif -#define COLOR_BLACK COLOR_BLUE -const int ti_map[8] = { - COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW, - COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE }; +/* Mapping data for the six terminfo colors that resolve to pairs of nethack + * colors. Black and white are handled specially. + */ +const struct {int ti_color, nh_color, nh_bright_color;} ti_map[6] = +{ + {COLOR_RED,CLR_RED,CLR_ORANGE}, + {COLOR_GREEN,CLR_GREEN,CLR_BRIGHT_GREEN}, + {COLOR_YELLOW,CLR_BROWN,CLR_YELLOW}, + {COLOR_BLUE,CLR_BLUE,CLR_BRIGHT_BLUE}, + {COLOR_MAGENTA,CLR_MAGENTA,CLR_BRIGHT_MAGENTA}, + {COLOR_CYAN,CLR_CYAN,CLR_BRIGHT_CYAN} +}; + static void init_hilite() { register int c; char *setf, *scratch; - - for (c = 0; c < SIZE(hilites); c++) - hilites[c] = nh_HI; - hilites[CLR_GRAY] = hilites[NO_COLOR] = (char *)0; + int md_len; if (tgetnum("Co") < 8 || (MD == NULL) || (strlen(MD) == 0) || ((setf = tgetstr("AF", (char **)0)) == (char *)0 && (setf = tgetstr("Sf", (char **)0)) == (char *)0)) + { + /* Fallback when colors not available + * It's arbitrary to collapse all colors except gray + * together, but that's what the previous code did. + */ + hilites[CLR_BLACK] = nh_HI; + hilites[CLR_RED] = nh_HI; + hilites[CLR_GREEN] = nh_HI; + hilites[CLR_BROWN] = nh_HI; + hilites[CLR_BLUE] = nh_HI; + hilites[CLR_MAGENTA] = nh_HI; + hilites[CLR_CYAN] = nh_HI; + hilites[CLR_GRAY] = ""; + hilites[NO_COLOR] = ""; + hilites[CLR_ORANGE] = nh_HI; + hilites[CLR_BRIGHT_GREEN] = nh_HI; + hilites[CLR_YELLOW] = nh_HI; + hilites[CLR_BRIGHT_BLUE] = nh_HI; + hilites[CLR_BRIGHT_MAGENTA] = nh_HI; + hilites[CLR_BRIGHT_CYAN] = nh_HI; + hilites[CLR_WHITE] = nh_HI; return; - - for (c = 0; c < CLR_MAX / 2; c++) { - scratch = tparm(setf, ti_map[c]); - if (c != CLR_GRAY) { - hilites[c] = (char *) alloc(strlen(scratch) + 1); - Strcpy(hilites[c], scratch); - } - if (c != CLR_BLACK) { - hilites[c|BRIGHT] = (char*) alloc(strlen(scratch)+strlen(MD)+1); - Strcpy(hilites[c|BRIGHT], MD); - Strcat(hilites[c|BRIGHT], scratch); } + md_len = strlen(MD); + + c = 6; + while (c--) { + char *work; + scratch = tparm(setf,ti_map[c].ti_color); + work = (char *) alloc(strlen(scratch) + md_len + 1); + Strcpy(work,MD); + hilites[ti_map[c].nh_bright_color] = work; + work += md_len; + Strcpy(work,scratch); + hilites[ti_map[c].nh_color] = work; + } + + scratch = tparm(setf,COLOR_WHITE); + hilites[CLR_WHITE] = (char *) alloc(strlen(scratch) + md_len + 1); + Strcpy(hilites[CLR_WHITE],MD); + Strcat(hilites[CLR_WHITE],scratch); + + hilites[CLR_GRAY] = ""; + hilites[NO_COLOR] = ""; + + if (iflags.wc2_darkgray) { + /* On many terminals, esp. those using classic PC CGA/EGA/VGA + * textmode, specifying "hilight" and "black" simultaneously + * produces a dark shade of gray that is visible against a + * black background. We can use it to represent black objects. + */ + scratch = tparm(setf,COLOR_BLACK); + hilites[CLR_BLACK] = (char *) alloc(strlen(scratch) + md_len + 1); + Strcpy(hilites[CLR_BLACK],MD); + Strcat(hilites[CLR_BLACK],scratch); + } else { + /* But it's concievable that hilighted black-on-black could + * still be invisible on many others. We substitute blue for + * black. + */ + hilites[CLR_BLACK] = hilites[CLR_BLUE]; } } +static void +kill_hilite() +{ + /* if colors weren't available, no freeing needed */ + if (hilites[CLR_BLACK] == nh_HI) + return; + + if (hilites[CLR_BLACK] != hilites[CLR_BLUE]) + free(hilites[CLR_BLACK]); + + /* CLR_BLUE overlaps CLR_BRIGHT_BLUE, do not free */ + /* CLR_GREEN overlaps CLR_BRIGHT_GREEN, do not free */ + /* CLR_CYAN overlaps CLR_BRIGHT_CYAN, do not free */ + /* CLR_RED overlaps CLR_ORANGE, do not free */ + /* CLR_MAGENTA overlaps CLR_BRIGHT_MAGENTA, do not free */ + /* CLR_BROWN overlaps CLR_YELLOW, do not free */ + /* CLR_GRAY is a constant "", do not free */ + /* NO_COLOR is a constant "", do not free */ + free(hilites[CLR_BRIGHT_BLUE]); + free(hilites[CLR_BRIGHT_GREEN]); + free(hilites[CLR_BRIGHT_CYAN]); + free(hilites[CLR_YELLOW]); + free(hilites[CLR_ORANGE]); + free(hilites[CLR_BRIGHT_MAGENTA]); + free(hilites[CLR_WHITE]); +} + + # else /* UNIX && TERMINFO */ # ifndef TOS @@ -1011,7 +1093,6 @@ init_hilite() # endif # endif /* TOS */ } -# endif /* UNIX */ static void kill_hilite() @@ -1029,6 +1110,7 @@ kill_hilite() # endif return; } +# endif /* UNIX */ #endif /* TEXTCOLOR */ diff --git a/win/tty/wintty.c b/win/tty/wintty.c index afe0e204e..bffce05d7 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -56,7 +56,7 @@ struct window_procs tty_procs = { #if defined(SELECTSAVED) WC2_SELECTSAVED| #endif - 0L, + WC2_DARKGRAY, tty_init_nhwindows, tty_player_selection, tty_askname, From 6c58e7f03fecefc7f0ddd666d0f7df2b867fa408 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 29 Mar 2015 17:44:59 +0300 Subject: [PATCH 304/354] Kicking a grave may topple the gravestone ...with similar alignment hit as when digging up a grave. --- doc/fixes35.0 | 1 + src/dokick.c | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 0d7fb3cde..6d859ff4d 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -892,6 +892,7 @@ add messages for trying to pick up some terrain features boomerang makes noise when hitting a sink non-pet rust monsters would eat rust-proofed non-digestibles but ignore those non-digestibles otherwise +kicking a grave may topple the gravestone Platform- and/or Interface-Specific Fixes diff --git a/src/dokick.c b/src/dokick.c index 645eb5cf2..d558bdd38 100644 --- a/src/dokick.c +++ b/src/dokick.c @@ -991,7 +991,28 @@ dokick() exercise(A_DEX, TRUE); return(1); } - if(IS_GRAVE(maploc->typ) || maploc->typ == IRONBARS) + if (IS_GRAVE(maploc->typ)) { + if(Levitation) goto dumb; + if (rn2(4)) goto ouch; + exercise(A_WIS, FALSE); + if (Role_if(PM_ARCHEOLOGIST) || + Role_if(PM_SAMURAI) || + ((u.ualign.type == A_LAWFUL) && (u.ualign.record > -10))) { + adjalign(-sgn(u.ualign.type)); + } + maploc->typ = ROOM; + maploc->doormask = 0; + (void) mksobj_at(ROCK, x,y, TRUE, FALSE); + del_engr_at(x,y); + if (Blind) + pline("Crack! %s broke!", Something); + else { + pline_The("headstone topples over and breaks!"); + newsym(x,y); + } + return 1; + } + if(maploc->typ == IRONBARS) goto ouch; if(IS_TREE(maploc->typ)) { struct obj *treefruit; From 2c9ad065c18510152e963c198d3b09684e6bc563 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 29 Mar 2015 10:50:39 -0400 Subject: [PATCH 305/354] add data.base suggestion for whistle On 1/24/2014 6:48 AM, a bug reporter wrote: > The whistle in Nethack has no encyclopedia entry. I suggest for the next > release something from the M. R. James ghost story 'Oh, Whistle, and I'll Come > to You My Lad'. > --- dat/data.base | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dat/data.base b/dat/data.base index 6bca23177..57aea652e 100644 --- a/dat/data.base +++ b/dat/data.base @@ -5321,6 +5321,22 @@ web Oh what a tangled web we weave, When first we practise to deceive! [ Marmion, by Sir Walter Scott ] +whistle + There were legends both on the front and on the back of the + whistle. The one read thus: + + FLA FUR BIS FLE The other: QUIS EST ISTE QUI VENIT + 'I ought to be able to make it out,' he thought; + 'but I suppose I am a little rusty in my Latin. + When I come to think of it, I don't believe I even + know the word for a whistle. The long one does seem + simple enough. It ought to mean, "Who is this who is coming?" + + Well, the best way to find out is evidently to whistle + for him.' + + [Ghost Stories of an Antiquary, by Montague Rhodes James + 'Oh, Whistle, and I'll Come to You My Lad'] # werecritter -- see "lycanthrope" *wight When he came to himself again, for a moment he could recall From 411ee585939f3d1e6dc1b48854518d6832080de6 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 29 Mar 2015 22:08:46 +0300 Subject: [PATCH 306/354] Add more explicit helpless reasons Instead of just "while helpless", the death reason will tell more explicitly why the player was helpless. For example: "while frozen by a monster's gaze" --- doc/fixes35.0 | 1 + include/decl.h | 1 + src/apply.c | 6 +++++- src/artifact.c | 1 + src/decl.c | 1 + src/detect.c | 1 + src/dig.c | 1 + src/do_wear.c | 2 ++ src/dothrow.c | 1 + src/eat.c | 4 ++++ src/end.c | 7 ++++++- src/hack.c | 3 +++ src/mcastu.c | 2 ++ src/mhitu.c | 1 + src/pickup.c | 2 ++ src/polyself.c | 1 + src/potion.c | 4 ++++ src/pray.c | 3 +++ src/priest.c | 1 + src/sounds.c | 1 + src/spell.c | 3 +++ src/steal.c | 1 + src/timeout.c | 4 ++++ src/trap.c | 1 + src/uhitm.c | 3 +++ 25 files changed, 54 insertions(+), 2 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 6d859ff4d..03cb10a96 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1107,6 +1107,7 @@ cursor positioning ignores uninteresting dungeon features allow reading many more items when you're hiding under something a zap downward should not hit that something, while a zap upward should +show more explicit reason why player was helpless at death Platform- and/or Interface-Specific New Features diff --git a/include/decl.h b/include/decl.h index 15191842e..417ca9d62 100644 --- a/include/decl.h +++ b/include/decl.h @@ -28,6 +28,7 @@ E char SAVEP[]; E NEARDATA int bases[MAXOCLASSES]; E NEARDATA int multi; +E const char *multi_reason; E NEARDATA int nroom; E NEARDATA int nsubroom; E NEARDATA int occtime; diff --git a/src/apply.c b/src/apply.c index 6f13d6623..386365f49 100644 --- a/src/apply.c +++ b/src/apply.c @@ -737,8 +737,10 @@ struct obj *obj; pline("Yow! The %s stares back!", mirror); else pline("Yikes! You've frozen yourself!"); - if (!Hallucination || !rn2(4)) + if (!Hallucination || !rn2(4)) { nomul(-rnd(MAXULEV + 6 - u.ulevel)); + multi_reason = "gazing into a mirror"; + } nomovemsg = 0; /* default, "you can move again" */ } } else if (youmonst.data->mlet == S_VAMPIRE) @@ -916,6 +918,7 @@ struct obj **optr; break; case 2: /* no explanation; it just happens... */ nomovemsg = ""; + multi_reason = NULL; nomul(-rnd(2)); break; } @@ -1509,6 +1512,7 @@ int magic; /* 0=Physical, otherwise skill level */ teleds(cc.x, cc.y, TRUE); sokoban_guilt(); nomul(-1); + multi_reason = "jumping around"; nomovemsg = ""; morehungry(rnd(25)); return 1; diff --git a/src/artifact.c b/src/artifact.c index c9baaf365..81bfd4cf0 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -983,6 +983,7 @@ char *hittee; /* target's name: "you" or mon_nam(mdef) */ resisted = TRUE; } else { nomul(-3); + multi_reason = "being scared stiff"; nomovemsg = ""; if (magr && magr == u.ustuck && sticks(youmonst.data)) { u.ustuck = (struct monst *)0; diff --git a/src/decl.c b/src/decl.c index 75203c056..2df304575 100644 --- a/src/decl.c +++ b/src/decl.c @@ -21,6 +21,7 @@ char *catmore = 0; /* default pager */ NEARDATA int bases[MAXOCLASSES] = DUMMY; NEARDATA int multi = 0; +const char *multi_reason = NULL; NEARDATA int nroom = 0; NEARDATA int nsubroom = 0; NEARDATA int occtime = 0; diff --git a/src/detect.c b/src/detect.c index ecc4d3878..2af53021e 100644 --- a/src/detect.c +++ b/src/detect.c @@ -890,6 +890,7 @@ struct obj *obj; } You("peer into %s...", the(xname(obj))); nomul(-rnd(10)); + multi_reason = "gazing into a crystal ball"; nomovemsg = ""; if (obj->spe <= 0) pline_The("vision is unclear."); diff --git a/src/dig.c b/src/dig.c index fa25f76a0..f50d8aa76 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1023,6 +1023,7 @@ struct obj *obj; /* you ought to be able to let go; tough luck */ /* (maybe `move_into_trap()' would be better) */ nomul(-d(2,2)); + multi_reason = "stuck in a spider web"; nomovemsg = "You pull free."; } else if (lev->typ == IRONBARS) { pline("Clang!"); diff --git a/src/do_wear.c b/src/do_wear.c index 39d3b6c3f..ef04ee360 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -1407,6 +1407,7 @@ register struct obj *otmp; if(cursed(otmp)) return(0); if(delay) { nomul(delay); + multi_reason = "disrobing"; if (is_helmet(otmp)) { /* ick... */ nomovemsg = !strcmp(helm_simple_name(otmp), "hat") ? @@ -1664,6 +1665,7 @@ dowear() delay = -objects[otmp->otyp].oc_delay; if(delay){ nomul(delay); + multi_reason = "dressing up"; if(is_boots(otmp)) afternmv = Boots_on; if(is_helmet(otmp)) afternmv = Helmet_on; if(is_gloves(otmp)) afternmv = Gloves_on; diff --git a/src/dothrow.c b/src/dothrow.c index aedb4fc40..ab4b96497 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -693,6 +693,7 @@ hurtle(dx, dy, range, verbose) if(!range || (!dx && !dy) || u.ustuck) return; /* paranoia */ nomul(-range); + multi_reason = "moving through the air"; nomovemsg = ""; /* it just happens */ if (verbose) You("%s in the opposite direction.", range > 1 ? "hurtle" : "float"); diff --git a/src/eat.c b/src/eat.c index a5b413772..cc87f399e 100644 --- a/src/eat.c +++ b/src/eat.c @@ -962,6 +962,7 @@ register int pm; /* A pile of gold can't ride. */ if (u.usteed) dismount_steed(DISMOUNT_FELL); nomul(-tmp); + multi_reason = "pretending to be a pile of gold"; Sprintf(buf, Hallucination ? "You suddenly dread being peeled and mimic %s again!" : "You now prefer mimicking %s again.", @@ -1479,6 +1480,7 @@ struct obj *obj; pline_The("world spins and %s %s.", what, where); incr_itimeout(&HDeaf, duration); nomul(-duration); + multi_reason = "unconscious from rotten food"; nomovemsg = "You are conscious again."; afternmv = Hear_again; return(1); @@ -2677,6 +2679,7 @@ boolean incr; if (!Levitation) selftouch("Falling, you"); incr_itimeout(&HDeaf, duration); nomul(-duration); + multi_reason = "fainted from lack of food"; nomovemsg = "You regain consciousness."; afternmv = unfaint; newhs = FAINTED; @@ -2853,6 +2856,7 @@ vomit() /* A good idea from David Neves */ else make_sick(0L, (char *)0, TRUE, SICK_VOMITABLE); nomul(-2); + multi_reason = "vomiting"; nomovemsg = You_can_move_again; } diff --git a/src/end.c b/src/end.c index 7ada39767..35a5393bd 100644 --- a/src/end.c +++ b/src/end.c @@ -465,7 +465,12 @@ int how; Sprintf(eos(buf), " called %s", MNAME(mtmp)); } - if (multi) Strcat(buf, ", while helpless"); + if (multi) { + if (multi_reason) + Sprintf(eos(buf), ", while %s", multi_reason); + else + Strcat(buf, ", while helpless"); + } Strcpy(killer.name, buf); if (mptr->mlet == S_WRAITH) u.ugrave_arise = PM_WRAITH; diff --git a/src/hack.c b/src/hack.c index 98e615ac8..32ceb8e69 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1568,6 +1568,7 @@ domove() /* must come after we finished picking up, in spoteffects() */ if (cause_delay) { nomul(-2); + multi_reason = "dragging an iron ball"; nomovemsg = ""; } @@ -2434,6 +2435,7 @@ nomul(nval) u.uinvulnerable = FALSE; /* Kludge to avoid ctrl-C bug -dlc */ u.usleep = 0; multi = nval; + if (nval == 0) multi_reason = NULL; context.travel = context.travel1 = context.mv = context.run = 0; } @@ -2448,6 +2450,7 @@ const char *msg_override; if (*nomovemsg) pline1(nomovemsg); nomovemsg = 0; u.usleep = 0; + multi_reason = NULL; if (afternmv) (*afternmv)(); afternmv = 0; } diff --git a/src/mcastu.c b/src/mcastu.c index a677db12e..03c06f2ed 100644 --- a/src/mcastu.c +++ b/src/mcastu.c @@ -634,12 +634,14 @@ int spellnum; if (multi >= 0) You("stiffen briefly."); nomul(-1); + multi_reason = "paralyzed by a monster"; } else { if (multi >= 0) You("are frozen in place!"); dmg = 4 + (int)mtmp->m_lev; if (Half_spell_damage) dmg = (dmg + 1) / 2; nomul(-dmg); + multi_reason = "paralyzed by a monster"; } nomovemsg = 0; dmg = 0; diff --git a/src/mhitu.c b/src/mhitu.c index 6aa4225f7..9ec602895 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -1053,6 +1053,7 @@ dopois: else You("are frozen by %s!", mon_nam(mtmp)); nomovemsg = You_can_move_again; nomul(-rnd(10)); + multi_reason = "paralyzed by a monster"; exercise(A_DEX, FALSE); } } diff --git a/src/pickup.c b/src/pickup.c index d2a76416c..bf5d06129 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -2121,6 +2121,7 @@ int held; /* even if the trap fails, you've used up this turn */ if (multi >= 0) { /* in case we didn't become paralyzed */ nomul(-1); + multi_reason = "opening a container"; nomovemsg = ""; } return 1; @@ -2630,6 +2631,7 @@ struct obj *box; /* or bag */ /* even if the trap fails, you've used up this turn */ if (multi >= 0) { /* in case we didn't become paralyzed */ nomul(-1); + multi_reason = "tipping a container"; nomovemsg = ""; } } else if (box->otyp == BAG_OF_TRICKS || box->otyp == HORN_OF_PLENTY) { diff --git a/src/polyself.c b/src/polyself.c index 3effba8b2..023b1f44a 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -1285,6 +1285,7 @@ dogaze() -d((int)mtmp->m_lev+1, (int)mtmp->data->mattk[0].damd) : -200); + multi_reason = "frozen by a monster's gaze"; nomovemsg = 0; return 1; } else diff --git a/src/potion.c b/src/potion.c index d9e5e9ca8..d32c65b65 100644 --- a/src/potion.c +++ b/src/potion.c @@ -375,6 +375,7 @@ ghost_from_bottle() if(flags.verbose) You("are frightened to death, and unable to move."); nomul(-3); + multi_reason = "being frightened to death"; nomovemsg = "You regain your composure."; } @@ -678,6 +679,7 @@ peffects(otmp) Your("%s are frozen to the %s!", makeplural(body_part(FOOT)), surface(u.ux, u.uy)); nomul(-(rn1(10, 25 - 12*bcsign(otmp)))); + multi_reason = "frozen by a potion"; nomovemsg = You_can_move_again; exercise(A_DEX, FALSE); } @@ -1467,6 +1469,7 @@ register struct obj *obj; if (!Free_action) { pline("%s seems to be holding you.", Something); nomul(-rnd(5)); + multi_reason = "frozen by a potion"; nomovemsg = You_can_move_again; exercise(A_DEX, FALSE); } else You("stiffen momentarily."); @@ -1476,6 +1479,7 @@ register struct obj *obj; if (!Free_action && !Sleep_resistance) { You_feel("rather tired."); nomul(-rnd(5)); + multi_reason = "sleeping off a magical draught"; nomovemsg = You_can_move_again; exercise(A_DEX, FALSE); } else You("yawn."); diff --git a/src/pray.c b/src/pray.c index ffdee9b49..bd95018c4 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1269,6 +1269,7 @@ dosacrifice() dmon->mpeaceful = TRUE; You("are terrified, and unable to move."); nomul(-3); + multi_reason = "being terrified of a demon"; nomovemsg = 0; } else pline_The("%s.", demonless_msg); } @@ -1655,6 +1656,7 @@ dopray() } } nomul(-3); + multi_reason = "praying"; nomovemsg = "You finish your prayer."; afternmv = prayer_done; @@ -1817,6 +1819,7 @@ doturn() } } nomul(-5); + multi_reason = "trying to turn the monsters"; nomovemsg = You_can_move_again; return(1); } diff --git a/src/priest.c b/src/priest.c index a28f2b8d4..0b520cfdf 100644 --- a/src/priest.c +++ b/src/priest.c @@ -475,6 +475,7 @@ int roomno; if (flags.verbose) You("are frightened to death, and unable to move."); nomul(-3); + multi_reason = "being terrified of a demon"; nomovemsg = "You regain your composure."; } } diff --git a/src/sounds.c b/src/sounds.c index d8d78b4cc..f1dec986f 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -710,6 +710,7 @@ register struct monst *mtmp; pline("%s rattles noisily.", Monnam(mtmp)); You("freeze for a moment."); nomul(-2); + multi_reason = "scared by rattling"; nomovemsg = 0; break; case MS_LAUGH: diff --git a/src/spell.c b/src/spell.c index 53b8626f0..5ce0a6015 100644 --- a/src/spell.c +++ b/src/spell.c @@ -329,6 +329,7 @@ learn(VOID_ARGS) context.spbook.book = 0; /* no longer studying */ context.spbook.o_id = 0; nomul(context.spbook.delay); /* remaining delay is uninterrupted */ + multi_reason = "reading a book"; nomovemsg = 0; context.spbook.delay = 0; return(0); @@ -506,6 +507,7 @@ register struct obj *spellbook; boolean gone = cursed_book(spellbook); nomul(context.spbook.delay); /* study time */ + multi_reason = "reading a book"; nomovemsg = 0; context.spbook.delay = 0; if(gone || !rn2(3)) { @@ -522,6 +524,7 @@ register struct obj *spellbook; spellbook->in_use = FALSE; } nomul(context.spbook.delay); + multi_reason = "reading a book"; nomovemsg = 0; context.spbook.delay = 0; return(1); diff --git a/src/steal.c b/src/steal.c index c73878310..f803ae4da 100644 --- a/src/steal.c +++ b/src/steal.c @@ -361,6 +361,7 @@ gotobj: named++; /* the following is to set multi for later on */ nomul(-armordelay); + multi_reason = "taking off clothes"; nomovemsg = 0; remove_worn_item(otmp, TRUE); otmp->cursed = curssv; diff --git a/src/timeout.c b/src/timeout.c index e47d863fb..e1ccaf96e 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -51,6 +51,7 @@ stoned_dialogue() case 3: /* limbs turned to stone */ stop_occupation(); nomul(-3); /* can't move anymore */ + multi_reason = "getting stoned"; nomovemsg = You_can_move_again; /* not unconscious */ break; default: @@ -377,6 +378,7 @@ nh_timeout() if (u.umoved && !Levitation) { slip_or_trip(); nomul(-2); + multi_reason = "fumbling"; nomovemsg = ""; /* The more you are carrying the more likely you * are to make noise when you fumble. Adjustments @@ -409,6 +411,7 @@ boolean wakeup_msg; { stop_occupation(); nomul(how_long); + multi_reason = "sleeping"; /* generally don't notice sounds while sleeping */ if (wakeup_msg && multi == how_long) { /* caller can follow with a direct call to Hear_again() if @@ -1271,6 +1274,7 @@ do_storms() if(!u.uinvulnerable) { stop_occupation(); nomul(-3); + multi_reason = "hiding from thunderstorm"; nomovemsg = 0; } } else diff --git a/src/trap.c b/src/trap.c index 47d8d99b2..775bca5cb 100644 --- a/src/trap.c +++ b/src/trap.c @@ -4447,6 +4447,7 @@ boolean disarm; if (!Free_action) { pline("Suddenly you are frozen in place!"); nomul(-d(5, 6)); + multi_reason = "frozen by a trap"; exercise(A_DEX, FALSE); nomovemsg = You_can_move_again; } else You("momentarily stiffen."); diff --git a/src/uhitm.c b/src/uhitm.c index 80f38addf..2bf963c94 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1871,6 +1871,7 @@ register struct attack *mattk; You("digest %s.", mon_nam(mdef)); if (Slow_digestion) tmp *= 2; nomul(-tmp); + multi_reason = "digesting something"; nomovemsg = msgbuf; } else pline1(msgbuf); if (pd == &mons[PM_GREEN_SLIME]) { @@ -2353,6 +2354,7 @@ boolean wep_was_destroyed; You("are frozen by %s gaze!", s_suffix(mon_nam(mon))); nomul((ACURR(A_WIS) > 12 || rn2(4)) ? -tmp : -127); + multi_reason = "frozen by a monster's gaze"; nomovemsg = 0; } } else { @@ -2366,6 +2368,7 @@ boolean wep_was_destroyed; You("are frozen by %s!", mon_nam(mon)); nomovemsg = You_can_move_again; nomul(-tmp); + multi_reason = "frozen by a monster"; exercise(A_DEX, FALSE); } break; From 94256853c63844c674ed59ff4eac4479e7a892ad Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sun, 29 Mar 2015 18:20:26 -0400 Subject: [PATCH 307/354] Fix a compiler warning. --- win/tty/wintty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win/tty/wintty.c b/win/tty/wintty.c index bffce05d7..8c8f5294c 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 wintty.c $NHDT-Date: 1427505884 2015/03/28 01:24:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.73 $ */ +/* NetHack 3.5 wintty.c $NHDT-Date: 1427667623 2015/03/29 22:20:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.75 $ */ /* NetHack 3.5 wintty.c $Date: 2012/01/22 06:27:09 $ $Revision: 1.66 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -1657,7 +1657,7 @@ struct WinDesc *cw; boolean on_curr_page = FALSE; int lineno = 0; tty_getlin("Search for:", tmpbuf); - if (!tmpbuf || tmpbuf[0] == '\033') break; + if (!tmpbuf[0] || tmpbuf[0] == '\033') break; Sprintf(searchbuf, "*%s*", tmpbuf); for (curr = cw->mlist; curr; curr = curr->next) { if (on_curr_page) lineno++; From 2a9c913c1c818106a583c989f4d38412a0775aec Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sun, 29 Mar 2015 19:10:46 -0400 Subject: [PATCH 308/354] Add new hallucinatory gods. --- doc/fixes35.0 | 1 + src/pray.c | 66 ++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 56 insertions(+), 11 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 03cb10a96..507480768 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1108,6 +1108,7 @@ allow reading many more items when you're hiding under something a zap downward should not hit that something, while a zap upward should show more explicit reason why player was helpless at death +added new hallucinatory-only gods Platform- and/or Interface-Specific New Features diff --git a/src/pray.c b/src/pray.c index bd95018c4..20e5d348d 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 pray.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 pray.c $NHDT-Date: 1427670643 2015/03/29 23:10:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.69 $ */ /* NetHack 3.5 pray.c $Date: 2012/05/07 01:44:38 $ $Revision: 1.62 $ */ /* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1863,26 +1863,70 @@ aligntyp alignment; return gnam; } +static const char *hallu_gods[] = { + "the Flying Spaghetti Monster", /* Church of the FSM */ + "Eris", /* Discordianism */ + "the Martians", /* every science fiction ever */ + "Xom", /* Crawl */ + "AnDoR dRaKoN", /* ADOM */ + "the Central Bank of Yendor", /* economics */ + "Tooth Fairy", /* real world(?) */ + "Om", /* Discworld */ + "Yawgmoth", /* Magic: the Gathering */ + "Morgoth", /* LoTR */ + "Cthulhu", /* Lovecraft */ + "the Ori", /* Stargate */ + "destiny", /* why not? */ + "your Friend the Computer", /* Paranoia */ +}; + /* hallucination handling for priest/minion names: select a random god iff character is hallucinating */ const char * halu_gname(alignment) aligntyp alignment; { - const char *gnam; + const char *gnam = NULL; int which; - if (!Hallucination) return align_gname(alignment); + if (!Hallucination) + return align_gname(alignment); - which = randrole(); - switch (rn2(3)) { - case 0: gnam = roles[which].lgod; break; - case 1: gnam = roles[which].ngod; break; - case 2: gnam = roles[which].cgod; break; - default: gnam = 0; break; /* lint suppression */ + /* The priest may not have initialized god names. If this is the + * case, and we roll priest, we need to try again. */ + do + which = randrole(); + while (!roles[which].lgod); + + switch (rn2(9)) { + case 0: + case 1: + gnam = roles[which].lgod; + break; + case 2: + case 3: + gnam = roles[which].ngod; + break; + case 4: + case 5: + gnam = roles[which].cgod; + break; + case 6: + case 7: + gnam = hallu_gods[rn2(sizeof hallu_gods / sizeof *hallu_gods)]; + break; + case 8: + gnam = Moloch; + break; + default: + impossible("rn2 broken in halu_gname?!?"); } - if (!gnam) gnam = Moloch; - if (*gnam == '_') ++gnam; + if (!gnam) { + impossible("No random god name?"); + gnam = "your Friend the Computer"; /* Paranoia */ + } + if (*gnam == '_') + ++gnam; return gnam; } From 5a90f5f3666f1527122e2c169aabf80750939b64 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 29 Mar 2015 20:07:41 -0400 Subject: [PATCH 309/354] fix some compiler warnings windows cmdline Changes to be committed: modified: src/hack.c modified: src/vision.c --- src/hack.c | 2 +- src/vision.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hack.c b/src/hack.c index 32ceb8e69..5e14a3fab 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1104,7 +1104,7 @@ domove() register struct monst *mtmp; register struct rm *tmpr; register xchar x,y; - struct trap *trap; + struct trap *trap = (struct trap *)0; int wtcap; boolean on_ice; xchar chainx, chainy, ballx, bally; /* ball&chain new positions */ diff --git a/src/vision.c b/src/vision.c index a6585de14..8abf63c79 100644 --- a/src/vision.c +++ b/src/vision.c @@ -2198,9 +2198,9 @@ right_side(row, left, right_mark, limits) int deeper; /* if TRUE, call self as needed */ int result; /* set by q?_path() */ register int i; /* loop counter */ - register char *rowp; /* row optimization */ - char *row_min; /* left most [used by macro set_min()] */ - char *row_max; /* right most [used by macro set_max()] */ + register char *rowp = NULL; /* row optimization */ + char *row_min = NULL; /* left most [used by macro set_min()] */ + char *row_max = NULL; /* right most [used by macro set_max()] */ int lim_max; /* right most limit of circle */ #ifdef GCC_WARN @@ -2374,8 +2374,8 @@ left_side(row, left_mark, right, limits) { int left, left_edge, nrow, deeper, result; register int i; - register char *rowp; - char *row_min, *row_max; + register char *rowp = NULL; + char *row_min = NULL, *row_max = NULL; int lim_min; #ifdef GCC_WARN From 07518420835d5a3b2f6af70125b51dae57339787 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 29 Mar 2015 20:28:38 -0400 Subject: [PATCH 310/354] clean up cmdline Makefile for VS2010,VS2013,... VS2010 tested ok. VS2013 tested ok. VS2015 generated a _lot_ of linker warnings building NetHack, but it built. --- sys/winnt/Makefile.msc | 235 +++++++++++++++++++---------------------- 1 file changed, 107 insertions(+), 128 deletions(-) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index a1dfdbcd8..29c781ea7 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -1,4 +1,4 @@ -# NetHack 3.5 Makefile.msc $NHDT-Date: 1426967393 2015/03/21 19:49:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.72 $ */ +# NetHack 3.5 Makefile.msc $NHDT-Date: 1427675315 2015/03/30 00:28:35 $ $NHDT-Branch: master $:$NHDT-Revision: 1.73 $ */ # Copyright (c) NetHack PC Development Team 1993-2015 # #============================================================================== @@ -133,72 +133,11 @@ cc=cl link=link rc=Rc -# -#============================================= -# Visual Studio versions >= 2013 specific stuff -#============================================= - -!IF "$(TARGET_CPU)" == "" -TARGET_CPU=x86 -!ENDIF - -# Common compiler flags: -# -c - compile without linking -# -W3 - Set warning level to level 3 (-W4 for 64-bit compilations) -# -Zi - generate debugging information -# -Od - disable all optimizations -# -Ox - use maximum optimizations -# -Zd - generate only public symbols and line numbers for debugging -# -GS - enable security checks -# -ccommon=-c $(CDBFLAG) -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -c -lflags=/INCREMENTAL:NO /NOLOGO - -!IF "$(TARGET_CPU)" == "x86" -cflags = $(ccommon) -D_X86_=1 -DWIN32 -D_WIN32 -W3 -scall = -Gz - -!ELSEIF "$(TARGET_CPU)" == "x64" -cflags = $(ccommon) -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -cflags = $(cflags) -W4 -scall = -!ENDIF - -# declarations for use on Intel x86 systems -!IF "$(TARGET_CPU)" == "x86" -DLLENTRY = @12 -!ENDIF - -# declarations for use on AMD64 systems -!IF "$(TARGET_CPU)" == "x64" -DLLENTRY = -!ENDIF - -# for Windows applications -conlflags = $(lflags) -subsystem:console,$(EXEVER) -guilflags = $(lflags) -subsystem:windows,$(EXEVER) -dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll - -# basic subsystem specific libraries, less the C Run-Time -baselibs = kernel32.lib $(optlibs) $(winsocklibs) advapi32.lib -winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib - -# for Windows applications that use the C Run-Time libraries -conlibs = $(baselibs) -guilibs = $(winlibs) -# -# End of VS2013 and greater stuff -#============================================= - # #========================================== # Exe File Info. #========================================== -# -# For the level compiler bits, -# we just defer to win\win32\dgnstuff.mak -# and win\win32\levstuff.mak # # # Optional high-quality BSD random number generation routines @@ -271,44 +210,90 @@ DLBFLG = #========================================== #========================================== -INCLDIR= /I..\include +!IF "$(TARGET_CPU)" == "" +TARGET_CPU=x86 +!ENDIF + +!IF "$(_NMAKE_VER)" == "10.00.40219.01" +CL2013= +!ELSE +! IF ($(VSVER) > 2010) +CL2013=-sdl +! ENDIF +!ENDIF + +ccommon= -c -nologo -D"_CONSOLE" -D"_CRT_NONSTDC_NO_DEPRECATE" -D"_CRT_SECURE_NO_DEPRECATE" \ + -D"_LIB" -D"_SCL_SECURE_NO_DEPRECATE" -D"_VC80_UPGRADE=0x0600" -D"DLB" -D"_MBCS" \ + -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -D"NDEBUG" -D"YY_NO_UNISTD_H" -EHsc -fp:precise -Gd -GF -GS -Gy \ + $(CL2013) -WX- -Zc:forScope -Zc:wchar_t -Zi +cdebug= -analyze- -D"_DEBUG" -Gm -MTd -RTC1 -Od +crelease= -analyze- -D"_MBCS" -errorReport:prompt -GL -Gm- -MT -O2 -Ot -Ox -Oy + +lcommon= /NOLOGO /INCREMENTAL:NO !IF "$(DEBUGINFO)" == "Y" -CDBGFLAG=-Zi -LDBGFLAG=/debug -cdebug = -Zi -Od ldebug = /DEBUG +cflags1=$(ccommon) $(cdebug) +lflags1=$(lcommon) $(ldebug) !ELSE -CDBGFLAG= -LDBGFLAG= -ldebug = -cdebug = +ldebug= +cflags1=$(ccomon) $(crelease) +lflags1=$(lcommon) $(ldebug) !ENDIF -!IF ("$(ldebug)" != "") -!IF ("$(ldebug)" != "/RELEASE") -ldebug = /DEBUG -!ENDIF +lflags= $(lflags1) + +!IF "$(TARGET_CPU)" == "x86" +cflags = $(cflags1) -D_X86_=1 -DWIN32 -D_WIN32 -W3 +scall = -Gz + +!ELSEIF "$(TARGET_CPU)" == "x64" +cflags = $(cflags1) -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32 -W4 +scall = !ENDIF -!IF ("$(cdebug)" != "") -!IF ("$(cdebug)" != "-Ox -DNDEBUG") -cdebug = -Zi -Od -!ENDIF +!IF "$(_NMAKE_VER)" == "10.00.40219.01" +cflags = $(cflags:-W4=-W3) !ENDIF -cflags2 = $(cflags:-W4=-W3) -#More verbose below -#cflags2 = $(cflags) -wd4131 -#cflags2 = $(cflags:-W4=-Wall) +#More verbose warning output options below +#cflags = $(cflags:-W4=-wd4131 +#cflags = $(cflags:-W4=-Wall) +#cflags = $(cflags:-W3=-wd4131 +#cflags = $(cflags:-W3=-Wall) + +# declarations for use on Intel x86 systems +!IF "$(TARGET_CPU)" == "x86" +DLLENTRY = @12 +!ENDIF + +# declarations for use on AMD64 systems +!IF "$(TARGET_CPU)" == "x64" +DLLENTRY = +!ENDIF + +# for Windows applications +conlflags = $(lflags) -subsystem:console,$(EXEVER) +guilflags = $(lflags) -subsystem:windows,$(EXEVER) +dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll + +# basic subsystem specific libraries, less the C Run-Time +baselibs = kernel32.lib $(optlibs) $(winsocklibs) advapi32.lib +winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib + +# for Windows applications that use the C Run-Time libraries +conlibs = $(baselibs) +guilibs = $(winlibs) +# + +INCLDIR= /I..\include #========================================== # Util builds #========================================== -cflagsUtil = $(cdebug) $(cflags2) $(INCLDIR) \ - $(WINPFLAG) $(DLBFLG) -lflagsUtil = $(ldebug) $(lflags) $(conlibs) +cflagsUtil = $(cflags) $(INCLDIR) $(WINPFLAG) $(DLBFLG) +lflagsUtil = $(lflags) $(conlibs) #========================================== # - Game build @@ -320,15 +305,13 @@ LIBS= user32.lib winmm.lib $(ZLIB) !IF ("$(GRAPHICAL)"=="Y") -cflagsGame = $(cdebug) $(cflags2) $(guiflags) $(INCLDIR) \ - $(WINPFLAG) $(DLBFLG) -lflagsGame = $(ldebug) $(lflags) $(guilibs) $(GAMEPDBFILE) $(GAMEMAPFILE) +cflagsGame = $(cflags) $(guiflags) $(INCLDIR) $(WINPFLAG) $(DLBFLG) +lflagsGame = $(lflags) $(guilibs) $(GAMEPDBFILE) $(GAMEMAPFILE) !ELSE -cflagsGame = $(cdebug) $(cflags2) $(conflags) $(INCLDIR) \ - $(WINPFLAG) $(DLBFLG) -lflagsGame = $(ldebug) $(lflags) $(conlibs) $(GAMEPDBFILE) $(GAMEMAPFILE) +cflagsGame = $(cflags) $(conflags) $(INCLDIR) $(WINPFLAG) $(DLBFLG) +lflagsGame = $(lflags) $(conlibs) $(GAMEPDBFILE) $(GAMEMAPFILE) !ENDIF @@ -429,21 +412,15 @@ U = $(UTIL)^\ # Utility Objects. # -MAKESRC = $(U)makedefs.c +MAKESRC = $(U)makedefs.c -MAKEOBJS = $(O)makedefs.o $(O)monst.o $(O)objects.o +MAKEOBJS = $(O)makedefs.o $(O)monst.o $(O)objects.o -#SPLEVOBJS = $(O)lev_yacc.o $(O)lev_lex.o $(O)lev_main.o \ -# $(O)alloc.o $(O)decl.o $(O)drawing.o \ -# $(O)monst.o $(O)objects.o $(O)panic.o - -SPLEVOBJS = $(O)lev_yacc.o $(O)lev_lex.o $(O)lev_main.o \ - $(O)alloc.o $(O)decl.o $(O)drawing.o \ - $(O)monst.o $(O)objects.o $(O)panic.o - -DGNCOMPOBJS = $(O)dgn_yacc.o $(O)dgn_lex.o $(O)dgn_main.o \ - $(O)alloc.o $(O)panic.o +LEVCOMPOBJS = $(O)lev_yacc.o $(O)lev_lex.o $(O)lev_main.o \ + $(O)alloc.o $(O)decl.o $(O)drawing.o $(O)monst.o $(O)objects.o $(O)panic.o +DGNCOMPOBJS = $(O)dgn_yacc.o $(O)dgn_lex.o $(O)dgn_main.o \ + $(O)alloc.o $(O)panic.o RECOVOBJS = $(O)recover.o @@ -703,7 +680,7 @@ $(NHRES): $(MSWSYS)\console.rc $(MSWSYS)\NetHack.ico $(GAMEFILE) : $(ALLOBJ) $(NHRES) $(O)gamedir.tag $(WINDLLS) @if not exist $(GAMEDIR)\*.* mkdir $(GAMEDIR) - @echo Linking.... + @echo Linking $@ $(link) $(lflagsGame) /STACK:2048 $(LIBS) $(COMCTRL) -out:$@ @<<$(GAME).lnk $(ALLOBJ:^ =^ ) $(NHRES) @@ -781,12 +758,14 @@ $(GAMEDIR)\nhraykey.dll : $(O)$(@B).o $(O)gamedir.tag $(O)$(@B).def # Makedefs Stuff #========================================== $(U)nhsizes.exe: $(O)nhsizes.o + @echo Linking $@ $(link) $(lflagsUtil) -out:$@ $(O)nhsizes.o $(O)panic.o $(O)alloc.o $(O)nhsizes.o: $(CONFIG_H) nhsizes.c @$(CC) $(cflagsUtil) -Fo$@ nhsizes.c $(U)makedefs.exe: $(MAKEOBJS) + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(MAKEOBJS) $(O)makedefs.o: $(CONFIG_H) $(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\objclass.h \ @@ -794,7 +773,7 @@ $(O)makedefs.o: $(CONFIG_H) $(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\objcla $(U)makedefs.c @if not exist $(OBJ)\*.* echo creating directory $(OBJ) @if not exist $(OBJ)\*.* mkdir $(OBJ) - $(CC) $(cflagsUtil) -Fo$@ $(U)makedefs.c + @$(CC) $(cflagsUtil) -Fo$@ $(U)makedefs.c # # date.h should be remade every time any of the source or include @@ -835,6 +814,7 @@ $(DAT)\bogusmon: $(DAT)\bogusmon.txt $(U)makedefs.exe #========================================== $(U)uudecode.exe: $(O)uudecode.o + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(O)uudecode.o $(O)uudecode.o: $(SSYS)\uudecode.c @@ -890,24 +870,20 @@ $(WIN32)\splash.bmp: $(U)uudecode.exe $(WIN32)\splash.uu $(U)lev_yacc.c $(INCL)\lev_comp.h: $(U)lev_comp.y nmake -nologo -f ..\win\win32\levstuff.mak default -LEVCFLAGS=-c -nologo -DWIN32 -D_WIN32 -I$(INCL) -nologo -Z7 -Od -DDLB - $(O)lev_yacc.o: $(HACK_H) $(SP_LEV_H) $(INCL)\lev_comp.h $(U)lev_yacc.c - $(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_yacc.c + @$(CC) $(cflagsUtil) -Fo$@ $(U)lev_yacc.c -$(O)lev_lex.o: $(HACK_H) $(INCL)\lev_comp.h $(SP_LEV_H) \ +$(O)lev_lex.o: $(HACK_H) $(INCL)\lev_comp.h $(SP_LEV_H) \ $(U)lev_lex.c - $(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_lex.c + @$(CC) $(cflagsUtil) -Fo$@ $(U)lev_lex.c -$(O)lev_main.o: $(U)lev_main.c $(HACK_H) $(SP_LEV_H) - $(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_main.c +$(O)lev_main.o: $(U)lev_main.c $(HACK_H) $(SP_LEV_H) + @$(CC) $(cflagsUtil) -Fo$@ $(U)lev_main.c -$(U)levcomp.exe: $(SPLEVOBJS) - @echo Linking $@... - echo $(link) - echo $(lflagsUtil) - $(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk - $(SPLEVOBJS:^ =^ +$(U)levcomp.exe: $(LEVCOMPOBJS) + @echo Linking $@ + @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk + $(LEVCOMPOBJS:^ =^ ) << @@ -921,17 +897,17 @@ $(U)dgn_yacc.c $(INCL)\dgn_comp.h : $(U)dgn_comp.y nmake -nologo -f ..\win\win32\dgnstuff.mak default $(O)dgn_yacc.o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h $(U)dgn_yacc.c - @$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_yacc.c + @$(CC) $(cflagsUtil) -Fo$@ $(U)dgn_yacc.c $(O)dgn_lex.o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h \ $(U)dgn_lex.c - @$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_lex.c + @$(CC) $(cflagsUtil) -Fo$@ $(U)dgn_lex.c $(O)dgn_main.o: $(HACK_H) $(U)dgn_main.c - @$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_main.c + @$(CC) $(cflagsUtil) -Fo$@ $(U)dgn_main.c $(U)dgncomp.exe: $(DGNCOMPOBJS) - @echo Linking $@... + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk $(DGNCOMPOBJS:^ =^ ) @@ -989,6 +965,7 @@ $(INCL)\win32api.h: $(MSWSYS)\win32api.h #========================================== $(U)dlb_main.exe: $(DLBOBJ) $(O)dlb.o + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk $(O)dlb_main.o $(O)dlb.o @@ -1038,10 +1015,11 @@ nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \ #========================================== $(U)recover.exe: $(RECOVOBJS) + @echo Linking $@ $(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(RECOVOBJS) $(O)recover.o: $(CONFIG_H) $(U)recover.c $(INCL)\win32api.h - $(CC) $(cflagsUtil) -Fo$@ $(U)recover.c + @$(CC) $(cflagsUtil) -Fo$@ $(U)recover.c #========================================== # Tile Mapping @@ -1052,6 +1030,7 @@ $(SRC)\tile.c: $(U)tilemap.exe @$(U)tilemap $(U)tilemap.exe: $(O)tilemap.o + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(O)tilemap.o $(O)tilemap.o: $(WSHR)\tilemap.c $(HACK_H) @@ -1083,7 +1062,7 @@ $(O)tilete32.o: $(WSHR)\tiletext.c $(CONFIG_H) $(TILE_H) #========================================== $(U)gif2txt.exe: $(GIFREADERS) $(TEXT_IO) - @echo Linking $@... + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk $(GIFREADERS:^ =^ ) @@ -1092,7 +1071,7 @@ $(U)gif2txt.exe: $(GIFREADERS) $(TEXT_IO) << $(U)gif2tx32.exe: $(GIFREADERS32) $(TEXT_IO32) - @echo Linking $@... + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk $(GIFREADERS32:^ =^ ) @@ -1101,7 +1080,7 @@ $(U)gif2tx32.exe: $(GIFREADERS32) $(TEXT_IO32) << $(U)txt2ppm.exe: $(PPMWRITERS) $(TEXT_IO) - @echo Linking $@... + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk $(PPMWRITERS:^ =^ ) @@ -1123,7 +1102,7 @@ $(TILEBMP32): !ENDIF $(U)tile2bmp.exe: $(O)tile2bmp.o $(TEXT_IO) - @echo Linking $@... + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk $(O)tile2bmp.o $(TEXT_IO:^ =^ @@ -1131,7 +1110,7 @@ $(U)tile2bmp.exe: $(O)tile2bmp.o $(TEXT_IO) << $(U)til2bm32.exe: $(O)til2bm32.o $(TEXT_IO32) - @echo Linking $@... + @echo Linking $@ @$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk $(O)til2bm32.o $(TEXT_IO32:^ =^ From 6ab783b05b5b4af1002f73671047c4bcc81417f9 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 29 Mar 2015 21:00:50 -0400 Subject: [PATCH 311/354] cmdline Makefile updates --- sys/winnt/Makefile.msc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 29c781ea7..66449cd9e 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -1,4 +1,4 @@ -# NetHack 3.5 Makefile.msc $NHDT-Date: 1427675315 2015/03/30 00:28:35 $ $NHDT-Branch: master $:$NHDT-Revision: 1.73 $ */ +# NetHack 3.5 Makefile.msc $NHDT-Date: 1426967393 2015/03/21 19:49:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.72 $ */ # Copyright (c) NetHack PC Development Team 1993-2015 # #============================================================================== From e305b8a51ed6ec5effd9314e9300aa93b2c411e5 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 30 Mar 2015 17:09:12 +0300 Subject: [PATCH 312/354] New T-shirt texts, bogusmon, one YAFM --- dat/bogusmon.txt | 3 +++ src/eat.c | 2 ++ src/read.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/dat/bogusmon.txt b/dat/bogusmon.txt index 2ec3e7fe7..59bfdbe3a 100644 --- a/dat/bogusmon.txt +++ b/dat/bogusmon.txt @@ -245,6 +245,9 @@ flying pig hippocampus hippogriff kelpie +catoblepas +phoenix +amphisbaena # Unusually animate body parts bouncing eye diff --git a/src/eat.c b/src/eat.c index cc87f399e..cb92f16c1 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1574,6 +1574,8 @@ eatcorpse(otmp) /* called when a corpse is selected as food */ } else if ((mnum == PM_COCKATRICE || mnum == PM_CHICKATRICE) && (Stone_resistance || Hallucination)) { pline("This tastes just like chicken!"); + } else if (mnum == PM_FLOATING_EYE && u.umonnum == PM_RAVEN) { + You("peck the eyeball with delight."); } else { /* [is this right? omnivores end up always disliking the taste] */ boolean yummy = (vegan(&mons[mnum]) ? diff --git a/src/read.c b/src/read.c index aa7a20508..9d8cac038 100644 --- a/src/read.c +++ b/src/read.c @@ -88,6 +88,55 @@ char *buf; "Don't Panic", /* HHGTTG */ "Furinkan High School Athletic Dept.", /* Ranma 1/2 */ "Hel-LOOO, Nurse!", /* Animaniacs */ + "=^.^=", + "100% goblin hair - do not wash", + "Aberzombie and Fitch", + "cK -- Cockatrice touches the Kop", + "Don't ask me, I only adventure here", + "Down with pants!", + "d, your dog or a killer?", + "FREE PUG AND NEWT!", + "Go team ant!", + "Got newt?", + "Hello, my darlings!", /* Charlie Drake */ + "Hey! Nymphs! Steal This T-Shirt!", + "I <3 Dungeon of Doom", + "I <3 Maud", + "I am a Valkyrie. If you see me running, try to keep up.", + "I am not a pack rat - I am a collector", + "I bounced off a rubber tree", /* Monkey Island */ + "Plunder Island Brimstone Beach Club", /* Monkey Island */ + "If you can read this, I can hit you with my polearm", + "I'm confused!", + "I scored with the princess", + "I want to live forever or die in the attempt.", + "Lichen Park", + "LOST IN THOUGHT - please send search party", + "Meat is Mordor", + "Minetown Better Business Bureau", + "Minetown Watch", + "Ms. Palm's House of Negotiable Affection -- A Very Reputable House Of Disrepute", + "Protection Racketeer", + "Real men love Crom", + "Somebody stole my Mojo!", + "The Hellhound Gang", + "The Werewolves", + "They Might Be Storm Giants", + "Weapons don't kill people, I kill people", + "White Zombie", + "You're killing me!", + "Anhur State University - Home of the Fighting Fire Ants!", + "FREE HUGS", + "Serial Ascender", + "Real men are valkyries", + "Young Men's Cavedigging Association", + "Occupy Fort Ludios", + "I couldn't afford this T-shirt so I stole it!", + "Mind flayers suck", + "I'm not wearing any pants", + "Down with the living!", + "Pudding farmer", + "Vegetarian", }; Strcpy(buf, shirt_msgs[tshirt->o_id % SIZE(shirt_msgs)]); return erode_obj_text(tshirt, buf); From 84a067a0162187383d0551aa5d4e130874b7bc57 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 30 Mar 2015 22:09:20 +0300 Subject: [PATCH 313/354] Options to create the character blind or nudist For those pro players who really want to try their hand at that zen samurai, without needing to reroll thousands of times to start with blindfold. Nudist starts without any armor, and keeps tabs whether you wore any during the game, for even more bragging rights. Also makes the Book of the Dead readable even while blind, for obvious reasons. --- doc/Guidebook.mn | 4 ++++ doc/Guidebook.tex | 6 ++++++ doc/fixes35.0 | 1 + include/patchlevel.h | 2 +- include/you.h | 6 ++++++ include/youprop.h | 2 +- src/attrib.c | 2 ++ src/cmd.c | 3 +++ src/options.c | 2 ++ src/read.c | 2 +- src/topten.c | 2 ++ src/u_init.c | 10 ++++++++++ src/worn.c | 1 + 13 files changed, 40 insertions(+), 3 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 496d588de..df7301a81 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1921,6 +1921,8 @@ quality of the weapon; you are free to manually fill your quiver or quiver sack or make ready with the `Q' command instead. If no weapon is found or the option is false, the `t' (throw) command is executed instead. (default false) +.lp blind +Start the character permanently blind. (default false) .lp bones Allow saving and loading bones files. (default true) .lp boulder @@ -2143,6 +2145,8 @@ Cannot be set with the `O' command. Read the NetHack news file, if present (default on). Since the news is shown at the beginning of the game, there's no point in setting this with the `O' command. +.lp nudist +Start the character with no armor (default false). .lp "null " Send padding nulls to the terminal (default on). .lp number_pad diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 6c3ccbded..7c2464664 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -2322,6 +2322,9 @@ or make ready with the `Q' command instead. If no weapon is found or the option is false, the `t' (throw) command is executed instead. (default false) %.lp +\item[\ib{blind}] +Start the character permanently blind. (default false) +%.lp \item[\ib{bones}] Allow saving and loading bones files. (default true) %.lp @@ -2576,6 +2579,9 @@ Read the {\it NetHack\/} news file, if present (default on). Since the news is shown at the beginning of the game, there's no point in setting this with the `{\tt O}' command. %.lp +\item[\ib{nudist}] +Start the character with no armor (default false). +%.lp \item[\ib{null}] Send padding nulls to the terminal (default on). %.lp diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 507480768..b5dfeea67 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1109,6 +1109,7 @@ when you're hiding under something a zap downward should not hit that something, while a zap upward should show more explicit reason why player was helpless at death added new hallucinatory-only gods +options to create the character blind or nudist Platform- and/or Interface-Specific New Features diff --git a/include/patchlevel.h b/include/patchlevel.h index 1b0ebf241..f4281139e 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -14,7 +14,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 59 +#define EDITLEVEL 60 #define COPYRIGHT_BANNER_A \ "NetHack, Copyright 1985-2015" diff --git a/include/you.h b/include/you.h index 0fc5c6073..a69fe4de3 100644 --- a/include/you.h +++ b/include/you.h @@ -92,6 +92,11 @@ struct u_conduct { /* number of times... */ /* genocides already listed at end of game */ }; +struct u_roleplay { + boolean blind; /* permanently blind */ + boolean nudist; /* has not worn any armor, ever */ +}; + /*** Unified structure containing role information ***/ struct Role { /*** Strings that name various things ***/ @@ -330,6 +335,7 @@ struct you { struct u_event uevent; /* certain events have happened */ struct u_have uhave; /* you're carrying special objects */ struct u_conduct uconduct; /* KMH, conduct */ + struct u_roleplay uroleplay; struct attribs acurr, /* your current attributes (eg. str)*/ aexe, /* for gain/loss via "exercise" */ abon, /* your bonus attributes (eg. str) */ diff --git a/include/youprop.h b/include/youprop.h index 1dfe3a9e9..cdecb6c82 100644 --- a/include/youprop.h +++ b/include/youprop.h @@ -91,7 +91,7 @@ #define Blinded u.uprops[BLINDED].intrinsic #define Blindfolded (ublindf && ublindf->otyp != LENSES) /* ...means blind because of a cover */ -#define Blind ((Blinded || Blindfolded || !haseyes(youmonst.data)) && \ +#define Blind ((u.uroleplay.blind || Blinded || Blindfolded || !haseyes(youmonst.data)) && \ !(ublindf && ublindf->oartifact == ART_EYES_OF_THE_OVERWORLD)) /* ...the Eyes operate even when you really are blind or don't have any eyes */ diff --git a/src/attrib.c b/src/attrib.c index b9ce67596..f7af4fee8 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -691,6 +691,8 @@ int propidx; /* special cases can have negative values */ Sprintf(buf, because_of, obj->oartifact ? bare_artifactname(obj) : ysimple_name(obj)); + else if (propidx == BLINDED && u.uroleplay.blind) + Sprintf(buf, " from birth"); else if (propidx == BLINDED && Blindfolded_only) Sprintf(buf, because_of, ysimple_name(ublindf)); diff --git a/src/cmd.c b/src/cmd.c index 5d9bcfc27..51bc10896 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -2246,6 +2246,9 @@ int final; en_win = create_nhwindow(NHW_MENU); putstr(en_win, 0, "Voluntary challenges:"); + if (u.uroleplay.blind) you_have_been("blind from birth"); + if (u.uroleplay.nudist) you_have_been("faithfully nudist"); + if (!u.uconduct.food) enl_msg(You_, "have gone", "went", " without food", ""); /* But beverages are okay */ diff --git a/src/options.c b/src/options.c index e1ff15ff0..742958fc3 100644 --- a/src/options.c +++ b/src/options.c @@ -85,6 +85,7 @@ static struct Bool_Opt #else {"BIOS", (boolean *)0, FALSE, SET_IN_FILE}, #endif + {"blind", &u.uroleplay.blind, FALSE, DISP_IN_GAME}, {"bones", &flags.bones, TRUE, SET_IN_FILE}, #ifdef INSURANCE {"checkpoint", &flags.ins_chkpt, TRUE, SET_IN_GAME}, @@ -149,6 +150,7 @@ static struct Bool_Opt #else {"news", (boolean *)0, FALSE, SET_IN_FILE}, #endif + {"nudist", &u.uroleplay.nudist, FALSE, DISP_IN_GAME}, {"null", &flags.null, TRUE, SET_IN_GAME}, #if defined(SYSFLAGS) && defined(MAC) {"page_wait", &sysflags.page_wait, TRUE, SET_IN_GAME}, diff --git a/src/read.c b/src/read.c index 9d8cac038..3ad28e8aa 100644 --- a/src/read.c +++ b/src/read.c @@ -287,7 +287,7 @@ doread() && scroll->oclass != SPBOOK_CLASS) { pline(silly_thing_to, "read"); return(0); - } else if (Blind) { + } else if (Blind && (scroll->otyp != SPE_BOOK_OF_THE_DEAD)) { const char *what = 0; if (scroll->oclass == SPBOOK_CLASS) what = "mystic runes"; diff --git a/src/topten.c b/src/topten.c index 19eaa2ed2..48c69cb8e 100644 --- a/src/topten.c +++ b/src/topten.c @@ -397,6 +397,8 @@ encodeachieve() if(u.uachieve.mines_luckstone) r |= 1L << 9; if(u.uachieve.finish_sokoban) r |= 1L << 10; if(u.uachieve.killed_medusa) r |= 1L << 11; + if(u.uroleplay.blind) r |= 1L << 12; + if(u.uroleplay.nudist) r |= 1L << 13; return r; } diff --git a/src/u_init.c b/src/u_init.c index 79954841c..3c32637dd 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -491,6 +491,7 @@ void u_init() { register int i; + struct u_roleplay tmpuroleplay = u.uroleplay; /* these set by rcfile options */ flags.female = flags.initgend; flags.beginner = 1; @@ -502,6 +503,8 @@ u_init() (void) memset((genericptr_t)&ubirthday, 0, sizeof(ubirthday)); (void) memset((genericptr_t)&urealtime, 0, sizeof(urealtime)); + u.uroleplay = tmpuroleplay; /* restore options set via rcfile */ + #if 0 /* documentation of more zero values as desirable */ u.usick_cause[0] = 0; u.uluck = u.moreluck = 0; @@ -922,6 +925,13 @@ register struct trobj *trop; nocreate4 = otyp; } + /* nudist gets no armor */ + if (u.uroleplay.nudist && obj->oclass == ARMOR_CLASS) { + dealloc_obj(obj); + trop++; + continue; + } + if (trop->trclass == COIN_CLASS) { /* no "blessed" or "identified" money */ obj->quan = u.umoney0; diff --git a/src/worn.c b/src/worn.c index 70ba11b3a..b810332ea 100644 --- a/src/worn.c +++ b/src/worn.c @@ -57,6 +57,7 @@ long mask; uskin = obj; /* assert( !uarm ); */ } else { + if ((mask & W_ARMOR)) u.uroleplay.nudist = FALSE; for(wp = worn; wp->w_mask; wp++) if(wp->w_mask & mask) { oobj = *(wp->w_obj); if(oobj && !(oobj->owornmask & wp->w_mask)) From ec7238ac221c13301b627b09e426ed879ba805fa Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 30 Mar 2015 16:10:14 -0700 Subject: [PATCH 314/354] lint cleanup for tty 'gray' gcc complained about assigning string literals to variables that aren't const. String literals don't have const type but modifying them results in undefined behavior, so the warning is justified. Except in this case the strings were never being modified so if wasn't justified after all. Switch to a static buffer anyway. --- win/tty/termcap.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/win/tty/termcap.c b/win/tty/termcap.c index 1455bf21a..5329417d5 100644 --- a/win/tty/termcap.c +++ b/win/tty/termcap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 termcap.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 termcap.c $NHDT-Date: 1427756993 2015/03/30 23:09:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.15 $ */ /* NetHack 3.5 termcap.c $Date: 2009/05/06 10:59:19 $ $Revision: 1.13 $ */ /* SCCS Id: @(#)termcap.c 3.5 2007/12/12 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ @@ -844,6 +844,7 @@ const struct {int ti_color, nh_color, nh_bright_color;} ti_map[6] = {COLOR_CYAN,CLR_CYAN,CLR_BRIGHT_CYAN} }; +static char nilstring[] = ""; static void init_hilite() @@ -868,8 +869,8 @@ init_hilite() hilites[CLR_BLUE] = nh_HI; hilites[CLR_MAGENTA] = nh_HI; hilites[CLR_CYAN] = nh_HI; - hilites[CLR_GRAY] = ""; - hilites[NO_COLOR] = ""; + hilites[CLR_GRAY] = nilstring; + hilites[NO_COLOR] = nilstring; hilites[CLR_ORANGE] = nh_HI; hilites[CLR_BRIGHT_GREEN] = nh_HI; hilites[CLR_YELLOW] = nh_HI; @@ -899,8 +900,8 @@ init_hilite() Strcpy(hilites[CLR_WHITE],MD); Strcat(hilites[CLR_WHITE],scratch); - hilites[CLR_GRAY] = ""; - hilites[NO_COLOR] = ""; + hilites[CLR_GRAY] = nilstring; + hilites[NO_COLOR] = nilstring; if (iflags.wc2_darkgray) { /* On many terminals, esp. those using classic PC CGA/EGA/VGA @@ -937,8 +938,8 @@ kill_hilite() /* CLR_RED overlaps CLR_ORANGE, do not free */ /* CLR_MAGENTA overlaps CLR_BRIGHT_MAGENTA, do not free */ /* CLR_BROWN overlaps CLR_YELLOW, do not free */ - /* CLR_GRAY is a constant "", do not free */ - /* NO_COLOR is a constant "", do not free */ + /* CLR_GRAY is static 'nilstring', do not free */ + /* NO_COLOR is static 'nilstring', do not free */ free(hilites[CLR_BRIGHT_BLUE]); free(hilites[CLR_BRIGHT_GREEN]); free(hilites[CLR_BRIGHT_CYAN]); From f2d97b2d00667989fa88fb54b70be8a867e81ffd Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 08:36:32 +0300 Subject: [PATCH 315/354] Silence GCC warnings ...when compiling with -Wall --pedantic --- src/cmd.c | 8 -------- src/dig.c | 4 ++-- src/dog.c | 4 ++-- src/mkroom.c | 6 +----- src/potion.c | 4 +--- src/read.c | 2 +- src/restore.c | 6 +++--- src/trap.c | 7 ++----- 8 files changed, 12 insertions(+), 29 deletions(-) diff --git a/src/cmd.c b/src/cmd.c index 51bc10896..8b7408533 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -997,11 +997,8 @@ wiz_levltyp_legend(VOID_ARGS) STATIC_PTR int wiz_smell(VOID_ARGS) { - char out_str[BUFSZ]; - struct permonst *pm = 0; int ans = 0; int mndx; /* monster index */ - int found; /* count of matching mndxs found */ coord cc; /* screen pos of unknown glyph */ int glyph; /* glyph at selected position */ @@ -1015,11 +1012,6 @@ wiz_smell(VOID_ARGS) pline("You can move the cursor to a monster that you want to smell."); do { - /* Reset some variables. */ - pm = (struct permonst *)0; - found = 0; - out_str[0] = '\0'; - pline("Pick a monster to smell."); ans = getpos(&cc, TRUE, "a monster"); if (ans < 0 || cc.x < 0) { diff --git a/src/dig.c b/src/dig.c index f50d8aa76..a99c93729 100644 --- a/src/dig.c +++ b/src/dig.c @@ -1284,7 +1284,7 @@ zap_dig() struct monst *mtmp; struct obj *otmp; struct trap *trap_with_u = (struct trap *)0; - int zx, zy, diridx, digdepth, flow_x, flow_y; + int zx, zy, diridx = 8, digdepth, flow_x = -1, flow_y = -1; boolean shopdoor, shopwall, maze_dig, pitdig = FALSE, pitflow = FALSE; /* @@ -1462,7 +1462,7 @@ zap_dig() } /* while */ tmp_at(DISP_END,0); /* closing call */ - if (pitflow) { + if (pitflow && isok(flow_x, flow_y)) { struct trap *ttmp = t_at(flow_x, flow_y); if (ttmp && (ttmp->ttyp == PIT || ttmp->ttyp == SPIKED_PIT)) { schar filltyp = fillholetyp(ttmp->tx, ttmp->ty, TRUE); diff --git a/src/dog.c b/src/dog.c index fcc258b86..10e33677f 100644 --- a/src/dog.c +++ b/src/dog.c @@ -423,7 +423,7 @@ boolean with_you; * probably because the level is full. * Dump the monster's cargo and leave the monster dead. */ - struct obj *obj, *corpse; + struct obj *obj; while ((obj = mtmp->minvent) != 0) { obj_extract_self(obj); obj_no_longer_held(obj); @@ -437,7 +437,7 @@ boolean with_you; impossible("Can't find relocated object."); } } - corpse = mkcorpstat(CORPSE, (struct monst *)0, mtmp->data, + (void) mkcorpstat(CORPSE, (struct monst *)0, mtmp->data, xlocale, ylocale, CORPSTAT_NONE); mongone(mtmp); } diff --git a/src/mkroom.c b/src/mkroom.c index 2581ce996..6ef03054a 100644 --- a/src/mkroom.c +++ b/src/mkroom.c @@ -219,14 +219,10 @@ struct mkroom *sroom; { struct monst *mon; register int sx,sy,i; - int sh, tx, ty, goldlim, type = sroom->rtype; + int sh, tx = 0, ty = 0, goldlim = 0, type = sroom->rtype; int rmno = (int)((sroom - rooms) + ROOMOFFSET); coord mm; -#ifdef GCC_WARN - tx = ty = goldlim = 0; -#endif - sh = sroom->fdoor; switch(type) { case COURT: diff --git a/src/potion.c b/src/potion.c index d32c65b65..86fdcdff8 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1055,7 +1055,7 @@ boolean useeit; const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */ { void FDECL((*func), (OBJ_P)) = 0; - const char *how = 0, *glowcolor = 0; + const char *glowcolor = 0; #define COST_alter (-2) #define COST_none (-1) int costchange = COST_none; @@ -1064,7 +1064,6 @@ const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */ if (!potion || potion->otyp != POT_WATER) return FALSE; if (potion->blessed) { - how = "softly glow"; if (targobj->cursed) { func = uncurse; glowcolor = NH_AMBER; @@ -1076,7 +1075,6 @@ const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */ altfmt = TRUE; /* "with a aura" */ } } else if (potion->cursed) { - how = "glow"; if (targobj->blessed) { func = unbless; glowcolor = "brown"; diff --git a/src/read.c b/src/read.c index 3ad28e8aa..7d35620bc 100644 --- a/src/read.c +++ b/src/read.c @@ -2198,7 +2198,7 @@ create_particular() { char buf[BUFSZ], *bufp, monclass; int which, tryct, i, firstchoice = NON_PM; - struct permonst *whichpm; + struct permonst *whichpm = NULL; struct monst *mtmp; boolean madeany = FALSE; boolean maketame, makepeaceful, makehostile; diff --git a/src/restore.c b/src/restore.c index be1126be8..4c4b049ce 100644 --- a/src/restore.c +++ b/src/restore.c @@ -1144,9 +1144,9 @@ get_plname_from_file(fd, plbuf) int fd; char *plbuf; { - int rlen, pltmpsiz = 0; - rlen = read(fd, (genericptr_t) &pltmpsiz, sizeof(pltmpsiz)); - rlen = read(fd, (genericptr_t) plbuf, pltmpsiz); + int pltmpsiz = 0; + (void) read(fd, (genericptr_t) &pltmpsiz, sizeof(pltmpsiz)); + (void) read(fd, (genericptr_t) plbuf, pltmpsiz); return; } diff --git a/src/trap.c b/src/trap.c index 775bca5cb..4c8adccbd 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1406,13 +1406,12 @@ struct obj *otmp; { struct monst *steed = u.usteed; int tt; - boolean in_sight, trapkilled, steedhit; + boolean trapkilled, steedhit; if (!steed || !trap) return 0; tt = trap->ttyp; steed->mx = u.ux; steed->my = u.uy; - in_sight = !Blind; trapkilled = steedhit = FALSE; switch (tt) { @@ -4266,7 +4265,7 @@ boolean trapdoor_only; boolean *noticed; /* set to true iff hero notices the effect; */ { /* otherwise left with its previous value intact */ struct trap *t; - boolean ishero = (mon == &youmonst), result; + boolean ishero = (mon == &youmonst); if (mon == u.usteed) ishero = TRUE; t = t_at(ishero ? u.ux : mon->mx, ishero ? u.uy : mon->my); @@ -4281,7 +4280,6 @@ boolean *noticed; /* set to true iff hero notices the effect; */ if (u.utrap) return FALSE; /* already trapped */ *noticed = TRUE; dotrap(t, FORCETRAP); - result = (u.utrap != 0); } else { if (mon->mtrapped) return FALSE; /* already trapped */ /* you notice it if you see the trap close/tremble/whatever @@ -4290,7 +4288,6 @@ boolean *noticed; /* set to true iff hero notices the effect; */ /* monster will be angered; mintrap doesn't handle that */ wakeup(mon); ++force_mintrap; - result = (mintrap(mon) != 0); --force_mintrap; /* mon might now be on the migrating monsters list */ } From aa7144daf69605d1d850992a807c3f928abe45b0 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 09:38:38 +0300 Subject: [PATCH 316/354] Bear traps wound legs --- src/trap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/trap.c b/src/trap.c index 4c8adccbd..f30fb5a6d 100644 --- a/src/trap.c +++ b/src/trap.c @@ -946,6 +946,7 @@ unsigned trflags; } else { pline("%s bear trap closes on your %s!", A_Your[trap->madeby_u], body_part(FOOT)); + set_wounded_legs(rn2(2) ? RIGHT_SIDE : LEFT_SIDE, rn1(10,10)); if(u.umonnum == PM_OWLBEAR || u.umonnum == PM_BUGBEAR) You("howl in anger!"); losehp(Maybe_Half_Phys(dmg), "bear trap", KILLED_BY_AN); From cc00b2117830118d3e980b8196fa7ee6d51cbdee Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 30 Mar 2015 23:20:45 -0700 Subject: [PATCH 317/354] bhitpile lint bit The 'zdir' function parameter has the same name as 'zdir' global variable, triggering a 'shadowing' warning. I had to read the 'if' statement multiple times to convince myself it was doing what was intended. It was, but I think this rewrite is easier to understand (at least for my feeble reptilian brain). I don't know who Tim Wright is, but his 15 mintues of fame has lasted for at least a decade so I cut his comment out. (The 28.5 year old GAN one a dozen lines lower was a tempting target for removal, but I managed to stop myself; otherwise it never ends.) --- src/zap.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/zap.c b/src/zap.c index b8c846be3..2852cf995 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 zap.c $NHDT-Date: 1427249230 2015/03/25 02:07:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.197 $ */ +/* NetHack 3.5 zap.c $NHDT-Date: 1427782839 2015/03/31 06:20:39 $ $NHDT-Branch: master $:$NHDT-Revision: 1.200 $ */ /* NetHack 3.5 zap.c $Date: 2013/11/05 00:57:56 $ $Revision: 1.183 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1892,11 +1892,11 @@ struct obj *obj, *otmp; /* returns nonzero if something was hit */ int -bhitpile(obj,fhito,tx,ty,zdir) +bhitpile(obj, fhito, tx, ty, zz) struct obj *obj; int FDECL((*fhito), (OBJ_P,OBJ_P)); int tx, ty; - schar zdir; + schar zz; { int hitanything = 0; register struct obj *otmp, *next_obj; @@ -1916,16 +1916,12 @@ bhitpile(obj,fhito,tx,ty,zdir) poly_zapped = -1; for(otmp = level.objects[tx][ty]; otmp; otmp = next_obj) { - /* Fix for polymorph bug, Tim Wright */ next_obj = otmp->nexthere; - /* - * game flavor: if you are hiding under something, - * a zap downwards shouldn't hit that obj, so honor that. - */ - if (!(u.uundetected && (zdir > 0) && - (otmp == level.objects[u.ux][u.uy]) && - hides_under(youmonst.data))) - hitanything += (*fhito)(otmp, obj); + /* for zap downwards, don't hit object poly'd hero is hiding under */ + if (zz > 0 && u.uundetected && otmp == level.objects[u.ux][u.uy] + && hides_under(youmonst.data)) continue; + + hitanything += (*fhito)(otmp, obj); } if(poly_zapped >= 0) create_polymon(level.objects[tx][ty], poly_zapped); From f0eae55d347cc18ff79f6014044e1594d4bbb763 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 31 Mar 2015 00:18:00 -0700 Subject: [PATCH 318/354] add .gitignore entries: tile.h, NetHack.ad Add a couple of missing .gitignore entries for files put into place when building. include/tile.h is genearated for tiles and dat/NetHack.ad is copied for X11 resource definitions. --- dat/.gitignore | 1 + include/.gitignore | 1 + 2 files changed, 2 insertions(+) diff --git a/dat/.gitignore b/dat/.gitignore index 1784229ab..caece5a59 100644 --- a/dat/.gitignore +++ b/dat/.gitignore @@ -20,3 +20,4 @@ nhdat dlb.lst guioptions porthelp +NetHack.ad diff --git a/include/.gitignore b/include/.gitignore index b9bd5d8ab..cb5a92532 100644 --- a/include/.gitignore +++ b/include/.gitignore @@ -5,3 +5,4 @@ pm.h vis_tab.h dgn_comp.h lev_comp.h +tile.h From 19aeb91dc4f5597059676a5205afa3e2c3e7ff8e Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 10:20:20 +0300 Subject: [PATCH 319/354] Revert one GCC warning --- src/trap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/trap.c b/src/trap.c index f30fb5a6d..3c3f66642 100644 --- a/src/trap.c +++ b/src/trap.c @@ -4266,7 +4266,7 @@ boolean trapdoor_only; boolean *noticed; /* set to true iff hero notices the effect; */ { /* otherwise left with its previous value intact */ struct trap *t; - boolean ishero = (mon == &youmonst); + boolean ishero = (mon == &youmonst), result; if (mon == u.usteed) ishero = TRUE; t = t_at(ishero ? u.ux : mon->mx, ishero ? u.uy : mon->my); @@ -4281,6 +4281,7 @@ boolean *noticed; /* set to true iff hero notices the effect; */ if (u.utrap) return FALSE; /* already trapped */ *noticed = TRUE; dotrap(t, FORCETRAP); + result = (u.utrap != 0); } else { if (mon->mtrapped) return FALSE; /* already trapped */ /* you notice it if you see the trap close/tremble/whatever @@ -4289,6 +4290,7 @@ boolean *noticed; /* set to true iff hero notices the effect; */ /* monster will be angered; mintrap doesn't handle that */ wakeup(mon); ++force_mintrap; + result = (mintrap(mon) != 0); --force_mintrap; /* mon might now be on the migrating monsters list */ } From 9f605ed2b330709f011714ee0677d9e00fa6d06d Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 11:46:41 +0300 Subject: [PATCH 320/354] Moving clouds on the plane of air Reusing the plane of water air bubbles code --- dat/endgame.des | 40 +++---- src/allmain.c | 2 +- src/do.c | 2 +- src/mkmaze.c | 309 ++++++++++++++++++++++++++---------------------- 4 files changed, 191 insertions(+), 162 deletions(-) diff --git a/dat/endgame.des b/dat/endgame.des index 4758ff518..1f811ad61 100644 --- a/dat/endgame.des +++ b/dat/endgame.des @@ -139,26 +139,26 @@ GEOMETRY:center,center # This map has no visible outer boundary, and # is all "air". MAP -AAAAAAAAAAAAAAAAAAAAAAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAACCCCCCAAAAAAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAACCAACCCCCAAAAAACCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAACCACCCCCCCAAAAACCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAACCCCCCCCCCAAAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAACCCCAAACCAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAACCCCAAAAAACCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAACCCCCCCAAAACCACCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAACCCCAAAAAAACCACAACCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCAACCCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAACCCCAAACCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAACACACCCCCAAACCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAACAACCCCCCCAAAACCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAACACCCCCCCCAAACCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCCCCCCCCAACCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAACACCCCCCCCCCACCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAACAACCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAACCCCCCAAACCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAACCAAAAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ENDMAP # Use up and down regions to partition the level into three parts; # teleportation can't cross from one part into another. diff --git a/src/allmain.c b/src/allmain.c index 45c319037..5f5ab44c7 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -292,7 +292,7 @@ boolean resuming; } restore_attrib(); /* underwater and waterlevel vision are done here */ - if (Is_waterlevel(&u.uz)) + if (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz)) movebubbles(); else if (Underwater) under_water(0); diff --git a/src/do.c b/src/do.c index c690ad4fa..eae360425 100644 --- a/src/do.c +++ b/src/do.c @@ -1286,7 +1286,7 @@ boolean at_stairs, falling, portal; } /* initial movement of bubbles just before vision_recalc */ - if (Is_waterlevel(&u.uz)) + if (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz)) movebubbles(); if (level_info[new_ledger].flags & FORGOTTEN) { diff --git a/src/mkmaze.c b/src/mkmaze.c index 87a3a870b..c0036d170 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -344,7 +344,8 @@ fixup_special() was_waterlevel = FALSE; u.uinwater = 0; unsetup_waterlevel(); - } else if (Is_waterlevel(&u.uz)) { + } + if (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz)) { level.flags.hero_memory = 0; was_waterlevel = TRUE; /* water level is an odd beast - it has to be set up @@ -922,98 +923,110 @@ movebubbles() struct trap *btrap; static const struct rm water_pos = { cmap_to_glyph(S_water), WATER, 0, 0, 0, 0, 0, 0, 0 }; + static const struct rm air_pos = + { cmap_to_glyph(S_cloud), AIR, 0, 0, 0, 1, 0, 0, 0 }; /* set up the portal the first time bubbles are moved */ if (!wportal) set_wportal(); vision_recalc(2); - /* keep attached ball&chain separate from bubble objects */ - if (Punished) unplacebc(); - /* - * Pick up everything inside of a bubble then fill all bubble - * locations. - */ + if (Is_waterlevel(&u.uz)) { - for (b = up ? bbubbles : ebubbles; b; b = up ? b->next : b->prev) { - if (b->cons) panic("movebubbles: cons != null"); - for (i = 0, x = b->x; i < (int) b->bm[0]; i++, x++) - for (j = 0, y = b->y; j < (int) b->bm[1]; j++, y++) - if (b->bm[j + 2] & (1 << i)) { - if (!isok(x,y)) { - impossible("movebubbles: bad pos (%d,%d)", x,y); - continue; - } + /* keep attached ball&chain separate from bubble objects */ + if (Punished) unplacebc(); - /* pick up objects, monsters, hero, and traps */ - if (OBJ_AT(x,y)) { - struct obj *olist = (struct obj *) 0, *otmp; - struct container *cons = (struct container *) - alloc(sizeof(struct container)); + /* + * Pick up everything inside of a bubble then fill all bubble + * locations. + */ - while ((otmp = level.objects[x][y]) != 0) { - remove_object(otmp); - otmp->ox = otmp->oy = 0; - otmp->nexthere = olist; - olist = otmp; + for (b = up ? bbubbles : ebubbles; b; b = up ? b->next : b->prev) { + if (b->cons) panic("movebubbles: cons != null"); + for (i = 0, x = b->x; i < (int) b->bm[0]; i++, x++) + for (j = 0, y = b->y; j < (int) b->bm[1]; j++, y++) + if (b->bm[j + 2] & (1 << i)) { + if (!isok(x,y)) { + impossible("movebubbles: bad pos (%d,%d)", x,y); + continue; } - cons->x = x; - cons->y = y; - cons->what = CONS_OBJ; - cons->list = (genericptr_t) olist; - cons->next = b->cons; - b->cons = cons; + /* pick up objects, monsters, hero, and traps */ + if (OBJ_AT(x,y)) { + struct obj *olist = (struct obj *) 0, *otmp; + struct container *cons = (struct container *) + alloc(sizeof(struct container)); + + while ((otmp = level.objects[x][y]) != 0) { + remove_object(otmp); + otmp->ox = otmp->oy = 0; + otmp->nexthere = olist; + olist = otmp; + } + + cons->x = x; + cons->y = y; + cons->what = CONS_OBJ; + cons->list = (genericptr_t) olist; + cons->next = b->cons; + b->cons = cons; + } + if (MON_AT(x,y)) { + struct monst *mon = m_at(x,y); + struct container *cons = (struct container *) + alloc(sizeof(struct container)); + + cons->x = x; + cons->y = y; + cons->what = CONS_MON; + cons->list = (genericptr_t) mon; + + cons->next = b->cons; + b->cons = cons; + + if(mon->wormno) + remove_worm(mon); + else + remove_monster(x, y); + + newsym(x,y); /* clean up old position */ + mon->mx = mon->my = 0; + } + if (!u.uswallow && x == u.ux && y == u.uy) { + struct container *cons = (struct container *) + alloc(sizeof(struct container)); + + cons->x = x; + cons->y = y; + cons->what = CONS_HERO; + cons->list = (genericptr_t) 0; + + cons->next = b->cons; + b->cons = cons; + } + if ((btrap = t_at(x,y)) != 0) { + struct container *cons = (struct container *) + alloc(sizeof(struct container)); + + cons->x = x; + cons->y = y; + cons->what = CONS_TRAP; + cons->list = (genericptr_t) btrap; + + cons->next = b->cons; + b->cons = cons; + } + + levl[x][y] = water_pos; + block_point(x,y); } - if (MON_AT(x,y)) { - struct monst *mon = m_at(x,y); - struct container *cons = (struct container *) - alloc(sizeof(struct container)); - - cons->x = x; - cons->y = y; - cons->what = CONS_MON; - cons->list = (genericptr_t) mon; - - cons->next = b->cons; - b->cons = cons; - - if(mon->wormno) - remove_worm(mon); - else - remove_monster(x, y); - - newsym(x,y); /* clean up old position */ - mon->mx = mon->my = 0; - } - if (!u.uswallow && x == u.ux && y == u.uy) { - struct container *cons = (struct container *) - alloc(sizeof(struct container)); - - cons->x = x; - cons->y = y; - cons->what = CONS_HERO; - cons->list = (genericptr_t) 0; - - cons->next = b->cons; - b->cons = cons; - } - if ((btrap = t_at(x,y)) != 0) { - struct container *cons = (struct container *) - alloc(sizeof(struct container)); - - cons->x = x; - cons->y = y; - cons->what = CONS_TRAP; - cons->list = (genericptr_t) btrap; - - cons->next = b->cons; - b->cons = cons; - } - - levl[x][y] = water_pos; - block_point(x,y); - } + } + } else if (Is_airlevel(&u.uz)) { + for (x = 0; x < COLNO; x++) + for (y = 0; y < ROWNO; y++) { + levl[x][y] = air_pos; + unblock_point(x,y); + } } /* @@ -1032,7 +1045,7 @@ movebubbles() } /* put attached ball&chain back */ - if (Punished) placebc(); + if (Is_waterlevel(&u.uz) && Punished) placebc(); vision_full_recalc = 1; } @@ -1076,7 +1089,7 @@ int fd, mode; { register struct bubble *b; - if (!Is_waterlevel(&u.uz)) return; + if (!Is_waterlevel(&u.uz) && !Is_airlevel(&u.uz)) return; if (perform_bwrite(mode)) { int n = 0; @@ -1101,7 +1114,7 @@ register int fd; register int i; int n; - if (!Is_waterlevel(&u.uz)) return; + if (!Is_waterlevel(&u.uz) && !Is_airlevel(&u.uz)) return; set_wportal(); mread(fd,(genericptr_t)&n,sizeof(int)); @@ -1177,6 +1190,7 @@ setup_waterlevel() register int x, y; register int xskip, yskip; register int water_glyph = cmap_to_glyph(S_water); + register int air_glyph = cmap_to_glyph(S_air); /* ouch, hardcoded... */ @@ -1189,12 +1203,18 @@ setup_waterlevel() for (x = xmin; x <= xmax; x++) for (y = ymin; y <= ymax; y++) - levl[x][y].glyph = water_glyph; + levl[x][y].glyph = Is_waterlevel(&u.uz) ? water_glyph : air_glyph; /* make bubbles */ - xskip = 10 + rn2(10); - yskip = 4 + rn2(4); + if (Is_waterlevel(&u.uz)) { + xskip = 10 + rn2(10); + yskip = 4 + rn2(4); + } else { + xskip = 6 + rn2(4); + yskip = 3 + rn2(3); + } + for (x = bxmin; x <= bxmax; x += xskip) for (y = bymin; y <= bymax; y += yskip) mk_bubble(x,y,rn2(7)); @@ -1280,67 +1300,76 @@ register boolean ini; register int x, y, i, j, colli = 0; struct container *cons, *ctemp; - /* move bubble */ - if (dx < -1 || dx > 1 || dy < -1 || dy > 1) { - /* pline("mv_bubble: dx = %d, dy = %d", dx, dy); */ - dx = sgn(dx); - dy = sgn(dy); + /* clouds move slowly */ + if (!Is_airlevel(&u.uz) || !rn2(6)) { + /* move bubble */ + if (dx < -1 || dx > 1 || dy < -1 || dy > 1) { + /* pline("mv_bubble: dx = %d, dy = %d", dx, dy); */ + dx = sgn(dx); + dy = sgn(dy); + } + + /* + * collision with level borders? + * 1 = horizontal border, 2 = vertical, 3 = corner + */ + if (b->x <= bxmin) colli |= 2; + if (b->y <= bymin) colli |= 1; + if ((int) (b->x + b->bm[0] - 1) >= bxmax) colli |= 2; + if ((int) (b->y + b->bm[1] - 1) >= bymax) colli |= 1; + + if (b->x < bxmin) { + pline("bubble xmin: x = %d, xmin = %d", b->x, bxmin); + b->x = bxmin; + } + if (b->y < bymin) { + pline("bubble ymin: y = %d, ymin = %d", b->y, bymin); + b->y = bymin; + } + if ((int) (b->x + b->bm[0] - 1) > bxmax) { + pline("bubble xmax: x = %d, xmax = %d", + b->x + b->bm[0] - 1, bxmax); + b->x = bxmax - b->bm[0] + 1; + } + if ((int) (b->y + b->bm[1] - 1) > bymax) { + pline("bubble ymax: y = %d, ymax = %d", + b->y + b->bm[1] - 1, bymax); + b->y = bymax - b->bm[1] + 1; + } + + /* bounce if we're trying to move off the border */ + if (b->x == bxmin && dx < 0) dx = -dx; + if (b->x + b->bm[0] - 1 == bxmax && dx > 0) dx = -dx; + if (b->y == bymin && dy < 0) dy = -dy; + if (b->y + b->bm[1] - 1 == bymax && dy > 0) dy = -dy; + + b->x += dx; + b->y += dy; } - /* - * collision with level borders? - * 1 = horizontal border, 2 = vertical, 3 = corner - */ - if (b->x <= bxmin) colli |= 2; - if (b->y <= bymin) colli |= 1; - if ((int) (b->x + b->bm[0] - 1) >= bxmax) colli |= 2; - if ((int) (b->y + b->bm[1] - 1) >= bymax) colli |= 1; - - if (b->x < bxmin) { - pline("bubble xmin: x = %d, xmin = %d", b->x, bxmin); - b->x = bxmin; - } - if (b->y < bymin) { - pline("bubble ymin: y = %d, ymin = %d", b->y, bymin); - b->y = bymin; - } - if ((int) (b->x + b->bm[0] - 1) > bxmax) { - pline("bubble xmax: x = %d, xmax = %d", - b->x + b->bm[0] - 1, bxmax); - b->x = bxmax - b->bm[0] + 1; - } - if ((int) (b->y + b->bm[1] - 1) > bymax) { - pline("bubble ymax: y = %d, ymax = %d", - b->y + b->bm[1] - 1, bymax); - b->y = bymax - b->bm[1] + 1; - } - - /* bounce if we're trying to move off the border */ - if (b->x == bxmin && dx < 0) dx = -dx; - if (b->x + b->bm[0] - 1 == bxmax && dx > 0) dx = -dx; - if (b->y == bymin && dy < 0) dy = -dy; - if (b->y + b->bm[1] - 1 == bymax && dy > 0) dy = -dy; - - b->x += dx; - b->y += dy; - - /* void positions inside bubble */ - + /* draw the bubbles */ for (i = 0, x = b->x; i < (int) b->bm[0]; i++, x++) for (j = 0, y = b->y; j < (int) b->bm[1]; j++, y++) if (b->bm[j + 2] & (1 << i)) { + if (Is_waterlevel(&u.uz)) { levl[x][y].typ = AIR; levl[x][y].lit = 1; unblock_point(x,y); + } else if (Is_airlevel(&u.uz)) { + levl[x][y].typ = CLOUD; + levl[x][y].lit = 1; + block_point(x,y); + } } - /* replace contents of bubble */ - for (cons = b->cons; cons; cons = ctemp) { - ctemp = cons->next; - cons->x += dx; - cons->y += dy; + if (Is_waterlevel(&u.uz)) { + /* replace contents of bubble */ + for (cons = b->cons; cons; cons = ctemp) { + ctemp = cons->next; + cons->x += dx; + cons->y += dy; - switch(cons->what) { + switch(cons->what) { case CONS_OBJ: { struct obj *olist, *otmp; @@ -1381,13 +1410,13 @@ register boolean ini; default: impossible("mv_bubble: unknown bubble contents"); break; + } + free((genericptr_t)cons); } - free((genericptr_t)cons); + b->cons = 0; } - b->cons = 0; /* boing? */ - switch (colli) { case 1: b->dy = -b->dy; break; case 3: b->dy = -b->dy; /* fall through */ From ef9a89c99d4acb88386ff4e8f646c8dadbaab9c3 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 12:41:35 +0300 Subject: [PATCH 321/354] Update fixes35.0 --- doc/fixes35.0 | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index b5dfeea67..2d3b8c7ad 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1110,6 +1110,7 @@ when you're hiding under something a zap downward should not hit that show more explicit reason why player was helpless at death added new hallucinatory-only gods options to create the character blind or nudist +moving clouds on the plane of air Platform- and/or Interface-Specific New Features From cbd1657976e92e09236278a4b079f4570c0b1f16 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 12:59:27 +0300 Subject: [PATCH 322/354] Use a menu when user wants to query a glyph When user presses '/', pop up a meny asking what the user wants to look at: What do you want to look at: a - something on the map b - something you're carrying c - something else This replaces the "Specify unknown object by cursor?" -prompt, while keepng backwards compatibility, and also allows querying about items in the inventory. --- src/pager.c | 79 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 18 deletions(-) diff --git a/src/pager.c b/src/pager.c index f2f5b9968..4c0f69d17 100644 --- a/src/pager.c +++ b/src/pager.c @@ -679,7 +679,7 @@ do_look(mode, click_cc) char out_str[BUFSZ]; const char *firstmatch = 0; struct permonst *pm = 0; - int i, ans = 0; + int i = '\0', ans = 0; int sym; /* typed symbol or converted glyph */ int found; /* count of matching syms found */ coord cc; /* screen pos of unknown glyph */ @@ -689,25 +689,68 @@ do_look(mode, click_cc) if (!clicklook) { if (quick) { from_screen = TRUE; /* yes, we want to use the cursor */ - } else { - i = ynq("Specify unknown object by cursor?"); - if (i == 'q') return 0; - from_screen = (i == 'y'); + i = 'y'; + } + + if (i != 'y') { + menu_item *pick_list = (menu_item *)0; + winid win; + anything any; + win = create_nhwindow(NHW_MENU); + start_menu(win); + any.a_void = 0; any.a_char ='a'; + /* 'y' and 'n' to keep backwards compat with previous versions */ + add_menu(win, NO_GLYPH, &any, 'a', 'y', ATR_NONE, "something on the map", MENU_UNSELECTED); + any.a_void = 0; any.a_char ='b'; + add_menu(win, NO_GLYPH, &any, 'b', 0, ATR_NONE, "something you're carrying", MENU_UNSELECTED); + any.a_void = 0; any.a_char ='c'; + add_menu(win, NO_GLYPH, &any, 'c', 'n', ATR_NONE, "something else", MENU_UNSELECTED); + end_menu(win, "What do you want to look at:"); + if (select_menu(win, PICK_ONE, &pick_list) > 0) { + i = pick_list->item.a_char; + free((genericptr_t)pick_list); + } + destroy_nhwindow(win); } - if (from_screen) { - cc.x = u.ux; - cc.y = u.uy; - sym = 0; /* gcc -Wall lint */ - } else { - getlin("Specify what? (type the word)", out_str); - if (out_str[0] == '\0' || out_str[0] == '\033') - return 0; - if (out_str[1]) { /* user typed in a complete string */ - checkfile(out_str, pm, TRUE, TRUE); - return 0; - } - sym = out_str[0]; + switch (i) { + default: + case 'q': return 0; + case 'y': + case 'a': + from_screen = TRUE; + sym = 0; + cc.x = u.ux; + cc.y = u.uy; + break; + case 'b': + { + char invlet; + struct obj *invobj; + invlet = display_inventory(NULL, TRUE); + if (!invlet) return 0; + for (invobj = invent; invobj; invobj = invobj->nobj) + if (invobj->invlet == invlet) { + strcpy(out_str, singular(invobj, xname)); + break; + } + if (!out_str[1]) return 0; + checkfile(out_str, pm, TRUE, TRUE); + return 0; + } + break; + case 'c': + from_screen = FALSE; + getlin("Specify what? (type the word)", out_str); + if (out_str[0] == '\0' || out_str[0] == '\033') + return 0; + + if (out_str[1]) { /* user typed in a complete string */ + checkfile(out_str, pm, TRUE, TRUE); + return 0; + } + sym = out_str[0]; + break; } } else { /* clicklook */ cc.x = click_cc->x; From 8ee2d5976e9e5843668f244793966f431f25fa0c Mon Sep 17 00:00:00 2001 From: keni Date: Tue, 31 Mar 2015 09:50:02 -0400 Subject: [PATCH 323/354] NHDT substitution version 2. Re-run nhgitset.pl to install. "perldoc DEVEL/hooksdir/nhsub" for details. General docs still to come. Quick notes: - "git nhsub" lets you apply substitutions to a file without involving any version control. - When doing nhadd/nhcommit, the working directory WILL reflect the results of the substitutions. Let's see what this breaks. --- .gitattributes | 4 +- DEVEL/.gitattributes | 6 +- DEVEL/hooksdir/NHadd | 9 +- DEVEL/hooksdir/nhsub | 376 ++++++++++++++++++++++++++++++++++ DEVEL/nhgitset.pl | 27 ++- dat/.gitattributes | 6 +- doc/.gitattributes | 8 +- sys/amiga/.gitattributes | 2 +- sys/mac/.gitattributes | 2 +- sys/msdos/.gitattributes | 8 +- sys/os2/.gitattributes | 2 +- sys/share/.gitattributes | 2 +- sys/unix/.gitattributes | 2 +- sys/unix/hints/.gitattributes | 2 +- sys/vms/.gitattributes | 2 +- sys/wince/.gitattributes | 6 +- sys/winnt/.gitattributes | 8 +- util/.gitattributes | 4 +- 18 files changed, 435 insertions(+), 41 deletions(-) mode change 100755 => 100644 DEVEL/hooksdir/NHadd create mode 100644 DEVEL/hooksdir/nhsub diff --git a/.gitattributes b/.gitattributes index 894a91c8e..9af92ddc6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,5 @@ -*.[ch] filter=NHtext merge=NHsubst -*.sh filter=NHtext merge=NHsubst +*.[ch] NHSUBST +*.sh NHSUBST * text=auto *.hqx -text *.sln -text diff --git a/DEVEL/.gitattributes b/DEVEL/.gitattributes index 3e157372b..cc0b542f3 100644 --- a/DEVEL/.gitattributes +++ b/DEVEL/.gitattributes @@ -1,4 +1,4 @@ -Developer.txt filter=NHtext merge=NHsubst -nhgitset.pl filter=NHtext merge=NHsubst -hookdir/* filter=NHtext merge=NHsubst +Developer.txt NHSUBST +nhgitset.pl NHSUBST +hooksdir/* NHSUBST * text=auto diff --git a/DEVEL/hooksdir/NHadd b/DEVEL/hooksdir/NHadd old mode 100755 new mode 100644 index 55a86ee08..55138e738 --- a/DEVEL/hooksdir/NHadd +++ b/DEVEL/hooksdir/NHadd @@ -1,14 +1,19 @@ #!/usr/bin/perl # wrapper for nhadd and nhcommit aliases -# $NHDT-Date$ +# $NHDT-Date: 1427408239 2015/03/26 22:17:19 $ %ok = map { $_ => 1 } ('add', 'commit'); die "Bad subcommand '$ARGV[0]'" unless $ok{$ARGV[0]}; +# we won't fail on a failure, so just system() +$rv = system('.git/hooks/nhsub',"--$ARGV[0]",@ARGV[1..$#ARGV]); +if($rv){ + print "warning: nhsub failed: $rv $!\n"; +} + if(length $ENV{GIT_PREFIX}){ chdir($ENV{GIT_PREFIX}) or die "Can't chdir $ENV{GIT_PREFIX}: $!"; } -$ENV{NHMODE} = 1; exec "git", @ARGV or die "Can't exec git: $!"; diff --git a/DEVEL/hooksdir/nhsub b/DEVEL/hooksdir/nhsub new file mode 100644 index 000000000..b8cdd9f67 --- /dev/null +++ b/DEVEL/hooksdir/nhsub @@ -0,0 +1,376 @@ +#!/usr/bin/perl +# nhsub +# $NHDT-Date: 1427408239 2015/03/26 22:17:19 $ + +# Note: was originally called nhdate; the rename is not reflected in the code. + +use strict; +my %opt; #cmd v n f F (other single char, but we don't care) +my $mode; # a c d f (add, commit, date, date -f) + +#SO how do we know if a file has changed? +#(git status: git status --porcelain --ignored -- FILES. +#maybe + -z but it's a question of rename operations - probably doesn't +# matter, but need to experiment. + +# key: [dacf] first character of opt{cmd} (f if nhsub -f or add -f) +# first 2 chars of "git status --porcelain --ignored" +# (see "git help status" for table) +# No default. Undef means something unexpected happened. +my %codes = ( + 'f M'=>1, 'f D'=>1, # [MD] not updated + 'a M'=>0, 'a D'=>0, + 'd M'=>0, 'd D'=>0, + 'c M'=>0, 'c D'=>0, + +# M [ MD] updated in index + + 'dA '=>1, 'dAM'=>1, 'dAD'=>1, + 'aA '=>1, 'aAM'=>1, 'aAD'=>1, + 'cA '=>1, 'cAM'=>1, 'cAD'=>1, + 'fA '=>1, 'fAM'=>1, 'fAD'=>1, + # A [ MD] added to index + + 'dD '=>0, 'dDM'=>0, + 'aD '=>1, 'aDM'=>1, + 'cD '=>0, 'cDM'=>0, + 'fD '=>1, 'fDM'=>1, + # D [ M] deleted from index + +# R [ MD] renamed in index + +# C [ MD] copied in index + + 'aM '=>1, 'aA '=>1, 'aR '=>1, 'aC '=>1, + 'fM '=>1, 'fA '=>1, 'fR '=>1, 'fC '=>1, + # [MARC] index and work tree matches + + 'd M'=>1, 'dMM'=>1, 'dAM'=>1, 'dRM'=>1, 'dCM'=>1, + 'a M'=>1, 'aMM'=>1, 'aAM'=>1, 'aRM'=>1, 'aCM'=>1, + 'c M'=>1, 'cMM'=>1, 'cAM'=>1, 'cRM'=>1, 'cCM'=>1, + 'f M'=>1, 'fMM'=>1, 'fAM'=>1, 'fRM'=>1, 'fCM'=>1, + # [ MARC] M work tree changed since index + + 'd D'=>0, 'dMD'=>0, 'dAD'=>0, 'dRD'=>0, 'dCD'=>0, + 'a D'=>0, 'aMD'=>0, 'aAD'=>0, 'aRD'=>0, 'aCD'=>0, + 'c D'=>0, 'cMD'=>0, 'cAD'=>0, 'cRD'=>0, 'cCD'=>0, + 'f D'=>0, 'fMD'=>0, 'fAD'=>0, 'fRD'=>0, 'fCD'=>0, + # [ MARC] D deleted in work tree + + # ------------------------------------------------- + # DD unmerged, both deleted + # AU unmerged, added by us + # UD unmerged, deleted by them + # UA unmerged, added by them + # DU unmerged, deleted by us + # AA unmerged, both added + # UU unmerged, both modified + # ------------------------------------------------- + 'a??'=>1, 'f??'=>1, # ?? untracked + 'd??'=>0, 'c??'=>0, + + 'f!!'=>1, # !! ignored + 'a!!'=>0, 'd!!'=>0, 'c!!'=>0 +); + +# OS hackery +my $PDS = '/'; +if ($^O eq "MSWin32") +{ + $PDS = '\\'; +} + +# pick up the prefix for substitutions in this repo +my $PREFIX = &git_config('nethack','substprefix'); +print "PREFIX: '$PREFIX'\n" if($opt{v}); + +my @rawlist = &cmdparse(@ARGV); +push(@rawlist,'.') if($#rawlist == -1); + +while(@rawlist){ + my $raw = shift @rawlist; + if(-f $raw){ + &schedule_work($raw); + next; + } + if(-d $raw){ + if($raw =~ m!$PDS.git$!o){ + print "SKIP $raw\n" if($opt{v}>=2); + next; + } + opendir RDIR,$raw or die "Can't opendir: $raw"; + local($_); # needed until perl 5.11.2 + while($_ = readdir RDIR){ + next if(m/^\.\.?$/); + if(m/^\./ && $opt{f}){ + print " IGNORE-f: $raw$PDS$_\n" if($opt{v}>=2); + next; + } + push(@rawlist, $raw.$PDS.$_); + } + closedir RDIR; + } + # ignore other file types +} + +# XXX could batch things up - later + +sub schedule_work { + my($file) = @_; + print "CHECK: '$file'\n" if($opt{v}>=2); + local($_) = `git status --porcelain --ignored -- $file`; + my $key = $mode . join('',(m/^(.)(.)/)); + if(length $key == 1){ + # Hack. An unmodified, tracked file produces no output from + # git status. Treat as ignored. + $key .= '!!'; + } + $key =~ s/-/ /g; # for Keni's locally mod'ed git + if(!exists $codes{$key}){ + die "I'm lost.\nK='$key' F=$file\nST=$_"; + } + if($codes{$key}==0){ + if($opt{v}>=2){ + print " IGNORE: $_" if(length); + print " IGNORE: !! $file\n" if(!length); + } + return; + } + if($opt{F}){ + my $ign = `git check-ignore $file`; + if($ign !~ m/^\s*$/){ + print " IGNORE-F: $ign" if($opt{v}>=2); + return; + } + } +# FALLTHROUGH and continue +#print "ACCEPT TEST\n"; # XXXXXXXXXX TEST +#return; + + my $attr = `git check-attr NHSUBST -- $file`; + if($attr =~ m/NHSUBST:\s+(.*)/){ +# XXX this is a bug in git. What if the value of an attribute is the +# string "unset"? Sigh. + if(! $opt{F}){ + if($1 eq "unset" || $1 eq "unspecified"){ + print " NOATTR: $attr" if($opt{v}>=2); + return; + } + } + &process_file($file); + return; + } + die "Can't parse check-attr return: $attr\n"; +} + +sub process_file { + my($file) = @_; + print "DOFIL: $file\n" if($opt{v}>=1); + + # For speed we read in the entire file then do the substitutions. + local($_) = ''; + my $len; + open INFILE, "<", $file or die "Can't open $file: $!"; + while(1){ + # On at least some systems we only get 64K. + my $len = sysread(INFILE, $_, 999999, length($_)); + last if($len == 0); + die "read failed: $!" unless defined($len); + } + close INFILE; + + local $::current_file = $file; # used under handlevar + # $1 - var and value (including trailing space but not $) + # $2 - var + # $4 - value or undef +#s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\N{DOLLAR SIGN}]+))?)\$/&handlevar($2,$4)/eg; +my $count = s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\x24]+))?)\$/&handlevar($2,$4)/eg; +# XXX had o modifier, why? + return unless($count>0); + return if($opt{n}); + + my $ofile = $file . ".nht"; + open(TOUT, ">", $ofile) or die "Can't open $ofile"; + die "write failed: $!" unless defined syswrite(TOUT, $_); + close TOUT or die "Can't close $ofile"; + rename $ofile, $file or die "Can't rename $ofile to $file"; +} + +sub cmdparse { + my(@in) = @_; + + # What are we doing? + $opt{cmd} = 'date'; # really nhsub + if($in[0] eq '--add'){ + $opt{cmd} = 'add'; + shift @in; + } + if($in[0] eq '--commit'){ + $opt{cmd} = 'commit'; + shift @in; + } + +# add: -n -v +# commit: --dry-run -v +# nhsub: -n -v + while($in[0] =~ m/^-/){ + local($_) = $in[0]; + if($_ eq '--'){ + shift @in; + last; + } + if(m/^--/){ + if($opt{cmd} eq 'commit' && $_ eq '--dry-run'){ + $opt{'n'} = 1; + } + shift @in; + next; + } + if(m/^-(.*)/){ + foreach my $single ( split(//,$1) ){ + # don't do -v here from add/commit + if($single ne 'v'){ + $opt{$single}++; + } elsif($opt{cmd} eq 'date'){ + $opt{$single}++; + } + } + } + shift @in; + } + + ($mode) = ($opt{cmd} =~ m/^(.)/); + $mode = 'f' if($opt{cmd} eq 'date' && ($opt{f}||$opt{F})); + $mode = 'f' if($opt{cmd} eq 'add' && $opt{f}); + + return @in; # this is our file list +} + +sub git_config { + my($section, $var) = @_; + my $raw = `git config --local --get $section.$var`; + $raw =~ s/[\r\n]*$//g; + return $raw if(length $raw); + die "Missing config var: [$section] $var\n"; +} + +sub handlevar { + my($var, $val) = @_; +# print "HIT '$var' '$val'\n" if($debug2); + + my $subname = "PREFIX::$var"; + if(defined &$subname){ + no strict; + print " SUBIN: $var '$val'\n" if($opt{v}>=3); + $val =~ s/\s+$//; + $val = &$subname($val); + print " SUBOT: $var '$val'\n" if($opt{v}>=3); + } else { + warn "No handler for \$$PREFIX-$var\n"; + } + + if(length $val){ + return "\$$PREFIX-$var: $val \$"; + } else { + return "\$$PREFIX-$var\$"; + } +} + +package PREFIX; +use POSIX qw(strftime); + +# On push, put in the current date because we changed the file. +# On pull, keep the current value so we can see the last change date. +sub Date { + my($val) = @_; + # we add this to make merge easier for now XXX + my $now = time; # not %s below - may not be portable + # YYYY/MM/DD HH:MM:SS + $val = "$now " . strftime("%Y/%m/%d %H:%M:%S", gmtime($now)); + return $val; +} + +#sub Header { +#} +#sub Author { +#} + +# NB: the standard-ish Revision line isn't enough - you need Branch:Revision - +# but we split it into 2 so we can use the standard processing code on Revision +# and just slip Branch in. +sub Branch { + my($val) = @_; + $val = `git symbolic-ref -q --short HEAD`; + $val =~ s/[\n\r]*$//; + $val =~ s/^\*\s*//; + $val = "(unknown)" unless($val =~ m/^[[:print:]]+$/); + return $val; +} + +sub Revision { + my($val) = @_; + my @val = `git log --follow --oneline $::current_file`; + my $ver = 0+$#val; + $ver = 0 if($ver < 0); + $val = "1.$ver"; + return $val; +} +__END__ + +=head1 NAME + +C - NetHack git command for substitution variables + +=head1 SYNOPSIS + +C + +=head1 DESCRIPTION + +C rewrites the specified files by doing variable substitution for +variables starting with the prefix specified in the repository's +C configuration variable. C is also invoked +internally from the implementation of the C and C +commands. + +The program re-writes those files listed on the command line; if the file +is actually a directory, the program recurses into that directory tree. +Not all files found are re-written; some are ignored and those with no +substitution variables are not re-written. Unless changed by the options, +files that have not changed are not affected. + +If no files are listed on the command line, the current directory is +checked as if specified as C<.>. +Files listed directly on the command line are always checked. +The C<.git> directory is never processed. + +The following command line options are available: + +=over + +=item C<-v[v[v]]> + +Verbose output; may be (usefully) specified up to 3 times. Not available +when invoked as part of C or C. + +=item C<-n> + +Do not write any files. + +=item C<-f> + +Force, version 1: +Perform substitution even if the file has not changed, +except no dot files are processed unless listed directly on the command line. +This prevents accidents with editor temprorary files while recursing. Note +that this overloads the C<-f> option of C and C. + +=item C<-F> + +Force, version 2: +Perform substitution even if the file has not changed, +even if the NHSUBST attribute is not set for the +file, and only if the file is not ignored by git. Not available +when invoked as part of C or C. + +=back diff --git a/DEVEL/nhgitset.pl b/DEVEL/nhgitset.pl index 183c73d69..08068484a 100755 --- a/DEVEL/nhgitset.pl +++ b/DEVEL/nhgitset.pl @@ -3,7 +3,7 @@ # value of nethack.setupversion we will end up with when this is done # version 1 is reserved for repos checked out before versioning was added -my $version_new = 2; +my $version_new = 3; my $version_old = 0; # current version, if any (0 is no entry ergo new repo) use Cwd; @@ -100,16 +100,29 @@ print STDERR "Installing aliases\n" if($opt_v); $addpath = catfile(curdir(),'.git','hooks','NHadd'); &add_alias('nhadd', "!$addpath add"); &add_alias('nhcommit', "!$addpath commit"); +my $nhsub = catfile(curdir(),'.git','hooks','nhsub'); +&add_alias('nhsub', "!$nhsub"); print STDERR "Installing filter/merge\n" if($opt_v); -if($^O eq "MSWin32"){ - $cmd = '.git\\\\hooks\\\\NHtext'; -} else { - $cmd = catfile(curdir(),'.git','hooks','NHtext'); +# XXXX need it in NHadd to find nhsub??? +# removed at version 3 +#if($^O eq "MSWin32"){ +# $cmd = '.git\\\\hooks\\\\NHtext'; +#} else { +# $cmd = catfile(curdir(),'.git','hooks','NHtext'); +#} +#&add_config('filter.NHtext.clean', "$cmd --clean %f"); +#&add_config('filter.NHtext.smudge', "$cmd --smudge %f"); +if($version_old == 1 or $version_old == 2){ + print STDERR "Removing filter.NHtext\n" if($opt_v); + system('git','config','--unset','filter.NHtext.clean') unless($opt_n); + system('git','config','--unset','filter.NHtext.smudge') unless($opt_n); + system('git','config','--remove-section','filter.NHtext') unless($opt_n); + + print STDERR "Removing NHtext\n" if($opt_v); + unlink catfile(curdir(),'.git','hooks','NHtext') unless($opt_n); } -&add_config('filter.NHtext.clean', "$cmd --clean %f"); -&add_config('filter.NHtext.smudge', "$cmd --smudge %f"); $cmd = catfile(curdir(),'.git','hooks','NHsubst'); &add_config('merge.NHsubst.name', 'NetHack Keyword Substitution'); diff --git a/dat/.gitattributes b/dat/.gitattributes index 72aa05edd..b59108e49 100644 --- a/dat/.gitattributes +++ b/dat/.gitattributes @@ -1,3 +1,3 @@ -*.def filter=NHtext merge=NHsubst -*.des filter=NHtext merge=NHsubst -*.txt filter=NHtext merge=NHsubst +*.def NHSUBST +*.des NHSUBST +*.txt NHSUBST diff --git a/doc/.gitattributes b/doc/.gitattributes index 9ca881076..a9a06f4c8 100644 --- a/doc/.gitattributes +++ b/doc/.gitattributes @@ -1,5 +1,5 @@ -*.mn filter=NHtext merge=NHsubst -*.6 filter=NHtext merge=NHsubst -fixes.* filter=NHtext merge=NHsubst -window.doc filter=NHtext merge=NHsubst +*.mn NHSUBST +*.6 NHSUBST +fixes.* NHSUBST +window.doc NHSUBST diff --git a/sys/amiga/.gitattributes b/sys/amiga/.gitattributes index 7a28030a9..7735c64ea 100644 --- a/sys/amiga/.gitattributes +++ b/sys/amiga/.gitattributes @@ -1 +1 @@ -*.p filter=NHtext merge=NHsubst +*.p NHSUBST diff --git a/sys/mac/.gitattributes b/sys/mac/.gitattributes index 62b9832d7..8f8defc69 100644 --- a/sys/mac/.gitattributes +++ b/sys/mac/.gitattributes @@ -1 +1 @@ -NHDeflts filter=NHtext merge=NHsubst +NHDeflts NHSUBST diff --git a/sys/msdos/.gitattributes b/sys/msdos/.gitattributes index baef52e46..7e8941f2d 100644 --- a/sys/msdos/.gitattributes +++ b/sys/msdos/.gitattributes @@ -1,4 +1,4 @@ -*.BC filter=NHtext merge=NHsubst -*.bat filter=NHtext merge=NHsubst -Makefile.* filter=NHtext merge=NHsubst -Install.* filter=NHtext merge=NHsubst +*.BC NHSUBST +*.bat NHSUBST +Makefile.* NHSUBST +Install.* NHSUBST diff --git a/sys/os2/.gitattributes b/sys/os2/.gitattributes index 8cffb77ae..31e18fe84 100644 --- a/sys/os2/.gitattributes +++ b/sys/os2/.gitattributes @@ -1 +1 @@ -Makefile.* filter=NHtext merge=NHsubst +Makefile.* NHSUBST diff --git a/sys/share/.gitattributes b/sys/share/.gitattributes index 8cffb77ae..31e18fe84 100644 --- a/sys/share/.gitattributes +++ b/sys/share/.gitattributes @@ -1 +1 @@ -Makefile.* filter=NHtext merge=NHsubst +Makefile.* NHSUBST diff --git a/sys/unix/.gitattributes b/sys/unix/.gitattributes index 8cffb77ae..31e18fe84 100644 --- a/sys/unix/.gitattributes +++ b/sys/unix/.gitattributes @@ -1 +1 @@ -Makefile.* filter=NHtext merge=NHsubst +Makefile.* NHSUBST diff --git a/sys/unix/hints/.gitattributes b/sys/unix/hints/.gitattributes index a079959f1..db77844f7 100644 --- a/sys/unix/hints/.gitattributes +++ b/sys/unix/hints/.gitattributes @@ -1 +1 @@ -* filter=NHtext merge=NHsubst +* NHSUBST diff --git a/sys/vms/.gitattributes b/sys/vms/.gitattributes index 8cffb77ae..31e18fe84 100644 --- a/sys/vms/.gitattributes +++ b/sys/vms/.gitattributes @@ -1 +1 @@ -Makefile.* filter=NHtext merge=NHsubst +Makefile.* NHSUBST diff --git a/sys/wince/.gitattributes b/sys/wince/.gitattributes index e034edc5e..fbe75bcd4 100644 --- a/sys/wince/.gitattributes +++ b/sys/wince/.gitattributes @@ -1,3 +1,3 @@ -*.ce filter=NHtext merge=NHsubst -*.mak filter=NHtext merge=NHsubst -*.bat filter=NHtext merge=NHsubst +*.ce NHSUBST +*.mak NHSUBST +*.bat NHSUBST diff --git a/sys/winnt/.gitattributes b/sys/winnt/.gitattributes index 2a38b029c..88f970c96 100644 --- a/sys/winnt/.gitattributes +++ b/sys/winnt/.gitattributes @@ -1,4 +1,4 @@ -Install.nt filter=NHtext merge=NHsubst -Makefile.* filter=NHtext merge=NHsubst -*.rc filter=NHtext merge=NHsubst -*.bat filter=NHtext merge=NHsubst +Install.nt NHSUBST +Makefile.* NHSUBST +*.rc NHSUBST +*.bat NHSUBST diff --git a/util/.gitattributes b/util/.gitattributes index 15e23d268..8b2657e61 100644 --- a/util/.gitattributes +++ b/util/.gitattributes @@ -1,2 +1,2 @@ -*.pl filter=NHtext merge=NHsubst -*.[ly] filter=NHtext merge=NHsubst +*.pl NHSUBST +*.[ly] NHSUBST From ca80675d590cbffcb9abd4a79bf01ceb97eef0b3 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 18:14:10 +0300 Subject: [PATCH 324/354] Allow admin to disable explore mode Some public servers want to disable explore mode, so make it configurable in sysconf. --- doc/Guidebook.mn | 4 ++++ doc/Guidebook.tex | 4 ++++ include/sys.h | 1 + src/cmd.c | 8 ++++++++ src/files.c | 3 +++ src/sys.c | 1 + sys/unix/sysconf | 3 +++ sys/winnt/sysconf | 3 +++ 8 files changed, 27 insertions(+) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index df7301a81..4293fdb3e 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2922,6 +2922,10 @@ SHELLERS A list of users who are allowed to use the shell escape command (!). The syntax is the same as WIZARDS. .lp +EXPLORERS +A list of users who are allowed to use the explore mode. The +syntax is the same as WIZARDS. +.lp MAXPLAYERS Limit the maximum number of games that can be running at the same time. .lp diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 7c2464664..5f1ae5e4b 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -3494,6 +3494,10 @@ asterisk (*) allows anyone to start a game in wizard mode. A list of users who are allowed to use the shell escape command (!). The syntax is the same as WIZARDS. %.lp +\item[\ib{EXPLORERS}] +A list of users who are allowed to use the explore mode. +The syntax is the same as WIZARDS. +%.lp \item[\ib{MAXPLAYERS}] Limit the maximum number of games taht can be running at the same time. %.lp diff --git a/include/sys.h b/include/sys.h index b97f7ca80..84d42b5b6 100644 --- a/include/sys.h +++ b/include/sys.h @@ -10,6 +10,7 @@ struct sysopt { char *support; /* local support contact */ char *recover; /* how to run recover - may be overridden by win port */ char *wizards; + char *explorers; char *shellers; /* like wizards, for ! command (-DSHELL) */ char *debugfiles; /* files to show debugplines in. '*' is all. */ int env_dbgfl; /* 1: debugfiles comes from getenv("DEBUGFILES") diff --git a/src/cmd.c b/src/cmd.c index 8b7408533..b028c57a3 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -509,6 +509,14 @@ enter_explore_mode(VOID_ARGS) } else if (discover) { You("are already in explore mode."); } else { +#ifdef SYSCF + if (!sysopt.explorers || + !sysopt.explorers[0] || + !check_user_string(sysopt.explorers)) { + You("cannot access explore mode."); + return 0; + } +#endif pline( "Beware! From explore mode there will be no return to normal game."); if (paranoid_query(ParanoidQuit, diff --git a/src/files.c b/src/files.c index ace417e7d..179cd3437 100644 --- a/src/files.c +++ b/src/files.c @@ -2184,6 +2184,9 @@ int src; } else if (src == SET_IN_SYS && match_varname(buf, "SHELLERS", 8)) { if (sysopt.shellers) free(sysopt.shellers); sysopt.shellers = dupstr(bufp); + } else if (src == SET_IN_SYS && match_varname(buf, "EXPLORERS", 7)) { + if (sysopt.explorers) free(sysopt.explorers); + sysopt.explorers = dupstr(bufp); } else if (src == SET_IN_SYS && match_varname(buf, "DEBUGFILES", 5)) { if (sysopt.debugfiles) free(sysopt.debugfiles); /* if showdebug() has already been called (perhaps we've added diff --git a/src/sys.c b/src/sys.c index 35e46b7c8..6ca0017f7 100644 --- a/src/sys.c +++ b/src/sys.c @@ -33,6 +33,7 @@ sys_early_init() #endif sysopt.env_dbgfl = 0; /* haven't checked getenv("DEBUGFILES") yet */ sysopt.shellers = NULL; + sysopt.explorers = NULL; sysopt.maxplayers = 0; /* XXX eventually replace MAX_NR_OF_PLAYERS */ /* record file */ diff --git a/sys/unix/sysconf b/sys/unix/sysconf index cff28b04f..50fa74085 100644 --- a/sys/unix/sysconf +++ b/sys/unix/sysconf @@ -14,6 +14,9 @@ WIZARDS=root games # Uses the same syntax as the WIZARDS option above. #SHELLERS= +# Users allowed to use #exploremode. Same syntax as WIZARDS above. +EXPLORERS=* + # Show debugging information originating from these source files. # Use '*' for all, or list source files separated by spaces. # Only available if game has been compiled with DEBUG. diff --git a/sys/winnt/sysconf b/sys/winnt/sysconf index 67c0b814d..808546da8 100644 --- a/sys/winnt/sysconf +++ b/sys/winnt/sysconf @@ -14,6 +14,9 @@ WIZARDS=* # Uses the same syntax as the WIZARDS option above. #SHELLERS= +# Users allowed to use #exploremode. Same syntax as WIZARDS above. +EXPLORERS=* + # Show debugging information originating from these source files. # Use '*' for all, or list source files separated by spaces. # Only available if game has been compiled with DEBUG. From 322d004e12e894508de025d416cf615e9c07426f Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 18:32:23 +0300 Subject: [PATCH 325/354] Some spam for mail daemon to deliver --- src/mail.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mail.c b/src/mail.c index cc01b97d3..c4cf8f61c 100644 --- a/src/mail.c +++ b/src/mail.c @@ -437,6 +437,11 @@ struct obj *otmp; "Only Amiga makes it possible.", "CATS have all the answers.", #endif + "This mail complies with the Yendorian Anti-Spam Act (YASA)", + "Please find enclosed a small token to represent your Owlbear", + "**FR33 P0T10N 0F FULL H34L1NG**", + "Please return to sender (Asmodeus)", + "Buy a potion of gain level for only $19.99! Guaranteed to be blessed!", "Invitation: Visit the NetHack web site at http://www.nethack.org!" }; From fdd49dde86f935dbade9dffa633655357850cc48 Mon Sep 17 00:00:00 2001 From: keni Date: Tue, 31 Mar 2015 12:29:58 -0400 Subject: [PATCH 326/354] Update docs for NHDT V2. --- DEVEL/Developer.txt | 8 ++++---- DEVEL/git_recipes.txt | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/DEVEL/Developer.txt b/DEVEL/Developer.txt index 5e9e76356..49cebe12f 100644 --- a/DEVEL/Developer.txt +++ b/DEVEL/Developer.txt @@ -136,9 +136,9 @@ B. Enabling variable expansion Variable expansion is controlled by the .gitattributes file. To enable variable expansion: - pattern filter=NHtext merge=NHsubst + pattern NHSUBST To disable variable expansion: - pattern -filter + pattern -NHSUBST More information: "git help gitattributes" @@ -147,8 +147,8 @@ C. Oddities instead of "git add" or "git commit." Nothing terrible will happen if you use the wrong one, but the values will not be updated. - Due to the way this abuses git filters, the updated values are not visible - in your working tree. + Variable expansion modifies the files in the work tree - your editor or + IDE may or may not be happy with this. D. Using your own hooks You can use your own hooks - put them in .git/hooks as usual BUT name them diff --git a/DEVEL/git_recipes.txt b/DEVEL/git_recipes.txt index 5e8d872f9..1a2ec0acf 100644 --- a/DEVEL/git_recipes.txt +++ b/DEVEL/git_recipes.txt @@ -42,9 +42,12 @@ you specify: Adds the changes you've made in (filename) to the pre-commit staging area. (also referred to as the 'index') + OR +Make a new file be tracked by git. "nhadd" is the preferred syntax and will automatically update the source file -headers with the latest date, branch, and version. +headers with the latest date, branch, and version. See Developer.txt for +details. [*] git commit [-a] [-m "text"] @@ -57,7 +60,8 @@ Including -m will use "text" as the commit message instead of opening an editor window for you to create one. "nhcommit" is the preferred syntax and will automatically update the source file -headers with the latest date, branch, and version. +headers with the latest date, branch, and version. See Developer.txt for +details. [*] git push [--all] [-u origin (branch)] From 055cc1b4d57151686dfb9f55999f652f9a077509 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 31 Mar 2015 21:40:49 +0300 Subject: [PATCH 327/354] Show legal jumping positions --- doc/fixes35.0 | 1 + src/apply.c | 68 +++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 53 insertions(+), 16 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 2d3b8c7ad..46b87d58f 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -893,6 +893,7 @@ boomerang makes noise when hitting a sink non-pet rust monsters would eat rust-proofed non-digestibles but ignore those non-digestibles otherwise kicking a grave may topple the gravestone +allow showing legal jumping positions when asked for location to jump to Platform- and/or Interface-Specific Fixes diff --git a/src/apply.c b/src/apply.c index 386365f49..65482c337 100644 --- a/src/apply.c +++ b/src/apply.c @@ -20,6 +20,7 @@ STATIC_DCL void FDECL(use_candelabrum, (struct obj *)); STATIC_DCL void FDECL(use_candle, (struct obj **)); STATIC_DCL void FDECL(use_lamp, (struct obj *)); STATIC_DCL void FDECL(light_cocktail, (struct obj *)); +STATIC_PTR void FDECL(display_jump_positions, (int)); STATIC_DCL void FDECL(use_tinning_kit, (struct obj *)); STATIC_DCL void FDECL(use_figurine, (struct obj **)); STATIC_DCL void FDECL(use_grease, (struct obj *)); @@ -1361,6 +1362,53 @@ dojump() return jump(0); } +boolean +is_valid_jump_pos(x,y, magic, showmsg) +int x,y, magic; +boolean showmsg; +{ + if (!magic && !(HJumping & ~INTRINSIC) && !EJumping && + distu(x, y) != 5) { + /* The Knight jumping restriction still applies when riding a + * horse. After all, what shape is the knight piece in chess? + */ + if (showmsg) pline("Illegal move!"); + return FALSE; + } else if (distu(x, y) > (magic ? 6+magic*3 : 9)) { + if (showmsg) pline("Too far!"); + return FALSE; + } else if (!cansee(x, y)) { + if (showmsg) You("cannot see where to land!"); + return FALSE; + } else if (!isok(x, y)) { + if (showmsg) You("cannot jump there!"); + return FALSE; + } + return TRUE; +} + +int jumping_is_magic; + +void +display_jump_positions(state) +int state; +{ + if (state == 0) { + tmp_at(DISP_BEAM, cmap_to_glyph(S_flashbeam)); + } else if (state == 1) { + int x,y, dx, dy; + for (dx = -4; dx <= 4; dx++) + for (dy = -4; dy <= 4; dy++) { + x = dx + (int)u.ux; + y = dy + (int)u.uy; + if (isok(x,y) && is_valid_jump_pos(x,y, jumping_is_magic, FALSE)) + tmp_at(x,y); + } + } else { + tmp_at(DISP_END, 0); + } +} + int jump(magic) int magic; /* 0=Physical, otherwise skill level */ @@ -1440,24 +1488,12 @@ int magic; /* 0=Physical, otherwise skill level */ pline("Where do you want to jump?"); cc.x = u.ux; cc.y = u.uy; + jumping_is_magic = magic; + getpos_sethilite(display_jump_positions); if (getpos(&cc, TRUE, "the desired position") < 0) return 0; /* user pressed ESC */ - if (!magic && !(HJumping & ~INTRINSIC) && !EJumping && - distu(cc.x, cc.y) != 5) { - /* The Knight jumping restriction still applies when riding a - * horse. After all, what shape is the knight piece in chess? - */ - pline("Illegal move!"); - return 0; - } else if (distu(cc.x, cc.y) > (magic ? 6+magic*3 : 9)) { - pline("Too far!"); - return 0; - } else if (!cansee(cc.x, cc.y)) { - You("cannot see where to land!"); - return 0; - } else if (!isok(cc.x, cc.y)) { - You("cannot jump there!"); - return 0; + if (!is_valid_jump_pos(cc.x, cc.y, magic, TRUE)) { + return 0; } else { coord uc; int range, temp; From 8fb23b4a4113cf275cb560afdbafc1e07b0d04b0 Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 31 Mar 2015 19:07:25 -0400 Subject: [PATCH 328/354] non-Unix build was broken today Changes to be committed: modified: src/cmd.c ../src/cmd.c(515) : warning C4013: 'check_user_string' undefined; assuming extern returning int) link error - cmd.o : error LNK2019: unresolved external symbol _check_user_string referenced in function _enter_explore_mode --- src/cmd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cmd.c b/src/cmd.c index b028c57a3..3798a4fb0 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -510,12 +510,14 @@ enter_explore_mode(VOID_ARGS) You("are already in explore mode."); } else { #ifdef SYSCF +# if defined(UNIX) if (!sysopt.explorers || !sysopt.explorers[0] || !check_user_string(sysopt.explorers)) { You("cannot access explore mode."); return 0; } +# endif #endif pline( "Beware! From explore mode there will be no return to normal game."); From 3f885ef58356453f322f77e5e762cf7b39c67061 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 1 Apr 2015 08:29:12 +0300 Subject: [PATCH 329/354] Remove EXPLORERS from winnt sysconf Stupidly added this to the winnt sysconf, when it should've been *nix only. --- sys/winnt/sysconf | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/winnt/sysconf b/sys/winnt/sysconf index 808546da8..67c0b814d 100644 --- a/sys/winnt/sysconf +++ b/sys/winnt/sysconf @@ -14,9 +14,6 @@ WIZARDS=* # Uses the same syntax as the WIZARDS option above. #SHELLERS= -# Users allowed to use #exploremode. Same syntax as WIZARDS above. -EXPLORERS=* - # Show debugging information originating from these source files. # Use '*' for all, or list source files separated by spaces. # Only available if game has been compiled with DEBUG. From d3205d98d648a890135b8e07119c9302f35a8ca7 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 1 Apr 2015 02:47:04 -0700 Subject: [PATCH 330/354] X11 menu hack for ':' Same functionality as was recently implemented for tty. If a character like ':' is an explicit menu selector and the player types it, select that menu entry rather than treating it as a search request. (Same for other menu commands like '>', but offhand I can't think of anything besides container looting's ': - look inside' that uses any non-letter selectors other than '$', which isn't used as a menu meta command.) --- win/X11/winmenu.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/win/X11/winmenu.c b/win/X11/winmenu.c index b28dc3361..6ab51fae9 100644 --- a/win/X11/winmenu.c +++ b/win/X11/winmenu.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 winmenu.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 winmenu.c $NHDT-Date: 1427881480 2015/04/01 09:44:40 $ $NHDT-Branch: master $:$NHDT-Revision: 1.5 $ */ /* NetHack 3.5 winmenu.c $Date: 2009/05/06 10:55:53 $ $Revision: 1.5 $ */ /* SCCS Id: @(#)winmenu.c 3.5 1996/08/15 */ /* Copyright (c) Dean Luick, 1992 */ @@ -206,6 +206,7 @@ menu_key(w, event, params, num_params) struct xwindow *wp; char ch; int count; + boolean selected_something; wp = find_widget(w); menu_info = wp->menu_information; @@ -218,6 +219,13 @@ menu_key(w, event, params, num_params) } if (menu_info->is_active) { /* waiting for input */ + /* first check for an explicit selector match, so that it won't be + overridden if it happens to duplicate a mapped menu command (':' + to look inside a container vs ':' to select via search string) */ + for (curr = menu_info->curr_menu.base; curr; curr = curr->next) + if (curr->identifier.a_void != 0 && curr->selector == ch) + goto make_selection; + ch = map_menu_cmd(ch); if (ch == '\033') { /* quit */ if (menu_info->counting) { @@ -294,7 +302,8 @@ menu_key(w, event, params, num_params) X11_nhbell(); return; } else { - boolean selected_something = FALSE; + make_selection: + selected_something = FALSE; for (count = 0, curr = menu_info->curr_menu.base; curr; curr = curr->next, count++) if (curr->identifier.a_void != 0 && curr->selector == ch) break; From fa4dda377d089568cde045b81c8ce1700cf60916 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 1 Apr 2015 16:38:56 +0300 Subject: [PATCH 331/354] Move isqrt into hacklib, other minor fixage --- include/extern.h | 3 ++- src/hacklib.c | 8 ++++++++ src/sp_lev.c | 9 +-------- src/spell.c | 24 ------------------------ 4 files changed, 11 insertions(+), 33 deletions(-) diff --git a/include/extern.h b/include/extern.h index 00d10a98f..4e2780c6b 100644 --- a/include/extern.h +++ b/include/extern.h @@ -828,6 +828,7 @@ E char *FDECL(sitoa, (int)); E int FDECL(sgn, (int)); E int FDECL(rounddiv, (long,int)); E int FDECL(dist2, (int,int,int,int)); +E int FDECL(isqrt, (int)); E int FDECL(distmin, (int,int,int,int)); E boolean FDECL(online2, (int,int,int,int)); E boolean FDECL(pmatch, (const char *,const char *)); @@ -1138,7 +1139,7 @@ E void FDECL(dodoor, (int,int,struct mkroom *)); E void FDECL(mktrap, (int,int,struct mkroom *,coord*)); E void FDECL(mkstairs, (XCHAR_P,XCHAR_P,CHAR_P,struct mkroom *)); E void NDECL(mkinvokearea); -E void FDECL(mineralize, (int, int, int, int, boolean)); +E void FDECL(mineralize, (int, int, int, int, BOOLEAN_P)); /* ### mkmap.c ### */ diff --git a/src/hacklib.c b/src/hacklib.c index 4fdbceb80..a9c31d42d 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -432,6 +432,14 @@ dist2(x0, y0, x1, y1) /* square of euclidean distance between pair of pts */ return dx * dx + dy * dy; } +/* Integer square root function without using floating point. + * This could be replaced by a faster algorithm, but has not been because: + * + the simple algorithm is easy to read + * + this algorithm does not require 64-bit support + * + in current usage, the values passed to isqrt() are not really that + * large, so the performance difference is negligible + * + isqrt() is used in only few places, which are not bottle-necks + */ int isqrt(val) int val; diff --git a/src/sp_lev.c b/src/sp_lev.c index 6e42b2c31..09005a32e 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -1303,6 +1303,7 @@ struct mkroom *croom; if (mtmp) { x = mtmp->mx, y = mtmp->my; /* sanity precaution */ + m->x = x, m->y = y; /* handle specific attributes for some special monsters */ if (m->name.str) mtmp = christen_monst(mtmp, m->name.str); @@ -2067,7 +2068,6 @@ struct mkroom *mkr; { boolean okroom; struct mkroom *aroom; - short i; xchar rtype = (!r->chance || rn2(100) < r->chance) ? r->rtype : OROOM; if(mkr) { @@ -2915,7 +2915,6 @@ void spo_room(coder) struct sp_coder *coder; { - int isbigrm = FALSE; if (coder->n_subroom > MAX_NESTED_ROOMS) panic("Too deeply nested rooms?!"); else { @@ -2950,8 +2949,6 @@ spo_room(coder) /*tmproom.irregular = (OV_i(flags) & (1 << 1));*/ tmproom.joined = !(OV_i(flags) & (1 << 2)); - isbigrm = ((tmproom.w * tmproom.h) > 20); - opvar_free(x); opvar_free(y); opvar_free(w); @@ -4162,7 +4159,6 @@ spo_map(coder) struct opvar *mpxs, *mpys, *mpmap, *mpa, *mpkeepr, *mpzalign; xchar halign, valign; xchar tmpxstart, tmpystart, tmpxsize, tmpysize; - int tryct = 0; unpacked_coord upc; if (!OV_pop_i(mpxs) || @@ -4172,8 +4168,6 @@ spo_map(coder) !OV_pop_i(mpzalign) || !OV_pop_c(mpa)) return; -redo_maploc: - tmpmazepart.xsize = OV_i(mpxs); tmpmazepart.ysize = OV_i(mpys); tmpmazepart.zaligntyp = OV_i(mpzalign); @@ -4281,7 +4275,6 @@ redo_maploc: xsize = tmpxsize; ysize = tmpysize; } -skipmap: opvar_free(mpxs); opvar_free(mpys); opvar_free(mpmap); diff --git a/src/spell.c b/src/spell.c index 5ce0a6015..2ccf7eea6 100644 --- a/src/spell.c +++ b/src/spell.c @@ -42,7 +42,6 @@ STATIC_DCL int NDECL(throwspell); STATIC_DCL void NDECL(cast_protection); STATIC_DCL void FDECL(spell_backfire, (int)); STATIC_DCL const char *FDECL(spelltypemnemonic, (int)); -STATIC_DCL int FDECL(isqrt, (int)); /* The roles[] table lists the role-specific values for tuning * percent_success(). @@ -1433,29 +1432,6 @@ int *spell_no; return FALSE; } -/* Integer square root function without using floating point. - * This could be replaced by a faster algorithm, but has not been because: - * + the simple algorithm is easy to read - * + this algorithm does not require 64-bit support - * + in current usage, the values passed to isqrt() are not really that - * large, so the performance difference is negligible - * + isqrt() is used in only one place - * + that one place is not a bottle-neck - */ -STATIC_OVL int -isqrt(val) -int val; -{ - int rt = 0; - int odd = 1; - while(val >= odd) { - val = val-odd; - odd = odd+2; - rt = rt + 1; - } - return rt; -} - STATIC_OVL int percent_success(spell) int spell; From 7d94548951072a5c55df8fad59145262971ecd13 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 1 Apr 2015 17:39:51 +0300 Subject: [PATCH 332/354] Doors must be linked afterwards --- src/sp_lev.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/sp_lev.c b/src/sp_lev.c index 09005a32e..c3b3eec61 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -521,6 +521,27 @@ remove_boundary_syms() } } +void +link_doors_rooms() +{ + xchar x,y; + for (y = 0; y < ROWNO; y++) + for (x = 0; x < COLNO; x++) + if (IS_DOOR(levl[x][y].typ) || levl[x][y].typ == SDOOR) { + struct mkroom *droom = rooms; + /* Now the complicated part, list it with each subroom */ + /* The dog move and mail daemon routines use this */ + while(droom->hx >= 0 && doorindex < DOORMAX) { + if(droom->hx >= x-1 && droom->lx <= x+1 && + droom->hy >= y-1 && droom->ly <= y+1) { + /* Found it */ + add_door(x, y, droom); + } + droom++; + } + } +} + void fill_rooms() { @@ -1118,7 +1139,6 @@ redoloop: ; impossible("create_door: Can't find a proper place!"); return; } - add_door(x,y,broom); levl[x][y].typ = (dd->secret ? SDOOR : DOOR); levl[x][y].doormask = dd->mask; } @@ -1156,7 +1176,6 @@ create_secret_door(croom, walls) if(okdoor(sx,sy)) { levl[sx][sy].typ = SDOOR; levl[sx][sy].doormask = D_CLOSED; - add_door(sx,sy,croom); return; } } @@ -3662,8 +3681,6 @@ sel_set_door(dx,dy,arg) xchar typ = (*(xchar *)arg); xchar x = dx; xchar y = dy; - struct mkroom *droom; - droom = &rooms[0]; /*get_location(&x, &y, DRY, (struct mkroom *)0);*/ if (!IS_DOOR(levl[x][y].typ) && levl[x][y].typ != SDOOR) levl[x][y].typ = (typ & D_SECRET) ? SDOOR : DOOR; @@ -3674,18 +3691,6 @@ sel_set_door(dx,dy,arg) } levl[x][y].doormask = typ; SpLev_Map[x][y] = 1; - - /* Now the complicated part, list it with each subroom */ - /* The dog move and mail daemon routines use this */ - while(droom->hx >= 0 && doorindex < DOORMAX) { - if(droom->hx >= x-1 && droom->lx <= x+1 && - droom->hy >= y-1 && droom->ly <= y+1) { - /* Found it */ - add_door(x, y, droom); - } - droom++; - } - } @@ -5065,6 +5070,7 @@ next_opcode: coder->frame->n_opcode++; } /*while*/ + link_doors_rooms(); fill_rooms(); remove_boundary_syms(); wallification(1, 0, COLNO-1, ROWNO-1); From 97fe3214c766c70cc844a23ef14666faa183bdb4 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 1 Apr 2015 18:24:15 +0300 Subject: [PATCH 333/354] Remove unused code --- src/sp_lev.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/sp_lev.c b/src/sp_lev.c index c3b3eec61..1e1327ec5 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -4810,15 +4810,6 @@ sp_lev *lvl; opvar_free(tmpv); } break; - /* - case SPO_COREFUNC: - { - struct opvar *a; - if (!OV_pop_i(a)) break; - spo_corefunc(coder, OV_i(a)); - } - break; - */ case SPO_DICE: { struct opvar *a, *b, *t; From f3bbd833c0da27a03fdc518d077376bebfd4e235 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 1 Apr 2015 18:30:35 +0300 Subject: [PATCH 334/354] Fix mazes not getting stocked --- src/sp_lev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sp_lev.c b/src/sp_lev.c index 1e1327ec5..5aeeb30b7 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -2189,7 +2189,7 @@ int humidity; x = rn1(x_maze_max - 3, 3); y = rn1(y_maze_max - 3, 3); if (--tryct < 0) break; /* give up */ - } while (!(x % 2) || !(y % 2) || !SpLev_Map[x][y] || + } while (!(x % 2) || !(y % 2) || SpLev_Map[x][y] || !is_ok_location((schar)x, (schar)y, humidity)); m->x = (xchar)x, m->y = (xchar)y; From a883d3c78b354ae076a0e72ebf8154b766707292 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 1 Apr 2015 19:00:56 +0300 Subject: [PATCH 335/354] Generate minetown guards after subrooms --- dat/mines.des | 60 ++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/dat/mines.des b/dat/mines.des index 151026ff1..c8be29d35 100644 --- a/dat/mines.des +++ b/dat/mines.des @@ -193,13 +193,6 @@ ROOM: "ordinary" , lit, (3,3), (center,center), (31,15) { FOUNTAIN: (17, 5) FOUNTAIN: (13, 8) -# The Town Watch -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watch captain"), random, peaceful - SUBROOM: "ordinary", random, (2,0), (2,2) { ROOMDOOR: false, closed, west, random } @@ -275,6 +268,13 @@ SUBROOM: "ordinary", lit, (18,10), (4,3) { MONSTER: ('G', "gnome lord"), random } +# The Town Watch +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watch captain"), random, peaceful + } ROOM: "ordinary" , random, random, random, random { @@ -307,11 +307,6 @@ LEVEL: "minetn-3" ROOM: "ordinary",lit,(3,3),(center,center),(31,15) { FOUNTAIN:(01,06) FOUNTAIN:(29,13) -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watch captain"), random, peaceful SUBROOM:"ordinary",random,(2,2),(2,2) { ROOMDOOR: false,closed,south,random @@ -383,6 +378,12 @@ SUBROOM: "candle shop",lit,(25,2),(3,3) { ROOMDOOR:false,closed,south,random } +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watch captain"), random, peaceful + } ROOM: "ordinary", random, random, random, random { @@ -415,11 +416,6 @@ LEVEL: "minetn-4" ROOM: "ordinary",lit,(3,3),(center,center),(30,15) { FOUNTAIN:(08,07) FOUNTAIN:(18,07) -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watch captain"), random, peaceful SUBROOM:"book shop",lit,(4,2),(3,3) { ROOMDOOR: false,closed,south,random @@ -479,6 +475,12 @@ SUBROOM:"shop" [90%],lit,(23,10),(3,3) { ROOMDOOR:false,closed,north,random } +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watch captain"), random, peaceful + } ROOM: "ordinary" , random, random, random, random { @@ -691,18 +693,6 @@ ROOM: "ordinary" , lit, (3,3), (center,center), (30,15) { FOUNTAIN: (12, 07) FOUNTAIN: (11, 13) -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watchman"), random, peaceful -MONSTER: ('@', "watch captain"), random, peaceful -MONSTER:('G',"gnome"),random -MONSTER:('G',"gnome"),random -MONSTER:('G',"gnome"),random -MONSTER:('G',"gnome lord"),random -MONSTER:('Y',"monkey"),random -MONSTER:('Y',"monkey"),random - SUBROOM: "ordinary", random, (2,2), (4,2) { ROOMDOOR: false, closed, south, random } @@ -786,6 +776,18 @@ SUBROOM: "temple", lit, (24,6), (4,4) { MONSTER: ('G', "gnomish wizard"), random } +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watchman"), random, peaceful +MONSTER: ('@', "watch captain"), random, peaceful +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome"),random +MONSTER:('G',"gnome lord"),random +MONSTER:('Y',"monkey"),random +MONSTER:('Y',"monkey"),random + } ROOM: "ordinary" , random, random, random, random { From 5bbde14a392d222f6e37b778385b23bbfdab4662 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 1 Apr 2015 19:02:52 +0300 Subject: [PATCH 336/354] Generate oracle monsters after subroom --- dat/oracle.des | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dat/oracle.des b/dat/oracle.des index 2b7fd8c33..095b40928 100644 --- a/dat/oracle.des +++ b/dat/oracle.des @@ -17,8 +17,6 @@ ROOM: "ordinary" , lit, (3,3), (center,center), (11,9) { OBJECT:('`',"statue"),(5,7),montype:'C',1 OBJECT:('`',"statue"),(2,4),montype:'C',1 OBJECT:('`',"statue"),(8,4),montype:'C',1 - MONSTER: random, random - MONSTER: random, random SUBROOM: "delphi" , lit , (4,3) , (3,3) { FOUNTAIN: (0, 1) @@ -28,6 +26,10 @@ ROOM: "ordinary" , lit, (3,3), (center,center), (11,9) { MONSTER: ('@', "Oracle"), (1,1) ROOMDOOR: false , nodoor , random, random } + + MONSTER: random, random + MONSTER: random, random + } ROOM: "ordinary" , random, random, random, random { From 32236f7985bebaa5cc696fe7a18af320d028a5c5 Mon Sep 17 00:00:00 2001 From: keni Date: Wed, 1 Apr 2015 14:40:48 -0400 Subject: [PATCH 337/354] bug fixes for nhsub --- DEVEL/hooksdir/nhsub | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/DEVEL/hooksdir/nhsub b/DEVEL/hooksdir/nhsub index b8cdd9f67..5238f422a 100644 --- a/DEVEL/hooksdir/nhsub +++ b/DEVEL/hooksdir/nhsub @@ -1,6 +1,6 @@ #!/usr/bin/perl # nhsub -# $NHDT-Date: 1427408239 2015/03/26 22:17:19 $ +# $NHDT-Date: 1427913635 2015/04/01 18:40:35 $ # Note: was originally called nhdate; the rename is not reflected in the code. @@ -8,6 +8,10 @@ use strict; my %opt; #cmd v n f F (other single char, but we don't care) my $mode; # a c d f (add, commit, date, date -f) +if(length $ENV{GIT_PREFIX}){ + chdir($ENV{GIT_PREFIX}) or die "Can't chdir $ENV{GIT_PREFIX}: $!"; +} + #SO how do we know if a file has changed? #(git status: git status --porcelain --ignored -- FILES. #maybe + -z but it's a question of rename operations - probably doesn't @@ -70,7 +74,10 @@ my %codes = ( 'd??'=>0, 'c??'=>0, 'f!!'=>1, # !! ignored - 'a!!'=>0, 'd!!'=>0, 'c!!'=>0 + 'a!!'=>0, 'd!!'=>0, 'c!!'=>0, + + 'f@@'=>1, # @@ internal ignored + 'a@@'=>0, 'd@@'=>0, 'c@@'=>0 ); # OS hackery @@ -111,6 +118,9 @@ while(@rawlist){ closedir RDIR; } # ignore other file types + if(! -e $raw){ + print "warning: missing file $raw\n"; + } } # XXX could batch things up - later @@ -122,8 +132,8 @@ sub schedule_work { my $key = $mode . join('',(m/^(.)(.)/)); if(length $key == 1){ # Hack. An unmodified, tracked file produces no output from - # git status. Treat as ignored. - $key .= '!!'; + # git status. Treat as another version of 'ignored'. + $key .= '@@'; } $key =~ s/-/ /g; # for Keni's locally mod'ed git if(!exists $codes{$key}){ From d883da2353a7954688b7b8deb42340c68fc2a453 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 1 Apr 2015 22:01:20 +0300 Subject: [PATCH 338/354] Add doors correctly --- src/sp_lev.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/sp_lev.c b/src/sp_lev.c index 5aeeb30b7..8bb22fdbb 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -521,23 +521,30 @@ remove_boundary_syms() } } + +void +maybe_add_door(x,y, droom, i,s) +int x,y; +struct mkroom *droom; +int i,s; +{ + if (droom->hx >= 0 && doorindex < DOORMAX && inside_room(droom, x,y)) + add_door(x, y, droom); +} + void link_doors_rooms() { - xchar x,y; + int x,y; + int tmpi, m; for (y = 0; y < ROWNO; y++) for (x = 0; x < COLNO; x++) if (IS_DOOR(levl[x][y].typ) || levl[x][y].typ == SDOOR) { - struct mkroom *droom = rooms; - /* Now the complicated part, list it with each subroom */ - /* The dog move and mail daemon routines use this */ - while(droom->hx >= 0 && doorindex < DOORMAX) { - if(droom->hx >= x-1 && droom->lx <= x+1 && - droom->hy >= y-1 && droom->ly <= y+1) { - /* Found it */ - add_door(x, y, droom); + for (tmpi = 0; tmpi < nroom; tmpi++) { + maybe_add_door(x,y, &rooms[tmpi], tmpi,-1); + for (m = 0; m < rooms[tmpi].nsubrooms; m++) { + maybe_add_door(x,y, rooms[tmpi].sbrooms[m], tmpi,m); } - droom++; } } } @@ -1983,7 +1990,6 @@ corridor *c; coord org, dest; if (c->src.room == -1) { - /*sort_rooms();*/ fix_stair_rooms(); makecorridors(); /*makecorridors(c->src.door);*/ return; @@ -2101,9 +2107,9 @@ struct mkroom *mkr; if (okroom) { #ifdef SPECIALIZATION - topologize(aroom,FALSE); /* set roomno */ + topologize(aroom,FALSE); /* set roomno */ #else - topologize(aroom); /* set roomno */ + topologize(aroom); /* set roomno */ #endif aroom->needfill = r->filled; aroom->needjoining = r->joined; @@ -3681,7 +3687,6 @@ sel_set_door(dx,dy,arg) xchar typ = (*(xchar *)arg); xchar x = dx; xchar y = dy; - /*get_location(&x, &y, DRY, (struct mkroom *)0);*/ if (!IS_DOOR(levl[x][y].typ) && levl[x][y].typ != SDOOR) levl[x][y].typ = (typ & D_SECRET) ? SDOOR : DOOR; if (typ & D_SECRET) { @@ -3951,9 +3956,9 @@ spo_region(coder) add_room(dx1, dy1, dx2, dy2, OV_i(rlit), OV_i(rtype), TRUE); #ifdef SPECIALIZATION - topologize(troom,FALSE); /* set roomno */ + topologize(troom,FALSE); /* set roomno */ #else - topologize(troom); /* set roomno */ + topologize(troom); /* set roomno */ #endif } @@ -4592,8 +4597,6 @@ sp_lev *lvl; case SPO_OBJECT: spo_object(coder); break; case SPO_LEVEL_FLAGS: spo_level_flags(coder); break; case SPO_INITLEVEL: spo_initlevel(coder); break; - /*case SPO_MON_GENERATION: spo_mon_generation(coder); break;*/ - /*case SPO_LEVEL_SOUNDS: spo_level_sounds(coder); break;*/ case SPO_ENGRAVING: spo_engraving(coder); break; case SPO_MINERALIZE: spo_mineralize(coder); break; case SPO_SUBROOM: @@ -4620,13 +4623,11 @@ sp_lev *lvl; case SPO_SINK: case SPO_POOL: case SPO_FOUNTAIN: spo_feature(coder); break; - /*case SPO_WALLWALK: spo_wallwalk(coder); break;*/ case SPO_TRAP: spo_trap(coder); break; case SPO_GOLD: spo_gold(coder); break; case SPO_CORRIDOR: spo_corridor(coder); break; case SPO_TERRAIN: spo_terrain(coder); break; case SPO_REPLACETERRAIN: spo_replace_terrain(coder); break; - /*case SPO_SPILL: spo_spill(coder); break;*/ case SPO_LEVREGION: spo_levregion(coder); break; case SPO_REGION: spo_region(coder); break; case SPO_DRAWBRIDGE: spo_drawbridge(coder); break; @@ -5004,7 +5005,6 @@ sp_lev *lvl; x -= xstart; y -= ystart; } - /*get_location(&x, &y, DRY|WET, coder->croom);*/ splev_stack_push(coder->stack, opvar_new_coord(x,y)); opvar_free(pt); } From 066e415c3e96e16457a68a2a200c3701f1223745 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 1 Apr 2015 17:29:26 -0700 Subject: [PATCH 339/354] some lint cleanup Mostly local variables using the same name as other things. --- src/sp_lev.c | 183 +++++++++++++++++++++++++++------------------------ src/trap.c | 3 +- 2 files changed, 98 insertions(+), 88 deletions(-) diff --git a/src/sp_lev.c b/src/sp_lev.c index 8bb22fdbb..5e3799b4e 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 sp_lev.c $NHDT-Date: 1426465441 2015/03/16 00:24:01 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.25 $ */ +/* NetHack 3.5 sp_lev.c $NHDT-Date: 1427934549 2015/04/02 00:29:09 $ $NHDT-Branch: master $:$NHDT-Revision: 1.40 $ */ /* NetHack 3.5 sp_lev.c $Date: 2011/01/05 01:28:36 $ $Revision: 1.23 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -1581,24 +1581,28 @@ struct mkroom *croom; if (!container_idx) { if (!invent_carrying_monster) { /*impossible("create_object: no container");*/ - /* don't complain, the monster may be gone legally (eg. unique demon already generated) - TODO: In the case of unique demon lords, they should get their inventories even when - they get generated outside the des-file. Maybe another data file that determines what - inventories monsters get by default? + /* don't complain, the monster may be gone legally + (eg. unique demon already generated) + TODO: In the case of unique demon lords, they should + get their inventories even when they get generated + outside the des-file. Maybe another data file that + determines what inventories monsters get by default? */ } else { - int c; + int ci; struct obj *objcheck = otmp; int inuse = -1; - for (c = 0; c < container_idx; c++) - if (container_obj[c] == objcheck) - inuse = c; + + for (ci = 0; ci < container_idx; ci++) + if (container_obj[ci] == objcheck) + inuse = ci; remove_object(otmp); if (mpickobj(invent_carrying_monster, otmp)) { if (inuse > -1) { - impossible("container given to monster was merged or deallocated."); - for (c = inuse; c < container_idx-1; c++) - container_obj[c] = container_obj[c+1]; + impossible( + "container given to monster was merged or deallocated."); + for (ci = inuse; ci < container_idx - 1; ci++) + container_obj[ci] = container_obj[ci + 1]; container_obj[container_idx] = NULL; container_idx--; } @@ -2490,6 +2494,7 @@ spo_return(coder) opvar_free(params); } +/*ARGUSED*/ void spo_end_moninvent(coder) struct sp_coder *coder; @@ -2499,6 +2504,7 @@ spo_end_moninvent(coder) invent_carrying_monster = NULL; } +/*ARGUSED*/ void spo_pop_container(coder) struct sp_coder *coder; @@ -2543,7 +2549,7 @@ spo_monster(coder) int nparams = 0; struct opvar *varparam; - struct opvar *id, *coord, *has_inv; + struct opvar *id, *mcoord, *has_inv; monster tmpmons; tmpmons.peaceful = -1; @@ -2660,13 +2666,13 @@ spo_monster(coder) } } - if (!OV_pop_c(coord)) panic("no monster coord?"); + if (!OV_pop_c(mcoord)) panic("no monster coord?"); if (!OV_pop_typ(id, SPOVAR_MONST)) panic("no mon type"); tmpmons.id = SP_MONST_PM(OV_i(id)); tmpmons.class = SP_MONST_CLASS(OV_i(id)); - tmpmons.coord = OV_i(coord); + tmpmons.coord = OV_i(mcoord); tmpmons.has_invent = OV_i(has_inv); create_monster(&tmpmons, coder->croom); @@ -2675,7 +2681,7 @@ spo_monster(coder) Free(tmpmons.appear_as.str); opvar_free(id); - opvar_free(coord); + opvar_free(mcoord); opvar_free(has_inv); opvar_free(varparam); } @@ -2837,22 +2843,22 @@ spo_level_flags(coder) struct sp_coder *coder; { struct opvar *flagdata; - long flags; + long lflags; if (!OV_pop_i(flagdata)) return; - flags = OV_i(flagdata); + lflags = OV_i(flagdata); - if (flags & NOTELEPORT) level.flags.noteleport = 1; - if (flags & HARDFLOOR) level.flags.hardfloor = 1; - if (flags & NOMMAP) level.flags.nommap = 1; - if (flags & SHORTSIGHTED) level.flags.shortsighted = 1; - if (flags & ARBOREAL) level.flags.arboreal = 1; - if (flags & MAZELEVEL) level.flags.is_maze_lev = 1; - if (flags & PREMAPPED) coder->premapped = TRUE; - if (flags & SHROUD) level.flags.hero_memory = 0; - if (flags & GRAVEYARD) level.flags.graveyard = 1; - if (flags & ICEDPOOLS) icedpools = TRUE; - if (flags & SOLIDIFY) coder->solidify = TRUE; + if (lflags & NOTELEPORT) level.flags.noteleport = 1; + if (lflags & HARDFLOOR) level.flags.hardfloor = 1; + if (lflags & NOMMAP) level.flags.nommap = 1; + if (lflags & SHORTSIGHTED) level.flags.shortsighted = 1; + if (lflags & ARBOREAL) level.flags.arboreal = 1; + if (lflags & MAZELEVEL) level.flags.is_maze_lev = 1; + if (lflags & PREMAPPED) coder->premapped = TRUE; + if (lflags & SHROUD) level.flags.hero_memory = 0; + if (lflags & GRAVEYARD) level.flags.graveyard = 1; + if (lflags & ICEDPOOLS) icedpools = TRUE; + if (lflags & SOLIDIFY) coder->solidify = TRUE; opvar_free(flagdata); } @@ -2902,19 +2908,19 @@ void spo_engraving(coder) struct sp_coder *coder; { - struct opvar *etyp, *txt, *coord; + struct opvar *etyp, *txt, *ecoord; xchar x,y; if (!OV_pop_i(etyp) || !OV_pop_s(txt) || - !OV_pop_c(coord)) return; + !OV_pop_c(ecoord)) return; - get_location_coord(&x, &y, DRY, coder->croom, OV_i(coord)); + get_location_coord(&x, &y, DRY, coder->croom, OV_i(ecoord)); make_engr_at(x, y, OV_s(txt), 0L, OV_i(etyp)); opvar_free(etyp); opvar_free(txt); - opvar_free(coord); + opvar_free(ecoord); } void @@ -2940,10 +2946,10 @@ void spo_room(coder) struct sp_coder *coder; { - if (coder->n_subroom > MAX_NESTED_ROOMS) + if (coder->n_subroom > MAX_NESTED_ROOMS) { panic("Too deeply nested rooms?!"); - else { - struct opvar *flags, *h, *w, *yalign, *xalign, + } else { + struct opvar *rflags, *h, *w, *yalign, *xalign, *y, *x, *rlit, *chance, *rtype; room tmproom; @@ -2955,7 +2961,7 @@ spo_room(coder) !OV_pop_i(x) || !OV_pop_i(yalign) || !OV_pop_i(xalign) || - !OV_pop_i(flags) || + !OV_pop_i(rflags) || !OV_pop_i(rlit) || !OV_pop_i(chance) || !OV_pop_i(rtype)) return; @@ -2970,9 +2976,9 @@ spo_room(coder) tmproom.rtype = OV_i(rtype); tmproom.chance = OV_i(chance); tmproom.rlit = OV_i(rlit); - tmproom.filled = (OV_i(flags) & (1 << 0)); - /*tmproom.irregular = (OV_i(flags) & (1 << 1));*/ - tmproom.joined = !(OV_i(flags) & (1 << 2)); + tmproom.filled = (OV_i(rflags) & (1 << 0)); + /*tmproom.irregular = (OV_i(rflags) & (1 << 1));*/ + tmproom.joined = !(OV_i(rflags) & (1 << 2)); opvar_free(x); opvar_free(y); @@ -2983,7 +2989,7 @@ spo_room(coder) opvar_free(rtype); opvar_free(chance); opvar_free(rlit); - opvar_free(flags); + opvar_free(rflags); if (!coder->failed_room[coder->n_subroom-1]) { tmpcr = build_room(&tmproom, coder->croom); @@ -3028,18 +3034,18 @@ spo_stair(coder) struct sp_coder *coder; { xchar x,y; - struct opvar *up, *coord; + struct opvar *up, *scoord; struct trap *badtrap; if (!OV_pop_i(up) || - !OV_pop_c(coord)) return; + !OV_pop_c(scoord)) return; - get_location_coord(&x, &y, DRY, coder->croom, OV_i(coord)); + get_location_coord(&x, &y, DRY, coder->croom, OV_i(scoord)); if ((badtrap = t_at(x,y)) != 0) deltrap(badtrap); mkstairs(x, y, (char)OV_i(up), coder->croom); SpLev_Map[x][y] = 1; - opvar_free(coord); + opvar_free(scoord); opvar_free(up); } @@ -3048,12 +3054,12 @@ spo_ladder(coder) struct sp_coder *coder; { xchar x,y; - struct opvar *up, *coord; + struct opvar *up, *lcoord; if (!OV_pop_i(up) || - !OV_pop_c(coord)) return; + !OV_pop_c(lcoord)) return; - get_location_coord(&x, &y, DRY, coder->croom, OV_i(coord)); + get_location_coord(&x, &y, DRY, coder->croom, OV_i(lcoord)); levl[x][y].typ = LADDER; SpLev_Map[x][y] = 1; @@ -3064,7 +3070,7 @@ spo_ladder(coder) xdnladder = x; ydnladder = y; levl[x][y].ladder = LA_DOWN; } - opvar_free(coord); + opvar_free(lcoord); opvar_free(up); } @@ -3072,13 +3078,13 @@ void spo_grave(coder) struct sp_coder *coder; { - struct opvar *coord, *typ, *txt; + struct opvar *gcoord, *typ, *txt; schar x,y; if (!OV_pop_i(typ) || !OV_pop_s(txt) || - !OV_pop_c(coord)) return; + !OV_pop_c(gcoord)) return; - get_location_coord(&x, &y, DRY, coder->croom, OV_i(coord)); + get_location_coord(&x, &y, DRY, coder->croom, OV_i(gcoord)); if (isok(x, y) && !t_at(x, y)) { levl[x][y].typ = GRAVE; @@ -3089,7 +3095,7 @@ spo_grave(coder) } } - opvar_free(coord); + opvar_free(gcoord); opvar_free(typ); opvar_free(txt); } @@ -3098,20 +3104,20 @@ void spo_altar(coder) struct sp_coder *coder; { - struct opvar *al, *shrine, *coord; + struct opvar *al, *shrine, *acoord; altar tmpaltar; if (!OV_pop_i(al) || !OV_pop_i(shrine) || - !OV_pop_c(coord)) return; + !OV_pop_c(acoord)) return; - tmpaltar.coord = OV_i(coord); + tmpaltar.coord = OV_i(acoord); tmpaltar.align = OV_i(al); tmpaltar.shrine = OV_i(shrine); create_altar(&tmpaltar, coder->croom); - opvar_free(coord); + opvar_free(acoord); opvar_free(shrine); opvar_free(al); } @@ -3121,17 +3127,17 @@ spo_trap(coder) struct sp_coder *coder; { struct opvar *type; - struct opvar *coord; + struct opvar *tcoord; trap tmptrap; if (!OV_pop_i(type) || - !OV_pop_c(coord)) return; + !OV_pop_c(tcoord)) return; - tmptrap.coord = OV_i(coord); + tmptrap.coord = OV_i(tcoord); tmptrap.type = OV_i(type); create_trap(&tmptrap, coder->croom); - opvar_free(coord); + opvar_free(tcoord); opvar_free(type); } @@ -3139,15 +3145,16 @@ void spo_gold(coder) struct sp_coder *coder; { - struct opvar *coord, *amt; + struct opvar *gcoord, *amt; schar x,y; long amount; - if (!OV_pop_c(coord) || !OV_pop_i(amt)) return; + + if (!OV_pop_c(gcoord) || !OV_pop_i(amt)) return; amount = OV_i(amt); - get_location_coord(&x, &y, DRY, coder->croom, OV_i(coord)); + get_location_coord(&x, &y, DRY, coder->croom, OV_i(gcoord)); if (amount == -1) amount = rnd(200); mkgold(amount, x,y); - opvar_free(coord); + opvar_free(gcoord); opvar_free(amt); } @@ -3878,19 +3885,19 @@ void spo_region(coder) struct sp_coder *coder; { - struct opvar *rtype, *rlit, *flags, *area; + struct opvar *rtype, *rlit, *rflags, *area; xchar dx1,dy1,dx2,dy2; register struct mkroom *troom; boolean prefilled, room_not_needed, irregular, joined; - if (!OV_pop_i(flags) || + if (!OV_pop_i(rflags) || !OV_pop_i(rtype) || !OV_pop_i(rlit) || !OV_pop_r(area)) return; - prefilled = !(OV_i(flags) & (1 << 0)); - irregular = (OV_i(flags) & (1 << 1)); - joined = !(OV_i(flags) & (1 << 2)); + prefilled = !(OV_i(rflags) & (1 << 0)); + irregular = (OV_i(rflags) & (1 << 1)); + joined = !(OV_i(rflags) & (1 << 2)); if(OV_i(rtype) > MAXRTYPE) { OV_i(rtype) -= MAXRTYPE+1; @@ -3927,7 +3934,7 @@ spo_region(coder) light_region(&tmpregion); opvar_free(area); - opvar_free(flags); + opvar_free(rflags); opvar_free(rlit); opvar_free(rtype); @@ -3973,7 +3980,7 @@ spo_region(coder) } opvar_free(area); - opvar_free(flags); + opvar_free(rflags); opvar_free(rlit); opvar_free(rtype); } @@ -3983,18 +3990,18 @@ spo_drawbridge(coder) struct sp_coder *coder; { xchar x,y; - struct opvar *dir, *db_open, *coord; + struct opvar *dir, *db_open, *dcoord; if (!OV_pop_i(dir) || !OV_pop_i(db_open) || - !OV_pop_c(coord)) return; + !OV_pop_c(dcoord)) return; - get_location_coord(&x, &y, DRY|WET|HOT, coder->croom, OV_i(coord)); + get_location_coord(&x, &y, DRY|WET|HOT, coder->croom, OV_i(dcoord)); if (!create_drawbridge(x, y, OV_i(dir), OV_i(db_open))) impossible("Cannot create drawbridge."); SpLev_Map[x][y] = 1; - opvar_free(coord); + opvar_free(dcoord); opvar_free(db_open); opvar_free(dir); } @@ -4004,17 +4011,17 @@ spo_mazewalk(coder) struct sp_coder *coder; { xchar x,y; - struct opvar *ftyp, *fstocked,*fdir, *coord; + struct opvar *ftyp, *fstocked,*fdir, *mcoord; int dir; if (!OV_pop_i(ftyp) || !OV_pop_i(fstocked) || !OV_pop_i(fdir) || - !OV_pop_c(coord)) return; + !OV_pop_c(mcoord)) return; dir = OV_i(fdir); - get_location_coord(&x, &y, ANY_LOC, coder->croom, OV_i(coord)); + get_location_coord(&x, &y, ANY_LOC, coder->croom, OV_i(mcoord)); if (!isok(x,y)) return; if (OV_i(ftyp) < 1) { @@ -4066,7 +4073,7 @@ spo_mazewalk(coder) walkfrom(x, y, OV_i(ftyp)); if (OV_i(fstocked)) fill_empty_maze(); - opvar_free(coord); + opvar_free(mcoord); opvar_free(fdir); opvar_free(fstocked); opvar_free(ftyp); @@ -4121,6 +4128,7 @@ spo_room_door(coder) opvar_free(pos); } +/*ARGSUSED*/ void sel_set_wallify(x,y,arg) int x, y; @@ -5029,25 +5037,28 @@ sp_lev *lvl; break; case SPO_SEL_GRADIENT: { - struct opvar *gtyp, *glim, *mind, *maxd, *coord, *coord2; + struct opvar *gtyp, *glim, *mind, *maxd, *gcoord, *coord2; struct opvar *sel; schar x,y, x2,y2; if (!OV_pop_i(gtyp)) panic("no gtyp for grad"); if (!OV_pop_i(glim)) panic("no glim for grad"); if (!OV_pop_c(coord2)) panic("no coord2 for grad"); - if (!OV_pop_c(coord)) panic("no coord for grad"); + if (!OV_pop_c(gcoord)) panic("no coord for grad"); if (!OV_pop_i(maxd)) panic("no maxd for grad"); if (!OV_pop_i(mind)) panic("no mind for grad"); - get_location_coord(&x, &y, ANY_LOC, coder->croom, OV_i(coord)); - get_location_coord(&x2, &y2, ANY_LOC, coder->croom, OV_i(coord2)); + get_location_coord(&x, &y, ANY_LOC, coder->croom, + OV_i(gcoord)); + get_location_coord(&x2, &y2, ANY_LOC, coder->croom, + OV_i(coord2)); sel = selection_opvar(NULL); - selection_do_gradient(sel, x,y, x2,y2, OV_i(gtyp), OV_i(mind), OV_i(maxd), OV_i(glim)); + selection_do_gradient(sel, x,y, x2,y2, OV_i(gtyp), + OV_i(mind), OV_i(maxd), OV_i(glim)); splev_stack_push(coder->stack, sel); opvar_free(gtyp); opvar_free(glim); - opvar_free(coord); + opvar_free(gcoord); opvar_free(coord2); opvar_free(maxd); opvar_free(mind); diff --git a/src/trap.c b/src/trap.c index 298ee2f44..c826fb851 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 trap.c $NHDT-Date: 1427331767 2015/03/26 01:02:47 $ $NHDT-Branch: master $:$NHDT-Revision: 1.199 $ */ +/* NetHack 3.5 trap.c $NHDT-Date: 1427934551 2015/04/02 00:29:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.223 $ */ /* NetHack 3.5 trap.c $Date: 2013/03/14 01:58:21 $ $Revision: 1.179 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3169,7 +3169,6 @@ struct obj *obj; const char *ostr; boolean force; { - boolean exploded = FALSE; if (!obj) return ER_NOTHING; if (snuff_lit(obj)) From 884d9d4be53ffd548bf5a143d01c701bf4a5c411 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 2 Apr 2015 13:06:45 +0300 Subject: [PATCH 340/354] Record in xlogfile if any bones were loaded --- include/you.h | 1 + src/bones.c | 1 + src/topten.c | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/you.h b/include/you.h index a69fe4de3..11ba9079e 100644 --- a/include/you.h +++ b/include/you.h @@ -95,6 +95,7 @@ struct u_conduct { /* number of times... */ struct u_roleplay { boolean blind; /* permanently blind */ boolean nudist; /* has not worn any armor, ever */ + long numbones; /* # of bones files loaded */ }; /*** Unified structure containing role information ***/ diff --git a/src/bones.c b/src/bones.c index 9024354a2..f061316b4 100644 --- a/src/bones.c +++ b/src/bones.c @@ -597,6 +597,7 @@ getbones() } (void) close(fd); sanitize_engravings(); + u.uroleplay.numbones++; if(wizard) { if(yn("Unlink bones?") == 'n') { diff --git a/src/topten.c b/src/topten.c index 0614eaeed..c803aac39 100644 --- a/src/topten.c +++ b/src/topten.c @@ -353,8 +353,9 @@ encodexlogflags() { long e = 0L; - if (wizard) e |= 1L << 0; - if (discover) e |= 1L << 1; + if (wizard) e |= 1L << 0; + if (discover) e |= 1L << 1; + if (!u.uroleplay.numbones) e |= 1L << 2; return e; } From f150adf0ce3b7b4b7871a209e353d505614facf2 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 2 Apr 2015 14:04:31 +0300 Subject: [PATCH 341/354] Silence GCC warnings --- src/decl.c | 6 +++--- src/mklev.c | 2 +- src/mkmaze.c | 4 ++-- src/sp_lev.c | 7 +++---- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/decl.c b/src/decl.c index 2df304575..6529336b2 100644 --- a/src/decl.c +++ b/src/decl.c @@ -103,9 +103,9 @@ NEARDATA struct multishot m_shot = { 0, 0, STRANGE_OBJECT, FALSE }; NEARDATA dungeon dungeons[MAXDUNGEON]; /* ini'ed by init_dungeon() */ NEARDATA s_level *sp_levchn; -NEARDATA stairway upstair = { 0, 0 }, dnstair = { 0, 0 }; -NEARDATA stairway upladder = { 0, 0 }, dnladder = { 0, 0 }; -NEARDATA stairway sstairs = { 0, 0 }; +NEARDATA stairway upstair = { 0, 0, { 0,0 }, 0 }, dnstair = { 0, 0, { 0,0 }, 0 }; +NEARDATA stairway upladder = { 0, 0, { 0,0 }, 0 }, dnladder = { 0, 0, { 0,0 }, 0 }; +NEARDATA stairway sstairs = { 0, 0, { 0,0 }, 0 }; NEARDATA dest_area updest = { 0, 0, 0, 0, 0, 0, 0, 0 }; NEARDATA dest_area dndest = { 0, 0, 0, 0, 0, 0, 0, 0 }; NEARDATA coord inv_pos = { 0, 0 }; diff --git a/src/mklev.c b/src/mklev.c index 5b4c9634a..5210d912b 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -537,7 +537,7 @@ STATIC_OVL void clear_level_structures() { static struct rm zerorm = { cmap_to_glyph(S_stone), - 0, 0, 0, 0, 0, 0, 0, 0 }; + 0, 0, 0, 0, 0, 0, 0, 0, 0 }; register int x,y; register struct rm *lev; diff --git a/src/mkmaze.c b/src/mkmaze.c index fcd6a2df5..8a5b9b793 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -916,9 +916,9 @@ movebubbles() register int x, y, i, j; struct trap *btrap; static const struct rm water_pos = - { cmap_to_glyph(S_water), WATER, 0, 0, 0, 0, 0, 0, 0 }; + { cmap_to_glyph(S_water), WATER, 0, 0, 0, 0, 0, 0, 0, 0 }; static const struct rm air_pos = - { cmap_to_glyph(S_cloud), AIR, 0, 0, 0, 1, 0, 0, 0 }; + { cmap_to_glyph(S_cloud), AIR, 0, 0, 0, 1, 0, 0, 0, 0 }; /* set up the portal the first time bubbles are moved */ if (!wportal) set_wportal(); diff --git a/src/sp_lev.c b/src/sp_lev.c index 5e3799b4e..6c87da562 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -523,10 +523,9 @@ remove_boundary_syms() void -maybe_add_door(x,y, droom, i,s) +maybe_add_door(x,y, droom) int x,y; struct mkroom *droom; -int i,s; { if (droom->hx >= 0 && doorindex < DOORMAX && inside_room(droom, x,y)) add_door(x, y, droom); @@ -541,9 +540,9 @@ link_doors_rooms() for (x = 0; x < COLNO; x++) if (IS_DOOR(levl[x][y].typ) || levl[x][y].typ == SDOOR) { for (tmpi = 0; tmpi < nroom; tmpi++) { - maybe_add_door(x,y, &rooms[tmpi], tmpi,-1); + maybe_add_door(x,y, &rooms[tmpi]); for (m = 0; m < rooms[tmpi].nsubrooms; m++) { - maybe_add_door(x,y, rooms[tmpi].sbrooms[m], tmpi,m); + maybe_add_door(x,y, rooms[tmpi].sbrooms[m]); } } } From 9f66b234ed26c5d99a5f290ba8b26483a8a68f14 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 2 Apr 2015 16:08:09 +0300 Subject: [PATCH 342/354] Separate splev stack pops --- src/sp_lev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sp_lev.c b/src/sp_lev.c index 6c87da562..ed1b782c2 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -4840,7 +4840,7 @@ sp_lev *lvl; { struct opvar *sel1, *sel2, *pt; if (!OV_pop_typ(sel1, SPOVAR_SEL)) panic("no sel1 for add"); - if (!OV_pop_typ(sel2, SPOVAR_SEL)) panic("no sel1 for add"); + if (!OV_pop_typ(sel2, SPOVAR_SEL)) panic("no sel2 for add"); pt = selection_logical_oper(sel1, sel2, '|'); opvar_free(sel1); opvar_free(sel2); @@ -4948,7 +4948,8 @@ sp_lev *lvl; { struct opvar *tmp, *tmp2, *pt = selection_opvar(NULL); schar x1,y1,x2,y2; - if (!OV_pop_c(tmp) || !OV_pop_c(tmp2)) panic("no ter sel linecoord"); + if (!OV_pop_c(tmp)) panic("no ter sel linecoord1"); + if (!OV_pop_c(tmp2)) panic("no ter sel linecoord2"); get_location_coord(&x1, &y1, ANY_LOC, coder->croom, OV_i(tmp)); get_location_coord(&x2, &y2, ANY_LOC, coder->croom, OV_i(tmp2)); x1 = (x1 < 0) ? 0 : x1; @@ -4965,7 +4966,9 @@ sp_lev *lvl; { struct opvar *tmp, *tmp2, *tmp3, *pt = selection_opvar(NULL); schar x1,y1,x2,y2; - if (!OV_pop_i(tmp3) || !OV_pop_c(tmp) || !OV_pop_c(tmp2)) panic("no ter sel randline"); + if (!OV_pop_i(tmp3)) panic("no ter sel randline1"); + if (!OV_pop_c(tmp)) panic("no ter sel randline2"); + if (!OV_pop_c(tmp2)) panic("no ter sel randline3"); get_location_coord(&x1, &y1, ANY_LOC, coder->croom, OV_i(tmp)); get_location_coord(&x2, &y2, ANY_LOC, coder->croom, OV_i(tmp2)); x1 = (x1 < 0) ? 0 : x1; From c8e781c4181ccbf1eec8bf3722a31b9f528b96c2 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 17 Mar 2015 22:50:11 +0200 Subject: [PATCH 343/354] Add menucolors -Add a boolean option menucolors to toggle menu color -Add MENUCOLOR -config file option TODO: -Better support for win32 -Support more windowports -Update Guidebook -Allow changing menucolor lines in-game --- doc/fixes35.0 | 1 + include/color.h | 18 +++++ include/config.h | 8 ++ include/extern.h | 3 + include/flag.h | 1 + src/decl.c | 2 + src/files.c | 2 + src/options.c | 179 ++++++++++++++++++++++++++++++++++++++++++ src/save.c | 1 + sys/share/NetHack.cnf | 11 +++ util/makedefs.c | 5 ++ win/tty/wintty.c | 11 +++ win/win32/mhmap.c | 1 - win/win32/mhmap.h | 1 + win/win32/mhmenu.c | 10 +++ 15 files changed, 253 insertions(+), 1 deletion(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 46b87d58f..5fa64755d 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -1132,6 +1132,7 @@ smartphone: added "Type Cmd" command that allows to type arbitrary commands smartphone: added Q(quiver) command to "Attack" layout smartphone: fixed F command to prompt for direction unix,vms: altmeta option to handle terminals which send "ESC c" for Alt+c +tty,win32gui,win32tty: add menucolors NetHack Community Patches (or Variation) Included diff --git a/include/color.h b/include/color.h index ab6fe0462..f7bec4a08 100644 --- a/include/color.h +++ b/include/color.h @@ -7,6 +7,10 @@ #ifndef COLOR_H #define COLOR_H +#ifdef MENU_COLOR_REGEX +#include +#endif + /* * The color scheme used is tailored for an IBM PC. It consists of the * standard 8 colors, folowed by their bright counterparts. There are @@ -51,4 +55,18 @@ #define DRAGON_SILVER CLR_BRIGHT_CYAN #define HI_ZAP CLR_BRIGHT_BLUE +struct menucoloring { +# ifdef MENU_COLOR_REGEX +# ifdef MENU_COLOR_REGEX_POSIX + regex_t match; +# else + struct re_pattern_buffer match; +# endif +# else + char *match; +# endif + int color, attr; + struct menucoloring *next; +}; + #endif /* COLOR_H */ diff --git a/include/config.h b/include/config.h index d8c96af14..c5e53abf6 100644 --- a/include/config.h +++ b/include/config.h @@ -437,6 +437,14 @@ typedef unsigned char uchar; * bugs left here. */ +/* Menucolors */ +# define MENU_COLOR_REGEX /* use GNU regex */ +/*# define MENU_COLOR_REGEX_POSIX*/ /* use POSIX regex */ +/* if neither is defined, uses pmatch() + * pmatch() provides basic globbing: '*' and '?' wildcards. + */ + + #define STATUS_VIA_WINDOWPORT /* re-work of the status line updating process */ #define STATUS_HILITES /* support hilites of status fields */ /* #define WINCHAIN*/ /* stacked window systems */ diff --git a/include/extern.h b/include/extern.h index 4e2780c6b..28680c5fa 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1583,6 +1583,9 @@ E void FDECL(parsesymbols, (char *)); E struct symparse *FDECL(match_sym, (char *)); E void NDECL(set_playmode); E int FDECL(sym_val, (char *)); +E boolean FDECL(add_menu_coloring, (char *)); +E boolean FDECL(get_menu_coloring, (char *, int *, int *)); +E void NDECL(free_menu_coloring); /* ### pager.c ### */ diff --git a/include/flag.h b/include/flag.h index 9eb7a68c6..072fb4a30 100644 --- a/include/flag.h +++ b/include/flag.h @@ -201,6 +201,7 @@ struct instance_flags { boolean rlecomp; /* run-length comp of levels when writing savefile */ uchar num_pad_mode; boolean echo; /* 1 to echo characters */ + boolean use_menu_color; /* use color in menus; only if wc_color */ #if 0 boolean DECgraphics; /* use DEC VT-xxx extended character set */ boolean IBMgraphics; /* use IBM extended character set */ diff --git a/src/decl.c b/src/decl.c index 6529336b2..d9429dbcf 100644 --- a/src/decl.c +++ b/src/decl.c @@ -219,6 +219,8 @@ NEARDATA struct c_color_names c_color_names = { "white" }; +struct menucoloring *menu_colorings = NULL; + const char *c_obj_colors[] = { "black", /* CLR_BLACK */ "red", /* CLR_RED */ diff --git a/src/files.c b/src/files.c index 179cd3437..f3b9eb610 100644 --- a/src/files.c +++ b/src/files.c @@ -2290,6 +2290,8 @@ int src; } else if (match_varname(buf, "BOULDER", 3)) { (void) get_uchars(fp, buf, bufp, &iflags.bouldersym, TRUE, 1, "BOULDER"); + } else if (match_varname(buf, "MENUCOLOR", 9)) { + (void) add_menu_coloring(bufp); } else if (match_varname(buf, "WARNINGS", 5)) { (void) get_uchars(fp, buf, bufp, translate, FALSE, WARNCOUNT, "WARNINGS"); diff --git a/src/options.c b/src/options.c index 742958fc3..54e0471e8 100644 --- a/src/options.c +++ b/src/options.c @@ -141,6 +141,7 @@ static struct Bool_Opt {"mail", (boolean *)0, TRUE, SET_IN_FILE}, #endif {"mention_walls", &iflags.mention_walls, FALSE, SET_IN_GAME}, + {"menucolors", &iflags.use_menu_color, FALSE, SET_IN_GAME}, /* for menu debugging only*/ {"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME}, {"menu_objsyms", &iflags.menu_head_objsym, FALSE, SET_IN_GAME}, @@ -1090,6 +1091,174 @@ STATIC_VAR const struct paranoia_opts { { ~0, "all", 3, 0, 0, 0 }, /* ditto */ }; + +extern struct menucoloring *menu_colorings; + +static const struct { + const char *name; + const int color; +} colornames[] = { + {"black", CLR_BLACK}, + {"red", CLR_RED}, + {"green", CLR_GREEN}, + {"brown", CLR_BROWN}, + {"blue", CLR_BLUE}, + {"magenta", CLR_MAGENTA}, + {"cyan", CLR_CYAN}, + {"gray", CLR_GRAY}, + {"grey", CLR_GRAY}, + {"orange", CLR_ORANGE}, + {"lightgreen", CLR_BRIGHT_GREEN}, + {"yellow", CLR_YELLOW}, + {"lightblue", CLR_BRIGHT_BLUE}, + {"lightmagenta", CLR_BRIGHT_MAGENTA}, + {"lightcyan", CLR_BRIGHT_CYAN}, + {"white", CLR_WHITE} +}; + +static const struct { + const char *name; + const int attr; +} attrnames[] = { + {"none", ATR_NONE}, + {"bold", ATR_BOLD}, + {"dim", ATR_DIM}, + {"underline", ATR_ULINE}, + {"blink", ATR_BLINK}, + {"inverse", ATR_INVERSE} +}; + +/* parse '"regex_string"=color&attr' and add it to menucoloring */ +boolean +add_menu_coloring(str) +char *str; +{ + int i, c = NO_COLOR, a = ATR_NONE; + struct menucoloring *tmp; + char *tmps, *cs = strchr(str, '='); +#ifdef MENU_COLOR_REGEX_POSIX + int errnum; + char errbuf[80]; +#endif + const char *err = (char *)0; + + if (!cs || !str) return FALSE; + + tmps = cs; + tmps++; + while (*tmps && isspace(*tmps)) tmps++; + + for (i = 0; i < SIZE(colornames); i++) + if (strstri(tmps, colornames[i].name) == tmps) { + c = colornames[i].color; + break; + } + if ((i == SIZE(colornames)) && (*tmps >= '0' && *tmps <='9')) + c = atoi(tmps); + + if (c > 15) return FALSE; + + tmps = strchr(str, '&'); + if (tmps) { + tmps++; + while (*tmps && isspace(*tmps)) tmps++; + for (i = 0; i < SIZE(attrnames); i++) + if (strstri(tmps, attrnames[i].name) == tmps) { + a = attrnames[i].attr; + break; + } + if ((i == SIZE(attrnames)) && (*tmps >= '0' && *tmps <='9')) + a = atoi(tmps); + } + + *cs = '\0'; + tmps = str; + if ((*tmps == '"') || (*tmps == '\'')) { + cs--; + while (isspace(*cs)) cs--; + if (*cs == *tmps) { + *cs = '\0'; + tmps++; + } + } + + tmp = (struct menucoloring *)alloc(sizeof(struct menucoloring)); +#ifdef MENU_COLOR_REGEX +#ifdef MENU_COLOR_REGEX_POSIX + errnum = regcomp(&tmp->match, tmps, REG_EXTENDED | REG_NOSUB); + if (errnum != 0) + { + regerror(errnum, &tmp->match, errbuf, sizeof(errbuf)); + err = errbuf; + } +#else + tmp->match.translate = 0; + tmp->match.fastmap = 0; + tmp->match.buffer = 0; + tmp->match.allocated = 0; + tmp->match.regs_allocated = REGS_FIXED; + err = re_compile_pattern(tmps, strlen(tmps), &tmp->match); +#endif +#else + tmp->match = (char *)alloc(strlen(tmps)+1); + (void) memcpy((genericptr_t)tmp->match, (genericptr_t)tmps, strlen(tmps)+1); +#endif + if (err) { + raw_printf("\nMenucolor regex error: %s\n", err); + wait_synch(); + free(tmp); + return FALSE; + } else { + tmp->next = menu_colorings; + tmp->color = c; + tmp->attr = a; + menu_colorings = tmp; + return TRUE; + } +} + +boolean +get_menu_coloring(str, color, attr) +char *str; +int *color, *attr; +{ + struct menucoloring *tmpmc; + if (iflags.use_menu_color) + for (tmpmc = menu_colorings; tmpmc; tmpmc = tmpmc->next) +#ifdef MENU_COLOR_REGEX +# ifdef MENU_COLOR_REGEX_POSIX + if (regexec(&tmpmc->match, str, 0, NULL, 0) == 0) { +# else + if (re_search(&tmpmc->match, str, strlen(str), 0, 9999, 0) >= 0) { +# endif +#else + if (pmatch(tmpmc->match, str)) { +#endif + *color = tmpmc->color; + *attr = tmpmc->attr; + return TRUE; + } + return FALSE; +} + +void +free_menu_coloring() +{ + struct menucoloring *tmp = menu_colorings; + + while (tmp) { + struct menucoloring *tmp2 = tmp->next; +#ifdef MENU_COLOR_REGEX + (void) regfree(&tmp->match); +#else + free(tmp->match); +#endif + free(tmp); + tmp = tmp2; + } +} + + void parseoptions(opts, tinitial, tfrom_file) register char *opts; @@ -1431,6 +1600,16 @@ boolean tinitial, tfrom_file; return; } + /* menucolor:"regex_string"=color */ + fullname = "menucolor"; + if (match_optname(opts, fullname, 9, TRUE)) { + if (negated) bad_negation(fullname, FALSE); + else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) + if (!add_menu_coloring(op)) + badoption(opts); + return; + } + fullname = "msghistory"; if (match_optname(opts, fullname, 3, TRUE)) { if (duplicate) complain_about_duplicate(opts,1); diff --git a/src/save.c b/src/save.c index 4a4363e9e..094f54042 100644 --- a/src/save.c +++ b/src/save.c @@ -1296,6 +1296,7 @@ void freedynamicdata() { unload_qtlist(); + free_menu_coloring(); free_invbuf(); /* let_to_name (invent.c) */ free_youbuf(); /* You_buf,&c (pline.c) */ tmp_at(DISP_FREEMEM, 0); /* temporary display effects */ diff --git a/sys/share/NetHack.cnf b/sys/share/NetHack.cnf index 29d8ce910..2b16dfcc7 100644 --- a/sys/share/NetHack.cnf +++ b/sys/share/NetHack.cnf @@ -121,3 +121,14 @@ OPTIONS=time,noshowexp,number_pad:2,lit_corridor # DEC Rainbows will hang if rawio is set, so they should instead use: #OPTIONS=BIOS,DECgraphics +# Colored menus. +#OPTIONS=menucolors +# Syntax is: MENUCOLOR="string_to_match"=color&attribute +# Colors: black, red, green, brown, blue, magenta, cyan, gray, orange, +# lightgreen, yellow, lightblue, lightmagenta, lightcyan, white. +# Attributes: none, bold, dim, underline, blink, inverse. +#MENUCOLOR=" blessed "=green +#MENUCOLOR=" holy "=green +#MENUCOLOR=" cursed "=red +#MENUCOLOR=" unholy "=red +#MENUCOLOR=" cursed .* (being worn)"=orange&underline diff --git a/util/makedefs.c b/util/makedefs.c index 8555178e1..7bb689bef 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1294,6 +1294,11 @@ static const char *build_opts[] = { #ifdef NEWS "news file", #endif +#ifdef MENU_COLOR_REGEX + "menu colors via regular expressions", +#else + "menu colors via pmatch", +#endif #ifdef OVERLAY # ifdef MOVERLAY "MOVE overlays", diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 8c8f5294c..0aaf9e92d 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1462,6 +1462,8 @@ struct WinDesc *cw; for (page_lines = 0, curr = page_start; curr != page_end; page_lines++, curr = curr->next) { + int color = NO_COLOR, attr = ATR_NONE; + boolean menucolr = FALSE; if (curr->selector) *rp++ = curr->selector; @@ -1477,6 +1479,11 @@ struct WinDesc *cw; * actually output the character. We're faster doing * this. */ + if (iflags.use_menu_color && + (menucolr = get_menu_coloring(curr->str, &color,&attr))) { + term_start_attr(attr); + if (color != NO_COLOR) term_start_color(color); + } else term_start_attr(curr->attr); for (n = 0, cp = curr->str; #ifndef WIN32CON @@ -1494,6 +1501,10 @@ struct WinDesc *cw; (void) putchar('#'); /* count selected */ } else (void) putchar(*cp); + if (iflags.use_menu_color && menucolr) { + if (color != NO_COLOR) term_end_color(); + term_end_attr(attr); + } else term_end_attr(curr->attr); } } else { diff --git a/win/win32/mhmap.c b/win/win32/mhmap.c index bd3c60a17..d07af75c5 100644 --- a/win/win32/mhmap.c +++ b/win/win32/mhmap.c @@ -45,7 +45,6 @@ static void nhcoord2display(PNHMapWindow data, int x, int y, LPRECT lpOut); #if (VERSION_MAJOR < 4) && (VERSION_MINOR < 4) && (PATCHLEVEL < 2) static void nhglyph2charcolor(short glyph, uchar* ch, int* color); #endif -static COLORREF nhcolor_to_RGB(int c); HWND mswin_init_map_window () { static int run_once = 0; diff --git a/win/win32/mhmap.h b/win/win32/mhmap.h index 54a614730..e33f64ec3 100644 --- a/win/win32/mhmap.h +++ b/win/win32/mhmap.h @@ -12,6 +12,7 @@ #include "global.h" +COLORREF nhcolor_to_RGB (int c); HWND mswin_init_map_window (void); void mswin_map_stretch(HWND hWnd, LPSIZE lpsz, BOOL redraw); int mswin_map_mode(HWND hWnd, int mode); diff --git a/win/win32/mhmenu.c b/win/win32/mhmenu.c index e39470dc1..6f32931e3 100644 --- a/win/win32/mhmenu.c +++ b/win/win32/mhmenu.c @@ -917,6 +917,9 @@ BOOL onDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam) int column; int spacing = 0; + int color = NO_COLOR, attr; + boolean menucolr = FALSE; + lpdis = (LPDRAWITEMSTRUCT) lParam; /* If there are no list box items, skip this message. */ @@ -967,6 +970,13 @@ BOOL onDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam) buf[0] = item->accelerator; buf[1] = '\x0'; + if (iflags.use_menu_color && + (menucolr = get_menu_coloring(item->str, &color,&attr))) { + /* TODO: use attr too */ + if (color != NO_COLOR) + SetTextColor(lpdis->hDC, nhcolor_to_RGB(color)); + } + SetRect( &drawRect, x, lpdis->rcItem.top, lpdis->rcItem.right, lpdis->rcItem.bottom ); DrawText(lpdis->hDC, NH_A2W(buf, wbuf, 2), 1, &drawRect, DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX); } From d0c3050d08aabcaee8fe7fca930126fedc42247a Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 2 Apr 2015 19:18:31 +0300 Subject: [PATCH 344/354] Update Guidebook with menucolor docs --- doc/Guidebook.mn | 53 ++++++++++++++++++++++++++++++++++++ doc/Guidebook.tex | 69 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 4293fdb3e..89dee0ae0 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2051,6 +2051,9 @@ An obsolete synonym for ``gender:male''. Cannot be set with the `O' command. .lp mention_walls Give feedback when walking against a wall (default off). +.lp menucolors +Enable coloring menu lines (default off). +See ``Configuring Menu Colors'' on how to configure the colors. .lp menustyle Controls the interface used when you need to choose various objects (in response to the Drop command, for instance). The value specified should @@ -2604,6 +2607,56 @@ The second example results in the exclusion of any corpse from autopickup. The last example results in the exclusion of items known to be cursed from autopickup. .hn 2 +Configuring Menu Colors +.pg +Some platforms allow you to define colors used in menu lines when the +line matches a user-defined pattern. At this time the tty, win32tty and +win32gui support this. +.pg +In general, the config file entries to configure the menu color mappings +look like this: +.si +.lp MENUCOLOR="pattern"=color&attribute +.ei +.PS "menu color" +.PL pattern +the pattern to match; +.PL color +the color to use for lines matching the pattern; +.PL attribute +the attribute to use for lines matching the pattern. The attribute is +optional, and if left out, you must also leave out the preceding ampersand. +If no attribute is defined, no attribute is used. +.PE +.lp "" +For explanation on pattern format and the matching routines, see +the pattern in the ``Configuring User Sounds'' -section. +.lp "" +Allowed colors are black, red, green, brown, blue, magenta, cyan, gray, +orange, lightgreen, yellow, lightblue, lightmagenta, lightcyan, and white. +.lp "" +Allowed attributes are none, bold, dim, underline, blink, and inverse. +Note that the platform used may interpret the attributes any way it +wants. +.lp "" +Here's an example of menu colors using NetHack's internal +pattern matching facility: +.sd +.si +MENUCOLOR="* blessed *"=green +MENUCOLOR="* cursed *"=red +MENUCOLOR="* cursed *(being worn)"=red&underline +.ei +.ed +specifies that any menu line with " blessed " contained +in it will be shown in green color, lines with " cursed " will be +shown in red, and lines with " cursed " followed by "(being worn)" +on the same line will be shown in red color and underlined. +You can have multiple MENUCOLOR entries in your config file, +and the last MENUCOLOR-line in your config file that matches +a menu line will be used for the line. +.pg +.hn 2 Configuring User Sounds .pg Some platforms allow you to define sound files to be played when a message diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 5f1ae5e4b..67ca18cc1 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -2479,6 +2479,10 @@ An obsolete synonym for ``{\tt gender:male}''. Cannot be set with the \item[\ib{mention\_walls}] Give feedback when walking against a wall (default off). %.lp +\item[\ib{menucolors}] +Enable coloring menu lines (default off). +See ``{\it Configuring Menu Colors\/}'' on how to configure the colors. +%.lp \item[\ib{menustyle}] Controls the interface used when you need to choose various objects (in response to the Drop command, for instance). The value specified should @@ -3141,6 +3145,71 @@ The second example results in the exclusion of any corpse from autopickup. The last example results in the exclusion of items known to be cursed from autopickup. +%.lp +%.hn 2 +\subsection*{Configuring Menu Colors} + +%.pg +Some platforms allow you to define colors used in menu lines when the +line matches a user-defined pattern. At this time the tty, win32tty and +win32gui support this. + +%.pg +In general, the config file entries to configure the menu color mappings +look like this: +\begin{verbatim} + MENUCOLOR="pattern"=color&attribute +\end{verbatim} + +\blist{} +%.lp +\item[\ib{pattern}] +the pattern to match; +%.lp +\item[\ib{color}] +the color to use for lines matching the pattern; +%.lp +\item[\ib{attribute}] +the attribute to use for lines matching the pattern. The attribute is +optional, and if left out, you must also leave out the preceding ampersand. +If no attribute is defined, no attribute is used. +\elist + +%.lp "" +For explanation on pattern format and the matching routines, see +the pattern in the {\it Configuring User Sounds} -section. + +%.lp "" +Allowed colors are {\it black}, {\it red}, {\it green}, {\it brown}, +{\it blue}, {\it magenta}, {\it cyan}, {\it gray}, {\it orange}, +{\it lightgreen}, {\it yellow}, {\it lightblue}, {\it lightmagenta}, +{\it lightcyan}, and {\it white}. + +%.lp "" +Allowed attributes are {\it none}, {\it bold}, {\it dim}, {\it underline}, +{\it blink}, and {\it inverse}. +Note that the platform used may interpret the attributes any way it +wants. + +%.lp "" +Here's an example of menu colors using NetHack's internal +pattern matching facility: + +\begin{verbatim} + MENUCOLOR="* blessed *"=green + MENUCOLOR="* cursed *"=red + MENUCOLOR="* cursed *(being worn)"=red&underline +\end{verbatim} + +specifies that any menu line with " blessed " contained +in it will be shown in green color, lines with " cursed " will be +shown in red, and lines with " cursed " followed by "(being worn)" +on the same line will be shown in red color and underlined. +You can have multiple MENUCOLOR entries in your config file, +and the last MENUCOLOR-line in your config file that matches +a menu line will be used for the line. +%.pg + %.lp %.hn 2 \subsection*{Configuring User Sounds} From 0344771b12a0006dcf1debc7d392164d24a1a171 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 3 Apr 2015 08:33:14 +0300 Subject: [PATCH 345/354] Silence warnings --- src/apply.c | 2 + src/sp_lev.c | 110 ++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 102 insertions(+), 10 deletions(-) diff --git a/src/apply.c b/src/apply.c index 65482c337..aec7550a2 100644 --- a/src/apply.c +++ b/src/apply.c @@ -37,6 +37,8 @@ STATIC_DCL boolean FDECL(figurine_location_checks, (struct obj *, coord *, BOOLEAN_P)); STATIC_DCL void FDECL(add_class, (char *, CHAR_P)); STATIC_DCL void FDECL(setapplyclasses, (char *)); +STATIC_DCL boolean FDECL(is_valid_jump_pos, (int, int, int, BOOLEAN_P)); +STATIC_DCL boolean FDECL(find_poleable_mon, (coord *, int, int)); #ifdef AMIGA void FDECL( amii_speaker, ( struct obj *, char *, int ) ); diff --git a/src/sp_lev.c b/src/sp_lev.c index ed1b782c2..5efdb6e16 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -15,6 +15,8 @@ #include "sp_lev.h" +typedef void (*select_iter_func)(int, int, genericptr_t); + extern void FDECL(mkmap, (lev_init *)); STATIC_DCL void FDECL(get_room_loc, (schar *, schar *, struct mkroom *)); @@ -35,6 +37,94 @@ STATIC_DCL boolean FDECL(create_subroom, (struct mkroom *, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P)); long FDECL(opvar_array_length, (struct sp_coder *)); +STATIC_DCL void NDECL(solidify_map); +STATIC_DCL void FDECL(splev_stack_init, (struct splevstack *)); +STATIC_DCL void FDECL(splev_stack_done, (struct splevstack *)); +STATIC_DCL void FDECL(splev_stack_push, (struct splevstack *, struct opvar *)); +STATIC_DCL struct opvar * FDECL(splev_stack_pop, (struct splevstack *)); +STATIC_DCL struct splevstack * FDECL(splev_stack_reverse, (struct splevstack *)); +STATIC_DCL struct opvar * FDECL(opvar_new_str, (char *)); +STATIC_DCL struct opvar * FDECL(opvar_new_int, (long)); +STATIC_DCL struct opvar * FDECL(opvar_new_coord, (int, int)); +STATIC_DCL struct opvar * FDECL(opvar_new_region, (int,int, int,int)); +STATIC_DCL void FDECL(opvar_free_x, (struct opvar *)); +STATIC_DCL struct opvar * FDECL(opvar_clone, (struct opvar *)); +STATIC_DCL struct opvar * FDECL(opvar_var_conversion, (struct sp_coder *, struct opvar *)); +STATIC_DCL struct splev_var * FDECL(opvar_var_defined, (struct sp_coder *, char *)); +STATIC_DCL struct opvar * FDECL(splev_stack_getdat, (struct sp_coder *, XCHAR_P)); +STATIC_DCL struct opvar * FDECL(splev_stack_getdat_any, (struct sp_coder *)); +STATIC_DCL void FDECL(variable_list_del, (struct splev_var *)); +STATIC_DCL void FDECL(lvlfill_maze_grid, (int,int, int,int, SCHAR_P)); +STATIC_DCL void FDECL(lvlfill_solid, (SCHAR_P, SCHAR_P)); +STATIC_DCL void NDECL(remove_boundary_syms); +STATIC_DCL void FDECL(maybe_add_door, (int,int, struct mkroom *)); +STATIC_DCL void NDECL(link_doors_rooms); +STATIC_DCL void NDECL(fill_rooms); +STATIC_DCL unpacked_coord FDECL(get_unpacked_coord, (long, int)); +STATIC_DCL void FDECL(replace_terrain, (replaceterrain *, struct mkroom *)); +STATIC_DCL void FDECL(wallify_map, (int,int, int,int)); +STATIC_DCL void FDECL(splev_initlev, (lev_init *)); +STATIC_DCL struct sp_frame * FDECL(frame_new, (long)); +STATIC_DCL void FDECL(frame_del, (struct sp_frame *)); +STATIC_DCL void FDECL(spo_frame_push, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_frame_pop, (struct sp_coder *)); +STATIC_DCL long FDECL(sp_code_jmpaddr, (long, long)); +STATIC_DCL void FDECL(spo_call, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_return, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_end_moninvent, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_pop_container, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_message, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_monster, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_object, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_level_flags, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_initlevel, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_engraving, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_mineralize, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_room, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_endroom, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_stair, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_ladder, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_grave, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_altar, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_trap, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_gold, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_corridor, (struct sp_coder *)); +STATIC_DCL struct opvar * FDECL(selection_opvar, (char *)); +STATIC_DCL xchar FDECL(selection_getpoint, (int,int, struct opvar *)); +STATIC_DCL void FDECL(selection_setpoint, (int,int, struct opvar *, XCHAR_P)); +STATIC_DCL struct opvar * FDECL(selection_not, (struct opvar *)); +STATIC_DCL struct opvar * FDECL(selection_logical_oper, (struct opvar *, struct opvar *, CHAR_P)); +STATIC_DCL struct opvar * FDECL(selection_filter_mapchar, (struct opvar *, struct opvar *)); +STATIC_DCL void FDECL(selection_filter_percent, (struct opvar *, int)); +STATIC_DCL int FDECL(selection_rndcoord, (struct opvar *, schar *, schar *)); +STATIC_DCL void FDECL(selection_do_grow, (struct opvar *, int)); +STATIC_DCL void FDECL(selection_floodfill, (struct opvar *, int,int)); +STATIC_DCL void FDECL(selection_do_ellipse, (struct opvar *, int,int, int,int, int)); +STATIC_DCL long FDECL(line_dist_coord, (long,long, long,long, long,long)); +STATIC_DCL void FDECL(selection_do_gradient, (struct opvar *, long,long, long,long, long,long,long,long)); +STATIC_DCL void FDECL(selection_do_line, (SCHAR_P,SCHAR_P, SCHAR_P,SCHAR_P, struct opvar *)); +STATIC_DCL void FDECL(selection_do_randline, (SCHAR_P,SCHAR_P, SCHAR_P,SCHAR_P, SCHAR_P,SCHAR_P, struct opvar *)); +STATIC_DCL void FDECL(selection_iterate, (struct opvar *, select_iter_func, genericptr_t)); +STATIC_DCL void FDECL(sel_set_ter, (int,int, genericptr_t)); +STATIC_DCL void FDECL(sel_set_feature, (int,int, genericptr_t)); +STATIC_DCL void FDECL(sel_set_door, (int,int, genericptr_t)); +STATIC_DCL void FDECL(spo_door, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_feature, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_terrain, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_replace_terrain, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_levregion, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_region, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_drawbridge, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_mazewalk, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_wall_property, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_room_door, (struct sp_coder *)); +STATIC_DCL void FDECL(sel_set_wallify, (int,int, genericptr_t)); +STATIC_DCL void FDECL(spo_wallify, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_map, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_jmp, (struct sp_coder *, sp_lev *)); +STATIC_DCL void FDECL(spo_conditional_jump, (struct sp_coder *, sp_lev *)); +STATIC_DCL void FDECL(spo_var_init, (struct sp_coder *)); +STATIC_DCL void FDECL(spo_shuffle_array, (struct sp_coder *)); #define LEFT 1 #define H_LEFT 2 @@ -3208,7 +3298,7 @@ selection_opvar(nbuf) return ov; } -char +xchar selection_getpoint(x,y,ov) int x,y; struct opvar *ov; @@ -3223,12 +3313,12 @@ void selection_setpoint(x,y,ov, c) int x,y; struct opvar *ov; - char c; + xchar c; { if (!ov || ov->spovartyp != SPOVAR_SEL) return; if (x < 0 || y < 0 || x >= COLNO || y >= ROWNO) return; - ov->vardata.str[COLNO*y + x] = (c + 1); + ov->vardata.str[COLNO*y + x] = (char)(c + 1); } struct opvar * @@ -3482,16 +3572,16 @@ line_dist_coord(x1,y1, x2,y2, x3,y3) long py = y2-y1; long s = px*px + py*py; long x, y, dx, dy, dist = 0; - float u = 0; + float lu = 0; if (x1 == x2 && y1 == y2) return isqrt(dist2(x1,y1, x3,y3)); - u = ((x3 - x1) * px + (y3 - y1) * py) / (float)s; - if (u > 1) u = 1; - else if (u < 0) u = 0; + lu = ((x3 - x1) * px + (y3 - y1) * py) / (float)s; + if (lu > 1) lu = 1; + else if (lu < 0) lu = 0; - x = x1 + u * px; - y = y1 + u * py; + x = x1 + lu * px; + y = y1 + lu * py; dx = x - x3; dy = y - y3; dist = isqrt(dx*dx + dy*dy); @@ -3648,7 +3738,7 @@ selection_do_randline(x1,y1,x2,y2,rough, rec, ov) void selection_iterate(ov, func, arg) struct opvar *ov; - void FDECL((*func), (int,int,genericptr_t)); + select_iter_func func; genericptr_t arg; { int x,y; From 30bce1ec6b7cd156ab2b77eb37166c88b2e20a0e Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 3 Apr 2015 12:29:58 +0300 Subject: [PATCH 346/354] Suggest only accessible positions for polearms and jumping --- src/apply.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/apply.c b/src/apply.c index aec7550a2..10bfdfd23 100644 --- a/src/apply.c +++ b/src/apply.c @@ -1403,7 +1403,8 @@ int state; for (dy = -4; dy <= 4; dy++) { x = dx + (int)u.ux; y = dy + (int)u.uy; - if (isok(x,y) && is_valid_jump_pos(x,y, jumping_is_magic, FALSE)) + if (isok(x,y) && ACCESSIBLE(levl[x][y].typ) && + is_valid_jump_pos(x,y, jumping_is_magic, FALSE)) tmp_at(x,y); } } else { @@ -2611,7 +2612,7 @@ int state; for (dy = -4; dy <= 4; dy++) { x = dx + (int)u.ux; y = dy + (int)u.uy; - if (isok(x, y) && + if (isok(x, y) && ACCESSIBLE(levl[x][y].typ) && distu(x, y) >= polearm_range_min && distu(x, y) <= polearm_range_max) { tmp_at(x, y); From fdc7e980ea2d32d8caea93e2cbc4381d849b6fd7 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 3 Apr 2015 14:46:28 +0300 Subject: [PATCH 347/354] Prevent segfaults, makemon can return null --- src/makemon.c | 16 +++++++++------- src/mhitu.c | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/makemon.c b/src/makemon.c index 799438c2e..cb466220e 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -122,13 +122,15 @@ register int x, y, n; */ if (enexto(&mm, mm.x, mm.y, mtmp->data)) { mon = makemon(mtmp->data, mm.x, mm.y, NO_MM_FLAGS); - mon->mpeaceful = FALSE; - mon->mavenge = 0; - set_malign(mon); - /* Undo the second peace_minded() check in makemon(); if the - * monster turned out to be peaceful the first time we - * didn't create it at all; we don't want a second check. - */ + if (mon) { + mon->mpeaceful = FALSE; + mon->mavenge = 0; + set_malign(mon); + /* Undo the second peace_minded() check in makemon(); if the + * monster turned out to be peaceful the first time we + * didn't create it at all; we don't want a second check. + */ + } } } } diff --git a/src/mhitu.c b/src/mhitu.c index 9ec602895..8450ad12e 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -2558,6 +2558,7 @@ cloneu() if (u.mh <= 1) return(struct monst *)0; if (mvitals[mndx].mvflags & G_EXTINCT) return(struct monst *)0; mon = makemon(youmonst.data, u.ux, u.uy, NO_MINVENT|MM_EDOG); + if (!mon) return NULL; mon->mcloned = 1; mon = christen_monst(mon, plname); initedog(mon); From 68a39aeab4d6e69bebd79449ea588bef9e62d0f8 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 3 Apr 2015 17:40:54 +0300 Subject: [PATCH 348/354] Fix GCC warnings caused by new lev_comp --- util/lev_main.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/util/lev_main.c b/util/lev_main.c index 2268c9fc3..88fe73ed3 100644 --- a/util/lev_main.c +++ b/util/lev_main.c @@ -119,7 +119,29 @@ static void NDECL(init_obj_classes); static int FDECL(case_insensitive_comp, (const char *, const char *)); void VDECL(lc_error, (const char *, ...)); +void VDECL(lc_warning, (const char *, ...)); +char * FDECL(decode_parm_chr, (CHAR_P)); +char * FDECL(decode_parm_str, (char *)); +struct opvar * FDECL(set_opvar_int, (struct opvar *, long)); +struct opvar * FDECL(set_opvar_coord, (struct opvar *, long)); +struct opvar * FDECL(set_opvar_region, (struct opvar *, long)); +struct opvar * FDECL(set_opvar_mapchar, (struct opvar *, long)); +struct opvar * FDECL(set_opvar_monst, (struct opvar *, long)); +struct opvar * FDECL(set_opvar_obj, (struct opvar *, long)); +struct opvar * FDECL(set_opvar_str, (struct opvar *, char *)); +struct opvar * FDECL(set_opvar_var, (struct opvar *, char *)); void VDECL(add_opvars, (sp_lev *, const char *, ...)); +void NDECL(break_stmt_start); +void FDECL(break_stmt_end, (sp_lev *)); +void FDECL(break_stmt_new, (sp_lev *, long)); +char *FDECL(funcdef_paramtypes, (struct lc_funcdefs *)); +const char *FDECL(spovar2str, (long)); +void FDECL(vardef_used, (struct lc_vardefs *, char *)); +void FDECL(check_vardef_type, (struct lc_vardefs *, char *, long)); +struct lc_vardefs * FDECL(add_vardef_type, (struct lc_vardefs *, char *, long)); +int FDECL(reverse_jmp_opcode, (int)); +struct opvar * FDECL(opvar_clone, (struct opvar *)); +void FDECL(start_level_def, (sp_lev **, char *)); static struct { @@ -897,15 +919,15 @@ splev_add_from(splev, from_splev) void -start_level_def(splev, fname) +start_level_def(splev, ldfname) sp_lev **splev; -char *fname; +char *ldfname; { struct lc_funcdefs *f; - if (index(fname, '.')) - lc_error("Invalid dot ('.') in level name '%s'.", fname); - if ((int) strlen(fname) > 14) - lc_error("Level names limited to 14 characters ('%s').", fname); + if (index(ldfname, '.')) + lc_error("Invalid dot ('.') in level name '%s'.", ldfname); + if ((int) strlen(ldfname) > 14) + lc_error("Level names limited to 14 characters ('%s').", ldfname); f = function_definitions; while (f) { f->n_called = 0; From 71401a7db877a726dbd219aa4939181c26792dfd Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 5 Apr 2015 12:17:57 +0300 Subject: [PATCH 349/354] Add poison cloud glyph, fumaroles to fire plane. When a gas cloud that deals damage is created, it uses a poison cloud glyph instead of the cloud glyph. (A bright green '#', or a bright-green recolor of the cloud tile) The plane of fire has random "stinking clouds", or fumaroles, centered on lava pools. Also make poison cloud glyph override lava, pool and moat glyphs. --- include/extern.h | 1 + include/rm.h | 39 ++++++++++++++++++++------------------- src/allmain.c | 2 ++ src/display.c | 7 ++++++- src/do.c | 2 ++ src/drawing.c | 2 ++ src/mkmaze.c | 20 ++++++++++++++++++++ src/region.c | 2 +- win/share/other.txt | 19 +++++++++++++++++++ 9 files changed, 73 insertions(+), 21 deletions(-) diff --git a/include/extern.h b/include/extern.h index 28680c5fa..971971ea8 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1158,6 +1158,7 @@ E boolean FDECL(bad_location, (XCHAR_P,XCHAR_P,XCHAR_P,XCHAR_P,XCHAR_P,XCHAR_P)) E void FDECL(place_lregion, (XCHAR_P,XCHAR_P,XCHAR_P,XCHAR_P, XCHAR_P,XCHAR_P,XCHAR_P,XCHAR_P, XCHAR_P,d_level *)); +E void NDECL(fumaroles); E void NDECL(movebubbles); E void NDECL(water_friction); E void FDECL(save_waterlevel, (int,int)); diff --git a/include/rm.h b/include/rm.h index 00f0bc4c5..cfc399300 100644 --- a/include/rm.h +++ b/include/rm.h @@ -189,34 +189,35 @@ #define S_ss2 72 #define S_ss3 73 #define S_ss4 74 +#define S_poisoncloud 75 /* The 8 swallow symbols. Do NOT separate. To change order or add, see */ /* the function swallow_to_glyph() in display.c. */ -#define S_sw_tl 75 /* swallow top left [1] */ -#define S_sw_tc 76 /* swallow top center [2] Order: */ -#define S_sw_tr 77 /* swallow top right [3] */ -#define S_sw_ml 78 /* swallow middle left [4] 1 2 3 */ -#define S_sw_mr 79 /* swallow middle right [6] 4 5 6 */ -#define S_sw_bl 80 /* swallow bottom left [7] 7 8 9 */ -#define S_sw_bc 81 /* swallow bottom center [8] */ -#define S_sw_br 82 /* swallow bottom right [9] */ +#define S_sw_tl 76 /* swallow top left [1] */ +#define S_sw_tc 77 /* swallow top center [2] Order: */ +#define S_sw_tr 78 /* swallow top right [3] */ +#define S_sw_ml 79 /* swallow middle left [4] 1 2 3 */ +#define S_sw_mr 80 /* swallow middle right [6] 4 5 6 */ +#define S_sw_bl 81 /* swallow bottom left [7] 7 8 9 */ +#define S_sw_bc 82 /* swallow bottom center [8] */ +#define S_sw_br 83 /* swallow bottom right [9] */ -#define S_explode1 83 /* explosion top left */ -#define S_explode2 84 /* explosion top center */ -#define S_explode3 85 /* explosion top right Ex. */ -#define S_explode4 86 /* explosion middle left */ -#define S_explode5 87 /* explosion middle center /-\ */ -#define S_explode6 88 /* explosion middle right |@| */ -#define S_explode7 89 /* explosion bottom left \-/ */ -#define S_explode8 90 /* explosion bottom center */ -#define S_explode9 91 /* explosion bottom right */ +#define S_explode1 84 /* explosion top left */ +#define S_explode2 85 /* explosion top center */ +#define S_explode3 86 /* explosion top right Ex. */ +#define S_explode4 87 /* explosion middle left */ +#define S_explode5 88 /* explosion middle center /-\ */ +#define S_explode6 89 /* explosion middle right |@| */ +#define S_explode7 90 /* explosion bottom left \-/ */ +#define S_explode8 91 /* explosion bottom center */ +#define S_explode9 92 /* explosion bottom right */ /* end effects */ -#define MAXPCHARS 92 /* maximum number of mapped characters */ +#define MAXPCHARS 93 /* maximum number of mapped characters */ #define MAXDCHARS 41 /* maximum of mapped dungeon characters */ #define MAXTCHARS 22 /* maximum of mapped trap characters */ -#define MAXECHARS 29 /* maximum of mapped effects characters */ +#define MAXECHARS 30 /* maximum of mapped effects characters */ #define MAXEXPCHARS 9 /* number of explosion characters */ struct symdef { diff --git a/src/allmain.c b/src/allmain.c index 5f5ab44c7..981358e77 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -294,6 +294,8 @@ boolean resuming; /* underwater and waterlevel vision are done here */ if (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz)) movebubbles(); + else if (Is_firelevel(&u.uz)) + fumaroles(); else if (Underwater) under_water(0); /* vision while buried done here */ diff --git a/src/display.c b/src/display.c index 0e8b042a6..87658aefa 100644 --- a/src/display.c +++ b/src/display.c @@ -674,7 +674,12 @@ newsym(x,y) */ lev->waslit = (lev->lit!=0); /* remember lit condition */ - if (reg != NULL && ACCESSIBLE(lev->typ)) { + /* normal region shown only on accessible positions, but poison clouds + * also shown above lava, pools and moats. + */ + if (reg != NULL && (ACCESSIBLE(lev->typ) || + (reg->glyph == cmap_to_glyph(S_poisoncloud) && + (lev->typ == LAVAPOOL || lev->typ == POOL || lev->typ == MOAT)))) { show_region(reg,x,y); return; } diff --git a/src/do.c b/src/do.c index eae360425..acc241a90 100644 --- a/src/do.c +++ b/src/do.c @@ -1288,6 +1288,8 @@ boolean at_stairs, falling, portal; /* initial movement of bubbles just before vision_recalc */ if (Is_waterlevel(&u.uz) || Is_airlevel(&u.uz)) movebubbles(); + else if (Is_firelevel(&u.uz)) + fumaroles(); if (level_info[new_ledger].flags & FORGOTTEN) { forget_map(ALL_MAP); /* forget the map */ diff --git a/src/drawing.c b/src/drawing.c index a5cc10d46..a08a7acc5 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -211,6 +211,7 @@ const struct symdef defsyms[MAXPCHARS] = { {'#', "", C(HI_ZAP)}, {'@', "", C(HI_ZAP)}, {'*', "", C(HI_ZAP)}, + {'#', "poison cloud", C(CLR_BRIGHT_GREEN)}, /* [part of] a poison cloud */ {'/', "", C(CLR_GREEN)}, /* swallow top left */ {'-', "", C(CLR_GREEN)}, /* swallow top center */ {'\\', "", C(CLR_GREEN)}, /* swallow top right */ @@ -614,6 +615,7 @@ struct symparse loadsyms[] = { {SYM_PCHAR, S_hcdbridge, "S_hcdbridge"}, {SYM_PCHAR, S_air, "S_air"}, {SYM_PCHAR, S_cloud, "S_cloud"}, + {SYM_PCHAR, S_poisoncloud, "S_poisoncloud"}, {SYM_PCHAR, S_water, "S_water"}, {SYM_PCHAR, S_arrow_trap, "S_arrow_trap"}, {SYM_PCHAR, S_dart_trap, "S_dart_trap"}, diff --git a/src/mkmaze.c b/src/mkmaze.c index 8a5b9b793..d9515de2d 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -879,6 +879,26 @@ register xchar x, y, todnum, todlevel; return; } +void +fumaroles() +{ + xchar n; + boolean snd = FALSE, loud = FALSE; + for (n = rn2(3)+2; n; n--) { + xchar x = rn1(COLNO-4,3); + xchar y = rn1(ROWNO-4,3); + struct trap *ttmp = t_at(x,y); + if (levl[x][y].typ == LAVAPOOL) { + NhRegion *r = create_gas_cloud(x,y, 4+rn2(5), rn1(10,5)); + clear_heros_fault(r); + snd = TRUE; + if (distu(x,y) < 15) loud = TRUE; + } + } + if (snd && !Deaf) + Norep("You hear a %swhoosh!", loud ? "loud " : ""); +} + /* * Special waterlevel stuff in endgame (TH). * diff --git a/src/region.c b/src/region.c index 562747948..bd47b7949 100644 --- a/src/region.c +++ b/src/region.c @@ -996,7 +996,7 @@ int damage; cloud->arg = zeroany; cloud->arg.a_int = damage; cloud->visible = TRUE; - cloud->glyph = cmap_to_glyph(S_cloud); + cloud->glyph = cmap_to_glyph(damage ? S_poisoncloud : S_cloud); add_region(cloud); return cloud; } diff --git a/win/share/other.txt b/win/share/other.txt index 14ec940d5..61258f290 100644 --- a/win/share/other.txt +++ b/win/share/other.txt @@ -1439,6 +1439,25 @@ P = (108, 145, 182) MMMMMNNNNNMMMMMM MMMMMMMMMMMMMMMM } +# tile 75 (poison cloud) +{ + BBBBBBBBBBBBBBBB + BBBBBFFFFFFFBBBB + BBBFFFFFFFFFFBBB + BBFFFFFFFFFGFFBB + BBFFFFFFFFFFFFFB + BFFFFFFFFFFFFGFB + FFFGFFFFFFFFGFFF + FFFFFFFFFFGGFFFF + FFFFFFFFFFFFFGFF + FFGGFFFFFFFGGFFG + FFFFFGGGGGFFFFGG + BGFFFFFFFFFFGGGB + BBGGGFFFFGGGGGGB + BBBGGGGGGGGGGBBB + BBBBBBGGGGBBBBBB + BBBBBBBBBBBBBBBB +} # tile 75 (cmap 75) { AAAAAAADDDDDDAAA From 056565fe7529f595f8ee892dd7a12ce5bffdcd4c Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 5 Apr 2015 12:47:27 +0300 Subject: [PATCH 350/354] Make all elementals breathless It makes no sense that air, fire and water elementals would choke in stinking cloud. --- src/monst.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/monst.c b/src/monst.c index d6b843b6c..2d2dbc5d1 100644 --- a/src/monst.c +++ b/src/monst.c @@ -1367,14 +1367,14 @@ NEARDATA struct permonst mons[] = { A(ATTK(AT_ENGL, AD_PHYS, 1, 10), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), SIZ(0, 0, MS_SILENT, MZ_HUGE), MR_POISON|MR_STONE, 0, - M1_NOEYES|M1_NOLIMBS|M1_NOHEAD|M1_MINDLESS|M1_UNSOLID|M1_FLY, + M1_NOEYES|M1_NOLIMBS|M1_NOHEAD|M1_MINDLESS|M1_BREATHLESS|M1_UNSOLID|M1_FLY, M2_STRONG|M2_NEUTER, 0, CLR_CYAN), MON("fire elemental", S_ELEMENTAL, LVL(8, 12, 2, 30, 0), (G_NOCORPSE|1), A(ATTK(AT_CLAW, AD_FIRE, 3, 6), ATTK(AT_NONE, AD_FIRE, 0, 4), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), SIZ(0, 0, MS_SILENT, MZ_HUGE), MR_FIRE|MR_POISON|MR_STONE, 0, - M1_NOEYES|M1_NOLIMBS|M1_NOHEAD|M1_MINDLESS|M1_UNSOLID|M1_FLY|M1_NOTAKE, + M1_NOEYES|M1_NOLIMBS|M1_NOHEAD|M1_MINDLESS|M1_BREATHLESS|M1_UNSOLID|M1_FLY|M1_NOTAKE, M2_STRONG|M2_NEUTER, M3_INFRAVISIBLE, CLR_YELLOW), MON("earth elemental", S_ELEMENTAL, LVL(8, 6, 2, 30, 0), (G_NOCORPSE|1), @@ -1390,7 +1390,7 @@ NEARDATA struct permonst mons[] = { A(ATTK(AT_CLAW, AD_PHYS, 5, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), SIZ(2500, 0, MS_SILENT, MZ_HUGE), MR_POISON|MR_STONE, 0, - M1_NOEYES|M1_NOLIMBS|M1_NOHEAD|M1_MINDLESS|M1_UNSOLID| + M1_NOEYES|M1_NOLIMBS|M1_NOHEAD|M1_MINDLESS|M1_BREATHLESS|M1_UNSOLID| M1_AMPHIBIOUS|M1_SWIM, M2_STRONG|M2_NEUTER, 0, CLR_BLUE), /* From 2643a5c3110d792b6d7f18db4f9403f8c0de7ce9 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 5 Apr 2015 13:47:59 +0300 Subject: [PATCH 351/354] Show stinking cloud valid positions --- doc/fixes35.0 | 4 ++-- src/display.c | 6 ++++-- src/read.c | 38 +++++++++++++++++++++++++++++++++++--- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 5fa64755d..4e81689ee 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -887,13 +887,13 @@ show object symbols in menu headings in menus where those object symbols act as menu accelerators, toggleable via "menu_objsyms" option show t-shirt text at end of game inventory disclose hitting with a polearm remembers the position of the last monster you hit -allow showing legal polearm positions when asked for location to hit add messages for trying to pick up some terrain features boomerang makes noise when hitting a sink non-pet rust monsters would eat rust-proofed non-digestibles but ignore those non-digestibles otherwise kicking a grave may topple the gravestone -allow showing legal jumping positions when asked for location to jump to +allow showing legal positions for stinking cloud, jumping and polearms + when asked for a location Platform- and/or Interface-Specific Fixes diff --git a/src/display.c b/src/display.c index 87658aefa..da5c194e7 100644 --- a/src/display.c +++ b/src/display.c @@ -829,8 +829,10 @@ shieldeff(x,y) * DISP_ALWAYS- Like DISP_FLASH, but vision is not taken into account. */ +#define TMP_AT_MAX_GLYPHS (COLNO*2) + static struct tmp_glyph { - coord saved[COLNO]; /* previously updated positions */ + coord saved[TMP_AT_MAX_GLYPHS]; /* previously updated positions */ int sidx; /* index of next unused slot in saved[] */ int style; /* either DISP_BEAM or DISP_FLASH or DISP_ALWAYS */ int glyph; /* glyph to use when printing */ @@ -900,7 +902,7 @@ tmp_at(x, y) default: /* do it */ if (tglyph->style == DISP_BEAM || tglyph->style == DISP_ALL) { if (tglyph->style != DISP_ALL && !cansee(x,y)) break; - if (tglyph->sidx >= COLNO) break; /* too many locations */ + if (tglyph->sidx >= TMP_AT_MAX_GLYPHS) break; /* too many locations */ /* save pos for later erasing */ tglyph->saved[tglyph->sidx].x = x; tglyph->saved[tglyph->sidx].y = y; diff --git a/src/read.c b/src/read.c index 7d35620bc..d20c25606 100644 --- a/src/read.c +++ b/src/read.c @@ -868,6 +868,39 @@ struct obj *sobj; return 0; } +boolean +is_valid_stinking_cloud_pos(x,y, showmsg) +int x,y; +boolean showmsg; +{ + if (!cansee(x, y) || !ACCESSIBLE(levl[x][y].typ) || distu(x, y) >= 32) { + if (showmsg) You("smell rotten eggs."); + return FALSE; + } + return TRUE; +} + +void +display_stinking_cloud_positions(state) + int state; +{ + if (state == 0) { + tmp_at(DISP_BEAM, cmap_to_glyph(S_flashbeam)); + } else if (state == 1) { + int x,y, dx, dy; + int dist = 6; + for (dx = -dist; dx <= dist; dx++) + for (dy = -dist; dy <= dist; dy++) { + x = u.ux + dx; + y = u.uy + dy; + if (isok(x,y) && is_valid_stinking_cloud_pos(x,y, FALSE)) + tmp_at(x,y); + } + } else { + tmp_at(DISP_END, 0); + } +} + /* scroll effects; return 1 if we use up the scroll and possibly make it become discovered, 0 if caller should take care of those side-effects */ int @@ -1613,14 +1646,13 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */ already_known ? "stinking " : ""); cc.x = u.ux; cc.y = u.uy; + getpos_sethilite(display_stinking_cloud_positions); if (getpos(&cc, TRUE, "the desired position") < 0) { pline1(Never_mind); break; } - if (!cansee(cc.x, cc.y) || distu(cc.x, cc.y) >= 32) { - You("smell rotten eggs."); + if (!is_valid_stinking_cloud_pos(cc.x, cc.y, TRUE)) break; - } (void) create_gas_cloud(cc.x, cc.y, 3+bcsign(sobj), 8+4*bcsign(sobj)); break; From 2c8b088edf468ba8d894a7a70d15c89849eb6100 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 5 Apr 2015 15:15:49 +0300 Subject: [PATCH 352/354] Add S_poisoncloud to Guidebooks --- doc/Guidebook.mn | 1 + doc/Guidebook.tex | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 89dee0ae0..5b6cd229e 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2837,6 +2837,7 @@ O S_ogre (ogre) o S_orc (orc) p S_piercer (piercer) ^ S_pit (pit) +# S_poisoncloud (poison cloud) ^ S_polymorph_trap (polymorph trap) } S_pool (water) ! S_potion (potion) diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 67ca18cc1..4073ab71b 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -3412,6 +3412,7 @@ Default & Symbol Name & Description\\ \verb@o@ & S\_orc & (orc)\\ \verb@p@ & S\_piercer & (piercer)\\ \verb@^@ & S\_pit & (pit)\\ +\verb@#@ & S\_poisoncloud & (poison cloud)\\ \verb@^@ & S\_polymorph\_trap & (polymorph trap)\\ \verb@}@ & S\_pool & (water)\\ \verb@!@ & S\_potion & (potion)\\ From 660534389e47146752340720e23aa2671bced2ce Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 5 Apr 2015 09:26:01 -0400 Subject: [PATCH 353/354] a warning bout lc_error lev_comp.l(310) : warning C4013: 'lc_error' undefined; assuming extern returning int --- sys/share/lev_lex.c | 1 + util/lev_comp.l | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/share/lev_lex.c b/sys/share/lev_lex.c index 91f13e8f8..c5fdc4097 100644 --- a/sys/share/lev_lex.c +++ b/sys/share/lev_lex.c @@ -1175,6 +1175,7 @@ void FDECL(init_yyout, (FILE *)); long NDECL(handle_varstring_check); long FDECL(corefunc_str_check, (char *, long)); +extern void VDECL(lc_error, (const char *, ...)); extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); extern struct lc_vardefs *variable_definitions; diff --git a/util/lev_comp.l b/util/lev_comp.l index bba52c270..202f3a7a8 100644 --- a/util/lev_comp.l +++ b/util/lev_comp.l @@ -1,5 +1,5 @@ %{ -/* NetHack 3.5 lev_comp.l $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */ +/* NetHack 3.5 lev_comp.l $NHDT-Date: 1428240296 2015/04/05 13:24:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ */ /* NetHack 3.5 lev_comp.l $Date: 2009/05/06 10:54:31 $ $Revision: 1.9 $ */ /* SCCS Id: @(#)lev_lex.c 3.5 2002/03/27 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ @@ -69,6 +69,7 @@ void FDECL(init_yyout, (FILE *)); long NDECL(handle_varstring_check); long FDECL(corefunc_str_check, (char *, long)); +extern void VDECL(lc_error, (const char *, ...)); extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int)); extern struct lc_vardefs *variable_definitions; From d8a65cd150c84ec9f65a917a8c11804a30a03acb Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 5 Apr 2015 16:29:34 +0300 Subject: [PATCH 354/354] Add missing protos --- src/read.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/read.c b/src/read.c index d20c25606..8c42fcfbe 100644 --- a/src/read.c +++ b/src/read.c @@ -27,7 +27,8 @@ STATIC_DCL void FDECL(randomize,(int *, int)); STATIC_DCL void FDECL(forget_single_object, (int)); STATIC_DCL void FDECL(forget, (int)); STATIC_DCL int FDECL(maybe_tame, (struct monst *,struct obj *)); - +STATIC_DCL boolean FDECL(is_valid_stinking_cloud_pos, (int, int, BOOLEAN_P)); +STATIC_DCL void FDECL(display_stinking_cloud_positions, (int)); STATIC_PTR void FDECL(set_lit, (int,int,genericptr_t)); STATIC_OVL boolean