mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-14 17:36:52 +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.
30 lines
1.4 KiB
Plaintext
30 lines
1.4 KiB
Plaintext
// ###############################################################################
|
|
// # ITEM: FRACTAL ENERGY REACTOR #
|
|
// # FUNCTION: Generate infinite electricity. Used for map testing. #
|
|
// ###############################################################################
|
|
|
|
/obj/structure/machinery/power/fractal_reactor
|
|
name = "Fractal Energy Reactor"
|
|
desc = "This thing drains power from fractal-subspace." // (DEBUG ITEM: INFINITE POWERSOURCE FOR MAP TESTING. CONTACT DEVELOPERS IF FOUND.)"
|
|
icon = 'icons/obj/power.dmi'
|
|
icon_state = "tracker" //ICON stolen from solar tracker. There is no need to make new texture for debug item
|
|
anchored = 1
|
|
density = 1
|
|
var/power_generation_rate = 1000000 //Defaults to 1MW of power.
|
|
var/powernet_connection_failed = 0
|
|
var/mapped_in = 0 //Do not announce creation when it's mapped in.
|
|
|
|
// This should be only used on Dev for testing purposes.
|
|
/obj/structure/machinery/power/fractal_reactor/New()
|
|
..()
|
|
if(!mapped_in)
|
|
log_and_message_admins("<b><span class='alert'>WARNING:</span> Map testing power source activated at: X:[src.loc.x] Y:[src.loc.y] Z:[src.loc.z]</b>")
|
|
|
|
/obj/structure/machinery/power/fractal_reactor/process()
|
|
if(!powernet && !powernet_connection_failed)
|
|
if(!connect_to_network())
|
|
powernet_connection_failed = 1
|
|
spawn(150) // Error! Check again in 15 seconds.
|
|
powernet_connection_failed = 0
|
|
ADD_TO_POWERNET(src, power_generation_rate)
|