Files
Batrachophreno 4ecb0bc21c Repath obj/machinery to obj/structure/machinery [MDB Ignore] (#22500)
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.
2026-05-26 19:35:48 +00:00

86 lines
2.4 KiB
Plaintext

/obj/structure/machinery/iff_beacon
name = "IFF transponder" //This object handles ship identification on sensors.
desc = "A complex set of various bluespace and subspace arrays that transmit a ship's identification tags."
icon = 'icons/obj/machinery/iff_transponder.dmi'
icon_state = "iff"
anchored = TRUE
idle_power_usage = 500
component_types = list(
/obj/item/circuitboard/iff_beacon,
/obj/item/stack/cable_coil = 2,
/obj/item/stock_parts/subspace/transmitter,
/obj/item/stock_parts/capacitor
)
var/datum/wires/iff/wires
var/disabled = FALSE
var/obfuscating = FALSE
var/can_change_class = TRUE
var/can_change_name = TRUE
/obj/structure/machinery/iff_beacon/Initialize()
..()
wires = new(src)
return INITIALIZE_HINT_LATELOAD
/obj/structure/machinery/iff_beacon/LateInitialize()
. = ..()
if(SSatlas.current_map.use_overmap && !linked)
var/my_sector = GLOB.map_sectors["[z]"]
if (istype(my_sector, /obj/effect/overmap/visitable))
attempt_hook_up(my_sector)
/obj/structure/machinery/iff_beacon/attackby(obj/item/attacking_item, mob/user)
if(default_deconstruction_screwdriver(user, attacking_item))
return TRUE
if(default_deconstruction_crowbar(user, attacking_item))
return TRUE
if(default_part_replacement(user, attacking_item))
return TRUE
if(panel_open)
wires.interact(user)
return TRUE
..()
/obj/structure/machinery/iff_beacon/proc/toggle()
if(disabled)
return // No turning on if broken.
if(!use_power) //need some juice to kickstart
use_power_oneoff(idle_power_usage*5)
update_use_power(!use_power)
if(use_power) //We are online now. Back to displaying real name.
linked.update_obfuscated(FALSE)
obfuscating = FALSE
else
linked.update_obfuscated(TRUE)
obfuscating = TRUE
/obj/structure/machinery/iff_beacon/proc/disable()
update_use_power(POWER_USE_OFF)
obfuscating = TRUE
disabled = TRUE
linked.update_obfuscated(TRUE)
/obj/structure/machinery/iff_beacon/proc/enable()
disabled = FALSE
toggle()
/obj/structure/machinery/iff_beacon/update_icon()
icon_state = initial(icon_state)
ClearOverlays()
if(panel_open)
icon_state += "_o"
if(!operable() || !use_power)
icon_state += "_off"
/obj/structure/machinery/iff_beacon/horizon
can_change_class = FALSE
can_change_name = FALSE
/obj/structure/machinery/iff_beacon/horizon/shuttle
icon = 'icons/obj/spaceship/scc/helm_pieces.dmi'
icon_state = "iff"
/obj/structure/machinery/iff_beacon/name_change
can_change_name = TRUE
can_change_class = FALSE