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

49 lines
1.2 KiB
Plaintext

//Engine component object
GLOBAL_LIST_INIT_TYPED(ship_engines, /datum/ship_engine, list())
/datum/ship_engine
var/name = "ship engine"
var/obj/structure/machinery/holder //actual engine object
/datum/ship_engine/New(var/obj/structure/machinery/_holder)
..()
holder = _holder
GLOB.ship_engines += src
/datum/ship_engine/proc/can_burn()
return 0
/// Tries to fire the engine with power modifier (0..1). Returns thrust.
/// Power modifier is intended to be used for maneuvers or the like,
/// that should use less/more fuel/electricity than an actual burn.
/datum/ship_engine/proc/burn(var/power_modifier = 1)
return 0
/// Returns status string for this engine
/datum/ship_engine/proc/get_status()
return "All systems nominal"
/datum/ship_engine/proc/get_thrust()
return 1
//Sets thrust limiter, a number between 0 and 1
/datum/ship_engine/proc/set_thrust_limit(var/new_limit)
return 1
/datum/ship_engine/proc/get_thrust_limit()
return 1
/datum/ship_engine/proc/is_on()
return 1
/datum/ship_engine/proc/toggle()
return 1
/datum/ship_engine/Destroy()
GLOB.ship_engines -= src
for(var/obj/effect/overmap/visitable/ship/S in SSshuttle.ships)
S.engines -= src
holder = null
. = ..()