Ports Bay's custodial bag tweaks

This commit is contained in:
Anewbe
2017-01-14 23:44:16 -06:00
parent 93a630e2e8
commit 0286be65ff
5 changed files with 72 additions and 24 deletions
+4 -24
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
@@ -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"
+3
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)