Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes a couple of istype(src) & unused proc #4955

Merged
merged 3 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions code/__HELPERS/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,10 @@
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
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
Expand Down
15 changes: 15 additions & 0 deletions code/game/objects/items/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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]")
Expand Down
6 changes: 6 additions & 0 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
11 changes: 2 additions & 9 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading