Merge branch 'NetHack-3.6.0' into win32-guitty

This commit is contained in:
nhmall
2016-01-06 20:59:50 -05:00
41 changed files with 1100 additions and 204 deletions
+1 -1
View File
@@ -218,7 +218,7 @@ MONSTER:random,random
LEVEL:"medusa-3"
FLAGS: noteleport,mazelevel
FLAGS: noteleport,mazelevel,shortsighted
INIT_MAP:solidfill,' '
GEOMETRY:center,center
#
+441 -34
View File
@@ -329,80 +329,473 @@ the most courted and the most cursed.
#
#
#
%title The Light Fantastic (2)
%title The Light Fantastic (12)
# p. 92 (Signet edition)
%passage 1
'Cohen is my name, boy' Belthan's hands stopped moving.
'Cohen?' she said, 'Cohen the Barbarian?'
'Cohen ish my name, boy.' Bethan's hands stopped moving.
'Cohen?' she said. 'Cohen the Barbarian?'
'The very shame.'
'Hang on, hang on,' said Rincewind, 'Cohen's a great big chap, neck like a
'Hang on, hang on,' said Rincewind. 'Cohen's a great big chap, neck like a
bull, got chest muscles like a sack of footballs. I mean, he's the Disc's
greatest warrior, a legend in his own lifetime. I remember my grandad
telling me he saw him ... my grandad telling me he ... my grandad ...'
telling me he saw him... my grandad telling me he... my grandad...'
He faltered under the gimlit gaze.
'Oh,' he said, 'Oh. Of course, Sorry.'
'Yesh,' said Cohen, and sighed, 'Thatsh right boy, I'm a lifetime in my own
legend.'
'Oh,' he said. 'Oh. Of course. Sorry.'
'Yesh,' said Cohen, and sighed. 'That's right boy. I'm a lifetime in my
own legend.'
[The Light Fantastic, by Terry Pratchett]
%e passage 1
# p. 113 (Twoflower is teaching the Riders how to play bridge;
# in /The Light Fantastic/, Death's dialog uses quotation marks
# and full uppercase rather than the small capital letters used in
# the other books)
%passage 2
Death sat at one side of a black baize table in the entre of the room,
Death sat at one side of a black baize table in the centre of the room,
arguing with Famine, War and Pestilence. Twoflower was the only one to
look up and notice Rincewind.
'Hey, how did you get here?' he said.
'Well, some say that the creator took a handful - oh, I see, well, it's
hard to explain but I -'
'Well, some say that the creator took a handful--oh, I see, well, it's
hard to explain but I--'
'Have you got the Luggage?'
The wooden box pushed past Rincewind and settled down in front of its
owner, who opened its lid and rummaged around inside until he came up with
a small, leatherbound book which he handed to War, who was hammering the
table with a mailed fist.
'It's "Nosehinger on the Laws of Contract",' he said. 'It's quite good,
there's a lot in it about double finessing and how to -'
Death snatched the book with a bony hand and flipped through the pages,
'It's "Nosehinger on the Laws of Contract",' he said. 'It's quite good,
there's a lot in it about double finessing and how to--'
Death snatched the book with a bony hand and flipped through the pages,
quite oblivious to the presence of the two men.
'RIGHT,' he said, 'PESTILENCE, OPEN ANOTHER PACK OF CARDS. I'M GOING TO GET
TO THE BOTTOM OF THIS IF IT KILLS ME. FIGURATIVELY SPEAKING OF COURSE.'
'RIGHT,' he said, 'PESTILENCE, OPEN ANOTHER PACK OF CARDS. I'M GOING TO
GET TO THE BOTTOM OF THIS IF IT KILLS ME. FIGURATIVELY SPEAKING OF COURSE.'
[The Light Fantastic, by Terry Pratchett]
%e passage 2
# p. 7 (passage starts mid-sentence; the too-long-to-answer question is
# "Why have Rincewind and Twoflower fallen off the Disc's rim?",
# alluding to the conclusion of /The Colour of Magic/;
# in /Sourcery/ and /Interesting Times/ and probably others, the
# famous philosohper's name is spelled "Ly Tin Wheedle")
%passage 3
[...] such questions take time and could be more trouble than they are
worth. For example, it is said that someone at a party once asked the
famous philosopher Ly Tin Weedle "Why are you here?" and the reply took
three years.
[The Light Fantastic, by Terry Pratchett]
%e passage
# p. 8 ('libraries': plural is accurate)
%passage 4
The only furnishing in the room was a lectern of dark wood, carved into the
shape of a bird--well, to be frank, into the shape of a winged thing it is
probably best not to examine too closely--and on the lectern, fastened to
it by a heavy chain covered in padlocks, was a book.
A large, but not particularly impressive, book. Other books in the
University's libraries had covers inlaid with rare jewels and fascinating
wood, or bound with dragon skin. This one was just a rather tatty leather.
It looked the sort of book described in library catalogues as "slightly
foxed," although it would be more honest to admit that it looked as though
it had been badgered, wolved and possibly beared as well.
[The Light Fantastic, by Terry Pratchett]
%e passage
# pp. 41-42
%passage 5
The barbarian chieftain said: "What then are the greatest things that a
man may find in life?" This is the sort of thing you're supposed to say to
maintain steppecred in barbarian circles.
The man on his right thoughtfully drank his cocktail of mare's milk and
snowcat blood, and spoke thus: "The crisp horizon of the steppe, the wind
in your hair, a fresh horse under you."
The man on his left said: "The cry of the white eagle in the heights, the
fall of snow in the forest, a true arrow in your bow."
The chieftain nodded and said: "Surely it is the sight of your enemy
slain, the humiliation of his tribe and the lamentation of his women."
There was a general murmur of whiskery approval at this outrageous display.
Then the chieftain turned respectfully to his guest, a small figure
carefully warming his chilblains by the fire, and said: "But our guest,
whose name is legend, must tell us truly: what is it that a man may call
the greatest things in life?"
The guest paused in the middle of another unsuccessful attempt to light up.
"What shay?" he said, toothlessly.
"I said: what is it that a man may call the greatest things in life?"
The warriors leaned closer. This should be worth hearing.
The guest thought long and hard and then said, with deliberation: "Hot
water, good dentishtry and shoft lavatory paper."
[The Light Fantastic, by Terry Pratchett]
%e passage
# p. 48 (Hanzel and Gretel, obviously...)
%passage 6
"Have a bit more table," said Rincewind.
"No thanks, I don't like marzipan," said Twoflower. "Anyway, I'm sure it's
not right to eat other people's furniture."
"Don't worry," said Swires. "The old witch hasn't been seen for years.
They say she was done up good and proper by a couple of young tearaways."
"Kids of today," said Rincewind.
"I blame the parents," said Twoflower.
[The Light Fantastic, by Terry Pratchett]
%e passage
# p. 103
%passage 7
It is a well known fact that warriors and wizards do not get along, because
one side considers the other side to be a collection of bloodthirsty idiots
who can't walk and think at the same time, while the other side is naturally
suspicious of a body of men who mumble a lot and wear long dresses. Oh, say
the wizards, if we're going to be like that, then, what about all those
studded collars and oiled muscles down at the Young Men's Pagan Association?
To which the heroes reply, that's a pretty good allegation coming from a
bunch of wimpsoes who won't go near a woman on account, can you believe it,
of their mystical power being sort of drained out. Right, say the wizards,
that just about does it, you and your leather posing pouches. Oh yeah, say
the heroes, why don't you...
And so on. This sort of thing has been going on for centuries, and caused
a number of major battles which have left large tracts of land uninhabitable
because of magical harmonics.
[The Light Fantastic, by Terry Pratchett]
%e passage
# p. 128
%passage 8
"He'sh mad?"
"Sort of mad. But mad with lots of money."
"Ah, then he can't be mad. I've been around; if a man hash lotsh of money
he'sh just ecshentric."
[The Light Fantastic, by Terry Pratchett]
%e passage
# p. 182 (Cohen is now wearing dentures with teeth made from diamonds)
%passage 9
Cohen tapped him on the shoulder. The man looked around irritably.
"What do you want, grandad?" he snarled.
Cohen paused until he had the man's full attention, and then he smiled. It
was a slow, lazy smile, unveiling about 300 carats of mouth jewelry that
seemed to light up the room.
"I will count to three," he said, in a friendly tone of voice. "One, Two."
His bony knee came up in the man's groin with a satisfyingly meaty noise,
and he half-turned to bring the full force of an elbow into the kidneys as
the leader collapsed around his private universe of pain.
"Three," to told the ball of agony on the floor. Cohen had heard of
fighting fair, and had long ago decided he wanted no part of it.
[The Light Fantastic, by Terry Pratchett]
%e passage
# pp. 193-194 (this passage is the data.base quote for shopkeeper)
%passage 10
There have been three general theories put forward to explain the
phenomenon of the wandering shops, or as they are generically known,
/tabernae vagantes/.
The first postulates that many thousands of years ago there evolved
somewhere in the multiverse a race whose single talent was to buy cheap
and sell dear. Soon they controlled a vast galactic empire or, as they put
it, Emporium, and the more advanced members of the species found a way to
equip their very shops with unique propulsion units that could break the
dark walls of space itself and open up vast new markets. And long after
the worlds of the Emporium perished in the heat death of their particular
universe, after one last defiant fire sale, the wandering starshops still
ply their trade, eating their way through the pages of space-time like a
worm through a three-volume novel.
The second is that they are the creation of a sympathetic Fate, charged
with the role of supplying exactly the right thing at the right time.
The third is that they are simply a very clever way of getting around the
various Sunday Closing acts.
All these theories, diverse as they are, have two things in common. They
explain the observed facts, and they are completely and utterly wrong.
[The Light Fantastic, by Terry Pratchett]
%e passage
# p. 205
%passage 11
"Where to they all come from?" said Twoflower, as they fled yet another mob.
"Inside every sane person there's a madman struggling to get out," said the
shopkeeper, "That's what I've always thought. No one goes mad quicker than
a totally sane person."
[The Light Fantastic, by Terry Pratchett]
%e passage
# pp. 229-230 ('grey': British spelling is accurate)
%passage 12
Trymon was looking at him. /Something/ was looking at him. And still the
others hadn't noticed. Could he even explain it? Trymon looked the same
as he had always done, except for the eyes, and a slight sheen to his skin.
Rincewind stared, and knew that there were far worse things than Evil. All
the demons in Hell would torture your very soul, but that was precisely
because they value souls very highly; evil would always try to steal the
universe, but at least it considered the universe worth stealing. But the
grey world behind those empty eyes would trample and destroy without even
according its victims the dignity of hatred. It wouldn't even notice them.
[The Light Fantastic, by Terry Pratchett]
%e passage
%e title
#
#
#
%title Equal Rites (3)
%title Equal Rites (10)
# p. 118 (Signet edition; passage starts mid-sentence and ends mid-paragraph)
%passage 1
...it is well known that a vital ingredient of success is not knowing that
what you're attempting can't be done.
[...] it is well known that a vital ingredient of success is not knowing
that what you're attempting can't be done. [...]
[Equal Rites, by Terry Pratchett]
%e passage
# p. 218 (speaker is Granny Weatherwax)
%passage 2
Million-to-one chances...crop up nine times out of ten.
"Million-to-one chances," she said, "crop up nine times out of ten."
[Equal Rites, by Terry Pratchett]
%e passage
# pp. 96-97 ('Tannoy': public address speaker)
%passage 3
Animal minds are simple, and therefore sharp. Animals never spend time
dividing experience into little bits and speculating about all the bits
they've missed. The whole panoply of the universe has been neatly
expressed to them as things to (a) mate with, (b) eat, (c) run away from,
and (d) rocks. This frees the mind from unnecessary thoughts and gives
it a cutting edge where it matters. Your normal animal, in fact, never
tries to walk and chew gum at the same time.
Animal minds are simple, and therefore sharp. Animals never spend time
dividing experience into little bits and speculating about all the bits
they've missed. The whole panoply of the universe has been neatly
expressed to them as things to (a) mate with, (b) eat, (c) run away from,
and (d) rocks. This frees the mind from unnecessary thoughts and gives
it a cutting edge where it matters. Your normal animal, in fact, never
tries to walk and chew gum at the same time.
The average human, on the other hand, thinks about all sorts of things
The average human, on the other hand, thinks about all sorts of things
around the clock, on all sorts of levels, with interruptions from dozens
of biological calendars and timepieces. There's thoughts about to be said,
and private thoughts, and real thoughts, and thoughts about thoughts, and
a whole gamut of subconscious thoughts. To a telepath the human head is
a din. It is a railway terminus with all the Tannoys talking at once.
It is a complete FM waveband- and some of those stations aren't reputable,
of biological calendars and timepieces. There's thoughts about to be said,
and private thoughts, and real thoughts, and thoughts about thoughts, and
a whole gamut of subconscious thoughts. To a telepath the human head is
a din. It is a railway terminus with all the Tannoys talking at once.
It is a complete FM waveband--and some of those stations aren't reputable,
they're outlawed pirates on forbidden seas who play late-night records with
limbic lyrics.
[Equal Rites, by Terry Pratchett]
%e passage
# pp. 18-19
%passage 4
Smith took a spade from beside the back door and hesitated.
"Granny."
"What?"
"Do you know how wizards like to be buried?"
"Yes!"
"Well, how?"
Granny paused at the bottom of the stairs.
"Reluctantly."
[Equal Rites, by Terry Pratchett]
%e passage
# p. 70
%passage 5
Granny sighed. "You have learned something," she said, and thought it
was safe to insert a touch of sternness into her voice. "They say that a
little knowledge is a dangerous thing, but it is not one half so bad as a
lot of ignorance."
[Equal Rites, by Terry Pratchett]
%e passage
# pp. 113-114 (Esk is a young girl)
%passage 6
The barges stopped at some of the towns. By tradition only the men went
ashore, and only Amschat, wearing his ceremonial Lying hat, spoke to
non-Zoons. Esk usually went with him. He tried hinting that she should
obey the unwritten rules of Zoon life and stay afloat, but a hint was to
Esk what a mosquito bite was to the average rhino because she was already
learning that if you ignore the rules people will, half the time, quietly
rewrite them so that they don't apply to you.
[Equal Rites, by Terry Pratchett]
%e passage
# pp. 119-120 (next passage is a direct continuation of this one)
%passage 7
The town was smaller than Ohulan, and very different because it lay on the
junction of three trade routes quite apart from the river itself. It was
built around one enormous square which was a cross between a permanent
exotic traffic jam and a tent village. Camels kicked mules, mules kicked
horses, horses kicked camels and they all kicked humans; there was a riot
of colours, a din of noise, a nasal orchestration of smells and the steady,
heady sound of hundreds of people working hard at making money.
One reason for the bustle was that over large parts of the continent other
people preferred to make money without working at all, and since the Disc
had yet to develop a music recording industry they were forced to fall back
on older, more traditional forms of banditry.
Strangely enough these often involved considerable effort. Rolling heavy
rocks to the top of cliffs for a decent ambush, cutting down trees to
block the road, and digging a pit lined with spikes while still keeping a
wicked edge on a dagger probably involved a much greater expenditure of
thought and muscle than more socially-acceptable professions but,
nevertheless, there were still people misguided enough to endure all this,
plus long nights in uncomfortable surroundings, merely to get their hands
on perfectly ordinary large boxes of jewels.
[Equal Rites, by Terry Pratchett]
%e passage
# pp. 120-121 (this passage is a direct continuation of preceding one;
# "I said, what is happening here?" actually omits "is"
# but must be a typo--fixed here to avoid bug reports;
# 'broomstick' is Esk's disguised wizard's staff)
%passage 8
So a town like Zemphis was the place where caravans split, mingled and
came together again, as dozens of merchants and travellers banded together
for protection against the socially disadvantaged on the trails ahead.
Esk, wandering unregarded amidst the bustle, learned all this by the simple
method of finding someone who looked important and tugging on the hem of
his coat.
This particular man was counting bales of tobacco and would have succeeded
but for the interruption.
"What?"
"I said, what is happening here?"
The man meant to say: "Push off and bother someone else." He meant to
give her a light cuff about the head. So he was astonished to find himself
bending down and talking seriously to a small, grubby-faced child holding
a large broomstick (which also, it seemed to him later, was in some
indefinable way /paying attention/).
He explained about the caravans. The child nodded.
"People all get together to travel?"
"Precisely."
"Where to?"
"All sorts of places. Sto Lat, Pseudopolis... Ankh-Morpork, of course...."
"But the river goes there," said Esk, reasonably. "Barges. The Zoons."
"Ah, yes," said the merchant, "but they charge high prices and they can't
carry everything and, anyway, no one trusts them much."
"But they're very honest!"
"Huh, yes," he said. "But you know what they say: never trust an honest
man." He smiled knowingly.
"Who says that?"
"They do. You know. People," he said, a certain uneasiness entering his
voice.
"Oh," said Esk. She thought about it. "They must be very silly," she said
primly. "Thank you, anyway."
[Equal Rites, by Terry Pratchett]
%e passage
# pp. 127-128 (this time broomstick is Granny's defective witch's broomstick)
%passage 9
The broomstick lay between two trestles. Granny Weatherwax sat on a rock
outcrop while a dwarf half her height, wearing an apron that was a mass of
pockets, walked around the broom and occasionally poked it.
Eventually he kicked the bristles and gave a long intake of breath, a sort
of reverse whistle, which is the secret sign of craftsman across the
universe and means that something expensive is about to happen.
"Weellll," he said. "I could get the apprentices in to look at this, I
could. It's an education in itself. And you say it actually managed to
get airborne?"
"It flew like a bird," said Granny.
The dwarf lit a pipe. "I should very much like to see that bird," he said
reflectively. "I should imagine it's quite something to watch, a bird like
that."
"Yes, but can you repair it?" said Granny. "I'm in a hurry."
The dwarf sat down, slowly and deliberately.
"As for /repair/," he said, "well, I don't know about /repair/. Rebuild,
maybe. Of course, it's hard to get the bristles these days even if you can
find people to do the proper binding, and the spells need--"
"I don't want it rebuilt, I just want it to work properly," said Granny.
"It's an early model, you see," the dwarf plugged on. "Very tricky, those
early models. You can't get the wood--"
He was picked up bodily until his eyes were level with Granny's. Dwarves,
being magical in themselves as it were, are quite resistant to magic but
her expression looked as though she was trying to weld his eyeballs to the
back of his skull.
"Just repair it," she hissed. "Please?"
"What, make a bodge job?" said the dwarf, his pipe clattering to the floor.
"Yes."
"Patch it up, you mean? Betray my training by doing half a job?"
"Yes," said Granny. Her pupils were two little black holes.
"Oh," said the dwarf. "Right, then."
[Equal Rites, by Terry Pratchett]
%e passage
# p. 185 (actually uses four periods to mark a sentence ending in a elipsis)
%passage 10
There may be universes where librarianship is considered a peaceful sort of
occupation, and where the risks are limited to large volumes falling off
the shelves on to one's head, but the keeper of a /magic/ library is no job
for the unwary. Spells have power, and merely writing them down and
shoving them between covers doesn't do anything to reduce it. The stuff
leaks. Books tend to react with one another, creating randomized magic
with a mind of its own. Books of magic are usually chained to their
shelves, but not to prevent them being stolen....
[Equal Rites, by Terry Pratchett]
%e passage
%e title
#
#
@@ -5997,7 +6390,7 @@ IF YOU ASK ME, said Death, NOBODY COULD DO ANY BETTER THAN THAT...
# Used for interaction with Death.
#
%section Death
%title Death Quotes (13)
%title Death Quotes (17)
%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.
%e passage
@@ -6046,6 +6439,20 @@ SHALL WE GO?
# p. 251
%passage 13
I HAVE COME FOR THEE.
# The Light Fantastic, p. 52 (Signet edition; quote has quotation marks but
# including them here wouldn't fit with the rest)
%passage 14
DARK IN HERE, ISN'T IT?
# p. 14 (Equal Rites; 2nd sentence continues 'said the deep, heavy voice...')
%passage 15
THERE IS NO GOING BACK. THERE IS NO GOING BACK.
# p. 15 (contradicts later descriptions of Death as existing outside of time;
# presumably it's just intended as a colloquial expression)
%passage 16
I HAVEN'T GOT ALL DAY, YOU KNOW.
# p. 15 (same page)
%passage 17
LIFE IS FOR THE LIVING.
%e title
%e section
#
+1 -1
View File
@@ -1948,7 +1948,7 @@ There is a section of this Guidebook that discusses that.
.pg
The default name of the configuration file varies on different
operating systems. On DOS and Windows, it is ``defaults.nh''
in the same folder as nethack.exe or nethackW.exe. On Unix, linux
in the same folder as nethack.exe or nethackW.exe. On Unix, Linux
and Mac OS X it is ``.nethackrc'' in the user's home directory.
NETHACKOPTIONS can also be set to the full name of a file you
want to use (possibly preceded by an `@').
+1 -1
View File
@@ -2347,7 +2347,7 @@ There is a section of this Guidebook that discusses that.
%.pg
The default name of the configuration file varies on different
operating systems. On DOS and Windows, it is ``{\tt defaults.nh}''
in the same folder as nethack.exe or nethackW.exe. On Unix, linux
in the same folder as nethack.exe or nethackW.exe. On Unix, Linux
and Mac OS X it is ``{\tt.nethackrc}'' in the user's home directory.
NETHACKOPTIONS can also be set to the full name of a file you
want to use (possibly preceded by an `{\tt @}').
+29 -2
View File
@@ -81,6 +81,22 @@ ensure sufficient messages are given to clarify the transition from detected
vampire bats to fog clouds in Vlad's tower
fix "killing by kicking something weird" when kicking an object causes death
guard macros available for mextra fields similar to those for oextra fields
compile-time option for an alternate paniclog format for public server use
make monsters forget where they stepped when fleeing or teleporting
requiver pickup_thrown objects if quiver is empty
make mimics mimicing walls or trees also block light
stepping onto lava destroyed non-fireproof water walking boots but left other
vulnerable boot types intact
fix death reason when eating tainted glob of <monster> (not corpse)
use appropriate place name for drum of earthquake shakes
fix unmapped branch stairs on sokoban level
redraw map when hilite_pile is toggled to display the highlighting
make commands that accept a count prefix for item selection
show "Count:" like command repeating does
make vault guard accept names starting with number
fix weight of containers in special levels
make the raven medusa level shortsighted
fix possible segfault in lev_comp when map was too tall
Platform- and/or Interface-Specific Fixes
@@ -89,6 +105,8 @@ tty: M-N gave "Unknown command 'M-" with "'." finishing the sentence on the
line below it, leaving bogus '.' displayed on the top row of the map
tty: specifying all four of role, race, gender, and alignment still prompted
for confirmation with "Is this ok?" before starting play
tty: responding with <return> or <enter> duing role, race, &c selection
behaved same as <escape> to quit; now it will pick [random] instead
unix/X11: in top level Makefile, some commented out definitions of VARDATND
misspelled pilemark.xbm (as pilemark.xpm)
unix/tty: fix compile warning about 'has_colors' for some configurations
@@ -110,11 +128,20 @@ General New Features
--------------------
naming Sting or Orcrist now breaks illiterate conduct
different feedback for reading a scroll of mail created by writing with marker
wizard mode #wizintrinsic
reading non-cursed scroll of enchant weapon uncurses welded tin opener
if hero has no jumping ability but knows the jumping spell, the #jump command
will attempt to cast the spell
additional tribute passages for The Colour of Magic, Snuff, and Raising Steam
allow moving cursor to monsters with 'm' (nearest first) and 'M' (furthest
first) when asked for map location, or to objects with 'o' and 'O'
allow picking a used inventory letter from menu when #adjusting
zapping wand of opening at yourself, unlock carried boxes
dissolve iron bars by force-fighting with wielded potion of acid
poison breath leaves a trail of poison gas
allow knife and stiletto as possible tin opening tools
wizard mode #wizintrinsic command
additional tribute passages for The Colour of Magic, The Light Fantastic,
Equal Rites, Snuff, and Raising Steam
compile-time options SIMPLE_MAIL and SERVER_ADMIN_MSG for public server use
Platform- and/or Interface-Specific New Features
+4
View File
@@ -206,6 +206,10 @@
#define NEWS "news" /* the file containing the latest hack news */
#define PANICLOG "paniclog" /* log of panic and impossible events */
/* alternative paniclog format, better suited for public servers with
many players, as it saves the player name and the game start time */
/* #define PANICLOG_FMT2 */
/*
* PERSMAX, POINTSMIN, ENTRYMAX, PERS_IS_UID:
* These control the contents of 'record', the high-scores file.
+9 -4
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 extern.h $NHDT-Date: 1451174855 2015/12/27 00:07:35 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.526 $ */
/* NetHack 3.6 extern.h $NHDT-Date: 1452123455 2016/01/06 23:37:35 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.535 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -204,6 +204,7 @@ E int FDECL(isok, (int, int));
E int FDECL(get_adjacent_loc,
(const char *, const char *, XCHAR_P, XCHAR_P, coord *));
E const char *FDECL(click_to_cmd, (int, int, int));
E char FDECL(get_count, (char *, CHAR_P, long, long *));
#ifdef HANGUPHANDLING
E void FDECL(hangup, (int));
E void NDECL(end_of_input);
@@ -498,6 +499,7 @@ E void FDECL(endmultishot, (BOOLEAN_P));
E void FDECL(hitfloor, (struct obj *));
E void FDECL(hurtle, (int, int, int, BOOLEAN_P));
E void FDECL(mhurtle, (struct monst *, int, int, int));
E boolean FDECL(throwing_weapon, (struct obj *));
E void FDECL(throwit, (struct obj *, long, BOOLEAN_P));
E int FDECL(omon_adj, (struct monst *, struct obj *, BOOLEAN_P));
E int FDECL(thitmonst, (struct monst *, struct obj *));
@@ -1061,6 +1063,7 @@ E void FDECL(nocmov, (int x, int y));
#ifdef MAIL
#ifdef UNIX
E void NDECL(getmailstatus);
E void NDECL(ck_server_admin_msg);
#endif
E void NDECL(ckmailstatus);
E void FDECL(readmail, (struct obj *));
@@ -1200,6 +1203,7 @@ E boolean FDECL(bad_location, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
XCHAR_P, XCHAR_P));
E void FDECL(place_lregion, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, d_level *));
E void NDECL(fixup_special);
E void NDECL(fumaroles);
E void NDECL(movebubbles);
E void NDECL(water_friction);
@@ -1497,9 +1501,10 @@ E boolean FDECL(lined_up, (struct monst *));
E struct obj *FDECL(m_carrying, (struct monst *, int));
E void FDECL(m_useupall, (struct monst *, struct obj *));
E void FDECL(m_useup, (struct monst *, struct obj *));
E void FDECL(m_throw,
(struct monst *, int, int, int, int, int, struct obj *));
E boolean FDECL(hits_bars, (struct obj **, int, int, int, int));
E void FDECL(m_throw, (struct monst *, int, int, int, int, int, struct obj *));
E void FDECL(hit_bars, (struct obj **, int, int, int, int,
BOOLEAN_P, BOOLEAN_P));
E boolean FDECL(hits_bars, (struct obj **, int, int, int, int, int, int));
/* ### muse.c ### */
+3
View File
@@ -29,6 +29,9 @@
#define EXT_ENCUMBER 4 /* Overtaxed */
#define OVERLOADED 5 /* Overloaded */
/* weight increment of heavy iron ball */
#define IRON_BALL_W_INCR 160
/* hunger states - see hu_stat in eat.c */
#define SATIATED 0
#define NOT_HUNGRY 1
+10
View File
@@ -159,6 +159,16 @@ struct monst {
#define is_vampshifter(mon) \
((mon)->cham == PM_VAMPIRE || (mon)->cham == PM_VAMPIRE_LORD \
|| (mon)->cham == PM_VLAD_THE_IMPALER)
/* mimic appearances that block vision/light */
#define is_lightblocker_mappear(mon) \
(is_obj_mappear(mon, BOULDER) || \
((mon)->m_ap_type == M_AP_FURNITURE \
&& ((mon)->mappearance == S_hcdoor \
|| (mon)->mappearance == S_vcdoor \
|| (mon)->mappearance < S_ndoor /* = walls */ \
|| (mon)->mappearance == S_tree)))
#define is_door_mappear(mon) ((mon)->m_ap_type == M_AP_FURNITURE \
&& ((mon)->mappearance == S_hcdoor || (mon)->mappearance == S_vcdoor))
#define is_obj_mappear(mon,otyp) ((mon)->m_ap_type == M_AP_OBJECT \
+21
View File
@@ -191,9 +191,30 @@
#endif
#endif
/* If SIMPLE_MAIL is defined, the mail spool file format is
"sender:message", one mail per line, and mails are
read within game, from demon-delivered mail scrolls.
The mail spool file will be deleted once the player
has read the message. */
/* #define SIMPLE_MAIL */
#ifndef MAILCKFREQ
/* How often mail spool file is checked for new messages, in turns */
#define MAILCKFREQ 50
#endif
#endif /* MAIL */
/* If SERVER_ADMIN_MSG is defined and the file exists, players get
a message from the user defined in the file. The file format
is "sender:message" all in one line. */
/* #define SERVER_ADMIN_MSG "adminmsg" */
#ifndef SERVER_ADMIN_MSG_CKFREQ
/* How often admin message file is checked for new messages, in turns */
#define SERVER_ADMIN_MSG_CKFREQ 25
#endif
/*
* Some terminals or terminal emulators send two character sequence "ESC c"
* when Alt+c is pressed. The altmeta run-time option allows the user to
+1 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 allmain.c $NHDT-Date: 1451344214 2015/12/28 23:10:14 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.68 $ */
/* NetHack 3.6 allmain.c $NHDT-Date: 1451955079 2016/01/05 00:51:19 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.70 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
-2
View File
@@ -773,8 +773,6 @@ beautiful()
: "ugly");
}
#define WEAK 3 /* from eat.c */
static const char look_str[] = "look %s.";
STATIC_OVL int
+61 -20
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 cmd.c $NHDT-Date: 1451082253 2015/12/25 22:24:13 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.212 $ */
/* NetHack 3.6 cmd.c $NHDT-Date: 1452123457 2016/01/06 23:37:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.216 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3864,6 +3864,60 @@ int x, y, mod;
return cmd;
}
char
get_count(allowchars, inkey, maxcount, count)
char *allowchars;
char inkey;
long maxcount;
long *count;
{
char qbuf[QBUFSZ];
int key;
long cnt = 0L;
boolean backspaced = FALSE;
/* this should be done in port code so that we have erase_char
and kill_char available; we can at least fake erase_char */
#define STANDBY_erase_char '\177'
for (;;) {
if (inkey) {
key = inkey;
inkey = '\0';
} else
key = readchar();
if (digit(key)) {
cnt = 10L * cnt + (long) (key - '0');
if (cnt < 0)
cnt = 0;
else if (maxcount > 0 && cnt > maxcount)
cnt = maxcount;
} else if (key == '\b' || key == STANDBY_erase_char) {
cnt = cnt / 10;
backspaced = TRUE;
} else if (key == '\033') {
break;
} else if (!allowchars || index(allowchars, key)) {
*count = cnt;
break;
}
if (cnt > 9 || backspaced) {
clear_nhwindow(WIN_MESSAGE);
if (backspaced && !cnt) {
Sprintf(qbuf, "Count: ");
} else {
Sprintf(qbuf, "Count: %ld", cnt);
backspaced = FALSE;
}
pline1(qbuf);
mark_synch();
}
}
return key;
}
STATIC_OVL char *
parse()
{
@@ -3882,25 +3936,12 @@ parse()
#ifdef ALTMETA
alt_esc = iflags.altmeta; /* readchar() hack */
#endif
if (!Cmd.num_pad || (foo = readchar()) == 'n')
for (;;) {
foo = readchar();
if (foo >= '0' && foo <= '9') {
multi = 10 * multi + foo - '0';
if (multi < 0 || multi >= LARGEST_INT)
multi = LARGEST_INT;
if (multi > 9) {
clear_nhwindow(WIN_MESSAGE);
Sprintf(in_line, "Count: %d", multi);
pline1(in_line);
mark_synch();
}
last_multi = multi;
if (!multi && foo == '0')
prezero = TRUE;
} else
break; /* not a digit */
}
if (!Cmd.num_pad || (foo = readchar()) == 'n') {
long tmpmulti = multi;
foo = get_count(NULL, '\0', LARGEST_INT, &tmpmulti);
last_multi = multi = tmpmulti;
}
#ifdef ALTMETA
alt_esc = FALSE; /* readchar() reset */
#endif
+3 -1
View File
@@ -1363,7 +1363,7 @@ register int aflag; /* intrinsic autosearch vs explicit searching */
unblock_point(x, y); /* vision */
exercise(A_WIS, TRUE);
nomul(0);
feel_location(x, y); /* make sure it shows up */
feel_newsym(x, y); /* make sure it shows up */
You("find a hidden passage.");
} else {
/* Be careful not to find anything in an SCORR or SDOOR */
@@ -1553,6 +1553,8 @@ int which_subset; /* when not full, whether to suppress objs and/or traps */
}
}
}
if (glyph == cmap_to_glyph(S_darkroom))
glyph = cmap_to_glyph(S_room); /* FIXME: dirty hack */
show_glyph(x, y, glyph);
}
+1 -2
View File
@@ -1201,8 +1201,7 @@ set_mimic_blocking()
for (mon = fmon; mon; mon = mon->nmon) {
if (DEADMONSTER(mon))
continue;
if (mon->minvis && (is_door_mappear(mon)
|| is_obj_mappear(mon,BOULDER))) {
if (mon->minvis && is_lightblocker_mappear(mon)) {
if (See_invisible)
block_point(mon->mx, mon->my);
else
+130 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 do_name.c $NHDT-Date: 1450178550 2015/12/15 11:22:30 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.80 $ */
/* NetHack 3.6 do_name.c $NHDT-Date: 1452064740 2016/01/06 07:19:00 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.84 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -6,6 +6,9 @@
STATIC_DCL char *NDECL(nextmbuf);
STATIC_DCL void FDECL(getpos_help, (BOOLEAN_P, const char *));
STATIC_DCL int FDECL(CFDECLSPEC cmp_coord_distu, (const void *,
const void *));
STATIC_OVL void FDECL(gather_locs, (coord **, int *, BOOLEAN_P));
STATIC_DCL void NDECL(do_mname);
STATIC_DCL boolean FDECL(alreadynamed, (struct monst *, char *, char *));
STATIC_DCL void FDECL(do_oname, (struct obj *));
@@ -30,7 +33,7 @@ nextmbuf()
/* function for getpos() to highlight desired map locations.
* parameter value 0 = initialize, 1 = highlight, 2 = done
*/
void FDECL((*getpos_hilitefunc), (int)) = (void FDECL((*), (int))) 0;
static void FDECL((*getpos_hilitefunc), (int)) = (void FDECL((*), (int))) 0;
void
getpos_sethilite(f)
@@ -55,6 +58,8 @@ const char *goal;
putstr(tmpwin, 0, "Use [HJKL] to move the cursor 8 units at a time.");
putstr(tmpwin, 0, "Or enter a background symbol (ex. <).");
putstr(tmpwin, 0, "Use @ to move the cursor on yourself.");
putstr(tmpwin, 0, "Use m or M to move the cursor to next monster.");
putstr(tmpwin, 0, "Use o or O to move the cursor to next object.");
if (getpos_hilitefunc)
putstr(tmpwin, 0, "Use $ to display valid locations.");
putstr(tmpwin, 0, "Use # to toggle automatic description.");
@@ -71,6 +76,80 @@ const char *goal;
destroy_nhwindow(tmpwin);
}
STATIC_OVL int
cmp_coord_distu(a, b)
const void *a;
const void *b;
{
const coord *c1 = a;
const coord *c2 = b;
int dx, dy, dist_1, dist_2;
dx = u.ux - c1->x;
dy = u.uy - c1->y;
dist_1 = dx * dx + dy * dy;
dx = u.ux - c2->x;
dy = u.uy - c2->y;
dist_2 = dx * dx + dy * dy;
return dist_1 - dist_2;
}
/* gather locations for monsters or objects shown on the map */
STATIC_OVL void
gather_locs(arr_p, cnt_p, do_mons)
coord **arr_p;
int *cnt_p;
boolean do_mons;
{
int x, y, pass, glyph, idx;
*cnt_p = idx = 0;
for (pass = 0; pass < 2; pass++) {
if (pass) {
/* *cnt_p + 1: always allocate a non-zero amount */
*arr_p = (coord *) alloc(sizeof (coord) * (*cnt_p + 1));
if (!*cnt_p) {
/* needed for caller's mon[0].x,.y==u.ux,.uy check */
(*arr_p)[0].x = (*arr_p)[0].y = 0;
break;
}
}
for (x = 1; x < COLNO; x++)
for (y = 0; y < ROWNO; y++) {
glyph = glyph_at(x, y);
if (do_mons) {
/* unlike '/M', this skips monsters revealed by
* warning glyphs and remembered invisible ones;
* TODO: skip worm tails
*/
if (glyph_is_monster(glyph)) {
if (!pass) {
++*cnt_p;
} else {
(*arr_p)[idx].x = x;
(*arr_p)[idx].y = y;
++idx;
}
}
} else { /* objects */
/* TODO: skip boulders and rocks */
if (glyph_is_object(glyph)) {
if (!pass) {
++*cnt_p;
} else {
(*arr_p)[idx].x = x;
(*arr_p)[idx].y = y;
++idx;
}
}
}
}
} /* pass */
if (*cnt_p)
qsort(*arr_p, *cnt_p, sizeof (coord), cmp_coord_distu);
}
int
getpos(ccp, force, goal)
coord *ccp;
@@ -85,6 +164,8 @@ const char *goal;
static const char pick_chars[] = ".,;:";
const char *cp;
boolean hilite_state = FALSE;
coord *monarr = (coord *) 0, *objarr = (coord *) 0;
int moncount = 0, monidx = 0, objcount = 0, objidx = 0;
if (!goal)
goal = "desired location";
@@ -192,7 +273,7 @@ const char *goal;
if (c == '?' || redraw_cmd(c)) {
if (c == '?')
getpos_help(force, goal);
else /* ^R */
else /* ^R */
docrt(); /* redraw */
/* update message window to reflect that we're still targetting */
show_goal_msg = TRUE;
@@ -217,10 +298,52 @@ const char *goal;
cx = u.ux;
cy = u.uy;
goto nxtc;
} else if (c == 'm' || c == 'M') {
if (!monarr) {
gather_locs(&monarr, &moncount, TRUE);
/* when hero is first element (always, unless unseen),
we want first increment to reach 1 (nearest aside
from hero) or first decrement to reach moncount-1
(farthest); if hero is not first element, we want
first increment to end up with 0 (nearest monster),
first decrement should still choose moncount-1 */
monidx = (monarr[0].x == u.ux && monarr[0].y == u.uy) ? 0
: (c == 'm') ? -1 : 0;
}
if (moncount) {
if (c == 'm') {
monidx = (monidx + 1) % moncount;
} else {
if (--monidx < 0)
monidx = moncount - 1;
}
cx = monarr[monidx].x;
cy = monarr[monidx].y;
goto nxtc;
}
} else if (c == 'o' || c == 'O') {
if (!objarr) {
gather_locs(&objarr, &objcount, FALSE);
/* ready for first increment to change to zero
or first decrement to change to objcount-1 */
objidx = (c == 'o') ? -1 : 0;
}
if (objcount) {
if (c == 'o') {
objidx = (objidx + 1) % objcount;
} else {
if (--objidx < 0)
objidx = objcount - 1;
}
cx = objarr[objidx].x;
cy = objarr[objidx].y;
goto nxtc;
}
} else {
if (!index(quitchars, c)) {
char matching[MAXPCHARS];
int pass, lo_x, lo_y, hi_x, hi_y, k = 0;
(void) memset((genericptr_t) matching, 0, sizeof matching);
for (sidx = 1; sidx < MAXPCHARS; sidx++)
if (c == defsyms[sidx].sym || c == (int) showsyms[sidx])
@@ -307,6 +430,10 @@ const char *goal;
clear_nhwindow(WIN_MESSAGE);
ccp->x = cx;
ccp->y = cy;
if (monarr)
free((genericptr_t) monarr);
if (objarr)
free((genericptr_t) objarr);
getpos_hilitefunc = (void FDECL((*), (int))) 0;
return result;
}
+1 -2
View File
@@ -325,8 +325,7 @@ boolean with_you;
xyflags = mtmp->mtrack[0].y;
xlocale = mtmp->mtrack[1].x;
ylocale = mtmp->mtrack[1].y;
mtmp->mtrack[0].x = mtmp->mtrack[0].y = 0;
mtmp->mtrack[1].x = mtmp->mtrack[1].y = 0;
memset(mtmp->mtrack, 0, sizeof(mtmp->mtrack));
if (mtmp == u.usteed)
return; /* don't place steed on the map */
+1 -2
View File
@@ -16,7 +16,6 @@ STATIC_DCL void FDECL(check_shop_obj, (struct obj *, XCHAR_P, XCHAR_P,
BOOLEAN_P));
STATIC_DCL void FDECL(breakmsg, (struct obj *, BOOLEAN_P));
STATIC_DCL boolean FDECL(toss_up, (struct obj *, BOOLEAN_P));
STATIC_DCL boolean FDECL(throwing_weapon, (struct obj *));
STATIC_DCL void FDECL(sho_obj_return_to_u, (struct obj * obj));
STATIC_DCL boolean FDECL(mhurtle_step, (genericptr_t, int, int));
@@ -943,7 +942,7 @@ boolean hitsroof;
}
/* return true for weapon meant to be thrown; excludes ammo */
STATIC_OVL boolean
boolean
throwing_weapon(obj)
struct obj *obj;
{
+2
View File
@@ -1431,6 +1431,8 @@ struct obj *otmp;
case ELVEN_DAGGER:
case ORCISH_DAGGER:
case ATHAME:
case KNIFE:
case STILETTO:
case CRYSKNIFE:
tmp = 3;
break;
+6
View File
@@ -3120,6 +3120,11 @@ const char *reason; /* explanation */
program_state.in_paniclog = 1;
lfile = fopen_datafile(PANICLOG, "a", TROUBLEPREFIX);
if (lfile) {
#ifdef PANICLOG_FMT2
(void) fprintf(lfile, "%ld %s: %s %s\n",
ubirthday, (plname ? plname : "(none)"),
type, reason);
#else
time_t now = getnow();
int uid = getuid();
char playmode = wizard ? 'D' : discover ? 'X' : '-';
@@ -3127,6 +3132,7 @@ const char *reason; /* explanation */
(void) fprintf(lfile, "%s %08ld %06ld %d %c: %s %s\n",
version_string(buf), yyyymmdd(now), hhmmss(now),
uid, playmode, type, reason);
#endif /* !PANICLOG_FMT2 */
(void) fclose(lfile);
}
program_state.in_paniclog = 0;
+16
View File
@@ -827,6 +827,9 @@ int mode;
} else if (mode == TEST_TRAV) {
struct obj *obj;
/* never travel through boulders in Sokoban */
if (Sokoban) return FALSE;
/* don't pick two boulders in a row, unless there's a way thru */
if (sobj_at(BOULDER, ux, uy) && !Sokoban) {
if (!Passes_walls
@@ -1434,6 +1437,19 @@ domove()
}
}
if (context.forcefight && levl[x][y].typ == IRONBARS && uwep) {
struct obj *obj = uwep;
if (breaktest(obj)) {
if (obj->quan > 1L)
obj = splitobj(obj, 1L);
else
setuwep((struct obj *)0);
freeinv(obj);
}
hit_bars(&obj, u.ux, u.uy, x, y, TRUE, TRUE);
return;
}
/* specifying 'F' with no monster wastes a turn */
if (context.forcefight
/* remembered an 'I' && didn't use a move command */
+28 -39
View File
@@ -434,6 +434,7 @@ struct obj *obj;
{
struct obj *otmp, *prev;
int saved_otyp = (int) obj->otyp; /* for panic */
boolean obj_was_thrown;
if (obj->where != OBJ_FREE)
panic("addinv: obj not free");
@@ -442,6 +443,7 @@ struct obj *obj;
obj->no_charge = 0; /* should not be set in hero's invent */
if (Has_contents(obj))
picked_container(obj); /* clear no_charge */
obj_was_thrown = obj->was_thrown;
obj->was_thrown = 0; /* not meaningful for invent */
addinv_core1(obj);
@@ -476,6 +478,10 @@ struct obj *obj;
}
obj->where = OBJ_INVENT;
/* fill empty quiver if obj was thrown */
if (flags.pickup_thrown && !uquiver && obj_was_thrown
&& (throwing_weapon(obj) || is_ammo(obj)))
setuqwep(obj);
added:
addinv_core2(obj);
carry_obj_effects(obj); /* carrying affects the obj */
@@ -964,8 +970,8 @@ register const char *let, *word;
boolean allownone = FALSE;
boolean useboulder = FALSE;
xchar foox = 0;
long cnt, prevcnt;
boolean prezero;
long cnt;
boolean cntgiven = FALSE;
long dummymask;
if (*let == ALLOW_COUNT)
@@ -1157,9 +1163,7 @@ register const char *let, *word;
}
for (;;) {
cnt = 0;
if (allowcnt == 2)
allowcnt = 1; /* abort previous count */
prezero = FALSE;
cntgiven = FALSE;
if (!buf[0]) {
Sprintf(qbuf, "What do you want to %s? [*]", word);
} else {
@@ -1169,28 +1173,17 @@ register const char *let, *word;
ilet = readchar();
else
ilet = yn_function(qbuf, (char *) 0, '\0');
if (digit(ilet) && !allowcnt) {
pline("No count allowed with this command.");
continue;
}
if (ilet == '0')
prezero = TRUE;
while (digit(ilet)) {
if (ilet != '?' && ilet != '*')
savech(ilet);
/* accumulate unless cnt has overflowed */
if (allowcnt < 3) {
prevcnt = cnt;
cnt = 10L * cnt + (long) (ilet - '0');
/* signal presence of cnt */
allowcnt = (cnt >= prevcnt) ? 2 : 3;
if (digit(ilet)) {
long tmpcnt = 0;
if (!allowcnt) {
pline("No count allowed with this command.");
continue;
}
ilet = get_count(NULL, ilet, LARGEST_INT, &tmpcnt);
if (tmpcnt) {
cnt = tmpcnt;
cntgiven = TRUE;
}
ilet = readchar();
}
if (allowcnt == 3) {
/* overflow detected; force cnt to be invalid */
cnt = -1L;
allowcnt = 2;
}
if (index(quitchars, ilet)) {
if (flags.verbose)
@@ -1231,9 +1224,7 @@ register const char *let, *word;
continue;
if (allowcnt && ctmp >= 0) {
cnt = ctmp;
if (!cnt)
prezero = TRUE;
allowcnt = 2;
cntgiven = TRUE;
}
if (ilet == '\033') {
if (flags.verbose)
@@ -1261,23 +1252,21 @@ register const char *let, *word;
* to your money supply. The LRS is the tax bureau
* from Larn.
*/
if (allowcnt == 2 && cnt <= 0) {
if (cnt < 0 || !prezero)
if (cntgiven && cnt <= 0) {
if (cnt < 0)
pline_The(
"LRS would be very interested to know you have that much.");
return (struct obj *) 0;
}
}
if (allowcnt == 2 && !strcmp(word, "throw")) {
if (cntgiven && !strcmp(word, "throw")) {
/* permit counts for throwing gold, but don't accept
* counts for other things since the throw code will
* split off a single item anyway */
if (ilet != def_oc_syms[COIN_CLASS].sym
&& !(otmp && otmp->oclass == COIN_CLASS))
allowcnt = 1;
if (cnt == 0 && prezero)
if (cnt == 0)
return (struct obj *) 0;
if (cnt > 1) {
if (cnt > 1 && (ilet != def_oc_syms[COIN_CLASS].sym
&& !(otmp && otmp->oclass == COIN_CLASS))) {
You("can only throw one item at a time.");
continue;
}
@@ -1305,7 +1294,7 @@ register const char *let, *word;
silly_thing(word, otmp);
return (struct obj *) 0;
}
if (allowcnt == 2) { /* cnt given */
if (cntgiven) {
if (cnt == 0)
return (struct obj *) 0;
if (cnt != otmp->quan) {
@@ -2193,7 +2182,7 @@ char avoidlet;
}
end_menu(win, "Inventory letters used:");
n = select_menu(win, PICK_NONE, &selected);
n = select_menu(win, PICK_ONE, &selected);
if (n > 0) {
ret = selected[0].item.a_char;
free((genericptr_t) selected);
+119 -2
View File
@@ -1,10 +1,14 @@
/* NetHack 3.6 mail.c $NHDT-Date: 1450261364 2015/12/16 10:22:44 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.22 $ */
/* NetHack 3.6 mail.c $NHDT-Date: 1451955080 2016/01/05 00:51:20 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.25 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
#include "hack.h"
#ifdef MAIL
#ifdef SIMPLE_MAIL
# include <fcntl.h>
# include <errno.h>
#endif /* SIMPLE_MAIL */
#include "mail.h"
/*
@@ -466,6 +470,8 @@ struct obj *otmp UNUSED;
void
ckmailstatus()
{
ck_server_admin_msg();
if (!mailbox || u.uswallow || !flags.biff
#ifdef MAILCKFREQ
|| moves < laststattime + MAILCKFREQ
@@ -498,6 +504,112 @@ ckmailstatus()
}
}
#if defined(SIMPLE_MAIL) || defined(SERVER_ADMIN_MSG)
void
read_simplemail(mbox, adminmsg)
char *mbox;
boolean adminmsg;
{
FILE* mb = fopen(mbox, "r");
char curline[128], *msg;
boolean seen_one_already = FALSE;
#ifdef SIMPLE_MAIL
struct flock fl = { 0 };
#endif
const char *msgfrom = adminmsg
? "The voice of %s booms through the caverns:"
: "This message is from '%s'.";
if (!mb)
goto bail;
#ifdef SIMPLE_MAIL
fl.l_type = F_RDLCK;
fl.l_whence = SEEK_SET;
fl.l_start = 0;
fl.l_len = 0;
errno = 0;
#endif
/* Allow this call to block. */
if (!adminmsg
#ifdef SIMPLE_MAIL
&& fcntl (fileno (mb), F_SETLKW, &fl) == -1
#endif
)
goto bail;
while (fgets(curline, 128, mb) != NULL) {
if (!adminmsg) {
#ifdef SIMPLE_MAIL
fl.l_type = F_UNLCK;
fcntl (fileno(mb), F_UNLCK, &fl);
#endif
pline("There is a%s message on this scroll.",
seen_one_already ? "nother" : "");
}
msg = strchr(curline, ':');
if (!msg)
goto bail;
*msg = '\0';
msg++;
msg[strlen(msg) - 1] = '\0'; /* kill newline */
pline(msgfrom, curline);
if (adminmsg)
verbalize(msg);
else
pline("It reads: \"%s\".", msg);
seen_one_already = TRUE;
#ifdef SIMPLE_MAIL
errno = 0;
if (!adminmsg) {
fl.l_type = F_RDLCK;
fcntl(fileno(mb), F_SETLKW, &fl);
}
#endif
}
#ifdef SIMPLE_MAIL
if (!adminmsg) {
fl.l_type = F_UNLCK;
fcntl(fileno(mb), F_UNLCK, &fl);
}
#endif
fclose(mb);
if (adminmsg)
display_nhwindow(WIN_MESSAGE, TRUE);
else
unlink(mailbox);
return;
bail:
/* bail out _professionally_ */
if (!adminmsg)
pline("It appears to be all gibberish.");
}
#endif /* SIMPLE_MAIL */
void
ck_server_admin_msg()
{
#ifdef SERVER_ADMIN_MSG
static struct stat ost,nst;
static long lastchk = 0;
if (moves < lastchk + SERVER_ADMIN_MSG_CKFREQ) return;
lastchk = moves;
if (!stat(SERVER_ADMIN_MSG, &nst)) {
if (nst.st_mtime > ost.st_mtime)
read_simplemail(SERVER_ADMIN_MSG, TRUE);
ost.st_mtime = nst.st_mtime;
}
#endif /* SERVER_ADMIN_MSG */
}
/*ARGSUSED*/
void
readmail(otmp)
@@ -505,7 +617,12 @@ struct obj *otmp UNUSED;
{
#ifdef DEF_MAILREADER /* This implies that UNIX is defined */
register const char *mr = 0;
#endif /* DEF_MAILREADER */
#ifdef SIMPLE_MAIL
read_simplemail(mailbox, FALSE);
return;
#endif /* SIMPLE_MAIL */
#ifdef DEF_MAILREADER /* This implies that UNIX is defined */
display_nhwindow(WIN_MESSAGE, FALSE);
if (!(mr = nh_getenv("MAILREADER")))
mr = DEF_MAILREADER;
+15 -18
View File
@@ -19,7 +19,6 @@ STATIC_DCL void FDECL(maze0xy, (coord *));
STATIC_DCL boolean FDECL(put_lregion_here, (XCHAR_P, XCHAR_P, XCHAR_P,
XCHAR_P, XCHAR_P, XCHAR_P,
XCHAR_P, BOOLEAN_P, d_level *));
STATIC_DCL void NDECL(fixup_special);
STATIC_DCL void NDECL(setup_waterlevel);
STATIC_DCL void NDECL(unsetup_waterlevel);
@@ -123,13 +122,9 @@ int wall_there, dx, dy;
return spine;
}
/*
* Wall cleanup. This function has two purposes: (1) remove walls that
* are totally surrounded by stone - they are redundant. (2) correct
* the types so that they extend and connect to each other.
*/
/* Remove walls totally surrounded by stone */
void
wallification(x1, y1, x2, y2)
wall_cleanup(x1, y1, x2, y2)
int x1, y1, x2, y2;
{
uchar type;
@@ -138,9 +133,9 @@ int x1, y1, x2, y2;
/* sanity check on incoming variables */
if (x1 < 0 || x2 >= COLNO || x1 > x2 || y1 < 0 || y2 >= ROWNO || y1 > y2)
panic("wallification: bad bounds (%d,%d) to (%d,%d)", x1, y1, x2, y2);
panic("wall_cleanup: bad bounds (%d,%d) to (%d,%d)", x1, y1, x2, y2);
/* Step 1: change walls surrounded by rock to rock. */
/* change walls surrounded by rock to rock. */
for (x = x1; x <= x2; x++)
for (y = y1; y <= y2; y++) {
lev = &levl[x][y];
@@ -153,10 +148,9 @@ int x1, y1, x2, y2;
lev->typ = STONE;
}
}
fix_wall_spines(x1,y1,x2,y2);
}
/* Correct wall types so they extend and connect to each other */
void
fix_wall_spines(x1, y1, x2, y2)
int x1, y1, x2, y2;
@@ -181,11 +175,7 @@ int x1, y1, x2, y2;
if (x1<0 || x2>=COLNO || x1>x2 || y1<0 || y2>=ROWNO || y1>y2)
panic("wall_extends: bad bounds (%d,%d) to (%d,%d)",x1,y1,x2,y2);
/*
* Step 2: set the correct wall type. We can't combine steps
* 1 and 2 into a single sweep because we depend on knowing if
* the surrounding positions are stone.
*/
/* set the correct wall type. */
for (x = x1; x <= x2; x++)
for (y = y1; y <= y2; y++) {
lev = &levl[x][y];
@@ -217,6 +207,14 @@ int x1, y1, x2, y2;
}
}
void
wallification(x1, y1, x2, y2)
int x1, y1, x2, y2;
{
wall_cleanup(x1,y1,x2,y2);
fix_wall_spines(x1,y1,x2,y2);
}
STATIC_OVL boolean
okay(x, y, dir)
int x, y;
@@ -363,7 +361,7 @@ d_level *lev;
static boolean was_waterlevel; /* ugh... this shouldn't be needed */
/* this is special stuff that the level compiler cannot (yet) handle */
STATIC_OVL void
void
fixup_special()
{
register lev_region *r = lregions;
@@ -578,7 +576,6 @@ register const char *s;
if (*protofile) {
Strcat(protofile, LEV_EXT);
if (load_special(protofile)) {
fixup_special();
/* some levels can end up with monsters
on dead mon list, including light source monsters */
dmonsfree();
+3 -2
View File
@@ -1653,6 +1653,8 @@ struct permonst *mptr; /* reflects mtmp->data _prior_ to mtmp's death */
remove_monster(mtmp->mx, mtmp->my);
if (emits_light(mptr))
del_light_source(LS_MONSTER, monst_to_any(mtmp));
if (mtmp->m_ap_type)
seemimic(mtmp);
newsym(mtmp->mx, mtmp->my);
unstuck(mtmp);
fill_pit(mtmp->mx, mtmp->my);
@@ -2616,8 +2618,7 @@ void
seemimic(mtmp)
register struct monst *mtmp;
{
boolean is_blocker_appear = (is_door_mappear(mtmp)
|| is_obj_mappear(mtmp, BOULDER));
boolean is_blocker_appear = (is_lightblocker_mappear(mtmp));
if (has_mcorpsenm(mtmp))
freemcorpsenm(mtmp);
+2
View File
@@ -271,6 +271,8 @@ boolean fleemsg;
}
mtmp->mflee = 1;
}
/* ignore recently-stepped spaces when made to flee */
memset(mtmp->mtrack, 0, sizeof(mtmp->mtrack));
}
STATIC_OVL void
+44 -15
View File
@@ -318,7 +318,9 @@ struct obj *obj; /* missile (or stack providing it) */
|| IS_ROCK(levl[bhitpos.x + dx][bhitpos.y + dy].typ)
|| closed_door(bhitpos.x + dx, bhitpos.y + dy)
|| (levl[bhitpos.x + dx][bhitpos.y + dy].typ == IRONBARS
&& hits_bars(&singleobj, bhitpos.x, bhitpos.y, 0, 0))) {
&& hits_bars(&singleobj,
bhitpos.x, bhitpos.y,
bhitpos.x + dx, bhitpos.y + dy, 0, 0))) {
(void) drop_throw(singleobj, 0, bhitpos.x, bhitpos.y);
return;
}
@@ -455,7 +457,10 @@ struct obj *obj; /* missile (or stack providing it) */
|| closed_door(bhitpos.x + dx, bhitpos.y + dy)
/* missile might hit iron bars */
|| (levl[bhitpos.x + dx][bhitpos.y + dy].typ == IRONBARS
&& hits_bars(&singleobj, bhitpos.x, bhitpos.y, !rn2(5), 0))
&& hits_bars(&singleobj,
bhitpos.x, bhitpos.y,
bhitpos.x + dx, bhitpos.y + dy,
!rn2(5), 0))
/* Thrown objects "sink" */
|| IS_SINK(levl[bhitpos.x][bhitpos.y].typ)) {
if (singleobj) /* hits_bars might have destroyed it */
@@ -831,11 +836,45 @@ int type;
return (struct obj *) 0;
}
void
hit_bars(objp, objx, objy, barsx, barsy, your_fault, from_invent)
struct obj **objp; /* *objp will be set to NULL if object breaks */
int objx, objy, barsx, barsy;
boolean your_fault, from_invent;
{
struct obj *otmp = *objp;
int obj_type = otmp->otyp;
boolean unbreakable = (levl[barsx][barsy].wall_info & W_NONDIGGABLE) != 0;
if (your_fault
? hero_breaks(otmp, objx, objy, from_invent)
: breaks(otmp, objx, objy)) {
*objp = 0; /* object is now gone */
/* breakage makes its own noises */
if (obj_type == POT_ACID) {
if (cansee(barsx, barsy) && !unbreakable)
pline_The("iron bars are dissolved!");
else
You_hear(Hallucination ? "angry snakes!" : "a hissing noise.");
if (!unbreakable)
dissolve_bars(barsx, barsy);
}
}
else if (obj_type == BOULDER || obj_type == HEAVY_IRON_BALL)
pline("Whang!");
else if (otmp->oclass == COIN_CLASS
|| objects[obj_type].oc_material == GOLD
|| objects[obj_type].oc_material == SILVER)
pline("Clink!");
else
pline("Clonk!");
}
/* TRUE iff thrown/kicked/rolled object doesn't pass through iron bars */
boolean
hits_bars(obj_p, x, y, always_hit, whodidit)
hits_bars(obj_p, x, y, barsx, barsy, always_hit, whodidit)
struct obj **obj_p; /* *obj_p will be set to NULL if object breaks */
int x, y;
int x, y, barsx, barsy;
int always_hit; /* caller can force a hit for items which would fit through */
int whodidit; /* 1==hero, 0=other, -1==just check whether it'll pass thru */
{
@@ -885,17 +924,7 @@ int whodidit; /* 1==hero, 0=other, -1==just check whether it'll pass thru */
}
if (hits && whodidit != -1) {
if (whodidit ? hero_breaks(otmp, x, y, FALSE) : breaks(otmp, x, y))
*obj_p = otmp = 0; /* object is now gone */
/* breakage makes its own noises */
else if (obj_type == BOULDER || obj_type == HEAVY_IRON_BALL)
pline("Whang!");
else if (otmp->oclass == COIN_CLASS
|| objects[obj_type].oc_material == GOLD
|| objects[obj_type].oc_material == SILVER)
pline("Clink!");
else
pline("Clonk!");
hit_bars(obj_p, x,y, barsx,barsy, whodidit, FALSE);
}
return hits;
+19 -1
View File
@@ -426,6 +426,23 @@ int force;
}
}
const char *
generic_lvl_desc()
{
if (Is_astralevel(&u.uz))
return "astral plane";
else if (In_endgame(&u.uz))
return "plane";
else if (Is_sanctum(&u.uz))
return "sanctum";
else if (In_sokoban(&u.uz))
return "puzzle";
else if (In_V_tower(&u.uz))
return "tower";
else
return "dungeon";
}
/*
* The player is trying to extract something from his/her instrument.
*/
@@ -537,7 +554,8 @@ struct obj *instr;
consume_obj_charge(instr, TRUE);
You("produce a heavy, thunderous rolling!");
pline_The("entire dungeon is shaking around you!");
pline_The("entire %s is shaking around you!",
generic_lvl_desc());
do_earthquake((u.ulevel - 1) / 3 + 1);
/* shake up monsters in a much larger radius... */
awaken_monsters(ROWNO * COLNO);
+13 -5
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 objnam.c $NHDT-Date: 1451683056 2016/01/01 21:17:36 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.162 $ */
/* NetHack 3.6 objnam.c $NHDT-Date: 1452043772 2016/01/06 01:29:32 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.163 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1102,6 +1102,8 @@ register struct obj *otmp;
|| is_flammable(otmp));
}
/* format a corpse name (xname() omits monster type; doname() calls us);
eatcorpse() also uses us for death reason when eating tainted glob */
char *
corpse_xname(otmp, adjective, cxn_flags)
struct obj *otmp;
@@ -1118,10 +1120,14 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */
/* include "an" for "an ogre corpse */
any_prefix = (cxn_flags & CXN_ARTICLE) != 0,
/* leave off suffix (do_name() appends "corpse" itself) */
omit_corpse = (cxn_flags & CXN_NOCORPSE) != 0, possessive = FALSE;
omit_corpse = (cxn_flags & CXN_NOCORPSE) != 0,
possessive = FALSE,
glob = (otmp->otyp != CORPSE && otmp->globby);
const char *mname;
if (omndx == NON_PM) { /* paranoia */
if (glob) {
mname = OBJ_NAME(objects[otmp->otyp]); /* "glob of <monster>" */
} else if (omndx == NON_PM) { /* paranoia */
mname = "thing";
/* [Possible enhancement: check whether corpse has monster traits
attached in order to use priestname() for priests and minions.] */
@@ -1172,7 +1178,9 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */
any_prefix = FALSE;
}
if (!omit_corpse) {
if (glob) {
; /* omit_corpse doesn't apply; quantity is always 1 */
} else if (!omit_corpse) {
Strcat(nambuf, " corpse");
/* makeplural(nambuf) => append "s" to "corpse" */
if (otmp->quan > 1L && !ignore_quan) {
@@ -3525,7 +3533,7 @@ typfnd:
}
otmp->owt = weight(otmp);
if (very && otmp->otyp == HEAVY_IRON_BALL)
otmp->owt += 160;
otmp->owt += IRON_BALL_W_INCR;
return otmp;
}
+1
View File
@@ -3384,6 +3384,7 @@ boolean tinitial, tfrom_file;
need_redraw = TRUE; /* darkroom refresh */
} else if ((boolopt[i].addr) == &iflags.use_inverse
|| (boolopt[i].addr) == &flags.showrace
|| (boolopt[i].addr) == &iflags.hilite_pile
|| (boolopt[i].addr) == &iflags.hilite_pet) {
need_redraw = TRUE;
#ifdef TEXTCOLOR
+1 -1
View File
@@ -2271,7 +2271,7 @@ struct obj *sobj;
You("are being punished for your misbehavior!");
if (Punished) {
Your("iron ball gets heavier.");
uball->owt += 160 * (1 + sobj->cursed);
uball->owt += IRON_BALL_W_INCR * (1 + sobj->cursed);
return;
}
if (amorphous(youmonst.data) || is_whirly(youmonst.data)
-2
View File
@@ -3118,8 +3118,6 @@ quit:
return 0;
}
#define HUNGRY 2
STATIC_OVL long
getprice(obj, shk_buying)
register struct obj *obj;
+12 -6
View File
@@ -1873,11 +1873,12 @@ struct mkroom *croom;
}
}
} else {
struct obj *cobj = container_obj[container_idx - 1];
remove_object(otmp);
if (container_obj[container_idx - 1])
(void) add_to_container(container_obj[container_idx - 1],
otmp);
else {
if (cobj) {
(void) add_to_container(cobj, otmp);
cobj->owt = weight(cobj);
} else {
obj_extract_self(otmp);
obfree(otmp, NULL);
return;
@@ -5863,11 +5864,16 @@ sp_lev *lvl;
count_features();
if (coder->premapped)
sokoban_detect();
if (coder->solidify)
solidify_map();
/* This must be done before sokoban_detect(),
* otherwise branch stairs won't be premapped. */
fixup_special();
if (coder->premapped)
sokoban_detect();
if (coder->frame) {
struct sp_frame *tmpframe;
do {
+1
View File
@@ -980,6 +980,7 @@ register int x, y;
}
}
memset(mtmp->mtrack, 0, sizeof(mtmp->mtrack));
place_monster(mtmp, x, y); /* put monster down */
update_monster_region(mtmp);
+9 -4
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 trap.c $NHDT-Date: 1451176031 2015/12/27 00:27:11 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.252 $ */
/* NetHack 3.6 trap.c $NHDT-Date: 1452039453 2016/01/06 00:17:33 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.253 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1889,7 +1889,9 @@ int style;
if (dist > 0 && isok(bhitpos.x + dx, bhitpos.y + dy)
&& levl[bhitpos.x + dx][bhitpos.y + dy].typ == IRONBARS) {
x2 = bhitpos.x, y2 = bhitpos.y; /* object stops here */
if (hits_bars(&singleobj, x2, y2, !rn2(20), 0)) {
if (hits_bars(&singleobj,
x2, y2, x2+dx, y2+dy,
!rn2(20), 0)) {
if (!singleobj) {
used_up = TRUE;
launch_drop_spot((struct obj *) 0, 0, 0);
@@ -4999,13 +5001,13 @@ lava_effects()
&& objects[obj->otyp].oc_oprop != FIRE_RES
&& obj->otyp != SCR_FIRE && obj->otyp != SPE_FIREBALL
&& !obj_resists(obj, 0, 0)) /* for invocation items */
obj->in_use = TRUE;
obj->in_use = 1;
/* Check whether we should burn away boots *first* so we know whether to
* make the player sink into the lava. Assumption: water walking only
* comes from boots.
*/
if (Wwalking && uarmf && is_organic(uarmf) && !uarmf->oerodeproof) {
if (uarmf && is_organic(uarmf) && !uarmf->oerodeproof) {
obj = uarmf;
pline("%s into flame!", Yobjnam2(obj, "burst"));
iflags.in_lava_effects++; /* (see above) */
@@ -5119,6 +5121,9 @@ sink_into_lava()
You("sink below the surface and die.");
burn_away_slime(); /* add insult to injury? */
done(DISSOLVED);
/* can only get here via life-saving; try to get away from lava */
u.utrap = 0;
(void) safe_teleds(TRUE);
} else if (!u.umoved) {
/* can't fully turn into slime while in lava, but might not
have it be burned away until you've come awfully close */
+67 -23
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 vault.c $NHDT-Date: 1446078792 2015/10/29 00:33:12 $ $NHDT-Branch: master $:$NHDT-Revision: 1.39 $ */
/* NetHack 3.6 vault.c $NHDT-Date: 1451962301 2016/01/05 02:51:41 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.40 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -342,7 +342,7 @@ invault()
newsym(guard->mx, guard->my);
if (u.uswallow) {
/* can't interrogate hero, don't interrogate engulfer */
verbalize("What's going on here?");
if (!Deaf) verbalize("What's going on here?");
if (gsensed)
pline_The("other presence vanishes.");
mongone(guard);
@@ -351,8 +351,8 @@ invault()
if (youmonst.m_ap_type == M_AP_OBJECT || u.uundetected) {
if (youmonst.m_ap_type == M_AP_OBJECT
&& youmonst.mappearance != GOLD_PIECE)
verbalize("Hey! Who left that %s in here?",
mimic_obj_name(&youmonst));
if (!Deaf) verbalize("Hey! Who left that %s in here?",
mimic_obj_name(&youmonst));
/* You're mimicking some object or you're hidden. */
pline("Puzzled, %s turns around and leaves.", mhe(guard));
mongone(guard);
@@ -362,7 +362,10 @@ invault()
/* [we ought to record whether this this message has already
been given in order to vary it upon repeat visits, but
discarding the monster and its egd data renders that hard] */
verbalize("I'll be back when you're ready to speak to me!");
if (Deaf)
pline("%s huffs and turns to leave.", noit_Monnam(guard));
else
verbalize("I'll be back when you're ready to speak to me!");
mongone(guard);
return;
}
@@ -374,9 +377,10 @@ invault()
}
trycount = 5;
do {
getlin("\"Hello stranger, who are you?\" -", buf);
getlin(Deaf ? "You are required to sign in with your name. -" :
"\"Hello stranger, who are you?\" -", buf);
(void) mungspaces(buf);
} while (!letter(buf[0]) && --trycount > 0);
} while (!buf[0] && --trycount > 0);
if (u.ualign.type == A_LAWFUL
/* ignore trailing text, in case player includes rank */
@@ -387,12 +391,22 @@ invault()
if (!strcmpi(buf, "Croesus") || !strcmpi(buf, "Kroisos")
|| !strcmpi(buf, "Creosote")) {
if (!mvitals[PM_CROESUS].died) {
verbalize(
if (Deaf) {
if (!Blind) pline("%s waves goodbye.", noit_Monnam(guard));
} else {
verbalize(
"Oh, yes, of course. Sorry to have disturbed you.");
}
mongone(guard);
} else {
setmangry(guard);
verbalize("Back from the dead, are you? I'll remedy that!");
if (Deaf) {
if (!Blind)
pline("%s mouths something and looks very angry!",
noit_Monnam(guard));
} else {
verbalize("Back from the dead, are you? I'll remedy that!");
}
/* don't want guard to waste next turn wielding a weapon */
if (!MON_WEP(guard)) {
guard->weapon_check = NEED_HTH_WEAPON;
@@ -401,18 +415,37 @@ invault()
}
return;
}
verbalize("I don't know you.");
if (Deaf)
pline("%s doesn't %srecognize you.", noit_Monnam(guard),
(Blind) ? "" : "appear to ");
else
verbalize("I don't know you.");
umoney = money_cnt(invent);
if (Deaf) {
;
} else if (!umoney && !hidden_gold()) {
verbalize("Please follow me.");
if (!umoney && !hidden_gold()) {
if (Deaf)
pline("%s stomps%s.", noit_Monnam(guard),
(Blind) ? "" : " and beckons");
else
verbalize("Please follow me.");
} else {
if (!umoney)
verbalize("You have hidden gold.");
verbalize(
"Most likely all your gold was stolen from this vault.");
verbalize("Please drop that gold and follow me.");
if (!umoney) {
if (Deaf) {
if (!Blind)
pline("%s glares at you%s.", noit_Monnam(guard),
invent ? "r stuff" : "");
} else {
verbalize("You have hidden gold.");
}
}
if (Deaf) {
if (!Blind)
pline("%s holds out %s palm and beckons with %s other hand.",
noit_Monnam(guard), mhis(guard), mhis(guard));
} else {
verbalize(
"Most likely all your gold was stolen from this vault.");
verbalize("Please drop that gold and follow me.");
}
}
EGD(guard)->gdx = gx;
EGD(guard)->gdy = gy;
@@ -578,8 +611,9 @@ register struct monst *grd;
return -1; /* teleported guard - treat as monster */
if (egrd->witness) {
verbalize("How dare you %s that gold, scoundrel!",
(egrd->witness & GD_EATGOLD) ? "consume" : "destroy");
if (!Deaf)
verbalize("How dare you %s that gold, scoundrel!",
(egrd->witness & GD_EATGOLD) ? "consume" : "destroy");
egrd->witness = 0;
grd->mpeaceful = 0;
return -1;
@@ -655,12 +689,22 @@ register struct monst *grd;
}
if (egrd->warncnt < 6) {
egrd->warncnt = 6;
if (!Deaf)
if (Deaf) {
if (!Blind)
pline("%s holds out %s palm demandingly!",
noit_Monnam(grd), mhis(grd));
} else {
verbalize("Drop all your gold, scoundrel!");
}
return 0;
} else {
if (!Deaf)
if (Deaf) {
if (!Blind)
pline("%s rubs %s hands with enraged delight!",
noit_Monnam(grd), mhis(grd));
} else {
verbalize("So be it, rogue!");
}
grd->mpeaceful = 0;
return -1;
}
+2 -2
View File
@@ -175,9 +175,9 @@ register struct rm *lev;
if (obj->otyp == BOULDER)
return 1;
/* Mimics mimicing a door or boulder block light. */
/* Mimics mimicing a door or boulder or ... block light. */
if ((mon = m_at(x, y)) && (!mon->minvis || See_invisible)
&& (is_door_mappear(mon) || is_obj_mappear(mon,BOULDER)))
&& is_lightblocker_mappear(mon))
return 1;
return 0;
+2 -2
View File
@@ -304,12 +304,12 @@ struct monst *mon;
if (ptr == &mons[PM_SHADE] && !shade_glare(otmp))
tmp = 0;
/* "very heavy iron ball"; weight increase is in increments of 160 */
/* "very heavy iron ball"; weight increase is in increments */
if (otyp == HEAVY_IRON_BALL && tmp > 0) {
int wt = (int) objects[HEAVY_IRON_BALL].oc_weight;
if ((int) otmp->owt > wt) {
wt = ((int) otmp->owt - wt) / 160;
wt = ((int) otmp->owt - wt) / IRON_BALL_W_INCR;
tmp += rnd(4 * wt);
if (tmp > 25)
tmp = 25; /* objects[].oc_wldam */
+12 -1
View File
@@ -2368,7 +2368,13 @@ boolean ordinary;
}
if (u.utrap) { /* escape web or bear trap */
(void) openholdingtrap(&youmonst, &learn_it);
} else { /* trigger previously escaped trapdoor */
} else {
struct obj *otmp;
/* unlock carried boxes */
for (otmp = invent; otmp; otmp = otmp->nobj)
if (Is_box(otmp))
(void) boxlock(otmp, obj);
/* trigger previously escaped trapdoor */
(void) openfallingtrap(&youmonst, TRUE, &learn_it);
}
break;
@@ -3097,6 +3103,7 @@ struct obj **pobj; /* object tossed/used, set to NULL
/* iron bars will block anything big enough */
if ((weapon == THROWN_WEAPON || weapon == KICKED_WEAPON)
&& typ == IRONBARS && hits_bars(pobj, x - ddx, y - ddy,
bhitpos.x, bhitpos.y,
point_blank ? 0 : !rn2(5), 1)) {
/* caveat: obj might now be null... */
obj = *pobj;
@@ -4305,6 +4312,10 @@ short exploding_wand_typ;
}
break; /* ZT_COLD */
case ZT_POISON_GAS:
(void) create_gas_cloud(x, y, 1, 8);
break;
case ZT_ACID:
if (lev->typ == IRONBARS) {
if ((lev->wall_info & W_NONDIGGABLE) != 0) {
+3 -1
View File
@@ -1351,7 +1351,7 @@ sp_lev *sp;
register char *s1, *s2;
int max_len = 0;
int max_hig = 0;
char *tmpmap[ROWNO];
char *tmpmap[MAP_Y_LIM+1];
int dx, dy;
char *mbuf;
@@ -1378,6 +1378,8 @@ sp_lev *sp;
/* Then parse it now */
while (map && *map) {
if (max_hig > MAP_Y_LIM)
break;
tmpmap[max_hig] = (char *) alloc(max_len);
s1 = index(map, '\n');
if (s1) {
+5 -4
View File
@@ -441,7 +441,8 @@ makepicks:
Strcpy(pbuf, "Pick a role or profession");
end_menu(win, pbuf);
n = select_menu(win, PICK_ONE, &selected);
choice = (n == 1) ? selected[0].item.a_int : ROLE_NONE;
choice = (n == 1) ? selected[0].item.a_int
: (n == 0) ? ROLE_RANDOM : ROLE_NONE;
if (selected)
free((genericptr_t) selected), selected = 0;
destroy_nhwindow(win);
@@ -526,7 +527,7 @@ makepicks:
end_menu(win, pbuf);
n = select_menu(win, PICK_ONE, &selected);
choice = (n == 1) ? selected[0].item.a_int
: ROLE_NONE;
: (n == 0) ? ROLE_RANDOM : ROLE_NONE;
if (selected)
free((genericptr_t) selected), selected = 0;
destroy_nhwindow(win);
@@ -615,7 +616,7 @@ makepicks:
end_menu(win, pbuf);
n = select_menu(win, PICK_ONE, &selected);
choice = (n == 1) ? selected[0].item.a_int
: ROLE_NONE;
: (n == 0) ? ROLE_RANDOM : ROLE_NONE;
if (selected)
free((genericptr_t) selected), selected = 0;
destroy_nhwindow(win);
@@ -700,7 +701,7 @@ makepicks:
end_menu(win, pbuf);
n = select_menu(win, PICK_ONE, &selected);
choice = (n == 1) ? selected[0].item.a_int
: ROLE_NONE;
: (n == 0) ? ROLE_RANDOM : ROLE_NONE;
if (selected)
free((genericptr_t) selected), selected = 0;
destroy_nhwindow(win);