Commit Graph

8242 Commits

Author SHA1 Message Date
nhmall
cbcb1ea7eb Merge branch 'NetHack-3.6.2' 2019-01-10 09:42:38 -05:00
nhmall
9641864861 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-10 09:26:27 -05:00
PatR
b1782b813f SEDUCE=0
When SEDUCE is disabled, instead of swapping attacks in mons[] once,
do it on the fly in getmattk() whenever needed.  That allows mons[]
to become readonly, although this doesn't declare it 'const' because
doing so will require a zillion 'struct permonst *' updates to match.

This seemed trickier than it should be, but that turned out to be
because the old behavior was broken.  Setting SEDUCE=0 in sysconf or
user's own configuration file resulted in all succubus and incubus
attacks being described as monster smiles engagingly or seductively
rather than hitting (while dishing out physical damage).  I didn't
try rebuilding 3.4.3 to see whether this was already broken before
being migrated to SYSCF.
2019-01-10 03:10:35 -08:00
PatR
79d40658c7 characteristics loss
A hero run by the fuzzer that has characteristics plummet to 3 and
then sometimes hang around there instead of being recovered by restore
ability is happening because loss that tries to reduce the base value
below 3 lowers the max (peak) value instead, and once that also gets
down to 3, restore ability is no longer able to do anything with it.
This changes an attempt to reduce a characteristic by N points below 3
to reduce it by rn2(N + 1) instead.  That's N/2 on average and a 50%
chance to be 0 when N is 1, so the peak value reached doesn't plummet
to 3 quite to quickly.  It can still drop to that though.

There is a pull request dealing with simplifying attribute handling
and part of it affects the code being changed here, but the bit of
simplification included in this patch doesn't use it.
2019-01-09 18:18:11 -08:00
PatR
a637e91f37 miscellaneous formatting
Some minor stuff that's been sitting around for a while.
2019-01-09 18:15:43 -08: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
d4a469a7a6 Merge branch 'NetHack-3.6.2' 2019-01-09 09:22:46 -05:00
nhmall
580a6ab9c1 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-09 09:22:29 -05:00
nhw_cron
6e108962cb This is cron-daily v1-Jan-1-2019. guidebook updated: doc/Guidebook.txt 2019-01-09 08:44:14 -05:00
nhmall
58f2218c4e Merge branch 'NetHack-3.6.2' 2019-01-09 07:24:18 -05:00
nhmall
624aee7749 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-09 06:21:59 -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
7eee5f3a1d Merge branch 'NetHack-3.6.2' 2019-01-08 18:30:31 -05:00
nhmall
dba8ce7c07 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-08 18:30:04 -05:00
PatR
d4e3f9d9d3 travel targetting via keyboard
Some phrase substitution in getpos() or its helpers produced
``Pick a target interesting thing in view for travel''
for 'm _', which sounds pretty awkward.  Change that to be
``Pick an interesting thing in view for travel destination''
leaving "target" implied.

For plain '_', typing '!' yielded
``Using a menu to show possible targets.''
but then nothing happened.  Change that to be
``Using a menu to show possible targets for 'm|M', 'o|O', 'd|D',
and 'x|X'.''
to explain when a menu will actually appear.
2019-01-08 14:42:54 -08:00
PatR
dedd0dd30a 'm ^T' documentation 2019-01-08 13:56:59 -08:00
nhmall
6408023786 Merge branch 'NetHack-3.6.2' 2019-01-07 18:13:45 -05:00
nhmall
4f11a122c9 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-07 18:13:22 -05:00
PatR
d1deafab05 stale vptrs for obj->{nexthere,ocontainer,ocarry}
'struct obj' contains a union of mutually exclusive pointers, but
removing an obj from a list wasn't clearing whichever one had been
in use.  If something is removed from a monster's inventory, clear
the object's pointer back to that monster; if something is removed
from a container, clear the object's pointer back to that container;
and whenever something is removed from the floor, clear the pointer
to the object which followed it at that floor location.
2019-01-06 20:59:20 -08:00
nhmall
269c9a2696 Merge branch 'NetHack-3.6.2' 2019-01-06 10:56:06 -05:00
nhmall
2e80de0646 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-06 10:55:37 -05:00
PatR
a1fd4622f2 get_cost_of_shop_item() crash
More shop price determination fallout.  After the most recent change
to get_cost_of_shop_item(), using ':' inside an engulfer carrying at
least one item while inside a shop would try to follow the item's
obj->ocontainer back-link and crash when that led to the engulfing
monster rather than to a container.
2019-01-06 02:36:41 -08:00
nhmall
ba67274dbf Merge branch 'NetHack-3.6.2' 2019-01-05 10:28:34 -05:00
nhmall
a95d0bd359 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-05 10:23:24 -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
1086be1027 merge 2 2019-01-04 23:19:58 -05:00
nhmall
ebabf16ad0 Merge branch 'NetHack-3.6.2' 2019-01-04 23:08:49 -05:00
nhmall
a318908944 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-04 22:45:19 -05:00
PatR
ab5b400aec options.c formatting; glob as named fruit
This started out removing one tab and I got carried away.  It moves
some labels to column 2, removes some parentheses where sizeof is
used on strings rather than types, adds or revises several comments,
replaces a couple of 'while' loops which can be simplified as 'for'
loops, and updates named fruit handling.

"glob of black pudding" became "candied glob of black pudding" if used
as a fruit name, but "small glob of black pudding" was used as-is and
became indistinguishable from an actual small glob.  Unless you had
more than one; then you could try to check whether they merged into a
stack or coalesced into a bigger glob (but if neither of those changes
happened, you still couldn't tell which was the glob and which was the
named fruit).
2019-01-04 19:03:34 -08:00
PatR
c0cce3110e src formatting
Remove a couple of tabs, and for the affected files, put 'goto' labels
in column 2 where they're easier to spot.
2019-01-04 18:47:00 -08:00
PatR
9bcc42957b 'm ^T' menu fix
Fix fuzzer feedback.  The new wizard mode ^T menu had an early return
which bypassed destroy_nhwindow(), leaving the menu around.  Fuzzer
eventually got "No window slots!" panic from tty.  Make sure that the
menu window is torn down fully before returning.

Also, make the normal wizard mode teleportation chioce be preselected
so that not picking anything doesn't lead to an early return any more.
ESC still does though.
2019-01-04 18:28:50 -08: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
68920fdff0 Merge branch 'NetHack-3.6.2' 2019-01-03 11:18:02 -05:00
nhmall
d0e1545657 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-03 11:17:33 -05:00
PatR
b2ad4651f3 sortloot vs gems
Some object classes (such as armor and weapons) are split into
"subclasses" when sortloot applies an ordering (for armor, all helms,
then all gloves, then all boots, and so on).  Give gem class subsets.
Simple (1) valueable gem, (2) worthless glass, (3) gray stone, (4) rock
would give away information; instead, factor in discovery state and use
(1) unseen gems and glass ("gem")
(2) seen but undiscovered gems and glass ("blue gem"),
(3) discovered gems ("sapphire"),
(4) discovered glass ("worthless pieced of blue glass"),
(5) unseen gray stones and rocks ("stone"),
(6) seen but undiscovered gray stones ("gray stone"),
(7) discovered gray stones ("touchstone"),
(8) seen rocks ("rock").
If everything happens to be identified, the simpler ordering happens
(via 3, 4, 7, and 8) because the other subsets will be empty.
2019-01-02 14:20:53 -08:00
PatR
480e682454 create_particular long worm tail vs mkclass
Similar to ^G of 'I' triggering impossible "mkclass found no class 35
monsters", using a leading substring of "long worm tail" (other than
"l" and "long worm") would trigger impossible "mkclass found no class
59 monsters and kill the fuzzer when it escalates impossible to panic.
Tighten up the substring matching.

^G of '~' wasn't affected; it deliberately creates a long worm rather
than the tail of one.  But it was possible to ask for "long worm tail"
as a specific monster type and then override the switch to long worm
when prompted about whether to force the originally specified critter.
I've added a check to prevent that opportunity to override even though
a tail without a head seemed to be harmless.
2019-01-02 13:42:45 -08:00
nhmall
f0defb1111 Merge branch 'NetHack-3.6.2' 2019-01-01 19:51:41 -05:00
nhmall
4010f4d91d Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-01 19:51:05 -05:00
nhmall
194fd65a4b Merge branch 'cron-NetHack-3.6.2-beta01' into NetHack-3.6.2-beta01 2019-01-01 19:50:17 -05:00
nhmall
ed2f2cc575 README update 2019-01-01 17:56:21 -05:00
nhw_cron
94aecd5ca0 This is cron-daily v1-Dec-30-2019. levcomp updated: sys/share/lev_comp.h sys/share/lev_yacc.c 2019-01-01 17:19:21 -05:00
nhw_cron
b2b5a7a257 This is cron-daily v1-Dec-30-2019. files updated: Files 2019-01-01 17:19:19 -05:00
nhw_cron
55e6a0986c This is cron-daily v1-Dec-30-2019. guidebook updated: doc/Guidebook.txt 2019-01-01 17:19:13 -05:00
nhw_cron
a2649ae879 This is cron-daily v1-Dec-30-2019. dgncomp updated: sys/share/dgn_comp.h sys/share/dgn_yacc.c 2019-01-01 17:19:11 -05:00
nhmall
cb25676c43 update for 2019 2019-01-01 11:48:30 -05:00
nhmall
be5998b6e4 Merge branch 'NetHack-3.6.2' 2019-01-01 08:37:25 -05:00
nhmall
d60cd7200e Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-01 08:37:01 -05:00
PatR
4fc49a22de tweak the Astral Plane level
Even out the difficulty (from one game to another) somewhat.  Instead
of a 75% chance that two large areas will be opened up on the left
and right sides of the arrival area plus 13.5 (avg) * 1.5 (avg) extra
monsters in that region, change to 60% chance that the left side will
be opened up with 7 (avg) * 1.5 (avg) extra monsters and a separate
60% chance that the right side will be opened up with 7 * 1.5 (avg)
extra monsters.  The chance that both sides get opened up drops to
36% but the chance that neither side gets opened drops to 16%, with
difference made up by 24% chance each for just one side or the other.

I was a little surprised that this actually worked.  I hope there's
a less clumsy way to have a loop index.
2018-12-31 16:48:14 -08:00
nhmall
c2777860e9 incorrect header 2018-12-30 22:02:42 -05:00
nhmall
8db202d90f Merge branch 'NetHack-3.6.2' 2018-12-30 21:45:25 -05:00