Files
Bubberstation/code/game/objects/items/implants/implant_mindshield.dm
SkyratBot ec09510459 Bools and returns super-pr (#53221) (#565)
Replaces like 70-80% of 0 and such, as a side effect cleaned up a bunch of returns
Edit: Most left out ones are in mecha which should be done in mecha refactor already
Oh my look how clean it is

Co-authored-by: TiviPlus <TiviPlus>
Co-authored-by: Couls <coul422@gmail.com>

Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
Co-authored-by: Couls <coul422@gmail.com>
2020-08-30 05:12:59 +02:00

73 lines
3.0 KiB
Plaintext

/obj/item/implant/mindshield
name = "mindshield implant"
desc = "Protects against brainwashing."
activated = 0
/obj/item/implant/mindshield/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
<b>Name:</b> Nanotrasen Employee Management Implant<BR>
<b>Life:</b> Ten years.<BR>
<b>Important Notes:</b> Personnel injected with this device are much more resistant to brainwashing.<BR>
<HR>
<b>Implant Details:</b><BR>
<b>Function:</b> Contains a small pod of nanobots that protects the host's mental functions from manipulation.<BR>
<b>Special Features:</b> Will prevent and cure most forms of brainwashing.<BR>
<b>Integrity:</b> Implant will last so long as the nanobots are inside the bloodstream."}
return dat
/obj/item/implant/mindshield/implant(mob/living/target, mob/user, silent = FALSE, force = FALSE)
if(..())
if(!target.mind)
ADD_TRAIT(target, TRAIT_MINDSHIELD, "implant")
target.sec_hud_set_implants()
return TRUE
var/deconverted = FALSE
if(target.mind.has_antag_datum(/datum/antagonist/brainwashed))
target.mind.remove_antag_datum(/datum/antagonist/brainwashed)
deconverted = TRUE
if(target.mind.has_antag_datum(/datum/antagonist/rev/head)|| target.mind.unconvertable)
if(!silent)
target.visible_message("<span class='warning'>[target] seems to resist the implant!</span>", "<span class='warning'>You feel something interfering with your mental conditioning, but you resist it!</span>")
removed(target, 1)
qdel(src)
return TRUE //the implant is still used
var/datum/antagonist/rev/rev = target.mind.has_antag_datum(/datum/antagonist/rev)
if(rev)
deconverted = TRUE
rev.remove_revolutionary(FALSE, user)
if(!silent)
if(target.mind in SSticker.mode.cult)
to_chat(target, "<span class='warning'>You feel something interfering with your mental conditioning, but you resist it!</span>")
else
to_chat(target, "<span class='notice'>You feel a sense of peace and security. You are now protected from brainwashing.</span>")
ADD_TRAIT(target, TRAIT_MINDSHIELD, "implant")
target.sec_hud_set_implants()
if(deconverted)
if(prob(1) || SSevents.holidays && SSevents.holidays[APRIL_FOOLS])
target.say("I'm out! I quit! Whose kidneys are these?", forced = "They're out! They quit! Whose kidneys do they have?")
return TRUE
return FALSE
/obj/item/implant/mindshield/removed(mob/target, silent = FALSE, special = 0)
if(..())
if(isliving(target))
var/mob/living/L = target
REMOVE_TRAIT(L, TRAIT_MINDSHIELD, "implant")
L.sec_hud_set_implants()
if(target.stat != DEAD && !silent)
to_chat(target, "<span class='boldnotice'>Your mind suddenly feels terribly vulnerable. You are no longer safe from brainwashing.</span>")
return TRUE
return FALSE
/obj/item/implanter/mindshield
name = "implanter (mindshield)"
imp_type = /obj/item/implant/mindshield
/obj/item/implantcase/mindshield
name = "implant case - 'Mindshield'"
desc = "A glass case containing a mindshield implant."
imp_type = /obj/item/implant/mindshield