Have quest leader ID thrown unknown fake Amulet

If the hero throws an unidentified fake Amulet of Yendor at the quest
leader, the leader will identify it and toss it back, similar to the
behavior for the real Amulet.

This was one of Pat's suggestions for continuing in the same key as
bda0b3b; I think this makes a lot of sense, especially now that people
may be encouraged to throw things called "Amulet of Yendor" at the quest
leader.  Arguable about whether a _known_ fake Amulet should still anger
the leader and quest helpers; as I have it in this commit, it will, but
I'm somewhat ambivalent about what makes more sense.
This commit is contained in:
Michael Meyer
2023-09-21 00:05:55 -04:00
committed by PatR
parent 2b47ef9670
commit dedf1ade18
2 changed files with 12 additions and 9 deletions

View File

@@ -1921,7 +1921,8 @@ tmiss(struct obj *obj, struct monst *mon, boolean maybe_wakeup)
}
#define special_obj_hits_leader(obj, mon) \
((is_quest_artifact(obj) || objects[obj->otyp].oc_unique) \
((is_quest_artifact(obj) || objects[obj->otyp].oc_unique \
|| (obj->otyp == FAKE_AMULET_OF_YENDOR && !obj->known)) \
&& mon->m_id == gq.quest_status.leader_m_id)
/*

View File

@@ -223,8 +223,8 @@ expulsion(boolean seal)
if hero throws or kicks an invocation item (probably the Bell)
at the leader. */
void
finish_quest(struct obj *obj) /* quest artifact or thrown unique item;
* possibly null if carrying the Amulet */
finish_quest(struct obj *obj) /* quest artifact or thrown unique item or faux
* AoY; possibly null if carrying the Amulet */
{
struct obj *otmp;
@@ -233,12 +233,10 @@ finish_quest(struct obj *obj) /* quest artifact or thrown unique item;
* if the invocation has already been performed, leader keeps any
* thrown (or kicked) invocation item, perhaps stating the intent
* to guard it for the future;
* if the item is an unidentified fake Amulet, identify it instead
* of treating the throw as an attack.
*/
if (obj && objects[obj->otyp].oc_unique) {
/* tossed one of the invocation items (or AoY) at the quest leader */
if (obj && !is_quest_artifact(obj)) {
/* tossed an invocation item (or [fake] AoY) at the quest leader */
if (Deaf)
return; /* optional (unlike quest completion) so skip if deaf */
/* do ID first so that the message identifying the item will refer to
@@ -246,10 +244,14 @@ finish_quest(struct obj *obj) /* quest artifact or thrown unique item;
fully_identify_obj(obj);
/* update_inventory() is not necessary or helpful here because item
was thrown, so isn't currently in inventory anyway */
if (obj->otyp == AMULET_OF_YENDOR)
if (obj->otyp == AMULET_OF_YENDOR) {
qt_pager("hasamulet");
else
} else if (obj->otyp == FAKE_AMULET_OF_YENDOR) {
verbalize(
"Sorry to say, this is a mere imitation of the true Amulet of Yendor.");
} else {
verbalize("Ah, I see you've found %s.", the(xname(obj)));
}
return;
}