Commit Graph

2079 Commits

Author SHA1 Message Date
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
nhmall
7012e7046f add support for MENU_ITEMFLAGS_SKIPINVERT
Able to test:
win/tty
win/win32
win/curses

Unable to test:
win/X11
win/Qt
win/Qt3
win/gem
win/gnome
2019-12-23 08:36:44 -05:00
nhmall
308943aea4 groundwork for window port interface change to add_menu
groundwork only - window port interface change

This changes the last parameter for add_menu() from a boolean
to an unsigned int, to allow additional itemflags in future
beyond just the "preselected" that the original boolean offered.

There shouldn't be any functionality changes with this groundwork-only
change, and if there are it is unintentional and should be reported.
2019-12-22 18:28:24 -05:00
PatR
c3fb94104b 'quick_farsight' option
Bite the bullet and add a special purpose boolean option to control
game behavior for random clairvoyance.  When objects or monsters are
discovered, it normally issues "you sense your surroundings" and
performs a getpos() operation which allows the player to browse the
map by moving the cursor around and getting 'autodescribe' feedback.
But there have been complaints that once the hero has the Amulet
(which triggers random clairvoyance even though hero isn't flagged
as having that attribute) the message and pause-to-browse become too
intrusive.

This was initially combined with the 'timed clairvoyance' fix because
they both bump EDITLEVEL to invalidate existing save files, but their
details don't interact so I separated them.
2019-12-22 13:40:59 -08:00
PatR
48a82fea8c fix github issue #266 - timed clairvoyance
When the hero has random clairvoyance, the code used
| (moves % 15) == 0 && rn2(2) != 0
(where 'moves' is actually the turn number) to decide when it would
kick in and show a portion of the map.  If the hero was fast enough
to get an extra move when the turn value met the (moves % 15) == 0
condition then clairvoyance could happen twice (or more if poly'd)
on the same turn.

The changes (one new field, reordering a few others) in 'struct
context' invalidate existing 3.7.0-x save files.

Fixes #266
2019-12-22 13:30:25 -08:00
nhmall
bcee4e694a Merge branch 'copperwater-hallutraps-3.7' into copperwater-3.7 2019-12-19 18:37:02 -05:00
nhmall
0c65736a08 Merge branch 'Nethack-3.7' into copperwater-autounlock-3.7 2019-12-19 18:34:33 -05:00
nhmall
ff48672e0b Merge branch 'NetHack-3.7' into copperwater-hallutraps-3.7 2019-12-19 18:32:53 -05:00