Commit Graph

51 Commits

Author SHA1 Message Date
nethack.allison
8f66986300 Pat Rankin wrote:
> The `prompt' buffer in tty_yn_function still only holds QBUFSZ
> characters. But fixing the tty incarnation wouldn't be good enough;
> all the other interfaces would need to handle it too.  I think it
> should be fixed in the core instead.  Prompt strings simply should
> not be allowed to become so lengthy.

Another step in the fight against prompt sting buffer overflows.
The goes after the ones that may not have been found yet.

This makes yn_function a real core function and removes
the #define yn_function macro.

The yn_function validates the prompt string buffer being
passed prior to calling (*windowprocs.win_yn_function)(),
and if necessary, truncating it and adding "...".

This won't help if the overflow occurs in the core in
a buffer that is still QBUFSZ in size, but it will help if
a BUFSZ buffer is being passed to one of the query
functions.
2003-05-10 14:11:42 +00:00
nethack.rankin
d0e4d1e31b #tip command - container access
Another fix to address the complaints about two-handed weapons being
rendered useless by 3.4.1's change to require free hands in order to apply
containers.  Some players now fear to wield two-handed weapons because a
curse would make accessing their bag impossible, which is doubly nasty if
that's where they have scrolls of remove curse or potions of holy water
intended to deal with cursed items.  The same situation applies for cursed
one-handed weapon combined with cursed shield, so some are now claiming
that 3.4.1 has made two-weapon combat be even more attractive than before.

     This implements #tip, a new command that causes a container at the
current location or carried in inventory to have its contents emptied
onto the floor.  Hero's hands don't need to be free at the time but tipping
a floor container requires limbs; tipping an inventory container doesn't
need hands or even limbs.  The contained items don't pass through inventory
during the process, so don't cause objects (loadstones, crysknives, scrolls
of scare monster?) to go through their special handling unless it's part of
normally dropping to the floor.  Tipping a bag of tricks behaves the same
as applying it (one monster is released, and it only becomes empty if
that happened to be the last charge) and items tipped out of a cursed bag
of holding have their normal cursed bag chance (1/13) of being destroyed.
Tipping an inventory container while levitating or during unskilled riding
behaves similar to normal drop--from a height, so some fragile items break.

     Players have wanted this feature to get gray stones out of chests or
heavy corpses out of ice boxes but I didn't care much about that; losing
access to your bag is more significant.  I'm pretty sure that there was a
user patch to do something like this floating around at one time, but I
couldn't find it when I looked, so I implemented #tip totally from scratch.

     Bug?  Extended commands which lack meta-key shortcuts are not listed
in the help files displayed by the '?' command....
2003-04-03 10:56:46 +00:00
nethack.allison
176d31c980 buried punishment ball
Prevent burying a ball from ending your punishment.

When you bury the ball, internally NetHack Punishment
ceases, but a new trap type of TT_BURIEDBALL  immediately
kicks in (acting similar to TT_INFLOOR in some ways).
You can eventually work the ball free (or teleport, etc.),
but that will just return you back to normal Punishment.
2003-03-11 03:40:17 +00:00
nethack.allison
5425e818a3 win32tty prototype followup 2003-03-09 15:58:47 +00:00
nethack.allison
78ce3749dc win32tty keystroke handling
- Move the code for keystroke handling into its own source file.
- Compile and link it as a dynamic link library.
- Dynamically load the keystroke handler at runtime
- Add support for specifying a different handler in defaults.nh
  so that internationalization issues can be dealt with without
  rebuilding nethack, just supply alternative handlers in HACKDIR.

The following exported functions need to be present in
the keystroke handler .dll:
ProcessKeystroke - returns an ascii value to NetHack
NHkbhit  - allows peeking to see if a key/mouse press is waiting
SourceWhere - returns location for souce code for a keystroke handler
SourceAuthor  - returns author information for a keystroke handler
KeyHandlerName  - returns the full or short name of the keystroke handling dll.
2003-03-09 15:44:50 +00:00
nethack.allison
5122409416 Several things that break savefile compatibility
- Version change from 3.4.x
- timed_delay feature ignore in makedefs
- several flags from iflags to flags
- use offsets from mons array entries in save file rather than storing
  the ptr and calculating the distance from beginning of array
2003-03-05 04:39:47 +00:00
jwalz
1d488f4762 Allow use of old compiler. 2003-02-18 22:31:12 +00:00
nethack.rankin
02d9ab252d fix B18007 - travel cmd forces extra keystroke
I don't know whether there were any other odd situations besides moving
onto known traps being caused by the out of date value in flags.run; several
places do check to see whether it's 8.
2003-02-07 10:04:27 +00:00
nethack.allison
2eeb979497 port-specific debug-mode command
Provide a way to have a port-specific debug-mode commands
if PORT_DEBUG is defined at build time.

Add a win32 keystroke checking routine to assist debugging
of international keyboards.

Fix a problem with the way NetHack was handling
international keyboards by letting ToAscii() come
up with an input character based on the virtual key,
and the shift and caps lock state.
2003-02-06 03:07:43 +00:00
nethack.allison
d1c2a37deb fix buglist entry: menu upon request
For "traditional" menu style, pickup and #loot/apply can't accept an 'm'
response to bring up a menu upon request when all items involved are of
the same class, because the prompt where that response is allowed only
gets issued when multiple classes are present.
2003-01-11 17:22:58 +00:00
nethack.rankin
ea400a778d some lint cleanup
Building with an old version of gcc with various warnings enabled
generated a lot of noise.  Most of it was due to not guarding string
literals with `const', but there were a couple of actual problems too.
2003-01-09 09:18:14 +00:00
nethack.allison
06812e0ce7 adornment
<email deleted> on Saturday, January 4, 2003 at 12:16:29
comments: I just noticed that, while wearing a -1 ring of adornment, a potion
of enlightenment gave the intrinsic "You are adorned."  Shouldn't it be more
accurately, "You are unadorned." or something similar?
2003-01-04 22:12:55 +00:00
nethack.allison
ec3b1bf40e revert B14005 cmdassist font fix 2003-01-02 04:00:46 +00:00
nethack.allison
da912b0780 B14005 cmdassist font
<Someone> wrote:
	I happened to be playing under X11 for a change this weekend, and I
	noticed that, since the direction help of cmdassist uses (sort of)
	ASCII art, it looks rather peculiar in a proportional font. Could it
	be made to use the menu font instead?
2003-01-02 03:07:46 +00:00
nethack.allison
abd3df2871 get_adjacent_loc()
use get_adjacent_loc() rather than getdir() directly for some things where
you want to ensure valid adjacent coordinates are returned

<email deleted> wrote:
>>> [...]
>>> I've noticed that the loot adjacent spot code doesn't have any
>>> isok(x,y) test, so will risk crashing if used at the edge of
>>> the screen (whether deliberately, or accidentally due to being
>>> confused or stunned when picking the direction).

>> Would this not be a problem elsewhere, such as use_leash() too?

> Yes, that looks like the same risk. getdir() doesn't validate
> that the <u.ux+u.dx, u.uy,u.dy> is safe and neither does m_at(),
> so their callers need to.
>
> I did manage to provoke a crash with #loot on the plane of earth,
> although an accidental case would be a lot less likely to happen.
2002-11-17 18:43:45 +00:00
cohrs
75f0c5db52 more cmdassist
Add the patch I suggested last week to show cmdassist help for the
various prefix commands.
2002-10-27 16:36:30 +00:00
nethack.rankin
31259d35c9 wizard mode mapping
Override confusion and hallucination when revealing the map with
<ctrl/F> in wizard mode.  This also renames the `#poly' extended command
to `#polyself' and adds several one-line comments.
2002-10-21 08:57:39 +00:00
cohrs
db73f34150 debug commands: lightsources and monpolycontrol
Given no objections to Pat's suggestion, putting back in the change to make
the newest debug commands consistent with the others, removing the space
from the former and the underscore from the latter.
2002-10-14 00:20:38 +00:00
cohrs
096ac17d8c back out accidental mod
In my previous patch, I accidentally included a change to wizard mode
commands I had not indented to apply at this time.
2002-10-10 21:16:33 +00:00
cohrs
84e3c1aac9 B13002 - negative protection
implement Michael's suggestion to tweak the protection message when your
protection is negative.
2002-10-10 21:13:05 +00:00
nethack.rankin
ce4bfb6a1a fix B12005 - polyself and gender
The ^X attributes were always showing "neuter" when polymorphed
into a non-humanoid creature.  This fix also suppresses the extra
"gender (base)" entry when that has the same value as the preceding
"gender" entry, it eliminates the redundant label "deity" from the
three entries in the deities section, and it capitalizes the alignment
names that nethack uses as proper nouns.

     This patch also introduces the capability of skipping the second
screen of enlightenment attributes (given for explore and wizard modes)
by terminating the first screen with ESC (or however else menus can be
explicitly cancelled for any given interface).  That has no noticeable
effect during normal play.
2002-09-21 07:17:14 +00:00
nethack.rankin
069703f6c3 enlightenment refinement for increased damage
The recent change to include increased damage and increased
chance to hit in all enlightenment feedback instead of just at end
of game feels too specific compared to most of the other feedback.
Instead of giving exact plus/minus values, give a generalized
categorization of the amount.  The exact value is given at game end
as in existing 3.4.0 behavior, and also given when in wizard mode.
2002-09-07 02:36:02 +00:00
nethack.rankin
c33417fc05 B10002 - enlightenment grammar bug
>       In my final attributes;
>       "You had +1 bonus to hit."
>       Surely "You had a ..." ?

Also moves the hit and damage bonus feedback from the "troubles"
section to the "physical attributes" section and delivers it for
every enlightenment rather than just after the game is over.
2002-09-01 09:56:55 +00:00
nethack.allison
fc319a4be0 string constants
<Someone> wrote:
> Linux, Redhat 7.1 nethack 3.4.0
>
>Please see attached patch file.
>
>I'm attempting to move more stuff into the "read-only" area, in
>preparation for a port to another OS.
2002-08-20 08:05:20 +00:00
nethack.allison
b0632cc637 add full suite of directions to cmdassist 2002-08-19 01:59:28 +00:00
nethack.rankin
c19ba37192 enlightenment bit 2002-08-14 06:51:01 +00:00
nethack.allison
8386f680a6 cmdassist follow-up bit 2002-08-04 23:34:10 +00:00
nethack.allison
4fd1cc98a9 Generalize cmdassist direction help
to work with any call to getdir().
When cmdassist is set, instead of the
message:
"What a strange direction!"
you get a screen of help showing the valid direction keys.

!cmdassist will suppress the extra help information.
2002-08-04 22:14:02 +00:00
nethack.allison
8631cba725 newbie in-game assistance with Guidebook notation
Provide some command assistance for newbies, but
suppress it with !cmdassist in the config file.

If someone misinterprets the Guidebook ^D, ^T
type command notation, this will pop up some
further information to possibly assist them and
explain the notation.
2002-08-04 16:48:15 +00:00
nethack.allison
a849315988 no message 2002-07-29 17:57:57 +00:00
nethack.allison
46721b5a91 flag changes
Several flags added since 3.4.0 were destined for flags
(to be saved with the game) but were placed in iflags for
savefile compatibility.  These include:
 boolean  lootabc;	/* use "a/b/c" rather than "o/i/b" when looting */
 boolean  showrace;	/* show hero glyph by race rather than by role */
 boolean  travelcmd;	/* allow travel command */
 int	 runmode;	/* update screen display during run moves */

This patch has no effect unless you define this in your port's
XXconf.h file.
#define SAVEFILE_340_CONVERT	/* allow moving of some iflags fields to flags
					without destroying savefile compatibility */
Without it, the new flags remain in "iflags."  With it, the flags are moved to
"flags" and the structures are converted when the save file is read. There
is no reverse compatibility.  If you save the game after conversion, you
can't load the savefile on 3.4.0, only 3.4.1.
2002-07-28 16:03:00 +00:00
cohrs
fbd986d031 final attributes say riding when you die while dismounting
Reported to the mailing list on 5/23.  To fix this, u.usteed cannot simply
be unset earlier, so I put a check for this special case into enlightenment().
2002-06-30 07:11:26 +00:00
nethack.rankin
174dbea372 #levelchange fix
Using #levelchange to reduce experience level would put nethack
into an infinite loop if the character had life-drain resistance.
2002-06-24 10:30:23 +00:00
cohrs
5bc5910ed8 compilation bits
- remove an unused variable in use_pick_axe2
- wiz_debug_cmd needs to return an int like other extended commands
2002-04-21 17:43:17 +00:00
nethack.allison
a277db8f73 debug-mode extended cmd - panic
Add a debug-mode extended command #panic to call
panic().  Useful for testing panic-savefile generation.
2002-04-21 13:51:10 +00:00
cohrs
1b321e92bc remove prescient travel command behavior
Addresses reports R718, R772.1, <Someone> P's extra move bug
- when there is a previously seen path or a straight path, always take it
- incorporate fix to ensure no extra "." turn at the end of traveling, but
 still avoid stepping into traps/pools, et al
- include a general "G"-command (and travel) fix to avoid stepping in
 known pools/lava while blind
- when there is no such path, "guess" at a path by finding an intermediate
 location that the hero couldsee that is closest to the actual goal, the
 intermediate goal is re-determined at each step
- when Blind, don't use couldsee for determining straight paths, just direction
- do not consider doors or most boulders obstacles for picking travel
 paths, test_move has a new mode to differentiate this case from the regular
 test case
- don't include known trap locations in the travel path, avoids unnecessary
 stops along the way, and usually doesn't affect the path length
- reformatted the code a bit so I could follow it
2002-04-13 16:00:13 +00:00
nethack.allison
69ee06a9bc Two new options
Add "travel" boolean option to enable/disable travel command.
Add "mouse_support" wincap option to enable/disable mouse.

- When running the win32 tty version full-screen, some people
complained about the square mouse cursor.

Newsgroups: rec.games.roguelike.nethack
Subject: Re: Getting rid of the cursor?
<email deleted> <email deleted>
Followup-To:

On Thu, 04 Apr 2002 00:20:06 <email deleted> wrote:
> Ok, let me be more specific: when playing the windows non-GUI version, is
> there a way to get rid of the large rectangular white cursor?
>
> <email deleted> wrote in message
> <email deleted>
>> Can you get rid of the cursor in the windows version?  I really hate that
>> thing.
>>

<email deleted>
>Newsgroups: rec.games.roguelike.nethack
>Subject: Disabling Mouse Input
>
>I purchased an older P120 laptop to be able to play Nethack at the hotel.
>I find that I rest my thumbs on the mouse touch pad all too often and my
>@ moves unexpectedly at times. I took a peruse through defaults.nh, but
>came up empty.
>
>Anyone know if mouse input can be disabled?
>
>MRSisson
2002-04-04 03:45:03 +00:00
jwalz
e833424555 Make pre-ANSI compiler happy. 2002-03-09 01:59:47 +00:00
nethack.rankin
4bc3561a96 from <Someone>: #rub touchstone
<Someone>'s message said this was committed, but the cvs repository
didn't reflect his changes.

> Subject: patch: #rub touchstone
> Date: Wed, 20 Feb 2002 23:33:27 -0800
> <email deleted>
>
> Implement <Someone>'s suggestion.
>
> - allow the #rub command to apply to gray stones
> - update various doc & help files to reflect the change
>
> Committed to CVS.
2002-02-24 03:19:20 +00:00
nethack.allison
3d9c97c576 menu tab tuning 2002-02-13 00:34:35 +00:00
nethack.allison
06528d1002 3.3.2 to 3.4.0 2002-02-04 16:06:00 +00:00
arromdee
af6a8574e0 minor things
Two unrelated tids.  I wouldn't bother putting them into Beta 1. :-)
2002-01-23 01:41:53 +00:00
nethack.rankin
6d28ddf14b wiz_level_change cleanup
The new routine needed to do something with u.ulevelmax
(which controls whether lost levels can be regained via magic).
This sets it to the new level rather than having it go up or
down the same amount as the user specified in the level change,
which yields a plausible reason for using this command to set
experience level explicitly to its current value.

     The new code was using a mixture of spaces and tabs for
indentation; I've totally reformatted it.
2002-01-19 04:15:46 +00:00
arromdee
9211e211b0 wizard # list
The monpoly_control command on the wizard # command list was formatted badly.
2002-01-19 03:17:31 +00:00
arromdee
89d9f36f06 fix typo (change experience change)
--Ken A
2002-01-19 01:30:26 +00:00
arromdee
d2050e48e5 levelchange
This changes the #levelgain command to #levelchange, and allows changing
levels both up and down.

--Ken A.
2002-01-18 01:09:28 +00:00
arromdee
f93521e95d wizard #poly and #levelgain
This adds the wizard #poly and #levelgain commands.
2002-01-17 02:47:23 +00:00
arromdee
6bfebccbed This adds <Someone> patch for enlightenment to show increase damage and
accuracy (only on death).  It's one of the 'insufficient discussion' patches,
but I doubt anyone will object to it.
2002-01-15 03:26:09 +00:00
arromdee
d5d7f15007 Fix some steed/wounded legs things. Also add a wizard-only enlightenment
message specifying that the steed has wounded legs.
2002-01-12 05:37:33 +00:00
kmhugo
46bd9b925c * Fix some formatting in cmd.c. 2002-01-10 06:49:35 +00:00