From 4c59644d95bd800f396eac1e3b29dd4b247257b7 Mon Sep 17 00:00:00 2001 From: Artorp Date: Sat, 9 Aug 2014 02:51:15 +0200 Subject: [PATCH 1/3] Enable medical belt quick pickup Using a medical belt on a bottle will attempt to pick up all bottles on the tile. --- code/game/objects/items/weapons/storage/belt.dm | 1 + code/modules/reagents/reagent_containers/glass.dm | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm index 46ef15a70a0..5a5be3c9e6e 100644 --- a/code/game/objects/items/weapons/storage/belt.dm +++ b/code/game/objects/items/weapons/storage/belt.dm @@ -72,6 +72,7 @@ /obj/item/weapon/storage/belt/medical + use_to_pickup = 1 //Allow medical belt to pick up medicine name = "medical belt" desc = "Can hold various medical equipment." icon_state = "medicalbelt" diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index f88918d5402..9bb38723a8f 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -152,7 +152,9 @@ return attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen)) + + ..() + if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen)) var/tmp_label = sanitize(input(user, "Enter a label for [src.name]","Label",src.label_text)) if(length(tmp_label) > 10) user << "\red The label can be at most 10 characters long." From 32d14b8307e8279a678d48015f6104be2d44b11a Mon Sep 17 00:00:00 2001 From: Artorp Date: Sat, 9 Aug 2014 03:18:31 +0200 Subject: [PATCH 2/3] Medical belt can load into fridge - Fixed compiling error with glass.dm - Medical belt will load apropriate items into the medical fridge when used on the fridge --- code/game/machinery/kitchen/smartfridge.dm | 5 +++-- code/modules/reagents/reagent_containers/glass.dm | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm index e51b11aafa4..f5c5e474cfb 100644 --- a/code/game/machinery/kitchen/smartfridge.dm +++ b/code/game/machinery/kitchen/smartfridge.dm @@ -96,7 +96,7 @@ nanomanager.update_uis(src) - else if(istype(O, /obj/item/weapon/storage/bag/plants)) + else if(istype(O, /obj/item/weapon/storage/bag/plants) || istype(O, /obj/item/weapon/storage/belt/medical)) var/obj/item/weapon/storage/bag/plants/P = O var/plants_loaded = 0 for(var/obj/G in P.contents) @@ -120,7 +120,8 @@ user << "Some items are refused." nanomanager.update_uis(src) - + + else user << "\The [src] smartly refuses [O]." return 1 diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 9bb38723a8f..6f95851c7a7 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -152,9 +152,8 @@ return attackby(obj/item/weapon/W as obj, mob/user as mob) - - ..() - if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen)) + ..() + if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen)) var/tmp_label = sanitize(input(user, "Enter a label for [src.name]","Label",src.label_text)) if(length(tmp_label) > 10) user << "\red The label can be at most 10 characters long." From c0378f14342994d692db4a4b382a155996038817 Mon Sep 17 00:00:00 2001 From: Artorp Date: Sat, 9 Aug 2014 04:36:37 +0200 Subject: [PATCH 3/3] Added: Pill bottle emptying into fridge - Drag pill bottle sprite onto fridge to empty it Code for batch filling of fridge is re-used from similar uses of plant bag and ore bag. --- code/game/machinery/kitchen/smartfridge.dm | 39 +++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm index f5c5e474cfb..7f8ba253582 100644 --- a/code/game/machinery/kitchen/smartfridge.dm +++ b/code/game/machinery/kitchen/smartfridge.dm @@ -120,8 +120,8 @@ user << "Some items are refused." nanomanager.update_uis(src) - - + + else user << "\The [src] smartly refuses [O]." return 1 @@ -139,6 +139,39 @@ ui_interact(user) +//Drag pill bottle to fridge to empty it into the fridge +/obj/machinery/smartfridge/MouseDrop_T(obj/over_object as obj, mob/user as mob) + if(!istype(over_object, /obj/item/weapon/storage/pill_bottle)) //Only pill bottles, please + return + + if(!src.ispowered) + user << "\The [src] is unpowered and useless." + return + + var/obj/item/weapon/storage/box/pillbottles/P = over_object + var/items_loaded = 0 + for(var/obj/G in P.contents) + if(accept_check(G)) + if(contents.len >= max_n_of_items) + user << "\The [src] is full." + return 1 + else + P.remove_from_storage(G,src) + if(item_quants[G.name]) + item_quants[G.name]++ + else + item_quants[G.name] = 1 + items_loaded++ + if(items_loaded) + user.visible_message( \ + "[user] empties \the [P] into \the [src].", \ + "You empty \the [P] into \the [src].") + if(P.contents.len > 0) + user << "Some items are refused." + nanomanager.update_uis(src) + updateUsrDialog() + + /******************* * SmartFridge Menu ********************/ @@ -202,5 +235,3 @@ return 0 - -