From 6b7ace83c9d3b8c50a0c2dc7f5c551c7230519d7 Mon Sep 17 00:00:00 2001 From: Ty-Omaha Date: Mon, 27 Aug 2018 11:01:14 -0400 Subject: [PATCH] WEEWOO --- code/modules/vehicle/ambulance.dm | 54 ++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/code/modules/vehicle/ambulance.dm b/code/modules/vehicle/ambulance.dm index 38eb4af18aa..a80b2d3dfa6 100644 --- a/code/modules/vehicle/ambulance.dm +++ b/code/modules/vehicle/ambulance.dm @@ -4,7 +4,59 @@ icon_state = "docwagon2" keytype = /obj/item/key/ambulance var/obj/structure/stool/bed/amb_trolley/bed = null + var/datum/action/ambulance_alarm/AA + var/datum/looping_sound/ambulance_alarm/soundloop +/obj/vehicle/ambulance/New() + . = ..() + AA = new(src) + soundloop = new(list(src), FALSE) + +/datum/action/ambulance_alarm + name = "Toggle Sirens" + icon_icon = 'icons/obj/vehicles.dmi' + button_icon_state = "docwagon2" + check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUNNED | AB_CHECK_LYING | AB_CHECK_CONSCIOUS + var/toggle_cooldown = 40 + var/cooldown = 0 + + +/datum/action/ambulance_alarm/Trigger() + if(!..()) + return FALSE + + var/obj/vehicle/ambulance/A = target + + if(!istype(A) || !A.soundloop) + return FALSE + + if(world.time < cooldown + toggle_cooldown) + return FALSE + + cooldown = world.time + + if(A.soundloop.muted) + A.soundloop.start() + A.set_light(4,3,"#F70027") + else + A.soundloop.stop() + A.set_light(0) + + +/datum/looping_sound/ambulance_alarm + start_length = 0 + mid_sounds = list('sound/items/WEEOO1.ogg' = 1) + mid_length = 14 + volume = 100 + + +/obj/vehicle/ambulance/post_buckle_mob(mob/living/M) + . = ..() + if(has_buckled_mobs()) + AA.Grant(M) + else + AA.Remove(M) + /obj/item/key/ambulance name = "ambulance key" @@ -56,4 +108,4 @@ to_chat(usr, "You unhook the bed to the ambulance.") else amb.bed = src - to_chat(usr, "You hook the bed to the ambulance.") + to_chat(usr, "You hook the bed to the ambulance.") \ No newline at end of file