Ore Bag Fixes [Requires #19383 merged first] (#19385)

* map stuff first

get this out of my changes

* Update vorestation.dme

* rest of it

* Better Bags

* Update ore_bag.dm

* Gets rid of bag override

* edits

* Less Jank

* aaa

* this doesnt work

* LOL WHY

* The future is NOW old man

* bye bye

* no hard refs~

* Update dog_sleeper.dm

* Update dog_sleeper.dm
This commit is contained in:
Cameron Lennox
2026-04-11 16:19:03 -04:00
committed by GitHub
parent 74791038ca
commit b4c3594844
33 changed files with 271 additions and 268 deletions
+1 -1
View File
@@ -94,7 +94,7 @@ NOTICE: Do not leave trailing commas!!!!
#define POCKET_MINING \
/obj/item/storage/excavation, \
/obj/item/storage/briefcase/inflatable, \
/obj/item/storage/bag/ore, \
/obj/item/ore_bag, \
/obj/item/pickaxe, \
/obj/item/shovel, \
/obj/item/stack/marker_beacon, \
+1 -1
View File
@@ -31,7 +31,7 @@
satchel_one = /obj/item/storage/backpack/satchel/eng
id_type = /obj/item/card/id/cargo/miner
pda_type = /obj/item/pda/shaftminer
backpack_contents = list(/obj/item/tool/crowbar = 1, /obj/item/storage/bag/ore = 1, /obj/item/mining_voucher = 1)
backpack_contents = list(/obj/item/tool/crowbar = 1, /obj/item/ore_bag = 1, /obj/item/mining_voucher = 1)
flags = OUTFIT_HAS_BACKPACK|OUTFIT_EXTENDED_SURVIVAL
headset = /obj/item/radio/headset/miner
+1 -1
View File
@@ -146,7 +146,7 @@
/obj/item/clothing/gloves/black,
/obj/item/clothing/shoes/black,
/obj/item/analyzer,
/obj/item/storage/bag/ore,
/obj/item/ore_bag,
/obj/item/flashlight/lantern,
/obj/item/shovel,
/obj/item/pickaxe,
+1 -1
View File
@@ -157,7 +157,7 @@
/obj/item/clothing/shoes/bhop = 125,
/obj/item/inducer = 125,
/obj/item/pickaxe/advdrill = 100,
/obj/item/storage/bag/ore/holding = 100
/obj/item/ore_bag/holding = 100
)
mail_color = COMMS_COLOR_SUPPLY
+1 -1
View File
@@ -110,7 +110,7 @@
to_chat(user, span_warning("[B.name] full. Empty or process contents to continue."))
return
if(B.ore_storage)
if(B.current_capacity >= B.max_ore_storage)
if(B.ore_bag.current_capacity >= B.ore_bag.max_storage_space)
to_chat(user, span_warning("Ore storage full. Deposit ore contents to a box continue."))
return
if(isbelly(output_atom))
@@ -88,165 +88,6 @@
can_hold = list() // any
cant_hold = list(/obj/item/disk/nuclear)
// -----------------------------
// Mining Satchel
// -----------------------------
/*
* Mechoid - Orebags are the most common quick-gathering thing, and also have tons of lag associated with it.
* Their checks are going to be hyper-simplified due to this, and their INCREDIBLY singular target contents.
*/
/obj/item/storage/bag/ore
name = "mining satchel"
desc = "This little bugger can be used to store and transport ores."
icon = 'icons/obj/mining.dmi'
icon_state = "satchel"
slot_flags = SLOT_BELT | SLOT_POCKET
w_class = ITEMSIZE_NORMAL
max_storage_space = ITEMSIZE_COST_NORMAL * 25
max_w_class = ITEMSIZE_NORMAL
allow_quick_empty = FALSE
can_hold = list(/obj/item/ore)
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(
ORE_SAND = 0,
ORE_HEMATITE = 0,
ORE_CARBON = 0,
ORE_COPPER = 0,
ORE_TIN = 0,
ORE_VOPAL = 0,
ORE_PAINITE = 0,
ORE_QUARTZ = 0,
ORE_BAUXITE = 0,
ORE_PHORON = 0,
ORE_SILVER = 0,
ORE_GOLD = 0,
ORE_MARBLE = 0,
ORE_URANIUM = 0,
ORE_DIAMOND = 0,
ORE_PLATINUM = 0,
ORE_LEAD = 0,
ORE_MHYDROGEN = 0,
ORE_VERDANTIUM = 0,
ORE_RUTILE = 0)
var/last_update = 0
/obj/item/storage/bag/ore/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."
icon_state = "satchel_bspace"
max_storage_space = ITEMSIZE_COST_NORMAL * 15000 // This should never, ever, ever be reached.
/obj/item/storage/bag/ore/attackby(obj/item/W as obj, mob/user as mob)
if(current_capacity >= max_storage_space)
to_chat(user, span_notice("\the [src] is too full to possibly fit anything else inside of it."))
return
if (istype(W, /obj/item/ore) && !istype(W, /obj/item/ore/slag))
var/obj/item/ore/ore = W
stored_ore[ore.material]++
current_capacity++
user.remove_from_mob(W)
qdel(ore)
/obj/item/storage/bag/ore/remove_from_storage(obj/item/W as obj, atom/new_location)
if(!istype(W)) return 0
if(new_location)
if(ismob(loc))
W.dropped(usr)
if(ismob(new_location))
W.hud_layerise()
else
W.reset_plane_and_layer()
W.forceMove(new_location)
else
W.forceMove(get_turf(src))
W.on_exit_storage(src)
update_icon()
return 1
/obj/item/storage/bag/ore/gather_all(turf/T as turf, mob/user as mob, var/silent = 0)
var/success = 0
var/failure = 0
var/current_pickup = 0
var/max_pickup_reached = 0
for(var/obj/item/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
break
if(current_pickup >= max_pickup)
max_pickup_reached = 1
break
if(istype(O, /obj/item/ore/slag))
continue
var/obj/item/ore/ore = O
stored_ore[ore.material]++
current_capacity++
current_pickup++
qdel(ore)
success = 1
if(!silent) //Let's do a single check and then do more instead of a bunch at once.
if(success && !failure && !max_pickup_reached) //Picked stuff up, did not reach capacity, did not reach max_pickup.
to_chat(user, span_notice("You put everything in [src]."))
else if(success && failure) //Picked stuff up to capacity.
to_chat(user, span_notice("You fill the [src]."))
else if(success && max_pickup_reached) //Picked stuff up to the max_pickup
to_chat(user, span_notice("You fill the [src] with as much as you can grab in one go."))
else //Failed. The bag is full.
to_chat(user, span_notice("You fail to pick anything up with \the [src]."))
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/storage/bag/ore/equipped(mob/user)
..()
user.AddComponent(/datum/component/recursive_move)
RegisterSignal(user, COMSIG_MOVABLE_ATTEMPTED_MOVE, /obj/item/storage/bag/ore/proc/autoload, override = TRUE)
/obj/item/storage/bag/ore/dropped(mob/user)
..()
UnregisterSignal(user, COMSIG_MOVABLE_ATTEMPTED_MOVE)
/obj/item/storage/bag/ore/proc/autoload(mob/user)
SIGNAL_HANDLER
var/obj/item/ore/O = locate() in get_turf(src)
if(O)
gather_all(get_turf(src), user)
/obj/item/storage/bag/ore/proc/rangedload(atom/A, mob/user)
var/obj/item/ore/O = locate() in get_turf(A)
if(O)
gather_all(get_turf(A), user)
/obj/item/storage/bag/ore/examine(mob/user)
. = ..()
if(!Adjacent(user)) //Can only check the contents of ore bags if you can physically reach them.
return .
if(isliving(user))
add_fingerprint(user)
. += span_notice("It holds:")
var/has_ore = 0
for(var/ore in stored_ore)
if(stored_ore[ore] > 0)
. += span_notice("- [stored_ore[ore]] [ore]")
has_ore = 1
if(!has_ore)
. += "Nothing."
/obj/item/storage/bag/ore/open(mob/user as mob) //No opening it for the weird UI of having shit-tons of ore inside it.
user.examinate(src)
// -----------------------------
// Plant bag
// -----------------------------
@@ -737,7 +737,7 @@
/obj/item/melee,
/obj/item/kinetic_crusher,
/obj/item/mining_scanner,
/obj/item/storage/bag/ore,
/obj/item/ore_bag,
/obj/item/storage/sample_container
)
//Pretty much, if it's in the mining vendor, they should be able to put it on the belt.
@@ -0,0 +1,179 @@
// -----------------------------
// Mining Satchel
// -----------------------------
/*
* Mechoid - Orebags are the most common quick-gathering thing, and also have tons of lag associated with it.
* Their checks are going to be hyper-simplified due to this, and their INCREDIBLY singular target contents.
*/
/obj/item/ore_bag
name = "mining satchel"
desc = "This little bugger can be used to store and transport ores."
icon = 'icons/obj/mining.dmi'
item_icons = list(
slot_l_hand_str = 'icons/mob/items/lefthand_storage.dmi',
slot_r_hand_str = 'icons/mob/items/righthand_storage.dmi',
)
icon_state = "satchel"
slot_flags = SLOT_BELT | SLOT_POCKET
w_class = ITEMSIZE_NORMAL
var/current_capacity = 0
var/max_storage_space = 100
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(
ORE_SAND = 0,
ORE_HEMATITE = 0,
ORE_CARBON = 0,
ORE_COPPER = 0,
ORE_TIN = 0,
ORE_VOPAL = 0,
ORE_PAINITE = 0,
ORE_QUARTZ = 0,
ORE_BAUXITE = 0,
ORE_PHORON = 0,
ORE_SILVER = 0,
ORE_GOLD = 0,
ORE_MARBLE = 0,
ORE_URANIUM = 0,
ORE_DIAMOND = 0,
ORE_PLATINUM = 0,
ORE_LEAD = 0,
ORE_MHYDROGEN = 0,
ORE_VERDANTIUM = 0,
ORE_RUTILE = 0)
var/last_update = 0
drop_sound = 'sound/items/drop/backpack.ogg'
pickup_sound = 'sound/items/pickup/backpack.ogg'
/obj/item/ore_bag/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."
icon_state = "satchel_bspace"
max_storage_space = ITEMSIZE_COST_NORMAL * 15000 // This should never, ever, ever be reached.
/obj/item/ore_bag/sleeper
name = "processing chamber"
desc = "A mining satchel built into a sleeper. VORE!!!"
icon_state = "satchel_bspace"
max_storage_space = 500
//item_flags = ABSTRACT //Enable once we have abstract PR merged.
/obj/item/ore_bag/attackby(obj/item/W, mob/user)
if(current_capacity >= max_storage_space)
to_chat(user, span_notice("\the [src] is too full to possibly fit anything else inside of it."))
return
if (istype(W, /obj/item/ore) && !istype(W, /obj/item/ore/slag) && !istype(W, /obj/item/ore/archeology_debris))
var/obj/item/ore/ore = W
stored_ore[ore.material]++
current_capacity++
user.remove_from_mob(W)
qdel(ore)
/obj/item/ore_bag/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
//If we attack a turf, we try to scoop up all the ore from the turf first.
if(isturf(target) && user.Adjacent(target))
gather_all(target, user)
return
//If we attack an ore, see if it's on a turf. If so, scoop up everything on the turf. If not, scoop up just that ore.
else if(istype(target, /obj/item/ore) && user.Adjacent(target))
var/turf_check = isturf(target.loc) //get_turf intentionally not used here due to clicking ore in a backpack or other weirdness.
if(turf_check)
gather_all(target.loc, user)
return
/obj/item/ore_bag/proc/remove_from_storage(obj/item/W, atom/new_location)
if(!istype(W)) return 0
if(new_location)
if(ismob(loc))
W.dropped(usr)
if(ismob(new_location))
W.hud_layerise()
else
W.reset_plane_and_layer()
W.forceMove(new_location)
else
W.forceMove(get_turf(src))
W.on_exit_storage(src)
update_icon()
return 1
/obj/item/ore_bag/proc/gather_all(turf/T, mob/user, var/silent = 0)
var/success = 0
var/failure = 0
var/current_pickup = 0
var/max_pickup_reached = 0
for(var/obj/item/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
break
if(current_pickup >= max_pickup)
max_pickup_reached = 1
break
if(istype(O, /obj/item/ore/slag) || istype(O, /obj/item/ore/archeology_debris))
continue
var/obj/item/ore/ore = O
stored_ore[ore.material]++
current_capacity++
current_pickup++
qdel(ore)
success = 1
if(!silent) //Let's do a single check and then do more instead of a bunch at once.
if(success && !failure && !max_pickup_reached) //Picked stuff up, did not reach capacity, did not reach max_pickup.
to_chat(user, span_notice("You put everything in [src]."))
else if(success && failure) //Picked stuff up to capacity.
to_chat(user, span_notice("You fill the [src]."))
else if(success && max_pickup_reached) //Picked stuff up to the max_pickup
to_chat(user, span_notice("You fill the [src] with as much as you can grab in one go."))
else //Failed. The bag is full.
to_chat(user, span_notice("You fail to pick anything up with \the [src]."))
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
return success
/obj/item/ore_bag/equipped(mob/user)
..()
user.AddComponent(/datum/component/recursive_move)
RegisterSignal(user, COMSIG_MOVABLE_ATTEMPTED_MOVE, /obj/item/ore_bag/proc/autoload)
/obj/item/ore_bag/dropped(mob/user)
..()
UnregisterSignal(user, COMSIG_MOVABLE_ATTEMPTED_MOVE)
/obj/item/ore_bag/proc/autoload(mob/user)
SIGNAL_HANDLER
var/obj/item/ore/O = locate() in get_turf(user)
if(O)
gather_all(get_turf(user), user)
/obj/item/ore_bag/proc/rangedload(atom/A, mob/user)
var/obj/item/ore/O = locate() in get_turf(A)
if(O)
gather_all(get_turf(A), user)
/obj/item/ore_bag/examine(mob/user)
. = ..()
if(!Adjacent(user)) //Can only check the contents of ore bags if you can physically reach them.
return .
if(isliving(user))
add_fingerprint(user)
. += span_notice("It holds:")
var/has_ore = 0
for(var/ore in stored_ore)
if(stored_ore[ore] > 0)
. += span_notice("- [stored_ore[ore]] [ore]")
has_ore = 1
if(!has_ore)
. += "Nothing."
+10 -10
View File
@@ -347,7 +347,7 @@
),
prob(2);list(
/obj/item/rig/industrial/equipped,
/obj/item/storage/bag/ore,
/obj/item/ore_bag,
/obj/structure/closet/crate/engineering
),
prob(2);list(
@@ -406,43 +406,43 @@
),
prob(2);list(
/obj/item/pickaxe/silver,
/obj/item/storage/bag/ore,
/obj/item/ore_bag,
/obj/item/clothing/glasses/material,
/obj/structure/closet/crate/engineering
),
prob(2);list(
/obj/item/pickaxe/advdrill,
/obj/item/storage/bag/ore,
/obj/item/ore_bag,
/obj/item/clothing/glasses/material,
/obj/structure/closet/crate/engineering
),
prob(2);list(
/obj/item/pickaxe/jackhammer,
/obj/item/storage/bag/ore,
/obj/item/ore_bag,
/obj/item/clothing/glasses/material,
/obj/structure/closet/crate/engineering
),
prob(2);list(
/obj/item/pickaxe/diamond,
/obj/item/storage/bag/ore,
/obj/item/ore_bag,
/obj/item/clothing/glasses/material,
/obj/structure/closet/crate/engineering
),
prob(2);list(
/obj/item/pickaxe/diamonddrill,
/obj/item/storage/bag/ore,
/obj/item/ore_bag,
/obj/item/clothing/glasses/material,
/obj/structure/closet/crate/engineering
),
prob(2);list(
/obj/item/pickaxe/gold,
/obj/item/storage/bag/ore,
/obj/item/ore_bag,
/obj/item/clothing/glasses/material,
/obj/structure/closet/crate/engineering
),
prob(2);list(
/obj/item/pickaxe/plasmacutter,
/obj/item/storage/bag/ore,
/obj/item/ore_bag,
/obj/item/clothing/glasses/material,
/obj/structure/closet/crate/engineering
),
@@ -1617,7 +1617,7 @@
/obj/random/multiple/underdark/ores/item_to_spawn()
return pick(
prob(9);list(
/obj/item/storage/bag/ore,
/obj/item/ore_bag,
/obj/item/shovel,
/obj/item/ore/glass,
/obj/item/ore/glass,
@@ -1637,7 +1637,7 @@
/obj/item/ore/hydrogen
),
prob(7);list(
/obj/item/storage/bag/ore,
/obj/item/ore_bag,
/obj/item/pickaxe,
/obj/item/ore/osmium,
/obj/item/ore/osmium,
+1 -1
View File
@@ -1134,7 +1134,7 @@
prob(10);/obj/item/clothing/under/hyperfiber,
prob(10);/obj/item/clothing/under/hyperfiber/bluespace,
prob(20);/obj/item/implant/sizecontrol,
prob(2);/obj/item/storage/bag/ore/holding,
prob(2);/obj/item/ore_bag/holding,
prob(2);/obj/item/storage/bag/sheetsnatcher/holding,
prob(2);/obj/item/storage/backpack/holding,
prob(2);/obj/item/storage/backpack/holding/duffle,
@@ -80,7 +80,7 @@
/obj/item/clothing/gloves/black,
/obj/item/clothing/shoes/black,
/obj/item/analyzer,
/obj/item/storage/bag/ore,
/obj/item/ore_bag,
/obj/item/storage/belt/miner,
/obj/item/flashlight/lantern,
/obj/item/shovel,
+2 -9
View File
@@ -402,13 +402,6 @@ GLOBAL_LIST_EMPTY(mining_overlay_cache)
to_chat(user, span_notice("You dug a hole."))
GetDrilled()
else if(istype(W,/obj/item/storage/bag/ore))
var/obj/item/storage/bag/ore/S = W
if(S.collection_mode)
for(var/obj/item/ore/O in contents)
O.attackby(W,user)
return
else if(istype(W,/obj/item/storage/bag/fossils))
var/obj/item/storage/bag/fossils/S = W
if(S.collection_mode)
@@ -497,7 +490,7 @@ GLOBAL_LIST_EMPTY(mining_overlay_cache)
next_rock += S.excavation_amount
while(next_rock > 50)
next_rock -= 50
var/obj/item/ore/O = new(src)
var/obj/item/ore/archeology_debris/O = new(src)
geologic_data.UpdateNearbyArtifactInfo(src)
O.geologic_data = geologic_data
@@ -547,7 +540,7 @@ GLOBAL_LIST_EMPTY(mining_overlay_cache)
next_rock += P.excavation_amount
while(next_rock > 50)
next_rock -= 50
var/obj/item/ore/O = new(src)
var/obj/item/ore/archeology_debris/O = new(src)
geologic_data.UpdateNearbyArtifactInfo(src)
O.geologic_data = geologic_data
return
+4
View File
@@ -7,6 +7,10 @@
var/datum/geosample/geologic_data
var/material
/obj/item/ore/archeology_debris
name = "rocky debris"
desc = "Leftover rocky debris from digging."
/obj/item/ore/uranium
name = "pitchblende"
icon_state = "ore_uranium"
+10 -5
View File
@@ -33,16 +33,20 @@
. = ..()
AddElement(/datum/element/climbable)
/obj/structure/ore_box/attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/ore))
/obj/structure/ore_box/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/ore))
var/obj/item/ore/ore = W
stored_ore[ore.material]++
user.remove_from_mob(W)
qdel(ore)
return
else if (istype(W, /obj/item/storage/bag/ore))
var/obj/item/storage/bag/ore/S = W
S.hide_from(user)
if(istype(W, /obj/item/dogborg/sleeper/compactor/supply))
var/obj/item/dogborg/sleeper/compactor/supply/borg_sleeper = W
W = borg_sleeper.ore_bag
if(istype(W, /obj/item/ore_bag))
var/obj/item/ore_bag/S = W
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?
@@ -50,6 +54,7 @@
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_notice("You empty the satchel into the box."))
return
return
@@ -69,7 +69,7 @@
EQUIPMENT("Jump Boots", /obj/item/clothing/shoes/bhop, 2500),
EQUIPMENT("Mini-Translocator", /obj/item/perfect_tele/one_beacon, 1200),
EQUIPMENT("Survival Equipment - Insulated Poncho", /obj/random/thermalponcho, 750),
EQUIPMENT("Mining Satchel of Holding", /obj/item/storage/bag/ore/holding, 1500),
EQUIPMENT("Mining Satchel of Holding", /obj/item/ore_bag/holding, 1500),
EQUIPMENT("Industrial Equipment - Sheet-Snatcher", /obj/item/storage/bag/sheetsnatcher, 500),
EQUIPMENT("Sheet Snatcher of Holding", /obj/item/storage/bag/sheetsnatcher/holding, 1000),
EQUIPMENT("Advanced Ore Scanner", /obj/item/mining_scanner/advanced, 500),
@@ -43,8 +43,7 @@
var/medsensor = TRUE //Does belly sprite come with patient ok/dead light?
var/obj/item/healthanalyzer/med_analyzer = null
var/ore_storage = FALSE
var/max_ore_storage = 500
var/current_capacity = 0
var/obj/item/ore_bag/sleeper/ore_bag //Used by supply compactor
flags = NOBLUDGEON
/obj/item/dogborg/sleeper/Initialize(mapload)
@@ -58,11 +57,17 @@
config_flags = EXPERIMENT_CONFIG_ALWAYS_ACTIVE|EXPERIMENT_CONFIG_SILENT_FAIL,\
experiment_signals = destructive_signals, \
)
if(ore_storage)
ore_bag = new(null) //We don't need it inside, just need a reference to it.
. = ..()
med_analyzer = new /obj/item/healthanalyzer
/obj/item/dogborg/sleeper/Destroy()
go_out()
if(ore_bag)
QDEL_NULL(ore_bag)
if(med_analyzer)
QDEL_NULL(med_analyzer)
. = ..()
/obj/item/dogborg/sleeper/Exit(atom/movable/O)
@@ -75,11 +80,11 @@
var/datum/gas_mixture/belly_air/air = new(1000)
return air
/obj/item/dogborg/sleeper/afterattack(var/atom/movable/target, mob/living/silicon/user, proximity)
/obj/item/dogborg/sleeper/afterattack(var/atom/movable/target, mob/living/silicon/user, proximity_flag, click_parameters)
hound = loc
if(!istype(target))
return
if(!proximity)
if(!proximity_flag)
return
if(target.anchored)
return
@@ -156,7 +161,7 @@
return
user.visible_message(span_warning("[hound.name] is ingesting [H.name] into their [src.name]."), span_notice("You start ingesting [H] into your [src]..."))
if(!patient && !H.buckled && do_after (user, 50, H))
if(!proximity)
if(!proximity_flag)
return //If they moved away, you can't eat them.
if(patient)
return //If you try to eat two people at once, you can only eat one.
@@ -291,6 +296,11 @@
)
var/datum/component/experiment_handler/handler = get_experiment_handler()
var/current_capacity = 0
var/max_ore_storage = 0
if(ore_storage)
current_capacity = ore_bag.current_capacity
max_ore_storage = ore_bag.max_storage_space
var/list/data = list(
"our_patient" = patient_data,
"eject_port" = eject_port,
@@ -50,49 +50,26 @@
injection_chems = list(REAGENT_ID_GLUCOSE,REAGENT_ID_INAPROVALINE,REAGENT_ID_TRICORDRAZINE)
max_item_count = 20
ore_storage = TRUE
var/list/stored_ore = list(
ORE_SAND = 0,
ORE_HEMATITE = 0,
ORE_CARBON = 0,
ORE_COPPER = 0,
ORE_TIN = 0,
ORE_VOPAL = 0,
ORE_PAINITE = 0,
ORE_QUARTZ = 0,
ORE_BAUXITE = 0,
ORE_PHORON = 0,
ORE_SILVER = 0,
ORE_GOLD = 0,
ORE_MARBLE = 0,
ORE_URANIUM = 0,
ORE_DIAMOND = 0,
ORE_PLATINUM = 0,
ORE_LEAD = 0,
ORE_MHYDROGEN = 0,
ORE_VERDANTIUM = 0,
ORE_RUTILE = 0)
medsensor = FALSE
/obj/item/dogborg/sleeper/compactor/supply/Entered(atom/movable/thing, atom/OldLoc)
. = ..()
if(istype(thing, /obj/item/ore))
var/obj/item/ore/ore = thing
stored_ore[ore.material]++
current_capacity++
qdel(ore)
/obj/structure/ore_box/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/dogborg/sleeper/compactor/supply))
var/obj/item/dogborg/sleeper/compactor/supply/S = W
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_notice("You empty the satchel into the box."))
/obj/item/dogborg/sleeper/compactor/supply/afterattack(atom/movable/target, mob/living/silicon/user, proximity_flag, click_parameters)
if(!proximity_flag)
return
..()
if(isturf(target))
if(ore_bag.gather_all(target, user, TRUE))
user.visible_message(span_warning("[hound.name]'s [src.name] groans lightly as ore slips inside."), span_notice("Your [src.name] groans lightly as ore slips inside."))
playsound(src, gulpsound, vol = 60, vary = 1, falloff = 0.1, preference = /datum/preference/toggle/eating_noises)
return
if(istype(target, /obj/item/ore) && !istype(target, /obj/item/ore/slag) && !istype(target, /obj/item/ore/archeology_debris))
var/turf_check = isturf(target.loc) //get_turf intentionally not used here due to clicking ore in a backpack or other weirdness.
if(turf_check)
if(ore_bag.gather_all(target.loc, user, TRUE))
user.visible_message(span_warning("[hound.name]'s [src.name] groans lightly as ore slips inside."), span_notice("Your [src.name] groans lightly as ore slips inside."))
playsound(src, gulpsound, vol = 60, vary = 1, falloff = 0.1, preference = /datum/preference/toggle/eating_noises)
return
. = ..()
/obj/item/dogborg/sleeper/compactor/brewer
name = "Brew Belly"
@@ -378,6 +378,13 @@
if(tracker.tracking)
tracker.tracking = FALSE
tracker.toggle_tracking()
if(istype(O, /obj/item/dogborg/sleeper)) //gross
var/obj/item/dogborg/sleeper/our_compactor = O
if(our_compactor.ore_storage)
if(O in get_all_held_items())
our_compactor.ore_bag.equipped(src)
else
our_compactor.ore_bag.dropped(src)
if(sight_mode & BORGANOMALOUS)
var/obj/item/dogborg/pounce/pounce = has_upgrade_module(/obj/item/dogborg/pounce)
if(pounce)
@@ -744,7 +744,6 @@
src.modules += new /obj/item/borg/sight/material(src)
src.modules += new /obj/item/tool/wrench/cyborg(src)
src.modules += new /obj/item/tool/screwdriver/cyborg(src)
src.modules += new /obj/item/storage/bag/ore(src)
src.modules += new /obj/item/pickaxe/borgdrill(src)
src.modules += new /obj/item/storage/bag/sheetsnatcher/borg(src)
src.modules += new /obj/item/gripper/miner(src)
@@ -933,7 +932,7 @@
..()
src.modules += new /obj/item/borg/sight/material(src)
src.modules += new /obj/item/pickaxe/borgdrill(src)
src.modules += new /obj/item/storage/bag/ore(src)
src.modules += new /obj/item/ore_bag(src)
src.modules += new /obj/item/storage/bag/sheetsnatcher/borg(src)
src.emag += new /obj/item/pickaxe/diamonddrill(src)
@@ -46,19 +46,6 @@
if(!module)
return
//Borgs and drones can use their mining bags ~automagically~ if they're deployed in a slot. Only mining bags, as they're optimized for mass use.
if(istype(module_state_1, /obj/item/storage/bag/ore) || istype(module_state_2, /obj/item/storage/bag/ore) || istype(module_state_3, /obj/item/storage/bag/ore))
var/obj/item/storage/bag/ore/B = null
if(istype(module_state_1, /obj/item/storage/bag/ore)) //First orebag has priority, if they for some reason have multiple.
B = module_state_1
else if(istype(module_state_2, /obj/item/storage/bag/ore))
B = module_state_2
else if(istype(module_state_3, /obj/item/storage/bag/ore))
B = module_state_3
var/turf/tile = loc
if(isturf(tile))
B.gather_all(tile, src, 1) //Shhh, unless the bag fills, don't spam the borg's chat with stuff that's going on every time they move!
if(scrubbing && isturf(loc))
var/turf/tile = loc
tile.wash(CLEAN_SCRUB)
@@ -62,7 +62,7 @@
var/datum/effect/effect/system/ion_trail_follow/ion_trail = null
var/obj/item/shield_projector/shields = null
var/obj/item/storage/bag/ore/my_storage = null
var/obj/item/ore_bag/my_storage = null
var/last_search = 0
var/search_cooldown = 5 SECONDS
@@ -74,7 +74,7 @@
ion_trail.set_up(src)
ion_trail.start()
my_storage = new /obj/item/storage/bag/ore(src)
my_storage = new /obj/item/ore_bag(src)
shields = new /obj/item/shield_projector/rectangle/automatic/drone(src)
return ..()
@@ -123,7 +123,7 @@
var/turf/simulated/mineral/M = T
M.GetDrilled(TRUE)
if(firer)
var/obj/item/storage/bag/ore/orebag = locate(/obj/item/storage/bag/ore) in firer
var/obj/item/ore_bag/orebag = locate(/obj/item/ore_bag) in firer
if(orebag)
for(var/turf/T in RANGE_TURFS(2, target_turf))
orebag.gather_all(T, firer, TRUE)
@@ -60,7 +60,7 @@
// req_tech = list(TECH_BLUESPACE = 2, TECH_MATERIAL = 3)
build_type = PROTOLATHE
materials = list(MAT_GOLD = 1000, MAT_DIAMOND = 500, MAT_URANIUM = 250) // Less expensive since it can only hold ores
build_path = /obj/item/storage/bag/ore/holding
build_path = /obj/item/ore_bag/holding
category = list(
RND_CATEGORY_EQUIPMENT + RND_SUBCATEGORY_EQUIPMENT_BLUESPACE
)
+2 -2
View File
@@ -121,8 +121,8 @@
var/turf/simulated/mineral/T = item_to_sample
T.geologic_data.UpdateNearbyArtifactInfo(T)
geo_data = T.geologic_data
else if(istype(item_to_sample, /obj/item/ore))
var/obj/item/ore/O = item_to_sample
else if(istype(item_to_sample, /obj/item/ore/archeology_debris))
var/obj/item/ore/archeology_debris/O = item_to_sample
geo_data = O.geologic_data
if(geo_data)
@@ -242,8 +242,8 @@
var/data = " - Mundane object: [scanned_item.desc ? scanned_item.desc : "No information on record."]<br>"
var/datum/geosample/G
switch(scanned_item.type)
if(/obj/item/ore)
var/obj/item/ore/O = scanned_item
if(/obj/item/ore/archeology_debris)
var/obj/item/ore/archeology_debris/O = scanned_item
if(O.geologic_data)
G = O.geologic_data