From b8c95c9f0c409bc01580e700dbb1a99e5ebb603d Mon Sep 17 00:00:00 2001
From: adacovsk <94659603+adacovsk@users.noreply.github.com>
Date: Fri, 3 Jun 2022 21:49:12 -0400
Subject: [PATCH] Refactor tinfoil hat snowflake code (#32664)
* replace
* fixed
* Update powers.dm
* M_PSY_RESIST refactors
* argh
* Update powers.dm
* Update teleport.dm
* Update teleport.dm
* turn into proc
remove digital camo
turn everything into can_mind_interact
* seems to work
* Update misc_special.dm
* Update misc_special.dm
* Update mob.dm
* Update mob.dm
* Update mob.dm
* Update teleport.dm
* Update teleport.dm
* Update teleport.dm
* Update teleport.dm
* PSY to interference
* Update goon_powers.dm
* changing the name again
* telepathy blocked again
---
__DEFINES/setup.dm | 2 +-
code/datums/gamemode/powers/changeling.dm | 5 +-
code/game/data_huds.dm | 5 +-
code/game/dna/genes/goon_powers.dm | 16 +-
code/game/dna/genes/powers.dm | 29 ++--
code/game/gamemodes/setupgame.dm | 4 +-
code/game/machinery/camera/tracking.dm | 21 +--
code/game/machinery/mind_machine.dm | 2 +-
.../objects/items/weapons/dna_injector.dm | 22 +--
.../human/life/handle_regular_hud_updates.dm | 2 +-
code/modules/mob/living/carbon/species.dm | 7 +-
.../simple_animal/hostile/human/grey.dm | 147 ++++++++----------
.../simple_animal/hostile/human/halloween.dm | 4 +-
code/modules/mob/mob.dm | 36 +++--
code/modules/mob/mob_defines.dm | 2 -
code/modules/spells/targeted/targeted.dm | 17 +-
maps/randomvaults/dungeons/research.dmm | 2 +-
17 files changed, 138 insertions(+), 185 deletions(-)
diff --git a/__DEFINES/setup.dm b/__DEFINES/setup.dm
index 66189cc1b36..79d7679fef5 100644
--- a/__DEFINES/setup.dm
+++ b/__DEFINES/setup.dm
@@ -474,7 +474,7 @@ var/global/list/BODY_COVER_VALUE_LIST=list("[HEAD]" = COVER_PROTECTION_HEAD,"[EY
#define M_TOXIC_FARTS 201 // Duh
#define M_STRONG 202 // (Nothing)
#define M_SOBER 203 // Increased alcohol metabolism
-#define M_PSY_RESIST 204 // Block remoteview
+#define M_JAMSIGNALS 204 // Block EMFs
#define M_SUPER_FART 205 // Duh
#define M_SMILE 206 // :)
#define M_ELVIS 207 // You ain't nothin' but a hound dog.
diff --git a/code/datums/gamemode/powers/changeling.dm b/code/datums/gamemode/powers/changeling.dm
index 6a9e9e84814..fff4506d3f2 100644
--- a/code/datums/gamemode/powers/changeling.dm
+++ b/code/datums/gamemode/powers/changeling.dm
@@ -211,20 +211,19 @@
if(changeling)
changeling.chem_storage += 25
-/datum/power/changeling/DigitalCamoflague
+/datum/power/changeling/DigitalCamouflage
name = "Digital Camouflage"
desc = "We evolve the ability to distort our form and proportions, defeating common algorithms used to detect lifeforms on cameras."
cost = 2
allowduringlesserform = 1
allowduringhorrorform = 0
-/datum/power/changeling/DigitalCamoflague/add_power(var/datum/role/R)
+/datum/power/changeling/DigitalCamouflage/add_power(var/datum/role/R)
. = ..()
if (!.)
return
var/mob/living/carbon/human/C = R.antag.current
to_chat(C, "We distort our form to prevent AI-tracking.")
- C.digitalcamo = 1
/datum/power/changeling/rapidregeneration
name = "Rapid Regeneration"
diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm
index ce0a33af49a..f04c45d5e67 100644
--- a/code/game/data_huds.dm
+++ b/code/game/data_huds.dm
@@ -89,8 +89,7 @@ the HUD updates properly! */
for(var/mob/living/carbon/patient in range(C.view+DATAHUD_RANGE_OVERHEAD,T))
if (ishuman(patient))
- var/mob/living/carbon/human/H = patient
- if(H.head && istype(H.head,/obj/item/clothing/head/tinfoil)) //Tinfoil hat? Move along.
+ if(!can_mind_interact(patient.mind)) //Tinfoil hat? Move along.
continue
if(!check_HUD_visibility(patient, M))
continue
@@ -181,7 +180,7 @@ the HUD updates properly! */
if(!holder)
continue
holder.icon_state = "hudno_id"
- if(perp.head && istype(perp.head,/obj/item/clothing/head/tinfoil)) //Tinfoil hat? Move along.
+ if(!can_mind_interact(perp.mind)) //Tinfoil hat? Move along.
C.images += holder
continue
var/obj/item/weapon/card/id/card = perp.get_id_card()
diff --git a/code/game/dna/genes/goon_powers.dm b/code/game/dna/genes/goon_powers.dm
index a157aadda9d..bc72cd50798 100644
--- a/code/game/dna/genes/goon_powers.dm
+++ b/code/game/dna/genes/goon_powers.dm
@@ -12,16 +12,16 @@
block = SOBERBLOCK
//WAS: /datum/bioEffect/psychic_resist
-/datum/dna/gene/basic/psychic_resist
- name = "Psy-Resist"
- desc = "Boosts efficiency in sectors of the brain commonly associated with meta-mental energies."
- activation_messages = list("Your mind feels closed.")
+/datum/dna/gene/basic/jamsignals
+ name = "Signal Jam"
+ desc = "Creates an invisible shield around your body, protecting you from harmful electromagnetic radiation."
+ activation_messages = list("Your body and mind feel shielded.")
deactivation_messages = list("You feel oddly exposed.")
- mutation = M_PSY_RESIST
+ mutation = M_JAMSIGNALS
-/datum/dna/gene/basic/psychic_resist/New()
- block = PSYRESISTBLOCK
+/datum/dna/gene/basic/jamsignals/New()
+ block = JAMSIGNALSBLOCK
/////////////////////////
// Stealth Enhancers
@@ -614,7 +614,7 @@
to_chat(user, "This can only be used on carbon beings.")
return 1
- if (M_PSY_RESIST in M.mutations)
+ if (!can_mind_interact(M.mind))
to_chat(user, "You can't see into [M.name]'s mind at all!")
return 1
diff --git a/code/game/dna/genes/powers.dm b/code/game/dna/genes/powers.dm
index d8080960769..7b23f02ddae 100644
--- a/code/game/dna/genes/powers.dm
+++ b/code/game/dna/genes/powers.dm
@@ -72,13 +72,8 @@
user.reset_view(0)
return
- for(var/T in targets)
- var/mob/living/target
- if (isliving(T))
- target = T
- if (istype (T, /datum/mind))
- target = user.can_mind_interact(T)
- if(target)
+ for(var/mob/living/target in targets)
+ if (can_mind_interact(target.mind))
user.remoteview_target = target
user.reset_view(target)
break
@@ -155,19 +150,17 @@
M.telepathic_target.len = 0
var/all_switch = TRUE
- for(var/T in targets)
- var/mob/living/target
- if (isliving(T))
- target = T
- if (istype (T, /datum/mind))
- target = user.can_mind_interact(T)
- if(!T || !istype(target) || tinfoil_check(target) || !user.can_mind_interact(target))
- user.show_message("You are unable to use telepathy with [target].")
+ for(var/mob/living/T in targets)
+ if(!istype(T) && !can_mind_interact(T.mind))
+ to_chat(M,"[T] cannot sense your telepathy.")
continue
- else if(istype(M))
- M.telepathic_target += target
+ if(istype(M))
+ M.telepathic_target += T
continue
- if(M_TELEPATHY in target.mutations)
+ if(T == user) //Talking to ourselves
+ to_chat(user,"Projected to self: [message]")
+ return
+ if(M_TELEPATHY in T.mutations)
to_chat(T, "You hear [user.real_name]'s voice: [message]")
else
to_chat(T,"You hear a voice inside your head: [message] ")
diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm
index 59e9b1c18c2..7853b0dffac 100644
--- a/code/game/gamemodes/setupgame.dm
+++ b/code/game/gamemodes/setupgame.dm
@@ -49,7 +49,7 @@ var/ELVISBLOCK = 0
// Powers
var/SOBERBLOCK = 0
-var/PSYRESISTBLOCK = 0
+var/JAMSIGNALSBLOCK = 0
var/STRONGBLOCK = 0
//var/SHADOWBLOCK = 0
var/FARSIGHTBLOCK = 0
@@ -159,7 +159,7 @@ var/LACTOSEBLOCK = 0
// Powers
SOBERBLOCK = getAssignedBlock("SOBER", numsToAssign, DNA_HARD_BOUNDS, good=1)
- PSYRESISTBLOCK = getAssignedBlock("PSYRESIST", numsToAssign, DNA_HARD_BOUNDS, good=1)
+ JAMSIGNALSBLOCK = getAssignedBlock("JAMSIGNALS", numsToAssign, DNA_HARD_BOUNDS, good=1)
//SHADOWBLOCK = getAssignedBlock("SHADOW", numsToAssign, DNA_HARDER_BOUNDS, good=1)
FARSIGHTBLOCK = getAssignedBlock("FARSIGHT", numsToAssign, DNA_HARDER_BOUNDS, good=1)
CHAMELEONBLOCK = getAssignedBlock("CHAMELEON", numsToAssign, DNA_HARDER_BOUNDS, good=1)
diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm
index 5879db26ab1..0a02286347b 100644
--- a/code/game/machinery/camera/tracking.dm
+++ b/code/game/machinery/camera/tracking.dm
@@ -156,26 +156,9 @@
return FALSE
if(ismob(target))
- var/mob/target_mob = target
- if(target_mob.digitalcamo)
+ var/mob/M = target
+ if(!can_mind_interact(M.mind))
return FALSE
-
- if(ishuman(target))
- var/mob/living/carbon/human/target_human = target
- if(target_human.wear_id && istype(target_human.wear_id.GetID(), /obj/item/weapon/card/id/syndicate))
- return FALSE
- if(target_human.is_wearing_item(/obj/item/clothing/mask/gas/voice))
- return FALSE
- if(target_human.is_wearing_item(/obj/item/clothing/gloves/ninja))
- return FALSE
- if(target_human.is_wearing_item(/obj/item/clothing/head/tinfoil))
- return FALSE
- if(target_human.is_holding_item(/obj/item/device/megaphone/madscientist))
- return FALSE
-
- if(isalien(target))
- return FALSE
-
if(istype(target.loc, /obj/effect/dummy))
return FALSE
diff --git a/code/game/machinery/mind_machine.dm b/code/game/machinery/mind_machine.dm
index 060d85f4270..667a5103777 100644
--- a/code/game/machinery/mind_machine.dm
+++ b/code/game/machinery/mind_machine.dm
@@ -354,7 +354,7 @@
if(is_type_in_list(S, illegalSwap) || is_type_in_list(S, illegalSwap))
MT = MINDMACHINE_SHIELDED
if((ishigherbeing(S)) || (ismonkey(S)))
- if(S.is_wearing_any(list(/obj/item/clothing/head/tinfoil,/obj/item/clothing/head/helmet/stun), slot_head))
+ if(!can_mind_interact(S.mind))
MT = MINDMACHINE_SHIELDED
if(S == occupantOne)
mindTypeOne = MT
diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm
index 258cb4fd6bd..307e86e4450 100644
--- a/code/game/objects/items/weapons/dna_injector.dm
+++ b/code/game/objects/items/weapons/dna_injector.dm
@@ -500,27 +500,27 @@
block = SOBERBLOCK
..()
-/obj/item/weapon/dnainjector/nofail/psychic_resist
- name = "DNA-Injector (Psychic Resist)"
- desc = "Not today, mind hippies."
+/obj/item/weapon/dnainjector/nofail/jamsignals
+ name = "DNA-Injector (Jam Signals)"
+ desc = "Hidden in plain sight"
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 2
-/obj/item/weapon/dnainjector/nofail/psychic_resist/initialize()
- block = PSYRESISTBLOCK
+/obj/item/weapon/dnainjector/nofail/JAMSIGNALS/initialize()
+ block = JAMSIGNALSBLOCK
..()
-/obj/item/weapon/dnainjector/nofail/antipsychic_resist
- name = "DNA-Injector (Anti-Psychic Resist)"
- desc = "Im thinking about furry porn 24/7. Come at me, faggots."
+/obj/item/weapon/dnainjector/nofail/antijamsignals
+ name = "DNA-Injector (Anti-Jamming)"
+ desc = "There are eyes everywhere"
datatype = DNA2_BUF_SE
value = 0x001
//block = 2
-/obj/item/weapon/dnainjector/nofail/antipsychic_resist/initialize()
- block = PSYRESISTBLOCK
+/obj/item/weapon/dnainjector/nofail/antijamsignals/initialize()
+ block = JAMSIGNALSBLOCK
..()
/*/obj/item/weapon/dnainjector/nofail/darkcloak
@@ -1380,7 +1380,7 @@
/obj/item/weapon/dnainjector/nofail/insulation,
/obj/item/weapon/dnainjector/nofail/midgit,
/obj/item/weapon/dnainjector/nofail/sober,
- /obj/item/weapon/dnainjector/nofail/psychic_resist,
+ /obj/item/weapon/dnainjector/nofail/jamsignals,
/obj/item/weapon/dnainjector/nofail/chameleon,
/obj/item/weapon/dnainjector/nofail/cryo,
/obj/item/weapon/dnainjector/nofail/mattereater,
diff --git a/code/modules/mob/living/carbon/human/life/handle_regular_hud_updates.dm b/code/modules/mob/living/carbon/human/life/handle_regular_hud_updates.dm
index cdbca3e276f..54f1ac080be 100644
--- a/code/modules/mob/living/carbon/human/life/handle_regular_hud_updates.dm
+++ b/code/modules/mob/living/carbon/human/life/handle_regular_hud_updates.dm
@@ -279,7 +279,7 @@
isRemoteObserve = 0
//Does he have psy resist?
- if(M_PSY_RESIST in remoteview_target.mutations)
+ if(!can_mind_interact(remoteview_target.mind))
to_chat(src, "Your mind is shut out!")
isRemoteObserve = 0
diff --git a/code/modules/mob/living/carbon/species.dm b/code/modules/mob/living/carbon/species.dm
index 0c45e16a219..ae03a619a2d 100644
--- a/code/modules/mob/living/carbon/species.dm
+++ b/code/modules/mob/living/carbon/species.dm
@@ -1357,8 +1357,11 @@ var/list/has_died_as_golem = list()
var/all_switch = TRUE
for(var/mob/living/T in telepathic_target)
- if(istype(T) && M.can_mind_interact(T))
- to_chat(T,"You feel [M]'s thoughts: [message]")
+ if(istype(T) && can_mind_interact(T.mind))
+ to_chat(T,"You feel [M]'s thoughts: [message]")
+ else
+ to_chat(M,"[T] cannot sense your telepathy.")
+ continue
if(all_switch)
all_switch = FALSE
if(T != M)
diff --git a/code/modules/mob/living/simple_animal/hostile/human/grey.dm b/code/modules/mob/living/simple_animal/hostile/human/grey.dm
index aa867ebc76b..cbe9deb9e03 100644
--- a/code/modules/mob/living/simple_animal/hostile/human/grey.dm
+++ b/code/modules/mob/living/simple_animal/hostile/human/grey.dm
@@ -728,32 +728,31 @@
/mob/living/simple_animal/hostile/humanoid/grey/researcher/surgeon/Shoot()
var/mob/living/carbon/human/H = target
- if(H.isUnconscious() || H.is_wearing_item(/obj/item/clothing/head/tinfoil) || (M_PSY_RESIST in H.mutations)) // Psy-attacks don't work if the target is unconsious, wearing a tin foil hat, or has genetic resistance
+ if(can_mind_interact(H.mind)) // Psy-attacks don't work if the target is unconsious, wearing a tin foil hat, or has genetic resistance
return
- else
- switch(rand(0,4))
- if(0) //Minor brain damage
- to_chat(H, "You get a blindingly painful headache.")
- H.adjustBrainLoss(10)
- H.eye_blurry = max(H.eye_blurry, 5)
- if(1) //Brief knockdown
- to_chat(H, "You suddenly lose your sense of balance!")
- H.emote("me", 1, "collapses!")
- H.Knockdown(2)
- if(2) //Target gets put to sleep for a few seconds
- to_chat(H, "You feel exhausted...")
- H.drowsyness += 4
- spawn(2 SECONDS)
- H.sleeping += 3
- if(3) //Minor hallucinations and jittering
- to_chat(H, "Your mind feels less stable, and you feel nervous.")
- H.hallucination += 60 // For some reason it has to be this high at least or seemingly nothing happens
- H.Jitter(20)
- H.stuttering += 20
- if(4) //Ranged disarm
- to_chat(H, "Your arm jerks involuntarily, and you drop what you're holding!")
- H.drop_item()
- return 1
+ switch(rand(0,4))
+ if(0) //Minor brain damage
+ to_chat(H, "You get a blindingly painful headache.")
+ H.adjustBrainLoss(10)
+ H.eye_blurry = max(H.eye_blurry, 5)
+ if(1) //Brief knockdown
+ to_chat(H, "You suddenly lose your sense of balance!")
+ H.emote("me", 1, "collapses!")
+ H.Knockdown(2)
+ if(2) //Target gets put to sleep for a few seconds
+ to_chat(H, "You feel exhausted...")
+ H.drowsyness += 4
+ spawn(2 SECONDS)
+ H.sleeping += 3
+ if(3) //Minor hallucinations and jittering
+ to_chat(H, "Your mind feels less stable, and you feel nervous.")
+ H.hallucination += 60 // For some reason it has to be this high at least or seemingly nothing happens
+ H.Jitter(20)
+ H.stuttering += 20
+ if(4) //Ranged disarm
+ to_chat(H, "Your arm jerks involuntarily, and you drop what you're holding!")
+ H.drop_item()
+ return 1
/mob/living/simple_animal/hostile/humanoid/grey/researcher/surgeon/Aggro()
..()
@@ -866,64 +865,48 @@
M.throw_at(target_turf,100,telekinesis_throw_speed)
/mob/living/simple_animal/hostile/humanoid/grey/leader/Shoot()
- if(last_psychicattack + psychicattack_cooldown < world.time)
- var/list/victims = list()
- for(var/mob/living/carbon/human/H in view(src, psychic_range))
- victims.Add(H)
-
- if(!victims.len)
- return
- switch(rand(0,4))
- if(0) //Brain damage, confusion, and dizziness
- for(var/mob/living/carbon/human/H in victims)
- if(H.isUnconscious() || H.is_wearing_item(/obj/item/clothing/head/tinfoil) || (M_PSY_RESIST in H.mutations)) // Psy-attacks don't work if the target is unconsious, wearing a tin foil hat, or has genetic resistance
- continue
- to_chat(H, "An unbearable pain stabs into your mind!")
- H.adjustBrainLoss(20)
- H.eye_blurry = max(H.eye_blurry, 10)
- H.confused += 10
- H.dizziness += 10
- last_psychicattack = world.time
- if(prob(25))
- H.audible_scream()
- if(1) //A knockdown, with some dizziness
- for(var/mob/living/carbon/human/H in victims)
- if(H.isUnconscious() || H.is_wearing_item(/obj/item/clothing/head/tinfoil) || (M_PSY_RESIST in H.mutations)) // Psy-attacks don't work if the target is unconsious, wearing a tin foil hat, or has genetic resistance
- continue
- to_chat(H, "You suddenly lose your sense of balance!")
- H.emote("me", 1, "collapses!")
- H.Knockdown(4)
- H.confused += 6
- H.dizziness += 6
- last_psychicattack = world.time
- if(2) //Naptime
- for(var/mob/living/carbon/human/H in victims)
- if(H.isUnconscious() || H.is_wearing_item(/obj/item/clothing/head/tinfoil) || (M_PSY_RESIST in H.mutations)) // Psy-attacks don't work if the target is unconsious, wearing a tin foil hat, or has genetic resistance
- continue
- to_chat(H, "You feel exhausted beyond belief. You can't keep your eyes open...")
- H.drowsyness += 6
- last_psychicattack = world.time
- spawn(2 SECONDS)
- H.sleeping += 5
- if(3) //Serious hallucinations and jittering
- for(var/mob/living/carbon/human/H in victims)
- if(H.isUnconscious() || H.is_wearing_item(/obj/item/clothing/head/tinfoil) || (M_PSY_RESIST in H.mutations)) // Psy-attacks don't work if the target is unconsious, wearing a tin foil hat, or has genetic resistance
- continue
- to_chat(H, "Your mind feels much less stable, and you feel a terrible dread.")
- H.hallucination += 75
- H.Jitter(30)
- H.stuttering += 30
- last_psychicattack = world.time
- if(4) //Brief period of pacification
- for(var/mob/living/carbon/human/H in victims)
- if(H.isUnconscious() || H.is_wearing_item(/obj/item/clothing/head/tinfoil) || (M_PSY_RESIST in H.mutations)) // Psy-attacks don't work if the target is unconsious, wearing a tin foil hat, or has genetic resistance
- continue
- to_chat(H, "You feel strangely calm and passive. What's the point in fighting?")
- H.reagents.add_reagent(CHILLWAX, 1)
- last_psychicattack = world.time
-
- if(!last_psychicattack + psychicattack_cooldown < world.time) // If not done cooling down from the previous psychic attack, just shoot a laser beem
+ // If not done cooling down from the previous psychic attack, just shoot a laser beem
+ if(last_psychicattack + psychicattack_cooldown > world.time)
..()
+ return
+ var/list/victims = list()
+ for(var/mob/living/carbon/human/H in view(src, psychic_range))
+ victims.Add(H)
+ if(!victims.len)
+ return
+ var/shot_choice = rand(0,4)
+ for(var/mob/living/carbon/human/H in victims)
+ if(!can_mind_interact(H.mind))
+ continue
+ switch(shot_choice)
+ if(0) //Brain damage, confusion, and dizziness
+ to_chat(H, "An unbearable pain stabs into your mind!")
+ H.adjustBrainLoss(20)
+ H.eye_blurry = max(H.eye_blurry, 10)
+ H.confused += 10
+ H.dizziness += 10
+ if(prob(25))
+ H.audible_scream()
+ if(1) //A knockdown, with some dizziness
+ to_chat(H, "You suddenly lose your sense of balance!")
+ H.emote("me", 1, "collapses!")
+ H.Knockdown(4)
+ H.confused += 6
+ H.dizziness += 6
+ if(2) //Naptime
+ to_chat(H, "You feel exhausted beyond belief. You can't keep your eyes open...")
+ H.drowsyness += 6
+ spawn(2 SECONDS)
+ H.sleeping += 5
+ if(3) //Serious hallucinations and jittering
+ to_chat(H, "Your mind feels much less stable, and you feel a terrible dread.")
+ H.hallucination += 75
+ H.Jitter(30)
+ H.stuttering += 30
+ if(4) //Brief period of pacification
+ to_chat(H, "You feel strangely calm and passive. What's the point in fighting?")
+ H.reagents.add_reagent(CHILLWAX, 1)
+ last_psychicattack = world.time
/mob/living/simple_animal/hostile/humanoid/grey/leader/bullet_act(var/obj/item/projectile/P) // Lasers have a 50% chance to reflect off the armor, which matches up if the player takes it and puts it on
if(istype(P, /obj/item/projectile/energy) || istype(P, /obj/item/projectile/beam) || istype(P, /obj/item/projectile/forcebolt) || istype(P, /obj/item/projectile/change))
diff --git a/code/modules/mob/living/simple_animal/hostile/human/halloween.dm b/code/modules/mob/living/simple_animal/hostile/human/halloween.dm
index 5ae3a0c8539..6f68ab42461 100644
--- a/code/modules/mob/living/simple_animal/hostile/human/halloween.dm
+++ b/code/modules/mob/living/simple_animal/hostile/human/halloween.dm
@@ -626,9 +626,7 @@
switch(spell)
if(1) //Mass Hallucination
for(var/mob/living/carbon/human/H in victims)
- if(H.is_wearing_any(list(/obj/item/clothing/head/tinfoil,/obj/item/clothing/head/helmet/stun), slot_head))
- continue
- if(M_PSY_RESIST in H.mutations)
+ if(!can_mind_interact(H.mind))
continue
to_chat(H, "You feel [diceroll>15 ? "incredibly" : ""] disorientated.")
H.hallucination += rand(10,20)*diceroll
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 36d8e66ebd3..f2554e8c2c8 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -2177,7 +2177,7 @@ Use this proc preferably at the end of an equipment loadout
/mob/proc/attempt_crawling(var/turf/target)
return FALSE
-/mob/proc/can_mind_interact(var/datum/mind/target_mind)
+/proc/can_mind_interact(var/datum/mind/target_mind)
var/mob/living/target
if(isliving(target_mind))
target = target_mind
@@ -2187,26 +2187,32 @@ Use this proc preferably at the end of an equipment loadout
target = target_mind.current
if (!istype(target))
return null
- var/turf/target_turf = get_turf(target)
- var/turf/our_turf = get_turf(src)
- if(!target_turf)
+ if(M_JAMSIGNALS in target.mutations)
return null
- if (target.isDead())
- to_chat(src, "You cannot sense the target mind anymore, that's not good...")
+ if(isalien(target))
return null
- if(target_turf.z != our_turf.z) //Not on the same zlevel as us
- to_chat(src, "The target mind is too faint, they must be quite far from you...")
+ if(target.is_wearing_item(/obj/item/clothing/mask/gas/voice))
return null
- if(target.stat != CONSCIOUS)
- to_chat(src, "The target mind is too faint, but still close, they must be unconscious...")
+ if(target.is_wearing_item(/obj/item/clothing/head/helmet/stun/))
return null
- if(M_PSY_RESIST in target.mutations)
- to_chat(src, "The target mind is resisting!")
+ if(target.is_wearing_item(/obj/item/clothing/gloves/ninja))
return null
- if(target.is_wearing_any(list(/obj/item/clothing/head/helmet/space/martian,/obj/item/clothing/head/tinfoil,/obj/item/clothing/head/helmet/stun), slot_head))
- to_chat(src, "Interference is disrupting the connection with the target mind.")
+ if(target.is_wearing_item(/obj/item/clothing/head/tinfoil))
return null
- return target
+ if(target.is_wearing_item(/obj/item/clothing/head/helmet/space/martian))
+ return null
+ if(target.is_holding_item(/obj/item/device/megaphone/madscientist))
+ return null
+ var/mob/living/carbon/human/H = target
+ if(istype(H))
+ if(H.wear_id && istype(H.wear_id.GetID(), /obj/item/weapon/card/id/syndicate))
+ return null
+ var/datum/role/changeling/C = target.mind.GetRole(CHANGELING)
+ if(istype(C))
+ if(locate(/datum/power/changeling/DigitalCamouflage) in C.current_powers)
+ return null
+
+ return TRUE
/mob/proc/canMouseDrag()//used mostly to check if the mob can drag'and'drop stuff in/out of various other stuff, such as disposals, cryo tubes, etc.
return TRUE
diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm
index 86321e6aa22..590891298fe 100644
--- a/code/modules/mob/mob_defines.dm
+++ b/code/modules/mob/mob_defines.dm
@@ -232,8 +232,6 @@
var/status_flags = CANSTUN|CANKNOCKDOWN|CANPARALYSE|CANPUSH //bitflags defining which status effects can be inflicted (replaces CANKNOCKDOWN, canstun, etc)
- var/digitalcamo = 0 // Can they be tracked by the AI?
-
var/list/radar_blips = list() // list of screen objects, radar blips
var/radar_open = 0 // nonzero is radar is open
diff --git a/code/modules/spells/targeted/targeted.dm b/code/modules/spells/targeted/targeted.dm
index 5adc95814aa..08630f4028d 100644
--- a/code/modules/spells/targeted/targeted.dm
+++ b/code/modules/spells/targeted/targeted.dm
@@ -39,13 +39,13 @@ Targeted spells have two useful flags: INCLUDEUSER and SELECTABLE. These are exp
return 0
if(ismob(target) && mind_affecting)
var/mob/M = target
- if (!user.can_mind_interact(M.mind))
+ if (!can_mind_interact(M.mind))
return 0
return !compatible_mobs.len || is_type_in_list(target, compatible_mobs)
/spell/targeted/choose_targets(mob/user = usr)
- if(mind_affecting && tinfoil_check(user))
- to_chat(user, "Something is interfering with your ability to target minds.")
+ if(mind_affecting && !can_mind_interact(user.mind))
+ to_chat(user, "Interference is disrupting the connection with the target.")
return
var/list/targets = list()
if(max_targets == 0) //unlimited
@@ -96,7 +96,7 @@ Targeted spells have two useful flags: INCLUDEUSER and SELECTABLE. These are exp
continue
if(mind_affecting)
if(iscarbon(user))
- if(!M.mind || !user.can_mind_interact(M.mind))
+ if(!M.mind || !can_mind_interact(M.mind))
continue
possible_targets += M
@@ -185,12 +185,3 @@ Targeted spells have two useful flags: INCLUDEUSER and SELECTABLE. These are exp
target.confused += amt_confused
target.confused_intensity = CONFUSED_MAGIC
target.stuttering += amt_stuttering
-
-/spell/targeted/proc/tinfoil_check(mob/living/carbon/human/user)
- if(!istype(user))
- return 0
-
- if(user.is_wearing_any(list(/obj/item/clothing/head/tinfoil,/obj/item/clothing/head/helmet/stun), slot_head))
- return 1
-
- return 0
diff --git a/maps/randomvaults/dungeons/research.dmm b/maps/randomvaults/dungeons/research.dmm
index 1398f72aead..1f9bba4f41a 100644
--- a/maps/randomvaults/dungeons/research.dmm
+++ b/maps/randomvaults/dungeons/research.dmm
@@ -490,7 +490,7 @@
"NG" = (/obj/structure/bed/roller/surgery,/turf/simulated/floor{dir = 5; icon_state = "whitegreen"; tag = "icon-whitegreen (NORTHEAST)"},/area/vault/mothership_lab/research)
"NN" = (/obj/effect/decal/warning_stripes{icon_state = "unloading"},/obj/effect/decal/cleanable/blood/gibs/robot{icon_state = "gib3"},/turf/simulated/floor/plating{icon_state = "platingdmg1"; tag = ""},/area/vault/mothership_lab/research)
"NW" = (/obj/machinery/light/he{dir = 1},/turf/simulated/floor{icon_state = "showroomfloor"},/area/vault/mothership_lab/research)
-"Oe" = (/obj/item/weapon/storage/lockbox/diskettebox/open/cloning{pixel_x = 2; pixel_y = 2},/obj/structure/table/reinforced,/obj/item/weapon/dnainjector/nofail/elvis,/obj/item/weapon/dnainjector/nofail/empath,/obj/item/weapon/dnainjector/nofail/insulation,/obj/item/weapon/dnainjector/nofail/psychic_resist,/obj/item/weapon/dnainjector/nofail/telepathy,/obj/item/weapon/dnainjector/nofail/telepathy,/obj/item/weapon/dnainjector/nofail/strong,/obj/item/weapon/dnainjector/nofail/remoteview,/obj/item/weapon/dnainjector/nofail/regenerate,/obj/item/weapon/dnainjector/nofail/sweedish,/obj/machinery/camera{id_tag = "labcameras"; name = "Genetics Research North"; network = list("MOTHERSHIPLAB")},/obj/item/weapon/dnainjector/nofail/farsightmut,/obj/item/weapon/dnainjector/nofail/farsightmut,/obj/item/weapon/dnainjector/nofail/insulation,/turf/simulated/floor{icon_state = "dark vault full"},/area/vault/mothership_lab/research)
+"Oe" = (/obj/item/weapon/storage/lockbox/diskettebox/open/cloning{pixel_x = 2; pixel_y = 2},/obj/structure/table/reinforced,/obj/item/weapon/dnainjector/nofail/elvis,/obj/item/weapon/dnainjector/nofail/empath,/obj/item/weapon/dnainjector/nofail/insulation,/obj/item/weapon/dnainjector/nofail/interference,/obj/item/weapon/dnainjector/nofail/telepathy,/obj/item/weapon/dnainjector/nofail/telepathy,/obj/item/weapon/dnainjector/nofail/strong,/obj/item/weapon/dnainjector/nofail/remoteview,/obj/item/weapon/dnainjector/nofail/regenerate,/obj/item/weapon/dnainjector/nofail/sweedish,/obj/machinery/camera{id_tag = "labcameras"; name = "Genetics Research North"; network = list("MOTHERSHIPLAB")},/obj/item/weapon/dnainjector/nofail/farsightmut,/obj/item/weapon/dnainjector/nofail/farsightmut,/obj/item/weapon/dnainjector/nofail/insulation,/turf/simulated/floor{icon_state = "dark vault full"},/area/vault/mothership_lab/research)
"Of" = (/obj/structure/flora/pottedplant/random{icon_state = "plant-10"; tag = "icon-plant-10"},/turf/simulated/floor{dir = 1; icon_state = "darkred"},/area/vault/mothership_lab/research)
"Oi" = (/obj/structure/bed/chair/shuttle/gamer{dir = 4},/mob/living/simple_animal/hostile/humanoid/grey/researcher/surgeon{dir = 4},/turf/simulated/floor{icon_state = "dark vault full"},/area/vault/mothership_lab/research)
"Oj" = (/obj/structure/bed,/turf/simulated/floor{dir = 6; icon_state = "darkred"},/area/vault/mothership_lab/research)