mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 10:03:50 +01:00
Antag datum clean up/refactor (#15084)
This commit is contained in:
@@ -130,10 +130,9 @@ GLOBAL_LIST_EMPTY(world_uplinks)
|
||||
var/active = 0
|
||||
|
||||
// The hidden uplink MUST be inside an obj/item's contents.
|
||||
/obj/item/uplink/hidden/New()
|
||||
spawn(2)
|
||||
if(!istype(src.loc, /obj/item))
|
||||
qdel(src)
|
||||
/obj/item/uplink/hidden/New(loc)
|
||||
if(!isitem(loc))
|
||||
qdel(src)
|
||||
..()
|
||||
|
||||
// Toggles the uplink on and off. Normally this will bypass the item's normal functions and go to the uplink menu, if activated.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name = "Mindslave Implant"
|
||||
desc = "Divide and Conquer"
|
||||
origin_tech = "programming=5;biotech=5;syndicate=8"
|
||||
activated = 0
|
||||
activated = FALSE
|
||||
|
||||
/obj/item/implant/traitor/get_data()
|
||||
var/dat = {"<b>Implant Specifications:</b><BR>
|
||||
@@ -16,71 +16,40 @@
|
||||
<b>Integrity:</b> Implant will last so long as the nanobots are inside the bloodstream."}
|
||||
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
|
||||
/obj/item/implant/traitor/implant(mob/living/carbon/human/mindslave_target, mob/living/carbon/human/user)
|
||||
// Check `activated` here so you can't just keep taking it out and putting it back into other people.
|
||||
if(!..() || activated || !istype(mindslave_target) || !istype(user)) // Both the target and the user need to be human.
|
||||
return FALSE
|
||||
|
||||
// If the target is catatonic or doesn't have a mind, return.
|
||||
if(!mindslave_target.mind)
|
||||
to_chat(user, "<span class='warning'><i>This person doesn't have a mind for you to slave!</i></span>")
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(!activated) //So you can't just keep taking it out and putting it back into other people.
|
||||
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
|
||||
if(!ishuman(mindslave_target))
|
||||
return 0
|
||||
if(!mindslave_target.mind)
|
||||
return 0
|
||||
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(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
|
||||
// Fails if they're already a mindslave of someone, or if they're mindshielded.
|
||||
if(ismindslave(mindslave_target) || 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 FALSE
|
||||
|
||||
to_chat(mindslave_target, "<span class='danger'>You feel completely loyal to [user.name].</span>")
|
||||
if(!(user.mind in SSticker.mode.implanter))
|
||||
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
|
||||
// Mindslaving yourself.
|
||||
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>")
|
||||
user.adjustBrainLoss(20)
|
||||
removed(mindslave_target)
|
||||
qdel(src)
|
||||
return FALSE
|
||||
|
||||
to_chat(mindslave_target, "<span class='danger'><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 = 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)]."
|
||||
mindslave_target.mind.objectives += MS
|
||||
mindslave_target.mind.add_antag_datum(/datum/antagonist/mindslave)
|
||||
|
||||
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")
|
||||
|
||||
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)
|
||||
return 1
|
||||
return 0
|
||||
// Create a new mindslave datum for the target with the user as their master.
|
||||
mindslave_target.mind.add_antag_datum(new /datum/antagonist/mindslave(user.mind))
|
||||
log_admin("[key_name_admin(user)] has mind-slaved [key_name_admin(mindslave_target)].")
|
||||
return TRUE
|
||||
|
||||
/obj/item/implant/traitor/removed(mob/target)
|
||||
if(..())
|
||||
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 TRUE
|
||||
return FALSE
|
||||
|
||||
Reference in New Issue
Block a user