From: <gi...@cr...> - 2025-07-18 02:20:11
|
via 81d314105f3ee489e9f10e194fe7515a12a0a353 (commit) via 89b82f3d1cf2e7c20c8dede848451ed986cd6b9b (commit) via 2adacdb53afa3d81e2363cc06fb42c3a3ca4f10b (commit) via b98de362c2a782b4f60ec34973d87c0d214565f3 (commit) from 1b205f4a7ac4a2671d3f2f83a1e1297cdf912134 (commit) ----------------------------------------------------------------------- commit 81d314105f3ee489e9f10e194fe7515a12a0a353 Author: DracoOmega <dra...@gm...> Date: Thu Jul 17 23:44:19 2025 -0230 Display the (P)ut on action when examining a talisman (Planckenstein) commit 89b82f3d1cf2e7c20c8dede848451ed986cd6b9b Author: DracoOmega <dra...@gm...> Date: Thu Jul 17 23:43:49 2025 -0230 Fix a crash with displaying floor items in some item menus (Kush) One of the sort comparators only worked properly for items in the player's inventory, and if there were enough valid items on the ground (which had never been in the player's inventory before) to need sorting, the game would crash tying to populate the menu. commit 2adacdb53afa3d81e2363cc06fb42c3a3ca4f10b Author: David Lawrence Ramsey <poo...@gm...> Date: Thu Jul 17 21:11:29 2025 -0500 Stop adding "pair of" to gloves in Xom msgs. Since gloves' names all start with +0 and the like now, which produces incorrect messaging. commit b98de362c2a782b4f60ec34973d87c0d214565f3 Author: David Lawrence Ramsey <poo...@gm...> Date: Thu Jul 17 21:10:00 2025 -0500 Choose more random slot items for Xom msgs. For cloaks, helmets, gloves, and boots, since multiple sets of them can be worn now. ----------------------------------------------------------------------- Summary of changes: crawl-ref/source/describe.cc | 1 + crawl-ref/source/invent.cc | 2 +- crawl-ref/source/xom.cc | 18 +++++------------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 88fffed13a..1c0784550c 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -3816,6 +3816,7 @@ static vector<command_type> _allowed_actions(const item_def& item) actions.push_back(CMD_WEAR_ARMOUR); break; case OBJ_JEWELLERY: + case OBJ_TALISMANS: if (item_is_equipped(item)) actions.push_back(CMD_REMOVE_JEWELLERY); else diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 0a3cdd872c..078c9b587e 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -783,7 +783,7 @@ int sort_item_qty(const InvEntry *a) } int sort_item_slot(const InvEntry *a) { - return letter_to_index(a->item->slot); + return a->item->slot > 0 ? letter_to_index(a->item->slot) : 0; } bool sort_item_identified(const InvEntry *a) diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 9ff62c6861..1cfe969691 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -3362,7 +3362,7 @@ static void _xom_pseudo_miscast(int /*sever*/) messages.push_back(str); } - if (item_def* item = you.equipment.get_first_slot_item(SLOT_CLOAK)) + if (item_def* item = _xom_get_random_worn_slot_item(SLOT_CLOAK)) { string name = "your " + item->name(DESC_BASENAME, false, false, false); string str = _get_xom_speech("cloak slot"); @@ -3381,7 +3381,7 @@ static void _xom_pseudo_miscast(int /*sever*/) messages.push_back(str); } - if (item_def* item = you.equipment.get_first_slot_item(SLOT_HELMET)) + if (item_def* item = _xom_get_random_worn_slot_item(SLOT_HELMET)) { string name = "your " + item->name(DESC_BASENAME, false, false, false); string str = _get_xom_speech("helmet slot"); @@ -3400,17 +3400,9 @@ static void _xom_pseudo_miscast(int /*sever*/) messages.push_back(str); } - if (item_def* item = you.equipment.get_first_slot_item(SLOT_GLOVES)) + if (item_def* item = _xom_get_random_worn_slot_item(SLOT_GLOVES)) { - string gloves_name = item->name(DESC_BASENAME, false, false, false); - // XXX: If the gloves' name doesn't start with "pair of", make it do so, - // so that it always comes out as singular for grammar purposes. This - // happens with the Mad Mage's Maulers and Delatra's gloves; see - // item_def::name_aux(). - if (gloves_name.find("pair of ") != 0) - gloves_name = "pair of " + gloves_name; - - string name = "your " + gloves_name; + string name = "your " + item->name(DESC_BASENAME, false, false, false); string str = _get_xom_speech("gloves slot"); str = replace_all(str, "@your_item@", name); @@ -3419,7 +3411,7 @@ static void _xom_pseudo_miscast(int /*sever*/) messages.push_back(str); } - if (item_def* item = you.equipment.get_first_slot_item(SLOT_LOWER_BODY)) + if (item_def* item = _xom_get_random_worn_slot_item(SLOT_LOWER_BODY)) { string name = "your " + item->name(DESC_BASENAME, false, false, false); string str = _get_xom_speech("boots slot"); -- Dungeon Crawl Stone Soup |