* sync (#3) * shuttle auto call * Merge /vore into /master (#39) * progress * Compile errors fixed No idea if it's test worthy tho as conflicts with race overhaul and narky removal. * Update admins.txt * efforts continue Fuck grab code, seriously * grab code is cancer * Execute the Narkism Do not hesitate. Show no mercy. * holy shit grab code is awful * have I bitched about grab code My bitching, let me show you it * código de agarre es una mierda No really it is * yeah I don't even know anymore. * Lolnope. Fuck grab code * I'm not even sure what to fix anymore * Self eating is not an acceptable fate * Taste the void, son. * My code doesn't pass it's own sanity check. Maybe it's a sign of things to come. * uncommented and notes * It Works and I Don't Know Why (#38) * shuttle auto call * it works and I don't know why * Subsystem 12/21 Most Recent TG subsystem folder * globalvars 12/21 Tossed out the flavor_misc and parallax files * Onclick 12/21 as well as .dme updates * _defines 12/21 ommited old _MC.dm * _HELPERS 12/21 Preserved snowflake placement of furry sprites * _defeines/genetics reapplied narkism holdover for snowflake races. * Oops forgot mutant colors * modules porting 12/21 + Sounds/icons Admin, Client and most of mob life files ommitted * enviroment file * Admin optimizations ahelp log system kept * Mob ports 12/21 Flavor text preserved * datums ported 12/21 * Game ported 12/21 * batch of duplicate fixes/dogborg work Dogborgs need to be modernized to refractored borg standards. * moar fixes * Maps and futher compile fixes
93 lines
2.8 KiB
Plaintext
93 lines
2.8 KiB
Plaintext
/**********************Mineral stacking unit console**************************/
|
|
|
|
/obj/machinery/mineral/stacking_unit_console
|
|
name = "stacking machine console"
|
|
icon = 'icons/obj/machines/mining_machines.dmi'
|
|
icon_state = "console"
|
|
density = 0
|
|
anchored = 1
|
|
var/obj/machinery/mineral/stacking_machine/machine = null
|
|
var/machinedir = SOUTHEAST
|
|
speed_process = 1
|
|
|
|
/obj/machinery/mineral/stacking_unit_console/New()
|
|
..()
|
|
spawn(7)
|
|
src.machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
|
|
if (machine)
|
|
machine.CONSOLE = src
|
|
else
|
|
qdel(src)
|
|
|
|
/obj/machinery/mineral/stacking_unit_console/attack_hand(mob/user)
|
|
|
|
var/obj/item/stack/sheet/s
|
|
var/dat
|
|
|
|
dat += text("<b>Stacking unit console</b><br><br>")
|
|
|
|
for(var/O in machine.stack_list)
|
|
s = machine.stack_list[O]
|
|
if(s.amount > 0)
|
|
dat += text("[capitalize(s.name)]: [s.amount] <A href='?src=\ref[src];release=[s.type]'>Release</A><br>")
|
|
|
|
dat += text("<br>Stacking: [machine.stack_amt]<br><br>")
|
|
|
|
user << browse(dat, "window=console_stacking_machine")
|
|
|
|
return
|
|
|
|
/obj/machinery/mineral/stacking_unit_console/Topic(href, href_list)
|
|
if(..())
|
|
return
|
|
usr.set_machine(src)
|
|
src.add_fingerprint(usr)
|
|
if(href_list["release"])
|
|
if(!(text2path(href_list["release"]) in machine.stack_list)) return //someone tried to spawn materials by spoofing hrefs
|
|
var/obj/item/stack/sheet/inp = machine.stack_list[text2path(href_list["release"])]
|
|
var/obj/item/stack/sheet/out = new inp.type()
|
|
out.amount = inp.amount
|
|
inp.amount = 0
|
|
machine.unload_mineral(out)
|
|
|
|
src.updateUsrDialog()
|
|
return
|
|
|
|
|
|
/**********************Mineral stacking unit**************************/
|
|
|
|
|
|
/obj/machinery/mineral/stacking_machine
|
|
name = "stacking machine"
|
|
icon = 'icons/obj/machines/mining_machines.dmi'
|
|
icon_state = "stacker"
|
|
density = 1
|
|
anchored = 1
|
|
var/obj/machinery/mineral/stacking_unit_console/CONSOLE
|
|
var/stk_types = list()
|
|
var/stk_amt = list()
|
|
var/stack_list[0] //Key: Type. Value: Instance of type.
|
|
var/stack_amt = 50; //ammount to stack before releassing
|
|
input_dir = EAST
|
|
output_dir = WEST
|
|
|
|
/obj/machinery/mineral/stacking_machine/proc/process_sheet(obj/item/stack/sheet/inp)
|
|
if(!(inp.type in stack_list)) //It's the first of this sheet added
|
|
var/obj/item/stack/sheet/s = new inp.type(src,0)
|
|
s.amount = 0
|
|
stack_list[inp.type] = s
|
|
var/obj/item/stack/sheet/storage = stack_list[inp.type]
|
|
storage.amount += inp.amount //Stack the sheets
|
|
inp.loc = null //Let the old sheet garbage collect
|
|
while(storage.amount > stack_amt) //Get rid of excessive stackage
|
|
var/obj/item/stack/sheet/out = new inp.type()
|
|
out.amount = stack_amt
|
|
unload_mineral(out)
|
|
storage.amount -= stack_amt
|
|
|
|
/obj/machinery/mineral/stacking_machine/process()
|
|
var/turf/T = get_step(src, input_dir)
|
|
if(T)
|
|
for(var/obj/item/stack/sheet/S in T)
|
|
process_sheet(S)
|