diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 7b73165f46e..1871a0b5436 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -1345,3 +1345,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_WING_BUFFET_TIRED "wing_buffet_tired" /// Trait given to a dragon who fails to defend their rifts #define TRAIT_RIFT_FAILURE "fail_dragon_loser" + +/// Trait given to mobs that we do not want to mindswap +#define TRAIT_NO_MINDSWAP "no_mindswap" diff --git a/code/modules/bitrunning/components/avatar_connection.dm b/code/modules/bitrunning/components/avatar_connection.dm index dab9be07e92..39b01b5ac00 100644 --- a/code/modules/bitrunning/components/avatar_connection.dm +++ b/code/modules/bitrunning/components/avatar_connection.dm @@ -33,6 +33,7 @@ server.avatar_connection_refs.Add(WEAKREF(src)) avatar.key = old_body.key + ADD_TRAIT(avatar, TRAIT_NO_MINDSWAP, REF(src)) // do not remove this one ADD_TRAIT(old_body, TRAIT_MIND_TEMPORARILY_GONE, REF(src)) RegisterSignals(old_body, list(COMSIG_LIVING_DEATH, COMSIG_MOVABLE_MOVED, COMSIG_LIVING_STATUS_UNCONSCIOUS), PROC_REF(on_sever_connection)) diff --git a/code/modules/events/wizard/shuffle.dm b/code/modules/events/wizard/shuffle.dm index a41e7d7de32..460fe7b8a2f 100644 --- a/code/modules/events/wizard/shuffle.dm +++ b/code/modules/events/wizard/shuffle.dm @@ -87,7 +87,7 @@ var/list/mobs_to_swap = list() for(var/mob/living/carbon/human/alive_human in GLOB.alive_mob_list) - if(alive_human.stat != CONSCIOUS || !alive_human.mind || IS_WIZARD(alive_human)) + if(alive_human.stat != CONSCIOUS || isnull(alive_human.mind) || IS_WIZARD(alive_human) || HAS_TRAIT(alive_human, TRAIT_NO_MINDSWAP)) continue //the wizard(s) are spared on this one mobs_to_swap += alive_human diff --git a/code/modules/spells/spell_types/pointed/mind_transfer.dm b/code/modules/spells/spell_types/pointed/mind_transfer.dm index 08c638ffe07..72441362b65 100644 --- a/code/modules/spells/spell_types/pointed/mind_transfer.dm +++ b/code/modules/spells/spell_types/pointed/mind_transfer.dm @@ -55,9 +55,19 @@ if(!isliving(cast_on)) to_chat(owner, span_warning("You can only swap minds with living beings!")) return FALSE + + if(HAS_TRAIT(cast_on, TRAIT_MIND_TEMPORARILY_GONE)) + to_chat(owner, span_warning("This creature's mind is somewhere else entirely!")) + return FALSE + + if(HAS_TRAIT(cast_on, TRAIT_NO_MINDSWAP)) + to_chat(owner, span_warning("This type of magic can't operate on [cast_on.p_their()] mind!")) + return FALSE + if(is_type_in_typecache(cast_on, blacklisted_mobs)) to_chat(owner, span_warning("This creature is too [pick("powerful", "strange", "arcane", "obscene")] to control!")) return FALSE + if(isguardian(cast_on)) var/mob/living/simple_animal/hostile/guardian/stand = cast_on if(stand.summoner && stand.summoner == owner)