Commit Graph

43 Commits

Author SHA1 Message Date
nethack.allison
6b47ae351d more NOCWD_ASSUMPTIONS
The NOCWD_ASSUMPTIONS conditional code allows readonly
parts of NetHack to be separated from areas that require write-access.
This allows the recent panic log needed a prefix.
2002-06-29 12:44:54 +00:00
cohrs
2e2ce4effa the panic log
Add an optional paniclog file, controlled by a new PANICLOG macro that can
be used to log all panic and impossible messages.  Helpful when people
forget to send, or didn't see, the message.
2002-06-02 18:49:18 +00:00
cohrs
2c26ea1dd5 R809 - newcham message reorganization
Add a param to newcham() to let it print "The oldmon turns into a newmon!"
rather than always printing this externally.  Should ensure a good ordering
of the messages.  Also put some special name handling in one place and
catch a couple cases where "saddled" was printed, resulting in funny messages.
2002-04-23 06:15:52 +00:00
cohrs
86f961ba3f crash fix: shopkeeper re-entering shop
- when a shopkeeper leaves the shop to chase the player, and the player
enters the shop, bill_p is set to an unusual value.  bill_p needs to be set
back to a valid value if the shopkeeper re-enters the shop.
- Also, the u.ushops state needs to be updated when a shop becomes tended
again if the player is in the shop.
- introduce a new after_shk_move function to handle this
2002-04-15 06:43:55 +00:00
cohrs
1b321e92bc remove prescient travel command behavior
Addresses reports R718, R772.1, <Someone> P's extra move bug
- when there is a previously seen path or a straight path, always take it
- incorporate fix to ensure no extra "." turn at the end of traveling, but
 still avoid stepping into traps/pools, et al
- include a general "G"-command (and travel) fix to avoid stepping in
 known pools/lava while blind
- when there is no such path, "guess" at a path by finding an intermediate
 location that the hero couldsee that is closest to the actual goal, the
 intermediate goal is re-determined at each step
- when Blind, don't use couldsee for determining straight paths, just direction
- do not consider doors or most boulders obstacles for picking travel
 paths, test_move has a new mode to differentiate this case from the regular
 test case
- don't include known trap locations in the travel path, avoids unnecessary
 stops along the way, and usually doesn't affect the path length
- reformatted the code a bit so I could follow it
2002-04-13 16:00:13 +00:00
nethack.rankin
812b53799d multiple iron bars fixes
Can't push boulders through iron bars; traps can't roll such through either;
	likewise for objects thrown by monsters.
Thrown objects susceptible to breaking might do so when they hit iron bars.
Assorted monsters can pass through iron bars; ditto for polymorphed character.
Attempting to dig iron bars will wake nearby monsters instead of yielding
	"you swing your pick-axe through thin air".
Autodig won't accept iron bars as candidate location.
2002-04-07 10:43:59 +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
kmhugo
9e60327b01 lootabc and showrace options
Replace "feature_toggle" implementation with an easier-to-understand
boolean option called "lootabc".

Provide "showrace", an option to display the hero by race glyph rather
than by role glyph.

Document the above.

Remove some obsolete Mac options.
2002-03-31 06:27:27 +00:00
nethack.allison
51f9892b3b Allow MICRO and WIN32 code paths to diverge
There's still a lot of overlap for 3.4.1, but not
100% any longer and it facilitates some improvements
- Allow error save files on WIN32
2002-03-30 19:09:56 +00:00
nethack.rankin
11b1874090 more wielded/quivered iron ball
There was at least one more special case aside from throwing
(jetisoning items to reduce weight after falling in water) which
have needed the same extra code.  This is a more general fix.
2002-03-30 09:50:59 +00:00
nethack.allison
224eddc1d3 generic feature_toggle
This adds a generic feature_toggle mechanism to
the game.  Code that wants to offer two different
ways of doing something can add an entry to
feature_toggles[] (in decl.c), and create a
preprocessor macro for its array index in decl.h.

Then the code can test it using
if (feature_toggle(FEATURE_NAME))
	..do_this..
else
	..do_that..

The player can toggle the alternate code path
on using OPTIONS=feature_toggle:feature_name_1 feature_name_2 ...

This seems better than creating brand new options
for controlling features (ala prayconfirm, which
could switch to this single option feature_toggle
mechanism as well)

My first use of it is to allow toggling of the selectors
on the loot menu, which I'm hesitant to just change back
because now people are actively using the new selectors and
the complaints would be really loud if the interface were
to just switch back after they adjusted.

The default behaviour is the new behaviour "iob", but with an
OPTIONS=feature_toggle:loot_menu_selectors
in your config file, it will revert to using "abc" as it did
in 3.3.1. I'll add a Guidebook page of "features/behaviour
that can be toggled" later.

The toggles can only be done in defaults.nh, and are
not saved with the game.
2002-03-26 05:33:04 +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
jwalz
3e6e2ff7c6 Lint part 2, mostly parameters. 2002-03-10 04:05:59 +00:00
jwalz
bab78d03c8 Lint part 1, unused variables, routines, and return codes. 2002-03-10 00:30:53 +00:00
arromdee
a5b8144dd1 wizkit messages for gold
This prevents wizkit items that aren't objects from having their names
printed on the screen if they are gold pieces, traps, or similar.

(Note that the only one of those that actually works is gold.  For some reason
if you put "a hole" (for instance) in the wizkit, the hole will not get
created, even though it will, even on the stairs, if the wizard wishes for it
in-game.)
2002-03-03 05:01:09 +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
nethack.allison
24956e3b53 The unpaid cost displayed in your inventory now
includes container contents, not just the cost of the
container itself (a prices in inventory phenomenon).

Along the way I discovered a peculiarity -
contained_cost() was adding up the cost of everything in
a container, even if you had stashed items in it that were your
own and not marked unpaid it seems.

I added a flag to force the code to only add objects
that were marked "unpaid" so I could use it in this new
instance, but I didn't change any of
the existing usages (I left the flag at FALSE which leaves
the consideration of the unpaid status alone just as
before).

Some of this is correction of some messages that were
wrong prior to this when dealing with selling of objects
inside a container when only part of the contents was unpaid.
2002-02-25 19:14:42 +00:00
cohrs
ae9f38222e add_sound_mapping cleanup
- avoid several buffer overflows
- move use of access() to files.c in new can_read_file() function
- remove extra newlines in raw_print() calls
- get ready for lint, eg sprintf -> Sprintf
- generally make the code look like core code, not Qt code
2002-02-21 03:33:42 +00:00
nethack.rankin
81684b1672 high-end monster tuning
Strengthen Death by making his "drains your life force"
result take away some max HPs to augment the ordinary damage
it does.  The chance for that effect is reduced from 80% to
75% though.  Weaken Famine, Pestilence, and Demogorgon by
preventing them from hitting with both of their disease or
hunger attacks on the same turn.  When their first attack
hits, the second now gets treated as a stun attack, but if
the first one misses then the second is unchanged and yields
another chance to deliver the disease or hunger effect.
2002-02-19 03:38:31 +00:00
cohrs
cad85663de purple worm digestion
Generally modify the AD_DGST damage type so that:
- players and pets get no AD_DGST nutrition from G_NOCORPSE monsters
- undead no longer convey any nutrition, to either monsters or you-as-monster
  I decided on this based on the age typically assigned to undead corpses.
- digestion conveys 50% or normal nutrition, and takes 25% the time to eat.
- all AD_DGST attacks are now subject to gas spore explosions, including player
2002-02-18 23:36:46 +00:00
cohrs
c1a3682952 "The" Invocation items in farewell message followup
use and export the_unique_obj() for the test, to ensure consistency
2002-02-12 05:42:08 +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
4b364d6927 modifying 'O' command behavour
I was asked how a window-port controls which options are
set to SET_IN_FILE, DISP_IN_GAME, or SET_IN_GAME.

This provides a run-time way to change an option's SET_IN_FILE,
DISP_IN_GAME, or SET_IN_GAME status through code, rather
than clog up options.c with a lot of compile-time #ifdefs
for different ports to offer different default option settings.
Update the documentation to reflect this.
2002-02-07 03:23:55 +00:00
nethack.allison
06528d1002 3.3.2 to 3.4.0 2002-02-04 16:06:00 +00:00
nethack.allison
cb6a93641b Adjust window-port related option processing
to allow common parsing in the core, and direct access to the
results by the window port.

Notes:

o Adds a new field, wincap, to the window_procs
structure for setting bits related to the preference
features that the window port supports.  This allows
run-time determination of whether a particular option
setting is applicable to the running window port.  A
window-port is free to support as many, or as few,
of the available options as it wants.  Ensure that
only the ones supported have their corresponding bit
set in window_proc.wincap. [see chart in
doc/window.doc for help with that.]

o The settings I stuck into wincap for each window
port are almost certainly not accurate, so each port
team should review them.  You should only include
the ones that you will actually react to and make
adjustments for if the user changes that option.
Without the setting in wincap, the option won't even
show up in the 'O'ptions menu.

o preference_update() added to the window-port
interface, so that the window-port can be notified
if an option of interest (an option with its
corresponding bit set in wincap field) is
changed.

o provided a genl_preference_update() routine in
windows.c and used it for all the existing
window ports since they don't have a functional
one of their own yet.

o this messes around heavily with iflags and the options
arrays in options.c

o I hope I didn't break any port's existing code. I
tried not to.  The Mac however, in particular, should
be looked at because it suffered a namespace collision
with what I was working on around fontname.  It had
Mac specific font stuff in options.c. Please test
the Mac.
2002-02-03 05:31:47 +00:00
kmhugo
532242f07f Artifact prices
Each artifact has its own individual price, rather than being solely
based on the cost of its base item.
2002-02-02 19:21:33 +00:00
cohrs
f73a1879c9 landmines and boulders
Make pushing a boulder onto a landmine share code with the trap case,
resulting in pits, waking sleepers, et al.
Don't leave a boulder suspended over the new pit, fill it.
Make sure any remaining boulder is placed on top of the pile.
If player sets off landmine, monsters killed are credited to/blamed on player.
2002-01-25 06:38:42 +00:00
arromdee
166affb0f9 polymorphed quest leader
Duuuh.  Of course adding objects already changed the editlevel.

Anyway, here's the fix I was working on.  It only matters in a very obscure
situation.  (Also, the quest leader still speaks no matter what he's
polymorphed into.)
2002-01-21 22:15:22 +00:00
nethack.allison
f2fe0a3d5c The word "zorkmid" was hard-coded in format strings all
over the place.

Often they would use
	"%ld zorkmid%s", amt, plur(amt)
but not consistently, so some of the hard-coded usage
could result in "1 zorkmids"

This adds the function
	currency(long)
to return the name of the currency, either plural
or singular depending on the argument passed to it.
That eliminates the need for the extra %s in the
format string and the use of the plur() macro.
2002-01-21 03:35:04 +00:00
nethack.rankin
e2175c2ce1 stale spellbook pointer
If you get interrupted while reading a spellbook and then
the book gets destroyed or you change levels, the object pointer
remembered for the book will be invalid and could accidentally
match one subsequently allocated to some other book.  That would
result in "you continue your efforts to memorize the spell" when
starting to read that other book; it would also end up bypassing
the reading difficulty check and reuse the old book's delay counter.

     I don't remember who reported this.  It was quite some time
ago and I have an abandoned patch dated last March from when I
first started to fix it.

Files patched:
  include/extern.h
  src/save.c, shk.c, spell.c
2002-01-20 09:53:36 +00:00
nethack.rankin
36511f2280 compile fix 2002-01-20 09:22:16 +00:00
cohrs
e7bdcb157f lava effects for monsters and objects
This patch, based on code sent to us by <Someone> well over a year ago, addresses
bugs recently resurfaced.  Namely, that lava does not generally do anything
to monsters or objects that land in java.  Newly renamed minliquid() handles
both water and lava, and new fire_damage() is used similar to water_damage().
2002-01-20 07:04:18 +00:00
arromdee
bfbf1d6c30 monster spells
This fixes the problem with my monster spell changes which let monsters
summon monsters around you when they don't even know you're around.

The summoned monsters should appear where the monster thinks you are, if
you're invisible or displaced.

I have not prevented them from summoning monsters when you are in a temple,
nor have I prevented them from aggravating monsters several times when you're
out of sight.

Messages should be a little smarter, taking into account number of monsters
and invisibility/displacement.

--Ken A
2002-01-20 06:17:20 +00:00
kmhugo
bb88bd1a4a Jousting
Players wielding a lance while riding will "joust" monsters
they attack.

Note that monsters don't get pushed into inaccessable tiles such
as walls, doors, iron bars, water, or lava; they stay at the edge.
Further refinements are possible for these cases.
2002-01-20 05:44:46 +00:00
nethack.rankin
43a1eadc9c lookat of high priests
One from <Someone>'s list:  there's no particular reason for
the High Priest of Moloch in the temple on the sanctum level in
Gehennom to have his identity concealed when he's detected from
a distance.  I also changed the concealment of the Astral Plane
to stop when you're adjacent to the priest, since #chat--among
other things, such as simply entering the temple--provides other
means of identifying which temple it is once you're there.

Files patched:
  include/extern.h
  src/do_name.c, pager.c
2002-01-19 06:52:03 +00:00
arromdee
f93521e95d wizard #poly and #levelgain
This adds the wizard #poly and #levelgain commands.
2002-01-17 02:47:23 +00:00
arromdee
4361289ec3 BUC patch
This adds the BUC-patch, except that it includes four separate choices for
blessed/cursed/uncursed/unknown.  The patch only applies to full menu styles.

--Ken A

(Incidentally, I have a suggestion: when deciding what's the first line for
purposes of mailing out messages, use the first nonblank line...)
2002-01-16 03:19:45 +00:00
arromdee
4b6b5d7b8c This adds in <Someone>'s autodig patch. 2002-01-15 02:50:36 +00:00
arromdee
b09c3e2e69 Fixing a buglist bug. Also changing an unrelated buglist item a bit (it was
mine to begin with, I thought I had a way to fix it but it turns out I didn't,
so I was researching it again).

Checked into CVS.
2002-01-13 20:37:18 +00:00
arromdee
157840766d Finally overhauled some spell stuff. --Ken A.
Summary of spell changes:
-- wimpiness of 'default' spell fixed by doing half damage for magic resistance
instead of 1 damage, and using half monster level instead of 1/3.  It may
still need tweaking, but is much better than before.
-- 'default' spell for cleric monsters is now the wounds spell, by analogy with
wizard monsters.
-- added clerical lightning strike, flame strike, gush of water
-- all spells should now say the monster is casting a spell, and all spells
should have messages.  (Side effect: monsters speeding up by other means
also give a message saying so).
-- casting undirected spells is not affected by whether the monster knows
where you are.  Monsters that are attacking your displaced image, that are
several squares away, or that are peaceful can use undirected spells.
-- messages should correctly say whether the spell is undirected (a monster
was always casting at thin air or pointing at you and cursing, without checking
to see if the spell wouldn't require pointing)
-- Monsters which are attacking your displaced image, etc. use up mspec_used.
If they are casting an undirected spell, the spell still works.
-- Monsters which are not attacking can cast spells that don't attack.
-- If a monster didn't have ranged spellcasting ability (which most don't),
it would print a curse message from buzzmu() every round it was at range,
creating a useless stream of constant curse messages

I still haven't made spellcasters "smarter" in the sense of noticing whether
you have reflection, fire resistance, etc.  That opens a big can of worms
because it would mean giving monsters a memory.

Known bug: the higher level a monster is, the more spells it has; since it
chooses a noncombat spell by randomly picking a spell and casting if it
happens to be noncombat, the higher level the monster is the greater the
chance of getting nothing.
2002-01-11 01:09:07 +00:00
cohrs
c77073be31 sync changes since last snapshot 2002-01-07 02:12:04 +00:00
jwalz
6706292233 *** empty log message *** 2002-01-05 21:05:47 +00:00