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

Posibrains no longer limited to 1, but cyborgs cannot have repeat names #11426

Merged
merged 3 commits into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 12 additions & 0 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,18 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
return TRUE
return FALSE

//// Special handler for cyborg naming to ensure no cyborgs ever take a name that has already been used. Prevents "respawning" when the same player takes two posibrains.
/mob/proc/apply_cyborg_name(preference_type, client/C)

//This name has already been taken, refuse to pass it on and return false
if(preference_type in GLOB.cyborg_name_list)
Rukofamicom marked this conversation as resolved.
Show resolved Hide resolved
to_chat(C.mob, "<span class='warning'>Cyborg name randomized. Cyborg name already used this round by another character.</span>")
return FALSE

//Name is original, add it to the list to prevent it from being used again.
GLOB.cyborg_name_list += preference_type
return apply_pref_name(preference_type, C)

/proc/view_or_range(distance = world.view , center = usr , type)
switch(type)
if("view")
Expand Down
2 changes: 1 addition & 1 deletion code/_globalvars/lists/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ GLOBAL_LIST_EMPTY(mob_config_movespeed_type_lookup)

GLOBAL_LIST_EMPTY(emote_list)

GLOBAL_LIST_EMPTY(posi_key_list)
GLOBAL_LIST_EMPTY(cyborg_name_list)

GLOBAL_LIST_INIT(construct_radial_images, list(
CONSTRUCT_JUGGERNAUT = image(icon = 'icons/mob/cult.dmi', icon_state = "juggernaut"),
Expand Down
7 changes: 1 addition & 6 deletions code/modules/mob/living/brain/posibrain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ GLOBAL_VAR(posibrain_notify_cooldown)
return FALSE
if(is_occupied() || QDELETED(brainmob) || QDELETED(src) || QDELETED(user))
return FALSE
if(user.ckey in GLOB.posi_key_list)
to_chat(user, "<span class='warning'>Positronic brain spawns limited to 1 per round.</span>")
return FALSE
if(!(GLOB.ghost_role_flags & GHOSTROLE_SILICONS))
to_chat(user, "<span class='warning'>Central Command has temporarily outlawed posibrain sentience in this sector...</span>")
return FALSE
Expand All @@ -108,9 +105,7 @@ GLOBAL_VAR(posibrain_notify_cooldown)
return FALSE
if(brainmob.suiciding) //clear suicide status if the old occupant suicided.
brainmob.set_suicide(FALSE)
var/ckey = user.ckey
if(transfer_personality(user))
GLOB.posi_key_list += ckey
transfer_personality(user)

var/datum/job/posibrain/pj = SSjob.GetJob(JOB_NAME_POSIBRAIN)
pj.remove_posi_slot(src)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/silicon/robot/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
if(custom_name)
changed_name = custom_name
if(changed_name == "" && C && C.prefs.read_character_preference(/datum/preference/name/cyborg) != DEFAULT_CYBORG_NAME)
if(apply_pref_name(/datum/preference/name/cyborg, C))
if(apply_cyborg_name(/datum/preference/name/cyborg, C))
return //built in camera handled in proc
if(!changed_name)
changed_name = get_standard_name()
Expand Down
Loading