diff --git a/modular_darkpack/master_files/code/modules/mob/living/carbon/human/initialize.dm b/modular_darkpack/master_files/code/modules/mob/living/carbon/human/initialize.dm index 73c76af769fd..f5bfc09a7ecb 100644 --- a/modular_darkpack/master_files/code/modules/mob/living/carbon/human/initialize.dm +++ b/modular_darkpack/master_files/code/modules/mob/living/carbon/human/initialize.dm @@ -3,7 +3,6 @@ //Initializes Jumping on the player AddComponent(/datum/component/jumper) - AddComponent(/datum/component/violation_observer, violation_aoe) if(CONFIG_GET(flag/swing_combat)) AddElement(/datum/element/swing_attack) else if(CONFIG_GET(flag/directional_combat)) diff --git a/modular_darkpack/master_files/code/modules/mob/living/living.dm b/modular_darkpack/master_files/code/modules/mob/living/living.dm index ffc42bb4bc1b..5938c2c4edb9 100644 --- a/modular_darkpack/master_files/code/modules/mob/living/living.dm +++ b/modular_darkpack/master_files/code/modules/mob/living/living.dm @@ -3,12 +3,14 @@ storyteller_stats = create_new_stat_prefs(storyteller_stats) become_area_sensitive(ZONE_TRAIT) update_zone_hud(src, get_area(src)) // AREAS - (Zone hud) + RegisterSignal(src, COMSIG_MASQUERADE_VIOLATION, TYPE_PROC_REF(/atom/movable, on_masquerade_violation)) /mob/living/Destroy(force) storyteller_stats = null beastmaster_minions = null minion_command_components = null QDEL_LAZYLIST(splats) + UnregisterSignal(src, COMSIG_MASQUERADE_VIOLATION) return ..() /mob/living/set_pull_offsets(mob/living/mob_to_set, grab_state = GRAB_PASSIVE, animate = TRUE) diff --git a/modular_darkpack/modules/bodycameras/code/bodycamera.dm b/modular_darkpack/modules/bodycameras/code/bodycamera.dm index 7bd499ea3509..f4d4bc771da9 100644 --- a/modular_darkpack/modules/bodycameras/code/bodycamera.dm +++ b/modular_darkpack/modules/bodycameras/code/bodycamera.dm @@ -20,10 +20,8 @@ ///The camera itself, made when we need it and deleted on Destroy. Installed into the clothing item directly. var/obj/machinery/camera/bodycamera/builtin_bodycamera var/static/mutable_appearance/equipped_overlay = mutable_appearance('modular_darkpack/modules/bodycameras/icons/bodycamera_overlay.dmi', "bodycamera") - -/obj/item/bodycam_upgrade/Initialize(mapload) - . = ..() - AddComponent(/datum/component/violation_observer, FALSE) + // the guy wearing it , temporary var until i figure out something better + var/mob/living/carbon/wearer /obj/item/bodycam_upgrade/examine_more(mob/user) . = ..() @@ -107,10 +105,11 @@ playsound(loc, 'sound/machines/beep/beep.ogg', get_clamped_volume(), TRUE, -1) builtin_bodycamera.network = network //sync the network of the camera to us, the upgrade. builtin_bodycamera.camera_enabled = TRUE - var/datum/component/violation_observer/violation_component = src.GetComponent(/datum/component/violation_observer) var/obj/item/clothing = loc - var/mob/living/carbon/wearer = iscarbon(clothing.loc) // interacting_with_atom forces us to be on an /obj/item/clothing on a mob - violation_component.toggle_area_of_effect(wearer) + if(!iscarbon(clothing.loc)) + return + wearer = clothing.loc // interacting_with_atom forces us to be on an /obj/item/clothing on a mob + wearer.toggle_masquerade_sensitivity(TRUE) log_game("BODYCAM TOGGLE: [(user ? key_name(user) : "SYSTEM")] turned ON [src] ([builtin_bodycamera.c_tag]) at [loc_name(src)].") ///Turns the camera off. Will be silent if 'user' is null. @@ -120,8 +119,8 @@ playsound(loc, 'sound/machines/beep/beep.ogg', get_clamped_volume(), TRUE, -1) if(builtin_bodycamera) builtin_bodycamera.camera_enabled = FALSE - var/datum/component/violation_observer/violation_component = src.GetComponent(/datum/component/violation_observer) - violation_component.toggle_area_of_effect() + wearer.toggle_masquerade_sensitivity(FALSE) + wearer = null log_game("BODYCAM TOGGLE: [(user ? key_name(user) : "SYSTEM")] turned OFF [src] at [loc_name(src)].") /** diff --git a/modular_darkpack/modules/masquerade/code/blood_hunt_skull.dm b/modular_darkpack/modules/masquerade/code/blood_hunt_skull.dm index 5402893aa83e..f25bb3de2b85 100644 --- a/modular_darkpack/modules/masquerade/code/blood_hunt_skull.dm +++ b/modular_darkpack/modules/masquerade/code/blood_hunt_skull.dm @@ -17,7 +17,6 @@ . = ..() REGISTER_REQUIRED_MAP_ITEM(1, 1) GLOB.blood_hunt_announcers += src - AddComponent(/datum/component/violation_observer, FALSE) /obj/item/blood_hunt/Destroy(force) GLOB.blood_hunt_announcers -= src diff --git a/modular_darkpack/modules/masquerade/code/components/violation_observer.dm b/modular_darkpack/modules/masquerade/code/components/violation_observer.dm index cfd2895f708f..59e48434d31b 100644 --- a/modular_darkpack/modules/masquerade/code/components/violation_observer.dm +++ b/modular_darkpack/modules/masquerade/code/components/violation_observer.dm @@ -1,34 +1,40 @@ -// Used for things that detect masquerade violations. -// Usually NPCs or cameras. -/datum/component/violation_observer - dupe_mode = COMPONENT_DUPE_UNIQUE - var/datum/proximity_monitor/advanced/violation_check_aoe/area_of_effect - /// Time between us checking for violations - COOLDOWN_DECLARE(scan_cooldown) - var/list/breached_players - -/datum/component/violation_observer/Initialize(add_area_of_effect) //Only add the AOE checker for NPCs and camera objects. - if(add_area_of_effect) - area_of_effect = new(parent, 7, TRUE, src) - breached_players = new() - -/datum/component/violation_observer/RegisterWithParent() - RegisterSignal(parent, COMSIG_SEEN_MASQUERADE_VIOLATION, PROC_REF(on_observed_violation)) - RegisterSignal(parent, COMSIG_MASQUERADE_REINFORCE, PROC_REF(on_masquerade_violation_reinforced)) - RegisterSignals(parent, list(COMSIG_LIVING_DEATH, COMSIG_ALL_MASQUERADE_REINFORCE), PROC_REF(on_death)) - -/datum/component/violation_observer/UnregisterFromParent(force, silent) - QDEL_NULL(area_of_effect) - breached_players = null - UnregisterSignal(parent, list(COMSIG_SEEN_MASQUERADE_VIOLATION, COMSIG_MASQUERADE_REINFORCE, COMSIG_LIVING_DEATH, COMSIG_ALL_MASQUERADE_REINFORCE)) - -/datum/component/violation_observer/proc/toggle_area_of_effect(origin = parent) - if(area_of_effect) - QDEL_NULL(area_of_effect) +/atom/movable + var/violation_observer = FALSE + COOLDOWN_DECLARE(masquerade_violation_cooldown) + +/atom/movable/proc/toggle_masquerade_sensitivity(new_listening_state) + // don't proceed if we're toggling to TRUE on something already listening + if(!isnull(new_listening_state) && new_listening_state == violation_observer) + return + + // if we don't pass an arg just flip the switch + if(isnull(new_listening_state)) + violation_observer = !violation_observer + else + violation_observer = new_listening_state + + if(violation_observer) + RegisterSignal(src, COMSIG_SEEN_MASQUERADE_VIOLATION, PROC_REF(on_observed_violation)) + RegisterSignal(src, COMSIG_MASQUERADE_REINFORCE, PROC_REF(on_masquerade_violation_reinforced)) + RegisterSignals(src, list(COMSIG_LIVING_DEATH, COMSIG_ALL_MASQUERADE_REINFORCE), PROC_REF(on_masquerade_witness_death)) else - area_of_effect = new(origin, 7, TRUE, src) + UnregisterSignal(src, list(COMSIG_SEEN_MASQUERADE_VIOLATION, COMSIG_MASQUERADE_REINFORCE, COMSIG_LIVING_DEATH, COMSIG_ALL_MASQUERADE_REINFORCE)) -/datum/component/violation_observer/proc/on_observed_violation(atom/source, mob/living/player_breacher) +/atom/movable/proc/on_masquerade_violation() + if(!COOLDOWN_FINISHED(src, masquerade_violation_cooldown)) + return + var/area/vtm/breacher_area = get_area(src) + if(!istype(breacher_area, /area/vtm)) + return + if(breacher_area.zone_type != ZONE_MASQUERADE) + return + for(var/atom/movable/moving_atom in view(7, loc)) + if(!moving_atom.violation_observer) + continue + SEND_SIGNAL(moving_atom, COMSIG_SEEN_MASQUERADE_VIOLATION, src) + COOLDOWN_START(src, masquerade_violation_cooldown, 1 TURNS) + +/atom/movable/proc/on_observed_violation(atom/source, atom/movable/player_breacher) SIGNAL_HANDLER if(!source || !player_breacher || ismundane(player_breacher)) //Humans cant break the masquerade. Because reasons. @@ -36,6 +42,8 @@ if(isliving(source)) var/mob/living/mob_parent = source + if(mob_parent.stat == DEAD) + return if(!INCAPACITATED_IGNORING(mob_parent, INCAPABLE_RESTRAINTS)) mob_parent.face_atom(player_breacher) source.observe_masquerade_violation(player_breacher) @@ -48,43 +56,48 @@ animate(exclamation, pixel_z = 32, alpha = 255, time = 0.5 SECONDS, easing = ELASTIC_EASING) source.AddComponent(/datum/component/masquerade_hud, player_breacher) - breached_players += player_breacher SSmasquerade.masquerade_breach(source, player_breacher, (isliving(source) ? MASQUERADE_REASON_NPC : MASQUERADE_REASON_OBJECT)) - RegisterSignal(player_breacher, COMSIG_LIVING_DEATH, PROC_REF(on_breacher_death)) + RegisterSignal(player_breacher, COMSIG_LIVING_DEATH, PROC_REF(on_breacher_death), override = TRUE) // override is for breaching multiple times on the same violation observer - on_breacher_death handles all violations, not just the breach created here, so we only need one register return TRUE -/datum/component/violation_observer/proc/on_masquerade_violation_reinforced(atom/source, mob/living/player_breacher) +/atom/movable/proc/on_masquerade_violation_reinforced(atom/source, atom/movable/player_breacher) SIGNAL_HANDLER - if(player_breacher in breached_players) - SEND_SIGNAL(source, COMSIG_MASQUERADE_HUD_DELETE, player_breacher) - SSmasquerade.masquerade_reinforce(source, player_breacher) - source.observe_masquerade_reinforce(player_breacher) - breached_players -= player_breacher + for(var/breach in SSmasquerade.masquerade_breachers) + if(breach[1] != player_breacher) + continue + if(breach[2] != src) + continue + SEND_SIGNAL(src, COMSIG_MASQUERADE_HUD_DELETE, player_breacher) + SSmasquerade.masquerade_reinforce(src, player_breacher) + src.observe_masquerade_reinforce(player_breacher) UnregisterSignal(player_breacher, COMSIG_LIVING_DEATH) return TRUE -/datum/component/violation_observer/proc/on_death(atom/source) +/atom/movable/proc/on_masquerade_witness_death() SIGNAL_HANDLER - for(var/mob/player_breacher in breached_players) - if(!QDELETED(player_breacher)) - SEND_SIGNAL(source, COMSIG_MASQUERADE_HUD_DELETE, player_breacher) - SSmasquerade.masquerade_reinforce(source, player_breacher) - source.observe_masquerade_reinforce(player_breacher) - breached_players -= player_breacher + for(var/breach in SSmasquerade.masquerade_breachers) + var/mob/living/player_breacher = breach[1] + var/atom/breach_witness = breach[2] + if(breach_witness != src) + continue + SEND_SIGNAL(src, COMSIG_MASQUERADE_HUD_DELETE, player_breacher) + SSmasquerade.masquerade_reinforce(src, player_breacher) + observe_masquerade_reinforce(player_breacher) + UnregisterSignal(player_breacher, COMSIG_LIVING_DEATH) -/datum/component/violation_observer/proc/on_breacher_death(mob/living/dead_breacher, gibbed) +/atom/movable/proc/on_breacher_death(mob/living/dead_breacher, gibbed) SIGNAL_HANDLER - if(dead_breacher in breached_players) - var/atom/parent_atom = parent - SEND_SIGNAL(parent, COMSIG_MASQUERADE_HUD_DELETE, dead_breacher) - SSmasquerade.masquerade_reinforce(parent, dead_breacher) - parent_atom.observe_masquerade_reinforce(dead_breacher) - breached_players -= dead_breacher + for(var/breach in SSmasquerade.masquerade_breachers) + if(breach[1] != dead_breacher) + continue + SEND_SIGNAL(src, COMSIG_MASQUERADE_HUD_DELETE, dead_breacher) + SSmasquerade.masquerade_reinforce(src, dead_breacher) + observe_masquerade_reinforce(dead_breacher) UnregisterSignal(dead_breacher, COMSIG_LIVING_DEATH) /atom/proc/observe_masquerade_violation(player_breacher) diff --git a/modular_darkpack/modules/masquerade/code/fields/violation_check_aoe.dm b/modular_darkpack/modules/masquerade/code/fields/violation_check_aoe.dm deleted file mode 100644 index 718ca64b60d6..000000000000 --- a/modular_darkpack/modules/masquerade/code/fields/violation_check_aoe.dm +++ /dev/null @@ -1,86 +0,0 @@ -/datum/proximity_monitor/advanced/violation_check_aoe - edge_is_a_field = TRUE - var/datum/component/violation_observer/violation_observer_callback - var/list/tracking_mobs - -/datum/proximity_monitor/advanced/violation_check_aoe/New(atom/_host, range, _ignore_if_not_on_turf = TRUE, _violation_observer_callback) - . = ..() - violation_observer_callback = _violation_observer_callback - tracking_mobs = new() - -/datum/proximity_monitor/advanced/violation_check_aoe/Destroy() - violation_observer_callback = null - for(var/mob in tracking_mobs) - UnregisterSignal(mob, COMSIG_MASQUERADE_VIOLATION) - tracking_mobs = null - return ..() - -/datum/proximity_monitor/advanced/violation_check_aoe/on_entered(turf/source, atom/movable/entered, turf/old_loc) - . = ..() - if(QDELETED(src)) - return - if(!isliving(entered)) - return - if(isnpc(entered)) //only track non-NPCs - return - if(entered == host) - return - if(entered in tracking_mobs) - return - tracking_mobs |= entered - RegisterSignal(entered, COMSIG_MASQUERADE_VIOLATION, PROC_REF(violation_observer_breach_callback)) - if(iscarbon(entered)) - var/mob/living/carbon/entered_mob = entered - if(HAS_TRAIT(entered_mob, TRAIT_MASQUERADE_VIOLATING_FACE) && !(entered_mob.obscured_slots & HIDEFACE)) - SEND_SIGNAL(entered_mob, COMSIG_MASQUERADE_VIOLATION) - else if(HAS_TRAIT(entered_mob, TRAIT_MASQUERADE_VIOLATING_EYES) && !entered_mob.is_eyes_covered()) - SEND_SIGNAL(entered_mob, COMSIG_MASQUERADE_VIOLATION) - -/datum/proximity_monitor/advanced/violation_check_aoe/on_uncrossed(turf/source, atom/movable/gone, direction) - . = ..() - if(QDELETED(src)) - return - if(!isliving(gone)) - return - if(isnpc(gone)) //only track non-NPCs - return - if(gone == host) - return - if(!(gone in tracking_mobs)) - return - tracking_mobs -= gone - UnregisterSignal(gone, COMSIG_MASQUERADE_VIOLATION) - -/datum/proximity_monitor/advanced/violation_check_aoe/on_z_change() - if(QDELETED(src)) - return - for(var/mob in tracking_mobs) - UnregisterSignal(mob, COMSIG_MASQUERADE_VIOLATION) - tracking_mobs -= mob - -/datum/proximity_monitor/advanced/violation_check_aoe/cleanup_field_turf(turf/target) - if(QDELETED(src)) - return - for(var/mob/living/living_mob in target.contents) - UnregisterSignal(living_mob, COMSIG_MASQUERADE_VIOLATION) - tracking_mobs -= living_mob - -/datum/proximity_monitor/advanced/violation_check_aoe/proc/violation_observer_breach_callback(mob/living/source) - SIGNAL_HANDLER - - var/mob/living/host_mob = host - if(!host_mob) - return - if(host_mob.incapacitated || IS_UNCONSCIOUS_OR_CRIT(host_mob) || host_mob.IsSleeping() || host_mob.IsParalyzed()) - return - if(HAS_TRAIT(source, TRAIT_OBFUSCATED)) - return - if(!check_zone_masquerade(host_mob)) - return - if(!can_see(host_mob, source, 7)) - return - if(!COOLDOWN_FINISHED(source, masquerade_timer)) - return - COOLDOWN_START(source, masquerade_timer, 10 SECONDS) - if(violation_observer_callback) - SEND_SIGNAL(violation_observer_callback.parent, COMSIG_SEEN_MASQUERADE_VIOLATION, source) diff --git a/modular_darkpack/modules/masquerade/code/subsystem/masquerade.dm b/modular_darkpack/modules/masquerade/code/subsystem/masquerade.dm index 38e329cfa188..c42f751f8bc2 100644 --- a/modular_darkpack/modules/masquerade/code/subsystem/masquerade.dm +++ b/modular_darkpack/modules/masquerade/code/subsystem/masquerade.dm @@ -45,11 +45,10 @@ SUBSYSTEM_DEF(masquerade) * player_breacher - The player which caused the masquerade breach. * reason - Optional, the reason for the breach. For example, */ -/datum/controller/subsystem/masquerade/proc/masquerade_reinforce(atom/source, mob/living/player_breacher, reason) +/datum/controller/subsystem/masquerade/proc/masquerade_reinforce(atom/source, mob/living/player_breacher) . = FALSE for(var/masquerade_breach in masquerade_breachers) var/breach_sources = masquerade_breach[2] - var/breach_reasons = masquerade_breach[3] var/source_matches = FALSE // breach_sources can be a list if there is more than one blood skull, handle for that @@ -58,17 +57,12 @@ SUBSYSTEM_DEF(masquerade) else source_matches = (source == breach_sources) - if(source_matches || reason == "debug") - if(!reason || (reason in masquerade_breach) || (reason == MASQUERADE_REASON_PREFERENCES) || (reason == "debug")) - // Only require blood hunt skull for "Preferences" (round-persistent) breaches - if(breach_reasons == MASQUERADE_REASON_PREFERENCES && !istype(source, /obj/item/blood_hunt)) - continue - - masquerade_breachers -= list(masquerade_breach) - masquerade_level = min(MASQUERADE_MAX_LEVEL, masquerade_level + 1) - player_breacher.masquerade_score = min(5, player_breacher.masquerade_score + 1) - . = TRUE - break + if(source_matches) + masquerade_breachers -= list(masquerade_breach) + masquerade_level = min(MASQUERADE_MAX_LEVEL, masquerade_level + 1) + player_breacher.masquerade_score = min(5, player_breacher.masquerade_score + 1) + . = TRUE + break if(player_breacher.masquerade_score == 5) //Doesn't matter if they weren't in one of these lists. GLOB.veil_breakers_list -= player_breacher GLOB.masquerade_breakers_list -= player_breacher @@ -90,13 +84,13 @@ SUBSYSTEM_DEF(masquerade) * player_breacher - The player which caused the masquerade breach. * reason - The reason for the breach. For example, */ -/datum/controller/subsystem/masquerade/proc/masquerade_breach(atom/source, mob/living/player_breacher, reason) - log_game("[player_breacher] has caused a masquerade breach in front of [source] by [reason]") +/datum/controller/subsystem/masquerade/proc/masquerade_breach(atom/source, mob/living/player_breacher) + log_game("[player_breacher] has caused a masquerade breach in front of [source]") var/pre_breach_score = player_breacher.masquerade_score if(pre_breach_score == 0) return player_breacher.masquerade_score = max(0, player_breacher.masquerade_score - 1) - masquerade_breachers += list(list(player_breacher, source, reason)) + masquerade_breachers += list(list(player_breacher, source)) if(get_vampire_splat(player_breacher)) GLOB.masquerade_breakers_list |= player_breacher GLOB.supernatural_breakers_list |= player_breacher @@ -161,7 +155,7 @@ SUBSYSTEM_DEF(masquerade) var/list/masquerade_breach_list = masquerade_breach if(islist(masquerade_breach_list[2])) //If its the skull list, then its a long term masq breach. Clear it. for(var/atom/list_object as anything in masquerade_breach_list[2]) - SSmasquerade.masquerade_reinforce(list_object, masquerade_breach_list[1], MASQUERADE_REASON_PREFERENCES) + SSmasquerade.masquerade_reinforce(list_object, masquerade_breach_list[1]) return else var/atom/object = masquerade_breach_list[2] @@ -183,7 +177,7 @@ SUBSYSTEM_DEF(masquerade) var/list/masquerade_breach_list = masquerade_breach if(islist(masquerade_breach_list[2])) //If its the skull list, then its a long term masq breach. Clear it. for(var/atom/list_object as anything in masquerade_breach_list[2]) - SSmasquerade.masquerade_reinforce(list_object, masquerade_breach_list[1], MASQUERADE_REASON_PREFERENCES) + SSmasquerade.masquerade_reinforce(list_object, masquerade_breach_list[1]) else var/atom/object = masquerade_breach_list[2] SEND_SIGNAL(object, COMSIG_ALL_MASQUERADE_REINFORCE) diff --git a/modular_darkpack/modules/npc/code/human/__npc.dm b/modular_darkpack/modules/npc/code/human/__npc.dm index ad6bc26347ab..2921a968c2ec 100644 --- a/modular_darkpack/modules/npc/code/human/__npc.dm +++ b/modular_darkpack/modules/npc/code/human/__npc.dm @@ -90,6 +90,8 @@ RegisterSignal(src, COMSIG_LIVING_MOB_BUMPED, PROC_REF(handle_bumped)) // Be annoyed if helped RegisterSignal(src, COMSIG_CARBON_HELP_ACT, PROC_REF(handle_helped)) + // all npcs are masquerade violators by default so flip it to true + toggle_masquerade_sensitivity(TRUE) return INITIALIZE_HINT_LATELOAD /mob/living/carbon/human/npc/LateInitialize(mapload) diff --git a/modular_darkpack/modules/phones/code/_phone.dm b/modular_darkpack/modules/phones/code/_phone.dm index 324235d8ba13..b9a92caeafe9 100644 --- a/modular_darkpack/modules/phones/code/_phone.dm +++ b/modular_darkpack/modules/phones/code/_phone.dm @@ -81,7 +81,6 @@ wiki_book = new() become_hearing_sensitive(ROUNDSTART_TRAIT) RegisterSignal(src, COMSIG_MOVABLE_HEAR, PROC_REF(handle_hearing)) - AddComponent(/datum/component/violation_observer, FALSE) phone_background = "BG_[rand(1,18)]" // pick a random phone background when spawned /obj/item/smartphone/proc/update_initialized_contacts() diff --git a/modular_darkpack/modules/phones/code/phone_procs.dm b/modular_darkpack/modules/phones/code/phone_procs.dm index db3423e400a0..b3afc2b90fb2 100644 --- a/modular_darkpack/modules/phones/code/phone_procs.dm +++ b/modular_darkpack/modules/phones/code/phone_procs.dm @@ -195,6 +195,10 @@ set_phone_state(PHONE_IN_CALL) calling_smartphone.set_phone_state(PHONE_IN_CALL) + // turn masq stuff on + toggle_masquerade_sensitivity(TRUE) + calling_smartphone.toggle_masquerade_sensitivity(TRUE) + phone_radio.canhear_range = 1 calling_smartphone.phone_radio.canhear_range = 1 muted = FALSE @@ -223,6 +227,10 @@ set_phone_state(PHONE_AVAILABLE) calling_smartphone.set_phone_state(PHONE_AVAILABLE) + // turn masq stuff off + toggle_masquerade_sensitivity(FALSE) + calling_smartphone.toggle_masquerade_sensitivity(FALSE) + // Internal only proc, used for setting a phone's internal radio. /obj/item/smartphone/proc/set_phone_radio(enabled) PROTECTED_PROC(TRUE) diff --git a/modular_darkpack/modules/powers/code/discipline/__discipline_power.dm b/modular_darkpack/modules/powers/code/discipline/__discipline_power.dm index 78508bef81a1..c209932f2363 100644 --- a/modular_darkpack/modules/powers/code/discipline/__discipline_power.dm +++ b/modular_darkpack/modules/powers/code/discipline/__discipline_power.dm @@ -726,6 +726,8 @@ to_chat(owner, span_warning("You don't have enough blood to keep [src] active!")) try_deactivate(target) + SEND_SIGNAL(owner, COMSIG_MASQUERADE_VIOLATION) + /** * Overridable proc that allows for extra modular code * in refreshing behaviour. Can do custom checks to see if activation diff --git a/modular_darkpack/modules/vampire_the_masquerade/code/splats/__vampire_splat.dm b/modular_darkpack/modules/vampire_the_masquerade/code/splats/__vampire_splat.dm index 566f0957b074..9d67cdc6e559 100644 --- a/modular_darkpack/modules/vampire_the_masquerade/code/splats/__vampire_splat.dm +++ b/modular_darkpack/modules/vampire_the_masquerade/code/splats/__vampire_splat.dm @@ -3,6 +3,7 @@ power_type = /datum/discipline COOLDOWN_DECLARE(passive_bp_drain_cooldown) + COOLDOWN_DECLARE(check_masq_violating_cooldown) /datum/splat/vampire/splat_life(seconds_per_tick) @@ -10,6 +11,16 @@ if(COOLDOWN_FINISHED(src, passive_bp_drain_cooldown)) owner.adjust_blood_pool(-1) COOLDOWN_START(src, passive_bp_drain_cooldown, CONFIG_GET(number/passive_bp_drain_timer)) + + if(COOLDOWN_FINISHED(src, check_masq_violating_cooldown)) + if(HAS_TRAIT(owner, TRAIT_MASQUERADE_VIOLATING_FACE) && (iscarbon(owner) ? !(owner.obscured_slots & HIDEFACE) : TRUE)) + SEND_SIGNAL(owner, COMSIG_MASQUERADE_VIOLATION) + + if(HAS_TRAIT(owner, TRAIT_MASQUERADE_VIOLATING_EYES) && (iscarbon(owner) ? !(owner.obscured_slots & HIDEEYES) : TRUE)) + SEND_SIGNAL(owner, COMSIG_MASQUERADE_VIOLATION) + + COOLDOWN_START(src, check_masq_violating_cooldown, 1 TURNS) + return /datum/splat/vampire/proc/get_discipline_power(datum/discipline_power/discipline_power_type) diff --git a/tgstation.dme b/tgstation.dme index b5efb0fa633b..299cacf87225 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -7710,7 +7710,6 @@ #include "modular_darkpack\modules\masquerade\code\word_checker.dm" #include "modular_darkpack\modules\masquerade\code\components\masquerade_hud.dm" #include "modular_darkpack\modules\masquerade\code\components\violation_observer.dm" -#include "modular_darkpack\modules\masquerade\code\fields\violation_check_aoe.dm" #include "modular_darkpack\modules\masquerade\code\subsystem\bloodhunt.dm" #include "modular_darkpack\modules\masquerade\code\subsystem\masquerade.dm" #include "modular_darkpack\modules\matrix\code\job.dm"