Merge branch 'master' into mac-build-tty-pkg

This commit is contained in:
Haoyang Wang
2015-11-18 13:23:35 -08:00
81 changed files with 7244 additions and 6478 deletions
+3 -2
View File
@@ -4,7 +4,7 @@
|___/\___|\_/\___|_\___/ .__/\___|_| |___/\___|\_/\___|_\___/ .__/\___|_|
|_| |_|
$NHDT-Date: 1429884664 2015/04/24 14:11:04 $ $NHDT-Date: 1447180052 2015/11/10 18:27:32 $
Welcome to the NetHack Infrastructure Developer's Guide. Welcome to the NetHack Infrastructure Developer's Guide.
@@ -58,7 +58,8 @@ A. If you have never set up git on this machine before:
You probably want to set up a credential cache. You probably want to set up a credential cache.
Mac OS X: Mac OS X:
git config --global credential.helper osxkeychain git config --global credential.helper osxkeychain
XXX windows Windows:
git config --global credential.helper store
XXX linux XXX linux
B. Specify the prefix for variable substitution: B. Specify the prefix for variable substitution:
(This assumes you are not a member of DevTeam or any variant's development (This assumes you are not a member of DevTeam or any variant's development
+20 -4
View File
@@ -6,7 +6,7 @@ from or not transferred to your system if you wish.
.: .:
(files in top directory) (files in top directory)
Files Porting README DEVEL Files Porting README
dat: dat:
(files for all versions) (files for all versions)
@@ -272,9 +272,10 @@ mnsel.uu mnselcnt.uu mnunsel.uu mswproc.c
petmark.uu pilemark.uu resource.h rip.uu splash.uu petmark.uu pilemark.uu resource.h rip.uu splash.uu
tiles.mak winMS.h winhack.c winhack.rc tiles.mak winMS.h winhack.c winhack.rc
(files for Visual Studio 2010 Express Edition builds) (files for Visual Studio 2010 Express Edition builds)
dgncomp.vcxproj dgnstuff.vcxproj dgnstuff.mak dlb_main.vcxproj levcomp.vcxproj dgncomp.vcxproj dgnstuff.vcxproj dgnstuff.mak dlb_main.vcxproj
levstuff.vcxproj levstuff.mak makedefs.vcxproj NetHack.sln uudecode.vcxproj levcomp.vcxproj levstuff.vcxproj levstuff.mak makedefs.vcxproj
NetHackW.vcxproj tile2bmp.vcxproj recover.vcxproj tilemap.vcxproj tiles.vcxproj NetHack.sln uudecode.vcxproj NetHackW.vcxproj tile2bmp.vcxproj
recover.vcxproj tilemap.vcxproj tiles.vcxproj
This is a list of files produced by auxiliary programs. They can all be This is a list of files produced by auxiliary programs. They can all be
regenerated from the files in the distribution. regenerated from the files in the distribution.
@@ -352,6 +353,21 @@ tiletxt.c
(files generated for win32 at compile time) (files generated for win32 at compile time)
uudecode.exe uudecode.exe
DEVEL:
(files for people developing changes to NetHack)
DOTGIT code_style.txt nhgitset.pl
Developer.txt git_recipes.txt
code_features.txt hooksdir
DEVEL/hooksdir:
NHadd nhsub pre-auto-gc
NHgithook.pm post-applypatch pre-commit
NHsubst post-checkout pre-push
NHtext post-commit pre-rebase
TARGET post-merge prepare-commit-msg
applypatch-msg post-rewrite
commit-msg pre-applypatch
.: .:
(files for win32 that are moved into . at compile time) (files for win32 that are moved into . at compile time)
nethack.dsw nethack.dsw
+6 -4
View File
@@ -57,12 +57,14 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code.
for particular windowing environments. Reading them, and the man pages, for particular windowing environments. Reading them, and the man pages,
should answer most of your questions. should answer most of your questions.
At the time of this release, NetHack 3.6 has been tested to run/compile on: At the time of this release, NetHack 3.6 has been tested to run/compile
on:
Intel Pentium or better (or clone) running Linux, BSDI, or Intel Pentium or better (or clone) running Linux, BSDI, or
Windows (XP through 8.1) Windows (XP through 10)
Intel 80386 or greater (or clone) boxes running Linux, or BSDI Intel 80386 or greater (or clone) boxes running Linux, or BSDI
Mac OS X 10.9 Mac OS X 10.9
OpenVMS (aka VMS) V8.4 on Alpha and on Integrity/Itanium/IA64
Previous versions of NetHack were tested and known to run on the Previous versions of NetHack were tested and known to run on the
following systems, but it is unknown if they can still build and following systems, but it is unknown if they can still build and
@@ -107,8 +109,8 @@ Please read items (1), (2) and (3) BEFORE doing anything with your new code.
Sun SPARC based machine running SunOS 4.x, Solaris 2.x, or Solaris 7 Sun SPARC based machine running SunOS 4.x, Solaris 2.x, or Solaris 7
Valid Logic Systems SCALD-System Valid Logic Systems SCALD-System
Previous versions, using a cross-compiler hosted on another platform, such as Previous versions, using a cross-compiler hosted on another platform,
win32, could also build the following from source: such as win32, could also build the following from source:
Pocket PC devices running Windows CE 3.0 and higher Pocket PC devices running Windows CE 3.0 and higher
H/PC Pro devices running Windows CE 2.11 and higher H/PC Pro devices running Windows CE 2.11 and higher
Palm Size PC 1.1 devices running Windows CE 2.11 Palm Size PC 1.1 devices running Windows CE 2.11
+1
View File
@@ -3,6 +3,7 @@ oracles
data data
rip.xpm rip.xpm
pet_mark.xbm pet_mark.xbm
pilemark.xbm
quest.dat quest.dat
rumors rumors
bogusmon bogusmon
+17 -11
View File
@@ -11,7 +11,8 @@ UNIX(tm) machines to the Usenet.
Don G. Kneller ported Hack 1.0.3 to Microsoft(tm) C and MS-DOS(tm), producing Don G. Kneller ported Hack 1.0.3 to Microsoft(tm) C and MS-DOS(tm), producing
PC HACK 1.01e, added support for DEC Rainbow graphics in version 1.03g, and PC HACK 1.01e, added support for DEC Rainbow graphics in version 1.03g, and
went on to produce at least four more versions (3.0, 3.2, 3.51, and 3.6). went on to produce at least four more versions (3.0, 3.2, 3.51, and 3.6;
note that these are old Hack version numbers, not contemporary NetHack ones).
R. Black ported PC HACK 3.51 to Lattice(tm) C and the Atari 520/1040ST, R. Black ported PC HACK 3.51 to Lattice(tm) C and the Atari 520/1040ST,
producing ST Hack 1.03. producing ST Hack 1.03.
@@ -153,8 +154,8 @@ 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 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 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 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 during the tenure of 3.4.3. It was during that same period that several
variants emerged within the NetHack community. Notably sporkhack by new variants emerged within the NetHack community. Notably sporkhack by
Derek S. Ray, unnethack by Patric Mueller, nitrohack and its successors Derek S. Ray, unnethack by Patric Mueller, nitrohack and its successors
originally by Daniel Thaler and then by Alex Smith, and originally by Daniel Thaler and then by Alex Smith, and
Dynahack by Tung Nguyen. Some of those variants continue to be developed, Dynahack by Tung Nguyen. Some of those variants continue to be developed,
@@ -178,9 +179,9 @@ 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. Pasi Kallinen, and Derek S. Ray joined the NetHack development team.
In January 2015, preparation began for the release of NetHack 3.6. The 3.6 In January 2015, preparation began for the release of NetHack 3.6. The 3.6
version merges work done by the development team since the previous release with version merges work done by the development team since the previous release
some of the beloved community patches. Many bugs were fixed and some code was with some of the beloved community patches. Many bugs were fixed and some
restructured. code was restructured.
The development team, as well as Steve VanDevender and Kevin Smolkowski The development team, as well as Steve VanDevender and Kevin Smolkowski
ensured that NetHack 3.6.0 continued to operate on various Unix flavors ensured that NetHack 3.6.0 continued to operate on various Unix flavors
@@ -192,9 +193,14 @@ of NetHack 3.6.0 for Mac.
Michael Allison, Derek S. Ray, Yitzhak Sapir, Alex Kompel, Dion Nicolaas, Michael Allison, Derek S. Ray, Yitzhak Sapir, Alex Kompel, Dion Nicolaas,
and David Cohrs maintained the port of NetHack 3.6.0 for Microsoft Windows. and David Cohrs maintained the port of NetHack 3.6.0 for Microsoft Windows.
Pat Rankin attempted to keep the VMS port running for NetHack 3.6.0,
hindered by limited access. Kevin Smolkowski has updated and tested it
for the most recent version of OpenVMS (V8.4 as of this writing) on Alpha
and Integrity (aka Itanium aka IA64) but not VAX.
This version of the game is special in a particular way. Near the end of 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 the development of 3.6, one of the significant inspirations for many of
humorous and fun features found in the game, author Terry Pratchett, the humorous and fun features found in the game, author Terry Pratchett,
passed away. This version of the game includes a tribute to him. passed away. This version of the game includes a tribute to him.
@@ -206,9 +212,9 @@ SHOUT-OUTS
The devteam would like to give a special "shout-out" to thank the generous The devteam would like to give a special "shout-out" to thank the generous
people primarily responsible for the public NetHack servers available for people primarily responsible for the public NetHack servers available for
playing the game at nethack.alt.org and devnull.net. In addition to providing playing the game at nethack.alt.org and devnull.net. In addition to
a way for the public to play a game of NetHack from almost anywhere, they providing a way for the public to play a game of NetHack from almost
have hosted annual NetHack tournaments for many, many years. 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. M. Drew Streib, Pasi Kallinen and Robin Bandy.
+1
View File
@@ -1142,6 +1142,7 @@ DOOR:closed,(73,5)
DOOR:closed,(2,15) DOOR:closed,(2,15)
MAZEWALK:(36,8),west MAZEWALK:(36,8),west
STAIR:(42,8),up STAIR:(42,8),up
WALLIFY
# Objects # Objects
OBJECT:('*',"diamond"),random OBJECT:('*',"diamond"),random
+535 -36
View File
@@ -3934,14 +3934,174 @@ is 'me'?"
# #
# #
# #
%title Going Postal (1) %title Going Postal (13)
%passage 1 %passage 1
What was magic, after all, but something that happened at the snap of
a finger? Where was the magic in that? It was mumbled words and weird
drawings in old books and in the wrong hands it was dangerous as hell,
but not one half as dangerous as it could be in the right hands.
What was magic, after all, but something that happened at the [Going Postal, by Terry Pratchett]
snap of a finger? Where was the magic in that? It was mumbled %e passage
words and weird drawings in old books and in the wrong hands it # p. 5 (Harper Torch edition)
was dangerous as hell, but not one half as dangerous as it could %passage 2
be in the right hands. They say that the prospect of being hanged in the morning concentrates
a man's mind wonderfully; unfortunately, what the mind inevitably
concentrates on is that, in the morning, it will be in a body that is
going to be hanged.
[Going Postal, by Terry Pratchett]
%e passage
# p. 18
%passage 3
There is a saying, "You can't fool an honest man," which is much quoted
by people who make a profitable living by fooling honest men. Moist
never tried it, knowingly anyway. If you did fool an honest man, he
tended to complain to the local Watch, and these days they were harder
to buy off. Fooling dishonest men was a lot safer, and somehow, more
sporting. And, of course, there were so many more of them. You hardly
had to aim.
[Going Postal, by Terry Pratchett]
%e passage
# p. 47 (passage starts mid-paragraph;
# italics because it's Moist von Lipwig's internal monolog)
%passage 4
/What kind of man would put a known criminal in charge of a major branch
of government? Apart from, say, the average voter./
[Going Postal, by Terry Pratchett]
%e passage
# p. 137
%passage 5
Now he could see the mysterious order clearly. They were robed, of course,
because you couldn't have a secret order without robes. They had pushed
the hoods back now, and each man(1) was wearing a peaked cap with a bird
skeleton wired to it.
(1) Women are always significantly underrepresented in secret orders.
[Going Postal, by Terry Pratchett]
%e passage
# p. 184 ('Tubso' and 'Bissonomy' are accurate)
%passage 6
Just below the dome, staring down from their niches, were statues of the
Virtues: Patience, Chastity, Silence, Charity, Hope, Tubso, Bissonomy,(1)
and Fortitude.
(1) Many cultures practice neither of these in the hustle and bustle of
the modern world, because no one can remember what they are.
[Going Postal, by Terry Pratchett]
%e passage
# pp. 249-250 (Moist and Miss Dearheart are in a fancy restaurant)
%passage 7
She froze, staring over his shoulder. He saw her right hand scrabble
frantically among the cutlery and grab a knife.
"That bastard has just walked into the place!" she hissed. "Reacher Gilt!
I'll just kill him and join you for the pudding..."
"You can't do that!" hissed Moist.
"Oh? Why not?"
"You're using the wrong knife! That's for the fish! You'll get into
trouble!"
She glared at him, but her hand relaxed, and something like a smile
appeared on her face.
"They don't have a knife for stabbing rich, murdering bastards?" she said.
"They bring it to the table when you order one," said Moist urgently.
"Look, this isn't the Drum, they don't just throw the body into the river!
They'll call the Watch! Get a grip. Not on a knife! And get ready to
run."
"Why?"
"Because I forged his signature on Grand Trunk notepaper to get us in
here, that's why."
[Going Postal, by Terry Pratchett]
%e passage
# pp 260-261 (Mr. Groat: elderly postal employee recently attacked in
# the palacial but severely dilapidated post office;
# "his imagination": Moist's; "him": Mr. Groat; "he": Moist)
%passage 8
The vision of Mr. Groat's chest kept bumping insistently against his
imagination. It looked as though something with claws had taken a swipe
at him, and only the thick uniform coat prevented him from being opened
like a clam. But that didn't sound like a vampire. They weren't messy
like that. It was a waste of good food.
Nevertheless, he picked up a piece of smashed chair. It had splintered
nicely. And the nice thing about a stake through the heart was that it
also worked on non-vampires.
[Going Postal, by Terry Pratchett]
%e passage
# p. 262 (Stanley, a young postal employee who collects pins, recently
# fought off /something/ using a bag of pins as a weapon)
# [this passage doesn't have a very satisfactory ending...]
%passage 9
You probably couldn't /kill/ a vampire with pins...
And after a thought like that is when you realize that however hard you
try to look behind you, there's a behind you, behind you, where you aren't
looking. Moist flung his back to the cold stone wall where he slithered
along it until he ran out of wall and acquired a doorframe.
[Going Postal, by Terry Pratchett]
%e passage
#p. 278 ('thoughted' and 'thoughting' are accurate)
%passage 10
"Oh, Mr. Lipwig!"
It is not often that a wailing woman rushes into a room and throws herself
at a man. It had never happened to Moist before. Now it happened, and it
seemed such a waste that the woman was Miss Maccalariat.
She tottered forward and clung to the startled Moist, tears streaming down
her face.
"Oh, Mr. Lipwig!" she wailed. "Oh, Mr. Lipwig!"
Moist reeled under her weight. She was dragging at his collar so hard
that he was likely to end up on the floor, and the thought of being found
on the floor with Miss Maccalariat was--well, a thought that just couldn't
be thoughted. The head would explode before thoughting it.
[Going Postal, by Terry Pratchett]
%e passage
#p. 315
%passage 11
Always remember that the crowd that applauds your coronation is the same
crowd that will applaud your beheading. People like a show.
[Going Postal, by Terry Pratchett]
%e passage
# p. 326 (homage to "To Have and Have Not"; Lauren Bacall's character says
# to Humphrey Bogart's character, "You know how to whistle, don't
# you Steve? Just put your lips together and--blow."
# Miss Dearheart's slight pause seems better placed...)
%passage 12
Miss Dearheart stubbed out her cigarette. "Go up there tonight, Mr. Lipwig.
Get yourself a little bit closer to heaven. And then get down on your
knees and pray. You know how to pray, don't you? You just put your hands
together--and hope."
[Going Postal, by Terry Pratchett]
%e passage
# p. 333 ('crackers' have been sending and receiving clandestine clacks
# messages without owners/operators of the clacks network noticing)
%passage 13
It was a little like stealing. It was exactly like stealing. It was, in
fact, stealing. But there was no law against it, because no one knew the
crime existed, so is it really stealing if what's stolen isn't missed?
And is it stealing if you're stealing from thieves? Anyway, all property
is theft, except mine.
[Going Postal, by Terry Pratchett] [Going Postal, by Terry Pratchett]
%e passage %e passage
@@ -3949,26 +4109,31 @@ be in the right hands.
# #
# #
# #
%title Thud! (2) %title Thud! (7)
# p. 39 (Harper Torch edition; passage starts mid-paragraph; speaker is Nobby)
%passage 1 %passage 1
Why bother with a cunning plan when a simple one will do? "Why mess about with a cunning plan when a simple one will do?"
[Thud!, by Terry Pratchett] [Thud!, by Terry Pratchett]
%e passage %e passage
# pp. 334-336 (originally transcribed from some other edition)
%passage 2 %passage 2
#submitted by Boudewijn He wanted to sleep. He'd never felt this tired before. Vimes slumped to
He wanted to sleep. He'd never felt this tired before. his knees, and then fell sideways on to the sand.
Vimes slumped to his knees, and then fell sideways on to the sand.
When he forced open his eyes he saw pale stars above him, and had once When he forced his eyes open, he saw pale stars above him, and had, once
again the sensation that there was someone else present. again, the sensation that there was someone else present.
He turned his head, wincing at the stab of pain, and saw a small but He turned his head, wincing at the stab of pain, and saw a small but
brightly lit folding chair on the sand. A robed figure was reclining brightly lit folding chair on the sand. A robed figure was reclining in
in it, reading a book. A scythe was stuck in the sand beside it. it, reading a book. A scythe was stuck in the sand beside it.
A white skeletal hand turned a page.
A white, skeletal hand turned a page.
'You'll be Death, then?' said Vimes, after a while. 'You'll be Death, then?' said Vimes, after a while.
AH. MISTER VIMES, ASTUTE AS EVER. GOT IT IN ONE, said Death, shutting AH, MISTER VIMES, ASTUTE AS EVER. GOT IT IN ONE, said Death, shutting the
the book on his finger to keep the place. book on his finger to keep the place.
'I've seen you before.' 'I've seen you before.'
@@ -3976,32 +4141,36 @@ I HAVE WALKED WITH YOU MANY TIMES, MISTER VIMES.
'And this is /it/, is it?' 'And this is /it/, is it?'
HAS IT NEVER STRUCK YOU THAT THE CONCEPT OF A WRITTEN NARRATIVE IS HAS IT NEVER STRUCK YOU THAT THE CONCEPT OF A WRITTEN NARRATIVE IS SOMEWHAT
SOMEWHAT STRANGE? said Death. STRANGE? said Death.
Vimes could tell when people were trying to avoid something they really Vimes could tell when people were trying to avoid something they really
didn't want to say, and it was happening here. didn't want to say, and it was happening here.
'Is it?' he insisted. 'Is this it? This time I die?' 'Is it?' he insisted. 'Is this it? This time I die?'
COULD BE. COULD BE.
'Could be? What sort of answer is that?' said Vimes. 'Could be? What sort of answer is that?' said Vimes.
A VERY ACCURATE ONE. YOU SEE, YOU ARE HAVING A NEAR DEATH EXPERIENCE, A VERY ACCURATE ONE. YOU SEE, YOU ARE HAVING A NEAR-DEATH EXPERIENCE,
WHICH INESCAPABLY MEANS THAT I MUST UNDERGO A NEAR VIMES EXPERIENCE. WHICH INESCAPABLY MEANS THAT I MUST UNDERGO A NEAR-/VIMES/ EXPERIENCE.
DON'T MIND ME. CARRY ON WHATEVER YOU WERE DOING. I HAVE A BOOK. DON'T MIND ME. CARRY ON WITH WHATEVER YOU WERE DOING. I HAVE A BOOK.
Vimes rolled over on to his stomach, gritted his teeth, and pushed himself
on to his hands and knees again. He managed a few yards before slumping
back down.
He heard the sound of a chair being moved.
Vimes rolled over on to his stomach, gritted his teeth and pushed
himself on to his hands and knees again. He managed a few yards before
slumping back down. He heard the sound of a chair being moved.
'Shouldn't you be somewhere else?' he said. 'Shouldn't you be somewhere else?' he said.
I AM, said Death, sitting down again. I AM, said Death, sitting down again.
'But you're here!' 'But you're here!'
AS WELL. Death turned a page and, for a person without breath, managed AS WELL. Death turned a page and, for a person without breath, managed a
a pretty good sigh. IT APPEARS THAT THE BUTLER DID IT. pretty good sigh. IT APPEARS THAT THE BUTLER DID IT.
'Did what?' 'Did what?'
@@ -4010,30 +4179,353 @@ LAST PAGE AND THE ANSWER IS THERE. WHAT, THEREFORE, IS THE POINT OF
DELIBERATEDLY NOT KNOWING? DELIBERATEDLY NOT KNOWING?
It sounded like gibberish to Vimes, so he ignored it. Some of the aches It sounded like gibberish to Vimes, so he ignored it. Some of the aches
had gone, although his head still hammered. There was an empty feeling, had gone, although his head still hammered. There was an empty feeling
everywhere. He just wanted to sleep. everywhere. He just wanted to sleep.
[Thud!, by Terry Pratchett] [Thud!, by Terry Pratchett]
%e passage %e passage
# pp. 225-226
%passage 3
And I'm going home, Vimes repeated to himself. Everyone wants something
from Vimes, even though I'm not the sharpest knife in the drawer. Hell,
I'm probably a spoon. Well I'm going to be Vimes, and Vimes reads
/Where's My Cow?/ to Young Sam at six o'clock. With the noises done right.
[Thud!, by Terry Pratchett]
%e passage
# pp. 261-262
%passage 4
Fred Colon peered through the bars. He was, on the whole, a pretty good
jailer; he always had a pot of tea on the go, he was, as a general rule,
amiably disposed to most people, he was too slow to be easily fooled, and
he kept the cell keys in a box in the bottom drawer of his desk, a long
way out of reach of any stick, hand, dog, cunningly thrown belt, or
trained Klatchian monkey spider.(1)
(1) Making Fred Colon possibly unique in the annals of jail history.
[Thud!, by Terry Pratchett]
%e passage
# p. 287 (American spelling of 'theater' is accurate [Harper Torch edition])
%passage 5
Brushing aside cobwebs with one hand and holding up a lantern with the
other, Sybil led the way past boxes of MEN'S BOOTS, VARIOUS; RISIBLE
PUPPETS, STRING & GLOVE; MODEL THEATER AND SCENERY. Maybe that was the
reason for their wealth: they bought things that were built to last, and
now they seldom had to buy anything at all. Except food, of course, and
even then Vimes would not have been surprised to see boxes labeled APPLE
CORES, VARIOUS, or LEFTOVERS, NEED EATING UP.(1)
(1) That was a phrase of Sybil's that got to him. She'd announce at lunch,
"we must have the pork tonight, it needs eating up." Vimes never had an
actual problem with this, because he'd been raised to eat what was put in
front of him, and do it quickly, too, before someone else snatched it away.
He was just puzzled at the suggestion that he was there to do the food a
favor.
[Thud!, by Terry Pratchett]
%e passage
# pp. 296-297
%passage 6
"Tell me Drumknott, are you a betting man at all?"
"I have been know to have the occasional 'little flutter,' sir."
"Given, then, a contest between an invisible and very powerful quasidemonic
/thing/ of pure vengence on the one hand, and the commander on the other,
where would you wager, say... one dollar?"
"I wouldn't, sir. That looks like one that would go to the judges."
"Yes," said Vetinari, staring thoughtfully at the closed door. "Yes,
/indeed/."
[Thud!, by Terry Pratchett]
%e passage
# p. 351 ('teeth-aching' probably ought to have been 'teeth-achingly')
%passage 7
Vimes reached up and took a mug of water from Angua. It was teeth-aching
cold and the best drink he'd ever tasted. And his mind worked fast, flying
in emergency supplies of common sense, as human minds do, to construct a
huge anchor in sanity and prove that what happened hadn't really happened
and, if it had happened, hadn't happened very much.
It was all mystic, that's what it was. Oh, it /might/ all be true, but how
could you ever tell? You had to stick to the things you can see. And you
had to keep reminding yourself of that, too.
Yeah, that was it. What had really happened, eh? A few signs? Well,
anything can look like you want it to, if you're worried and confused
enough, yes? A sheep can look like a cow, right? Ha!
[Thud!, by Terry Pratchett]
%e passage
%e title %e title
# #
# #
# #
%title Wintersmith (2) %title Wintersmith (16)
# p. 82 (HarperTeen edition--presumably HarperTempest suffered a name change)
%passage 1 %passage 1
That's Third Thoughts for you. That's Third Thoughts for you. When a huge rock is going to land on your
When a huge rock is going to land on your head, head, they're the thoughts that think: Is that an igneous rock, such as
they're the thoughts that think: granite, or is it sandstone?
Is that an igneous rock, such as granite, or is it sandstone?
[Wintersmith, by Terry Pratchett] [Wintersmith, by Terry Pratchett]
%e passage %e passage
p. 113
%passage 2 %passage 2
They say that there can never be two snowflakes that are exactly alike, but They say that there can never be two snowflakes that are exactly alike, but
has anyone checked lately? has anyone checked lately?
[Wintersmith, by Terry Pratchett] [Wintersmith, by Terry Pratchett]
%e passage %e passage
# pp. 32-33
%passage 3
All witches are a bit odd. Tiffany had got used to odd, so that odd seemed
quite normal. There was Miss Level, for example, who had two bodies,
although one of them was imaginery. Mistress Pullunder, who bred pedigreed
earthworms and gave them all names... well, she was hardly odd at all, just
a bit peculiar, and anyway earthworms were quite interesting in a basically
uninterestng kind of way. And there had been Old Mother Dismass, who
suffered from bouts of temporal confusion, which can be quite strange when
it happens to a witch; her mouth never moved in time with her words, and
sometimes her footsteps came down the stairs ten minutes before she did.
But when it came to odd, Miss Treason didn't just take the cake, but a
packet of biscuits too, with sprinkles on the top, and also a candle.
[Wintersmith, by Terry Pratchett]
%e passage
# p. 34 ('villages': plural is accurate; 'clonk-clank' is rendered bold)
%passage 4
Then there was her clock. It was heavy and made of rusty iron by someone
who was more blacksmith than watchmaker, which was why it went
*clonk-clank* instead of /tick-tock/. She wore it on her belt and could
tell the time by feeling the stubby little hands.
There was a story in the villages that the clock was Miss Treason's heart,
which she'd used ever since her first heart died. But there were lots of
stories about Miss Treason.
[Wintersmith, by Terry Pratchett]
%e passage
# p. 40 (Boffo)
%passage 5
First Sight and Second Thoughts, that's what a witch had to rely on: First
Sight to see what's really there, and Second Thoughts to watch the First
Thoughts to check that they were thinking right. Then there were the
Third Thoughts, which Tiffany had never heard discussed and therefore kept
quiet about; they were odd, seemed to think for themselves, and didn't
turn up very often. And they were telling her that there was more to Miss
Treason than met the eye.
[Wintersmith, by Terry Pratchett]
%e passage
# p. 53-54 (in Carpe Jugulum, most of the lore [for humans] about how to kill
# vampires had been written by long-lived/long-not-defunct vampires
# [meaning that it was deliberately full of inaccuracies...])
%passage 6
It was in fact Miss Tick who had written /Witch Hunting for Dumb People/,
and she made sure that copies of it found their way into those areas where
people still believed that witches should be burned or drowned.
Since the only witch ever likely to pass through these days was Miss Tick
herself, it meant that if things did go wrong, she'd get a good night's
sleep and a decent meal before being thrown into the water. The water was
no problem at all for Miss Tick, who had been to the Quirm College for
Young Ladies, where you had to have an icy dip every morning to build Moral
Fiber. And a No. 1 Bosun's knot was very easy to undo with your teeth,
even underwater.
[Wintersmith, by Terry Pratchett]
%e passage
# p. 55-56
%passage 7
Working quickly, she emptied her pockets and started a shamble.
Shambles worked. That was about all you could say about them for certain.
You made them out of some string and a couple of sticks and anything you
had in your pocket at the time. They were a witch's equivalent of those
knives with fifteen blades and three screwdrivers and a tiny magnifying
glass and a thing for extracting earwax from chickens.
You couldn't even say precisely what they did, although Miss Tick thought
that they were a way of finding out what things the hidden bits of your
own mind already knew. You had to make a shamble from scratch every time,
and only from things in your pockets. There was no harm in having
interesting things in your pockets, though, just in case.
[Wintersmith, by Terry Pratchett]
%e passage
# p. 69
%passage 8
A witch didn't do things because they seemed like a good idea at the time!
That was practically cackling! You had to deal every day with people who
were foolish and lazy and untruthful and downright unpleasant, and you
could certainly end up thinking that the world would be considerably
improved if you gave them a slap. But you didn't because, as Miss Tick
had once explained: a) it would make the world a better place for only a
very short period of time; b) it would then make the world a slightly
worse place; and c) you're not supposed to be as stupid as they are.
[Wintersmith, by Terry Pratchett]
%e passage
# p. 106 (Rob Anybody is married to their kelda, ruler of the clan;
# passage continues with three or so pages about Explaining
# [focusing on the reactions of the recipient of the explanation:
# Pursin' o' the Lips; Foldin' o' the Arms; Tappin' o' the Feets;
# and also the reactions of the listening Feegles as they hear
# about them] but would end up on the long side if included here)
%passage 9
"Aye, but the boy willna be interested in marryin'," said Slightly Mad
Angus.
"He might be one day," said Billy Bigchin, who'd made a hobby of watching
humans. "Most bigjob men get married."
"They do?" said a Feegle in astonishment.
"Oh, aye."
"They want tae get married?"
"A lot o' them do, aye," said Billy.
"So there's nae more drinkin', and stealin', and fightin'?"
"Hey, ah'm still allowed some drinkin' and stealin' and fightin'!" said
Rob Anybody.
"Aye, Rob, but we canna help noticin' ye also have tae do the Explainin',
too." said Daft Wullie.
There was a general nodding from the crowd. To Feegles, Explaining was a
dark art. It was just so /hard/.
[Wintersmith, by Terry Pratchett]
%e passage
# p. 126-127 (passage starts mid-paragraph;
# witches know in advance when they're going to die)
%passage 10
"[...] We shall hold the funeral tomorrow afternoon."
"Sorry? You mean /before/ you die?" said Tiffany.
"Why, of course! I don't see why I shouldn't have some fun!"
"Good thinkin'!" said Rob Anybody. "That's the kind o' sensible detail
people usually fails tae consider."
"We call it a going-away party," said Miss Treason. "Just for witches, of
course. Other people tend to get a bit nervous--I can't think why. And
on the bright side, we've got that splendid ham that Mr. Armbinder gave us
last week for settling the ownership of the chestnut tree, and I'd love to
try it."
[Wintersmith, by Terry Pratchett]
%e passage
# p. 129
%passage 11
Some people think that "coven" is a word for a group of witches, and it's
true that's what the dictionary says. But the real word for a group of
witches is an "argument."
[Wintersmith, by Terry Pratchett]
%e passage
# p. 174-175 (passage starts mid-paragraph; last paragraph continues, but
# changes topic so abruptly Tiffany gasps; 'rumbustious' is accurate)
%passage 12
"[...] And now I shall tell you something vitally important. It is the
secret of my long life."
Ah, thought Tiffany, and she leaned forward.
"The important thing," said Miss Treason, "is to stay the passage of the
wind. You should avoid rumbustious fruits and vegetables. Beans are the
worst, take it from me."
"I don't think I understand--" Tiffany began.
"Try not to fart, in a nutshell."
"In a nutshell, I imagine it would be pretty unpleasant!" said Tiffany
nervously. She couldn't believe she was being told this.
"This is no joking matter," said Miss Treason. "The human body has only
so much air in it. You have to make it last. One plate of beans can take
a year off your life. I have avoided rumbustiousness all my days. I am
an old person and that means what I say is wisdom!" She gave the
bewildered Tiffany a stern look. "Do you understand, child?"
Tiffany's mind raced. Everything is a test! "No," she said. "I'm not a
child and that's nonsense, not wisdom!"
The stern look cracked into a smile. "Yes," said Miss Treason. "Total
gibberish. But you've got to admit it's a corker, all the same, right?
You definitely believed it, just for a moment? The villagers did last
year. You should have seen the way they walked about for a few weeks!
The strained looks on their faces quite cheered me up! [...]"
[Wintersmith, by Terry Pratchett]
%e passage
# p. 185 (Miss Treason tells people she's 113, but she's actually /only/ 111)
%passage 13
MISS EUMENIDES TREASON, AGED ONE HUNDRED AND ELEVEN?
Tiffany heard the voice inside her head. It didn't seem to have come
through her ears. And she'd heard it before, making her quite unusual.
Most people hear the voice of Death only once.
[Wintersmith, by Terry Pratchett]
%e passage
# p. 229
%passage 14
Tiffany had looked up "strumpet" in the Unexpurgated Dictionary, and found
it meant "a woman who is no better than she should be" and "a lady of easy
virtue." This, she decided after some working out, meant that Mrs. Gytha
Ogg, known as Nanny, was a very respectable person. She found virtue easy,
for one thing. And if she was no better than she should be, she was just
as good as she ought to be.
[Wintersmith, by Terry Pratchett]
%e passage
# p. 360-361 ('wurds' is accurate)
%passage 15
"An heroic effect, Mr. Anybody," said Granny. "The first thing a hero must
conquer is his fear, and when it comes to fightin', the Nac Mac Feegle
don't know the meanin' of the word."
"Aye, true enough," Rob grunted. "We dinna ken the meanin' o' thousands
o' wurds!"
[Wintersmith, by Terry Pratchett]
%e passage
# p. 398-399 ("Chumsfanleigh" is pronounced "Chuffley")
%passage 16
At the back of the Feegles' chalk pit, more chalk had been carved out of
the wall to make a tunnel about five feet high and perhaps as long.
In front of it stood Roland de Chumsfanleigh (it wasn't his fault). His
ancestors had been knights, and they had come to own the Chalk by killing
the kings who thought they did. Swords, that's what it had all been about.
Swords and cutting off heads. That was how you got land in the old days,
and then the rules were changed so that you didn't need a sword to own
land anymore, you just needed the right piece of paper. But his ancestors
had still hung on to their swords, just in case people thought that the
whole thing with the bits of paper had been unfair, it being a fact that
you can't please everybody.
He'd always wanted to be good with a sword, and it had come as a shock to
find that they were so /heavy/. He was great at air sword. In front of a
mirror he could fence against his reflection and win nearly all the time.
Real swords didn't allow that. You tried to swing them and they ended up
swinging you. He'd realized that maybe he was more cut out for bits of
paper. Besides, he needed glasses, which could be a bit tricky under a
helmet, especially if someone was hitting /you/ with a sword.
[Wintersmith, by Terry Pratchett]
%e passage
%e title %e title
# #
# #
@@ -4046,7 +4538,7 @@ Making Money, by Terry Pratchett
'I don't know, thur. I didn't athk.' 'I don't know, thur. I didn't athk.'
[Making Money, by Terry Pratchett] [Making Money, by Terry Pratchett]
%e pasasge %e passage
%passage 2 %passage 2
The Watch armour fitted like a glove. He'd have preferred it to fit like a The Watch armour fitted like a glove. He'd have preferred it to fit like a
helmet and breastplate. It was common knowledge that the Watch's approach helmet and breastplate. It was common knowledge that the Watch's approach
@@ -4255,7 +4747,7 @@ IF YOU ASK ME, said Death, NOBODY COULD DO ANY BETTER THAN THAT. . .
# Used for interaction with Death. # Used for interaction with Death.
# #
%section Death %section Death
%title Death Quotes (8) %title Death Quotes (10)
%passage 1 %passage 1
WHERE THE FIRST PRIMAL CELL WAS, THERE WAS I ALSO. WHERE MAN IS, THERE AM I. WHEN THE LAST LIFE CRAWLS UNDER FREEZING STARS, THERE WILL I BE. WHERE THE FIRST PRIMAL CELL WAS, THERE WAS I ALSO. WHERE MAN IS, THERE AM I. WHEN THE LAST LIFE CRAWLS UNDER FREEZING STARS, THERE WILL I BE.
%e passage %e passage
@@ -4288,5 +4780,12 @@ THERE IS A LITTLE CONFUSION AT FIRST. IT IS ONLY TO BE EXPECTED.
# time and space) # time and space)
%passage 8 %passage 8
THERE IS ALWAYS TIME FOR ANOTHER LAST MINUTE. THERE IS ALWAYS TIME FOR ANOTHER LAST MINUTE.
# Wintersmith, p. 187 (HarperTeen edition; dying Miss Treason takes a ham
# [too silly?] sandwich with her to the grave, and it accompanies
# her to the afterlife, but its condiments don't)
%passage 9
MUSTARD IS ALWAYS TRICKY.
%passage 10
PICKLES OF ALL SORTS DON'T SEEM TO MAKE IT. I'M SORRY.
%e title %e title
%e section %e section
+1162 -832
View File
File diff suppressed because it is too large Load Diff
+70 -52
View File
@@ -1,9 +1,8 @@
/* NetHack 3.6 config.h $NHDT-Date: 1433279371 2015/06/02 21:09:31 $ $NHDT-Branch: status_hilite $:$NHDT-Revision: 1.89 $ */ /* NetHack 3.6 config.h $NHDT-Date: 1447728911 2015/11/17 02:55:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.91 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
#ifndef CONFIG_H /* make sure the compiler does not see the typedefs twice \ #ifndef CONFIG_H /* make sure the compiler does not see the typedefs twice */
*/
#define CONFIG_H #define CONFIG_H
/* /*
@@ -137,39 +136,55 @@
/* /*
* Section 2: Some global parameters and filenames. * Section 2: Some global parameters and filenames.
* Commenting out WIZARD, LOGFILE, NEWS or PANICLOG removes that
* feature from the game; otherwise set the appropriate wizard
* name. LOGFILE, NEWS and PANICLOG refer to files in the
* playground.
* *
* LOGFILE, XLOGFILE, NEWS and PANICLOG refer to files in
* the playground directory. Commenting out LOGFILE, XLOGFILE,
* NEWS or PANICLOG removes that feature from the game.
*
* Building with debugging features enabled is now unconditional;
* the old WIZARD setting for that has been eliminated.
* If SYSCF is enabled, WIZARD_NAME will be overridden at
* runtime by the SYSCF WIZARDS value.
*
* SYSCF: (not supported by all ports)
* If SYSCF is defined, the following configuration info is * If SYSCF is defined, the following configuration info is
* available in a global config space, with the compiled-in * available in a global config space, with the compiled-in
* entries as defaults: * entries as defaults:
* WIZARDS (a value of * allows anyone to be wizard) * WIZARDS (a space-separated list of usernames of users who
* (this does NOT default to compiled-in value) * can run the game in debug mode, aka wizard mode;
* MAXPLAYERS (see MAX_NR_OF_PLAYERS above and nethack.sh) * a value of * allows anyone to debug;
* SUPPORT (how to get local support)(no default) * this does NOT default to compiled-in value)
* RECOVER (how to recover a game at your site)(no * EXPLORERS (who can use explore mode, aka discover mode)
*default) * SHELLERS (who can use ! to execute a shell subprocess)
* SHELLERS (who can use !, syntax as WIZARDS) * MAXPLAYERS (see MAX_NR_OF_PLAYERS below and nethack.sh)
* for the record file (see topten.c): * SUPPORT (how to get local support) [no default]
* RECOVER (how to recover a game at your site) [no default]
* For the record file (see topten.c):
* PERSMAX (max entries for one person) * PERSMAX (max entries for one person)
* ENTRYMAX (max entries in the record file) * ENTRYMAX (max entries in the record file)
* POINTSMIN (min points to get an entry) * POINTSMIN (min points to get an entry)
* PERS_IS_UID (0 or 1 - person is name or (numeric) userid) * PERS_IS_UID (0 or 1 - person is name or (numeric) userid)
* SEDUCE (0 or 1 - runtime disable/enable SEDUCE * Can force incubi/succubi behavior to be toned down to nymph-like:
*option) * SEDUCE (0 or 1 - runtime disable/enable SEDUCE option)
*
* The following options select how the config space is stored:
* SYSCF_FILE in the named file
*
* The following options pertain to crash reporting: * The following options pertain to crash reporting:
* GREPPATH (the path to the system grep(1) utility) * GREPPATH (the path to the system grep(1) utility)
* GDBPATH (the path to the system gdb(1) program) * GDBPATH (the path to the system gdb(1) program)
* Regular nethack options can also be specified in order to
* provide system-wide default values local to your system:
* OPTIONS (same as in users' .nethackrc or defaults.nh)
*
* In the future there may be other ways to supply SYSCF
* information (Windows registry, Apple resource forks, etc)
* but at present the only supported method is via a text file.
* If the program is built with SYSCF enabled, the file *must*
* exist and be readable, otherwise the game will complain and
* refuse to start.
* SYSCF_FILE: file containing the SYSCF options shown above;
* default is 'sysconf' in nethack's playground.
*/ */
#ifndef WIZARD_NAME /* allow for compile-time or Makefile changes */ #ifndef WIZARD_NAME /* allow for compile-time or Makefile changes */
#define WIZARD_NAME "wizard" #define WIZARD_NAME "wizard" /* value is ignored if SYSCF is enabled */
#endif #endif
#ifndef SYSCF #ifndef SYSCF
@@ -184,11 +199,20 @@
#define GREPPATH "/bin/grep" #define GREPPATH "/bin/grep"
#endif #endif
/* note: "larger" is in comparison with 'record', the high-scores file
(whose name can be overridden via #define in global.h if desired) */
#define LOGFILE "logfile" /* larger file for debugging purposes */ #define LOGFILE "logfile" /* larger file for debugging purposes */
#define XLOGFILE "xlogfile" /* even larger logfile */ #define XLOGFILE "xlogfile" /* even larger logfile */
#define NEWS "news" /* the file containing the latest hack news */ #define NEWS "news" /* the file containing the latest hack news */
#define PANICLOG "paniclog" /* log of panic and impossible events */ #define PANICLOG "paniclog" /* log of panic and impossible events */
/*
* PERSMAX, POINTSMIN, ENTRYMAX, PERS_IS_UID:
* These control the contents of 'record', the high-scores file.
* They used to be located in topten.c rather than config.h, and
* their values can be overridden at runtime (to increase ENTRYMAX, the
* maximum number of scores to keep, for example) if SYSCF is enabled.
*/
#ifndef PERSMAX #ifndef PERSMAX
#define PERSMAX 3 /* entries per name/uid per char. allowed */ #define PERSMAX 3 /* entries per name/uid per char. allowed */
#endif #endif
@@ -313,8 +337,8 @@
*/ */
#endif /* CHDIR */ #endif /* CHDIR */
/* If GENERIC_USERNAMES is defined, and the user name is found /* If GENERIC_USERNAMES is defined, and the player's username is found
* in that list, prompt for username instead. * in the list, prompt for character name instead of using username.
* A public server should probably disable this. */ * A public server should probably disable this. */
#define GENERIC_USERNAMES "play player game games nethack nethacker" #define GENERIC_USERNAMES "play player game games nethack nethacker"
@@ -341,12 +365,10 @@
#include "tradstdc.h" #include "tradstdc.h"
/* /*
* type schar: small signed integers (8 bits suffice) (eg. TOS) * type schar:
* * small signed integers (8 bits suffice) (eg. TOS)
* typedef char schar; * typedef char schar;
*
* will do when you have signed characters; otherwise use * will do when you have signed characters; otherwise use
*
* typedef short int schar; * typedef short int schar;
*/ */
#ifdef AZTEC #ifdef AZTEC
@@ -356,13 +378,10 @@ typedef signed char schar;
#endif #endif
/* /*
* type uchar: small unsigned integers (8 bits suffice - but 7 bits do not) * type uchar:
* * small unsigned integers (8 bits suffice - but 7 bits do not)
* typedef unsigned char uchar; * typedef unsigned char uchar;
* * will be satisfactory if you have an "unsigned char" type; otherwise use
* will be satisfactory if you have an "unsigned char" type;
* otherwise use
*
* typedef unsigned short int uchar; * typedef unsigned short int uchar;
*/ */
#ifndef _AIX32 /* identical typedef in system file causes trouble */ #ifndef _AIX32 /* identical typedef in system file causes trouble */
@@ -400,19 +419,6 @@ typedef unsigned char uchar;
#endif #endif
#endif #endif
/*
* Section 4: THE FUN STUFF!!!
*
* Conditional compilation of special options are controlled here.
* If you define the following flags, you will add not only to the
* complexity of the game but also to the size of the load module.
*/
/* display features */
/* dungeon features */
/* dungeon levels */
/* monsters & objects */
/* I/O */
#if !defined(MAC) #if !defined(MAC)
#if !defined(NOCLIPPING) #if !defined(NOCLIPPING)
#define CLIPPING /* allow smaller screens -- ERS */ #define CLIPPING /* allow smaller screens -- ERS */
@@ -421,21 +427,33 @@ typedef unsigned char uchar;
#define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ #define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */
/* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson@ucivax) */
/* /*
* Section 5: EXPERIMENTAL STUFF * Section 4: EXPERIMENTAL STUFF
* *
* Conditional compilation of new or experimental options are controlled here. * Conditional compilation of new or experimental options are controlled here.
* Enable any of these at your own risk -- there are almost certainly * Enable any of these at your own risk -- there are almost certainly
* bugs left here. * bugs left here.
*/ */
/* #define STATUS_VIA_WINDOWPORT */ /* re-work of the status line updating process */ /* #define STATUS_VIA_WINDOWPORT */ /* re-work of the status line
updating process */
/* #define STATUS_HILITES */ /* support hilites of status fields */ /* #define STATUS_HILITES */ /* support hilites of status fields */
/* #define WINCHAIN */ /* stacked window systems */ /* #define WINCHAIN */ /* stacked window systems */
/* End of Section 5 */ /* #define DEBUG_MIGRATING_MONS */ /* add a wizard-mode command to help debug
migrating monsters */
/* SCORE_ON_BOTL is neither experimental nor inadequately tested,
but doesn't seem to fit in any other section... */
/* #define SCORE_ON_BOTL */ /* enable the 'showscore' option to
show estimated score on status line */
/* FREE_ALL_MEMORY is neither experimental nor inadequately tested,
but it isn't necessary for successful operation of the program */
#define FREE_ALL_MEMORY /* free all memory at exit */
/* End of Section 4 */
#include "global.h" /* Define everything else according to choices above */ #include "global.h" /* Define everything else according to choices above */
+8 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 context.h $NHDT-Date: 1445215010 2015/10/19 00:36:50 $ $NHDT-Branch: master $:$NHDT-Revision: 1.27 $ */ /* NetHack 3.6 context.h $NHDT-Date: 1447653421 2015/11/16 05:57:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.28 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -90,6 +90,12 @@ struct tribute_info {
/* 30 free bits */ /* 30 free bits */
}; };
struct novel_tracking { /* for choosing random passage when reading novel */
unsigned id; /* novel oid from previous passage selection */
int count; /* number of passage indices available in pasg[] */
xchar pasg[30]; /* pasg[0..count] are passage indices */
};
struct context_info { struct context_info {
unsigned ident; /* social security number for each monster */ unsigned ident; /* social security number for each monster */
unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */ unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */
@@ -124,6 +130,7 @@ struct context_info {
struct polearm_info polearm; struct polearm_info polearm;
struct obj_split objsplit; /* track most recently split object stack */ struct obj_split objsplit; /* track most recently split object stack */
struct tribute_info tribute; struct tribute_info tribute;
struct novel_tracking novel;
}; };
extern NEARDATA struct context_info context; extern NEARDATA struct context_info context;
+27 -26
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 display.h $NHDT-Date: 1432512777 2015/05/25 00:12:57 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */ /* NetHack 3.6 display.h $NHDT-Date: 1447729027 2015/11/17 02:57:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.26 $ */
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */ /* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
/* and Dave Cohrs, 1990. */ /* and Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -29,11 +29,13 @@
*/ */
#define tp_sensemon(mon) \ #define tp_sensemon(mon) \
(/* The hero can always sense a monster IF: */ \ (/* The hero can always sense a monster IF: */ \
(!mindless(mon->data)) && /* 1. the monster has a brain to sense AND */ \ /* 1. the monster has a brain to sense */ \
((Blind && Blind_telepat) \ (!mindless(mon->data)) \
|| /* 2a. hero is blind and telepathic OR */ /* 2b. hero is using a \ /* AND 2a. hero is blind and telepathic */ \
telepathy inducing */ /* object and in range */ \ && ((Blind && Blind_telepat) \
(Unblind_telepat \ /* OR 2b. hero is using a telepathy inducing */ \
/* object and in range */ \
|| (Unblind_telepat \
&& (distu(mon->mx, mon->my) <= (BOLT_LIM * BOLT_LIM))))) && (distu(mon->mx, mon->my) <= (BOLT_LIM * BOLT_LIM)))))
#define sensemon(mon) \ #define sensemon(mon) \
@@ -57,11 +59,10 @@
* Infravision is not taken into account. * Infravision is not taken into account.
*/ */
#define mon_visible(mon) \ #define mon_visible(mon) \
(/* The hero can see the monster */ /* IF the monster */ \ (/* The hero can see the monster IF the monster */ \
(!mon->minvis || See_invisible) && /* 1. is not invisible AND */ \ (!mon->minvis || See_invisible) /* 1. is not invisible */ \
(!mon->mundetected) && /* 2. not an undetected hider */ \ && !mon->mundetected /* AND 2. not an undetected hider */ \
(!(mon->mburied || u.uburied)) /* 3. neither you or it is buried */ \ && !(mon->mburied || u.uburied)) /* AND 3. neither you nor it is buried */
)
/* /*
* see_with_infrared() * see_with_infrared()
@@ -72,7 +73,7 @@
* canseemon() or canspotmon() which already check that. * canseemon() or canspotmon() which already check that.
*/ */
#define see_with_infrared(mon) \ #define see_with_infrared(mon) \
(!Blind && Infravision && infravisible(mon->data) \ (!Blind && Infravision && mon && infravisible(mon->data) \
&& couldsee(mon->mx, mon->my)) && couldsee(mon->mx, mon->my))
/* /*
@@ -179,8 +180,7 @@
#define DISP_BEAM (-1) /* Keep all glyphs showing & clean up at end. */ #define DISP_BEAM (-1) /* Keep all glyphs showing & clean up at end. */
#define DISP_ALL (-2) /* Like beam, but still displayed if not visible. */ #define DISP_ALL (-2) /* Like beam, but still displayed if not visible. */
#define DISP_FLASH (-3) /* Clean up each glyph before displaying new one. */ #define DISP_FLASH (-3) /* Clean up each glyph before displaying new one. */
#define DISP_ALWAYS (-4) /* Like flash, but still displayed if not visible. \ #define DISP_ALWAYS (-4) /* Like flash, but still displayed if not visible. */
*/
#define DISP_CHANGE (-5) /* Change glyph. */ #define DISP_CHANGE (-5) /* Change glyph. */
#define DISP_END (-6) /* Clean up. */ #define DISP_END (-6) /* Clean up. */
#define DISP_FREEMEM (-7) /* Free all memory during exit only. */ #define DISP_FREEMEM (-7) /* Free all memory during exit only. */
@@ -200,15 +200,14 @@
#define display_self() \ #define display_self() \
show_glyph(u.ux, u.uy, \ show_glyph(u.ux, u.uy, \
maybe_display_usteed( \ maybe_display_usteed((youmonst.m_ap_type == M_AP_NOTHING) \
youmonst.m_ap_type == M_AP_NOTHING \
? hero_glyph \ ? hero_glyph \
: youmonst.m_ap_type == M_AP_FURNITURE \ : (youmonst.m_ap_type == M_AP_FURNITURE) \
? cmap_to_glyph(youmonst.mappearance) \ ? cmap_to_glyph(youmonst.mappearance) \
: youmonst.m_ap_type == M_AP_OBJECT \ : (youmonst.m_ap_type == M_AP_OBJECT) \
? objnum_to_glyph(youmonst.mappearance) \ ? objnum_to_glyph(youmonst.mappearance) \
: /* else M_AP_MONSTER */ \ /* else M_AP_MONSTER */ \
monnum_to_glyph(youmonst.mappearance))) : monnum_to_glyph(youmonst.mappearance)))
/* /*
* A glyph is an abstraction that represents a _unique_ monster, object, * A glyph is an abstraction that represents a _unique_ monster, object,
@@ -276,7 +275,6 @@
#define MAX_GLYPH (NUMMONS + GLYPH_STATUE_OFF) #define MAX_GLYPH (NUMMONS + GLYPH_STATUE_OFF)
#define NO_GLYPH MAX_GLYPH #define NO_GLYPH MAX_GLYPH
#define GLYPH_INVISIBLE GLYPH_INVIS_OFF #define GLYPH_INVISIBLE GLYPH_INVIS_OFF
#define warning_to_glyph(mwarnlev) ((mwarnlev) + GLYPH_WARNING_OFF) #define warning_to_glyph(mwarnlev) ((mwarnlev) + GLYPH_WARNING_OFF)
@@ -297,15 +295,16 @@
: otg_temp + GLYPH_OBJ_OFF) : otg_temp + GLYPH_OBJ_OFF)
#define obj_to_glyph(obj) \ #define obj_to_glyph(obj) \
((obj)->otyp == STATUE \ (((obj)->otyp == STATUE) \
? statue_to_glyph(obj) \ ? statue_to_glyph(obj) \
: Hallucination ? random_obj_to_glyph() \ : Hallucination \
: (obj)->otyp == CORPSE \ ? random_obj_to_glyph() \
: ((obj)->otyp == CORPSE) \
? (int) (obj)->corpsenm + GLYPH_BODY_OFF \ ? (int) (obj)->corpsenm + GLYPH_BODY_OFF \
: (int) (obj)->otyp + GLYPH_OBJ_OFF) : (int) (obj)->otyp + GLYPH_OBJ_OFF)
/* MRKR: Statues now have glyphs corresponding to the monster they */ /* MRKR: Statues now have glyphs corresponding to the monster they */
/* brepresent and look like monsters when you are hallucinating. */ /* represent and look like monsters when you are hallucinating. */
#define statue_to_glyph(obj) \ #define statue_to_glyph(obj) \
(Hallucination ? random_monster() + GLYPH_MON_OFF \ (Hallucination ? random_monster() + GLYPH_MON_OFF \
@@ -360,7 +359,9 @@
? ((glyph) - GLYPH_STATUE_OFF) \ ? ((glyph) - GLYPH_STATUE_OFF) \
: NO_GLYPH) : NO_GLYPH)
#define glyph_to_obj(glyph) \ #define glyph_to_obj(glyph) \
(glyph_is_body(glyph) ? CORPSE : glyph_is_statue(glyph) \ (glyph_is_body(glyph) \
? CORPSE \
: glyph_is_statue(glyph) \
? STATUE \ ? STATUE \
: glyph_is_normal_object(glyph) \ : glyph_is_normal_object(glyph) \
? ((glyph) - GLYPH_OBJ_OFF) \ ? ((glyph) - GLYPH_OBJ_OFF) \
+11 -18
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 dungeon.h $NHDT-Date: 1436065581 2015/07/05 03:06:21 $ $NHDT-Branch: master $:$NHDT-Revision: 1.21 $ */ /* NetHack 3.6 dungeon.h $NHDT-Date: 1447755969 2015/11/17 10:26:09 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -79,12 +79,10 @@ typedef struct branch {
/* branch types */ /* branch types */
#define BR_STAIR 0 /* "Regular" connection, 2 staircases. */ #define BR_STAIR 0 /* "Regular" connection, 2 staircases. */
#define BR_NO_END1 1 /* "Regular" connection. However, no stair from */ #define BR_NO_END1 1 /* "Regular" connection. However, no stair from
/* end1 to end2. There is a stair from end2 */ end1 to end2. There is a stair from end2 to end1. */
/* to end1. */ #define BR_NO_END2 2 /* "Regular" connection. However, no stair from
#define BR_NO_END2 2 /* "Regular" connection. However, no stair from */ end2 to end1. There is a stair from end1 to end2. */
/* end2 to end1. There is a stair from end1 */
/* to end2. */
#define BR_PORTAL 3 /* Connection by magic portals (traps) */ #define BR_PORTAL 3 /* Connection by magic portals (traps) */
/* A particular dungeon contains num_dunlevs d_levels with dlevel 1.. /* A particular dungeon contains num_dunlevs d_levels with dlevel 1..
@@ -153,11 +151,9 @@ struct linfo {
#define VISITED 0x01 /* hero has visited this level */ #define VISITED 0x01 /* hero has visited this level */
#define FORGOTTEN 0x02 /* hero will forget this level when reached */ #define FORGOTTEN 0x02 /* hero will forget this level when reached */
#define LFILE_EXISTS 0x04 /* a level file exists for this level */ #define LFILE_EXISTS 0x04 /* a level file exists for this level */
/* /* Note: VISITED and LFILE_EXISTS are currently almost always
* Note: VISITED and LFILE_EXISTS are currently almost always set at the * set at the same time. However they _mean_ different things.
* same time. However they _mean_ different things.
*/ */
#ifdef MFLOPPY #ifdef MFLOPPY
#define FROMPERM 1 /* for ramdisk use */ #define FROMPERM 1 /* for ramdisk use */
#define TOPERM 2 /* for ramdisk use */ #define TOPERM 2 /* for ramdisk use */
@@ -171,18 +167,15 @@ struct linfo {
/* types and structures for dungeon map recording /* types and structures for dungeon map recording
* *
* It is designed to eliminate the need for an external notes file for some of * It is designed to eliminate the need for an external notes file for some
* the more mundane dungeon elements. "Where was the last altar I passed?" * mundane dungeon elements. "Where was the last altar I passed?" etc...
* etc...
* Presumably the character can remember this sort of thing even if, months * Presumably the character can remember this sort of thing even if, months
* later in real time picking up an old save game, I can't. * later in real time picking up an old save game, I can't.
* *
* To be consistent, one can assume that this map is in the player's mind and * To be consistent, one can assume that this map is in the player's mind and
* has no physical correspondence (eliminating illiteracy/blind/hands/hands * has no physical correspondence (eliminating illiteracy/blind/hands/hands
* free * free concerns). Therefore, this map is not exhaustive nor detailed ("some
* concerns.) Therefore, this map is not exhaustive nor detailed ("some * fountains"). This makes it also subject to player conditions (amnesia).
* fountains").
* This makes it also subject to player conditions (amnesia).
*/ */
/* Because clearly Nethack needs more ways to specify alignment */ /* Because clearly Nethack needs more ways to specify alignment */
+7 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 extern.h $NHDT-Date: 1446516834 2015/11/03 02:13:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.513 $ */ /* NetHack 3.6 extern.h $NHDT-Date: 1447653422 2015/11/16 05:57:02 $ $NHDT-Branch: master $:$NHDT-Revision: 1.517 $ */
/* Copyright (c) Steve Creps, 1988. */ /* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -306,6 +306,7 @@ E void FDECL(map_object, (struct obj *, int));
E void FDECL(map_invisible, (XCHAR_P, XCHAR_P)); E void FDECL(map_invisible, (XCHAR_P, XCHAR_P));
E void FDECL(unmap_object, (int, int)); E void FDECL(unmap_object, (int, int));
E void FDECL(map_location, (int, int, int)); E void FDECL(map_location, (int, int, int));
E void FDECL(feel_newsym, (XCHAR_P, XCHAR_P));
E void FDECL(feel_location, (XCHAR_P, XCHAR_P)); E void FDECL(feel_location, (XCHAR_P, XCHAR_P));
E void FDECL(newsym, (int, int)); E void FDECL(newsym, (int, int));
E void FDECL(shieldeff, (XCHAR_P, XCHAR_P)); E void FDECL(shieldeff, (XCHAR_P, XCHAR_P));
@@ -765,7 +766,8 @@ E void NDECL(really_close);
#ifdef DEBUG #ifdef DEBUG
E boolean FDECL(debugcore, (const char *, BOOLEAN_P)); E boolean FDECL(debugcore, (const char *, BOOLEAN_P));
#endif #endif
E boolean FDECL(read_tribute, (const char *, const char *, int, char *, int)); E boolean FDECL(read_tribute, (const char *, const char *, int,
char *, int, unsigned));
E boolean FDECL(Death_quote, (char *, int)); E boolean FDECL(Death_quote, (char *, int));
/* ### fountain.c ### */ /* ### fountain.c ### */
@@ -1069,6 +1071,7 @@ E int FDECL(monhp_per_lvl, (struct monst *));
E void FDECL(newmonhp, (struct monst *, int)); E void FDECL(newmonhp, (struct monst *, int));
E struct mextra *NDECL(newmextra); E struct mextra *NDECL(newmextra);
E void FDECL(copy_mextra, (struct monst *, struct monst *)); E void FDECL(copy_mextra, (struct monst *, struct monst *));
E void FDECL(dealloc_mextra, (struct monst *));
E struct monst *FDECL(makemon, (struct permonst *, int, int, int)); E struct monst *FDECL(makemon, (struct permonst *, int, int, int));
E boolean FDECL(create_critters, (int, struct permonst *, BOOLEAN_P)); E boolean FDECL(create_critters, (int, struct permonst *, BOOLEAN_P));
E struct permonst *NDECL(rndmonst); E struct permonst *NDECL(rndmonst);
@@ -1202,7 +1205,7 @@ E const char *FDECL(waterbody_name, (XCHAR_P, XCHAR_P));
E struct oextra *NDECL(newoextra); E struct oextra *NDECL(newoextra);
E void FDECL(copy_oextra, (struct obj *, struct obj *)); E void FDECL(copy_oextra, (struct obj *, struct obj *));
E void FDECL(dealloc_oextra, (struct oextra *)); E void FDECL(dealloc_oextra, (struct obj *));
E void FDECL(newomonst, (struct obj *)); E void FDECL(newomonst, (struct obj *));
E void FDECL(free_omonst, (struct obj *)); E void FDECL(free_omonst, (struct obj *));
E void FDECL(newomid, (struct obj *)); E void FDECL(newomid, (struct obj *));
@@ -1637,6 +1640,7 @@ E void FDECL(set_option_mod_status, (const char *, int));
E int FDECL(add_autopickup_exception, (const char *)); E int FDECL(add_autopickup_exception, (const char *));
E void NDECL(free_autopickup_exceptions); E void NDECL(free_autopickup_exceptions);
E int FDECL(load_symset, (const char *, int)); E int FDECL(load_symset, (const char *, int));
E void NDECL(free_symsets);
E void FDECL(parsesymbols, (char *)); E void FDECL(parsesymbols, (char *));
E struct symparse *FDECL(match_sym, (char *)); E struct symparse *FDECL(match_sym, (char *));
E void NDECL(set_playmode); E void NDECL(set_playmode);
+4 -5
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 mactty.h $NHDT-Date: 1432512775 2015/05/25 00:12:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */ /* NetHack 3.6 mactty.h $NHDT-Date: 1447755970 2015/11/17 10:26:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */
/* Copyright (c) Jon W{tte 1993. */ /* Copyright (c) Jon W{tte 1993. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -72,8 +72,8 @@
#define CHAR_BLANK ((char) 32) #define CHAR_BLANK ((char) 32)
#define CHAR_DELETE ((char) 127) #define CHAR_DELETE ((char) 127)
extern char extern char game_active; /* flag to window rendering routines
game_active; /* flag to window rendering routines not to use ppat */ not to use ppat */
/* /*
* If you want some fancy operations that not a normal TTY device normally * If you want some fancy operations that not a normal TTY device normally
* supports, use EXTENDED_SUPPORT. For frames, area erases and area scrolls, * supports, use EXTENDED_SUPPORT. For frames, area erases and area scrolls,
@@ -174,8 +174,7 @@ typedef enum tty_attrib {
/* /*
* Use this macro to cast a function pointer to a tty attribute; this will * Use this macro to cast a function pointer to a tty attribute; this will
* help * help portability to systems where a function pointer doesn't fit in a long
* portability to systems where a function pointer doesn't fit in a long
*/ */
#define TA_ATTRIB_FUNC(x) ((long) (x)) #define TA_ATTRIB_FUNC(x) ((long) (x))
+3 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 macwin.h $NHDT-Date: 1432512779 2015/05/25 00:12:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ */ /* NetHack 3.6 macwin.h $NHDT-Date: 1447755970 2015/11/17 10:26:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -27,7 +27,8 @@ typedef pascal void (*UserItemProcPtr)(WindowPtr theWindow, short itemNo);
typedef UserItemProcPtr UserItemUPP; typedef UserItemProcPtr UserItemUPP;
#define NewUserItemProc(p) (UserItemUPP)(p) #define NewUserItemProc(p) (UserItemUPP)(p)
typedef pascal void (*ControlActionProcPtr)(ControlHandle theControl, short partCode); typedef pascal void (*ControlActionProcPtr)(ControlHandle theControl,
short partCode);
typedef ControlActionProcPtr ControlActionUPP; typedef ControlActionProcPtr ControlActionUPP;
#define NewControlActionProc(p) (ControlActionUPP)(p) #define NewControlActionProc(p) (ControlActionUPP)(p)
+6 -9
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 ntconf.h $NHDT-Date: 1432512777 2015/05/25 00:12:57 $ $NHDT-Branch: master $:$NHDT-Revision: 1.47 $ */ /* NetHack 3.6 ntconf.h $NHDT-Date: 1447424077 2015/11/13 14:14:37 $ $NHDT-Branch: master $:$NHDT-Revision: 1.48 $ */
/* Copyright (c) NetHack PC Development Team 1993, 1994. */ /* Copyright (c) NetHack PC Development Team 1993, 1994. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -107,11 +107,12 @@ extern void FDECL(interject, (int));
#ifdef YYPREFIX #ifdef YYPREFIX
#pragma warning(disable : 4102) /* unreferenced label */ #pragma warning(disable : 4102) /* unreferenced label */
#endif #endif
#if 0 #ifdef __cplusplus
#pragma warning(disable : 4018) /* signed/unsigned mismatch */ /* suppress a warning in cppregex.cpp */
#pragma warning(disable : 4305) /* init, conv from 'const int' to 'char' */ #pragma warning(disable : 4101) /* unreferenced local variable */
#endif
#endif #endif
#endif /* _MSC_VER */
#define RUNTIME_PORT_ID /* trigger run-time port identification for \ #define RUNTIME_PORT_ID /* trigger run-time port identification for \
* identification of exe CPU architecture \ * identification of exe CPU architecture \
@@ -187,10 +188,6 @@ extern void FDECL(interject, (int));
#define FILENAME_CMP stricmp /* case insensitive */ #define FILENAME_CMP stricmp /* case insensitive */
#endif #endif
#if 0
extern char levels[], bones[], permbones[],
#endif /* 0 */
/* this was part of the MICRO stuff in the past */ /* this was part of the MICRO stuff in the past */
extern const char *alllevels, *allbones; extern const char *alllevels, *allbones;
extern char hackdir[]; extern char hackdir[];
+5 -5
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 objclass.h $NHDT-Date: 1432512779 2015/05/25 00:12:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ */ /* NetHack 3.6 objclass.h $NHDT-Date: 1447755971 2015/11/17 10:26:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.15 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -153,14 +153,14 @@ extern NEARDATA struct objdescr obj_descr[];
#define ALLOW_COUNT (MAXOCLASSES + 1) /* Can be used in the object class */ #define ALLOW_COUNT (MAXOCLASSES + 1) /* Can be used in the object class */
#define ALL_CLASSES (MAXOCLASSES + 2) /* input to getobj(). */ #define ALL_CLASSES (MAXOCLASSES + 2) /* input to getobj(). */
#define ALLOW_NONE (MAXOCLASSES + 3) /* */ #define ALLOW_NONE (MAXOCLASSES + 3)
#define BURNING_OIL (MAXOCLASSES + 1) /* Can be used as input to explode. */ #define BURNING_OIL (MAXOCLASSES + 1) /* Can be used as input to explode. */
#define MON_EXPLODE (MAXOCLASSES + 2) /* Exploding monster (e.g. gas spore) \ #define MON_EXPLODE (MAXOCLASSES + 2) /* Exploding monster (e.g. gas spore) */
*/
#if 0 /* moved to decl.h so that makedefs.c won't see them */ #if 0 /* moved to decl.h so that makedefs.c won't see them */
extern const struct class_sym def_oc_syms[MAXOCLASSES]; /* default class symbols */ extern const struct class_sym
def_oc_syms[MAXOCLASSES]; /* default class symbols */
extern uchar oc_syms[MAXOCLASSES]; /* current class symbols */ extern uchar oc_syms[MAXOCLASSES]; /* current class symbols */
#endif #endif
+16 -10
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 patchlevel.h $NHDT-Date: 1445215015 2015/10/19 00:36:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.109 $ */ /* NetHack 3.6 patchlevel.h $NHDT-Date: 1447755971 2015/11/17 10:26:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.112 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -8,12 +8,12 @@
/* /*
* PATCHLEVEL is updated for each release. * PATCHLEVEL is updated for each release.
*/ */
#define PATCHLEVEL 1 #define PATCHLEVEL 0
/* /*
* Incrementing EDITLEVEL can be used to force invalidation of old bones * Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files. * and save files.
*/ */
#define EDITLEVEL 0 #define EDITLEVEL 2
#define COPYRIGHT_BANNER_A "NetHack, Copyright 1985-2015" #define COPYRIGHT_BANNER_A "NetHack, Copyright 1985-2015"
#define COPYRIGHT_BANNER_B \ #define COPYRIGHT_BANNER_B \
@@ -32,7 +32,7 @@
*/ */
/* #define VERSION_COMPATIBILITY 0x03050000L */ /* #define VERSION_COMPATIBILITY 0x03050000L */
/*****************************************************************************/ /****************************************************************************/
/* Version 3.6.x */ /* Version 3.6.x */
/* /*
@@ -40,7 +40,13 @@
* *
*/ */
/*****************************************************************************/ /****************************************************************************/
/* Version 3.5.x */
/* Version 3.5 was never officially released.
*/
/****************************************************************************/
/* Version 3.4.x */ /* Version 3.4.x */
/* Patch 3, December 7, 2003 /* Patch 3, December 7, 2003
@@ -109,7 +115,7 @@
/* Version 3.4 */ /* Version 3.4 */
/*****************************************************************************/ /****************************************************************************/
/* Version 3.3.x */ /* Version 3.3.x */
/* Patch 1, August 9, 2000 /* Patch 1, August 9, 2000
@@ -150,7 +156,7 @@
/* Version 3.3 */ /* Version 3.3 */
/*****************************************************************************/ /****************************************************************************/
/* Version 3.2.x */ /* Version 3.2.x */
/* Patch 3, December 10, 1999 /* Patch 3, December 10, 1999
@@ -228,7 +234,7 @@
/* Version 3.2 */ /* Version 3.2 */
/*****************************************************************************/ /****************************************************************************/
/* Version 3.1.x */ /* Version 3.1.x */
/* /*
@@ -282,7 +288,7 @@
/* Version 3.1 */ /* Version 3.1 */
/*****************************************************************************/ /****************************************************************************/
/* Version 3.0 */ /* Version 3.0 */
/* /*
@@ -405,6 +411,6 @@
/* Version 3.0 */ /* Version 3.0 */
/*****************************************************************************/ /****************************************************************************/
/*patchlevel.h*/ /*patchlevel.h*/
+3 -2
View File
@@ -1,4 +1,4 @@
// NetHack 3.6 qt_win.h $NHDT-Date: 1433806580 2015/06/08 23:36:20 $ $NHDT-Branch: master $:$NHDT-Revision: 1.16 $ // NetHack 3.6 qt_win.h $NHDT-Date: 1447755972 2015/11/17 10:26:12 $ $NHDT-Branch: master $:$NHDT-Revision: 1.17 $
// Copyright (c) Warwick Allison, 1999. // Copyright (c) Warwick Allison, 1999.
// NetHack may be freely redistributed. See license for details. // NetHack may be freely redistributed. See license for details.
// //
@@ -863,7 +863,8 @@ class NetHackQtBind : NetHackQtBindBase
static void qt_cliparound(int x, int y); static void qt_cliparound(int x, int y);
static void qt_cliparound_window(winid wid, int x, int y); static void qt_cliparound_window(winid wid, int x, int y);
static void qt_print_glyph(winid wid, XCHAR_P x, XCHAR_P y, int glyph, int bkglyph); static void qt_print_glyph(winid wid, XCHAR_P x, XCHAR_P y,
int glyph, int bkglyph);
static void qt_raw_print(const char *str); static void qt_raw_print(const char *str);
static void qt_raw_print_bold(const char *str); static void qt_raw_print_bold(const char *str);
static int qt_nhgetch(); static int qt_nhgetch();
+11 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 tradstdc.h $NHDT-Date: 1432512778 2015/05/25 00:12:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */ /* NetHack 3.6 tradstdc.h $NHDT-Date: 1447755973 2015/11/17 10:26:13 $ $NHDT-Branch: master $:$NHDT-Revision: 1.26 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -104,6 +104,7 @@
#define _VA_LIST_ /* prevents multiple def in stdio.h */ #define _VA_LIST_ /* prevents multiple def in stdio.h */
#endif #endif
#else #else
#ifdef USE_VARARGS #ifdef USE_VARARGS
#include <varargs.h> #include <varargs.h>
#define VA_DECL(typ1, var1) \ #define VA_DECL(typ1, var1) \
@@ -125,6 +126,8 @@
va_end(the_args); \ va_end(the_args); \
} }
#else #else
/*USE_OLDARGS*/
#define VA_ARGS arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 #define VA_ARGS arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
#define VA_DECL(typ1, var1) \ #define VA_DECL(typ1, var1) \
(var1, VA_ARGS) typ1 var1; \ (var1, VA_ARGS) typ1 var1; \
@@ -137,10 +140,15 @@
{ {
#define VA_START(x) #define VA_START(x)
#define VA_INIT(var1, typ1) #define VA_INIT(var1, typ1)
/* this is inherently risky, and should only be attempted as a /* This is inherently risky, and should only be attempted as a
very last resort; manipulating arguments which haven't actually very last resort; manipulating arguments which haven't actually
been passed may or may not cause severe trouble depending on been passed may or may not cause severe trouble depending on
the function-calling/argument-passing mechanism being used */ the function-calling/argument-passing mechanism being used.
[nethack's core doesn't use VA_NEXT() so doesn't use VA_SHIFT()
either, and this definition is just retained for completeness.
lev_comp does use VA_NEXT(), but it passes all 'argX' arguments.]
*/
#define VA_SHIFT() \ #define VA_SHIFT() \
(arg1 = arg2, arg2 = arg3, arg3 = arg4, arg4 = arg5, arg5 = arg6, \ (arg1 = arg2, arg2 = arg3, arg3 = arg4, arg4 = arg5, arg5 = arg6, \
arg6 = arg7, arg7 = arg8, arg8 = arg9) arg6 = arg7, arg7 = arg8, arg8 = arg9)
+7 -10
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 unixconf.h $NHDT-Date: 1432512778 2015/05/25 00:12:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.23 $ */ /* NetHack 3.6 unixconf.h $NHDT-Date: 1447755973 2015/11/17 10:26:13 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -52,12 +52,11 @@
* particular, it should NOT be defined for the UNIXPC * particular, it should NOT be defined for the UNIXPC
* unless you remove the use of the shared library in * unless you remove the use of the shared library in
* the Makefile */ * the Makefile */
#define TEXTCOLOR /* Use System V r3.2 terminfo color support */ #define TEXTCOLOR /* Use System V r3.2 terminfo color support
/* and/or ANSI color support on termcap systems */ * and/or ANSI color support on termcap systems
/* and/or X11 color */ * and/or X11 color */
#define POSIX_JOB_CONTROL /* use System V / Solaris 2.x / POSIX job control \ #define POSIX_JOB_CONTROL /* use System V / Solaris 2.x / POSIX job control
*/ * (e.g., VSUSP) */
/* (e.g., VSUSP) */
#define POSIX_TYPES /* use POSIX types for system calls and termios */ #define POSIX_TYPES /* use POSIX types for system calls and termios */
/* Define for many recent OS releases, including /* Define for many recent OS releases, including
* those with specific defines (since types are * those with specific defines (since types are
@@ -109,8 +108,8 @@
* If defined, it can be overridden by the environment variable PAGER. * If defined, it can be overridden by the environment variable PAGER.
* Hack will use its internal pager if DEF_PAGER is not defined. * Hack will use its internal pager if DEF_PAGER is not defined.
* (This might be preferable for security reasons.) * (This might be preferable for security reasons.)
* #define DEF_PAGER ".../mydir/mypager"
*/ */
/* #define DEF_PAGER ".../mydir/mypager" */
/* /*
* Define PORT_HELP to be the name of the port-specfic help file. * Define PORT_HELP to be the name of the port-specfic help file.
@@ -148,7 +147,6 @@
* (another directory). MAILBOX is the element that will be added on to * (another directory). MAILBOX is the element that will be added on to
* the user's home directory path to generate the Mailbox path - just in * the user's home directory path to generate the Mailbox path - just in
* case other Andrew sites do it differently from CMU. * case other Andrew sites do it differently from CMU.
*
* dan lovinger * dan lovinger
* dl2n+@andrew.cmu.edu (dec 19 1989) * dl2n+@andrew.cmu.edu (dec 19 1989)
*/ */
@@ -158,7 +156,6 @@
/* NO_MAILREADER is for kerberos authenticating filesystems where it is /* NO_MAILREADER is for kerberos authenticating filesystems where it is
* essentially impossible to securely exec child processes, like mail * essentially impossible to securely exec child processes, like mail
* readers, when the game is running under a special token. * readers, when the game is running under a special token.
*
* dan * dan
*/ */
+4 -10
View File
@@ -401,19 +401,13 @@ register struct obj *obj;
case SDOOR: case SDOOR:
You_hear(hollow_str, "door"); You_hear(hollow_str, "door");
cvt_sdoor_to_door(lev); /* ->typ = DOOR */ cvt_sdoor_to_door(lev); /* ->typ = DOOR */
if (Blind) feel_newsym(rx, ry);
feel_location(rx, ry);
else
newsym(rx, ry);
return res; return res;
case SCORR: case SCORR:
You_hear(hollow_str, "passage"); You_hear(hollow_str, "passage");
lev->typ = CORR; lev->typ = CORR;
unblock_point(rx, ry); unblock_point(rx, ry);
if (Blind) feel_newsym(rx, ry);
feel_location(rx, ry);
else
newsym(rx, ry);
return res; return res;
} }
@@ -2042,8 +2036,8 @@ boolean quietly;
You("don't have enough room in here."); You("don't have enough room in here.");
return FALSE; return FALSE;
} }
x = cc->x; x = cc ? cc->x : u.ux;
y = cc->y; y = cc ? cc->y : u.uy;
if (!isok(x, y)) { if (!isok(x, y)) {
if (!quietly) if (!quietly)
You("cannot put the figurine there."); You("cannot put the figurine there.");
+4 -1
View File
@@ -1404,7 +1404,10 @@ arti_invoke(obj)
struct obj *obj; struct obj *obj;
{ {
register const struct artifact *oart = get_artifact(obj); register const struct artifact *oart = get_artifact(obj);
if (!obj) {
impossible("arti_invoke without obj");
return 0;
}
if (!oart || !oart->inv_prop) { if (!oart || !oart->inv_prop) {
if (obj->otyp == CRYSTAL_BALL) if (obj->otyp == CRYSTAL_BALL)
use_crystal_ball(&obj); use_crystal_ball(&obj);
+2 -3
View File
@@ -385,7 +385,6 @@ extcmd_via_menu()
biggest = 0; biggest = 0;
while (!ret) { while (!ret) {
i = n = 0; i = n = 0;
accelerator = 0;
any = zeroany; any = zeroany;
/* populate choices */ /* populate choices */
for (efp = extcmdlist; efp->ef_txt; efp++) { for (efp = extcmdlist; efp->ef_txt; efp++) {
@@ -421,7 +420,7 @@ extcmd_via_menu()
/* otherwise... */ /* otherwise... */
win = create_nhwindow(NHW_MENU); win = create_nhwindow(NHW_MENU);
start_menu(win); start_menu(win);
prevaccelerator = 0; accelerator = prevaccelerator = 0;
acount = 0; acount = 0;
for (i = 0; choices[i]; ++i) { for (i = 0; choices[i]; ++i) {
accelerator = choices[i]->ef_txt[matchlevel]; accelerator = choices[i]->ef_txt[matchlevel];
@@ -1769,7 +1768,7 @@ int final;
/* when mounted, Wounded_legs applies to steed rather than to /* when mounted, Wounded_legs applies to steed rather than to
hero; we only report steed's wounded legs in wizard mode */ hero; we only report steed's wounded legs in wizard mode */
if (u.usteed) { /* not `Riding' here */ if (u.usteed) { /* not `Riding' here */
if (wizard) { if (wizard && steedname) {
Strcpy(buf, steedname); Strcpy(buf, steedname);
*buf = highc(*buf); *buf = highc(*buf);
enl_msg(buf, " has", " had", " wounded legs", ""); enl_msg(buf, " has", " had", " wounded legs", "");
+1 -1
View File
@@ -388,7 +388,7 @@ const char *verb;
static char wholebuf[80]; static char wholebuf[80];
Strcpy(wholebuf, is_u(etmp) ? "You" : Monnam(etmp->emon)); Strcpy(wholebuf, is_u(etmp) ? "You" : Monnam(etmp->emon));
if (!*verb) if (!verb || !*verb)
return wholebuf; return wholebuf;
Strcat(wholebuf, " "); Strcat(wholebuf, " ");
if (is_u(etmp)) if (is_u(etmp))
+1 -4
View File
@@ -1291,10 +1291,7 @@ struct trap *trap;
trap->tseen = 1; trap->tseen = 1;
exercise(A_WIS, TRUE); exercise(A_WIS, TRUE);
if (Blind) feel_newsym(trap->tx, trap->ty);
feel_location(trap->tx, trap->ty);
else
newsym(trap->tx, trap->ty);
if (levl[trap->tx][trap->ty].glyph != trap_to_glyph(trap)) { if (levl[trap->tx][trap->ty].glyph != trap_to_glyph(trap)) {
/* There's too much clutter to see your find otherwise */ /* There's too much clutter to see your find otherwise */
+4 -9
View File
@@ -81,10 +81,7 @@ boolean waslit, rockit;
lev->typ = (rockit ? STONE : ROOM); lev->typ = (rockit ? STONE : ROOM);
if (dist >= 3) if (dist >= 3)
impossible("mkcavepos called with dist %d", dist); impossible("mkcavepos called with dist %d", dist);
if (Blind) feel_newsym(x, y);
feel_location(x, y);
else
newsym(x, y);
} }
STATIC_OVL void STATIC_OVL void
@@ -437,10 +434,7 @@ dig(VOID_ARGS)
if (!does_block(dpx, dpy, &levl[dpx][dpy])) if (!does_block(dpx, dpy, &levl[dpx][dpy]))
unblock_point(dpx, dpy); /* vision: can see through */ unblock_point(dpx, dpy); /* vision: can see through */
if (Blind) feel_newsym(dpx, dpy);
feel_location(dpx, dpy);
else
newsym(dpx, dpy);
if (digtxt && !context.digging.quiet) if (digtxt && !context.digging.quiet)
pline1(digtxt); /* after newsym */ pline1(digtxt); /* after newsym */
if (dmgtxt) if (dmgtxt)
@@ -1989,7 +1983,8 @@ long timeout;
if (mtmp && !OBJ_AT(x, y) && mtmp->mundetected if (mtmp && !OBJ_AT(x, y) && mtmp->mundetected
&& hides_under(mtmp->data)) { && hides_under(mtmp->data)) {
mtmp->mundetected = 0; mtmp->mundetected = 0;
} } else if (x == u.ux && y == u.uy && u.uundetected && hides_under(youmonst.data))
(void) hideunder(&youmonst);
newsym(x, y); newsym(x, y);
} else if (in_invent) } else if (in_invent)
update_inventory(); update_inventory();
+17
View File
@@ -486,6 +486,23 @@ register struct monst *mon;
show_glyph(x, y, glyph); show_glyph(x, y, glyph);
} }
/*
* feel_newsym()
*
* When hero knows what happened to location, even when blind.
*/
void
feel_newsym(x, y)
xchar x, y;
{
if (Blind)
feel_location(x, y);
else
newsym(x, y);
}
/* /*
* feel_location() * feel_location()
* *
+4
View File
@@ -1123,6 +1123,10 @@ register struct obj *otmp;
{ {
boolean was_blind = Blind, changed = FALSE; boolean was_blind = Blind, changed = FALSE;
if (!otmp) {
impossible("Blindf_off without otmp");
return;
}
context.takeoff.mask &= ~W_TOOL; context.takeoff.mask &= ~W_TOOL;
setworn((struct obj *) 0, otmp->owornmask); setworn((struct obj *) 0, otmp->owornmask);
off_msg(otmp); off_msg(otmp);
+3 -12
View File
@@ -973,10 +973,7 @@ dokick()
} else if (maploc->doormask != D_NODOOR } else if (maploc->doormask != D_NODOOR
&& !(maploc->doormask & D_LOCKED)) && !(maploc->doormask & D_LOCKED))
maploc->doormask = D_ISOPEN; maploc->doormask = D_ISOPEN;
if (Blind) feel_newsym(x, y); /* we know it's gone */
feel_location(x, y); /* we know it's gone */
else
newsym(x, y);
if (maploc->doormask == D_ISOPEN if (maploc->doormask == D_ISOPEN
|| maploc->doormask == D_NODOOR) || maploc->doormask == D_NODOOR)
unblock_point(x, y); /* vision */ unblock_point(x, y); /* vision */
@@ -989,10 +986,7 @@ dokick()
pline("Crash! You kick open a secret passage!"); pline("Crash! You kick open a secret passage!");
exercise(A_DEX, TRUE); exercise(A_DEX, TRUE);
maploc->typ = CORR; maploc->typ = CORR;
if (Blind) feel_newsym(x, y); /* we know it's gone */
feel_location(x, y); /* we know it's gone */
else
newsym(x, y);
unblock_point(x, y); /* vision */ unblock_point(x, y); /* vision */
return 1; return 1;
} else } else
@@ -1267,10 +1261,7 @@ dokick()
exercise(A_STR, TRUE); exercise(A_STR, TRUE);
maploc->doormask = D_BROKEN; maploc->doormask = D_BROKEN;
} }
if (Blind) feel_newsym(x, y); /* we know we broke it */
feel_location(x, y); /* we know we broke it */
else
newsym(x, y);
unblock_point(x, y); /* vision */ unblock_point(x, y); /* vision */
if (shopdoor) { if (shopdoor) {
add_damage(x, y, 400L); add_damage(x, y, 400L);
+1 -2
View File
@@ -1161,10 +1161,9 @@ boolean
; /* missile has already been handled */ ; /* missile has already been handled */
} else if (u.uswallow) { } else if (u.uswallow) {
/* ball is not picked up by monster */ /* ball is not picked up by monster */
if (obj != uball) { if (obj != uball)
(void) mpickobj(u.ustuck, obj); (void) mpickobj(u.ustuck, obj);
thrownobj = (struct obj *) 0; thrownobj = (struct obj *) 0;
}
} else { } else {
/* the code following might become part of dropy() */ /* the code following might become part of dropy() */
if (obj->oartifact == ART_MJOLLNIR && Role_if(PM_VALKYRIE) if (obj->oartifact == ART_MJOLLNIR && Role_if(PM_VALKYRIE)
+1 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 drawing.c $NHDT-Date: 1446975466 2015/11/08 09:37:46 $ $NHDT-Branch: master $:$NHDT-Revision: 1.48 $ */ /* NetHack 3.6 drawing.c $NHDT-Date: 1447124657 2015/11/10 03:04:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.49 $ */
/* Copyright (c) NetHack Development Team 1992. */ /* Copyright (c) NetHack Development Team 1992. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -520,9 +520,7 @@ boolean name_too;
free((genericptr_t) symset[which_set].desc); free((genericptr_t) symset[which_set].desc);
symset[which_set].desc = (char *) 0; symset[which_set].desc = (char *) 0;
symset[which_set].nocolor = 0;
symset[which_set].handling = H_UNK; symset[which_set].handling = H_UNK;
symset[which_set].desc = (char *) 0;
symset[which_set].nocolor = 0; symset[which_set].nocolor = 0;
/* initialize restriction bits */ /* initialize restriction bits */
symset[which_set].primary = 0; symset[which_set].primary = 0;
+4 -1
View File
@@ -271,7 +271,10 @@ STATIC_OVL void
recalc_wt() recalc_wt()
{ {
struct obj *piece = context.victual.piece; struct obj *piece = context.victual.piece;
if (!piece) {
impossible("recalc_wt without piece");
return;
}
debugpline1("Old weight = %d", piece->owt); debugpline1("Old weight = %d", piece->owt);
debugpline2("Used time = %d, Req'd time = %d", context.victual.usedtime, debugpline2("Used time = %d, Req'd time = %d", context.victual.usedtime,
context.victual.reqtime); context.victual.reqtime);
+6 -7
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 end.c $NHDT-Date: 1446510332 2015/11/03 00:25:32 $ $NHDT-Branch: master $:$NHDT-Revision: 1.102 $ */ /* NetHack 3.6 end.c $NHDT-Date: 1447576343 2015/11/15 08:32:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.103 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -627,7 +627,7 @@ boolean taken;
{ {
char c = 0, defquery; char c = 0, defquery;
char qbuf[QBUFSZ]; char qbuf[QBUFSZ];
boolean ask; boolean ask = FALSE;
if (invent && !done_stopprint) { if (invent && !done_stopprint) {
if (taken) if (taken)
@@ -1094,6 +1094,7 @@ die:
/* clean up unneeded windows */ /* clean up unneeded windows */
if (have_windows) { if (have_windows) {
wait_synch(); wait_synch();
free_pickinv_cache(); /* extra persistent window if perm_invent */
if (WIN_INVEN != WIN_ERR) if (WIN_INVEN != WIN_ERR)
destroy_nhwindow(WIN_INVEN), WIN_INVEN = WIN_ERR; destroy_nhwindow(WIN_INVEN), WIN_INVEN = WIN_ERR;
display_nhwindow(WIN_MESSAGE, TRUE); display_nhwindow(WIN_MESSAGE, TRUE);
@@ -1122,9 +1123,8 @@ die:
} }
if (!done_stopprint) { if (!done_stopprint) {
Sprintf( Sprintf(pbuf, "%s %s the %s...", Goodbye(), plname,
pbuf, "%s %s the %s...", Goodbye(), plname, (how != ASCENDED)
how != ASCENDED
? (const char *) ((flags.female && urole.name.f) ? (const char *) ((flags.female && urole.name.f)
? urole.name.f ? urole.name.f
: urole.name.m) : urole.name.m)
@@ -1254,8 +1254,7 @@ die:
putstr(endwin, 0, pbuf); putstr(endwin, 0, pbuf);
} }
if (!done_stopprint) { if (!done_stopprint) {
Sprintf( Sprintf(pbuf,
pbuf,
"You were level %d with a maximum of %d hit point%s when you %s.", "You were level %d with a maximum of %d hit point%s when you %s.",
u.ulevel, u.uhpmax, plur(u.uhpmax), ends[how]); u.ulevel, u.uhpmax, plur(u.uhpmax), ends[how]);
putstr(endwin, 0, pbuf); putstr(endwin, 0, pbuf);
+50 -17
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 files.c $NHDT-Date: 1446955299 2015/11/08 04:01:39 $ $NHDT-Branch: master $:$NHDT-Revision: 1.186 $ */ /* NetHack 3.6 files.c $NHDT-Date: 1447653425 2015/11/16 05:57:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.187 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -3421,20 +3421,55 @@ boolean wildcards;
/* ---------- BEGIN TRIBUTE ----------- */ /* ---------- BEGIN TRIBUTE ----------- */
/* 3.6 tribute code /* 3.6 tribute code
*
* Returns TRUE if you were able to read something.
*
*/ */
#define SECTIONSCOPE 1 #define SECTIONSCOPE 1
#define TITLESCOPE 2 #define TITLESCOPE 2
#define PASSAGESCOPE 3 #define PASSAGESCOPE 3
#define MAXPASSAGES SIZE(context.novel.pasg) /* 30 */
static int FDECL(choose_passage, (int, unsigned));
/* choose a random passage that hasn't been chosen yet; once all have
been chosen, reset the tracking to make all passages available again */
static int
choose_passage(passagecnt, oid)
int passagecnt; /* total of available passages, 1..MAXPASSAGES */
unsigned oid; /* book.o_id, used to determine whether re-reading same book */
{
int idx, res;
if (passagecnt < 1)
return 0;
if (passagecnt > MAXPASSAGES)
passagecnt = MAXPASSAGES;
/* if a different book or we've used up all the passages already,
reset in order to have all 'passagecnt' passages available */
if (oid != context.novel.id || context.novel.count == 0) {
context.novel.id = oid;
context.novel.count = passagecnt;
for (idx = 0; idx < MAXPASSAGES; idx++)
context.novel.pasg[idx] = (xchar) ((idx < passagecnt) ? idx + 1
: 0);
}
idx = rn2(context.novel.count);
res = (int) context.novel.pasg[idx];
/* move the last slot's passage index into the slot just used
and reduce the number of passages available */
context.novel.pasg[idx] = context.novel.pasg[--context.novel.count];
return res;
}
/* Returns True if you were able to read something. */
boolean boolean
read_tribute(tribsection, tribtitle, tribpassage, nowin_buf, bufsz) read_tribute(tribsection, tribtitle, tribpassage, nowin_buf, bufsz, oid)
const char *tribsection, *tribtitle; const char *tribsection, *tribtitle;
int tribpassage, bufsz; int tribpassage, bufsz;
char *nowin_buf; char *nowin_buf;
unsigned oid; /* book identifier */
{ {
dlb *fp; dlb *fp;
char *endp; char *endp;
@@ -3510,25 +3545,20 @@ char *nowin_buf;
if ((p2 = index(p1, ')')) != 0) { if ((p2 = index(p1, ')')) != 0) {
*p2 = '\0'; *p2 = '\0';
passagecnt = atoi(p1); passagecnt = atoi(p1);
/* sanity check here caps #passages at 50 */ if (passagecnt > MAXPASSAGES)
if ((passagecnt > 0) && (passagecnt < 50)) { passagecnt = MAXPASSAGES;
scope = TITLESCOPE; scope = TITLESCOPE;
if (matchedsection && !strcmpi(st, tribtitle)) { if (matchedsection && !strcmpi(st, tribtitle)) {
matchedtitle = TRUE; matchedtitle = TRUE;
if (!tribpassage) { targetpassage = !tribpassage
targetpassage = rnd(passagecnt); ? choose_passage(passagecnt, oid)
} else { : (tribpassage <= passagecnt)
if (tribpassage <= passagecnt) ? tribpassage : 0;
targetpassage = tribpassage;
else
targetpassage = 0;
}
} else { } else {
matchedtitle = FALSE; matchedtitle = FALSE;
} }
} }
} }
}
} else if (!strncmpi(&line[1], "passage ", } else if (!strncmpi(&line[1], "passage ",
sizeof("passage ") - 1)) { sizeof("passage ") - 1)) {
int passagenum = 0; int passagenum = 0;
@@ -3610,8 +3640,11 @@ Death_quote(buf, bufsz)
char *buf; char *buf;
int bufsz; int bufsz;
{ {
return read_tribute("Death", "Death Quotes", 0, buf, bufsz); unsigned death_oid = 1; /* chance of oid #1 being a novel is negligible */
return read_tribute("Death", "Death Quotes", 0, buf, bufsz, death_oid);
} }
/* ---------- END TRIBUTE ----------- */ /* ---------- END TRIBUTE ----------- */
/*files.c*/ /*files.c*/
+1 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 invent.c $NHDT-Date: 1446516832 2015/11/03 02:13:52 $ $NHDT-Branch: master $:$NHDT-Revision: 1.178 $ */ /* NetHack 3.6 invent.c $NHDT-Date: 1447576348 2015/11/15 08:32:28 $ $NHDT-Branch: master $:$NHDT-Revision: 1.179 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1985,7 +1985,6 @@ struct obj *list, **last_found;
then regrown to full inventory, possibly being resized in the process */ then regrown to full inventory, possibly being resized in the process */
static winid cached_pickinv_win = WIN_ERR; static winid cached_pickinv_win = WIN_ERR;
/* #ifdef FREE_ALL_MEMORY */
void void
free_pickinv_cache() free_pickinv_cache()
{ {
@@ -1994,7 +1993,6 @@ free_pickinv_cache()
cached_pickinv_win = WIN_ERR; cached_pickinv_win = WIN_ERR;
} }
} }
/* #endif */
/* /*
* Internal function used by display_inventory and getobj that can display * Internal function used by display_inventory and getobj that can display
+5 -9
View File
@@ -64,8 +64,10 @@ lock_action()
return actions[3]; /* same as lock_pick */ return actions[3]; /* same as lock_pick */
else if (xlock.door) else if (xlock.door)
return actions[0]; /* "unlocking the door" */ return actions[0]; /* "unlocking the door" */
else else if (xlock.box)
return xlock.box->otyp == CHEST ? actions[1] : actions[2]; return xlock.box->otyp == CHEST ? actions[1] : actions[2];
else
return actions[3];
} }
/* try to open/close a lock */ /* try to open/close a lock */
@@ -648,10 +650,7 @@ int x, y;
add_damage(cc.x, cc.y, 0L); add_damage(cc.x, cc.y, 0L);
} else } else
door->doormask = D_ISOPEN; door->doormask = D_ISOPEN;
if (Blind) feel_newsym(cc.x, cc.y); /* the hero knows she opened it */
feel_location(cc.x, cc.y); /* the hero knows she opened it */
else
newsym(cc.x, cc.y);
unblock_point(cc.x, cc.y); /* vision: new see through there */ unblock_point(cc.x, cc.y); /* vision: new see through there */
} else { } else {
exercise(A_STR, TRUE); exercise(A_STR, TRUE);
@@ -781,10 +780,7 @@ doclose()
|| rn2(25) < (ACURRSTR + ACURR(A_DEX) + ACURR(A_CON)) / 3) { || rn2(25) < (ACURRSTR + ACURR(A_DEX) + ACURR(A_CON)) / 3) {
pline_The("door closes."); pline_The("door closes.");
door->doormask = D_CLOSED; door->doormask = D_CLOSED;
if (Blind) feel_newsym(x, y); /* the hero knows she closed it */
feel_location(x, y); /* the hero knows she closed it */
else
newsym(x, y);
block_point(x, y); /* vision: no longer see there */ block_point(x, y); /* vision: no longer see there */
} else { } else {
exercise(A_STR, TRUE); exercise(A_STR, TRUE);
+1 -1
View File
@@ -2089,7 +2089,7 @@ register struct monst *mtmp;
} }
} }
/* release monster frome bag of tricks; return number of monsters created */ /* release monster from bag of tricks; return number of monsters created */
int int
bagotricks(bag, tipping, seencount) bagotricks(bag, tipping, seencount)
struct obj *bag; struct obj *bag;
+4 -4
View File
@@ -824,7 +824,7 @@ bound_digging()
return; /* everything diggable here */ return; /* everything diggable here */
found = nonwall = FALSE; found = nonwall = FALSE;
for (xmin = 0; !found; xmin++) { for (xmin = 0; !found && xmin <= COLNO; xmin++) {
lev = &levl[xmin][0]; lev = &levl[xmin][0];
for (y = 0; y <= ROWNO - 1; y++, lev++) { for (y = 0; y <= ROWNO - 1; y++, lev++) {
typ = lev->typ; typ = lev->typ;
@@ -840,7 +840,7 @@ bound_digging()
xmin = 0; xmin = 0;
found = nonwall = FALSE; found = nonwall = FALSE;
for (xmax = COLNO - 1; !found; xmax--) { for (xmax = COLNO - 1; !found && xmax >= 0; xmax--) {
lev = &levl[xmax][0]; lev = &levl[xmax][0];
for (y = 0; y <= ROWNO - 1; y++, lev++) { for (y = 0; y <= ROWNO - 1; y++, lev++) {
typ = lev->typ; typ = lev->typ;
@@ -856,7 +856,7 @@ bound_digging()
xmax = COLNO - 1; xmax = COLNO - 1;
found = nonwall = FALSE; found = nonwall = FALSE;
for (ymin = 0; !found; ymin++) { for (ymin = 0; !found && ymin <= ROWNO; ymin++) {
lev = &levl[xmin][ymin]; lev = &levl[xmin][ymin];
for (x = xmin; x <= xmax; x++, lev += ROWNO) { for (x = xmin; x <= xmax; x++, lev += ROWNO) {
typ = lev->typ; typ = lev->typ;
@@ -870,7 +870,7 @@ bound_digging()
ymin -= (nonwall || !level.flags.is_maze_lev) ? 2 : 1; ymin -= (nonwall || !level.flags.is_maze_lev) ? 2 : 1;
found = nonwall = FALSE; found = nonwall = FALSE;
for (ymax = ROWNO - 1; !found; ymax--) { for (ymax = ROWNO - 1; !found && ymax >= 0; ymax--) {
lev = &levl[xmin][ymax]; lev = &levl[xmin][ymax];
for (x = xmin; x <= xmax; x++, lev += ROWNO) { for (x = xmin; x <= xmax; x++, lev += ROWNO) {
typ = lev->typ; typ = lev->typ;
+25 -9
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 mkobj.c $NHDT-Date: 1446892448 2015/11/07 10:34:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.112 $ */ /* NetHack 3.6 mkobj.c $NHDT-Date: 1447475943 2015/11/14 04:39:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.113 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -79,21 +79,25 @@ newoextra()
} }
void void
dealloc_oextra(x) dealloc_oextra(o)
struct oextra *x; struct obj *o;
{ {
struct oextra *x = o->oextra;
if (x) { if (x) {
if (x->oname) if (x->oname)
free((genericptr_t) x->oname); free((genericptr_t) x->oname);
if (x->omonst) if (x->omonst)
free((genericptr_t) x->omonst); free_omonst(o); /* 'o' rather than 'x' */
if (x->omid) if (x->omid)
free((genericptr_t) x->omid); free((genericptr_t) x->omid);
if (x->olong) if (x->olong)
free((genericptr_t) x->olong); free((genericptr_t) x->olong);
if (x->omailcmd) if (x->omailcmd)
free((genericptr_t) x->omailcmd); free((genericptr_t) x->omailcmd);
free((genericptr_t) x); free((genericptr_t) x);
o->oextra = (struct oextra *) 0;
} }
} }
@@ -104,8 +108,13 @@ struct obj *otmp;
if (!otmp->oextra) if (!otmp->oextra)
otmp->oextra = newoextra(); otmp->oextra = newoextra();
if (!OMONST(otmp)) { if (!OMONST(otmp)) {
OMONST(otmp) = (struct monst *) alloc(sizeof (struct monst)); struct monst *m = newmonst();
(void) memset((genericptr_t) OMONST(otmp), 0, sizeof (struct monst));
/* newmonst() allocates memory but doesn't initialize anything */
(void) memset((genericptr_t) m, 0, sizeof (struct monst));
m->mextra = (struct mextra *) 0;
m->nmon = (struct monst *) 0;
OMONST(otmp) = m;
} }
} }
@@ -113,11 +122,17 @@ void
free_omonst(otmp) free_omonst(otmp)
struct obj *otmp; struct obj *otmp;
{ {
if (otmp->oextra && OMONST(otmp)) { if (otmp->oextra) {
free((genericptr_t) OMONST(otmp)); struct monst *m = OMONST(otmp);
if (m) {
if (m->mextra)
dealloc_mextra(m);
free((genericptr_t) m);
OMONST(otmp) = (struct monst *) 0; OMONST(otmp) = (struct monst *) 0;
} }
} }
}
void void
newomid(otmp) newomid(otmp)
@@ -1511,6 +1526,7 @@ struct monst *mtmp;
newomonst(obj); newomonst(obj);
if (has_omonst(obj)) { if (has_omonst(obj)) {
struct monst *mtmp2 = OMONST(obj); struct monst *mtmp2 = OMONST(obj);
*mtmp2 = *mtmp; *mtmp2 = *mtmp;
mtmp2->mextra = (struct mextra *) 0; mtmp2->mextra = (struct mextra *) 0;
if (mtmp->data) if (mtmp->data)
@@ -2053,7 +2069,7 @@ struct obj *obj;
kickedobj = 0; kickedobj = 0;
if (obj->oextra) if (obj->oextra)
dealloc_oextra(obj->oextra); dealloc_oextra(obj);
free((genericptr_t) obj); free((genericptr_t) obj);
} }
+1 -1
View File
@@ -422,7 +422,7 @@ int mm_flags;
while (cnt--) { while (cnt--) {
mdat = morguemon(); mdat = morguemon();
if (enexto(&cc, mm->x, mm->y, mdat) if (mdat && enexto(&cc, mm->x, mm->y, mdat)
&& (!revive_corpses && (!revive_corpses
|| !(otmp = sobj_at(CORPSE, cc.x, cc.y)) || !(otmp = sobj_at(CORPSE, cc.x, cc.y))
|| !revive(otmp, FALSE))) || !revive(otmp, FALSE)))
+11 -6
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 mon.c $NHDT-Date: 1446458009 2015/11/02 09:53:29 $ $NHDT-Branch: master $:$NHDT-Revision: 1.194 $ */ /* NetHack 3.6 mon.c $NHDT-Date: 1447475944 2015/11/14 04:39:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.196 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -18,7 +18,6 @@ STATIC_DCL long FDECL(mm_aggression, (struct monst *, struct monst *));
STATIC_DCL long FDECL(mm_displacement, (struct monst *, struct monst *)); STATIC_DCL long FDECL(mm_displacement, (struct monst *, struct monst *));
STATIC_DCL int NDECL(pick_animal); STATIC_DCL int NDECL(pick_animal);
STATIC_DCL void FDECL(kill_eggs, (struct obj *)); STATIC_DCL void FDECL(kill_eggs, (struct obj *));
STATIC_DCL void FDECL(dealloc_mextra, (struct mextra *));
STATIC_DCL int FDECL(pickvampshape, (struct monst *)); STATIC_DCL int FDECL(pickvampshape, (struct monst *));
STATIC_DCL boolean FDECL(isspecmon, (struct monst *)); STATIC_DCL boolean FDECL(isspecmon, (struct monst *));
STATIC_DCL boolean FDECL(validspecmon, (struct monst *, int)); STATIC_DCL boolean FDECL(validspecmon, (struct monst *, int));
@@ -392,6 +391,8 @@ unsigned corpseflags;
} }
/* All special cases should precede the G_NOCORPSE check */ /* All special cases should precede the G_NOCORPSE check */
if (!obj) return NULL;
/* if polymorph or undead turning has killed this monster, /* if polymorph or undead turning has killed this monster,
prevent the same attack beam from hitting its corpse */ prevent the same attack beam from hitting its corpse */
if (context.bypasses) if (context.bypasses)
@@ -1597,10 +1598,12 @@ struct monst *mtmp2, *mtmp1;
MCORPSENM(mtmp2) = MCORPSENM(mtmp1); MCORPSENM(mtmp2) = MCORPSENM(mtmp1);
} }
STATIC_OVL void void
dealloc_mextra(x) dealloc_mextra(m)
struct mextra *x; struct monst *m;
{ {
struct mextra *x = m->mextra;
if (x) { if (x) {
if (x->mname) if (x->mname)
free((genericptr_t) x->mname); free((genericptr_t) x->mname);
@@ -1615,7 +1618,9 @@ struct mextra *x;
if (x->edog) if (x->edog)
free((genericptr_t) x->edog); free((genericptr_t) x->edog);
/* [no action needed for x->mcorpsenm] */ /* [no action needed for x->mcorpsenm] */
free((genericptr_t) x); free((genericptr_t) x);
m->mextra = (struct mextra *) 0;
} }
} }
@@ -1626,7 +1631,7 @@ struct monst *mon;
if (mon->nmon) if (mon->nmon)
panic("dealloc_monst with nmon"); panic("dealloc_monst with nmon");
if (mon->mextra) if (mon->mextra)
dealloc_mextra(mon->mextra); dealloc_mextra(mon);
free((genericptr_t) mon); free((genericptr_t) mon);
} }
+12 -5
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 objects.c $NHDT-Date: 1444617222 2015/10/12 02:33:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.46 $ */ /* NetHack 3.6 objects.c $NHDT-Date: 1447313395 2015/11/12 07:29:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.49 $ */
/* Copyright (c) Mike Threepoint, 1989. */ /* Copyright (c) Mike Threepoint, 1989. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -846,7 +846,12 @@ SCROLL("earth", "KIRJE", 1, 18, 200),
SCROLL("punishment", "VE FORBRYDERNE", 1, 15, 300), SCROLL("punishment", "VE FORBRYDERNE", 1, 15, 300),
SCROLL("charging", "HACKEM MUCHE", 1, 15, 300), SCROLL("charging", "HACKEM MUCHE", 1, 15, 300),
SCROLL("stinking cloud", "VELOX NEB", 1, 15, 300), SCROLL("stinking cloud", "VELOX NEB", 1, 15, 300),
/* extra descriptions, shuffled into use at start of new game */ /* Extra descriptions, shuffled into use at start of new game.
* Code in win/share/tilemap.c depends on SCR_STINKING_CLOUD preceding
* these and on how many of them there are. If a real scroll gets added
* after stinking cloud or the number of extra descriptions changes,
* tilemap.c must be modified to match.
*/
SCROLL(None, "FOOBIE BLETCH", 1, 0, 100), SCROLL(None, "FOOBIE BLETCH", 1, 0, 100),
SCROLL(None, "TEMOV", 1, 0, 100), SCROLL(None, "TEMOV", 1, 0, 100),
SCROLL(None, "GARVEN DEH", 1, 0, 100), SCROLL(None, "GARVEN DEH", 1, 0, 100),
@@ -862,12 +867,14 @@ SCROLL(None, "GNIK SISI VLE", 1, 0, 100), /* Zak McKracke
SCROLL(None, "HAPAX LEGOMENON", 1, 0, 100), SCROLL(None, "HAPAX LEGOMENON", 1, 0, 100),
SCROLL(None, "EIRIS SAZUN IDISI", 1, 0, 100), /* Merseburg Incantations */ SCROLL(None, "EIRIS SAZUN IDISI", 1, 0, 100), /* Merseburg Incantations */
SCROLL(None, "PHOL ENDE WODAN", 1, 0, 100), /* Merseburg Incantations */ SCROLL(None, "PHOL ENDE WODAN", 1, 0, 100), /* Merseburg Incantations */
SCROLL(None, "GHOTI", 1, 0, 100), /* pronounced as 'fish', George Bernard Shaw */ SCROLL(None, "GHOTI", 1, 0, 100), /* pronounced as 'fish',
George Bernard Shaw */
SCROLL(None, "MAPIRO MAHAMA DIROMAT", 1, 0, 100), /* Wizardry */ SCROLL(None, "MAPIRO MAHAMA DIROMAT", 1, 0, 100), /* Wizardry */
SCROLL(None, "VAS CORP BET MANI", 1, 0, 100), /* Ultima */ SCROLL(None, "VAS CORP BET MANI", 1, 0, 100), /* Ultima */
SCROLL(None, "XOR OTA", 1, 0, 100), /* Aarne Haapakoski */ SCROLL(None, "XOR OTA", 1, 0, 100), /* Aarne Haapakoski */
SCROLL(None, "STRC PRST SKRZ KRK", 1, 0, 100), /* Czech and Slovak tongue-twister */ SCROLL(None, "STRC PRST SKRZ KRK", 1, 0, 100), /* Czech and Slovak
/* these must come last because they have special descriptions tongue-twister */
/* These must come last because they have special fixed descriptions.
*/ */
#ifdef MAIL #ifdef MAIL
SCROLL("mail", "stamped", 0, 0, 0), SCROLL("mail", "stamped", 0, 0, 0),
+32 -15
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 objnam.c $NHDT-Date: 1446892450 2015/11/07 10:34:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.153 $ */ /* NetHack 3.6 objnam.c $NHDT-Date: 1447490776 2015/11/14 08:46:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.154 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -2364,6 +2364,13 @@ struct alt_spellings {
{ "grappling iron", GRAPPLING_HOOK }, { "grappling iron", GRAPPLING_HOOK },
{ "grapnel", GRAPPLING_HOOK }, { "grapnel", GRAPPLING_HOOK },
{ "grapple", GRAPPLING_HOOK }, { "grapple", GRAPPLING_HOOK },
/* normally we wouldn't have to worry about unnecessary <space>, but
" stone" will get stripped off, preventing a wishymatch; that actually
lets "flint stone" be a match, so we also accept bogus "flintstone" */
{ "luck stone", LUCKSTONE },
{ "load stone", LOADSTONE },
{ "touch stone", TOUCHSTONE },
{ "flintstone", FLINT },
{ (const char *) 0, 0 }, { (const char *) 0, 0 },
}; };
@@ -2429,7 +2436,6 @@ struct obj *no_wish;
* "2 3 alarm chilis". Currently this isn't allowed; options.c * "2 3 alarm chilis". Currently this isn't allowed; options.c
* automatically sticks 'candied' in front of such names. * automatically sticks 'candied' in front of such names.
*/ */
char oclass; char oclass;
char *un, *dn, *actualn; char *un, *dn, *actualn;
const char *name = 0; const char *name = 0;
@@ -2556,15 +2562,14 @@ struct obj *no_wish;
} }
if (!cnt) if (!cnt)
cnt = 1; /* %% what with "gems" etc. ? */ cnt = 1; /* %% what with "gems" etc. ? */
if (strlen(bp) > 1) { if (strlen(bp) > 1 && (p = rindex(bp, '(')) != 0) {
if ((p = rindex(bp, '(')) != 0) { boolean keeptrailingchars = TRUE;
if (p > bp && p[-1] == ' ')
p[-1] = 0; p[(p > bp && p[-1] == ' ') ? -1 : 0] = '\0'; /*terminate bp */
else ++p; /* advance past '(' */
*p = 0; if (!strncmpi(p, "lit)", 4)) {
p++;
if (!strcmpi(p, "lit)")) {
islit = 1; islit = 1;
p += 4 - 1; /* point at ')' */
} else { } else {
spe = atoi(p); spe = atoi(p);
while (digit(*p)) while (digit(*p))
@@ -2578,13 +2583,23 @@ struct obj *no_wish;
} }
if (*p != ')') { if (*p != ')') {
spe = rechrg = 0; spe = rechrg = 0;
/* mis-matched parentheses; rest of string will be ignored
* [probably we should restore everything back to '('
* instead since it might be part of "named ..."]
*/
keeptrailingchars = FALSE;
} else { } else {
spesgn = 1; spesgn = 1;
p++;
if (*p)
Strcat(bp, p);
} }
} }
if (keeptrailingchars) {
char *pp = eos(bp);
/* 'pp' points at 'pb's terminating '\0',
'p' points at ')' and will be incremented past it */
do {
*pp++ = *++p;
} while (*p);
} }
} }
/* /*
@@ -2892,8 +2907,8 @@ retry:
goto typfnd; goto typfnd;
} }
if (!BSTRCMPI(bp, p - 6, " stone")) { if (!BSTRCMPI(bp, p - 6, " stone") || !BSTRCMPI(bp, p - 4, " gem")) {
p[-6] = 0; p[!strcmpi(p - 4, " gem") ? -4 : -6] = '\0';
oclass = GEM_CLASS; oclass = GEM_CLASS;
dn = actualn = bp; dn = actualn = bp;
goto srch; goto srch;
@@ -2920,6 +2935,7 @@ retry:
typ = 0; /* somebody changed objects[]? punt */ typ = 0; /* somebody changed objects[]? punt */
} else { /* try to construct canonical form */ } else { /* try to construct canonical form */
char tbuf[BUFSZ]; char tbuf[BUFSZ];
Strcpy(tbuf, "worthless piece of "); Strcpy(tbuf, "worthless piece of ");
Strcat(tbuf, g); /* assume it starts with the color */ Strcat(tbuf, g); /* assume it starts with the color */
Strcpy(bp, tbuf); Strcpy(bp, tbuf);
@@ -2967,6 +2983,7 @@ srch:
} }
if (actualn) { if (actualn) {
struct Jitem *j = Japanese_items; struct Jitem *j = Japanese_items;
while (j->item) { while (j->item) {
if (actualn && !strcmpi(actualn, j->name)) { if (actualn && !strcmpi(actualn, j->name)) {
typ = j->item; typ = j->item;
+118 -114
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 options.c $NHDT-Date: 1446854231 2015/11/06 23:57:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.236 $ */ /* NetHack 3.6 options.c $NHDT-Date: 1447234076 2015/11/11 09:27:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.240 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -710,8 +710,10 @@ initoptions_init()
#if defined(UNIX) || defined(VMS) #if defined(UNIX) || defined(VMS)
#ifdef TTY_GRAPHICS #ifdef TTY_GRAPHICS
/* detect whether a "vt" terminal can handle alternate charsets */ /* detect whether a "vt" terminal can handle alternate charsets */
if ((opts = nh_getenv("TERM")) && !strncmpi(opts, "vt", 2) && AS && AE if ((opts = nh_getenv("TERM"))
&& index(AS, '\016') && index(AE, '\017')) { /* [could also check "xterm" which emulates vtXXX by default] */
&& !strncmpi(opts, "vt", 2)
&& AS && AE && index(AS, '\016') && index(AE, '\017')) {
if (!symset[PRIMARY].name) if (!symset[PRIMARY].name)
load_symset("DECGraphics", PRIMARY); load_symset("DECGraphics", PRIMARY);
switch_symbols(TRUE); switch_symbols(TRUE);
@@ -1057,9 +1059,9 @@ const char *optn;
else else
flags.suppress_alert = fnv; flags.suppress_alert = fnv;
if (rejectver) { if (rejectver) {
if (!initial) if (!initial) {
You_cant("disable new feature alerts for future versions."); You_cant("disable new feature alerts for future versions.");
else { } else {
Sprintf(buf, Sprintf(buf,
"\n%s=%s Invalid reference to a future version ignored", "\n%s=%s Invalid reference to a future version ignored",
optn, op); optn, op);
@@ -1387,7 +1389,7 @@ char *pattern;
pline("%s: %s", re_error, regex_error_desc(tmp->regex)); pline("%s: %s", re_error, regex_error_desc(tmp->regex));
wait_synch(); wait_synch();
regex_free(tmp->regex); regex_free(tmp->regex);
free(tmp); free((genericptr_t) tmp);
return FALSE; return FALSE;
} }
tmp->pattern = dupstr(pattern); tmp->pattern = dupstr(pattern);
@@ -1655,7 +1657,7 @@ boolean tinitial, tfrom_file;
{ {
register char *op; register char *op;
unsigned num; unsigned num;
boolean negated, duplicate; boolean negated, val_negated, duplicate;
int i; int i;
const char *fullname; const char *fullname;
@@ -1730,10 +1732,10 @@ boolean tinitial, tfrom_file;
/* align:string */ /* align:string */
fullname = "align"; fullname = "align";
if (match_optname(opts, fullname, sizeof("align") - 1, TRUE)) { if (match_optname(opts, fullname, sizeof("align") - 1, TRUE)) {
if (negated) if (negated) {
bad_negation(fullname, FALSE); bad_negation(fullname, FALSE);
else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) {
boolean val_negated = FALSE; val_negated = FALSE;
while ((*op == '!') || !strncmpi(op, "no", 2)) { while ((*op == '!') || !strncmpi(op, "no", 2)) {
if (*op == '!') if (*op == '!')
op++; op++;
@@ -1758,10 +1760,10 @@ boolean tinitial, tfrom_file;
fullname = "role"; fullname = "role";
if (match_optname(opts, fullname, 4, TRUE) if (match_optname(opts, fullname, 4, TRUE)
|| match_optname(opts, (fullname = "character"), 4, TRUE)) { || match_optname(opts, (fullname = "character"), 4, TRUE)) {
if (negated) if (negated) {
bad_negation(fullname, FALSE); bad_negation(fullname, FALSE);
else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) {
boolean val_negated = FALSE; val_negated = FALSE;
while ((*op == '!') || !strncmpi(op, "no", 2)) { while ((*op == '!') || !strncmpi(op, "no", 2)) {
if (*op == '!') if (*op == '!')
op++; op++;
@@ -1787,10 +1789,10 @@ boolean tinitial, tfrom_file;
/* race:string */ /* race:string */
fullname = "race"; fullname = "race";
if (match_optname(opts, fullname, 4, TRUE)) { if (match_optname(opts, fullname, 4, TRUE)) {
if (negated) if (negated) {
bad_negation(fullname, FALSE); bad_negation(fullname, FALSE);
else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) {
boolean val_negated = FALSE; val_negated = FALSE;
while ((*op == '!') || !strncmpi(op, "no", 2)) { while ((*op == '!') || !strncmpi(op, "no", 2)) {
if (*op == '!') if (*op == '!')
op++; op++;
@@ -1816,10 +1818,10 @@ boolean tinitial, tfrom_file;
/* gender:string */ /* gender:string */
fullname = "gender"; fullname = "gender";
if (match_optname(opts, fullname, 4, TRUE)) { if (match_optname(opts, fullname, 4, TRUE)) {
if (negated) if (negated) {
bad_negation(fullname, FALSE); bad_negation(fullname, FALSE);
else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) {
boolean val_negated = FALSE; val_negated = FALSE;
while ((*op == '!') || !strncmpi(op, "no", 2)) { while ((*op == '!') || !strncmpi(op, "no", 2)) {
if (*op == '!') if (*op == '!')
op++; op++;
@@ -1968,11 +1970,10 @@ boolean tinitial, tfrom_file;
if (match_optname(opts, fullname, 7, TRUE)) { if (match_optname(opts, fullname, 7, TRUE)) {
if (duplicate) if (duplicate)
complain_about_duplicate(opts, 1); complain_about_duplicate(opts, 1);
if (negated) if (negated) {
bad_negation(fullname, FALSE); bad_negation(fullname, FALSE);
else if ((op = string_for_opt(opts, FALSE)) != 0) { } else if ((op = string_for_opt(opts, FALSE)) != 0) {
symset[ROGUESET].name = (char *) alloc(strlen(op) + 1); symset[ROGUESET].name = dupstr(op);
Strcpy(symset[ROGUESET].name, op);
if (!read_sym_file(ROGUESET)) { if (!read_sym_file(ROGUESET)) {
clear_symsetentry(ROGUESET, TRUE); clear_symsetentry(ROGUESET, TRUE);
raw_printf("Unable to load symbol set \"%s\" from \"%s\".", raw_printf("Unable to load symbol set \"%s\" from \"%s\".",
@@ -1991,11 +1992,10 @@ boolean tinitial, tfrom_file;
if (match_optname(opts, fullname, 6, TRUE)) { if (match_optname(opts, fullname, 6, TRUE)) {
if (duplicate) if (duplicate)
complain_about_duplicate(opts, 1); complain_about_duplicate(opts, 1);
if (negated) if (negated) {
bad_negation(fullname, FALSE); bad_negation(fullname, FALSE);
else if ((op = string_for_opt(opts, FALSE)) != 0) { } else if ((op = string_for_opt(opts, FALSE)) != 0) {
symset[PRIMARY].name = (char *) alloc(strlen(op) + 1); symset[PRIMARY].name = dupstr(op);
Strcpy(symset[PRIMARY].name, op);
if (!read_sym_file(PRIMARY)) { if (!read_sym_file(PRIMARY)) {
clear_symsetentry(PRIMARY, TRUE); clear_symsetentry(PRIMARY, TRUE);
raw_printf("Unable to load symbol set \"%s\" from \"%s\".", raw_printf("Unable to load symbol set \"%s\" from \"%s\".",
@@ -2370,9 +2370,9 @@ boolean tinitial, tfrom_file;
if (match_optname(opts, fullname, 4, TRUE)) { if (match_optname(opts, fullname, 4, TRUE)) {
if (duplicate) if (duplicate)
complain_about_duplicate(opts, 1); complain_about_duplicate(opts, 1);
if (negated) if (negated) {
bad_negation(fullname, FALSE); bad_negation(fullname, FALSE);
else if ((op = string_for_opt(opts, negated))) { } else if ((op = string_for_opt(opts, negated)) != 0) {
#ifdef WIN32 #ifdef WIN32
(void) strncpy(iflags.altkeyhandler, op, MAX_ALTKEYHANDLER - 5); (void) strncpy(iflags.altkeyhandler, op, MAX_ALTKEYHANDLER - 5);
load_keyboard_handler(); load_keyboard_handler();
@@ -2973,9 +2973,9 @@ boolean tinitial, tfrom_file;
fullname = "subkeyvalue"; fullname = "subkeyvalue";
if (match_optname(opts, fullname, 5, TRUE)) { if (match_optname(opts, fullname, 5, TRUE)) {
/* no duplicate complaint here */ /* no duplicate complaint here */
if (negated) if (negated) {
bad_negation(fullname, FALSE); bad_negation(fullname, FALSE);
else { } else {
#if defined(WIN32) #if defined(WIN32)
op = string_for_opt(opts, 0); op = string_for_opt(opts, 0);
map_subkeyvalue(op); map_subkeyvalue(op);
@@ -3140,9 +3140,9 @@ boolean tinitial, tfrom_file;
if (duplicate) if (duplicate)
complain_about_duplicate(opts, 1); complain_about_duplicate(opts, 1);
if (match_optname(opts, fullname, (int) strlen(fullname), TRUE)) { if (match_optname(opts, fullname, (int) strlen(fullname), TRUE)) {
if (negated) if (negated) {
bad_negation(fullname, FALSE); bad_negation(fullname, FALSE);
else if ((op = string_for_opt(opts, FALSE)) != 0) { } else if ((op = string_for_opt(opts, FALSE)) != 0) {
int j; int j;
char c, op_buf[BUFSZ]; char c, op_buf[BUFSZ];
boolean isbad = FALSE; boolean isbad = FALSE;
@@ -3197,11 +3197,10 @@ boolean tinitial, tfrom_file;
complain_about_duplicate(opts, 1); complain_about_duplicate(opts, 1);
if (!negated) { if (!negated) {
/* There is no rogue level DECgraphics-specific set */ /* There is no rogue level DECgraphics-specific set */
if (symset[PRIMARY].name) if (symset[PRIMARY].name) {
badflag = TRUE; badflag = TRUE;
else { } else {
symset[PRIMARY].name = (char *) alloc(strlen(fullname) + 1); symset[PRIMARY].name = dupstr(fullname);
Strcpy(symset[PRIMARY].name, fullname);
if (!read_sym_file(PRIMARY)) { if (!read_sym_file(PRIMARY)) {
badflag = TRUE; badflag = TRUE;
clear_symsetentry(PRIMARY, TRUE); clear_symsetentry(PRIMARY, TRUE);
@@ -3224,13 +3223,12 @@ boolean tinitial, tfrom_file;
complain_about_duplicate(opts, 1); complain_about_duplicate(opts, 1);
if (!negated) { if (!negated) {
for (i = 0; i < NUM_GRAPHICS; ++i) { for (i = 0; i < NUM_GRAPHICS; ++i) {
if (symset[i].name) if (symset[i].name) {
badflag = TRUE; badflag = TRUE;
else { } else {
if (i == ROGUESET) if (i == ROGUESET)
sym_name = "RogueIBM"; sym_name = "RogueIBM";
symset[i].name = (char *) alloc(strlen(sym_name) + 1); symset[i].name = dupstr(sym_name);
Strcpy(symset[i].name, sym_name);
if (!read_sym_file(i)) { if (!read_sym_file(i)) {
badflag = TRUE; badflag = TRUE;
clear_symsetentry(i, TRUE); clear_symsetentry(i, TRUE);
@@ -3258,11 +3256,10 @@ boolean tinitial, tfrom_file;
if (duplicate) if (duplicate)
complain_about_duplicate(opts, 1); complain_about_duplicate(opts, 1);
if (!negated) { if (!negated) {
if (symset[PRIMARY].name) if (symset[PRIMARY].name) {
badflag = TRUE; badflag = TRUE;
else { } else {
symset[PRIMARY].name = (char *) alloc(strlen(fullname) + 1); symset[PRIMARY].name = dupstr(fullname);
Strcpy(symset[PRIMARY].name, fullname);
if (!read_sym_file(PRIMARY)) { if (!read_sym_file(PRIMARY)) {
badflag = TRUE; badflag = TRUE;
clear_symsetentry(PRIMARY, TRUE); clear_symsetentry(PRIMARY, TRUE);
@@ -3355,9 +3352,8 @@ boolean tinitial, tfrom_file;
|| (boolopt[i].addr) == &flags.showrace || (boolopt[i].addr) == &flags.showrace
|| (boolopt[i].addr) == &iflags.hilite_pet) { || (boolopt[i].addr) == &iflags.hilite_pet) {
need_redraw = TRUE; need_redraw = TRUE;
}
#ifdef TEXTCOLOR #ifdef TEXTCOLOR
else if ((boolopt[i].addr) == &iflags.use_color) { } else if ((boolopt[i].addr) == &iflags.use_color) {
need_redraw = TRUE; need_redraw = TRUE;
#ifdef TOS #ifdef TOS
if ((boolopt[i].addr) == &iflags.use_color && iflags.BIOS) { if ((boolopt[i].addr) == &iflags.use_color && iflags.BIOS) {
@@ -3367,9 +3363,8 @@ boolean tinitial, tfrom_file;
set_colors(); set_colors();
} }
#endif #endif
#endif /* TEXTCOLOR */
} }
#endif
return; return;
} }
} }
@@ -3417,9 +3412,9 @@ void
add_menu_cmd_alias(from_ch, to_ch) add_menu_cmd_alias(from_ch, to_ch)
char from_ch, to_ch; char from_ch, to_ch;
{ {
if (n_menu_mapped >= MAX_MENU_MAPPED_CMDS) if (n_menu_mapped >= MAX_MENU_MAPPED_CMDS) {
pline("out of menu map space."); pline("out of menu map space.");
else { } else {
mapped_menu_cmds[n_menu_mapped] = from_ch; mapped_menu_cmds[n_menu_mapped] = from_ch;
mapped_menu_op[n_menu_mapped] = to_ch; mapped_menu_op[n_menu_mapped] = to_ch;
n_menu_mapped++; n_menu_mapped++;
@@ -3604,19 +3599,20 @@ doset()
} }
any.a_int = -4; any.a_int = -4;
Sprintf(buf2, n_currently_set, msgtype_count()); Sprintf(buf2, n_currently_set, msgtype_count());
Sprintf(buf, fmtstr_doset_add_menu, any.a_int ? "" : " ", "message types", Sprintf(buf, fmtstr_doset_add_menu, any.a_int ? "" : " ",
buf2); "message types", buf2);
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, MENU_UNSELECTED); add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, MENU_UNSELECTED);
any.a_int = -3; any.a_int = -3;
Sprintf(buf2, n_currently_set, count_menucolors()); Sprintf(buf2, n_currently_set, count_menucolors());
Sprintf(buf, fmtstr_doset_add_menu, any.a_int ? "" : " ", "menucolors", Sprintf(buf, fmtstr_doset_add_menu, any.a_int ? "" : " ",
buf2); "menucolors", buf2);
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, MENU_UNSELECTED); add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, MENU_UNSELECTED);
#ifdef STATUS_VIA_WINDOWPORT #ifdef STATUS_VIA_WINDOWPORT
#ifdef STATUS_HILITES #ifdef STATUS_HILITES
any.a_int = -2; any.a_int = -2;
get_status_hilites(buf2, 60); get_status_hilites(buf2, 60);
if (!*buf2) Sprintf(buf2, "%s", "(none)"); if (!*buf2)
Sprintf(buf2, "%s", "(none)");
if (!iflags.menu_tab_sep) if (!iflags.menu_tab_sep)
Sprintf(buf, fmtstr_doset_add_menu, any.a_int ? "" : " ", Sprintf(buf, fmtstr_doset_add_menu, any.a_int ? "" : " ",
"status_hilites", buf2); "status_hilites", buf2);
@@ -3824,8 +3820,7 @@ boolean setinitial, setfromfile;
could have toggled off preselected ones to end up with 0 */ could have toggled off preselected ones to end up with 0 */
flags.paranoia_bits = 0; flags.paranoia_bits = 0;
if (i > 0) { if (i > 0) {
/* at least one item set, either preselected or newly picked /* at least 1 item set, either preselected or newly picked */
*/
while (--i >= 0) while (--i >= 0)
flags.paranoia_bits |= paranoia_picks[i].item.a_int; flags.paranoia_bits |= paranoia_picks[i].item.a_int;
free((genericptr_t) paranoia_picks); free((genericptr_t) paranoia_picks);
@@ -3835,6 +3830,7 @@ boolean setinitial, setfromfile;
} else if (!strcmp("pickup_burden", optname)) { } else if (!strcmp("pickup_burden", optname)) {
const char *burden_name, *burden_letters = "ubsntl"; const char *burden_name, *burden_letters = "ubsntl";
menu_item *burden_pick = (menu_item *) 0; menu_item *burden_pick = (menu_item *) 0;
tmpwin = create_nhwindow(NHW_MENU); tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin); start_menu(tmpwin);
any = zeroany; any = zeroany;
@@ -3922,6 +3918,7 @@ boolean setinitial, setfromfile;
} else if (!strcmp("runmode", optname)) { } else if (!strcmp("runmode", optname)) {
const char *mode_name; const char *mode_name;
menu_item *mode_pick = (menu_item *) 0; menu_item *mode_pick = (menu_item *) 0;
tmpwin = create_nhwindow(NHW_MENU); tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin); start_menu(tmpwin);
any = zeroany; any = zeroany;
@@ -3941,6 +3938,7 @@ boolean setinitial, setfromfile;
#ifdef TTY_GRAPHICS #ifdef TTY_GRAPHICS
/* by Christian W. Cooper */ /* by Christian W. Cooper */
menu_item *window_pick = (menu_item *) 0; menu_item *window_pick = (menu_item *) 0;
tmpwin = create_nhwindow(NHW_MENU); tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin); start_menu(tmpwin);
any = zeroany; any = zeroany;
@@ -3966,6 +3964,7 @@ boolean setinitial, setfromfile;
} else if (!strcmp("sortloot", optname)) { } else if (!strcmp("sortloot", optname)) {
const char *sortl_name; const char *sortl_name;
menu_item *sortl_pick = (menu_item *) 0; menu_item *sortl_pick = (menu_item *) 0;
tmpwin = create_nhwindow(NHW_MENU); tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin); start_menu(tmpwin);
any = zeroany; any = zeroany;
@@ -4119,9 +4118,8 @@ boolean setinitial, setfromfile;
for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx) for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx)
free_one_msgtype(pick_list[pick_idx].item.a_int - 1 free_one_msgtype(pick_list[pick_idx].item.a_int - 1
- pick_idx); - pick_idx);
free((genericptr_t) pick_list), pick_list = (menu_item *) 0;
} }
free((genericptr_t) pick_list);
pick_list = (menu_item *) 0;
destroy_nhwindow(tmpwin); destroy_nhwindow(tmpwin);
if (pick_cnt >= 0) if (pick_cnt >= 0)
goto msgtypes_again; goto msgtypes_again;
@@ -4175,15 +4173,15 @@ boolean setinitial, setfromfile;
Sprintf(mcbuf, "%s menu colors", Sprintf(mcbuf, "%s menu colors",
(opt_idx == 1) ? "List of" : "Remove which"); (opt_idx == 1) ? "List of" : "Remove which");
end_menu(tmpwin, mcbuf); end_menu(tmpwin, mcbuf);
pick_cnt = select_menu( pick_cnt = select_menu(tmpwin,
tmpwin, (opt_idx == 1) ? PICK_NONE : PICK_ANY, &pick_list); (opt_idx == 1) ? PICK_NONE : PICK_ANY,
&pick_list);
if (pick_cnt > 0) { if (pick_cnt > 0) {
for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx) for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx)
free_one_menu_coloring(pick_list[pick_idx].item.a_int - 1 free_one_menu_coloring(pick_list[pick_idx].item.a_int - 1
- pick_idx); - pick_idx);
free((genericptr_t) pick_list), pick_list = (menu_item *) 0;
} }
free((genericptr_t) pick_list);
pick_list = (menu_item *) 0;
destroy_nhwindow(tmpwin); destroy_nhwindow(tmpwin);
if (pick_cnt >= 0) if (pick_cnt >= 0)
goto menucolors_again; goto menucolors_again;
@@ -4240,16 +4238,16 @@ boolean setinitial, setfromfile;
Sprintf(apebuf, "%s autopickup exceptions", Sprintf(apebuf, "%s autopickup exceptions",
(opt_idx == 1) ? "List of" : "Remove which"); (opt_idx == 1) ? "List of" : "Remove which");
end_menu(tmpwin, apebuf); end_menu(tmpwin, apebuf);
pick_cnt = select_menu( pick_cnt = select_menu(tmpwin,
tmpwin, (opt_idx == 1) ? PICK_NONE : PICK_ANY, &pick_list); (opt_idx == 1) ? PICK_NONE : PICK_ANY,
&pick_list);
if (pick_cnt > 0) { if (pick_cnt > 0) {
for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx) for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx)
remove_autopickup_exception( remove_autopickup_exception(
(struct autopickup_exception *) pick_list[pick_idx] (struct autopickup_exception *)
.item.a_void); pick_list[pick_idx].item.a_void);
free((genericptr_t) pick_list), pick_list = (menu_item *) 0;
} }
free((genericptr_t) pick_list);
pick_list = (menu_item *) 0;
destroy_nhwindow(tmpwin); destroy_nhwindow(tmpwin);
if (pick_cnt >= 0) if (pick_cnt >= 0)
goto ape_again; goto ape_again;
@@ -4258,13 +4256,12 @@ boolean setinitial, setfromfile;
|| !strcmp("roguesymset", optname)) { || !strcmp("roguesymset", optname)) {
menu_item *symset_pick = (menu_item *) 0; menu_item *symset_pick = (menu_item *) 0;
boolean primaryflag = (*optname == 's'), boolean primaryflag = (*optname == 's'),
rogueflag = (*optname == 'r'), ready_to_switch = FALSE, rogueflag = (*optname == 'r'),
ready_to_switch = FALSE,
nothing_to_do = FALSE; nothing_to_do = FALSE;
int res;
char *symset_name, fmtstr[20]; char *symset_name, fmtstr[20];
struct symsetentry *sl; struct symsetentry *sl;
int setcount = 0; int res, which_set, setcount = 0, chosen = -2;
int chosen = -2, which_set;
if (rogueflag) if (rogueflag)
which_set = ROGUESET; which_set = ROGUESET;
@@ -4359,14 +4356,13 @@ boolean setinitial, setfromfile;
} }
sl = sl->next; sl = sl->next;
} }
} } else if (chosen == -1) {
else if (chosen == -1) {
/* explicit selection of defaults */ /* explicit selection of defaults */
/* free the now stale symset attributes */ /* free the now stale symset attributes */
if (symset_name) if (symset_name) {
free((genericptr_t) symset_name); free((genericptr_t) symset_name);
symset_name = (char *) 0; symset_name = (char *) 0;
}
clear_symsetentry(which_set, TRUE); clear_symsetentry(which_set, TRUE);
} else } else
nothing_to_do = TRUE; nothing_to_do = TRUE;
@@ -4399,7 +4395,7 @@ boolean setinitial, setfromfile;
return TRUE; return TRUE;
if (!symset[which_set].name && symset_name) if (!symset[which_set].name && symset_name)
symset[which_set].name = symset_name; symset[which_set].name = symset_name; /* not dupstr() here */
/* Set default symbols and clear the handling value */ /* Set default symbols and clear the handling value */
if (rogueflag) if (rogueflag)
@@ -4408,9 +4404,9 @@ boolean setinitial, setfromfile;
init_l_symbols(); init_l_symbols();
if (symset[which_set].name) { if (symset[which_set].name) {
if (read_sym_file(which_set)) if (read_sym_file(which_set)) {
ready_to_switch = TRUE; ready_to_switch = TRUE;
else { } else {
clear_symsetentry(which_set, TRUE); clear_symsetentry(which_set, TRUE);
return TRUE; return TRUE;
} }
@@ -4586,9 +4582,9 @@ char *buf;
Sprintf(buf, "%s", to_be_done); Sprintf(buf, "%s", to_be_done);
else if (!strcmp(optname, "menu_invert_all")) else if (!strcmp(optname, "menu_invert_all"))
Sprintf(buf, "%s", to_be_done); Sprintf(buf, "%s", to_be_done);
else if (!strcmp(optname, "menu_headings")) { else if (!strcmp(optname, "menu_headings"))
Sprintf(buf, "%s", attr2attrname(iflags.menu_headings)); Sprintf(buf, "%s", attr2attrname(iflags.menu_headings));
} else if (!strcmp(optname, "menu_invert_page")) else if (!strcmp(optname, "menu_invert_page"))
Sprintf(buf, "%s", to_be_done); Sprintf(buf, "%s", to_be_done);
else if (!strcmp(optname, "menu_last_page")) else if (!strcmp(optname, "menu_last_page"))
Sprintf(buf, "%s", to_be_done); Sprintf(buf, "%s", to_be_done);
@@ -4602,12 +4598,12 @@ char *buf;
Sprintf(buf, "%s", to_be_done); Sprintf(buf, "%s", to_be_done);
else if (!strcmp(optname, "menu_select_page")) else if (!strcmp(optname, "menu_select_page"))
Sprintf(buf, "%s", to_be_done); Sprintf(buf, "%s", to_be_done);
else if (!strcmp(optname, "monsters")) else if (!strcmp(optname, "monsters")) {
Sprintf(buf, "%s", to_be_done); Sprintf(buf, "%s", to_be_done);
else if (!strcmp(optname, "msghistory")) } else if (!strcmp(optname, "msghistory")) {
Sprintf(buf, "%u", iflags.msg_history); Sprintf(buf, "%u", iflags.msg_history);
#ifdef TTY_GRAPHICS #ifdef TTY_GRAPHICS
else if (!strcmp(optname, "msg_window")) } else if (!strcmp(optname, "msg_window")) {
Sprintf(buf, "%s", (iflags.prevmsg_window == 's') Sprintf(buf, "%s", (iflags.prevmsg_window == 's')
? "single" ? "single"
: (iflags.prevmsg_window == 'c') : (iflags.prevmsg_window == 'c')
@@ -4616,9 +4612,9 @@ char *buf;
? "full" ? "full"
: "reversed"); : "reversed");
#endif #endif
else if (!strcmp(optname, "name")) } else if (!strcmp(optname, "name")) {
Sprintf(buf, "%s", plname); Sprintf(buf, "%s", plname);
else if (!strcmp(optname, "number_pad")) { } else if (!strcmp(optname, "number_pad")) {
static const char *numpadmodes[] = { static const char *numpadmodes[] = {
"0=off", "1=on", "2=on, MSDOS compatible", "0=off", "1=on", "2=on, MSDOS compatible",
"3=on, phone-style layout", "3=on, phone-style layout",
@@ -4699,14 +4695,11 @@ char *buf;
else else
Strcpy(buf, defopt); Strcpy(buf, defopt);
} else if (!strcmp(optname, "sortloot")) { } else if (!strcmp(optname, "sortloot")) {
char *sortname = (char *) NULL; for (i = 0; i < SIZE(sortltype); i++)
if (flags.sortloot == sortltype[i][0]) {
for (i = 0; i < SIZE(sortltype) && sortname == (char *) NULL; i++) { Strcpy(buf, sortltype[i]);
if (flags.sortloot == sortltype[i][0]) break;
sortname = (char *) sortltype[i];
} }
if (sortname != (char *) NULL)
Sprintf(buf, "%s", sortname);
} else if (!strcmp(optname, "player_selection")) { } else if (!strcmp(optname, "player_selection")) {
Sprintf(buf, "%s", iflags.wc_player_selection ? "prompts" : "dialog"); Sprintf(buf, "%s", iflags.wc_player_selection ? "prompts" : "dialog");
#ifdef MSDOS #ifdef MSDOS
@@ -4836,7 +4829,7 @@ const char *mapping;
if (!regex_compile(text2, ape->regex)) { if (!regex_compile(text2, ape->regex)) {
raw_print("regex error in AUTOPICKUP_EXCEPTION"); raw_print("regex error in AUTOPICKUP_EXCEPTION");
regex_free(ape->regex); regex_free(ape->regex);
free(ape); free((genericptr_t) ape);
return 0; return 0;
} }
ape->pattern = (char *) alloc(strlen(text2) + 1); ape->pattern = (char *) alloc(strlen(text2) + 1);
@@ -4861,14 +4854,15 @@ struct autopickup_exception *whichape;
for (ape = iflags.autopickup_exceptions[chain]; ape;) { for (ape = iflags.autopickup_exceptions[chain]; ape;) {
if (ape == whichape) { if (ape == whichape) {
struct autopickup_exception *freeape = ape; struct autopickup_exception *freeape = ape;
ape = ape->next; ape = ape->next;
if (prev) if (prev)
prev->next = ape; prev->next = ape;
else else
iflags.autopickup_exceptions[chain] = ape; iflags.autopickup_exceptions[chain] = ape;
regex_free(freeape->regex); regex_free(freeape->regex);
free(freeape->pattern); free((genericptr_t) freeape->pattern);
free(freeape); free((genericptr_t) freeape);
} else { } else {
prev = ape; prev = ape;
ape = ape->next; ape = ape->next;
@@ -4907,9 +4901,9 @@ free_autopickup_exceptions()
for (pass = AP_LEAVE; pass <= AP_GRAB; ++pass) { for (pass = AP_LEAVE; pass <= AP_GRAB; ++pass) {
while ((ape = iflags.autopickup_exceptions[pass]) != 0) { while ((ape = iflags.autopickup_exceptions[pass]) != 0) {
regex_free(ape->regex); regex_free(ape->regex);
free(ape->pattern); free((genericptr_t) ape->pattern);
iflags.autopickup_exceptions[pass] = ape->next; iflags.autopickup_exceptions[pass] = ape->next;
free(ape); free((genericptr_t) ape);
} }
} }
} }
@@ -4922,17 +4916,30 @@ int which_set;
{ {
clear_symsetentry(which_set, TRUE); clear_symsetentry(which_set, TRUE);
symset[which_set].name = (char *) alloc(strlen(s) + 1); if (symset[which_set].name)
Strcpy(symset[which_set].name, s); free((genericptr_t) symset[which_set].name);
if (read_sym_file(which_set)) symset[which_set].name = dupstr(s);
if (read_sym_file(which_set)) {
switch_symbols(TRUE); switch_symbols(TRUE);
else { } else {
clear_symsetentry(which_set, TRUE); clear_symsetentry(which_set, TRUE);
return 0; return 0;
} }
return 1; return 1;
} }
void
free_symsets()
{
clear_symsetentry(PRIMARY, TRUE);
clear_symsetentry(ROGUESET, TRUE);
/* symset_list is cleaned up as soon as it's used, so we shouldn't
have to anything about it here */
/* assert( symset_list == NULL ); */
}
/* Parse the value of a SYMBOLS line from a config file */ /* Parse the value of a SYMBOLS line from a config file */
void void
parsesymbols(opts) parsesymbols(opts)
@@ -5104,7 +5111,7 @@ const char *str;
Strcat(buf, ", "); Strcat(buf, ", ");
} else { } else {
putstr(datawin, 0, str); putstr(datawin, 0, str);
free(buf), buf = 0; free((genericptr_t) buf), buf = 0;
} }
return; return;
} }
@@ -5550,9 +5557,8 @@ char *fontname;
} }
if (fn) { if (fn) {
if (*fn) if (*fn)
free(*fn); free((genericptr_t) *fn);
*fn = (char *) alloc(strlen(fontname) + 1); *fn = dupstr(fontname);
Strcpy(*fn, fontname);
} }
return; return;
} }
@@ -5638,15 +5644,13 @@ char *op;
if (!strcmpi(wn, wnames[j]) || !strcmpi(wn, shortnames[j])) { if (!strcmpi(wn, wnames[j]) || !strcmpi(wn, shortnames[j])) {
if (tfg && !strstri(tfg, " ")) { if (tfg && !strstri(tfg, " ")) {
if (*fgp[j]) if (*fgp[j])
free(*fgp[j]); free((genericptr_t) *fgp[j]);
*fgp[j] = (char *) alloc(strlen(tfg) + 1); *fgp[j] = dupstr(tfg);
Strcpy(*fgp[j], tfg);
} }
if (tbg && !strstri(tbg, " ")) { if (tbg && !strstri(tbg, " ")) {
if (*bgp[j]) if (*bgp[j])
free(*bgp[j]); free((genericptr_t) *bgp[j]);
*bgp[j] = (char *) alloc(strlen(tbg) + 1); *bgp[j] = dupstr(tbg);
Strcpy(*bgp[j], tbg);
} }
break; break;
} }
+1 -1
View File
@@ -144,7 +144,7 @@ struct obj *objs;
boolean here; boolean here;
int *menu_on_demand; int *menu_on_demand;
{ {
char ilets[20], inbuf[BUFSZ]; char ilets[30], inbuf[BUFSZ]; /* FIXME: hardcoded ilets[] length */
int iletct, oclassct; int iletct, oclassct;
boolean not_everything; boolean not_everything;
char qbuf[QBUFSZ]; char qbuf[QBUFSZ];
+1 -1
View File
@@ -448,7 +448,7 @@ int psflags;
|| mntmp == urole.femalenum)) { || mntmp == urole.femalenum)) {
const char *pm_name; const char *pm_name;
/* mkclass_ploy() can pick a !polyok() /* mkclass_poly() can pick a !polyok()
candidate; if so, usually try again */ candidate; if so, usually try again */
if (class) { if (class) {
if (rn2(3) || --tryct > 0) if (rn2(3) || --tryct > 0)
+2 -2
View File
@@ -797,7 +797,7 @@ gcrownu()
case A_NEUTRAL: case A_NEUTRAL:
if (class_gift != STRANGE_OBJECT) { if (class_gift != STRANGE_OBJECT) {
; /* already got bonus above */ ; /* already got bonus above */
} else if (in_hand) { } else if (obj && in_hand) {
Your("%s goes snicker-snack!", xname(obj)); Your("%s goes snicker-snack!", xname(obj));
obj->dknown = TRUE; obj->dknown = TRUE;
} else if (!already_exists) { } else if (!already_exists) {
@@ -819,7 +819,7 @@ gcrownu()
Sprintf(swordbuf, "%s sword", hcolor(NH_BLACK)); Sprintf(swordbuf, "%s sword", hcolor(NH_BLACK));
if (class_gift != STRANGE_OBJECT) { if (class_gift != STRANGE_OBJECT) {
; /* already got bonus above */ ; /* already got bonus above */
} else if (in_hand) { } else if (obj && in_hand) {
Your("%s hums ominously!", swordbuf); Your("%s hums ominously!", swordbuf);
obj->dknown = TRUE; obj->dknown = TRUE;
} else if (!already_exists) { } else if (!already_exists) {
+48 -21
View File
@@ -82,38 +82,62 @@ char *buf;
"I survived Yendor Military Boot Camp", "I survived Yendor Military Boot Camp",
"Ludios Accounting School Intra-Mural Lacrosse Team", "Ludios Accounting School Intra-Mural Lacrosse Team",
"Oracle(TM) Fountains 10th Annual Wet T-Shirt Contest", "Oracle(TM) Fountains 10th Annual Wet T-Shirt Contest",
"Hey, black dragon! Disintegrate THIS!", "I'm With Stupid -->", "Hey, black dragon! Disintegrate THIS!",
"Don't blame me, I voted for Izchak!", "Don't Panic", /* HHGTTG */ "I'm With Stupid -->",
"Don't blame me, I voted for Izchak!",
"Don't Panic", /* HHGTTG */
"Furinkan High School Athletic Dept.", /* Ranma 1/2 */ "Furinkan High School Athletic Dept.", /* Ranma 1/2 */
"Hel-LOOO, Nurse!", /* Animaniacs */ "Hel-LOOO, Nurse!", /* Animaniacs */
"=^.^=", "100% goblin hair - do not wash", "Aberzombie and Fitch", "=^.^=",
"100% goblin hair - do not wash",
"Aberzombie and Fitch",
"cK -- Cockatrice touches the Kop", "cK -- Cockatrice touches the Kop",
"Don't ask me, I only adventure here", "Down with pants!", "Don't ask me, I only adventure here",
"d, your dog or a killer?", "FREE PUG AND NEWT!", "Go team ant!", "Down with pants!",
"Got newt?", "Hello, my darlings!", /* Charlie Drake */ "d, your dog or a killer?",
"Hey! Nymphs! Steal This T-Shirt!", "I <3 Dungeon of Doom", "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 <3 Maud",
"I am a Valkyrie. If you see me running, try to keep up.", "I am a Valkyrie. If you see me running, try to keep up.",
"I am not a pack rat - I am a collector", "I am not a pack rat - I am a collector",
"I bounced off a rubber tree", /* Monkey Island */ "I bounced off a rubber tree", /* Monkey Island */
"Plunder Island Brimstone Beach Club", /* Monkey Island */ "Plunder Island Brimstone Beach Club", /* Monkey Island */
"If you can read this, I can hit you with my polearm", "If you can read this, I can hit you with my polearm",
"I'm confused!", "I scored with the princess", "I'm confused!",
"I want to live forever or die in the attempt.", "Lichen Park", "I scored with the princess",
"LOST IN THOUGHT - please send search party", "Meat is Mordor", "I want to live forever or die in the attempt.",
"Minetown Better Business Bureau", "Minetown Watch", "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", "Ms. Palm's House of Negotiable Affection -- A Very Reputable House Of Disrepute",
"Protection Racketeer", "Real men love Crom", "Protection Racketeer",
"Somebody stole my Mojo!", "The Hellhound Gang", "The Werewolves", "Real men love Crom",
"Somebody stole my Mojo!",
"The Hellhound Gang",
"The Werewolves",
"They Might Be Storm Giants", "They Might Be Storm Giants",
"Weapons don't kill people, I kill people", "White Zombie", "Weapons don't kill people, I kill people",
"White Zombie",
"You're killing me!", "You're killing me!",
"Anhur State University - Home of the Fighting Fire Ants!", "Anhur State University - Home of the Fighting Fire Ants!",
"FREE HUGS", "Serial Ascender", "Real men are valkyries", "FREE HUGS",
"Young Men's Cavedigging Association", "Occupy Fort Ludios", "Serial Ascender",
"I couldn't afford this T-shirt so I stole it!", "Mind flayers suck", "Real men are valkyries",
"I'm not wearing any pants", "Down with the living!", "Young Men's Cavedigging Association",
"Pudding farmer", "Vegetarian", "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",
"Hello, I'm War!",
}; };
Strcpy(buf, shirt_msgs[tshirt->o_id % SIZE(shirt_msgs)]); Strcpy(buf, shirt_msgs[tshirt->o_id % SIZE(shirt_msgs)]);
@@ -126,8 +150,11 @@ struct obj *apron;
char *buf; char *buf;
{ {
static const char *apron_msgs[] = { static const char *apron_msgs[] = {
"Kiss the cook", "I'm making SCIENCE!", "Don't mess with the chef", "Kiss the cook",
"Don't make me poison you", "Gehennom's Kitchen", "I'm making SCIENCE!",
"Don't mess with the chef",
"Don't make me poison you",
"Gehennom's Kitchen",
"Rat: The other white meat", "Rat: The other white meat",
"If you can't stand the heat, get out of Gehennom!", "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 we weren't meant to eat animals, why are they made out of meat?",
+3 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 save.c $NHDT-Date: 1446892456 2015/11/07 10:34:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.92 $ */ /* NetHack 3.6 save.c $NHDT-Date: 1447576350 2015/11/15 08:32:30 $ $NHDT-Branch: master $:$NHDT-Revision: 1.94 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1395,7 +1395,8 @@ freedynamicdata()
free_autopickup_exceptions(); free_autopickup_exceptions();
/* miscellaneous */ /* miscellaneous */
free_pickinv_cache(); /* free_pickinv_cache(); -- done from done()... */
free_symsets();
#endif /* FREE_ALL_MEMORY */ #endif /* FREE_ALL_MEMORY */
#ifdef STATUS_VIA_WINDOWPORT #ifdef STATUS_VIA_WINDOWPORT
status_finish(); status_finish();
+27 -11
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1446887534 2015/11/07 09:12:14 $ $NHDT-Branch: master $:$NHDT-Revision: 1.70 $ */ /* NetHack 3.6 sp_lev.c $NHDT-Date: 1447836300 2015/11/18 08:45:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.73 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */ /* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -18,7 +18,7 @@
#pragma warning(disable : 4244) #pragma warning(disable : 4244)
#endif #endif
typedef void (*select_iter_func)(int, int, genericptr_t); typedef void FDECL((*select_iter_func), (int, int, genericptr_t));
extern void FDECL(mkmap, (lev_init *)); extern void FDECL(mkmap, (lev_init *));
@@ -471,6 +471,7 @@ opvar_var_conversion(coder, ov)
struct sp_coder *coder; struct sp_coder *coder;
struct opvar *ov; struct opvar *ov;
{ {
static const char nhFunc[] = "opvar_var_conversion";
struct splev_var *tmp; struct splev_var *tmp;
struct opvar *tmpov; struct opvar *tmpov;
struct opvar *array_idx = NULL; struct opvar *array_idx = NULL;
@@ -483,14 +484,15 @@ struct opvar *ov;
while (tmp) { while (tmp) {
if (!strcmp(tmp->name, OV_s(ov))) { if (!strcmp(tmp->name, OV_s(ov))) {
if ((tmp->svtyp & SPOVAR_ARRAY)) { if ((tmp->svtyp & SPOVAR_ARRAY)) {
array_idx = opvar_var_conversion( array_idx = opvar_var_conversion(coder,
coder, splev_stack_pop(coder->stack)); splev_stack_pop(coder->stack));
if (!array_idx || OV_typ(array_idx) != SPOVAR_INT) if (!array_idx || OV_typ(array_idx) != SPOVAR_INT)
panic("array idx not an int"); panic("array idx not an int");
if (tmp->array_len < 1) if (tmp->array_len < 1)
panic("array len < 1"); panic("array len < 1");
OV_i(array_idx) = (OV_i(array_idx) % tmp->array_len); OV_i(array_idx) = (OV_i(array_idx) % tmp->array_len);
tmpov = opvar_clone(tmp->data.arrayvalues[OV_i(array_idx)]); tmpov = opvar_clone(tmp->data.arrayvalues[OV_i(array_idx)]);
opvar_free(array_idx);
return tmpov; return tmpov;
} else { } else {
tmpov = opvar_clone(tmp->data.value); tmpov = opvar_clone(tmp->data.value);
@@ -525,15 +527,21 @@ splev_stack_getdat(coder, typ)
struct sp_coder *coder; struct sp_coder *coder;
xchar typ; xchar typ;
{ {
static const char nhFunc[] = "splev_stack_getdat";
if (coder && coder->stack) { if (coder && coder->stack) {
struct opvar *tmp = splev_stack_pop(coder->stack); struct opvar *tmp = splev_stack_pop(coder->stack);
struct opvar *ret = NULL;
if (!tmp) if (!tmp)
panic("no value type %i in stack.", typ); panic("no value type %i in stack.", typ);
if (tmp->spovartyp == SPOVAR_VARIABLE) if (tmp->spovartyp == SPOVAR_VARIABLE) {
tmp = opvar_var_conversion(coder, tmp); ret = opvar_var_conversion(coder, tmp);
opvar_free(tmp);
tmp = ret;
}
if (tmp->spovartyp == typ) if (tmp->spovartyp == typ)
return tmp; return tmp;
else opvar_free(tmp);
} }
return NULL; return NULL;
} }
@@ -542,10 +550,14 @@ struct opvar *
splev_stack_getdat_any(coder) splev_stack_getdat_any(coder)
struct sp_coder *coder; struct sp_coder *coder;
{ {
static const char nhFunc[] = "splev_stack_getdat_any";
if (coder && coder->stack) { if (coder && coder->stack) {
struct opvar *tmp = splev_stack_pop(coder->stack); struct opvar *tmp = splev_stack_pop(coder->stack);
if (tmp && tmp->spovartyp == SPOVAR_VARIABLE) if (tmp && tmp->spovartyp == SPOVAR_VARIABLE) {
tmp = opvar_var_conversion(coder, tmp); struct opvar *ret = opvar_var_conversion(coder, tmp);
opvar_free(tmp);
return ret;
}
return tmp; return tmp;
} }
return NULL; return NULL;
@@ -964,6 +976,9 @@ packed_coord pos;
schar try_x, try_y; schar try_x, try_y;
register int trycnt = 0; register int trycnt = 0;
if (!x || !y)
panic("get_free_room_loc: x or y is null");
get_location_coord(&try_x, &try_y, DRY, croom, pos); get_location_coord(&try_x, &try_y, DRY, croom, pos);
if (levl[try_x][try_y].typ != ROOM) { if (levl[try_x][try_y].typ != ROOM) {
do { do {
@@ -4725,9 +4740,9 @@ struct sp_coder *coder;
dy1 = (xchar) SP_REGION_Y1(OV_i(r)); dy1 = (xchar) SP_REGION_Y1(OV_i(r));
dx2 = (xchar) SP_REGION_X2(OV_i(r)); dx2 = (xchar) SP_REGION_X2(OV_i(r));
dy2 = (xchar) SP_REGION_Y2(OV_i(r)); dy2 = (xchar) SP_REGION_Y2(OV_i(r));
wallify_map(dx1 < 0 ? xstart : dx1, dy1 < 0 ? ystart : dy1, wallify_map(dx1 < 0 ? (xstart-1) : dx1, dy1 < 0 ? (ystart-1) : dy1,
dx2 < 0 ? xstart + xsize : dx2, dx2 < 0 ? (xstart + xsize + 1) : dx2,
dy2 < 0 ? ystart + ysize : dy2); dy2 < 0 ? (ystart + ysize + 1) : dy2);
break; break;
case 1: case 1:
if (!OV_pop_typ(r, SPOVAR_SEL)) if (!OV_pop_typ(r, SPOVAR_SEL))
@@ -4736,6 +4751,7 @@ struct sp_coder *coder;
break; break;
} }
opvar_free(r); opvar_free(r);
opvar_free(typ);
} }
void void
+4 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 spell.c $NHDT-Date: 1446854236 2015/11/06 23:57:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.70 $ */ /* NetHack 3.6 spell.c $NHDT-Date: 1447653429 2015/11/16 05:57:09 $ $NHDT-Branch: master $:$NHDT-Revision: 1.72 $ */
/* Copyright (c) M. Stephenson 1988 */ /* Copyright (c) M. Stephenson 1988 */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -469,7 +469,9 @@ register struct obj *spellbook;
if (booktype == SPE_NOVEL) { if (booktype == SPE_NOVEL) {
/* Obtain current Terry Pratchett book title */ /* Obtain current Terry Pratchett book title */
const char *tribtitle = noveltitle(&spellbook->novelidx); const char *tribtitle = noveltitle(&spellbook->novelidx);
if (read_tribute("books", tribtitle, 0, (char *)0, 0)) {
if (read_tribute("books", tribtitle, 0, (char *) 0, 0,
spellbook->o_id)) {
u.uconduct.literate++; u.uconduct.literate++;
check_unpaid(spellbook); check_unpaid(spellbook);
if (!u.uevent.read_tribute) { if (!u.uevent.read_tribute) {
+1
View File
@@ -676,6 +676,7 @@ boolean is_pet; /* If true, pet should keep wielded/worn items */
if (canspotmon(mtmp)) if (canspotmon(mtmp))
pline("%s gold %s.", s_suffix(Monnam(mtmp)), pline("%s gold %s.", s_suffix(Monnam(mtmp)),
canseemon(mtmp) ? "vanishes" : "seems to vanish"); canseemon(mtmp) ? "vanishes" : "seems to vanish");
obj_extract_self(otmp);
obfree(otmp, (struct obj *) 0); obfree(otmp, (struct obj *) 0);
} /* isgd && has gold */ } /* isgd && has gold */
+27 -15
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 sys.c $NHDT-Date: 1432512769 2015/05/25 00:12:49 $ $NHDT-Branch: master $:$NHDT-Revision: 1.33 $ */ /* NetHack 3.6 sys.c $NHDT-Date: 1447118472 2015/11/10 01:21:12 $ $NHDT-Branch: master $:$NHDT-Revision: 1.34 $ */
/* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -6,9 +6,11 @@
#ifndef SYSCF #ifndef SYSCF
/* !SYSCF configurations need '#define DEBUGFILES "foo.c bar.c"' /* !SYSCF configurations need '#define DEBUGFILES "foo.c bar.c"'
to enable debugging feedback for source files foo.c and bar.c; * to enable debugging feedback for source files foo.c and bar.c;
to activate debugpline(), set an appropriate value and uncomment */ * to activate debugpline(), set an appropriate value and uncomment
*/
/* # define DEBUGFILES "*" */ /* # define DEBUGFILES "*" */
/* note: DEBUGFILES value here or in sysconf.DEBUGFILES can be overridden /* note: DEBUGFILES value here or in sysconf.DEBUGFILES can be overridden
at runtime by setting up a value for "DEBUGFILES" in the environment */ at runtime by setting up a value for "DEBUGFILES" in the environment */
#endif #endif
@@ -18,21 +20,21 @@ struct sysopt sysopt;
void void
sys_early_init() sys_early_init()
{ {
sysopt.support = NULL; sysopt.support = (char *) 0;
sysopt.recover = NULL; sysopt.recover = (char *) 0;
#ifdef SYSCF #ifdef SYSCF
sysopt.wizards = NULL; sysopt.wizards = (char *) 0;
#else #else
sysopt.wizards = dupstr(WIZARD_NAME); sysopt.wizards = dupstr(WIZARD_NAME);
#endif #endif
#if defined(SYSCF) || !defined(DEBUGFILES) #if defined(SYSCF) || !defined(DEBUGFILES)
sysopt.debugfiles = NULL; sysopt.debugfiles = (char *) 0;
#else #else
sysopt.debugfiles = dupstr(DEBUGFILES); sysopt.debugfiles = dupstr(DEBUGFILES);
#endif #endif
sysopt.env_dbgfl = 0; /* haven't checked getenv("DEBUGFILES") yet */ sysopt.env_dbgfl = 0; /* haven't checked getenv("DEBUGFILES") yet */
sysopt.shellers = NULL; sysopt.shellers = (char *) 0;
sysopt.explorers = NULL; sysopt.explorers = (char *) 0;
sysopt.maxplayers = 0; /* XXX eventually replace MAX_NR_OF_PLAYERS */ sysopt.maxplayers = 0; /* XXX eventually replace MAX_NR_OF_PLAYERS */
/* record file */ /* record file */
@@ -72,25 +74,31 @@ sys_early_init()
sysopt.check_save_uid = 1; sysopt.check_save_uid = 1;
sysopt.seduce = 1; /* if it's compiled in, default to on */ sysopt.seduce = 1; /* if it's compiled in, default to on */
sysopt_seduce_set(sysopt.seduce); sysopt_seduce_set(sysopt.seduce);
return;
} }
void void
sysopt_release() sysopt_release()
{ {
if (sysopt.support) if (sysopt.support)
free(sysopt.support), sysopt.support = NULL; free(sysopt.support), sysopt.support = (char *) 0;
if (sysopt.recover) if (sysopt.recover)
free(sysopt.recover), sysopt.recover = NULL; free(sysopt.recover), sysopt.recover = (char *) 0;
if (sysopt.wizards) if (sysopt.wizards)
free(sysopt.wizards), sysopt.wizards = NULL; free(sysopt.wizards), sysopt.wizards = (char *) 0;
if (sysopt.explorers)
free(sysopt.explorers), sysopt.explorers = (char *) 0;
if (sysopt.shellers)
free(sysopt.shellers), sysopt.shellers = (char *) 0;
if (sysopt.debugfiles) if (sysopt.debugfiles)
free(sysopt.debugfiles), sysopt.debugfiles = NULL; free(sysopt.debugfiles), sysopt.debugfiles = (char *) 0;
#ifdef PANICTRACE #ifdef PANICTRACE
if (sysopt.gdbpath) if (sysopt.gdbpath)
free(sysopt.gdbpath), sysopt.gdbpath = NULL; free(sysopt.gdbpath), sysopt.gdbpath = (char *) 0;
if (sysopt.greppath) if (sysopt.greppath)
free(sysopt.greppath), sysopt.greppath = NULL; free(sysopt.greppath), sysopt.greppath = (char *) 0;
#endif #endif
return;
} }
extern struct attack sa_yes[NATTK]; extern struct attack sa_yes[NATTK];
@@ -102,8 +110,12 @@ int val;
{ {
struct attack *setval = val ? sa_yes : sa_no; struct attack *setval = val ? sa_yes : sa_no;
int x; int x;
for (x = 0; x < NATTK; x++) { for (x = 0; x < NATTK; x++) {
mons[PM_INCUBUS].mattk[x] = setval[x]; mons[PM_INCUBUS].mattk[x] = setval[x];
mons[PM_SUCCUBUS].mattk[x] = setval[x]; mons[PM_SUCCUBUS].mattk[x] = setval[x];
} }
return;
} }
/*sys.c*/
+3 -1
View File
@@ -490,12 +490,14 @@ int
dotele() dotele()
{ {
struct trap *trap; struct trap *trap;
boolean trap_once = FALSE;
trap = t_at(u.ux, u.uy); trap = t_at(u.ux, u.uy);
if (trap && (!trap->tseen || trap->ttyp != TELEP_TRAP)) if (trap && (!trap->tseen || trap->ttyp != TELEP_TRAP))
trap = 0; trap = 0;
if (trap) { if (trap) {
trap_once = trap->once; /* trap may get deleted, save this */
if (trap->once) { if (trap->once) {
pline("This is a vault teleport, usable once only."); pline("This is a vault teleport, usable once only.");
if (yn("Jump in?") == 'n') if (yn("Jump in?") == 'n')
@@ -569,7 +571,7 @@ dotele()
} }
if (next_to_u()) { if (next_to_u()) {
if (trap && trap->once) if (trap && trap_once)
vault_tele(); vault_tele();
else else
tele(); tele();
+2 -5
View File
@@ -760,10 +760,7 @@ boolean shatter;
otmp = nxtobj(otmp, STATUE, TRUE); otmp = nxtobj(otmp, STATUE, TRUE);
} }
if (Blind) feel_newsym(x, y);
feel_location(x, y);
else
newsym(x, y);
return mtmp; return mtmp;
} }
@@ -3767,7 +3764,7 @@ STATIC_OVL void
move_into_trap(ttmp) move_into_trap(ttmp)
struct trap *ttmp; struct trap *ttmp;
{ {
int bc; int bc = 0;
xchar x = ttmp->tx, y = ttmp->ty, bx, by, cx, cy; xchar x = ttmp->tx, y = ttmp->ty, bx, by, cx, cy;
boolean unused; boolean unused;
+1 -1
View File
@@ -959,7 +959,7 @@ int otyp;
break; break;
} }
while (skills->skill != P_NONE) { while (skills && skills->skill != P_NONE) {
if (skills->skill == this_skill) if (skills->skill == this_skill)
return FALSE; return FALSE;
++skills; ++skills;
+5 -5
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 zap.c $NHDT-Date: 1446887542 2015/11/07 09:12:22 $ $NHDT-Branch: master $:$NHDT-Revision: 1.233 $ */ /* NetHack 3.6 zap.c $NHDT-Date: 1447475947 2015/11/14 04:39:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.235 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -2979,7 +2979,8 @@ STATIC_OVL void
skiprange(range, skipstart, skipend) skiprange(range, skipstart, skipend)
int range, *skipstart, *skipend; int range, *skipstart, *skipend;
{ {
int tmp = range - (rnd(range / 4)); int tr = (range / 4);
int tmp = range - ((tr > 0) ? rnd(tr) : 0);
*skipstart = tmp; *skipstart = tmp;
*skipend = tmp - ((tmp / 4) * rnd(3)); *skipend = tmp - ((tmp / 4) * rnd(3));
if (*skipend >= tmp) if (*skipend >= tmp)
@@ -4461,9 +4462,8 @@ register struct obj *obj; /* no texts here! */
obj->owt = weight(obj); obj->owt = weight(obj);
obj->dknown = obj->bknown = obj->rknown = 0; obj->dknown = obj->bknown = obj->rknown = 0;
obj->known = objects[obj->otyp].oc_uses_known ? 0 : 1; obj->known = objects[obj->otyp].oc_uses_known ? 0 : 1;
if (obj->oextra) dealloc_oextra(obj);
dealloc_oextra(obj->oextra);
obj->oextra = (struct oextra *) 0;
if (obj->where == OBJ_FLOOR) { if (obj->where == OBJ_FLOOR) {
obj_extract_self(obj); /* move rocks back on top */ obj_extract_self(obj); /* move rocks back on top */
place_object(obj, obj->ox, obj->oy); place_object(obj, obj->ox, obj->oy);
+2 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 bemain.c $NHDT-Date: 1432512791 2015/05/25 00:13:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.17 $ */ /* NetHack 3.6 bemain.c $NHDT-Date: 1447844549 2015/11/18 11:02:29 $ $NHDT-Branch: master $:$NHDT-Revision: 1.18 $ */
/* Copyright (c) Dean Luick, 1996. */ /* Copyright (c) Dean Luick, 1996. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -167,7 +167,6 @@ process_options(int argc, char **argv)
case 'D': case 'D':
wizard = TRUE, discover = FALSE; wizard = TRUE, discover = FALSE;
break; break;
/* otherwise fall thru to discover */
case 'X': case 'X':
discover = TRUE, wizard = FALSE; discover = TRUE, wizard = FALSE;
break; break;
@@ -268,6 +267,7 @@ authorize_wizard_mode()
* do anything extra. * do anything extra.
*/ */
void nethack_exit(int status); void nethack_exit(int status);
void void
nethack_exit(int status) nethack_exit(int status)
{ {
+1326 -1066
View File
File diff suppressed because it is too large Load Diff
+1539 -2105
View File
File diff suppressed because it is too large Load Diff
+7 -4
View File
@@ -1,5 +1,5 @@
# NetHack Makefile. # NetHack Makefile.
# NetHack 3.6 Makefile.dat $NHDT-Date: 1432512788 2015/05/25 00:13:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.15 $ # NetHack 3.6 Makefile.dat $NHDT-Date: 1447844574 2015/11/18 11:02:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.18 $
# Root of source tree: # Root of source tree:
NHSROOT=.. NHSROOT=..
@@ -35,12 +35,15 @@ x11tiles: ../util/tile2x11 ../win/share/monsters.txt ../win/share/objects.txt \
../util/tile2x11 ../win/share/monsters.txt ../win/share/objects.txt \ ../util/tile2x11 ../win/share/monsters.txt ../win/share/objects.txt \
../win/share/other.txt ../win/share/other.txt
beostiles: ../util/tile2beos ../win/share/monsters.txt ../win/share/objects.txt \ beostiles: ../util/tile2beos ../win/share/monsters.txt \
../win/share/objects.txt \
../win/share/other.txt ../win/share/other.txt
../util/tile2beos ../win/share/monsters.txt ../win/share/objects.txt \ ../util/tile2beos ../win/share/monsters.txt \
../win/share/objects.txt \
../win/share/other.txt ../win/share/other.txt
nhtiles.bmp: ../util/tile2bmp ../win/share/monsters.txt ../win/share/objects.txt \ nhtiles.bmp: ../util/tile2bmp ../win/share/monsters.txt \
../win/share/objects.txt \
../win/share/other.txt ../win/share/other.txt
../util/tile2bmp $@ ../util/tile2bmp $@
+3 -2
View File
@@ -1,5 +1,5 @@
# NetHack Makefile. # NetHack Makefile.
# NetHack 3.6 Makefile.src $NHDT-Date: 1434446945 2015/06/16 09:29:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.44 $ # NetHack 3.6 Makefile.src $NHDT-Date: 1447313972 2015/11/12 07:39:32 $ $NHDT-Branch: master $:$NHDT-Revision: 1.45 $
# Root of source tree: # Root of source tree:
NHSROOT=.. NHSROOT=..
@@ -750,7 +750,8 @@ dogmove.o: dogmove.c $(HACK_H) ../include/mfndpos.h
dokick.o: dokick.c $(HACK_H) dokick.o: dokick.c $(HACK_H)
dothrow.o: dothrow.c $(HACK_H) dothrow.o: dothrow.c $(HACK_H)
drawing.o: drawing.c $(HACK_H) ../include/tcap.h drawing.o: drawing.c $(HACK_H) ../include/tcap.h
dungeon.o: dungeon.c $(HACK_H) ../include/dgn_file.h ../include/dlb.h dungeon.o: dungeon.c $(HACK_H) ../include/dgn_file.h ../include/dlb.h \
../include/lev.h
eat.o: eat.c $(HACK_H) eat.o: eat.c $(HACK_H)
end.o: end.c $(HACK_H) ../include/lev.h ../include/dlb.h end.o: end.c $(HACK_H) ../include/lev.h ../include/dlb.h
engrave.o: engrave.c $(HACK_H) ../include/lev.h engrave.o: engrave.c $(HACK_H) ../include/lev.h
+4 -4
View File
@@ -1,5 +1,5 @@
# NetHack Makefile. # NetHack Makefile.
# NetHack 3.6 Makefile.top $NHDT-Date: 1432512789 2015/05/25 00:13:09 $ $NHDT-Branch: master $:$NHDT-Revision: 1.29 $ # NetHack 3.6 Makefile.top $NHDT-Date: 1447844578 2015/11/18 11:02:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.32 $
# Root of source tree: # Root of source tree:
NHSROOT=. NHSROOT=.
@@ -46,14 +46,14 @@ DIRPERM = 0755
# per discussion in Install.X11 and Install.Qt # per discussion in Install.X11 and Install.Qt
#VARDATND = #VARDATND =
# VARDATND = x11tiles NetHack.ad pet_mark.xbm # VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xpm
# VARDATND = x11tiles NetHack.ad pet_mark.xbm rip.xpm # VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xpm rip.xpm
# for Atari/Gem # for Atari/Gem
# VARDATND = nh16.img title.img GEM_RSC.RSC rip.img # VARDATND = nh16.img title.img GEM_RSC.RSC rip.img
# for BeOS # for BeOS
# VARDATND = beostiles # VARDATND = beostiles
# for Gnome # for Gnome
# VARDATND = x11tiles pet_mark.xbm rip.xpm mapbg.xpm # VARDATND = x11tiles pet_mark.xbm pilemark.xpm rip.xpm mapbg.xpm
VARDATD = bogusmon data engrave epitaph oracles options quest.dat rumors VARDATD = bogusmon data engrave epitaph oracles options quest.dat rumors
VARDAT = $(VARDATD) $(VARDATND) VARDAT = $(VARDATD) $(VARDATND)
+9 -7
View File
@@ -1,5 +1,5 @@
# Makefile for NetHack's utility programs. # Makefile for NetHack's utility programs.
# NetHack 3.6 Makefile.utl $NHDT-Date: 1432512789 2015/05/25 00:13:09 $ $NHDT-Branch: master $:$NHDT-Revision: 1.22 $ # NetHack 3.6 Makefile.utl $NHDT-Date: 1447844579 2015/11/18 11:02:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $
# Root of source tree: # Root of source tree:
NHSROOT=.. NHSROOT=..
@@ -256,7 +256,7 @@ dgn_yacc.o: dgn_yacc.c $(CONFIG_H) ../include/dgn_file.h ../include/date.h
dgn_main.o: dgn_main.c $(CONFIG_H) ../include/dlb.h dgn_main.o: dgn_main.c $(CONFIG_H) ../include/dlb.h
# see dgn_comp.l for WEIRD_LEX discussion # see dgn_comp.l for WEIRD_LEX discussion
dgn_lex.o: dgn_lex.c $(CONFIG.H) ../include/dgn_comp.h ../include/dgn_file.h dgn_lex.o: dgn_lex.c $(CONFIG_H) ../include/dgn_comp.h ../include/dgn_file.h
@echo $(CC) -c $(CFLAGS) dgn_lex.c @echo $(CC) -c $(CFLAGS) dgn_lex.c
@$(CC) -c $(CFLAGS) -DWEIRD_LEX=`egrep -c _cplusplus dgn_lex.c` dgn_lex.c @$(CC) -c $(CFLAGS) -DWEIRD_LEX=`egrep -c _cplusplus dgn_lex.c` dgn_lex.c
@@ -373,6 +373,11 @@ bitmfile.o: ../win/gem/bitmfile.c ../include/bitmfile.h
tile2beos.o: ../win/BeOS/tile2beos.cpp $(HACK_H) ../include/tile.h tile2beos.o: ../win/BeOS/tile2beos.cpp $(HACK_H) ../include/tile.h
$(CXX) $(CFLAGS) -c ../win/BeOS/tile2beos.cpp $(CXX) $(CFLAGS) -c ../win/BeOS/tile2beos.cpp
tileedit: tileedit.cpp $(TEXT_IO)
$(QTDIR)/bin/moc -o tileedit.moc tileedit.h
$(CC) -o tileedit -I../include -I$(QTDIR)/include -L$(QTDIR)/lib \
tileedit.cpp $(TEXT_IO) -lqt
# using dependencies like # using dependencies like
# ../src/foo:: # ../src/foo::
# @( cd ../src ; $(MAKE) foo ) # @( cd ../src ; $(MAKE) foo )
@@ -416,8 +421,5 @@ spotless: clean
-rm -f ../include/lev_comp.h ../include/dgn_comp.h -rm -f ../include/lev_comp.h ../include/dgn_comp.h
-rm -f ../include/tile.h tiletxt.c -rm -f ../include/tile.h tiletxt.c
-rm -f makedefs lev_comp dgn_comp recover dlb -rm -f makedefs lev_comp dgn_comp recover dlb
-rm -f gif2txt txt2ppm tile2x11 tile2img.ttp xpm2img.ttp tilemap -rm -f gif2txt txt2ppm tile2x11 tile2img.ttp xpm2img.ttp \
tilemap tileedit
tileedit: tileedit.cpp $(TEXT_IO)
$(QTDIR)/bin/moc -o tileedit.moc tileedit.h
$(CC) -o tileedit -I../include -I$(QTDIR)/include -L$(QTDIR)/lib tileedit.cpp $(TEXT_IO) -lqt
+1 -1
View File
@@ -1,5 +1,5 @@
# #
# NetHack 3.6 macosx $NHDT-Date: 1432512814 2015/05/25 00:13:34 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ # NetHack 3.6 macosx $NHDT-Date: 1447844580 2015/11/18 11:03:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.18 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
# NetHack may be freely redistributed. See license for details. # NetHack may be freely redistributed. See license for details.
# #
+1 -1
View File
@@ -1,5 +1,5 @@
# #
# NetHack 3.6 macosx10.5 $NHDT-Date: 1432512814 2015/05/25 00:13:34 $ $NHDT-Branch: master $:$NHDT-Revision: 1.21 $ # NetHack 3.6 macosx10.5 $NHDT-Date: 1447844587 2015/11/18 11:03:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.27 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009. # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009.
# NetHack may be freely redistributed. See license for details. # NetHack may be freely redistributed. See license for details.
# #
+1 -1
View File
@@ -1,5 +1,5 @@
# #
# NetHack 3.6 macosx10.7 $NHDT-Date: 1432512814 2015/05/25 00:13:34 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ # NetHack 3.6 macosx10.7 $NHDT-Date: 1447844589 2015/11/18 11:03:09 $ $NHDT-Branch: master $:$NHDT-Revision: 1.31 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009. # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2009.
# NetHack may be freely redistributed. See license for details. # NetHack may be freely redistributed. See license for details.
# #
+13 -16
View File
@@ -5,18 +5,10 @@
0. Please read this entire file before trying to build or install 0. Please read this entire file before trying to build or install
NetHack, then read it again! NetHack, then read it again!
1. Building NetHack requires a C compiler (either Compaq C, DEC C, 1. Build testing was done using a recent version of HP C (aka Compaq C
VAX C, or GNU C) and VMS version V4.6 or later (but see note #9). aka--and more widely known as--DEC C). Older versions of DEC C will
This release has been tested with Compaq C V6.4 on Alpha/VMS V7.3-1 probably work too. Ancient VAX C probably will not. The set of
and with VAX C V3.2 and GNU C 2.7.1 on VAX/VMS V5.5-2. The build Makefiles are known to be out of date; use vmsbuild.com instead.
procedure (vmsbuild.com) should not need to be modified; it accepts
an option for selecting the compiler, and it can detect different
versions which might require specific command qualifiers. Versions
of VAXC earlier than V2.3 will produce many warning messages (about
200 per source file; over to 25,000 total!), but NetHack has been
verified to compile, link, and execute correctly when built with VAXC
V2.2 using vmsbuild.com. There is also a set of Makefiles suitable for
use with MMS or MMK; they may or may not work with other make utilities.
2. Make sure all the NetHack files are in the appropriate directory 2. Make sure all the NetHack files are in the appropriate directory
structure. You should set up a directory--referred to as "top" below structure. You should set up a directory--referred to as "top" below
@@ -43,6 +35,7 @@
[.sys .os2] -- OS/2 [.sys .os2] -- OS/2
[.sys .share .sounds] -- AIFF format audio files [.sys .share .sounds] -- AIFF format audio files
[.sys .unix] -- guess :-) [.sys .unix] -- guess :-)
[.sys .unit .hints] -- configuration data for setup.sh
[.sys .wince] -- Windows CE [.sys .wince] -- Windows CE
[.sys .wince .ceinc] -- more WinCE [.sys .wince .ceinc] -- more WinCE
[.sys .wince .ceinc .sys] -- ditto [.sys .wince .ceinc .sys] -- ditto
@@ -136,10 +129,11 @@
Notes: Notes:
0. Versions 3.5.0 was never publicly released.
1. Save files and bones files from 3.4.x and earlier versions 1. Save files and bones files from 3.4.x and earlier versions
will not work with 3.5.0. The scoreboard file (RECORD) from will not work with 3.6.0. The scoreboard file (RECORD) from
3.4.x or 3.3.x will work; one from version 3.2.x is a slightly different 3.4.x or 3.3.x will work.
format but should be compatible.
2. To specify user-preference options in your environment, define the 2. To specify user-preference options in your environment, define the
logical name NETHACKOPTIONS to have the value of a quoted string logical name NETHACKOPTIONS to have the value of a quoted string
@@ -174,7 +168,9 @@ Notes:
placed in the playground directory by install.com. Also, an example placed in the playground directory by install.com. Also, an example
configuration file can be found in [.win.X11]nethack.rc.) configuration file can be found in [.win.X11]nethack.rc.)
3. Instead of using vmsbuild.com to compile and link everything, you can 3. [As mentioned above, the set of Makefiles is out of date so disregard
this note....]
Instead of using vmsbuild.com to compile and link everything, you can
use the set of Makefiles found in the vms subdirectory, provided you use the set of Makefiles found in the vms subdirectory, provided you
have an appropriate and compatible make utility. They've been tested have an appropriate and compatible make utility. They've been tested
using MMK, a freeware clone of Digital's MMS. There are five of them, using MMK, a freeware clone of Digital's MMS. There are five of them,
@@ -477,3 +473,4 @@ Notes:
and the C compiler used. and the C compiler used.
20-OCT-2003 20-OCT-2003
minimally updated 9-NOV-2015...
+2 -2
View File
@@ -1,5 +1,5 @@
# NetHack Makefile (VMS) - for building nethack itself. # NetHack Makefile (VMS) - for building nethack itself.
# NetHack 3.6 Makefile.src $NHDT-Date: 1432512790 2015/05/25 00:13:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.26 $ # NetHack 3.6 Makefile.src $NHDT-Date: 1447314365 2015/11/12 07:46:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.27 $
# Copy this file to [.src]Makefile. and then edit it as needed. # Copy this file to [.src]Makefile. and then edit it as needed.
# The default configuration is for building with DEC C (aka Compaq C). # The default configuration is for building with DEC C (aka Compaq C).
@@ -392,7 +392,7 @@ dogmove.obj : dogmove.c $(HACK_H) $(INC)mfndpos.h
dokick.obj : dokick.c $(HACK_H) dokick.obj : dokick.c $(HACK_H)
dothrow.obj : dothrow.c $(HACK_H) dothrow.obj : dothrow.c $(HACK_H)
drawing.obj : drawing.c $(HACK_H) $(INC)tcap.h drawing.obj : drawing.c $(HACK_H) $(INC)tcap.h
dungeon.obj : dungeon.c $(HACK_H) $(INC)dgn_file.h $(INC)dlb.h dungeon.obj : dungeon.c $(HACK_H) $(INC)dgn_file.h $(INC)dlb.h $(INC)lev.h
eat.obj : eat.c $(HACK_H) eat.obj : eat.c $(HACK_H)
end.obj : end.c $(HACK_H) $(INC)lev.h $(INC)dlb.h end.obj : end.c $(HACK_H) $(INC)lev.h $(INC)dlb.h
engrave.obj : engrave.c $(HACK_H) $(INC)lev.h engrave.obj : engrave.c $(HACK_H) $(INC)lev.h
+1 -1
View File
@@ -3,7 +3,7 @@
============================================================== ==============================================================
Instructions for compiling and installing Instructions for compiling and installing
NetHack 3.6 on a Windows system NetHack 3.6 on a Windows system
(Windows 7/8.x or later only. XP may work but is untested) (Windows 7/8.x/10 or later only. XP may work but is untested)
============================================================== ==============================================================
Last revision: $NHDT-Date: 1434806470 2015/06/20 13:21:10 $ Last revision: $NHDT-Date: 1434806470 2015/06/20 13:21:10 $
+3
View File
@@ -17,3 +17,6 @@ gif2txt
txt2ppm txt2ppm
tile2img.ttp tile2img.ttp
xpm2ppm.ttp xpm2ppm.ttp
# dev tool for analyzing data collected by nethack's #define MONITOR_HEAP
heaputil
heaputil.c
+23 -18
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 makedefs.c $NHDT-Date: 1434151372 2015/06/12 23:22:52 $ $NHDT-Branch: master $:$NHDT-Revision: 1.103 $ */ /* NetHack 3.6 makedefs.c $NHDT-Date: 1447062431 2015/11/09 09:47:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.105 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* Copyright (c) M. Stephenson, 1990, 1991. */ /* Copyright (c) M. Stephenson, 1990, 1991. */
/* Copyright (c) Dean Luick, 1990. */ /* Copyright (c) Dean Luick, 1990. */
@@ -7,6 +7,9 @@
#define MAKEDEFS_C /* use to conditionally include file sections */ #define MAKEDEFS_C /* use to conditionally include file sections */
#include "config.h" #include "config.h"
#ifdef MONITOR_HEAP
#undef free /* makedefs doesn't use the alloc and free in src/alloc.c */
#endif
#include "permonst.h" #include "permonst.h"
#include "objclass.h" #include "objclass.h"
#include "monsym.h" #include "monsym.h"
@@ -891,6 +894,7 @@ unsigned long old_rumor_offset;
we ameliorate the latter by padding the shortest lines, we ameliorate the latter by padding the shortest lines,
increasing the chance of the random seek landing in them */ increasing the chance of the random seek landing in them */
int len = (int) strlen(line); int len = (int) strlen(line);
if (len <= PAD_RUMORS_TO) { if (len <= PAD_RUMORS_TO) {
char *base = index(line, '\n'); char *base = index(line, '\n');
/* this is only safe because fgetline() overallocates */ /* this is only safe because fgetline() overallocates */
@@ -1985,7 +1989,7 @@ register struct permonst *ptr;
return TRUE; return TRUE;
} }
return (FALSE); return FALSE;
} }
/* This routine is designed to return an integer value which represents /* This routine is designed to return an integer value which represents
@@ -2035,9 +2039,8 @@ struct permonst *ptr;
n += ((int) (ptr->mattk[i].damd * ptr->mattk[i].damn) > 23); n += ((int) (ptr->mattk[i].damd * ptr->mattk[i].damn) > 23);
} }
/* Leprechauns are special cases. They have many hit dice so they /* Leprechauns are special cases. They have many hit dice so they can
can hit and are hard to kill, but they don't really do much hit and are hard to kill, but they don't really do much damage. */
damage. */
if (!strcmp(ptr->mname, "leprechaun")) if (!strcmp(ptr->mname, "leprechaun"))
n -= 2; n -= 2;
@@ -2049,7 +2052,7 @@ struct permonst *ptr;
else else
tmp += (n / 3 + 1); tmp += (n / 3 + 1);
return ((tmp >= 0) ? tmp : 0); return (tmp >= 0) ? tmp : 0;
} }
void void
@@ -2151,15 +2154,15 @@ qt_comment(s)
char *s; char *s;
{ {
if (s[0] == '#') if (s[0] == '#')
return (TRUE); return TRUE;
return ((boolean)(!in_msg && strlen(s) == NO_MSG)); return (boolean) (!in_msg && strlen(s) == NO_MSG);
} }
static boolean static boolean
qt_control(s) qt_control(s)
char *s; char *s;
{ {
return ((boolean)(s[0] == '%' && (s[1] == 'C' || s[1] == 'E'))); return (boolean) (s[0] == '%' && (s[1] == 'C' || s[1] == 'E'));
} }
static int static int
@@ -2170,9 +2173,9 @@ char *code;
for (i = 0; i < qt_hdr.n_hdr; i++) for (i = 0; i < qt_hdr.n_hdr; i++)
if (!strncmp(code, qt_hdr.id[i], LEN_HDR)) if (!strncmp(code, qt_hdr.id[i], LEN_HDR))
return (++i); return ++i;
return (0); return 0;
} }
static boolean static boolean
@@ -2181,13 +2184,13 @@ char *code;
{ {
if (qt_hdr.n_hdr >= N_HDR) { if (qt_hdr.n_hdr >= N_HDR) {
Fprintf(stderr, OUT_OF_HEADERS, qt_line); Fprintf(stderr, OUT_OF_HEADERS, qt_line);
return (FALSE); return FALSE;
} }
strncpy(&qt_hdr.id[qt_hdr.n_hdr][0], code, LEN_HDR); strncpy(&qt_hdr.id[qt_hdr.n_hdr][0], code, LEN_HDR);
msg_hdr[qt_hdr.n_hdr].n_msg = 0; msg_hdr[qt_hdr.n_hdr].n_msg = 0;
qt_hdr.offset[qt_hdr.n_hdr++] = 0L; qt_hdr.offset[qt_hdr.n_hdr++] = 0L;
return (TRUE); return TRUE;
} }
static boolean static boolean
@@ -2198,9 +2201,9 @@ int num, id;
for (i = 0; i < msg_hdr[num].n_msg; i++) for (i = 0; i < msg_hdr[num].n_msg; i++)
if (msg_hdr[num].qt_msg[i].msgnum == id) if (msg_hdr[num].qt_msg[i].msgnum == id)
return (TRUE); return TRUE;
return (FALSE); return FALSE;
} }
static void static void
@@ -2392,10 +2395,12 @@ put_qt_hdrs()
sizeof(struct qtmsg), msg_hdr[i].n_msg, ofp); sizeof(struct qtmsg), msg_hdr[i].n_msg, ofp);
if (debug) { if (debug) {
int j; int j;
for (j = 0; j < msg_hdr[i].n_msg; j++) { for (j = 0; j < msg_hdr[i].n_msg; j++) {
Fprintf( Fprintf(stderr, "msg %d @ %ld (%ld)",
stderr, "msg %d @ %ld (%ld)", msg_hdr[i].qt_msg[j].msgnum, msg_hdr[i].qt_msg[j].msgnum,
msg_hdr[i].qt_msg[j].offset, msg_hdr[i].qt_msg[j].size); msg_hdr[i].qt_msg[j].offset,
msg_hdr[i].qt_msg[j].size);
if (msg_hdr[i].qt_msg[j].summary_size) if (msg_hdr[i].qt_msg[j].summary_size)
Fprintf(stderr, " [%ld]", Fprintf(stderr, " [%ld]",
msg_hdr[i].qt_msg[j].summary_size); msg_hdr[i].qt_msg[j].summary_size);
+56 -47
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 winmap.c $NHDT-Date: 1435002689 2015/06/22 19:51:29 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */ /* NetHack 3.6 winmap.c $NHDT-Date: 1447844616 2015/11/18 11:03:36 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ */
/* Copyright (c) Dean Luick, 1992 */ /* Copyright (c) Dean Luick, 1992 */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -58,8 +58,8 @@ extern int total_tiles_used;
static boolean FDECL(init_tiles, (struct xwindow *)); static boolean FDECL(init_tiles, (struct xwindow *));
static void FDECL(set_button_values, (Widget, int, int, unsigned)); static void FDECL(set_button_values, (Widget, int, int, unsigned));
static void FDECL(map_check_size_change, (struct xwindow *)); static void FDECL(map_check_size_change, (struct xwindow *));
static void FDECL(map_update, static void FDECL(map_update, (struct xwindow *, int, int, int, int,
(struct xwindow *, int, int, int, int, BOOLEAN_P)); BOOLEAN_P));
static void FDECL(init_text, (struct xwindow *)); static void FDECL(init_text, (struct xwindow *));
static void FDECL(map_exposed, (Widget, XtPointer, XtPointer)); static void FDECL(map_exposed, (Widget, XtPointer, XtPointer));
static void FDECL(set_gc, (Widget, Font, const char *, Pixel, GC *, GC *)); static void FDECL(set_gc, (Widget, Font, const char *, Pixel, GC *, GC *));
@@ -67,14 +67,14 @@ static void FDECL(get_text_gc, (struct xwindow *, Font));
static void FDECL(get_char_info, (struct xwindow *)); static void FDECL(get_char_info, (struct xwindow *));
static void FDECL(display_cursor, (struct xwindow *)); static void FDECL(display_cursor, (struct xwindow *));
/* Global functions ======================================================== /* Global functions ======================================================= */
*/
void void
X11_print_glyph(window, x, y, glyph, bkglyph) X11_print_glyph(window, x, y, glyph, bkglyph)
winid window; winid window;
xchar x, y; xchar x, y;
int glyph, bkglyph; int glyph;
int bkglyph UNUSED;
{ {
struct map_info_t *map_info; struct map_info_t *map_info;
boolean update_bbox = FALSE; boolean update_bbox = FALSE;
@@ -104,6 +104,7 @@ int glyph, bkglyph;
#ifdef TEXTCOLOR #ifdef TEXTCOLOR
register unsigned char *co_ptr; register unsigned char *co_ptr;
#endif #endif
/* map glyph to character and color */ /* map glyph to character and color */
(void) mapglyph(glyph, &och, &color, &special, x, y); (void) mapglyph(glyph, &och, &color, &special, x, y);
ch = (uchar) och; ch = (uchar) och;
@@ -156,8 +157,7 @@ int x, y;
} }
#endif /* CLIPPING */ #endif /* CLIPPING */
/* End global functions ==================================================== /* End global functions =================================================== */
*/
#include "tile2x11.h" #include "tile2x11.h"
@@ -199,6 +199,7 @@ Pixel colorpixel;
&annotation->bitmap, &annotation->hotx, &annotation->bitmap, &annotation->hotx,
&annotation->hoty)) { &annotation->hoty)) {
char buf[BUFSZ]; char buf[BUFSZ];
Sprintf(buf, "Failed to load %s", filename); Sprintf(buf, "Failed to load %s", filename);
X11_raw_print(buf); X11_raw_print(buf);
} }
@@ -327,8 +328,7 @@ struct xwindow *wp;
/* assume a fixed number of tiles per row */ /* assume a fixed number of tiles per row */
if (tile_image->width % TILES_PER_ROW != 0 if (tile_image->width % TILES_PER_ROW != 0
|| tile_image->width <= TILES_PER_ROW) { || tile_image->width <= TILES_PER_ROW) {
Sprintf( Sprintf(buf,
buf,
"%s is not a multiple of %d (number of tiles/row) pixels wide", "%s is not a multiple of %d (number of tiles/row) pixels wide",
appResources.tile_file, TILES_PER_ROW); appResources.tile_file, TILES_PER_ROW);
X11_raw_print(buf); X11_raw_print(buf);
@@ -348,7 +348,7 @@ struct xwindow *wp;
} }
tile_width = image_width / TILES_PER_ROW; tile_width = image_width / TILES_PER_ROW;
tile_height = image_height / (tile_count / TILES_PER_ROW); tile_height = image_height / (tile_count / TILES_PER_ROW);
#else #else /* !USE_XPM */
/* any less than 16 colours makes tiles useless */ /* any less than 16 colours makes tiles useless */
ddepth = DefaultDepthOfScreen(screen); ddepth = DefaultDepthOfScreen(screen);
if (ddepth < 4) { if (ddepth < 4) {
@@ -377,11 +377,11 @@ struct xwindow *wp;
result = FALSE; result = FALSE;
goto tiledone; goto tiledone;
} }
#ifdef VERBOSE #ifdef VERBOSE
fprintf(stderr, "X11 tile file:\n version %ld\n ncolors %ld\n " fprintf(stderr, "\
"tile width %ld\n tile height %ld\n per row %ld\n " X11 tile file:\n version %ld\n ncolors %ld\n \
" ntiles %ld\n", tile width %ld\n tile height %ld\n per row %ld\n \
ntiles %ld\n",
header.version, header.ncolors, header.tile_width, header.version, header.ncolors, header.tile_width,
header.tile_height, header.per_row, header.ntiles); header.tile_height, header.per_row, header.ntiles);
#endif #endif
@@ -458,11 +458,11 @@ struct xwindow *wp;
else else
bitmap_pad = 8; bitmap_pad = 8;
tile_image = tile_image = XCreateImage(dpy, DefaultVisualOfScreen(screen),
XCreateImage(dpy, DefaultVisualOfScreen(screen), ddepth, /* depth */ ddepth, /* depth */
ZPixmap, /* format */ ZPixmap, /* format */
0, /* offset */ 0, /* offset */
0, /* data */ (char *) 0, /* data */
image_width, /* width */ image_width, /* width */
image_height, /* height */ image_height, /* height */
bitmap_pad, /* bit pad */ bitmap_pad, /* bit pad */
@@ -499,7 +499,7 @@ struct xwindow *wp;
for (x = 0; x < (int) image_width; x++, tb++) for (x = 0; x < (int) image_width; x++, tb++)
XPutPixel(tile_image, x, y, colors[*tb].pixel); XPutPixel(tile_image, x, y, colors[*tb].pixel);
} }
#endif /* USE_XPM */ #endif /* ?USE_XPM */
/* fake an inverted tile by drawing a border around the edges */ /* fake an inverted tile by drawing a border around the edges */
#ifdef USE_WHITE #ifdef USE_WHITE
@@ -872,7 +872,7 @@ struct xwindow *wp;
/* changed map display mode, re-display the full map */ /* changed map display mode, re-display the full map */
(void) memset((genericptr_t) map_info->t_start, (char) 0, (void) memset((genericptr_t) map_info->t_start, (char) 0,
sizeof(map_info->t_start)); sizeof(map_info->t_start));
(void) memset((genericptr_t) map_info->t_stop, (char) COLNO - 1, (void) memset((genericptr_t) map_info->t_stop, (char) (COLNO - 1),
sizeof(map_info->t_stop)); sizeof(map_info->t_stop));
map_info->is_tile = iflags.wc_tiled_map && !Is_rogue_level(&u.uz); map_info->is_tile = iflags.wc_tiled_map && !Is_rogue_level(&u.uz);
XClearWindow(XtDisplay(wp->w), XtWindow(wp->w)); XClearWindow(XtDisplay(wp->w), XtWindow(wp->w));
@@ -912,8 +912,7 @@ map_all_stone(map_info)
struct map_info_t *map_info; struct map_info_t *map_info;
{ {
int x, y; int x, y;
unsigned short *sp, stone; unsigned short stone = cmap_to_glyph(S_stone);
stone = cmap_to_glyph(S_stone);
for (x = 0; x < COLNO; x++) for (x = 0; x < COLNO; x++)
for (y = 0; y < ROWNO; y++) { for (y = 0; y < ROWNO; y++) {
@@ -1122,8 +1121,8 @@ unsigned int button;
click_y = y / map_info->text_map.square_height; click_y = y / map_info->text_map.square_height;
} }
/* The values can be out of range if the map window has been resized */ /* The values can be out of range if the map window has been resized
/* to be larger than the max size. */ to be larger than the max size. */
if (click_x >= COLNO) if (click_x >= COLNO)
click_x = COLNO - 1; click_x = COLNO - 1;
if (click_y >= ROWNO) if (click_y >= ROWNO)
@@ -1202,8 +1201,8 @@ XtPointer widget_data; /* expose event from Window widget */
t_width, start_row, stop_row, start_col, stop_col); t_width, start_row, stop_row, start_col, stop_col);
#endif #endif
/* Out of range values are possible if the map window is resized to be */ /* Out of range values are possible if the map window is resized to be
/* bigger than the largest expected value. */ bigger than the largest expected value. */
if (stop_row >= ROWNO) if (stop_row >= ROWNO)
stop_row = ROWNO - 1; stop_row = ROWNO - 1;
if (stop_col >= COLNO) if (stop_col >= COLNO)
@@ -1294,8 +1293,9 @@ boolean inverted;
XSetClipMask(dpy, tile_map->black_gc, XSetClipMask(dpy, tile_map->black_gc,
pile_annotation.bitmap); pile_annotation.bitmap);
XCopyPlane(dpy, pile_annotation.bitmap, XtWindow(wp->w), XCopyPlane(dpy, pile_annotation.bitmap, XtWindow(wp->w),
tile_map->black_gc, 0, 0, pile_annotation.width, tile_map->black_gc, 0, 0,
pile_annotation.height, dest_x, dest_y, 1); pile_annotation.width, pile_annotation.height,
dest_x, dest_y, 1);
XSetClipOrigin(dpy, tile_map->black_gc, 0, 0); XSetClipOrigin(dpy, tile_map->black_gc, 0, 0);
XSetClipMask(dpy, tile_map->black_gc, None); XSetClipMask(dpy, tile_map->black_gc, None);
XSetForeground(dpy, tile_map->black_gc, XSetForeground(dpy, tile_map->black_gc,
@@ -1305,11 +1305,11 @@ boolean inverted;
} }
if (inverted) { if (inverted) {
XDrawRectangle( XDrawRectangle(XtDisplay(wp->w), XtWindow(wp->w),
XtDisplay(wp->w), XtWindow(wp->w),
#ifdef USE_WHITE #ifdef USE_WHITE
/* kludge for white square... */ /* kludge for white square... */
tile_map->glyphs[start_row][start_col].glyph == cmap_to_glyph(S_ice) (tile_map->glyphs[start_row][start_col].glyph
== cmap_to_glyph(S_ice))
? tile_map->black_gc ? tile_map->black_gc
: tile_map->white_gc, : tile_map->white_gc,
#else #else
@@ -1317,7 +1317,8 @@ boolean inverted;
#endif #endif
start_col * tile_map->square_width, start_col * tile_map->square_width,
start_row * tile_map->square_height, start_row * tile_map->square_height,
tile_map->square_width - 1, tile_map->square_height - 1); tile_map->square_width - 1,
tile_map->square_height - 1);
} }
} else { } else {
struct text_map_info_t *text_map = &map_info->text_map; struct text_map_info_t *text_map = &map_info->text_map;
@@ -1366,20 +1367,22 @@ boolean inverted;
{ {
int win_row, win_xstart; int win_row, win_xstart;
/* We always start at the same x window position and have */ /* We always start at the same x window position and have
/* the same character count. */ the same character count. */
win_xstart = text_map->square_lbearing win_xstart = text_map->square_lbearing
+ (win_start_col * text_map->square_width); + (win_start_col * text_map->square_width);
count = stop_col - start_col + 1; count = stop_col - start_col + 1;
for (row = start_row, win_row = win_start_row; row <= stop_row; for (row = start_row, win_row = win_start_row; row <= stop_row;
row++, win_row++) { row++, win_row++) {
XDrawImageString( XDrawImageString(XtDisplay(wp->w), XtWindow(wp->w),
XtDisplay(wp->w), XtWindow(wp->w), inverted ? text_map->inv_copy_gc
inverted ? text_map->inv_copy_gc : text_map->copy_gc, : text_map->copy_gc,
win_xstart, text_map->square_ascent win_xstart,
text_map->square_ascent
+ (win_row * text_map->square_height), + (win_row * text_map->square_height),
(char *) &(text_map->text[row][start_col]), count); (char *) &(text_map->text[row][start_col]),
count);
} }
} }
} }
@@ -1463,8 +1466,9 @@ Widget parent;
XtSetArg(args[num_args], XtNinput, False); XtSetArg(args[num_args], XtNinput, False);
num_args++; num_args++;
wp->popup = parent = XtCreatePopupShell( wp->popup = parent = XtCreatePopupShell("nethack",
"nethack", topLevelShellWidgetClass, toplevel, args, num_args); topLevelShellWidgetClass,
toplevel, args, num_args);
/* /*
* If we're here, then this is an auxiliary map window. If we're * If we're here, then this is an auxiliary map window. If we're
* cancelled via a delete window message, we should just pop down. * cancelled via a delete window message, we should just pop down.
@@ -1476,15 +1480,17 @@ Widget parent;
num_args++; num_args++;
XtSetArg(args[num_args], XtNallowVert, True); XtSetArg(args[num_args], XtNallowVert, True);
num_args++; num_args++;
/* XtSetArg(args[num_args], XtNforceBars, True); num_args++; */ #if 0
XtSetArg(args[num_args], XtNforceBars, True);
num_args++;
#endif
XtSetArg(args[num_args], XtNuseBottom, True); XtSetArg(args[num_args], XtNuseBottom, True);
num_args++; num_args++;
XtSetArg(args[num_args], XtNtranslations, XtSetArg(args[num_args], XtNtranslations,
XtParseTranslationTable(map_translations)); XtParseTranslationTable(map_translations));
num_args++; num_args++;
viewport = XtCreateManagedWidget( viewport = XtCreateManagedWidget("map_viewport", /* name */
"map_viewport", /* name */ viewportWidgetClass, /* from Window.h */
viewportWidgetClass, /* widget class from Window.h */
parent, /* parent widget */ parent, /* parent widget */
args, /* set some values */ args, /* set some values */
num_args); /* number of values to set */ num_args); /* number of values to set */
@@ -1607,13 +1613,15 @@ struct xwindow *wp;
} }
boolean exit_x_event; /* exit condition for the event loop */ boolean exit_x_event; /* exit condition for the event loop */
/*******
#if 0 /*******/
void
pkey(k) pkey(k)
int k; int k;
{ {
printf("key = '%s%c'\n", (k < 32) ? "^" : "", (k < 32) ? '@' + k : k); printf("key = '%s%c'\n", (k < 32) ? "^" : "", (k < 32) ? '@' + k : k);
} }
******/ #endif /***0***/
/* /*
* Main X event loop. Here we accept and dispatch X events. We only exit * Main X event loop. Here we accept and dispatch X events. We only exit
@@ -1650,6 +1658,7 @@ int exit_condition;
switch (exit_condition) { switch (exit_condition) {
case EXIT_ON_SENT_EVENT: { case EXIT_ON_SENT_EVENT: {
XAnyEvent *any = (XAnyEvent *) &event; XAnyEvent *any = (XAnyEvent *) &event;
if (any->send_event) { if (any->send_event) {
retval = 0; retval = 0;
keep_going = FALSE; keep_going = FALSE;
+4 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 tilemap.c $NHDT-Date: 1432512803 2015/05/25 00:13:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.24 $ */ /* NetHack 3.6 tilemap.c $NHDT-Date: 1447306925 2015/11/12 05:42:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.25 $ */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
/* /*
@@ -28,6 +28,8 @@ extern void FDECL(exit, (int));
#define OBJ_GLYPH 2 #define OBJ_GLYPH 2
#define OTH_GLYPH 3 /* fortunately unnecessary */ #define OTH_GLYPH 3 /* fortunately unnecessary */
#define EXTRA_SCROLL_DESCR_COUNT ((SCR_BLANK_PAPER - SCR_STINKING_CLOUD) - 1)
/* note that the ifdefs here should be the opposite sense from monst.c/ /* note that the ifdefs here should be the opposite sense from monst.c/
* objects.c/rm.h * objects.c/rm.h
*/ */
@@ -64,7 +66,7 @@ struct conditionals {
* don't know what a slime mold should look like when renamed anyway * don't know what a slime mold should look like when renamed anyway
*/ */
#ifndef MAIL #ifndef MAIL
{ OBJ_GLYPH, SCR_STINKING_CLOUD + 4, "stamped / mail" }, { OBJ_GLYPH, SCR_STINKING_CLOUD + EXTRA_SCROLL_DESCR_COUNT, "stamped / mail" },
#endif #endif
{ 0, 0, 0 } { 0, 0, 0 }
}; };
+35 -28
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 termcap.c $NHDT-Date: 1446856761 2015/11/07 00:39:21 $ $NHDT-Branch: master $:$NHDT-Revision: 1.22 $ */ /* NetHack 3.6 termcap.c $NHDT-Date: 1447234979 2015/11/11 09:42:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.23 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -30,8 +30,7 @@ static void NDECL(init_hilite);
static void NDECL(kill_hilite); static void NDECL(kill_hilite);
#endif #endif
/* (see tcap.h) -- nh_CM, nh_ND, nh_CD, nh_HI,nh_HE, nh_US,nh_UE, /* (see tcap.h) -- nh_CM, nh_ND, nh_CD, nh_HI,nh_HE, nh_US,nh_UE, ul_hack */
ul_hack */
struct tc_lcl_data tc_lcl_data = { 0, 0, 0, 0, 0, 0, 0, FALSE }; struct tc_lcl_data tc_lcl_data = { 0, 0, 0, 0, 0, 0, 0, FALSE };
STATIC_VAR char *HO, *CL, *CE, *UP, *XD, *BC, *SO, *SE, *TI, *TE; STATIC_VAR char *HO, *CL, *CE, *UP, *XD, *BC, *SO, *SE, *TI, *TE;
@@ -44,6 +43,7 @@ STATIC_VAR char *MD; /* may already be in use below */
#endif #endif
#ifdef TERMLIB #ifdef TERMLIB
boolean dynamic_HIHE = FALSE;
#ifdef TEXTCOLOR #ifdef TEXTCOLOR
STATIC_VAR char *MD; STATIC_VAR char *MD;
#endif #endif
@@ -233,18 +233,17 @@ int *wid, *hgt;
LI = tgetnum("li"); LI = tgetnum("li");
#else #else
#if defined(TOS) && defined(__GNUC__) #if defined(TOS) && defined(__GNUC__)
if (!strcmp(term, "builtin")) if (!strcmp(term, "builtin")) {
get_scr_size(); get_scr_size();
else { } else
#endif #endif
{
CO = tgetnum("co"); CO = tgetnum("co");
LI = tgetnum("li"); LI = tgetnum("li");
if (!LI || !CO) /* if we don't override it */ if (!LI || !CO) /* if we don't override it */
get_scr_size(); get_scr_size();
#if defined(TOS) && defined(__GNUC__)
} }
#endif #endif /* ?MICRO */
#endif
#ifdef CLIPPING #ifdef CLIPPING
if (CO < COLNO || LI < ROWNO + 3) if (CO < COLNO || LI < ROWNO + 3)
setclipped(); setclipped();
@@ -298,16 +297,14 @@ int *wid, *hgt;
* pager as a string - so how can you send it NULs??? * pager as a string - so how can you send it NULs???
* -jsb * -jsb
*/ */
nh_HI = (char *) alloc((unsigned) (strlen(SO) + 1)); for (i = 0; digit(SO[i]); ++i)
nh_HE = (char *) alloc((unsigned) (strlen(ME) + 1)); continue;
i = 0; nh_HI = dupstr(&SO[i]);
while (digit(SO[i])) for (i = 0; digit(ME[i]); ++i)
i++; continue;
Strcpy(nh_HI, &SO[i]); nh_HE = dupstr(&ME[i]);
i = 0; dynamic_HIHE = TRUE;
while (digit(ME[i]))
i++;
Strcpy(nh_HE, &ME[i]);
AS = Tgetstr("as"); AS = Tgetstr("as");
AE = Tgetstr("ae"); AE = Tgetstr("ae");
nh_CD = Tgetstr("cd"); nh_CD = Tgetstr("cd");
@@ -340,10 +337,17 @@ int *wid, *hgt;
void void
tty_shutdown() tty_shutdown()
{ {
#if defined(TEXTCOLOR) && defined(TERMLIB) /* we only attempt to clean up a few individual termcap variables */
#ifdef TERMLIB
#ifdef TEXTCOLOR
kill_hilite(); kill_hilite();
#endif #endif
/* we don't attempt to clean up individual termcap variables [yet?] */ if (dynamic_HIHE) {
free((genericptr_t) nh_HI), nh_HI = (char *) 0;
free((genericptr_t) nh_HE), nh_HE = (char *) 0;
dynamic_HIHE = FALSE;
}
#endif
return; return;
} }
@@ -570,7 +574,8 @@ register int x, y;
} }
/* See note above. xputc() is a special function. */ /* See note above. xputc() is a special function. */
void xputc(c) void
xputc(c)
#if defined(apollo) #if defined(apollo)
int c; int c;
#else #else
@@ -758,7 +763,7 @@ tty_delay_output()
#else /* MICRO */ #else /* MICRO */
/* BUG: if the padding character is visible, as it is on the 5620 /* BUG: if the padding character is visible, as it is on the 5620
then this looks terrible. */ then this looks terrible. */
if (flags.null) if (flags.null) {
#ifdef TERMINFO #ifdef TERMINFO
/* cbosgd!cbcephus!pds for SYS V R2 */ /* cbosgd!cbcephus!pds for SYS V R2 */
#ifdef NHSTDC #ifdef NHSTDC
@@ -774,7 +779,7 @@ tty_delay_output()
#endif #endif
#endif #endif
else if (ospeed > 0 && ospeed < SIZE(tmspc10) && nh_CM) { } else if (ospeed > 0 && ospeed < SIZE(tmspc10) && nh_CM) {
/* delay by sending cm(here) an appropriate number of times */ /* delay by sending cm(here) an appropriate number of times */
register int cmlen = register int cmlen =
strlen(tgoto(nh_CM, ttyDisplay->curx, ttyDisplay->cury)); strlen(tgoto(nh_CM, ttyDisplay->curx, ttyDisplay->cury));
@@ -788,13 +793,15 @@ tty_delay_output()
#endif /* MICRO */ #endif /* MICRO */
} }
void cl_eos() /* free after Robert Viduya */ /* must only be called with curx = 1 */
{ /* must only be called with curx = 1 */ void
cl_eos() /* free after Robert Viduya */
if (nh_CD) {
if (nh_CD) {
xputs(nh_CD); xputs(nh_CD);
else { } else {
register int cy = ttyDisplay->cury + 1; register int cy = ttyDisplay->cury + 1;
while (cy <= LI - 2) { while (cy <= LI - 2) {
cl_end(); cl_end();
xputc('\n'); xputc('\n');
+46 -24
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 wintty.c $NHDT-Date: 1446856765 2015/11/07 00:39:25 $ $NHDT-Branch: master $:$NHDT-Revision: 1.110 $ */ /* NetHack 3.6 wintty.c $NHDT-Date: 1447630543 2015/11/15 23:35:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.115 $ */
/* Copyright (c) David Cohrs, 1991 */ /* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1189,17 +1189,36 @@ const char *str;
winid i; winid i;
tty_suspend_nhwindows(str); tty_suspend_nhwindows(str);
/* Just forget any windows existed, since we're about to exit anyway. /*
* Disable windows to avoid calls to window routines. * Disable windows to avoid calls to window routines.
*/ */
for (i = 0; i < MAXWIN; i++) free_pickinv_cache(); /* reset its state as well as tear down window */
if (wins[i] && (i != BASE_WINDOW)) { for (i = 0; i < MAXWIN; i++) {
if (i == BASE_WINDOW)
continue; /* handle wins[BASE_WINDOW] last */
if (wins[i]) {
#ifdef FREE_ALL_MEMORY #ifdef FREE_ALL_MEMORY
free_window_info(wins[i], TRUE); free_window_info(wins[i], TRUE);
free((genericptr_t) wins[i]); free((genericptr_t) wins[i]);
#endif #endif
wins[i] = 0; wins[i] = (struct WinDesc *) 0;
} }
}
WIN_MAP = WIN_MESSAGE = WIN_INVEN = WIN_ERR; /* these are all gone now */
#ifndef STATUS_VIA_WINDOWPORT
WIN_STATUS = WIN_ERR;
#endif
#ifdef FREE_ALL_MEMORY
if (BASE_WINDOW != WIN_ERR && wins[BASE_WINDOW]) {
free_window_info(wins[BASE_WINDOW], TRUE);
free((genericptr_t) wins[BASE_WINDOW]);
wins[BASE_WINDOW] = (struct WinDesc *) 0;
BASE_WINDOW = WIN_ERR;
}
free((genericptr_t) ttyDisplay);
ttyDisplay = (struct DisplayDesc *) 0;
#endif
#ifndef NO_TERMS /*(until this gets added to the window interface)*/ #ifndef NO_TERMS /*(until this gets added to the window interface)*/
tty_shutdown(); /* cleanup termcap/terminfo/whatever */ tty_shutdown(); /* cleanup termcap/terminfo/whatever */
#endif #endif
@@ -1298,9 +1317,10 @@ int type;
newwin->datlen = newwin->datlen =
(short *) alloc(sizeof(short) * (unsigned) newwin->maxrow); (short *) alloc(sizeof(short) * (unsigned) newwin->maxrow);
if (newwin->maxcol) { if (newwin->maxcol) {
/* WIN_STATUS */
for (i = 0; i < newwin->maxrow; i++) { for (i = 0; i < newwin->maxrow; i++) {
newwin->data[i] = (char *) alloc((unsigned) newwin->maxcol); newwin->data[i] = (char *) alloc((unsigned) newwin->maxcol);
newwin->datlen[i] = newwin->maxcol; newwin->datlen[i] = (short) newwin->maxcol;
} }
} else { } else {
for (i = 0; i < newwin->maxrow; i++) { for (i = 0; i < newwin->maxrow; i++) {
@@ -2017,6 +2037,7 @@ winid window;
boolean blocking; /* with ttys, all windows are blocking */ boolean blocking; /* with ttys, all windows are blocking */
{ {
register struct WinDesc *cw = 0; register struct WinDesc *cw = 0;
short s_maxcol;
if (window == WIN_ERR || (cw = wins[window]) == (struct WinDesc *) 0) if (window == WIN_ERR || (cw = wins[window]) == (struct WinDesc *) 0)
panic(winpanicstr, window); panic(winpanicstr, window);
@@ -2053,15 +2074,18 @@ boolean blocking; /* with ttys, all windows are blocking */
/*FALLTHRU*/ /*FALLTHRU*/
case NHW_MENU: case NHW_MENU:
cw->active = 1; cw->active = 1;
/* cw->maxcol is a long, but its value is constrained to
be <= ttyDisplay->cols, so is sure to fit within a short */
s_maxcol = (short) cw->maxcol;
#ifdef H2344_BROKEN #ifdef H2344_BROKEN
cw->offx = (cw->type == NHW_TEXT) cw->offx = (cw->type == NHW_TEXT)
? 0 ? 0
: min(min(82, ttyDisplay->cols / 2), : min(min(82, ttyDisplay->cols / 2),
ttyDisplay->cols - cw->maxcol - 1); ttyDisplay->cols - s_maxcol - 1);
#else #else
/* avoid converting to uchar before calculations are finished */ /* avoid converting to uchar before calculations are finished */
cw->offx = (uchar)(int) max( cw->offx = (uchar) max((int) 10,
(int) 10, (int) (ttyDisplay->cols - cw->maxcol - 1)); (int) (ttyDisplay->cols - s_maxcol - 1));
#endif #endif
if (cw->offx < 0) if (cw->offx < 0)
cw->offx = 0; cw->offx = 0;
@@ -3008,7 +3032,8 @@ void
tty_print_glyph(window, x, y, glyph, bkglyph) tty_print_glyph(window, x, y, glyph, bkglyph)
winid window; winid window;
xchar x, y; xchar x, y;
int glyph, bkglyph; int glyph;
int bkglyph UNUSED;
{ {
int ch; int ch;
boolean reverse_on = FALSE; boolean reverse_on = FALSE;
@@ -3342,18 +3367,16 @@ genericptr_t ptr;
default: default:
value = atol(text); value = atol(text);
Sprintf(status_vals[fldidx], Sprintf(status_vals[fldidx],
status_fieldfmt[fldidx] ? status_fieldfmt[fldidx] : status_fieldfmt[fldidx] ? status_fieldfmt[fldidx] : "%s",
"%s", text); text);
break; break;
} }
}
#ifdef STATUS_HILITES #ifdef STATUS_HILITES
switch (tty_status_hilites[fldidx].behavior) { switch (tty_status_hilites[fldidx].behavior) {
case BL_TH_NONE: case BL_TH_NONE:
tty_status_colors[fldidx] = NO_COLOR; tty_status_colors[fldidx] = NO_COLOR;
break; break;
case BL_TH_UPDOWN: case BL_TH_UPDOWN:
if (chg > 0) if (chg > 0)
tty_status_colors[fldidx] = tty_status_hilites[fldidx].over; tty_status_colors[fldidx] = tty_status_hilites[fldidx].over;
@@ -3362,29 +3385,27 @@ genericptr_t ptr;
else else
tty_status_colors[fldidx] = NO_COLOR; tty_status_colors[fldidx] = NO_COLOR;
break; break;
case BL_TH_VAL_PERCENTAGE: {
case BL_TH_VAL_PERCENTAGE:
{
int pct_th = 0; int pct_th = 0;
if (tty_status_hilites[fldidx].thresholdtype != ANY_INT) { if (tty_status_hilites[fldidx].thresholdtype != ANY_INT) {
impossible( impossible(
"tty_status_update: unsupported percentage threshold type %d", "tty_status_update: unsupported percentage threshold type %d",
tty_status_hilites[fldidx].thresholdtype); tty_status_hilites[fldidx].thresholdtype);
break; } else {
}
pct_th = tty_status_hilites[fldidx].threshold.a_int; pct_th = tty_status_hilites[fldidx].threshold.a_int;
tty_status_colors[fldidx] = (percent >= pct_th) tty_status_colors[fldidx] = (percent >= pct_th)
? tty_status_hilites[fldidx].over ? tty_status_hilites[fldidx].over
: tty_status_hilites[fldidx].under; : tty_status_hilites[fldidx].under;
} }
break; break;
}
case BL_TH_VAL_ABSOLUTE: case BL_TH_VAL_ABSOLUTE: {
{
int c = NO_COLOR; int c = NO_COLOR;
int o = tty_status_hilites[fldidx].over; int o = tty_status_hilites[fldidx].over;
int u = tty_status_hilites[fldidx].under; int u = tty_status_hilites[fldidx].under;
anything *t = &tty_status_hilites[fldidx].threshold; anything *t = &tty_status_hilites[fldidx].threshold;
switch (tty_status_hilites[fldidx].thresholdtype) { switch (tty_status_hilites[fldidx].thresholdtype) {
case ANY_LONG: case ANY_LONG:
c = (value >= t->a_long) ? o : u; c = (value >= t->a_long) ? o : u;
@@ -3408,10 +3429,11 @@ genericptr_t ptr;
break; break;
} }
tty_status_colors[fldidx] = c; tty_status_colors[fldidx] = c;
}
break; break;
} } /* case */
} /* switch */
#endif /* STATUS_HILITES */ #endif /* STATUS_HILITES */
}
/* For now, this version copied from the genl_ version currently /* For now, this version copied from the genl_ version currently
* updates everything on the display, everytime * updates everything on the display, everytime