Commit Graph

15818 Commits

Author SHA1 Message Date
nhmall
31a46e72c0 Guidebook date stamp 2023-11-13 07:46:17 -05:00
nhw_cron
62d8d5858f This is cron-daily v1-May-8-2022. 005guidebook updated: doc/Guidebook.txt 2023-11-13 07:39:05 -05:00
nhmall
682ae10f51 missing prototype warning ifndef TEXTCOLOR
../win/tty/wintty.c: In function ‘set_item_state’:
../win/tty/wintty.c:1174:9: warning: implicit declaration of function
‘term_start_color’; did you mean ‘term_start_attr’?
[-Wimplicit-function-declaration]
 1174 |         term_start_color(item->color);
      |         ^~~~~~~~~~~~~~~~
      |         term_start_attr
 ../win/tty/wintty.c:1178:9: warning: implicit declaration
 of function ‘term_end_color’; did you mean ‘term_end_attr’?
 [-Wimplicit-function-declaration]
 1178 |         term_end_color();
      |         ^~~~~~~~~~~~~~
      |         term_end_attr
2023-11-13 07:26:04 -05:00
Pasi Kallinen
f74f7988ff MSDOS: implement valid location highlighting
... for VGA and VESA tiled map.
2023-11-13 12:40:10 +02:00
Pasi Kallinen
dd5ca5b058 Change menu_headings to accept color and attribute
Instead of just accepting an attribute, it's now possible to
use a color, or both color and attribute, for example:

OPTIONS=menu_headings:inverse
OPTIONS=menu_headings:red
OPTIONS=menu_headings:red&underline

Default is still just inverse.
This lets the player change the menu heading color without
needing to use menu colors for them.

Also makes it so the core uses NO_COLOR instead of 0, for all
the menu lines which don't have any prefedefined color.

Tested for tty, curses, x11, qt, and win32
2023-11-13 07:33:56 +02:00
PatR
dd6c249a8c remove obsolete comment 2023-11-12 10:26:59 -08:00
PatR
fcf1a42cac fix for two empty-handed hits
When using bare-handed combat or martial arts at better than 'basic'
skill, don't attempt a second hit if wearing a shield.
2023-11-12 10:21:51 -08:00
nhmall
76d328d86a gi.invalid_obj -> hands_obj 2023-11-11 19:49:38 -05:00
nhmall
47bca92e6c follow-up Install.dos: consistent sample dir path 2023-11-11 12:27:03 -05:00
nhmall
7b2bf56f40 update Install.dos 2023-11-11 12:01:28 -05:00
nhmall
e0e60cb97e remove a cast from assignment to same type 2023-11-11 08:12:17 -05:00
PatR
ce79cb519c fixes entry for PR #1129 - using up ammo/missiles
Pull request by entrez:  have monsters and the hero use the same code
when deciding whether to destroy a missile that hits a monster after
being thrown or shot.

Closes #1129
2023-11-11 01:25:49 -08:00
Michael Meyer
d42564bacd Better align drop_throw with hero ammo breakage
There is a comment above the function indicating that it should be
aligned with hero ammo breakage, but this wasn't the case.  One big
difference is that any monster-thrown or -shot object would be deleted
unconditionally if it hit another monster trapped in a pit.  I don't
know why that was in there, but it's not present in hero ammo breakage
chances, and it meant that a monster could sling the Mines luckstone at
the hero, hit a monster in the pit, and permanently lock the hero out of
getting the luckstone (as just happened to a player during the current
tournament).  This pulls the hero breakage rules out into their own
function and uses that for monster breakage as well, to make sure they
are aligned.  I also refactored drop_throw a bit to reduce the number of
separate variables tracking whether the object was deleted (was create,
objgone, and retvalu), and changed its (and ohitmon's) type to boolean.
2023-11-11 01:17:54 -08:00
nhmall
ee0247ac5f follow-up u.uswallow 2023-11-10 19:01:16 -05:00
PatR
b03e5c1ad7 ^G of unseen monster
I used ^G to create a monster and specified "invisible owlbear".  I
then got "An owlbear appears next to you."  Except it didn't; it was
invisible and I lacked see-invisible.  I imagine that newsym() was
called for the new-yet-invisible monster, but that remained buffered
and was gone overridden by the time pending map update got flushed
at some point after the monster was made invisible.

Add a new makemon() flag to turn a newly created monster invisible
during its creation, before "monster appears" message is delivered.
Since that message will now be suppressed in this situation, use the
cursor-flash hack that indicates where the new, unseen monster got
placed.  Creating "1000 invisible <mon>" is something you probably
won't do twice.
2023-11-10 15:43:02 -08:00
nhmall
088c15b3cd improve x_monnam results when swallowed
This addresses one of the scenarios that had previously been discussed
in the comments under pull request #979.
2023-11-10 17:01:46 -05:00
nhmall
f360cb24b1 allow monster that has swallowed hero to be named 2023-11-10 16:35:43 -05:00
PatR
4512ae5bbe warning fix
Adding U suffixe to ELF_WT lead indirectly to comparing signed rn2()
with macro specifying an unsigned magic constant.
2023-11-10 10:33:50 -08:00
PatR
a758e88246 PR #1125 - more disturbing buried zombies
Pull request from entrez:  hero walking over a zombie's burial site
will only disturb it if meeting a minimum weight threshold.

Update several weight macros to be 'unsigned', matching mons[].cwt.
[I'm not sure about this one.  'unsigned short' promotes to 'signed
int' these days on most platforms.]

Closes #1125
2023-11-10 10:33:11 -08:00
nhmall
f97ff175de bring a couple of comments up to date 2023-11-10 13:17:09 -05:00
Pasi Kallinen
c44906b28e Put random room engravings on room locations only
Another case of engraving going on a cloud.
2023-11-10 20:08:45 +02:00
Michael Meyer
392295d770 Require min body weight for step to wake zombies
A newt or something probably isn't disturbing anything buried 6 feet
below the ground.  WT_ELF/2 is the size of a dingo or goblin.
2023-11-10 10:04:07 -08:00
Michael Meyer
de2c3f033a Make WT_foo defines unsigned
These are meant to be 'cwt' values and directly comparable to a
particular pm->cwt, which is an unsigned short.  My concern here was
signed/unsigned comparison warnings like the one fixed in 1538b40, but
I'm not sure if this is actually necessary: there is already a
comparison between cwt and WT_HUMAN in max_mon_load() which apparently
doesn't produce the warning...
2023-11-10 10:04:06 -08:00
PatR
069855eefc yet more #1112 - slippery hands vs sink
Fake object used for 'hands' has an address, so checking for a Null
pointer won't recognize it.
2023-11-10 09:38:40 -08:00
nhmall
27e727d7d7 another missed cast removal 2023-11-10 11:31:24 -05:00
nhmall
24b6f6a03e follow-up cast removal in eat.c 2023-11-10 11:28:08 -05:00
nhmall
314a2a9489 use gi.invalid_obj instead of cg.zeroobj
cg.zeroobj was originally added (under its previous unprefixed name)
for providing a one-line way to zero out the fields of a struct obj.

    struct obj tempobj;
    tempobj = cg.zeroobj;

    initfn(struct obj *otmp)
    {
        if (otmp)
            *otmp = cg.zeroobj;
    }

More recently, the address of cg.zeroobj began to be used as a return
flag to indicate some things, but the 'const struct obj zeroobj' wasn't
an ideal fit for the purpose and required a number of casts, including
casting away const.

Provide a better fitting variable (gi.invalid_obj) and eliminate a
number of casts.
2023-11-10 11:07:49 -05:00
nhmall
17dd51d922 Merge branch 'discard-broken-wand' of https://github.com/argrath/NetHack into NetHack-3.7 2023-11-10 09:14:20 -05:00
nhmall
b63c2ecc2b Merge branch 'fix-options' of https://github.com/argrath/NetHack into NetHack-3.7 2023-11-10 09:13:45 -05:00
PatR
915da30c9d more PR #1112 - dipping in sinks
Suggestion from entrez:  If dipping something in a sink while hands
are slippery happens to cause that sink to break, only remind player
about still being Glib if the item was '-' or uarmg.

Redo one of the fixes entries:  dipping a potion into a sink does not
dilute it.  The potion is used up and gives a hint about what it does
so player might discover it.
2023-11-10 01:14:24 -08:00
SHIRAKATA Kentaro
3db06f4c6d split discarding broken wand into separate function 2023-11-10 16:46:06 +09:00
PatR
d0ade3b085 streamline PR #1124
Get rid of an extra 'if'.
2023-11-09 21:58:58 -08:00
PatR
5481657792 pull request #1124 - streamline dosacrifice()
Pull request from argrath.

Closes #1124
2023-11-09 21:50:02 -08:00
SHIRAKATA Kentaro
637db78cea streamline dosacrifice(): early return when offering other than corpse 2023-11-09 21:32:32 -08:00
PatR
394fa24666 refine PR #1112 - washing, dipping in sinks
If hero has slippery hands, include '-' among likely candidates for
item to #dip when dipping at a pool, fountain, or sink location.

When dipping an item (including hands), have a modest chance for the
sink to be destroyed--which turns it into a fountain--each time so
that it can't be used to blank scrolls an unlimited number of items.
(Pools can already be used for that, but you need to obtain water
walking ability or else drop most of your stuff and enter the water;
sinks weren't imposing any such requirements or risks.)
2023-11-09 18:22:06 -08:00
PatR
f86dbf13b5 fixes entry for PR #1112- wash hands, dip in sink
Pull request from entrez:  when at a fountain, pool, or sink location,
the #dip command will allow #dip to pick terrain and player to choose
pseudo-item '-' for hands.  Also allow dipping actual items in sinks.

Closes #1112
2023-11-09 16:46:36 -08:00
Michael Meyer
ca56b1d161 Make c_vision_clears const char *const
Everything else in c_commmon_strings had this qualifier, but
c_vision_clears was just const char *.  There doesn't seem to be any
reason for that so change it to be consistent with the others.
2023-11-09 16:41:06 -08:00
Michael Meyer
674b8c6b07 Add additional sink potion #dipping effects
Also put "Nothing seems to happen." into c_common_strings, since it's
used all over several files.
2023-11-09 16:41:05 -08:00
Michael Meyer
3fac63749a Add basic sink #dipping effects
This is largely taken from xNetHack with a few minor changes.  Dipping a
potion into a sink can help with item identification by producing the
potionbreathe effect (or a sink-specific effect, for a couple potions).
Dipping other items will just run water over them.  I also added the
capability to wash your hands at a sink.
2023-11-09 16:41:05 -08:00
Michael Meyer
5af1fad398 Enable hero to wash hands in fountains and pools
Dipping hands (with '-') or currently-worn gloves in a fountain or pool
will cause the hero to wash her hands, washing away any oil and clearing
the Glib intrinsic timeout.  This does mean bare hands can be used to
fish for fountain effects, without having to pick up a stray arrow and
carry it around as a dipping item, but having your hands be the only
thing that does not activate those effects felt weird.  If that would be
too unbalancing this could be scrapped.
2023-11-09 16:41:04 -08:00
PatR
33034ebaba revise the two engraving tiles
With 16x16 tiles on X11 or Qt, I couldn't see the (dark blue?)
engraving marks on either the room engraving tile or the corridor one.
Change those marks to yellow so that the contrast with floor more.

The corrdidor engraving tile was based on the lit corridor tile.
Change that to be midway between the lit (centered solid dot) and
unlit corridor (centered hollow dot) tiles.  It no longer directly
matches either one but it also can't sometimes match the wrong one.
2023-11-09 13:52:19 -08:00
Pasi Kallinen
2e8adda028 Clouds cannot have engravings in them
... so delete the existing engraving if a cloud is put on the map.
2023-11-09 18:08:00 +02:00
SHIRAKATA Kentaro
eb03b1a6db remove unnecessary condition on parseoptions()
`opts` here is always non-null, otherwise it leads segv at earlier code.
2023-11-09 12:37:25 +09:00
PatR
e783c82b84 pull request #1116 - mon->mstate flags
Pull request from entrez:  the mstate field in struct mon defines many
bits but didn't use some of them consistently.

Initially they were intended to be examined via debugger, where being
inconsistent might lead to confusion but not have a negative impact on
gameplay.  However, some of them have morphed into affecting gameplay.

Closes #1116
2023-11-08 10:41:40 -08:00
Michael Meyer
a69ff06e85 Make mstate flag checks more mutually consistent
Various places checking for whether a monster was on the map based on
mstate flags were inconsistent about which ones they checked (and then
place_monster() was additionally inconsistent with all of them about
which bits were cleared when placing a monster onto the map).  I think
some places were also more convoluted than is now necessary because they
date back to mstate being an alias for mspare1, which it shared with
migflags before those became two separate dedicated fields (MSTATE_MASK
also dates back to this and is no longer used, so I removed it).

I tried to go through all the MON_foo mstate bits, understand when/why
they are set, and make the various functions I noticed more consistent
(with each other, and with my understanding of how the bits work) about
how they are treated.  I don't know for a fact that I understood
everything right -- some diagnostic bits that aren't used for much of
anything, like MON_OBLITERATE, had me mystified until I read the 5ee78c5
commit message -- but this patch hasn't caused any new problems (sanity
check or otherwise) with the fuzzer in my testing so far.  All the same,
it could probably use review by someone who has a good sense of what the
mstate bits mean.
2023-11-08 10:41:40 -08:00
SHIRAKATA Kentaro
7d007ea365 null-check argument bl before using it 2023-11-09 00:10:23 +09:00
PatR
bd2f8b4b8c pull request #1121 - remove unused variable
Pull request from argrath:  'sel' is assigned but then never used.

Closes #1121
2023-11-07 16:26:44 -08:00
SHIRAKATA Kentaro
7e735d9386 remove unused assignments 2023-11-07 16:26:12 -08:00
PatR
ffc6aa06cc pull request #1123 - back-on-solid-ground
Pull request from entrez:  update some terain-change messaging and be
more consistent with "you find yourself back on solid ground."

Closes #1123
2023-11-07 16:16:09 -08:00
Michael Meyer
a1b1f3b250 Try to unify "back on solid ground" messaging
Put everything through a single function that can handle all the
complicated parts of using the correct proposition for different terrain
types, and will not just call things "solid ground" indiscriminately.
This got complicated but I'm not sure if it's possible to do it much
simpler while still using the distinct names for each type of terrain
(unless you are OK with the sentences sounding sort of wonky).
2023-11-07 16:13:55 -08:00