Commit Graph

10295 Commits

Author SHA1 Message Date
nhmall
4a7cb8d3d7 Merge branch 'chasonr-msdos-video-doc' into NetHack-3.7 2020-02-10 23:26:26 -05:00
nhmall
e779165733 Guidebook corrections for msdos video_width and video_height
merge pull request #294 from chasonr

Closes #294
2020-02-10 23:20:58 -05:00
nhmall
de339ce14d Merge branch 'msdos-video-doc' of https://github.com/chasonr/NetHack into chasonr-msdos-video-doc 2020-02-10 23:05:33 -05:00
nhmall
1566063b4c bump editlevel
the code in pr298 altered the sound bit for one existing monster
2020-02-10 22:12:38 -05:00
nhmall
292d681efa sounds for minotaurs pr298
Closes #298
2020-02-10 22:04:10 -05:00
nhmall
0b15b99b12 Merge branch 'NullCGT-minotaurs-pr298' into NetHack-3.7 2020-02-10 22:02:26 -05:00
PatR
9a8bea550f Revert "plug a couple of memory leaks in sp_lev.c"
This reverts commit 1b7ac93930.

I just got a crash from within Lua when loading mine town and it
appears to be memory related, so back out the "plug leaks" commit
for the time being.
2020-02-10 15:44:16 -08:00
PatR
1b7ac93930 plug a couple of memory leaks in sp_lev.c
selection_floodfill() would free the contents of its temporary
selection structure when the check function was Null but neglected
to free the allocated structure itself.  I don't know whether that
was ever triggered.

generate_way_out_method() did likewise when trying to make a hole
or trapdoor.  It reused the 'ov3' pointer without freeing it first.
'heaputil' reported instances of non-freed memory that were
allocated at line 3612 by selection_clone(), only called within
generate_way_out_method().

Change selection_free(foo) to also free(foo) after freeing foo's
fields.  Every use was already
  selection_free(foo);
  free(foo);
except for the two instances of memory leak.
2020-02-10 14:23:47 -08:00
PatR
bade2f19b2 simplify Achievements display
The you-acquired-the-Amulet achievement uses alternate wording when
you were carrying it but just gave it up via #offer to ascend.  That
wording looks much better when displayed right before "You ascended!",
without entered-endgame and entered-astral (and maybe always-blind or
never-wore-armor) achievements in between.  That was and still is done
by taking it away.  Adding it back in the desired spot is simpler than
leaving it out while tracking whether it was removed.

Effectively, ACH_UWIN (ascension) is forced to be very last--where it
will always be anyway, but at one point the blind and nudist ones came
after it--and ACH_AMUL (you obtained the Amulet) is sorted to right
before that.  For non-ascending games, the Amulet achievement is left
in the position where it was attained.
2020-02-10 11:21:44 -08:00
PatR
d462bdffca redo achievement tracking
Instead of an assortment of bits, assign numeric indices to the
potential achievements and keep an array of those in the order they
were attained.  So disclosure might show the same subset occurring
differently in different games depending on the player's actions.
The encoded field in xlogfile doesn't care about that and remains
the same.

Modifies 'struct u', so EDITLEVEL has been incremented and existing
save files are invalidated.
2020-02-10 00:17:54 -08:00
nhmall
9b0ded6ff6 Merge branch 'feature/sounds' of https://github.com/NullCGT/NetHack into NullCGT-minotaurs-pr298 2020-02-09 20:38:22 -05:00
PatR
89c1b09d70 Achievements doc bit
Confusion on my part.  "Entered Gehennom" achievement is recorded if
you enter the Valley of the Dead rather than requiring that you get
past that level.

Guidebook.tex is still lagging but not forgotten.
2020-02-09 16:56:23 -08:00
PatR
e09bfeb8af remove another unused variable 2020-02-09 12:28:19 -08:00
nhmall
bea4fb9166 remove an unused variable 2020-02-09 15:21:35 -05:00
nhmall
2ed0270e7e Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-02-09 14:57:15 -05:00
nhmall
c7c0c87859 move status condition field selection to its own menu 2020-02-09 14:56:37 -05:00
Pasi Kallinen
6fd51c29ef Unify Bag of Holding item loss chance 2020-02-09 18:39:46 +02:00
Pasi Kallinen
39032d2fac Fix the selection param unify 2020-02-09 14:47:41 +02:00
Pasi Kallinen
e182ff428b Unify lua setting wallprop 2020-02-09 14:30:11 +02:00
Pasi Kallinen
ced327fdf5 Unify some exported lua script params 2020-02-09 13:44:04 +02:00
nhmall
5e0c668e83 set g.opt_need_redraw on ingame cond_foo change 2020-02-08 21:38:14 -05:00
nhmall
4d42d44c02 catch-up on some updates to fixes37.0
Side note: Here's a correction for the commit
message for 330287da42:

The original incorrectly stated 'CONDITION_SIZE' (which
doesn't exist) instead of CONDITION_COUNT in one of the
paragraphs.

--- snip ---

eliminate the uses of the manually maintained BL_MASK_BITS

Use CONDITION_COUNT which does not require manual updating.

Also attempts to adjust win32 graphics window port for
the new fields.

That port has its own field names and should be adjusted
to using the following which are declared extern in
include/botl.h.

   struct conditions[CONDITION_COUNT];
   int cond_idx[CONDITION_COUNT];

The former contains the fields that were port-specifically
added to the win32 graphical port and more, plus it is
centrally maintained and currently utilized by tty and curses.

The cond_idx[] array contains the ranked ordering of the
condition fields from highest ranking to lowest. Instead
of indexing like this:
    int i;
    for (i = 0; i < CONDITION_COUNT; ++i) {
        ...conditons[i].enabled;
        ...condtions[i].text[0];
    }

you can use the ranked ordering like this:
    int i, ci;
    for (i = 0; i < CONDITION_COUNT; ++i) {
        ci = cond_idx[i];
        ...conditons[ci].enabled;
        ...condtions[ci].text[0];
    }
2020-02-08 21:07:04 -05:00
nhmall
330287da42 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-02-08 20:51:10 -05:00
nhmall
2da95e4dc0 eliminate the uses of the manually maintained BL_MASK_BITS
Use CONDITION_SIZE which does not require manual updating.

Also attempts to adjust win32 graphics window port for
the new fields.

That port has its own field names and should be adjusted
to using the following which are declared extern in
include/botl.h.

   struct conditions[CONDITION_COUNT];
   int cond_idx[CONDITION_COUNT];

The former contains the fields that were port-specifically
added to the win32 graphical port and more, plus it is
centrally maintained and currently utilized by tty and curses.

The cond_idx[] array contains the ranked ordering of the
condition fields from highest ranking to lowest. Instead
of indexing like this:
	int i;
	for (i = 0; i < CONDITION_COUNT; ++i) {
	    ...conditons[i].enabled;
 	    ...condtions[i].text[0];
	}

you can use the ranked ordering like this:
	int i, ci;
	for (i = 0; i < CONDITION_COUNT; ++i) {
	    ci = cond_idx[i];
	    ...conditons[ci].enabled;
 	    ...condtions[ci].text[0];
	}
2020-02-08 20:40:38 -05:00
PatR
e198150ad8 more level teleport feedback
Level teleporting to current level doesn't give any feedback but
is usually done intentionally to abort the level teleport.  Being
on the bottom level of branch and attempting to teleport even lower
failed silently like choosing the current level.  Have it give some
feedback about not being able to go any lower.
2020-02-08 17:15:18 -08:00
nhmall
4096ce8454 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-02-08 19:52:22 -05:00
nhmall
67cc0183b0 ranking of new status conditions 2020-02-08 19:51:04 -05:00
PatR
916366fbd1 new data.base quote: win/winner/winning
A quote about "winning team" doesn't fit nethack very well but this
is too good to pass up.  I considered adding "/Rule Six/" as a false
rumor, but the rumors don't offer any way to specify attribution.

Also, give full attribution for another Douglas Adams quote that's
used for a random ungraving.
2020-02-08 16:05:29 -08:00
Pasi Kallinen
1e915a9a52 Unify revealing hiding monsters for mvm attacks
Whether the monster-vs-monster hits or misses, hiders
are revealed the same way. Unify that part of the code.

Use git show --patience to have a better view of the changes.
2020-02-08 23:41:36 +02:00
nhmall
ce235dc94b more condition_aliases 2020-02-08 14:26:03 -05:00
nhmall
cef50363ca adjust condition_aliases to include new macro masks 2020-02-08 14:01:57 -05:00
PatR
f3338e6e30 remove unused variable 2020-02-08 09:59:08 -08:00
Pasi Kallinen
df137029c0 Unify finding room pos for some features 2020-02-08 19:47:36 +02:00
Pasi Kallinen
0f16a48aaf Unify (un)locking boxes in inventory 2020-02-08 18:56:40 +02:00
Pasi Kallinen
58677b9e95 Unify inventory letter value for sortloot 2020-02-08 18:42:06 +02:00
nhmall
e12cab4ee1 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-02-08 11:06:04 -05:00
nhmall
5116ad4eed Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-02-08 11:05:26 -05:00
Pasi Kallinen
7eb20c9e7a Unify multishot class bonus code 2020-02-08 18:04:54 +02:00
nhmall
ffd9eedb2c condtests[bl_bareh] requires a couple of additional g.context.botl = 1 2020-02-08 11:03:46 -05:00
Pasi Kallinen
0323eecbfe Unify finding a queen bee 2020-02-08 17:35:52 +02:00
Pasi Kallinen
c585c65042 Add some stair helper functions 2020-02-08 17:08:26 +02:00
Pasi Kallinen
9e4319824d Fix digging through iron bars from adjacent pit
It was possible to create a pit on top of iron bars, by first creating
a pit next to the bars, going down into the pit, and then digging sideways
towards the bars. This did not destroy the iron bars.
2020-02-08 17:08:17 +02:00
nhmall
d02bf5d1d0 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-02-08 07:40:47 -05:00
nhmall
27ab3e66ba options.c initializers got misaligned
Correct the initializers in options.c for the cond_ options.
2020-02-08 07:39:21 -05:00
Pasi Kallinen
c2e8703fe0 Unify breamm and breamu
Monster vs monster breath attacks were using nearly the same code
as monster vs hero - unify the code
2020-02-08 14:19:17 +02:00
nhmall
a781b295a5 OS X warning 2020-02-08 01:44:56 -05:00
nhmall
57d25ad826 fixes37.0 update for unexplored changes and new status conditions 2020-02-08 01:30:14 -05:00
nhmall
4f2375ffe5 Merge branch 'new-status-conditions' into NetHack-3.7 2020-02-08 01:24:51 -05:00
nhmall
07a9a67fb2 expand the pool of status condition fields
Most of the additional ones are "opt-in" meaning that unless you add them
to your config file to enable them, they won't show up.

Two that aren't "opt-in", but can be "opted-out" (as can they all) are
cond_grab (for an eel grabbing you and drowing being imminent) and
cond_lava which leads to a fatality.

All the ones that already existed are "opt-out" options, meaning that
they will still show if you do nothing.

Here's the complete list of status conditions following this patch:
 config option     internal     default mask id            mask        text1    tex2   text3
"cond_barehanded"  bl_bareh     opt_in  BL_MASK_BAREH      0x00000001L Bare     Bar    Bh
"cond_blind"       bl_blind     opt_out BL_MASK_BLIND      0x00000002L Blind    Blnd   Bl
"cond_busy"        bl_busy      opt_in  BL_MASK_BUSY       0x00000004L Busy     Bsy    By
"cond_conf"        bl_conf      opt_out BL_MASK_CONF       0x00000008L Conf     Cnf    Cf
"cond_deaf"        bl_deaf      opt_out BL_MASK_DEAF       0x00000010L Deaf     Def    Df
"cond_iron"        bl_elf_iron  opt_out BL_MASK_ELF_IRON   0x00000020L Iron     Irn    Fe
"cond_fly"         bl_fly       opt_out BL_MASK_FLY        0x00000040L Fly      Fly    Fl
"cond_foodPois"    bl_foodpois  opt_out BL_MASK_FOODPOIS   0x00000080L FoodPois Fpois  Poi
"cond_glowhands"   bl_glowhands opt_in  BL_MASK_GLOWHANDS  0x00000100L Glow     Glo    Gl
"cond_grab"        bl_grab      opt_out BL_MASK_GRAB       0x00000200L Grab     Grb    Gr
"cond_hallu"       bl_hallu     opt_out BL_MASK_HALLU      0x00000400L Hallu    Hal    Hl
"cond_held"        bl_held      opt_in  BL_MASK_HELD       0x00000800L Held     Hld    Hd
"cond_ice"         bl_icy       opt_in  BL_MASK_ICY        0x00001000L Icy      Icy    Ic
"cond_lava"        bl_inlava    opt_out BL_MASK_INLAVA     0x00002000L Lava     Lav    La
"cond_lev"         bl_lev       opt_out BL_MASK_LEV        0x00004000L Lev      Lev    Lv
"cond_paralyze"    bl_parlyz    opt_in  BL_MASK_PARLYZ     0x00008000L Parlyz   Para   Par
"cond_ride"        bl_ride      opt_out BL_MASK_RIDE       0x00010000L Ride     Rid    Rd
"cond_sleep"       bl_sleeping  opt_in  BL_MASK_SLEEPING   0x00020000L Zzz      Zzz    Zz
"cond_slime"       bl_slime     opt_out BL_MASK_SLIME      0x00040000L Slime    Slim   Slm
"cond_slip"        bl_slippery  opt_in  BL_MASK_SLIPPERY   0x00080000L Slip     Sli    Sl
"cond_stone"       bl_stone     opt_out BL_MASK_STONE      0x00100000L Stone    Ston   Sto
"cond_strngl"      bl_strngl    opt_out BL_MASK_STRNGL     0x00200000L Strngl   Stngl  Str
"cond_stun"        bl_stun      opt_out BL_MASK_STUN       0x00400000L Stun     Stun   St
"cond_submerged"   bl_submerged opt_in  BL_MASK_SUBMERGED  0x00800000L Sub      Sub    Sw
"cond_termIll"     bl_termill   opt_out BL_MASK_TERMILL    0x01000000L TermIll  Ill    Ill
"cond_tethered"    bl_tethered  opt_in  BL_MASK_TETHERED   0x02000000L Teth     Tth    Te
"cond_trap"        bl_trapped   opt_in  BL_MASK_TRAPPED    0x04000000L Trap     Trp    Tr
"cond_unconscious" bl_unconsc   opt_in  BL_MASK_UNCONSC    0x08000000L Out      Out    KO
"cond_woundedl"    bl_woundedl  opt_in  BL_MASK_WOUNDEDL   0x10000000L Legs     Leg    Lg
2020-02-08 01:03:25 -05:00
nhmall
d37fa196b2 make a distinction between rock and unexplored area
This adds a pair of new glyphs: GLYPH_UNEXPLORED and GLYPH_NOTHING

GLYPH_UNEXPLORED is meant to be the glyph for areas of the map that
haven't been explored yet.

GLYPH_NOTHING is a glyph that represents that which cannot be seen,
for instance the dark part of a room when the dark_room option is
not set.  Since the symbol for stone can now be overridden to
a players choice, it no longer made sense using S_stone for the
dark areas of the room with dark_room off. This allows the same
intended result even if S_stone symbol is mapped to something visible.

GLYPH_UNEXPLORED is what areas of the map get initialized to now
instead of STONE.

This adds a pair of new symbols: S_unexplored and S_nothing.

S_nothing is meant to be left as an unseen character (space) in
order to achieve the intended effect on the display.

S_unexplored is the symbol that is mapped to GLYPH_UNEXPLORED, and
is a distinct symbol from S_stone, even if they are set to the same
character. They don't have to be set to the same character.

Hopefully there are minimal bugs, but it is a deviation from a
fairly long-standing approach so there could be some unintended
glitches that will need repair.
2020-02-08 00:48:03 -05:00