Commit Graph

62 Commits

Author SHA1 Message Date
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
cohrs
bcf47b7663 missing altar drop messages
Most callers of dropx did not check for altars, but should have.  Rather
than add such checks, I moved the check from drop to dropx.  I also found
several callers of dropx that could generate out-of-order messages for some
cases (not new) and fixed them. FYI - callers of dropy don't seem to want
altar checks or already do them.
2002-12-17 03:36:42 +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
nethack.rankin
c3a9637ba7 touchstone use
Make touchstones more convenient to use after they're identified
by only listing unknown gems as likely candidates.  This doesn't prevent
other stuff from being rubbed on them, just alters the prompt string and
the subset of inventory shown for '?'.
2002-10-01 07:23:10 +00:00
nethack.rankin
ef14456b3d eucalyptus leaf whistles
Add <Someone>'s patch that enables using the apply command
on eucalyptus leaves to produce a whistle effect.  Blessed leaves
behave like magic whistles; I added a chance for the blessing to be
used up in the process.

     The invent.c diff is almost all reformatting.
2002-09-26 07:26:03 +00:00
nethack.rankin
846de96a4a two figurine tweaks
Fix the reported problem of applying a figurine while swallowed
and getting a message about setting the figuring on the ground.  Rather
than coming with special messages, just prevent it would activating if
you're swallowed at the time.

     Also prevent figurines from creating the 4th erinys or 10th Nazgul.
I'm not sure whether to bother doing similar handling for stone-to-flesh
cast on statues.
2002-09-26 04:05:54 +00:00
nethack.rankin
b0f2478b51 check_leash's handling of 2nd leash
Noticed by code inspection:  the inventory scan to find leashes
in use didn't reset the monster traversal loop for each leash, so
with more than one active it wouldn't necessarily find and check the
monster attached to the second one.
2002-09-24 02:11:10 +00:00
cohrs
2d2a20cdf0 R1049 followup
This patch handles the case of angering the town watch when breaking a wand
of digging damages walls or doors.
2002-08-21 23:36:47 +00:00
cohrs
5d492abf6f R1049 - various wand of digging bugs
- Breaking wand of digging dug through rock which should be undiggable.
Checks assumed pits would never show up in solid rock.
- Breaking wand of digging near shop walls wouldn't anger the shopkeeper
Checks assumed pits would never show up in walls, also, added a special
case to pay_for_damage to handle the case where you're falling thru and
can't be asked to pay.
- Shop walls wouldn't be restored if there are pits in the way.
Checks assumed pits would never show up in walls.
- If there was a hole outside the shop, you could kick stuff out of the
door into the hole without shopkeeper noticing.  Added the missing check.
2002-08-21 23:06:58 +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
3c227928f9 function name format
From <Someone>:
[functions that don't start in leftmost column ]

apply.c:int unfixable_trouble_count(is_horn)
artifact.c:void arti_speak(obj)
botl.c:int xlev_to_rank(xlev)
botl.c:int rank_to_xlev(rank)
display.c:void map_location(x,y,show)
hack.c:static void findtravelpath()
hack.c:void unmul(msg_override)
hack.c:long money_cnt(otmp)
mklev.c:CFDECLSPEC do_comp(vx,vy)
pickup.c:long carry_count(obj, container, count, telekinesis, wt_before, wt_after)
pickup.c:boolean mon_beside(x,y)
shk.c:long money2mon(mon, amount)
shk.c:boolean same_price(obj1, obj2)
shk.c:void finish_paybill()
trap.c:boolean delfloortrap(ttmp)
weapon.c:void give_may_advance_msg(skill)
do_name.c:char *coyotename(mtmp, buf)

(This with a pruned 'egrep '^[[:alnum:]]+ .*\(.*\)$' *.c' in src/; I
haven't looked outside that directory, but generally speaking once you
go beyond there you're widening your search anyway.)
2002-08-12 22:24:05 +00:00
nethack.rankin
9fa85b109b artifact manipulation
Fix an item from <Someone>'s list:  invoking or applying an
artifact might blast you; if it evades your grasp, the intended
action won't take place but will still use up a turn.
2002-08-01 23:20:34 +00:00
nethack.allison
02ed5c37c9 From the newsgroup, there was a discussion about how you
can't just blind yourself with a cream pie in your inventory
directly by applying it or by throwing it.

On 27 Jul 2002 14:11:06 GMT, <Someone> wrote:
> <email deleted> wrote:
>> <email deleted> (<Someone>) hypothesised:
>>
>> [cream pie]
>>> So I a)pply the pie. What I want to do is to hit MYSELF in the
>>> face with the pie, thereby blinding me and giving me T-P for
>>> just a few turns.
>>
>> Not a bad TTDTDTO ("Thing The DevTeam Didn't Think Of," which is
>> subtly different to a YANI, and not a bug; sorry, I seem to be
>> on a neologismathon today.)
> I tried throwing a cream pie upwards, hoping it would blind me,
> but no luck:
>
> "A cream pie hits the ceiling. What a mess!"
>
2002-07-27 20:48:45 +00:00
cohrs
35914ed186 R919 - applying lances
Fixes 2 bugs:
1) an impossible() could occur if you applied a lance against a long worm
because the code uses thitmonst to do the hitting, but didn't set bhitpos,
which is required before calling thitmonst.
Add the missing assignment.
2) applying a lance would never mark a knight as a caitiff.  Added a new
check_caitiff function and called it from the 2 existing checks and in
the lance code.
2002-07-11 05:16:27 +00:00
nethack.allison
40940991bb change GOLD_CLASS to COIN_CLASS 2002-07-08 23:25:53 +00:00
nethack.allison
a8b7d559cb axing boulder/statue follow-up
<email deleted>
Sent: Sunday, June 30, 2002 6:30 PM
Subject: Sparks from statue-axing
> First, the message given when your axe-handle vibrates is a little
> ambiguous; I'd be explicit and include the name of obj.
>
> More seriously, potions of oil catching light from the sparks are a) a
> great idea, but b) slightly broken. They catch light fine, but
> snuffing them produces a "del_light_source: not found"
> impossible(). (This probably means the same applies to being lit by
> fire_damage(), but that's rare enough this hasn't been caught before.)
>
> (Also, a)pplying a potion of oil to light one identifies its object
> type, so lighting one by this means probably ought to as well. And
> oughtn't it to be charged for if you don't own it, as light_cocktail()
> does?)
2002-07-01 06:41:08 +00:00
nethack.rankin
197b4e706f grammar tidbit
From the newsgroup:  if the Candelabrum of Invocation already
has six candles attached and you apply another one to add the seventh,
the message said it "now has seven candle attached."
2002-04-19 05:50:02 +00:00
kmhugo
a7504f0c77 Grappling hook aiming
Characters skilled or better with a grappling hook have a chance of
aiming for an object, monster, or the floor.
2002-04-16 17:24:33 +00:00
kmhugo
31c824dbf3 digging rock vs. chopping wood
Refinement of the digging code:
* Picks should not chop down trees, but axes should.
* Picks should break walls, rock, statues, and boulders; axes shouldn't.
* Either picks or axes should chop down doors.
2002-04-16 01:37:57 +00:00
cohrs
5c1ea899bf ensure touch_artifact is always called via hold_another_object
- remove the touch_artifact calls just added
- put a check into hold_another_object itself, based on the complete check
removed from makewish
2002-04-02 05:32:02 +00:00
arromdee
08c463759c iron balls/teleds
Fixing some iron ball/teleds stuff:
-- If the player can pass through walls, ignore all checks for walls, or else
things will behave weirdly.
-- Instead of using the kludge "if the distance is >2 it must be a teleport",
pass a parameter indicating whether they crawled or teleported onto the new
space.  This fixes a special case, where the player moved one space and the
ball didn't move, but the chain moved through solid rock.  This is acceptable
if teleporting and unacceptable if dragging.
This also required some rearrangement of teleds() so that u.ux,u.uy
are set after placing the ball, not before.  I'm still not sure the pit
filling line is in the right place; anyone know?
-- add some comments so I can look at the code in a month and still know what
I did.
Most of this patch is just adding the new parameter.
2002-04-01 05:18:28 +00:00
cohrs
587fe0b9e7 comment bit
- the dropx comment has been wrong for a while, time to accept that
2002-04-01 00:20:58 +00:00
cohrs
531f703cd0 fix more "drops to the floor" cases when there is no floor
- make the code in apply.c and zap.c consistent
- use the "drops away from you" case whenever the location type does not
lend itself to using the word "floor"
2002-03-31 04:18:02 +00:00
nethack.rankin
49d84cffdb final(?) touchstone
Put back the "better gold handling" that was inadvertently
dropped from the previous rewrite.  Prevent gems rubbed on cursed
gray stones other than touchstones from being shattered.  Fix
several pluralization buglets, including allowing the player to
rub a stone against itself if the quantity is more than one (just
like potion dipping is handled).  Overall, streamline the rather
convoluted logic, eliminating the `goto's.
2002-03-19 05:13:50 +00:00
nethack.rankin
fafbb60725 touchstone again
Recent patches broke rubbing gold coins on touchstones; for the
!GOLDOBJ configuration, the character's money would be lost and the
program leaked memory.  That problem was already present for rubbing
gold on other gray stones.

     This also gives a gem advantage back to archeologists:  they
can comprehend touchstone results when the stone is uncursed rather
than require it to be blessed.  (I gave gnome characters that benefit
too.  Why gnomes and not dwarves?  I don't have a reasonable answer
for that....)  To go along with that, make A's initial touchstone
start uncursed rather than blessed, so that other characters finding
them in bones won't get an immediate benefit from them for the 20%
of the time that they're not cursed when saving bones.

     Much of this is whitespace cleanup.  I reformatted use_stone()
completely.
2002-03-17 08:19:21 +00:00
nethack.allison
16cdae3bd2 touchstone follow-up
- Handle gold materials a littel better.
2002-03-16 14:08:35 +00:00
nethack.allison
ce6025df6e >Rubbing a clove of garlic on a gray stone to see if it went "scritch,
>scritch": "You make scratch marks on the stone".
2002-03-16 13:57:08 +00:00
nethack.rankin
6c91a6bc04 leash groundwork
Add another parameter to m_unleash.  This should not introduce
any change in behavior.
2002-03-11 08:00:21 +00:00
nethack.rankin
bc8acf4a29 steed/leash bit
It's possible to leashed a saddled pet and them ride it,
but it wasn't possible to remove the leash while mounted.  This
fixes that; it also lets you put the leash on your steed while
mounted, but there's nothing wrong with that.
2002-03-11 06:41:47 +00:00
jwalz
bab78d03c8 Lint part 1, unused variables, routines, and return codes. 2002-03-10 00:30:53 +00:00
cohrs
8fb7664869 fix more your corpse cases
- new cxname() to simplify doing the right thing in increasingly common cases
- use for bullwhip snagging
- in shopkeeper offer code
- in a couple other existing places rather than duplicating CORPSE checks
- use singular(...) in "swings" cases, since only one can hit.  Singular uses
  corpse_xname automatically when appropriate
2002-02-27 05:15:48 +00:00
cohrs
0f1615c7ad simplify touchstone object choosing
- remove special case code from getobj for touchstone
- remove other hacks from getobj that resulted from earlier hack, solves
  the "rub on the gold stone" problem completely
- pass correct letter list to getobj from use_stone, like other callers
2002-02-26 07:36:30 +00:00
cohrs
7f5285b1ee converting SCORR to CORR unblocks vision
- fix several cases where a point was unblocked by unblock_point wasn't
 called, directly or indirectly
2002-02-25 02:43:50 +00:00
nethack.allison
490ceaee6c change is_greystone() to is_graystone()
-Rename is_greystone() to is_graystone() since I've
had one complaint about my choice of spelling for
the macro already.

-Change the recent "#rub touchstone" code to use
the macro which pre-existed under the other spelling
and was already used in the very same "if" statement
with that spelling in invent.c. :-)
2002-02-24 17:23:02 +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
cohrs
fe4f8b3c9d whipping hidden mimic displays mimic name too early
rather than the "flick" message, just go directly to stumble_onto_mimic
2002-02-15 04:29:11 +00:00
cohrs
4497d8e4e3 pline missing punctuation bits 2002-02-13 06:52:46 +00:00
nethack.allison
97d635fdbf Fix B6013. 2002-02-11 23:15:33 +00:00
cohrs
3b3362b236 glyphs for breaking wands
use fire an cold glyphs when breaking the corresponding wands.  Other
wands all get EXPL_MAGICAL since there's nothing more specific for them.
2002-02-11 03:29:11 +00:00
arromdee
14a6d90763 mirrors
Invisibility should be treated consistently regarding passive reflection of
gaze attacks and explicit mirror use against gaze attacks.
2002-02-11 00:42:44 +00:00
cohrs
316a94d50f obj_no_longer_held consistency
Call obj_no_longer_held whenever an object hits the floor, no matter what
previously held it.  Also handle stoning of prior holder.
2002-02-09 21:55:45 +00:00
cohrs
5e2692fba5 catch_lit lights cursed candelabrum
also, cursed lamps should sometimes fail to light, and check "spe" of
candelabrum before checking age
2002-02-09 08:13:18 +00:00
cohrs
cf37a7bac0 verb agreement
add and use new APIs, Tobjnam, otense and vtense, is_plural
to determine tense/form of verbs and a few pronouns as well
2002-02-09 00:16:35 +00:00
nethack.rankin
f750e2df4e fix B3032 -- wand of speed monster id
Make wands of speed or slow monster known if their effect
on monsters is observed; likewise for speed boots.  Also, avoid
giving odd "the bat is moving faster" when seeing a bat created
in gehennom and inaccurate "the monster is moving slower" when
a monster puts on speed boots.
2002-02-08 04:14:03 +00:00
nethack.allison
7d1e6f7d57 from Yitzhak
Add absent prototypes to some core routines.
Also add some port function() to function(void) in some win32 routines.
Also updates the Borland C Makefile for win32.
2002-02-05 13:21:43 +00:00
cohrs
f4a5823add touchstone bit 2002-02-05 04:22:23 +00:00
nethack.allison
06528d1002 3.3.2 to 3.4.0 2002-02-04 16:06:00 +00:00
nethack.allison
25b357d344 Fix problem with cloth scratching the stone From a bug report. 2002-02-03 07:48:41 +00:00
cohrs
9c851c0c1d grappling hook followup
fix a compilation bug
2002-02-02 01:59:44 +00:00