Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pill packet boxes #6991

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/game/machinery/vending/vendor_types/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@
list("Beaker (60 Units)", floor(scale * 3), /obj/item/reagent_container/glass/beaker, VENDOR_ITEM_REGULAR),
list("Beaker, Large (120 Units)", floor(scale * 3), /obj/item/reagent_container/glass/beaker/large, VENDOR_ITEM_REGULAR),
list("Box of Pill Bottles", floor(scale * 2), /obj/item/storage/box/pillbottles, VENDOR_ITEM_REGULAR),
list("Box of Pill Packets", floor(scale * 2), /obj/item/storage/box/pillbottles/pillpackets, VENDOR_ITEM_REGULAR),
list("Dropper", floor(scale * 3), /obj/item/reagent_container/dropper, VENDOR_ITEM_REGULAR),
list("Syringe", floor(scale * 7), /obj/item/reagent_container/syringe, VENDOR_ITEM_REGULAR)
)
Expand Down
13 changes: 13 additions & 0 deletions code/game/objects/items/storage/boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,19 @@
new /obj/item/storage/pill_bottle( src )
new /obj/item/storage/pill_bottle( src )

/obj/item/storage/box/pillbottles/pillpackets
name = "box of pill packets"
desc = "it has pictures of pill packets on its front."
icon_state = "pillpacket_box"

/obj/item/storage/box/pillbottles/pillpackets/fill_preset_inventory()
new /obj/item/storage/pill_bottle/packet( src )
new /obj/item/storage/pill_bottle/packet( src )
new /obj/item/storage/pill_bottle/packet( src )
new /obj/item/storage/pill_bottle/packet( src )
new /obj/item/storage/pill_bottle/packet( src )
new /obj/item/storage/pill_bottle/packet( src )
new /obj/item/storage/pill_bottle/packet( src )

/obj/item/storage/box/snappops
name = "snap pop box"
Expand Down
16 changes: 15 additions & 1 deletion code/modules/reagents/chemistry_machinery/chem_master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
var/vial_maker = FALSE
var/obj/item/reagent_container/beaker = null
var/obj/item/storage/pill_bottle/loaded_pill_bottle = null
var/is_packet = FALSE
var/mode = 0
var/condi = 0
var/useramount = 30 // Last used amount
Expand Down Expand Up @@ -86,7 +87,14 @@

loaded_pill_bottle = B
user.drop_inv_item_to_loc(B, src)
to_chat(user, SPAN_NOTICE("You add the pill bottle into the dispenser slot!"))
if(istype(B, /obj/item/storage/pill_bottle/packet))
is_packet = TRUE
pillamount = 4
to_chat(user, SPAN_NOTICE("You add the pill packet into the dispenser slot!"))

else
is_packet = FALSE
to_chat(user, SPAN_NOTICE("You add the pill bottle into the dispenser slot!"))
updateUsrDialog()
return

Expand Down Expand Up @@ -124,6 +132,7 @@
loaded_pill_bottle.forceMove(loc)

loaded_pill_bottle = null
pillamount = 16

// Adding a name to the currently stored pill bottle
if(href_list["addlabelp"])
Expand All @@ -149,6 +158,11 @@
if(!Adjacent(usr))
return

if(is_packet)
to_chat(user, SPAN_WARNING("You cannot change the color of pill packets."))
updateUsrDialog()
return

loaded_pill_bottle.choose_color()

else if(href_list["close"])
Expand Down
Binary file modified icons/obj/items/storage/box.dmi
Binary file not shown.
Binary file modified icons/obj/items/storage/boxes.dmi
Binary file not shown.
Loading