Commit Graph

291 Commits

Author SHA1 Message Date
nethack.allison
96b149208f B20007 age of potion of oil from bones
First From a bug report.4.1 beta 20.
2003-03-17 01:20:41 +00:00
nethack.allison
e0b59d47a2 some release prep 2003-03-15 12:20:34 +00:00
nethack.rankin
9fa5cc7630 combat fixes
1) make two-weapon combat perform two attacks instead of always either
   hitting twice or missing twice;
2) address <Someone>'s report of weapon skill to-hit adjustment being ignored
   for bare-handed and martial arts attacks;
3) address newsgroup complaints about the intrusive "your armor is rather
   cumbersome" message given every time a monk wearing a suit attacks;
   this implements the suggestion that it only occur for those times where
   you miss because of the penalty involved, suppressing it when you miss
   due to other reasons and when you successfully hit;
4) bonus fix:  a side-effect of #3 is that the order of the messages "your
   armor is cumbersome" and Stormbringer's "bloodthirsty blade attacks" is
   inverted, making a sensible sequence instead of implying precognition.
2003-03-15 05:38:44 +00:00
nethack.allison
db6fe9ec56 rndcolor()
> "A cloud of sangria gas billows from the chest.
> You stagger and your vision blurs."
> When I see the gas billowing from the chest, I'm not yet
> hallucinating. Shouldn't the gas have a normal colour, then?
> Only after my vision blurs should the gas assume a fake colour, I
> think.
>
2003-03-12 18:38:56 +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.rankin
6b1811007c new prayer trouble
3.4.1 included a change which requires you to be able to use hands
in order to manipulate containers; that makes sense but has introduced
an unintended side-effect.  It has become much harder to uncurse a
two-handed weapon or combination of a one-handed weapon and a shield
because you can't get scrolls or potions out of your bag.  This adds a
new major trouble for prayer to address that, escalating it above the
normal minor cursed item trouble.  It also removes a nonsensical check
for combination of two-handed weapon and shield that I added long ago.

     Not related, but same file:  add the missing artifact touch checks
for putting on accessories (quest amulets and lenses).  I can't remember
if this was From a bug report.
2003-03-10 23:49:04 +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
nethack.allison
eab7064510 W341-2 Finnish and international keyboard arrangements 2003-03-02 12:58:29 +00:00
cohrs
b6da412ef1 U277 - Gnome compilation on Redhat 7.2 & 8.0
Reported on RH 7.2 and 8.0.  Compilation failed because system headers that
needed _GNU_SOURCE on these Redhat versions got included before it was
defined.  To ensure _GNU_SOURCE is defined, added an autodetect for it to
config1.h and removed the need to set it in unixres.c.  __linux__ is also
checked elsewhere.
2003-03-02 06:07:19 +00:00
nethack.allison
fc1ae80c9b Windows CE bits (from <Someone>) 2003-02-21 01:51:54 +00:00
nethack.allison
e60b33d9fd get ready for tarball 2003-02-20 00:36:14 +00:00
nethack.allison
0c4bd66545 runtime port identification
The CE ports use makedefs hosted on another platform,
so the version string generated at build time isn't really
appropriate.

Add a way to add information to the version string
at runtime for such ports.
2003-02-19 11:44:14 +00:00
nethack.allison
1284e86476 lint follow up
Janet wrote:
>There is one more new complaint that might cause problems:
>explode.c(545): warning: conversion from long may lose accuracy
2003-02-19 05:12:31 +00:00
nethack.allison
39e11412b0 windows PORT_SUB_ID
allow PORT_SUB_ID to be defined in ntconf.h or ceconf.h
2003-02-19 03:14:21 +00:00
nethack.allison
2a83f1b830 more MSDOS build 2003-02-17 02:55:46 +00:00
nethack.allison
f505101fa3 macro arrangement bit 2003-02-15 23:34:37 +00:00
nethack.allison
58c504954d beta 20 2003-02-15 02:45:37 +00:00
nethack.rankin
4496ca3d85 fix B18012 - Werebane
Make wielding Werebane confer defense against catching lychanthropy
from monster bites.  It doesn't protect against catching that from eating
lycanthrope corpses and might blast the character if wielded at such time.

     Also fix artifact handling to recognize the character as lycanthrope
while in normal human/elf/whatever form--rather than only when in beast
form--just like it does for monsters.
2003-02-14 01:06:08 +00:00
nethack.allison
6cf5c60dcc CE patch (from <Someone>) 2003-02-13 05:10:21 +00:00
nethack.rankin
00d320c3d3 magicbane groundwork
To fix Magicbane's message sequencing, its code needs to be redone
substantially.  These changes make that easier.

cancel_monst()  let caller know whether cancellation succeeds
resist()  give artifact weapons a resistance attack rating
vtense()  handle monster names and "you" as subjects; checking against
          object names and descriptions pointed out a couple of other
          words that would have ended up being miscategorized.
2003-02-10 10:23:01 +00:00
nethack.allison
c2c72d11e7 B18009 animate figurine over water
>More worrying is the fact that applying a figurine over water lets
>the monster wait until its next move before it drowns (giving
>you time to teleport it to safety, or whatever) [...]
>Should there be a minliquid() check as part of make_familiar()?

Applying at the water location next to you was easy. But
applying it at your own location (triggering BY_YOU)  could
end up placing the figurine at the far side of the level if
there was lots of water.

Correcting that required the ability to pass a flag from
make_familiar to makemon() telling it to not rule out
water locations as good positions.  The flag had to
be passed on down to goodpos() and enexto().

The bulk of this patch is just adding an additional
argument to goodpos() in all of the callers.
2003-02-09 05:39:32 +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
b7be80ab22 fix other way to get "silly thing to wear"
It was possible for the code to end up in do_wear.c
to put out the "silly thing to wear" message.
2003-01-31 13:19:09 +00:00
nethack.rankin
1114722335 fix B18002 and B18003 - #rub worn blindfold and wield_tool() feedback
Prevent #rub from wielding an item that is already being worn
(which should narrow things down to the various types of eyewear;
other tools and weapons that go through wield_tool() can't be worn).
Fix up the wield_tool message spacing in the process.

     This moves wield_tool() from apply.c to wield.c.  Some plural
handling for messages is included; it is feasible to try to #rub a
"pair of lenses" or a stack of N candles.
2003-01-30 11:31:12 +00:00
nethack.allison
d3dfe5dfc8 Test cvs script patch mailer
Move an is_elven_* macro definition to the same spot as the other ones
so future elven equipment changes can be done in one place.
2003-01-17 03:40:47 +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.allison
c34d7af1eb B16002
The complaint states:
It still won't let you unwield a cursed secondary weapon while
two-weaponing, even though you can drop such a weapon without problem.

You aren't supposed to be able to two-weapon
with a cursed alternate weapon at all.  It appears that there are some
checks to prevent twoweaponing if uswapwep is cursed when you try.
This patch ensures that two-weaping stops if uswapwep gets cursed
while two-weaponing.  I think this means the 'A' command will never
encounter the situation now in the complaint now.

The rules in wield.c state
 The secondary weapon (uswapwep):
 1.  Is filled by the x command, which swaps this slot
     with the main weapon.  If the "pushweapon" option is set,
     the w command will also store the old weapon in the
     secondary slot.
 2.  Can be field with anything that will fit in the main weapon
     slot; that is, any type of item.
 3.  Is usually NOT considered to be carried in the hands.
     That would force too many checks among the main weapon,
    second weapon, shield, gloves, and rings; and it would
     further be complicated by bimanual weapons.  A special
     exception is made for two-weapon combat.
 4.  Is used as the second weapon for two-weapon combat, and as
     a convenience to swap with the main weapon.
 5.  Never conveys intrinsics.
 6.  Cursed items never weld (see number 3 for reasons), but they also
     prevent two-weapon combat.
2003-01-10 04:00:37 +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.rankin
f52b94336f hats vs horns
Some recent newsgroup discussion claiming that a pet ki-rin was
wearing a helmet (I think poster was hallucinating) caused me to look
at some of the hat handling code.  There were a couple of noticeable
problems and one latent one in code added for 3.4.1.  Polymorphing
into a minotaur pushes hard helmets off hero's head, but nothing
prevented you from putting one right back on.  Helmet wearing monsters
who polymorphed into minotaurs weren't affected at all.  And message
handling always assumed multiple horns even though we have some singled
horned monsters, but since all those have no hands they can't wear any
armor and that potential pluralization issue wasn't noticeable.
2003-01-09 01:20:49 +00:00
nethack.allison
b4a65cab8f silver dragon colour
Back in 2000 "Pat Rankin" wrote:
>      From a user (in a message which had several unrelated things):
>
> > I think the colour of silver dragon scales / scale mail should not be
> > SILVER (which is not a colour), but HI_SILVER. Of course the colour of
> > silver dragons would have to be adjusted to match this.
>
> I don't normally have access to a color display, so I hadn't noticed
> that silver dragons are CLR_BRIGHT_CYAN.  It is pure coincidence
> that material SILVER happens to have the same numeric value as that.
> Is bright cyan intentional, to make them distinguishable from gray
> dragons (since color HI_SILVER is defined to be the same as CLR_GRAY)?
> Or was it done for the monsters just because the corresponding objects
> accidentally had the wrong value?  It seems to me that they ought to
> be the same shade of silver (ie, gray) as other silver things, even
> if that makes them look identical to gray dragons.

Using the material value SILVER in the "color"
field was wrong, no matter what the reason. I
suspect it was probably a mistake originally.

This patch does not alter the displayed colour for the
bug-fix release, but does correct the misuse of the
material.
2003-01-04 17:37:09 +00:00
nethack.allison
886749e21b mimic orange follow-up 2003-01-04 16:28:21 +00:00
nethack.rankin
4fb26adf87 fix B16006 - cancelled monster-monster attacks
Various damage types which wouldn't work when a cancelled monster
attacks the player were working when it attacked other monsters instead.
Besides attempting to fix that, this also makes cloaks and other magic
blocking armor ("magic cancellation factor") work for monsters similar
to the way it works for the player.

     Most types of damage appear to revert to physical damage when the
attacker is cancelled; I'm not sure that's appropriate in many of the
instances.  The leg-pricking case was clearly wrong, since it gives
messages about the attack failing yet still hurt the character.

     This really needs a lot more testing than I have energy for.  I've
tried to clean up various inconsistencies and may have made some typos
in the process.
2003-01-04 02:29:35 +00:00
nethack.allison
042a993fca new year 2002-12-30 02:08:34 +00:00
nethack.allison
bbfd597a80 raceptr()
Add a routine for returning a ptr
to the correct race of monst.
Compensates for polyd and non-polyd player.
2002-12-30 01:42:36 +00:00
nethack.allison
e8ca725e92 buglist entry: hobbits and elven mithril armour
<Someone> wrote: "Also, hobbits can't wear armour,
at least, you can't wear armour when polymorphed into a hobbit, even
though hobbits do tend to be carrying elven mithril-coats.
It's tempting to suggest adding an explicit exception in
sliparm() for elven mithril just to keep the Tolkienness."

- added a general routine for adding race-based /object
combination exceptions.
- hobbits can wear elven mithril-coats
2002-12-29 23:55:58 +00:00
nethack.rankin
df07fd4b90 fix buglist entry - artifact bow wielded by monsters
The Longbow of Diana (ranger quest artifact) confers reflection
to the hero when wielded but didn't do the same for monsters when they
wielded it.
2002-12-27 03:40:57 +00:00
nethack.allison
70b4129ef3 Borland updates (from Yitzhak) 2002-12-23 12:51:57 +00:00
nethack.allison
3f3ce17256 wince (from <Someone>)
Added support for
Palm-size PC (Windows CE 2.11) and Smartphone 2002.
It works fine under emulation, but it still needs to be tested
on real device. There are also some minor tweaks here and there.

Removed files:
    sys/wince/recover.vcp
    sys/wince/wince.vcp

New files:
    sys/wince/winhcksp.rc
    sys/wince/defaults.nh
    sys/wince/hpc.vcp
    sys/wince/palmpc.vcp
    sys/wince/pocketpc.vcp
    sys/wince/smartphn.vcp

<Someone>
2002-12-18 03:51:34 +00:00
nethack.rankin
137bd330e4 fix B14021 - inconsistent menu styles
Menu styles `partial' and `full' will let you remove any type of
item from the three weapon slots via the 'A' command, but `traditional'
and `combination' would only do that for the primary weapon slot.  For
the alternate weapon and quiver slots, the item in question had to be
one which can normally be wielded or worn, otherwise when choosing the
object class letter you'd be told that it was "Not applicable."  And
for wearable items, you needed to be really wearing one of that class
(besides the quivered one) or else you'd get "not wearing any amulet"
or similar.
2002-12-14 11:53:22 +00:00
nethack.rankin
b90f50075d fire attack messages
Make sure the three instances of special fire effects stay
synchronized in the future by moving the relevant code into its own
routine.

     Shouldn't fire vortices and fire elementals also yield "already
on fire"?  How about ice vortices "melting"?
2002-12-10 10:21:28 +00:00
cohrs
2492ed0de1 comment bit
mtrapped comment didn't mention webs
2002-11-28 19:13:01 +00:00
nethack.rankin
7b9f2f6e3e stealing heaven
Fix the reported problem of getting impossible warnings for unpaid
inventory items during final disclosure if you level teleport out of
the dungeon while holding shop goods.  The fix makes you trigger a shop
robbery first; that required a minor end of game change to prevent the
shopkeeper from seeming to tag along (shk would take your possessions
as if you'd died on the shop level).
2002-11-21 00:47:12 +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
nethack.rankin
e639c09f58 fix B14012 - polymorph of monster possessions
Forwarded from the newsgroup:  when a monster gets hit by wand or
spell of polymorph, any armor that fell off was protected from being
hit by that same zap, but a dropped weapon wasn't.  Nor was the whole
dropped inventory in the case where the monster is killed by system
shock rather than transformed.  Protect its entire inventory.
2002-11-08 12:45:58 +00:00
cohrs
ff8512b36b is_lminion should only match lawful minions
When Angels were introduced, they were always lawful.  Somewhere along the
line, non-lawful angels were added, but is_lminion and uses of it was never
updated to address this change.  Among other things, this resulted in
non-lawful angels delivering messages via #chat that are only appropriate
for lawful angels.  That is addressed simply by changing the definition of
is_lminion, which must take a struct monst, not a permonst, to return valid
results.  Also, non-lawful angels should summon appropriate monsters, not
lawful minions.
2002-10-24 04:13:56 +00:00
nethack.rankin
7411e1daf5 fix U100 - vampire stoning buf
Fix the reported bug of a vampire that is wearing gloves being
able to bite a cockatrice without becoming petrified.
2002-10-18 06:49:34 +00:00
nethack.rankin
2f6d82dcc6 fix B14002 - Stinking clouds in bonefiles
More region fixes.  The region restore code wasn't updating monster
ID numbers for bones data, so monsters already inside stinking clouds
might or might not be affected by them depending on arbitrary mon->mid
assignments across the old and new games.

     This also flags stinking clouds in a way that lets the game keep
track of whether they were created by the player, and clears that state
for bones data so that the current player doesn't get credit or blame
for clouds left by the former one.  File compatibility with 3.4.0 is
retained; if/when that eventually changes, this code can be simplified.

     Testing with current development code has been limited but seems
to be working correctly; testing with actual 3.4.0 files has not been
attempted.
2002-10-16 22:20:30 +00:00
cohrs
cb38d0882d B14001 - Stinking clouds in bonesfiles
Incorporate a fix from <Someone> that resets the timestamp on
stinking clouds left in bones files.  This does allow the cloud's ttl to
restart.  Extended it to reset the player_inside flag.

Then noticed that the only placed that called in_out_region was domove().
Added calls when changing levels (which causes player_inside to be set
correctly if the cloud covers the location where the player starts on the
bones level), teleporting, and inside hurtle_step.  There are still other
places that fail to call in_out_region, which others may choose to tackle.

I split out the remaining stinking cloud bug reported in the same e-mail
into a separate betabug.  That one probably cannot be addressed without
changing the level file format to track the creator.
2002-10-16 06:30:36 +00:00
nethack.rankin
2c3964e619 #dipping from steed
Fix the reported bug of an unskilled rider who is unable to pick
items off the floor while mounted still being able to dip into water.
There might be other actions which need similar checking; this one only
handles the dip into pool/moat case.
2002-10-11 00:46:37 +00:00