Commit Graph

614 Commits

Author SHA1 Message Date
nethack.rankin
54bbb38ee0 merge javelin and spear skills (trunk only)
Part of "multi-shot throwing proposal" last January.  Unfortunately
some of the bits that I had implemented back then have vanished, so I'm
doing it over from scratch.  There were three main parts:
1) allow multi-shot volley throwing for all stackable weapons (affects
   knives, javelins, spears, and boomerangs; other weapons either don't
   stack or are already multi-shot);
2) make worm teeth and crysknives be stackable like ordinary knives;
3) merge spear and javelin skills, so that allocating skill points to
   their use becomes more attractive and they might get used more.
This patch only does #3.

     Since the monk skill set shrinks by more than any of the other roles,
I bumped max skill for escape spells (haste self, invisibility, jumping,
levitation, and teleport away) from basic to skilled; that's the only
skill adjustment included here.  For the couple of roles had different
max values for spear and javelin skill; this keeps the higher of the two.
2006-12-15 04:54:22 +00:00
nethack.rankin
0db19f1c96 restore_menu (trunk only)
Move the code to use a nethack menu for restoring a saved game.  It
was inline in tty_askname() but is now a separate routine, restore_menu()
in restore.c.  There was no port-specific code and only a small amount of
tty-specific code; it should be useable by anyone (but Qt doesn't have to
switch over if it doesn't want to).

     The original behaved strangely if there were exactly 26 saved chars;
the "start new game" menu entry ended up using "{" as selection character.
There wasn't any comparable problem at 52; it was limiting the menu to 51
games.  Now it will allow 52 (with "start a new game" bumped into "#" if
there are that many), and adds an explicit quit entry (unless there are
52 or more games so that # is already used by new-game, then quit remains
implicit rather than resort to some other none-of-the-above character).
2006-12-12 04:52:39 +00:00
nethack.rankin
528238422a saved-games menu for vms (3 of 2) (trunk only)
A copy+paste error was being masked by some temporary code.
2006-12-10 04:58:34 +00:00
nethack.rankin
a654734476 saved-games menu for vms (1 of 2) (trunk only)
First cut at implementing SELECTSAVED for VMS.  Unfortunately, it only
works by default if the player is using a [probably] shared account called
"games" or "nethack", and displaying a menu of games available to restore
will likely have the side-effect of encouraging other players sharing that
account to steal each others saved games.  To use it with a normal account,
the player has to include "-ugames" or "-unethack" on the command line
(or OPTIONS=name:games in config file) to force the program to reach the
"Who are you?" stage.

     I've added a flag argument to set_savefile_name() so regularization
can be suppressed, allowing it to be used to construct a wildcarded file
specification.  I'm using that for VMS and have attempted to put in place
for WIN32CON, but the latter is not tested.

     The current WIN32CON and UNIX+QT_GRAPHICS methods of collecting save
file names is bug-prone if used on a shared playground directory.  Counting
matching file names first, then allocating memory and retraversing the
directory to copy those names into the allocated memory has a window of
vulnerability where the number of matching files could increase between the
counting and the copying.
2006-12-10 04:46:57 +00:00
nethack.rankin
58a9bcf893 moveloop() vs lava
Something's wrong with the way lava was being handled in moveloop().
If you were trapped in lava (ie, moved into some but didn't die on the
spot thanks to fire resistance), you could sink and ultimately die without
ever taking another actual turn (typing ``i<space>'' repeatedly is an easy
way to reproduce).  [`didmove' was only being checked for the sinking
deeper case and not for the decrement which ultimately leads to the fully
sunk case.]  On the other hand, if you could manage to start an occupation
and avoid being interrupted, you would never sink while it was in progress.
[Lava handling followed ``if (multi && occupation) { ...; continue; }''.]

     While testing some other code (lava vs slime, coming shortly) I ended
up with the cursor sitting on the status line while the game was waiting
for me to enter my next move.  I don't really understand what's going on
there, and moving the lava handling before bot() might have hidden that
particular problem now by changing the point at which Slime will get taken
off the status line, but this attempts to fix it anyway.
2006-12-01 06:42:25 +00:00
nethack.rankin
17f8482e73 dipping and greasing (trunk only)
From a bug report:  you
can dip a worn item such as shirt or suit into a potion of polymorph and
it will become unworn--but as of a couple of days ago, unworn only if the
transformed object's new form can't be worn in the same slot--even if it
is covered by a cursed worn item (suit or cloak).  It didn't seem like
trying to fix that special case would be very worthwhile; this fixes the
more general situation of "you could dip worn items even though they were
covered up by other worn items".

     In the same report:  you could apply grease to rings while wearing
cursed gloves.  The code already prevented greasing a suit when it was
covered by a cloak (regardless of whether that cloak was cursed), and a
shirt when it was covered by a suit or cloak or both.  This moves that
code into a separate routine which is used for dipping as well as for
applying grease, and now handles rings vs gloves.

     Since covered rings, shirt, or suit are no longer eligible to be
dipped or greased, this also makes "?" for the pick-an-item prompt leave
such things out of the list of likely candidates.
2006-11-30 05:54:47 +00:00
nethack.rankin
8d86a87a7b polymorphing worn items (trunk only)
From a bug report.  That's hard to fix in the general case because armor
and tools might not fit back into the same equipment slot, but most other
types of worn items can be re-worn after being transformed.  This makes
any transformed worn item stay worn if it is wearable in the same slot.
2006-11-28 05:06:13 +00:00
nethack.rankin
2fa9bd0301 petrification fixes
Eliminate the somewhat redundant "You die..." following "You turned
to stone..." when becoming petrified by touching a cockatrice (reported
by <email deleted> for kicking, but occurs for weaponless hitting too).
Also, if a cockatrice killed you with normal damage, your tombstone would
erroneously report petrification and presumeably there'd be a statue
instead of a ghost in the resulting bones file.  This fixes both things.
2006-11-10 05:13:57 +00:00
nethack.rankin
f8f5642d3a #tipping shop containers (trunk only)
Using #tip (post-3.4.3 code) on a container that's on a shop floor
didn't handle ownership correctly.  Bag of tricks could be emptied for
free, and contents of other containers were being sold to the shop even
when the shop already owned them.  This fixes bag of tricks and makes a
first cut at doing so for regular containers.

     Message handling when #tipping any bag of tricks was also suboptimal
since the decision about message delivery was made again as each charge
released something instead of waiting until the whole bag was emptied.
So you could get inappropriate "nothing seems to happen" before or after
a monster visibily popped up if something unseen was also produced.
2006-11-09 06:36:36 +00:00
nethack.rankin
ef2085bcaf "(contents, N zorkmids)" fix (trunk only)
Some code I recently added was misusing count_unpaid() and would
traverse some or all of inventory instead of just container's contents
when looking for unpaid items.  Add mew routine `is_unpaid(obj)' to do
what I was intending to do with count_unpaid().
2006-11-09 05:20:00 +00:00
nethack.rankin
0a7c5d6ad2 shopkeeper feedback (trunk only)
Use verbalize instead of pline for shop "thank you, scum" message
(From a bug report.  Suppress shop "you sneaky cad" message
when removing a hero-owned pick-axe from a container inside a shop if the
shk is unable to speak; also give it at most one time per move (taking
multiple pick-axes out of a bag at once was way too verbose).  Honor
addtobill's silent flag for the bill overflow message when/if that occurs.

     Also adds a safe_qbuf usage for the #tip command that I had pending
for pickup.c.
2006-11-07 02:49:09 +00:00
nethack.rankin
bc9f91fce5 unpaid shop goods in inventory (trunk only)
Inventory display adds "(unpaid, N zorkmids)" to carried unpaid
items, but it didn't show anything comparable for indirect unpaid ones
(hero-owned containers holding shop-owned objects).  Now it will include
"(contents, N zorkmids)" in such cases.
2006-11-04 07:49:49 +00:00
nethack.allison
93b378fac6 wchar follow-up (trunk only)
- ensure that wchar.h is included even if it is not included
from another system header file as it is on some platforms.

- attempt to make the NHWCHAR_P definition more appropriate
for more platforms.
2006-10-26 23:30:00 +00:00
nethack.rankin
9315307df2 safe_qbuf, short_oname (trunk only)
Change safe_qbuf() so that instead of picking one of three strings
for sprintf() to plug into a prompt string, it actually constructs the
full prompt string itself.  Also pass in the unformatted object and a pair
of formatting functions instead of performing dual formatting in advance.
The actual formatting is done via new routine short_oname() which also
takes an object and a pair of formatting routines plus a target length.
It uses the first routine, typically xname() or doname(), and formats the
object, then if the result is too long it makes some transformations, and
tries again.  If truncating "called foo" and "named bar" down to 12 chars
and omitting "uncursed, rustproof, thoroughly corroded" attributes still
result in a string that's too long, it uses the other formatting routine.
The latter calls one of several jacket routines around simple_typename()
to produce a short result.

     This has been through about four incarnations now and has gotten a
bit less testing each time, but I need to get it in place before I end up
running out of gas and abandoning it.  I've got some changes to shk.c
(where safe_qbuf is needed but not currently used) that now need to be
redone and will come eventually.
2006-10-24 05:18:00 +00:00
nethack.rankin
6b371a7042 unhiding during level change
From the newsgroup:  if a pet was hiding under an object next to you
when you changed levels, it could arrive hidden at the destination if there
was something available to hide under there too, and sometimes you'd start
the new level with a hidden monster glyph at its location.  I was able to
reproduce that once with current trunk code, but while trying to figure
out what is actually happening I've been unable to make it happen again.
However, it doesn't make sense for a monster to be able to remain in hiding
during the level change in the first place, so this patch prevents that.
(I'd still like to know how/why map_invisible() is sometimes getting called.
[The test character was a level 1 tourist without auto-search capability.]
I'm reasonably sure that it won't happen any more once this fix in place.)

     This also brings adjacent pets out of hiding when they accompany you
during ascension or dungeon escape, but it seems that that wasn't actually
necessary.  The end of game disclosure already lists such by name rather
than as "it", contrary to my expectations.  (I had forgotten that end-of-
game forces true names so that blindness and hallucination don't interfere
with disclosure; obviously that ends up handling hidden monsters too.)
2006-10-22 02:53:31 +00:00
nethack.allison
4169a3a308 Remove win32 mapi mail from distribution (trunk only) 2006-10-19 13:26:54 +00:00
nethack.allison
24bf14cdb2 add some unicode support (trunk only)
This patch attempts to add some levels of unicode support
to NetHack.

The master on/off switch for any Unicode support is
defining UNICODE_SUPPORT in config.h. Currently
there is code support for two subsets of unicode support:

UNICODE_DRAWING

If UNICODE_DRAWING is defined, then the data
structures used to house drawing symbols are expanded
to the size of wchar_t, big enough to hold unicode characters.
A typdef called `nhsym' is involved and if UNICODE_DRAWING
is defined, it is wchar_t, otherwise it is uchar.

UNICODE_WIDEWINPORT

If UNICODE_WIDEWINPORT is defined, then the data
structures inside the window port are expanded to the size of
wchar_t, big enough to hold unicode characters.  Both map
symbols and text within the window port are expanded, in order
for potential support for displaying multinational characters some
day, but this patch only provides viewing of map symbols.
A typdef called `nhwchar' is involved and if UNICODE_WIDEWINPORT
is defined, it is wchar_t, otherwise it is char.

The only window port with code support for UNICODE_WIDEWINPORT
currently is the TTY port.  Don't enable UNICODE_WIDEWINPORT
unless:
- it is a TTY port
- the underlying platform specific routines can
handle the larger data structures.

Don't enable UNICODE_SUPPORT unless:
- your compiler can handle wchar_t.
- your compiler can accept L'a' characters.
- your compiler can accept L"wide" strings.

Note that if your compiler can handle the above, you could
enable the larger data structures (currently if TTY) even if your
platform can't actually display unicode or UTF-8, by messing
with u_putch() in win/tty/wintty.c to only deal regular chars.
That should be the only function that actually pushes wide characters
out to the display.

If you enable UNICODE_SUPPORT, and your platform is capable
you will need to turn on the unicode run-time option to be able to
load unicode character sets from the symbol file, to be able to
push unicode characters to the display. You'll also want to load
a unicode symbol set once the unicode option is toggled on. In
a config file you would do that via these two lines:
OPTIONS=unicode
OPTIONS=symset:Unicode_non_US

The repository was stamped with NETHACK_PRE_UNICODE
prior to applying this patch, and stamped with
NETHACK_POST_UNICODE afterwards. The code differences
between those two tagged versions are this patch.
2006-10-18 00:09:18 +00:00
nethack.allison
7f0f43e6f9 add some unicode support (trunk only)
This patch attempts to add some levels of unicode support
to NetHack.

The master on/off switch for any Unicode support is
defining UNICODE_SUPPORT in config.h. Currently
there is code support for two subsets of unicode support:

UNICODE_DRAWING

If UNICODE_DRAWING is defined, then the data
structures used to house drawing symbols are expanded
to the size of wchar_t, big enough to hold unicode characters.
A typdef called `nhsym' is involved and if UNICODE_DRAWING
is defined, it is wchar_t, otherwise it is uchar.

UNICODE_WIDEWINPORT

If UNICODE_WIDEWINPORT is defined, then the data
structures inside the window port are expanded to the size of
wchar_t, big enough to hold unicode characters.  Both map
symbols and text within the window port are expanded, in order
for potential support for displaying multinational characters some
day, but this patch only provides viewing of map symbols.
A typdef called `nhwchar' is involved and if UNICODE_WIDEWINPORT
is defined, it is wchar_t, otherwise it is char.

The only window port with code support for UNICODE_WIDEWINPORT
currently is the TTY port.  Don't enable UNICODE_WIDEWINPORT
unless:
- it is a TTY port
- the underlying platform specific routines can
handle the larger data structures.

Don't enable UNICODE_SUPPORT unless:
- your compiler can handle wchar_t.
- your compiler can accept L'a' characters.
- your compiler can accept L"wide" strings.

Note that if your compiler can handle the above, you could
enable the larger data structures (currently if TTY) even if your
platform can't actually display unicode or UTF-8, by messing
with u_putch() in win/tty/wintty.c to only deal regular chars.
That should be the only function that actually pushes wide characters
out to the display.

If you enable UNICODE_SUPPORT, and your platform is capable
you will need to turn on the unicode run-time option to be able to
load unicode character sets from the symbol file, to be able to
push unicode characters to the display. You'll also want to load
a unicode symbol set once the unicode option is toggled on. In
a config file you would do that via these two lines:
OPTIONS=unicode
OPTIONS=symset:Unicode_non_US

The repository was stamped with NETHACK_PRE_UNICODE
prior to applying this patch, and stamped with
NETHACK_POST_UNICODE afterwards. The code differences
between those two tagged versions are this patch.
2006-10-17 23:55:42 +00:00
nethack.allison
8fc01eb6b1 window port change - putmixed() (trunk only)
Add putmixed() to the window port. It allows map symbols to
be included in the string by encoding them in a unique fashion.
This was done because Unicode symbols, for instance, could be
longer than the size of a char.

The encoding of the map symbols in this patch is done by
prefixing a glyph value with \GXXXX, where XXXX is a
random value for the current game. The reason for the random
prefix is to minimize the possibility that a player can trigger
the escape sequence processing within text under their control
(dog names, etc.) the way they could if the sequence was fixed
in the source code. The random prefix remains the same throughout
the lifetime of a game because message window strings are
saved in the save file.

(There was actually a bug present because of the embedded
character even before the recent symbol changes, because if
someone was using a  different set of characters between games,
the saved messages would reflect the original characters, rather
than the current. That bug was introduced with the ability to
save messages to the savefile.)

A window port does not have to supply an XXX_putmixed() routine,
it can use genl_putmixed() which uses the old behavior of
embedding the sequence as a character within the string
and calling putstr(). genl_putmixed() takes care of the decoding
of the escape sequence.

This also #ifdef's out code in pager.c for converting a glyph
to a character, and uses mapglyph() to do that instead. Does
anyone see a problem with doing that through mapglyph instead
of repeating similar code within pager.c?
2006-10-17 23:06:31 +00:00
nethack.rankin
624a1b31d9 surviving petrification (trunk only)
From the newsgroup:  if you were wielding a cockatrice corpse without
gloves while polymorphed into something capable of doing that, then were
turned to stone when rehumanizing, you'd be left wielding the untouchable
corpse if life-saving kept the game going.  This causes it to stop being
wielded if you get that far.  Likewise for monsters.
2006-10-13 05:39:16 +00:00
nethack.rankin
93eccebe84 sleeping steeds (trunk only)
From the newsgroup:  it was possible to saddle, mount, and ride on a
sleeping jabberwork without it ever waking up.  Movement was checking for
timed sleep (!mon->mcanmove, set when mon->mfrozen contains a timer count
for either sleep or paralysis) but not indefinite sleep (mon->msleeping).
This moves the checking into its own routine which handles both types.
And it gives monsters a chance to wake up when they get saddled or mounted.
2006-10-13 04:03:36 +00:00
nethack.rankin
35920f24d5 paniclog prefix (trunk only)
Extend the identifying information used to prefix paniclog entries
from version + date to version + date + time + userid + mode (where mode
is 'D' for wizard mode, 'X' for discover mode, and '-' for normal play).

     hacklib.c ended up getting more of a revision than I intended, but
the date/time handling routines now have less clutter.  I hope I didn't
break anything in the process.
2006-10-10 05:47:04 +00:00
nethack.allison
ab947c6b65 squeaky boards (trunk only)
There is a quote in data.base for squeaky board traps:
	A floorboard creaked.  Galder had spent many hours tuning them,
	always a wise precaution with an ambitious assistant who walked
	like a cat.
	D flat.  That meant he was just to the right of the door.
	"Ah, Trymon," he said, without turning, and noted with some
	satisfaction the faint indrawing of breath behind him.  "Good
	of you to come.  Shut the door, will you?"
		[ The Light Fantastic, by Terry Pratchett ]

This patch makes each squeaky board trap on a level produce
a unique sound. If you had visited the trap yourself prior
to hearing a monster on it, you could actually know where
a monster was by the unique pitch of the squeak.

If someone wants further refinement of the roles, this could
be adjusted to only work for musically adept roles/species,
with the others only hearing a generic squeak. As it stands
right now, everyone benefits.  Does anyone thing the
separation by role or species would be good? If so, which
roles/species are musically proficient, and which are not?

Since this patch increments editlevel anyway, it also sneaks in a
context structure change for an upcoming patch.
2006-10-08 21:37:58 +00:00
nethack.allison
2c5d46fbd7 symbol bit (trunk only)
Ensure that the symset struct is defined before
external declaration using it.
2006-10-07 23:06:35 +00:00
cohrs
d04a0f808c H143 - bugles affecting all monsters
<Someone> pointed out that bugles, although noisy, only affect soldiers.
This didn't make sense to me either.  Added code so they will also affect
monsters near the bugler.
2006-10-03 03:32:26 +00:00
nethack.allison
0ce424b71a symset restrictions attribute (trunk only)
Pat Rankin wrote:
> I was about to also suggest that there
> be a rogue/non-rogue (with perhaps a third choice meaning "both")
> attribute.  That way we could keep the rogue choices from being
> listed in the "symset" menu and the non-rogue choices from the
> "roguesymset" menu.  Players who deliberately wanted to switch
> over would need to modify the attribute, possibly on a cloned set.
> Or perhaps they could just explicitly set their desired choices
> via NETHACKOPTIONS or .nethackrc and not use the 'O' menues--the
> new attribute doesn't necessary have to block which sets get used
> where, just filter menu entries to display the most applicable
> candidates.
2006-10-03 02:38:40 +00:00
nethack.allison
084dce82d0 symbol preprocessing (trunk only)
Clean up the preprocessing associated with the
loadable symbol stuff.

Base it on new LOADSYMSETS, rather than on the
previously existing ASCIIGRAPH preprocessor define.
2006-10-02 13:15:50 +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.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
nethack.rankin
b8ecf9e23e vms update (trunk only) 2006-09-23 04:45:56 +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
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
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.rankin
467899e307 <foo> suddenly appears next to you (trunk only)
Give demon lords and other monsters who teleport to your location a
oneshot arrival message.  Brought about by the report of the late "<demon>
appears" message delivered during its bribery demand, after the character
had already been able to see it for long enough to extract gold from a bag.
Now, if you can't see or sense a monster before it teleports to you, and
you can see or sense it after, you'll get "<monster> suddenly appears!".
The message will be given at most once for any given monster, and it won't
be shown at all if you already see/sense the monster before it teleports or
still don't see/sense it afterwards.  The fixes entry is deliberately a bit
vague (and I put it in the new feature section rather than the fix section).

     The change from long to unsigned long for monst.mstrategy may bring
some lint complaints along with it.  The various constants (STRAT_xxx) used
to populate it are still signed.  I didn't increment EDITLEVEL for this;
existing data should still work ok.
2006-09-07 04:42:13 +00:00
nethack.allison
817cae4518 adjustment of win32 console colours (trunk only)
Allow config file entries to adjust win32 console colours.

The following entries in a config file are examples:
OPTIONS=palette:black-0-0-0
OPTIONS=palette:red-210-0-0
OPTIONS=palette:green-80-200-0
OPTIONS=palette:brown-180-100-0
OPTIONS=palette:blue-0-0-200
OPTIONS=palette:magenta-128-0-128
OPTIONS=palette:cyan-50-180-180
OPTIONS=palette:gray-192-192-192
OPTIONS=palette:dark gray-100-100-100
OPTIONS=palette:orange-255-128-0
OPTIONS=palette:bright green-0-255-0
OPTIONS=palette:yellow-255-255-0
OPTIONS=palette:bright blue-100-100-240
OPTIONS=palette:bright magenta-255-0-255
OPTIONS=palette:bright cyan-0-255-255
OPTIONS=palette:white-255-255-255

This uses an undocumented way to adjust the console
colours in a win32 console application. The method and
code snippet used comes from www.catch22.net by James Brown.

This page:
      http://www.catch22.net/about.asp
states the following:
"you do not have to pay anything to use the software, and there are no
 licencing terms for any sourcecode that you may download from this site.
This means you can freely use any sourcecode or portions of code in
your applications, whether they be free software or professional, retail
products."
2006-09-03 04:17:09 +00:00
nethack.rankin
06e9fa91de Unaware; fix #H202 and extend the fix for #H179 (trunk only)
Turn being unconscious (via several reasons, including fainted from
hunger) into a pseudo-property named `Unaware' and use it in several
places where only being asleep was checked.  #H202 was about a stunned
character who got the recovery message when it timed out while fainted.
This suppresses messages for several difficulties when they begin or end
while hero is Unaware.  Messages about fatal illness, sliming, or
petrification aren't suppressed; they're too important to hide from the
player.  "You feel ..." messages come out as "You dream that you feel ..."
when Unaware; fairly lame but hopefully adequate.
2006-09-02 03:32:18 +00:00
nethack.allison
90fba2f9f9 cmdassist for wishing 2006-08-26 04:03:27 +00:00
nethack.rankin
d8076947dd fix #H177 - mimicking gold while hallucinating (trunk only)
From a bug report, having hallucination time out while
mimicking an orange (instead of gold, after eating a mimic corpse), you'd
still get the hallucinatory end-of-mimicking message about not wanting to
be peeled.  If hallucination state is toggled, update the pending message
and change the hero's appearance.  In practice, only the orange-to-gold
case can occur.  Anything which might trigger gold-to-orange will have
terminated the hero's mimickery befort that happens.
2006-08-19 05:29:16 +00:00
nethack.allison
7f826cd288 more set_corpsenm (trunk only)
Use set_corpsenm() in a few more places.
2006-07-30 20:08:57 +00:00
nethack.allison
7394b0a353 ntconf vc2005 warnings bit 2006-07-11 12:29:51 +00:00
nethack.allison
e9a6ed3766 recent dead code(trunk only)
remove function zero_anything() completely, as it isn't needed any longer
2006-07-11 12:28:19 +00:00
nethack.allison
0abece54c1 more dos bits 2006-07-10 02:10:22 +00:00
nethack.allison
00768fce8b bits
- catch up on a couple of DOS bits
- fix a copy-and-paste error on hack.c function
2006-07-09 22:17:57 +00:00
nethack.allison
003aea0ce3 zeroany [trunk only]
Avoid function call when clearing 'anything' union.
2006-07-09 16:25:39 +00:00
nethack.allison
98a09101b1 remove pointer to long conversions - part 3 of 3 (trunk only)
Remove some more code that forced pointers into a long int, and
vice versa where information could be lost (P64 platforms such as
WIN64 have a 64 bit pointer size, but a 32 bit long size.)

This 3rd part deals with region functions switching
some arguments from type genericptr_t to 'anything'.

Like the previous 2 parts, this needs to increment
 EDITLEVEL in patchlevel.h.
2006-07-09 01:23:26 +00:00