Commit Graph

2187 Commits

Author SHA1 Message Date
cohrs
fc40ccd7d2 random numbers on linux
Switch the default Linux build behavior to use random instead of lrand48,
since lrand48 exhibits some obviously non-random behavior.  random() has
been in glibc for a long time.  Even if no other changes are made to
nethack's random number generator, this will improve the Linux behavior.
2003-06-30 04:18:29 +00:00
cohrs
b633b91875 SF patch 536615: travel cache
This is derived from the proposed patch and feedback to it.  This applies
the last-position cache behavior without an option, making the behavior
more like it is for interfaces with a mouse, where holding the mouse still
acts the same way as the travel cache.  The code is not #ifdef'd either.
2003-06-30 04:00:14 +00:00
nethack.allison
cec8e1ee31 clicklook (main trunk only)
This allows the use of the right mouse button to
look at things on the screen when the
'clicklook' option is set.

Concept came from a patch for 3.4.0
that I saw referenced on r.g.r.n
[see http://www.steelskies.com/nethack.php]
but the implementation is different.
2003-06-30 02:09:04 +00:00
cohrs
00addd7eea SF patch 414711: stethoscope fix
Incorporate the submitted stethoscope fix.
2003-06-30 01:54:23 +00:00
cohrs
21b26e867d shopkeeper geography
From: <Someone>
I dunno if this is relevant  but "Gomel" is actually not in Ukraine but in
Belarus. I am pretty sure because I have been there.
2003-06-26 00:53:10 +00:00
cohrs
71fbc01113 U510: yet another update_inventory call
When armor becomes ungreased, update_inventory to reflect the change.
2003-06-19 02:26:49 +00:00
nethack.allison
45460e3f9a more DOS gcc makefile 2003-06-15 15:56:03 +00:00
nethack.allison
abe2701a1c DOS gcc makefile fix 2003-06-15 15:23:13 +00:00
nethack.rankin
5a88f420d5 comment tidbit
Fix a misspelling pointed out by <Someone> some time back.
2003-06-14 06:58:11 +00:00
nethack.allison
93ab03cc80 djgpp build instructions
Explicitly mention fil41b.zip as a required djgpp component.
Oddly, some people only pick up part of djgpp, then
complain to us when the Makefile doesn't run as
planned.
2003-06-13 19:57:22 +00:00
cohrs
a686589b1f guidebook building command
I found that the setting of GUIDECMD sys/unix/Makefile.doc didn't cut
it with groff-1.18.  Also, the command was duplicated in the rule to
generate Guidebook.txt.
2003-06-12 05:16:20 +00:00
cohrs
90c03c2f0a corpses on ice use of obj recharged field
A while back, I noticed that there was a custom use of the obj->recharged
flag in mkobj.c for tracking corpses on ice.  It's much more obvious for
those of us that don't have the entire source base memorized to follow the
usual convention of adding a #define to obj.h.  That's what this change does.
2003-06-12 04:49:09 +00:00
cohrs
2a3e8c9fc4 webbing over stairs
Due to limitations in some interface's display capabilities, don't let
polymorphed players web over stairs or ladders.  As a side effect, this
side-steps missing checks for webs when going up or down stairs and ladders.
2003-06-12 03:32:58 +00:00
nethack.allison
8105adfae5 Long ago we received a bug report complaining that
hilite_pet on Win32 (tty) wasn't respecting
the setting of "use_inverse" (plain "inverse" at the
time I think).

In response, we made it respect the setting.  The
"use_inverse" setting is off by default however,
so we've now had about three complaints about
hilite_pet not working.

So I'm changing the default value for win32 tty
to having "use_inverse" set to TRUE.
They can still override it in the config file
that way.
2003-06-12 03:28:39 +00:00
cohrs
ecd72571fd Guidebook.txt sync
note that trunk and 3.4.2 guidebooks are different.
2003-06-08 20:02:54 +00:00
cohrs
42d336aa94 U393 - jousting puddings into a polymorph trap caused 2 identical new monsters
Because hmon_hitmon caches the monster data type, it needs to update this
whenever the monster might polymorph.  It already did this for potions, but
not for jousting.  There are other more complex ways this could be addressed.
2003-06-08 19:36:45 +00:00
nethack.allison
feccae0b74 config file samples
Make config file samples behave as they always have
2003-06-08 18:45:23 +00:00
nethack.allison
32d71e5993 interactive number_pad handling
Make the interactive display and handling of number_pad
from the 'O' menu a little more friendly.
2003-06-08 18:33:13 +00:00
cohrs
ec13f16ff7 U393 - unix hangups in endgame
Unix code does not always go thru hangup() when EOF is encountered.
There is a similar end_of_input() that is sometimes called instead, which
was missing a test of program_state.something_worth_saving.
2003-06-08 18:31:57 +00:00
cohrs
e33b62192c U338 - dismounting into known traps
When dismounting by choice and not impaired, the player could end up in a
known trap even if better positions were available.  This change allows
the landing spot to prefer non-traps in these cases.
2003-06-08 17:51:57 +00:00
nethack.allison
083efbb630 font_size descriptions
In May 2002, <Someone> wrote:
>In src/options.c, there are these options with their descriptions:
>
>#####################
>{ "font_size_map", "the size of the map font", 20, DISP_IN_GAME },
>            /*WC*/
>{ "font_size_menu", "the size of the map font", 20, DISP_IN_GAME
>            }, /*WC*/
>{ "font_size_message", "the size of the map font", 20,
>            DISP_IN_GAME }, /*WC*/
>{ "font_size_status", "the size of the map font", 20, DISP_IN_GAME
>            }, /*WC*/
>{ "font_size_text", "the size of the map font", 20, DISP_IN_GAME
>            }, /*WC*/ #####################
>
>Surely all those descriptions shouldn't be the same?
2003-06-08 00:22:28 +00:00
nethack.allison
d3fc89f25d U486 follow-up
>>+ #define OPENFAILURE(fd) (fd < 0)
>>+ # endif
>>      lockptr = 0;
>>!     while (retryct-- && OPENFAILURE(lockptr)) {>nhversion: 3.4.1
>And now this is accepted as valid and nothing is opened...

Oops, thanks Janet.
2003-06-07 17:18:28 +00:00
nethack.allison
ff8744798d fix for U486: Can't get Nethack 3.4.1 to work
>nhversion: 3.4.1
>
> nhfrom: 3.4.1 Official binary release for Windows 95/98/NT/2000/Me/XP
> (nh341win.zip)
> comments: Whenever I run NethackW.exe, the nethack window
> appears, and does not run anything.  When I close out of the
> program, I get this message:
> Waiting for access to C:\GAMES\NETHACK341\record.  (X  retries left).  > The X seems to  always be either 9 or 59.  I don't know how to fix this > > problem, any help would  be greatly appreciated

<Someone> writes:
>win32 open() returns -1 if failed - same as POSIX open().
> There is no STDIN in GUI applications so 0 is a valid return
> value from open().
> So it should read like that unless that breaks Amiga code:

Since I can't test the Amiga code, I added a macro
OPENFAILURE to keep the Amiga code the same as it
is now.  It should probably be reviewed by someone on
the Amiga team to verify if open() on the Amiga returns
0 or -1 on failure.  If the latter, the macro could be
removed completely.
2003-06-07 13:16:40 +00:00
nethack.allison
a67ed775cb number_pad (modified from <Someone>'s patch)
The number_pad option can now optionally hold a value
{0,1, 2 } for {off, on, DOS-mode} but plain number_pad and
!number_pad in config files still work as before.

When number_pad:2 is set, iflags.num_pad_mode is set to 1
which triggers the following behaviour:
> '5', M('5') and M('0') are mapped in rhack()
>in cmd.c, only when they are entered as a command. When used as a
>number, like in the 'n' command, no mapping takes place. '0' is
>already mapped to 'i' by the core. The
>only difference [<Someone>] left in (deliberately) is when you press Ctrl-0;
>this used to map to C('i'), which is an invalid command; now
>keep it '0' (which is interpreted as 'i' by the core.)
2003-06-06 03:49:56 +00:00
nethack.allison
3a31710a6c win32gui (from <Someone>)
[main trunk only]
Fixes incorrect registry entries for inventory window position.
2003-06-06 01:56:34 +00:00
nethack.allison
a091428423 win32 (from Yitzhak)
>The attached is a patch for the makefiles and .rc that makes
>Borland compile. Files modified: sys/winnt/Makefile.bcc - changes
>Makefile so dependencies on dlls are removed for console, adds
>gamedir.tag sys/winnt/Makefile.msc - changes the Makefile a bit to
>make it dependent on gamedir.tag in both gui and console, and make
>the dlls a dependency only in console but without the !IF for
>$(GAMEFILE). The .rc format is made workable for both Borland and
>MSC. win/win32/winhack.rc - makes FONT format Borland compatible
2003-06-03 10:09:07 +00:00
nethack.rankin
974bab3a32 fix B03007 - monster gender handling + level follower tuning
Fix the reported problem of combat messages referring to Orcus as
"it" when the data.base entry uses "he"; extend use of gender-specific
pronouns to named and other unique monsters as well as to humanoids.
If any of those should stay as "it", they'll need to be M2_NEUTERed....

     And prevent level followers from chasing you across levels if they
are fleeing at the time.  It's an old change I've been sitting on which
is not related but happens to be right next to the pronoun code.
2003-06-02 08:05:41 +00:00
nethack.allison
70b0a44a80 look vs pickup
I encountered a look vs pickup cockatrice corpse
bug today.

If you looked at a location with ':', you
would instantly get
"Touching the cockatrice corpse is a fatal mistake..."
but if you used "m," you got the full list of
things at the location to choose from.

This patch makes the behaviour consistent
and more informative to the player.
You now get the partial list of things felt
up until the cockatrice corpse is encountered,
and then you get the
"Touching the cockatrice corpse is a fatal mistake..."

Before, the code was never displaying the partially
built list because the feel_cockatrice() call was
happening before the window display call.
2003-06-01 17:42:49 +00:00
nethack.allison
f65a13cfbe look vs pickup
I encountered a look vs pickup cockatrice corpse
bug today.

If you looked at a location with ':', you
would instantly get
"Touching the cockatrice corpse is a fatal mistake..."
but if you used "m," you got the full list of
things at the location to choose from.

This patch makes the behaviour consistent
and more informative to the player.
You now get the partial list of things felt
up until the cockatrice corpse is encountered,
and then you get the
"Touching the cockatrice corpse is a fatal mistake..."

Before, the code was never displaying the partially
built list because the feel_cockatrice() call was
happening before the window display call.
2003-06-01 15:54:41 +00:00
nethack.rankin
bc2215268b random level teleport fix
From the newsgroup:  prevent monsters from level teleporting out of
the quest into the main dungeon.  The player can't do that and monsters
weren't supposed to be able to, but from time to time the quest nemesis
has seemingly vanished after reading a cursed scroll of teleportation.
His disappearance was due to ending up on a random level between the
quest entrance and the top of the dungeon.

     This also fixes an obscure bug that I noticed while trying to
reproduce that problem:  uncontrolled level teleports by the player in
the quest had 80% or thereabouts chance of ending up on the quest home
level.  All 12-15 main dungeon levels above quest entrance were included
in the random range of 1 thru current+3, then any choice which tried to
pick one of those was converted to quest level 1.  (Monster destination
wasn't getting that adjustment.)
2003-06-01 14:52:04 +00:00
nethack.allison
1add9289c0 quiet warning
A recent patch triggered a warning about signed/unsigned mismatch in
an assignment.
2003-06-01 14:19:16 +00:00
nethack.rankin
678e05096d some lint cleanup
Mostly `gcc -Wwrite-strings' complaining about passing string
literals to safe_qbuf().  `gcc -Wformat' didn't catch the type mismatch
of formatting the return value of strlen() with %d, presumeably because
size_t is defined as unsigned int on this system and it treats int and
unsigned int as interchangeable as far as printf/scanf checking goes.

     I'm not sure whether the sizeof() values being passed to safe_qbuf()
ought to have casts.  Any system where size_t isn't the same width as
unsigned int is bound to support prototypes, but might possibly warn about
the implicit conversion of unsigned long (or even unsigned long long these
days) to unsigned int.
2003-05-31 07:14:21 +00:00
jwalz
c845548c36 Make enhanced ammo last longer.
Since traps can no longer provide an infinite supply, and people were
complaining that they always ran out of ammo before, make it less likely
to break enchanted and blessed ammo, and more likely to break eroded
ones.
2003-05-28 21:54:37 +00:00
jwalz
be7e8373f4 That one $(LD) needs to be an $(LD). $(CC) will link in the non-shared
C library and cause problems with address space for something NetHack's
size.
2003-05-28 17:33:54 +00:00
warwick
47bbe26073 Unify usage of $(CC) vs. $(LD) for linking to always $(LINK), set
to $(CC) by default.
Necessary for C++ builds where the C++ compiler driver must be used
to link, adding libraries that the C compiler driver does not know
about.
2003-05-28 05:36:57 +00:00
nethack.rankin
ad243c0286 cmdassist bits
If the player gives the 'T' command while not wearing any armor,
don't suggest "use 'R' to remove accessories" unless the character is
actually wearing accessories.  Likewise for 'R' while not wearing any
accessories, don't suggest "use 'T' to take off armor" unless wearing
some.

     Add missing amulet case to the silly_thing() handling for 'W' and
'T'.  Also handle boots, gloves, and lenses as plural in the message
there.  silly_thing() has been simplified a little bit in the process.
2003-05-26 17:34:28 +00:00
nethack.allison
253a9d388b win32gui: prevent male valkyrie (from <Someone>)
>Steps to reproduce problem:
>1) make sure you don't have race, role, gender specified in your
>   defaults.h, then add
>   OPTIONS=role:Valkyrie,race:Human,gender:male,align:lawful
>2) start a new nethackw.exe game
>3) Uncheck "Random" from gender box, now you can select from male
>   or female, not only female.
>4) Select male and click OK.
>5) When game begins press shift+O (Options) and look to gender.
>   Your valkyrie is male.

defaults.nh values were not used the dialog initialization. That's
why both male/female options were available for Valkyries. This is
now fixed.

Also added: checking for consistency of the initial settings and
resetting all incompatible values to ROLE_NONE.
2003-05-26 09:58:15 +00:00
cohrs
f61e3ceefe another grammar bit
My e-mail archive shows this was originally reported as one of several
items in R871.  Clean up a hit message when wielding cream pies.
2003-05-25 23:21:20 +00:00
nethack.allison
01120453f2 Fix B03001
"You can't loot or pick up containers on the floor if you're not
skilled enough to reach them from your saddle, but you can check
for and disarm traps on them; this seems a little odd. (Likewise,
being able to set land mines and beartraps while riding.)"
2003-05-25 22:47:12 +00:00
cohrs
1f712ac626 U303 - starting the game as a male valkyrie
A core fixup if the the port startup code sets an invalid flags.female when
starting a new game.  The old comment regarding being unable to change
flags.female was not completely correct.  The flags.pantheon can be used to
differenciate new games from a restored game.
2003-05-25 20:28:41 +00:00
cohrs
702c373619 untested FreeBSD compilation fix
this particular fix has been sitting around my inbox for a while although
we've had reports of FreeBSD build problems for a long time.  While it's
untested, it certainly looks like the unfixed system.h had a case that
could not be reached.  bsdi seems like it needs to be handled the same way.
2003-05-25 19:03:55 +00:00
cohrs
8fcb235336 golem statue vs stone-to-flesh
move the fixes entry for this from 35.0 to 34.2 since the fix got
inserted into the 3.4.2 source and is not detrimental to the branch.
2003-05-25 17:40:51 +00:00
cohrs
b115b536c1 B03005 - canceling monster redux
Revert the code, but add a comment. The behavior is not obvious to everyone.
2003-05-25 17:21:21 +00:00
cohrs
dde1a1ceec B03006 - Searching trapped chests
When attempting to disarm a trapped chest, wisdom should only be exercised
when not confused.  It stands to reason that even if you manage to find a
trap in a confused/hallucinating state, wisdom shouldn't be exercised.
2003-05-25 05:04:11 +00:00
cohrs
1d2b62de95 B03005 - Canceling monsters
Since monster cancellation sticks, it doesn't makes sense for Magicbane to
cancel a monster more than once.  Tweaked the messages to deal with this fact.
I decided to not make Magicbane's random effect "intelligent", which is what
changing it to use some other attack against a canceled monster would be.
2003-05-25 03:47:31 +00:00
cohrs
dce0e0cb33 use Is_box
While inspecting some code, I noticed that detect.c wasn't using Is_box in
some places it should have been.
2003-05-25 02:35:16 +00:00
nethack.rankin
9a39064b8f more perm_invent handling
Keep permanent inventory window up to date when using charged items.
Also a status line bit for the #tip command.
2003-05-24 04:07:14 +00:00
cohrs
aace75a34d B03004 - candelabrum in bones file
curse the candelabrum, like other similar artifacts
2003-05-24 01:59:11 +00:00
cohrs
4b22aa7bff sitting in lava and other utraptype sit messages
Several cases in the trap block of code in dosit() were caused by utraptype
being set to values not corresponding to an actual trap.  <Someone>
reported back in 12/02 that the "sitting in lava" killer message could not
occur, but the special-case sit messages for TT_INFLOOR and TT_BURIEDBALL
couldn't occur either.
2003-05-23 02:47:45 +00:00
cohrs
73fa09fac7 class genocide by species name
Incorporate a mod submitted by <Someone> to implement the TODO in the
class genocide code by walking thru the species to find a class to genocide
if the user input does not match the class description.
2003-05-23 02:47:42 +00:00