[MIRROR] Adds Quirk-Related "Special Pool" to obsessed for Chaplain, Clown, and Mime targets. (#2859)

* Adds Quirk-Related "Special Pool" to obsessed for Chaplain, Clown, and Mime targets. (#56357)

* Adds Quirk-Related "Special Pool" to obsessed for Chaplain, Clown, and Mime targets.

Co-authored-by: RaveRadbury <3204033+RaveRadbury@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-01-24 17:32:53 +01:00
committed by GitHub
parent 3196c6a150
commit 81395e3f52

View File

@@ -115,15 +115,28 @@
return COMSIG_BLOCK_EYECONTACT
/datum/brain_trauma/special/obsessed/proc/find_obsession()
var/chosen_victim
var/list/possible_targets = list()
var/list/viable_minds = list()
var/list/viable_minds = list() //The first list, which excludes hijinks
var/list/possible_targets = list() //The second list, which filters out silicons and simplemobs
var/static/list/trait_obsessions = list("Mime" = TRAIT_FAN_MIME, "Clown" = TRAIT_FAN_CLOWN, "Chaplain" = TRAIT_SPIRITUAL) //Jobs and their corresponding quirks
var/list/special_pool = list() //The special list, for quirk-based
var/chosen_victim //The obsession target
for(var/mob/Player in GLOB.player_list)//prevents crewmembers falling in love with nuke ops they never met, and other annoying hijinks
if(Player.mind && Player.stat != DEAD && !isnewplayer(Player) && !isbrain(Player) && Player.client && Player != owner && SSjob.GetJob(Player.mind.assigned_role))
viable_minds += Player.mind
for(var/datum/mind/possible_target in viable_minds)
if(possible_target != owner && ishuman(possible_target.current))
var/job = possible_target.assigned_role
if (trait_obsessions[job] != null && HAS_TRAIT(owner, trait_obsessions[job]))
special_pool += possible_target.current
possible_targets += possible_target.current
//Do we have any special target?
if(length(special_pool))
chosen_victim = pick(special_pool)
return chosen_victim
//If not, pick any other ordinary target
if(possible_targets.len > 0)
chosen_victim = pick(possible_targets)
return chosen_victim