Commit Graph

2511 Commits

Author SHA1 Message Date
nethack.allison
896b74a400 autopickup_exceptions docs and tweak
- document it
-added a goto (shudder) to return to the menu choices after getting
a list of the autopickup_exceptions
2003-11-15 18:47:32 +00:00
nethack.rankin
e989ae0b96 resuming interrupted 'A' command
[ Caveat:  compiles ok on branch code but only play tested on trunk code;
  the do_wear.c diff is a lot different between the two variants and the
  trunk one includes some whitespace cleanup. ]

     <email deleted> reported that having a spellcasting monster
destroy some armor while you're in the midst of using 'A' to take that
armor off would result in a crash.  The problem was actually more
widespread than that:  having a nymph steal worn items (accessories as
well as armor), or a succubus remove them, or being interrupted by monster
activity and then reading a scroll of destroy armor prior to resuming 'A'
could all produce a similar crash.  'A' relied on stale context and could
attempt to manipulate an equipment slot which had become empty, ultimately
leading to an attempt to dereference a null pointer.

     The 'R' command didn't have this problem since any accessory gets
removed immediately.  The 'T' command already had handling for this:
there's only one item to deal with and multi-turn take off only applies
to some of the slots; the donning() check followed by cancel_don() took
care of those.  Only 'A' was vulnerable to the problem and it wouldn't
necessarily need to be interrupted and resumed; loss of the current
multi-turn item or any pending item would be enough--but I'm not sure
whether such item loss could occur without also interrupting the current
activity, so resumption of previous 'A' was probably a requirement for
triggering the crash.

     This makes shield and shirt handling be similar to other types of
armor instead of relying on the fact that none of them need to have any
attribute adjustments when put on or taken off.  However, there are
still assumptions (the `cancelled_don' stuff) that some slots don't have
any eligible items requiring more than a single turn to use; that should
probably be changed.
2003-11-15 10:25:09 +00:00
nethack.rankin
23d3a146d9 autopickup exceptions
External names longer than 31 characters trigger a compiler warning
for me about truncation, and that causes make to quit.  So shorten the
two long names.  Also, call the cleanup routine for the FREE_ALL_MEMORY
configuration.
2003-11-15 08:09:18 +00:00
nethack.allison
e9afb34423 autopickup_exceptions enhancement
An enhancement to the original to allow
two types of exceptions:
      always pickup
      never pickup

To specify "never pickup", begin the pattern string with '>'
which is NetHack's down direction symbol (for "leave it down")

To specify "always pickup", begin the pattern string with '<'
which is NetHack's up direction symbol.

For example, to pick up all arrows, regardless of the pickup_
types setting:
autopickup_exception = "<*arrows"
2003-11-15 02:49:07 +00:00
nethack.allison
a89c7cfa60 autopickup_exceptions build followup
- correct an obsolete, incorrect comment
2003-11-15 01:17:44 +00:00
nethack.allison
c0349ec918 autopickup_exceptions build option
Add config.h experimental option AUTOPICKUP_EXCEPTIONS.

It's an interface-only change which allows you to add lines to your
config file to selectively avoid autopickup of items based on their
text description that is displayed when you pick them up. It does
it by matching a pattern against the xname singular return value.

For example:

autopickup_exception = "*corpse" will avoid picking up corpses, even if
food (%) is in your pickup_types.

autopickup_exception = "*brown*"
will avoid picking up any brown items (why, I do not know)

autopickup_exception = "*loadstone"
will NOT avoid picking up loadstones, unless they are already
identified, because the xname string will be "gray stone", so no
match there.

The matching has no knowledge of in-game objects, it is just
a text pattern match, thus it is an interface change, not a gameplay
change, and it is meant as a convenience for players.
2003-11-15 01:05:32 +00:00
nethack.allison
507e1293e6 win32tty: Fix an early error message crash 2003-11-15 00:38:59 +00:00
nethack.allison
f96fca8005 no message 2003-11-15 00:23:15 +00:00
nethack.allison
52490ee062 B01004 No mimic corpse effect on pet (trunk only)
Make a mimic effect that lasts only as long as the
pet is still consuming the corpse.
2003-11-12 03:28:26 +00:00
nethack.rankin
bc06d02d24 deafness fix (trunk only)
Evidently the trunk code isn't undergoing much testing lately;
"you hear <blah>" messages have been broken for a couple of weeks now.
2003-11-10 08:09:15 +00:00
nethack.allison
b1dd8ac093 silver wands followup
There was code higher up that could destroy the obj,
so this eliminates any risk of trying to dereference a
bad pointer in the deferred silver message by saving
a copy of the name earlier on.
2003-11-10 01:39:38 +00:00
cohrs
800baf8771 B01001 - bold menu_heading support
Not really a bug, but when TEXTCOLOR is defined, wintty can display menu
headings is bold upon request, but didn't.
2003-11-10 00:15:47 +00:00
nethack.allison
8212618221 silver wands
From the newsgroup:
> <email deleted> (<Someone>)
> Newsgroups: rec.games.roguelike.nethack
> Subject: Question: Why don't silver wands give silver damage?
> Date: 9 Nov 2003 09:18:50 -0800
> Organization: http://groups.google.com
> Lines: 7
> <email deleted>
>
> I had a character cornered by a werejackal the other day.  I'm not too
> bothered by the death but why didn't the silver wand he desperately
> wielded in his final moments do extra damage?  I mean, silver rings do
> so why not wands?  I realise this is a pretty minor problem since not
> that many people will be going around wielding wands, but still.
>
>  ~<Someone>

There was a code path for objects such as wands that avoided
all the silver checks. Now fixed.
2003-11-09 23:38:33 +00:00
nethack.allison
d290e918c6 flag adjustment followup (trunk only) 2003-11-09 16:05:51 +00:00
nethack.allison
7bab241f17 flag adjustments (trunk only)
Move all system or port specific flags to sysflags which is used only if
SYSFLAGS is defined, and leave everything else in flags unconditional.
2003-11-09 11:48:38 +00:00
nethack.allison
da80c0572e Acknowledge Schroedinger's cat (trunk only)
Acknowledge Schroedinger's cat at end of game.
- determine cat's status:
      - give points for the animal which accompanied
        you.
     or
     - include dead cat in the box contents.

Schroedinger's cat is the only ordinary creature
that could actually ascend with you.

This patch doesn't deal with any supernatural creatures
including:
 - djinn in bottles
 - ghosts in bottles
2003-11-07 18:42:59 +00:00
warwick
2d9aba259d POSIX compliance for get_saved_games(). 2003-11-07 04:47:26 +00:00
nethack.allison
0834d51482 mon name buffers
Follow suit with what <Someone> did for the object name buffers,
so that this sort of statement can work correctly:

	pline("%s hits %s.", Monnam(mtmp), mon_nam(mtmp2));
2003-11-06 02:16:22 +00:00
cohrs
cf07cbf556 U716 - trapped monster switching weapons
A trapped monster with one step between you and the monster (@.@) would
repeatedly switch between a ranged and hand-to-hand weapon if carrying both.
Since the monster switches each turn, it will not make ranged attacks.
Modified the test in dochug to prefer a ranged weapon in this case.
2003-11-05 15:47:50 +00:00
nethack.allison
1922636393 wiztele follow-up 2003-11-04 11:49:09 +00:00
cohrs
4981e82bb4 U716 - trapped monster switching weapons
A trapped monster with one step between you and the monster (@.@) would
repeatedly switch between a ranged and hand-to-hand weapon if carrying both.
Since the monster switches each turn, it will not make ranged attacks.
Modified the test in dochug to prefer a ranged weapon in this case.
2003-11-04 05:52:54 +00:00
nethack.allison
886349c1dd wizmode level teleport
<Someone> wrote:
> The new ^V wizmode menu is nice, but it is rather misleading; most of
> the levels it lists are "you can't get there from here". Would it be
> possible either to make it only list levels that can be reached
> directly, or alternatively to allow you to reach the ones you
> ordinarily couldn't (maybe by forcefully changing u.uz.dnum to yoink
> you into the right branch, and even summarily issuing you with an
> Amulet if you ask to teleport to the endgame).[...]; being able to bamf
> quickly to Minetown from DL 1, for example, would be damn useful in > testing stuff.

Allow fairly free roaming of the dungeon via the wizard mode teleport menu.
2003-11-02 18:47:50 +00:00
nethack.allison
e3462e093e <Someone> wrote:
> The new ^V wizmode menu is nice, but it is rather misleading; most of
> the levels it lists are "you can't get there from here". Would it be
> possible either to make it only list levels that can be reached
> directly, or alternatively to allow you to reach the ones you
> ordinarily couldn't (maybe by forcefully changing u.uz.dnum to yoink
> you into the right branch, and even summarily issuing you with an
> Amulet if you ask to teleport to the endgame).[...]; being able to bamf
> quickly to Minetown from DL 1, for example, would be damn useful in > testing stuff.

Allow fairly free roaming of the dungeon via the wizard mode teleport menu.
2003-11-02 17:59:22 +00:00
nethack.allison
5c9c0732cb win32tty hung NetHack fix
If a Key-down event didn't meet the expected criteria,
the event was ignored in the "peek" loop, but it was
never removed from the input queue either, so it
remained at the top of the queue.

It isn't clear if this fixes the dedicated arrow keys
hanging, but if those were resulting in strange
event values too, it just might.
2003-11-01 23:56:24 +00:00
nethack.allison
67dea0ebe1 B01001 fix: corpse grammar
<Someone> wrote:
> You start bashing monsters with your 2 cockatrice corpses.
> You hit the foo with the cockatrice corpse (note singular).
> The foo is slowing down. The foo turns to stone.
> Also: Your cockatrice corpses rots away.

It appears that vtense() has a problem recognizing "corpses"
as plural.  This doesn't fix that, it just switches to using
otense() in this particular case.
2003-11-01 22:05:44 +00:00
cohrs
64f2d8a37b sleeping shopkeeper
Pat verified something I had wondered about, that various tests of mcanmove
in shk.c should have also been testing mcanmove.  There may well be other
tests of mcanmove in other files that need fixing.
2003-10-30 04:31:05 +00:00
nethack.allison
863de70092 debug mode monster creation [trunk only]
Allow '*' with control-g to create a random monster species,
or several different monster species if a multi count was specified
on the control-g command.
2003-10-30 02:52:29 +00:00
cohrs
e8a53c9ea3 sleeping monster responding to attacks
when msleeping is set, mcanmove is not cleared.  mcanmove applies only to
mfrozen.  So, mattackm needs to test both mcanmove and msleeping.
mattackm will not wake the defender if the attack misses.
2003-10-30 02:40:45 +00:00
nethack.allison
cdbe3b1d39 U719: grayswandir and exploding black lights
<email deleted> wrote:
> When wielding greyswander and a black light explodes, the
> message is still "You are freaked by a blast of kaleidoscopic
> light!" giving no indication that you are immune to
> hallucination. Maybe something like "You see a blast of color,
> but seem unaffected" would be more appropriate?

return the changed status back to the caller from
make_hallucinated().
2003-10-29 13:03:23 +00:00
nethack.allison
fec5392055 healer follow-up bit (trunk only)
There is a new Deaf attrib to consider in the trunk.
2003-10-28 12:49:11 +00:00
nethack.allison
6c4e1227a4 ce fix (from <Someone>)
set interject() and interject_assistance() to NOP for Windows CE port.
2003-10-28 12:19:26 +00:00
nethack.rankin
7232e52367 display bit for spellbook gift (trunk only)
From the newsgroup:  when invisible and unable to see invisible,
if successful prayer results in being given a spellbook you'll get the
message "an object appears at your feet" but the spellbook won't show on
the map.  Add a newsym() to force its location to be updated.  (I didn't
try to figure out why spellbooks use place_object() when all other divine
gifts use dropy() but that's why only this case has the display glitch.)

     This also fixes up the message vs map update sequencing for a couple
of other "at your feet" cases so that all of them use the same ordering:
first the message is given, then the object drops.

[Timing is the only reason not to put this simple change into 3.4.3.]
2003-10-28 06:55:18 +00:00
nethack.allison
39564c274c tin variety followup 2 (trunk only) 2003-10-28 04:36:24 +00:00
nethack.allison
4c0d380e68 tin variety followup (trunk only) 2003-10-28 04:14:01 +00:00
nethack.allison
d08dcbc3fb tin variety (trunk only)
- store the variety of tin at tin creation time
  rather than at tin-opening time (as a negative
  value in spe just as homemade was; spinach
   is still spe 1)

Allow wishing for a particular variety of tin
from the tin variety list:
	"deep fried", "boiled","broiled","candied"
	"dried", "french fried", "homemade"
	"pickled", "pureed", "rotten", "sauteed"
	"smoked", "soup made from", "stir fried",
	"szechuan"
Example: "tin of soup made from orc"

non-debug player could randomly fail on the
variety specification 1 in 4 times
2003-10-28 03:45:49 +00:00
nethack.allison
f66a750562 win32tty: fix extended commands
The autocompletion was working, but you couldn't tell
because the text was overwritten with blanks.  This was
a recent glitch created during fix for other cursor problems.
2003-10-27 01:14:02 +00:00
cohrs
05f2aa40ce crash on hangup following
restore the exit_nhwindows call, but in the right place.  without this,
the window inteface doesn't get a chance o shut down.
2003-10-27 00:59:54 +00:00
cohrs
1dae4245f5 crash on hangup
the message history saver needs the windows to stick around until save
is completed.  This usually the case, but end_of_input() was calling
exit_nhwindows prematurely.  This is actually an old bug (calling it early,
but wasn't harmful until other recent changes).
2003-10-27 00:39:45 +00:00
nethack.allison
dbb1d0f230 saving msg history glitch (trunk only)
<Someone> discovered that it is possible to
have wins[WIN_MESSAGE] be null during
a hangup, not sure why yet.

Put a guard in to prevent de-referencing a null pointer.
2003-10-27 00:23:22 +00:00
nethack.allison
211666434c more win32tty clean-up
This brings things much closer to correct operation (I hope).
- The shift to only moving the cursor on input (<Someone>'s
changes) had a lot of complications, among them was
that sometimes, there is no more input. When the program was
exiting, or bombing the cursor synch never got done, so the
final messages could end up strewn any place the cursor
happened to be dwelling.

- There were two competing output systems in use: the
wintty stuff for the game, and the msmsg and error stuff
used by the sys/share/pcsys, sys/share/pctty, and
sys/share/pcunix routines.  Those were meant to mimic
output to stdout, where stuff just got sent to a sequential
display.  Over time, there were calls mixed in that depended
on the cursor tracked stuff from the core game, so you
really couldn't be sure where things were going to display.
It wasn't as much of an issue before, because the cursor
really did get moved around as expected. Everything
now ends up in the same output system.

- I even found a use of the real putchar() because
sys/share/pcunix didn't #include wintty.h the same
as the other files, and the macro never got defined.
Who knows where that character was being put -
the game certainly couldn't track it.

While everything I knew to be wrong yesterday is
now working, there may be some other glitches
lurking that I haven't discovered yet.

Please: test, test, test.
2003-10-26 15:56:50 +00:00
nethack.rankin
ca476c0eb2 patchevel.h comment 2003-10-26 06:04:04 +00:00
nethack.allison
043a2944ca class differentiation followup
> Healers pick up on the fact that a wand of undead turning
> revived a creature.
...if a vital piece of code isn't accidentally left out
2003-10-25 22:37:18 +00:00
nethack.allison
b4c2f74c22 class differentiation bit (trunk only)
Healers pick up on the fact that a wand of undead turning
revived a creature.
2003-10-25 22:20:24 +00:00
cohrs
cd7e1163e1 changing level workaround (C341-13)
Use a new flush_screen(-1) call to toggle 3rd screen update in goto_level.
This keeps the 3rd screen state unchanged, no matter what happens at higher
levels, ensures the map window cursor stays on the hero, ensures the
hero's showrace colors remains bright white, and so on.
2003-10-25 19:28:54 +00:00
nethack.allison
125d1f1cf1 handheld lockfile left around fix (from <Someone>) 2003-10-25 18:32:30 +00:00
nethack.allison
2a9f2b1f36 patchlevel.h sync between branch and core 2003-10-25 15:20:04 +00:00
nethack.allison
fa8956dbb9 win32gui build fix (from <Someone>)
<Someone> wrote:
> Using the MCVS IDE I couldn't compile NetHack any longer, due to a
> misplaced #endif and a library not included in the DSP file.
> Here's a patch for both problems for 3.5.0.
> The 3.4.x verison only suffered from the first problem. Patch also
> attached.
2003-10-25 14:45:51 +00:00
nethack.allison
58f322841d more win32tty fixes
There were still some significant startup message problems
with win32tty.

I've spent a lot of time in the debugger tracing through them all.
I think I've got them all worked out now, certainly the ones that
I was aware of.  There may be some I haven't discovered.
Testing welcomed of course!

This patch also attempts to diagnose the error where someone tries
to execute NetHack directly out of a zip file, and provide
them with a (hopefully) helpful message similar to what we
might end up telling them if they wrote in.  If you want
to test that part, you can comment out the line in the
Makefile that adds "dungeon" to nhdat, and delete the nhdat
in your binary and src directories, and "make install".
Then add the value of your TEMP environment variable as a
DATADIR statement in defaults.nh (here's mine):
	DATADIR=C:\DOCUME~1\ALLISO~1\LOCALS~1\Temp
The diagnostic code engages if the game fails to open
dungeon. It then checks to see if it the game dir is the
TEMP directory for your system, and if so it prints the
message.
2003-10-25 04:02:24 +00:00
nethack.allison
b989a746a0 fixes catchup 2003-10-25 03:59:09 +00:00
nethack.allison
45dd5ffe9f win32tty: startup msg cleanup
the win32 cursor restriction stuff messed up any
messages displayed during abnormal start conditions
where the window system never got initialized properly.
among them:
- messages relating to lock files or games in progress
- dungeon errors
- early panic messages
2003-10-24 15:15:44 +00:00