Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions code/datums/brain_damage/creepy_trauma.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
/datum/brain_trauma/special/obsessed/proc/find_obsession()
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/list/exemption_list = list() //A list of all targets, subtracting targets who are exempt from being an Obsession target through preferences. special_pool will still be picked first
var/static/list/trait_obsessions = list(
JOB_MIME = TRAIT_MIME_FAN,
JOB_CLOWN = TRAIT_CLOWN_ENJOYER,
Expand Down Expand Up @@ -148,12 +149,22 @@
if (trait_obsessions[job] != null && HAS_TRAIT(owner, trait_obsessions[job]))
special_pool += possible_target.current
possible_targets += possible_target.current
exemption_list += possible_target.current
//check if they are exempt from being an obsession target
var/mob/living/carbon/human/exempt_target = possible_target
if(exempt_target.obsession_target == 0)
exemption_list -= exempt_target

//Do we have any special target?
if(length(special_pool))
chosen_victim = pick(special_pool)
return chosen_victim

//Prioritize picking those who are eligible to roll being the target of an Obsession in preferences
if(length(exemption_list))
chosen_victim = pick(exemption_list)
return chosen_victim

//If not, pick any other ordinary target
if(possible_targets.len > 0)
chosen_victim = pick(possible_targets)
Expand Down
7 changes: 7 additions & 0 deletions code/modules/client/preferences/obsession_target.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/datum/preference/toggle/obsession_target
category = PREFERENCE_CATEGORY_NON_CONTEXTUAL
savefile_key = "obsession_target"
savefile_identifier = PREFERENCE_CHARACTER

/datum/preference/toggle/obsession_target/apply_to_human(mob/living/carbon/human/target, value)
target.obsession_target = value
3 changes: 3 additions & 0 deletions code/modules/mob/living/carbon/human/human_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@
/// Normally set by `/datum/preference/toggle/persistent_scars/apply_to_human`.
var/persistent_scars

///Preferences check to determine if a character is capable or not of being the target of an Obsession.
var/obsession_target

/// Base height of the mob, modified by stuff like dwarfism or species
VAR_PRIVATE/base_mob_height = HUMAN_HEIGHT_MEDIUM
/// Actual height of the mob. Don't touch this one, it is set via update_mob_height()
Expand Down
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3890,6 +3890,7 @@
#include "code\modules\client\preferences\multiz_parallax.dm"
#include "code\modules\client\preferences\multiz_performance.dm"
#include "code\modules\client\preferences\names.dm"
#include "code\modules\client\preferences\obsession_target.dm"
#include "code\modules\client\preferences\ooc.dm"
#include "code\modules\client\preferences\operative_species.dm"
#include "code\modules\client\preferences\paint_color.dm"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { CheckboxInput, type FeatureToggle } from '../base';

export const obsession_target: FeatureToggle = {
name: 'Obsession Target',
description:
'If unchecked, you will be less likely to become a target for an Obsession.',
component: CheckboxInput,
};
Loading