Commit Graph

1657 Commits

Author SHA1 Message Date
nhmall
cbcb1ea7eb Merge branch 'NetHack-3.6.2' 2019-01-10 09:42:38 -05:00
PatR
bb86fa2bb7 hero infravision
Take a first step towards making the mons[] array be readonly.
The only other place that updates it is when changing succubus and
incubus AD_SSEX attacks to AD_SEDU ones and that can be handled
via existing getmattk(), but so far has proven to be trickier than
anticipated.
2019-01-09 18:10:55 -08:00
nhmall
58f2218c4e Merge branch 'NetHack-3.6.2' 2019-01-09 07:24:18 -05:00
PatR
dd13b10cf2 make zeroany, zeromonst, zeroobj 'const'
They're never modified.  Minor complication:  &zeroobj is used as
a special not-Null-but-not-an-object value in multiple places and
needs to have 'const' removed with a cast in that situation.
2019-01-09 01:13:01 -08:00
nhmall
ba67274dbf Merge branch 'NetHack-3.6.2' 2019-01-05 10:28:34 -05:00
PatR
ab1bee1778 fix #H7865 - shop prices for container contents
The recent attempt to have looking inside a container show shop
prices had multiple problems.  Worst one was showing shop prices as
if the hero would be buying for items already owned by the hero.
Item handling inside containers on shop floor was inconsistent:  if
shop was selling those items, they would include a price, but if not
selling--either already owned by hero or shopkeeper didn't care about
them--they were only marked "no charge" if hero owned the container.

This is definitely better but I won't be surprised if other obscure
issues crop up.  Gold inside containers on shop floor is always owned
by the shop (credit is issued if it was owned by the hero) but is not
described as such.
2019-01-05 03:21:39 -08:00
nhmall
ebabf16ad0 Merge branch 'NetHack-3.6.2' 2019-01-04 23:08:49 -05:00
PatR
600261d81f fix github #172 - ^T inconsistencies; add m^T
Fixes #172

Casting teleport-away via ^T used different requirements for energy,
strength, and hunger than casting it via 'Z'.  The strength and hunger
requirements were more stringent, the energy one more lenient.  When
it rejected a cast attempt due to any of those, it used up the move,
but 'Z' didn't.

When testing my fix, I wanted an easier way than a debugger to control
how ^T interacts with wizard mode, so finally got around to a first
cut at being able to invoke it via wizard mode but not override those
energy/strength/hunger requirements.  It uses the 'm' prefix to ask
for a menu.  'm^T' gives four options about how to teleport.  (There
are other permutations which aren't handled.)

Also noticed while testing:  ^T wouldn't attempt to cast teleport-away
if you didn't know the corresponding spellbook.  'Z' will attempt that
because it is possible to forget a book and still know its spell.
2019-01-03 17:37:00 -08:00
nhmall
f0defb1111 Merge branch 'NetHack-3.6.2' 2019-01-01 19:51:41 -05:00
nhmall
cb25676c43 update for 2019 2019-01-01 11:48:30 -05:00
nhmall
8db202d90f Merge branch 'NetHack-3.6.2' 2018-12-30 21:45:25 -05:00
PatR
da40f55a9f 'O' vs bouldersym
The 'O' handling for bouldersym was updating the display value for
boulder even if the value had been rejected, and if it still had the
default of '\0', the map would end up with <NUL> characters.  (When
examined via '//' or ';', those matched dummy monster class #0 and
led to the impossible "Alphabet soup: 'an("")'" that was suppressed
yesterday.)

Attempting to set bouldersym to ^@ or \0 would also be rejected as
duplicating a monster symbol.  That is now accepted and used to reset
the boulder symbol to default.  However, other control characters are
also accepted--not due to this patch, they already are, and from a
config file in addition to via 'O'--so bouldersym can still disrupt
the map.  But that's no different from putting control characters
into a symbol set or setting them from config file via S_foo:^C.
2018-12-30 15:30:38 -08:00
nhmall
fac470096b Merge branch 'NetHack-3.6.2' 2018-12-29 12:37:27 -05:00
nhmall
eed7c4bdd1 nttty topten output processing
switch back to using the safe routines
after tty port exits on Windows console
tty port.

Fixes H7758
1613
2018-12-29 12:26:33 -05:00
nhmall
178aae42f4 Merge branch 'NetHack-3.6.2' 2018-12-27 22:47:26 -05:00
PatR
c056ca1b35 fix github issue #170 - stacks of non-missiles
Fixes #170

Monsters never throw athames or scalpels but some fake player monsters
on the Astral Plane are given those.  Since they're stackable the
quantity usually gets boosted but there's no point in having more than
one if they won't be thrown.

This could have been fixed by letting monsters throw those two items,
but I prevented the quantity from being boosted instead.
2018-12-27 18:36:26 -08:00
nhmall
fb42fb47c8 Merge branch 'NetHack-3.6.2' 2018-12-27 17:42:14 -05:00
PatR
a6b4322034 fix #H7103 - shop pricing
Player came across a stack of 2 gray stones in a shop and kicked one.
That one ended up with a different (in his case, lower) price once it
was separate.  This behavior only applies to non-glass gems which add
a price variation derived from internal ID (obj->o_id) number.  Make
splitting stacks always yield the same price per item in the new stack
as was being charged in the old stack by choosing a similar o_id.  Do
it for all splits (that can vary price by ID, so just non-glass gems),
not just ones performed inside shops.

He picked up the lower priced one and dropped it back on the original
higher priced one; the combined stack took on the lower price.  That
will no longer happen if they come from splitting a stack, but this
fix doesn't address merging with different prices when they start out
as separate stacks.  (Unpaid items won't merge in inventory if prices
are different, but shop-owned items will merge on floor.)
2018-12-27 14:12:48 -08:00
Bart House
deb220c7c1 teleport and topten globals moved to instance globals. 2018-12-25 18:30:48 -08:00
Bart House
ed096f74c3 shk followmsg moved to instance globals. early_init introduced. 2018-12-25 17:46:52 -08:00
Bart House
cfb0e3ef78 Use MAX_LAN_USERNAME to determine if we should declare lusername. 2018-12-25 17:25:31 -08:00
Bart House
c2f562e41c Define lan globals only if LAN_FEATUES is defined 2018-12-25 17:22:39 -08:00
Bart House
769ad91cc3 mthrowu, nhlan, options, regions, rip and role globals moved to g. 2018-12-25 16:26:27 -08:00
Bart House
c67f7e5122 globals from files.c moved to instance globals. 2018-12-25 12:56:27 -08:00
Bart House
b1ab64db43 program_state moved to g. 2018-12-25 10:09:04 -08:00
Bart House
16db7498d0 UNIX, VMS, DEF_PAGER, MICRO and MFLOPPY globals moved to g. 2018-12-25 09:34:24 -08:00
Bart House
0763046c38 zeroX, tc_gbl_data and fqn_prefix moved to instance globals. 2018-12-25 08:09:37 -08:00
Bart House
1c65e6afe0 context to g.context 2018-12-25 07:29:38 -08:00
Bart House
8c1a4d9a97 invent, youmonst, hackdir moved to g. 2018-12-24 21:04:15 -08:00
Bart House
90547edb83 moves, monstermoves, wailmsg, migrating_objs and billobjs moved to g. 2018-12-24 20:22:33 -08:00
Bart House
be5cdcf77a killer, level and rooms move to instance globals. 2018-12-24 19:50:08 -08:00
Bart House
572ee347b9 Another round of instance globals changes. 2018-12-24 16:43:50 -08:00
Bart House
62e1a45b60 Merge branch 'win-wip3.7' into win-wip3.7-bart
Conflicts:
	src/end.c
2018-12-24 12:09:42 -08:00
nhmall
a229a8a56d Merge branch 'NetHack-3.6.2' 2018-12-24 06:44:27 -05:00
PatR
7bc36ddef4 fix #H6942 - dropx vs hold_another_object
Dropping an existing fragile item while levitating will usually
break it.  Getting a new wished-for fragile item and dropping it
because of fumbling or overfull inventory never would.

Some callers of hold_another_object() held on to its return value,
others discarded that.  That return value was unsafe if the item
was dropped and fell down a hole (or broke [after this change]).
Return Null if we can't be sure of the value, and make sure all
callers are prepared to deal with Null.
2018-12-23 12:37:26 -08:00
Bart House
74edf42f1c Moved decl.c globals into instance globals. 2018-12-22 18:44:22 -08:00
Bart House
c8ae68b06a Merge branch 'win-wip3.7' into win-wip3.7-bart
Conflicts:
	src/o_init.c
2018-12-22 13:22:58 -08:00
PatR
4159dd985a fix #2468 - killer bees without a queen
Seven year old suggestion was to have a killer bee eat royal jelly if
there was no queen around, then after a short delay it would become a
queen.  This does that, with "no queen around" being "no queen bee on
current dungeon level" and the transformation happening immediately
with the "short delay" taking place after.

Pet killer bees will target nearby royal jelly if there's no queen,
hostile killer bees will only eat it if they happen to walk on the
same spot as one.  Both types accept either tame or hostile queen bee
as an existing queen.

Killer bees eating royal jelly will drop dead if queen bees have been
genocided, and aren't smart enough to avoid the instinct to eat such
if/when that happens to be the situation.
2018-12-21 16:59:01 -08:00
nhmall
bba5d14dca Merge branch 'NetHack-3.6.2' 2018-12-21 09:38:22 -05:00
PatR
0e58316109 fix #H2680 - IDing unpaid gem should adjust price
Another one from 6.5 years ago, identifying a type of gem should give
a new price for any unpaid gems of that type and adjust shopping bill
accordingly.  Report was for rubbing with touchstone and learning
worthless glass with price not changing until the learned 'gem' was
dropped.  Fix works for that and also other forms of identification
(and for amnesia, raising prices of forgotten gems); no dropping is
required for the price to change.

Theoretically could apply to any type of item, but prices of gems are
by far the most sensitive to whether or not they're identified.
2018-12-21 01:14:45 -08:00
nhmall
47f936ad53 Merge branch 'NetHack-3.6.2' 2018-12-20 08:04:49 -05:00
Bart House
605667b470 Add missing comment from hackpid declaration. 2018-12-19 21:27:31 -08:00
Bart House
576eece500 More globals moved to instance_globals. 2018-12-19 21:26:35 -08:00
Bart House
cb42021389 Last big push for moving globals to instance_globals. 2018-12-19 20:01:56 -08:00
Bart House
af949cb1df Moving globals to instance_globals part 10ish. 2018-12-19 20:01:56 -08:00
Bart House
f312b8cfe6 Even more globals moved to instance_globals. 2018-12-19 20:01:56 -08:00
Bart House
e4ab048c90 Even more globals moved to instance_globals.c 2018-12-19 20:01:55 -08:00
Bart House
ff5fe26e72 More globals moved to instance_globals. 2018-12-19 20:01:55 -08:00
Bart House
3645e415e3 Moved more globals to instance_globals. 2018-12-19 20:01:55 -08:00
Bart House
f1e48cddfe artifact.c, cmd.c and makemon.c globals moved to instance_globals. 2018-12-19 20:01:55 -08:00