nethack.allison [Sun, 7 Dec 2003 01:33:25 +0000 (01:33 +0000)]
wince build fix (from <Someone>)
[this is not meant to trigger re-packaging for 3.4.3]
Windows CE defines leave as part of exception handling (__leave)
It confilicts with existing sources and since we don't use exceptions
it is safe to undefine it
nethack.rankin [Sat, 6 Dec 2003 14:08:51 +0000 (14:08 +0000)]
fix the "big abuse" reported a few days ago
It was possible to get a shopkeeper to carry the Amulet from the
bottom of the dungeon up to the location of his shop, thereby bypassing
the usual labor of lugging it up yourself. [Drop the Amulet somewhere;
rob a shop so that the Kops are summoned and the shk comes after you;
when shk is next you, level teleport to the Amulet (probably two hops,
one to the Valley and another deeper into Gehennom); walk to the vicinity
of the Amulet; shk will eventually pick it up (shopkeepers like to pick
up magic items); now, pay him for the stolen goods--he'll be pacified
and migrate back to his shop, taking his inventory with him; lastly,
return to his shop and relieve him of his burder.] This patch makes
shopkeepers drop the Amulet or invocation tools if/when they set set to
migrate to their normal location.
Also fix another long standing risk that a monster that is sent
away (nurse when healing, Kops when you pacify a shopkeeper) might be
carrying the Amulet or one of the invocation tools and make the game
unwinnable. I doubt that that's ever actually happened but I think it'd
be possible if a monster that likes magic items ever got polymorphed
into a Kop. Such dismissed monsters will now drop the same stuff as
the shk above prior to leaving the game.
nethack.rankin [Fri, 5 Dec 2003 11:37:37 +0000 (11:37 +0000)]
#U770 part II - lack of "miss" message when throwing gold at monster
There was no feedback when gold was thrown or kicked at monsters
who weren't interested in catching it. Now it'll give the same "<obj>
misses <monster>" message as other thrown or kicked items objects which
don't hit.
nethack.rankin [Fri, 5 Dec 2003 08:54:32 +0000 (08:54 +0000)]
fix U770 - grammar bug: The gold pieces hits the [monster]
Report was for scattering gold during a land mine explosion, but the
message was delivered by the widely used hit(). Bug was caused by a typo
in vtense() when handling a subject containing a space.
nethack.rankin [Wed, 3 Dec 2003 07:10:24 +0000 (07:10 +0000)]
loadstone dropping fix
Fix the reported problem of bad inventory management if the user
specified a count (with traditional menu style) when attempting to drop
part of a stack of cursed loadstones. After the "you can't drop that"
message, it tried to undo the stack split, but splitobj was changed
sometime back and the undo hack wasn't adjusted to account for the fact
that it needed to merge with the previous object instead of the next one.
The result was that it would incorrectly increment the count of the next
item instead of the original loadstone, or crash in canletgo() if the
split off stone was the last item in the list.
This prevents cursed loadstones from being split (via getobj()'s
count handling) in the first place, so there's nothing to undo later.
It still uses a similar kludge so that the "can't drop that" message can
be adjusted, but it's now a simpler kludge and I hope a more robust one.
nethack.allison [Tue, 2 Dec 2003 05:00:02 +0000 (05:00 +0000)]
B02005 and B02006
B02006 autopickup_exception documentation
>Should the documentation say what priority order is used if two conflict?
>(For example, how ">*orcish" and "<*arrow" handle an orcish arrow; from
>experimentation, > always takes precedent over < , but I could be
>missing something.)
B02005 autopickup_exception option menu
> It'd be nice if you were returned to the menu after adding an exception
> via O so that you can set several with one command.
nethack.rankin [Sun, 30 Nov 2003 21:19:01 +0000 (21:19 +0000)]
corpse revival and statue animation (trunk only)
Try to address the problem From a bug report: turning the Wizard
of Yendor to stone preserves monster information with his statue and
presence of that information overrides the statue animation check
intended to prevent players from creating the Wizard (or other unique
monsters). That's ok for the current game--the monster had to have been
in play in order to be turned to stone--but is a problem if the statue
is found in a bones file. The report was for placing such a statue at
the location of an untriggered statue trap by a player who leaves bones,
but stone-to-flesh by the player who loads bones is a simpler way to
trigger this. (Aside from getting unique monsters earlier than usual
under some degree of player control they won't have their starting
inventory so special items like the Candelabrum might not get created.)
Using undead turning to revive corpses found in bones was another way to
get into the same trouble (I thought corpses of special monsters were
already excluded from bones?).
It looks like it's also possible to get strange quest behavior if
a corpse or statue of the leader or nemesis is brought into the dungeon,
left in bones, then revived by the second player, but I didn't attempt
to reproduce it. More work is probably needed; this tightens up leader
handling a bit but doesn't do anything about the nemesis. This patch
has already been spreading tentacles and I've got to cut it off....
The patch discards saved monster traits for corpses and statues of
unique monsters while saving bones; reviving or reanimating them will
produce doppelgangers instead of the original monsters, same as stone-to-
flesh on wished-for statues behaves. It also discards saved traits for
shopkeepers (also temple priests and vault guards--their traits weren't
saved in 3.4.2 though). That info might be useable when the corpse or
statue is on the same level as the monster started (ie, where its special
room is located), but that's a complication I'm going to bypass. This
patch also adds chameleon handling for statue activation--it wouldn't
have mattered in 3.4.2 since shapechangers didn't get their traits saved;
it does matter now but was omitted when trait-saving was extended to all
statues a while back. (It adds chameleon handling to corpse revival too,
but they still don't get their traits saved with corpses so that's just
protection in case of future modifications.)
Other bits: `cant_create()' is renamed to `cant_revive()' since
the latter is a more signicant use than wizard mode <ctrl/G> handling.
Now save traits with nymph corses so that cancellation can be propagated
if they're revived; that doesn't matter much but matches statue handling
(where it was more important since it dealt with succubi as well as with
nymphs). Explicitly initialize the shape-changer field of all monsters
instead of relying on implicit initialization to 0 (CHAM_ORDINARY).
There'll be a *much* shorter patch for 3.4.3 which will have to get
by with most of these obscure problems--fortunately they're unlikely to
impact many (any?) players.
nethack.rankin [Sun, 30 Nov 2003 11:04:54 +0000 (11:04 +0000)]
status bits
Declare structure before using it in prototypes, and declare atol()
for configurations which don't have or don't use <stdlib.h>. (Some
#ifdef MICRO code for atoi at the end of system.h might need to be done
for atol too.)
nethack.allison [Sun, 30 Nov 2003 05:51:53 +0000 (05:51 +0000)]
core support for status field highlighting (trunk only)
This provides the core support needed for status field highlighting.
This patch doesn't actually perform status field highlighting for any port,
but provides the core hooks for doing so.
The syntax is:
OPTIONS=hilite_status:{fieldname}/{threshold}/{below}/{above}
where {fieldname} is the name of a status field.
{threshold} is the value used as the threshold to trigger a display
change. It can also be set to "updown" to trigger
a display change whenever it rises or whenever it falls.
If you end the threshold value with %, then it signifies
that you want to trigger the display change based on the
percentage of maximum.
{below}, {above}
are the color or display attribute that you want to use when
the field value is underneath the threshold. Supported display
fields are: normal, inverse, bold, black, red, green,
brown, blue, magenta, cyan, gray, orange,
bright-green, yellow, bright-blue, bright-magenta,
bright-cyan, or white.
Valid field names are:
alignment, armor-class, carrying-capacity,
charisma, condition, constitution, dexterity,
dungeon-level, experience-level, experience,
gold, HD, hitpoints-max, hitpoints, hunger,
intelligence, power-max, power, score,
strength, time, title, wisdom
Refer to window.doc for details. Guidebook updates to come later.
nethack.allison [Sat, 29 Nov 2003 18:48:13 +0000 (18:48 +0000)]
egg hatching message bug
> From the newsgroup: an egg carried by the hero hatched and the
> resulting monster was placed in hiding underneath an adjacent object.
> The silly hatching message given was "You see it drop from your pack."
> (Player said he was using 3.4.1, but the relevant code hasn't changed
> since then.)
cohrs [Thu, 27 Nov 2003 17:37:38 +0000 (17:37 +0000)]
B02002 - drawbridge vs longworm
If a long worm's head is on the drawbridge and a tail segment is at the
portcullis and you raise the drawbridge, bad monster handling occurs
because of some recursion that occurs before set_entity is called again.
Not sure when this last worked; it's broken in 3.4.2 as well. Modified
e_died to ensure both entity objects for the same monster get cleaned up
so subsequent e_at calls behave as expected.
cohrs [Thu, 27 Nov 2003 07:03:56 +0000 (07:03 +0000)]
U761 - Sitting as a hider and other related is_hider behavior
While looking at the behavior of sitting hiders, I noticed other related
odd behavior.
- player hiding while poly'd as a hider that hangs on the ceiling now drops to
the floor before sitting (similar to the behavior of movement commands).
- trappers, as per data.base, don't hang on the ceiling. Changed the
mattacku case dealing with hiders to not treat trappers as ceiling hiders.
- updated can_reach_floor to also exclude ceiling hiders. This covers a
bunch of cases, such as pickup, look-here-while-blind, and so on. Another
alternative would have been to automatically unhide for all such cases.
trunk only, it's a minor bug IMO and we appear to be close to a release.
nethack.rankin [Thu, 27 Nov 2003 05:00:29 +0000 (05:00 +0000)]
poison messages (trunk only)
<Someone> reported something along the lines of
"You are hit by a little dart."
[ "The dart was poisoned." -- this expected message was missing ]
"The poison doesn't seem to affect you."
Remove the overloading of ``chance for fatal poison'' and ``thrown weapon''
(which reduces that chance, among other things) for the arguments passed to
poisoned() and change how it decides whether feedback about being poisoned
is needed. Also, move poisoned() and poisontell() from mon.c to attrib.c.
cohrs [Wed, 26 Nov 2003 21:54:07 +0000 (21:54 +0000)]
compilation and warnings bits for new botl code
- gcc warned that the "anything" initializer needed more braces
- gcc also warned of a couple unused variables
- WIN_STATUS, when STATUS_VIA_WINDOWPORT is not defined, had no type
cohrs [Sun, 23 Nov 2003 21:36:36 +0000 (21:36 +0000)]
Unix CLI option to set windowtype
Add the ability to select the windowtype on the command line on Unix using
a new -wwindowtype option. I had thought the proposed patch could core
dump, but the default windowtype selection occurs earlier and ensures
that raw_print will always work. So, the only problem with the proposed
patch was it didn't move the linux and sco special-case code until after
the selection was made. That special-case code really should be moved to
to wintty.c, IMO since it doesn't affect other windowtypes.
cohrs [Sun, 23 Nov 2003 21:24:16 +0000 (21:24 +0000)]
lit and unlit corridors
The default symbol for lit and unlit corridors are the same. This makes
the lit_corridor option a no-op where the defaults are used and also means
that using a light scroll/spell a corridor has no obvious effect. To
address that, I special-cased the lit corridor symbol and change its color
to bright white when its the same symbol as the unlit corridor symbol (I
didn't change the default color since I thought that made the lit corridor
look strange using the windows console interface).
nethack.rankin [Sun, 23 Nov 2003 09:47:34 +0000 (09:47 +0000)]
build fix (trunk only)
DEC C warned about a problem and that caused make to quit.
| idx = (++idx % 2);
|........^
|%CC-W-UNDEFVARMOD, In this statement, the expression "idx=(++idx%2)"
|modifies the variable "idx" more than once without an intervening
|sequence point. This behavior is undefined.
nethack.allison [Sun, 23 Nov 2003 06:50:48 +0000 (06:50 +0000)]
status display - new file (trunk only)
Introduction of a new set of window port status display
routines. The new routines are conditional on
STATUS_VIA_WINDOWPORT
being defined in config.h. See the experimental section,
where the #define resides for the time being.
nethack.allison [Sun, 23 Nov 2003 06:47:13 +0000 (06:47 +0000)]
status display - port modules (trunk only)
Introduction of a new set of window port status display
routines. The new routines are conditional on
STATUS_VIA_WINDOWPORT
being defined in config.h. See the experimental section,
where the #define resides for the time being.
nethack.allison [Sun, 23 Nov 2003 06:43:17 +0000 (06:43 +0000)]
status display - core modules (trunk only)
Introduction of a new set of window port status display
routines. The new routines are conditional on
STATUS_VIA_WINDOWPORT
being defined in config.h. See the experimental section,
where the #define resides for the time being.
nethack.rankin [Fri, 21 Nov 2003 08:08:49 +0000 (08:08 +0000)]
redundant "you finish disrobing" messages
Just From a bug report: getting interrupted and then
resuming would sometimes produce two instances of the "You finish" message
(and evidently consumed an extra turn in the process). I think this is
an old problem and that it's just coincidence that it showed up right after
the patch dealing with avoidance of stale context for 'A'; the interruption
has to occur when there is just one turn left in removing the final item
so doesn't happen very often.
nethack.rankin [Thu, 20 Nov 2003 04:54:39 +0000 (04:54 +0000)]
stethoscope use on corpses & statues (trunk only)
Prompted by the report that it was possible to check a corpse at an
adjacent spot while levitating: substantially revamp the handling of
applying a stethoscope to corpses and/or statues. Aside from the missing
reachability check, the old code suffered from grammar problems when
multiple corpses were present and it didn't try to figure out the gender
of the monster who left the corpse.
This now lets non-healers check corpses and statues at any time
(previously that only worked for them while hallucinating). For healers
it gives some new feedback: when listening to a corpse, they'll be given
a hint if it (actually any corpse in the pile at that location) is going
to revive, and when listening to a statue they'll be given a hint if it
contains any items. The existing hint when a statue is actually a trap
is still only given to healers.
nethack.rankin [Thu, 20 Nov 2003 04:40:46 +0000 (04:40 +0000)]
couple of new routines (trunk only)
Groundwork for forthcoming stethoscope fix: add an object list
traveral routine (there must be something like this already, but I
couldn't find it...) and a couple of timer access routines.
nethack.allison [Sun, 16 Nov 2003 20:10:30 +0000 (20:10 +0000)]
monsters moving other monsters (trunk only)
For now, the code is conditional on BARGETHROUGH
being defined, while it gets tested further. While behavior is
different with and without BARGETHROUGH defined, savefiles
are the same either way.
After this patch is applied, only the riders have the M3_DISPLACES
bit set, but the Wizard and Vlad probably should too. Any others?
nethack.allison [Sat, 15 Nov 2003 23:26:18 +0000 (23:26 +0000)]
Guidebook typo
Oops, I spotted a typo that I made in the new text.
For the branch, there is no need to re-synch, as the
the generated .txt version is also patched with this patch.
nethack.allison [Sat, 15 Nov 2003 23:15:01 +0000 (23:15 +0000)]
more autopickup_exception
An optimization.
Split the patterns into two chains, one for things you want "always picked up", and one for things you want "never picked up". That way, the
entire exception list isn't being checked twice, once for each type of
check. The check for things to "always pick up" only checks the
chain at the AP_GRAB index, and the check for things to "never
pick up" only checks the chain at the AP_LEAVE index.
- Also modifies the toggle autopickup '@' message
appropriately for the AUTOPICKUP_EXCEPTIONS build.
(it just tacks on ", with some exceptions" if there are some)
cohrs [Sat, 15 Nov 2003 21:01:46 +0000 (21:01 +0000)]
Guidebook bits
Guidebook used both "behavior" and "behaviour". I think this was the
only word not using the US-English spelling. Also fixed a spacing bit
in Michael's latest rev to the .mn version.
nethack.rankin [Sat, 15 Nov 2003 10:25:09 +0000 (10:25 +0000)]
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.
nethack.rankin [Sat, 15 Nov 2003 08:09:18 +0000 (08:09 +0000)]
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.
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.
nethack.allison [Mon, 10 Nov 2003 01:39:38 +0000 (01:39 +0000)]
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.
nethack.allison [Sun, 9 Nov 2003 23:38:33 +0000 (23:38 +0000)]
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.
nethack.allison [Fri, 7 Nov 2003 18:42:59 +0000 (18:42 +0000)]
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
cohrs [Wed, 5 Nov 2003 15:47:50 +0000 (15:47 +0000)]
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.
cohrs [Tue, 4 Nov 2003 05:52:54 +0000 (05:52 +0000)]
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.
nethack.allison [Sun, 2 Nov 2003 18:47:50 +0000 (18:47 +0000)]
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.
nethack.allison [Sun, 2 Nov 2003 17:59:22 +0000 (17:59 +0000)]
<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.
nethack.allison [Sat, 1 Nov 2003 23:56:24 +0000 (23:56 +0000)]
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.
nethack.allison [Sat, 1 Nov 2003 22:05:44 +0000 (22:05 +0000)]
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.
cohrs [Thu, 30 Oct 2003 04:31:05 +0000 (04:31 +0000)]
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.
nethack.allison [Thu, 30 Oct 2003 02:52:29 +0000 (02:52 +0000)]
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.
cohrs [Thu, 30 Oct 2003 02:40:45 +0000 (02:40 +0000)]
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.
nethack.allison [Wed, 29 Oct 2003 13:03:23 +0000 (13:03 +0000)]
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().
nethack.rankin [Tue, 28 Oct 2003 06:55:18 +0000 (06:55 +0000)]
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.]