mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
[MIRROR] Changing changeling (Refactor) (#11142)
Co-authored-by: Cameron Lennox <killer65311@gmail.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9feb91ec4c
commit
a0c273ce1f
@@ -165,6 +165,7 @@
|
||||
new_character.key = player_key
|
||||
|
||||
//Were they any particular special role? If so, copy.
|
||||
|
||||
if(new_character.mind)
|
||||
new_character.mind.loaded_from_ckey = picked_ckey
|
||||
new_character.mind.loaded_from_slot = picked_slot
|
||||
@@ -172,6 +173,8 @@
|
||||
if(antag_data)
|
||||
antag_data.add_antagonist(new_character.mind)
|
||||
antag_data.place_mob(new_character)
|
||||
if(new_character.mind.antag_holder)
|
||||
new_character.mind.antag_holder.apply_antags(new_character)
|
||||
|
||||
for(var/lang in ghost_client.prefs.alternate_languages)
|
||||
var/datum/language/chosen_language = GLOB.all_languages[lang]
|
||||
|
||||
@@ -387,6 +387,12 @@
|
||||
active_mr = null
|
||||
return
|
||||
|
||||
//Changeling lock.
|
||||
if(sleever.get_occupant().changeling_locked && !is_changeling(active_mr.mind_ref))
|
||||
set_temp("Error: Mind incompatible with body", "danger")
|
||||
active_mr = null
|
||||
return TRUE
|
||||
|
||||
var/list/subtargets = list()
|
||||
for(var/mob/living/carbon/human/H in sleever.get_occupant())
|
||||
if(H.resleeve_lock && active_mr.ckey != H.resleeve_lock)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
////////////////////////////////
|
||||
|
||||
/mob/living/carbon/human/var/resleeve_lock
|
||||
/mob/living/carbon/human/var/changeling_locked
|
||||
/mob/living/carbon/human/var/original_player
|
||||
|
||||
/////// Mind-backup record ///////
|
||||
@@ -79,6 +80,7 @@
|
||||
//These may or may not be set, mostly irrelevant since it's just a body record.
|
||||
var/ckey
|
||||
var/locked
|
||||
var/changeling_locked
|
||||
var/client/client_ref
|
||||
var/datum/mind/mind_ref
|
||||
var/synthetic
|
||||
@@ -123,6 +125,11 @@
|
||||
//Person OOCly doesn't want people impersonating them
|
||||
locked = ckeylock
|
||||
|
||||
//The mob is a changeling, don't allow anyone to possess them. Not using locked as locked gives OOC notices.
|
||||
if(is_changeling(M))
|
||||
changeling_locked = TRUE
|
||||
|
||||
|
||||
var/datum/species/S = GLOB.all_species["[M.dna.species]"]
|
||||
if(S)
|
||||
// Force ckey locking if species is whitelisted
|
||||
|
||||
@@ -493,8 +493,15 @@
|
||||
if(!occupant.mind)
|
||||
log_debug("[occupant] didn't have a mind to check for vore_death, which may be problematic.")
|
||||
|
||||
if(occupant.mind && occupant.original_player && ckey(occupant.mind.key) != occupant.original_player)
|
||||
log_and_message_admins("is now a cross-sleeved character. Body originally belonged to [occupant.real_name]. Mind is now [occupant.mind.name].",occupant)
|
||||
if(occupant.mind)
|
||||
if(occupant.original_player && ckey(occupant.mind.key) != occupant.original_player)
|
||||
log_and_message_admins("is now a cross-sleeved character. Body originally belonged to [occupant.real_name]. Mind is now [occupant.mind.name].",occupant)
|
||||
var/datum/antagonist/antag_data = get_antag_data(occupant.mind.special_role)
|
||||
if(antag_data)
|
||||
antag_data.add_antagonist(occupant.mind)
|
||||
antag_data.place_mob(occupant)
|
||||
if(occupant.mind.antag_holder)
|
||||
occupant.mind.antag_holder.apply_antags(occupant)
|
||||
|
||||
if(original_occupant)
|
||||
occupant = original_occupant
|
||||
|
||||
Reference in New Issue
Block a user