diff --git a/code/datums/components/shy.dm b/code/datums/components/shy.dm index b7587063e86..608b7b70cf0 100644 --- a/code/datums/components/shy.dm +++ b/code/datums/components/shy.dm @@ -6,7 +6,9 @@ /// How close you are before you get shy var/shy_range = 4 /// Typecache of mob types you are okay around - var/list/whitelist + var/list/mob_whitelist + /// Typecache of machines you can avoid being shy with + var/list/machine_whitelist = null /// Message shown when you are is_shy var/message = "You find yourself too shy to do that around %TARGET!" /// Are you shy around a dead body? @@ -16,16 +18,18 @@ /// What was our last result? var/last_result = FALSE -/datum/component/shy/Initialize(whitelist, shy_range, message, dead_shy) +/datum/component/shy/Initialize(mob_whitelist, shy_range, message, dead_shy, machine_whitelist) if(!ismob(parent)) return COMPONENT_INCOMPATIBLE - src.whitelist = whitelist + src.mob_whitelist = mob_whitelist if(shy_range) src.shy_range = shy_range if(message) src.message = message if(dead_shy) src.dead_shy = dead_shy + if(machine_whitelist) + src.machine_whitelist = machine_whitelist /datum/component/shy/RegisterWithParent() RegisterSignal(parent, COMSIG_MOB_CLICKON, .proc/on_clickon) @@ -50,7 +54,7 @@ /datum/component/shy/InheritComponent(datum/component/shy/friend, i_am_original, list/arguments) if(i_am_original) shy_range = friend.shy_range - whitelist = friend.whitelist + mob_whitelist = friend.mob_whitelist message = friend.message /// Returns TRUE or FALSE if you are within shy_range tiles from a /mob/living @@ -60,6 +64,9 @@ if(target in owner.DirectAccess()) return + for(var/type in machine_whitelist) + if(istype(target, type)) + return if(!COOLDOWN_FINISHED(src, result_cooldown)) return last_result @@ -68,7 +75,7 @@ if(length(strangers) && locate(/mob/living) in strangers) for(var/mob/living/person in strangers) - if(person != owner && !is_type_in_typecache(person, whitelist) && (person.stat != DEAD || dead_shy)) + if(person != owner && !is_type_in_typecache(person, mob_whitelist) && (person.stat != DEAD || dead_shy)) to_chat(owner, span_warning("[replacetext(message, "%TARGET", person)]")) result = TRUE break diff --git a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm index 1ddffb43a5a..42d94b00a24 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm @@ -153,6 +153,11 @@ /obj/item/clothing/head, /obj/item/clothing/mask, ) + /// machines whitelisted from being shy with + var/list/shy_machine_whitelist = list( + /obj/machinery/atmospherics/components/unary/vent_pump, + /obj/machinery/atmospherics/components/unary/vent_scrubber, + ) /mob/living/simple_animal/drone/Initialize(mapload) . = ..() @@ -333,7 +338,7 @@ var/static/list/not_shy_of = typecacheof(list(/mob/living/simple_animal/drone, /mob/living/simple_animal/bot)) if(shy) ADD_TRAIT(src, TRAIT_PACIFISM, DRONE_SHY_TRAIT) - LoadComponent(/datum/component/shy, not_shy_of, 4, "Your laws prevent this action near %TARGET.", TRUE) + LoadComponent(/datum/component/shy, not_shy_of, 4, "Your laws prevent this action near %TARGET.", TRUE, shy_machine_whitelist) LoadComponent(/datum/component/shy_in_room, drone_bad_areas, "Touching anything in %ROOM could break your laws.") LoadComponent(/datum/component/technoshy, 5 MINUTES, "%TARGET was touched by a being recently, using it could break your laws.") LoadComponent(/datum/component/itempicky, drone_good_items, "Using %TARGET could break your laws.")