Skip to content

Commit

Permalink
Assigned job slots and cryorines. (#4076)
Browse files Browse the repository at this point in the history
# About the pull request

Followup to #3552. In other words, the second part of it that was left
out of the original PR to cut down on feature creep.
Seems to work out fine in first approach on localhost, but testing with
wider populace in natural conditions is probably required.
(Also, added an extra sanity check to keep randomised characters from
inheriting actual characters' records which might be using the actual
names - not that anybody ever reads character records anyawy.)

# Explain why it's good for the game

Roleplaying game letting players use their characters is good.
Encouraging players to use different characters more is also good.


# Changelog
:cl:
add: Joining cryomarines now uses your assigned character slot for the
role you get (as long as you have not already used that character name
this round).
/:cl:
  • Loading branch information
Segrain committed Aug 3, 2023
1 parent 07fae75 commit b4859b4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 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
17 changes: 12 additions & 5 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1955,11 +1955,17 @@ var/const/MAX_SAVE_SLOTS = 10
load_character(slot_for_job)

/// 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)
if(check_datacore && !(be_random_body && be_random_name))
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
break

if(be_random_name)
real_name = random_name(gender)
Expand Down Expand Up @@ -1987,10 +1993,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 b4859b4

Please sign in to comment.