Monkey eyes fix and noticable organ display refactor; AI monkeys no longer catatonic (#82669)

## About The Pull Request

It turns out monkeys being catatonic got broken 2 years ago in a PR that
was meant to fix something else; also, it turns out monkeys are supposed
to have primal eyes when turned into humans, and that got broken too. I
fixed both of those things, and while I was at it I did a refactor to
make it easier to give noticable organs (or anything else that you'd
want correct pronoun and verb tenses) easier to implement.

1) AI controlled mobs now properly display their noticable organs when
appropriate
2) Added some macros and a helper proc for replacing appropriate
pronouns and verb tenses in text
3) The noticable organ HTML is no longer broken, so you can pass text
with spans into it, if you want the text to be pretty or big or whatever
4) Monkeys are no longer catatonic if they have an active AI controller;
this goes for any carbon actually but I think monkeys are the only one
with AI controllers at the moment
## Why It's Good For The Game

Fixes the logic for displaying organs on AI controller mobs (currently
monkeys)
Makes it easier to add these kind of organs for carbons, AI controlled
or not, in the future

Look! An actual use-case for split editor:

![image](https://github.com/tgstation/tgstation/assets/49173900/8cd0d69e-8091-4431-9418-6bd29e1713b5)
## Changelog

Humanized monkeys now have their primal eyes again; monkeys with active
AI are no longer catatonic.
🆑 Bisar
fix: AI controlled monkeys are no longer catatonic, and they have primal
eyes again when turned into humans.
spellcheck: Noticable organs now have more modular grammar, and their
current grammar is fixed.
refactor: Refactored the code for displaying the messages for noticable
organs.
config: Added a documented define of all our pronouns
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
Joshua Kidder
2024-04-25 12:36:04 +01:00
committed by GitHub
co-authored by MrMelbert
parent 68115df173
commit 7809dee900
12 changed files with 97 additions and 32 deletions
+1 -1
View File
@@ -46,7 +46,7 @@
if(noticable_organ_examines[possibly_noticable.slot])
make_organ_noticable(possibly_noticable.slot, possibly_noticable)
/datum/element/ai_control_examine/proc/make_organ_noticable(organ_slot, obj/item/organ/noticable_organ)
/datum/element/ai_control_examine/proc/make_organ_noticable(organ_slot, obj/item/organ/noticable_organ, mob/living/carbon/human/human_pawn)
var/examine_text = noticable_organ_examines[organ_slot]
var/body_zone = organ_slot != ORGAN_SLOT_BRAIN ? noticable_organ.zone : null
noticable_organ.AddElement(/datum/element/noticable_organ/ai_control, examine_text, body_zone)
+13 -12
View File
@@ -6,15 +6,13 @@
/datum/element/noticable_organ
element_flags = ELEMENT_BESPOKE
argument_hash_start_idx = 2
/// whether we wrap the examine text in a notice span.
var/add_span = TRUE
/// "[they]|[their] [desc here]", shows on examining someone with an infused organ.
/// Uses a possessive pronoun (His/Her/Their) if a body zone is given, or a singular pronoun (He/She/They) otherwise.
///Shows on examining someone with an infused organ.
var/infused_desc
/// Which body zone has to be exposed. If none is set, this is always noticable, and the description pronoun becomes singular instead of possesive.
/// Which body zone has to be exposed. If none is set, this is always noticable.
var/body_zone
/datum/element/noticable_organ/Attach(datum/target, infused_desc, body_zone)
/datum/element/noticable_organ/Attach(obj/item/organ/target, infused_desc, body_zone)
. = ..()
if(!isorgan(target))
@@ -23,8 +21,10 @@
src.infused_desc = infused_desc
src.body_zone = body_zone
RegisterSignal(target, COMSIG_ORGAN_IMPLANTED, PROC_REF(on_implanted))
RegisterSignal(target, COMSIG_ORGAN_IMPLANTED, PROC_REF(enable_description))
RegisterSignal(target, COMSIG_ORGAN_REMOVED, PROC_REF(on_removed))
if(target.owner)
enable_description(target, target.owner)
/datum/element/noticable_organ/Detach(obj/item/organ/target)
UnregisterSignal(target, list(COMSIG_ORGAN_IMPLANTED, COMSIG_ORGAN_REMOVED))
@@ -38,7 +38,7 @@
return FALSE
return TRUE
/datum/element/noticable_organ/proc/on_implanted(obj/item/organ/target, mob/living/carbon/receiver)
/datum/element/noticable_organ/proc/enable_description(obj/item/organ/target, mob/living/carbon/receiver)
SIGNAL_HANDLER
RegisterSignal(receiver, COMSIG_ATOM_EXAMINE, PROC_REF(on_receiver_examine))
@@ -53,16 +53,17 @@
if(!should_show_text(examined))
return
var/examine_text = replacetext(replacetext("[body_zone ? examined.p_Their() : examined.p_They()] [infused_desc]", "%PRONOUN_ES", examined.p_es()), "%PRONOUN_S", examined.p_s())
if(add_span)
examine_text = span_notice(examine_text)
var/examine_text = REPLACE_PRONOUNS(infused_desc, examined)
examine_list += examine_text
/**
* Subtype of noticable organs for AI control, that will make a few more ai status checks before forking over the examine.
*/
/datum/element/noticable_organ/ai_control
add_span = FALSE
/datum/element/noticable_organ/ai_control/should_show_text(mob/living/carbon/examined)
. = ..()