mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
[MIRROR] Removing random sleeps (#10165)
Co-authored-by: Cameron Lennox <killer65311@gmail.com> Co-authored-by: Willburd <7099514+Willburd@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a182c4528d
commit
ff165c6c71
@@ -5,18 +5,29 @@
|
||||
icon_state = "emp"
|
||||
det_time = 20
|
||||
origin_tech = list(TECH_BLUESPACE = 4, TECH_MATERIAL = 4)
|
||||
var/light_sound = 'sound/effects/phasein.ogg'
|
||||
var/blast_sound = 'sound/effects/bang.ogg'
|
||||
|
||||
/obj/item/grenade/anti_photon/detonate()
|
||||
playsound(src, 'sound/effects/phasein.ogg', 50, 1, 5)
|
||||
/obj/item/grenade/anti_photon/detonate(var/parent_callback = FALSE)
|
||||
if(parent_callback) // An awful way to do this, but the spawn() setup left me no choice when porting to timers
|
||||
..()
|
||||
return
|
||||
playsound(src, light_sound, 50, 1, 5)
|
||||
set_light(10, -10, "#FFFFFF")
|
||||
|
||||
var/extra_delay = rand(0,90)
|
||||
addtimer(CALLBACK(src, PROC_REF(grenade_light),extra_delay), 200 + extra_delay, TIMER_DELETE_ME)
|
||||
|
||||
spawn(extra_delay)
|
||||
spawn(200)
|
||||
if(prob(10+extra_delay))
|
||||
set_light(10, 10, "#[num2hex(rand(64,255))][num2hex(rand(64,255))][num2hex(rand(64,255))]")
|
||||
spawn(210)
|
||||
..()
|
||||
playsound(src, 'sound/effects/bang.ogg', 50, 1, 5)
|
||||
qdel(src)
|
||||
/obj/item/grenade/anti_photon/proc/grenade_light(var/extra_delay)
|
||||
PRIVATE_PROC(TRUE)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
if(prob(10+extra_delay))
|
||||
set_light(10, 10, "#[num2hex(rand(64,255))][num2hex(rand(64,255))][num2hex(rand(64,255))]")
|
||||
addtimer(CALLBACK(src, PROC_REF(grenade_blast)), 10, TIMER_DELETE_ME)
|
||||
|
||||
/obj/item/grenade/anti_photon/proc/grenade_blast()
|
||||
PRIVATE_PROC(TRUE)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
detonate(TRUE) // See above for this sinful choice
|
||||
playsound(src, blast_sound, 50, 1, 5)
|
||||
qdel(src)
|
||||
|
||||
@@ -25,8 +25,7 @@
|
||||
|
||||
activate(user)
|
||||
add_fingerprint(user)
|
||||
spawn(5)
|
||||
detonate()
|
||||
addtimer(CALLBACK(src, PROC_REF(detonate)), 5, TIMER_DELETE_ME)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
@@ -39,9 +38,7 @@
|
||||
active = 1
|
||||
icon_state = initial(icon_state) + "_active"
|
||||
playsound(src, 'sound/weapons/armbomb.ogg', 75, 1, -3)
|
||||
spawn(det_time)
|
||||
detonate()
|
||||
return
|
||||
addtimer(CALLBACK(src, PROC_REF(detonate)), det_time, TIMER_DELETE_ME)
|
||||
user.set_dir(get_dir(user, target))
|
||||
user.drop_item()
|
||||
var/t = (isturf(target) ? target : target.loc)
|
||||
@@ -82,9 +79,7 @@
|
||||
active = 1
|
||||
playsound(src, arm_sound, 75, 1, -3)
|
||||
|
||||
spawn(det_time)
|
||||
detonate()
|
||||
return
|
||||
addtimer(CALLBACK(src, PROC_REF(detonate)), det_time, TIMER_DELETE_ME)
|
||||
|
||||
|
||||
/obj/item/grenade/proc/detonate()
|
||||
|
||||
@@ -220,21 +220,30 @@
|
||||
if(temperature_settings[watertemp] < T20C)
|
||||
return //no mist for cold water
|
||||
if(!ismist)
|
||||
spawn(50)
|
||||
if(src && on)
|
||||
ismist = 1
|
||||
mymist = new /obj/effect/mist(loc)
|
||||
addtimer(CALLBACK(src, PROC_REF(spawn_mist)), 50, TIMER_DELETE_ME)
|
||||
else
|
||||
ismist = 1
|
||||
mymist = new /obj/effect/mist(loc)
|
||||
else if(ismist)
|
||||
ismist = 1
|
||||
mymist = new /obj/effect/mist(loc)
|
||||
spawn(250)
|
||||
if(src && !on)
|
||||
qdel(mymist)
|
||||
mymist = null
|
||||
ismist = 0
|
||||
addtimer(CALLBACK(src, PROC_REF(remove_mist)), 250, TIMER_DELETE_ME)
|
||||
|
||||
/obj/machinery/shower/proc/spawn_mist()
|
||||
PRIVATE_PROC(TRUE)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
if(on)
|
||||
ismist = 1
|
||||
mymist = new /obj/effect/mist(loc)
|
||||
|
||||
/obj/machinery/shower/proc/remove_mist()
|
||||
PRIVATE_PROC(TRUE)
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
if(!on)
|
||||
qdel(mymist)
|
||||
mymist = null
|
||||
ismist = 0
|
||||
|
||||
|
||||
//Yes, showers are super powerful as far as washing goes.
|
||||
/obj/machinery/shower/proc/wash(atom/movable/O as obj|mob)
|
||||
@@ -273,8 +282,7 @@
|
||||
is_washing = 1
|
||||
var/turf/T = get_turf(src)
|
||||
T.clean(src)
|
||||
spawn(100)
|
||||
is_washing = 0
|
||||
addtimer(VARSET_CALLBACK(src, is_washing, 0), 100, TIMER_DELETE_ME)
|
||||
|
||||
/obj/machinery/shower/proc/process_heat(mob/living/M)
|
||||
if(!on || !istype(M)) return
|
||||
@@ -310,8 +318,7 @@
|
||||
if(honk_text)
|
||||
audible_message(span_maroon("[honk_text]"))
|
||||
src.add_fingerprint(user)
|
||||
spawn(20)
|
||||
spam_flag = 0
|
||||
addtimer(VARSET_CALLBACK(src, spam_flag, 0), 20, TIMER_DELETE_ME)
|
||||
return
|
||||
|
||||
//Admin spawn duckies
|
||||
@@ -327,7 +334,7 @@
|
||||
|
||||
/obj/item/bikehorn/rubberducky/red/attack_self(mob/user as mob)
|
||||
if(honk_count >= 3)
|
||||
var/turf/epicenter = src.loc
|
||||
var/turf/epicenter = get_turf(src)
|
||||
explosion(epicenter, 0, 0, 1, 3)
|
||||
qdel(src)
|
||||
return
|
||||
@@ -338,8 +345,7 @@
|
||||
if(honk_text)
|
||||
audible_message(span_maroon("[honk_text]"))
|
||||
honk_count ++
|
||||
spawn(20)
|
||||
spam_flag = 0
|
||||
addtimer(VARSET_CALLBACK(src, spam_flag, 0), 20, TIMER_DELETE_ME)
|
||||
return
|
||||
|
||||
/obj/item/bikehorn/rubberducky/blue
|
||||
@@ -360,8 +366,7 @@
|
||||
if(honk_text)
|
||||
audible_message(span_maroon("[honk_text]"))
|
||||
src.add_fingerprint(user)
|
||||
spawn(20)
|
||||
spam_flag = 0
|
||||
addtimer(VARSET_CALLBACK(src, spam_flag, 0), 20, TIMER_DELETE_ME)
|
||||
return
|
||||
|
||||
/obj/item/bikehorn/rubberducky/pink
|
||||
@@ -386,8 +391,7 @@
|
||||
user.drop_item()
|
||||
user.forceMove(src)
|
||||
to_chat(user, span_vnotice("You have been swallowed alive by the rubber ducky. Your entire body compacted up and squeezed into the tiny space that makes up the oddly realistic and not at all rubbery stomach. The walls themselves are kneading over you, grinding some sort of fluids into your trapped body. You can even hear the sound of bodily functions echoing around you..."))
|
||||
spawn(20)
|
||||
spam_flag = 0
|
||||
addtimer(VARSET_CALLBACK(src, spam_flag, 0), 20, TIMER_DELETE_ME)
|
||||
return
|
||||
|
||||
/obj/item/bikehorn/rubberducky/pink/container_resist(var/mob/living/escapee)
|
||||
@@ -455,8 +459,7 @@
|
||||
if(honk_text)
|
||||
audible_message(span_maroon("[honk_text]"))
|
||||
src.add_fingerprint(user)
|
||||
spawn(20)
|
||||
spam_flag = 0
|
||||
addtimer(VARSET_CALLBACK(src, spam_flag, 0), 20, TIMER_DELETE_ME)
|
||||
return
|
||||
|
||||
/obj/item/bikehorn/rubberducky/white
|
||||
@@ -476,8 +479,6 @@
|
||||
if(honk_text)
|
||||
audible_message(span_maroon("[honk_text]"))
|
||||
src.add_fingerprint(user)
|
||||
spawn(20)
|
||||
spam_flag = 0 //leaving this in incase it doesn't qdel somehow
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
@@ -487,25 +488,8 @@
|
||||
icon = 'icons/obj/watercloset.dmi'
|
||||
icon_state = "rubberducky_black"
|
||||
item_state = "rubberducky_black"
|
||||
det_time = 20
|
||||
var/honk_text = 0
|
||||
|
||||
/obj/item/grenade/anti_photon/rubberducky/black/detonate()
|
||||
playsound(src, 'sound/voice/quack.ogg', 50, 1, 5)
|
||||
set_light(10, -10, "#FFFFFF")
|
||||
|
||||
var/extra_delay = rand(0,90)
|
||||
|
||||
spawn(extra_delay)
|
||||
spawn(200)
|
||||
if(prob(10+extra_delay))
|
||||
set_light(10, 10, "#[num2hex(rand(64,255))][num2hex(rand(64,255))][num2hex(rand(64,255))]")
|
||||
spawn(210)
|
||||
..()
|
||||
playsound(src, 'sound/voice/quack.ogg', 50, 1, 5)
|
||||
if(honk_text)
|
||||
audible_message(span_maroon("[honk_text]"))
|
||||
qdel(src)
|
||||
light_sound = 'sound/voice/quack.ogg'
|
||||
blast_sound = 'sound/voice/quack.ogg'
|
||||
|
||||
/obj/structure/sink
|
||||
name = "sink"
|
||||
|
||||
Reference in New Issue
Block a user