From b10d8ef6a6cc365ea80c44d1d5086e3060fea81e Mon Sep 17 00:00:00 2001 From: "baloh.matevz" Date: Sat, 8 Jan 2011 02:09:55 +0000 Subject: [PATCH] lots of updates to mining. Mainly added consoles to control what's going on in the processing unit. the stacking unit is still a placeholder as is it's console, which is not placed in the world. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@808 316c924e-a436-60f5-8080-3fe189b3f50e --- code/WorkInProgress/mining.dm | 283 +++++++++++++++++++++--- icons/obj/terminals.dmi | Bin 2864 -> 971 bytes maps/tgstation.2.0.0.dmm | 403 +++++++++++++++++----------------- tgstation.dme | 3 - 4 files changed, 458 insertions(+), 231 deletions(-) diff --git a/code/WorkInProgress/mining.dm b/code/WorkInProgress/mining.dm index 85b8f0d7a5f..d820cdbbb09 100644 --- a/code/WorkInProgress/mining.dm +++ b/code/WorkInProgress/mining.dm @@ -272,7 +272,7 @@ for (var/obj/item/weapon/ore/O in contents) contents -= O O.loc = user.loc - user << "\blue You empty the satchel." + user << "\blue You empty the satchel." return /obj/item/weapon/satchel/attackby(obj/item/weapon/W as obj, mob/user as mob) @@ -464,6 +464,127 @@ return return +/**********************Mineral processing unit console**************************/ + +/obj/machinery/mineral/processing_unit_console + name = "Produciton machine console" + icon = 'terminals.dmi' + icon_state = "production_console" + density = 1 + anchored = 1 + var/obj/machinery/mineral/processing_unit/machine = null + +/obj/machinery/mineral/processing_unit_console/New() + ..() + spawn(7) + src.machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, EAST)) + if (machine) + machine.CONSOLE = src + else + del(src) + +/obj/machinery/mineral/processing_unit_console/attack_hand(user as mob) + + var/dat = "" + dat += text("What the heck can you even control on this, anyway??

") + + //iron + if (machine.selected_iron==1) + dat += text("Y ") + else + dat += text("N ") + dat += text("Iron: [machine.ore_iron]
") + + //plasma + if (machine.selected_plasma==1) + dat += text("Y ") + else + dat += text("N ") + dat += text("Plasma: [machine.ore_plasma]
") + + //uranium + if (machine.selected_uranium==1) + dat += text("Y ") + else + dat += text("N ") + dat += text("Uranium: [machine.ore_uranium]
") + + //gold + if (machine.selected_gold==1) + dat += text("Y ") + else + dat += text("N ") + dat += text("Gold: [machine.ore_gold]
") + + //silver + if (machine.selected_silver==1) + dat += text("Y ") + else + dat += text("N ") + dat += text("Silver: [machine.ore_silver]
") + + //diamond + if (machine.selected_diamond==1) + dat += text("Y ") + else + dat += text("N ") + dat += text("Diamond: [machine.ore_diamond]
") + + //On or off + dat += text("Machine is currently ") + if (machine.on==1) + dat += text("On ") + else + dat += text("Off ") + + + + user << browse("[dat]", "window=console_processing_unit") + + + +/obj/machinery/mineral/processing_unit_console/Topic(href, href_list) + if(..()) + return + usr.machine = src + src.add_fingerprint(usr) + if(href_list["sel_iron"]) + if (href_list["sel_iron"] == "yes") + machine.selected_iron = 1 + else + machine.selected_iron = 0 + if(href_list["sel_plasma"]) + if (href_list["sel_plasma"] == "yes") + machine.selected_plasma = 1 + else + machine.selected_plasma = 0 + if(href_list["sel_uranium"]) + if (href_list["sel_uranium"] == "yes") + machine.selected_uranium = 1 + else + machine.selected_uranium = 0 + if(href_list["sel_gold"]) + if (href_list["sel_gold"] == "yes") + machine.selected_gold = 1 + else + machine.selected_gold = 0 + if(href_list["sel_silver"]) + if (href_list["sel_silver"] == "yes") + machine.selected_silver = 1 + else + machine.selected_silver = 0 + if(href_list["sel_diamond"]) + if (href_list["sel_diamond"] == "yes") + machine.selected_diamond = 1 + else + machine.selected_diamond = 0 + if(href_list["set_on"]) + if (href_list["set_on"] == "on") + machine.on = 1 + else + machine.on = 0 + src.updateUsrDialog() + return /**********************Mineral processing unit**************************/ @@ -476,7 +597,20 @@ anchored = 1.0 var/obj/machinery/mineral/input = null var/obj/machinery/mineral/output = null - + var/obj/machinery/mineral/CONSOLE = null + var/ore_gold = 0; + var/ore_silver = 0; + var/ore_diamond = 0; + var/ore_plasma = 0; + var/ore_uranium = 0; + var/ore_iron = 0; + var/selected_gold = 0 + var/selected_silver = 0 + var/selected_diamond = 0 + var/selected_plasma = 0 + var/selected_uranium = 0 + var/selected_iron = 0 + var/on = 0 //0 = off, 1 =... oh you know! /obj/machinery/mineral/processing_unit/New() ..() @@ -489,32 +623,128 @@ /obj/machinery/mineral/processing_unit/process() if (src.output && src.input) - var/obj/item/weapon/ore/O - O = locate(/obj/item/weapon/ore, input.loc) - if (istype(O,/obj/item/weapon/ore/iron)) - new /obj/item/stack/sheet/metal(output.loc) - del(O) - return - if (istype(O,/obj/item/weapon/ore/diamond)) - new /obj/item/stack/sheet/diamond(output.loc) - del(O) - return - if (istype(O,/obj/item/weapon/ore/plasma)) - new /obj/item/stack/sheet/plasma(output.loc) - del(O) - return - if (istype(O,/obj/item/weapon/ore/gold)) - new /obj/item/stack/sheet/gold(output.loc) - del(O) - return - if (istype(O,/obj/item/weapon/ore/silver)) - new /obj/item/stack/sheet/silver(output.loc) - del(O) - return - if (O) - O.loc = src.output.loc + var/i + for (i = 0; i < 10; i++) + if (on) + if (selected_gold == 1 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0) + if (ore_gold > 0) + ore_gold--; + new /obj/item/stack/sheet/gold(output.loc) + continue + if (selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0) + if (ore_silver > 0) + ore_silver--; + new /obj/item/stack/sheet/silver(output.loc) + continue + if (selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0) + if (ore_diamond > 0) + ore_diamond--; + new /obj/item/stack/sheet/diamond(output.loc) + continue + if (selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0) + if (ore_plasma > 0) + ore_plasma--; + new /obj/item/stack/sheet/plasma(output.loc) + continue + if (selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0) + if (ore_uranium > 0) + ore_uranium--; + new /obj/item/weapon/ore/uranium(output.loc) + continue + if (selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1) + if (ore_iron > 0) + ore_iron--; + new /obj/item/stack/sheet/metal(output.loc) + continue + + + //if a non valid combination is selected + if (selected_gold == 1) + ore_gold-- + if (selected_silver == 1) + ore_silver-- + if (selected_diamond == 1) + ore_diamond-- + if (selected_plasma == 1) + ore_plasma-- + if (selected_uranium == 1) + ore_uranium-- + if (selected_iron == 1) + ore_iron-- + + new /obj/decal/ash(output.loc) + + break + else + break + for (i = 0; i < 10; i++) + var/obj/item/weapon/ore/O + O = locate(/obj/item/weapon/ore, input.loc) + if (O) + if (istype(O,/obj/item/weapon/ore/iron)) + ore_iron++; + //new /obj/item/stack/sheet/metal(output.loc) + del(O) + continue + if (istype(O,/obj/item/weapon/ore/diamond)) + ore_diamond++; + //new /obj/item/stack/sheet/diamond(output.loc) + del(O) + continue + if (istype(O,/obj/item/weapon/ore/plasma)) + ore_plasma++ + //new /obj/item/stack/sheet/plasma(output.loc) + del(O) + continue + if (istype(O,/obj/item/weapon/ore/gold)) + ore_gold++ + //new /obj/item/stack/sheet/gold(output.loc) + del(O) + continue + if (istype(O,/obj/item/weapon/ore/silver)) + ore_silver++ + //new /obj/item/stack/sheet/silver(output.loc) + del(O) + continue + if (istype(O,/obj/item/weapon/ore/uranium)) + ore_uranium++ + del(O) + continue + O.loc = src.output.loc + else + break return + + +/**********************Mineral stacking unit console**************************/ + +/obj/machinery/mineral/stacking_unit_console + name = "Stacking machine console" + icon = 'terminals.dmi' + icon_state = "production_console" + density = 1 + anchored = 1 + var/obj/machinery/mineral/processing_unit/machine = null + +/obj/machinery/mineral/stacking_unit_console/New() + ..() + spawn(7) + src.machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, SOUTH)) + if (machine) + machine.CONSOLE = src + else + del(src) + +/obj/machinery/mineral/stacking_unit_console/attack_hand(user as mob) + + var/dat + + dat += text("What the heck can you even control on this, anyway??

") + + user << browse("[dat]", "window=console_stacking_machine") + + /**********************Mineral stacking unit**************************/ @@ -640,7 +870,6 @@ dat += text("

Silver inserterd: [amt_silver]") dat += text("

Make coins") - dat += text("

found: [newCoins]") user << browse("[dat]", "window=mint") diff --git a/icons/obj/terminals.dmi b/icons/obj/terminals.dmi index 34fe215a234b9182b807dd044284e32fe4590e6a..0b5524385a0edbacf07669bb2aa8601da7cdae41 100644 GIT binary patch delta 960 zcmV;x13&z*7Rv{a8Gi!+0082oihBS609sH?R7JqRz!n-OA|fU{K}Y~I|7My0000gD z004M+g~`dw0L(Ml+}}b%NC5w40L*4{bA7kBx&N5}S65*F|1)OHGiPUVnPz7H05dK% zP{6>z|Ns90%*2iZ06osWV6%(`A#5B{I_kYa-ZY)=B zC`&pMj+yx5Lp&@hhoZ>JDhjfyG`t{hD=7k!<1QXL0~?P(e$1wSH?IVhaB>9wiX2C|KMXp zYfzM=;eWiqcDvi|G|3f2<-9<{WNSfG&I-_Ge`x5S`gjsYO_vJda=vD34*OkJPCE~*#l<2S6k@LALs#lzOTmTY<$jH`?RM7;f_6E z=KBvQ%8 zxPO7J>&|DzK>YoI<8k6$_a!77NU%S^42V=-0C=38&$|kPKokVfdhb^Z+J@kZblU_aSm-Z^xHoYjK5}=7QuZLL)myq!w#@4~;Y-)w8|zel5@emL>aGx{o!}%;V3O8e!K7FKqrHizxse z@yDHLOafK6f6Tpmv$Hd^v%9midpGYFmYMgRcjhy*^Stjo?>qB8imIwe`B$H-_6bN; zSJD7{E@=Qh*M0g#=X24F7tkGV_9$lglJ7nLKI6tO++W#q`1mu^YnS{g@$(D-U`E5t zioh?OKj)~Nv^ z?Uu$fUpRv07=jnqU$7Towr-V9M76GnnHIOV7JYIPfiKct@f994J=S6iM!^<9Z(U}V zrtgOWuJwZ@-y6Q87QoIDjd{kC70bou71LIdUwOVGA3%RVW7;g=>;legwELqHf1BdgLot?{U_m}+Y z@$(EoJR|1JZh`?|L2kZLKYIRo0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