|
209 | 209 | /datum/mind/proc/add_antag_datum(datum_type_or_instance, team) |
210 | 210 | if(!datum_type_or_instance) |
211 | 211 | return |
| 212 | + if(has_antag_datum(datum_type_or_instance)) //if they already have it, don't give it again |
| 213 | + return |
212 | 214 | var/datum/antagonist/A |
213 | 215 | if(!ispath(datum_type_or_instance)) |
214 | 216 | A = datum_type_or_instance |
|
396 | 398 | return I |
397 | 399 |
|
398 | 400 |
|
| 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 |
399 | 404 |
|
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] |
401 | 425 |
|
| 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. |
402 | 429 | /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 | + |
403 | 433 | if(iscultist(creator)) |
404 | 434 | SSticker.mode.add_cultist(src) |
405 | 435 |
|
|
417 | 447 | N.nukeop_outfit = null |
418 | 448 | add_antag_datum(N,converter.nuke_team) |
419 | 449 |
|
| 450 | + else if(is_team_darkspawn(creator)) |
| 451 | + add_antag_datum(/datum/antagonist/psyche) |
| 452 | + |
420 | 453 |
|
421 | 454 | enslaved_to = WEAKREF(creator) |
422 | 455 |
|
|
0 commit comments