Skip to content

Commit

Permalink
Fix: novice_jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
PhantornRU committed Nov 17, 2023
1 parent b6932c6 commit d3feb23
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 21 deletions.
34 changes: 33 additions & 1 deletion modular_ss220/jobs/code/cards_ids.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Для отрисовки ХУД'ов.
GLOBAL_LIST_INIT(Jobs_SS220, list("intern", "cadet", "trainee", "student"))
GLOBAL_LIST_INIT(Jobs_titles_SS220, list("Intern", "Security Cadet", "Trainee Engineer", "Student Scientist"))
GLOBAL_LIST_INIT(Jobs_titles_SS220, Jobs_novice_titles_SS220)
GLOBAL_LIST_INIT(Jobs_novice_titles_SS220, list("Intern", "Security Cadet", "Trainee Engineer", "Student Scientist"))

/proc/get_all_medical_novice_titles()
return list("Intern", "Medical Assistant", "Student Medical Doctor")
Expand Down Expand Up @@ -58,8 +59,39 @@ GLOBAL_LIST_INIT(Jobs_titles_SS220, list("Intern", "Security Cadet", "Trainee En
return data

/obj/machinery/computer/card/ui_act(action, params)
var/is_alt_title_rewrite = FALSE
var/job_alt_tittle
switch(action)
if("assign") // transfer to a new job
if(!modify)
return

job_alt_tittle = params["assign_target"]
if(job_alt_tittle in GLOB.Jobs_novice_titles_SS220)
//for fast find job without check all jobs (!!!for alt_titles job with icon like novice roles!!!)
var/list/dictionary = list(
"Intern" = /datum/job/doctor,
"Security Cadet" = /datum/job/officer,
"Trainee Engineer" = /datum/job/engineer,
"Student Scientist" = /datum/job/scientist,
)
var/job_type = dictionary[job_alt_tittle]
var/datum/job/job
if(!job_type) // gatto
return
job = new job_type

if(job && length(job.alt_titles) && (job_alt_tittle in job.alt_titles))
params["assign_target"] = job.title
is_alt_title_rewrite = TRUE
qdel(job)

. = ..()

if(is_alt_title_rewrite)
modify.assignment = job_alt_tittle
regenerate_id_name()

switch(action)
if("skin")
if(!modify)
Expand Down
5 changes: 0 additions & 5 deletions modular_ss220/jobs/code/job/engineering_jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,3 @@
head = /obj/item/clothing/head/soft/orange
if("Engineer Student")
head = /obj/item/clothing/head/beret/eng

// Identification jobs for console
/datum/job/engineer/trainee
title = "Trainee Engineer"
hidden_from_job_prefs = TRUE
5 changes: 0 additions & 5 deletions modular_ss220/jobs/code/job/medical_jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,3 @@
if("Student Medical Doctor")
head = /obj/item/clothing/head/surgery/green/light
uniform = /obj/item/clothing/under/rank/medical/scrubs/green/light

// Identification jobs for console
/datum/job/doctor/intern
title = "Intern"
hidden_from_job_prefs = TRUE
5 changes: 0 additions & 5 deletions modular_ss220/jobs/code/job/science_jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,3 @@
uniform = /obj/item/clothing/under/rank/scientist/student/assistant
if(H.gender == FEMALE)
uniform = /obj/item/clothing/under/rank/scientist/student/assistant/skirt

// Identification jobs for console
/datum/job/scientist/student
title = "Student Scientist"
hidden_from_job_prefs = TRUE
5 changes: 0 additions & 5 deletions modular_ss220/jobs/code/job/security_jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,3 @@
uniform = /obj/item/clothing/under/rank/security/cadet/assistant/skirt
if("Security Graduate")
head = /obj/item/clothing/head/beret/sec

// Identification jobs for console
/datum/job/officer/cadet
title = "Security Cadet"
hidden_from_job_prefs = TRUE

0 comments on commit d3feb23

Please sign in to comment.