I went through the places that set context.botl/botlx in src/a*.c to
see whether I could find any unnecessary status updates. I didn't
find anything interesting, mostly some minor sequencing issues plus
a couple of redundant sets (call foo() which includes setting botl,
then explicitly set botl after it returns). If you issue pline first
and then set context.botl, bottom lines won't be updated until the
next message or next pass through moveloop. If you order those the
other way around, status will be updated as the message describing
the reason for the update is being delivered.
Dropping an existing fragile item while levitating will usually
break it. Getting a new wished-for fragile item and dropping it
because of fumbling or overfull inventory never would.
Some callers of hold_another_object() held on to its return value,
others discarded that. That return value was unsafe if the item
was dropped and fell down a hole (or broke [after this change]).
Return Null if we can't be sure of the value, and make sure all
callers are prepared to deal with Null.
Replace recent "(light blue aura)" with
"(flickering light blue)" if there are 1..4 orcs,
"(glimmering light blue)" if 5..12, or
"(gleaming light blue)" if there are 13 or more, and move its place
in the formatted name.
_3.6.1_: Sting (weapon in hand) (glowing light blue)
_recent: Sting (weapon in hand) (light blue aura)
_now___: Sting (weapon in hand, flickering light blue)
The thresholds for intensity may need to be tweaked. The start
message has been changed from "glows" to "flickers/glimmers/gleams"
and is given when the intensity changes (up or down) as well as when
first glowing. Stop message will usually be "stops flickering" but
some form of mass kill (genocide for sure, maybe explosion, probably
not wand zap) might result in stopping directly from higher intensity.
It still "quivers" if hero is blind when there are orcs on the level,
but no name augmentation shows in inventory for that situation;
describing it as "(weapon in hand, quivering)" would be too silly.
Also, the quiver or glow intermediate message if blindness is toggled
while Sting is active only worked for make_blinded(), not for putting
on and taking off a blindfold. Now fixed. I think becoming blind due
to polymorphing into an eyeless form is still not handled, but there
are no eyeless creatures capable of wielding weapons so that can wait.
Polymorphing from eyeless to sighted is handled but moot for Sting.
Latent bug: if a non-role-specific artifact which could be invoked
for charging existed, it would never work as if blessed because the
test for no-role was wrong. Caused when 3.3.0 changed the Role_if()
predicate and artilist[] array to use monster index numbers (PM_foo)
instead of role letters; the non-role value changed from '\0' to
NON_PM (-1) but the test for non-role didn't.
No fixes36.1 entry; there aren't any artifacts which were affected.
Make #untrap while carrying the non-cursed (for rogues) or blessed
(for non-rogues) Key work the same as #invoke has been doing (without
regard to its bless/curse state): when used on trapped door or chest,
that trap will always be found and disarming it will always succeed.
It should work when carried by monsters too: if they try to open a
trapped door while carrying the Key (must be blessed since they're
not rogues) the trap will be automatically disarmed. (Caveat: that
hasn't been adequately tested.)
TODO (maybe...): change the #invoke property to detect unseen/secret
door detection instead of #untrap. The latter isn't completely
redundant; it works when the Key is cursed. But quest artifacts
strongly resist becoming cursed so that isn't a particularly useful
distinction.
Also, trap hints when wielding the Key without gloves didn't notice
adjacent door and chest traps. Now it does. And the behavior is
slightly different: known traps covered by objects or monsters are
treated like unknown traps as far as the hot/cold hints go.
If the key is wielded and touching skin (that is, you're not
wearing gloves), it will give heat-related messages like
minesweeper, counting the undetected traps around player.
by Excalibur. Noticed on Reddit by Alex, the attempt to fix being
blasted twice by wielded artifact weapon when changing alignment
ended up preventing wielding other role's quest weapons. At the
moment I can't even see how it prevented the double-blast....
This backs out that change and fixes the double-blasting correctly.
When uwep and uswapwep are tested in advance of the rest of invent,
mark them as already processed before entering the loop that checks
all not-yet-processed inventory.
...when alignment was toggled by helm of opposite alignment. The
touch/retouch code is quite convoluted, but I think this simple
change is the right fix.
Enlightenment and end of game disclosure didn't report level-drain
resistance if that was obtained via wielding Excalibur (or Stormbringer
or Staff of Aesculapius). Drain_resistance wasn't one of the attributes
set for intrinsics/extrinsics when wielding or unwielding weapon or
wearing/unwearing other equipment. loseexp() checks resists_drli()
which does check for items in use, so level drain would be aborted,
possibly after messages claimed that it was taming place. I didn't try
to untangle any of that, just changed set_artifact_intrinsic to include
a test for DRAIN_RES.
Reformat some trailing &&, || operators followed by end-of-line comment,
missed by the earlier continuation formating.
An
#if 0
something {
#else
something_else {
#endif
construct in rhack(cmd.c) confused the automated reformatter, resulting
in some code from inside a function ending up in column 1.
Mostly && and || at end of the first half of a continued line rather
than at the start of the second half. The automated reformat got
confused by comments in the midst of such lines.
foo ||
bar
was converted to
foo
|| bar
but
foo ||
/* comment */
bar
stayed as is.
Some excluded code [#if 0] was also manually reformatted, but this is
mainly stuff that can be found via regexp '[&|?:][ \t]*$' (with a lot
of false hits for labels whose colon ends their line).
Require the hero to pass the next_to_u() check when using the Eye of the
Aethiopica to portal to another dungeon branch. Even though the reported
exploit of having a steed which is carrying the Amulet bring it along had
already been prevented, this changes the temporary portal behavior to be
like level teleport. A steed carrying the Amulet or a non-adjacent pet
on a cursed leash will inhibit the attempted change of location.
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".
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.
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.
Give an alternate message if Sting starts or stops glowing while the
hero can't see. It probably ought to give an immediate message when
blindness toggles but that looks like it could get messy.
Having an 'o' die or migrate off level should probably also redo the
Sting message immediately, otherwise we see things like:
The little dog kills the goblin.
The little dog eats a goblin corpse.
Sting stops glowing.
(There could be lots of additional intervening messages depending on
other monster activity at the time.) Calling see_monsters() in the
relevant places--probably m_detach() and migrate_to_level()--would
address this but won't do because that could result in hallucinating
monsters changing appearance mid-turn.
I'll push a formatting guide at some point. There may still be
outstanding changes, but please feel free to resolve those as you arrive
a them.
To the best of my knowledge, there is no changes to the actual code
content, but the formatter does have the occasional bug. If you run into
an issue, please fix it!
Instead of just "while helpless", the death reason will tell
more explicitly why the player was helpless. For example:
"while frozen by a monster's gaze"
Simplify retouch_equipment (post-3.4.3.code, called when hero
changes alignment or turns into a silver-hating critter; inventory
traversal must cope with the possibility of losing object->nobj when
processing object) by switching to recently added object->bypass code.
After newsgroup discussion of C343-162, I noticed that it had fixed
the verb usage in the message for confused and/or stunned, but not in the
one for resisting. (If a monster name ends in 's', or it has been named
"you", 3.4.3 used the wrong verb because vtense() was fooled about plural
or second person.) No new fixes entry needed....
Simplify many of the intrinsics macros from
#define xxx_resistance (Hxxx || Exxx || resists_xxx(&youmonst))
down to
#define xxx_resistance (Hxxx || Exxx)
by setting or clearing an extra bit in Hxxx during polymorph so that the
resists_xxx() check becomes implicit.
Unfornately there were lots of places in the code that treat Hxxx
as a timeout number--primarily for Stunned, Confused, and Hallucination;
Stunned happens to be one of the revised macros--rather than as a bit
mask, so this patch needed a lot more changes than originally antipated.
Use the grave accent (back tick) character as the keystroke for a
new command which prompts for an object class and then shows a subset of
the discovered objects list covering just the selected class. Similar
to the 'I' variant of 'i' for viewing inventory, and mainly useful once
the '\' discoveries list has grown long.
This is mostly groundwork prior to making the Protection intrinsic
become more meaningful. The Mitre of Holiness (priest quest artifact)
and the Tsurugi of Muramasa (samurai quest artifact) will now confer
Protection when worn/wielded (though at present that effectively does
nothing). While in there, this also changes the Eye of the Aethiopica
(wizard quest artifact), the Eyes of the Overworld (monk quest artifact),
and the Sceptre of Might (caveman quest artifact) so that they need to
be worn/wielded rather than just carried in order for them to confer
magic resistance. That way they're a little less attractive for wishing
by other roles and a little more likely to be actively used by their own
roles (not an issues for the Eyes, I'm sure). This change actually works
to the player's advantage, since it means that monsters who successfully
steal those items won't instantly obtain magic resistance in the process.
This adds protects() as a predicate routine to check an item for
conferring Protection. In order to do that, it renames the existing
protects() routine to defends_when_carried(), because that predicate is
actually a variant of defends() for items which aren't worn or wielded.
From the newsgroup: if no co-aligned artifacts are available when
attempting to give the first divine gift for an offered corpse, nothing
would be given. Since the gift counter stayed at 0, subsequent attempts
to select one would still treat it as first gift and always fail again.
The first divine gift from offering corpses must match the hero's
alignment; after that, nonaligned artifacts (Frost Brand, Giant Slayer, &c)
are added to the pool of choices for further divine gifts. It's pretty
easy for a chaotic character to use up the co-aligned artifacts before
getting any divine gift. There aren't many chaotic ones and some are
inelgible due to being race-specific items. Wishing for Stormbringer--or
loading a bones file which contains it--and creating Sting and Orcrist
via naming will do the trick for an elven hero.
This patch expands the pool of candidates to include nonaligned
artifacts during first gift selection if no co-aligned ones are available.
The one `anything any' that was triggering a warning was shadowing
another `anything any' in the same function; no need to rename it, just
remove the unnecessary declaration. Also, mark the couple of arrays with
initializers that I'd noticed as static instead of letting them default
to auto. The abil_to_spfx()::abil2spfx[] one might need to be redone in
code as a switch if some compilers/linkers have trouble initializing it.
Groundwork for re-doing ^X so that it'll be more integrated with
enlightenment and display bottom line information without abbreviations
or long-line truncation. `mode' doesn't do anything yet so may provoke
lint complaints.
From a four year old news posting: hero was levitating via #invoke
on the Heart of Ahriman, then dropping that artifact yielded:
You drop a gray stone named The Heart of Ahriman.
You float gently to the floor.
A gray stone named The Heart of Ahriman hits the floor.
That might be strictly correct, assuming that both hero and stone fall at
the same speed; if the stone was dropped from perhaps waist height then
the hero's feet would touch first. But it looks strange, like a cartoon
where something hangs in midair until someone notices that it should fall.
Removing the artifact from inventory causes the #invoke property to
toggle off. Unfortunately it has to be done here before the object can
be placed at its destination. Modifying message order seemed unviable;
this fix fiddles with the Levitation property in order to defer hero's
descent until after object handling is finished. Now same setup gives:
You drop a gray stone named The Heart of Ahriman.
A gray stone named The Heart of Ahriman hits the floor.
You float gently to the floor.
You see here a gray stone named The Heart of Ahriman.
From the newsgroup: Sunsword is ineffective against shades. It
gets a special bonus of double damage vs undead, but since it's not made
of silver it was only doing 1 point of damage against shades. Make the
bonus-vs-undead attribute override the silver-required criterion. (No
comparable handling for flimsy weapons against thick-skinned critters
this time.)
Extend rotouch_equipment() to cover all items in use, worn/carried/
invoked in addition to wielded. Done when you change alignment, change
shape, or catch lycanthropy. No-longer-touchable items inflict modest
damage; worn/wielded ones will be unworn/unwielded. For the shape change
and lycanthropy cases, unwieled weapons are also dropped. Other unworn
stuff stays in inventory, as do weapons for the alignment change case.
It ought to force off gloves if worn silver--or hypothetical
artifact--ring has become untouchable and gets unworn. Instead it just
curses the gloves, if necessary, so that there's some plausibility to
having the ring come off.
Make polymorphing or changing alignment perform a touch check (as is
done when catching lycanthropy) on wielded weapon(s) to see whether the
hero can still use them in his new form. Part [2 of 2] will update
retouch_equipment() to check all items in use rather than just weapon(s).
(A comment or two in part 1 already refers to expected behavior of part 2.)