mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-20 20:16:55 +01:00
40 lines
1.1 KiB
Plaintext
40 lines
1.1 KiB
Plaintext
/**********************Unloading unit**************************/
|
|
|
|
/obj/machinery/mineral/unloading_machine
|
|
name = "unloading machine"
|
|
icon = 'icons/obj/machines/mining_machines.dmi'
|
|
icon_state = "unloader"
|
|
density = 1
|
|
anchored = 1.0
|
|
speed_process = TRUE
|
|
var/obj/machinery/mineral/input = null
|
|
var/obj/machinery/mineral/output = null
|
|
|
|
/obj/machinery/mineral/unloading_machine/Initialize(mapload)
|
|
. = ..()
|
|
return INITIALIZE_HINT_LATELOAD
|
|
|
|
// wip - why isn't this dirs instead?!
|
|
/obj/machinery/mineral/unloading_machine/LateInitialize()
|
|
for(var/dir in GLOB.cardinal)
|
|
input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
|
if(input)
|
|
break
|
|
for(var/dir in GLOB.cardinal)
|
|
output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
|
if(output)
|
|
break
|
|
|
|
/obj/machinery/mineral/unloading_machine/process(delta_time)
|
|
if(output && input)
|
|
if(length(output.loc.contents) > TURF_CROWDING_SOFT_LIMIT) // let's not!
|
|
return
|
|
var/obj/structure/ore_box/O = locate() in input.loc
|
|
if(O)
|
|
O.deposit(output.loc, 50)
|
|
var/obj/item/I
|
|
I = locate() in input.loc
|
|
if(I)
|
|
I.forceMove(output.loc)
|
|
|