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

67 lines
1.6 KiB
Plaintext

//
// Shield Diffusers
//
/obj/structure/machinery/shield_diffuser
name = "shield diffuser"
desc = "A small underfloor device specifically designed to disrupt energy barriers."
icon = 'icons/obj/machinery/shielding.dmi'
icon_state = "fdiffuser_on"
use_power = POWER_USE_IDLE
idle_power_usage = 0
active_power_usage = 0
anchored = TRUE
density = FALSE
level = 1
var/diffuser_enabled = TRUE
var/diffuser_range = 0 // 1x1 tiles, including the tile its on.
/obj/structure/machinery/shield_diffuser/feedback_hints(mob/user, distance, is_adjacent)
. += ..()
. += "It is [diffuser_enabled ? "enabled" : "disabled"]."
/obj/structure/machinery/shield_diffuser/process()
if(stat & BROKEN)
return PROCESS_KILL
if(!diffuser_enabled)
return
for(var/obj/effect/energy_field/S in range(diffuser_range, src))
S.diffuse()
/obj/structure/machinery/shield_diffuser/update_icon()
if(stat & BROKEN || !diffuser_enabled)
icon_state = "fdiffuser_off"
else
icon_state = "fdiffuser_on"
/obj/structure/machinery/shield_diffuser/attack_ai(mob/user)
if(!ai_can_interact(user))
return
return attack_hand(user)
/obj/structure/machinery/shield_diffuser/attack_hand(mob/user)
if(stat & BROKEN)
return
interact(user)
/obj/structure/machinery/shield_diffuser/interact(mob/user)
diffuser_enabled = !diffuser_enabled
update_icon()
to_chat(user, "You turn \the [src] [diffuser_enabled ? "on" : "off"].")
/obj/structure/machinery/shield_diffuser/power_change()
..()
update_icon()
//
// Shield Diffuser Variants
//
// 3x3 Range Shield Diffuser
/obj/structure/machinery/shield_diffuser/threebythree
diffuser_range = 1 // 3x3 tiles, including the tile its on.