Commit Graph

1466 Commits

Author SHA1 Message Date
nhmall
ab9e28d1aa some fixes provided from Hardfought 2018-12-04 11:58:05 -05:00
nhmall
f6b7ce02d8 Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2018-12-04 11:46:19 -05:00
nhmall
ec8f002d81 bit-use collision on WC2_TERM_SIZE, WC2_RESET_STATUS 2018-12-04 11:45:41 -05:00
PatR
285023acf6 fix #H7659 - accessing freed memory by cutworm()
hmon() can destroy the weapon being used, and known_hitum() would
still pass the pointer to the freed object to cutworm().  Remember the
relevant weapon attribute before using and maybe freeing the object,
then pass that attribute instead of the whole weapon.  Also pass
'more-likely-to-cut' for axes in addition to blades.

thimonst() behaved similarly, although due to much different code
paths none of the objects that might get to hmon() were then passed to
cutworm(), so it wasn't vulnerable.  But pass 'more-likely-to-cut'
for axes instead of for blades when thrown.
2018-12-03 18:57:01 -08:00
PatR
13ef86488a command handling for !SHELL and !SUSPEND
Change the command list to always include #shell and #suspend so that
a user's preferred key bindings can span platforms without worrying
about whether those exist or not.  They're still effectively no-ops
when compiled out.

'#?' suppresses them from the list of displayed commands.  Interface-
specific extended command handling may want to check new extcmd.flag
value CMD_NOT_AVAILABLE to do the same, but failing to do so shouldn't
pose a problem.  They behave sanely if executed when not supported.
2018-12-02 16:43:53 -08:00
nhmall
a9ff2a296a remove slipped-in partial bits from another feature
Some bits from another feature by Tangles had
slipped into our merge of curses a while back.

Remove the partial bits as feature bits should
be complete or not at all, unless foundational
for something to come.
2018-12-02 11:54:42 -05:00
nhmall
4a4b3fb8f1 add a macro to ease conditional testing based on active window port
Add WINDOWPORT macro

example:
if (WINDOWPORT("tty"))
	pline("Look at me, I'm on tty at the moment!");
2018-12-02 09:56:44 -05:00
PatR
26a3a53786 Sting revisited
Replace recent "(light blue aura)" with
"(flickering light blue)" if there are 1..4 orcs,
"(glimmering light blue)" if 5..12, or
"(gleaming light blue)" if there are 13 or more, and move its place
in the formatted name.
_3.6.1_: Sting (weapon in hand) (glowing light blue)
_recent: Sting (weapon in hand) (light blue aura)
_now___: Sting (weapon in hand, flickering light blue)

The thresholds for intensity may need to be tweaked.  The start
message has been changed from "glows" to "flickers/glimmers/gleams"
and is given when the intensity changes (up or down) as well as when
first glowing.  Stop message will usually be "stops flickering" but
some form of mass kill (genocide for sure, maybe explosion, probably
not wand zap) might result in stopping directly from higher intensity.

It still "quivers" if hero is blind when there are orcs on the level,
but no name augmentation shows in inventory for that situation;
describing it as "(weapon in hand, quivering)" would be too silly.
Also, the quiver or glow intermediate message if blindness is toggled
while Sting is active only worked for make_blinded(), not for putting
on and taking off a blindfold.  Now fixed.  I think becoming blind due
to polymorphing into an eyeless form is still not handled, but there
are no eyeless creatures capable of wielding weapons so that can wait.
Polymorphing from eyeless to sighted is handled but moot for Sting.
2018-12-02 02:09:22 -08:00
nhmall
a5a51814a1 get rid of some gcc warnings with Windows build 2018-12-01 09:41:22 -05:00
nhmall
8a9f98f179 curses follow-up bits
Move the curses global variable defininitions to cursmain.c.

Make the references to those global variables extern in
include/wincurs.h

Get rid of a warning:
../win/curses/cursmesg.c:379:9: warning: declaration shadows a
variable in the global scope [-Wshadow] int orig_cursor = curs_set(0);

Kludge for Visual Studio compiler: Add a stub- file for use
in Windows curses port builds to ensure that a needed #pragma
is invoked prior to compiling the file pdcscrn.c in the
PDCurses source distribution. All command line options and
compile of the file. It is unreasonable to expect a NetHack
builder to have to tinker with the PDCurses source files in
order to build NetHack. This kludge means the NetHack builder
doesn't have to.
The file stub-pdcscrn.c contains only two lines:
	#pragma warning(disable : 4996)
	#include "pdcscrn.c"
Some day, if the PDCurses sources corrects the issue, this
can go away.
2018-11-30 16:00:24 -05:00
Pasi Kallinen
75bf7c1975 X11: Disable menucolors when showing text files 2018-11-30 15:26:38 +02:00
nhmall
7495d0f2f4 more Windows gcc cleanup
Still not finished
2018-11-29 22:32:36 -05:00
nhmall
bf4bb47518 Update header at the top of the curses files
Place the copyright notice within the win/curses files as confirmed
by the original curses port author on November 28, 2018.
2018-11-28 20:00:20 -05:00
nhmall
478b53b4c2 Merge branch 'mouse_support' into NetHack-3.6.2-beta01 2018-11-27 22:58:42 -05:00
nhmall
d18bf800ae expand mouse_support to three values rather than boolean
On Windows only:
   0 = turn off mouse_support
   1 = turn on mouse_support and turn off QuickEdit mode
   2 = turn on mouse_support and leave QuickEdit mode untouched

More generally, but not implemented anywhere:
   0 = turn off mouse_support
   1 = turn on mouse_support and make supporting O/S adjustments
       (O/S adjustments not implented beyond Windows as yet)
   2 = turn on mouse_support and do not make OS adjustments
       (unimplemented as yet so behaves as 1)
2018-11-27 22:15:34 -05:00
PatR
5d2686e7c1 lev_comp int vs long
Fix lev_comp's variable argument usage by changing it to make
add_opvars() expect an int rather than a long when given the "i"
indicator, and add "l" for really passing a long.  The ints are
conveted to longs when setting up the interpreter.  I think I changed
just about all the integer opvars to int, although there is one use
of "l" in lev_main.c just to make sure it works.  There could be
arguments that really do need to be 'long'; if so, the add_opvars()
calls for them will have to have its indicator string updated and
possibly add or remove some casts.

There's a lot of reformatting included but it's not consistent about
tab replacement.  Some of the changes are due to renaming long-named
'variable_definitions' to 'vardefs' to shorten a bunch of lines.

Updated sys/share/*_yacc.c will be checked in separately.  The ones
currently in the repository won't work with patched lev_main.c due to
that renamed variable.
2018-11-27 18:21:58 -08:00
Pasi Kallinen
f942687378 Remove unnecessary define 2018-11-27 07:38:03 +02:00
Bart House
c44c0d3e01 Added support for color condition hilites to tile mode.
Code is complete but might take another pass over the code to simplify
where we can.
2018-11-25 21:04:30 -08:00
PatR
5226de8c74 warning fixups
Non-const string literals.
2018-11-25 14:31:20 -08:00
nhmall
ccd6f1cf22 more orctown-related follow-up
Under some circumstances, when all the marauding orcs belonging to the
horde operating within the gnomish mines had been provided with their
spoils and placed appropriately, there could still be some pillaged stuff
left-over on the migrating obj chain. Orcs created by regular monster
generation elsewhere would then be susceptable to receiving that stuff
until it was used up. That part is fine, except that the orcs were then
being named as part of the same horde operating within the mines. Now
they will no longer be named as part of the Gnomish Mines horde.

Mythos: There's a good chance that these particular orcs received the
stolen goods from the Gnomish Mines horde.
2018-11-25 12:47:53 -05:00
PatR
cc5bb44a9a fix #H7591 - migrating monsters vs full levels
During level change, when a monster from mydogs (monsters accompaying
hero, usually pets) couldn't be placed because the level was full, it
was set to migrate to that level (in order to get another chance to
arrive if hero left and returned).  The code sequence
 mon_arrive()-> mnexto()-> m_into_limbo()-> migrate_to_level()-> relmon()
tried to remove the monster from the map, but it wasn't necessarily on
the map (depending upon whether it couldn't arrive at all, or arrived
at the hero's spot and couldn't be moved out of the hero's way).  The
EXTRA_SANITY_CHECKS for remove_monster() issued impossible "no monster
to remove".  relmon() now checks whether monster is already off the map.

While investigating that, I discovered that pets set to re-migrate
to the same level to try again on hero's next visit didn't work at all.
migrating_mons gets processed after mydogs so moving something from
the latter to the former after arrival failure just resulted in
immediate second failure when the more general list was handled during
the hero's current arrival.  And failure to arrive from migrating_mons
would kill the monster instead of scheduling another attempt.

The sanest fix for that turned out to be to have all monsters who
can't arrive be put back on the migrating_mons list to try again upon
hero's next visit.  Pets still fail twice but are no longer discarded
during the second time, and now do arrive when hero leaves and comes
back provided he or she has opened up some space before leaving.  If
there's still no space on the next visit, monsters who can't arrive
then are scheduled to try again on the visit after that.

Recent fix for invalid corpses becomes moot.  Monsters aren't killed
during arrival failure so there are no resulting corpses to deal with.
2018-11-24 01:45:09 -08:00
nhmall
75a962aa78 Revert "Modified how we initialize save file info."
This reverts commit 44b002c9f3.
2018-11-23 22:17:35 -05:00
nhmall
66b874dce3 Revert "Added PLAYAGAIN experimental support definition."
This reverts commit ea8cf6613a.
2018-11-23 22:17:33 -05:00
nhmall
d88490fa94 Revert "Revert "Modified how we initialize save file info.""
This reverts commit 05c9ccc035.
2018-11-23 22:17:31 -05:00
nhmall
c5b283a839 Revert "Added decl_early_init() which is called when PLAYAGAIN is supported."
This reverts commit acbe4d9242.
2018-11-23 22:17:24 -05:00
nhmall
bb826992dd Revert "Previous encumberance state moved to decl.c."
This reverts commit 4e774197a6.
2018-11-23 22:17:22 -05:00
nhmall
28a953337f Revert "Moved petname_used to decl.c"
This reverts commit 6272c37035.
2018-11-23 22:17:20 -05:00
nhmall
162018060a Revert "Initial check in of icontext."
This reverts commit 5bbe3cd6bb.
2018-11-23 22:17:18 -05:00
nhmall
93ebcf0071 Revert "check."
This reverts commit 7814d9097a.
2018-11-23 22:17:16 -05:00
nhmall
7ce4c28eb9 Revert "Fixed nocreate."
This reverts commit 244a473a19.
2018-11-23 22:17:14 -05:00
nhmall
4590c9c0dd Revert "Instance variable work check-point."
This reverts commit 8e316df117.
2018-11-23 22:17:12 -05:00
nhmall
4d6e3326bb Revert "Instance variable work."
This reverts commit 14bf74c862.
2018-11-23 22:17:09 -05:00
nhmall
7ad3f32e16 Revert "Renamed instance_variables to global_variables and iv to g."
This reverts commit f9a0db6c44.
2018-11-23 22:17:07 -05:00
nhmall
414a5135b7 Revert "rumors.c static globals moved to instance_globals."
This reverts commit 6a78b203e4.
2018-11-23 22:17:05 -05:00
nhmall
bf3602eb1b Revert "rfilter initialized to UNDEFINED."
This reverts commit 716c2ceccf.
2018-11-23 22:17:03 -05:00
nhmall
5e5e321378 Revert "Renamed UNDEFINED to UNDEFINED_VALUE."
This reverts commit cee4933c24.
2018-11-23 22:17:01 -05:00
nhmall
053baa8274 Revert "restore.c globals moved to instance_globals."
This reverts commit 865c4d5a7d.
2018-11-23 22:16:59 -05:00
nhmall
04fe16d938 Revert "Moved read.c globals to instance_globals."
This reverts commit d37a91a6b8.
2018-11-23 22:16:56 -05:00
nhmall
2fb68024fe Revert "Moved potion.c globals to instance_globals."
This reverts commit d3c192e5a8.
2018-11-23 22:16:54 -05:00
nhmall
6f3f1caee3 Revert "define nhassert if not defined by port."
This reverts commit cff9fb441a.
2018-11-23 22:16:52 -05:00
nhmall
9db124f650 Revert "Fix compiler warnings in macos build."
This reverts commit 0d59f1a22b.
2018-11-23 22:16:49 -05:00
nhmall
7f023c99fb Revert "Moved sex_change_ok to instance_globals."
This reverts commit ee22210a68.
2018-11-23 22:16:47 -05:00
nhmall
44af1c78f3 Revert "topl.c globals moved to instance_globals."
This reverts commit b384223e1b.
2018-11-23 22:16:45 -05:00
nhmall
61a35d4ac0 Revert "Moved pickup globals to instance_globals."
This reverts commit 01596f1660.
2018-11-23 22:16:40 -05:00
nhmall
734a6c2ddb Revert "objnam.c globals moved to instance globals."
This reverts commit 041e55467a.
2018-11-23 22:16:35 -05:00
nhmall
3cbc6d4cf5 Revert "Modified objects initialization to support re-entry."
This reverts commit c3eefefc99.
2018-11-23 22:16:24 -05:00
nhmall
efdfd2fa1d Revert "Removing prototype for decl_globals_init()."
This reverts commit 26d03b5017.
2018-11-23 22:15:37 -05:00
Bart House
26d03b5017 Removing prototype for decl_globals_init(). 2018-11-23 15:47:18 -08:00
Bart House
c3eefefc99 Modified objects initialization to support re-entry. 2018-11-23 15:22:55 -08:00
Bart House
041e55467a objnam.c globals moved to instance globals. 2018-11-23 15:22:55 -08:00