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

92 lines
2.7 KiB
Plaintext

SUBSYSTEM_DEF(arrivals)
name = "Arrivals"
flags = SS_NO_INIT | SS_BACKGROUND
priority = SS_PRIORITY_ARRIVALS
var/datum/shuttle/autodock/ferry/arrival/shuttle
var/launch_time //the time at which the shuttle will be launched
var/wait_for_launch = 0 //if the shuttle is waiting to launch
var/failreturnnumber = 0 // the number of times the shuttle failed to leave the station
var/list/current_mobs = list()
var/shuttle_launch_countdown = 30 SECONDS
/datum/controller/subsystem/arrivals/fire()
post_signal("arrivals")
if (wait_for_launch)
// Timing.
if (world.time >= launch_time) //time to launch the shuttle
stop_launch_countdown()
shuttle.try_jump()
for(var/thing in current_mobs)
var/mob/living/carbon/human/M = locate(thing)
if (istype(M) && M.centcomm_despawn_timer)
deltimer(M.centcomm_despawn_timer)
M.centcomm_despawn_timer = null
current_mobs.Cut()
else
// Sleep, we ain't doin' shit. on_hotzone_enter() will wake us.
can_fire = FALSE
// Called when a living mob enters the shuttle area.
/datum/controller/subsystem/arrivals/proc/on_hotzone_enter(mob/living/M)
if (!shuttle.location)
return
if (istype(M))
current_mobs += REF(M)
can_fire = TRUE // Wake the process.
if (!wait_for_launch && shuttle.location == 1 && shuttle.moving_status == SHUTTLE_IDLE)
set_launch_countdown()
/datum/controller/subsystem/arrivals/proc/on_hotzone_exit(mob/living/M)
current_mobs -= REF(M)
//called when the shuttle has arrived.
/datum/controller/subsystem/arrivals/proc/shuttle_arrived()
if (!shuttle.location) //at station
set_launch_countdown() //get ready to return
/datum/controller/subsystem/arrivals/proc/forbidden_atoms_check(atom/A)
if(istype(A,/mob/living))
return 1
if(istype(A,/obj/item/disk/nuclear))
return 1
if(istype(A,/obj/structure/machinery/nuclearbomb))
return 1
if(istype(A,/obj/item/radio/beacon))
return 1
if(istype(A,/obj/item/phylactery))
return 1
for(var/i=1, i<=A.contents.len, i++)
var/atom/B = A.contents[i]
if(.(B))
return 1
//begins the launch countdown and sets the amount of time left until launch
/datum/controller/subsystem/arrivals/proc/set_launch_countdown()
wait_for_launch = 1
launch_time = world.time + shuttle_launch_countdown
can_fire = TRUE
/datum/controller/subsystem/arrivals/proc/stop_launch_countdown()
wait_for_launch = 0
/datum/controller/subsystem/arrivals/proc/post_signal(var/command)
var/datum/radio_frequency/frequency = SSradio.return_frequency(1435)
if(!frequency) return
var/datum/signal/status_signal = new
status_signal.source = src
status_signal.transmission_method = TRANSMISSION_RADIO
status_signal.data["command"] = command
frequency.post_signal(src, status_signal, RADIO_ARRIVALS)