mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
machine.process() now uses a return value to remove itself from the processing machines list. This is more efficient and will help reduce costs especially at round start where some 5000+ machines were removed from the list using first-find. Now there is no searching involved. Instead of machines.Remove(src) just do .=PROCESS_KILL that will return the flag to the proc which called it (the MC) and trigger its removal from the list. If you're deleting something don't even bother removing it from the machines list, there is no need to. Simplified the last_processed stuff for the MC. It's now a single variable rather than 3. It is simply a typepath rather than a reference to an object (this is so it works even if said object is deleted) MC stats in admin status_panels now show the length of the processing lists (indicated by #). I've just realised I forgot to mention what the abbreviations are: The less obvious ones are: Dis=diseases; Net=pipes; Pnet=powernets; Mch=Machines; Tick=the game-mode ticker. Beach-water now uses an overlay image rather than a separate object. Fixed a typo in the shuttle console. Hydroponics trays no longer use first-find within their process() for checking the plant is in the tray (why is that even there anyway? talk about lazy) Removed some junk/placeholder procs like organ/proc/process() return Removed newscasters from the processing machines lists. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4603 316c924e-a436-60f5-8080-3fe189b3f50e
32 lines
1.0 KiB
Plaintext
32 lines
1.0 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 = 0
|
|
var/energy = 0
|
|
|
|
/obj/machinery/the_singularitygen/process()
|
|
var/turf/T = get_turf(src)
|
|
if(src.energy >= 200)
|
|
new /obj/machinery/singularity/(T, 50)
|
|
if(src) del(src)
|
|
|
|
/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user)
|
|
if(istype(W, /obj/item/weapon/wrench))
|
|
anchored = !anchored
|
|
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
|
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")
|
|
return
|
|
return ..()
|