Skip to content

Commit

Permalink
Assigned job slots and cryorines.
Browse files Browse the repository at this point in the history
  • Loading branch information
Segrain committed Aug 1, 2023
1 parent 947878f commit 8471995
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
15 changes: 10 additions & 5 deletions code/datums/emergency_calls/cryo_marines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,35 @@
if(leaders < cryo_squad.max_leaders && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_LEADER) && check_timelock(H.client, JOB_SQUAD_LEADER, time_required_for_job))
leader = H
leaders++
arm_equipment(H, /datum/equipment_preset/uscm/leader/cryo, TRUE, TRUE)
H.client.prefs.copy_all_to(H, JOB_SQUAD_LEADER, TRUE, TRUE)
arm_equipment(H, /datum/equipment_preset/uscm/leader/cryo, FALSE, TRUE)
to_chat(H, SPAN_ROLE_HEADER("You are a Squad Leader in the USCM"))
to_chat(H, SPAN_ROLE_BODY("You are here to assist in the defence of the [SSmapping.configs[GROUND_MAP].map_name]. Listen to the chain of command."))
to_chat(H, SPAN_BOLDWARNING("If you wish to cryo or ghost upon spawning in, you must ahelp and inform staff so you can be replaced."))
else if (heavies < max_heavies && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_HEAVY) && check_timelock(H.client, JOB_SQUAD_SPECIALIST, time_required_for_job))
heavies++
arm_equipment(H, /datum/equipment_preset/uscm/spec/cryo, TRUE, TRUE)
H.client.prefs.copy_all_to(H, JOB_SQUAD_SPECIALIST, TRUE, TRUE)
arm_equipment(H, /datum/equipment_preset/uscm/spec/cryo, FALSE, TRUE)
to_chat(H, SPAN_ROLE_HEADER("You are a Weapons Specialist in the USCM"))
to_chat(H, SPAN_ROLE_BODY("Your squad is here to assist in the defence of the [SSmapping.configs[GROUND_MAP].map_name]. Listen to the chain of command."))
to_chat(H, SPAN_BOLDWARNING("If you wish to cryo or ghost upon spawning in, you must ahelp and inform staff so you can be replaced."))
else if (medics < max_medics && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_MEDIC) && check_timelock(H.client, JOB_SQUAD_MEDIC, time_required_for_job))
medics++
arm_equipment(H, /datum/equipment_preset/uscm/medic/cryo, TRUE, TRUE)
H.client.prefs.copy_all_to(H, JOB_SQUAD_MEDIC, TRUE, TRUE)
arm_equipment(H, /datum/equipment_preset/uscm/medic/cryo, FALSE, TRUE)
to_chat(H, SPAN_ROLE_HEADER("You are a Hospital Corpsman in the USCM"))
to_chat(H, SPAN_ROLE_BODY("You are here to assist in the defence of the [SSmapping.configs[GROUND_MAP].map_name]. Listen to the chain of command."))
to_chat(H, SPAN_BOLDWARNING("If you wish to cryo or ghost upon spawning in, you must ahelp and inform staff so you can be replaced."))
else if (engineers < max_engineers && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_ENGINEER) && check_timelock(H.client, JOB_SQUAD_ENGI, time_required_for_job))
engineers++
arm_equipment(H, /datum/equipment_preset/uscm/engineer/cryo, TRUE, TRUE)
H.client.prefs.copy_all_to(H, JOB_SQUAD_ENGI, TRUE, TRUE)
arm_equipment(H, /datum/equipment_preset/uscm/engineer/cryo, FALSE, TRUE)
to_chat(H, SPAN_ROLE_HEADER("You are an Engineer in the USCM"))
to_chat(H, SPAN_ROLE_BODY("You are here to assist in the defence of the [SSmapping.configs[GROUND_MAP].map_name]. Listen to the chain of command."))
to_chat(H, SPAN_BOLDWARNING("If you wish to cryo or ghost upon spawning in, you must ahelp and inform staff so you can be replaced."))
else
arm_equipment(H, /datum/equipment_preset/uscm/pfc/cryo, TRUE, TRUE)
H.client.prefs.copy_all_to(H, JOB_SQUAD_MARINE, TRUE, TRUE)
arm_equipment(H, /datum/equipment_preset/uscm/pfc/cryo, FALSE, TRUE)
to_chat(H, SPAN_ROLE_HEADER("You are a Rifleman in the USCM"))
to_chat(H, SPAN_ROLE_BODY("You are here to assist in the defence of the [SSmapping.configs[GROUND_MAP].map_name]. Listen to the chain of command."))
to_chat(H, SPAN_BOLDWARNING("If you wish to cryo or ghost upon spawning in, you must ahelp and inform staff so you can be replaced."))
Expand Down
22 changes: 15 additions & 7 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1943,23 +1943,30 @@ var/const/MAX_SAVE_SLOTS = 10


/// Loads appropriate character slot for the given job as assigned in preferences.
/datum/preferences/proc/find_assigned_slot(job_title, is_late_join = FALSE)
/datum/preferences/proc/find_assigned_slot(job_title, is_late_join = FALSE, check_datacore = FALSE)
if(toggle_prefs & (is_late_join ? TOGGLE_LATE_JOIN_CURRENT_SLOT : TOGGLE_START_JOIN_CURRENT_SLOT))
return
var/slot_for_job = pref_job_slots[job_title]
switch(slot_for_job)
if(JOB_SLOT_RANDOMISED_SLOT)
be_random_body = TRUE
be_random_name = TRUE
check_datacore = FALSE
if(1 to MAX_SAVE_SLOTS)
load_character(slot_for_job)
if(check_datacore)
for(var/datum/data/record/record as anything in GLOB.data_core.locked)
if(record.fields["name"] == real_name)
be_random_body = TRUE
be_random_name = TRUE
return

/// Transfers both physical characteristics and character information to character
/datum/preferences/proc/copy_all_to(mob/living/carbon/human/character, job_title, is_late_join = FALSE)
/datum/preferences/proc/copy_all_to(mob/living/carbon/human/character, job_title, is_late_join = FALSE, check_datacore = FALSE)
if(!istype(character))
return

find_assigned_slot(job_title, is_late_join)
find_assigned_slot(job_title, is_late_join, check_datacore)

if(be_random_name)
real_name = random_name(gender)
Expand Down Expand Up @@ -1987,10 +1994,11 @@ var/const/MAX_SAVE_SLOTS = 10
character.flavor_texts["legs"] = flavor_texts["legs"]
character.flavor_texts["feet"] = flavor_texts["feet"]

character.med_record = strip_html(med_record)
character.sec_record = strip_html(sec_record)
character.gen_record = strip_html(gen_record)
character.exploit_record = strip_html(exploit_record)
if(!be_random_name)
character.med_record = strip_html(med_record)
character.sec_record = strip_html(sec_record)
character.gen_record = strip_html(gen_record)
character.exploit_record = strip_html(exploit_record)

character.age = age
character.gender = gender
Expand Down

0 comments on commit 8471995

Please sign in to comment.