From 76c7b3f003fe1341d0745c55ffe43c0cde4c54d4 Mon Sep 17 00:00:00 2001 From: "C.L" Date: Sun, 25 Sep 2022 01:20:55 -0400 Subject: [PATCH] Makes the mining drill use lists. Updates some ore names. Uses the same magical anti-lag lists as the other mining items! Some mining drill items had incorrect names, such as glass being 'silicates' which isn't an ore, which is essential for this change. This changes that. This is purely a name change and users won't see anything different. Also removed rutile as it was duplicated in the list. Presumably due to Polaris adding rutile and it never being removed. --- .../objects/items/weapons/storage/bags.dm | 1 - code/modules/mining/drilling/drill.dm | 66 ++++++++++++++++--- code/modules/mining/drilling/scanner.dm | 4 +- .../mining/machinery/machine_processing.dm | 1 - code/modules/mining/mine_turfs.dm | 2 +- code/modules/mining/ore_box.dm | 1 - code/modules/random_map/noise/ore.dm | 6 +- maps/expedition_vr/aerostat/_aerostat.dm | 6 +- 8 files changed, 66 insertions(+), 21 deletions(-) diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm index 3e7c63e711b..6db9ef64e84 100644 --- a/code/game/objects/items/weapons/storage/bags.dm +++ b/code/game/objects/items/weapons/storage/bags.dm @@ -112,7 +112,6 @@ "silver" = 0, "gold" = 0, "marble" = 0, - "rutile" = 0, "uranium" = 0, "diamond" = 0, "platinum" = 0, diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm index 0baa14a790a..ed438e6fbef 100644 --- a/code/modules/mining/drilling/drill.dm +++ b/code/modules/mining/drilling/drill.dm @@ -20,6 +20,28 @@ var/drill_range = 5 var/offset = 2 + var/list/stored_ore = list( + "sand" = 0, + "hematite" = 0, + "carbon" = 0, + "raw copper" = 0, + "raw tin" = 0, + "void opal" = 0, + "painite" = 0, + "quartz" = 0, + "raw bauxite" = 0, + "phoron" = 0, + "silver" = 0, + "gold" = 0, + "marble" = 0, + "uranium" = 0, + "diamond" = 0, + "platinum" = 0, + "lead" = 0, + "mhydrogen" = 0, + "verdantium" = 0, + "rutile" = 0) + var/list/ore_types = list( "hematite" = /obj/item/weapon/ore/iron, "uranium" = /obj/item/weapon/ore/uranium, @@ -27,9 +49,9 @@ "silver" = /obj/item/weapon/ore/silver, "diamond" = /obj/item/weapon/ore/diamond, "phoron" = /obj/item/weapon/ore/phoron, - "osmium" = /obj/item/weapon/ore/osmium, - "hydrogen" = /obj/item/weapon/ore/hydrogen, - "silicates" = /obj/item/weapon/ore/glass, + "platinum" = /obj/item/weapon/ore/osmium, + "mhydrogen" = /obj/item/weapon/ore/hydrogen, + "sand" = /obj/item/weapon/ore/glass, "carbon" = /obj/item/weapon/ore/coal, // "copper" = /obj/item/weapon/ore/copper, // "tin" = /obj/item/weapon/ore/tin, @@ -62,6 +84,25 @@ var/need_update_field = 0 var/need_player_check = 0 + +/obj/machinery/mining/drill/examine(mob/user) //Let's inform people about stuff. Let people KNOW how it works. + . = ..() + if(Adjacent(user)) + if(cell) + . += "The drill's cell is [round(cell.percent() )]% charged." + if(charge_use) //Prevention of dividing by 0 errors. + . += "The drill reads that it can mine for [round((cell.charge/charge_use)/60)] more minutes before the cell depletes." + else + . += "The drill has no cell installed." + if(drill_range) + . += "The drill will mine in a range of [drill_range] tiles." + if(harvest_speed) + . += "The drill can mine [harvest_speed] [(harvest_speed == 1)? "ore" : "ores"] a second!" + if(exotic_drilling) + . += "The drill is upgraded and is capable of mining [(exotic_drilling == 1)? "moderately further" : "as deep as possible"]!" + if(capacity && contents.len) //TODO: Replace contents with a list that calculates current value. + . += "The drill currently has [contents.len] capacity taken up and can fit [capacity - contents.len] more ore." + /obj/machinery/mining/drill/Initialize() . = ..() if(ispath(cell)) @@ -69,6 +110,7 @@ default_apply_parts() cell = default_use_hicell() faultreporter = new /obj/item/device/radio/intercom{channels=list("Supply")}(null) + RefreshParts() //This is required to get the cell to register. /obj/machinery/mining/drill/Destroy() qdel_null(faultreporter) @@ -104,7 +146,11 @@ return //Drill through the flooring, if any. - if(istype(get_turf(src), /turf/simulated)) + if(istype(get_turf(src), /turf/simulated/mineral)) + var/turf/simulated/mineral/M = get_turf(src) + M.GetDrilled() + + else if(istype(get_turf(src), /turf/simulated)) var/turf/simulated/T = get_turf(src) T.ex_act(2.0) @@ -154,8 +200,7 @@ harvesting.resources[metal] = 0 for(var/i=1, i <= create_ore, i++) - var/oretype = ore_types[metal] - new oretype(src) + stored_ore[metal]++ //Bugged line. if(!found_resource) // If a drill can't see an advanced material, it will destroy it while going through. harvesting.has_resources = 0 @@ -348,8 +393,11 @@ var/obj/structure/ore_box/B = locate() in orange(1) if(B) - for(var/obj/item/weapon/ore/O in contents) - O.loc = B + for(var/ore in stored_ore) + if(stored_ore[ore] > 0) + var/ore_amount = stored_ore[ore] // How many ores does the satchel have? + B.stored_ore[ore] += ore_amount // Add the ore to the machine. + stored_ore[ore] = 0 // Set the value of the ore in the satchel to 0. to_chat(usr, "You unload the drill's storage cache into the ore box.") else to_chat(usr, "You must move an ore box up to the drill before you can unload it.") @@ -365,7 +413,7 @@ /obj/machinery/mining/brace/examine(mob/user) . = ..() - if(brace_tier > 2) + if(brace_tier >= 3) . += SPAN_NOTICE("The internals of the brace look resilient enough to support a drill by itself.") /obj/machinery/mining/brace/Initialize() diff --git a/code/modules/mining/drilling/scanner.dm b/code/modules/mining/drilling/scanner.dm index b1427946c91..34c0c2f99cc 100644 --- a/code/modules/mining/drilling/scanner.dm +++ b/code/modules/mining/drilling/scanner.dm @@ -41,12 +41,12 @@ var/ore_type switch(metal) - if("silicates", "carbon", "marble", /*"quartz"*/) ore_type = "surface minerals" + if("sand", "carbon", "marble", /*"quartz"*/) ore_type = "surface minerals" if("hematite", /*"tin", "copper", "bauxite",*/ "lead") ore_type = "industrial metals" if("gold", "silver", "rutile") ore_type = "precious metals" if("diamond", /*"painite"*/) ore_type = "precious gems" if("uranium") ore_type = "nuclear fuel" - if("phoron", "osmium", "hydrogen") ore_type = "exotic matter" + if("phoron", "platinum", "mhydrogen") ore_type = "exotic matter" if("verdantium", /*"void opal"*/) ore_type = "anomalous matter" if(ore_type) metals[ore_type] += T.resources[metal] diff --git a/code/modules/mining/machinery/machine_processing.dm b/code/modules/mining/machinery/machine_processing.dm index 1b06da1422c..b0930e116bb 100644 --- a/code/modules/mining/machinery/machine_processing.dm +++ b/code/modules/mining/machinery/machine_processing.dm @@ -179,7 +179,6 @@ "silver" = 16, "gold" = 18, "marble" = 20, - "rutile" = 20, "uranium" = 30, "diamond" = 50, "platinum" = 40, diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index e36d5ba8c06..ece68c7a08c 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -53,7 +53,7 @@ var/list/mining_overlay_cache = list() "phoron" = /obj/item/weapon/ore/phoron, "osmium" = /obj/item/weapon/ore/osmium, "hydrogen" = /obj/item/weapon/ore/hydrogen, - "silicates" = /obj/item/weapon/ore/glass, + "sand" = /obj/item/weapon/ore/glass, "carbon" = /obj/item/weapon/ore/coal, "verdantium" = /obj/item/weapon/ore/verdantium, "marble" = /obj/item/weapon/ore/marble, diff --git a/code/modules/mining/ore_box.dm b/code/modules/mining/ore_box.dm index b2930992abe..cf205b3d736 100644 --- a/code/modules/mining/ore_box.dm +++ b/code/modules/mining/ore_box.dm @@ -21,7 +21,6 @@ "silver" = 0, "gold" = 0, "marble" = 0, - "rutile" = 0, "uranium" = 0, "diamond" = 0, "platinum" = 0, diff --git a/code/modules/random_map/noise/ore.dm b/code/modules/random_map/noise/ore.dm index 17c10cad1a1..8a0b014303b 100644 --- a/code/modules/random_map/noise/ore.dm +++ b/code/modules/random_map/noise/ore.dm @@ -48,7 +48,7 @@ continue if(!priority_process) sleep(-1) T.resources = list() - T.resources["silicates"] = rand(3,5) + T.resources["sand"] = rand(3,5) T.resources["carbon"] = rand(3,5) var/current_cell = map[get_map_cell(x,y)] @@ -60,8 +60,8 @@ T.resources["marble"] = rand(RESOURCE_LOW_MIN, RESOURCE_MID_MAX) T.resources["diamond"] = 0 T.resources["phoron"] = 0 - T.resources["osmium"] = 0 - T.resources["hydrogen"] = 0 + T.resources["platinum"] = 0 + T.resources["mhydrogen"] = 0 T.resources["verdantium"] = 0 T.resources["lead"] = 0 //T.resources["copper"] = rand(RESOURCE_MID_MIN, RESOURCE_HIGH_MAX) diff --git a/maps/expedition_vr/aerostat/_aerostat.dm b/maps/expedition_vr/aerostat/_aerostat.dm index 6bc8ab85221..f2404f2f7e2 100644 --- a/maps/expedition_vr/aerostat/_aerostat.dm +++ b/maps/expedition_vr/aerostat/_aerostat.dm @@ -48,7 +48,7 @@ continue if(!priority_process) sleep(-1) T.resources = list() - T.resources["silicates"] = rand(3,5) + T.resources["sand"] = rand(3,5) T.resources["carbon"] = rand(3,5) var/current_cell = map[get_map_cell(x,y)] @@ -60,8 +60,8 @@ T.resources["marble"] = rand(RESOURCE_LOW_MIN, RESOURCE_MID_MAX) T.resources["diamond"] = 0 T.resources["phoron"] = 0 - T.resources["osmium"] = 0 - T.resources["hydrogen"] = 0 + T.resources["platinum"] = 0 + T.resources["mhydrogen"] = 0 T.resources["verdantium"] = 0 T.resources["lead"] = 0 //T.resources["copper"] = rand(RESOURCE_MID_MIN, RESOURCE_HIGH_MAX)