mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-11 07:58:57 +01:00
4ecb0bc21c
Repaths obj/machinery to obj/structure/machinery. **Note for reviewers:** the only meaningful changed code exists within **code/game/objects/structures.dm** and **code/game/objects/structures/_machinery.dm**, largely concerning damage procs. With the exception of moving airlock defines to their own file, ALL OTHER CHANGES ARE STRICTLY PATH CHANGES. Objects, _categorically_, are largely divided between those you can hold in your hand/inventory and those you can't. Machinery objects are already subtypes of Structures behaviorally, this PR just makes their pathing reflect that, and allows for future work (tool actions, more health/destruction functionality) to be developed without unnecessary code duplication. I have tested this PR by loading up the Horizon and dismantling various machines and structures with tools, shooting guns of various types throughout the ship, and detonating a bunch of explosions throughout the ship.
42 lines
1.3 KiB
Plaintext
42 lines
1.3 KiB
Plaintext
/////SINGULARITY SPAWNER
|
|
/obj/structure/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/structure/machinery/the_singularitygen/update_icon()
|
|
ClearOverlays()
|
|
if(anchored)
|
|
AddOverlays("[icon_state]+bolts")
|
|
var/image/lights_image = image(icon, null, "[icon_state]+lights")
|
|
lights_image.plane = ABOVE_LIGHTING_PLANE
|
|
AddOverlays(lights_image)
|
|
|
|
/obj/structure/machinery/the_singularitygen/process()
|
|
var/turf/T = get_turf(src)
|
|
if(src.energy >= 200)
|
|
new creation_type(T, 50)
|
|
if(src) qdel(src)
|
|
|
|
/obj/structure/machinery/the_singularitygen/attackby(obj/item/attacking_item, mob/user)
|
|
if(attacking_item.tool_behaviour == TOOL_WRENCH)
|
|
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 ..()
|