diff --git a/_maps/map_files/cyberiad/cyberiad.dmm b/_maps/map_files/cyberiad/cyberiad.dmm index d6fe5f20d6f..a0deb25b20d 100644 --- a/_maps/map_files/cyberiad/cyberiad.dmm +++ b/_maps/map_files/cyberiad/cyberiad.dmm @@ -49566,11 +49566,9 @@ pixel_y = 0; step_size = 0 }, -/obj/item/storage/box/pillbottles, /obj/machinery/atmospherics/unary/vent_pump/on{ dir = 8 }, -/obj/item/storage/box/iv_bags, /turf/simulated/floor/plasteel{ tag = "icon-whitebluefull"; icon_state = "whitebluefull" diff --git a/code/game/objects/items/weapons/dice.dm b/code/game/objects/items/weapons/dice.dm index d93ebcf3214..666c14801d8 100644 --- a/code/game/objects/items/weapons/dice.dm +++ b/code/game/objects/items/weapons/dice.dm @@ -3,6 +3,7 @@ desc = "Contains all the luck you'll ever need." icon = 'icons/obj/dice.dmi' icon_state = "dicebag" + can_hold = list(/obj/item/dice) /obj/item/storage/pill_bottle/dice/New() ..() diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index 5a5d1c5ba63..afe4bc1ce13 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -773,6 +773,20 @@ new /obj/item/storage/pill_bottle( src ) new /obj/item/storage/pill_bottle( src ) +/obj/item/storage/box/patch_packs + name = "box of patch packs" + desc = "It has pictures of patch packs on its front." + +/obj/item/storage/box/patch_packs/New() + ..() + new /obj/item/storage/pill_bottle/patch_pack(src) + new /obj/item/storage/pill_bottle/patch_pack(src) + new /obj/item/storage/pill_bottle/patch_pack(src) + new /obj/item/storage/pill_bottle/patch_pack(src) + new /obj/item/storage/pill_bottle/patch_pack(src) + new /obj/item/storage/pill_bottle/patch_pack(src) + new /obj/item/storage/pill_bottle/patch_pack(src) + /obj/item/storage/box/bodybags name = "body bags" desc = "This box contains body bags." diff --git a/code/game/objects/items/weapons/storage/firstaid.dm b/code/game/objects/items/weapons/storage/firstaid.dm index 66f7e9b9492..5e81c320041 100644 --- a/code/game/objects/items/weapons/storage/firstaid.dm +++ b/code/game/objects/items/weapons/storage/firstaid.dm @@ -234,6 +234,7 @@ /* * Pill Bottles */ + /obj/item/storage/pill_bottle name = "pill bottle" desc = "It's an airtight container for storing medication." @@ -241,18 +242,38 @@ icon = 'icons/obj/chemical.dmi' item_state = "contsolid" w_class = WEIGHT_CLASS_SMALL - can_hold = list(/obj/item/reagent_containers/food/pill, /obj/item/dice, /obj/item/paper) - allow_quick_gather = 1 - use_to_pickup = 1 - storage_slots = 14 - display_contents_with_number = 1 + can_hold = list(/obj/item/reagent_containers/food/pill) + cant_hold = list(/obj/item/reagent_containers/food/pill/patch) + allow_quick_gather = TRUE + use_to_pickup = TRUE + storage_slots = 50 + max_combined_w_class = 50 + display_contents_with_number = TRUE var/base_name = "" var/label_text = "" + var/applying_meds = FALSE //To Prevent spam clicking and generating runtimes from apply a deleting pill multiple times. + var/rapid_intake_message = "unscrews the cap on the pill bottle and begins dumping the entire contents down their throat!" + var/rapid_post_instake_message = "downs the entire bottle of pills in one go!" /obj/item/storage/pill_bottle/New() ..() base_name = name +/obj/item/storage/pill_bottle/attack(mob/M, mob/user) + if(iscarbon(M) && contents.len) + if(applying_meds) + to_chat(user, "You are already applying meds.") + return + applying_meds = TRUE + for(var/obj/item/reagent_containers/food/pill/P in contents) + if(P.attack(M, user)) + applying_meds = FALSE + else + applying_meds = FALSE + break + else + return ..() + /obj/item/storage/pill_bottle/ert/New() ..() new /obj/item/reagent_containers/food/pill/salicylic(src) @@ -262,27 +283,21 @@ new /obj/item/reagent_containers/food/pill/charcoal(src) new /obj/item/reagent_containers/food/pill/charcoal(src) -/obj/item/storage/pill_bottle/MouseDrop(obj/over_object as obj) //Quick pillbottle fix. -Agouri - if(ishuman(usr)) //Can monkeys even place items in the pocket slots? Leaving this in just in case~ - var/mob/M = usr - if(!( istype(over_object, /obj/screen) )) - return ..() - if((!( M.restrained() ) && !( M.stat ) /*&& M.pocket == src*/)) - switch(over_object.name) - if("r_hand") - M.unEquip(src) - M.put_in_r_hand(src) - if("l_hand") - M.unEquip(src) - M.put_in_l_hand(src) - src.add_fingerprint(usr) - return - if(over_object == usr && in_range(src, usr) || usr.contents.Find(src)) - if(usr.s_active) - usr.s_active.close(usr) - src.show_to(usr) - return - return +/obj/item/storage/pill_bottle/MouseDrop(obj/over_object as obj) // Best utilized if you're a cantankerous doctor with a Vicodin habit. + if(iscarbon(over_object)) + var/mob/living/carbon/C = over_object + if(loc == C && src == C.get_active_hand()) + if(!contents.len) + to_chat(C, "There is nothing in [src]!") + return + C.visible_message("[C] [rapid_intake_message]") + if(do_mob(C, C, 100)) // 10 seconds + for(var/obj/item/reagent_containers/food/pill/P in contents) + P.attack(C, C) + C.visible_message("[C] [rapid_post_instake_message]") + return + + return ..() /obj/item/storage/pill_bottle/attackby(var/obj/item/I, mob/user as mob, params) if(istype(I, /obj/item/pen) || istype(I, /obj/item/flashlight/pen)) @@ -294,7 +309,7 @@ label_text = tmp_label update_name_label() else - ..() + return ..() /obj/item/storage/pill_bottle/proc/update_name_label() if(label_text == "") @@ -302,6 +317,14 @@ else name = "[base_name] ([label_text])" +/obj/item/storage/pill_bottle/patch_pack + name = "Patch Pack" + icon_state = "patch_pack" + can_hold = list(/obj/item/reagent_containers/food/pill/patch) + cant_hold = list() + rapid_intake_message = "flips the lid of the Patch Pack open and begins rapidly stamping patches on themselves!" + rapid_post_instake_message = "stamps the entire contents of the Patch Pack all over their entire body!" + /obj/item/storage/pill_bottle/charcoal name = "Pill bottle (Charcoal)" desc = "Contains pills used to counter toxins." diff --git a/code/game/objects/structures/crates_lockers/closets/secure/medical.dm b/code/game/objects/structures/crates_lockers/closets/secure/medical.dm index 551a8b30d9d..9cbd43bf098 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/medical.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/medical.dm @@ -13,6 +13,9 @@ ..() new /obj/item/storage/box/autoinjectors(src) new /obj/item/storage/box/syringes(src) + new /obj/item/storage/box/pillbottles(src) + new /obj/item/storage/box/patch_packs(src) + new /obj/item/storage/box/iv_bags(src) new /obj/item/reagent_containers/dropper(src) new /obj/item/reagent_containers/dropper(src) new /obj/item/reagent_containers/glass/beaker(src) @@ -216,6 +219,8 @@ ..() new /obj/item/storage/box/pillbottles(src) new /obj/item/storage/box/pillbottles(src) + new /obj/item/storage/box/patch_packs(src) + new /obj/item/storage/box/patch_packs(src) /obj/structure/closet/secure_closet/medical_wall diff --git a/code/modules/client/asset_cache.dm b/code/modules/client/asset_cache.dm index 0c3fed01011..300443714ab 100644 --- a/code/modules/client/asset_cache.dm +++ b/code/modules/client/asset_cache.dm @@ -294,7 +294,7 @@ You can set verify to TRUE if you want send() to sleep until the client has the /datum/asset/chem_master/register() for(var/i = 1 to 20) assets["pill[i].png"] = icon('icons/obj/chemical.dmi', "pill[i]") - for(var/i in list("bottle", "small_bottle", "wide_bottle", "round_bottle")) + for(var/i in list("bottle", "small_bottle", "wide_bottle", "round_bottle", "reagent_bottle")) assets["[i].png"] = icon('icons/obj/chemical.dmi', "[i]") for(var/asset_name in assets) register_asset(asset_name, assets[asset_name]) diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 2bd9f6d4af8..707ead485ff 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -1,7 +1,7 @@ /obj/machinery/chem_master name = "\improper ChemMaster 3000" - density = 1 - anchored = 1 + density = TRUE + anchored = TRUE icon = 'icons/obj/chemical.dmi' icon_state = "mixer0" use_power = IDLE_POWER_USE @@ -9,28 +9,27 @@ var/obj/item/reagent_containers/beaker = null var/obj/item/storage/pill_bottle/loaded_pill_bottle = null var/mode = 0 - var/condi = 0 + var/condi = FALSE var/useramount = 30 // Last used amount var/pillamount = 10 var/patchamount = 10 var/bottlesprite = "bottle" var/pillsprite = "1" var/client/has_sprites = list() - var/printing = null + var/printing = FALSE /obj/machinery/chem_master/New() + ..() create_reagents(100) update_icon() /obj/machinery/chem_master/ex_act(severity) switch(severity) - if(1.0) + if(1) qdel(src) - return - if(2.0) + if(2) if(prob(50)) qdel(src) - return /obj/machinery/chem_master/update_icon() overlays.Cut() @@ -50,43 +49,43 @@ stat |= NOPOWER update_icon() -/obj/machinery/chem_master/attackby(obj/item/B, mob/user, params) - if(default_unfasten_wrench(user, B)) +/obj/machinery/chem_master/attackby(obj/item/I, mob/user, params) + if(default_unfasten_wrench(user, I)) power_change() return - if(istype(B, /obj/item/reagent_containers/glass) || istype(B, /obj/item/reagent_containers/food/drinks/drinkingglass)) - + if(istype(I, /obj/item/reagent_containers/glass) || istype(I, /obj/item/reagent_containers/food/drinks/drinkingglass)) if(beaker) to_chat(user, "A beaker is already loaded into the machine.") return if(!user.drop_item()) - to_chat(user, "[B] is stuck to you!") + to_chat(user, "[I] is stuck to you!") return - beaker = B - B.forceMove(src) + beaker = I + I.forceMove(src) to_chat(user, "You add the beaker to the machine!") SSnanoui.update_uis(src) update_icon() - else if(istype(B, /obj/item/storage/pill_bottle)) - + else if(istype(I, /obj/item/storage/pill_bottle)) if(loaded_pill_bottle) - to_chat(user, "A pill bottle is already loaded into the machine.") + to_chat(user, "A [loaded_pill_bottle] is already loaded into the machine.") return if(!user.drop_item()) - to_chat(user, "[B] is stuck to you!") + to_chat(user, "[I] is stuck to you!") return - loaded_pill_bottle = B - B.forceMove(src) - to_chat(user, "You add the pill bottle into the dispenser slot!") + + loaded_pill_bottle = I + I.forceMove(src) + to_chat(user, "You add [I] into the dispenser slot!") SSnanoui.update_uis(src) - return + else + return ..() /obj/machinery/chem_master/Topic(href, href_list) if(..()) - return 1 + return TRUE add_fingerprint(usr) usr.set_machine(src) @@ -103,8 +102,8 @@ return if(href_list["print_p"]) - if(!(printing)) - printing = 1 + if(!printing) + printing = TRUE visible_message("[src] rattles and prints out a sheet of paper.") playsound(loc, 'sound/goonstation/machines/printer_dotmatrix.ogg', 50, 1) var/obj/item/paper/P = new /obj/item/paper(loc) @@ -125,7 +124,7 @@ P.info += "Description: [href_list["desc"]]" P.info += "

Notes:
" P.name = "Chemical Analysis - [href_list["name"]]" - printing = null + printing = FALSE if(beaker) var/datum/reagents/R = beaker.reagents @@ -203,10 +202,13 @@ if(count == null) return count = isgoodnumber(count) - if(count > 20) count = 20 //Pevent people from creating huge stacks of pills easily. Maybe move the number to defines? - if(count <= 0) return - var/amount_per_pill = reagents.total_volume/count - if(amount_per_pill > 50) amount_per_pill = 50 + if(count > 20) + count = 20 //Pevent people from creating huge stacks of pills easily. Maybe move the number to defines? + if(count <= 0) + return + var/amount_per_pill = reagents.total_volume / count + if(amount_per_pill > 100) + amount_per_pill = 100 var/name = input(usr,"Name:","Name your pill!","[reagents.get_master_reagent_name()] ([amount_per_pill]u)") as text|null if(!name) return @@ -216,18 +218,19 @@ to_chat(usr, "Not enough reagents to create these pills!") return var/obj/item/reagent_containers/food/pill/P = new/obj/item/reagent_containers/food/pill(loc) - if(!name) name = reagents.get_master_reagent_name() + if(!name) + name = reagents.get_master_reagent_name() P.name = "[name] pill" P.pixel_x = rand(-7, 7) //random position P.pixel_y = rand(-7, 7) P.icon_state = "pill"+pillsprite - reagents.trans_to(P,amount_per_pill) - if(loaded_pill_bottle) + reagents.trans_to(P, amount_per_pill) + if(loaded_pill_bottle && loaded_pill_bottle.type == /obj/item/storage/pill_bottle) if(loaded_pill_bottle.contents.len < loaded_pill_bottle.storage_slots) P.forceMove(loaded_pill_bottle) updateUsrDialog() else - var/name = input(usr,"Name:","Name your bag!",reagents.get_master_reagent_name()) as text|null + var/name = input(usr, "Name:", "Name your bag!", reagents.get_master_reagent_name()) as text|null if(!name) return name = reject_bad_text(name) @@ -236,7 +239,7 @@ P.originalname = name P.name = "[name] pack" P.desc = "A small condiment pack. The label says it contains [name]." - reagents.trans_to(P,10) + reagents.trans_to(P, 10) else if(href_list["createpatch"] || href_list["createpatch_multiple"]) if(!condi) var/count = 1 @@ -247,10 +250,12 @@ count = isgoodnumber(count) if(!count || count <= 0) return - if(count > 20) count = 20 //Pevent people from creating huge stacks of patches easily. Maybe move the number to defines? + if(count > 20) + count = 20 //Pevent people from creating huge stacks of patches easily. Maybe move the number to defines? var/amount_per_patch = reagents.total_volume/count - if(amount_per_patch > 40) amount_per_patch = 40 - var/name = input(usr,"Name:","Name your patch!","[reagents.get_master_reagent_name()] ([amount_per_patch]u)") as text|null + if(amount_per_patch > 40) + amount_per_patch = 40 + var/name = input(usr, "Name:", "Name your patch!", "[reagents.get_master_reagent_name()] ([amount_per_patch]u)") as text|null if(!name) return name = reject_bad_text(name) @@ -263,24 +268,30 @@ P.pixel_y = rand(-7, 7) reagents.trans_to(P,amount_per_patch) if(is_medical_patch) - P.instant_application = 1 + P.instant_application = TRUE P.icon_state = "bandaid_med" + if(loaded_pill_bottle && loaded_pill_bottle.type == /obj/item/storage/pill_bottle/patch_pack) + if(loaded_pill_bottle.contents.len < loaded_pill_bottle.storage_slots) + P.forceMove(loaded_pill_bottle) + updateUsrDialog() + else if(href_list["createbottle"]) if(!condi) - var/name = input(usr,"Name:","Name your bottle!",reagents.get_master_reagent_name()) as text|null + var/name = input(usr, "Name:", "Name your bottle!", reagents.get_master_reagent_name()) as text|null if(!name) return name = reject_bad_text(name) - var/obj/item/reagent_containers/glass/bottle/P = new/obj/item/reagent_containers/glass/bottle(loc) - if(!name) name = reagents.get_master_reagent_name() + var/obj/item/reagent_containers/glass/bottle/reagent/P = new/obj/item/reagent_containers/glass/bottle/reagent(loc) + if(!name) + name = reagents.get_master_reagent_name() P.name = "[name] bottle" P.pixel_x = rand(-7, 7) //random position P.pixel_y = rand(-7, 7) P.icon_state = bottlesprite - reagents.trans_to(P,30) + reagents.trans_to(P, 50) else var/obj/item/reagent_containers/food/condiment/P = new/obj/item/reagent_containers/food/condiment(loc) - reagents.trans_to(P,50) + reagents.trans_to(P, 50) else if(href_list["change_pill"]) #define MAX_PILL_SPRITE 20 //max icon state of the pill sprites var/dat = "" @@ -299,7 +310,7 @@ else if(href_list["change_bottle"]) var/dat = "
" var/j = 0 - for(var/i in list("bottle", "small_bottle", "wide_bottle", "round_bottle")) + for(var/i in list("bottle", "small_bottle", "wide_bottle", "round_bottle", "reagent_bottle")) j++ if(j == 1) dat += "" @@ -318,7 +329,6 @@ usr << browse(null, "window=chem_master_iconsel") SSnanoui.update_uis(src) - return /obj/machinery/chem_master/attack_ai(mob/user) return attack_hand(user) @@ -328,11 +338,10 @@ /obj/machinery/chem_master/attack_hand(mob/user) if(..()) - return 1 + return TRUE ui_interact(user) - return -/obj/machinery/chem_master/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1) +/obj/machinery/chem_master/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = TRUE) var/datum/asset/chem_master/assets = get_asset_datum(/datum/asset/chem_master) assets.send(user) @@ -380,15 +389,15 @@ return 0 /obj/machinery/chem_master/proc/chemical_safety_check(datum/reagents/R) - var/all_safe = 1 + var/all_safe = TRUE for(var/datum/reagent/A in R.reagent_list) if(!GLOB.safe_chem_list.Find(A.id)) - all_safe = 0 + all_safe = FALSE return all_safe /obj/machinery/chem_master/condimaster name = "\improper CondiMaster 3000" - condi = 1 + condi = TRUE /obj/machinery/chem_master/constructable name = "ChemMaster 2999" @@ -403,9 +412,9 @@ component_parts += new /obj/item/reagent_containers/glass/beaker(null) component_parts += new /obj/item/reagent_containers/glass/beaker(null) -/obj/machinery/chem_master/constructable/attackby(obj/item/B, mob/user, params) +/obj/machinery/chem_master/constructable/attackby(obj/item/I, mob/user, params) - if(default_deconstruction_screwdriver(user, "mixer0_nopower", "mixer0", B)) + if(default_deconstruction_screwdriver(user, "mixer0_nopower", "mixer0", I)) if(beaker) beaker.forceMove(get_turf(src)) beaker = null @@ -415,15 +424,15 @@ loaded_pill_bottle = null return - if(exchange_parts(user, B)) + if(exchange_parts(user, I)) return if(panel_open) - if(istype(B, /obj/item/crowbar)) - default_deconstruction_crowbar(B) - return 1 + if(iscrowbar(I)) + default_deconstruction_crowbar(I) + return TRUE else to_chat(user, "You can't use the [name] while it's panel is opened!") - return 1 + return TRUE else - ..() + return ..() diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm index 71b0532650b..78e65c82591 100644 --- a/code/modules/reagents/reagent_containers/pill.dm +++ b/code/modules/reagents/reagent_containers/pill.dm @@ -8,7 +8,7 @@ icon_state = null item_state = "pill" possible_transfer_amounts = null - volume = 50 + volume = 100 consume_sound = null taste = FALSE diff --git a/icons/obj/chemical.dmi b/icons/obj/chemical.dmi index f692814d18c..61390f38057 100644 Binary files a/icons/obj/chemical.dmi and b/icons/obj/chemical.dmi differ diff --git a/nano/templates/chem_master.tmpl b/nano/templates/chem_master.tmpl index 1ccfcadfe70..385237727db 100644 --- a/nano/templates/chem_master.tmpl +++ b/nano/templates/chem_master.tmpl @@ -42,7 +42,7 @@
- {{:helper.link('Create pill (50u max)', 'arrow-right', {'createpill': 1})}} + {{:helper.link('Create pill (100u max)', 'arrow-right', {'createpill': 1})}} {{:helper.link('Multiple', 'arrow-right', {'createpill_multiple': 1})}} @@ -64,7 +64,7 @@
- {{:helper.link('Create bottle (30u max)', 'arrow-right', {'createbottle': 1})}} + {{:helper.link('Create bottle (50u max)', 'arrow-right', {'createbottle': 1})}} {{:helper.link('Style', 'pencil', {'change_bottle': 1})}}