Files
Aurora.3/code/modules/power/singularity/generator.dm
T
c1d241594b Planes & Layers part 2: Plane Masters (#18749)
Part 2 of the PR series to bring /tg/'s and bay's plane masters to
Aurora, the lack of which is blocking several features we want.

This ports over the easier to understand Bay version of plane masters,
which is detailed in the relevant readme file in the code. Example
effect code for a warp effect is also in, which has been implemented for
gravity catapults.

Relies on #18741

---------

Signed-off-by: Matt Atlas <mattiathebest2000@hotmail.it>
Co-authored-by: Cody Brittain <cbrittain10@live.com>
Co-authored-by: Matt Atlas <mattiathebest2000@hotmail.it>
2024-04-13 18:07:51 +00:00

42 lines
1.3 KiB
Plaintext

/////SINGULARITY SPAWNER
/obj/machinery/the_singularitygen
name = "gravitational singularity generator"
desc = "An Odd Device which produces a Gravitational Singularity when set up."
icon = 'icons/obj/singularity.dmi'
icon_state = "TheSingGen"
anchored = 0
density = 1
use_power = POWER_USE_OFF
var/energy = 0
var/creation_type = /obj/singularity
/obj/machinery/the_singularitygen/update_icon()
cut_overlays()
if(anchored)
add_overlay("[icon_state]+bolts")
var/image/lights_image = image(icon, null, "[icon_state]+lights")
lights_image.plane = EFFECTS_ABOVE_LIGHTING_PLANE
add_overlay(lights_image)
/obj/machinery/the_singularitygen/process()
var/turf/T = get_turf(src)
if(src.energy >= 200)
new creation_type(T, 50)
if(src) qdel(src)
/obj/machinery/the_singularitygen/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.iswrench())
anchored = !anchored
attacking_item.play_tool_sound(get_turf(src), 75)
if(anchored)
user.visible_message("[user.name] secures [src.name] to the floor.",
"You secure the [src.name] to the floor.",
"You hear a ratchet")
else
user.visible_message("[user.name] unsecures [src.name] from the floor.",
"You unsecure the [src.name] from the floor.",
"You hear a ratchet")
update_icon()
return
return ..()