Commit Graph
134 Commits
Author SHA1 Message Date
nhmall cbcb1ea7eb Merge branch 'NetHack-3.6.2' 2019-01-10 09:42:38 -05:00
PatR a637e91f37 miscellaneous formatting
Some minor stuff that's been sitting around for a while.
2019-01-09 18:15:43 -08:00
Bart House 1c65e6afe0 context to g.context 2018-12-25 07:29:38 -08:00
Bart House 8c1a4d9a97 invent, youmonst, hackdir moved to g. 2018-12-24 21:04:15 -08:00
Bart House 90547edb83 moves, monstermoves, wailmsg, migrating_objs and billobjs moved to g. 2018-12-24 20:22:33 -08:00
Bart House be5cdcf77a killer, level and rooms move to instance globals. 2018-12-24 19:50:08 -08:00
Bart House 572ee347b9 Another round of instance globals changes. 2018-12-24 16:43:50 -08:00
Bart House 576eece500 More globals moved to instance_globals. 2018-12-19 21:26:35 -08:00
Bart House 3645e415e3 Moved more globals to instance_globals. 2018-12-19 20:01:55 -08:00
PatR 9c422f2c1f fix #H7707 - terrain change leaving stale flags
struct rm.flags in overloaded for a bunch of rm.typ -dependent things
(doormask, altarmask, throne/fountain/sink looted, a few others) and
wasn't being reset for various cases where rm.typ gets changed.

I've changed a lot, some no doubt unnecessarily, and probably missed
plenty.  This compiles but has not been thoroughly tested.
2018-12-10 03:52:00 -08:00
keni d8c49ec9d1 Add updated copyright lines, part 1. 2018-04-25 15:00:13 -04:00
PatR 0419f097f1 fix #H6960 - redundant feedback for '#force'
When using #force at a spot which has a broken or unlocked chest (or
large box) whose lock state has been previously discovered, avoid
|There is a broken chest here, but its lock is already broken.
|There is an unlocked chest here, but its lock is already unlocked.
by suppressing "broken"/"unlocked" from the chest description for
that particular message.

We might still want to change "broken chest" to "damaged chest" but
I don't think there should be any reference to its lock as the reason
it's broken or damaged.  The fact that #loot, #force, and applying a
key still treat it as a container is sufficient to reveal that it
functions as one.
2018-03-19 15:48:46 -07:00
nhmall 7238803b25 revert box naming 2018-03-19 07:13:07 -04:00
nhmall e7ed6508cd more message adjustments to chests with broken locks 2018-03-18 08:49:25 -04:00
nhmall e07c6b5b77 broken large box wording change
> When you try to #force a large box or chest whose lock is already broken from a
> previous #force, the game tells you "There is a broken large box here, but its
> lock is already broken." It's minor, but this implies that the box being broken
> is separate from the lock being broken (as well as that the box itself *can* be
> broken).

change the wording to "lock-damaged box" and suppress
", but its lock is aleady broken" when "lock-damaged box" has
already been displayed.

(Nobody particularly likes the wording "lock-damaged box" either, but at least
it seems less misleading)
2018-03-17 23:05:52 -04:00
Pasi Kallinen a785663c58 Attempting to open down or at yourself is same as #loot
Trying to open at the same location as you did nothing,
make it loot instead. Apparently #looting is also annoying
when using vi-keys.

Based on code by aosdict
2018-03-14 20:15:21 +02:00
PatR 5c77360023 still more Master Key of Thievery
Make #untrap while carrying the non-cursed (for rogues) or blessed
(for non-rogues) Key work the same as #invoke has been doing (without
regard to its bless/curse state):  when used on trapped door or chest,
that trap will always be found and disarming it will always succeed.

It should work when carried by monsters too:  if they try to open a
trapped door while carrying the Key (must be blessed since they're
not rogues) the trap will be automatically disarmed.  (Caveat:  that
hasn't been adequately tested.)

TODO (maybe...):  change the #invoke property to detect unseen/secret
door detection instead of #untrap.  The latter isn't completely
redundant; it works when the Key is cursed.  But quest artifacts
strongly resist becoming cursed so that isn't a particularly useful
distinction.

Also, trap hints when wielding the Key without gloves didn't notice
adjacent door and chest traps.  Now it does.  And the behavior is
slightly different:  known traps covered by objects or monsters are
treated like unknown traps as far as the hot/cold hints go.
2017-10-08 03:29:16 -07:00
PatR 468fc1a925 more Master Key of Thievery: lock/unlock vs traps
Always find traps when using the rogue's quest Key to lock or unlock a
trapped door or chest provided that the Key is not cursed (for rogues)
or is blessed (for non-rogues).  When a trap is found, the player is
given the opportunity to disarm it, and doing so will always succeed.
(It isn't disarmed automatically; the player may prefer to leave traps
in place, presumably hoping to set up a dangerous bones file.  Or he
or she may be unaware of the guaranteed success and be too timid to
risk trying to disarm the trap.)

TODO:  make #untrap of a door or chest while carrying that Key always
find traps (with same bless/curse requirements as above).  And maybe
change its #invoke property from untrap to detect unseen/secret door
detection since current invoke power would become redundant.

Also, move a bunch of new artifact abilities from the fixes section to
the new features section in fixes36.1.
2017-10-07 02:28:20 -07:00
Pasi Kallinen f8bd77ae03 Use symbolic names for shop repair costs
...and add costs to two places where the door you touched
blew up (picking the lock and opening the door).
2017-09-14 21:07:18 +03:00
Pasi Kallinen 3502cfcc5a Hallucinatory liquids for water, lava, and acid 2016-06-07 20:57:50 +03:00
Pasi Kallinen 984785b13c Give a hint that containers are looted instead of opened 2016-06-02 18:11:41 +03:00
PatR 0c70b1bd06 reset travel cache when changing levels
When travel fails to reach its destination, it remembers the target
spot to use as default next time.  But that spot is only meaningful
on the current level.  Discard last travel destination when moving
to a different level.

Also, discard unlocking context when changing level unless the
context is for a container being brought along (after having been
picked up since you can't unlock a carried box).  Previously, a
door pointer on the new level could happen to match the last one
being unlocked on the old level.

Discard trap setting context when changing level even if the trap
object is brought along.

Somehow the code for applying a touchstone got inserted in between
two sections of code for applying a trap (ages ago; probably since
touchstone was first introduced however many versions back), so
clean that up.
2016-05-28 19:54:19 -07:00
Pasi Kallinen dc09a991fe Fix some warnings from clang's static code analyzer 2015-11-18 22:54:28 +02:00
Pasi Kallinen 2c0f24896f Unify blind feel_location or newsym info single func 2015-11-09 21:37:28 +02:00
PatR c09fe294dd formatting: more casts 2015-11-07 20:02:04 -08:00
PatR 915dd89270 more src reformatting
Fixing up mis-indented block comments, but hit some files that hadn't
had the earlier mixture of tab replacement, etc, so it's bigger than I
expected.  If I get to it, they'll be another round of this tomorrow.
2015-11-06 03:14:50 -08:00
PatR 2ddc361adf another batch of formatting
Same sort of stuff as before:  some continuation lines with operator
followed by end of line comment (only a few files with those still to
go...), plus tab replaced by spaces in comments, excess parenthesis
removal for return statements, and force function name to be in column
one in function definitions:
  type name(args) /* comment */
  argtype args;
  {
to
  /* comment */
  type
  name(args)
  argtype args;
  {
I've been spotting those by eye rather than rexexp, so probably missed
some.
2015-11-03 18:28:53 -08:00
Pasi Kallinen 95983f6ae6 Use macros for monster appearances 2015-10-18 13:55:11 +03:00
Pasi Kallinen 857225ad0f Use existing function for stumbling on door mimic 2015-10-18 09:57:07 +03:00
Pasi Kallinen af1c77808b Comment typofixes, pt 4 2015-10-17 18:47:31 +03:00
PatR 2b2ee0fbab formatting fixup (1 of 2)
Replace instances of strings split across lines which rely on C89/C90
implicit concatenation of string literals to splice them together
with single strings that are outdented relative to the code that uses
them.  It's uglier but it won't break compile for pre-ANSI compilers.

This covers many files in src/ that only have one or two such split
strings.  There are several more files which have three or more.  Those
will eventually be '(2 of 2)'.

Noticed along the way:  the fake mail message/subject
  Report bugs to devteam@nethack.org.
wasn't using its format string of "Report bugs to %s.", so would have
just shown our email address.  Doesn't anybody enable fake mail anymore?

I modified that format to enclose the address within angle brackets and
made a similar change for the 'contact' choice of the '?' command.
2015-07-12 19:35:06 -07:00
Sean Hunt 1c081b1647 Remove stale version control lines. 2015-05-25 09:21:31 +09:00
Sean Hunt 97d6fade74 Reformat all C files.
I'll push a formatting guide at some point. There may still be
outstanding changes, but please feel free to resolve those as you arrive
a them.

To the best of my knowledge, there is no changes to the actual code
content, but the formatter does have the occasional bug. If you run into
an issue, please fix it!
2015-05-09 13:43:16 -04:00
karnov 2a907f894e Version number increment 2015-05-06 22:04:27 -04:00
PatR 16d8074352 lint 2015-04-22 19:17:49 -07:00
Pasi Kallinen bd69677933 Unify stumbling on door mimic 2015-04-22 09:23:54 +03:00
Pasi Kallinen 35e0027328 Prevent out-of-bounds coords when closing a door 2015-04-15 19:43:53 +03:00
Pasi Kallinen 879f6d55c2 Add Auto open doors -patch 2015-04-13 21:11:44 +03:00
nhmall f799bffbb2 Additional obstruction messaging fixup 2015-03-14 09:43:07 -04:00
nhmall ece3385900 fix messaging in obstructed() in lock.c
From ais523's recent list of bugs:
If a long worm tail is blocking the door, and you're blind and not
telepathic, attempting to close the door marks the position of its head.

From an email received in late September 2014 before the git conversion:
> I was trying to close a door, not noticing that there was a garter
> snake there, and this message resulted:
> The garter snake stands in the way!
> I haven't tried it with any other monsters without feet, but
> "stands in the way" appears to be the wrong way to describe
> this situation...

Both of the above were found in the same function in lock.c
2015-03-13 22:27:09 -04:00
Pasi Kallinen f2ab8f336b You_hear already checks deafness 2015-03-06 21:01:02 +02:00
Sean Hunt ad82ca80f3 Make DUNGEON_OVERVIEW unconditional. 2015-02-27 19:33:20 -05:00
Sean Hunt 1edadd1d48 Make REINCARNATION unconditional.
There is a lot of code affected by this, and Pat Rankin correctly
observes that it would be better to store roguelike as a level flag
rather than just using Is_rogue_level. A note for the future.
2015-02-27 19:33:16 -05:00
Sean Hunt 260f7ea860 Make TOURIST unconditional. 2015-02-27 19:33:12 -05:00
Sean Hunt 9e65758947 Make STEED unconditional. 2015-02-27 19:33:01 -05:00
keni 03140969ee Bulk recovery of file CVS headers and addition of NHDT- headers. 2015-02-26 09:19:03 -05:00
nethack.allison 5163e6dc20 remove line of unreachable code (trunk only) 2012-01-21 12:39:03 +00:00
keni 6520bbdca9 first try tonight: lock.c makemon.c 2011-12-30 23:10:37 +00:00
nethack.rankin c34efb07bd mimic-as-door stealing key (trunk only)
Suggested by <email deleted> a month ago when he
reported that attempting to unlock a door which was actually a mimic
simply told the player that the door was not locked or that there was
no door.  He thought that mimic should take the key/pick/card away from
the hero.  This gives a 50% chance for the unlocking tool to be stolen
and become part of the mimic's inventory; it will be dropped when mimic
is killed.

     The theft routine has groundwork to be able to be used to take the
hero's wielded or thrown weapon when hitting, but the attack code doesn't
call it so that won't happen (and the theft code hasn't been tested under
that circumstance).  I'm not sure whether mimics should be able to grab
weapons, but g.cubes perhaps should, and if puddings could then "pudding
farming" [using a low damage iron weapon to split puddings, yielding tons
of experience, death drops, and #offer fodder when they're killed and
repeatable for as long as at least one pudding is kept healthy enough to
be split again] would become tougher to accomplish.  [The item drop and
corpse aspects have been toned down quite a bit since 3.4.3, but with
sufficient patience it is still possible to abuse.]
2011-02-03 21:49:36 +00:00
nethack.rankin 3b6c59c7fc more mimic-as-boulder (trunk only)
I started to add handling for doorways containing mimic-as-boulder
to doopen() and doclose() as was done for pick_lock(), but decided that
it was better just to prevent mimics from appearing as boulders at closed
door locations in the first place.  So the most recent pick_lock() change
and its fixes entry go away.

     This also fixes a post-3.4.3 bug.  On the top level of Sokoban I
discovered a boulder over a hole; probing reported it as a mimic with
0 hp.  The special level loading code moves mimic-as-boulder away from
trap spots by using place_monster() to put it on another spot, but it
was missing the corresponding remove_monster() to take it away from the
original location so left a stale pointer on the map.
2011-01-05 01:28:36 +00:00