Skip to content

Commit ccef870

Browse files
Fixes midshipman department assignments (#2424)
Co-authored-by: Bokkiewokkie <[email protected]>
1 parent 24861be commit ccef870

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

nsv13/code/modules/jobs/job_types/marine/midshipman.dm

+48
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,51 @@ Marine & all their unique stuff!
6868
name = "squad medic uniform"
6969
desc = "A cheaply made and uncomfortable uniform worn by squad medics. It has a conspicuous blue cross on the back. Shooting its bearer may constitute a war crime."
7070
icon_state = "marine_medic"
71+
72+
/datum/job/assistant/after_spawn(mob/living/carbon/human/H, mob/M)
73+
. = ..()
74+
// Assign department
75+
var/department = M?.client?.prefs?.active_character?.preferred_security_department
76+
if(department == "None")
77+
to_chat(M, "<b>You have not been assigned to any department. Help in any way you can!</b>")
78+
return
79+
else if(!(department in GLOB.available_depts))
80+
department = pick(GLOB.available_depts)
81+
82+
var/ears = null
83+
var/accessory = null
84+
var/list/dep_access = null
85+
switch(department)
86+
if(SEC_DEPT_SUPPLY)
87+
ears = /obj/item/radio/headset/headset_cargo
88+
dep_access = list(ACCESS_MAILSORTING, ACCESS_CARGO)
89+
accessory = /obj/item/clothing/accessory/armband/cargo
90+
if(SEC_DEPT_ENGINEERING)
91+
ears = /obj/item/radio/headset/headset_eng
92+
dep_access = list(ACCESS_CONSTRUCTION, ACCESS_ENGINE, ACCESS_AUX_BASE)
93+
accessory = /obj/item/clothing/accessory/armband/engine
94+
if(SEC_DEPT_MEDICAL)
95+
ears = /obj/item/radio/headset/headset_med
96+
dep_access = list(ACCESS_MEDICAL, ACCESS_MORGUE, ACCESS_CLONING)
97+
accessory = /obj/item/clothing/accessory/armband/medblue
98+
if(SEC_DEPT_SCIENCE)
99+
ears = /obj/item/radio/headset/headset_sci
100+
dep_access = list(ACCESS_RESEARCH)
101+
accessory = /obj/item/clothing/accessory/armband/science
102+
if(SEC_DEPT_MUNITIONS)
103+
ears = /obj/item/radio/headset/munitions/munitions_tech
104+
dep_access = list(ACCESS_MUNITIONS, ACCESS_MUNITIONS_STORAGE)
105+
accessory = /obj/item/clothing/accessory/armband/munitions
106+
107+
if(accessory)
108+
var/obj/item/clothing/under/U = H.w_uniform
109+
U.attach_accessory(new accessory)
110+
if(ears)
111+
if(H.ears)
112+
qdel(H.ears)
113+
H.equip_to_slot_or_del(new ears(H), ITEM_SLOT_EARS)
114+
115+
var/obj/item/card/id/W = H.wear_id
116+
W.access |= dep_access
117+
118+
to_chat(M, "<b>You have been assigned to [department]!</b>")

0 commit comments

Comments
 (0)