From dedf1ade18094ad7007f378013feadf5578bc3f3 Mon Sep 17 00:00:00 2001 From: Michael Meyer Date: Thu, 21 Sep 2023 00:05:55 -0400 Subject: [PATCH 1/2] 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. --- src/dothrow.c | 3 ++- src/quest.c | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/dothrow.c b/src/dothrow.c index 2df4be975..cb568a779 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -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) /* diff --git a/src/quest.c b/src/quest.c index 8a55b1826..2da242924 100644 --- a/src/quest.c +++ b/src/quest.c @@ -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; } From 602af21ca32c04e9e230c9389972e413a993f0c1 Mon Sep 17 00:00:00 2001 From: Michael Meyer Date: Thu, 21 Sep 2023 00:40:31 -0400 Subject: [PATCH 2/2] Have leader keep already-used invocation items The other suggestion from Pat about potential extensions to bda0b3b. I think it's interesting from a story perspective, and hopefully nobody will run into this by mistake when they hoped to use the Candelabra as a light source later! The specific language used by the leader could be changed if someone has a better idea (as could the code itself, for that matter). --- src/dothrow.c | 30 ++++++++++++++++++++++++------ src/quest.c | 7 ------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/dothrow.c b/src/dothrow.c index cb568a779..a996d672f 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -2033,7 +2033,30 @@ thitmonst( if (mon->mcanmove) { pline("%s catches %s.", Some_Monnam(mon), the(xname(obj))); - if (mon->mpeaceful) { + /* leader will keep tossed invocation item after you've done the + invocation and it's become unnecessary for completion.. */ + if ((u.uevent.invoked && objects[obj->otyp].oc_unique + && obj->otyp != AMULET_OF_YENDOR) + /* ...or any special item, if you've made him angry */ + || !mon->mpeaceful) { + /* give an explanation for keeping the item only if leader is + not doing it out of anger */ + if (mon->mpeaceful && !Deaf) { + /* just in case, identify the object so its name will + appear in the message */ + fully_identify_obj(obj); + verbalize("%s part in this is finished.", + s_suffix(The(xname(obj)))); + verbalize( + "We will guard it in case it is ever needed again, %s forbid.", + align_gname(u.ualignbase[A_ORIGINAL])); + } + if (*u.ushops || obj->unpaid) /* not very likely... */ + check_shop_obj(obj, mon->mx, mon->my, FALSE); + (void) mpickobj(mon, obj); + } else { + /* under normal circumstances, leader will say something and + then return the item to the hero */ boolean next2u = monnear(mon, u.ux, u.uy); finish_quest(obj); /* acknowledge quest completion */ @@ -2043,11 +2066,6 @@ thitmonst( sho_obj_return_to_u(obj); obj = addinv(obj); /* back into your inventory */ (void) encumber_msg(); - } else { - /* angry leader caught it and isn't returning it */ - if (*u.ushops || obj->unpaid) /* not very likely... */ - check_shop_obj(obj, mon->mx, mon->my, FALSE); - (void) mpickobj(mon, obj); } return 1; /* caller doesn't need to place it */ } diff --git a/src/quest.c b/src/quest.c index 2da242924..9e12604c0 100644 --- a/src/quest.c +++ b/src/quest.c @@ -228,13 +228,6 @@ finish_quest(struct obj *obj) /* quest artifact or thrown unique item or faux { struct obj *otmp; - /* - * Possible extensions [would mostly need to be done in thitmonst()]: - * 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 (obj && !is_quest_artifact(obj)) { /* tossed an invocation item (or [fake] AoY) at the quest leader */ if (Deaf)