Food refactor, Trash states for drinks and updated icons (#8285)

This commit is contained in:
Wowzewow (Wezzy)
2020-02-24 15:04:57 +01:00
committed by GitHub
parent 89d7425405
commit ffe96a44aa
16 changed files with 144 additions and 78 deletions
@@ -284,7 +284,7 @@
color = "#c79705"
touch_met = 1.5
var/lastburnmessage = 0
taste_description = "some short of oil"
taste_description = "some sort of oil"
taste_mult = 0.1
/datum/reagent/nutriment/triglyceride/oil/touch_turf(var/turf/simulated/T)
@@ -3731,16 +3731,16 @@
glass_name = "glass of Brandy"
glass_desc = "Cheap knock off for cognac."
/datum/reagent/alcohol/ethanol/guinnes
/datum/reagent/alcohol/ethanol/guinness
name = "Guinness"
id = "guinnes"
id = "guinness"
description = "Special Guinnes drink."
color = "#2E6671"
strength = 8
taste_description = "dryness"
carbonated = TRUE
glass_icon_state = "guinnes_glass"
glass_icon_state = "guinness_glass"
glass_name = "glass of Guinness"
glass_desc = "A glass of Guinness."
@@ -2,19 +2,29 @@
/// Food.
////////////////////////////////////////////////////////////////////////////////
/obj/item/reagent_containers/food
drop_sound = 'sound/items/drop/food.ogg'
flags = OPENCONTAINER
possible_transfer_amounts = null
volume = 50 //Sets the default container amount for all food items.
var/filling_color = "#FFFFFF" //Used by sandwiches
drop_sound = 'sound/items/drop/food.ogg'
var/is_liquid = FALSE // Handles whether you can eat with a fork & which eating sound is played
/obj/item/reagent_containers/food/self_feed_message(var/mob/user)
to_chat(user, "<span class='notice'>You [is_liquid? "drink" : "eat"] \the [src].</span>")
var/trash = null
var/is_liquid = TRUE
/obj/item/reagent_containers/food/self_feed_message(var/mob/user)
to_chat(user, "<span class='notice'>You [is_liquid ? "drink from" : "eat"] \the [src].</span>")
/obj/item/reagent_containers/food/feed_sound(var/mob/user)
if(is_liquid)
playsound(user.loc, 'sound/items/drink.ogg', rand(10, 50), 1)
else
playsound(user.loc, 'sound/items/eatfood.ogg', rand(10, 50), 1)
/obj/item/reagent_containers/food/proc/on_consume(var/mob/user, var/mob/target)
if(!reagents.total_volume)
user.drop_from_inventory(src) //so trash actually stays in the active hand.
if(trash)
var/obj/item/TrashItem = new trash(user)
user.put_in_hands(TrashItem)
target.visible_message(span("notice", "[target] finishes [is_liquid ? "drinking" : "eating"] \the [src]."),
span("notice","You finish [is_liquid ? "drinking" : "eating"] \the [src]."))
qdel(src)
@@ -100,7 +100,7 @@
/obj/item/reagent_containers/food/drinks/cans/grape_juice
name = "\improper Grapel juice"
desc = "500 pages of rules of how to appropriately enter into a combat with this juice!"
icon_state = "purple_can"
icon_state = "grapesoda"
center_of_mass = list("x"=16, "y"=10)
/obj/item/reagent_containers/food/drinks/cans/grape_juice/Initialize()
@@ -15,12 +15,6 @@
/obj/item/reagent_containers/food/drinks/on_reagent_change()
return
/obj/item/reagent_containers/food/drinks/feed_sound(var/mob/user)
playsound(user.loc, 'sound/items/drink.ogg', rand(10, 50), 1)
/obj/item/reagent_containers/food/drinks/self_feed_message(var/mob/user)
to_chat(user, "<span class='notice'>You drink from \the [src].</span>")
/obj/item/reagent_containers/food/drinks/attack_self(mob/user as mob)
if(!is_open_container())
if(user.a_intent == I_HURT && !shaken)
@@ -56,6 +50,7 @@
if(!is_open_container())
to_chat(user, "<span class='notice'>You need to open \the [src]!</span>")
return 1
on_consume(target,user)
return ..()
/obj/item/reagent_containers/food/drinks/standard_dispenser_refill(var/mob/user, var/obj/structure/reagent_dispensers/target)
@@ -130,61 +125,72 @@
reagents.add_reagent("soymilk", 50)
/obj/item/reagent_containers/food/drinks/coffee
name = "Robust coffee"
name = "robust coffee"
desc = "Careful, the beverage you're about to enjoy is extremely hot."
icon_state = "coffee"
icon_state = "coffee_vended"
item_state = "contvapour"
drop_sound = 'sound/items/drop/box.ogg'
trash = /obj/item/trash/coffee
drop_sound = 'sound/items/drop/papercup.ogg'
center_of_mass = list("x"=16, "y"=11)
Initialize()
. = ..()
reagents.add_reagent("coffee", 30)
/obj/item/reagent_containers/food/drinks/pslatte
name = "Seasonal Pumpkin Spice Latte"
name = "seasonal pumpkin spice latte"
desc = "A limited edition pumpkin spice coffee drink!"
icon_state = "psl_vended"
drop_sound = 'sound/items/drop/box.ogg'
item_state = "contvapour"
trash = /obj/item/trash/coffee
drop_sound = 'sound/items/drop/papercup.ogg'
center_of_mass = list("x"=16, "y"=11)
Initialize()
. = ..()
reagents.add_reagent("sadpslatte", 30)
/obj/item/reagent_containers/food/drinks/tea
name = "Duke purple tea"
name = "duke purple tea"
desc = "An insult to Duke Purple is an insult to the Space Queen! Any proper gentleman will fight you, if you sully this tea."
icon_state = "coffee"
item_state = "coffee"
icon_state = "coffee_vended"
item_state = "contvapour"
trash = /obj/item/trash/coffee
drop_sound = 'sound/items/drop/papercup.ogg'
center_of_mass = list("x"=16, "y"=14)
Initialize()
. = ..()
reagents.add_reagent("tea", 30)
/obj/item/reagent_containers/food/drinks/greentea
name = "Green Tea"
name = "green tea"
desc = "Tasty green tea. It's good for you!"
icon_state = "greentea_vended"
item_state = "coffee"
item_state = "contvapour"
trash = /obj/item/trash/coffee
drop_sound = 'sound/items/drop/papercup.ogg'
center_of_mass = list("x"=16, "y"=14)
Initialize()
. = ..()
reagents.add_reagent("greentea", 30)
/obj/item/reagent_containers/food/drinks/hotcider
name = "Hot Cider"
name = "hot cider"
desc = "A hearty apple drink, spiced just right."
icon_state = "soy_latte"
item_state = "coffee"
icon_state = "soy_latte_vended"
item_state = "contvapour"
trash = /obj/item/trash/coffee
drop_sound = 'sound/items/drop/papercup.ogg'
center_of_mass = list("x"=16, "y"=14)
Initialize()
. = ..()
reagents.add_reagent("ciderhot", 30)
/obj/item/reagent_containers/food/drinks/chaitea
name = "Chai Tea"
name = "chai Tea"
desc = "The name is redundant but the flavor is delicious!"
icon_state = "chai_vended"
item_state = "coffee"
item_state = "contvapour"
trash = /obj/item/trash/coffee
drop_sound = 'sound/items/drop/papercup.ogg'
center_of_mass = list("x"=16, "y"=14)
Initialize()
. = ..()
@@ -193,7 +199,10 @@
/obj/item/reagent_containers/food/drinks/ice
name = "ice cup"
desc = "Careful, cold ice, do not chew."
icon_state = "coffee"
icon_state = "coffee_vended"
item_state = "contvapour"
trash = /obj/item/trash/coffee
drop_sound = 'sound/items/drop/papercup.ogg'
center_of_mass = list("x"=15, "y"=10)
Initialize()
. = ..()
@@ -203,7 +212,9 @@
name = "dutch hot coco"
desc = "Made in Space South America."
icon_state = "hot_coco"
item_state = "coffee"
item_state = "contvapour"
trash = /obj/item/trash/coffee
drop_sound = 'sound/items/drop/papercup.ogg'
center_of_mass = list("x"=15, "y"=13)
Initialize()
. = ..()
@@ -213,7 +224,9 @@
name = "cup ramen"
desc = "Just add 10ml water, self heats! A taste that reminds you of your school years."
icon_state = "ramen"
drop_sound = 'sound/items/drop/gloves.ogg'
item_state = "contvapour"
trash = /obj/item/trash/ramen
drop_sound = 'sound/items/drop/papercup.ogg'
center_of_mass = list("x"=16, "y"=11)
Initialize()
. = ..()
@@ -224,7 +237,7 @@
name = "paper cup"
desc = "A paper water cup."
icon_state = "water_cup_e"
drop_sound = 'sound/items/drop/paper.ogg'
drop_sound = 'sound/items/drop/papercup.ogg'
possible_transfer_amounts = null
volume = 10
center_of_mass = list("x"=16, "y"=12)
@@ -19,10 +19,9 @@
var/rag_underlay = "rag"
/obj/item/reagent_containers/food/drinks/bottle/Initialize()
. = ..()
..()
if(isGlass)
unacidable = 1
drop_sound = 'sound/items/drop/bottle.ogg'
/obj/item/reagent_containers/food/drinks/bottle/Destroy()
if(rag)
@@ -30,6 +29,10 @@
rag = null
return ..()
/obj/item/reagent_containers/food/drinks/bottle/on_reagent_change()
update_icon()
//when thrown on impact, bottles smash and spill their contents
/obj/item/reagent_containers/food/drinks/bottle/throw_impact(atom/hit_atom, var/speed)
..()
@@ -112,7 +115,8 @@
update_icon()
/obj/item/reagent_containers/food/drinks/bottle/open(mob/user)
if(rag) return
if(rag)
return
..()
/obj/item/reagent_containers/food/drinks/bottle/update_icon()
@@ -120,6 +124,13 @@
if(rag)
var/underlay_image = image(icon='icons/obj/drinks.dmi', icon_state=rag.on_fire? "[rag_underlay]_lit" : rag_underlay)
underlays += underlay_image
set_light(2)
else
set_light(0)
if(reagents.total_volume)
icon_state = "[initial(icon_state)]"
else
icon_state = "[initial(icon_state)]_empty"
/obj/item/reagent_containers/food/drinks/bottle/attack(mob/living/target, mob/living/user, var/hit_zone)
var/blocked = ..()
@@ -170,6 +181,7 @@
desc = "A bottle with a sharp broken bottom."
icon = 'icons/obj/drinks.dmi'
icon_state = "broken_bottle"
drop_sound = 'sound/items/drop/glass.ogg'
force = 9
throwforce = 5
throw_speed = 3
@@ -219,7 +231,7 @@
/obj/item/reagent_containers/food/drinks/bottle/fireball
name = "Uncle Git's Cinnamon Fireball"
desc = "A premium single-malt whiskey, infused with cinnamon and hot pepper inside the tunnels of a nuclear shelter. TUNNEL WHISKEY RULES."
icon_state = "fireballbottle"
icon_state = "whiskeybottle"
center_of_mass = list("x"=16, "y"=4)
Initialize()
. = ..()
@@ -578,14 +590,14 @@
. = ..()
reagents.add_reagent("brandy", 100)
/obj/item/reagent_containers/food/drinks/bottle/guinnes
/obj/item/reagent_containers/food/drinks/bottle/guinness
name = "Guinness"
desc = "A bottle of good old Guinness."
icon_state = "guinnes_bottle"
icon_state = "guinness_bottle"
center_of_mass = list("x" = 15,"y" = 4)
Initialize()
. = ..()
reagents.add_reagent("guinnes", 100)
reagents.add_reagent("guinness", 100)
/obj/item/reagent_containers/food/drinks/bottle/drambuie
name = "Drambuie"
@@ -7,9 +7,11 @@
desc = "Yummy!"
icon = 'icons/obj/food.dmi'
icon_state = null
center_of_mass = list("x"=16, "y"=16)
w_class = 2
is_liquid = FALSE
var/bitesize = 1
var/bitecount = 0
var/trash = null
var/slice_path
var/slices_num
var/dried_type = null
@@ -17,8 +19,6 @@
var/nutriment_amt = 0
var/nutriment_type = NUTRIMENT_GOOD
var/list/nutriment_desc = list("food" = 1)
center_of_mass = list("x"=16, "y"=16)
w_class = 2
var/datum/reagent/nutriment/coating/coating = null
var/icon/flat_icon = null //Used to cache a flat icon generated from dipping in batter. This is used again to make the cooked-batter-overlay
var/do_coating_prefix = 1
@@ -40,20 +40,10 @@
/obj/item/reagent_containers/food/snacks/standard_splash_mob(var/mob/user, var/mob/target)
return 1 //Returning 1 will cancel everything else in a long line of things it should do.
/obj/item/reagent_containers/food/snacks/proc/on_consume(var/mob/eater, var/mob/feeder = null)
/obj/item/reagent_containers/food/snacks/on_consume()
..()
if(!reagents.total_volume)
eater.visible_message(span("notice", "[eater] finishes [is_liquid ? "drinking" : "eating"] \the [src]."),span("notice","You finish [is_liquid ? "drinking" : "eating"] \the [src]."))
if(!feeder)
feeder = eater
feeder.drop_from_inventory(src) //so icons update :[ //what the fuck is this????
if(trash)
if(ispath(trash,/obj/item))
var/obj/item/TrashItem = new trash(feeder)
feeder.put_in_hands(TrashItem)
else if(istype(trash,/obj/item))
feeder.put_in_hands(trash)
qdel(src)
return
/obj/item/reagent_containers/food/snacks/attack_self(mob/user as mob)
return
@@ -65,11 +55,6 @@
if(!istype(target))
return
if(!reagents.total_volume)
to_chat(user,span("warning","There is none of \the [src] left to eat!"))
qdel(src)
return
if (isanimal(target))
var/mob/living/simple_animal/SA = target
if(!(reagents && SA.reagents))
@@ -147,10 +132,7 @@
msg_admin_attack("[key_name_admin(user)] fed [key_name_admin(target)] with [name] Reagents: [contained] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)",ckey=key_name(user),ckey_target=key_name(target))
reagents.trans_to_mob(target, min(reagents.total_volume,bitesize), CHEM_INGEST)
if(is_liquid)
playsound(user.loc, 'sound/items/drink.ogg', rand(10, 50), 1)
else
playsound(user.loc, 'sound/items/eatfood.ogg', rand(10, 50), 1)
feed_sound(target,user)
bitecount++
on_consume(target,user)
@@ -230,11 +212,8 @@
U.is_liquid = TRUE
if (reagents.total_volume <= 0)
if(trash)
if(ispath(trash,/obj/item))
var/obj/item/TrashItem = new trash(user)
user.put_in_hands(TrashItem)
else if(istype(trash,/obj/item))
user.put_in_hands(trash)
var/obj/item/TrashItem = new trash(user)
user.put_in_hands(TrashItem)
qdel(src)
return
@@ -529,7 +508,6 @@
. = ..()
reagents.add_reagent("sugar", 3)
/obj/item/reagent_containers/food/snacks/candy/koko
name = "\improper koko bar"
desc = "A sweet and gritty candy bar cultivated exclusively on the Compact ruled world of Ha'zana. A good pick-me-up for Unathi, but has no effect on other species."
@@ -547,6 +525,7 @@
/obj/item/reagent_containers/food/snacks/candy/donor
name = "donor candy"
icon_state = "candy"
desc = "A little treat for blood donors. Made with real sugar!"
trash = /obj/item/trash/candy
nutriment_desc = list("candy" = 10)
@@ -5517,6 +5496,5 @@
It is known for its hard crust, bland taste and for being long lasting. The hard bread was usually prepared for long journeys, hard winters or military campaigns, \
due to its shelf life. Certain folk stories and jokes claim that such food could also be used as an artillery ammunition or thrown at besieging armies during sieges."
#undef NUTRIMENT_GOOD
#undef NUTRIMENT_BAD
#undef NUTRIMENT_BAD