Commit Graph

2086 Commits

Author SHA1 Message Date
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
nhmall
3c968a09a3 Merge 'NetHack-3.6' updates into NetHack-3.7-Jan2020 2020-01-25 23:45:38 -05:00
nhmall
9e165b9e2a release prep bits 2020-01-25 23:42:36 -05:00
nhmall
97b74e6f7b Merge branch 'NetHack-3.7' into NetHack-3.7-Jan2020 2020-01-24 17:27:48 -05:00
PatR
0166239a22 simplify achievement tracking for special objects
This turned out to be a lot more work than I anticipated, but it is
definitely simpler (other than having #wizmakemap take achievements
away if you replace the level that contains the 'prize', which wasn't
handled before).

I cheated and made Mine's End into a no-bones level because the new
flagging scheme for luckstone, bag, and amulet can't carry over from
one game to another.  It probably should have been no-bones all along.
Sokoban didn't have this issue because it's already no-bones.

Existing save files are invalidated.
2020-01-24 13:54:23 -08:00
PatR
3e18804371 half poison gas damage from wearing a wet towel
Make wearing a wet towel confer new attribute Half_gas_damage in
addition to the usual blindness.  It reduces damage from being inside
a gas cloud region and from being hit by poison gas breath attack.
It also fully blocks breathing of potion vapors.

Might make the Plane of Fire easier although overcoming its blindness
with telepathy won't reveal elementals.  Definitely has the potential
to make blind-from-birth conduct easier which wasn't the intent and
probably isn't significant.
2020-01-21 17:03:54 -08:00
nhmall
36bb4334e8 Merge fixes from 'NetHack-3.6' into NetHack-3.7-Jan2020 2020-01-20 21:33:20 -05:00
nhmall
b6efb765dc update README and patchlevel.h 2020-01-20 16:58:12 -05:00
nhmall
92deddd6a3 use vsnprintf instead of vsprintf in pline.c 2020-01-20 16:09:00 -05:00
PatR
d19cab4d98 implicit_uncursed, mention_walls
Move 'implicit_uncursed' and 'mention_walls' from iflags to flags to
make their current setting persist across save/restore.  Invalidates
existing save files.
2020-01-17 04:03:14 -08:00
nhmall
d5174323eb Merge 'NetHack-3.6' updates into NetHack-3.7-Jan2020 2020-01-14 22:09:29 -05:00
nhmall
a6c46bbd85 housekeeping items for 3.6.5 - first pass 2020-01-14 11:35:06 -05:00
PatR
3409546876 more random novels
Give statues 'real' spellbooks only.

Provide mkobj() a way to accomplish that instead of resorting to
mksobj(rnd_class()).
2020-01-12 22:02:36 -08:00
Patric Mueller
38fa93df73 Restrict the teleportation notification to actual teleportations
teleds() is used for more than just teleportations, the teleportation message
was also given when mounting a steed.

Trying out a new bit flags method parameter design pattern.
2020-01-11 19:51:54 +01:00
PatR
7c3ae74c27 hallucinatory water and lava terrain
When browsing the map while hallucinating and looking at a pool, a
moat, or 'other' water or at molten lava, report with hallucinatory
liquids rather than the ordinary substance.  Likewise when browsing
self on map or using ^X would report "sinking into lava".
2020-01-11 09:34:01 -08:00
PatR
a4e80fa9b4 more trap feedback
When trapped in lava, change the text from "stuck in the lava" to
"sinking into lava" to describe the situation much more accurately.
Instead of doing that twice, move the u.utraptype feedback into a
separate routine that both enlightenment and self-lookat can use.
2020-01-10 06:53:48 -08:00
PatR
bfa0f072f7 fix #K125 - autounlock vs touching artifacts
Apply makes a touch_artifact check on the tool being applied, but
autounlock would pick an unlocking tool to use without doing that.
Noticed while fixing that:  autounlock took no time.

Since picking an artifact unlocking tool might now blast the hero,
change the tool selection.  First choice: any key except another
role's quest artifact; second: any lock-pick except another role's
quest artifact; third: any credit card except another role's quest
artifact; fourth, fifth, sixth: other roles' quest artifact key,
lock-pick, or credit card.  The fifth category (artifact lock-picks)
is empty.  Rogues will pick non-cursed Master Key over any other
key (special case for first choice).  Tourists will pick a key or
a lock-pick over their PYEC (first and second choices over third).
2020-01-05 23:54:11 -08:00
Patric Mueller
5267a50c7e Move enhance_tip into context and don't show tip if #enhance has been used before
Breaks save and bones compatibility.
2020-01-06 00:50:32 +01:00
PatR
8853d0e566 wizard mode wishing for secret doors
Allow wishing for secret doors and secret corridors.  It's a bit
more strict about where the wish is performed than wishing for
furniture.  Implemented in order to test drum of earthquake effects.

I spent a lot of time figuring out SDOOR details that somebody
already knew at some point but evidently didn't document--you can't
specify D_CLOSED for them or the display code will issue impossible
warnings about wall mode angles.
2020-01-05 13:13:21 -08:00
Pasi Kallinen
cedc757e16 Unify random light state for rooms or level 2020-01-05 13:31:24 +02:00
Pasi Kallinen
1d312ee3fe Add some player lua methods
Adds u.clear_inventory() and u.giveobj(new.obj("rock")) and some other minor stuff.
2020-01-04 16:55:53 +02:00
nhmall
218cbe9ea6 2020 2020-01-01 10:12:16 -05:00
Pasi Kallinen
7e07cef197 Lua struct obj improvements
If the core frees the obj struct referred by lua, don't free it,
just mark it as OBJ_LUAFREE - lua will free it in gc once all
the references to it are gone.
2020-01-01 13:25:59 +02:00
nhmall
e76326544f fix Xcode warning 2019-12-27 10:32:06 -05:00
nhmall
a4dfac2cec pull requests #174 and #128 for hallucinatory traps and autounlock
Pull requests:
hallucinatory traps
autounlock

This breaks existing save files.

Closes #174
Closes #228
2019-12-27 09:05:27 -05:00
nhmall
90f2af5277 merge bit 2019-12-27 09:02:51 -05:00
nhmall
b241945672 Merge branch 'NetHack-3.7' 2019-12-27 08:52:42 -05:00
Pasi Kallinen
6d8d3a9557 Add lua object references
Whenever a lua script references a core struct obj, increment a counter
in the obj struct. Core code will not free the obj, if there are any
lua references pointing to it, just makes it free-floating.
When lua script ends, the lua gc will free the free-floating objects.

Also exposes u.inventory to lua.

Breaks save and bones compat.
2019-12-26 19:15:24 +02:00
nhmall
a034e8200c centralize the invert decision logic to avoid updates to 7 ports
This will make it easier to tinker for best results.
2019-12-23 21:44:34 -05:00
Pasi Kallinen
370cfad85a Fix X11 compile 2019-12-23 16:45:25 +02:00
nhmall
83fdda56fe curses updates 2019-12-23 08:53:58 -05:00