PatR [Wed, 10 Jun 2015 23:23:19 +0000 (16:23 -0700)]
tribute passage 'summary'
When reading a passage from a tribute novel, put the final attribution
line "[$TITLE, by Terry Pratchett]" into message history, comparable to
the summary line for deliver-by-window quest messages.
PatR [Wed, 10 Jun 2015 07:54:07 +0000 (00:54 -0700)]
tribute: The Last Hero
Flesh out _The_Last_Hero_. Due to its publishing history (no ordinary
paperback, some lists of "other books by this author" miscategorize it
as being co-written by the illustrator) it's most likely not as widely
read as the other Discworld books.
nhmall [Wed, 10 Jun 2015 01:33:08 +0000 (21:33 -0400)]
default to original background
Changes to be committed:
modified: src/display.c
The work for getting this working fully is now moving to the background_tiles branch.
In master, we just return the standard lit room tile for now, no change in behavior.
No ports utilize the new parameter as yet.
Pasi Kallinen [Tue, 9 Jun 2015 13:54:44 +0000 (16:54 +0300)]
TTY: Hilight piles of objects
Add MG_OBJPILE flag, which windowports can use to check if a location
has more than one object stack. If use_inverse is on, TTY will use
inverse to show such piles. If a boulder is the topmost item on a pile,
then the object pile flag is not used; mainly because boulders are "solid",
boulders dropped by monsters are nearly always over other objects, and so
that special levels such a Sokoban can "hide" items under the boulders.
TODO: a "pilemark", analogous to "petmark", perhaps a green plus sign,
which can be used by windowports with tiles.
Tiles on tiled ports always looked odd on places like the plane of air
where the background color of the tile didn't match the general background
of the surrounding area.
3.6 made that even worse and more glaringly noticeable with the introduction
of darkened room tiles.
The code to actually send something useful through the new parameter
for window ports to take advantage if they want will follow.
PatR [Sat, 6 Jun 2015 06:37:02 +0000 (23:37 -0700)]
lookat again
Remove second 'alt_i' initialization, which was first in implementation.
Superseded by the preceding line, which came later. Works either way,
but the conditional initalization avoids the two extra loop iterations
when they're not useful.
PatR [Sat, 6 Jun 2015 03:19:18 +0000 (20:19 -0700)]
lookat issues for unknown/solid rock/dark room
Fix two things with the ';' and '/' commands, both for looking at blank
space. The list of possibilies included "a dark part of a room or the
dark part of a room" even though the code involved goes out of its way
to avoid redundant clauses. S_stone let dark part be prefixed by 'a',
S_room and S_darkroom forced it to be 'the' which is better phrasing
but outsmarted the redundancy check. Make S_stone's use of "dark part
of a room" force 'the' too.
That's trivial; this is more complicated: the new maze variations
exposed/aggravated an issue that's been there all along. In a non-
WALLIFIED maze, doing look-at on the solid stone in-place-of-wall
next to you reported "dark part of a room" which is clearly wrong when
you can tell it's not a room. (The same thing happens in any ordinary
corridor, but players rarely try to identify blank space next to them
it that circumstance so it hasn't mattered very much.) This change
results in look-at listing "unexplored" and "stone" as additional
possibilities when looking at blank spots. Final description will be
"unexplored" instead of dark room if you haven't seen the spot, "stone"
if you have and that's what it is, or "dark part of a room" otherwise.
PatR [Sat, 6 Jun 2015 01:18:19 +0000 (18:18 -0700)]
remove use of __FUNCTION__
The special level loader has been using __FUNCTION__ in error messages
for a few months now, but that is a gcc extension (evidently picked up
by other compilers since only Borland had an issue so far). The
standard way to do the same thing is with __func__, but that's C99 so
we should avoid it. (__FUNCTION__ came earlier; gcc supports both.)
This switches to convential C code to achieve the same effect, using
the name 'nhFunc' rather than __FUNCTION__:
void foo()
{
static const char nhFunc[] = "foo";
... code that might report problem in nhFunc ...
return;
}
This has only been added to the functions which actually reference it,
not a blanket intrusion into every routine. In special level loader's
case, the reference is hidden in the opvar_free() macro which is used
quite a lot.
At first I used a macro:
void foo()
{
#define nhFunc "foo"
... code that might report problem in nhFunc ...
return;
#undef nhFunc
}
but using an actual variable avoids duplicate copies of the function
name string when used more than once inside a given function, and it
can't accidentally carry over into the next function due to missing or
misspelled #undef.
If we someday switch alloc() to give more specific information than
__FILE__, the macro variation would be better since the function name
won't be used most of the time (ie, when MONITOR_HEAP isn't defined).
nhmall [Fri, 5 Jun 2015 10:36:00 +0000 (06:36 -0400)]
ensure dummy obj owornmask is clear (from Alex)
Another minor oddity (did not have time to trace it). Charges for damaged
weapon refer to it as "weapon in hand":
--
As you read the scroll, it disappears. Being confused, you mispronounce
the magic words... Demirci's long sword is covered by a mottled purple
glow! "You degrade that long sword, you pay for it!"
Call a scroll labeled VERR YED HORRE:
What do you want to wield? [- ajrw or ?*] j
j - a rustproof athame named Magicbane (weapon in hand) (10 aum).
What do you want to drop? [$a-df-rtwxM or ?*] r
You drop a long sword (40 aum).
Demirci offers 8 gold pieces for your long sword. Sell it? [ynaq] (y) y
You sold a long sword (40 aum) for 8 gold pieces.
You see here a scale mail (250 aum).
You see here a ring mail (250 aum).
A rustproof long sword (weapon in hand) (40 aum) for 15 zorkmids. Pay?
[yn] (n)
You paid for a rustproof long sword (weapon in hand) (40 aum) at a cost of
15 gold pieces. "Thank you for shopping in Demirci's used armor
dealership!"
--
PatR [Thu, 4 Jun 2015 22:31:25 +0000 (15:31 -0700)]
shapeshifting on rogue level
Limit vampire shapeshifting on rogue level to vampire bats (only
choice represented by uppercase letter) and have other shapeshifting
try for uppercase. The latter isn't rigorous because shapeshifters
(chameleon=':', doppelganger='@', sandestin='&') aren't uppercase
themselves, so won't be created there under ordinary circumstances.
It applies to the "summon nasties" monster spell and post-invocation/
post-Wizard's-death harassment effect too.
Pasi Kallinen [Thu, 4 Jun 2015 12:36:26 +0000 (15:36 +0300)]
Fix looking around when swallowed
From Boudewijn:
> I am currently swallowed by an ice vortex, and used the ; command
> to identify the \ on my top right.
>
> It said: "\ an opulent throne (interior of a monster)"
Now, when you're swallowed, and look at anything else than yourself,
you'll get "\ the interior of a monster (interior of an ice vortex)".
Based on the comment in the code, it seems this was the original
intention anyway.
PatR [Wed, 3 Jun 2015 00:39:19 +0000 (17:39 -0700)]
enlightenment for unarmored, also blindness
Augment the existing enlightenment feedback for blindness: "innately"
blind if poly'd into something without eyes, "permanently" blind if
using the blind-from-birth option, "deliberately" blind if blindness
is solely due to a blindfold, or "temporarily" blind otherwise.
Add status of "not wearing any armor" when applicable, with slightly
different phrasing if it's due to adhering the OPTIONS:nudist conduct.
PatR [Wed, 3 Jun 2015 00:30:16 +0000 (17:30 -0700)]
blind-from-birth fix
The Blindfolded_only macro didn't track u.uroleplay.blind so would
give a false positive if wearing a blindfold, not able to see due to
the blind option, and not afflicted with any other blindness factors.
Dipping a worn blindfold into holy or unholy water is supposed to
reveal a glow if that blindfold is the only reason for blindness but
the glow was described even when blind-from-birth.
There's no feedback at all when the glow isn't seen. I'm punting on
that one. (This change didn't introduce that, just added one extra
situation where it happens.)
PatR [Tue, 2 Jun 2015 23:57:42 +0000 (16:57 -0700)]
breaking blind-from-birth conduct
OPTIONS:blind starts the hero off blind, but putting on the Eyes of the
Overworld confers sight. Make that break the blind-from-birth conduct.
Sight persists after removing the Eyes even though they aren't intended
to cure anything. It doesn't make sense to restore the blind-from-birth
flag when taking the Eyes off, but we may want to add another flag, or
make u.uroleplay.blind into a bit mask that can track both can't-see-now
for play and could-never-see for conduct. (Actually, u.uroleplay.blind
should track only the conduct, and starting the game with it enabled
should set one of the extra bits in u.uprops[BLINDED].intrinsic. The
Eyes already override that, and taking them off would restore blindness
since the bit would still be set. As a bonus, the expression in the
macro 'Blind' could be simplified.)
nhmall [Tue, 2 Jun 2015 02:30:04 +0000 (22:30 -0400)]
option name change to statushilites
Changes to be committed:
modified: doc/Guidebook.mn
modified: doc/Guidebook.tex
modified: include/flag.h
modified: src/options.c
modified: win/tty/wintty.c
nhmall [Tue, 2 Jun 2015 01:41:00 +0000 (21:41 -0400)]
ready for testing
Changes to be committed:
modified: doc/Guidebook.mn
modified: doc/Guidebook.tex
modified: include/config.h
modified: win/tty/wintty.c
PatR [Tue, 2 Jun 2015 01:18:47 +0000 (18:18 -0700)]
tty role selection when filter by options
Honor things like OPTIONS:role=!tourist and NETHACKOPTIONS='race=!orc'
when performing interactive role selection. I don't think it was
completely correct when players let the program choose, but it must
have been close enough because we haven't gotten any complaints.
The post-3.4.3 interactive selection was ignoring options-base filtering
entirely and did get complaints for the pre-beta.
Role selection has a ton of code which bloats the program without doing
anything useful for actual game play. It ought to be split off into a
separate front end.
Pasi Kallinen [Mon, 1 Jun 2015 12:56:23 +0000 (15:56 +0300)]
Reduce the number of gnomes with candles
Gnomes in mines during level generation have 1/20 chance of getting a candle
(should give approximately 4 candles in all of the mines total), and every
randomly generated gnome has 1/60 chance.
PatR [Mon, 1 Jun 2015 00:18:06 +0000 (17:18 -0700)]
mondata.c formatting cleanup, ancient AIX PS/2 bug
When looking to see whether the monsndx() panic could provide any more
useful information [if a pointer that's supposed to point into the
mons[] array doesn't, I don't think that there's a whole lot of other
information available aside from whether it is null or not, and that's
implicitly provided already], I went through the whole file cleaning up
the formatting and making sure every routine was preceded by a short
(usually one line) comment.
There were a few bits of code reorganization. I changed little_to_big
to have a single point of return. The 25 year old workaround for a
compiler bug on a defunct platform may or may not still be applicable;
I took that out. If we get segfault reports for AIX on PS/2, this is
the first place to look. (big_to_little is nearly identical and didn't
have the same workaround. Not needed, or not called often enough for
any AIX PS/2 user to be affected?)
PatR [Sun, 31 May 2015 08:24:19 +0000 (01:24 -0700)]
last? Sting
If Sting is glowing when blindness gets toggled, give a new "glowing"
message.
So instead of
Sting glows blue! [...] You can't see! [...] Sting stops quivering.
if you're still blind when the last orc goes away, or
Sting quivers slightly. [...] You can see again. [...] Sting stops
glowing.
if you were blind when the first orc arrived, now you'll get an
intermediate message between the second and third ones. 'Sting is
quivering' for the first case, 'Sting is glowing' for the second.
No matter how many times blindness toggles back and forth, the final
"stops glowing" or "stops quivering" will be consistent with the most
recent "is glowing" or "is quivering".
PatR [Sun, 31 May 2015 05:41:30 +0000 (22:41 -0700)]
more Sting,&c
Add "(glowing light blue)" to the formatted object description when
Sting or Orcrist is glowing due to presence of orcs or "(glowing red)"
if Grimtooth is glowing due to elves. Use "(glowing)" if blind;
assumes that some aspect of the glow (perhaps warmth or vibration) can
be noticed via touch.
Make enlightenment's "you are warned about <monster class> because of
<artifact>" catch up with Orcrist and Grimtooth. It was attributing
Orcrist's warning against orcs to Sting, and Grimtooth's warning was
against "something" rather than elves.
The glow color is now a new field in artilist[], so the biggest part
of this patch is adding an extra value to each artifact's definition.
PatR [Sun, 31 May 2015 01:22:14 +0000 (18:22 -0700)]
get_cost_from_price
I couldn't figure out why walking over a container in a shop might
give the wrong price; the code looks correct. But I've reorganized
get_cost_from_price to perform the cheapest tests first. The u.ushops
check should probably be done in doname to avoid calling this routine
at all 99.99% of the time.
PatR [Sat, 30 May 2015 19:30:54 +0000 (12:30 -0700)]
disoriented teleport attempt
Reported for pre-beta, getting "you feel disoriented" when attempting
to teleport within a level while carrying the Amulet, you still ended
up teleporting. Wizard mode allows the disorientation to be overridden
but the logic was wrong. It worked as intended when in wizard mode but
unintentionally always overrode disorientation when not in that mode.
PatR [Sat, 30 May 2015 08:25:46 +0000 (01:25 -0700)]
menucolors parsing
Revise the menucolor parsing (color and attribute portion, not the
regexp part) to switch to the string matching used for wishing in
order to allow space in the "light <foo>" entries instead of forcing
the two words to be run together. Having them be run together still
works, as does use of dash or underscore to separate the two words.
So the canonical form for light blue is now "light blue" instead of
"lightblue", but all of "light blue", "lightblue", "light-blue", and
"light_blue" match it. (So do weird things like "--li-gh_-_tbl ue _"
but I won't lose any sleep over that.)
Almost all of this if formatting; mostly blank line after declarations
but also there was new stuff that didn't match the recent reformat.
PatR [Sat, 30 May 2015 00:42:15 +0000 (17:42 -0700)]
add warning glow for Orcrist & Grimtooth
Make Orcrist glow light blue when orcs are present, just like Sting.
(Sting supposedly glowed because it was made by the elves of Gondolin
rather than any particular attribute built into it, and Orcrist was
made there too. I think it also glowed in the Hobbit; that was how
Bilbo recognized what the situation was when he first saw Sting glow.
Maybe it was the other sword rather than Orcrist, but they were treated
as being functionally equivalent.)
Also make Grimtooth glow red when elves are present. That's from thin
air, to give it some novelty. Unlike Sting, whose double-damage bonus
is restricted to orc targets, Grimtooth's weak 1d6 bonus still applies
to all targets.
PatR [Fri, 29 May 2015 22:46:13 +0000 (15:46 -0700)]
'Du' bug with non-empty containers
ckunpaid() had the same coding error as allow_category(). A hero-owned
container holding hero-owned contents followed in invent an any unpaid
object was mis-classified unpaid.