Mining adjustments

This commit is contained in:
Casey
2022-09-25 16:46:54 -04:00
committed by CHOMPStation2
parent 535555b46c
commit 1550c3bee5
12 changed files with 321 additions and 85 deletions

View File

@@ -98,14 +98,48 @@
max_storage_space = ITEMSIZE_COST_NORMAL * 25 max_storage_space = ITEMSIZE_COST_NORMAL * 25
max_w_class = ITEMSIZE_NORMAL max_w_class = ITEMSIZE_NORMAL
can_hold = list(/obj/item/weapon/ore) can_hold = list(/obj/item/weapon/ore)
var/stored_ore = list() var/current_capacity = 0
var/max_pickup = 100 //How much ore can be picked up in one go. There to prevent someone from walking on a turf with 10000 ore and making the server cry.
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/last_update = 0 var/last_update = 0
/obj/item/weapon/storage/bag/ore/holding /obj/item/weapon/storage/bag/ore/holding
name = "mining satchel of holding" name = "mining satchel of holding"
desc = "Like a mining satchel, but when you put your hand in, you're pretty sure you can feel time itself." desc = "Like a mining satchel, but when you put your hand in, you're pretty sure you can feel time itself."
icon_state = "satchel_bspace" icon_state = "satchel_bspace"
max_storage_space = ITEMSIZE_COST_NORMAL * 75 // 3x max_storage_space = ITEMSIZE_COST_NORMAL * 15000 // This should never, ever, ever be reached.
/obj/item/weapon/storage/bag/ore/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(current_capacity >= max_storage_space)
to_chat(user, "<span class='notice'>\the [src] is too full to possibly fit anything else inside of it.</span>")
return
if (istype(W, /obj/item/weapon/ore))
var/obj/item/weapon/ore/ore = W
stored_ore[ore.material]++
current_capacity++
user.remove_from_mob(W)
qdel(ore)
/obj/item/weapon/storage/bag/ore/remove_from_storage(obj/item/W as obj, atom/new_location) /obj/item/weapon/storage/bag/ore/remove_from_storage(obj/item/W as obj, atom/new_location)
if(!istype(W)) return 0 if(!istype(W)) return 0
@@ -128,21 +162,39 @@
/obj/item/weapon/storage/bag/ore/gather_all(turf/T as turf, mob/user as mob, var/silent = 0) /obj/item/weapon/storage/bag/ore/gather_all(turf/T as turf, mob/user as mob, var/silent = 0)
var/success = 0 var/success = 0
var/failure = 0 var/failure = 0
for(var/obj/item/weapon/ore/I in T) //Only ever grabs ores. Doesn't do any extraneous checks, as all ore is the same size. Tons of checks means it causes hanging for up to three seconds. var/current_pickup = 0
if(contents.len >= max_storage_space) var/max_pickup_reached = 0
for(var/obj/item/weapon/ore/O in T) //Only ever grabs ores. Doesn't do any extraneous checks, as all ore is the same size. Tons of checks means it causes hanging for up to three seconds.
if(current_capacity >= max_storage_space)
failure = 1 failure = 1
break break
I.forceMove(src) if(current_pickup >= max_pickup)
max_pickup_reached = 1
break
var/obj/item/weapon/ore/ore = O
stored_ore[ore.material]++
current_capacity++
current_pickup++
qdel(ore)
success = 1 success = 1
if(success && !failure && !silent) if(!silent) //Let's do a single check and then do more instead of a bunch at once.
to_chat(user, "<span class='notice'>You put everything in [src].</span>") if(success && !failure && !max_pickup_reached) //Picked stuff up, did not reach capacity, did not reach max_pickup.
else if(success && (!silent || (silent && contents.len >= max_storage_space))) to_chat(user, "<span class='notice'>You put everything in [src].</span>")
to_chat(user, "<span class='notice'>You fill the [src].</span>") else if(success && failure) //Picked stuff up to capacity.
else if(!silent) to_chat(user, "<span class='notice'>You fill the [src].</span>")
to_chat(user, "<span class='notice'>You fail to pick anything up with \the [src].</span>") else if(success && max_pickup_reached) //Picked stuff up to the max_pickup
if(istype(user.pulling, /obj/structure/ore_box)) //Bit of a crappy way to do this, as it doubles spam for the user, but it works. to_chat(user, "<span class='notice'>You fill the [src] with as much as you can grab in one go.</span>")
var/obj/structure/ore_box/O = user.pulling else //Failed. The bag is full.
O.attackby(src, user) to_chat(user, "<span class='notice'>You fail to pick anything up with \the [src].</span>")
if(istype(user.pulling, /obj/structure/ore_box)) //Bit of a crappy way to do this, as it doubles spam for the user, but it works. //Then let me fix it. ~CL.
var/obj/structure/ore_box/OB = user.pulling
for(var/ore in stored_ore)
if(stored_ore[ore] > 0)
var/ore_amount = stored_ore[ore] // How many ores does the satchel have?
OB.stored_ore[ore] += ore_amount // Add the ore to the box
stored_ore[ore] = 0 // Set the value of the ore in the satchel to 0.
current_capacity = 0 // Set the amount of ore in the satchel to 0.
current_pickup = 0
/obj/item/weapon/storage/bag/ore/equipped(mob/user) /obj/item/weapon/storage/bag/ore/equipped(mob/user)
..() ..()
@@ -175,24 +227,20 @@
if(istype(user, /mob/living)) if(istype(user, /mob/living))
add_fingerprint(user) add_fingerprint(user)
if(!contents.len) . += "<span class='notice'>It holds:</span>"
. += "It is empty." var/has_ore = 0
for(var/ore in stored_ore)
else if(world.time > last_update + 10) if(stored_ore[ore] > 0)
update_ore_count()
last_update = world.time
. += "<span class='notice'>It holds:</span>"
for(var/ore in stored_ore)
. += "<span class='notice'>- [stored_ore[ore]] [ore]</span>" . += "<span class='notice'>- [stored_ore[ore]] [ore]</span>"
has_ore = 1
if(!has_ore)
. += "Nothing."
/obj/item/weapon/storage/bag/ore/open(mob/user as mob) //No opening it for the weird UI of having shit-tons of ore inside it. /obj/item/weapon/storage/bag/ore/open(mob/user as mob) //No opening it for the weird UI of having shit-tons of ore inside it.
if(world.time > last_update + 10) user.examinate(src)
update_ore_count()
last_update = world.time
user.examinate(src)
/obj/item/weapon/storage/bag/ore/proc/update_ore_count() //Stolen from ore boxes. /*
/obj/item/weapon/storage/bag/ore/proc/update_ore_count() //Stolen from ore boxes. OLD way of storing ore.
stored_ore = list() stored_ore = list()
@@ -201,6 +249,7 @@
stored_ore[O.name]++ stored_ore[O.name]++
else else
stored_ore[O.name] = 1 stored_ore[O.name] = 1
<<<<<<< HEAD
//CHOMPstation edit START //CHOMPstation edit START
/obj/item/weapon/storage/bag/ore/large /obj/item/weapon/storage/bag/ore/large
@@ -219,6 +268,9 @@
//CHOMPstation edit END //CHOMPstation edit END
=======
*/
>>>>>>> fe004aefc3... Merge pull request #13799 from Cameron653/MINING_ADJUSTMENTS
// ----------------------------- // -----------------------------
// Plant bag // Plant bag
// ----------------------------- // -----------------------------

View File

@@ -19,6 +19,29 @@
var/obj/item/device/radio/intercom/faultreporter var/obj/item/device/radio/intercom/faultreporter
var/drill_range = 5 var/drill_range = 5
var/offset = 2 var/offset = 2
var/current_capacity = 0
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( var/list/ore_types = list(
"hematite" = /obj/item/weapon/ore/iron, "hematite" = /obj/item/weapon/ore/iron,
@@ -27,9 +50,9 @@
"silver" = /obj/item/weapon/ore/silver, "silver" = /obj/item/weapon/ore/silver,
"diamond" = /obj/item/weapon/ore/diamond, "diamond" = /obj/item/weapon/ore/diamond,
"phoron" = /obj/item/weapon/ore/phoron, "phoron" = /obj/item/weapon/ore/phoron,
"osmium" = /obj/item/weapon/ore/osmium, "platinum" = /obj/item/weapon/ore/osmium,
"hydrogen" = /obj/item/weapon/ore/hydrogen, "mhydrogen" = /obj/item/weapon/ore/hydrogen,
"silicates" = /obj/item/weapon/ore/glass, "sand" = /obj/item/weapon/ore/glass,
"carbon" = /obj/item/weapon/ore/coal, "carbon" = /obj/item/weapon/ore/coal,
// "copper" = /obj/item/weapon/ore/copper, // "copper" = /obj/item/weapon/ore/copper,
// "tin" = /obj/item/weapon/ore/tin, // "tin" = /obj/item/weapon/ore/tin,
@@ -62,12 +85,30 @@
var/need_update_field = 0 var/need_update_field = 0
var/need_player_check = 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 && current_capacity)
. += "The drill currently has [current_capacity] capacity taken up and can fit [capacity - current_capacity] more ore."
/obj/machinery/mining/drill/Initialize() /obj/machinery/mining/drill/Initialize()
. = ..() . = ..()
if(ispath(cell)) if(ispath(cell))
cell = new cell(src) cell = new cell(src)
default_apply_parts() default_apply_parts()
cell = default_use_hicell()
faultreporter = new /obj/item/device/radio/intercom{channels=list("Supply")}(null) faultreporter = new /obj/item/device/radio/intercom{channels=list("Supply")}(null)
/obj/machinery/mining/drill/Destroy() /obj/machinery/mining/drill/Destroy()
@@ -104,7 +145,11 @@
return return
//Drill through the flooring, if any. //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) var/turf/simulated/T = get_turf(src)
T.ex_act(2.0) T.ex_act(2.0)
@@ -128,7 +173,7 @@
for(var/metal in ore_types) for(var/metal in ore_types)
if(contents.len >= capacity) if(current_capacity >= capacity)
system_error("Insufficient storage space.") system_error("Insufficient storage space.")
active = 0 active = 0
need_player_check = 1 need_player_check = 1
@@ -154,8 +199,8 @@
harvesting.resources[metal] = 0 harvesting.resources[metal] = 0
for(var/i=1, i <= create_ore, i++) for(var/i=1, i <= create_ore, i++)
var/oretype = ore_types[metal] stored_ore[metal]++ // Adds the ore to the drill.
new oretype(src) current_capacity++ // Adds the ore to the drill's capacity.
if(!found_resource) // If a drill can't see an advanced material, it will destroy it while going through. if(!found_resource) // If a drill can't see an advanced material, it will destroy it while going through.
harvesting.has_resources = 0 harvesting.has_resources = 0
@@ -348,8 +393,12 @@
var/obj/structure/ore_box/B = locate() in orange(1) var/obj/structure/ore_box/B = locate() in orange(1)
if(B) if(B)
for(var/obj/item/weapon/ore/O in contents) for(var/ore in stored_ore)
O.loc = B 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.
current_capacity = 0 // Set the amount of ore in the drill to 0.
to_chat(usr, "<span class='notice'>You unload the drill's storage cache into the ore box.</span>") to_chat(usr, "<span class='notice'>You unload the drill's storage cache into the ore box.</span>")
else else
to_chat(usr, "<span class='notice'>You must move an ore box up to the drill before you can unload it.</span>") to_chat(usr, "<span class='notice'>You must move an ore box up to the drill before you can unload it.</span>")
@@ -365,7 +414,7 @@
/obj/machinery/mining/brace/examine(mob/user) /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.") . += SPAN_NOTICE("The internals of the brace look resilient enough to support a drill by itself.")
/obj/machinery/mining/brace/Initialize() /obj/machinery/mining/brace/Initialize()

View File

@@ -41,12 +41,12 @@
var/ore_type var/ore_type
switch(metal) 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("hematite", /*"tin", "copper", "bauxite",*/ "lead") ore_type = "industrial metals"
if("gold", "silver", "rutile") ore_type = "precious metals" if("gold", "silver", "rutile") ore_type = "precious metals"
if("diamond", /*"painite"*/) ore_type = "precious gems" if("diamond", /*"painite"*/) ore_type = "precious gems"
if("uranium") ore_type = "nuclear fuel" 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("verdantium", /*"void opal"*/) ore_type = "anomalous matter"
if(ore_type) metals[ore_type] += T.resources[metal] if(ore_type) metals[ore_type] += T.resources[metal]

View File

@@ -69,7 +69,7 @@
else else
data["has_id"] = FALSE data["has_id"] = FALSE
var/list/ores = list() var/list/ores = list()
for(var/ore in machine.ores_processing) for(var/ore in machine.ores_processing)
if(!machine.ores_stored[ore] && !show_all_ores) if(!machine.ores_stored[ore] && !show_all_ores)
@@ -179,7 +179,6 @@
"silver" = 16, "silver" = 16,
"gold" = 18, "gold" = 18,
"marble" = 20, "marble" = 20,
"rutile" = 20,
"uranium" = 30, "uranium" = 30,
"diamond" = 50, "diamond" = 50,
"platinum" = 40, "platinum" = 40,
@@ -194,7 +193,7 @@
var/ore/OD = GLOB.ore_data[ore] var/ore/OD = GLOB.ore_data[ore]
ores_processing[OD.name] = 0 ores_processing[OD.name] = 0
ores_stored[OD.name] = 0 ores_stored[OD.name] = 0
// TODO - Eschew input/output machinery and just use dirs ~Leshana // TODO - Eschew input/output machinery and just use dirs ~Leshana
//Locate our output and input machinery. //Locate our output and input machinery.
for (var/dir in cardinal) for (var/dir in cardinal)
@@ -236,11 +235,23 @@
var/list/tick_alloys = list() var/list/tick_alloys = list()
//Grab some more ore to process this tick. //Grab some more ore to process this tick.
for(var/obj/item/weapon/ore/O in input.loc) for(var/obj/structure/ore_box/OB in input.loc)
if(!isnull(ores_stored[O.material])) for(var/ore in OB.stored_ore)
ores_stored[O.material]++ if(OB.stored_ore[ore] > 0)
points += (ore_values[O.material]*points_mult) // Give Points! VOREStation Edit - or give lots of points! or less points! or no points! var/ore_amount = OB.stored_ore[ore] // How many ores does the box have?
qdel(O) ores_stored[ore] += ore_amount // Add the ore to the machine.
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) if(!active)
return return

View File

@@ -39,12 +39,60 @@
if (locate(/obj/structure/ore_box, input.loc)) if (locate(/obj/structure/ore_box, input.loc))
var/obj/structure/ore_box/BOX = locate(/obj/structure/ore_box, input.loc) var/obj/structure/ore_box/BOX = locate(/obj/structure/ore_box, input.loc)
var/i = 0 var/i = 0
for (var/obj/item/weapon/ore/O in BOX.contents) for (var/ore in BOX.stored_ore)
BOX.contents -= O if(BOX.stored_ore[ore] > 0)
O.loc = output.loc var/obj/item/ore_chunk/ore_chunk = new /obj/item/ore_chunk(src.output.loc)
i++ var/ore_amount = BOX.stored_ore[ore]
if (i>=10) ore_chunk.stored_ore[ore] += ore_amount
return BOX.stored_ore[ore] = 0
//Icon code here. Going from most to least common.
if(ore == "sand")
ore_chunk.icon_state = "ore_glass"
else if(ore == "carbon")
ore_chunk.icon_state = "ore_coal"
else if(ore == "hematite")
ore_chunk.icon_state = "ore_iron"
else if(ore == "phoron")
ore_chunk.icon_state = "ore_phoron"
else if(ore == "silver")
ore_chunk.icon_state = "ore_silver"
else if(ore == "gold")
ore_chunk.icon_state = "ore_gold"
else if(ore == "uranium")
ore_chunk.icon_state = "ore_uranium"
else if(ore == "diamond")
ore_chunk.icon_state = "ore_diamond"
else if(ore == "platinum")
ore_chunk.icon_state = "ore_platinum"
else if(ore == "marble")
ore_chunk.icon_state = "ore_marble"
else if(ore == "lead")
ore_chunk.icon_state = "ore_lead"
else if(ore == "rutile")
ore_chunk.icon_state = "ore_rutile"
else if(ore == "quartz")
ore_chunk.icon_state = "ore_quartz"
else if(ore == "mhydrogen")
ore_chunk.icon_state = "ore_hydrogen"
else if(ore == "verdantium")
ore_chunk.icon_state = "ore_verdantium"
else if(ore == "raw copper")
ore_chunk.icon_state = "ore_copper"
else if(ore == "raw tin")
ore_chunk.icon_state = "ore_tin"
else if(ore == "void opal")
ore_chunk.icon_state = "ore_void_opal"
else if(ore == "raw bauxite")
ore_chunk.icon_state = "ore_bauxite"
else if(ore == "painite")
ore_chunk.icon_state = "ore_painite"
else
ore_chunk.icon_state = "boulder[rand(1,4)]"
if (i>=3) //Let's make it staggered so it looks like a lot is happening.
return
if (locate(/obj/item, input.loc)) if (locate(/obj/item, input.loc))
var/obj/item/O var/obj/item/O
var/i var/i

View File

@@ -62,7 +62,7 @@ var/list/mining_overlay_cache = list()
"phoron" = /obj/item/weapon/ore/phoron, "phoron" = /obj/item/weapon/ore/phoron,
"osmium" = /obj/item/weapon/ore/osmium, "osmium" = /obj/item/weapon/ore/osmium,
"hydrogen" = /obj/item/weapon/ore/hydrogen, "hydrogen" = /obj/item/weapon/ore/hydrogen,
"silicates" = /obj/item/weapon/ore/glass, "sand" = /obj/item/weapon/ore/glass,
"carbon" = /obj/item/weapon/ore/coal, "carbon" = /obj/item/weapon/ore/coal,
"verdantium" = /obj/item/weapon/ore/verdantium, "verdantium" = /obj/item/weapon/ore/verdantium,
"marble" = /obj/item/weapon/ore/marble, "marble" = /obj/item/weapon/ore/marble,

View File

@@ -170,3 +170,49 @@
return return
..() ..()
//VOREStation Add End //VOREStation Add End
/obj/item/ore_chunk
name = "ore chunk"
desc = "A conglomerate of ore."
icon = 'icons/obj/mining_ore_vr.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."

View File

@@ -7,33 +7,68 @@
desc = "A heavy box used for storing ore." desc = "A heavy box used for storing ore."
density = TRUE density = TRUE
var/last_update = 0 var/last_update = 0
var/list/stored_ore = list() 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/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/ore)) if (istype(W, /obj/item/weapon/ore))
<<<<<<< HEAD
if (W.name != "strange rock") if (W.name != "strange rock")
user.remove_from_mob(W) user.remove_from_mob(W)
src.contents += W src.contents += W
else else
to_chat(user,"<span class='notice'>The [W] bounces out of the [src]!</span>") to_chat(user,"<span class='notice'>The [W] bounces out of the [src]!</span>")
=======
var/obj/item/weapon/ore/ore = W
stored_ore[ore.material]++
user.remove_from_mob(W)
qdel(ore)
>>>>>>> fe004aefc3... Merge pull request #13799 from Cameron653/MINING_ADJUSTMENTS
else if (istype(W, /obj/item/weapon/storage)) else if (istype(W, /obj/item/weapon/storage/bag/ore))
var/obj/item/weapon/storage/S = W var/obj/item/weapon/storage/bag/ore/S = W
if(!S.contents.len)
return
S.hide_from(user) S.hide_from(user)
<<<<<<< HEAD
for(var/obj/item/weapon/ore/O in S.contents) for(var/obj/item/weapon/ore/O in S.contents)
if (O.name != "strange rock") if (O.name != "strange rock")
S.remove_from_storage(O, src) //This will move the item to this item's contents S.remove_from_storage(O, src) //This will move the item to this item's contents
else else
to_chat(user,"<span class='notice'>The [O] bounces out of the [src]!</span>") to_chat(user,"<span class='notice'>The [O] bounces out of the [src]!</span>")
to_chat(user,"<span class='notice'>You empty the satchel into the [src].</span>") to_chat(user,"<span class='notice'>You empty the satchel into the [src].</span>")
=======
update_ore_count() for(var/ore in S.stored_ore)
if(S.stored_ore[ore] > 0)
var/ore_amount = S.stored_ore[ore] // How many ores does the satchel have?
stored_ore[ore] += ore_amount // Add the ore to the machine.
S.stored_ore[ore] = 0 // Set the value of the ore in the satchel to 0.
S.current_capacity = 0 // Set the amount of ore in the satchel to 0.
to_chat(user, "<span class='notice'>You empty the satchel into the box.</span>")
>>>>>>> fe004aefc3... Merge pull request #13799 from Cameron653/MINING_ADJUSTMENTS
return return
/obj/structure/ore_box/proc/update_ore_count() /*
/obj/structure/ore_box/proc/update_ore_count() //OLD way of storing ore. Comment this out once done.
stored_ore = list() stored_ore = list()
@@ -42,7 +77,7 @@
stored_ore[O.name]++ stored_ore[O.name]++
else else
stored_ore[O.name] = 1 stored_ore[O.name] = 1
*/
/obj/structure/ore_box/examine(mob/user) /obj/structure/ore_box/examine(mob/user)
. = ..() . = ..()
@@ -51,19 +86,16 @@
add_fingerprint(user) add_fingerprint(user)
if(!contents.len)
. += "It is empty."
return .
if(world.time > last_update + 10)
update_ore_count()
last_update = world.time
. += "It holds:" . += "It holds:"
var/has_ore = 0
for(var/ore in stored_ore) for(var/ore in stored_ore)
. += "- [stored_ore[ore]] [ore]" if(stored_ore[ore] > 0)
. += "- [stored_ore[ore]] [ore]"
has_ore = 1
if(!has_ore)
. += "Nothing."
// /obj/structure/ore_box/verb/empty_box() // /obj/structure/ore_box/verb/empty_box() //Servercrash.mov
// set name = "Empty Ore Box" // set name = "Empty Ore Box"
// set category = "Object" // set category = "Object"
// set src in view(1) // set src in view(1)
@@ -92,9 +124,6 @@
// return // return
/obj/structure/ore_box/ex_act(severity) /obj/structure/ore_box/ex_act(severity)
if(severity == 1.0 || (severity < 3.0 && prob(50))) if(severity == 1.0 || (severity == 2.0 && prob(50)))
for (var/obj/item/weapon/ore/O in contents)
O.loc = src.loc
O.ex_act(severity++)
qdel(src) qdel(src)
return return

View File

@@ -55,6 +55,7 @@
EQUIPMENT("Survival Equipment - Insulated Poncho", /obj/random/thermalponcho, 750), EQUIPMENT("Survival Equipment - Insulated Poncho", /obj/random/thermalponcho, 750),
EQUIPMENT("Large Mining Satchel", /obj/item/weapon/storage/bag/ore/large, 1000), //CHOMP Add //CHOMPstation addition EQUIPMENT("Large Mining Satchel", /obj/item/weapon/storage/bag/ore/large, 1000), //CHOMP Add //CHOMPstation addition
EQUIPMENT("Mining Satchel of Holding", /obj/item/weapon/storage/bag/ore/holding, 1500), EQUIPMENT("Mining Satchel of Holding", /obj/item/weapon/storage/bag/ore/holding, 1500),
EQUIPMENT("Advanced Ore Scanner", /obj/item/weapon/mining_scanner/advanced, 500),
) )
prize_list["Consumables"] = list( prize_list["Consumables"] = list(
EQUIPMENT("1 Marker Beacon", /obj/item/stack/marker_beacon, 1), EQUIPMENT("1 Marker Beacon", /obj/item/stack/marker_beacon, 1),

View File

@@ -48,7 +48,7 @@
continue continue
if(!priority_process) sleep(-1) if(!priority_process) sleep(-1)
T.resources = list() T.resources = list()
T.resources["silicates"] = rand(3,5) T.resources["sand"] = rand(3,5)
T.resources["carbon"] = rand(3,5) T.resources["carbon"] = rand(3,5)
var/current_cell = map[get_map_cell(x,y)] 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["marble"] = rand(RESOURCE_LOW_MIN, RESOURCE_MID_MAX)
T.resources["diamond"] = 0 T.resources["diamond"] = 0
T.resources["phoron"] = 0 T.resources["phoron"] = 0
T.resources["osmium"] = 0 T.resources["platinum"] = 0
T.resources["hydrogen"] = 0 T.resources["mhydrogen"] = 0
T.resources["verdantium"] = 0 T.resources["verdantium"] = 0
T.resources["lead"] = 0 T.resources["lead"] = 0
//T.resources["copper"] = rand(RESOURCE_MID_MIN, RESOURCE_HIGH_MAX) //T.resources["copper"] = rand(RESOURCE_MID_MIN, RESOURCE_HIGH_MAX)

BIN
icons/obj/mining_ore_vr.dmi Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -48,7 +48,7 @@
continue continue
if(!priority_process) sleep(-1) if(!priority_process) sleep(-1)
T.resources = list() T.resources = list()
T.resources["silicates"] = rand(3,5) T.resources["sand"] = rand(3,5)
T.resources["carbon"] = rand(3,5) T.resources["carbon"] = rand(3,5)
var/current_cell = map[get_map_cell(x,y)] 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["marble"] = rand(RESOURCE_LOW_MIN, RESOURCE_MID_MAX)
T.resources["diamond"] = 0 T.resources["diamond"] = 0
T.resources["phoron"] = 0 T.resources["phoron"] = 0
T.resources["osmium"] = 0 T.resources["platinum"] = 0
T.resources["hydrogen"] = 0 T.resources["mhydrogen"] = 0
T.resources["verdantium"] = 0 T.resources["verdantium"] = 0
T.resources["lead"] = 0 T.resources["lead"] = 0
//T.resources["copper"] = rand(RESOURCE_MID_MIN, RESOURCE_HIGH_MAX) //T.resources["copper"] = rand(RESOURCE_MID_MIN, RESOURCE_HIGH_MAX)