Commit Graph

3236 Commits

Author SHA1 Message Date
nethack.allison
0e5159b6b7 statue patch (trunk only)
Pat wrote:
> <Someone> has a patch (we've added a couple of
> his earlier ones) which changes the statue display from a single
> one size fits all "`" to a gray monster symbol instead.
> But I think the idea is a good one, and along with the
> bouldersym option could make the fairly hard to
> distinguish back-tick character go away.

Sources tagged before applying NETHACK_PRE_STATUE,
and afterwards with NETHACK_POST_STATUE for easy
rollback.
2006-10-01 21:34:54 +00:00
nethack.allison
a0986b1e30 statue patch (trunk only)
Pat wrote:
> <Someone> has a patch (we've added a couple of
> his earlier ones) which changes the statue display from a single
> one size fits all "`" to a gray monster symbol instead.
> But I think the idea is a good one, and along with the
> bouldersym option could make the fairly hard to
> distinguish back-tick character go away.

Sources tagged before applying NETHACK_PRE_STATUE,
and afterwards with NETHACK_POST_STATUE for easy
rollback.
2006-10-01 21:17:38 +00:00
nethack.allison
374e9fbbb4 more symbol stuff (trunk only)
- reduce the number of symbol tables for each graphics
set {PRIMARY, ROGUESET} from three {map, oc, mon}
tables for each of the display symbols, the loadable symbols,
and the rogue symbols, to one continguous table for
each:
showsyms: the current display symbols
l_syms: the loaded, alterable symbols
r_syms: the rogue symbols

- Modify mapglyph so that the index into the symbolt table is
available as a return value (it was a void function), rather than
just the char converted from the glyph.
- That makes it possible for a window port to use the same
index value to extract from another table (perhaps a unicode
table) for a different set of display symbols. The  index
is much more useful than trying to convert the character
into another type of symbol, as some contributed patches
have done.
- It is much easier to load a single alternative flat table to
make substitutions, since the corresponding value just
has to get placed into the same index offset in the
alternative table.

This also fixes a bug I found in botl.c, where you could
go to the rogue level, and the bottom line gold symbol
was not being updated with the new character as it should.
The reason was because the gold value had not changed,
only the field symbol used had changed.

This updates multiple ports to place a (void) cast on
the mapglyph call, now that it returns a value, so this
is going to generate a lot of diff e-mails.
2006-10-01 19:30:08 +00:00
nethack.rankin
fb8261769a locking/unlocking vs traps (trunk only)
About six weeks back, <email deleted> suggested that
bear traps should deal out damage and be escapable via opening magic.
This doesn't do anything about the first part, but it does allow opening
magic (wand of opening, spell of knock, blessed Bell of Opening) to get
the hero out of bear traps and webs if zapped either at self or downwards.
Zaps across the floor which hit monsters will free them from such traps,
with a chance that releasing a hostile monster will pacify it (using
existing #untrap code).  Conversely, if you are at a web or bear trap
location but not currently trapped, closing magic (wand of locking, spell
of wizard lock) will cause the trap to activate; you may or may not become
trapped.  Likewise for zaps at monsters who are at such locations, which
is treated as an attack.

     Opening magic which hits the hero or a monster located at a trap door
or falling rock trap spot will cause the trap to activate; as above, it's
an attack for the monster case.  At the moment, zapping opening magic
downwards at the hero's location (but not zapping at self or at monsters)
will also cause holes, pits, and spiked pits to activate.  (Zapping down
triggers falling rock traps and zapping up doesn't; that'll need to be
changed.)  Zapping opening down while mounted will untrap, if stuck in a
web or bear trap, and will trap, for the falling cases, in precedence over
releasing the saddle and forcibly dismounting.  The latter still occurs
when there is no applicable trap present though.

     Zapping locking magic downwards at a hole location will convert the
hole into a trap door.  Zapping breaking magic (wand of striking, spell of
force bolt) down at a trap door location will convert the trap door into a
hole.  (Neither conversion currently alters the made-by-you flag for the
trap.  However, the rationalization that distinctive style is what makes
made-by-you recognizable suggests that conversion should clear the flag.)
Lastly, the old behavior (which pre-dated bare holes) of destroying trap
doors when zapping down at them with locking magic has been removed--it
didn't seem to fit very well with the new cases.  I'm starting to have
second thoughts about that but am going to commit this before discovery of
some more niggling details drags it out for another six weeks.
2006-10-01 05:24:28 +00:00
nethack.rankin
d526b4f32f fix burned by burning/drowned in a drowning
From a bug report:  you could end up with
gravestone/logfile result of "burned by burning" or "drowned in a drowning".
If you get life-saved when drowning in water or burning in lava, the game
tries to teleport you to safety.  If the teleport fails for some reason--
such as lack of unoccupied non-water or non-lava locations--you drown or
burn again.  But life-saving was resetting the killer reason and the repeat
drowning/burning wasn't setting it up again, so the default got used and
produced a silly result.
2006-09-29 02:54:17 +00:00
nethack.rankin
556226f695 fix burned by burning/drowned in a drowning
From a bug report:  you could end up with
gravestone/logfile result of "burned by burning" or "drowned in a drowning".
If you get life-saved when drowning in water or burning in lava, the game
tries to teleport you to safety.  If the teleport fails for some reason--
such as lack of unoccupied non-water or non-lava locations--you drown or
burn again.  But life-saving was resetting the killer reason and the repeat
drowning/burning wasn't setting it up again, so the default got used and
produced a silly result.
2006-09-29 02:43:27 +00:00
nethack.allison
15d933a07f trouble after applying a wielded cream pie
<Someone> wrote:
> I can' t find this bug in the known bug list. If I missed I do apologize.
> It occurs on the standard windows nethack.exe. Just wield a cream pie
> and then apply it. Press x to switch weapons. Program in disorder.
> s - 1752440940 glorkum 32 26485 101's named ? (alternate weapon; not wielded).
> Greetings, <Someone>

It crashed with an access violation for me.
2006-09-29 00:40:18 +00:00
nethack.allison
c07c48ab01 roll back 3.4.x branch 2006-09-28 22:32:31 +00:00
nethack.rankin
e6f9adcc53 wizard ^G tweaks
Wizard mode's ^G lets you specify "tame <foo>", "peaceful <foo>", or
"hostile <foo>" to override the created monster's default disposition.
Since it also lets you override the restriction against creating unique
monsters and various other special ones like shopkeepers (a post-3.4.3
change), it became possible to produce tame versions of monsters that
ordinarily are impossible to tame.  That's pretty iffy even when it only
applies to debugging, so switch from internal tameness conversion to use
of tamedog() to get the non-tameable cases handled.  (Minor side-effect:
full moon might prevent a request for "tame dog" from starting out tame.)

     Also, for <N>^G, give up before the specified count is reached if
creation fails when creating multiple copies of a specific type of monster,
on the assumption that the level has become filled up.  (When the type is
random, keep trying in case you subsequently get something different which
could survive on water or inside solid rock.)
2006-09-28 03:56:02 +00:00
nethack.rankin
008366c273 fix #h192 - missile which kills engulfer is in limbo when hero gets expelled (trunk only)
More explicit control over the behavior of spoteffects() is probably
the way to go in the long run, but this much simpler fix handles the case
at hand.  I'm not sure what `thrownobj' was intended to be used for in the
first place, but it came in handy here.  (It was being left as a dangling
pointer when thitmonst() reports that the missile has been used up; that's
fixed now.)

    Fix the reported problem of lookhere/autopickup not seeing the missile
which just killed the engulfing monster whose death caused the hero to be
put back onto the map and so look/pickup upon arrival.  Normally the missile
gets placed after damage has been dealt and the throw has finished.  This
overrides that so that the missile is put into the engulfer's inventory as
it is being killed (which will then put that inventory onto the floor prior
to expelling the hero on top of same).  If the monster happens to get
life-saved it just ends up collecting the thrown-from-inside object a little
sooner than usual.

    This wouldn't correctly handle the same case for a kicked object, if
that were possible.  But it isn't possible to kick objects while engulfed,
so that's moot.  Other calls to thitmonst() and hmon() don't appear to have
any objects in transit so shouldn't need any comparable fix (I hope...).
2006-09-28 03:16:59 +00:00
nethack.allison
171a28871c Apply the symbol changes to 3.4.4 tree 2006-09-27 22:13:48 +00:00
cohrs
01ce182b02 fireproof containers catching fire in lava
Recently reported to the list, a fireproof container dropped in lava would
catch fire and burn.  Add the missing check; this looks an oversight when
the idea of fireproof was added, since other fireproof objects get handled
later in the cascading if().
2006-09-24 23:58:39 +00:00
cohrs
7272de6881 H216 - ball and chain movement
<Someone> reported the longstanding behavior that when dragging, the chain
does not always remain directly between the player and the ball.  This occurs
when the player zigzags.  Added a check to the simple drag code to try to
keep the chain directly between the player and the ball.  But, don't do this
if the player is walking thru rock or if it would move the chain into rock.
2006-09-24 22:31:22 +00:00
nethack.allison
bcf68f17da typo fix 2006-09-24 17:42:40 +00:00
nethack.allison
6e1c1dba92 symset properties (trunk only)
Pat Rankin wrote:
> Symbol set definitions need a description attribute, above and
> beyond allowing comments in the file, for inclusion in the 'O'
> command's menu entries for selecting them.
[...]
> mapglyph.c isn't the proper place to decide whether to define
> ROGUE_COLOR.  That may need to become a symbol attribute,
> which we'd then specify on the Epyx rogue set(s).

Implement both of the suggestions above.
2006-09-24 02:45:34 +00:00
cohrs
13559f1ad8 Elbereth on unoccupied locations
Pat recently forwarded a discussion that Elbereth was ignored unless there
was an object on its location.  Mostly.  It was also respected if the hero
was Displaced, no matter where the hero was.  No one commented on his
message, which I took for assent to address this.  Removed the qualifiers, so
now Elbereth is always respected, just like a scroll of scare monster.
2006-09-24 01:36:40 +00:00
cohrs
21eb6adf36 Guidebook sync for symset
Fix a few things in Guidebook.mn especially syntax errors in the new prose
about nethack symbols, and sync it with Guidebook.txt.
2006-09-23 23:23:48 +00:00
nethack.allison
7fce69157e symbols file feedback (trunk only)
Pat Rankin wrote:
> When 'symbols' is missing from the playground, or is an empty
> file, picking either the symset or roguesymset option via the
> 'O' command just goes right back to the game display (or next
> pending compound option) without giving any feedback.
>
2006-09-23 18:32:21 +00:00
nethack.allison
f713038a88 buildfix !defined(REINCARNATION) [trunk only] 2006-09-23 17:31:19 +00:00
cohrs
d9368a3c09 constrain monster migration in wizard tower
<Someone> noticed that when a monster escaped upladder in the wizard
tower, it ended up outside the tower.  This is due to the "wander" code in
monster migration.  Rather than add code to try to keep the monster from
crossing the undiggable wall, just add REGIONs on the tower levels within the
area, which then utilizes the existing in-a-room constraint behavior of
monster migration. Of course, one can still fill a tower level with fodder,
and then when another monster climbs the ladder, it will still end up
outside the tower.
2006-09-23 06:32:01 +00:00
nethack.allison
c38a07174d symbol parsing (trunk only)
Make sure that less than three digits on a symbol
evaluates correctly.
2006-09-23 06:17:47 +00:00
nethack.rankin
7a49705a93 symbols documentation (trunk only)
A first cut at adding some user-level documentation to dat/symbols.
It should probably include a brief example (not verbose description) of
how to specify values in the various supported formats (decimal, octal,
hexadecimal, simple string, string including escape sequeces?).  Perhaps
a pointer to the Guidebook too. :-}
2006-09-23 05:34:38 +00:00
nethack.rankin
b8ecf9e23e vms update (trunk only) 2006-09-23 04:45:56 +00:00
nethack.allison
1820d8c689 blind player updates (trunk only)
This takes the PC config file commented symbol value
recommendations from <Someone> for blind players
and puts them into a symset.

[note to devteam: They look odd. I thought perhaps that
something was code wrong, but I went back to 3.4.3
and uncommented the config file stuff. They look the
same there, still odd, especially corridors.
Does anyone have any of the e-mail from <Someone> that might give an indication of what is supposed
to be seen on the display?  I wonder if those config
file options fell out of synch with the code long ago]
2006-09-23 04:40:15 +00:00
nethack.rankin
7f4c90ca10 build fix (trunk only)
This may become moot if ASCIIGRAPH and/or ROGUE_COLOR setup changes.
But right now, the initialization was failing except when all three of
TEXTCOLOR, ASCIIGRAPH, and REINCARNATION were defined.
2006-09-23 04:30:45 +00:00
nethack.rankin
d66f04ab5a Readme update
Noticed while synchronizing my code:  Readme's list of directories
still had sys/amiga/ship, which is long gone, and lacked sys/wince/ceinc
and sys/wince/ceinc/sys, which have been around for quite a while now.
2006-09-23 03:40:57 +00:00
nethack.allison
d1c3312cf0 comment bits 2006-09-22 12:29:42 +00:00
nethack.allison
719721e017 more symbol set stuff (trunk only)
- Instead of checking for the Rogue level, check which
  graphics are engaged (PRIMARY or ROGUESET) in the
  SYMHANDLING() macro.

- track which graphics are active through 'currentgraphics'.

- Instead of symset and roguesymset and symhandling and roguehandling
  variables, have symset and symhandling be arrays of two, with the
  following indexes:
	PRIMARY
	ROGUESET
  That reduced the amount of repeated code.
  (Not to be confused with the 'symset' and 'roguesymset' config file options
   both of which still exist)

- the symbol routines were adjusted to pass
the index , rather than 'rogueflag' and coding to roguesymset etc.

Other than fixing bugs that are encountered, this is probably
the last of the symbol stuff, with the exception of
making the symset and roguesymset config file options
accept the keyword value "default".
2006-09-22 02:00:30 +00:00
cohrs
a3e0bf97b1 Eyes plus stinking cloud
stinking clouds extend their timers, causing the "ttl == 0" check in
visible_region_at to be inappropriate; technically it was never quite
right, since the ttl is set to 0 one turn before removal is considered. But
with the Eyes on, this caused a visible change in the region although the
region still existed.  Introduced a new -2L value to designate that the
region is being removed (-1L means it's permanent), which is what
visible_region_at was really trying to test.
2006-09-21 15:03:48 +00:00
cohrs
2303fc8923 more symhandling followup
- yet another unused symbol, this one on files.c.
2006-09-21 06:24:44 +00:00
cohrs
81d5ba4044 more symhandling followup
- the cause of of the odd "~" with DECgraphics appears to have been caused
by the Is_rogue_level(&u.uz) tests occurring before rogue_level was
initialized.  Perhaps there's a better way to deal with this than what I did?
2006-09-21 06:24:19 +00:00
nethack.allison
72011cb75f more followup (trunk only)
make the handling recognition use an int instead of string.
2006-09-21 05:53:08 +00:00
cohrs
39d5f48ce0 symhandling followup for Linux
- tile2x11 would not build because drawing.c now depended on strcmpi which
was (via STRNCMPI not being defined) defined to strncmpi which is
implemented in hacklib.c which needs panic which is defined in... I gave up
on tracking down all the loose ends and changed the strcmpi to strcmp,
which means the handling is case sensitive, but it avoids a bunch of
changes to the way the util/Makefile.
- the symhandling changes introduced a chicken and the egg problem for
ASCIIGRAPH on Unix platforms, which was getting the defn from tcap.h but
that does not get included earlier enough nor often enough.  I added a defn
to unixconf.h to mimic ntconf.h, since ASCIIGRAPH is normally defined on Unix.
- options.c included an unused decl for a function named graphics_opts
- Unix Makefile was not installing "symbols".  I'm assuming this isn't
supposed to get the DLB treatment.
2006-09-21 05:09:38 +00:00
nethack.allison
f0bf6c7653 more follow-up (trunk only)
Based on feedback, make the load_symset() call easier
to follow.
2006-09-21 03:47:00 +00:00
nethack.allison
b5648a7bb3 symhandling follow-up (trunk only) 2006-09-21 03:11:06 +00:00
nethack.allison
347aadee88 fixes update (trunk only) 2006-09-21 02:35:56 +00:00
nethack.allison
5d0228ed70 yet more followup (trunk only)
- a reference to roguesymset should be 'symbols'
- another symset name update
2006-09-21 02:13:26 +00:00
nethack.allison
6133b14fb7 more followup (trunk only)
More symset name correction
2006-09-21 02:01:56 +00:00
nethack.allison
1e60eab7cd pcmain followup (trunk only)
Specify a valid symset.
2006-09-21 01:57:25 +00:00
nethack.allison
b972732dd8 Files followup (trunk only) 2006-09-21 01:48:22 +00:00
nethack.allison
253bf359af drawing overhaul (trunk only)
This is an overhaul to the NetHack drawing mechanism.

- eliminates the need to have separate lists in drawing.c
for the things and their associated explanations by grouping
those thing together on the same inializer in a struct.

- replaces all of these options: IBMgraphics, DECgraphics, MACgraphics,
graphics, monsters, objects, boulder, traps, effects

- drawing.c contains only the set of NetHack standard symbols for
the main game and a set of NetHack standard symbols for the
roguelevel.

- introduces a symbols file that contains named sets of
symbols that can be loaded at run time making it extensible
for situations like multinational code pages like those reported
by <Someone>, without hardcoding additional sets into the game code.

- symbols file uses names for the symbols, so offsets will not break
when new things are introduced into the game, the way the older
config file uchar load routines did.

- symbols file only contains exceptions to the standard NetHack
set, not entire sets so they are much less verbose than all of
the g_FILLER() entries that were previously in drawing.c

- 'symset' and 'roguesymset' config file options for
preselecting a symbol set from the file called 'symbols'
at startup time. The name of the symbols file is not under the
users control, only the symbol set name desired from within the
symbols file is.

- 'symset' config file option loads a desired symbol set for
everything but the rogue level.

- 'roguesymset' config file option loads a desired symbol set
for the rogue level.

- 'SYMBOLS' config file option allows the user to specify replacement
symbols on a per symbol basis. You can specify as many or as few symbols
as you wish. The symbols are identified by a name:value pair, and line
continuation is supported. Multiple symbol assignments can be made on
the same line if each name:value pair is separated by a comma.
For example:
SYMBOLS = S_bars:\xf0, S_tree: \xf1, S_room:\xfa \
	  S_fountain:\xf4 \
	  S_boulder:0

- 'symbols' file has the following structure:
start: DECgraphics
	Handling: DEC
	S_vwall: \xf8			# meta-x, vertical rule
	S_hwall: \xf1			# meta-q, horizontal rule
finish
start: IBMgraphics
	Handling: IBM
	S_vwall: \xb3			# meta-3, vertical rule
	S_hwall: \xc4			# meta-D, horizontal rule
finish

- 'symbols' file added to the source tree in the dat directory

- Port Makefiles/scripts will need to be adjusted to move them into
HACKDIR destination
2006-09-21 01:46:15 +00:00
nethack.allison
94b66d0be5 New file: dat/symbols 2006-09-21 01:33:24 +00:00
nethack.allison
67b34944e3 dos port chdir fix
I don't know if this was introduced post 3.4.3 or not, but the
DOS port was doing a chdir at the start, but not doing one
at the finish of the game, so you ended up in the same
directory as the NetHack.exe executable post-game.

It was doing the chdir even if NOCWD_ASSUMPTIONS was
defined.
2006-09-18 23:18:54 +00:00
nethack.allison
04470da94c very minor optimization in mapglyph
Perform the multiple tests in macro once and use the
result throughout the function.
2006-09-17 14:23:17 +00:00
nethack.allison
61f6e7b7c6 build fix w/o REINCARNATION defined 2006-09-17 04:40:06 +00:00
nethack.rankin
bc8453a239 <foo> suddenly appears next to you (trunk only)
> Give demon lords and other monsters who teleport to your location a
> oneshot arrival message.  [...]
> The fixes entry is deliberately a bit vague (and I put it in the new
> feature section rather than the fix section).

And apparently I neglected to commit it with the rest of that patch last
week.
2006-09-16 04:46:12 +00:00
nethack.allison
1cf4c373fc fix for #H229
<Someone> wrote:
>>comments:
>>When you commit suicide with a potion of oil (lit), sometimes nethack
>>reports an `obj_is_local' error just after disclosing all the game
>>variables. This has been found in-game (don't ask) and reproduced in
>>wizard mode and in-game (start-scumming).
>
> 0) a neutral human wizard (the scrolls/spellbooks burning, potions boiling ;))
> 1) wish up 3 potions of oil (so that the 2 remaining will definitely kill you)
> 2) a'pply one of them
> 3) stand 1 square away from a wall, like "| @"
> 4) throw the lit potion into the wall (`h' in this case)
> 5) answer `yes' on all prompts.

The thrown potion of oil, which was extracted from any chain
during the throw, still had its timers attached when the call to
splatter_burning_oil() was made. If that killed the hero, a
panic would result during bones file creation (saving timers)
because (obj->where == OBJ_FREE) on the potion.

Remove the timer prior to splattering the oil inside.
2006-09-11 04:03:59 +00:00
nethack.allison
80a5f0d4dd #H226: Poor grammar when engraving under water 2006-09-10 14:20:31 +00:00
nethack.allison
ea80f61b6f bug W343-3 fix (trunk only)
Incorporate part of <Someone>'s changes to address
the main part of bug W343-3.

One other patch yet to come needs to provide a way
to limit the IBMGraphics symbols to various subsets that are
available on some international versions of Windows. Pat
suggested that we not incorporate that patch as is, so I'll be
working on an overhaul of the {DEC|IBM|MACgraphics mechanism.

    * Checks for the presence of the Unicode
      APIs.  If GetVersion() returns the 31st bit set, NetHack is running on
      a 95-based version of Windows.  The Unicode APIs are not available
     and NetHack will revert to the pre-patch behavior. This fix isn't needed
      on 95-based Windows anyway.
    * Fixes console output for text strings.
      The character is converted according to the user's configured IEM code
      page and passed to the Unicode version of WriteConsoleOutputCharacter.
    * Fixes console output for map symbols.
      The character is converted according to a fixed mapping containing
      code page 437 plus the symbols in the space from 00 to 1F.  A fixed
      table is used so that a player using Lucida Console can get full
      IBMgraphics (original set, i.e. level 3) regardless of the code page.
      A table is used instead of MultiByteToWideChar so that the space from
      00 to 1F will be converted correctly; this is necessary for correct
      display of the Rogue level.
2006-09-09 20:36:12 +00:00
nethack.allison
94bc5885b1 console colour follow up 2
If you specified one or more palete options in the config file,
but not all 16, you ended up with black for any you didn't
specify - oops.

This patch ensures that the table has a full complement
of 16 colours by initializing it to the windows default colours
just ahead of the first palette option encountered.

As before, if the config file has no palette option in it,
no calls to change the palette are made at all. If the
undocumented method breaks in a future release of
Windows, then avoiding palette options will work
around the problem.
2006-09-09 19:38:25 +00:00