Add checks to allow Tesla to fully dissipate once it runs out of energy.

This commit is contained in:
Leshana
2018-01-21 16:19:13 -05:00
parent 62e58702f7
commit 71b3ef47a9
13 changed files with 932 additions and 5 deletions
+7 -1
View File
@@ -55,7 +55,8 @@
/obj/singularity/energy_ball/process(var/wait = 20)
set waitfor = FALSE
if(!orbiting)
handle_energy()
if (handle_energy())
return
move_the_basket_ball(max(wait - 5, 4 + orbiting_balls.len * 1.5))
@@ -91,6 +92,11 @@
sleep(1) // So movement is smooth
/obj/singularity/energy_ball/proc/handle_energy()
if (energy <= 0)
investigate_log("collapsed.", I_SINGULO)
qdel(src)
return TRUE
if(energy >= energy_to_raise)
energy_to_lower = energy_to_raise - 20
energy_to_raise = energy_to_raise * 1.25