home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!news.tek.com!master!saab!billr
- From: billr@saab.CNA.TEK.COM (Bill Randle)
- Newsgroups: comp.sources.games
- Subject: v16i089: nethack31 - display oriented dungeons & dragons (Ver. 3.1), Part81/108
- Message-ID: <4452@master.CNA.TEK.COM>
- Date: 5 Feb 93 19:21:23 GMT
- Sender: news@master.CNA.TEK.COM
- Lines: 1938
- Approved: billr@saab.CNA.TEK.COM
- Xref: uunet comp.sources.games:1640
-
- Submitted-by: izchak@linc.cis.upenn.edu (Izchak Miller)
- Posting-number: Volume 16, Issue 89
- Archive-name: nethack31/Part81
- Supersedes: nethack3p9: Volume 10, Issue 46-102
- Environment: Amiga, Atari, Mac, MS-DOS, OS2, Unix, VMS, X11
-
-
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 81 (of 108)."
- # Contents: dat/endgame.des src/cmd.c src/rip.c
- # Wrapped by billr@saab on Wed Jan 27 16:09:19 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'dat/endgame.des' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'dat/endgame.des'\"
- else
- echo shar: Extracting \"'dat/endgame.des'\" \(24177 characters\)
- sed "s/^X//" >'dat/endgame.des' <<'END_OF_FILE'
- X# SCCS Id: @(#)endgame.des 3.1 93/01/13
- X# Copyright (c) 1989 by Jean-Christophe Collet
- X# Copyright (c) 1992,1993 by Izchak Miller, David Cohrs,
- X# and Timo Hakulinen
- X# NetHack may be freely redistributed. See license for details.
- X#
- X# These are the ENDGAME levels: earth, air, fire, water, and astral.
- X# The top-most level, the Astral Level, has 3 temples and shrines.
- X# Players are supposed to sacrifice the Amulet of Yendor on the appropriate
- X# shrine.
- X
- XMAZE:"earth",' '
- XFLAGS: noteleport,hardfloor,shortsighted
- XMESSAGE: "Well done, mortal!"
- XMESSAGE: "But now thou must face the final Test..."
- XMESSAGE: "Prove thyself worthy or perish!"
- X
- XGEOMETRY:center,center
- X# The player lands, upon arrival, in the
- X# lower-right cavern. The location of the
- X# portal to the next level is randomly chosen.
- X# This map has no visible outer boundary, and
- X# is mostly diggable "rock".
- XMAP
- X
- X ...
- X .... ..
- X ..... ... ..
- X .... .... ...
- X .... ... .... ... .
- X .. .. ....... . ..
- X .. ... .
- X . .. . ...
- X .. .. . .. .
- X .. ... .
- X ... ...
- X .. ... ..
- X .... ..
- X .. ...
- X .. .....
- X ... ...
- X ....
- X ..
- X
- XENDMAP
- X# Since there are no stairs, this forces the hero's initial placement
- XTELEPORT_REGION:(69,16,69,16),(0,0,0,0)
- XPORTAL:(0,0,75,19),(65,13,75,19),"air"
- X# Some helpful monsters. Making sure a
- X# pick axe and at least one wand of digging
- X# are available.
- XMONSTER:'@',"Elvenking",(67,16)
- XMONSTER:'H',"minotaur",(67,14)
- X# An assortment of earth-appropriate nasties
- X# in each cavern.
- XMONSTER:'E',"earth elemental",(52,13),hostile
- XMONSTER:'E',"earth elemental",(53,13),hostile
- XMONSTER:'T',"rock troll",(53,12)
- XMONSTER:'H',"stone giant",(54,12)
- X#
- XMONSTER:'S',"pit viper",(70,05)
- XMONSTER:'&',"barbed devil",(69,06)
- XMONSTER:'H',"stone giant",(69,08)
- XMONSTER:''',"stone golem",(71,08)
- XMONSTER:'&',"pit fiend",(70,09)
- XMONSTER:'E',"earth elemental",(70,08),hostile
- X#
- XMONSTER:'E',"earth elemental",(60,03),hostile
- XMONSTER:'H',"stone giant",(61,04)
- XMONSTER:'E',"earth elemental",(62,04),hostile
- XMONSTER:'E',"earth elemental",(61,05),hostile
- XMONSTER:'s',"scorpion",(62,05)
- XMONSTER:'p',"rock piercer",(63,05)
- X#
- XMONSTER:'U',"umber hulk",(40,05)
- XMONSTER:'v',"dust vortex",(42,05)
- XMONSTER:'T',"rock troll",(38,06)
- XMONSTER:'E',"earth elemental",(39,06),hostile
- XMONSTER:'E',"earth elemental",(41,06),hostile
- XMONSTER:'E',"earth elemental",(38,07),hostile
- XMONSTER:'H',"stone giant",(39,07)
- XMONSTER:'E',"earth elemental",(43,07),hostile
- XMONSTER:''',"stone golem",(37,08)
- XMONSTER:'S',"pit viper",(43,08)
- XMONSTER:'S',"pit viper",(43,09)
- XMONSTER:'T',"rock troll",(44,10)
- X#
- XMONSTER:'E',"earth elemental",(02,01),hostile
- XMONSTER:'E',"earth elemental",(03,01),hostile
- XMONSTER:''',"stone golem",(01,02)
- XMONSTER:'E',"earth elemental",(02,02),hostile
- XMONSTER:'T',"rock troll",(04,03)
- XMONSTER:'T',"rock troll",(03,03)
- XMONSTER:'&',"pit fiend",(03,04)
- XMONSTER:'E',"earth elemental",(04,05),hostile
- XMONSTER:'S',"pit viper",(05,06)
- X#
- XMONSTER:'E',"earth elemental",(21,02),hostile
- XMONSTER:'E',"earth elemental",(21,03),hostile
- XMONSTER:'H',"minotaur",(21,04)
- XMONSTER:'E',"earth elemental",(21,05),hostile
- XMONSTER:'T',"rock troll",(22,06)
- XMONSTER:'E',"earth elemental",(22,06),hostile
- XMONSTER:'E',"earth elemental",(23,06),hostile
- X#
- XMONSTER:'S',"pit viper",(14,08)
- XMONSTER:'&',"barbed devil",(14,09)
- XMONSTER:'E',"earth elemental",(13,10),hostile
- XMONSTER:'T',"rock troll",(12,11)
- XMONSTER:'E',"earth elemental",(14,12),hostile
- XMONSTER:'E',"earth elemental",(15,13),hostile
- XMONSTER:'H',"stone giant",(17,13)
- XMONSTER:''',"stone golem",(18,13)
- XMONSTER:'&',"pit fiend",(18,12)
- XMONSTER:'E',"earth elemental",(18,11),hostile
- XMONSTER:'E',"earth elemental",(18,10),hostile
- X#
- XMONSTER:'&',"barbed devil",(02,16)
- XMONSTER:'E',"earth elemental",(03,16),hostile
- XMONSTER:'T',"rock troll",(02,17)
- XMONSTER:'E',"earth elemental",(04,17),hostile
- XMONSTER:'E',"earth elemental",(04,18),hostile
- X
- X
- XMAZE:"air",' '
- XFLAGS: noteleport,hardfloor,shortsighted
- X# The following messages are somewhat obtuse, to make then
- X# equally meaningful if the player can see or not.
- XMESSAGE: "What a strange feeling!"
- XMESSAGE: "You notice that there is no gravity here."
- XGEOMETRY:center,center
- X# The player lands, upon arrival, in the
- X# lower-left area. The location of the
- X# portal to the next level is randomly chosen.
- X# This map has no visible outer boundary, and
- X# is all "air".
- XMAP
- XAAAAAAAAAAAAAAAAAAAAAAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAAACCCCCCAAAAAAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAACCAACCCCCAAAAAACCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAACCACCCCCCCAAAAACCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAACCCCCCCCCCAAAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAAAACCCCAAACCAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAAAAACCCCAAAAAACCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAAACCCCCCCAAAACCACCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAACCCCAAAAAAACCACAACCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCAACCCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAACCCCAAACCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACACACCCCCAAACCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAACCCCCCCAAAACCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACACCCCCCCCAAACCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCCCCCCCCAACCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAAAAAAAAACACCCCCCCCCCACCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAACCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAACCCCCCAAACCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAACCAAAAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- XAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- XENDMAP
- XTELEPORT_REGION:(09,16,09,16),(0,0,0,0)
- XPORTAL:(30,0,75,19),(00,00,09,16),"fire"
- XREGION:(00,00,75,19),lit,"ordinary"
- XMONSTER:'E',"air elemental",random,hostile
- XMONSTER:'E',"air elemental",random,hostile
- XMONSTER:'E',"air elemental",random,hostile
- XMONSTER:'E',"air elemental",random,hostile
- XMONSTER:'E',"air elemental",random,hostile
- XMONSTER:'E',"air elemental",random,hostile
- XMONSTER:'E',"air elemental",random,hostile
- XMONSTER:'E',"air elemental",random,hostile
- XMONSTER:'E',"air elemental",random,hostile
- XMONSTER:'E',"air elemental",random,hostile
- XMONSTER:'E',"air elemental",random,hostile
- X
- XMONSTER:'e',"floating eye",random,hostile
- XMONSTER:'e',"floating eye",random,hostile
- XMONSTER:'e',"floating eye",random,hostile
- X
- XMONSTER:'y',"yellow light",random,hostile
- XMONSTER:'y',"yellow light",random,hostile
- XMONSTER:'y',"yellow light",random,hostile
- X
- XMONSTER:'A',"couatl",random
- X
- XMONSTER:'D',random,random
- XMONSTER:'D',random,random
- XMONSTER:'D',random,random
- XMONSTER:'D',random,random
- XMONSTER:'D',random,random
- X
- XMONSTER:'I',random,random
- XMONSTER:'I',random,random
- XMONSTER:'I',random,random
- XMONSTER:'J',random,random
- XMONSTER:'J',random,random
- X
- XMONSTER:'&',"djinni",random,hostile
- XMONSTER:'&',"djinni",random,hostile
- XMONSTER:'&',"djinni",random,hostile
- X
- XMONSTER:'v',"fog cloud",random,hostile
- XMONSTER:'v',"fog cloud",random,hostile
- XMONSTER:'v',"fog cloud",random,hostile
- XMONSTER:'v',"fog cloud",random,hostile
- XMONSTER:'v',"fog cloud",random,hostile
- XMONSTER:'v',"fog cloud",random,hostile
- XMONSTER:'v',"fog cloud",random,hostile
- XMONSTER:'v',"fog cloud",random,hostile
- XMONSTER:'v',"fog cloud",random,hostile
- XMONSTER:'v',"energy vortex",random,hostile
- XMONSTER:'v',"energy vortex",random,hostile
- XMONSTER:'v',"energy vortex",random,hostile
- XMONSTER:'v',"energy vortex",random,hostile
- XMONSTER:'v',"energy vortex",random,hostile
- XMONSTER:'v',"steam vortex",random,hostile
- XMONSTER:'v',"steam vortex",random,hostile
- XMONSTER:'v',"steam vortex",random,hostile
- XMONSTER:'v',"steam vortex",random,hostile
- XMONSTER:'v',"steam vortex",random,hostile
- X
- X
- XMAZE:"fire",' '
- XFLAGS: noteleport,hardfloor,shortsighted
- XGEOMETRY:center,center
- X# The player lands, upon arrival, in the
- X# lower-right. The location of the
- X# portal to the next level is randomly chosen.
- X# This map has no visible outer boundary, and
- X# is mostly open area, with lava lakes and bunches of fire traps.
- XMAP
- X............................................................................
- X....LLLLLLLL............L.......................LLL.........................
- X...LL...................L......................LLLL................LL.......
- X...L.............LLLL...LL....LL...............LLLLL.............LLL........
- X.LLLL..............LL....L.....LLL..............LLLL..............LLLL......
- X..........LLLL...LLLL...LLL....LLL......L........LLLL....LL........LLL......
- X........LLLLLLL...LL.....L......L......LL.........LL......LL........LL...L..
- X........LL..LLL..LL......LL......LLLL..L.........LL......LLL............LL..
- X....L..LL....LLLLL.................LLLLLLL.......L......LL............LLLLLL
- X....L..L.....LL.LLLL.......L............L........LLLLL.LL......LL.........LL
- X....LL........L...LL......LL.............LLL.....L...LLL.......LLL.........L
- X.....LLLLLL........L.......LLL.............L....LL...L.LLL......LLLLLLL.....
- X..........LLLL............LL.L.............L....L...LL.........LLL..LLL.....
- X...........................LLLLL...........LL...L...L........LLLL..LLLLLL...
- X.....LLLL.............LL....LL.......LLL...LL.......L..LLL....LLLLLLL.......
- X.......LLL.........LLLLLLLLLLL......LLLLL...L...........LL...LL...LL........
- X.........LL.......LL.........LL.......LLL....L..LLL....LL.........LL........
- X..........LLLLLLLLL...........LL....LLL.......LLLLL.....LL........LL........
- X.................L.............LLLLLL............LL...LLLL.........LL.......
- X.................................LL....................LL...................
- XENDMAP
- XTELEPORT_REGION:(69,16,69,16),(0,0,0,0)
- XPORTAL:(0,0,75,19),(65,13,75,19),"water"
- X
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- XTRAP:"fire",random
- X# An assortment of fire-appropriate nasties
- XMONSTER:'D',"red dragon",random
- XMONSTER:'&',"balrog",random
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'v',"fire vortex",random
- XMONSTER:'d',"hell hound",random
- X#
- XMONSTER:'H',"fire giant",random
- XMONSTER:'&',"barbed devil",random
- XMONSTER:'d',"hell hound",random
- XMONSTER:''',"stone golem",random
- XMONSTER:'&',"pit fiend",random
- XMONSTER:'E',"fire elemental",random,hostile
- X#
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'d',"hell hound",random
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'s',"scorpion",random
- XMONSTER:'H',"fire giant",random
- X#
- XMONSTER:'d',"hell hound",random
- XMONSTER:'v',"dust vortex",random
- XMONSTER:'v',"fire vortex",random
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'d',"hell hound",random
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:''',"stone golem",random
- XMONSTER:'S',"pit viper",random
- XMONSTER:'S',"pit viper",random
- XMONSTER:'v',"fire vortex",random
- X#
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'H',"fire giant",random
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'v',"fire vortex",random
- XMONSTER:'v',"fire vortex",random
- XMONSTER:'&',"pit fiend",random
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'S',"pit viper",random
- X#
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'H',"minotaur",random
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'v',"fire vortex",random
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'E',"fire elemental",random,hostile
- X#
- XMONSTER:'H',"fire giant",random
- XMONSTER:'&',"barbed devil",random
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'v',"fire vortex",random
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'d',"hell hound",random
- XMONSTER:'H',"fire giant",random
- XMONSTER:'&',"pit fiend",random
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'E',"fire elemental",random,hostile
- X#
- XMONSTER:'&',"barbed devil",random
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'v',"fire vortex",random
- XMONSTER:'E',"fire elemental",random,hostile
- XMONSTER:'E',"fire elemental",random,hostile
- X
- X
- XMAZE:"water",' '
- XFLAGS: noteleport,hardfloor,shortsighted
- XMESSAGE: "You find yourself suspended in an air bubble surrounded by water."
- XGEOMETRY:center,center
- X# The player lands upon arrival to an air bubble
- X# within the leftmost third of the level. The
- X# portal to the next level is randomly located in an air
- X# bubble within the rightmost third of the level.
- X# Bubbles are generated by special code in mkmaze.c for now.
- XMAP
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
- XENDMAP
- XTELEPORT_REGION:(0,0,25,19),(0,0,0,0)
- XPORTAL:(51,0,75,19),(0,0,0,0),"astral"
- X# A fisherman's dream...
- XMONSTER:';',"giant eel",random
- XMONSTER:';',"giant eel",random
- XMONSTER:';',"giant eel",random
- XMONSTER:';',"giant eel",random
- XMONSTER:';',"giant eel",random
- XMONSTER:';',"giant eel",random
- XMONSTER:';',"giant eel",random
- XMONSTER:';',"giant eel",random
- XMONSTER:';',"electric eel",random
- XMONSTER:';',"electric eel",random
- XMONSTER:';',"electric eel",random
- XMONSTER:';',"electric eel",random
- XMONSTER:';',"electric eel",random
- XMONSTER:';',"electric eel",random
- XMONSTER:';',"electric eel",random
- XMONSTER:';',"electric eel",random
- XMONSTER:';',"kraken",random
- XMONSTER:';',"kraken",random
- XMONSTER:';',"kraken",random
- XMONSTER:';',"kraken",random
- XMONSTER:';',"kraken",random
- XMONSTER:';',"kraken",random
- XMONSTER:';',"kraken",random
- XMONSTER:';',"kraken",random
- XMONSTER:';',"kraken",random
- XMONSTER:';',random,random
- XMONSTER:';',random,random
- XMONSTER:';',random,random
- XMONSTER:';',random,random
- XMONSTER:';',random,random
- XMONSTER:';',random,random
- XMONSTER:';',random,random
- XMONSTER:';',random,random
- XMONSTER:';',random,random
- X# These guys feel like home here
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- XMONSTER:'E',"water elemental",random,hostile
- X
- X
- XMAZE:"astral",' '
- XFLAGS: noteleport,hardfloor,shortsighted
- XMESSAGE: "You arrive on the Astral Plane!"
- XMESSAGE: "Here the High Temples of the aligned gods are located."
- XMESSAGE: "You sense alarm, hostility, and excitement in the air!"
- XGEOMETRY:center,center
- XMAP
- X ---------------
- X |.............|
- X |..---------..|
- X |..|.......|..|
- X--------------- |..|.......|..| ---------------
- X|.............| |..|.......|..| |.............|
- X|..---------..-| |-------| |..|.......|..| |-------| |-..---------..|
- X|..|.......|...-| |-.......-| |..|.......|..| |-.......-| |-...|.......|..|
- X|..|.......|....-|-.........-||..----+----..||-.........-|-....|.......|..|
- X|..|.......+.....+...........||.............||...........+.....+.......|..|
- X|..|.......|....-|-.........-|--|.........|--|-.........-|-....|.......|..|
- X|..|.......|...-| |-.......-| -|---+---|- |-.......-| |-...|.......|..|
- X|..---------..-| |---+---| |-.......-| |---+---| |-..---------..|
- X|.............| |...|-----|-.........-|-----|...| |.............|
- X--------------- |.........|...........|.........| ---------------
- X -------...|-.........-|...-------
- X |....|-.......-|....|
- X ---...|---+---|...---
- X |...............|
- X -----------------
- XENDMAP
- X# Where the player will land on arrival
- XTELEPORT_REGION:(29,15,45,15),(30,15,44,15)
- X# Lit courts
- XREGION:(01,05,16,14),lit,"ordinary",filled,true
- XREGION:(31,01,44,10),lit,"ordinary",filled,true
- XREGION:(61,05,74,14),lit,"ordinary",filled,true
- X# A Sanctum for each alignment
- X# The shrines' alignments are shuffled for
- X# each game
- XREGION:(04,07,10,11),lit,"temple"
- XREGION:(34,03,40,07),lit,"temple"
- XREGION:(64,07,70,11),lit,"temple"
- XALTAR:(07,09),align[0],sanctum
- XALTAR:(37,05),align[1],sanctum
- XALTAR:(67,09),align[2],sanctum
- X# Doors
- XDOOR:closed,(11,09)
- XDOOR:closed,(17,09)
- XDOOR:locked,(23,12)
- XDOOR:locked,(37,08)
- XDOOR:closed,(37,11)
- XDOOR:closed,(37,17)
- XDOOR:locked,(51,12)
- XDOOR:locked,(57,09)
- XDOOR:closed,(63,09)
- X# Non diggable everywhere
- XNON_DIGGABLE:(00,00,74,19)
- X# Moloch's horde
- X# West round room
- XMONSTER:'@',"aligned priest",(18,09),noalign,hostile
- XMONSTER:'@',"aligned priest",(19,08),noalign,hostile
- XMONSTER:'@',"aligned priest",(19,09),noalign,hostile
- XMONSTER:'@',"aligned priest",(19,10),noalign,hostile
- XMONSTER:'A',"Angel",(20,09),noalign,hostile
- XMONSTER:'A',"Angel",(20,10),noalign,hostile
- XMONSTER:'&',"Pestilence",(23,09),hostile
- X# South-central round room
- XMONSTER:'@',"aligned priest",(36,12),noalign,hostile
- XMONSTER:'@',"aligned priest",(37,12),noalign,hostile
- XMONSTER:'@',"aligned priest",(38,12),noalign,hostile
- XMONSTER:'@',"aligned priest",(36,13),noalign,hostile
- XMONSTER:'A',"Angel",(38,13),noalign,hostile
- XMONSTER:'A',"Angel",(37,13),noalign,hostile
- XMONSTER:'&',"Death",(37,14),hostile
- X# East round room
- XMONSTER:'@',"aligned priest",(56,09),noalign,hostile
- XMONSTER:'@',"aligned priest",(55,08),noalign,hostile
- XMONSTER:'@',"aligned priest",(55,09),noalign,hostile
- XMONSTER:'@',"aligned priest",(55,10),noalign,hostile
- XMONSTER:'A',"Angel",(54,09),noalign,hostile
- XMONSTER:'A',"Angel",(54,10),noalign,hostile
- XMONSTER:'&',"Famine",(51,09),hostile
- X#
- X# The aligned horde
- X#
- X# We do not know in advance the alignment of the
- X# player. The mpeaceful bit will need resetting
- X# when the level is created. The setting here is
- X# but a place holder.
- X#
- X# West court
- XMONSTER:'@',"aligned priest",(12,07),chaos,hostile
- XMONSTER:'@',"aligned priest",(13,07),chaos,peaceful
- XMONSTER:'@',"aligned priest",(14,07),law,hostile
- XMONSTER:'@',"aligned priest",(12,11),law,peaceful
- XMONSTER:'@',"aligned priest",(13,11),neutral,hostile
- XMONSTER:'@',"aligned priest",(14,11),neutral,peaceful
- XMONSTER:'A',"Angel",(11,05),chaos,hostile
- XMONSTER:'A',"Angel",(12,05),chaos,peaceful
- XMONSTER:'A',"Angel",(13,05),law,hostile
- XMONSTER:'A',"Angel",(11,13),law,peaceful
- XMONSTER:'A',"Angel",(12,13),neutral,hostile
- XMONSTER:'A',"Angel",(13,13),neutral,peaceful
- X# Central court
- XMONSTER:'@',"aligned priest",(32,09),chaos,hostile
- XMONSTER:'@',"aligned priest",(33,09),chaos,peaceful
- XMONSTER:'@',"aligned priest",(34,09),law,hostile
- XMONSTER:'@',"aligned priest",(40,09),law,peaceful
- XMONSTER:'@',"aligned priest",(41,09),neutral,hostile
- XMONSTER:'@',"aligned priest",(42,09),neutral,peaceful
- XMONSTER:'A',"Angel",(31,08),chaos,hostile
- XMONSTER:'A',"Angel",(32,08),chaos,peaceful
- XMONSTER:'A',"Angel",(31,09),law,hostile
- XMONSTER:'A',"Angel",(42,08),law,peaceful
- XMONSTER:'A',"Angel",(43,08),neutral,hostile
- XMONSTER:'A',"Angel",(43,09),neutral,peaceful
- X# East court
- XMONSTER:'@',"aligned priest",(60,07),chaos,hostile
- XMONSTER:'@',"aligned priest",(61,07),chaos,peaceful
- XMONSTER:'@',"aligned priest",(62,07),law,hostile
- XMONSTER:'@',"aligned priest",(60,11),law,peaceful
- XMONSTER:'@',"aligned priest",(61,11),neutral,hostile
- XMONSTER:'@',"aligned priest",(62,11),neutral,peaceful
- XMONSTER:'A',"Angel",(61,05),chaos,hostile
- XMONSTER:'A',"Angel",(62,05),chaos,peaceful
- XMONSTER:'A',"Angel",(63,05),law,hostile
- XMONSTER:'A',"Angel",(61,13),law,peaceful
- XMONSTER:'A',"Angel",(62,13),neutral,hostile
- XMONSTER:'A',"Angel",(63,13),neutral,peaceful
- X#
- X# Assorted nasties
- XMONSTER:'L',random,random,hostile
- XMONSTER:'L',random,random,hostile
- XMONSTER:'L',random,random,hostile
- XMONSTER:'V',random,random,hostile
- XMONSTER:'V',random,random,hostile
- XMONSTER:'V',random,random,hostile
- XMONSTER:'D',random,random,hostile
- XMONSTER:'D',random,random,hostile
- XMONSTER:'D',random,random,hostile
- END_OF_FILE
- if test 24177 -ne `wc -c <'dat/endgame.des'`; then
- echo shar: \"'dat/endgame.des'\" unpacked with wrong size!
- fi
- # end of 'dat/endgame.des'
- fi
- if test -f 'src/cmd.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/cmd.c'\"
- else
- echo shar: Extracting \"'src/cmd.c'\" \(26575 characters\)
- sed "s/^X//" >'src/cmd.c' <<'END_OF_FILE'
- X/* SCCS Id: @(#)cmd.c 3.1 92/11/25 */
- X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
- X/* NetHack may be freely redistributed. See license for details. */
- X
- X#include "hack.h"
- X#include "func_tab.h"
- X
- X/*
- X * Some systems may have getchar() return EOF for various reasons, and
- X * we should not quit before seeing at least NR_OF_EOFS consecutive EOFs.
- X */
- X#if defined(SYSV) || defined(DGUX) || defined(HPUX)
- X#define NR_OF_EOFS 20
- X#endif
- X
- X#ifdef DUMB /* stuff commented out in extern.h, but needed here */
- Xextern int NDECL(doapply); /**/
- Xextern int NDECL(dorub); /**/
- Xextern int NDECL(dojump); /**/
- Xextern int NDECL(doextlist); /**/
- Xextern int NDECL(dodrop); /**/
- Xextern int NDECL(doddrop); /**/
- Xextern int NDECL(dodown); /**/
- Xextern int NDECL(doup); /**/
- Xextern int NDECL(donull); /**/
- Xextern int NDECL(dowipe); /**/
- Xextern int NDECL(do_mname); /**/
- Xextern int NDECL(ddocall); /**/
- Xextern int NDECL(dotakeoff); /**/
- Xextern int NDECL(doremring); /**/
- Xextern int NDECL(dowear); /**/
- Xextern int NDECL(doputon); /**/
- Xextern int NDECL(doddoremarm); /**/
- Xextern int NDECL(dokick); /**/
- Xextern int NDECL(dothrow); /**/
- Xextern int NDECL(doeat); /**/
- Xextern int NDECL(done2); /**/
- Xextern int NDECL(doengrave); /**/
- Xextern int NDECL(dopickup); /**/
- Xextern int NDECL(ddoinv); /**/
- Xextern int NDECL(dotypeinv); /**/
- Xextern int NDECL(dolook); /**/
- Xextern int NDECL(doprgold); /**/
- Xextern int NDECL(doprwep); /**/
- Xextern int NDECL(doprarm); /**/
- Xextern int NDECL(doprring); /**/
- Xextern int NDECL(dopramulet); /**/
- Xextern int NDECL(doprtool); /**/
- Xextern int NDECL(dosuspend); /**/
- Xextern int NDECL(doforce); /**/
- Xextern int NDECL(doopen); /**/
- Xextern int NDECL(doclose); /**/
- Xextern int NDECL(dosh); /**/
- Xextern int NDECL(dodiscovered); /**/
- Xextern int NDECL(doset); /**/
- Xextern int NDECL(dotogglepickup); /**/
- Xextern int NDECL(dowhatis); /**/
- Xextern int NDECL(doquickwhatis); /**/
- Xextern int NDECL(dowhatdoes); /**/
- Xextern int NDECL(dohelp); /**/
- Xextern int NDECL(dohistory); /**/
- Xextern int NDECL(doloot); /**/
- Xextern int NDECL(dodrink); /**/
- Xextern int NDECL(dodip); /**/
- Xextern int NDECL(dosacrifice); /**/
- Xextern int NDECL(dopray); /**/
- Xextern int NDECL(doturn); /**/
- Xextern int NDECL(doredraw); /**/
- Xextern int NDECL(doread); /**/
- Xextern int NDECL(dosave); /**/
- Xextern int NDECL(dosearch); /**/
- Xextern int NDECL(doidtrap); /**/
- Xextern int NDECL(dopay); /**/
- Xextern int NDECL(dosit); /**/
- Xextern int NDECL(dotalk); /**/
- Xextern int NDECL(docast); /**/
- Xextern int NDECL(dovspell); /**/
- Xextern int NDECL(dotele); /**/
- Xextern int NDECL(dountrap); /**/
- Xextern int NDECL(doversion); /**/
- Xextern int NDECL(doextversion); /**/
- Xextern int NDECL(dowield); /**/
- Xextern int NDECL(dozap); /**/
- Xextern int NDECL(doorganize); /**/
- X#endif /* DUMB */
- X
- X#ifdef OVL1
- Xstatic int NDECL((*timed_occ_fn));
- X#endif /* OVL1 */
- X
- XSTATIC_PTR int NDECL(doprev_message);
- XSTATIC_PTR int NDECL(timed_occupation);
- XSTATIC_PTR int NDECL(doextcmd);
- X# ifdef POLYSELF
- XSTATIC_PTR int NDECL(domonability);
- X# endif
- X# ifdef WIZARD
- XSTATIC_PTR int NDECL(wiz_wish);
- XSTATIC_PTR int NDECL(wiz_identify);
- XSTATIC_PTR int NDECL(wiz_map);
- XSTATIC_PTR int NDECL(wiz_genesis);
- XSTATIC_PTR int NDECL(wiz_where);
- XSTATIC_PTR int NDECL(wiz_detect);
- XSTATIC_PTR int NDECL(wiz_level_tele);
- X# endif
- X# ifdef EXPLORE_MODE
- XSTATIC_PTR int NDECL(enter_explore_mode);
- X# endif
- X# if defined(WIZARD) || defined(EXPLORE_MODE)
- XSTATIC_PTR int NDECL(wiz_attributes);
- X# endif
- X
- X#ifdef OVLB
- Xstatic void FDECL(enlght_line, (const char *,const char *,const char *));
- X#ifdef UNIX
- Xstatic void NDECL(end_of_input);
- X#endif
- X#endif /* OVLB */
- X
- X#ifdef OVL0
- Xstatic int FDECL(click_to_cmd, (int,int,int));
- X#endif /* OVL0 */
- X
- XSTATIC_OVL char *NDECL(parse);
- X
- X#ifdef UNIX
- Xextern boolean hu;
- X#endif
- X
- X#ifdef OVL1
- X
- XSTATIC_PTR int
- Xdoprev_message()
- X{
- X return nh_doprev_message();
- X}
- X
- X/* Count down by decrementing multi */
- XSTATIC_PTR int
- Xtimed_occupation() {
- X (*timed_occ_fn)();
- X if (multi > 0)
- X multi--;
- X return multi > 0;
- X}
- X
- X/* If you have moved since initially setting some occupations, they
- X * now shouldn't be able to restart.
- X *
- X * The basic rule is that if you are carrying it, you can continue
- X * since it is with you. If you are acting on something at a distance,
- X * your orientation to it must have changed when you moved.
- X *
- X * The exception to this is taking off items, since they can be taken
- X * off in a number of ways in the intervening time, screwing up ordering.
- X *
- X * Currently: Take off all armor.
- X * Picking Locks / Forcing Chests.
- X */
- Xvoid
- Xreset_occupations() {
- X
- X reset_remarm();
- X reset_pick();
- X}
- X
- X/* If a time is given, use it to timeout this function, otherwise the
- X * function times out by its own means.
- X */
- Xvoid
- Xset_occupation(fn, txt, xtime)
- Xint NDECL((*fn));
- Xconst char *txt;
- Xint xtime;
- X{
- X if (xtime) {
- X occupation = timed_occupation;
- X timed_occ_fn = fn;
- X } else
- X occupation = fn;
- X occtxt = txt;
- X occtime = 0;
- X return;
- X}
- X
- X#ifdef REDO
- X
- Xstatic char NDECL(popch);
- X
- X/* Provide a means to redo the last command. The flag `in_doagain' is set
- X * to true while redoing the command. This flag is tested in commands that
- X * require additional input (like `throw' which requires a thing and a
- X * direction), and the input prompt is not shown. Also, while in_doagain is
- X * TRUE, no keystrokes can be saved into the saveq.
- X */
- X#define BSIZE 20
- Xstatic char pushq[BSIZE], saveq[BSIZE];
- Xstatic int NEARDATA phead, NEARDATA ptail, NEARDATA shead, NEARDATA stail;
- X
- Xstatic char
- Xpopch() {
- X /* If occupied, return '\0', letting tgetch know a character should
- X * be read from the keyboard. If the character read is not the
- X * ABORT character (as checked in pcmain.c), that character will be
- X * pushed back on the pushq.
- X */
- X if (occupation) return '\0';
- X if (in_doagain) return (shead != stail) ? saveq[stail++] : '\0';
- X else return (phead != ptail) ? pushq[ptail++] : '\0';
- X}
- X
- Xchar
- Xpgetchar() { /* curtesy of aeb@cwi.nl */
- X register int ch;
- X
- X if(!(ch = popch()))
- X ch = nhgetch();
- X return(ch);
- X}
- X
- X/* A ch == 0 resets the pushq */
- Xvoid
- Xpushch(ch)
- Xchar ch;
- X{
- X if (!ch)
- X phead = ptail = 0;
- X if (phead < BSIZE)
- X pushq[phead++] = ch;
- X return;
- X}
- X
- X/* A ch == 0 resets the saveq. Only save keystrokes when not
- X * replaying a previous command.
- X */
- Xvoid
- Xsavech(ch)
- Xchar ch;
- X{
- X if (!in_doagain) {
- X if (!ch)
- X phead = ptail = shead = stail = 0;
- X else if (shead < BSIZE)
- X saveq[shead++] = ch;
- X }
- X return;
- X}
- X#endif /* REDO */
- X
- X#endif /* OVL1 */
- X#ifdef OVLB
- X
- XSTATIC_PTR int
- Xdoextcmd() /* here after # - now read a full-word command */
- X{
- X char buf[BUFSZ];
- X register const struct ext_func_tab *efp = extcmdlist;
- Xagain:
- X#ifdef COM_COMPL
- X get_ext_cmd(buf);
- X#else
- X getlin("#", buf);
- X#endif
- X clear_nhwindow(WIN_MESSAGE);
- X if(buf[0] == '\0' || buf[0] == '\033')
- X return 0;
- X if(buf[0] == '?') {
- X (void) doextlist();
- X goto again;
- X }
- X while(efp->ef_txt) {
- X if(!strncmpi(efp->ef_txt, buf,BUFSIZ))
- X return (*(efp->ef_funct))();
- X efp++;
- X }
- X pline("%s: unknown extended command.", buf);
- X return 0;
- X}
- X
- Xint
- Xdoextlist() /* here after #? - now list all full-word commands */
- X{
- X register const struct ext_func_tab *efp;
- X char buf[BUFSZ];
- X winid datawin;
- X
- X datawin = create_nhwindow(NHW_TEXT);
- X putstr(datawin, 0, "");
- X putstr(datawin, 0, " Extended Commands List");
- X putstr(datawin, 0, "");
- X#ifdef COM_COMPL
- X putstr(datawin, 0, " Press '#', then type (first letter only):");
- X#else
- X putstr(datawin, 0, " Press '#', then type:");
- X#endif
- X putstr(datawin, 0, "");
- X
- X for(efp = extcmdlist; efp->ef_txt; efp++) {
- X Sprintf(buf, " %-8s - %s.", efp->ef_txt, efp->ef_desc);
- X putstr(datawin, 0, buf);
- X }
- X display_nhwindow(datawin, FALSE);
- X destroy_nhwindow(datawin);
- X return 0;
- X}
- X
- X#ifdef POLYSELF
- XSTATIC_PTR int
- Xdomonability()
- X{
- X if (can_breathe(uasmon)) return dobreathe();
- X else if (attacktype(uasmon, AT_SPIT)) return dospit();
- X else if (u.usym == S_NYMPH) return doremove();
- X else if (u.usym == S_UMBER) return doconfuse();
- X else if (is_were(uasmon)) return dosummon();
- X else if (webmaker(uasmon)) return dospinweb();
- X else if (is_hider(uasmon)) return dohide();
- X else if(u.umonnum == PM_GREMLIN) {
- X if(IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
- X struct monst *mtmp;
- X if ((mtmp = cloneu()) != 0) {
- X mtmp->mhpmax = (u.mhmax /= 2);
- X You("multiply.");
- X dryup(u.ux,u.uy);
- X }
- X } else pline("There is no fountain here.");
- X }
- X else if (u.usym == S_UNICORN) {
- X use_unicorn_horn((struct obj *)0);
- X return 1;
- X } else if (u.umonnum == PM_MIND_FLAYER) return domindblast();
- X else if (uasmon->msound == MS_SHRIEK) {
- X You("shriek.");
- X aggravate();
- X } else if (u.umonnum >= 0)
- X pline("Any special ability you may have is purely reflexive.");
- X else You("don't have a special ability!");
- X return 0;
- X}
- X#endif
- X
- X#ifdef EXPLORE_MODE
- XSTATIC_PTR int
- Xenter_explore_mode()
- X{
- X if(!discover && !wizard) {
- X pline("Beware! From discovery mode there will be no return to normal game.");
- X if (yn("Do you want to enter discovery mode?") == 'y') {
- X clear_nhwindow(WIN_MESSAGE);
- X You("are now in non-scoring discovery mode.");
- X discover = TRUE;
- X }
- X else {
- X clear_nhwindow(WIN_MESSAGE);
- X pline("Resuming normal game.");
- X }
- X }
- X return 0;
- X}
- X#endif
- X
- X#ifdef WIZARD
- XSTATIC_PTR int
- Xwiz_wish() /* Unlimited wishes for debug mode by Paul Polderman */
- X{
- X if (wizard) {
- X makewish();
- X (void) encumber_msg();
- X } else
- X pline("Unavailable command '^W'.");
- X return 0;
- X}
- X
- XSTATIC_PTR int
- Xwiz_identify()
- X{
- X struct obj *obj;
- X
- X if (!wizard)
- X pline("Unavailable command '^I'.");
- X else {
- X for (obj = invent; obj; obj = obj->nobj)
- X if (!objects[obj->otyp].oc_name_known || !obj->known
- X || !obj->dknown || !obj->bknown)
- X (void) identify(obj);
- X }
- X return 0;
- X}
- X
- XSTATIC_PTR int
- Xwiz_map()
- X{
- X if (wizard) do_mapping();
- X else pline("Unavailable command '^F'.");
- X return 0;
- X}
- X
- XSTATIC_PTR int
- Xwiz_genesis()
- X{
- X if (wizard) (void) create_particular();
- X else pline("Unavailable command '^G'.");
- X return 0;
- X}
- X
- XSTATIC_PTR int
- Xwiz_where()
- X{
- X if (wizard) print_dungeon();
- X else pline("Unavailable command '^O'.");
- X return 0;
- X}
- X
- XSTATIC_PTR int
- Xwiz_detect()
- X{
- X if(wizard) (void) findit();
- X else pline("Unavailable command '^E'.");
- X return 0;
- X}
- X
- XSTATIC_PTR int
- Xwiz_level_tele()
- X{
- X if (wizard) level_tele();
- X else pline("Unavailable command '^V'.");
- X return 0;
- X}
- X
- X#endif /* WIZARD */
- X
- X/* -enlightenment- */
- Xstatic winid en_win;
- Xstatic const char
- X *You_ = "You ",
- X *are = "are ", *were = "were ",
- X *have = "have ", *had = "had ",
- X *can = "can ", *could = "could ";
- X
- X#define enl_msg(prefix,present,past,suffix) \
- X enlght_line(prefix, final ? past : present, suffix)
- X#define you_are(attr) enl_msg(You_,are,were,attr)
- X#define you_have(attr) enl_msg(You_,have,had,attr)
- X#define you_can(attr) enl_msg(You_,can,could,attr)
- X
- Xstatic void
- Xenlght_line(start, middle, end)
- Xconst char *start, *middle, *end;
- X{
- X char buf[BUFSZ];
- X
- X Sprintf(buf, "%s%s%s.", start, middle, end);
- X putstr(en_win, 0, buf);
- X}
- X
- Xvoid
- Xenlightenment(final)
- Xboolean final;
- X{
- X int ltmp;
- X char buf[BUFSZ];
- X
- X en_win = create_nhwindow(NHW_MENU);
- X putstr(en_win, 0, final ? "Final Attributes:" : "Current Attributes:");
- X putstr(en_win, 0, "");
- X
- X /* note: piousness 20 matches MIN_QUEST_ALIGN (quest.h) */
- X if (u.ualign.record >= 20) you_are("piously aligned");
- X else if (u.ualign.record > 13) you_are("devoutly aligned");
- X else if (u.ualign.record > 8) you_are("fervently aligned");
- X else if (u.ualign.record > 3) you_are("stridently aligned");
- X else if (u.ualign.record == 3) you_are("aligned");
- X else if (u.ualign.record > 0) you_are("haltingly aligned");
- X else if (u.ualign.record == 0) you_are("nominally aligned");
- X else if (u.ualign.record >= -3) you_have("strayed");
- X else if (u.ualign.record >= -8) you_have("sinned");
- X else you_have("transgressed");
- X#ifdef WIZARD
- X if (wizard) {
- X Sprintf(buf, " %d", u.ualign.record);
- X enl_msg("Your alignment ", "is", "was", buf);
- X }
- X#endif
- X
- X if (Telepat) you_are("telepathic");
- X if (Searching) you_have("automatic searching");
- X if (Teleportation) you_can("teleport");
- X if (Teleport_control) you_have("teleport control");
- X if (See_invisible) enl_msg(You_, "see", "saw", " invisible");
- X if (Invisible) you_are("invisible");
- X else if (Invis) you_are("invisible to others");
- X if (Fast) you_are((Fast & ~INTRINSIC) ? "very fast" : "fast");
- X if (Stealth) you_are("stealthy");
- X if (Regeneration) enl_msg("You regenerate", "", "d", "");
- X if (Hunger) you_have("hunger");
- X if (Conflict) enl_msg("You cause", "", "d", " conflict");
- X if (Aggravate_monster) enl_msg("You aggravate", "", "d", " monsters");
- X if (Poison_resistance) you_are("poison resistant");
- X if (Fire_resistance) you_are("fire resistant");
- X if (Cold_resistance) you_are("cold resistant");
- X if (Shock_resistance) you_are("shock resistant");
- X if (Sleep_resistance) you_are("sleep resistant");
- X if (Disint_resistance) you_are("disintegration-resistant");
- X if (Protection_from_shape_changers)
- X you_are("protected from shape changers");
- X#ifdef POLYSELF
- X if (Polymorph) you_are("polymorphing");
- X if (Polymorph_control) you_have("polymorph control");
- X#endif
- X if (HHalluc_resistance)
- X enl_msg("You resist", "", "ed", " hallucinations");
- X if (final) {
- X if (Hallucination) you_are("hallucinating");
- X if (Stunned) you_are("stunned");
- X if (Confusion) you_are("confused");
- X if (Sick) you_are("sick");
- X if (Blinded) you_are("blinded");
- X }
- X if (Wounded_legs) {
- X Sprintf(buf, "wounded %s", makeplural(body_part(LEG)));
- X you_have(buf);
- X }
- X if (Glib) {
- X Sprintf(buf, "slippery %s", makeplural(body_part(FINGER)));
- X you_have(buf);
- X }
- X if (Strangled) you_are("being strangled");
- X if (Stoned) you_are("turning to stone");
- X if (Lifesaved)
- X enl_msg("Your life ", "will be", "would have been", " saved");
- X if (Adornment) you_are("adorned");
- X if (Warning) you_are("warned");
- X if (Protection) you_are("protected");
- X if (Reflecting) you_have("reflection");
- X if (Levitation) you_are("levitating");
- X if (Fumbling) enl_msg("You fumble", "", "d", "");
- X if (Jumping) you_can("jump");
- X if (Wwalking) you_can("walk on water");
- X if (Magical_breathing) you_can("survive without air");
- X if (Antimagic) you_are("magic-protected");
- X if (Displaced) you_are("displaced");
- X if (Clairvoyant) you_are("clairvoyant");
- X#ifdef POLYSELF
- X if (u.ulycn != -1) {
- X Strcpy(buf, an(mons[u.ulycn].mname));
- X you_are(buf);
- X }
- X#endif
- X if (Luck) {
- X ltmp = abs((int)Luck);
- X Sprintf(buf, "%s%slucky",
- X ltmp >= 10 ? "extremely " : ltmp >= 5 ? "very " : "",
- X Luck < 0 ? "un" : "");
- X#ifdef WIZARD
- X if (wizard) Sprintf(eos(buf), " (%d)", Luck);
- X#endif
- X you_are(buf);
- X }
- X#ifdef WIZARD
- X else if (wizard) enl_msg("Your luck ", "is", "was", " zero");
- X#endif
- X ltmp = stone_luck(TRUE);
- X if (ltmp > 0) you_have("extra luck");
- X else if (ltmp < 0) you_have("reduced luck");
- X if (carrying(LUCKSTONE)) {
- X ltmp = stone_luck(FALSE);
- X if (ltmp <= 0)
- X enl_msg("Bad luck ", "does", "did", " not time out for you");
- X if (ltmp >= 0)
- X enl_msg("Good luck ", "does", "did", " not time out for you");
- X }
- X
- X display_nhwindow(en_win, TRUE);
- X destroy_nhwindow(en_win);
- X return;
- X}
- X
- X#if defined(WIZARD) || defined(EXPLORE_MODE)
- XSTATIC_PTR int
- Xwiz_attributes()
- X{
- X if (wizard || discover)
- X enlightenment(FALSE);
- X else
- X pline("Unavailable command '^X'.");
- X return 0;
- X}
- X#endif /* WIZARD || EXPLORE_MODE */
- X
- X#endif /* OVLB */
- X#ifdef OVL1
- X
- X#ifndef M
- X# ifndef NHSTDC
- X# define M(c) (0x80 | (c))
- X# else
- X# define M(c) ((c) - 128)
- X# endif /* NHSTDC */
- X#endif
- X#ifndef C
- X#define C(c) (0x1f & (c))
- X#endif
- X
- Xstatic const struct func_tab cmdlist[] = {
- X {C('d'), dokick}, /* "D" is for door!...? */
- X#ifdef WIZARD
- X {C('e'), wiz_detect},
- X {C('f'), wiz_map},
- X {C('g'), wiz_genesis},
- X {C('i'), wiz_identify},
- X#endif
- X {C('l'), doredraw}, /* if number_pad is set */
- X#ifdef WIZARD
- X {C('o'), wiz_where},
- X#endif
- X {C('p'), doprev_message},
- X {C('r'), doredraw},
- X {C('t'), dotele},
- X#ifdef WIZARD
- X {C('v'), wiz_level_tele},
- X {C('w'), wiz_wish},
- X#endif
- X#if defined(WIZARD) || defined(EXPLORE_MODE)
- X {C('x'), wiz_attributes},
- X#endif
- X#ifdef SUSPEND
- X {C('z'), dosuspend},
- X#endif
- X {'a', doapply},
- X {'A', doddoremarm},
- X {M('a'), doorganize},
- X/* 'b', 'B' : go sw */
- X {'c', doclose},
- X {'C', do_mname},
- X {M('c'), dotalk},
- X {'d', dodrop},
- X {'D', doddrop},
- X {M('d'), dodip},
- X {'e', doeat},
- X {'E', doengrave},
- X/* Soon to be
- X {'f', dofight, "fighting"},
- X {'F', doFight, "fighting"},
- X */
- X {M('f'), doforce},
- X/* 'g', 'G' : multiple go */
- X/* 'h', 'H' : go west */
- X {'h', dohelp}, /* if number_pad is set */
- X {'i', ddoinv},
- X {'I', dotypeinv}, /* Robert Viduya */
- X {M('i'), doinvoke},
- X/* 'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N' : move commands */
- X {'j', dojump}, /* if number_pad is on */
- X {M('j'), dojump},
- X {'k', dokick}, /* if number_pad is on */
- X {'l', doloot}, /* if number_pad is on */
- X {M('l'), doloot},
- X/* 'n' prefixes a count if number_pad is on */
- X#ifdef POLYSELF
- X {M('m'), domonability},
- X#endif /* POLYSELF */
- X {'N', ddocall}, /* if number_pad is on */
- X {M('N'), ddocall},
- X {'o', doopen},
- X {'O', doset},
- X {M('o'), dosacrifice},
- X {'p', dopay},
- X {'P', doputon},
- X {M('p'), dopray},
- X {'q', dodrink},
- X {'Q', done2},
- X {'r', doread},
- X {'R', doremring},
- X {M('r'), dorub},
- X {'s', dosearch, "searching"},
- X {'S', dosave},
- X {M('s'), dosit},
- X {'t', dothrow},
- X {'T', dotakeoff},
- X {M('t'), doturn},
- X/* 'u', 'U' : go ne */
- X {'u', dountrap}, /* if number_pad is on */
- X {M('u'), dountrap},
- X {'v', doversion},
- X {'V', dohistory},
- X {M('v'), doextversion},
- X {'w', dowield},
- X {'W', dowear},
- X {M('w'), dowipe},
- X {'x', dovspell}, /* Mike Stephenson */
- X#ifdef EXPLORE_MODE
- X {'X', enter_explore_mode},
- X#endif
- X/* 'y', 'Y' : go nw */
- X {'z', dozap},
- X {'Z', docast},
- X {'<', doup},
- X {'>', dodown},
- X {'/', dowhatis},
- X {'&', dowhatdoes},
- X {'?', dohelp},
- X#ifdef SHELL
- X {'!', dosh},
- X#endif
- X {'.', donull, "waiting"},
- X {' ', donull, "waiting"},
- X {',', dopickup},
- X {':', dolook},
- X {';', doquickwhatis},
- X {'^', doidtrap},
- X {'\\', dodiscovered}, /* Robert Viduya */
- X {'@', dotogglepickup},
- X {WEAPON_SYM, doprwep},
- X {ARMOR_SYM, doprarm},
- X {RING_SYM, doprring},
- X {AMULET_SYM, dopramulet},
- X {TOOL_SYM, doprtool},
- X {GOLD_SYM, doprgold},
- X {SPBOOK_SYM, dovspell}, /* Mike Stephenson */
- X {'#', doextcmd},
- X {0,0,0}
- X};
- X#undef M
- X
- Xconst struct ext_func_tab extcmdlist[] = {
- X {"adjust", "adjust inventory letters", doorganize},
- X {"chat", "talk to someone", dotalk}, /* converse? */
- X {"dip", "dip an object into something", dodip},
- X {"force", "force a lock", doforce},
- X {"invoke", "invoke an object's powers", doinvoke},
- X {"jump", "jump to a location", dojump},
- X {"loot", "loot a box on the floor", doloot},
- X#ifdef POLYSELF
- X {"monster", "use a monster's special ability", domonability},
- X#endif
- X {"name", "name an item or type of object", ddocall},
- X {"offer", "offer a sacrifice to the gods", dosacrifice},
- X {"pray", "pray to the gods for help", dopray},
- X {"rub", "rub a lamp", dorub},
- X {"sit", "sit down", dosit},
- X {"turn", "turn undead", doturn},
- X {"untrap", "untrap something", dountrap},
- X {"version", "list compile time options for this version of NetHack",
- X doextversion},
- X#ifdef MAC
- X {"window", "clean up windows", SanePositions},
- X#endif
- X {"wipe", "wipe off your face", dowipe},
- X {"?", "get this list of extended commands", doextlist},
- X {NULL, NULL, donull}
- X};
- X
- X#define unctrl(c) ((c) <= C('z') ? (0x60 | (c)) : (c))
- X#define unmeta(c) (0x7f & (c))
- X
- X
- Xvoid
- Xrhack(cmd)
- Xregister char *cmd;
- X{
- X register const struct func_tab *tlist = cmdlist;
- X boolean firsttime = FALSE;
- X register int res;
- X
- X if(!cmd) {
- X firsttime = TRUE;
- X flags.nopick = 0;
- X cmd = parse();
- X }
- X if(*cmd == (char)033) {
- X flags.move = 0;
- X return;
- X }
- X#ifdef REDO
- X if (*cmd == DOAGAIN && !in_doagain && saveq[0]) {
- X in_doagain = TRUE;
- X stail = 0;
- X rhack(NULL); /* read and execute command */
- X in_doagain = FALSE;
- X return;
- X }
- X /* Special case of *cmd == ' ' handled better below */
- X if(!*cmd || *cmd == (char)0377) {
- X#else
- X if(!*cmd || *cmd == (char)0377 ||
- X (!flags.rest_on_space && *cmd == ' ')) {
- X#endif
- X nhbell();
- X flags.move = 0;
- X return; /* probably we just had an interrupt */
- X }
- X if(movecmd(*cmd)) {
- X walk:
- X if(multi) flags.mv = 1;
- X domove();
- X return;
- X }
- X if(movecmd(flags.num_pad ? unmeta(*cmd) : lowc(*cmd))) {
- X flags.run = 1;
- X rush:
- X if(firsttime){
- X if(!multi) multi = COLNO;
- X u.last_str_turn = 0;
- X }
- X flags.mv = 1;
- X domove();
- X return;
- X }
- X if(*cmd == 'g' && movecmd(cmd[1])) {
- X flags.run = 2;
- X goto rush;
- X }
- X if (((*cmd == 'G' || (flags.num_pad && *cmd == '5')) &&
- X movecmd(lowc(cmd[1]))) || movecmd(unctrl(*cmd))) {
- X flags.run = 3;
- X goto rush;
- X }
- X if((*cmd == 'm' || (flags.num_pad && *cmd == '-')) &&
- X movecmd(cmd[1])) {
- X flags.run = 0;
- X flags.nopick = 1;
- X goto walk;
- X }
- X if(*cmd == 'M' && movecmd(lowc(cmd[1]))) {
- X flags.run = 1;
- X flags.nopick = 1;
- X goto rush;
- X }
- X if (flags.num_pad && *cmd == '0') {
- X (void)ddoinv(); /* A convenience borrowed from the PC */
- X flags.move = 0;
- X multi = 0;
- X return;
- X }
- X while(tlist->f_char) {
- X if((*cmd & 0xff) == (tlist->f_char & 0xff)){
- X /* Special case of *cmd == ' ' handled here */
- X if (*cmd == ' ' && !flags.rest_on_space)
- X break;
- X
- X /* Now control-A can stop lengthy commands */
- X /* in the PC version only -- use ^C-N otherwise */
- X if (tlist->f_text && !occupation && multi)
- X#ifdef GCC_WARN
- X set_occupation(tlist->f_funct,
- X tlist->f_text, multi);
- X#else
- X set_occupation(((struct func_tab *)tlist)->f_funct,
- X tlist->f_text, multi);
- X#endif
- X res = (*(tlist->f_funct))();
- X if(!res) {
- X flags.move = 0;
- X multi = 0;
- X }
- X return;
- X }
- X tlist++;
- X }
- X { char expcmd[10];
- X register char *cp = expcmd;
- X while(*cmd && cp-expcmd < sizeof(expcmd)-2) {
- X if(*cmd >= 040 && *cmd < 0177)
- X *cp++ = *cmd++;
- X else if (*cmd & 0200) {
- X *cp++ = 'M';
- X *cp++ = '-';
- X *cp++ = *cmd++ &=~ 0200;
- X }
- X else {
- X *cp++ = '^';
- X *cp++ = *cmd++ ^ 0100;
- X }
- X }
- X *cp = 0;
- X Norep("Unknown command '%s'.", expcmd);
- X }
- X multi = flags.move = 0;
- X return;
- X}
- X
- Xint
- Xxytod(x, y) /* convert an x,y pair into a direction code */
- Xschar x, y;
- X{
- X register int dd;
- X
- X for(dd = 0; dd < 8; dd++)
- X if(x == xdir[dd] && y == ydir[dd]) return dd;
- X
- X return -1;
- X}
- X
- X#ifdef WALKIES
- Xvoid
- Xdtoxy(cc,dd) /* convert a direction code into an x,y pair */
- Xcoord *cc;
- Xregister int dd;
- X{
- X cc->x = xdir[dd];
- X cc->y = ydir[dd];
- X return;
- X}
- X#endif /* WALKIES */
- X
- Xint
- Xmovecmd(sym) /* also sets u.dz, but returns false for <> */
- Xchar sym;
- X{
- X register const char *dp;
- X register const char *sdp = flags.num_pad ? ndir : sdir;
- X
- X u.dz = 0;
- X if(!(dp = index(sdp, sym))) return 0;
- X u.dx = xdir[dp-sdp];
- X u.dy = ydir[dp-sdp];
- X u.dz = zdir[dp-sdp];
- X#ifdef POLYSELF
- X if (u.dx && u.dy && u.umonnum == PM_GRID_BUG) {
- X u.dx = u.dy = 0;
- X return 0;
- X }
- X#endif
- X return !u.dz;
- X}
- X
- Xint
- Xgetdir(s)
- Xconst char *s;
- X{
- X char dirsym;
- X
- X#ifdef REDO
- X if(in_doagain)
- X dirsym = readchar();
- X else
- X#endif
- X dirsym = yn_function (s ? s : "In what direction?", NULL, '\0');
- X#ifdef REDO
- X savech(dirsym);
- X#endif
- X if(dirsym == '.' || dirsym == 's')
- X u.dx = u.dy = u.dz = 0;
- X else if(!movecmd(dirsym) && !u.dz) {
- X if(!index(quitchars, dirsym))
- X pline("What a strange direction!");
- X return 0;
- X }
- X if(!u.dz && (Stunned || (Confusion && !rn2(5)))) confdir();
- X return 1;
- X}
- X
- X#endif /* OVL1 */
- X#ifdef OVLB
- X
- Xvoid
- Xconfdir()
- X{
- X register int x =
- X#ifdef POLYSELF
- X (u.umonnum == PM_GRID_BUG) ? 2*rn2(4) :
- X#endif
- X rn2(8);
- X u.dx = xdir[x];
- X u.dy = ydir[x];
- X return;
- X}
- X
- X#endif /* OVLB */
- X#ifdef OVL0
- X
- Xint
- Xisok(x,y)
- Xregister int x, y;
- X{
- X /* x corresponds to curx, so x==1 is the first column. Ach. %% */
- X return x >= 1 && x <= COLNO-1 && y >= 0 && y <= ROWNO-1;
- X}
- X
- Xstatic int NEARDATA last_multi;
- X
- X/*
- X * convert a MAP window position into a movecmd
- X */
- Xstatic int
- Xclick_to_cmd(x, y, mod)
- X int x, y, mod;
- X{
- X x -= u.ux;
- X y -= u.uy;
- X /* convert without using floating point, allowing sloppy clicking */
- X if(x > 2*abs(y))
- X x = 1, y = 0;
- X else if(y > 2*abs(x))
- X x = 0, y = 1;
- X else if(x < -2*abs(y))
- X x = -1, y = 0;
- X else if(y < -2*abs(x))
- X x = 0, y = -1;
- X else
- X x = sgn(x), y = sgn(y);
- X
- X if(x == 0 && y == 0) /* map click on player to "rest" command */
- X return '.';
- X
- X x = xytod(x, y);
- X if(mod == CLICK_1) {
- X return (flags.num_pad ? ndir[x] : sdir[x]);
- X } else {
- X return (sdir[x] - 'a' + 'A'); /* run command */
- X }
- X}
- X
- XSTATIC_OVL char *
- Xparse()
- X{
- X#ifdef LINT /* static char in_line[COLNO]; */
- X char in_line[COLNO];
- X#else
- X static char in_line[COLNO];
- X#endif
- X register int foo;
- X boolean prezero = FALSE;
- X
- X multi = 0;
- X flags.move = 1;
- X flush_screen(1); /* Flush screen buffer. Put the cursor on the hero. */
- X
- X if (!flags.num_pad || (foo = readchar()) == 'n')
- X for (;;) {
- X foo = readchar();
- X if (foo >= '0' && foo <= '9') {
- X multi = 10 * multi + foo - '0';
- X if (multi < 0 || multi > LARGEST_INT) multi = LARGEST_INT;
- X if (multi > 9) {
- X clear_nhwindow(WIN_MESSAGE);
- X Sprintf(in_line, "Count: %d", multi);
- X pline(in_line);
- X mark_synch();
- X }
- X last_multi = multi;
- X if (!multi && foo == '0') prezero = TRUE;
- X } else break; /* not a digit */
- X }
- X
- X if (foo == '\033') { /* esc cancels count (TH) */
- X clear_nhwindow(WIN_MESSAGE);
- X multi = last_multi = 0;
- X# ifdef REDO
- X } else if (foo == DOAGAIN || in_doagain) {
- X multi = last_multi;
- X } else {
- X last_multi = multi;
- X savech(0); /* reset input queue */
- X savech((char)foo);
- X# endif
- X }
- X
- X if (multi) {
- X multi--;
- X save_cm = in_line;
- X } else {
- X save_cm = NULL;
- X }
- X in_line[0] = foo;
- X in_line[1] = '\0';
- X if (foo == 'g' || foo == 'G' || (flags.num_pad && foo == '5') ||
- X foo == 'm' || foo == 'M') {
- X foo = readchar();
- X#ifdef REDO
- X savech((char)foo);
- X#endif
- X in_line[1] = foo;
- X in_line[2] = 0;
- X }
- X clear_nhwindow(WIN_MESSAGE);
- X if (prezero) in_line[0] = '\033';
- X return(in_line);
- X}
- X
- X#endif /* OVL0 */
- X#ifdef OVLB
- X
- X#ifdef UNIX
- Xstatic
- Xvoid
- Xend_of_input()
- X{
- X exit_nhwindows("End of input?");
- X#ifndef NOSAVEONHANGUP
- X if(!hu) {
- X hu = TRUE;
- X (void) dosave0();
- X }
- X#endif
- X clearlocks();
- X terminate(0);
- X}
- X#endif
- X
- X#endif /* OVLB */
- X#ifdef OVL0
- X
- Xchar
- Xreadchar()
- X{
- X register int sym;
- X int x, y, mod;
- X
- X#ifdef REDO
- X sym = in_doagain ? Getchar() : nh_poskey(&x, &y, &mod);
- X#else
- X sym = Getchar();
- X#endif
- X
- X#ifdef UNIX
- X# ifdef NR_OF_EOFS
- X if (sym == EOF) {
- X register int cnt = NR_OF_EOFS;
- X /*
- X * Some SYSV systems seem to return EOFs for various reasons
- X * (?like when one hits break or for interrupted systemcalls?),
- X * and we must see several before we quit.
- X */
- X do {
- X clearerr(stdin); /* omit if clearerr is undefined */
- X sym = Getchar();
- X } while (--cnt && sym == EOF);
- X }
- X# endif /* NR_OF_EOFS */
- X if (sym == EOF)
- X end_of_input();
- X#endif /* UNIX */
- X
- X if(sym == 0) /* click event */
- X sym = click_to_cmd(x, y, mod);
- X return((char) sym);
- X}
- X#endif /* OVL0 */
- X
- X/*cmd.c*/
- END_OF_FILE
- if test 26575 -ne `wc -c <'src/cmd.c'`; then
- echo shar: \"'src/cmd.c'\" unpacked with wrong size!
- fi
- # end of 'src/cmd.c'
- fi
- if test -f 'src/rip.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/rip.c'\"
- else
- echo shar: Extracting \"'src/rip.c'\" \(3321 characters\)
- sed "s/^X//" >'src/rip.c' <<'END_OF_FILE'
- X/* SCCS Id: @(#)rip.c 3.1 91/08/05
- X/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
- X/* NetHack may be freely redistributed. See license for details. */
- X
- X#include "hack.h"
- X
- Xstatic void FDECL(center, (int, char *));
- X
- Xextern const char *killed_by_prefix[];
- X
- Xstatic const char *rip_txt[] = {
- X" ----------",
- X" / \\",
- X" / REST \\",
- X" / IN \\",
- X" / PEACE \\",
- X" / \\",
- X" | |", /* Name of player */
- X" | |", /* Amount of $ */
- X" | |", /* Type of death */
- X" | |", /* . */
- X" | |", /* . */
- X" | |", /* . */
- X" | 1001 |", /* Real year of death */
- X" *| * * * | *",
- X" _________)/\\\\_//(\\/(/\\)/\\//\\/|_)_______",
- X0
- X};
- X
- X#define STONE_LINE_CENT 28 /* char[] element of center of stone face */
- X#define STONE_LINE_LEN 16 /* # chars that fit on one line
- X * (note 1 ' ' border)
- X */
- X#define NAME_LINE 6 /* *char[] line # for player name */
- X#define GOLD_LINE 7 /* *char[] line # for amount of gold */
- X#define DEATH_LINE 8 /* *char[] line # for death description */
- X#define YEAR_LINE 12 /* *char[] line # for year */
- X
- Xchar **rip;
- X
- Xstatic void
- Xcenter(line, text)
- Xint line;
- Xchar *text;
- X{
- X register char *ip,*op;
- X ip = text;
- X op = &rip[line][STONE_LINE_CENT - ((strlen(text)+1)>>1)];
- X while(*ip) *op++ = *ip++;
- X}
- X
- Xvoid
- Xoutrip(how, tmpwin)
- Xint how;
- Xwinid tmpwin;
- X{
- X register char **dp;
- X register char *dpx;
- X char buf[BUFSZ];
- X register int x;
- X int line;
- X
- X rip = dp = (char **) alloc(sizeof(rip_txt));
- X if (!dp) return;
- X for (x = 0; rip_txt[x]; x++) {
- X dp[x] = (char *) alloc((unsigned int)(strlen(rip_txt[x]) + 1));
- X if (!dp[x]) return;
- X Strcpy(dp[x], rip_txt[x]);
- X }
- X dp[x] = (char *)0;
- X
- X /* Put name on stone */
- X Sprintf(buf, "%s", plname);
- X buf[STONE_LINE_LEN] = 0;
- X center(NAME_LINE, buf);
- X
- X /* Put $ on stone */
- X Sprintf(buf, "%ld Au", u.ugold);
- X buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */
- X center(GOLD_LINE, buf);
- X
- X /* Put together death description */
- X switch (killer_format) {
- X default: impossible("bad killer format?");
- X case KILLED_BY_AN:
- X Strcpy(buf, killed_by_prefix[how]);
- X Strcat(buf, an(killer));
- X break;
- X case KILLED_BY:
- X Strcpy(buf, killed_by_prefix[how]);
- X Strcat(buf, killer);
- X break;
- X case NO_KILLER_PREFIX:
- X Strcpy(buf, killer);
- X break;
- X }
- X
- X /* Put death type on stone */
- X for (line=DEATH_LINE, dpx = buf; line<YEAR_LINE; line++) {
- X register int i,i0;
- X char tmpchar;
- X
- X if ( (i0=strlen(dpx)) > STONE_LINE_LEN) {
- X for(i = STONE_LINE_LEN;
- X ((i0 > STONE_LINE_LEN) && i); i--)
- X if(dpx[i] == ' ') i0 = i;
- X if(!i) i0 = STONE_LINE_LEN;
- X }
- X tmpchar = dpx[i0];
- X dpx[i0] = 0;
- X center(line, dpx);
- X if (tmpchar != ' ') {
- X dpx[i0] = tmpchar;
- X dpx= &dpx[i0];
- X } else dpx= &dpx[i0+1];
- X }
- X
- X /* Put year on stone */
- X Sprintf(buf, "%4d", getyear());
- X center(YEAR_LINE, buf);
- X
- X putstr(tmpwin, 0, "");
- X for(; *dp; dp++)
- X putstr(tmpwin, 0, *dp);
- X
- X putstr(tmpwin, 0, "");
- X putstr(tmpwin, 0, "");
- X}
- X
- X/*rip.c*/
- END_OF_FILE
- if test 3321 -ne `wc -c <'src/rip.c'`; then
- echo shar: \"'src/rip.c'\" unpacked with wrong size!
- fi
- # end of 'src/rip.c'
- fi
- echo shar: End of archive 81 \(of 108\).
- cp /dev/null ark81isdone
- MISSING=""
- for I in 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 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 108 archives.
- echo "Now execute 'rebuild.sh'"
- rm -f ark10[0-8]isdone ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-