diff --git a/code/modules/paperwork/desk_bell.dm b/code/modules/paperwork/desk_bell.dm new file mode 100644 index 000000000000..a69c114fa212 --- /dev/null +++ b/code/modules/paperwork/desk_bell.dm @@ -0,0 +1,96 @@ +// A receptionist's bell + +/obj/item/desk_bell + name = "desk bell" + desc = "The cornerstone of any customer service job. You feel an unending urge to ring it." + icon = 'icons/obj/objects.dmi' + icon_state = "desk_bell" + w_class = SIZE_SMALL + embeddable = FALSE + /// The amount of times this bell has been rang, used to check the chance it breaks. + var/times_rang = 0 + /// Is this bell broken? + var/broken_ringer = FALSE + /// Holds the time that the bell can next be rang. + COOLDOWN_DECLARE(ring_cooldown) + /// The length of the cooldown. Setting it to 0 will skip all cooldowns alltogether. + var/ring_cooldown_length = 1 SECONDS // This is here to protect against tinnitus. + /// The sound the bell makes. + var/ring_sound = 'sound/misc/desk_bell.ogg' + +/obj/item/desk_bell/attack_hand(mob/living/user) + if(!ishuman(user)) + return FALSE + if(!anchored) + return ..() + if(!COOLDOWN_FINISHED(src, ring_cooldown)) + return FALSE + if(!ring_bell(user)) + to_chat(user, SPAN_NOTICE("[src] is silent. Some idiot broke it.")) + return FALSE + return TRUE + +/obj/item/desk_bell/MouseDrop(atom/over_object) + var/mob/mob = usr + if(!Adjacent(mob) || anchored) + return + if(!ishuman(mob)) + return + + if(over_object == mob) + mob.put_in_hands(src) + +/obj/item/desk_bell/attackby(obj/item/item, mob/user) + //Repair the desk bell if its broken and we're using a screwdriver. + if(HAS_TRAIT(item, TRAIT_TOOL_SCREWDRIVER)) + if(broken_ringer) + visible_message(SPAN_NOTICE("[user] begins repairing [src]..."), SPAN_NOTICE("You begin repairing [src]...")) + if(do_after(user, 5 SECONDS, INTERRUPT_ALL, BUSY_ICON_GENERIC)) + user.visible_message(SPAN_NOTICE("[user] repairs [src]."), SPAN_NOTICE("You repair [src].")) + playsound(src, 'sound/items/Screwdriver.ogg', 50) + broken_ringer = FALSE + times_rang = 0 + return TRUE + return FALSE + + //Return at this point if we're not on a turf so we don't anchor or unanchor inside our bag/hands or inventory. + if(!isturf(loc)) + return + + //Wrenching down and unwrenching. + if(HAS_TRAIT(item, TRAIT_TOOL_WRENCH)) + if(user.a_intent == INTENT_HARM) + visible_message(SPAN_NOTICE("[user] begins taking apart [src]..."), SPAN_NOTICE("You begin taking apart [src]...")) + playsound(src, 'sound/items/deconstruct.ogg', 35) + if(do_after(user, 5 SECONDS, INTERRUPT_ALL, BUSY_ICON_GENERIC)) + visible_message(SPAN_NOTICE("[user] takes apart [src]."), SPAN_NOTICE("You take apart [src].")) + new /obj/item/stack/sheet/metal(get_turf(src)) + qdel(src) + return TRUE + else + user.visible_message("[user] begins [anchored ? "un" : ""]securing [src]...", "You begin [anchored ? "un" : ""]securing [src]...") + playsound(src, 'sound/items/Ratchet.ogg', 35, vary = TRUE) + if(!do_after(user, 2 SECONDS, INTERRUPT_ALL, BUSY_ICON_GENERIC)) + return FALSE + user.visible_message("[user] [anchored ? "un" : ""]secures [src].", "You [anchored ? "un" : ""]secure [src].") + anchored = !anchored + return TRUE + + +/// Check if the clapper breaks, and if it does, break it chance to break is 1% for every 100 rings of the bell. +/obj/item/desk_bell/proc/check_clapper(mob/living/user) + if(prob(times_rang / 100)) + to_chat(user, SPAN_NOTICE("You hear [src]'s clapper fall off of its hinge. Nice job hamfist, you broke it.")) + broken_ringer = TRUE + +/// Ring the bell. +/obj/item/desk_bell/proc/ring_bell(mob/living/user) + if(broken_ringer) + return FALSE + check_clapper(user) + // The lack of varying is intentional. The only variance occurs on the strike the bell breaks. + COOLDOWN_START(src, ring_cooldown, ring_cooldown_length) + playsound(src, ring_sound, 80) + flick("desk_bell_activate", src) + times_rang++ + return TRUE diff --git a/colonialmarines.dme b/colonialmarines.dme index ca8e80ef5067..cdf50f138240 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -2161,6 +2161,7 @@ #include "code\modules\organs\wound.dm" #include "code\modules\paperwork\carbonpaper.dm" #include "code\modules\paperwork\clipboard.dm" +#include "code\modules\paperwork\desk_bell.dm" #include "code\modules\paperwork\filingcabinet.dm" #include "code\modules\paperwork\folders.dm" #include "code\modules\paperwork\notepad.dm" diff --git a/icons/obj/objects.dmi b/icons/obj/objects.dmi index b62860559b16..bbc2665dde57 100644 Binary files a/icons/obj/objects.dmi and b/icons/obj/objects.dmi differ diff --git a/maps/map_files/USS_Almayer/USS_Almayer.dmm b/maps/map_files/USS_Almayer/USS_Almayer.dmm index 26c9816ca0c3..444badc36b1d 100644 --- a/maps/map_files/USS_Almayer/USS_Almayer.dmm +++ b/maps/map_files/USS_Almayer/USS_Almayer.dmm @@ -20030,6 +20030,11 @@ }, /obj/structure/machinery/door/firedoor/border_only/almayer, /obj/structure/surface/table/reinforced/almayer_blend/north, +/obj/item/desk_bell{ + pixel_x = -6; + pixel_y = -8; + anchored = 1 + }, /turf/open/floor/almayer{ icon_state = "test_floor4" }, @@ -20415,6 +20420,11 @@ }, /obj/structure/machinery/door/firedoor/border_only/almayer, /obj/structure/surface/table/reinforced/almayer_blend, +/obj/item/desk_bell{ + pixel_x = -6; + pixel_y = 10; + anchored = 1 + }, /turf/open/floor/almayer{ icon_state = "test_floor4" }, @@ -42054,8 +42064,11 @@ /obj/structure/machinery/door/window/eastleft{ req_access_txt = "8" }, -/obj/item/book/manual/medical_diagnostics_manual, -/obj/item/device/megaphone, +/obj/item/desk_bell{ + pixel_x = -6; + pixel_y = 10; + anchored = 1 + }, /turf/open/floor/almayer{ icon_state = "sterile_green" }, @@ -69247,6 +69260,8 @@ dir = 8; pixel_x = 17 }, +/obj/item/device/megaphone, +/obj/item/book/manual/medical_diagnostics_manual, /turf/open/floor/almayer{ icon_state = "sterile_green_side" }, @@ -77144,13 +77159,19 @@ }, /area/almayer/powered/agent) "wph" = ( -/obj/item/paper_bin/wy, +/obj/item/paper_bin/wy{ + pixel_x = 5 + }, /obj/structure/surface/table/woodentable/fancy, /obj/item/tool/pen/clicky, /obj/item/tool/pen/clicky, /obj/structure/machinery/status_display{ pixel_x = -32 }, +/obj/item/desk_bell{ + pixel_x = -8; + pixel_y = 8 + }, /turf/open/floor/carpet, /area/almayer/command/corporateliaison) "wpw" = ( @@ -77685,6 +77706,7 @@ dir = 1; name = "ship-grade camera" }, +/obj/item/desk_bell, /turf/open/floor/almayer{ dir = 6; icon_state = "red" diff --git a/sound/misc/desk_bell.ogg b/sound/misc/desk_bell.ogg new file mode 100644 index 000000000000..c3b143c1a11f Binary files /dev/null and b/sound/misc/desk_bell.ogg differ