Files
Batrachophreno 5277251959 Tool behaviors port (#21663)
For a robust crafting system, I need a new materials framework.
For a new materials framework, I need to clean up reagents.
To clean up reagents, I need to pare down foods from reagent holders.
To pare down foods from reagent holders, I need to port edibility
components.
To port edibility components, I need to port processing components.
To port processing components, I need to port tool behaviors.

This is all back-end code, no new features or functionality from this.
2026-01-27 08:44:49 +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()
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/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.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 ..()