../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
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
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
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.
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.
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
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...
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.
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.
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.)
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
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.
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.
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.
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.
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
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.
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).