mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
Merge pull request #9425 from Ty-Omaha/weewoo3
Adds a siren to the Ambulance
This commit is contained in:
@@ -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.")
|
||||
Reference in New Issue
Block a user