diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 64e8c5e539..c61c44be8d 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -206,38 +206,18 @@ R.activate_module(src) R.hud_used.update_robot_modules_display() -// Due to storage type consolidation this should get used more now. -// I have cleaned it up a little, but it could probably use more. -Sayu /obj/item/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W,/obj/item/weapon/storage)) + if(istype(W, /obj/item/weapon/storage)) var/obj/item/weapon/storage/S = W if(S.use_to_pickup) - if(S.collection_mode) //Mode is set to collect all items on a tile and we clicked on a valid one. + if(S.collection_mode) //Mode is set to collect all items if(isturf(src.loc)) - var/list/rejections = list() - var/success = 0 - var/failure = 0 - - for(var/obj/item/I in src.loc) - if(I.type in rejections) // To limit bag spamming: any given type only complains once - continue - if(!S.can_be_inserted(I)) // Note can_be_inserted still makes noise when the answer is no - rejections += I.type // therefore full bags are still a little spammy - failure = 1 - continue - success = 1 - S.handle_item_insertion(I, 1) //The 1 stops the "You put the [src] into [S]" insertion message from being displayed. - if(success && !failure) - user << "You put everything in [S]." - else if(success) - user << "You put some things in [S]." - else - user << "You fail to pick anything up with \the [S]." + S.gather_all(src.loc, user) else if(S.can_be_inserted(src)) S.handle_item_insertion(src) - return + return ..() /obj/item/proc/talk_into(mob/M as mob, text) return diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index e691ed2795..8c1c47713a 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -478,6 +478,27 @@ src.add_fingerprint(user) return +/obj/item/weapon/storage/proc/gather_all(turf/T as turf, mob/user as mob) + var/list/rejections = list() + var/success = 0 + var/failure = 0 + + for(var/obj/item/I in T) + if(I.type in rejections) // To limit bag spamming: any given type only complains once + continue + if(!can_be_inserted(I, user)) // Note can_be_inserted still makes noise when the answer is no + rejections += I.type // therefore full bags are still a little spammy + failure = 1 + continue + success = 1 + handle_item_insertion(I, 1) //The 1 stops the "You put the [src] into [S]" insertion message from being displayed. + if(success && !failure) + to_chat(user, "You put everything in [src].") + else if(success) + to_chat(user, "You put some things in [src].") + else + to_chat(user, "You fail to pick anything up with \the [src].") + /obj/item/weapon/storage/verb/toggle_gathering_mode() set name = "Switch Gathering Method" set category = "Object" diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index 588517a7ed..0d8a94944d 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -78,6 +78,9 @@ else user << "[src] can't hold any more signs." + else if(istype(I, /obj/item/weapon/reagent_containers/glass)) + return // So we do not put them in the trash bag as we mean to fill the mop bucket + else if(mybag) mybag.attackby(I, user) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index e3cdd8328a..ecc8c49c4b 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -68,6 +68,13 @@ step(user.pulling, get_dir(user.pulling.loc, src)) return 1 +turf/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W, /obj/item/weapon/storage)) + var/obj/item/weapon/storage/S = W + if(S.use_to_pickup && S.collection_mode) + S.gather_all(src, user) + return ..() + /turf/Enter(atom/movable/mover as mob|obj, atom/forget as mob|obj|turf|area) if(movement_disabled && usr.ckey != movement_disabled_exception) usr << "Movement is admin-disabled." //This is to identify lag problems diff --git a/html/changelogs/Hubblenaut - Custodial.yml b/html/changelogs/Hubblenaut - Custodial.yml new file mode 100644 index 0000000000..881c51aa3b --- /dev/null +++ b/html/changelogs/Hubblenaut - Custodial.yml @@ -0,0 +1,37 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Hubblenaut + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - tweak: "Can now click on turfs with trash bags and similar to quick-gather everything on it. No longer pixelhunting for cigarettes and bullets." + - bugfix: "Buckets and other reagent holders will no longer simply be put into the janitorial cart's trash bag." \ No newline at end of file