[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:
CHOMPStation2StaffMirrorBot
2025-02-14 21:30:12 -07:00
committed by GitHub
parent a182c4528d
commit ff165c6c71
7 changed files with 59 additions and 77 deletions

View File

@@ -235,11 +235,10 @@
//If we're in an area that is fucking ideal, and we don't have to do anything, chances are we won't next tick either so why redo these calculations?
//JESUS FUCK. THERE ARE LITERALLY 250 OF YOU MOTHERFUCKERS ON ZLEVEL ONE AND YOU DO THIS SHIT EVERY TICK WHEN VERY OFTEN THERE IS NO REASON TO
if(pump_direction && pressure_checks == PRESSURE_CHECK_EXTERNAL && controller_iteration > 10) //99% of all vents
if(pump_direction && pressure_checks == PRESSURE_CHECK_EXTERNAL && Master.iteration > 10) //99% of all vents
//Fucking hibernate because you ain't doing shit.
hibernate = 1
spawn(rand(100,200)) //hibernate for 10 or 20 seconds randomly
hibernate = 0
addtimer(VARSET_CALLBACK(src, hibernate, 0), rand(10 SECONDS,20 SECONDS), TIMER_DELETE_ME) //hibernate randomly
if (power_draw >= 0)
@@ -380,13 +379,11 @@
return
if(signal.data["status"] != null)
spawn(2)
broadcast_status()
addtimer(CALLBACK(src, PROC_REF(broadcast_status)), 2, TIMER_DELETE_ME)
return //do not update_icon
//log_admin("DEBUG \[[world.timeofday]\]: vent_pump/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
spawn(2)
broadcast_status()
addtimer(CALLBACK(src, PROC_REF(broadcast_status)), 2, TIMER_DELETE_ME)
update_icon()
return

View File

@@ -160,11 +160,10 @@
power_draw = pump_gas(src, environment, air_contents, transfer_moles, power_rating)
if(scrubbing && power_draw < 0 && controller_iteration > 10) //99% of all scrubbers
if(scrubbing && power_draw < 0 && Master.iteration > 10) //99% of all scrubbers
//Fucking hibernate because you ain't doing shit.
hibernate = 1
spawn(rand(100,200)) //hibernate for 10 or 20 seconds randomly
hibernate = 0
addtimer(VARSET_CALLBACK(src, hibernate, 0), rand(10 SECONDS,20 SECONDS), TIMER_DELETE_ME) //hibernate randomly
if (power_draw >= 0)
last_power_draw = power_draw
@@ -253,13 +252,11 @@
return
if(signal.data["status"] != null)
spawn(2)
broadcast_status()
addtimer(CALLBACK(src, PROC_REF(broadcast_status)), 2, TIMER_DELETE_ME)
return //do not update_icon
// log_admin("DEBUG \[[world.timeofday]\]: vent_scrubber/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
spawn(2)
broadcast_status()
addtimer(CALLBACK(src, PROC_REF(broadcast_status)), 2, TIMER_DELETE_ME)
update_icon()
return

View File

@@ -8,7 +8,6 @@
var/global/datum/controller/game_controller/master_controller //Set in world.New()
var/global/controller_iteration = 0
var/global/last_tick_duration = 0
/datum/controller/game_controller

View File

@@ -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)

View File

@@ -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()

View File

@@ -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"

View File

@@ -38,7 +38,6 @@
/mob/living/silicon/robot/proc/use_power()
// Debug only
// to_world("DEBUG: life.dm line 35: cyborg use_power() called at tick [controller_iteration]")
used_power_this_tick = 0
for(var/V in components)
var/datum/robot_component/C = components[V]