diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index d7b3aa81b6a..53373a97c96 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -687,7 +687,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/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 a158a5e7468..2dae88713c9 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -326,20 +326,30 @@ beaker = null reagents.clear_reagents() icon_state = "mixer0" - else if (href_list["createpill"]) - var/name = reject_bad_text(input(usr,"Name:","Name your pill!",reagents.get_master_reagent_name())) - var/obj/item/weapon/reagent_containers/pill/P + else if (href_list["createpill"]) //Also used for condiment packs. + if(!condi) + var/name = reject_bad_text(input(usr,"Name:","Name your pill!",reagents.get_master_reagent_name())) + var/obj/item/weapon/reagent_containers/pill/P - if(loaded_pill_bottle && loaded_pill_bottle.contents.len < loaded_pill_bottle.storage_slots) - P = new/obj/item/weapon/reagent_containers/pill(loaded_pill_bottle) + if(loaded_pill_bottle && loaded_pill_bottle.contents.len < loaded_pill_bottle.storage_slots) + P = new/obj/item/weapon/reagent_containers/pill(loaded_pill_bottle) + else + 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) + reagents.trans_to(P,50) else - P = new/obj/item/weapon/reagent_containers/pill(src.loc) + 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) - reagents.trans_to(P,50) + if(!name) name = reagents.get_master_reagent_name() + 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) @@ -411,6 +421,7 @@ dat += "

Create pill (50 units max)
" 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 cb072c3f6ae..bd6e2a02e27 100644 --- a/code/modules/reagents/reagent_containers/food/condiment.dm +++ b/code/modules/reagents/reagent_containers/food/condiment.dm @@ -13,138 +13,113 @@ 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) +/obj/item/weapon/reagent_containers/food/condiment/attackby(obj/item/weapon/W as obj, mob/user as mob) + return - 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/attack_self(mob/user as mob) + return - if(!R || !R.total_volume) - user << "\red None of [src] left, oh no!" - return 0 +/obj/item/weapon/reagent_containers/food/condiment/attack(mob/M as mob, mob/user as mob, def_zone) + var/datum/reagents/R = src.reagents - 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) - add_logs(user, M, "fed", object="[reagentlist(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 + if(!R || !R.total_volume) + user << "None of [src] left, oh no!" return 0 - attackby(obj/item/I as obj, mob/user as mob) + if(M == user) + M << "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("[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("[user] feeds [M] [src].", 1) + + add_logs(user, M, "fed", object="[reagentlist(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 + 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 << "[target] is empty." + return + + if(reagents.total_volume >= reagents.maximum_volume) + user << "[src] is full." + return + + var/trans = target.reagents.trans_to(src, target:amount_per_transfer_from_this) + user << "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 << "[src] is empty." + return + if(target.reagents.total_volume >= target.reagents.maximum_volume) + user << "you can't add anymore to [target]." + return + var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this) + user << "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] - 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]." - - 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!" - 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 + 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 /obj/item/weapon/reagent_containers/food/condiment/enzyme name = "Universal Enzyme" desc = "Used in cooking various dishes." icon_state = "enzyme" + New() ..() reagents.add_reagent("enzyme", 50) /obj/item/weapon/reagent_containers/food/condiment/sugar + New() ..() reagents.add_reagent("sugar", 50) @@ -156,6 +131,7 @@ possible_transfer_amounts = list(1,20) //for clown turning the lid off amount_per_transfer_from_this = 1 volume = 20 + New() ..() reagents.add_reagent("sodiumchloride", 20) @@ -167,6 +143,77 @@ possible_transfer_amounts = list(1,20) //for clown turning the lid off amount_per_transfer_from_this = 1 volume = 20 + New() ..() - reagents.add_reagent("blackpepper", 20) \ No newline at end of file + reagents.add_reagent("blackpepper", 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 = list(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, mob/user, 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 src + 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 src + 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 src + +/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) diff --git a/icons/obj/food.dmi b/icons/obj/food.dmi index 8a47f0c3683..6b8e7af858f 100644 Binary files a/icons/obj/food.dmi and b/icons/obj/food.dmi differ