Skip to content

Commit

Permalink
SSD takeover now loads your active character slot (#16253)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ldip999 committed Jul 9, 2024
1 parent de91279 commit fb8969f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions code/datums/actions/observer_action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@
if(new_mob.stat == DEAD)
to_chat(owner, span_warning("You cannot join if the mob is dead."))
return FALSE

switch(tgui_alert(owner, "Are you sure you want to take " + new_mob.real_name +" ("+new_mob.job.title+")?", "Take SSD mob", list("Yes", "No",)))
if("No")
return
if(isxeno(new_mob))
var/mob/living/carbon/xenomorph/ssd_xeno = new_mob
if(ssd_xeno.tier != XENO_TIER_MINION && XENODEATHTIME_CHECK(owner))
Expand All @@ -85,13 +87,20 @@
if(is_banned_from(owner.ckey, new_mob?.job?.title))
to_chat(owner, span_warning("You are jobbaned from the [new_mob?.job.title] role."))
return

if(!ishuman(new_mob))
message_admins(span_adminnotice("[owner.key] took control of [new_mob.name] as [new_mob.p_they()] was ssd."))
log_admin("[owner.key] took control of [new_mob.name] as [new_mob.p_they()] was ssd.")
new_mob.transfer_mob(owner)
return
if(CONFIG_GET(flag/prevent_dupe_names) && GLOB.real_names_joined.Find(owner.client.prefs.real_name))
to_chat(usr, span_warning("Someone has already joined the round with this character name. Please pick another."))
return
message_admins(span_adminnotice("[owner.key] took control of [new_mob.name] as [new_mob.p_they()] was ssd."))
log_admin("[owner.key] took control of [new_mob.name] as [new_mob.p_they()] was ssd.")
new_mob.transfer_mob(owner)
if(!ishuman(new_mob))
return
var/mob/living/carbon/human/H = new_mob
H.fully_replace_character_name(H.real_name, H.species.random_name(H.gender))
H.on_transformation()

//respawn button for campaign gamemode
/datum/action/observer_action/campaign_respawn
Expand Down
2 changes: 1 addition & 1 deletion code/datums/gamemodes/_game_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ GLOBAL_LIST_INIT(bioscan_locations, list(
if(job.job_flags & JOB_FLAG_SPECIALNAME)
name_to_check = job.get_special_name(NP.client)
if(CONFIG_GET(flag/prevent_dupe_names) && GLOB.real_names_joined.Find(name_to_check))
to_chat(usr, "<span class='warning'>Someone has already joined the round with this character name. Please pick another.<spawn>")
to_chat(usr, span_warning("Someone has already joined the round with this character name. Please pick another."))
return FALSE
if(!SSjob.AssignRole(NP, job, TRUE))
to_chat(usr, "<span class='warning'>Failed to assign selected role.<spawn>")
Expand Down

0 comments on commit fb8969f

Please sign in to comment.