mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-22 05:25:15 +01:00
Prevents Mindswapping on Bitrunners (#79323)
## About The Pull Request Fixes #79310 Adds a new trait to prevent mindswaps (which is just useful for any future cases when we don't wanna rely on the blacklist typecache) while also accounting for bitrunners (who you can't mindswap because their mind is elsewhere) and their avatars (because that's not a real mind now is it). this does mean that bitrunners while bitrunning are immune to all mindswaps but i don't have a good answer on how to fix it. i don't even much like the idea of VR but I think that having these traits are useful enough for future utilization. ## Why It's Good For The Game prevent big breakage. ## Changelog 🆑 fix: Bitrunners can no longer get mass-mindswapped out of their avatar when the wizard does the event. Something about machinery and magic not going well together. /🆑
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user