Commit Graph

2858 Commits

Author SHA1 Message Date
Pasi Kallinen
4e067f5f2b Show level annotation on level entry
Idea by Chris Smith, via Unnethack
2015-04-26 10:46:42 +03:00
nhmall
8624709c0d comment termination bit 2015-04-25 15:49:14 -04:00
nhmall
07c5467434 checkfile protection from caller
Changes to be committed:
	modified:   src/pager.c
2015-04-25 10:51:07 -04:00
Pasi Kallinen
5828d17eef Show only the short automatic glyph description
When you turn on the automatic description of a glyph under cursor,
we want to show the short description of what glyph it actually is.
The long full description of all possibilities is far too long, so
may cause more-prompts, and is awkward for blind players.
2015-04-25 15:19:19 +03:00
Pasi Kallinen
5479a0b44c Also allow q at the Itemized billing -prompt
Original change via AceHack by Alex Smith
2015-04-25 12:56:55 +03:00
PatR
27d8b631cd isspace() usage
Replace most uses of isspace() with a simple test for ' ' after
processing the string buffer with mungspaces (which replaces tab
with space, converts instances of consecutive whitespace into a
single space, and removes leading and trailing spaces).  The uses
where this wasn't done now cast their argument to (uchar) so that
platforms with signed chars will never pass negative values to it.

I didn't mess with the menu coloring code (except for casts to the
isspace() argument); it almost certainly could benefit from using
mungspaces.  I did mess with the symset processing quite a bit,
and hope I haven't accidentally broken anything.  Default symbols
and DECgraphics symbols still parse and display ok, so the rest of
dat/symbols should be ok too.  I didn't test symbols in the user's
config file because I don't remember how that's supposed to work.
2015-04-25 02:11:13 -07:00
Pasi Kallinen
672ef5223a Fix adding doors to levels 2015-04-25 12:00:44 +03:00
Pasi Kallinen
8e6dde226f Fix out-of-map condition in buzz 2015-04-25 06:24:43 +03:00
PatR
1eff16afcb do_look fix fix
Avoid initializer for auto-class array since many pre-ANSI compilers
didn't support that.  Also, when ESC is used to cancel inventory
selection, don't continue on searching for that selection in invent.
2015-04-24 16:07:00 -07:00
nhmall
65e699b646 fix an observed stack corruption
Changes to be committed:
	modified:   src/pager.c
2015-04-24 11:23:07 -04:00
Pasi Kallinen
1369b17e3b Stop travel or run when you get hungry 2015-04-24 16:24:50 +03:00
PatR
ce58721890 more data.base lookup tidbits
Still doesn't address the reported stack corruption.

* 'alt' points to a buffer which has already been processed by
  lcase(), so remove the redundant call to that routine;
* common error exit accessed via 'goto' could potentially leave
  a dangling window structure (only if 'data' is corrupted though;
  it's the only way a failure at that late point could occur).
2015-04-24 02:18:07 -07:00
PatR
d65fba4ebe do_look bits
I didn't find Michael's crasher, but I did find a couple of minor
problems:

knight's saddled pony wasn't found in the file lookup either though
there is an entry for pony ("tame saddled <foo>" stripped off "tame "
but not "saddled "; "saddled <foo>" would only be found of there was
a wildcard entry key of "*<foo>", like "*horse" to catch both horse
and warhorse);

"wombat" matched the bat entry rather than reporting an unknown
entity.
2015-04-23 19:25:01 -07:00
Pasi Kallinen
aea472c0c0 Give honorifics to vampires and elves 2015-04-23 21:46:10 +03:00
Pasi Kallinen
ea6157c475 Give gnomes occasionally a candle
...and if in unlit area, light the candle.
2015-04-23 21:19:25 +03:00
Pasi Kallinen
23ad7a8635 Hallucinated currencies
Originally via UnNetHack by Patric Mueller
2015-04-23 20:30:59 +03:00
Pasi Kallinen
fbf787c4fe Indicate how far you fall down a hole or trapdoor
No extra message when falling down to the next level,
otherwise give "You fall down a [very] [deep] shaft!".
2015-04-23 19:27:12 +03:00
PatR
ae6eeec22a statue glyph save/restore
Remove the code that converted statues shown as monsters into stautes
shown as big rocks when saving and then reversed the effect when
restoring.  It was done to preserve save file compatability with 3.4.3
where statue-as-monster glyphs didn't exist, so is no longer useful.
2015-04-22 19:47:55 -07:00
PatR
51a70d0277 sp_lev.c cleanup
* remove several unreachable panic() calls; alloc() already panics
  rather than return a null pointer;
* replace a couple of calls to malloc() with alloc() so that
  MONITOR_HEAP won't produce spurious alloc/free discrepancies;
* replace several instances of variable 'd' with 'd0' so that it
  doesn't conflict with the name of a function;
* comment out opvar_new_region() since it isn't used anywhere.
2015-04-22 19:18:57 -07:00
PatR
16d8074352 lint 2015-04-22 19:17:49 -07:00
Pasi Kallinen
5a42ce4040 Unify boulder dropping on player
... and if you're swallowed, make the dropped boulder hit the monster.
(Changes from UnNetHack)
2015-04-22 20:22:55 +03:00
Pasi Kallinen
65dcf2e2cc Fold another instance of "You are rooted" into u_rooted 2015-04-22 11:54:27 +03:00
Pasi Kallinen
bd69677933 Unify stumbling on door mimic 2015-04-22 09:23:54 +03:00
Pasi Kallinen
75e7d837e6 Unify food-related conducts when eating a monster 2015-04-22 09:16:49 +03:00
Pasi Kallinen
6d4aa312e6 Unify hero free hand check and msg 2015-04-22 09:02:38 +03:00
Pasi Kallinen
171e8284cd Unify monster gender setting 2015-04-22 08:58:04 +03:00
Pasi Kallinen
3bf2d17e2c Unify iron ball unwielding 2015-04-22 08:53:13 +03:00
Pasi Kallinen
34d5a4c1f9 Unify file removed -trickery 2015-04-22 08:45:03 +03:00
Pasi Kallinen
2783157f95 Unify "You are rooted" message 2015-04-22 08:35:14 +03:00
Derek S. Ray
0bef94cfde Make coalescence message be smart about status
- honor blindness and hallucination
- honor ability to see one of the mergees
- provide audible feedback if appropriate
- merging inside pack gets special-cased so player knows something
  different/unusual is happening
2015-04-21 21:47:33 -04:00
Pasi Kallinen
c9bb75eaf3 Unify dropping boulder on monster 2015-04-21 22:40:27 +03:00
PatR
7bbf292c92 mongone vs vault guard
mongone() would send away a vault guard, whether alive or already
dead and parked at <0,0>, losing the information needed to remove
the temporary vault corridor once whatever obstacle (ie, the hero)
that's keeping it in place has been cleared.  Have mongone() call
grddead() like mondead() does, so that a guard will just be moved
to <0,0> with 0 HP and kept there rather than being purged during
the next dead monster removal.

Move polearm context reset to m_detach() [and, unfortunately,
duplicated in grddead()] rather than in having it in dmonsfree()
since execution of the latter is deferred.  I'm not sure offhand
whether a fast hero could get a second move before end-of-turn
purging of dead monsters.
2015-04-20 19:45:13 -07:00
Pasi Kallinen
bac7654a75 Make sure can't chat out of the map 2015-04-20 18:09:59 +03:00
PatR
6cad21e4e8 tribute in-game bonus
Give 20 experience points the first time the hero reads a passage
from a tribute novel.  It's enough to go from level 1 to 2 or from
2 to 3.  By the time a book store is found, that's too trivial for
most to care about, but it's potentially useful to a pacifist.
2015-04-20 00:05:00 -07:00
Pasi Kallinen
460538b618 Fix dark room glyphs when searching
Searching while blind showed room glyphs as lit even when
dark_room option was on.
2015-04-19 10:47:05 +03:00
PatR
7ba63a868a fix "bad fruit #0"
When minimal_xname() set up a dummy object containing as few details
as possible, it wasn't setting up the fruit id field, so xname()
couldn't figure out what type of fruit it had and issued a warning.

I haven't managed a test case that uses minimal_xname so testing of
the fix is less than comprehensive.  [Pasi got it through dopay, but
that only resorts to minimal_xname if the formatted name is really
long and would otherwise cause the shopkeeper's prompt to overflow.
Long fruit name combined with long individual object name wasn't
long enough to trigger that.  Maybe uncursed, greased, rustproof
the like, or possibly just a longer shopkeeper name than I had?]
2015-04-18 20:18:43 -07:00
PatR
8246c1b7c7 revisit the forcefight crash fix
The previous fix prevents the crash from 'the()' when NO_GLYPH was
used as an index into the defsyms array, but it resulted in giving
feedback of "you attack thin air" regardless of what was at the
target location, reverting to the situation that the buggy code was
attempting to address in the first place.  Handle that differently
by removing the unseen monster glyph sooner.  Also, the underwater
handling wasn't working as intended.

I blamed Derek's pudding farming patch for introducing the problem,
but all that did was replace the offending line(s) with different
indentation.  The older post-3.4.3 patch which produced the problem
was mine.  Sorry, Derek.
2015-04-18 20:02:40 -07:00
PatR
ce05d14e74 revert unneeded lookat() change
The enclosing switch statement is only reached when `glyph_is_cmap' is
known to be true, so remove the redundant extra test.
2015-04-18 18:50:38 -07:00
nhmall
0fdcea70c6 suggested booktribute mods
Changes to be committed:
	modified:   include/extern.h
	modified:   src/files.c
	modified:   src/objects.c
	modified:   src/spell.c

- charge a little more.
- no free read in the bookstore.
2015-04-18 17:45:27 -04:00
nhmall
78b012a680 prevent a couple of reported array index segfaults
Changes to be committed:
	modified:   src/hack.c
	modified:   src/pager.c

Don't use glyph_to_cmap as an array index into
the defsyms[] array unless it really is a cmap.

Recent situation: glyph_to_cmap will return
NO_GLYPH for the unknown monster glyph 'I', which
is not a valid index for the defsyms[] array.
2015-04-18 15:29:37 -04:00
Pasi Kallinen
323b7bba2c Allow wishing for polearm or hammer
which gives a random weapon with the matching skill,
so a random polearm, or a war hammer, respectively.
2015-04-18 17:25:56 +03:00
Pasi Kallinen
8c41a962a7 Fix saving xlogfile realtime 2015-04-17 10:35:05 +03:00
nhmall
e1155aca6f add an initializer 2015-04-17 00:46:54 -04:00
nhmall
f6bf9f9999 protect against bad dates
A recent fault on mingw32 revealed that faulty
code which passes a bad or out-of-range date
value could have game-fatal consequences.
Add some protection.
2015-04-17 00:31:22 -04:00
nhmall
d52c6a208d date verification 2015-04-17 00:12:53 -04:00
Pasi Kallinen
38bdb175cc Prevent divide by zero in newman
...which happened when your max power was 0
2015-04-15 21:05:46 +03:00
Pasi Kallinen
5a08671fc0 Prevent illegal positions for tmp_at
It seems like m_throw() can call tmp_at() with !isok coordinates,
so prevent those in both functions
2015-04-15 20:35:52 +03:00
Pasi Kallinen
97f6834730 Prevent infinite loop
...if the map is filled with monsters, and for some reason
the drowning just won't kill you.

Infinite looping cannot currently happen, because no-one who
can drown can keep surviving the drowning once their amulet
of life saving is used up.
2015-04-15 20:13:30 +03:00
Pasi Kallinen
35e0027328 Prevent out-of-bounds coords when closing a door 2015-04-15 19:43:53 +03:00
Pasi Kallinen
e77ea2ae61 Prevent segfault when looking around inside monster
A recent change by me introduced a segfault when
counting swallowed hero as a monster inventory item.
2015-04-15 17:06:44 +03:00