mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
## 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:  ## 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>
79 lines
2.5 KiB
Plaintext
79 lines
2.5 KiB
Plaintext
/**
|
|
* noticable organ element; which makes organs have a special description added to the person with the organ, if certain body zones aren't covered.
|
|
*
|
|
* Used for infused mutant organs
|
|
*/
|
|
/datum/element/noticable_organ
|
|
element_flags = ELEMENT_BESPOKE
|
|
argument_hash_start_idx = 2
|
|
|
|
///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.
|
|
var/body_zone
|
|
|
|
/datum/element/noticable_organ/Attach(obj/item/organ/target, infused_desc, body_zone)
|
|
. = ..()
|
|
|
|
if(!isorgan(target))
|
|
return ELEMENT_INCOMPATIBLE
|
|
|
|
src.infused_desc = infused_desc
|
|
src.body_zone = body_zone
|
|
|
|
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))
|
|
if(target.owner)
|
|
UnregisterSignal(target.owner, COMSIG_ATOM_EXAMINE)
|
|
return ..()
|
|
|
|
/// Proc that returns true or false if the organ should show its examine check.
|
|
/datum/element/noticable_organ/proc/should_show_text(mob/living/carbon/examined)
|
|
if(body_zone && (body_zone in examined.get_covered_body_zones()))
|
|
return FALSE
|
|
return TRUE
|
|
|
|
/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))
|
|
|
|
/datum/element/noticable_organ/proc/on_removed(obj/item/organ/target, mob/living/carbon/loser)
|
|
SIGNAL_HANDLER
|
|
|
|
UnregisterSignal(loser, COMSIG_ATOM_EXAMINE)
|
|
|
|
/datum/element/noticable_organ/proc/on_receiver_examine(mob/living/carbon/examined, mob/user, list/examine_list)
|
|
SIGNAL_HANDLER
|
|
|
|
if(!should_show_text(examined))
|
|
return
|
|
|
|
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
|
|
|
|
|
|
/datum/element/noticable_organ/ai_control/should_show_text(mob/living/carbon/examined)
|
|
. = ..()
|
|
if(!.)
|
|
return FALSE
|
|
if(examined.ai_controller?.ai_status == AI_STATUS_ON)
|
|
if(!examined.dna.species.ai_controlled_species)
|
|
return TRUE
|
|
return FALSE
|
|
|
|
/datum/element/noticable_organ/ai_control/on_removed(obj/item/organ/target, mob/living/carbon/loser)
|
|
Detach(target)
|