Datumizes traitors and mindslaves (#11969)

This commit is contained in:
SteelSlayer
2019-09-21 18:50:03 -05:00
committed by variableundefined
parent eac649d5de
commit 94bb14bb29
15 changed files with 663 additions and 509 deletions
@@ -619,6 +619,7 @@
/obj/item/nullrod/missionary_staff/proc/do_convert(mob/living/carbon/human/target, mob/living/carbon/human/missionary)
var/convert_duration = 6000 //10 min
if(!target || !ishuman(target) || !missionary || !ishuman(missionary))
return
if(ismindslave(target) || target.mind.zealot_master) //mindslaves and zealots override the staff because the staff is just a temporary mindslave
@@ -17,64 +17,65 @@
return dat
/obj/item/implant/traitor/implant(mob/M, mob/user)
if(!M.mind) // If the target is catatonic or doesn't have a mind, don't let them use it
to_chat(user, "<span class='warning'><i>This person doesn't have a mind for you to slave!</i></span>")
return 0
if(!activated) //So you can't just keep taking it out and putting it back into other people.
var/mob/living/carbon/human/H = M
if(ismindslave(H))
H.visible_message("<span class='warning'>[H] seems to resist the implant!</span>", "<span class='warning'>You feel a strange sensation in your head that quickly dissipates.</span>")
var/mob/living/carbon/human/mindslave_target = M
if(ismindslave(mindslave_target))
mindslave_target.visible_message("<span class='warning'>[mindslave_target] seems to resist the implant!</span>", "<span class='warning'>You feel a strange sensation in your head that quickly dissipates.</span>")
qdel(src)
return -1
if(..())
var/list/implanters
var/ref = "\ref[user.mind]"
if(!ishuman(M))
if(!ishuman(mindslave_target))
return 0
if(!M.mind)
if(!mindslave_target.mind)
return 0
if(M == user)
if(mindslave_target == user)
to_chat(user, "<span class='notice'>Making yourself loyal to yourself was a great idea! Perhaps even the best idea ever! Actually, you just feel like an idiot.</span>")
if(isliving(user))
var/mob/living/L = user
L.adjustBrainLoss(20)
removed(M)
removed(mindslave_target)
qdel(src)
return -1
if(ismindshielded(mindslave_target))
mindslave_target.visible_message("<span class='warning'>[mindslave_target] seems to resist the implant!</span>", "<span class='warning'>You feel a strange sensation in your head that quickly dissipates.</span>")
removed(mindslave_target)
qdel(src)
return -1
if(ismindshielded(H))
H.visible_message("<span class='warning'>[H] seems to resist the implant!</span>", "<span class='warning'>You feel a strange sensation in your head that quickly dissipates.</span>")
removed(M)
qdel(src)
return -1
H.implanting = 1
to_chat(H, "<span class='notice'>You feel completely loyal to [user.name].</span>")
mindslave_target.implanting = 1
to_chat(mindslave_target, "<span class='notice'>You feel completely loyal to [user.name].</span>")
if(!(user.mind in SSticker.mode.implanter))
SSticker.mode.implanter[ref] = list()
implanters = SSticker.mode.implanter[ref]
implanters.Add(H.mind)
SSticker.mode.implanted.Add(H.mind)
SSticker.mode.implanted[H.mind] = user.mind
//SSticker.mode.implanter[user.mind] += H.mind
SSticker.mode.implanter[ref] = implanters
SSticker.mode.traitors += H.mind
H.mind.special_role = SPECIAL_ROLE_TRAITOR
to_chat(H, "<span class='warning'><B>You're now completely loyal to [user.name]!</B> You now must lay down your life to protect [user.p_them()] and assist in [user.p_their()] goals at any cost.</span>")
SSticker.mode.implanter[user.mind] = list()
implanters = SSticker.mode.implanter[user.mind]
implanters.Add(mindslave_target.mind)
SSticker.mode.implanted.Add(mindslave_target.mind)
SSticker.mode.implanted[mindslave_target.mind] = user.mind
SSticker.mode.implanter[user.mind] = implanters
SSticker.mode.traitors += mindslave_target.mind
to_chat(mindslave_target, "<span class='warning'><B>You're now completely loyal to [user.name]!</B> You now must lay down your life to protect [user.p_them()] and assist in [user.p_their()] goals at any cost.</span>")
var/datum/objective/protect/mindslave/MS = new
MS.owner = H.mind
MS.owner = mindslave_target.mind
MS.target = user.mind
MS.explanation_text = "Obey every order from and protect [user.real_name], the [user.mind.assigned_role == user.mind.special_role ? (user.mind.special_role) : (user.mind.assigned_role)]."
H.mind.objectives += MS
for(var/datum/objective/objective in H.mind.objectives)
to_chat(H, "<B>Objective #1</B>: [objective.explanation_text]")
var/datum/antagonist/mindslave/S = new()
S.add_objective(MS)
mindslave_target.mind.add_antag_datum(S)
SSticker.mode.update_traitor_icons_added(user.mind)
SSticker.mode.update_traitor_icons_added(H.mind)//handles datahuds/observerhuds
var/datum/mindslaves/slaved = user.mind.som
mindslave_target.mind.som = slaved
slaved.serv += mindslave_target
slaved.add_serv_hud(user.mind, "master") //handles master servent icons
slaved.add_serv_hud(mindslave_target.mind, "mindslave")
if(user.mind.som)//do not add if not a traitor..and you just picked up an implanter in the hall...
var/datum/mindslaves/slaved = user.mind.som
H.mind.som = slaved
slaved.serv += H
slaved.add_serv_hud(user.mind, "master") //handles master servent icons
slaved.add_serv_hud(H.mind, "mindslave")
log_admin("[key_name(user)] has mind-slaved [key_name(H)].")
log_admin("[key_name(user)] has mind-slaved [key_name(mindslave_target)].")
activated = 1
if(jobban_isbanned(M, ROLE_SYNDICATE))
SSticker.mode.replace_jobbanned_player(M, ROLE_SYNDICATE)
@@ -83,6 +84,7 @@
/obj/item/implant/traitor/removed(mob/target)
if(..())
SSticker.mode.remove_traitor_mind(target.mind)
target.mind.remove_antag_datum(/datum/antagonist/mindslave)
to_chat(target, "<span class='warning'>You are no longer a mindslave: you have complete and free control of your own faculties, once more!</span>")
return 1
return 0
return 0