diff --git a/code/game/objects/items/devices/dummy_tablet.dm b/code/game/objects/items/devices/dummy_tablet.dm index d1036ebfa93b..3172c84c8b01 100644 --- a/code/game/objects/items/devices/dummy_tablet.dm +++ b/code/game/objects/items/devices/dummy_tablet.dm @@ -1,6 +1,6 @@ /obj/item/device/professor_dummy_tablet icon = 'icons/obj/items/devices.dmi' - name = "Professor DUMMY tablet" + name = "\improper Professor DUMMY tablet" desc = "A Professor DUMMY Control Tablet." suffix = "\[3\]" icon_state = "Cotablet" @@ -21,23 +21,35 @@ */ /obj/item/device/professor_dummy_tablet/proc/is_adjacent_to_dummy(mob/user) if (get_dist(linked_dummy, user) > 1) - to_chat(user, "You are too far away to use the tablet.") + to_chat(user, SPAN_WARNING("You are too far away from the dummy to use its tablet.")) return FALSE - return TRUE -/obj/item/device/professor_dummy_tablet/proc/link_mob(mob/living/carbon/human/H) - linked_dummy = H +/obj/item/device/professor_dummy_tablet/proc/link_dummy(mob/living/carbon/human/dummy_to_link) + if(dummy_to_link) + linked_dummy = dummy_to_link + RegisterSignal(linked_dummy, COMSIG_PARENT_QDELETING, PROC_REF(self_delete)) + return + +/obj/item/device/professor_dummy_tablet/proc/self_delete() + SIGNAL_HANDLER + + UnregisterSignal(linked_dummy, COMSIG_PARENT_QDELETING) + linked_dummy = null + if(isstorage(loc)) + var/obj/item/storage/storage = loc + storage.remove_from_storage(src, get_turf(src)) + qdel(src) /obj/item/device/professor_dummy_tablet/attack_self(mob/user as mob) ..() interact(user) /obj/item/device/professor_dummy_tablet/interact(mob/user as mob) - if (isnull(linked_dummy)) + if(isnull(linked_dummy)) return - if (!is_adjacent_to_dummy(user)) + if(!is_adjacent_to_dummy(user)) return user.set_interaction(src) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/medical.dm b/code/game/objects/structures/crates_lockers/closets/secure/medical.dm index 80a5664567c3..8cc9b84bb023 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/medical.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/medical.dm @@ -171,3 +171,63 @@ . = ..() new /obj/item/storage/surgical_tray(src) new /obj/item/roller/surgical(src) + +/obj/structure/closet/secure_closet/professor_dummy + name = "professor dummy cabinet" + desc = "An ultrasafe cabinet containing Professor DUMMY and its tablet. Only accessible by Chief Medical Officers and Senior Listed Advisors." + icon_state = "surgical_wall_locked" + icon_closed = "surgical_wall_unlocked" + icon_locked = "surgical_wall_locked" + icon_opened = "surgical_wall_open" + icon_broken = "surgical_wall_spark" + health = null // Unbreakable + unacidable = TRUE + unslashable = TRUE + store_mobs = TRUE + wall_mounted = TRUE + +/obj/structure/closet/secure_closet/professor_dummy/Initialize() + . = ..() + var/mob/living/carbon/human/dummy/professor_dummy/spawned_dummy = new(src) + var/datum/equipment_preset/dummy_preset = /datum/equipment_preset/other/professor_dummy + arm_equipment(spawned_dummy, initial(dummy_preset.name), TRUE, FALSE) + +/obj/structure/closet/secure_closet/professor_dummy/togglelock(mob/living/user) + if(user.job == JOB_CMO || user.job == JOB_SEA) + return ..() + + to_chat(user, SPAN_WARNING("Only the [JOB_CMO] or the [JOB_SEA] can toggle this lock.")) + +/obj/structure/closet/secure_closet/professor_dummy/dump_contents() + if(locate(/mob/living/carbon/human/dummy/professor_dummy) in src) + visible_message(SPAN_HIGHDANGER("Professor DUMMY should only be used for teaching medical personnel, exclusively done by the [JOB_CMO] or the [JOB_SEA]. Do not abuse it.")) + return ..() + +/obj/structure/closet/secure_closet/professor_dummy/close() + for(var/mob/mob in loc) + if(!istype(mob, /mob/living/carbon/human/dummy/professor_dummy)) + visible_message(SPAN_WARNING("[src] won't budge!")) + return + ..() + + // Force locking upon closing it + locked = TRUE + update_icon() + +/obj/structure/closet/secure_closet/professor_dummy/flashbang(datum/source, obj/item/explosive/grenade/flashbang/FB) + return + +/obj/structure/closet/secure_closet/professor_dummy/proc/check_and_destroy_dummy() + var/mob/dummy = locate(/mob/living/carbon/human/dummy/professor_dummy) in src + if(dummy) + visible_message(SPAN_DANGER("Something in [src] blows apart!")) + playsound(src, 'sound/effects/metal_crash.ogg', 25, 1) + qdel(dummy) + +/obj/structure/closet/secure_closet/professor_dummy/emp_act(severity) + check_and_destroy_dummy() + ..() + +/obj/structure/closet/secure_closet/professor_dummy/ex_act(severity) + check_and_destroy_dummy() + ..() diff --git a/code/modules/gear_presets/other.dm b/code/modules/gear_presets/other.dm index cc9fcf269a4d..99b8bf634eed 100644 --- a/code/modules/gear_presets/other.dm +++ b/code/modules/gear_presets/other.dm @@ -861,7 +861,6 @@ var/datum/preferences/A = new A.randomize_appearance(new_human) - /datum/equipment_preset/other/professor_dummy/load_race(mob/living/carbon/human/new_human) . = ..() //Can't hug the dummy! Otherwise it's basically human... @@ -870,7 +869,7 @@ /datum/equipment_preset/other/professor_dummy/load_gear(mob/living/carbon/human/new_human) var/obj/item/device/professor_dummy_tablet/tablet = new /obj/item/device/professor_dummy_tablet(new_human) - tablet.link_mob(new_human) + tablet.link_dummy(new_human) new_human.equip_to_slot_or_del(tablet, WEAR_R_HAND) new_human.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical, WEAR_BODY) diff --git a/code/modules/mob/living/carbon/human/human_dummy.dm b/code/modules/mob/living/carbon/human/human_dummy.dm index 1f90c618fd38..b6fb109cd038 100644 --- a/code/modules/mob/living/carbon/human/human_dummy.dm +++ b/code/modules/mob/living/carbon/human/human_dummy.dm @@ -74,7 +74,6 @@ GLOBAL_LIST_EMPTY(dummy_mob_list) /mob/living/carbon/human/dummy/add_to_all_mob_huds() return - /mob/living/carbon/human/dummy/tutorial // Effectively an even more disabled dummy /mob/living/carbon/human/dummy/tutorial/Initialize(mapload) @@ -82,3 +81,18 @@ GLOBAL_LIST_EMPTY(dummy_mob_list) status_flags = GODMODE ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_TUTORIAL) anchored = TRUE + +// Professor Dummy, used by CMOs and SEAs to teach new nurses/doctors +/mob/living/carbon/human/dummy/professor_dummy/Initialize(mapload) + . = ..() + RegisterSignal(SSdcs, COMSIG_GLOB_HIJACK_LANDED, PROC_REF(destroy_upon_hijack)) + +/mob/living/carbon/human/dummy/professor_dummy/proc/destroy_upon_hijack() + SIGNAL_HANDLER + + visible_message(SPAN_WARNING("The [src] suddenly disintegrates!")) + dust(create_cause_data("hijack autodelete")) + +/mob/living/carbon/human/dummy/professor_dummy/Destroy() + UnregisterSignal(src, COMSIG_GLOB_HIJACK_LANDED) + return ..() diff --git a/maps/map_files/USS_Almayer/USS_Almayer.dmm b/maps/map_files/USS_Almayer/USS_Almayer.dmm index f4ba343d3bc2..0d15799978a9 100644 --- a/maps/map_files/USS_Almayer/USS_Almayer.dmm +++ b/maps/map_files/USS_Almayer/USS_Almayer.dmm @@ -7481,6 +7481,9 @@ pixel_y = 16 }, /obj/item/clothing/accessory/stethoscope, +/obj/structure/closet/secure_closet/professor_dummy{ + pixel_x = -32 + }, /turf/open/floor/almayer{ dir = 8; icon_state = "sterile_green_corner" @@ -19276,9 +19279,9 @@ }, /area/almayer/medical/morgue) "cnZ" = ( -/obj/item/tool/surgery/hemostat, -/obj/item/tool/surgery/scalpel, /obj/structure/surface/table/reinforced/prison, +/obj/item/tool/surgery/scalpel, +/obj/item/tool/surgery/hemostat, /turf/open/floor/almayer{ dir = 8; icon_state = "sterile_green_corner"