Commit Graph

2975 Commits

Author SHA1 Message Date
PatR
ae78865da8 msghistory bandage
Have genl_putmsghistory() pass the message to pline() for the !restoring
case, so that quest summary lines are delivered as ordinary messages.
No effect on tty or win32, which have their own putmsghistory routines.
But for X11, which has a multi-line message window but no save/restore
implementation for its contents, this makes the quest summary lines
actually show up somewhere.  (I looked at maybe implementing
X11_getmsghistory() and X11_putmsghistory() but don't have the energy to
tackle it.)

Other interfaces which lack their own history save/restore will see the
quest summary messages too.  Presumeably they'll all have multi-line
history windows so the extra line won't be displacing the most recent
message.  If not, they'll essentially get the long quest messages twice,
once in full via popup window, then the one-line summary via pline.
2015-05-23 00:59:18 -07:00
PatR
905c21dbe8 qtdump() overhaul
When dumping quest messages at startup via DEBUGFILES=questpgr.c,
give a single message for each one, instead of a pline showing the
message number and delivery protocol followed by a popup message
window containing the text.  This puts the number and protocol info
at the start/top of the popup window, bypassing the pline (and the
extra --More-- given for tty).
2015-05-23 00:50:34 -07:00
nhmall
404e37633f beta info
Changes to be committed:
	modified:   src/version.c
2015-05-22 20:08:33 -04:00
PatR
168572fd0d #terrain update
Make the post-3.4.3 '#terrain' command be more versatile by allowing the
player to choose between floor-only, floor+traps, and floor+traps+objects
so that it is possible to view known traps covered by objects or monsters
and remembered objects covered by monsters.  The extra explore mode and
wizard mode choices aren't affected.
2015-05-21 16:53:46 -07:00
PatR
f0370f5f86 you feel {a,an unexpected} draft
Move the message given when a monster digs through a closed door
or a secret corridor into a separate routine.  In theory, nethack
should determine whether there is a path between the new opening
and the hero's location in order to decide whether a draft can
be felt.  (I don't think anyone is likely to implement that--I'm
certainly not.  Checking whether the hero is in a room with no
breaches in its walls could at least catch being inside a vault.)

While at it, add some USA-centric puns about feeling the prospect
of imminent military conscription instead of air current if it
happens while hallucinating.
2015-05-18 18:25:44 -07:00
PatR
fabf9cd901 VA_DECL/VA_END usage
Make the variadic functions look more like ordinary code rather than
have the function opening brace be hidden inside the VA_DECL() macro.
That brace is still there, but VA_DECL() now needs to be followed by
a visible brace (which introduces a nested block rather than the
start of the funciton).  VA_END() now provides a hidden closing brace
to end the nested block, and the existing closing brace still matches
the one in VA_DECL().

Sample usage:
void foo VA_DECL(int, arg)  --macro expansion has a hidden opening brace
{  --new, explicit opening brace (actually introduces a nested block)
  VA_START(bar);
  ...code for foo...
  VA_END();  --expansion now provides a closing brace for the nested block
}  --existing closing brace, still pairs with the hidden one in VA_DECL()

This should help if/when another round of reformatting ever takes place,
and also with editors or other tools that do brace/bracket/parenthesis
matching.

I had forgotten that there were variadic functions in sys/* and ended
up modifying a lot more files than intended.  The majority of changes
to those just inserted a new '{' line so that revised VA_END()'s '}'
won't introduce a syntax error.  A couple of them needed VA_END() moved
so that local variables wouldn't go out of scope too soon.  Only the
Unix ones have been tested.
2015-05-15 17:45:21 -07:00
PatR
dd62a6831f fix mdig_tunnel impossibility
Reported by the keymasher:  "stone at (48,8) is undiggable".  Bigroom 4
has a tree at that spot and the whole level is flagged as undiggable.
Undiggable trees were supported on arboreal levels (where their terrain
type is STONE rather than TREE), but not elsewhere.  Monster movement
uses IS_ROCK(), which is true for TREEs, but may_dig() uses IS_STWALL(),
which is false for TREEs so doesn't consider the location as being of
interest and fails to disallow digging.  But mdig_tunnel() bypasses
may_dig() and tests the NONDIGGABLE bit directly, disallowing digging.
(If this sounds confusing, it's a stroll in the park compared to the
code itself.  Apologies for the mixed metaphore.)

Digging away a secret corridor could leave rocks, which doesn't make
a whole lot of sense.  Now a monster's dig attempt will reveal the
location as a corridor instead.

This also moves an assignment out of a macro invocation where it was
inviting trouble if that macro gets modified.  And reorganizes an 'if'
to put cheaper tests sooner.
2015-05-13 17:54:26 -07:00
PatR
beaab1b974 Make the #terrain command work as intended if used while the map is
suppressed when the hero is engulfed.  No fixes entry.
2015-05-12 16:07:18 -07:00
Sean Hunt
dc08561ddb Replace tabs with spaces. 2015-05-09 14:45:43 -04:00
Derek S. Ray
1770591189 fix duplicated header lines 2015-05-09 14:35:12 -04:00
Derek S. Ray
a3b260f390 Merge branch 'AlexK-misc'
* AlexK-misc:
  erosion is not being removed after reading non-cursed scroll of enchant weapon
2015-05-09 14:34:16 -04:00
Derek S. Ray
a8f95494a1 fix whitespace errors from simultaneous commit 2015-05-09 14:20:36 -04:00
Derek S. Ray
e124a61362 reorder onscary() logic to be in right order 2015-05-09 14:16:47 -04: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
Derek S. Ray
d0fb68795d Merge branch 'derek-elbereth'
* derek-elbereth:
  ensure that the 'safe' objects remain safe
  finish up the changes to trigger erosion on use
  initial pass for toning down Elbereth

Conflicts:
	dat/castle.des
	dat/sokoban.des
	include/extern.h
	src/engrave.c
	src/mklev.c
	src/monmove.c
	src/zap.c
2015-05-09 11:58:36 -04:00
nhmall
9d54b5e43e Merge branch 'win32-x64-working' 2015-05-09 08:02:19 -04:00
Alex Kompel
6a66408964 erosion is not being removed after reading non-cursed scroll of enchant weapon 2015-05-08 00:12:36 -07:00
Pasi Kallinen
29ea460446 Used invent letters didn't destroy the window 2015-05-07 18:04:40 +03:00
nhmall
20069798d4 Merge branch 'master' into win32-x64-working 2015-05-07 04:52:30 -04:00
karnov
2a907f894e Version number increment 2015-05-06 22:04:27 -04:00
nhmall
1ef94c890f Merge branch 'master' into win32-x64-working
Conflicts:
	include/hack.h
	win/X11/winmenu.c
	win/X11/winstat.c
2015-05-06 19:53:26 -04:00
Sean Hunt
b7c5b33173 Add a funny message for when a burrower eats food. 2015-05-06 19:25:23 -04:00
Derek S. Ray
be98bca06d cherry-pick the YACC/LEX upgrades from elsewhere 2015-05-06 17:55:50 -04:00
Derek S. Ray
9c19f55403 jonadab's patch for engraving on the drawbridge
Should be splinters, not gravel.
Addendum to C343-239
2015-05-06 17:51:18 -04:00
Pasi Kallinen
b8e0394a2e Hidden holes made by breaking a wand of digging
Holes created via applying a wand of digging were not
shown on the map, because holes are always marked as seen,
and seetrap/feeltrap then do nothing.
2015-05-06 18:02:15 +03:00
PatR
e72246f1d1 new file: include/lint.h
modified files: include/hack.h, src/decl.c, sys/unix/Makefile.src

Groundwork for cleaning up the X11 sources, where gcc with the option
settings specified in the OSX hints file currently generates close to
400 warnings for win/X11/*.c.

lint.h is included by hack.h, and I've moved the debugpline stuff from
the latter to the former to hide it better.  (By rights it belongs in
debug.h or something of the sort, but I didn't want to go that far.)
Makefile and project dependencies need to catch up.

nhStr() hides a cast to char *, and is intended to by used on string
literals where it isn't feasible to maintain the 'const' attribute.
(A pernicious problem with X11 code, where the include situation can
become very convoluted, and many, MANY string literals are hidden
behind macros to look like keyword-type tokens.)

nhUse() can be used to force a fake usage on something which triggers
an unused parameter warning.  There are a 6 or 8 or 10 places in the
core code where that applies, but so far I have't touched any of them.
There's a tradeoff since it will result in some worthless code being
generated and executed, but is much simpler than tacking on compiler-
specific workarounds like '#pragma unused' or gcc's __attribute__ hack.
2015-05-06 00:38:16 -07:00
Pasi Kallinen
2a4bf5efa7 Comment for the pudding glob order 2015-05-06 09:54:28 +03:00
PatR
7b75da924e another pass at "gold wield inconsistency"
Handle !fixinv by forcing gold to have slot '$' all the time; that
particular type of object is 'fixed' regardless of user preference.
Also add a couple of checks for non-'$' gold when selecting from
inventory, just in case the issue of multiple gold stacks reappears.
2015-05-05 16:25:49 -07:00
Pasi Kallinen
fd8127dcf4 Fix impossible when quivered gold was stolen from you 2015-05-05 21:29:24 +03:00
Pasi Kallinen
0dd715da11 Revert previous, with a comment in code 2015-05-05 06:55:56 +03:00
nhmall
f692db8581 Merge branch 'master' into win32-x64-working 2015-05-04 17:56:35 -04:00
Pasi Kallinen
766d874a47 Melded pudding object may be gone 2015-05-04 22:19:32 +03:00
PatR
e2e269504c more "deleting worn obj"
Lit candles and burning potions of oil can be on the migrating objects
list and get deleted before arrival, so they need the same cleanup as
rotting corpses to prevent obfree from complaining that they're worn.
2015-05-04 08:49:21 -07:00
nhmall
636edf2b08 Merge branch 'master' into win32-x64-working
Conflicts:
	src/dig.c
	src/mkobj.c

 Changes to be committed:
	modified:   src/dig.c
	modified:   src/mkobj.c
2015-05-03 20:53:04 -04:00
PatR
3fa8ff9d62 owornmask sanity_check fix and enhancement
Thinko fix:  sanity checking for owornmask was mis-treating
OBJ_MIGRATING as OBJ_MINVENT of migrating monsters rather than as
unattended objects and would have had problems similar to obfree's
inappropriate impossible check.

Sanity checking for objects worn in invalid slots (amulet worn in
a ring slot and so forth) is extended to items worn by monsters.
Also add a check for wielded coins since the loophole that let them
become wielded has been closed.
2015-05-03 16:57:09 -07:00
PatR
505f6246b5 fix "deleting worn object" impossibility
Migrating objects overload obj->owornmask with a destination code,
so rot_corpse needs to clear that before deleting corpses.  (Buried
objects don't touch owornmask, so rot_organic, which does the actual
object deletion, shouldn't need any similar change.)

The corpses with owornmask 3 that have been observed recently were
slated to arrive on the up stairs, so presumeably fell down the down
stairs of the current level and rotted before the hero went down.
Put plainly, it was the [post-3.4.3] impossible() check which was in
error, not the active game data.
2015-05-03 16:54:53 -07:00
nhmall
8ebf5b1759 Merge branch 'master' into win32-x64-working 2015-05-03 09:01:46 -04:00
PatR
181740e874 fix "gold wield inconsistency"
'w$' reported "you can't wield gold" but
'w*$', choosing from inventory and picking gold, let you wield gold.

The old code checked whether gold had been picked before checking
whether '?' or '*' had been picked to request selection from inventory.
This wasn't an issue with 3.4.3's !GOLDINV configuration (but probably
was for anyone who explicitly switched to GOLDINV) because getobj()'s
callers only inserted gold into inventory when they intended to accept
it as a valid choice.

Fix is just to swap two adjacent 'if' blocks in getobj() so that '*'
is processed before the test of whether '$' has been chosen.  Most of
the diff is indentation and other minor reformatting.
2015-05-03 01:22:25 -07:00
nhmall
5dfc98bc6a Merge branch 'master' into win32-x64-working 2015-05-02 18:18:36 -04:00
nhmall
02de9d1313 commit the latest update for wiz_identify
git add mistake on my part
2015-05-02 18:16:11 -04:00
nhmall
be643386c5 permanent wiz_identify correction
wiz_identify (^I) is supposed to bring up the inventory list
with the items identified, in contrast to the regular (I)
inventory, but only for that inventory display.

It is intended that if you then hit ^I again while at that
wiz_identify inventory menu, you'll trigger permanent
identification of itemsand any other key is supposed to
leave them as they were.

In tty however, <space> was doing the same thing as the
second ^I, and permanently identifying everything.
So, for those that like to <space> through menus (like
me) this makes it work as originally intended and
requires a deliberate second ^I at the menu to permanently
identify. (It might also allow trigger permanent ID if you hit
underscore, but nobody "underscores" through menus,
so that's ok.)
2015-05-02 18:04:20 -04:00
nhmall
77dd76ed17 Merge branch 'master' into win32-x64-working
Resolved Conflicts:
	src/cmd.c
	src/mkobj.c

 All conflicts fixed but you are still merging.

 Changes to be committed:
	modified:   dat/Priest.des
	modified:   dat/Rogue.des
	modified:   dat/Valkyrie.des
	modified:   dat/Wizard.des
	modified:   dat/gehennom.des
	modified:   src/cmd.c
	modified:   src/mkobj.c
	modified:   src/steal.c
	modified:   sys/share/lev_yacc.c
	modified:   util/lev_comp.y
2015-05-02 13:53:08 -04:00
PatR
ee854e5c76 more owornmask sanity_check
Fix the problem with erroneously detecting wielded or quivered
chained ball which legitimately has more than one mask bit set.

Add an additional check for valid wornmask of an item somehow worn
in an invalid slot (such as an amulet in one of the ring slots).
Only lightly tested; it really needs debugger assistance to force
various invalid situations but I don't know gdb well enough for that.
2015-05-02 02:44:57 -07:00
PatR
40fdbccf84 enlightenment for polymorph & lycanthropy
Fine-tune lycanthropy feedback by combining "you are a werecritter"
and "you are in beast form" into one message.  Also, add some new
feedback when lycanthropy and intrinsic polymorph are blocked by
intrinsic unchanging.
2015-05-01 19:44:56 -07:00
PatR
274904f9be stabilize loss of gold
When gold is stolen by a leprechaun or lost when being "overwhelmed
by an urge to take a bath" while dipping in a fountain, if you had
99 gold pieces or less, you'd lose all of it (in the bath case, only
if it was at least 10 to start with), but if you had 100 or more,
you would lose a random amount which could be as little as 1.  And
in the bath case, if the random amount was less than 10, you would
lose nothing but be told that "you lost some of your money in the
fountain".  After this change, it is still possible to lose less
when starting with more, but not as likely and not as extreme a case
as maybe losing only 1 when starting with thousands.

The fountain-dip bath case has code to handle mutiple denominations
of coins, possibly the only place in the program where that exists.
I've left that alone although it should probably be taken out....
2015-05-01 18:01:12 -07:00
nhmall
088e0471f1 Merge branch 'master' into win32-x64-working 2015-05-01 18:36:39 -04:00
nhmall
573c9dc98f Merge branch 'AlexK-misc' 2015-05-01 18:24:59 -04:00
Pasi Kallinen
8f639796d5 Handle boulder-option in config file
Setting boulder in config file did not work correctly in post-3.4.3
code, due to the symset changes.
2015-05-01 22:03:13 +03:00
nhmall
bd68a6c80c Merge branch 'master' into win32-x64-working
Resolved Conflicts:
	src/mkobj.c
	src/mon.c
	src/options.c

 Changes to be committed:
	modified:   DEVEL/hooksdir/nhsub
	modified:   src/invent.c
	modified:   src/mkobj.c
	modified:   src/mon.c
	modified:   src/options.c
2015-05-01 08:22:36 -04:00
Pasi Kallinen
40080817ce Uninitialized variable 2015-05-01 14:52:25 +03:00