Commit Graph

2116 Commits

Author SHA1 Message Date
PatR
9366307210 extra ^X info (mon's location) for u.ustuck 2020-02-21 13:46:03 -08:00
Pasi Kallinen
88aa0793dc 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.
2020-02-21 18:16:14 +02:00
nhmall
86f5e73ef3 ensure condition menu always starts the same way even under "play again" 2020-02-20 20:36:37 -05:00
nhmall
d81c096ce6 window port interface change - add mbehavior flags to start_menu()
Provide a way to communicate additional behaviors and/or appearances
desired from NetHack window port menus.

This is foundation work for changes to follow at a future date.
2020-02-20 20:12:51 -05:00
nhmall
d50c3577e9 some more status condition follow-up
- Don't display 'Held' when swallowed.
- Don't display 'Held' when the hero is doing the holding; add a condition display
  entry "UHold" for that (the opt_in option is "holding")
- Allow resorting of the 'O' menu for status condition fields. Default is alphabetical, but you
  can sort by condition field ranking now.
2020-02-20 01:22:27 -05:00
PatR
cfd425d5db Wounded_legs condition
Mounting a steed while legs are wounded would offer to cure them
but wasn't going through the heal_legs() routine so didn't update
the status line when Wounded_legs condition is enabled.

Move some common code for describing left/right/both legs into a
new routine used for feedback by jumping, kicking, and ridiing.

For ^X, distinguish between one wounded leg and both but don't
bother with left vs right when it is just one.
2020-02-19 15:47:55 -08:00
PatR
8659dcd7bc monster sound changes
MS_MOO was placed among the humanoid sounds, resulting in a minotaur
being able to articulate "I'm hungry".  Move it to the animal sounds,
which causes almost all the sounds to be renumbered.

Give MS_MOO to rothes.

Change mumak from MS_ROAR to new sound MS_TRUMPET and mastodon from
silent to that.

I changed MS_ORC from a synonym for MS_GRUNT into a distinct type
which also just grunts.  Grunt is in the animal group of sounds and
orc is now in the 'other' group (neither animal nor understandable
humanoid).  [There are a bunch of other humanoid monsters (gnomes and
ogres, for example) that still use MS_GRUNT.  They aren't animals so
that's not right.]

Have pets who beg for food but happen to have 'other' sounds between
animal and humanoid be described as looking hungry instead of being
skipped.

Hat tipped to a peaceful humanoid will behave as non-peaceful if
Conflict is active (without giving the monster a resistance check).

Despite mons[].msound getting new values, save files should be ok.
2020-02-18 13:33:00 -08:00
PatR
814adb41b8 fix #K376 - tipping cap
Allow #tip to do something if you pick your worn helmet instead of
a container.  It's mostly just a variation of #chat but probably adds
several new bugs....
2020-02-18 03:14:22 -08:00
PatR
3981e3e6e5 controlling u.ustuck
Setting or clearing u.ustuck now requires that context.botl be set,
so make a new routine to take care of both instead of manipulating
that pointer directly.
2020-02-16 13:04:12 -08:00
nhmall
751f1f47ab Windows options dynamically
There are two executables int the windows binary, each of which
have different options and capabilities. Sharing of one dat/options
file hasn't really been an accurate approach.

Produce that information dynamically for the Windows exe files.

This impacts alt-v results.
2020-02-13 21:24:24 -05:00
PatR
cbe27c7702 unseen pet drowning
The "you have a sad feeling for a moment" message was only given when
one monster kills another (and the latter is an unseen pet).  Give it
for drowning too.  There are probably a bunch of other circumstances
which warrant it as well but I've settled for handling minliquid().
2020-02-13 15:38:59 -08:00
nhmall
a213811975 stone/unexplored glyph follow-up
typo
2020-02-13 17:37:55 -05:00
PatR
75e9055b89 plug a couple of memory leaks in sp_lev.c, take II
[...]
| 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.

And except for the three which aren't in sp_lev.c, one of which was
dealing with memory managed by Lua.  This time it seems to be working
as intended.
2020-02-12 18:56:41 -08:00
PatR
804499d9be add some new, easier achievements
Introduce eight achievements that can be attained by more players.
 Entered Gnomish Mines  - self explanatory
 Entered Mine Town      - the town portion, not just the level
 Entered a shop         - any tended shop on any level
 Entered a temple       - likewise for temple
 Consulted the Oracle   - bought at least one major or minor oracle
 Read a Discworld Novel - read at least one passage
 Entered Sokoban        - like mines
 Entered the Big Room   - not always possible since not always present

The novel and bigroom ones aren't always achieveable since novels are
only guaranteed if a book or scroll shop gets created and bigroom is
only guaranteed in wizard mode.  No one ever claimed that every
possible achievement can be attained in a single game.  (If one for
entering the Fort Ludios level--or perhaps entering the Fort itself--
eventually gets add, that won't be possible in every game either.)

The mine town one probably needs some tweaking.  Two of the town's
seven variants have no town boundary (despite a rectangular area of
pre-defined map) and at present simply arriving on either of those
levels is enough to be credited with the entered-town achievement.

Bump EDITLEVEL because u.uachieved[] has increased in size.  This
time it has been expanded to the maximum that xlogfile's bitmask of
achievements can handle, enough for up to 9 more achievements without
another EDITLEVEL increment.
2020-02-12 14:35:37 -08: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
0b15b99b12 Merge branch 'NullCGT-minotaurs-pr298' into NetHack-3.7 2020-02-10 22:02:26 -05: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
nhmall
c7c0c87859 move status condition field selection to its own menu 2020-02-09 14:56:37 -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
nhmall
67cc0183b0 ranking of new status conditions 2020-02-08 19:51:04 -05:00
Pasi Kallinen
7eb20c9e7a Unify multishot class bonus code 2020-02-08 18:04:54 +02: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
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
PatR
b4d8475b95 populate insight.c
Move enlightenment and conduct from cmd.c to insight.c.  Also move
vanquished monsters plus genocided and/or extinct monsters from end.c
to there.  And move the one-line stethoscope/probing feedback for
self and for monsters from priest.c to there.

Achievement feedback has been overhauled a bit.  When no achievements
have been recorded, the header for them (after conducts) won't be
shown, and when at least one has been recorded, make the prompt for
asking whether to disclose conduct be about disclosing conduct and
achievements.  Also, describe achievements in the Guidebook.

I ran out of gas before updating Guidebook.tex; it will catch up to
Guidebook.mn eventually.

Some of the MS-DOS Makefiles haven't been updated yet so linking
without insight.{o,obj} will break there.
2020-02-06 17:42:15 -08:00
nhmall
690e072a49 is_elf(), is_dwarf(), is_gnome(), is_orc(), is_human()
Those tests were only checking the permonst mflags2 field
so anytime those tests were used in the code, they came
up false for things like an elven ranger. An elven ranger
should return true for an is_elf() test, as an example.

That happens because the profession monsters in monst.c
are defined with M2_HUMAN.

This augments those is_*() race tests to also check for a
matching player race as well.
2020-02-06 12:09:24 -05:00
Connor Gregorich-Trevor
d6a99a5586 Added sounds for minotaurs. 2020-02-05 19:54:01 -06:00
nhmall
1dfab5fe11 remove an argument that is no longer necessary from a few functions
Passing a boolean 'ghostly' argument to some functions that are also passed
an NHFILE * is unnecessary now.
2020-02-02 22:54:44 -05:00
PatR
2ebbe61f53 fix github issue #285 - spellcasting monster
After casting a spell, a monster got a chance to make a regular attack
despite the apparent attempt to set up a return value indicating that
it wouldn't move.

When looking over the return value situation, I noticed 'wormhitu()'
for the first time.  It gives worms additional attacks when the hero
is adjacent to some of the tail, that only works if the head is within
reach of a melee attack.  The hidden tail segment at head's location
always met that criterium so gave an extra attack that didn't make
sense; change wormhitu() to skip that segment.

Do some formatting in mcastu.c; no change in actual code there.

Fixes #285
2020-02-02 00:55:26 -08:00
PatR
32f0520fe0 sp_lev.c private variables
Make a start at reducing the size of 'g' by removing some special
level stuff that doesn't need to be there.
2020-02-01 15:44:42 -08:00
Pasi Kallinen
33cd6befe0 Dehardcode minefill
Instead of hardcoding the minefill levels in the core,
allow defining fill levels for a dungeon branch in the dungeon.lua
2020-02-01 18:31:39 +02:00
PatR
fb05f30167 update EDITLEVEL for achievement tracking 2020-01-30 18:28:55 -08:00
PatR
6c479f2317 more simplification of achievement tracking
Instead of hardcoding the "prize" type and then watching for that
to be created, specify it in the level description.

Also, instead of giving both Sokoban end levels 50:50 chance for
either prize, bias the one that used to always have the bag of
holding to now have 75% chance for that and 25% chance for amulet
of reflection, with the other one having those chances reversed.
So still 50:50 overall.
2020-01-30 17:35:32 -08:00
PatR
ea8248e3c6 new 'mention_decor' option
Somewhat similar to 'mention_walls', 'mention_decor' is a way to
request additional feedback when moving around the map.  It reports
furniture or unusual terrain when you step on that.  Normally stepping
on furniture only mentions it when it is covered by object(s).  And
moving onto (rather than into) water or lava or ice doesn't bother
saying anything at all.  With the new option set there will be a
message.  It uses Norep so won't repeat when moving from one water
spot to another or one lava spot to another or one ice spot to another
unless there has been at least one intervening message.  There is also
a one-shot message when moving from water or lava or ice onto ordinary
terrain (not Norep, just once since there's no land to land message).

Having the verbose flag Off doesn't inhibit these new messages but it
does shorten them: "A fountain." instead of "There is a fountain here."

The Guidebook gets a new subsection "Movement feedback" of the "Rooms
and corridors" section and it covers more than just 'mention_decor'.
As usual, Guidebook.tex is untested.

'mention_decor' persists across save/restore, so 'struct flags' has
changed and EDITLEVEL is being bumped, hence save files are invalided.
2020-01-29 09:47:36 -08:00
nhmall
63310076bb fnamesiz comment bit 2020-01-29 10:29:37 -05:00
nhmall
c97cabb92e fnamesiz bit 2020-01-29 10:09:45 -05:00
nhmall
e39ec5ce3e rename new header file to fnamesiz.h
Changes to be committed:
renamed:    include/filesize.h -> include/fnamesiz.h
2020-01-29 09:56:43 -05:00
nhmall
209fab138b recover fix
recover had deviated somewhat from NetHack in its
file expectations:
1) A couple of 3.7 fields needed to be accommodated.
2) hard-coded file size values had deviated.

The file sizes are now in an added header file named "filesize.h",
which is included at the bottom of config.h.

There will likely be another commit to write the filename size ahead
of the file name so that the precise number of characters can be read,
but since that will break existing saves, it can go in along with another
save-breaking commit.

This commit doesn't not alter savefiles written by nethack so does not
require an editlevel bump. It does alter the read-in expectation in
recover to match the game and this get recover working again.
2020-01-29 09:15:55 -05:00
PatR
c9166bc00c black and white ice
Like lava when that looks the same as water with color Off, render ice
in inverse video if it looks the same as the floor of a room.  (I tried
bold first but the result didn't look very good.)

Done for tty and curses; others may want to follow suit.
2020-01-28 15:01:41 -08:00
nhmall
efd0911f89 Merge recent changes into NetHack-3.7 2020-01-27 16:49:31 -05:00
nhmall
4302b7404c more typo propagation 2020-01-27 12:56:34 -05:00
nhmall
033894d784 Merge branch 'NetHack-3.7' into NetHack-3.7-Jan2020 2020-01-27 08:52:17 -05:00
Ray Chason
b2c8d916f6 Add set_tile_type, stretch_tile and free_tile
set_tile_type frees tileset memory not in use for the current tile
type (paletted or full color).
stretch_tile and free_tile support resizing tiles at run time.
2020-01-27 09:54:58 +02:00
Ray Chason
9460796a2b MSDOS/VESA: Add video_width and video_height
To be used to set the video mode
2020-01-27 09:54:58 +02:00
PatR
c911446188 more wizard mode wishing for terrain
Try a lot harder to keep terrain/level flags in a sane state.  They're
overloaded so it's not simple.

Creating a fountain or sink incremented the corresponding counter (for
controlling ambient sounds) but removing one by wishing for something
else in its place didn't decrement.

Allow wish for "disturbed grave" to create a grave with the 'disturbed'
flag set, similar to existing "magic fountain" and 'blessedftn' flag.
(I didn't add "looted throne", "looted tree", and several other things
that use the 'looted' overload of 'rm.flags'.)

Automate block_point (tree, cloud, secret corridor, or secret door in
open doorway) and add unblock_point (use Pass_wall to move into wall
or tree or stone, or just walk onto a cloud, then make iron bars or
almost any other wishable terrain to replace the blocking feature).
2020-01-26 12:23:50 -08:00
PatR
4505a8dc4c left out of "limit rate of long worm growth" 2020-01-26 05:12:55 -08:00
PatR
206e9668f1 achievement tracking oversight
obj->record_achieve_special (overlay of obj->corpsenm) is no longer
used.
2020-01-26 02:58:18 -08:00