Commit Graph

549 Commits

Author SHA1 Message Date
nethack.rankin
4ebc37a371 quest artifact handling (trunk only)
When the hero receives the quest artifact "got it" message, set the
artifact's dknown bit in case the hero is blinded.  That message describes
the object by name, effectively the same as seeing it up close.  (This
would have prevented the "now wearing an Eyes of the Overworld" grammar bug
for monks but not for non-monks, so the previous fix is still necessary.)
2006-05-18 02:50:33 +00:00
nethack.rankin
9151db8aaf add pickup_thrown option (trunk only)
This patch by <email deleted> was released
when 3.4.1 was current and has been incorporated into slash'em.  It is
extremely useful while using ranged weapons.  When both autopickup and
pickup_thrown are enabled, walking across previously thrown objects will
pick them up even if they don't match the current pickup_types list.
[See cvs log for patchlevel.h for longer description.]
2006-05-13 04:57:52 +00:00
nethack.rankin
151bff298c add pickup_thrown option (trunk only)
This patch by <email deleted> was released
when 3.4.1 was current and has been incorporated into slash'em.  It is
extremely useful while using ranged weapons.  When both autopickup and
pickup_thrown are enabled, walking across previously thrown objects will
pick them up even if they don't match the current pickup_types list.
(Autopickup exceptions weren't around when the patch was first developed
and while those can be used for this purpose if you're willing to name
every object prior to throwing it, pickup_thrown is much more convenient.
Especially when you run out of weapons and resort to throwing pick-axes,
unicorn horns, and spare suits of banded mail at that floating eye who
rudely refuses to die.)  If you drop a previously thrown object (after
getting it back into your inventory again, of course), its was_thrown bit
will be clear and subsequent walking over it behaves in the regular
autopickup manner.  There's no special stacking handling; if a thrown
object lands on a compatable object and they stack, the combined stack is
subject to pickup_thrown handling.

     The original patch updated makedefs to add an entry for pickup_thrown
patch to the options list displayed by #version; I've left that out.  It
also cleared the was_thrown bit in the pickup code, resulting in being
sticky for boomerangs and Mjollnir (where throwing, catching, and then
dropping those would result in behaving as if they had most recently been
thrown rather than dropped).  I've moved that to the add-to-inventory code
instead to fix this.  The original patch also put the pickup_thrown bit
into iflags instead of flags in order to avoid invalidating save files;
I've moved it to flags where it belongs and added a patchlevel.h update.
I've also reworded the Guidebook entries slightly.  [The original patch
can be obtained from <Someone>'s "NetHack Patch Database" at
http://bilious.homelinux.org/ under the "browse" heading.  I didn't hang
on the exact URL; sorry.]

     I think objects stolen from the hero should have their was_thrown bit
set (or else add a new was_stolen bit, which seems like overkill) so that
recovering stolen objects will become simpler after the thief has been
tracked down and dealt with, but I haven't done that here.
2006-05-13 04:56:16 +00:00
nethack.rankin
5333a7a30d candelabrum in shop (trunk only)
The code to have Izchak recognize the Candelabrum of Invocation
instead of just being uninterested in an item not stocked in his shop was
being skipped when the character is hallucinating.  Make it work for any
lighting store (slash'em sometimes has another candle shop, run by a
randomly named shopkeeper), and make it recogize Izchak even when
hallucinating.  Also, have him give a message about the need for 7 candles
if the candelabrum doesn't already have them attached.
2006-05-12 00:30:32 +00:00
nethack.rankin
a73d997034 water vs acid
Fix the bug From a bug report.alt.org server, where killing a monster by closing the
castle drawbridge resulted in a panic after the dead monster's possessions
were dropped into the moat and a potion of acid exploded in the process.
water_damage() deleted the object but had no way to tell flooreffects()
that it was gone, so flooreffects() couldn't tell its own caller not to
place and stack the object.  After that, a chunk of freed memory became
part of the floor objects chain and eventually triggered a panic which
tried to make a save file but whose reason didn't get logged properly.
2006-05-11 03:26:55 +00:00
nethack.allison
52586db3ae set_corpsenm()
Provide a common routine that always does the right
thing with respect to timers and weight when altering
obj->corpsenm, and use it throughout the code.
2006-05-09 23:10:22 +00:00
nethack.allison
376f9ba047 debug mode #wizrumorcheck
Provide a command to easily verify that the rumor true/false
boundary offsets are correct for the rumors file.
If the boundary is pointing mid-line, the rumor at the boundary
won't decrypt properly.
2006-05-01 01:49:18 +00:00
nethack.allison
660d3589c5 experimental - dungeon overview (trunk only)
Add Hojita Discordia's Dungeon Map overview as
conditional code for experimentation and testing.
Everything is guarded by
#ifdef DUNGEON_OVERVIEW
#endif

The notes that accompanied the original patch follow.

Dungeon Map Overview Patch for Nethack 3.4.3
Version 3
=============================================================================
Changelist:
    v3: Changed #level to #annotate to avoid #levelchange collision.  Fixed
        handling of elemental planes and astral plane (oops).  Changed
	formatting to be slightly closer to print_dungeon()'s.  Should be
	"final" version for 3.4.3.
    v2: Added tracking of trees.  Changed ctrl-m command to ctrl-o.  Portals
        displayed as "sealed" instead of "closed".
    v1: First release.
    (Note: all versions are mutually save compatible.)
=============================================================================
This patch creates a dungeon map overview that is recorded as the player
explores the dungeon.  I was tired of returning to a game a few days later
and having no idea what the dungeon looked like.  Trying to name pieces
of armor with shorthand didn't work so well as an intermediate solution
either, especially around nymphs.

It can be assumed that this map is in the mind of the hero and thus
can't be stolen, can be read when blind, or when buried, or when the hero
doesn't have any hands, or eyes, or hands free, or...etc. On the other hand,
this implies that the hero doesn't remember all of the details ("a fountain",
"some fountains", "many fountains") and that the map is subject to amnesia
when applicable.

This overview tracks fountains, altars, stores, temples, sinks, thrones,
trees, and dungeon branches.  It attempts to not spoil the player nor
reveal more information than the hero knows.  For this reason, it only
tracks dungeon features found in the guidebook and dungeon branches.

This patch breaks save file compatibility.  Sorry.

Added commands
=============================================================================
#overview (ctrl-o, if not in wizard mode) - displays overview
#annotate (ctrl-n, if using numpad) - names current level

Example Output From #overview
=============================================================================
The Dungeons of Doom: levels 1 to level 15
   Level 1:
      A fountain
   Level 3: (My stash.)
      An altar, some fountains
      Stairs down to The Gnomish Mines
   Level 7:
      Many fountains
   Level 8:
      Stairs up to Sokoban, level 7
   Level 15:
      A general store
      Sealed portal to The Quest
The Gnomish Mines: levels 4 to level 7
   Level 7: <- You are here
      Many stores, some fountains, a temple

More Details
=============================================================================
The overview shows only levels that have anything interesting to display and
doesn't show branches that don't have any interesting levels.

To avoid the map revealing more information than the hero knows, the overview
only displays things that the hero has seen or touched.  (If the hero
blinds herself, levitates above a known fountain, and obliterates it with a
wand of digging, the overview will still say that there is a fountain.)

This is done, sadly, by adding 6 bits to the rm struct to track the last
known dungeon type.  On the other hand, this change could potentially allow
a window port to do something like drawing an item and a fountain on the same
square.

Things That Could Be Better And Maybe Some Feedback Would Help
=============================================================================
"<- You Are Here" is pretty goofy
    -...but an indicator of some sort is nice.
=============================================================================
Many thanks to all the kind folks on r.g.r.n. who had very good feedback
about this patch, in particular L (for the trees), <Someone> Papaganou (for the
#annotate suggestion and some formatting feedback), and <Someone> (for the suggestion
of just overriding ctrl-o instead of using the very broken ctrl-m.)
=============================================================================
20060311. Hojita Discordia. (My usenet email is bogus. Sorry.)
2006-04-20 00:57:45 +00:00
nethack.allison
08d4a0c0fa comment bit (trunk only) 2006-04-20 00:50:37 +00:00
nethack.allison
78ef9ef991 safe_oname (trunk only)
There were routines that were passed the
object name as an argument.  Before the oextra
patch, ONAME() always returned a valid pointer
to a location within the obj struct. The oextra
patch worked around those cases by
using a temporary variable that was either set
to ONAME (if the obj passed the has_oname() test),
or to ""  (pointer to an empty string) if no name was
present.

Since that might be a common thing to do, provide
the safe_oname() routine that you can use as a
function parameter without having to worry about
about whether ONAME(obj) is valid, and without
the need for the temporary variable.
2006-04-15 15:40:27 +00:00
nethack.allison
c16a87d367 increment editlevel
That last merge update should have included this.
2006-04-15 13:40:11 +00:00
nethack.allison
d156b95e0d oextra follow-up - merging (trunk only)
It seemed inappropriate to allocate and tack on an oextra
structure just to mark it as unmergable, and the oextra
struct itself wouldn't be released until a save/restore took
place.

This uses one of the freed up oattached bits to prevent the merge.
2006-04-15 13:37:58 +00:00
nethack.allison
e7948e258c oextra obj.h follow-up (trunk only)
Just add some notes to obj.h around oextra.
2006-04-15 13:09:57 +00:00
nethack.rankin
5501922aa8 omailcmd (trunk only)
The revised newmail() wouldn't compile (Strncpy doesn't exist, `buf'
was an array of pointers rather than of char).  Simplify it substantially,
and adjust the one caller (vms) that relied on the old convoluted bit.
2006-04-15 02:14:36 +00:00
nethack.allison
f55210be79 code change - oextra
move oattached and oname and other things that vary
the size of the obj structure into a separate
non-adjacent oextra structure, similar to what has
already been done for mextra. The obj structure
itself becomes a fixed size.

New macros:

#define ONAME(o)	((o)->oextra->oname)
#define OMID(o)		((o)->oextra->omid)
#define OMONST(o)	((o)->oextra->omonst)
#define OLONG(o)	((o)->oextra->olong)
#define OMAILCMD(o)	((o)->oextra->omailcmd)

#define has_oname(o)	((o)->oextra && ONAME(o))
#define has_omid(o)	((o)->oextra && OMID(o))
#define has_omonst(o)	((o)->oextra && OMONST(o))
#define has_olong(o)	((o)->oextra && OLONG(o))
#define has_omailcmd(o)	((o)->oextra && OMAILCMD(o))

changed macros:
has_name(mon) becomes has_mname(mon)  to correspond.

The CVS repository was tagged with
	NETHACK_PRE_OEXTRA
before commiting these, and
tagged with
	NETHACK_POST_OEXTRA
immediately after. The diff
between those two tags is this oextra patch.

The associated mail daemon changes to use an oextra
structure instead of a hidden command located in the
name after the terminating NUL, have not been tried
or tested.
2006-04-14 16:23:56 +00:00
nethack.rankin
51d60d9721 digging land mines & bear traps (trunk only)
<Someone> suggested that digging down on a land mine with a pick-axe ought
to set if off.  I agree; this implements that and also for bear traps.  In
the bear trap case, if you dig down once trapped, you will destroy that
trap explicitly rather than replace it with a pit, so it's now possible to
escape from one without leaving another trap in your wake.  Once the bear
trap is gone, further digging there will make a pit as usual.  While stuck
in one, digging down poses a modest risk of harming yourself.

|You now wield a pick-axe.
|You start digging downward.  A bear trap closes on your foot!
|You start digging downward.  You destroy the bear trap with your pick-axe.
|You continue digging downward.  You dig a pit in the floor.
|You start digging downward.  You dig a hole through the floor.
|You fall through...

[It seems a bit strange that finishing a pit discards all digging context,
so that resuming within the pit in order to make a hole "starts" digging
rather than "continues" it.]

     Digging down with a wand or spell will disarm these two types of traps
and then leave the corresponding object (which may or may not fall through
the resulting hole, like any other object there).  Digging to the side via
magic while trapped in a pit will also disarm such traps when it encounters
them.  (When not in a pit, a digging beam which simply passes over an armed
bear trap or land mine won't have any effect on the trap.)  Digging to the
side via tool behaves somewhat oddly ("no room for the rubble"?) and will
probably need some tweaking before eventual release; at present it doesn't
reach adjacent traps so didn't need any land mine or bear trap handling.

     I put the fixes entry in the new features section.
2006-04-08 06:55:15 +00:00
nethack.rankin
27dcb8e34a silver vs poly'd hero (trunk only)
<Someone> reported that thitu() was adding d20 damage for silver object
hitting silver-hating hero even though all the callers were using dmgval()
which also does that, resulting in doubled silver bonus/penalty.  This
fixes that (including for boomerangs thrown by player, which weren't using
dmgval(), to handle a hyptothetical silver boomerang).  While testing it,
I noticed that there was no "the silver sears your flesh" message when a
monster hit you with a wielded silver weapon, so this fixes that too.
(How did we miss that?  And how did <Someone>? :-)
2006-04-06 05:57:50 +00:00
nethack.rankin
2c0a072ef1 main() reorganization (trunk only)
Move some internals-related code out of port-specific main so that
it isn't duplicated a bunch of times.  One minor side-effect of this
change is that if you auto-pickup something at the very start of a game,
it will happen after any full moon/new moon/Friday 13th message rather
than before.  There's a second change for some:  the shared main() used
by several of the micro ports had a small difference in game play--if you
saved a game while on an engraving, it would automatically be read when
you resume--that will now occur for everybody [Elbereth weenies rejoice!].
pcmain() was also calling update_inventory() at start of play.  That's
unnecessary for new games, where inventory initialization triggers a call
to it for each item added to your pack; but I wasn't sure about restored
games, so everybody gets it there now.

     The Mac and BeOS ports evidently haven't been touched it some time;
they still referenced flags.move which got replaced by context.move quite
a while back.  The Windows GUI code has a declaration for mswin_moveloop()
which appears to be non-existant, but I left it alone.  I assume that the
Qt interface uses the existing main() routines; at least I couldn't find
any start of game code specific to it.  vmsmain's revised main() is the
only one which has been tested.
2006-04-02 07:35:30 +00:00
nethack.rankin
f94b832fc9 shattering monster's weapon stack
Something I encountered while playing slash'em a while back, but
relevant to nethack:  "Its orcish spears shatter from the force of your
blow!".  I was using a two-handed weapon (at skilled or expert level) to
fight an invisible monster which was wielding a stack of multiple spears
(slash'em gives them out in groups of 3 for monsters' starting inventory).
After killing it, I found 2 orcish spears along with an invisible corpse
of somebody-or-other the Kobold King.  The message suggested that the
whole spear stack had been destroyed (and the weapon shattering code in
hmon_hitmon() clearly expects that to be the case), but only one of them
had actually gotten used up.

     I can't recall whether "shatter" was actually given as singular or
plural at the time; nethack handles that aspect correctly.  Only object
destruction needed tweaking.
2006-03-30 05:52:28 +00:00
nethack.allison
ecb98e019c eating gold in front of the vault guard (trunk only)
<email deleted> wrote:
> Eating gold in a vault (or polymorphing a pile of gold into 1 gold piece)
> doesn't anger the guard.

This addresses the eating part of that report, but the hero
has to get caught doing it.
2006-03-26 05:23:46 +00:00
nethack.allison
e063031f00 digging conjoined pits follow-up (trunk only)
Pat Rankin wrote:
>      Isn't an array of booleans overkill?  A single byte bitmap
> could achieve the same result.
2006-03-25 18:59:53 +00:00
nethack.allison
6ef8efcefb digging conjoined pits (trunk only)
This one turned out to be more effort than I had
originally anticipated.

We had a bug report requesting that zapping a wand of digging
laterally while in a pit should dig beside you. That seemed
like a reasonable enough request, but this ended up with
the following results:
- needed to check where this should not be permitted, or at
  least where there should be special-case code because there is
  something such as furniture on the surface above the dig
  point.
- now tracks conjoined pits through new fields in the trap
  structure, hence the pathlevel increment. The array of
  8 boolean values represents each of the 8 directions
  around a pit.
- Previously, pits could be adjacent to each other as two
  individual pits, in which case moving between them
  results in a fall as you went into the next pit. That
  behavior is preserved.
- Pits created either by zapping a wand of digging
  laterally while in a pit, or by "clearing debris"
  between two adjacent pits via a pick-axe, sets the
  conjoined fields for those two pits. You cannot
  create a brand new adjacent pit via pick-axe, only
  with the wand.
- The hero can pass between conjoined pits without
  falling.
- dighole() was hijacked for adjacent pit digging,
  so the ability to pass coordinates to it and
  its downstream functions was added (dig_up_grave()
  for example). dighole() does pretty much everything
  appropriately for this adjacent digging, more so
  than calling digactualhole() directly.
- moving into a conjoined pit that has spikes still
  does damage, but less so that "falling" into the
  spiked pit, and you "step on" the spikes rather
  than falling into them.
- Not done: should pits with the conjoined fields
  set be referred to as 'trenches' rather than pits
  in messages and identifications?
2006-03-19 23:59:03 +00:00
nethack.allison
0b88609133 chameleon behaviour
- restore intended behaviour of kill_genocided_monsters().
  It has been incorrect since  the chameleon overhaul in June 2004.
- eliminate CHAM_ORDINARY and use NON_PM instead.
2006-03-12 04:43:28 +00:00
nethack.rankin
e1ef0f1042 filling antholes
From a bug report:  when creating a
level, anthole rooms can be generated even when no ants are left, unlike
beehives which get suppressed once killer bees are gone.  Also, if some
ants are available but the type chosen for the current level isn't (in his
case, soldier ants had been genocided), the anthole was filled will random
monsters instead of picking another type of ant.  This fixes both issues.
Random monsters will only occur if the last type of ant gets used up while
filling an anthole that was started when some ants were available, same as
how monster generation for beehives and barracks works.
2006-03-09 05:39:38 +00:00
nethack.allison
71ed473cf6 broken wand of striking vs door (trunk only)
<email deleted> wrote:
> * Doors absorb the blast of a broken wand of striking. What's more, the message
> reads "The door absorbs your bolt!" rather than "blast".

passes wand type to explode() as a negative value for the case
where the wand type isn't mapped to an AD_* explosion type.

Then explode() converts it to a positive and passes it to zap_over_floor().
2006-03-07 03:10:58 +00:00
nethack.rankin
63103b6705 luck confusion
Remove a couple of false comments about Luck, and an unreachable
switch case based upon them.  I don't know if the comment in you.h was ever
true, but it was false by the time Kevin brought across assorted changes
from slash'em however many years ago.  Full moon does not change the range
of possible Luck values, and ``rn2((Luck + 6) >> 1)'' produces a value
between 0 and 8 for prayer result, never 9.  Natural luck is always within
the range of -10 to +10, and extra luck from carrying blessed or cursed
luckstone can add or subtract another 3.  Full moon and Friday the 13th
change the equilibrium point for luck timeout but do not change the overall
range of possible values, which remains at -13 to +13.
2006-03-02 05:54:04 +00:00
nethack.allison
f65d0710b6 confused scroll of light
Implement the following suggestion by <email deleted>
- Reading a scroll of light while confused should
create a hostile yellow light (black light if cursed).

It only creates the light monster effect 1 out of 5 times.
2006-02-19 23:28:38 +00:00
nethack.allison
645d1b9921 finish a trailing sentence in a comment 2006-02-19 22:44:06 +00:00
nethack.rankin
ff553c6995 latent level arrival message bug (trunk only)
Something I noticed during a level change in slash'em:
        You hear the sounds of civilization.  You fly down the stairs.
The first message ought to follow the second.  Our only arrival messages
that are handled via the special level loader occur in the endgame where
travel is by magic portal, and the transit message given for portals is
for entering one rather than exiting at the far side, so this sequencing
problem can't currently be noticed in nethack.  But sooner or later there
will be levels reachable by stairs and having entry messages, or there'll
be some feedback added when magic portal transport finishes, and then we'd
get bitten by this.

     Tested by adding an arrival message to each of the bigroom variants.
2006-02-16 07:35:00 +00:00
nethack.rankin
73e9225d88 scroll usage; also spell of ID (trunk only)
Make a not-very-robust fix for the report from <email deleted> about
being told a scoll disappears as you read it, then for the case of cursed
remove curse being told that the scroll disintegrates.  He missed similar
case for scroll of fire erupting into flames after it had disappeared.
This suppresses the "disappears" part of the scroll reading message for
those two cases, but won't be very reliable if other scroll messages
referring to the scroll itself get introduced in the future.  [Several
paths through scroll of fire won't report that it burns, and now it doesn't
give the disappears message any more.  I don't think that's worth worrying
about; the scroll leaving inventory after burning up is implicit.]

     Also cut down on redundant feedback for several scrolls (genocide,
charging, identify, stinking cloud) that start off by informing the player
what they are.  That's only needed when the the player doesn't already
know the type of scroll.  I've always felt it silly to be told that I've
"found a scroll of genocide" when I'm intentionally reading a known scroll
of genocide.  All these types of scroll give a subsequent prompt which
makes them recongizable if you somehow manage to choose the wrong object
when picking the one to read.

    Lastly, make spell of identify behave like ordinary uncursed scroll of
identify by default instead of ususally ID'ing multiple items.  Now you'll
need to be skilled or better in divination spells skill in order to get the
blessed scroll effect out of it.  And give some feedback if the spell is
cast when not carrying any inventory; it was just silently moving on to the
user's next command in that case.
2006-02-16 06:44:24 +00:00
nethack.rankin
458c90fd7e couple of spell bits (trunk only)
Move NO_SPELL and MAX_SPELL_STUDY from hack.h to spell.h.  I didn't
even remember that the latter existed when I put MAX_SPELL_STUDY in the
former recently.

     Add a couple of new "spell is almost gone" messages that occur when
casting spells.  One matches up with yesterday's change for when you can
re-read a spellbook to reinforce memory of a known spell.

     When "too hungry", you can't cast any spells, except detect food so
that you can find something to eat.  When "too weak" you couldn't cast any
spells at all; now you can cast restore ability so that you can recover
lost strength.  [We still need to come up with a better crowning bonus for
monks than spellbook of restore ability.]  I couldn't think of a reasonable
exception for the "can't cast when carrying too much" restriction.  If we
can come up with one (levitation?), then remove curse could/should become
an exception for the "no free hands" restriction.
2006-02-12 06:24:25 +00:00
nethack.rankin
5d732c47a3 partial fix for #H38 - hallucination of personal names (trunk only)
This fixes the monnam() family of functions so that hallucinated
personal names, such as Barney, won't be prefixed by "the".  It uses the
same hack as is used for shopkeeper names:  single character prefix on
names which warrant some handling other than the default.  rndmonnam()
strips that off, so unmodified callers (which is almost all of them...)
retain the same behavior has before.

     There are several capitalized names that I have no idea whether need
to be treated as personal names:
  Evil Iggy - name, or type of monster named after someone?
  Totoro    - no clue
  Invid     - ditto
  Vorlon    - just guessing that it's a species rather than an individual.
I couldn't remember whether Godzilla was baby Godzilla's mother or father,
so I went with female there.  So far, no callers of rndmonnam() care about
gender so it doesn't make any difference.  Because of that, I didn't look
though the non-capitalized names to see whether any should be all male or
all female and need one of the other prefix codes.

     I've added "were-rabbit" from the Wallace & Gromit movie.  The recent
ads for its DVD release reminded me that I was going to add that back when
the movie first came out.  I haven't seen it but the creature name fits.

     I also fixed Smokey Bear.  Smokey the Bear is a common misspelling;
I thought we had fixed that ages ago, back when people still had some clue
as to who in the world he was.
2006-02-09 06:12:00 +00:00
arromdee
83807a84f5 patch: #defines
This is a fairly trivial code change but should have been done long ago...
2006-02-09 03:26:59 +00:00
nethack.rankin
98685ea234 `spestudied' manipulation for polymorphed spellbooks (trunk only)
From a bug report... some
special case handling for polymorph of spellbooks never worked as intended.
It's possible to polymorph a spellbook, use it to learn a new spell, and
then repeat as many times as you like unless/until you run out of polymorph
magic or the small chance of "object shuddering" causes it to be destroyed.
Polymorph was incrementing the book's ``number of times read'' field with
the intent that it would fade to blank after being read 3 times (which
turns out to the 4 times since the check is actually for re-reading 3 times
after the first).  That didn't work because the spestudied field was ignored
when learning a new spell, only checked when relearning a known spell.

     Now it will be checked when learning a new spell, and also the book
tweaking during polymorph is slightly more elaborate.  If you happen to
get a blank book during the item selection, it will have a read counter
of 0 and can be re-polymorphed into something readable.  But if you get
some other book, its read counter will be set to one greater than than the
original book's (same as before).  And then the counter will be checked
to see if it has gone over the limit, in which case the book will be made
blank and its counter will be reset to a random value.  Re-polymorphing
that blank book again has 1/4 chance apiece among the following cases
  book gets blanked again; goto step 1...
  book is non-blank but too faint to read; reading attempt will fail
  book can be read normally and then re-read once
  book can be read normally and then re-read twice
which is more inline with the intent of the original special case code.
It's actually slightly nastier since you'll occasionally get a book for a
spell you don't know yet but then not be able to learn it from that book.
2006-02-04 06:11:44 +00:00
nethack.rankin
0a52d1879f reduce temple verbosity (trunk only)
Cut down on the excessive verbosity generated when entering a temple.
The first time you enter a particular temple (or more accurately, the
temple attended by a particular priest), you still get the three message
sequence
  The <priest of foo> intones:
  Pilgrim, you enter a sacred place!
  You have a strange forbidding feeling...
or
  You experience a strange sense of peace.
except that the last one doesn't say "strange" any more.  On subsequent
visits to the same temple, you usually won't get the first introductory
message any more, often won't get the second entry one, and sometimes
won't even get the final one, depending upon how much time has elapsed
since the previous entry.  The old verbosity could really be infuriating
when attempting to lug corpses to the altar before they spoil.  Even
though the messages don't affect the passage of time, it always felt as
if they were slowing you down.  And even when you weren't in any hurry,
it required at least one and often 2 or even 3 responses to --More--
depending upon the length of the deity's name and whether some other
message was also delivered on the same turn (fairly common in minetown).

     Saving and restoring, or leaving the level and returning, resets
the priest's memory of when the messages were last given, so the next
entry after that behaves similar to the very first.  This was initially
intended for cleanup prior to saving bones data, but it seemed reasonable
to have it apply to the current game too.  Unattended temples now also
have a 25% chance of not giving any message when entering.  That one is
random rather than based on the passage of time since last entry; there's
no priest available to track the latter data.
2006-01-28 06:46:19 +00:00
nethack.allison
70b04bfb6e wiz_identify change (trunk only)
This patch alters wiz_identify so that it displays an
inventory menu with all items shown identified
without actually identifying them.

You can just press ^I (or whatever the wiz_identify command
is) a second time, while the menu is displayed to actually identify
them (tested with TTY menus only).
2006-01-14 17:02:22 +00:00
nethack.rankin
3b127d31d9 mextra.h comments (trunk only)
Add an introductory comment for each type of extension.  Also move
ANGRY/NOTANGRY shopkeeper macros from old eshk.h out of the common header
and into shk.c so that their use doesn't end up spreading into other code.

     Not fixed:  entry #9 in the block comment at the top is truncated
mid-sentence.
2006-01-12 06:06:33 +00:00
nethack.allison
de2a6034dd tin details (trunk only)
Reveal more tin details at end of game disclosure.

	b - an uncursed carrot
	c - an uncursed tin of broiled kobold meat
	d - an uncursed tin of stir fried fox meat
	e - 4 uncursed tripe rations
	f - 4 uncursed food rations
	g - an uncursed cream pie
	n - 4 uncursed tins of spinach
	o - 3 uncursed tins of pureed newt meat
	p - an uncursed homemade tin of fox meat

Note that in the case of homemade and rotten
it sounded better to have the term before the
word tin, rather than after:
	homemade tins of newt meat
rather than:
	tins of homemade newt meat

The wishing code should probably be
changed to reflect this so people can wish for
a "homemade tin of newt". As it stands, they must
wish for a "tin of homemade newt" which differs
from the final display. That is not included.
2006-01-12 03:23:05 +00:00
nethack.allison
ce434a8cb7 formatting bit 2006-01-08 16:21:10 +00:00
nethack.rankin
039e051323 mextra tweaks (trunk only)
Add new_mname/free_mname functions to make monster name handling be
more like the other extended data and to hide mextra details a bit more.
Add some casts where int and unsigned are being intermixed.  Simplify
christen_monst(); it ought to be changed to have type `void' but I wanted
to avoid modifying another ten or so files.
2006-01-08 06:19:42 +00:00
nethack.allison
0bdb1fba28 mextra docs 2006-01-07 17:36:24 +00:00
nethack.allison
5548bd6c5a new year 2006-01-07 13:47:41 +00:00
nethack.allison
580b5e62f1 remove obsolete files 2006-01-06 22:28:29 +00:00
nethack.allison
aea3c50163 mextra follow up bit 2
<Someone> noticed the leftover zeromextra, this removes it.

Using memset() on a possibly failed mextra allocation was inapprorpriate,
so replace the newmextra() macro with a function.

Prevent a crash in christen_monst() if mextra was not initialized.
2006-01-06 22:16:46 +00:00
nethack.allison
54ec47807a mextra.h 2006-01-06 20:52:04 +00:00
nethack.allison
0dc071bee8 mextra changes
Note: The CVS repository was tagged with NETHACK_PRE_MEXTRA
prior to application of this patch to allow easy withdrawal if necessary.

Adds a new mextra structure type that has a set
of pointers to various types of monster structures
including:
   mname, egd, epri, eshk, emin, edog

Replaces the mextra bits in the monst structure
with a single pointer called mtmp->mextra of type
(struct mextra *).
The pointer can be null if there are no additional
structures attached. The mextra structure is not
adjacent to the monst structure.

Reduces the in-memory footprint of the monst that
has no other structures attached, at the cost
of adding 6 extra long ints per monster to
the save file

The new mextra structure has the mextra fields
independent of each other, not overlapping as was
the case with previous NetHack versions.
This patch doesn't do anything to capitalize on
that difference however.

Consolidates vault.h, epri.h, eshk.h, emin.h and edog.h
into mextra.h

Adds a macro for checking for whether a monster has
a name:
	has_name(monst)

This fixes the magic trap panic
   expels() -> spoteffects() -> dotrap() ->
	domagictrap() -> tamedog()
because the monst no longer varies in size so no
replacement is required.
2006-01-06 05:46:03 +00:00
nethack.rankin
40dd607233 corpse_xname overhaul (trunk only)
Extend the capabilities of corpse_xname() so that various callers can
be simplified.  It can how handle an article prefix, effectively turning it
into corpse_doname() (not quite; still need doname() to see a count when
quantity is more than one, or to see bless/curse state).  It can also handle
inclusion of adjectives like "partly eaten" or "bite-covered".  For unique
monsters those come out in the form
  the Chromatic Dragon's partly eaten corpse
instead of the old
  partly eaten Chromatic Dragon corpse
[so wishing probably needs to be taught about potentially finding a monster
name before assorted adjectives such as blessed; also, name_to_mon() needs
to learn how to cope with the possessive suffix].

     A sizeable chunk of this patch deals with consolidating some of the
redundant "petrified by a cockatrice corpse" handling.  It may be possible
to consolidate all remaining instances together since they're quite similar,
but I didn't think about that until just now and I want to get this patch
over with.
2005-12-30 06:08:20 +00:00
nethack.rankin
b4cc1427d9 diagonal blockage exceptions
From a bug report, amorphous creatures can fit underneath
closed doors but could still be considered too big to fit through diagonal
gaps.  Let them and several other shapeless or flexibly shaped critters
squeeze through provided that they pass the not-carrying-too-much check.
2005-12-23 04:35:24 +00:00
nethack.rankin
aa98091bfa in_lava_effects (trunk only)
The in_lava_effects flag should never be saved and restored; putting
it into the context struct was a mistake.  Move it to the iflags struct
(where the branch code already has it).  I haven't bumped the EDITLEVEL
setting.  Save and bones files from more that a few days ago were breifly
invalid but should be viable again.  Save and bones files from the past
couple of days are now no good; sorry about that.
2005-12-11 03:09:05 +00:00
nethack.rankin
83b73be40c killer_xname changes (trunk only)
Have killer_xname() handle corpses properly and also avoid having it
use user-supplied fruit names as per <Someone>'s suggestion.  Also make
a start at eliminating the umpteen inconsitent checks for whether a monster
type (like "Oracle") ought to be prefixed by "the ".

     I used a stub which looped over all object types, all artifacts, and
corpses of all monster types to print the output of killer_xname() for each
one; its prefix choice among {[no article], a, an, the} looked right.
2005-12-10 05:39:24 +00:00