Merge pull request #2926 from Anewbe/custodial_tweaks

Ports Bay's custodial bag tweaks
This commit is contained in:
Anewbe
2017-01-15 18:54:02 -05:00
committed by GitHub
5 changed files with 72 additions and 24 deletions

View File

@@ -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 << "<span class='notice'>You put everything in [S].</span>"
else if(success)
user << "<span class='notice'>You put some things in [S].</span>"
else
user << "<span class='notice'>You fail to pick anything up with \the [S].</span>"
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

View File

@@ -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, "<span class='notice'>You put everything in [src].</span>")
else if(success)
to_chat(user, "<span class='notice'>You put some things in [src].</span>")
else
to_chat(user, "<span class='notice'>You fail to pick anything up with \the [src].</span>")
/obj/item/weapon/storage/verb/toggle_gathering_mode()
set name = "Switch Gathering Method"
set category = "Object"

View File

@@ -78,6 +78,9 @@
else
user << "<span class='notice'>[src] can't hold any more signs.</span>"
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)

View File

@@ -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 << "<span class='warning'>Movement is admin-disabled.</span>" //This is to identify lag problems

View File

@@ -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."