]> granicus.if.org Git - nethack/log
nethack
5 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
nhmall [Sat, 7 Mar 2020 19:36:24 +0000 (14:36 -0500)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

5 years agomerge bit
nhmall [Sat, 7 Mar 2020 19:36:03 +0000 (14:36 -0500)]
merge bit

5 years agoFix wizmakemap to consider monster birth counts and uniques
Pasi Kallinen [Sat, 7 Mar 2020 19:33:31 +0000 (21:33 +0200)]
Fix wizmakemap to consider monster birth counts and uniques

Also add a new wizmode command #wizborn to show those.

5 years agoremove mhitm.c's 'otmp'
PatR [Sat, 7 Mar 2020 19:20:45 +0000 (11:20 -0800)]
remove mhitm.c's 'otmp'

Get rid of a couple of variables that were file scope and then
incorporated into 'g'.  This should prevent the situation where
attacking a shade gave bogus feedback about glorkum although I
never did reproduce that.

This eliminates g.otmp and g.dieroll but leaves a couple of others.
g.vis really should go away....

5 years agoMerge NetHack 3.6 updates into NetHack-3.7
nhmall [Sat, 7 Mar 2020 19:08:40 +0000 (14:08 -0500)]
Merge NetHack 3.6 updates into NetHack-3.7

5 years agomon's glorkum pass harmlessly through the shade
PatR [Sat, 7 Mar 2020 18:47:51 +0000 (10:47 -0800)]
mon's glorkum pass harmlessly through the shade

I couldn't reproduce the problem; it appears to depend upon whether
the file-scope variable 'otmp' has a stale value, and that might
happen after a monster has tried to steal mon's saddle.  However,
the code pointed out in the report is clearly wrong.  This prevents
feedback of "glorkum" (with plural verb since quantity of 0 isn't 1),
but the potential stale value hasn't been dealt with.

5 years agoupdate visual studio props file
nhmall [Sat, 7 Mar 2020 16:45:35 +0000 (11:45 -0500)]
update visual studio props file

5 years agoclear travis boolean prerelease flag as well
nhmall [Sat, 7 Mar 2020 16:38:42 +0000 (11:38 -0500)]
clear travis boolean prerelease flag as well

5 years agoupdate .travis.yml
nhmall [Sat, 7 Mar 2020 16:32:50 +0000 (11:32 -0500)]
update .travis.yml

5 years agofixes doc bit
Pasi Kallinen [Sat, 7 Mar 2020 15:18:19 +0000 (17:18 +0200)]
fixes doc bit

Previous commit should've been:

Fixes #311

5 years agoFix flipping non-existent stairs
Pasi Kallinen [Sat, 7 Mar 2020 15:05:39 +0000 (17:05 +0200)]
Fix flipping non-existent stairs

If the stair or ladder x coord is 0, it doesn't exist.
Flipping it, caused "u_on_newpos: trying to place hero off map <80,0>"
when coming back up from the valley into the castle, and the
castle was flipped.

Fixes #331

5 years agolua special level feature flags
Pasi Kallinen [Fri, 6 Mar 2020 18:17:23 +0000 (20:17 +0200)]
lua special level feature flags

Allow des.feature() to set rm flags for the special features.

5 years agofix #H4545 - stack of scrolls of scare monster
PatR [Fri, 6 Mar 2020 17:24:33 +0000 (09:24 -0800)]
fix #H4545 - stack of scrolls of scare monster

Reported 3.5 years ago.  Specifying a count for pickup to pick up a
subset of a stack was processed after scrolls of scare monster were
handled, so a whole stack of those got picked up or crumbled to dust
whether you gave a count or not.  Also, if you were too encumbered to
pick up the full stack, they still all crumbled or all changed state
to crumble next time, then for the latter case you picked up as big a
subset as you could handle.

5 years agoone more redundant entry
nhmall [Fri, 6 Mar 2020 17:01:59 +0000 (12:01 -0500)]
one more redundant entry

5 years agoremove redundant entries that are now in fixes36.6
nhmall [Fri, 6 Mar 2020 16:58:23 +0000 (11:58 -0500)]
remove redundant entries that are now in fixes36.6

5 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Fri, 6 Mar 2020 16:24:07 +0000 (11:24 -0500)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

5 years agoThis is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt
nhw_cron [Fri, 6 Mar 2020 16:24:08 +0000 (11:24 -0500)]
This is cron-daily v1-Jan-20-2020.  guidebook updated: doc/Guidebook.txt

5 years agomerge bits
nhmall [Fri, 6 Mar 2020 16:30:39 +0000 (11:30 -0500)]
merge bits

5 years agoamiga .gitattributes bit
nhmall [Fri, 6 Mar 2020 16:04:24 +0000 (11:04 -0500)]
amiga .gitattributes bit

5 years agoREADME bit
nhmall [Fri, 6 Mar 2020 16:00:51 +0000 (11:00 -0500)]
README bit

5 years agoMerge March 2020 changes into NetHack 3.7
nhmall [Fri, 6 Mar 2020 15:59:50 +0000 (10:59 -0500)]
Merge March 2020 changes into NetHack 3.7

5 years agoMarch 2020 updates
nhmall [Fri, 6 Mar 2020 15:31:51 +0000 (10:31 -0500)]
March 2020 updates

5 years agoavoid #wizrumorcheck crash on bad rumor input
PatR [Thu, 5 Mar 2020 21:55:45 +0000 (13:55 -0800)]
avoid #wizrumorcheck crash on bad rumor input

If either rumors.tru or rumors.fal was empty when makedefs made
'rumors', init_rumors() will set true_rumor_size to -1 to indicate
that rumors aren't available.  It also closes the input file, and
then #wizrumorcheck closed that again, triggering a crash in the
dlb code.

Fortune cookies and oracles work ok (just not very interesting)
when rumors aren't available.  Only the check command had trouble
with that.

5 years agofixes update
nhmall [Wed, 4 Mar 2020 21:01:50 +0000 (16:01 -0500)]
fixes update

5 years agofix github issue #302 - divide by 0 crash
PatR [Sat, 22 Feb 2020 09:41:04 +0000 (01:41 -0800)]
fix github issue #302 - divide by 0 crash

The traceback points directly to the problem:  divide by 0 happens
if the 'bogusmon' file only contains the "do not edit" line, which
would happen if 'bogusmon.txt' is empty.  makedefs probably ought to
complain about that.

There is now one hardcoded bogus monster to fall back to:  'bogon'.

Random tombstone epitaphs report divide by 0 if their text source is
empty, but it is done by rn2() rather than rn2_for_display_rng() so
is just a warning for pre-release code.  It would crash for release
version though.

I tried placing an empty engravings file and expected similar results
but didn't see any response.  Not sure what that means.

After the fix, empty epitaph file yields blank result so graves that
want a random epitaph won't have any epitaph.

Fixes #302

5 years agomore #302 - empty {bogusmon,engrave,epitaph}.txt
PatR [Sat, 22 Feb 2020 20:32:00 +0000 (12:32 -0800)]
more #302 - empty {bogusmon,engrave,epitaph}.txt

Have makedefs add a real data line to the output for the files that
caused trouble when empty.

5 years agoLua tests for map and room contents
Pasi Kallinen [Wed, 4 Mar 2020 20:07:10 +0000 (22:07 +0200)]
Lua tests for map and room contents

5 years agoLua: Add contents function to room and map
Pasi Kallinen [Wed, 4 Mar 2020 18:04:01 +0000 (20:04 +0200)]
Lua: Add contents function to room and map

The function will get the map/room width and height as a parameter.

5 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Wed, 4 Mar 2020 16:24:08 +0000 (11:24 -0500)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

5 years agoThis is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt
nhw_cron [Wed, 4 Mar 2020 16:24:05 +0000 (11:24 -0500)]
This is cron-daily v1-Jan-20-2020.  guidebook updated: doc/Guidebook.txt

5 years agoupdates for 3.6 March 2020
nhmall [Wed, 4 Mar 2020 15:41:57 +0000 (10:41 -0500)]
updates for 3.6 March 2020

5 years agoupdate to Install.nt
nhmall [Wed, 4 Mar 2020 15:31:48 +0000 (10:31 -0500)]
update to Install.nt

5 years agocorpse_xname() fix
PatR [Wed, 4 Mar 2020 09:58:22 +0000 (01:58 -0800)]
corpse_xname() fix

Potential write out of bounds, in front of the block of obufs.
Not exploitable but could conceivably trigger a crash.

5 years agomatch_str2clr() fix
PatR [Wed, 4 Mar 2020 00:46:04 +0000 (16:46 -0800)]
match_str2clr() fix

Integrity fix.  Make sure color values obtained via atoi() are sane
so that use as array indices can't go out of bounds.

5 years agobuild fix for vs2019
nhmall [Tue, 3 Mar 2020 23:34:27 +0000 (18:34 -0500)]
build fix for vs2019

src\nhlsel.c(604) : error C4703: potentially uninitialized local pointer variable 'mf' used

5 years agoreglyph_darkroom map traversal
PatR [Tue, 3 Mar 2020 00:33:43 +0000 (16:33 -0800)]
reglyph_darkroom map traversal

5 years agoMister Fantastic's sea monster form
PatR [Mon, 2 Mar 2020 23:58:42 +0000 (15:58 -0800)]
Mister Fantastic's sea monster form

While polymorphed and underwater, an eel bite killed the hero who
rehumaized and crawled out of the water, then the eel continued with
its second attack and "wrapped itself around you" even though no
longer adjacent.  That's a long reach....

| ...@.
| .;}..
| .}}..

Make any additional attacks silently miss if hero changes location
during the attack sequence of a monster who has pinpointed the hero.

5 years agoconditional status condition tracking
PatR [Mon, 2 Mar 2020 23:16:50 +0000 (15:16 -0800)]
conditional status condition tracking

If 'sinking-into-lava' is disabled as a displayed status condition
but general 'trapped' is enabled, then display 'trapped' when in lava.
Similarly, if 'grabbed-by-eel' is disabled but more general 'held' is
enabled, display 'held' when grabbed.

5 years agopanictrace_libc
PatR [Mon, 2 Mar 2020 23:05:06 +0000 (15:05 -0800)]
panictrace_libc

Try to make the tracebacks generated via PANICTRACE's libc method
be more readable.  There tends to be a lot of blank space in the
middle of lines, depending on the length of the program's or
libraries' file names, which can make lines wrap and the whole
thing sometimes be harder to make out.  Narrow it by squeezing out
some spaces from each line before writing to reduce the chance of
line wrapping.  That isn't guaranteed to make things ledgible but
seems to help quite a bit.  Also, force the line number inserted
by nethack to be two digits so when spanning from line 9 to line 10
it doesn't cause the field positions to shift by a column.  (Using
'#panic' doesn't have enough stack frames to illustrate that.)

I think the original libc formatting was designed for the address
column to hold a 32-bit value ('0x' prefix and 8 hex digits), and
eventually extending that to handle 64 bits ('0x' prefix and 16 hex
digits) made things wider than intended.  But the gradual increase
in the length of function names we use is also a factor.

5 years agoStart of lua api docs
Pasi Kallinen [Mon, 2 Mar 2020 15:38:31 +0000 (17:38 +0200)]
Start of lua api docs

... in asciidoc format. Use "asciidoctor -b html5 lua.adoc"
to generate the HTML version.

5 years agoAdd lua selection match method
Pasi Kallinen [Mon, 2 Mar 2020 14:15:40 +0000 (16:15 +0200)]
Add lua selection match method

Also improve the replace_terrain command parameters.

5 years agoaction after parse_role_opts() returns FALSE
nhmall [Mon, 2 Mar 2020 06:11:51 +0000 (01:11 -0500)]
action after parse_role_opts() returns FALSE

The old parseoptions() would get a FALSE return from parse_role_opts() and
then exit FALSE.

The new parseoptions() was printing an error message due to the FALSE return
value, and then exiting FALSE.

Have it behave the original way following parse_role_opts().

5 years agofix github issue #309 - random role segfault
PatR [Sun, 1 Mar 2020 22:36:28 +0000 (14:36 -0800)]
fix github issue #309 - random role segfault

Role selection is insanely complex.  I had to use a debugger to force
the relevant routine to be executed.

The analysis was correct:  it could use rn2(14) to pick a role (valid
values 0 through 12) and randomly getting 13 would lead to a crash.

The terminating element of roles[] passes all the ok_role(), ok_race(),
etc tests.  Explicitly exclude that element when collecting the roles
to choose from.

5 years agotypos in doc/options.doc
nhmall [Sun, 1 Mar 2020 16:04:02 +0000 (11:04 -0500)]
typos in doc/options.doc

5 years agomore duplicate detect; also copy-and-paste for vt_tiledata entry left it enabled...
nhmall [Sun, 1 Mar 2020 15:48:46 +0000 (10:48 -0500)]
more duplicate detect; also copy-and-paste for vt_tiledata entry left it enabled by default

5 years agothrow-and-return vs !fixinv
PatR [Sun, 1 Mar 2020 14:46:37 +0000 (06:46 -0800)]
throw-and-return vs !fixinv

Implement the request that a wielded+thrown aklys be given the same
inventory letter when it returns and is caught and rewielded, even for
the !fixinv setting where inventory letters don't stick.  Works for
Valkyrie-thrown Mjollnir and returning (ie, didn't hit) boomerangs as
well as for aklys.

I'm not sure how useful this really is, because on the rare occasions
that it either doesn't return or fails to be caught, it won't be given
the same letter when subsequently picked up.  So the player who relies
on it will still be vulnerable to using the wrong letter next time a
throw is attempted.  But at least picking it up explicitly displays
the new inventory letter, unlike catching it upon return.

5 years agoFix room tests
Pasi Kallinen [Sun, 1 Mar 2020 08:28:19 +0000 (10:28 +0200)]
Fix room tests

5 years agoFix Fort Ludios room type
Pasi Kallinen [Sun, 1 Mar 2020 08:13:50 +0000 (10:13 +0200)]
Fix Fort Ludios room type

... and add an impossible when lua tries to create unknown room type.

5 years agohard quit vs botl
PatR [Sun, 1 Mar 2020 00:44:48 +0000 (16:44 -0800)]
hard quit vs botl

For
 Really quit? [yn] y
 Dump core? [ynq] q
skip the final status update.  Noticeable when debugging and some
status breakpoints are set.

5 years agoMerge
nhmall [Sat, 29 Feb 2020 23:49:16 +0000 (18:49 -0500)]
Merge

5 years agosince sole argument to set_duplicate_opt_detection was unused, eliminate it altogether
nhmall [Sat, 29 Feb 2020 23:47:34 +0000 (18:47 -0500)]
since sole argument to set_duplicate_opt_detection was unused, eliminate it altogether

5 years agosome warnings
nhmall [Sat, 29 Feb 2020 23:36:03 +0000 (18:36 -0500)]
some warnings

5 years agooptions follow-up: fix up duplicate_option_detection and !pet
nhmall [Sat, 29 Feb 2020 22:54:41 +0000 (17:54 -0500)]
options follow-up: fix up duplicate_option_detection and !pet

5 years agominor flavor bit of the day
nhmall [Sat, 29 Feb 2020 18:57:31 +0000 (13:57 -0500)]
minor flavor bit of the day

5 years agohaste timeout, vomit countdown feedback
PatR [Fri, 28 Feb 2020 21:30:59 +0000 (13:30 -0800)]
haste timeout, vomit countdown feedback

Change a couple of messages.  When speed/haste-self times out:
"you feel yourself slowing down" -> "you feel yourself slow down"
because the former was too close to the turn-to-stone countdown and
the loss of speed is immediate rather than gradual.

The vomiting countdown causes confusion and stun; vary the messages
for those if already confused or stunned:
"you feel slightly confused" -> "you feel slightly more confused";
"you can't seem to think straight" -> "you can't think straight".

5 years agoAllow coord in place of x and y in special level lua script
Pasi Kallinen [Fri, 28 Feb 2020 20:14:36 +0000 (22:14 +0200)]
Allow coord in place of x and y in special level lua script

5 years agoX11/winstat.c formatting
PatR [Thu, 27 Feb 2020 19:51:10 +0000 (11:51 -0800)]
X11/winstat.c formatting

Separate out the reformatting from other changes I'm working on
for X11 "fancy status".  Splits a few wide lines but mostly just
switches to the X11 idiom of combining
 XSetArg(arglist[argcount], ...);
 argcount++;
onto one line:
 XSetArg(arglist[argcount], ...); argcount++;

5 years agobotl update for trapped/untrapped
PatR [Thu, 27 Feb 2020 10:26:57 +0000 (02:26 -0800)]
botl update for trapped/untrapped

Make set_utrap() set context.botl when changing between untrapped and
trapped or vice versa.

5 years agoupdate a parameter in some ancient platforms
nhmall [Thu, 27 Feb 2020 02:53:07 +0000 (21:53 -0500)]
update a parameter in some ancient platforms

5 years agofix build break when there's no #define for CLIPPING
nhmall [Thu, 27 Feb 2020 02:38:38 +0000 (21:38 -0500)]
fix build break when there's no #define for CLIPPING

5 years agoThis is cron-daily v1-Jan-20-2020. files updated: Files
nhw_cron [Wed, 26 Feb 2020 20:17:08 +0000 (15:17 -0500)]
This is cron-daily v1-Jan-20-2020.  files updated: Files

5 years agofixes entry
nhmall [Wed, 26 Feb 2020 20:45:04 +0000 (15:45 -0500)]
fixes entry

This issue was present prior to the options overhaul; a fix
was embedded in the options overhaul code changes

5 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
nhmall [Wed, 26 Feb 2020 20:36:53 +0000 (15:36 -0500)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

5 years agotypo in fixes
nhmall [Wed, 26 Feb 2020 20:30:10 +0000 (15:30 -0500)]
typo in fixes

5 years agoshowscore typo
PatR [Wed, 26 Feb 2020 20:28:33 +0000 (12:28 -0800)]
showscore typo

5 years agofix warning observed on Mac OS X
nhmall [Wed, 26 Feb 2020 20:20:08 +0000 (15:20 -0500)]
fix warning observed on Mac OS X

5 years agotranspose error in comments bit
nhmall [Wed, 26 Feb 2020 20:03:58 +0000 (15:03 -0500)]
transpose error in comments bit

5 years agoMerge branch 'options-overhaul' into NetHack-3.7
nhmall [Wed, 26 Feb 2020 19:36:20 +0000 (14:36 -0500)]
Merge branch 'options-overhaul' into NetHack-3.7

5 years agofixes37.0 update for options overhaul
nhmall [Wed, 26 Feb 2020 19:32:07 +0000 (14:32 -0500)]
fixes37.0 update for options overhaul

5 years agofix the menu_* options which had valok set to No
nhmall [Wed, 26 Feb 2020 19:23:26 +0000 (14:23 -0500)]
fix the menu_* options which had valok set to No

5 years agoDemon lords and princes suppress teleporting in Gehennom
Pasi Kallinen [Wed, 26 Feb 2020 17:55:53 +0000 (19:55 +0200)]
Demon lords and princes suppress teleporting in Gehennom

Instead of having the demon lair levels unconditionally no-teleport,
grant demon lords and princes the ability to suppress teleportation
in Gehennom on the level they are on.

5 years agoLua: accept different params for gold function
Pasi Kallinen [Wed, 26 Feb 2020 15:57:47 +0000 (17:57 +0200)]
Lua: accept different params for gold function

5 years agoImplement lua selection iteration
Pasi Kallinen [Wed, 26 Feb 2020 15:25:25 +0000 (17:25 +0200)]
Implement lua selection iteration

... and showcase it by dehardcoding the Fort Ludios treasury.

5 years agoFebruary 2020 options.c overhaul
nhmall [Wed, 26 Feb 2020 05:19:08 +0000 (00:19 -0500)]
February 2020 options.c overhaul

combine boolean and compound options into a single allopt[] array for
processing in options.c.

move the definitions of the options into new include/optlist.h file which
uses a set of macros to define them appropriately.

during compile of options.c each option described in include/optlist.h:
   1. automatically results in a function prototype for an optfn called
      optfn_xxxx (xxxx is the option name).
   2. automatically results in an opt_xxxx enum value for referencing
      its index throughout options.c (xxxx is the option name).
   3. is used to initialize an element of the allopt[] array at index
      opt_xxxx (xxxx is the option name) based on the settings in the
      NHOPTB, NHOPTC, NHOPTP macros. Those macros only live during the
      compilation of include/optlist.h.

each optfn_xxxx() function can be called with a req id of: do_init, do_set,
get_val or do_handler.

req do_init is called from options_init, and if initialization or memory
allocation or other initialization for that particular option is needed,
it can be done in response to the init req.

req do_set is called from parseoptions() for each option it encounters
and the optfn_xxxx() function is expected to react and set the option
based on the string values that parseoptions() passes to it.

req get_val expects each optfn_xxxx() function to write the current
option value into the buffer it is passed.

req do_handler is called during doset() operations in response to player
selections most likely from the 'O' option-setting menu, but only if the
option is identified as having do_handler support in the allopts[]
'has_handler' boolean flag. Not every optfn_xxxx() does.

function special_handling() is eliminated. It's code has been redistributed
to individual handler functions for the option or purpose that they serve.

moved reglyph_darkroom() function from options.c to display.c

5 years agofix a couple of warnings seen on visual studio 2019
nhmall [Wed, 26 Feb 2020 03:56:50 +0000 (22:56 -0500)]
fix a couple of warnings seen on visual studio 2019

  src/sp_lev.c(4278): warning C4113: 'int (__cdecl *)()' differs in parameter lists from 'int(__cdecl *)(int,int)'
  src/sp_lev.c(5021): warning C4113: 'int (__cdecl *)()' differs in parameter lists from 'int (__cdecl *)(int,int)'

5 years agofix a pair of warnings received with visual studio
nhmall [Wed, 26 Feb 2020 02:37:10 +0000 (21:37 -0500)]
fix a pair of warnings received with visual studio

src/sp_lev.c(4278): warning C4113: 'int (__cdecl *)()' differs in parameter lists from 'int(__cdecl *)(int,int)'
src/sp_lev.c(5021): warning C4113: 'int (__cdecl *)()' differs in parameter lists from 'int (__cdecl *)(int,int)'

Add prototype prior to first reference

5 years agofix curses' create_nhmenu() warning
PatR [Wed, 26 Feb 2020 00:18:58 +0000 (16:18 -0800)]
fix curses' create_nhmenu() warning

The extra flags argument to create_nhmenu() wasn't propagated to
anywhere useful.  It still doesn't do anything yet.

5 years agofix nhlsel.c warning
PatR [Wed, 26 Feb 2020 00:04:41 +0000 (16:04 -0800)]
fix nhlsel.c warning

A recent change has resulted in complaints about 'sel' not being
used in
  struct selectionvar *sel = l_selection_check(L, 1);
  struct selectionvar *ret;
  int p = (int) luaL_checkinteger(L, 2);

  lua_pop(L, 1);
  (void) l_selection_clone(L);
  ret = l_selection_check(L, 1);
  selection_filter_percent(ret, p);

This preserves the semantics of that code while getting rid of the
warning, but I have no idea whether it makes any sense.

5 years agoAdd new level init type, swamp
Pasi Kallinen [Tue, 25 Feb 2020 16:53:06 +0000 (18:53 +0200)]
Add new level init type, swamp

Creates a "relaxed blockwise maze".
Make Juiblex's swamp use it.

5 years agolevel flip comment bit
PatR [Tue, 25 Feb 2020 01:29:32 +0000 (17:29 -0800)]
level flip comment bit

5 years agoflipping current level with #wizlevelflip
PatR [Tue, 25 Feb 2020 01:07:01 +0000 (17:07 -0800)]
flipping current level with #wizlevelflip

Give wizard mode player control over how a level gets transposed by
prompting for the desired outcome.

Refreshing the screen showed that remembered, no longer in view wall
corners and T walls were shown with their old orientation instead of
being transposed along with the level.  This fixes that, but does so
by adding a chunk of code that will be irrelevant for normal play.

5 years agoMore noflip special levels
Pasi Kallinen [Mon, 24 Feb 2020 17:08:58 +0000 (19:08 +0200)]
More noflip special levels

5 years agoMinor tweaks to level flipping
Pasi Kallinen [Sun, 23 Feb 2020 13:06:44 +0000 (15:06 +0200)]
Minor tweaks to level flipping

5 years agoadopt github pull request #286 - rndmonst()
PatR [Sun, 23 Feb 2020 01:40:55 +0000 (17:40 -0800)]
adopt github pull request #286 - rndmonst()

Eliminate the cache that was supporting rndmonst() and pick a random
monster in a single pass through mons[] via "weighted reservoir
sampling", a term I'm not familiar with.

It had a couple of bugs:  if the first monster examined happened to
be given a weighting of 0, rn2() would divide by 0.  I didn't try
to figure out how to trigger that.  But the second one was easy to
trigger:  if all eligible monsters were extinct or genocided, it
would issue a warning even though the situation isn't impossible.

Aside from fixing those, the rest is mostly as-is.  I included a bit
of formatting in decl.c, moved some declarations to not require C99,
and changed a couple of macros to not hide and duplicate a call to
level_difficulty().

Fixes #286

5 years agomore #302 - empty {bogusmon,engrave,epitaph}.txt
PatR [Sat, 22 Feb 2020 20:32:00 +0000 (12:32 -0800)]
more #302 - empty {bogusmon,engrave,epitaph}.txt

Have makedefs add a real data line to the output for the files that
caused trouble when empty.

5 years agoChange lua selection floodfill and add some tests
Pasi Kallinen [Sat, 22 Feb 2020 16:35:33 +0000 (18:35 +0200)]
Change lua selection floodfill and add some tests

5 years agoMake lua selection filter_mapchar create a new selection
Pasi Kallinen [Sat, 22 Feb 2020 15:51:08 +0000 (17:51 +0200)]
Make lua selection filter_mapchar create a new selection

5 years agoMake lua selection grow create a new selection
Pasi Kallinen [Sat, 22 Feb 2020 14:58:45 +0000 (16:58 +0200)]
Make lua selection grow create a new selection

5 years agoMake lua selection randline create a new selection
Pasi Kallinen [Sat, 22 Feb 2020 14:34:50 +0000 (16:34 +0200)]
Make lua selection randline create a new selection

5 years agoMake lua selection rect and fillrect create a new selection
Pasi Kallinen [Sat, 22 Feb 2020 13:23:30 +0000 (15:23 +0200)]
Make lua selection rect and fillrect create a new selection

5 years agoMake lua selection line create a new selection
Pasi Kallinen [Sat, 22 Feb 2020 12:23:33 +0000 (14:23 +0200)]
Make lua selection line create a new selection

... instead of modifying the one given as a parameter.

Also add some tests for it.

5 years agoMake lua selection percent filter create a new selection
Pasi Kallinen [Sat, 22 Feb 2020 11:31:22 +0000 (13:31 +0200)]
Make lua selection percent filter create a new selection

... instead of modifying the one given as a parameter.

Also add some tests for it.

5 years agoMake lua selection boolean opers create a new selection
Pasi Kallinen [Sat, 22 Feb 2020 10:11:47 +0000 (12:11 +0200)]
Make lua selection boolean opers create a new selection

... instead of modifying one of the given selections.

Also add tests for the operations.

5 years agoMake lua selection negate return a new selection
Pasi Kallinen [Sat, 22 Feb 2020 08:58:17 +0000 (10:58 +0200)]
Make lua selection negate return a new selection

... instead of modifying the one given as a parameter.

Also add tests for it.

5 years agofix github issue #302 - divide by 0 crash
PatR [Sat, 22 Feb 2020 09:41:04 +0000 (01:41 -0800)]
fix github issue #302 - divide by 0 crash

The traceback points directly to the problem:  divide by 0 happens
if the 'bogusmon' file only contains the "do not edit" line, which
would happen if 'bogusmon.txt' is empty.  makedefs probably ought to
complain about that.

There is now one hardcoded bogus monster to fall back to:  'bogon'.

Random tombstone epitaphs report divide by 0 if their text source is
empty, but it is done by rn2() rather than rn2_for_display_rng() so
is just a warning for pre-release code.  It would crash for release
version though.

I tried placing an empty engravings file and expected similar results
but didn't see any response.  Not sure what that means.

After the fix, empty epitaph file yields blank result so graves that
want a random epitaph won't have any epitaph.

Fixes #302

5 years agoextra ^X info (mon's location) for u.ustuck
PatR [Fri, 21 Feb 2020 21:46:03 +0000 (13:46 -0800)]
extra ^X info (mon's location) for u.ustuck

5 years agobuild warning
PatR [Fri, 21 Feb 2020 21:45:17 +0000 (13:45 -0800)]
build warning

5 years agoDon't bother flipping oracle level
Pasi Kallinen [Fri, 21 Feb 2020 19:32:18 +0000 (21:32 +0200)]
Don't bother flipping oracle level

5 years agoAllow flipping levels horizontally or vertically
Pasi Kallinen [Thu, 20 Feb 2020 17:18:54 +0000 (19:18 +0200)]
Allow flipping levels horizontally or vertically

When a special level is created, there's a chance it gets flipped
horizontally and/or vertically.

Add new level flags "noflip", "noflipx", and "noflipy" to prevent
flipping the level. Add a wiz-mode command #wizlevelflip to test
the flipping on current level - although this doesn't flip everything,
as level flipping is meant to happen during level creation.

5 years agoensure condition menu always starts the same way even under "play again"
nhmall [Fri, 21 Feb 2020 01:36:37 +0000 (20:36 -0500)]
ensure condition menu always starts the same way even under "play again"