From e7b396eddfd3974acf69e7bf81c352e649a16659 Mon Sep 17 00:00:00 2001 From: GDN <96800819+GDNgit@users.noreply.github.com> Date: Wed, 1 Nov 2023 15:10:15 -0500 Subject: [PATCH] Silicon Chamo properly hides huds (#22312) * hide hud * more documentation * Update code/modules/mob/mob_vars.dm Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> * Update code/modules/mob/mob_vars.dm Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> --------- Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> --- code/_onclick/click.dm | 13 ------ code/datums/atom_hud.dm | 2 + code/game/verbs/suicide.dm | 2 - .../changeling/powers/digitalcamo.dm | 4 +- .../clothing/under/syndicate_jumpsuits.dm | 4 +- .../detective_work/footprints_and_rag.dm | 8 ---- code/modules/mob/mob.dm | 3 -- code/modules/mob/mob_misc_procs.dm | 13 ++++++ code/modules/mob/mob_vars.dm | 45 ++++++++++++++++--- code/modules/mob/typing_indicator.dm | 5 --- code/modules/tgui/external.dm | 6 --- 11 files changed, 59 insertions(+), 46 deletions(-) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index f92675a1f60..32c75816276 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -3,11 +3,6 @@ ~Sayu */ - -// THESE DO NOT AFFECT THE BASE 1 DECISECOND DELAY OF NEXT_CLICK -/mob/var/next_move_adjust = 0 //Amount to adjust action delays by, + or - -/mob/var/next_move_modifier = 1 //Value to multiply action delays by - //Delays the mob's next action by num deciseconds // eg: 10-3 = 7 deciseconds of delay // eg: 10*0.5 = 5 deciseconds of delay @@ -16,14 +11,6 @@ /mob/proc/changeNext_move(num) next_move = world.time + ((num+next_move_adjust)*next_move_modifier) -// 1 decisecond click delay (above and beyond mob/next_move) -//This is mainly modified by click code, to modify click delays elsewhere, use next_move and changeNext_move() -/mob/var/next_click = 0 - -// THESE DO AFFECT THE BASE 1 DECISECOND DELAY OF NEXT_CLICK -/mob/var/next_click_adjust = 0 -/mob/var/next_click_modifier = 1 //Value to multiply click delays by - //Delays the mob's next click by num deciseconds // eg: 10-3 = 7 deciseconds of delay // eg: 10*0.5 = 5 deciseconds of delay diff --git a/code/datums/atom_hud.dm b/code/datums/atom_hud.dm index 9eeda5fd9f2..ff924e697d1 100644 --- a/code/datums/atom_hud.dm +++ b/code/datums/atom_hud.dm @@ -81,6 +81,8 @@ GLOBAL_LIST_INIT(huds, list( /datum/atom_hud/proc/add_to_single_hud(mob/M, atom/A) //unsafe, no sanity apart from client if(!M || !M.client || !A) return + if(A.invisibility > M.see_invisible) // yee yee ass snowflake check for our yee yee ass snowflake huds + return for(var/i in hud_icons) if(A.hud_list[i]) M.client.images |= A.hud_list[i] diff --git a/code/game/verbs/suicide.dm b/code/game/verbs/suicide.dm index de9702bcb5a..1558c9d524d 100644 --- a/code/game/verbs/suicide.dm +++ b/code/game/verbs/suicide.dm @@ -1,5 +1,3 @@ -/mob/var/suiciding = 0 - /mob/living/verb/suicide() // imagine this shit with BORERS lmao set hidden = 1 diff --git a/code/modules/antagonists/changeling/powers/digitalcamo.dm b/code/modules/antagonists/changeling/powers/digitalcamo.dm index 6f9be10fa79..f05edff6b21 100644 --- a/code/modules/antagonists/changeling/powers/digitalcamo.dm +++ b/code/modules/antagonists/changeling/powers/digitalcamo.dm @@ -14,11 +14,11 @@ /datum/action/changeling/digitalcamo/sting_action(mob/user) if(HAS_TRAIT_FROM(user, TRAIT_AI_UNTRACKABLE, CHANGELING_TRAIT)) REMOVE_TRAIT(user, TRAIT_AI_UNTRACKABLE, CHANGELING_TRAIT) - user.invisibility = initial(user.invisibility) + user.set_invisible(INVISIBILITY_MINIMUM) to_chat(user, "We return to normal.") else ADD_TRAIT(user, TRAIT_AI_UNTRACKABLE, CHANGELING_TRAIT) to_chat(user, "We distort our form to prevent AI-tracking.") - user.invisibility = SEE_INVISIBLE_LIVING + user.set_invisible(SEE_INVISIBLE_LIVING) SSblackbox.record_feedback("nested tally", "changeling_powers", 1, list("[name]")) return TRUE diff --git a/code/modules/clothing/under/syndicate_jumpsuits.dm b/code/modules/clothing/under/syndicate_jumpsuits.dm index 5fc8c2aefbb..6caf91dab70 100644 --- a/code/modules/clothing/under/syndicate_jumpsuits.dm +++ b/code/modules/clothing/under/syndicate_jumpsuits.dm @@ -45,12 +45,12 @@ . = ..() if(slot == SLOT_HUD_JUMPSUIT) ADD_TRAIT(user, TRAIT_AI_UNTRACKABLE, "silicon_cham[UID()]") - user.invisibility = SEE_INVISIBLE_LIVING + user.set_invisible(SEE_INVISIBLE_LIVING) to_chat(user, "You feel a slight shiver as the cybernetic obfuscators activate.") /obj/item/clothing/under/syndicate/silicon_cham/dropped(mob/user) . = ..() if(user) REMOVE_TRAIT(user, TRAIT_AI_UNTRACKABLE, "silicon_cham[UID()]") - user.invisibility = initial(user.invisibility) + user.set_invisible(INVISIBILITY_MINIMUM) to_chat(user, "You feel a slight shiver as the cybernetic obfuscators deactivate.") diff --git a/code/modules/detective_work/footprints_and_rag.dm b/code/modules/detective_work/footprints_and_rag.dm index 92ce57b5936..282efb696d9 100644 --- a/code/modules/detective_work/footprints_and_rag.dm +++ b/code/modules/detective_work/footprints_and_rag.dm @@ -1,11 +1,3 @@ - -/mob - var/bloody_hands = 0 - var/list/feet_blood_DNA - var/feet_blood_color - var/blood_state = BLOOD_STATE_NOT_BLOODY - var/list/bloody_feet = list(BLOOD_STATE_HUMAN = 0, BLOOD_STATE_XENO = 0, BLOOD_STATE_NOT_BLOODY = 0, BLOOD_BASE_ALPHA = BLOODY_FOOTPRINT_BASE_ALPHA) - /obj/item/clothing/gloves var/transfer_blood = 0 diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 39f18a3fdbe..db7822b4c5e 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -781,9 +781,6 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ /mob/proc/is_dead() return stat == DEAD -/mob - var/newPlayerType = /mob/new_player - /mob/verb/abandon_mob() set name = "Respawn" set category = "OOC" diff --git a/code/modules/mob/mob_misc_procs.dm b/code/modules/mob/mob_misc_procs.dm index fb8d33449ac..8031723971d 100644 --- a/code/modules/mob/mob_misc_procs.dm +++ b/code/modules/mob/mob_misc_procs.dm @@ -807,3 +807,16 @@ GLOBAL_LIST_INIT(intents, list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM /mob/proc/attempt_listen_to_deadsay() + +/// Proc to PROPERLY set mob invisibility, huds gotta get set too! +/mob/proc/set_invisible(invis_value) + if(invis_value) + invisibility = invis_value + else + invisibility = initial(invisibility) + for(var/hud in hud_possible) + var/image/actual_hud = hud_list[hud] + if(invis_value) + actual_hud.invisibility = invis_value + else + actual_hud.invisibility = initial(actual_hud.invisibility) diff --git a/code/modules/mob/mob_vars.dm b/code/modules/mob/mob_vars.dm index 5fbbc7ea067..f66f9da307a 100644 --- a/code/modules/mob/mob_vars.dm +++ b/code/modules/mob/mob_vars.dm @@ -42,7 +42,6 @@ var/obj/machinery/machine = null var/currently_grab_pulled = null /// only set while the move is ongoing, to prevent shuffling between pullees var/memory = "" - var/next_move = null var/notransform = FALSE //Carbon /// True for left hand active, otherwise for right hand active var/hand = null @@ -216,8 +215,44 @@ var/runechat_msg_location /// The datum receiving keyboard input. parent mob by default. var/datum/input_focus = null - - /// lazy list. contains /obj/screen/alert only. On /mob so clientless mobs will throw alerts properly - var/list/alerts - + /// Is our mob currently suiciding? Used for suicide code along with many different revival checks + var/suiciding = FALSE + /// Used for some screen objects, such as var/list/screens = list() + /// lazy list. contains /obj/screen/alert only, On /mob so clientless mobs will throw alerts properly + var/list/alerts + /// Makes items bloody if you touch them + var/bloody_hands = 0 + /// Basically a lazy list, copies the DNA of blood you step in + var/list/feet_blood_DNA + /// affects the blood color of your feet, color taken from the blood you step in + var/feet_blood_color + /// Weirdly named, effects how blood transfers onto objects + var/blood_state = BLOOD_STATE_NOT_BLOODY + /// Assoc list for tracking how "bloody" a mobs feet are, used for creating bloody foot/shoeprints on turfs when moving + var/list/bloody_feet = list(BLOOD_STATE_HUMAN = 0, BLOOD_STATE_XENO = 0, BLOOD_STATE_NOT_BLOODY = 0, BLOOD_BASE_ALPHA = BLOODY_FOOTPRINT_BASE_ALPHA) + /// set when typing in an input window instead of chatline, this var could probably be removed soon enough + var/hud_typing = 0 + /// Affects if you have a typing indicator + var/typing + /// Last thing we typed in to the typing indicator, probably does not need to exist + var/last_typed + /// Last time we typed something in to the typing popup + var/last_typed_time + // Ran after next_click on most item interactions, used in any case where we aren't required to use next click Eg: Action buttons + var/next_move + /// Unused, used to adjust our next move on a linar skill world.time + (how_many_deciseconds + Next move adjust) = Next move + var/next_move_adjust = 0 + /// Value to multiply action delays by, actually used world.time + (how_many_deciseconds * Next move Adjust) = Next move + var/next_move_modifier = 1 + // 1 decisecond click delay (above and beyond mob/next_move) + /// This is mainly modified by click code, to modify click delays elsewhere, use next_move and changeNext_move(), Controls the click delay. Changed with + var/next_click = 0 + + // Does not effect the build in tick delay of click, can't go below 1 click per tick + /// Unused + var/next_click_adjust = 0 + /// Unused + var/next_click_modifier = 1 + /// Tracks the open UIs that a mob has, used in TGUI for various things, such as updating UIs + var/list/open_uis = list() diff --git a/code/modules/mob/typing_indicator.dm b/code/modules/mob/typing_indicator.dm index 9345d0836d9..f949dc33dd0 100644 --- a/code/modules/mob/typing_indicator.dm +++ b/code/modules/mob/typing_indicator.dm @@ -1,10 +1,5 @@ #define TYPING_INDICATOR_LIFETIME 30 * 10 //grace period after which typing indicator disappears regardless of text in chatbar -/mob/var/hud_typing = 0 //set when typing in an input window instead of chatline -/mob/var/typing -/mob/var/last_typed -/mob/var/last_typed_time - GLOBAL_LIST_EMPTY(typing_indicator) /** diff --git a/code/modules/tgui/external.dm b/code/modules/tgui/external.dm index 2f7ca23b0af..94fec60a4eb 100644 --- a/code/modules/tgui/external.dm +++ b/code/modules/tgui/external.dm @@ -116,12 +116,6 @@ */ /datum/var/list/tgui_shared_states -/** - * global - * - * Used to track UIs for a mob. - */ -/mob/var/list/open_uis = list() /** * public *