Commit Graph

188 Commits

Author SHA1 Message Date
Pasi Kallinen
cd3b0efe5d Unify description of hero's visage into single function 2015-04-14 19:41:44 +03:00
Pasi Kallinen
1c2f2af357 Indicator glyph for good target positions
Add a new glyph, S_goodpos, to indicate valid locations
instead of reusing the camera flash beam glyph.
2015-04-07 18:18:54 +03:00
Pasi Kallinen
30bce1ec6b Suggest only accessible positions for polearms and jumping 2015-04-03 12:29:58 +03:00
Pasi Kallinen
0344771b12 Silence warnings 2015-04-03 08:33:14 +03:00
Pasi Kallinen
055cc1b4d5 Show legal jumping positions 2015-03-31 21:40:49 +03:00
Pasi Kallinen
411ee58593 Add more explicit helpless reasons
Instead of just "while helpless", the death reason will tell
more explicitly why the player was helpless.  For example:
"while frozen by a monster's gaze"
2015-03-29 22:12:19 +03:00
Pasi Kallinen
9a4fefb5ad Add missing prototype 2015-03-28 19:21:49 +02:00
nhmall
9b328f1ad6 Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource 2015-03-28 11:23:47 -04:00
Pasi Kallinen
0e4317fa6b Balsa wands break easily 2015-03-28 17:20:57 +02:00
nhmall
c035402c14 flavor enhance zap downwards/upwards when hiding
Changes to be committed:
	modified:   doc/fixes35.0
	modified:   include/extern.h
	modified:   src/apply.c
	modified:   src/zap.c

    On 3/23/2015 6:41 PM, a bug reporter wrote:
    > When you're hiding under an item (e.g. via garter snake polyform), and
    > that item gets polyshuddered into nonexistence, you continue hiding
    > (under nothing).
    This was addressed previously.

    > (Incidentally, it's a bit weird that you use > to aim at items that are
    > flavorwise above you at the time.)

    This addresses the flavorwise concern.
2015-03-28 11:20:44 -04:00
Pasi Kallinen
2fce0074b3 Show legal polearm hit positions
User can press $ to display valid positions when asked
for a position to pick, and the positions will be hilighted
2015-03-28 13:32:24 +02:00
Pasi Kallinen
13645dcd2a Automatically find monster to target with polearm
If there's only one suitable monster within range, automatically
suggest it for targeting with the polearm
2015-03-28 00:32:54 +02:00
Pasi Kallinen
5bb4a02ffe Remember position of monster you hit with polearm
If you hit a monster with a polearm, following polearm applications
will try to automatically suggest the monster's position
2015-03-27 23:34:13 +02:00
PatR
14525ed0c6 DEBUG/debugpline() fixup
* Replace variadic debugpline() with fixed argument debugpline0(str),
   debugpline1(fmt,arg), and so on so that C99 support isn't required;
 * showdebug() becomes a function rather than a macro and handles a
   bit more;
 * two debugpline() calls in light.c have been changed to impossible();
 * DEBUGFILES macro (in sys.c) can substitute for SYSCF's DEBUGFILES
   setting in !SYSCF configuration (I hope that's temporary).
2015-03-15 18:02:26 -07:00
Derek S. Ray
4dddb97301 remove and transfer INVISIBLE_OBJECTS to branch 2015-02-27 19:34:32 -05:00
Pasi Kallinen
612852f7de Apply paxed's DEBUG patch to remove DEBUG/D_DEBUG.
Move debugging output into couple preprocessor defines, which
    are no-op without DEBUG.  To show debugging output from a
    certain source files, use sysconf:

    DEBUGFILES=dungeon.c questpgr.c

    Also fix couple debug lines which did not compile.

This also includes fixes due to Derek Ray to depugpline to work better
on other platforms.
2015-02-27 19:33:45 -05:00
Sean Hunt
ac108cd365 Make GOLDOBJ unconditional. 2015-02-27 19:33:40 -05:00
Sean Hunt
260f7ea860 Make TOURIST unconditional. 2015-02-27 19:33:12 -05:00
Sean Hunt
9e65758947 Make STEED unconditional. 2015-02-27 19:33:01 -05:00
keni
03140969ee Bulk recovery of file CVS headers and addition of NHDT- headers. 2015-02-26 09:19:03 -05:00
nethack.rankin
9f2ca00138 fix [part of] #H2554 - hunger when declining to attack peaceful monst
Reported last December by <email deleted>, attempting to move
into a peaceful monster's position and then declining to attack at the
confirmation prompt uses no time, as expected, but does burn nutrition
the same as if you carried out the attack.  A player could abuse that to
make room to eat an intrinisic-conferring corpse before it rots away.
This fixes that, and also makes attacking a monster via applying a polearm
and via kicking burn the same extra nutrition as ordinary attack.  I didn't
add it for attacking via throwing.

     He/she also reported that kicking at a peaceful monster and declining
to attack at the prompt wakes up nearby monsters even though no actual kick
ultimately takes place.  I can confirm that, but this does not fix it.
2012-05-01 02:22:33 +00:00
nethack.rankin
889e3fa0b6 magic whistle vs steed
From a bug report, using a magic whistle when
you're mounted and standing on a trap location would cause your steed to
trigger the trap even though it didn't move.  Since it is already at the
same place as you, make steed be unaffected by magic whistle so that trap
complications can be avoided.
2012-04-30 22:00:25 +00:00
nethack.rankin
369b1031fd fix #H2559+2564 - using 'a' command to discover potion of oil (trunk only)
From a bug report, if you used the apply command while
not carrying anything applicable except for unknown potion, you would get
"you don't have anything to apply" if that potion wasn't oil but an
inventory selection prompt (with '*' as the default since you wouldn't
have anything considered to be a likely candidate) if that potion was oil,
giving away information.

     This fix makes carrying any unknown potion yield the inventory
selection result, unless oil is already discovered and hero can see that
the unknown potion isn't oil.
2012-01-10 08:50:19 +00:00
keni
68cbca9305 more debugging: apply.c 2011-12-29 22:16:49 +00:00
keni
6205188c36 whack some compiler warnings to test updated postcommit.pl 2011-11-15 02:14:39 +00:00
nethack.rankin
84f02bd336 intrinsics revamp (trunk only)
Simplify many of the intrinsics macros from
  #define xxx_resistance (Hxxx || Exxx || resists_xxx(&youmonst))
down to
  #define xxx_resistance (Hxxx || Exxx)
by setting or clearing an extra bit in Hxxx during polymorph so that the
resists_xxx() check becomes implicit.

     Unfornately there were lots of places in the code that treat Hxxx
as a timeout number--primarily for Stunned, Confused, and Hallucination;
Stunned happens to be one of the revised macros--rather than as a bit
mask, so this patch needed a lot more changes than originally antipated.
2011-10-01 00:25:57 +00:00
nethack.rankin
d592b9c4ae sokoban completion (trunk only)
Something I've had in mind for a long time and finally gotten around
to implementing:  when you fill in the last pit or hole of a sokoban level,
it's considered to be completed so luck penalties for unsokobanish things
(breaking a boulder, dropping everything and squeezing onto a boulder's
spot, reading a scroll of earth) stop being assessed and most Sokoban-
specific movement restrictions (against pushing boulders diagonally,
squeezing diagonally between boulders, floating over a pit or hole without
falling in, digging of new holes by monsters) are lifted.  Teleporting,
level teleporting, and phasing through walls are still prohibited when in
the sokoban branch of the dungeon.  (Keeping the non-phasing one in place
prevents taking a shortcut to the final prize in order to bypass the
treasure zoo monsters.)

     This adds level.flags.sokoban_rules, defines Sokoban macro to access
it, and replaces most In_sokoban(&u.uz) tests to check it instead.  It
gets set when a sokoban level is pre-mapped at the end of level creation,
and if it is set then whenever a trap is deleted, the flag gets cleared
if there are no more pits or holes present on the level.
2011-08-30 22:13:27 +00:00
nethack.rankin
b16fa5084e fix #2276 - unlightable candelabrum
From a bug report, applying unlit Candelabrum
of Invocation when its candles had 1 turn's worth of burning left would
give a message that the candles were burning but not actually light them
if done anywhere other than the invocation location.  Their burn time is
cut it half when not at that spot, and dividing an age of 1 yielded 0,
confusing begin_burn().  They wouldn't light and they couldn't be replaced
since they'd never get used up.

     The problem is real, but the chance of it actually happening in
normal play is just about zero.  This applies his suggested fix of
rounding the halved burn time up instead of down so that it can't yield 0.
It also applies his suggestion that the Candelabrum treat the invocation
spot like any other location once invocation has produced stairs there,
just as the Bell and the Book do.
2011-05-10 02:32:37 +00:00
keni
9ae93d8b71 new and fixed messages
2 fixed messages and 2 new silly messages
2010-01-07 17:51:35 +00:00
nethack.rankin
8f3c74d804 wand/spell/breath zaps hitting secret doors (trunk only)
From a bug report, black dragon breath
destroys closed doors didn't acknowledge hitting secret doors.  bhit()
reveals secret doors, but zap_over_floor() (called by buzz() for ray-type
wands and spells, and for breath attacks) didn't check for hitting those.

     When testing the fix, I noticed that feedback for an explosion caused
by breaking a wand was worded oddly for zaps like magic missile which don't
damage doors.  "The door absorbs your bolt" didn't make much sense; what
bolt?  That was first changed to "absords your blast", which still sounded
weird, then to "absorbs the blast", which seemed better but was inaccurate.
Next was "absorbs some of the blast" since the explosion continues to hit
adjacent spots, but since it still has full strength that wasn't accurate
either.  It's finally become "The door remains intact."  Unlike with zaps,
there is no additional range being lost, so no reference to absorption.
2009-05-28 14:09:30 +00:00
keni
df20791e59 Add RCS version lines 2009-05-06 10:45:32 +00:00
nethack.rankin
e11c136bc9 fix #H1816 - polearm/grapnel/whip fixes (trunk only)
From a bug report, applying a polearm to make a
short-range ranged attack didn't scuff any engraving you were standing on,
unlike ordinary melee and throwing/shooting attacks.  Grappling hooks had
the same omission.  Fixing it led to several other minor bugs.  Attempting
to target an unseen monster's spot with polearm or grapnel would yield some
permutation of "wait, there's something there" but draw the 'I' glyph at
the wrong spot.  It used <u.ux+u.dx,u.uy+u.dy> instead of the actual target,
so put the 'I' one step in front of your most recent move (or throw or zap
or whatever last set u.dx and u.dy).  Giving ESC when prompted for target
spot failed to use up a turn even when the polearm or grappling hook had
just been auto-wielded for use.  Neither use_pole() nor use_grapple() set
`notonhead' for hmon() (called via thitmonst() in their cases; this was
academic since plain physical damage attacks don't actually care about it).
[The bad 'I' placement was a post-3.4.3 bug.]

     Applying a bullwhip to attack an adjacent monster didn't have any of
those issues but did have the possibility of targetting off the edge of
the map when standing at that edge while confused or stunned.

     Applying a polearm to target an 'I' would yield "nothing happens" if
the unseen monster wasn't there anymore, and it didn't bother to remove
that 'I' from the map.  After changing it to do so, the phrasing no longer
made any sense.  This led to a slightly bigger change than I intended:
since statues are now shown as gray monsters (does that work for tiles?)
instead of as chunks of stone, they are likely to be intentional targets
sometimes, so polearm attacks now handle them differently from other
non-monster locations.  [I hope that other attack forms don't need
similar handling.  Melee certainly doesn't, since walking onto the spot
is enough to distinguish statues from monsters.  Having the missile pass
right through a statue's location probably suffices for ranged attacks.]
2009-02-23 01:20:32 +00:00
nethack.rankin
6870660aba more breaking wands (trunk only)
If breaking a wand of polymorph uses up any floor objects, give a
"you feel shuddering vibrations" message like happens when zapping.
2008-10-20 04:07:40 +00:00
nethack.rankin
b0478ecef8 breaking wands (trunk only)
From a bug report, polymorph of self due to
breaking a wand also polymorphed various items that were dropped in the
process, unlike the case of zapping polymorph at monsters which excludes
dropped items from being poly'd.  This polymorphs the pile at the hero's
feet before polymorphing the hero.  I first tried to handle it using
obj->bypass like with monsters, but that didn't work.  Post-3.4.3, the
bypass handling is also used for polyself (by retouch_equipment()) and
it was getting reset at an inconvenient time.

     He also complained that he failed to get "you feel shuddering
vibrations" when some polymorphed objects got destroyed.  That message
is issued by weffects() which do_break_wand() doesn't call.  It ought to
be fixed, but this patch doesn't address it.

     Lastly, add code to prevent objects guarded against polymorph via
obj->bypass from getting used up when creating polypile golems.
2008-10-20 00:57:16 +00:00
nethack.rankin
2d1eb28e67 aborting key/pick usage (trunk only)
From the newsgroup:  applying a key and then using ESC at direction
choosing prompt was using up a move even though hero didn't do anything.
2008-03-08 03:45:26 +00:00
nethack.rankin
e08b97597c igniting unpaid potions of oil (trunk only)
From another many year old news posting:  if you picked up a stack
of potions of oil in a shop and then applied them, one potion was split
off and started burning but you were forced to pay for all of them.
Split the to-be-lit one off first so that the remainder of the stack
stays as ordinary unpaid shop goods.

     This also fixes an old bug with bill_dummy_object sometimes charging
a different price than the player got quoted when an object was picked up.
2007-06-03 02:33:34 +00:00
nethack.rankin
8d880dd143 unicorn horn vs sustain ability (trunk only)
Forwarded from newsgroup by <Someone> in February, 2005:  non-cursed
unicorn horn fixes lost Str/Con/&c stats even when ring of sustain ability
is supposedly locking those at current value.  This makes unicorn horn
honor the Fixed_abil intrinsic.  The potion and spell of restore ability
still override that, so they now have potential for use even after player
has acquired a unihorn.  Prayer also continues to override Fixed_abil.
Major prayer result to heal crippled strength now attempts to uncurse a
ring of sustain ability (or gloves or weapon covering it up--similar
situation as with cursed levitation).  Minor prayer result to fix lost
stats resets those without attempting to do anything about Fixed_abil.
2007-05-29 03:52:02 +00:00
nethack.rankin
0ba059f749 Hallucination vs gaze attacks (trunk only)
Suggested by <Someone> in March, 2005 based on newsgroup discussion
at the time:  hallucination protects against touch of death attack by
disrupting how the hero's brain reacts, so why not against gaze attacks
too?  This gives hallucinating hero 75% chance of being unaffected by
gazes.  If unaffected or if the gazer has been cancelled, the gaze will
fail with some feedback.  Previously, all cancelled gazes failed but only
Medusa's gave feedback.

     This will give players another way to defeat Medusa, but since it
isn't foolproof and there are several sure fire ways already, I don't
think it'll hurt play balance there.  It may be useful to avoid getting
repeatedly stunned by Archons though.
2007-05-29 02:00:25 +00:00
nethack.rankin
bb5ade4293 confirmation for polearm attacks (trunk only)
From a bug report, 2005:  applying a
polearm towards a monster ignores the `confirm' option.  It's a wielded
weapon attack but is handled internally as a throw since it's also a
ranged attack.  The report included a small patch for use_pole() but I'm
calling the regular attack confirmation routine instead.

     Also, move the penalty for samurai attacking peaceful monsters into
the same routine that handles knight attacking defenseless monsters so
that they're more consistent.
2007-05-28 00:20:43 +00:00
nethack.rankin
5ca566f0f2 mirror fixes (trunk only)
From some notes I made prior to release of 3.4.3, about applying a
carried mirror in the direction of a monster:

 invisible player applying mirror toward monster which can't see invisible
   should have no effect (monster can't see hero's equipment);
 similarly when inside engulfer regardless of whether it can see invisible;
 applying mirror at worm tail shouldn't work but does;
 applying mirror toward unseen monster that can see invisible (so should be
   able to see its own image) doesn't work because bhit() won't target it;
 mirror shouldn't work when target is only visible via infravision.

The fourth one is iffy since it assumes that invisible monsters produce
invisible reflections rather than no reflections.  The reverse of that is
probably more reasonable but isn't as interesting.  The fifth one may be
contradictory; it fails to extend that logic to "infravisible monsters
produce infravisible reflections."
2007-05-12 02:01:18 +00:00
nethack.rankin
49d0204fc4 breaking empty wands
I found a copy of a news posting from 1996 which suggested that
using a[pply] to break a wand which has 0 charges should have a chance of
wresting out one extra charge, like zapping.  That way the player can't
destroy spent wands with impunity, and it makes the two wand actions be
more consistent.  Also, it's trivial to implement.  :-)
2007-05-08 02:02:22 +00:00
nethack.rankin
4e38da7ed9 more #H267 - cursed figurine auto-activation
Figurine activation timer had the same problem as burning objects:
it didn't clear up worn object pointers when destroying the object.
2007-03-16 02:40:21 +00:00
nethack.rankin
a2a5df0932 fix #H265 - applying wielded towel fails with odd message
From a bug report:  attempting to apply
a towel which is currently "worn" in the weapon, alternate weapon, or
quiver slot fails with "you cannot use it while you're wearing it".  The
message sounds odd when the towel is wielded, and there's no reason why
you shouldn't be able to use it when it's in any of those weapon slots.
Compare it with current blindfold rather than checking its owornmask.
2007-03-15 06:04:08 +00:00
nethack.rankin
f67a4547ac held artifacts evading your grasp (trunk only)
From a bug report, trying
to invoke a wielded artifact after changing alignment resulted in "the
<artifact> evades your grasp" but it remained wielded, contradicting the
message.  This adjusts the message in touch_artifact() if the object is
already in inventory, and adds retouch_object() to handle cases where
failing to be able to touch ought to force unwearing/unwielding.
2007-03-10 05:54:17 +00:00
nethack.rankin
b8a51d3649 fix #H254 - stethocoping mimics (trunk only)
From a bug report, applying a stetoscope to
a mimic which was hiding would report that mimic's stats but not bring it
out of hiding, unlike the behavior for other types of hiding monsters.
2007-03-08 05:42:15 +00:00
nethack.rankin
a9b7b19b95 more jumping (trunk only)
Allow jumping via spell when hero or steed has wounded legs.
Otherwise the previous fix for immobilized steed--and the existing code
requiring limbs for physical jump but not for spell jump--is inconsistent.
2007-02-11 01:50:56 +00:00
nethack.rankin
2343e77eb0 fix #Q382 - jumping possible while riding a sleeping pet (trunk only)
From a bug report:  when riding,
#jump command and jumping spell didn't check whether steed is able to move.
This makes #jump command, either magic boots or knight's innate ability,
fail if the steed can't move.  Spell still succeeds; its magic overrides
steed's immobility.  Fix is trunk only since it relies on a function that
isn't in the branch.

     Also, tweak hero movement to avoid an extra function call per move
when not riding.
2007-02-11 01:33:26 +00:00
nethack.rankin
7c64dbaf83 fix #Q404 - monster wielding cursed corpse
From a bug report, applying a bullwhip
towards a monster to try to steal its weapon would report that a cursed
cockatrice corpse was welded to the monster's hands even though corpses
wielded by the player never become welded.  Code for monsters deciding
what to wield knew that corpses don't weld; everywhere else seems to
assume that they only wield weldable weapons.  Add a routine to check
whether a wielded item is welded, similar to what's done for the hero.  I
fixed a couple of other spots besides use_whip() but didn't hunt all over.
2007-02-10 05:14:22 +00:00
nethack.rankin
eabf0f649e fix #Q367 - tinning Rider corpse when level is full
From a bug report:  if you try to tin a
Rider's corpse and revival fails, you still get the gimicky message about
War not preserving his enemies.  Give the suggested alternate message in
that case:  The corpse evades your grasp.  I hope that we can do better
than that, but I'm too burned out to think of anything.
2007-02-09 01:35:41 +00:00
nethack.rankin
8465f87d2f fix #Q108 - adding candles to Candelabrum while underwater
From a bug report, but just received:
you can't affix candles to the candelabrum while underwater, because the
underwater check (can't light candles while underwater) is made too soon.
If you somehow managed to get a lit lamp, candle, or candelabrum while
underwater, you wouldn't be able to extinguish it for same reason.  The
bug report included a URL for a fix, but I didn't look at that.  This
changes use_candle() to rely on use_lamp() for underwater handling, and
changes use_lamp() and use_candelabrum() to check for extinguishing
before making the underwater check.
2007-02-04 05:34:59 +00:00