diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index de45169baed..ea905a402b4 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -801,7 +801,7 @@ desc = "A kitchen and restaurant equipment vendor" product_ads = "Mm, food stuffs!;Food and food accessories.;Get your plates!;You like forks?;I like forks.;Woo, utensils.;You don't really need these..." icon_state = "dinnerware" - products = list(/obj/item/weapon/tray = 8,/obj/item/weapon/kitchen/utensil/fork = 6,/obj/item/weapon/kitchenknife = 3,/obj/item/weapon/reagent_containers/food/drinks/drinkingglass = 8,/obj/item/clothing/suit/chef/classic = 2) + products = list(/obj/item/weapon/tray = 8,/obj/item/weapon/kitchen/utensil/fork = 6,/obj/item/weapon/kitchenknife = 3,/obj/item/weapon/reagent_containers/food/drinks/drinkingglass = 8,/obj/item/clothing/suit/chef/classic = 2,/obj/item/weapon/reagent_containers/food/condiment/pack/ketchup = 5,/obj/item/weapon/reagent_containers/food/condiment/pack/hotsauce = 5) contraband = list(/obj/item/weapon/kitchen/utensil/spoon = 2,/obj/item/weapon/kitchen/utensil/knife = 2,/obj/item/weapon/kitchen/rollingpin = 2, /obj/item/weapon/butch = 2) /obj/machinery/vending/sovietsoda diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index e68e74c253a..a78b2e45746 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -426,24 +426,33 @@ reagents.clear_reagents() icon_state = "mixer0" else if (href_list["createpill"] || href_list["createpill_multiple"]) - 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 - var/name = reject_bad_text(input(usr,"Name:","Name your pill!","[reagents.get_master_reagent_name()] ([amount_per_pill] units)")) - while (count--) - var/obj/item/weapon/reagent_containers/pill/P = new/obj/item/weapon/reagent_containers/pill(src.loc) + if(!condi) + 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 + var/name = reject_bad_text(input(usr,"Name:","Name your pill!","[reagents.get_master_reagent_name()] ([amount_per_pill] units)")) + 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 + var/name = reject_bad_text(input(usr,"Name:","Name your bag!",reagents.get_master_reagent_name())) + var/obj/item/weapon/reagent_containers/food/condiment/pack/P = new/obj/item/weapon/reagent_containers/food/condiment/pack(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() + P.originalname = name + P.name = "[name] pack" + P.desc = "A small condiment pack. The label says it contains [name]." + reagents.trans_to(P,10) else if (href_list["createbottle"]) if(!condi) var/name = reject_bad_text(input(usr,"Name:","Name your bottle!",reagents.get_master_reagent_name())) @@ -543,6 +552,7 @@ dat += "Create multiple pills
" dat += "Create bottle (30 units max)" else + dat += "

Create pack (10 units max)
" dat += "Create bottle (50 units max)" if(!condi) user << browse("Chemmaster 3000Chemmaster menu:

[dat]", "window=chem_master;size=575x400") diff --git a/code/modules/reagents/reagent_containers/food/condiment.dm b/code/modules/reagents/reagent_containers/food/condiment.dm index bb7903c793b..167d0878b16 100644 --- a/code/modules/reagents/reagent_containers/food/condiment.dm +++ b/code/modules/reagents/reagent_containers/food/condiment.dm @@ -13,133 +13,107 @@ flags = FPRINT | TABLEPASS | OPENCONTAINER possible_transfer_amounts = list(1,5,10) volume = 50 + //Possible_states has the reagent id as key and a list of, in order, the icon_state, the name and the desc as values. Used in the on_reagent_change() to change names, descs and sprites. + var/list/possible_states = list("ketchup" = list("ketchup", "Ketchup", "You feel more American already."), "capsaicin" = list("hotsauce", "Hotsauce", "You can almost TASTE the stomach ulcers now!"), "enzyme" = list("enzyme", "Universal Enzyme", "Used in cooking various dishes"), "soysauce" = list("soysauce", "Soy Sauce", "A salty soy-based flavoring"), "frostoil" = list("coldsauce", "Coldsauce", "Leaves the tongue numb in it's passage"), "sodiumchloride" = list("saltshaker", "Salt Shaker", "Salt. From space oceans, presumably"), "blackpepper" = list("pepermillsmall", "Pepper Mill", "Often used to flavor food or make people sneeze"), "cornoil" = list("oliveoil", "Corn Oil", "A delicious oil used in cooking. Made from corn"), "sugar" = list("emptycondiment", "Sugar", "Tasty spacey sugar!")) - attackby(obj/item/weapon/W as obj, mob/user as mob) - return - attack_self(mob/user as mob) - return - attack(mob/M as mob, mob/user as mob, def_zone) - var/datum/reagents/R = src.reagents +/obj/item/weapon/reagent_containers/food/condiment/attackby(obj/item/weapon/W as obj, mob/user as mob) + return - if(!R || !R.total_volume) - user << "\red None of [src] left, oh no!" - return 0 - if(M == user) - M << "\blue You swallow some of contents of the [src]." - if(reagents.total_volume) - reagents.reaction(M, INGEST) - spawn(5) - reagents.trans_to(M, 10) +/obj/item/weapon/reagent_containers/food/condiment/attack_self(mob/user as mob) + return - playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1) - return 1 - else if( istype(M, /mob/living/carbon/human) ) +/obj/item/weapon/reagent_containers/food/condiment/attack(mob/M as mob, mob/user as mob, def_zone) + var/datum/reagents/R = src.reagents - for(var/mob/O in viewers(world.view, user)) - O.show_message("\red [user] attempts to feed [M] [src].", 1) - if(!do_mob(user, M)) return - for(var/mob/O in viewers(world.view, user)) - O.show_message("\red [user] feeds [M] [src].", 1) - - M.attack_log += text("\[[time_stamp()]\] Has been fed [src.name] by [user.name] ([user.ckey]) Reagents: [reagentlist(src)]") - user.attack_log += text("\[[time_stamp()]\] Fed [src.name] by [M.name] ([M.ckey]) Reagents: [reagentlist(src)]") - msg_admin_attack("[user.name] ([user.ckey]) fed [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (JMP)") - - if(reagents.total_volume) - reagents.reaction(M, INGEST) - spawn(5) - reagents.trans_to(M, 10) - - playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1) - return 1 + if(!R || !R.total_volume) + user << "\red None of [src] left, oh no!" return 0 - attackby(obj/item/I as obj, mob/user as mob) + if(M == user) + M << "\blue You swallow some of contents of the [src]." + if(reagents.total_volume) + reagents.reaction(M, INGEST) + spawn(5) + reagents.trans_to(M, 10) + playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1) + return 1 + else if( istype(M, /mob/living/carbon/human) ) + + for(var/mob/O in viewers(world.view, user)) + O.show_message("\red [user] attempts to feed [M] [src].", 1) + if(!do_mob(user, M)) return + for(var/mob/O in viewers(world.view, user)) + O.show_message("\red [user] feeds [M] [src].", 1) + + M.attack_log += text("\[[time_stamp()]\] Has been fed [src.name] by [user.name] ([user.ckey]) Reagents: [reagentlist(src)]") + user.attack_log += text("\[[time_stamp()]\] Fed [src.name] by [M.name] ([M.ckey]) Reagents: [reagentlist(src)]") + msg_admin_attack("[user.name] ([user.ckey]) fed [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (JMP)") + + if(reagents.total_volume) + reagents.reaction(M, INGEST) + spawn(5) + reagents.trans_to(M, 10) + + playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1) + return 1 + return 0 + +/obj/item/weapon/reagent_containers/food/condiment/attackby(obj/item/I as obj, mob/user as mob) + return + +/obj/item/weapon/reagent_containers/food/condiment/afterattack(obj/target, mob/user , proximity) + if(!proximity) return + if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us. + + if(!target.reagents.total_volume) + user << "\red [target] is empty." + return + + if(reagents.total_volume >= reagents.maximum_volume) + user << "\red [src] is full." + return + + var/trans = target.reagents.trans_to(src, target:amount_per_transfer_from_this) + user << "\blue You fill [src] with [trans] units of the contents of [target]." + + //Something like a glass or a food item. Player probably wants to transfer TO it. + else if(target.is_open_container() || istype(target, /obj/item/weapon/reagent_containers/food/snacks)) + if(!reagents.total_volume) + user << "\red [src] is empty." + return + if(target.reagents.total_volume >= target.reagents.maximum_volume) + user << "\red you can't add anymore to [target]." + return + var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this) + user << "\blue You transfer [trans] units of the condiment to [target]." + +/obj/item/weapon/reagent_containers/food/condiment/on_reagent_change() + if(icon_state == "saltshakersmall" || icon_state == "peppermillsmall") + return + if(reagents.reagent_list.len > 0) + var/main_reagent = reagents.get_master_reagent_id() + if(main_reagent in possible_states) + var/list/temp_list = possible_states[main_reagent] + icon_state = temp_list[1] + name = temp_list[2] + desc = temp_list[3] + + else + name = "Misc Condiment Bottle" + if (reagents.reagent_list.len==1) + desc = "Looks like it is [main_reagent], but you are not sure." + else + desc = "A mixture of various condiments. [main_reagent] is one of them." + icon_state = "mixedcondiments" + else + icon_state = "emptycondiment" + name = "Condiment Bottle" + desc = "An empty condiment bottle." return - afterattack(obj/target, mob/user , flag) - if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us. - - if(!target.reagents.total_volume) - user << "\red [target] is empty." - return - - if(reagents.total_volume >= reagents.maximum_volume) - user << "\red [src] is full." - return - - var/trans = target.reagents.trans_to(src, target:amount_per_transfer_from_this) - user << "\blue You fill [src] with [trans] units of the contents of [target]." - - //Something like a glass or a food item. Player probably wants to transfer TO it. - else if(target.is_open_container() || istype(target, /obj/item/weapon/reagent_containers/food/snacks)) - if(!reagents.total_volume) - user << "\red [src] is empty." - return - if(target.reagents.total_volume >= target.reagents.maximum_volume) - user << "\red you can't add anymore to [target]." - return - var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this) - user << "\blue You transfer [trans] units of the condiment to [target]." - - on_reagent_change() - if(icon_state == "saltshakersmall" || icon_state == "peppermillsmall") - return - if(reagents.reagent_list.len > 0) - switch(reagents.get_master_reagent_id()) - if("ketchup") - name = "Ketchup" - desc = "You feel more American already." - icon_state = "ketchup" - if("capsaicin") - name = "Hotsauce" - desc = "You can almost TASTE the stomach ulcers now!" - icon_state = "hotsauce" - if("enzyme") - name = "Universal Enzyme" - desc = "Used in cooking various dishes." - icon_state = "enzyme" - if("soysauce") - name = "Soy Sauce" - desc = "A salty soy-based flavoring." - icon_state = "soysauce" - if("frostoil") - name = "Coldsauce" - desc = "Leaves the tongue numb in its passage." - icon_state = "coldsauce" - if("sodiumchloride") - name = "Salt Shaker" - desc = "Salt. From space oceans, presumably." - icon_state = "saltshaker" - if("blackpepper") - name = "Pepper Mill" - desc = "Often used to flavor food or make people sneeze." - icon_state = "peppermillsmall" - if("cornoil") - name = "Corn Oil" - desc = "A delicious oil used in cooking. Made from corn." - icon_state = "oliveoil" - if("sugar") - name = "Sugar" - desc = "Tastey space sugar!" - if("chefspecial") - name = "Chef Excellence's Special Sauce" - desc = "A potent sauce distilled from the toxin glands of 1000 Space Carp." - else - name = "Misc Condiment Bottle" - if (reagents.reagent_list.len==1) - desc = "Looks like it is [reagents.get_master_reagent_name()], but you are not sure." - else - desc = "A mixture of various condiments. [reagents.get_master_reagent_name()] is one of them." - icon_state = "mixedcondiments" - else - icon_state = "emptycondiment" - name = "Condiment Bottle" - desc = "An empty condiment bottle." - return /obj/item/weapon/reagent_containers/food/condiment/enzyme name = "Universal Enzyme" @@ -183,4 +157,74 @@ volume = 20 New() ..() - reagents.add_reagent("chefspecial", 20) \ No newline at end of file + reagents.add_reagent("chefspecial", 20) + +//Food packs. To easily apply deadly toxi... delicious sauces to your food! +/obj/item/weapon/reagent_containers/food/condiment/pack + name = "condiment pack" + desc = "A small plastic pack with condiments to put on your food" + icon_state = "condi_empty" + volume = 10 + amount_per_transfer_from_this = 10 + possible_transfer_amounts = 10 + flags = FPRINT | TABLEPASS + possible_states = list("ketchup" = list("condi_ketchup", "Ketchup", "You feel more American already."), "capsaicin" = list("condi_hotsauce", "Hotsauce", "You can almost TASTE the stomach ulcers now!"), "soysauce" = list("condi_soysauce", "Soy Sauce", "A salty soy-based flavoring"), "frostoil" = list("condi_frostoil", "Coldsauce", "Leaves the tongue numb in it's passage"), "sodiumchloride" = list("condi_salt", "Salt Shaker", "Salt. From space oceans, presumably"), "blackpepper" = list("condi_pepper", "Pepper Mill", "Often used to flavor food or make people sneeze"), "cornoil" = list("condi_cornoil", "Corn Oil", "A delicious oil used in cooking. Made from corn"), "sugar" = list("condi_sugar", "Sugar", "Tasty spacey sugar!")) + var/originalname = "condiment" //Can't use initial(name) for this. This stores the name set by condimasters. + +/obj/item/weapon/reagent_containers/food/condiment/pack/New() + ..() + pixel_x = rand(-7, 7) + pixel_y = rand(-7, 7) + +/obj/item/weapon/reagent_containers/food/condiment/pack/attack(mob/M as mob, mob/user as mob, def_zone) //Can't feed these to people directly. + return + +/obj/item/weapon/reagent_containers/food/condiment/pack/afterattack(obj/target, mob/user , proximity) + if(!proximity) return + + //You can tear the bag open above food to put the condiments on it, obviously. + if(istype(target, /obj/item/weapon/reagent_containers/food/snacks)) + if(!reagents.total_volume) + user << "You tear open [src], but there's nothing in it." + Del() + return + if(target.reagents.total_volume >= target.reagents.maximum_volume) + user << "You tear open [src], but [target] is stacked so high that it just drips off!" //Not sure if food can ever be full, but better safe than sorry. + Del() + return + else + user << "You tear open [src] above [target] and the condiments drip onto it." + src.reagents.trans_to(target, amount_per_transfer_from_this) + Del() + +/obj/item/weapon/reagent_containers/food/condiment/pack/on_reagent_change() + if(reagents.reagent_list.len > 0) + var/main_reagent = reagents.get_master_reagent_id() + if(main_reagent in possible_states) + var/list/temp_list = possible_states[main_reagent] + icon_state = temp_list[1] + desc = temp_list[3] + else + icon_state = "condi_mixed" + desc = "A small condiment pack. The label says it contains [originalname]" + else + icon_state = "condi_empty" + desc = "A small condiment pack. It is empty." + +//Ketchup +/obj/item/weapon/reagent_containers/food/condiment/pack/ketchup + name = "Ketchup pack" + originalname = "Ketchup" + +/obj/item/weapon/reagent_containers/food/condiment/pack/ketchup/New() + ..() + reagents.add_reagent("ketchup", 10) + +//Hot sauce +/obj/item/weapon/reagent_containers/food/condiment/pack/hotsauce + name = "Hotsauce pack" + originalname = "Hotsauce" + +/obj/item/weapon/reagent_containers/food/condiment/pack/hotsauce/New() + ..() + reagents.add_reagent("capsaicin", 10) \ No newline at end of file diff --git a/icons/obj/food.dmi b/icons/obj/food.dmi index 5bb8d5f7fed..66edab66b90 100644 Binary files a/icons/obj/food.dmi and b/icons/obj/food.dmi differ