Commit Graph

6949 Commits

Author SHA1 Message Date
nhmall
ff80f6be74 yet more Guidebook 2018-05-26 22:43:09 +00:00
nhmall
ad52611a6b Update Guidebook.txt 2018-05-26 22:32:46 +00:00
nhmall
d9ce033915 Guidebook.tex typo 2018-05-26 18:27:29 -04:00
nhmall
61bf743fb1 update some history 2018-05-26 18:23:19 -04:00
nhmall
e41c80e5eb missed one 2018-05-25 18:57:41 -04:00
nhmall
6c9aa091cd guidebk.txt over guideboo.txt 2018-05-25 18:52:26 -04:00
nhmall
4d7f2869c6 Merge branch 'msdos-build' of https://github.com/chasonr/NetHack into msdos 2018-05-25 18:42:50 -04:00
Ray Chason
bd5743f758 MS-DOS does not use getreturn_enabled 2018-05-23 21:44:42 -04:00
Ray Chason
2357cb3fc2 Work around quirky FreeDOS behavior 2018-05-23 21:44:20 -04:00
PatR
645e1ac5b3 hilite_status title when polymorphed
Make a 'textmatch' rule for title that matches a specific monster type
while polymorphed take precedence over a "none of the above" one.
2018-05-22 19:23:03 -07:00
PatR
cb02e77589 hilite_status, what else?
While deciding which highlights to apply, give 'percentage' and/or
'absolute' rules that match precedence over 'always' rules regardless
of order within the config settings.

When using 'O' to add 'up/down/changed' rule, don't include 'down'
as a choice for field 'time'.

When using 'O' to add rules, don't squeeze out spaces if adding a
'textmatch' rule for title (to support "field worker", "high priest",
"student of stones", and so forth).

While deciding which highlights to apply, ignore double quotes when
testing whether a 'textmatch' rule matches the current text of a
field.  This allows rules to specify string values as '"value"'
instead of just 'value'.  It not does validate them to ensure quotes
are paired at beginning and end, it just ignores them.  New rules
created via 'O' for rank title include them when displaying what the
new rule would look like as a config file option.  Other text fields
haven't been changed to show quotes but ignoring such applies to all
'textmatch' comparisons.

Expand the menu for adding 'textmatch' rules for title.  When a rank
has separate male and female titles, list three entries instead of
just one
  "male rank"
  "female rank"
  "male rank" or "female rank"
(the order of the first two entries and of the two titles in the
third entry is reversed if the current character is female).  If the
user picks the third entry, two rules are added instead of just one,
identical to each other except for the text to match.

Further expand that menu with
  "none of the above (polymorphed)"
at the end.  When deciding which highlights to apply, "none of the
above" and "(polymorphed)" and the full string are treated as
equivalent (with spaces, quotes, and parentheses ignored).  Rather
than comparing anything against the title text, it matches if the
hero is polymorphed (where title will be "<hero> the <monster-type>"
instead of "<hero> the <rank>").  Note that the user can have config
file 'textmatch' rules for title to match specific "<monster-type>"
values but the 'O' menu doesn't offer any opportunity for that.
(I've just realized that rules for specific monster types should be
given precedence over "none of the above" but at present that isn't
done; the order of the rules will determine which wins out.)
2018-05-22 10:40:55 -07:00
PatR
1e0f546740 hilite_status string comparison
Simplify the string comparison done when checking 'textmatch' rules
to decide whether to highlight something.

Fix the menu titles when setting up a textmatch via 'O':  the title
for color referred to attribute and the one for attribute used the
default.  The two tiles are set up in advance; the one for color was
set correctly but then the one for attribute was written into the
wrong buffer.

When using 'O' to manipulate hilite_status rules, if there are any
when you're done and the 'statushilites' option (iflags.hilite_delta)
is 0, give a message reminding that it needs to be non-zero for
highlighting to be activated.
2018-05-22 02:42:08 -07:00
PatR
2b8160a70d status_hilite: no more ANY_UINT
The fact that the index to the array of hunger strings is an unsigned
field in 'struct you' is unimportant as far as its usage for status
highlighting.  Since it is the only ANY_UINT field, change BL_HUNGER
to plain 'int' so that there'll be no need for ANY_UINT handling.

And some more validation when setting up highlight rules.  For 'O',
in the menu to choose a relationship after supplying a number N,
don't include "less than N" and "N or less" for percentage or
absolute--other than AC--unless N is greater than 0, and don't
include "N or more" and "more than N" for percentage unless N < 100.

Also, when 'O' prompted for a number, if you entered <X or =X (for X
not a sequence of digits), it remembered the '<' or '=' (or '>=', &c)
when reprompting for a valid number.  If the 'X' portion is invalid,
discard the relationship operator before asking for another number.
2018-05-21 19:11:18 -07:00
nhmall
f614b9e27e fix access violation in status_finish() if window port not initialized 2018-05-21 18:31:45 -04:00
nhmall
81e422189c Windows wouldn't compile without TTY_GRAPHICS defined 2018-05-21 16:44:19 -04:00
nhmall
d95dae3cf4 fix early crash during config file error processing 2018-05-21 16:39:16 -04:00
nhmall
fcc26f2c44 fixes update for previous static prototype move in rip.c 2018-05-21 10:20:17 -04:00
nhmall
8f73f85ac4 static prototype could be left orphaned depending on #defines 2018-05-21 10:14:39 -04:00
nhmall
7508b0e34e Merge branch 'NetHack-3.6.2' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2 2018-05-21 09:55:44 -04:00
nhmall
6311985d57 don't highlight the leading space before gold field on the status line 2018-05-21 09:35:38 -04:00
PatR
dc00df935b hilite_status support for <=, >=, explicit =
Add threshold relationships <= and >= so that the change to make <
and > perform their expected comparison can be resolved.  "Point
release shouldn't force players to update their config files" does
not carry sufficient weight given that they already had to do that
to turn on status highlighting when going from 3.6.0 to 3.6.1.  The
3.6.2 release notes can warn them about the need to update their
status highlight options if they're currently using '<' and/or '>'.

Entering new hilite rules via the 'O' command accepted '=' prefix
for numbers, but rules from config files did not.  Now they do.
The '=' prefix is optional in both situations.

With 'O', percent rules and absolute rules had separate menu entries
so picking one was already choosing the rule type, but entering a
numeric value without percent sign (for percent) or with one (for
absolute) would change the type on the fly.  If someone has already
picked percentage they shouldn't be required to append '%' to the
digits, so that is now optional.  If explicitly included with the
number after having picked absolute, the value is rejected.  It is
trivial to back up in those menus and choose the alternate type if
someone changes his/her mind part way through.

If a status field has both persistent (percent, absolute, always)
and temporary highlights (up, down, changed), give the temporary one
precedence when the value has changed.  To do that with 3.6.1, the
rules for temporary had to follow the ones for persistent highlights
since whichever matched last was the one used.  Now their order
relative to each other doesn't matter.  If a value increases and
there is both an 'up' rule and a 'changed' rule, the more specific
'up' takes precedence, regardless of their relative order; likewise
for decreases and 'down' vs 'changed'.

There were a couple more tweaks needed to support negative values;
I overlooked the 'O' menu handling before.  >-1% and <101% now work
for both the config file and interactive adding via 'O' methods of
defining highlight rules, although new >=0% and <=100% will be
clearer to anyone examining a rule set.

'enum relationship' was forcing LT_VALUE to be -1 but that fact was
never utilized anywhere, and the code was using magic number -2 to
mean "no relationship yet".  This adds NO_LTEQGT to replace the
latter and gives it value -1.  EQ_VALUE is still 0 so effectively
the default if a highlight hasn't been fully set up yet.  LT_VALUE
is now just another positive value along with GT_VALUE, LE_VALUE, &c.

The Guidebook hasn't caught up with the code yet.

The rule choosing code used when deciding how to highlight something
only supports 'int' fields and relies on 'long' having the same bits.
It needs to be extended to support 'long' properly.  Fixing should
be straightforward (except maybe for the initialization of min/max
best fit handling) but this doesn't address that.  Also, data type
for encumbrance/carrying-capacity should be changed from unsigned to
plain int so that no extra handling for just one field will be needed.
2018-05-21 05:58:01 -07:00
nhmall
b142456787 Merge branch 'NetHack-3.6.2' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2 2018-05-20 15:37:38 -04:00
nhmall
c58b6119ca be consistent with the tex version 2018-05-20 15:36:51 -04:00
nhmall
5a63871c83 be consistant with the tex version 2018-05-20 15:17:57 -04:00
nhmall
9cb9164ce5 update note of appreciation in Guidebooks (dat/history to follow) 2018-05-20 15:11:49 -04:00
PatR
4fa455e306 more status_hilite threshold handling
Negative AC needed one extra change to support >-N since there was
a place in the code that assumed 0 was the lowest possible value.
(My earlier testing was with <-N which didn't have that issue.)

Make '/<N/' work as 'val < N' instead of 'val <= N', and />N/ work
as 'val > N' instead of >=.  The <= and >= behavior might have been
intentional but the only support for that I could find was that
the 'O' menu used "N or less" for '<' and "N or more" for '>' when
setting up 'absolute' rules.  If we actually want <= and >= (and we
probably do...), we should add them as more relationship operators
instead of misusing < and >.

Simplify the is_ltgt_percentnumber() case when parsing options
since input has been fully validated by the point that that test
passes.  Among other things, /<-0/ and />-0' are now accepted (as
synonums for 0; -0 doesn't mean anything special) instead of being
silently rejected and then discarding the rest of the config file.
(That bad behavior is a separate issue not dealt with here.)
2018-05-20 01:20:51 -07:00
PatR
b17c6d0b54 fix #H7155 - polearm can reveal hidden monster
The code to choose a likely target when applying a polearm was
basing its decision on visible spots which contained monsters,
so could expose the location of a hidden monster if there was
only one such spot within polearm range.  Not mentioned in the
report:  it also wouldn't pick remembered, unseen monster unless
there was a monster still at that spot.

I've changed it to choose candidate location based on the glyphs
shown rather than on the presence of monsters.
2018-05-19 15:46:09 -07:00
PatR
98099863ff fix #H7159 - orc hero can start with lembas wafers
Orc heroes get an extra food item ("to compensate for generally
inferior equipment") and it could randomly be lembas wafers (or
cram rations), and Ranger heroes always started with cram rations
even when they're orcs.  Fixing the latter was simple, but the
normal race-based substitutions weren't applied to randomly
generated items, so the fix for the former required a bit of code
reorganization in ini_inv().

Elf heroes already get lembas instead of cram; do the reverse for
dwarves (although I don't think this case can happen--no role gets
lembas wafers and only orcs and always-human tourists get random
food); give orc heroes tripe instead of either lembas or cram.
2018-05-19 11:47:15 -07:00
PatR
e9f1e03271 fix some of #H7156 - perm_invent issues
> [1. perm_invent is kept in flags so persists across save/restore, but
>  perm_invent capability can change if player restores with a different
>  interface--or same one running on a different-sized display--so it
>  ought to be in iflags instead.]

Not addressed here.

> 2. perm_invent window does not get updated when charging a wand (or
> other chargeable item presumably), with a scroll of charging.

Most scrolls rely on useup() -> update_inventory(), but charging uses up
the scroll early so that it will be gone from inventory when choosing an
item to charge.  It needed an explicit update_inventory() after charging.

> 3. update_inventory(), is called from setworn(), which is called from
> dorestore(), when loading a save.  Segfaults have been observed in
> variants based on this code (though not yet in vanilla 3.6.1), so it's
> possible this may be unsafe.  The update_inventory() call in setworn()
> could be protected with "if (!restoring) ..."

tty doesn't support perm_invent, so this might be a win32 issue.
I've made the suggested change, but a better fix would be to turn off
perm_invent as soon as options processing (new game) or options restore
(old game unless/until #1 gets changed) has finished setting things up,
then turn it back on at the end of moveloop()'s prolog when play is
about to start.

 = =

Most of the read.c change is reordering prototypes to match the order
of the corresponding functions.  I did this when adding a new static
routine, then ended up discarding that routine.
2018-05-19 04:19:18 -07:00
PatR
bed79b8391 more hilite_status threshold number parsing
In addition to leading '-' for negative values, accept explicit '+'
for positive values as a no-op.
2018-05-18 22:56:21 -07:00
nhmall
ee36206fdc Merge branch 'NetHack-3.6.2' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2 2018-05-18 22:05:57 -04:00
nhmall
3b77543bcc preserve change from old branch 2018-05-18 22:05:05 -04:00
PatR
546321d055 Unix Makefile changes 2018-05-18 22:04:21 -04:00
nhmall
2fb9d6c94e save Pat's change 2018-05-18 21:42:41 -04:00
PatR
5c6245c312 commit test for renamed branch
Locally I've committed to NetHack-3.6.0 and haven't yet pulled from
upstream to get the branch rename.  I expect this commit to be
rejected but it could conceivably go through to the new name.
2018-05-18 21:40:22 -04:00
PatR
4b98266e25 fix #H7160 - hilite thresholds reject negatives
There was a prior report about this but I can't find it; maybe it
didn't go through the web contact form.  Anyway, status_hilite
threshold numeric values wouldn't accept a minus sign before the
digits, preventing negative AC values from being tracked.
2018-05-17 15:48:09 -07:00
nhmall
1641409d1c Merge branch 'NetHack-3.6.0' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.0 2018-05-16 23:46:12 -04:00
nhmall
2758cd998a Guidebook.txt update 2018-05-17 03:42:38 +00:00
nhmall
84d4fcc4c8 another beta bit 2018-05-16 23:31:27 -04:00
nhmall
1e60a16565 sync date between two Guidebook files (.mn, .tex) 2018-05-16 23:26:07 -04:00
nhmall
05e84babb8 beta bit
Display the word beta in a better spot on the line
2018-05-16 23:23:08 -04:00
nhmall
5a62515d7b more bump of version ID 2018-05-16 23:08:37 -04:00
nhmall
2b66b5ecd1 bump version ID values 2018-05-16 23:06:44 -04:00
PatR
fa0a136b06 tty/wintty.c w/o TEXTCOLOR
With TEXTCOLOR disabled, compiler warnings about term_start_color()
and term_end_color() not being declared were followed by link failure
because they weren't available.

This tries to simplify color handling in the tty status code without
resorting to #if TEXTCOLOR (the proper fix, but somewhat intrusive).
For the usual case where TEXTCOLOR is defined, there were instances
of
  if (color != NO_COLOR && color != CLR_MAX)
    term_start_color();
  ...
  if (color != NO_COLOR)
    term_end_color();
and also of
  if (color != NO_COLOR)
    term_start_color();
  ...
  if (color != NO_COLOR)
    term_end_color();
I've changed both types to be
  if (color != NO_COLOR && color != CLR_MAX)
    term_start_color();
  ...
  if (color != NO_COLOR && color != CLR_MAX)
    term_end_color();
so that start/end pairing will always be consistent.

Also, ((color_and_attr & 0xFF00) >> 8) might not work as intended if
using 16-bit int and color_and_attr happened to have its sign bit set.
Change to ((color_and_attr >> 8) & 0x00FF) to ensure just the desired
bits.

Also also, a couple more formatting bits.
2018-05-15 17:09:47 -07:00
PatR
d752a4ad93 X11/winX.c w/o TEXTCOLOR
Avoid warnings when TEXTCOLOR isn't enabled.
2018-05-15 17:08:40 -07:00
PatR
1ecb2c1e79 mapglyph.c w/o TEXTCOLOR
Avoid warnings when TEXTCOLOR isn't enabled.
2018-05-15 17:06:51 -07:00
nhmall
8dc2c59796 fixes36.2 catch-up for previous commit 2018-05-15 19:41:12 -04:00
nhmall
821399c6be fix access violation when --debug:xxxx has no other args after it 2018-05-15 19:39:05 -04:00
nhmall
88f5dcbfb4 fix spaces in hilite_status option text field not working H7107 (GitHub #88)
Fixes #88

H7107: FWD: spaces in hilite_status option text field not working
2018-05-15 19:35:36 -04:00
keni
f810a45dc1 fix H7138: sys/unix/setup.sh fails with no arguments
Sanity check was in the wrong place.
2018-05-15 16:30:28 -04:00