Make Singulo Stable Again (#4521)

* Make Singulo Stable Again

* Prevents emitter beam effects from being pulled by singulo.  Now watch them hit the field gens.
* Prevent singulo from consuming the PA particle effects.  It already gets fed by impact, don't try to eat them.
* Improve the Setup Singularity debug verb to do more better setup (including PA)
* Fix the energy dissipation values so that singularity does not just keep on growing even when setup properly.

* Enhance singularity proc/eat()

* Use `var/simulated` as a more generic way to ignore lighting overlays etc
* Remove redundant code in the rest of the proc body.
* Slight optimization: avoiding typecheck in loop over return from orange()
This commit is contained in:
Leshana
2018-01-13 22:43:32 -05:00
committed by Anewbe
parent e96408e710
commit 0e6f2fcb09
5 changed files with 37 additions and 20 deletions

View File

@@ -512,12 +512,25 @@
return return
for(var/obj/machinery/power/emitter/E in world) for(var/obj/machinery/power/emitter/E in world)
if(E.anchored) if(istype(get_area(E), /area/space))
E.active = 1 E.anchored = TRUE
E.state = 2
E.connect_to_network()
E.active = TRUE
for(var/obj/machinery/field_generator/F in world) for(var/obj/machinery/field_generator/F in world)
if(F.anchored) if(istype(get_area(F), /area/space))
F.Varedit_start = 1 F.Varedit_start = 1
for(var/obj/structure/particle_accelerator/PA in world)
PA.anchored = TRUE
PA.construction_state = 3
PA.update_icon()
for(var/obj/machinery/particle_accelerator/PA in world)
PA.anchored = TRUE
PA.construction_state = 3
PA.update_icon()
spawn(30) spawn(30)
for(var/obj/machinery/the_singularitygen/G in world) for(var/obj/machinery/the_singularitygen/G in world)
if(G.anchored) if(G.anchored)
@@ -549,10 +562,6 @@
if(!Rad.active) if(!Rad.active)
Rad.toggle_power() Rad.toggle_power()
for(var/obj/machinery/power/smes/SMES in world)
if(SMES.anchored)
SMES.input_attempt = 1
/client/proc/setup_supermatter_engine() /client/proc/setup_supermatter_engine()
set category = "Debug" set category = "Debug"
set name = "Setup supermatter" set name = "Setup supermatter"

View File

@@ -95,6 +95,9 @@
/obj/item/projectile/beam/emitter/singularity_pull() /obj/item/projectile/beam/emitter/singularity_pull()
return return
/obj/effect/projectile/emitter/singularity_pull()
return
/obj/item/weapon/storage/backpack/holding/singularity_act(S, current_size) /obj/item/weapon/storage/backpack/holding/singularity_act(S, current_size)
var/dist = max((current_size - 2), 1) var/dist = max((current_size - 2), 1)
explosion(src.loc,(dist),(dist*2),(dist*4)) explosion(src.loc,(dist),(dist*2),(dist*4))
@@ -128,6 +131,9 @@
/turf/space/singularity_act() /turf/space/singularity_act()
return return
/turf/simulated/open/singularity_act()
return
/******************* /*******************
* Nar-Sie Act/Pull * * Nar-Sie Act/Pull *
*******************/ *******************/

View File

@@ -71,7 +71,8 @@
qdel(src) qdel(src)
return return
/obj/effect/accelerated_particle/singularity_act()
return
/obj/effect/accelerated_particle/proc/toxmob(var/mob/living/M) /obj/effect/accelerated_particle/proc/toxmob(var/mob/living/M)
var/radiation = (energy*2) var/radiation = (energy*2)

View File

@@ -47,7 +47,7 @@
/obj/singularity/Destroy() /obj/singularity/Destroy()
processing_objects -= src processing_objects -= src
..() return ..()
/obj/singularity/attack_hand(mob/user as mob) /obj/singularity/attack_hand(mob/user as mob)
consume(user) consume(user)
@@ -169,7 +169,7 @@
pixel_y = -64 pixel_y = -64
grav_pull = 8 grav_pull = 8
consume_range = 2 consume_range = 2
dissipate_delay = 10 dissipate_delay = 4
dissipate_track = 0 dissipate_track = 0
dissipate_strength = 20 dissipate_strength = 20
overlays = 0 overlays = 0
@@ -267,19 +267,15 @@
return 1 return 1
/obj/singularity/proc/eat() /obj/singularity/proc/eat()
for(var/atom/X in orange(grav_pull, src)) for(var/T in orange(grav_pull, src))
var/atom/X = T
if(!X.simulated)
continue
var/dist = get_dist(X, src) var/dist = get_dist(X, src)
var/obj/singularity/S = src
if(!istype(src))
return
if(dist > consume_range) if(dist > consume_range)
X.singularity_pull(S, current_size) X.singularity_pull(src, current_size)
else if(dist <= consume_range) else
consume(X) consume(X)
//for (var/turf/T in trange(grav_pull, src)) //TODO: Create a similar trange for orange to prevent snowflake of self check.
// consume(T)
return return
/obj/singularity/proc/consume(const/atom/A) /obj/singularity/proc/consume(const/atom/A)

View File

@@ -0,0 +1,5 @@
author: Leshana
delete-after: True
changes:
- tweak: "Fix singularity energy balance so it is stable under normal operation."
- bugfix: "Fix emitter beams and PA effects from being grav pulled or consumed."