Commit Graph

357 Commits

Author SHA1 Message Date
cohrs
559be58c21 conflicting delayed killers
Introduce a new set of functions to manage delayed killers in the trunk, used
in addressing the various reports of delayed killer confusion.  Since existing
delayed killers are related to player properties, the delayed killers are
keyed by uprop indexes.  I did this to avoid adding yet another set of
similar identifiers.
- the new delayed_killer() is used for stoning, sliming, sickness, and
delayed self-genocide while polymorphed.  Some other timed events don't
use it (and didn't use the old delayed_killer variable) because they
use a fixed message when the timeout occurs.
- A new data structure, struct kinfo, is used to track both delayed and
immediate killers.  This encapsulates all the info involved with
identifying a killer.  The structure contains a buffer, which subsumes the
old killer_buf and several other buffers that didn't/couldn't use killer_buf.
- the killer list is saved and restored as part of the game state.
- the special case of usick_cause was removed and a delayed killer list
entry is now used in its place
- common code dealing with (un)sliming is moved to a new make_slimed function
- attempted to update all make dependencies for new end.c -> lev.h
dependency, sorry if I messed any up
2003-09-29 19:24:20 +00:00
kmhugo
e1f5ddd820 sound cleanup
+ Separate the two uses of flags.soundok.
+ Player-settable option is now called "acoustics".
+ Deafness is now handled as a full-fledged attribute.
+ Check for deafness in You_hear(), rather than caller.
+ Check for deafness in caller, rather than verbalize(),
  because gods can speak to characters in spite of deafness.
+ Since changes are being made to prop.h, reorder it to the
  same order as youprop.h and enlightenment.

There are still some extraneous checks and missing checks
for deafness, which will be followed up in a future patch.

Because of the size of this patch and its savefile incompatibilities,
it is only being applied to the trunk code.  Portions of this patch
were written by Michael Allison.
2003-09-28 03:42:50 +00:00
cohrs
929f9ce2c7 various tests of flaming monsters
This change adds a new flaming() macro and uses it in several places
where the list of flaming monsters was tested.  on_fire() didn't list
salamanders as already being on fire, but should have.  A couple other
cases were not updated to include flaming sphere.
2003-09-26 00:37:24 +00:00
cohrs
afea61ef57 U659 - "destroy" manes
Nethack's manes are based on AD&D manes which are in turn based on the
manes of Roman legend.  They are supposed to be spirits of the dead.
To that end, added them to the nonliving() macro.  The biggest behavioral
change is that death spells no longer effect them, which does technically
make them a bit tougher but also makes sense.  Also, they're so wimpy, it's
hard to believe anyone would use a death/disintegration on them anyway.
2003-09-24 01:29:54 +00:00
nethack.allison
92d59e2fe6 fix cvs macro 2003-09-21 13:34:52 +00:00
nethack.allison
dc9dee3e0d commit new file context.h 2003-09-21 13:32:36 +00:00
nethack.allison
74b834c774 trunk only: preserving context (include files)
Pat Rankin wrote:
> collect them all into some new struct and
> save that separately rather than jamming more non-option stuff
> into struct flags.

This patch:
- collects all context/tracking related fields from flags
  into a new structure called "context."
It also adds the following to the new structure:
- stethoscope turn support
- victual support
- tin support
2003-09-21 11:46:53 +00:00
nethack.allison
018123c007 SAFERHANGUP support for win32tty
win32gui support still needs to be developed.
2003-09-19 11:22:00 +00:00
cohrs
22fe9838f3 SAFERHANGUP support for win/Qt.
Now all the current Unix window-ports support it.
2003-09-19 04:08:37 +00:00
cohrs
d66bd647e6 more SAFERHANGUP
make "done_hup" volatile on platforms where this matters, since hangup()
now returns when it didn't used to.
2003-09-19 03:55:33 +00:00
cohrs
40b5b12673 SAFERHANGUP
This is an initial round of SAFERHANGUP hangup changes.  It introduces
SAFERHANGUP, provides the core framework, and enables it for UNIX.

Window-port changes are provided for win/tty, win/X11 and win/gnome.  Qt
changes should be forthcoming after having Warwick look at them.
window.doc is updated so windowport maintainers have an clue what needs to
be done to support SAFERHANGUP.
2003-09-19 03:15:49 +00:00
cohrs
5e443536d8 "your" artifacts
This patch introduces a change to yname() and Yname2() that avoids the
possessive "your" for the hero's normal, fully identified artifacts.
Quest artifacts still get the possessive, as do all other objects and all
objects not in the hero's possession.  shk_your()/Shk_Your() are used in
many places with a specific, generalized name for the object, so I didn't
introduce the artifact behavior there, although I did change them to append
a space, which simplified some other code.  Through added use of yname(),
there may be some places that used to just say "corpse" that will now be more
descriptive via yname()'s use of cxname().  I'm sure <Someone> will point
out any such places that are too onerous, although nothing obviously is.

I took the opportunity to inspect many uses of "your" and even Your().  Two
new functions are also introduced, yobjnam() and Yobjnam2(), which work
like aobjnam() and yname() combined, because I found that many uses of
aobjnam() were preceeded by "your" and I couldn't generally provide the
desired behavior for artifacts (or future artifacts) without a combined
function.  In some cases, this change allowed better sharing of code.

rust_dmg() still takes a string as input which is sometimes initialized
from xname() and often prepends "your" to it.  Currently, this isn't a
problem since there currently are no normal, armor artifacts.  If/when any
are introduced, rust_dmg() will need to be addressed.

The patch is for the trunk only.  A lot of research was required and I
didn't feel the upside was there for repeating it in the 3.4.3 branch.
2003-09-18 02:52:40 +00:00
warwick
9402d6dc54 Don't use regex by default - that way player can share/transport
their nethack.cnf between platforms bettery. Wildcards suffice anyway.
2003-09-16 03:45:58 +00:00
nethack.allison
5eff6601e9 avoid the_your[] duplication
get rid of a duplication of the_your[] strings (do.c, trap.c) by
moving it to c_common_strings.
2003-09-15 02:04:00 +00:00
nethack.allison
cc830fb311 buglist - full level triggers impossible() from migrating mons
<email deleted> wrote:
> If more monsters fall through a trap door than can fit on the
> level below, when you go down the stairs, you get the following
> message:
>  "Program in disorder - perhaps you'd better #quit.
>  rloc(): couldn't relocate monster"
> This message seems to appear once for every monster-too-many that
> fell through the hole. I originally found this while
> intentionally completely filling a level with black puddings
> (there was a trap door I didn't know about). I also confirmed it
> in a wiz-mode test using gremlins and water.

[confirmed: moveloop -> deferred_goto -> goto_level ->
 losedogs -> mon_arrive -> rloc -> impossible]

This patch:
- causes rloc() to return TRUE if successful,
  or FALSE if it wasn't.
- adds code to mon_arrive() in dog.c to deal with
  the failed rloc()
- allows the x,y parameters to mkcorpstat() to
  be 0,0 in order to trigger random placement of the
  corpse on the level
- if you define DEBUG_MIGRATING_MONS when you build cmd.c
  then you'll have a debug-mode command #migratemons to
  store the number of random monsters that you specify
  on the migrating monsters chain.
2003-09-13 05:30:43 +00:00
nethack.allison
b7a64afdd7 U638 Juiblex's "moat"
> NetHack feedback form submitted by
> <email deleted>
> on Tuesday, September 9, 2003 at 06:41:34
> Hi, Just thought I'd point out a sort of inappropriate word
> choice or typo that I came across in Juiblex's Swamp. I got this
> message, after pushing a boulder into the swamp: There is a large
> splash as the boulder falls into the moat. Obviously it's a swamp
> and not a moat so that sounds a bit wrong. It says the same sort
> of thing when I #dip a scroll in the swamp as well.
2003-09-10 01:16:23 +00:00
nethack.allison
89551f2157 missing band
<Someone> pointed out that I didn't check in the
updated include/extern.h
2003-09-06 21:33:31 +00:00
nethack.allison
237a8fbce7 monster birth limits exceeded by bones load
Bones loading was only checking to see if a
monster was marked extinct, it wasn't adding
up the born count of a species in the current
game with the number of that species on the
bones level being loaded. That made it possible
to exceed the correct number of nazgul and
erinys via bones.

This adds a common routine called propagate()
that makemon() and restmonchn(ghostly) share,
for incrementing the born count and checking for
extinction, etc.

When a bones level is loaded, restmonchn()
will flag an illegal monster (duplicated unique,
or too many of a species) by setting the
individual monster's mhpmax to the cookie
value DEFUNCT_MONSTER. Before getbones() finishes
loading the bones level, it will purge those
monsters from the chain.
2003-09-05 20:39:35 +00:00
nethack.allison
416412f92b Remove vestiges of old overlay source split
[trunk only]
2003-09-05 02:45:18 +00:00
kmhugo
48d826b907 Mac Terminal port tuneup
Submit the last of the changes that were needed to compile the
MacOS X Terminal port.
2003-09-02 16:06:53 +00:00
kmhugo
96c3043690 Unix on MacOSX tidbit
This old conditional was targeted for Apple compilers in a Unix
environment (probably A/UX, which hasn't been sold in over 10
years).  It now interferes with installations under MacOS X.
2003-09-01 02:23:50 +00:00
kmhugo
1282e5c623 Synch recent 3.4.2 changes to main trunk
This is merely a synchronization of recent changes for the
Macintosh Carbon port, which were committed to the 3.4.2
branch, to the main trunk.
2003-08-30 00:45:58 +00:00
jwalz
2ea07652d8 lint removal -- nothing of import 2003-08-29 17:23:19 +00:00
kmhugo
6c70ec2799 Mac port prefix files
Support compilation of multiple flavors for the Macintosh:
1.  A Carbon port, text only and backwards-compatible with
    older versions of the MacOS.
2.  A termcap/Unix port for MacOS X only.
3.  A Qt port, tiled and MacOS X only.

The flavor can be selected at compile-time by specifying the
appropriate prefix file for the compiler.
2003-08-26 00:19:58 +00:00
nethack.allison
48ab2a434c guardian corpse, statue animation follow-up
- fix ring of protection from shape changers causing
  real monster to be created.
- add ability to get the character class monster from
  genus() or the species.
- use the character class monster when animating
  guardian corpses.
2003-08-19 14:41:54 +00:00
nethack.allison
3372f5d694 wishing for quest guardian corpse
wishing for quest guardian corpse now gives
a generic corpse of the species
2003-08-19 04:06:34 +00:00
nethack.allison
82e8dd3247 wizmode level teleport via menu
If you answer '?' to the level teleport prompt
in debug mode, you get a menu to choose
from, similar to the control-O print_dungeon
display.
2003-08-17 19:10:52 +00:00
nethack.allison
5e94d4478b wraptext port option (from <Someone>)
WC2_WRAPTEXT option was added but core changes
were not included  in the previous wince patch.
2003-08-14 11:04:33 +00:00
nethack.allison
1ac71854a3 buglist item (main trunk only)
> The lighting store doesn't sell oil (probably never added when
> POT_OIL was added). There currently isn't enough room in the
> shclass struct for another item, but that could be expanded. I
> think adding oil there would be useful for the post-3.4.x
> version.
2003-08-03 18:05:36 +00:00
nethack.allison
b85ff22c1f ce changes (from <Someone>)
The following files are gone (sys\wince):
- stat.h (moved to ceinc\sys\stat.h)
- fcntl.h (moved to ceinc\fcntl.h)
- errno.h (moved to ceinc\errno.h)
- assert.h (moved to ceinc\assert.h)

The following files were added:
- mhtxtbuf.c
- mhtxtbuf.h
- menubar.uu
- ceinc
- ceinc\sys
- ceinc\fcntl.h
- ceinc\errno.h
- ceinc\assert.h
- ceinc\sys\stat.h

CE notes:

Fixes:
- added new options "wraptext", "fullscreen" and "softkeyboard"
- CE341-1 fix ("wraptext" option)
- hide map scrollbars on Smartphone
- added View->Options menu
- PocketPC: added "Fit to screen" and "Show/Hide keypad" icons
  on the menu bar
- Smartphone: '<', '>' keys were mapped incorrectly
- build: use source files directly from <buildroot>\sys\wince instead of
  copying them to <buildroot>\wince\
2003-08-01 12:06:43 +00:00
cohrs
c954ee8a10 U555 - solaris compilation bits
- If you have Gnome installed on solaris, the GETRES support wouldn't build.
I don't have access to a solaris system with Gnome installed, but hacked
unixconf.h to force the GETRES code itself to be compiled.  So, I believe the
unixres.c change will work for folks really using Gnome on Solaris.
Whether the rest of the gnome code will build there is beyond me.
- I accidentally left TIMED_DELAY defined and the Solaris build failed.
While solaris has usleep(), this is not part of SVR4 as far as I can tell.
But, SysV does have poll, so I implemented msleep() for SysV systems in
terms of poll.  So, you can now define TIMED_DELAY on any SYSV build.
2003-07-30 23:19:56 +00:00
nethack.allison
ba5e9ef7ae build fix without TEXTCOLOR 2003-07-29 12:08:56 +00:00
nethack.allison
b750eee32a fix display problem with tabs on win32tty 2003-07-27 03:22:15 +00:00
nethack.allison
db4b55a6de typo fix in comment 2003-07-19 12:42:39 +00:00
nethack.allison
9608015ac8 new makemon() flag
add a flag to makemon() to allow monster to be created adjacent to the supplied  coordinates if there is already a monster at the target location
2003-07-19 12:24:32 +00:00
nethack.allison
99bcdf6a4e expand wincap options to second field
<Someone> wishes to add a couple of new options to the wince port ("run fullscreen" and "do not use CE software keyboard").

The wincap field was full, so this adds a second field for
additional options.
2003-07-17 01:35:31 +00:00
nethack.allison
8eb6614a56 fix B04004 "lead steed" into pit after landmine
<Someone> wrote:
	KAABLAMM!!!  You triggered [your|a] land mine!
	You lead the poor warhorse into a pit!
	Is "lead" really the right word here?
2003-07-12 16:59:32 +00:00
nethack.allison
b88e0a13ab fix B04005 and B04006
[B04003 and B04004 are still marked "Reported"]

<Someone>:
> You aren't very skilled at reaching from the saddled blue dragon.
> Continue your attempt to set the land mine? [yn] (n)
> You begin setting your land mine.
> There is the trigger of your mine in a pile of soil below you.
> KAABLAMM!!!  The air currents set your land mine off!
> I somehow suspect that it'd be more than the air currents, if I were
> trying to arm a land mine from dragonback while not very good at
> controlling it.

<Someone>:
> What do you want to use or apply? [cmu or ?*]
> You aren't very skilled at reaching from the saddled warhorse.
> Continue your attempt to set the land mine? [yn] (n)
> You begin setting your land mine.  You escape your land mine.
> Is "escape" really the right word here?
2003-07-12 14:55:44 +00:00
nethack.allison
08bbe34a9f suppress DOS djgpp build warning
gcc -c -O -I../include -DDLB -DUSE_TILES -oo/cmd.o ../src/cmd.c
../src/cmd.c: In function `rhack':
../src/cmd.c:1800: warning: case value out of range
../src/cmd.c:1801: warning: case value out of range
2003-07-08 00:30:40 +00:00
cohrs
362518c3ac BSD and POSIX
Finally got around to installing OpenBSD (rev 3.3) in a vmware partition.
Found that several #if BSD's were inappropriate for modern BSD's.  Haven't
installed FreeBSD or NetBSD, but based on reading their man pages,
these changes are needed there too.  Mostly due to POSIX time() signature.
2003-07-06 22:06:46 +00:00
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
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
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
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
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
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
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
nethack.rankin
29f3c6486e vms update
Bring a couple of vms-specific instances of nethack's version number
up to date.
2003-05-20 06:24:46 +00:00