Commit Graph

3591 Commits

Author SHA1 Message Date
PatR
4c6c2b02ed baalz hack fixup fix...
I saw a lich in solid wall at one of the spots which gehennom.des
marks with a pool (so that baalz_fixup() can find the two spots that
need post-wallification fixup).  I could understand the special level
loader placing a swimming or flying monster there, but don't know
whether it might do that for a lich (which doesn't need to breathe)
so am not sure whether this actually fixes what I observed.

The lich was there for far too long to have been a shapechanger, but
when I went back to the save file it was no longer there, producing
another puzzle.
2016-04-25 00:58:44 -07:00
PatR
6a3d82ced6 fix #H4317 - grave diggin'
Digging a grave witha a pick-axe converted the grave to floor but
did not dig a pit and unearth the grave's contents.  [Caused by a
change to maketrap() intended to prevent wizard-mode wishing for
traps on top of furniture.]  Digging a second time succeeded in
creating a pit since the location was no longer furniture.
2016-04-25 00:14:48 -07:00
PatR
4750c0a303 sortloot ordering for holy/unholy water
When items were sorted alphabetically, holy water ended up in the H's
and unholy water in the U's.  Force them to get placed with water in
the W's, as would happen if water wasn't given an alternate name when
blessed or cursed.
2016-04-23 15:44:26 -07:00
Pasi Kallinen
0956054b30 Better wishing text match
Try harder to find a matching object, and if multiple objects would
match, pick one from all the matches at random.
2016-04-23 22:38:25 +03:00
PatR
ebe21e72b2 wizard-mode enlightenment
Add another 'from_what' reason for intrinsic/extrinsic attributes:
You are <whatever> intrinsically.
2016-04-23 11:58:20 -07:00
PatR
713d8cc492 piousness lint 2016-04-23 11:57:14 -07:00
Pasi Kallinen
638aa6969c Unify piousness strings 2016-04-23 12:00:02 +03:00
Pasi Kallinen
c5aa0ff368 Simplify the web destruction func 2016-04-22 22:47:43 +03:00
PatR
117334b20e Ft.Ludios entrance (fort's entry, not level entry)
The code to apply an automatic annotation to the knox level was looking
for a drawbridge like on the castle level, but knox doesn't have any
drawbridge.  Look for its door instead.  (It's initially a secret door,
so won't be revealed via magic mapping.  It needs to be found or
destroyed to get mapped as a door or empty doorway in order to trigger
the annotation.)

Also, give a tiny bit of variation to the knox level layout.  It used
to have both the throne and the secret door on the lower of two similar
rows and the door into the treasure vault on the upper one.  Now each
of the three can be on either of those two rows (independently of each
other), making eight possibilities.  This doesn't accomplish much,
other than to make the secret door locations not always be at the same
fixed spot.
2016-04-22 02:12:10 -07:00
PatR
23b3d5a126 newcham() feedback: "A <mon> turns into it!"
Silly shapechange message if <mon> is sensed via telepathy and takes
on a mindless form.  In the case I noticed, it was a doppelganger on
the far side of a maze wall who changed from something ordinary into
a mummy while the hero was wearing an amulet of esp.

3.6.0 could deliver this message, but I think changes since then have
increased the chance for newcham() to give shapechange feedback.
2016-04-21 16:45:19 -07:00
PatR
573fff466e formatting fixups
Presence of trailing whitespace pointed out so post-reformatting
non-conformant formatting.
2016-04-20 16:43:33 -07:00
PatR
1cad2bd783 more sortloot revamp fallout
getobj() was caching 'invent' in 'firstobj', dating from the days
of the !GOLDOBJ configuration, and sortloot() could change the value
of invent, making firstobj end up pointing somewhere into the midst
of the inventory list.  So collecting letters of applicable items
could miss things (typically right after restoring a saved game).
Repeating the command would operate on already sorted invent, making
firstobj remain valid and things mysteriously reappear after having
been missed before.

Just get rid of 'firstobj' since it's no longer useful.
2016-04-19 17:01:01 -07:00
PatR
a0a4408957 flags.sortloot tweaks
flags.sortloot was changed from boolean to xchar, but proper type
is plain char.  (Presumeably it was originally off or on, then got
changed to 'n' for off, 'l' for on, plus 'f' for super-on.)

Also, make the sortloot menu for 'O' mark the current value as
preselected when interactively setting the value.  (I've been
meaning to do this for various other options but haven't gotten
around to it.  The need to workaround PICK_ONE+MENU_SELECTED menu
behavior is a nuisance.)
2016-04-19 14:40:59 -07:00
PatR
daee9f3e7c fix deleting worn obj (uchain) impossibility
... when exploding chest trap destroys uchain without using
unpunish() to un-wear it first.  The '!carried(uball)' clause
should be applied to the uball->ox,oy test only, not to both
uchain->ox,oy and uball->ox,oy.
2016-04-19 11:30:11 -07:00
PatR
f9a47bb63d menu handling for ':' when hero is swallowed
Force the menu for the look-here command when 'here' is the inside
of an engulfer to be PICK_NONE.  That way '>' won't exit the menu
by choosing the extra inventory item "> - hero".
2016-04-18 18:15:58 -07:00
Pasi Kallinen
a181c2f93b Fix dead mon and guard sanity checking 2016-04-18 19:52:54 +03:00
PatR
d02ba84684 invent menu fixes (mostly menustyle:Traditional)
For menustyle:Traditional, the object class prompt for 'D' includes
an entry choice of 'm' to request a menu.  Supplying real classes
and 'm' resulted in a menu limited to those classes, as intended,
but any of BUCX for curse/bless state and 'm' without any actual
classes resulted in a menu of entire invent.  A one-line fix once
the proper place for that fix was located.

For menustyle:Traditional or menustyle:Combination, 'A' includes an
extra choice of 'i' to examine relevant inventory prior to choosing
object classes (and object identification also offers that), but
the inventory display showed everything rather than just the items
applicable to 'A' (or to object ID).  Figuring out where to apply
the fix was trivial, but the fix itself was a bit more involved and
it exposed a latent bug in display_pickinv(): "" was supposed to be
the same as NULL when passed in as list of target inventory letters,
but it wasn't being handled correctly.
2016-04-17 16:50:25 -07:00
Pasi Kallinen
8132cb5a42 Unify web burning or dissolving
Also make any flaming monster burn webs.

This also fixes a bug, where a gelatinous cube monster did not
dissolve the web.
2016-04-17 17:02:47 +03:00
PatR
828c244ff3 'R' fix
A patch in late January to suppress suits as likely candidates for
the 'R' command when wearing a cloak also unintentionally suppressed
rings when wearing non-cursed (or not yet known to be cursed) gloves.
Cloak always blocks suit removal; gloves only block ring removal if
cursed.
2016-04-16 17:25:33 -07:00
PatR
953ee96f7e extend wizard-mode '#stats' command
Extend #stats beyond just monsters and objects.  Have it display
memory usage for traps, engravings, light sources, timers, pending
shop wall/floor repair, regions, bones tracking, named object types,
and dungeon overview.

No doubt there are other memory consumers that I've overlooked.
2016-04-16 15:37:35 -07:00
Sean Hunt
bca851d711 Merge remote-tracking branch 'github/tung/shop-floor-nested-loot' into NetHack-3.6.0 2016-04-12 21:32:10 -04:00
Sean Hunt
f5019b231e Merge remote-tracking branch 'github/tung/shkp-anger-bill-fix' into NetHack-3.6.0 2016-04-12 21:16:38 -04:00
Sean Hunt
ef621d2e6c Merge remote-tracking branch 'github/tung/randline-rng-fix' into NetHack-3.6.0 2016-04-12 21:08:31 -04:00
Sean Hunt
36c3a1c665 Merge remote-tracking branch 'github/UniQP/trap' into NetHack-3.6.0
Also update fixes file
2016-04-12 20:58:25 -04:00
Sean Hunt
1e47807302 Merge remote-tracking branch 'github/UniQP/break' into NetHack-3.6.0 2016-04-12 20:52:13 -04:00
PatR
221a73fe2b getobj() ? fix
The "sortloot revamp" patch six or seven weeks ago broke filtering
for '?' menu in display_pickinv() called by getobj().  The old code
handled 'lets' when building an array of object pointers to be
sorted.  The revamp code did away with that to sort the linked list
instead, but neglected to put 'lets' handling into the subsequent
menu creation loop which is now operating on full invent rather
than the filtered subset.
2016-04-10 16:16:07 -07:00
PatR
65b9429b60 fix #H4296 - grease no checked for passive damage
Hitting a rust monster with a greased weapon would rust the weapon
instead of removing the grease.  Likewise for monsters with passive
acid or corrosion damage.  passive_obj() was ignoring grease.
2016-04-09 18:51:28 -07:00
PatR
43c7a4b312 wizard mode enlightenment for "very fast"
Fast and Very_fast share the same property index, but from_what()
didn't handle that.  Enlightenment for a Very_fast hero--which
can only happen via worn equipment (speed boots) or timed effect
(potion of speed or spell of haste self)--would be erroneously
described as "very fast innately" for roles who get intrinsic
speed at level 1, or "very fast because of experience" when high
enough level for roles who get intrinsic speed later.
2016-04-09 15:48:41 -07:00
PatR
f150d8ddfe 'fix' #H4295 - weapon shattering
When hero with two-handed weapon, or samurai with katana and without
shield, hits a monster which is wielding a weapon, there is a chance
for defender's weapon to be destroyed via shattering.  The chance is
reduced--by increasing the chance to resist--if the hero's weapon is
rusty or otherwise eroded.  That works as intended.  This changes
things to make the chance be increased--by reducing the chance to
resist--if defender's weapon is rusty or otherwise eroded.
2016-04-08 01:12:53 -07:00
PatR
3381aa4122 symset parsing
Add support for character enclosed within single quotes.  Single
character without quotes would work for most characters, but not
'#' and possibly not '^' or '\\'.  All the values in dat/symbols
are specified via backslash+digits so it isn't obvious that some
other form of value is allowed.

I think this parsing accepts all valid values.  It doesn't reject
all invalid ones:  opening quote followed by valid escape sequence
followed by junk followed by closing quote will ignore the junk.
I don't think there's any pressing need to worry about that.
2016-04-06 17:06:33 -07:00
PatR
3d50dbcbde symset S_darkroom, S_vibrating_sqaure
Symbol set parsing rejected S_darkroom and S_vibrating_square.
Now it will accept them.

The fact that this bug wasn't noticed indicates that none of the
3.6.0 symbol sets (other than "Default symbols") is specifying a
value for either of these symbols.

This also changes the default vibrating square value from yellow
'^' (caret) to purple '~' (tilde).  I don't think there's any risk
of mistaking it for a long worm tail (brown '~') and it emphasizes
that it isn't really a trap.
2016-04-06 16:52:06 -07:00
PatR
cb66774430 couple of formatting tweaks 2016-04-04 14:05:31 -07:00
PatR
bde9fdd48b revamp baalz level
Quite a bit of special case code for something so inconsequential.
Tweak the baalz level layout a little to make it be a bit more
interesting, and perform custom wallification on it so that the
beetle layout becomes clearly visible.  It looks great with
DECgraphics (and presumably IBMgraphics).  It's recognizeable but
not as interesting with ordinary ascii because corner walls use
'-' or '|' so don't join up nicely.  It looks a little weird
with tiles; the square aspect ratio of individual tiles makes it
end up being very elongated compared to character cell map it was
designed for.

As far as the level layout goes, the pair of secret doors into
Baalzebub's chamber have been give a random alternative.  The two
right-most accessible columns were diggable--I don't know whether
that was intentional; it's been reduced to one right-most column.
The middle pair of legs were asymmetrical; this fixes that.  The
beetle also now has eyes and an entry door in its mouth.
2016-04-04 13:59:23 -07:00
Tung Nguyen
24bd638356 Use rn2() instead of Rand() for selection_do_randline()
That is, use NetHack's RNG instead of the direct system RNG.  This fixes
maps generated with randlines to interact correctly with potential
future RNG system changes e.g. switching PRNG algorithms, supporting
NAO343's RNG reseeding, and even supporting replays like NetHack 4.

Based on DynaHack commit e464f63 (lev_comp: Fix system RNG use in
randline) by me.
2016-04-02 12:41:35 +11:00
PatR
c3ef98c4d1 REPRODUCIBLE_BUILD
Take the 4-5 line Debian patch and turn it into six dozen lines of
new code.  The submitted patch introduces use of several C library
routines that aren't presently in use, so would need testing by all
functional or nearly-functional ports to verify that it wouldn't
break anything.  It also switched the formatted build date+time
from localtime to UTC.  This makes the code conditional so it can
be ignored by anybody and avoid the risk of breakage.  And a lot of
the increase in size is comments attempting to explain what the new
conditional is for:  when REPRODUCIBLE_BUILD is defined, makedefs
will use getenv("SOURCE_DATE_EPOCH") (whose value is an integer
representing seconds since 1-Jan-1970) instead of current date+time
when generating date.h.  The purpose is to be able to rebuild at a
later date and produce an identical program, which doesn't happen
when compile time gets incorporated into the binary.

I've added some sanity checking to try to make sure the getenv()
value obtained isn't bogus.  And the version string put into date.h
will be slightly different, allowing someone who sees date.h or 'v'
output to tell whether SOURCE_DATE_EPOCH was involved:  showing
"<port> NetHack <version> last revision <date>" instead of the
usual "... last build <date>".

To test, checkout a new branch for building, make any local edits
to unixconf.h and config.h, including enabling REPRODUCIBLE_BUILD,
git add+commit them, then use
  SOURCE_DATE_EPOCH=`git log -1 --pretty=%ct` make install
Other ports will need a bit more work to set up the environment,
but can still use git to track file dates and supply the latest.
Building with alternate configurations could be accomplished by
using tags instead of 'log -1' or by using distinct build branches
where nothing is commited/merged/rebased after completed build.

Unresolved issue:  BUILD_DATE, VERSION_ID, and COPYRIGHT_BANNER_C
contain formatted date+time but omit timezone.  SOURCE_DATE_EPOCH
is assumed to be UTC but the formatted values don't say so, so it
might appear to be incorrect when compared with local time.  We
definitely don't want to start mucking about with timezones within
nethack, so I think we just live with this.  It's not an issue for
default configruation where REPRODUCIBLE_BUILD is left disabled.
2016-03-31 17:56:11 -07:00
PatR
d6fa06f8e8 zeromonst
Make 'zeromonst' global instead of local to makemon.c.  Its address
isn't used as a special value like &zeroobj, but it is useful to
have available for initializing various pseudo-monsters.

modified:
  include/decl.h
  src/decl.c, makemon.c, mkobj.c, mplayer.c, teleport.c
2016-03-26 16:42:24 -07:00
PatR
862d37c77a more recovered bits
Some worthwhile stuff from abandoned 'git stash':
 is_plural() macro wasn't comprehensive;
 a couple of return values where writing with a magic marker was
   causing time to elapse even though nothing happened;
 comment formatting for saddle being left in shop by dying steed.
2016-03-25 17:26:37 -07:00
PatR
41b8f38272 shapechanger polymorph bit
Rescuing an old revision from bit rot:  If one of fog clouds or
vampire bats has been genocided and you try to polymorph a vampire
disguised as the other, it won't change form because the shape it's
currently in is the only candidate shape left for vampshifting.
This makes shapechangers who fail to take on a new shape when
polymorphed try again, specifying original form on the second try.
It's unlikely to affect chameleons, but disguised vampires will
sometimes become undisguised instead of seeming to be immune from
polymorph.
2016-03-25 16:49:01 -07:00
PatR
36464df379 mplayer.c formatting
Some formatting cleanup for file that escaped the umpteen earlier
rounds of such.
2016-03-25 16:45:26 -07:00
PatR
b5d2135673 'O' for regexp options
Noticed when testing tty menucolor changes recently, using the 'O'
command to interactively add a new entry would accept one and then
quit, unlike remove which accepts multiple at a time and then goes
back to the menu where you could choose 'remove' all over again.
Adding is still done one entry at a time, but instead of finishing,
it goes back to the menu where you can choose to add another.
2016-03-22 18:22:39 -07:00
PatR
e8e8c14b34 more fixes for revised 'sortloot'
After some permutation of commands which displayed items, the 'd'
command presented a prompt with the list of letters scrambled (in
loot order or pack order rather than invlet order), so explicitly
sort when getobj operates.  Done for ggetobj too.

For menustyle:Traditional, ',' followed by 'm' presented a pickup
list in pile order even when sortloot was 'l' or 'f'.  That was an
unintentional change during the 'revamp'.
2016-03-22 01:19:27 -07:00
PatR
3353ad1114 fix "object lost" panic after query_objlist
Reported directly to devteam for recent git code, the "sortloot
revamp" patch could trigger an object lost panic after calling
query_objlist() when menustyle was full or partial and player
picked up a subset of available items.  Modified head-of-list was
not being propagated to its source in pickup().  Use an extra layer
of indirection.
2016-03-20 13:01:56 -07:00
PatR
c53565036c fix scatter feedback
Reported directly to devteam (for 3.4.3 but still present in 3.6.0):
an unseen landmine explosion which caused scatter() to break a
boulder or statue would give feedback as if the hero could see the
boulder or statue being destroyed.

Also, a couple of landmine explosion messages didn't take deafness
into account.
2016-03-19 15:46:33 -07:00
PatR
96dd800301 fix #4279 - kicked daggers are lost
A kicked object which hits a monster wasn't placed back on map,
removing it from play.
2016-03-19 14:47:36 -07:00
PatR
bb68c4b4e7 tuning: succubi
This one had been intended for longer than several years, but I
hadn't gotten around to it.  When consorting with succubi and
incubi, very high Cha+Int no longer guarantees that a positive
outcome will occur.

Chance of positive outcome is still quite high and most of the
negative outcomes are pretty easy to repair, so this isn't likely
to make a significant impact.  However, the possibility of losing
spell power will matter for some players....
2016-03-18 15:50:13 -07:00
PatR
6ae8f291ac tuning: thrones
This was sitting around for several years.  When positive luck
lessens a negative effect from sitting on a throne, reduce luck so
that repeated occurances will eventually get the intended result.
2016-03-18 15:46:11 -07:00
PatR
606a738c4b fix #H4274 - monster growing up changes gender
Most of the humanoid species have Lords and several have Kings,
but none of them have Ladies or Queens.  When a female grows up
to reach that level of monster, she changes into male.  This fix
gives an alternate message acknowledging that change rather than
prevent taking on the stronger form.  A better fix would be to
add ogre ladies and dwarf queens as separate monsters, but doing
so will break 3.6.0 save file compatibility.

(I started out with an alternate fix, adding mons[].fname for the
dozen or so creatures which warrant an alternate name for females.
But that requires statues, figurines, corpses, tins, and maybe
even eggs to track gender [some statues already do, and corpses
and statues with attached mtraits also implicitly do] and to not
stack with equivalent ones of the opposite gender.  Plus glyphs
to track them, and new tiles.  It was becoming too complicated
for such a relatively unimportant feature.  Separate monsters is
the way to go, deferred until save file format changes again.)
2016-03-16 15:03:37 -07:00
PatR
13c40d85e7 fix #H4275 - blinded, stunned, confused timers
Blindness due to face covered by pie was ignored for several cases
of magically curing blindness--cleaning the face seems better than
adjusting timeout to account for u.ucreamed for those cases.  A few
instances of taking stun or confusion damage overrode existing stun
or confusion rather than increasing it.  Plus a copy/paste mistake
for dual stun+confusion when casting an expired spell.

There was also a suggestion that vomiting when already nauseated
should decrement the timer instead of increasing it.  But there is a
negative effect for as long as it's in effect, so I left that as is.
2016-03-15 01:00:36 -07:00
PatR
77fe8db320 monster sanity checking
Add some more checks for monsters when the sanity_check option
is enabled.
2016-03-14 15:42:03 -07:00
PatR
1aff4f89fd sortloot fixes
Fix some typos in the sort-by-invlet code and a logic error in the
lately added subclass sorting for sort-by-pack.  Regular inventory
display only works correctly for the latter if invlet is the tie-
breaker within object classes.  When helmet/gloves/boots/&c and
ammo/launcher/missile/&c sub-categories already break ties for armor
and weapon classes, inventory ended up out of alphabetical order.
2016-03-14 15:32:17 -07:00