From bd01e86ebcaf81cb605791d3b0c7dda19eadfd17 Mon Sep 17 00:00:00 2001 From: Birdtalon Date: Sat, 18 Nov 2023 12:12:07 +0000 Subject: [PATCH 1/3] moves GetJobRealName() unused proc --- code/__HELPERS/job.dm | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/code/__HELPERS/job.dm b/code/__HELPERS/job.dm index 89fe6877647e..897d736b7650 100644 --- a/code/__HELPERS/job.dm +++ b/code/__HELPERS/job.dm @@ -14,18 +14,8 @@ all_jobs += new jobtype return all_jobs - /proc/get_all_centcom_jobs() return list() -//gets the actual job rank (ignoring alt titles) -//this is used solely for sechuds -/obj/proc/GetJobRealName() - if (!istype(src,/obj/item/card/id)) return - var/obj/item/card/id/I = src - if(I.rank in GLOB.joblist) return I.rank - if(I.assignment in GLOB.joblist) return I.assignment - return "Unknown" - /proc/get_all_job_icons() return GLOB.joblist + list("Prisoner")//For all existing HUD icons /obj/proc/GetJobName() //Used in secHUD icon generation From 71715ee83a42c937cf1605c66000ae932dc96dc5 Mon Sep 17 00:00:00 2001 From: Birdtalon Date: Sat, 18 Nov 2023 12:12:37 +0000 Subject: [PATCH 2/3] refactors out of obj/ into obj/item/card/id GetJobName() --- code/__HELPERS/job.dm | 12 ------------ code/game/objects/items/cards_ids.dm | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/code/__HELPERS/job.dm b/code/__HELPERS/job.dm index 897d736b7650..220236c6f7e3 100644 --- a/code/__HELPERS/job.dm +++ b/code/__HELPERS/job.dm @@ -18,18 +18,6 @@ /proc/get_all_job_icons() return GLOB.joblist + list("Prisoner")//For all existing HUD icons -/obj/proc/GetJobName() //Used in secHUD icon generation - var/obj/item/card/id/I = src - if(istype(I)) - var/job_icons = get_all_job_icons() - var/centcom = get_all_centcom_jobs() - - if(I.assignment in job_icons) return I.assignment//Check if the job has a hud icon - if(I.rank in job_icons) return I.rank - if(I.assignment in centcom) return "Centcom"//Return with the NT logo if it is a Centcom job - if(I.rank in centcom) return "Centcom" - return "Unknown" //Return unknown if none of the above apply - /proc/get_actual_job_name(mob/M) if(!M) return null diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index a5e0eafe2f91..f6af3c0ca237 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -97,6 +97,21 @@ . = ..() screen_loc = null +/obj/item/card/id/proc/GetJobName() //Used in secHUD icon generation + + var/job_icons = get_all_job_icons() + var/centcom = get_all_centcom_jobs() + + if(assignment in job_icons) + return assignment//Check if the job has a hud icon + if(rank in job_icons) + return rank + if(assignment in centcom) + return "Centcom"//Return with the NT logo if it is a Centcom job + if(rank in centcom) + return "Centcom" + return "Unknown" //Return unknown if none of the above apply + /obj/item/card/id/attack_self(mob/user as mob) ..() user.visible_message("[user] shows you: [icon2html(src, viewers(user))] [name]: assignment: [assignment]") From 2304860a3779a7d36de60e85507f0872c3dca478 Mon Sep 17 00:00:00 2001 From: Birdtalon Date: Sat, 18 Nov 2023 12:20:16 +0000 Subject: [PATCH 3/3] refactors istype(src) out of make_dizzy() --- code/modules/mob/living/carbon/human/human.dm | 6 ++++++ code/modules/mob/mob.dm | 11 ++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 3bc8e97623da..95fd393d12b5 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1741,3 +1741,9 @@ return FALSE . = ..() + +/mob/living/carbon/human/make_dizzy(amount) + dizziness = min(500, dizziness + amount) // store what will be new value + // clamped to max 500 + if(dizziness > 100 && !is_dizzy) + INVOKE_ASYNC(src, PROC_REF(dizzy_process)) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index c28de81ecfc1..26139af07eb6 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -593,20 +593,13 @@ adds a dizziness amount to a mob use this rather than directly changing var/dizziness since this ensures that the dizzy_process proc is started -currently only humans get dizzy +currently only mob/living/carbon/human get dizzy value of dizziness ranges from 0 to 1000 below 100 is not dizzy */ /mob/proc/make_dizzy(amount) - if(!istype(src, /mob/living/carbon/human)) // for the moment, only humans get dizzy - return - - dizziness = min(500, dizziness + amount) // store what will be new value - // clamped to max 500 - if(dizziness > 100 && !is_dizzy) - INVOKE_ASYNC(src, PROC_REF(dizzy_process)) - + return /* dizzy process - wiggles the client's pixel offset over time