mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-30 15:37:36 +01:00
Refactor atom HUDs to track source of HUD gain/loss. (#32091)
* Refactor atom HUDs to track source of HUD gain/loss. * Retain shared images from different huds on removal. * Fix some ghost HUD toggles. * Add HUD sources to more hud add/remove calls. * Apply suggestions from CRUNCH review. Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> Signed-off-by: Alan <alfalfascout@users.noreply.github.com> * Check if a user has a hud before removing it, autodoc. --------- Signed-off-by: Alan <alfalfascout@users.noreply.github.com> Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
This commit is contained in:
@@ -676,7 +676,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
continue
|
||||
for(var/m in GLOB.player_list)
|
||||
var/mob/M = m
|
||||
antag_hud.add_hud_to(M)
|
||||
antag_hud.add_hud_to(M, "round end")
|
||||
|
||||
var/static/list/base_encouragement_messages = list(
|
||||
"Keep on keeping on!",
|
||||
|
||||
@@ -98,13 +98,13 @@
|
||||
if(zeroth_law_borg)
|
||||
laws.set_zeroth_law(zeroth_law_borg.law)
|
||||
var/datum/atom_hud/data/human/malf_ai/H = GLOB.huds[DATA_HUD_MALF_AI]
|
||||
H.add_hud_to(src)
|
||||
H.add_hud_to(src, "zeroth law")
|
||||
else if(zeroth_law)
|
||||
laws.set_zeroth_law(zeroth_law.law)
|
||||
else
|
||||
laws.clear_zeroth_laws()
|
||||
var/datum/atom_hud/data/human/malf_ai/H = GLOB.huds[DATA_HUD_MALF_AI]
|
||||
H.remove_hud_from(src)
|
||||
H.remove_hud_from(src, "zeroth law")
|
||||
|
||||
/mob/living/silicon/ai/sync_zeroth(datum/ai_law/zeroth_law, datum/ai_law/zeroth_law_borg)
|
||||
if(zeroth_law)
|
||||
|
||||
+32
-16
@@ -36,9 +36,12 @@ GLOBAL_LIST_INIT(huds, alist(
|
||||
))
|
||||
|
||||
/datum/atom_hud
|
||||
var/list/atom/hudatoms = list() //list of all atoms which display this hud
|
||||
var/list/mob/hudusers = list() //list with all mobs who can see the hud
|
||||
var/list/hud_icons = list() //these will be the indexes for the atom's hud_list
|
||||
/// All the atoms that display this hud.
|
||||
var/list/atom/hudatoms = list()
|
||||
/// All the mobs who can see this hud, and their sources. each_mob = list(source/1, source/2).
|
||||
var/list/mob/hudusers = list()
|
||||
/// Indexes for the atom's hud_list.
|
||||
var/list/hud_icons = list()
|
||||
/// Do we ignore the invisibility check? Used by anom huds so we can see our stuff.
|
||||
var/ignore_invisibility_check = FALSE
|
||||
|
||||
@@ -54,43 +57,57 @@ GLOBAL_LIST_INIT(huds, alist(
|
||||
GLOB.all_huds -= src
|
||||
return ..()
|
||||
|
||||
/datum/atom_hud/proc/remove_hud_from(mob/M)
|
||||
/// Removes `source` from mob's hud sources, and if mob has no hud sources, removes their ability to see this hud
|
||||
/datum/atom_hud/proc/remove_hud_from(mob/M, atom/source)
|
||||
if(!M)
|
||||
return
|
||||
if(src in M.permanent_huds)
|
||||
return
|
||||
for(var/atom/A in hudatoms)
|
||||
remove_from_single_hud(M, A)
|
||||
hudusers -= M
|
||||
if(hudusers[M])
|
||||
hudusers[M] -= source
|
||||
if(hudusers[M] && length(hudusers[M]))
|
||||
return
|
||||
|
||||
for(var/atom/A in hudatoms)
|
||||
remove_hud_images(M, A)
|
||||
hudusers -= M
|
||||
M.reload_huds()
|
||||
|
||||
/// Removes a single item from being displayed on this hud, for example, removes one mess from janihud.
|
||||
/datum/atom_hud/proc/remove_from_hud(atom/A)
|
||||
if(!A)
|
||||
return
|
||||
for(var/mob/M in hudusers)
|
||||
remove_from_single_hud(M, A)
|
||||
remove_hud_images(M, A)
|
||||
hudatoms -= A
|
||||
|
||||
/datum/atom_hud/proc/remove_from_single_hud(mob/M, atom/A) //unsafe, no sanity apart from client
|
||||
/// Removes all of the hud pictures that `A` produces from mob `M`'s view.
|
||||
/datum/atom_hud/proc/remove_hud_images(mob/M, atom/A) // Unsafe, no sanity apart from client.
|
||||
if(!M || !M.client || !A)
|
||||
return
|
||||
for(var/i in hud_icons)
|
||||
M.client.images -= A.hud_list[i]
|
||||
|
||||
/datum/atom_hud/proc/add_hud_to(mob/M)
|
||||
/// Adds `source` to mob's sources of this hud, and shows them all the pictures on the hud
|
||||
/datum/atom_hud/proc/add_hud_to(mob/M, atom/source)
|
||||
if(!M)
|
||||
return
|
||||
hudusers |= M
|
||||
if(!(M in hudusers))
|
||||
hudusers[M] = list()
|
||||
hudusers[M] |= source
|
||||
for(var/atom/A in hudatoms)
|
||||
add_to_single_hud(M, A)
|
||||
add_hud_images(M, A)
|
||||
|
||||
/// Adds single atom `A` to the list of pictures this hud will display. Shows them to mobs with this hud.
|
||||
/datum/atom_hud/proc/add_to_hud(atom/A)
|
||||
if(!A)
|
||||
return
|
||||
hudatoms |= A
|
||||
for(var/mob/M in hudusers)
|
||||
add_to_single_hud(M, A)
|
||||
add_hud_images(M, A)
|
||||
|
||||
/datum/atom_hud/proc/add_to_single_hud(mob/M, atom/A) //unsafe, no sanity apart from client
|
||||
/// Adds all hud images that `A` produces to player `M`'s view.
|
||||
/datum/atom_hud/proc/add_hud_images(mob/M, atom/A) // Unsafe, no sanity apart from client.
|
||||
if(!M || !M.client || !A)
|
||||
return
|
||||
if((A.invisibility > M.see_invisible) && !ignore_invisibility_check) // yee yee ass snowflake check for our yee yee ass snowflake huds
|
||||
@@ -111,10 +128,9 @@ GLOBAL_LIST_INIT(huds, alist(
|
||||
for(var/datum/mindslaves/serv in (SSticker.mode.vampires | SSticker.mode.traitors))
|
||||
serv_huds += serv.thrallhud
|
||||
|
||||
|
||||
for(var/datum/atom_hud/hud in (GLOB.all_huds|serv_huds))//|gang_huds))
|
||||
if(src in hud.hudusers)
|
||||
hud.add_hud_to(src)
|
||||
hud.add_hud_to(src, hud.hudusers[src][1])
|
||||
|
||||
/mob/new_player/reload_huds()
|
||||
return
|
||||
|
||||
@@ -337,7 +337,7 @@
|
||||
//Makes the user passive, it's in their oath not to harm!
|
||||
ADD_TRAIT(owner, TRAIT_PACIFISM, "hippocraticOath")
|
||||
var/datum/atom_hud/H = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
|
||||
H.add_hud_to(owner)
|
||||
H.add_hud_to(owner, src)
|
||||
owner.permanent_huds |= H
|
||||
return ..()
|
||||
|
||||
@@ -345,7 +345,7 @@
|
||||
REMOVE_TRAIT(owner, TRAIT_PACIFISM, "hippocraticOath")
|
||||
var/datum/atom_hud/H = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
|
||||
owner.permanent_huds ^= H
|
||||
H.remove_hud_from(owner)
|
||||
H.remove_hud_from(owner, src)
|
||||
|
||||
/datum/status_effect/hippocratic_oath/tick()
|
||||
// Death transforms you into a snake after a short grace period
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
if(U.sensor_mode <= SENSOR_VITALS) return
|
||||
return TRUE
|
||||
|
||||
/datum/atom_hud/data/human/medical/basic/add_to_single_hud(mob/M, mob/living/carbon/H)
|
||||
/datum/atom_hud/data/human/medical/basic/add_hud_images(mob/M, mob/living/carbon/H)
|
||||
if(check_sensors(H) || isobserver(M))
|
||||
..()
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
/mob/living/simple_animal/hostile/guardian/healer/Life(seconds, times_fired)
|
||||
..()
|
||||
var/datum/atom_hud/medsensor = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
|
||||
medsensor.add_hud_to(src)
|
||||
medsensor.add_hud_to(src, "guardian healer")
|
||||
|
||||
/mob/living/simple_animal/hostile/guardian/healer/get_status_tab_items()
|
||||
var/list/status_tab_data = ..()
|
||||
|
||||
@@ -30,31 +30,28 @@
|
||||
/obj/mecha/nkarrdem/moved_inside(mob/living/carbon/human/H)
|
||||
. = ..()
|
||||
if(. && ishuman(H))
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses/hud))
|
||||
occupant_message(SPAN_WARNING("[H.glasses] prevent you from using [src]'s built-in janitorial HUD."))
|
||||
else
|
||||
var/datum/atom_hud/data/janitor/jani_hud = GLOB.huds[DATA_HUD_JANITOR]
|
||||
jani_hud.add_hud_to(H)
|
||||
builtin_hud_user = TRUE
|
||||
var/datum/atom_hud/data/janitor/jani_hud = GLOB.huds[DATA_HUD_JANITOR]
|
||||
jani_hud.add_hud_to(H, src)
|
||||
builtin_hud_user = TRUE
|
||||
|
||||
/obj/mecha/nkarrdem/mmi_moved_inside(obj/item/mmi/mmi_as_oc, mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(occupant.client)
|
||||
var/datum/atom_hud/data/janitor/jani_hud = GLOB.huds[DATA_HUD_JANITOR]
|
||||
jani_hud.add_hud_to(occupant)
|
||||
jani_hud.add_hud_to(occupant, src)
|
||||
builtin_hud_user = TRUE
|
||||
|
||||
/obj/mecha/nkarrdem/go_out()
|
||||
if(ishuman(occupant) && builtin_hud_user)
|
||||
var/mob/living/carbon/human/H = occupant
|
||||
var/datum/atom_hud/data/janitor/jani_hud = GLOB.huds[DATA_HUD_JANITOR]
|
||||
jani_hud.remove_hud_from(H)
|
||||
jani_hud.remove_hud_from(H, src)
|
||||
builtin_hud_user = FALSE
|
||||
else if((isbrain(occupant) || pilot_is_mmi()) && builtin_hud_user)
|
||||
var/mob/living/brain/H = occupant
|
||||
var/datum/atom_hud/data/janitor/jani_hud = GLOB.huds[DATA_HUD_JANITOR]
|
||||
jani_hud.remove_hud_from(H)
|
||||
jani_hud.remove_hud_from(H, src)
|
||||
builtin_hud_user = FALSE
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -16,31 +16,28 @@
|
||||
/obj/mecha/medical/odysseus/moved_inside(mob/living/carbon/human/H)
|
||||
. = ..()
|
||||
if(. && ishuman(H))
|
||||
if(istype(H.glasses, /obj/item/clothing/glasses/hud))
|
||||
occupant_message(SPAN_WARNING("[H.glasses] prevent you from using the built-in medical hud."))
|
||||
else
|
||||
var/datum/atom_hud/data/human/medical/advanced/A = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
|
||||
A.add_hud_to(H)
|
||||
builtin_hud_user = 1
|
||||
var/datum/atom_hud/data/human/medical/advanced/A = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
|
||||
A.add_hud_to(H, src)
|
||||
builtin_hud_user = 1
|
||||
|
||||
/obj/mecha/medical/odysseus/mmi_moved_inside(obj/item/mmi/mmi_as_oc, mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(occupant.client)
|
||||
var/datum/atom_hud/A = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
|
||||
A.add_hud_to(occupant)
|
||||
A.add_hud_to(occupant, src)
|
||||
builtin_hud_user = 1
|
||||
|
||||
/obj/mecha/medical/odysseus/go_out()
|
||||
if(ishuman(occupant) && builtin_hud_user)
|
||||
var/mob/living/carbon/human/H = occupant
|
||||
var/datum/atom_hud/data/human/medical/advanced/A = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
|
||||
A.remove_hud_from(H)
|
||||
A.remove_hud_from(H, src)
|
||||
builtin_hud_user = 0
|
||||
else if((isbrain(occupant) || pilot_is_mmi()) && builtin_hud_user)
|
||||
var/mob/living/brain/H = occupant
|
||||
var/datum/atom_hud/A = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
|
||||
A.remove_hud_from(H)
|
||||
A.remove_hud_from(H, src)
|
||||
builtin_hud_user = 0
|
||||
|
||||
. = ..()
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
M.mind.antag_hud.leave_hud(M)
|
||||
add_to_hud(M)
|
||||
if(self_visible)
|
||||
add_hud_to(M)
|
||||
add_hud_to(M, "antag")
|
||||
M.mind.antag_hud = src
|
||||
|
||||
/datum/atom_hud/antag/proc/leave_hud(mob/M)
|
||||
@@ -22,7 +22,7 @@
|
||||
if(!istype(M))
|
||||
CRASH("leave_hud(): [M] ([M.type]) is not a mob!")
|
||||
remove_from_hud(M)
|
||||
remove_hud_from(M)
|
||||
remove_hud_from(M, "antag")
|
||||
if(M.mind)
|
||||
M.mind.antag_hud = null
|
||||
|
||||
@@ -31,13 +31,13 @@
|
||||
CRASH("join_hud(): [M] ([M.type]) is not a mob!")
|
||||
add_to_hud(M)
|
||||
if(self_visible)
|
||||
add_hud_to(M)
|
||||
add_hud_to(M, "antag")
|
||||
|
||||
/datum/atom_hud/antag/hidden/secondary/leave_hud(mob/M)
|
||||
if(!istype(M))
|
||||
CRASH("leave_hud(): [M] ([M.type]) is not a mob!")
|
||||
remove_from_hud(M)
|
||||
remove_hud_from(M)
|
||||
remove_hud_from(M, "antag")
|
||||
|
||||
//GAME_MODE PROCS
|
||||
//called to set a mob's antag icon state
|
||||
@@ -71,7 +71,7 @@
|
||||
if(!istype(data_hud))
|
||||
continue
|
||||
if(current in data_hud.hudusers)
|
||||
data_hud.remove_hud_from(current)
|
||||
data_hud.remove_hud_from(current, "antag")
|
||||
|
||||
|
||||
///Master Servent Datum Sytems,Based on TG Gang system//
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
if(!issilicon(our_mob))
|
||||
GLOB.reality_smash_track.add_tracked_mind(owner)
|
||||
var/datum/atom_hud/data/heretic/h_hud = GLOB.huds[DATA_HUD_HERETIC]
|
||||
h_hud.add_hud_to(our_mob)
|
||||
h_hud.add_hud_to(our_mob, src)
|
||||
ADD_TRAIT(our_mob, TRAIT_MANSUS_TOUCHED, src.UID())
|
||||
RegisterSignal(our_mob, COMSIG_LIVING_CULT_SACRIFICED, PROC_REF(on_cult_sacrificed))
|
||||
RegisterSignal(our_mob, COMSIG_MOB_BEFORE_SPELL_CAST, PROC_REF(on_spell_cast))
|
||||
@@ -293,7 +293,7 @@
|
||||
if(owner in GLOB.reality_smash_track.tracked_heretics)
|
||||
GLOB.reality_smash_track.remove_tracked_mind(owner)
|
||||
var/datum/atom_hud/data/heretic/h_hud = GLOB.huds[DATA_HUD_HERETIC]
|
||||
h_hud.remove_hud_from(our_mob)
|
||||
h_hud.remove_hud_from(our_mob, src)
|
||||
|
||||
REMOVE_TRAIT(our_mob, TRAIT_MANSUS_TOUCHED, src.UID())
|
||||
UnregisterSignal(our_mob, list(
|
||||
|
||||
@@ -56,9 +56,9 @@ RESTRICT_TYPE(/datum/antagonist/traitor)
|
||||
A.remove_malf_abilities()
|
||||
QDEL_NULL(A.malf_picker)
|
||||
var/datum/atom_hud/data/human/malf_ai/H = GLOB.huds[DATA_HUD_MALF_AI]
|
||||
H.remove_hud_from(usr)
|
||||
H.remove_hud_from(usr, src)
|
||||
for(var/mob/living/silicon/robot/borg in A.connected_robots)
|
||||
H.remove_hud_from(borg)
|
||||
H.remove_hud_from(borg, src)
|
||||
|
||||
// Leave the mindslave hud.
|
||||
if(owner.som)
|
||||
@@ -250,9 +250,9 @@ RESTRICT_TYPE(/datum/antagonist/traitor)
|
||||
to_chat(killer, "Your radio has been upgraded! Use :t to speak on an encrypted channel with Syndicate Agents!")
|
||||
killer.add_malf_picker()
|
||||
var/datum/atom_hud/data/human/malf_ai/H = GLOB.huds[DATA_HUD_MALF_AI]
|
||||
H.add_hud_to(killer)
|
||||
H.add_hud_to(killer, src)
|
||||
for(var/mob/living/silicon/robot/borg in killer.connected_robots)
|
||||
H.add_hud_to(borg)
|
||||
H.add_hud_to(borg, src)
|
||||
|
||||
/**
|
||||
* Gives a traitor human their uplink, and uplink code.
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
return
|
||||
for(var/new_hud in hud_types)
|
||||
var/datum/atom_hud/H = GLOB.huds[new_hud]
|
||||
H.add_hud_to(user)
|
||||
H.add_hud_to(user, src)
|
||||
|
||||
/obj/item/clothing/glasses/hud/dropped(mob/living/carbon/human/user)
|
||||
..()
|
||||
@@ -32,7 +32,7 @@
|
||||
return
|
||||
for(var/new_hud in hud_types)
|
||||
var/datum/atom_hud/H = GLOB.huds[new_hud]
|
||||
H.remove_hud_from(user)
|
||||
H.remove_hud_from(user, src)
|
||||
|
||||
/obj/item/clothing/glasses/hud/emp_act(severity)
|
||||
if(!emagged)
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
return
|
||||
for(var/new_hud in hud_types)
|
||||
var/datum/atom_hud/H = GLOB.huds[new_hud]
|
||||
H.remove_hud_from(user)
|
||||
H.remove_hud_from(user, src)
|
||||
hud_types = null
|
||||
return
|
||||
electronics = TRUE
|
||||
@@ -85,7 +85,7 @@
|
||||
return
|
||||
for(var/new_hud in hud_types)
|
||||
var/datum/atom_hud/H = GLOB.huds[new_hud]
|
||||
H.add_hud_to(user)
|
||||
H.add_hud_to(user, src)
|
||||
|
||||
/obj/item/clothing/glasses/hud/tajblind/meson
|
||||
name = "\improper Tajaran engineering meson veil"
|
||||
|
||||
@@ -331,13 +331,13 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
/mob/dead/observer/proc/show_me_the_hud(hud_index)
|
||||
var/datum/atom_hud/H = GLOB.huds[hud_index]
|
||||
H.add_hud_to(src)
|
||||
H.add_hud_to(src, "observer")
|
||||
data_hud_seen |= hud_index
|
||||
|
||||
// remove old huds
|
||||
/mob/dead/observer/proc/remove_the_hud(hud_index)
|
||||
var/datum/atom_hud/H = GLOB.huds[hud_index]
|
||||
H.remove_hud_from(src)
|
||||
H.remove_hud_from(src, "observer")
|
||||
data_hud_seen -= hud_index
|
||||
|
||||
/mob/dead/observer/verb/open_hud_panel()
|
||||
@@ -432,7 +432,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
var/datum/atom_hud/antag/chosen_hud = hud
|
||||
if(!istype(chosen_hud))
|
||||
continue
|
||||
chosen_hud.add_hud_to(src)
|
||||
chosen_hud.add_hud_to(src, "observer")
|
||||
|
||||
/**
|
||||
* Toggles off all HUDs for the ghost player.
|
||||
@@ -448,7 +448,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
var/datum/atom_hud/antag/chosen_hud = hud
|
||||
if(!istype(chosen_hud))
|
||||
continue
|
||||
chosen_hud.remove_hud_from(src)
|
||||
chosen_hud.remove_hud_from(src, "observer")
|
||||
|
||||
/mob/dead/observer/proc/toggle_rad_view()
|
||||
ghost_flags ^= GHOST_SEE_RADS
|
||||
|
||||
@@ -39,11 +39,11 @@
|
||||
remove_verb(src, /mob/living/verb/pulled)
|
||||
remove_verb(src, /mob/verb/me_verb)
|
||||
var/datum/atom_hud/med_hud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
|
||||
med_hud.add_hud_to(src)
|
||||
med_hud.add_hud_to(src, "lightgeist")
|
||||
|
||||
/mob/living/basic/lightgeist/Destroy()
|
||||
var/datum/atom_hud/med_hud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
|
||||
med_hud.remove_hud_from(src)
|
||||
med_hud.remove_hud_from(src, "lightgeist")
|
||||
return ..()
|
||||
|
||||
/mob/living/basic/lightgeist/melee_attack(atom/target, list/modifiers, ignore_cooldown)
|
||||
|
||||
@@ -40,9 +40,9 @@
|
||||
H.languages.Cut() //Under no condition should you be able to speak any language
|
||||
H.add_language("Abductor Mindlink") //other than over the abductor's own mindlink
|
||||
var/datum/atom_hud/abductor_hud = GLOB.huds[DATA_HUD_ABDUCTOR]
|
||||
abductor_hud.add_hud_to(H)
|
||||
abductor_hud.add_hud_to(H, "abductor")
|
||||
|
||||
/datum/species/abductor/on_species_loss(mob/living/carbon/human/H)
|
||||
..()
|
||||
var/datum/atom_hud/abductor_hud = GLOB.huds[DATA_HUD_ABDUCTOR]
|
||||
abductor_hud.remove_hud_from(H)
|
||||
abductor_hud.remove_hud_from(H, "abductor")
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
diag_hud.remove_from_hud(H)
|
||||
else if(istype(hud, /datum/atom_hud/data/human/medical))
|
||||
var/datum/atom_hud/data/human/medical/med_hud = hud
|
||||
med_hud.add_hud_to(H)
|
||||
med_hud.add_to_hud(H)
|
||||
|
||||
// i love snowflake code
|
||||
var/image/health_bar = H.hud_list[DIAG_HUD]
|
||||
|
||||
@@ -1257,7 +1257,8 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
clear_supplied_laws()
|
||||
laws = new /datum/ai_laws/crewsimov
|
||||
var/datum/atom_hud/data/human/malf_ai/A = GLOB.huds[DATA_HUD_MALF_AI]
|
||||
A.remove_hud_from(user)
|
||||
|
||||
A.remove_hud_from(user, "emag")
|
||||
|
||||
/mob/living/silicon/robot/emag_act(mob/user)
|
||||
if(!ishuman(user) && !issilicon(user))
|
||||
@@ -1646,7 +1647,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
update_icons()
|
||||
emagged = TRUE
|
||||
var/datum/atom_hud/data/human/malf_ai/A = GLOB.huds[DATA_HUD_MALF_AI]
|
||||
A.add_hud_to(src)
|
||||
A.add_hud_to(src, "emag")
|
||||
SetLockdown(FALSE)
|
||||
|
||||
/mob/living/silicon/robot/proc/make_mindflayer_robot(mob/living/flayer)
|
||||
|
||||
@@ -409,27 +409,27 @@
|
||||
var/datum/atom_hud/medsensor = GLOB.huds[med_hud]
|
||||
var/datum/atom_hud/diagsensor = GLOB.huds[d_hud]
|
||||
var/datum/atom_hud/janisensor = GLOB.huds[jani_hud]
|
||||
secsensor.remove_hud_from(src)
|
||||
medsensor.remove_hud_from(src)
|
||||
diagsensor.remove_hud_from(src)
|
||||
janisensor.remove_hud_from(src)
|
||||
secsensor.remove_hud_from(src, "silicon")
|
||||
medsensor.remove_hud_from(src, "silicon")
|
||||
diagsensor.remove_hud_from(src, "silicon")
|
||||
janisensor.remove_hud_from(src, "silicon")
|
||||
|
||||
|
||||
/mob/living/silicon/proc/add_sec_hud()
|
||||
var/datum/atom_hud/secsensor = GLOB.huds[sec_hud]
|
||||
secsensor.add_hud_to(src)
|
||||
secsensor.add_hud_to(src, "silicon")
|
||||
|
||||
/mob/living/silicon/proc/add_med_hud()
|
||||
var/datum/atom_hud/medsensor = GLOB.huds[med_hud]
|
||||
medsensor.add_hud_to(src)
|
||||
medsensor.add_hud_to(src, "silicon")
|
||||
|
||||
/mob/living/silicon/proc/add_diag_hud()
|
||||
var/datum/atom_hud/diagsensor = GLOB.huds[d_hud]
|
||||
diagsensor.add_hud_to(src)
|
||||
diagsensor.add_hud_to(src, "silicon")
|
||||
|
||||
/mob/living/silicon/proc/add_jani_hud()
|
||||
var/datum/atom_hud/janisensor = GLOB.huds[jani_hud]
|
||||
janisensor.add_hud_to(src)
|
||||
janisensor.add_hud_to(src, "silicon")
|
||||
|
||||
/mob/living/silicon/proc/toggle_sensor_mode()
|
||||
to_chat(src, SPAN_NOTICE("Please select sensor type."))
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
|
||||
var/datum/atom_hud/data_hud = GLOB.huds[data_hud_type]
|
||||
if(data_hud)
|
||||
data_hud.remove_hud_from(src)
|
||||
data_hud.remove_hud_from(src, "bot")
|
||||
|
||||
GLOB.bots_list -= src
|
||||
QDEL_NULL(path)
|
||||
@@ -1077,7 +1077,7 @@ Pass a positive integer as an argument to override a bot's default speed.
|
||||
|
||||
var/datum/atom_hud/data_hud = GLOB.huds[data_hud_type]
|
||||
if(data_hud)
|
||||
data_hud.add_hud_to(src)
|
||||
data_hud.add_hud_to(src, "bot")
|
||||
|
||||
diag_hud_set_botmode()
|
||||
show_laws()
|
||||
|
||||
@@ -289,7 +289,7 @@ GLOBAL_LIST_EMPTY(ts_infected_list)
|
||||
addtimer(CALLBACK(src, PROC_REF(CheckFaction)), 20)
|
||||
addtimer(CALLBACK(src, PROC_REF(announcetoghosts)), 30)
|
||||
var/datum/atom_hud/U = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
|
||||
U.add_hud_to(src)
|
||||
U.add_hud_to(src, "spider")
|
||||
spider_creation_time = world.time
|
||||
AddComponent(/datum/component/event_tracker, EVENT_TERROR_SPIDERS)
|
||||
|
||||
@@ -305,7 +305,7 @@ GLOBAL_LIST_EMPTY(ts_infected_list)
|
||||
/mob/living/simple_animal/hostile/poison/terror_spider/Destroy()
|
||||
GLOB.ts_spiderlist -= src
|
||||
var/datum/atom_hud/U = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
|
||||
U.remove_hud_from(src)
|
||||
U.remove_hud_from(src, "spider")
|
||||
handle_dying()
|
||||
|
||||
spider_mymother = null
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
return
|
||||
if(hud_type)
|
||||
var/datum/atom_hud/hud = GLOB.huds[hud_type]
|
||||
hud.add_hud_to(mod.wearer)
|
||||
hud.add_hud_to(mod.wearer, src)
|
||||
if(length(visor_trait))
|
||||
ADD_TRAIT(mod.wearer, visor_trait, MODSUIT_TRAIT)
|
||||
mod.wearer.update_sight()
|
||||
@@ -32,7 +32,7 @@
|
||||
return
|
||||
if(hud_type)
|
||||
var/datum/atom_hud/hud = GLOB.huds[hud_type]
|
||||
hud.remove_hud_from(mod.wearer)
|
||||
hud.remove_hud_from(mod.wearer, src)
|
||||
if(length(visor_trait))
|
||||
REMOVE_TRAIT(mod.wearer, visor_trait, MODSUIT_TRAIT)
|
||||
mod.wearer.update_sight()
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
..()
|
||||
if(HUD_type)
|
||||
var/datum/atom_hud/H = GLOB.huds[HUD_type]
|
||||
H.add_hud_to(M)
|
||||
H.add_hud_to(M, src)
|
||||
M.permanent_huds |= H
|
||||
|
||||
/obj/item/organ/internal/cyberimp/eyes/hud/remove(mob/living/carbon/M, special = 0)
|
||||
@@ -33,7 +33,7 @@
|
||||
if(HUD_type)
|
||||
var/datum/atom_hud/H = GLOB.huds[HUD_type]
|
||||
M.permanent_huds ^= H
|
||||
H.remove_hud_from(M)
|
||||
H.remove_hud_from(M, src)
|
||||
|
||||
/obj/item/organ/internal/cyberimp/eyes/hud/medical
|
||||
name = "Medical HUD implant"
|
||||
|
||||
@@ -88,9 +88,9 @@ GLOBAL_DATUM_INIT(ghost_hud_panel, /datum/ui_module/ghost_hud_panel, new)
|
||||
var/datum/atom_hud/antag/chosen_hud = hud
|
||||
if(!istype(chosen_hud))
|
||||
continue
|
||||
chosen_hud.add_hud_to(ghost)
|
||||
chosen_hud.add_hud_to(ghost, "observer")
|
||||
var/datum/atom_hud/data/human/malf_ai/H = GLOB.huds[DATA_HUD_MALF_AI]
|
||||
H.add_hud_to(ghost)
|
||||
H.add_hud_to(ghost, "observer")
|
||||
|
||||
if("ahud_off")
|
||||
ghost.antagHUD = FALSE
|
||||
@@ -98,6 +98,6 @@ GLOBAL_DATUM_INIT(ghost_hud_panel, /datum/ui_module/ghost_hud_panel, new)
|
||||
var/datum/atom_hud/antag/chosen_hud = hud
|
||||
if(!istype(chosen_hud))
|
||||
continue
|
||||
chosen_hud.remove_hud_from(ghost)
|
||||
chosen_hud.remove_hud_from(ghost, "observer")
|
||||
var/datum/atom_hud/data/human/malf_ai/H = GLOB.huds[DATA_HUD_MALF_AI]
|
||||
H.remove_hud_from(ghost)
|
||||
H.remove_hud_from(ghost, "observer")
|
||||
|
||||
Reference in New Issue
Block a user