From: <gi...@cr...> - 2025-07-18 01:45:14
|
via 1b205f4a7ac4a2671d3f2f83a1e1297cdf912134 (commit) via d9fd00228f0f64cf0a4b821368443d99fbbbc2d8 (commit) via 6208bf039ecf2a77402194453867ef59a971f6c6 (commit) from 2f817d26c11d8105e9dd7db53aafa23ca71c40e6 (commit) ----------------------------------------------------------------------- commit 1b205f4a7ac4a2671d3f2f83a1e1297cdf912134 Author: David Lawrence Ramsey <poo...@gm...> Date: Thu Jul 17 20:38:42 2025 -0500 Rearrange Xom message item checks. Check the offhand slot right after the weapon slot. commit d9fd00228f0f64cf0a4b821368443d99fbbbc2d8 Author: David Lawrence Ramsey <poo...@gm...> Date: Thu Jul 17 19:45:16 2025 -0500 Genericise a Xom msg random item check. Instead of checking only the ring slot, have it take a slot. commit 6208bf039ecf2a77402194453867ef59a971f6c6 Author: David Lawrence Ramsey <poo...@gm...> Date: Thu Jul 17 20:07:09 2025 -0500 Fix Xom msg refs to poltergeists' having heads. Use "form" instead of "head" for them. Adding an entire head_name() function for only the one species seems like overkill, so do it manually for now. Also, add another amulet message referencing the head. ----------------------------------------------------------------------- Summary of changes: crawl-ref/source/dat/database/godspeak.txt | 6 ++-- crawl-ref/source/xom.cc | 46 +++++++++++++++++++++++------- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/crawl-ref/source/dat/database/godspeak.txt b/crawl-ref/source/dat/database/godspeak.txt index 37b35374f4..ee9c783ef7 100644 --- a/crawl-ref/source/dat/database/godspeak.txt +++ b/crawl-ref/source/dat/database/godspeak.txt @@ -495,13 +495,13 @@ Xom cloak slot @Your_item@ billows in an unfelt wind. -@Your_item@ briefly wraps itself around your head! +@Your_item@ briefly wraps itself around your @head@! @Your_item@ is briefly covered in lurid @any_colour_pattern@! %%%% Xom helmet slot -@Your_item@ leaps into the air, briefly spins, then lands back on your head! +@Your_item@ leaps into the air, briefly spins, then lands back on your @head@! %%%% Xom offhand slot @@ -522,6 +522,8 @@ Xom amulet slot @Your_item@ pulsates! @Your_item@ flares @any_glowing_colour@, then returns to normal. + +@Your_item@ briefly flies off and hovers over your @head@! %%%% Xom gizmo slot diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 91a1c7ddd1..9ff62c6861 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -3107,14 +3107,14 @@ static void _xom_fog(int /*sever*/) god_speaks(GOD_XOM, _get_xom_speech("cloud").c_str()); } -static item_def* _xom_get_random_worn_ring() +static item_def* _xom_get_random_worn_slot_item(equipment_slot item_slot) { - vector<item_def*> worn_rings = you.equipment.get_slot_items(SLOT_RING); + vector<item_def*> worn_slot_item = you.equipment.get_slot_items(item_slot); - if (worn_rings.empty()) + if (worn_slot_item.empty()) return nullptr; - return worn_rings[random2(worn_rings.size())]; + return worn_slot_item[random2(worn_slot_item.size())]; } static void _xom_pseudo_miscast(int /*sever*/) @@ -3351,10 +3351,10 @@ 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 = you.equipment.get_first_slot_item(SLOT_OFFHAND)) { string name = "your " + item->name(DESC_BASENAME, false, false, false); - string str = _get_xom_speech("cloak slot"); + string str = _get_xom_speech("offhand slot"); str = replace_all(str, "@your_item@", name); str = replace_all(str, "@Your_item@", uppercase_first(name)); @@ -3362,25 +3362,41 @@ 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 = you.equipment.get_first_slot_item(SLOT_CLOAK)) { string name = "your " + item->name(DESC_BASENAME, false, false, false); - string str = _get_xom_speech("helmet slot"); + string str = _get_xom_speech("cloak slot"); str = replace_all(str, "@your_item@", name); str = replace_all(str, "@Your_item@", uppercase_first(name)); + /* XXX: The formless mutation doesn't technically mean you don't have a + * form; it means you don't have a head. */ + if (you.has_mutation(MUT_FORMLESS)) + { + str = replace_all(str, "@head@", + you.has_mutation(MUT_FORMLESS) ? "form" : "head"); + } + messages.push_back(str); } - if (item_def* item = you.equipment.get_first_slot_item(SLOT_OFFHAND)) + if (item_def* item = you.equipment.get_first_slot_item(SLOT_HELMET)) { string name = "your " + item->name(DESC_BASENAME, false, false, false); - string str = _get_xom_speech("offhand slot"); + string str = _get_xom_speech("helmet slot"); str = replace_all(str, "@your_item@", name); str = replace_all(str, "@Your_item@", uppercase_first(name)); + /* XXX: The formless mutation doesn't technically mean you don't have a + * form; it means you don't have a head. */ + if (you.has_mutation(MUT_FORMLESS)) + { + str = replace_all(str, "@head@", + you.has_mutation(MUT_FORMLESS) ? "form" : "head"); + } + messages.push_back(str); } @@ -3422,6 +3438,14 @@ static void _xom_pseudo_miscast(int /*sever*/) str = replace_all(str, "@your_item@", name); str = replace_all(str, "@Your_item@", uppercase_first(name)); + /* XXX: The formless mutation doesn't technically mean you don't have a + * form; it means you don't have a head. */ + if (you.has_mutation(MUT_FORMLESS)) + { + str = replace_all(str, "@head@", + you.has_mutation(MUT_FORMLESS) ? "form" : "head"); + } + messages.push_back(str); } @@ -3436,7 +3460,7 @@ static void _xom_pseudo_miscast(int /*sever*/) messages.push_back(str); } - if (item_def* item = _xom_get_random_worn_ring()) + if (item_def* item = _xom_get_random_worn_slot_item(SLOT_RING)) { // Don't just say "your ring" here. We want to know which one. string name = "your " + item->name(DESC_QUALNAME, false, false, false); -- Dungeon Crawl Stone Soup |