From 2e7c83866c16f9324880273beec3ac35e524b449 Mon Sep 17 00:00:00 2001 From: Contrabang <91113370+Contrabang@users.noreply.github.com> Date: Mon, 24 Jul 2023 10:36:42 -0400 Subject: [PATCH] Fixes headrevs being able to be mindshielded (#21714) * VIVAAAAA * sirryan review --- .../objects/items/weapons/implants/implant.dm | 17 ++++++++++++++++- .../weapons/implants/implant_mindshield.dm | 7 +++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index 2017fb294f0..cf19adbd0e6 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -160,7 +160,9 @@ * -1 if the implant fails to inject * 0 if there's no room for the implant. */ -/obj/item/implant/proc/implant(mob/source, mob/user) +/obj/item/implant/proc/implant(mob/source, mob/user, force) + if(!force && !can_implant(source, user)) + return var/obj/item/implant/imp_e = locate(type) in source if(!allow_multiple && imp_e && imp_e != src) if(imp_e.uses < initial(imp_e.uses)*2) @@ -200,6 +202,19 @@ return 1 +/** + * Check that we can actually implant this before implanting it + * * source - The person being implanted + * * user - The person doing the implanting + * + * Returns + * TRUE - I could care less, implant it, maybe don't. I don't care. + * FALSE - Don't implant! + */ +/obj/item/implant/proc/can_implant(mob/source, mob/user) + return TRUE + + /** * Clean up when an implant is removed. * * source - the user who the implant was removed from. diff --git a/code/game/objects/items/weapons/implants/implant_mindshield.dm b/code/game/objects/items/weapons/implants/implant_mindshield.dm index a2b8fea7055..9ca982c5074 100644 --- a/code/game/objects/items/weapons/implants/implant_mindshield.dm +++ b/code/game/objects/items/weapons/implants/implant_mindshield.dm @@ -6,6 +6,13 @@ implant_data = /datum/implant_fluff/mindshield implant_state = "implant-nanotrasen" +/obj/item/implant/mindshield/can_implant(mob/source, mob/user) + if(source.mind in SSticker.mode.head_revolutionaries) + source.visible_message("[source] seems to resist [src]!", + "You feel something interfering with your mental conditioning, but you resist it!") + return FALSE + return ..() + /obj/item/implant/mindshield/implant(mob/target) if(!..()) return FALSE