mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 07:38:05 +01:00
Remove spawn in favour of timers (#50562)
* Remove spawn in favour of timers * aaaaaa * Qdels Co-Authored-By: Rohesie <rohesie@gmail.com> Co-authored-by: Rohesie <rohesie@gmail.com>
This commit is contained in:
@@ -148,6 +148,36 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/structure/spider/spiderling/proc/cancel_vent_move()
|
||||
forceMove(entry_vent)
|
||||
entry_vent = null
|
||||
|
||||
/obj/structure/spider/spiderling/proc/vent_move(obj/machinery/atmospherics/components/unary/vent_pump/exit_vent)
|
||||
if(QDELETED(exit_vent) || exit_vent.welded)
|
||||
cancel_vent_move()
|
||||
return
|
||||
|
||||
forceMove(exit_vent)
|
||||
var/travel_time = round(get_dist(loc, exit_vent.loc) / 2)
|
||||
addtimer(CALLBACK(src, .proc/do_vent_move, exit_vent, travel_time), travel_time)
|
||||
|
||||
/obj/structure/spider/spiderling/proc/do_vent_move(obj/machinery/atmospherics/components/unary/vent_pump/exit_vent, travel_time)
|
||||
if(QDELETED(exit_vent) || exit_vent.welded)
|
||||
cancel_vent_move()
|
||||
return
|
||||
|
||||
if(prob(50))
|
||||
audible_message("<span class='hear'>You hear something scampering through the ventilation ducts.</span>")
|
||||
|
||||
addtimer(CALLBACK(src, .proc/finish_vent_move, exit_vent), travel_time)
|
||||
|
||||
/obj/structure/spider/spiderling/proc/finish_vent_move(obj/machinery/atmospherics/components/unary/vent_pump/exit_vent)
|
||||
if(QDELETED(exit_vent) || exit_vent.welded)
|
||||
cancel_vent_move()
|
||||
return
|
||||
forceMove(exit_vent.loc)
|
||||
entry_vent = null
|
||||
|
||||
/obj/structure/spider/spiderling/process()
|
||||
if(travelling_in_vent)
|
||||
if(isturf(loc))
|
||||
@@ -167,34 +197,8 @@
|
||||
visible_message("<B>[src] scrambles into the ventilation ducts!</B>", \
|
||||
"<span class='hear'>You hear something scampering through the ventilation ducts.</span>")
|
||||
|
||||
spawn(rand(20,60))
|
||||
if(!exit_vent || exit_vent.welded)
|
||||
forceMove(entry_vent)
|
||||
entry_vent = null
|
||||
return
|
||||
addtimer(CALLBACK(src, .proc/vent_move, exit_vent), rand(20,60))
|
||||
|
||||
forceMove(exit_vent)
|
||||
var/travel_time = round(get_dist(loc, exit_vent.loc) / 2)
|
||||
spawn(travel_time)
|
||||
|
||||
if(!exit_vent || exit_vent.welded)
|
||||
forceMove(entry_vent)
|
||||
entry_vent = null
|
||||
return
|
||||
|
||||
if(prob(50))
|
||||
audible_message("<span class='hear'>You hear something scampering through the ventilation ducts.</span>")
|
||||
sleep(travel_time)
|
||||
|
||||
if(!exit_vent || exit_vent.welded)
|
||||
forceMove(entry_vent)
|
||||
entry_vent = null
|
||||
return
|
||||
forceMove(exit_vent.loc)
|
||||
entry_vent = null
|
||||
var/area/new_area = get_area(loc)
|
||||
if(new_area)
|
||||
new_area.Entered(src)
|
||||
//=================
|
||||
|
||||
else if(prob(33))
|
||||
|
||||
Reference in New Issue
Block a user