Commit Graph

827 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.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
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
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
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
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
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.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
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
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
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
b989a746a0 fixes catchup 2003-10-25 03:59:09 +00:00
nethack.allison
4ceb7c3743 starting pet identification
make it possible for the code to recognize your starting pet throughout the
	game via is_starting_pet(mon) macro.
2003-10-24 12:15:46 +00:00
cohrs
25d9778b64 stone to flesh bit
<Someone> suggested and I agree (mostly, if you're a Monk poly'd to a
strict carnivore, I think it should still smell delicious):
> "You smell the odor of meat." (if herbivorous)
> "You smell a delicious smell." (otherwise)
> I think that if your character is a monk or still veg(itari)an, you should
> also get the first message. Even if you're not intentionally vegitarian,
> the first message is still appropriate.
2003-10-24 05:58:39 +00:00
cohrs
a9c80974e8 another conflict abuse
Reported a really long time ago (June 2001) by <Someone>:
 - stand on the upstairs and engrave Elbereth with a /oFire
 - create Demogorgon and e.g. a tame dragon
 - cause conflict
 - Dragon will kill Demogorgon and Demogorgon will never ever attack Dragon.
All monsters could still attack Demogorgon without response via fightm().
Modified fightm() to include a bit of code in m_move and dog_move, allowing
response to an attack.  Testing this in action, Demogorgon still usually
did things detrimental to the player, mostly summoning nasty monsters.
2003-10-24 01:59:48 +00:00
nethack.allison
96b0d848b2 buglist: polymorphed into quantum mechanic
<email deleted> wrote:
- When polymorphed into a quantum mechanic, it is possible to jump in
  the water on a no teleport level and instinctively teleport.
- When an engulfing monster is teleported away on a no teleport level
  when the hero is polymorphed into a quantum mechanic, there is no
  message displayed like "You are no longer engulfed!" because
  u_teleport_mon is passed FALSE for give feedback. But maybe this is
  for a good reason...
2003-10-24 01:54:34 +00:00
nethack.allison
e4495a6389 <Someone>'s were_summon rules
>Hemmed in by one invisible wererat?
><Someone>: Should I feel hemmed in if I can see that a wererat summons
>zero rats? Can the invisible wererat hem me in all by itself? And
>even if it had summoned anything, wouldn't a different message had
>been clearer (for isntance, "Rats appear around you!"); after all,
>I could see *what* was hemming me in.
>I agree that the current messages (and even the ones aspired to by the
>comment) are non-ideal.

<Someone>'s suggested set-up:
Seen summoner, seen help    : "The wererat summons help!"
Seen summoner, unseen help: "The wererat summons help! You feel hemmed in."
Seen summoner, no help: "The wererat summons help! But none comes."
Unseen summoner, seen help: "(A rat appears|Rats appear) from
nowhere!"
Unseen summoner, unseen help: "You feel hemmed in."
Unseen summoner, no help: No message.
2003-10-23 12:13:21 +00:00
nethack.rankin
5b9c03729c weapon skill tweak
Barbarians start with either a two-handed sword and an ordinary axe
or a battle-axe and a short sword.  The latter combination was the only
one among all the roles where the player couldn't enhance skills for
starting weapons to expert.  Fix that by allowing barbarians to become
expert in short swords; reduce potential capability with pick-axe/mattock
from expert down to skilled to compensate for the increase.

     This also addresses an earlier complaint that monks are no better in
martial arts than samurai even though the latter have lots of choices for
good weapon skills.  Reduce the martial arts limit on samurai from grand
master to just master; likewise with bare-handed combat for barbarians
and cavemen.  In this case there didn't seem to be any need to bump the
limit on anything else as compensation.

     I still think non-rogues shouldn't be allowed to become expert in
daggers (which means that ranger and valkyrie starting gear would need
to change slightly) due to how powerful throwing them is, but I haven't
included that change here.

     For the skills which have lower upper limits than before, existing
characters who have #enhanced their skills high enough with the previous
code will retain their higher-than-max skill ranking with the new code.
Characters who have exercised enough to advance to the old max but
haven't done so yet will be limited to the new max.
2003-10-23 07:12:03 +00:00
cohrs
f7a681a139 inappropriate lit_corridor check
To reproduce: disable lit_corridor, enter a corridor, read a scroll of
light, then read a cursed scroll of light.  The corridor won't darken again.
A test of flags.lit_corridor in newsym was at fault.  I'm guessing this was
never noticed because lit_corridor is on by default on Windows and the
default lit and unlit corridor symbols are the same on most other platforms.
2003-10-23 06:49:22 +00:00
cohrs
d82c7e671b support engraving in blood in special level files
the file format and sp_lev.c supported it, but the level parser didn't
2003-10-23 02:36:23 +00:00
cohrs
f4fbe1a13e buglist: cutting Shopkeeper the long worm
Cutting a shopkeeper poly'd as a long worm would generate strange messages
and could result in a crash.  cutworm didn't deal with all the intricacies
of duplicating a monster.   Fixed by changing cutworm() to use clone_mon()
to do most of its dirty work.  It seems to me that without this change,
cutting a tame long worm could also have similar bad effects.
Other side effects of this change:
- clone_mon now takes x,y coordinates, 0,0 results in previous behavior
- clone_mon no longer always makes cloned monsters tame/peaceful if player
  caused the clone, using the same formula previously in cutworm.  Someone
  else may wish to tweak this for gremlins.
- clone_mon will christen the new mon with the old shopkeeper's name, even
  though clones are never shopkeepers (game can't handle 2 for a shop)
- cutworm can now be called during conflict or pet combat, although I
  added no such calls (yet)
2003-10-23 02:30:46 +00:00
cohrs
32234b1da4 pets getting "stuck" trying to reach inaccessible objects
Incorporate a slightly modified version of a patch submitted by <Someone> back in June.  The basic problem, which I noticed again this past
weekend, is that pets with a high apport value can still try to get to
objects when there's no path to the object.  The patch extends the
can_reach_food function to be used for any object, renaming it to
can_reach_location, and adds a could_reach_item function for doing point
checks.  This also removes any chance of a pet dragon, for example, eating
something underwater.
2003-10-21 17:16:50 +00:00
cohrs
6c63831645 U704 - creating unappropriate hell random monsters
When changing levels, the state of rndmonst() is reset, causing the monster
choices to be recalculated.  However, the frequency counts for initial
uncommon() monsters were never cleared.  Thus, if the first non-extinct
monster were a hell monster, and you returned to the main dungeon, the hell
monster will remain in the list and could be selected.
2003-10-21 16:20:18 +00:00
nethack.allison
a6ed42dc07 win32tty hangs if you ^C at "Who are you?"
From Newsgroups: rec.games.roguelike.nethack :
> <email deleted>
> Subject: question for windows tty users
>
> I am trying to hunt down a bug, and want to know if I have
> encountered another one of those bizarre "features" that only
> occur on my computer (I seem to get a lot of them).
>
> I can reproduce this bug, or whatever it is, in the official
> Windows binary like this: Start the tty version of NetHack by
> double clicking on the program. You won't see the bug if you
> start it from the command line. When the game asks, "Who are
> you?" press ^C. NetHack will respond with "^C abort. Hit
> <Enter> to end," and then it hangs. Pressing Enter does
> nothing, and the program does not end.
>
> Can anybody else reproduce this behaviour? Thanks in advance.
>
> -- <Someone>
2003-10-21 15:19:08 +00:00
cohrs
15bd245d2b old bug report: unchanging iron golem still rehumanizes
Calling rehumanize directly when u.mh > 0 doesn't consider Unchanging
(perhaps it should?).  But, it's probably better to call losehp anyway.
Also, part of a buglist item: .5PD didn't affect rust trap damage on iron golem
2003-10-21 04:28:16 +00:00
cohrs
231b2b16f8 U453 and buglist item - travel command updates
I wrote to the devteam early last week:
> Given my understanding of travel, it's supposed to be somewhat intelligent,
> and "convenient", and should, therefore avoid walking into water, lava,
> traps, or other things that distant movement would avoid, even if you're
> right next it.  Unless...  the travel destination is the "bad" location
> next to you when the travel starts.
To that end...
- add a context (iflags in 3.4.3 to maintain savefile compat) flag to
differenciate the first travel step from later steps, to allow the
detection of the final sentence, above.
- several changes to set/reset the travel1 flag as needed
- add code to findtravelpath to treat the first step specially if it's
the only step, allowing forced travel into a "bad" location
- correct the "don't travel over traps" code, which was getting confused
because hero's starting location was being avoided
- add code to avoid traveling into water and lava, duplicating
checks used for non-travel running
- fix some strange "guess" travel behavior: avoid zigzag paths when there's
a more direct path (even though the number of moves is the same)
- trunk change adds a new DISP_ALL tmp_at type, and uses it in some debug
code for travel, debug changes not added to the 3.4.3 branch
2003-10-21 02:27:43 +00:00
cohrs
eab9e5f0a3 gnome does not like ^C
This hack simply causes ^C to be ignored completely by the gnome interface.
Gnome really cannot handle interrupts, and the window port interface does
not currently provide a way for the gnome interface to just quit.  Allowing
the gnome interface to prompt would require a complete overhall to the the
way window ports work.
2003-10-21 01:06:05 +00:00
nethack.allison
98678f6037 more buglist crystal ball detection
<Someone> wrote:
- If I set the 'boulder' option, shouldn't I be able to give the
  symbol I define for them at the crystal ball "object or
  monster symbol" prompt and have it work?
- Could ']' be added as a synonym for 'm', as with genocide?
- set boulder symbol to '3'; use '/' or ';' to examine a
  boulder. Result is "unknown creature causing you disquiet
  co-located with a boulder" even though there's no warning
  glyph '3' there.
2003-10-20 03:46:43 +00:00
nethack.allison
2b1313a93c crystal balls and space key
Another buglist entry.

<Someone> wrote:
- There appears to be no way to detect ghosts-and-shades; the
  space key just "Never mind"s. (Not that they'd be particularly
  visible on the resulting screen under ASCII, unless you've
  changed the 'monsters' option.)

Allow space; display results in inverse using detected_mon_to_glyph()
2003-10-19 19:49:43 +00:00
nethack.allison
db2620d481 crystal balls and '~'
<Someone> wrote:
- You currently appear to be able to specify '~' and have it try
  to detect monsters (though it won't detect any long worms)

Show the entire worm when specifying either '~' or 'w' now.
2003-10-19 19:07:33 +00:00
cohrs
b2ffe64968 breaking migrated objects
Allow migrated objects to break on arrival.  Added code to obj_delivery to
cause this, along with a flag to keep breakage from occurring.  The new
flag isn't used yet, because all the current object migration involve
objects that were moving/dropping.  To help make this change, rloco now
returns whether the object was placed or not, so caller can know if an obj
pointer is still valid or not.

Making the breakage messages for MIGR_NEAR_PLAYER objects show up after the
new level is displayed required some effort (rather than while the old level
was still displayed, which was confusing), due to the needs of goto_level.
- obj_delivery now has 2 passes, one for before player arrives, another after,
allowing the two cases to be treated differently
- goto_level calls obj_delivery twice (run_timers is not called twice,
since the run required before the level is displayed will have already run
any timers on migrating object)
- kill_genocided_monsters now kills eggs on the migrating_objs list too
2003-10-18 22:55:42 +00:00
nethack.allison
4cbdae2d3b > - When polymorphed into a flying creature and being grabbed
> over the water, then polymorphed into a non-flying creature
> leaves you standing on the water (you can kill the creature
> too and you're still on the water when you shouldn't be).
> - When floating from levitation over water and being held and
> removing levitation, you will fall into the water and drown or
> crawl back onto land. If you crawl back onto land you're no
> longer being held.
> The first situation seems to be a bug, the second a possible
> exploit. Both situations don't seem very correct, if you're
> being held it seems you should not fall into the water/lava
> until you are no longer being held. [patch contributed] It
> will keep the hero held up on over the water until released if
> his size is smaller than or equal to the size of the monster
> holding him. [<email deleted>, patch
> supplied]
>

A recent patch ensured that you ended up in the water when
polymorphed.

This patch is less ambitious than <Someone>'s
contribution, where he actually had the monster hold you up.
Perhaps that can be tackled for the trunk later.
2003-10-18 14:59:29 +00:00
nethack.allison
6820b0520b buglist: Vlad can turn to flee and be paralyzed at the same time
This is a cop-out in that it just suppresses the message.
2003-10-18 14:02:25 +00:00
cohrs
36faeeea3c debian bug #23229 - save file permissions
Use fqname buffer 1 for restoring the save file (just like save does when
creating it) so the value won't change out from under the code in unixmain.
- Also moved a tty-specific hack in docompress_file that was causing
the 'y' response to the "keep the save file" prompt to be echoed twice.
2003-10-16 16:18:26 +00:00
nethack.allison
716b2e81f4 from <Someone>'s list: destroy wand of digging
20000922    Water should flow into pits from broken WoD, or DoE.

This addresses the Wand of Digging part, but does not
do anything about Drum of Earthquake.
2003-10-16 02:36:26 +00:00
cohrs
f86341a390 eating amulet of unchanging redux
To keep this from growing beyond this targeted change, make eating an
amulet of unchanging "un"change you, unless you're also wearing one.
2003-10-15 20:07:14 +00:00
nethack.allison
46296dfb5c dipping non-weapon iron in fountain
<email deleted> wrote:
> Non-weapon iron items don't appear to rust if #dipped in a fountain.

Fixed. If something does get rusted, its a 50/50 chance whether other
fountain effects take place on the item afterwards.
2003-10-15 12:32:35 +00:00
nethack.allison
9f6e99c9c1 win32tty color fix
fix by <Someone>, updated by <Someone> on r.g.r.n.

changes the colours of the windows tty port so that blue and
bright blue, and cyan and bright cyan are distinguishable. The chief
benefit of this is that floating eyes no longer look like shocking
spheres.
2003-10-15 11:37:16 +00:00
cohrs
dadeed21d2 debian bug #154629 - extended commands in gnome front end
Not all of the extended commands worked in the gnome interface because
'#' just caused the next character to be treated as a meta character (this
was a hack I added a while back when none of the extended commands worked).
Resolved by finally adding an extended command menu to the gnome interface.
- updated some formatting so I could read the code
- fixed startup player selection menus so accelerators work
- added necessary calls to make sure selected menu item is visible
- also removed some dead code
2003-10-15 06:02:27 +00:00
cohrs
cc2105b7b4 debian #184911 - quitting while tty mode inventory is displayed
The tty menu code wasn't totally reentrant, causing it to free memory
that wasn't on the heap if you had your inventory displayed, ^C then
ask to see the inventory again.  Solved this by converting the buffer used
by process_menu_window to be heap-allocated.  If the Quit code could return at
this point, this would still be very bad, but since it doesn't, this is OK.
2003-10-14 07:35:01 +00:00
cohrs
0d533b7b39 debian #170531 - sign extension in gnome input
Internals of gnome_yn_function should treat key inputs as 'int' until
returning them, to avoid truncating and not sign extending as needed on
platforms where char is unsigned.
2003-10-14 07:07:40 +00:00