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.
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.
I did my best to exempt some of the bigger aligned blocks from the reformatting
using the /* clang-format off */ and /* clang-format on */ tags. Probably some
that shouldn't have been formatted were anyway; if you encounter them, please
fix.
The clang-format tags were left in on the basis that it's much easier to prune
those out later than to put them back in, and it means that, modulo my custom
version of clang-format, I should be able to run clang-format on the source tree
again without changing anything, now that Pat has fixed the VA_DECL issues.
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.
Make wielding Werebane confer defense against catching lychanthropy
from monster bites. It doesn't protect against catching that from eating
lycanthrope corpses and might blast the character if wielded at such time.
Also fix artifact handling to recognize the character as lycanthrope
while in normal human/elf/whatever form--rather than only when in beast
form--just like it does for monsters.