From be7dc9dc4d47ac94161a98070f6f79dca089c3db Mon Sep 17 00:00:00 2001 From: "C.L" Date: Sun, 25 Sep 2022 03:32:04 -0400 Subject: [PATCH] Adds ore chunks --- .../mining/machinery/machine_processing.dm | 10 ++++ .../mining/machinery/machine_unloading.dm | 14 +++--- code/modules/mining/ore.dm | 46 +++++++++++++++++++ 3 files changed, 64 insertions(+), 6 deletions(-) diff --git a/code/modules/mining/machinery/machine_processing.dm b/code/modules/mining/machinery/machine_processing.dm index b0930e116bb..c6a3d35ddf8 100644 --- a/code/modules/mining/machinery/machine_processing.dm +++ b/code/modules/mining/machinery/machine_processing.dm @@ -243,6 +243,16 @@ points += (ore_values[ore]*points_mult*ore_amount) // Give Points! VOREStation Edit - or give lots of points! or less points! or no points! OB.stored_ore[ore] = 0 // Set the value of the ore in the box to 0. + + for(var/obj/item/ore_chunk/ore_chunk in input.loc) //Special ore chunk item. For conveyor belt. Completely unneeded but keeps asthetics. + for(var/ore in ore_chunk.stored_ore) + if(ore_chunk.stored_ore[ore] > 0) + var/ore_amount = ore_chunk.stored_ore[ore] + ores_stored[ore] += ore_amount + points += (ore_values[ore]*points_mult*ore_amount) + ore_chunk.stored_ore[ore] = 0 + qdel(ore_chunk) + if(!active) return diff --git a/code/modules/mining/machinery/machine_unloading.dm b/code/modules/mining/machinery/machine_unloading.dm index ed609e4dfaf..bbdd80e3d3a 100644 --- a/code/modules/mining/machinery/machine_unloading.dm +++ b/code/modules/mining/machinery/machine_unloading.dm @@ -39,12 +39,14 @@ if (locate(/obj/structure/ore_box, input.loc)) var/obj/structure/ore_box/BOX = locate(/obj/structure/ore_box, input.loc) var/i = 0 - for (var/obj/item/weapon/ore/O in BOX.contents) - BOX.contents -= O - O.loc = output.loc - i++ - if (i>=10) - return + for (var/ore in BOX.stored_ore) + if(BOX.stored_ore[ore] > 0) + var/obj/item/ore_chunk/ore_chunk = new /obj/item/ore_chunk(src.output.loc) + var/ore_amount = BOX.stored_ore[ore] + ore_chunk.stored_ore[ore] += ore_amount + BOX.stored_ore[ore] = 0 + if (i>=3) //Let's make it staggered so it looks like a lot is happening. + return if (locate(/obj/item, input.loc)) var/obj/item/O var/i diff --git a/code/modules/mining/ore.dm b/code/modules/mining/ore.dm index 4fc2091b03a..ffceba6718d 100644 --- a/code/modules/mining/ore.dm +++ b/code/modules/mining/ore.dm @@ -170,3 +170,49 @@ return ..() //VOREStation Add End + +/obj/item/ore_chunk + name = "ore chunk" + desc = "A conglomerate of ore." + icon = 'icons/obj/xenoarchaeology.dmi' + icon_state = "strange" + randpixel = 8 + w_class = ITEMSIZE_SMALL + 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) + +/obj/item/ore_chunk/examine(mob/user) + . = ..() + + if(!Adjacent(user)) //Can only check the contents of ore boxes if you can physically reach them. + return . + + add_fingerprint(user) //You pick it up to look at it. + + . += "It is composed of:" + var/has_ore = 0 + for(var/ore in stored_ore) + if(stored_ore[ore] > 0) + . += "- [stored_ore[ore]] [ore]" + has_ore = 1 + if(!has_ore) + . += "Nothing. You should contact a developer." \ No newline at end of file