diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm
index 9435fee6a0..8ed5aa4b86 100644
--- a/code/modules/reagents/Chemistry-Machinery.dm
+++ b/code/modules/reagents/Chemistry-Machinery.dm
@@ -186,6 +186,7 @@
var/mode = 0
var/condi = 0
var/useramount = 30 // Last used amount
+ var/pillamount = 10
var/bottlesprite = "1" //yes, strings
var/pillsprite = "1"
var/client/has_sprites = list()
@@ -331,19 +332,25 @@
beaker = null
reagents.clear_reagents()
icon_state = "mixer0"
- else if (href_list["createpill"])
+ else if (href_list["createpill"] || href_list["createpill_multiple"])
var/name = reject_bad_text(input(usr,"Name:","Name your pill!",reagents.get_master_reagent_name()))
- var/obj/item/weapon/reagent_containers/pill/P = new/obj/item/weapon/reagent_containers/pill(src.loc)
- 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,50)
- if(src.loaded_pill_bottle)
- if(loaded_pill_bottle.contents.len < loaded_pill_bottle.storage_slots)
- P.loc = loaded_pill_bottle
- src.updateUsrDialog()
+ var/count = 1
+ if (href_list["createpill_multiple"]) count = isgoodnumber(input("Select the number of pills to make.", 10, pillamount) as num)
+ if (count > 20) count = 20 //Pevent people from creating huge stacks of pills easily. Maybe move the number to defines?
+ var/amount_per_pill = reagents.total_volume/count
+ if (amount_per_pill > 50) amount_per_pill = 50
+ while (count--)
+ var/obj/item/weapon/reagent_containers/pill/P = new/obj/item/weapon/reagent_containers/pill(src.loc)
+ 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(src.loaded_pill_bottle)
+ if(loaded_pill_bottle.contents.len < loaded_pill_bottle.storage_slots)
+ P.loc = loaded_pill_bottle
+ src.updateUsrDialog()
else if (href_list["createbottle"])
if(!condi)
var/name = reject_bad_text(input(usr,"Name:","Name your bottle!",reagents.get_master_reagent_name()))
@@ -440,6 +447,7 @@
dat += "Empty
"
if(!condi)
dat += "