Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit d2cccd7

Browse files
authored
Created servants now more closely follow their creator's antag status (#22358)
* Update mind.dm * Update mind.dm * Update mind.dm * Update mind.dm
1 parent 8bbc5ae commit d2cccd7

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

code/datums/mind.dm

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@
209209
/datum/mind/proc/add_antag_datum(datum_type_or_instance, team)
210210
if(!datum_type_or_instance)
211211
return
212+
if(has_antag_datum(datum_type_or_instance)) //if they already have it, don't give it again
213+
return
212214
var/datum/antagonist/A
213215
if(!ispath(datum_type_or_instance))
214216
A = datum_type_or_instance
@@ -396,10 +398,38 @@
396398
return I
397399

398400

401+
//Register a signal to the creator such that if they gain an antagonist datum, they also get it
402+
/datum/mind/proc/add_creator_antag(datum/mind/creator, datum/antagonist/antag)
403+
var/antag_type = antag.type
399404

400-
//Link a new mobs mind to the creator of said mob. They will join any team they are currently on, and will only switch teams when their creator does.
405+
//don't give them a full antag status if there's a suitable servant antag datum
406+
var/list/antag_downgrade = list(
407+
/datum/antagonist/darkspawn = /datum/antagonist/psyche,
408+
/datum/antagonist/thrall = /datum/antagonist/psyche
409+
)
410+
if(antag_type in antag_downgrade)
411+
antag_type = antag_downgrade[antag_type]
412+
413+
add_antag_datum(antag_type)
414+
415+
/datum/mind/proc/remove_creator_antag(datum/mind/creator, datum/antagonist/antag)
416+
var/antag_type = antag.type
417+
418+
//make sure to do it here too so the proper tag is removed
419+
var/list/antag_downgrade = list(
420+
/datum/antagonist/darkspawn = /datum/antagonist/psyche,
421+
/datum/antagonist/thrall = /datum/antagonist/psyche
422+
)
423+
if(antag_type in antag_downgrade)
424+
antag_type = antag_downgrade[antag_type]
401425

426+
remove_antag_datum(antag_type)
427+
428+
//Link a new mobs mind to the creator of said mob. They will join any team they are currently on, and will only switch teams when their creator does.
402429
/datum/mind/proc/enslave_mind_to_creator(mob/living/creator)
430+
RegisterSignal(creator.mind, COMSIG_ANTAGONIST_GAINED, PROC_REF(add_creator_antag)) //re-enslave to the new antag
431+
RegisterSignal(creator.mind, COMSIG_ANTAGONIST_REMOVED, PROC_REF(remove_creator_antag)) //remove enslavement to the antag
432+
403433
if(iscultist(creator))
404434
SSticker.mode.add_cultist(src)
405435

@@ -417,6 +447,9 @@
417447
N.nukeop_outfit = null
418448
add_antag_datum(N,converter.nuke_team)
419449

450+
else if(is_team_darkspawn(creator))
451+
add_antag_datum(/datum/antagonist/psyche)
452+
420453

421454
enslaved_to = WEAKREF(creator)
422455

0 commit comments

Comments
 (0)