Files
Bubberstation/code/modules/events/creep_awakening.dm
YPOQ 94d1203276 Fix obsessed not respecting player preferences (#44609)
Also fixes a runtime due to a missing early return
2019-06-18 13:29:07 -07:00

25 lines
826 B
Plaintext

/datum/round_event_control/obsessed
name = "Obsession Awakening"
typepath = /datum/round_event/obsessed
max_occurrences = 1
min_players = 20
/datum/round_event/obsessed
fakeable = FALSE
/datum/round_event/obsessed/start()
for(var/mob/living/carbon/human/H in shuffle(GLOB.player_list))
if(!H.client || !(ROLE_OBSESSED in H.client.prefs.be_special))
continue
if(H.stat == DEAD)
continue
if(!SSjob.GetJob(H.mind.assigned_role) || H.mind.assigned_role in GLOB.nonhuman_positions) //only station jobs sans nonhuman roles, prevents ashwalkers trying to stalk with crewmembers they never met
continue
if(H.mind.has_antag_datum(/datum/antagonist/obsessed))
continue
if(!H.getorgan(/obj/item/organ/brain))
continue
H.gain_trauma(/datum/brain_trauma/special/obsessed)
announce_to_ghosts(H)
break