More things use trait huds over raw hud management (#93084)

This commit is contained in:
MrMelbert
2025-10-02 14:36:40 -05:00
committed by GitHub
parent 3d0cdfeac0
commit 44acefa73f
47 changed files with 249 additions and 236 deletions
+4 -4
View File
@@ -27,14 +27,14 @@
/datum/element/digitalcamo/proc/HideFromAIHuds(mob/living/target)
for(var/mob/living/silicon/ai/AI in GLOB.ai_list)
for (var/hud_type in AI.silicon_huds)
var/datum/atom_hud/silicon_hud = GLOB.huds[hud_type]
for (var/hud_trait in AI.silicon_huds)
var/datum/atom_hud/silicon_hud = GLOB.huds[GLOB.trait_to_hud[hud_trait]]
silicon_hud.hide_single_atomhud_from(AI,target)
/datum/element/digitalcamo/proc/UnhideFromAIHuds(mob/living/target)
for(var/mob/living/silicon/ai/AI in GLOB.ai_list)
for (var/hud_type in AI.silicon_huds)
var/datum/atom_hud/silicon_hud = GLOB.huds[hud_type]
for (var/hud_trait in AI.silicon_huds)
var/datum/atom_hud/silicon_hud = GLOB.huds[GLOB.trait_to_hud[hud_trait]]
silicon_hud.unhide_single_atomhud_from(AI,target)
/datum/element/digitalcamo/proc/on_examine(datum/source, mob/M, list/examine_list)
+14 -3
View File
@@ -20,11 +20,22 @@ GLOBAL_LIST_INIT(huds, list(
DATA_HUD_MALF_APC = new /datum/atom_hud/data/malf_apc(),
))
/// Assoc list of traits to the huds they give.
GLOBAL_LIST_INIT(trait_to_hud, list(
TRAIT_SECURITY_HUD = DATA_HUD_SECURITY_ADVANCED,
TRAIT_MEDICAL_HUD = DATA_HUD_MEDICAL_ADVANCED,
TRAIT_DIAGNOSTIC_HUD = DATA_HUD_DIAGNOSTIC,
TRAIT_ABDUCTOR_HUD = DATA_HUD_ABDUCTOR,
TRAIT_BOT_PATH_HUD = DATA_HUD_BOT_PATH,
TRAIT_CLOWN_ENJOYER = DATA_HUD_FAN,
TRAIT_DIAGNOSTIC_HUD = DATA_HUD_DIAGNOSTIC,
TRAIT_MEDICAL_HUD = DATA_HUD_MEDICAL_ADVANCED,
TRAIT_MEDICAL_HUD_SENSOR_ONLY = DATA_HUD_MEDICAL_BASIC,
TRAIT_MIME_FAN = DATA_HUD_FAN,
TRAIT_SECURITY_HUD = DATA_HUD_SECURITY_ADVANCED,
TRAIT_SECURITY_HUD_ID_ONLY = DATA_HUD_SECURITY_BASIC,
))
/// Assoc list of traits that block other traits' huds to list of hud (traits) that they block
GLOBAL_LIST_INIT(trait_blockers_to_hud, list(
TRAIT_BLOCK_SECHUD = list(TRAIT_SECURITY_HUD, TRAIT_SECURITY_HUD_ID_ONLY),
))
/datum/atom_hud
@@ -25,7 +25,3 @@
/datum/quirk/item_quirk/clown_enjoyer/add_unique(client/client_source)
give_item_to_holder(/obj/item/clothing/accessory/clown_enjoyer_pin, list(LOCATION_BACKPACK, LOCATION_HANDS))
/datum/quirk/item_quirk/clown_enjoyer/add(client/client_source)
var/datum/atom_hud/fan = GLOB.huds[DATA_HUD_FAN]
fan.show_to(quirk_holder)
@@ -23,7 +23,3 @@
/datum/quirk/item_quirk/mime_fan/add_unique(client/client_source)
give_item_to_holder(/obj/item/clothing/accessory/mime_fan_pin, list(LOCATION_BACKPACK, LOCATION_HANDS))
/datum/quirk/item_quirk/mime_fan/add(client/client_source)
var/datum/atom_hud/fan = GLOB.huds[DATA_HUD_FAN]
fan.show_to(quirk_holder)
+2 -6
View File
@@ -299,16 +299,12 @@
)
//Makes the user passive, it's in their oath not to harm!
owner.add_traits(list(TRAIT_PACIFISM, TRAIT_HIPPOCRATIC_OATH), HIPPOCRATIC_OATH_TRAIT)
var/datum/atom_hud/med_hud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
med_hud.show_to(owner)
owner.add_traits(list(TRAIT_PACIFISM, TRAIT_HIPPOCRATIC_OATH, TRAIT_MEDICAL_HUD), HIPPOCRATIC_OATH_TRAIT)
return ..()
/datum/status_effect/hippocratic_oath/on_remove()
QDEL_NULL(aura_healing)
owner.remove_traits(list(TRAIT_PACIFISM, TRAIT_HIPPOCRATIC_OATH), HIPPOCRATIC_OATH_TRAIT)
var/datum/atom_hud/med_hud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
med_hud.hide_from(owner)
owner.remove_traits(list(TRAIT_PACIFISM, TRAIT_HIPPOCRATIC_OATH, TRAIT_MEDICAL_HUD), HIPPOCRATIC_OATH_TRAIT)
/datum/status_effect/hippocratic_oath/get_examine_text()
return span_notice("[owner.p_They()] seem[owner.p_s()] to have an aura of healing and helpfulness about [owner.p_them()].")