PatR [Mon, 13 Jan 2020 20:34:01 +0000 (12:34 -0800)]
fix #K166 - role selection filtering
pick_role() had a 5 year old copy+paste error where a pair of lines
were cloned multiple times but one of the resulting lines didn't get
the intended revision, preventing OPTIONS=align:!chaotic or !neutral
or !lawful from working as intended when letting the game choose role
randomly. The bad line should have been calling ok_align() but that
routine turned out to have a bug too.
Fixing those lead to other less obvious problems with role selection,
particularly the tty menu version for picking manually. Roles and/or
races which should have been excluded by partial specification weren't
always kept out. Also, if any filtering was specified, trying to
disable all filters (via choosing 'reset filtering' and de-selecting
everything in the menu) was a no-op. Once any filtering was in place
you had to leave at least one role or race or gender or alignment
flagged as not acceptable in order to change any of the filtering.
When that was fixed and it was possible to turn off all filtering,
there was no way to turn it back on because the menu choice to reset
the filters wasn't offered unless there was some filtering in place
(that was intentional but turned out not to be a good idea).
I checked curses and X11; they both offer less versatile selection
capability that don't seem to need the tty-specific fixes.
PatR [Mon, 13 Jan 2020 06:16:49 +0000 (22:16 -0800)]
rnd_class()
Guard against potential bad arguments: first index greaer than last.
Return STRANGE_OBJECT instead of hardcoded 0 if it ever fails (which
should be impossible with good arguments).
PatR [Sun, 12 Jan 2020 19:00:38 +0000 (11:00 -0800)]
randonly occurring Discworld novels
Give 'novel' a 1 in 1000 chance of being created in place of each
random spellbook (except for hero's initial inventory and NPC
priests' monster inventory and divine reward for prayer--those all
force regular spellbooks; statue contents aren't among the
exceptions--those books can now be novels). Shop inventory (where
first book or scroll shop created is guaranteed one novel) hasn't
been touched. If there is any other special spellbook handling
somewhere, I've overlooked it.
PatR [Sun, 12 Jan 2020 13:05:24 +0000 (05:05 -0800)]
fix github issue #279 - boulder feedback
Polymophed into a giant and moving onto a boulder's location could
yield "you easily pick it up" (without actually doing so) followed
by "you see a boulder here". It would happen if autopickup was Off,
or if the 'm' move-without-autopickup prefix was used, while either
boulder was included in pickup_types (including when that is set
for 'all') or hero had thrown that particular boulder and
pickup_thrown was On. The check for whether auto-pick should try
on an object relied on its caller verifying that autopickup was On.
pickup() does that for
pickup() -> autopick() -> autopick_testobj()
but moverock() wasn't doing that for
moverock() -> autopick_testobj()
so the logic controlling moverock's message was subverted.
I first thought that logic itself was incorrect and changed the
message. This keeps the new message even though it turned out not
to be cause of the problem.
PatR [Sat, 11 Jan 2020 17:34:01 +0000 (09:34 -0800)]
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".
PatR [Sat, 11 Jan 2020 16:45:45 +0000 (08:45 -0800)]
data.base lookup fix
Changing data.base lookup to accept leading spaces as an alternative
to the normal leading tab ended up adding an invalid integrity check.
Lines without any leading space or tab were considered to be in error
but empty lines are present so need to be accepted.
PatR [Fri, 10 Jan 2020 21:13:36 +0000 (13:13 -0800)]
fix github issue #277 - repeat door open failure
The change to make "ouch! you bump into a door" use up a turn didn't
end running, so when it happened while running useless turns took
place and that message was delivered repeatedly until some other
action interrupted the hero. It didn't matter whether autoopen is
enabled.
PatR [Fri, 10 Jan 2020 14:53:48 +0000 (06:53 -0800)]
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.
PatR [Fri, 10 Jan 2020 12:36:28 +0000 (04:36 -0800)]
escaping buried iron ball
Noticed while testing the look-at-self feedback for traps. When
punished and the iron ball gets buried, hero becomes "tethered to a
buried object". It is possible to simply walk away (like from a pit,
bear trap, web, stuck in floor by solidified lava or sinking into
molten lava) but that requires many tries. Once the escape happens,
"you finally wrench the ball free" and are supposed to have it
reattached to a replacement chain. However, buried_ball() wouldn't
look at buried objects if the trap countdown timer was 0 (which is
the case when finally wrenching free). So hero got a new chain to
drag around but it had no heavy iron ball attached.
I didn't turn on sanity checking but that would have complained about
this. Normal dragging didn't care but I wouldn't be surprised if
various actions that checked Punished and picked up the ball in order
to put it down again elsewhere would have had possibly serious trouble.
PatR [Fri, 10 Jan 2020 02:45:06 +0000 (18:45 -0800)]
randomized trap names
Use trapname() in several more places. I wasn't systematic about it.
trapname() could generate a random value of 0 and attempt to use
"real trap #0" but 0 is NO_TRAP. So it ended up with "water" from
the preceding block of entries in defsyms[]. Treat 0 as an extra
chance for the actual trap instead of an hallucinatory one.
Add a couple more hallucinatory traps. "Roach Motel" is trademarked
but like Spam and Band-Aid, general usage has trampled over it. I
included "(tm)" anyway. Also, sometimes generate "<role> trap" or
"<rank> trap" on the fly. Why should tourists get all the fun?
PatR [Fri, 10 Jan 2020 00:59:30 +0000 (16:59 -0800)]
enhanced look-at-self
^X reports whether you're caught in a trap, but neither looking at
yourself (via '//' or ';' or other getpos autodescribe) nor looking
"here" (via ':') said anything about that. Make looking at yourself
do so.
PatR [Thu, 9 Jan 2020 01:21:47 +0000 (17:21 -0800)]
more wishing for Amulet of Yendor
Make wish for "amulet of yendor" be the same as "real amulet of yendor"
instead of preserving the 3.6.x behavior of having a 50% chance of it
yielding "fake amulet of yendor".
Both the "real" and "fake" prefixes are still accepted, but "real" has
become a no-op:
!real and fake, real and fake => fake
real and !fake, !real and !fake => real
so fake vs !fake always decides the result.
PatR [Wed, 8 Jan 2020 01:57:38 +0000 (17:57 -0800)]
fix #K112 - fumbling vs autoopen
Report complained that having autoopen not work when fumbling was
inconvenient and mentioned that the "ouch! you bump into a door"
result didn't take any time. This updates the documentation to
state that autoopen won't work while fumbling (so the inconvenient
behavior persists) but changes movement so that bumping into a door
now takes time. (Despite "ouch!", it doesn't inflict any damage.)
Also, document the recently added autounlock option.
PatR [Tue, 7 Jan 2020 12:40:20 +0000 (04:40 -0800)]
tethered aklys description
Recent object formatting changes for wielded weapon put some pline
arguments in the wrong order.
a - aklys (weapontethered in hand)
or worse, when dual-wielding
a - aklys (wieldedtethered in right hand)
Change back to
a - aklys (tethered weapon in hand)
or
a - aklys (tethered weapon in right hand)
I considered (tethered weapon wielded in right hand) for the two-
weapon case, but I think that's too verbose.
PatR [Tue, 7 Jan 2020 10:59:25 +0000 (02:59 -0800)]
fix #K119 - wishing for Amulet of Yendor
Wizard mode wishing for "Amulet of Yendor" has a 50% chance of
yielding a cheap plastic imitation. Allow asking for "real Amulet
of Yendor" and "fake Amulet of Yendor" to provide precise control.
Asking for "real Amulet of Yendor" in normal play will be accepted
but then overridden with the fake amulet as usual.
Without the prefix, there's still a 50:50 chance for either amulet.
"real fake amulet of yendor" and "fake real amulet of yendor" both
yield a fake one.
When handling "amulet of yendor", any of "cheap", "plastic",
"imitation", "cheap plastic", "cheap imitation", and "plastic
imitation" are now recognized to mean "cheap plastic imitation".
Unlike prefixes such as "blessed rustproof" vs "rustproof blessed",
these two-word ones (or the three-word whole thing) need to be in
specific order and after the general prefixes. Also, any of those
force "fake" even if an explicit "real" prefix came before them.
Pasi Kallinen [Mon, 6 Jan 2020 09:48:16 +0000 (11:48 +0200)]
Fixes for degenerate RNG
Assume a degenerate RNG that always returns the same number.
With these fixes, the game starts and is almost playable.
There are still some places that will go into infinite loop, eg.
the mines level generation.
PatR [Mon, 6 Jan 2020 07:54:11 +0000 (23:54 -0800)]
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).
Remove Sokoban luck penalties for things you can't cheat with
Jumping, Newton's 3rd Law hurtling, and throwing an iron ball:
attempting to do any of these in such a way that you would diagonally
pass between boulders/walls causes the Luck penalty. However, none of
these actually get you through the diagonal gap, thus they can't be used
to cheat and the penalty doesn't make sense.
PatR [Sun, 5 Jan 2020 21:13:21 +0000 (13:13 -0800)]
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.
PatR [Sun, 5 Jan 2020 19:30:38 +0000 (11:30 -0800)]
more earthquake
When a drum of earthquake targets a secret door, reveal it (which
is always followed by collapsing the door), and when it targets a
secret corridor, reveal that corridor. Both situations also place
a pit at the location.
PatR [Sun, 5 Jan 2020 09:20:15 +0000 (01:20 -0800)]
fix #K105 - earthquake chasms
Drum of earthquake can try to destroy fountains, thrones, altars,
sinks, and graves but it wouldn't do so because maketrap() had been
changed to prevent clobbering furniture with traps. So you might get
"the throne falls into a chasm" but the throne would remain intact.
Change furniture to be floor before trying to create a pit. The gist
of the patch is the 'if' after 'do_pit:' and also some changes to the
revealing of hidden monsters. The rest is reformatting.
PatR [Sun, 5 Jan 2020 02:22:04 +0000 (18:22 -0800)]
twoweapon tweaks
Don't allow dual-wielding if either wielded or alternate weapon
(or both) is a launcher: bow, crossbow, or sling. (I thought that
this had been addressed ages ago.)
Refine the "can't twoweapon" feedback. The message for having
either or both hands empty is the same, but sentence construction
is different. The not-a-weapon feedback is slightly different, now
mentioning whether it's the wielded or alternate weapon which isn't
allowed. The case where neither are acceptable still just reports
uwep; mentioning both it and uswapwep would be too verbose.
Make more things be described as "(wielded)" instead of "(weapon in
hand)". It was just stacks with quantity more than 1. That's now
joined by ammo and missiles (any stack size, but in reality just 1
since greater was already being caught here) and any quantity of
non-weapon, non-weptool. It's overridden if dual-wielding so that
right/left stay matched.
When dual-wielding, list primary as "(wielded in right hand)" and
secondary as "(wielded in left hand)" instead of "(weapon in hand)"
and "(wielded in other hand)". The vaguer wording was better for
bows since they're held in the off hand but now that they can't be
dual-wielded that doesn't matter. (Single-wielding a bow is still
"(weapon in hand)".)
When not dual-wielding, the item in the alternate weapon slot is
still described as "(alternate weapon; not wielded)" even if it's
not actually a weapon. I couldn't think of better phrasing.
copperwater [Tue, 12 Jun 2018 15:33:36 +0000 (11:33 -0400)]
Always print a message when the hero level teleports
For much the same reason as the horizontal teleport message: various
forms of level teleportation produce no message indication at all that
you just ended up somewhere else.
copperwater [Tue, 29 May 2018 02:12:47 +0000 (22:12 -0400)]
Always print a message when the hero teleports
It's useful to get a message as indication you suddenly moved somewhere.
For instance, MSGTYPE=stop can be used on this to avoid bumbling in the
wrong direction after a spontaneous uncontrolled teleport.
copperwater [Fri, 1 Feb 2019 17:21:42 +0000 (12:21 -0500)]
Teach non-mindless monsters about the Castle trapdoors
This feature is originally from SliceHack, but the original code
directly edited the monmove code, whereas I thought it was cleaner to
use the existing mtrapseen code. Thus, this commit just marks trapdoors
as "seen" for all non-mindless monsters generated in the Castle level
(the same way all monsters in Sokoban are marked aware of pits and
holes).
This change prevents these Castle monsters from moving onto trapdoors
97.5% of the time. (A determined player can still patiently sit and wait
for everyone in the castle to plunge like lemmings into the trapdoors,
but it will now take 40 times as long.) Also unlike SliceHack, this only
excludes mindless monsters - not all non-humanoids. There are plenty of
intelligent non-humanoid monsters generated right next to the trapdoors,
after all.
This is aimed at better flavor (the inhabitants of the castle should
know about the traps in their own area) and better scenery in the Valley
(doesn't seem as much of a valley of the dead if there are hordes of
soldiers milling around down there).
I considered sticking an in_mklev condition onto this if statement, so
that monsters spawned into the Castle after its creation will fall down
the trapdoors, but ultimately decided against it.
copperwater [Thu, 19 Dec 2019 03:25:12 +0000 (22:25 -0500)]
Better reporting directions for impossible()
Rather than just informing the player that saving and reloading might
fix the problem, they are now encouraged to report the problem to the
value of DEVTEAM_EMAIL. If the sysconf specifies SUPPORT, that is also
presented as an option.
copperwater [Tue, 5 Feb 2019 03:45:45 +0000 (22:45 -0500)]
Add a default message for chatting to gnomes
Message is a reference to The Silver Chair. Most of the other races had
their own messages already, but gnomes would just default to discussing
dungeon exploration, which doesn't make that much sense most of the
times when you would be chatting to them in their own mines.
The quotation is edited from the source to reflect the dungeon
environment, but the sentiment is actually pretty spot-on given the
average player's win ratio.
Note: this doesn't interfere with the South Park gnome speech added to
3.6 a while ago; that only occurs when hallucinating and this only
occurs when not hallucinating.
copperwater [Fri, 25 Jan 2019 14:27:55 +0000 (09:27 -0500)]
Call potion bottles by nonsensical names if hallucinating
From SliceHack. Note that this refers to the description of the physical
bottle; it's a substitute for "phial", "carafe", "flask", etc. such as
are seen when a potion crashes on someone's head. They don't obscure the
randomized appearance or actual potion identity.
The SliceHack version evidently went through several revisions; just
take the current one.
copperwater [Sat, 22 Dec 2018 14:38:40 +0000 (09:38 -0500)]
Neutral sacrifices disappear in a cloud of smoke
The general idea here came from SpliceHack -- give each alignment a
unique effect in what happens to its sacrifices -- but the "puff of
smoke" in Splice seemed too small.
copperwater [Sat, 8 Dec 2018 18:51:23 +0000 (13:51 -0500)]
Give player message informing them they can use #enhance
Triggers when you feel more confident in your skills. This is to address
a problem I have heard about several times from newer players: unless
you pay close attention to the guidebook, nothing in the game actually
indicates that you can level up your abilities and how to do it.
Experienced players don't need this message, of course; they can hide it
via MSGTYPE if they really hate it, but I additionally added a clause
that prevents this message from being displayed more than once per game
session. (It didn't seem important enough to make a save field for.)
Suppress "Unknown command" messages in the dumplog.
Backported from TNNT. Only affects dumplog pline history, not any other
form of pline history.
The impetus for this is to avoid dumplogs full of "Unknown command foo."
messages which don't provide any value for people reading the file. In
many cases, these messages crowd out the actual message history, making
it hard to reconstruct what happened.
It's confusing and served no purpose; a spoiled player knew what it is,
an unspoiled player might think it was a hook-hand or something. Now
they all show up as grappling hook.
Replace awful "You feel cold" message for freezing a door you can't see
That message implied something to do with an effect happening to the
hero that causes them to feel cold, such as taking cold damage.
Change it to "You hear a deep cracking sound" instead.
Pasi Kallinen [Wed, 1 Jan 2020 11:25:55 +0000 (13:25 +0200)]
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.
Patric Mueller [Tue, 31 Dec 2019 13:10:24 +0000 (14:10 +0100)]
Replace "money" in in-game texts with "gold"
When GOLDOBJ was activated unconditionally, several texts started referencing
"money" instead of "gold".
As we don't have the intention to introduce a complex coin system with
different denominations, change it back and also some other places that
reference "money".
nhmall [Tue, 31 Dec 2019 15:02:54 +0000 (10:02 -0500)]
twoweapon message adjustment
There was a concern that some things resulted in "is not a weapon"
when trying to twoweapon, then were subsequently refered to in
menus as "weapon in hand."
Remove any perceived inconsistency by simply adjusting the first
message.
PatR [Tue, 31 Dec 2019 02:37:42 +0000 (18:37 -0800)]
miscellaneous reformatting
Some new code was using 3.4.3 era formatting (operators at end of
first half of a continued line rather than at start of second half).
Also a few cases of 'g.' prefix making lines be too wide. I imagine
there will be a lot more of these over time.
PatR [Mon, 30 Dec 2019 02:55:44 +0000 (18:55 -0800)]
fix github issue #273 - named orc mummy
The test for whether a migrating object generated as plundered
mine-town loot should be delivered to any orc created and then giving
that orc a bandit name was kicking in for orc mummies and orc zombies
as well as for regular orcs.
Also, the loot could include tins or eggs and their species would
get clobbered by the overloading of obj->corpsenm. During delivery
when the overloading was reset they would become giant ant eggs/tins.
(Not seen in actual play.)
Pasi Kallinen [Thu, 26 Dec 2019 16:43:39 +0000 (18:43 +0200)]
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.
PatR [Tue, 24 Dec 2019 12:31:41 +0000 (04:31 -0800)]
fix github issue #272 - meat rings, +0 protection
Meat rings were causing increased hunger even though they don't do
anything. Not mentioned in the report, but cheap plastic imitation
amulets increased hunger too and they don't do anything either.
Trickier to fix, +0 rings of protection were excluded from hunger
on the grounds that +0 rings don't do anything, but since 3.6.0
+0 protection provides +1 to magic cancellation if protection isn't
coming from anywhere else. Two +0 rings of protection are trickier
still since only one of them provides the MC bonus.
PatR [Tue, 24 Dec 2019 11:26:34 +0000 (03:26 -0800)]
'w-' object lost panic
After the "make 'w' parallel with 'Q'" patch, wielding bare hands
was erroneously treating object id 0 as a split of zeroobj. That
isn't in inventory so seems 'lost'. Fixed by testing for nonzero.
There was another bug: you could wield a partial stack even if your
current weapon was cursed. Fixed by reordering if/else-if/end-if.
PatR [Tue, 24 Dec 2019 10:41:19 +0000 (02:41 -0800)]
fix github issue #268 - worm tooth & crysknife
Change the composition of worm tooth from none-of-the-above to bone
and crysknife from mineral to bone, same as is used for unicorn horn.
I think the only significant difference will be that worm teeth used
up during polypiling will produce skeletons rather than flesh golems.
nhmall [Mon, 23 Dec 2019 15:44:07 +0000 (10:44 -0500)]
add a requested interface adjustment for menu invert operations
Originally requested by one of the hardfought admins
Adjust all active window ports (tty, curses, win32, Qt, X11) to store
the itemflags that they receive with each item.
Also, make those active window ports understand the new
MENU_ITEMFLAGS_SKIPINVERT flag by skipping any menu items with that
setting during invert_all and invert_page operations.
Build testing and rudimentary functionality testing was carried out
on each of the window ports listed above.
The code was also modified on some non-active window ports (Qt3, gem,
gnome) but it was not tested for build or function there.
The desired functionality expressed was to be able to select a
single object category, and use the @ "invert all" function to
exclude that one and select all the others.
The "invert all" function's behavior of also including things
like "select all" and BUCX menu items made the feature unuseful
for that purpose.