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

Reagent Containers : The 3/4thening & Contained Spritening (and other related food things) #17231

Merged
merged 31 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
aa65b39
food and drink
alsoandanswer Aug 31, 2023
a66e3be
Merge branch 'master' into food_and_drink
alsoandanswer Aug 31, 2023
58406c2
sabrage
alsoandanswer Sep 3, 2023
c424aa1
Merge branch 'master' into food_and_drink
alsoandanswer Sep 3, 2023
d873314
kanpai and blasted on grain alcohol
alsoandanswer Sep 3, 2023
726c2cf
beakers
alsoandanswer Sep 3, 2023
050b19e
Update code/modules/reagents/reagent_containers/food/cans.dm
alsoandanswer Sep 3, 2023
6e9176d
Update code/modules/reagents/reagent_containers/food/cans.dm
alsoandanswer Sep 3, 2023
33338ba
Update code/modules/reagents/reagent_containers/food/cans.dm
alsoandanswer Sep 3, 2023
e99196e
Update code/modules/reagents/reagent_containers/food/cans.dm
alsoandanswer Sep 3, 2023
71ff5bd
Update code/modules/reagents/reagent_containers/food/cans.dm
alsoandanswer Sep 3, 2023
2660e36
Update code/modules/reagents/reagent_containers/food/drinks/bottle.dm
alsoandanswer Sep 3, 2023
0723cbb
Update code/modules/reagents/reagent_containers/food/drinks/bottle.dm
alsoandanswer Sep 3, 2023
ee3134a
changelog
alsoandanswer Sep 3, 2023
f3b3a39
the contained sprite-ening....
alsoandanswer Sep 5, 2023
41be2df
deletes old file
alsoandanswer Sep 5, 2023
cc03969
teapot
alsoandanswer Sep 5, 2023
88cfa4f
aaaaahhhh
alsoandanswer Sep 5, 2023
a2f9985
AAAGH INHANDS
alsoandanswer Sep 5, 2023
7d5711f
volume = 30
alsoandanswer Sep 5, 2023
99f7fe8
fixes invalid icon state
alsoandanswer Sep 5, 2023
a43b39e
Merge branch 'master' into food_and_drink
alsoandanswer Sep 5, 2023
5b238c7
is this really that fucking esoteric
alsoandanswer Sep 5, 2023
741eb06
Revert "is this really that fucking esoteric"
alsoandanswer Sep 5, 2023
efc4c36
this should fix it maybe
alsoandanswer Sep 5, 2023
a998fe3
fixes 2
alsoandanswer Sep 5, 2023
5a5d180
the simple solution
alsoandanswer Sep 5, 2023
c1389f9
skibidi toilet
alsoandanswer Sep 5, 2023
5ee2341
god dammit
alsoandanswer Sep 5, 2023
127c7c0
jyalra
alsoandanswer Sep 6, 2023
f03ab92
redundancy
alsoandanswer Sep 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions code/game/objects/random/loot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@
/obj/item/razor = 0.5,
/obj/item/reagent_containers/extinguisher_refill = 0.1,
/obj/item/reagent_containers/extinguisher_refill/filled = 0.5,
/obj/item/reagent_containers/food/drinks/flask/lithium = 0.3,
/obj/item/reagent_containers/food/drinks/flask/shiny = 0.3,
/obj/item/reagent_containers/food/drinks/teapot = 0.4,
/obj/item/reagent_containers/cooking_container/board/bowl = 0.8,
/obj/item/reagent_containers/inhaler/hyperzine = 0.1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@
taste_description = "corn oil"
condiment_name = "corn oil"
condiment_desc = "A delicious oil used in cooking. Made from corn."
condiment_icon_state = "oliveoil"
condiment_icon_state = "cooking_oil"

/singleton/reagent/nutriment/triglyceride/oil/peanut
name = "Peanut Oil"
Expand All @@ -359,14 +359,17 @@
taste_mult = 1
condiment_name = "peanut oil"
condiment_desc = "Tasteful and rich peanut oil used in cooking. Made from roasted peanuts."
condiment_icon_state = "peanutoil"
condiment_icon_state = "peanut_oil"

/singleton/reagent/nutriment/honey
name = "Honey"
description = "A golden yellow syrup, loaded with sugary sweetness."
nutriment_factor = 8
color = "#FFFF00"
taste_description = "honey"
condiment_name = "honey"
condiment_desc = "A jar of sweet and viscous honey."
condiment_icon_state = "honey"
germ_adjust = 5

/singleton/reagent/nutriment/flour
Expand Down Expand Up @@ -594,7 +597,7 @@
taste_description = "roasted peanuts"
taste_mult = 2
condiment_name = "ground roasted peanuts sack"
condiment_icon_state = "peanut_sack"
condiment_icon_state = "peanut"
condiment_center_of_mass = list("x"=16, "y"=8)

/singleton/reagent/nutriment/virusfood
Expand Down Expand Up @@ -682,7 +685,7 @@
color = "#F0EBD8"
condiment_name = "mayonnaise"
condiment_desc = "Great for sandwiches!"
condiment_icon_state = "mayojar"
condiment_icon_state = "mayonnaise"
condiment_center_of_mass = list("x"=16, "y"=8)

/* Non-food stuff like condiments */
Expand Down Expand Up @@ -4613,7 +4616,7 @@
description = "A good, strong drink must be erected upon the ruins, if any of us are to have a future."
strength = 20
taste_description = "freedom from want"

glass_icon_state = "insurrenderglass"
glass_name = "glass of instrument of surrender"
glass_desc = "A good, strong drink must be erected upon the ruins, if any of us are to have a future."
Expand Down
12 changes: 12 additions & 0 deletions code/modules/reagents/reagent_containers/food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
var/ingredient_name // Also used by sandwiches; if null, it just uses the normal name.
var/trash = null
var/is_liquid = TRUE
var/empty_icon_state

/obj/item/reagent_containers/food/update_icon()
..()
if(!reagents.total_volume)
if(("[initial(icon_state)]_empty") in icon_states(icon)) // if there's an empty icon state, use it
icon_state = "[initial(icon_state)]_empty"
else if (empty_icon_state)
icon_state = empty_icon_state
else
icon = initial(icon) //Necessary for refilling empty drinks
icon_state = initial(icon_state)

/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>")
Expand Down
3 changes: 2 additions & 1 deletion code/modules/reagents/reagent_containers/food/cans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
volume = 40 //just over one and a half cups
amount_per_transfer_from_this = 5
flags = 0 //starts closed
icon = 'icons/obj/item/reagent_containers/food/drinks/soda.dmi'
drop_sound = 'sound/items/drop/soda.ogg'
pickup_sound = 'sound/items/pickup/soda.ogg'
desc_info = "Click it in your hand to open it.\
Expand Down Expand Up @@ -433,7 +434,7 @@
desc_extended = "Hro'zamal Soda is a soft drink made from the seed's powder of a plant native to Hro'zamal, the sole Hadiist colony. While initially consumed as a herbal tea by the \
colonists, it was introduced to Adhomai by the Army Expeditionary Force and transformed into a carbonated drink. The beverage is popular with factory workers and university \
students because of its stimulant effect."
icon_state = "hrozamal_soda_can"
icon_state = "hrozamal_soda"
center_of_mass = list("x"=16, "y"=10)

reagents_to_add = list(/singleton/reagent/drink/hrozamal_soda = 30)
Expand Down
8 changes: 2 additions & 6 deletions code/modules/reagents/reagent_containers/food/condiment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/obj/item/reagent_containers/food/condiment
name = "condiment container"
desc = "Just your average condiment container."
icon = 'icons/obj/food.dmi'
icon = 'icons/obj/item/reagent_containers/food/condiment.dmi'
icon_state = "emptycondiment"
flags = OPENCONTAINER
possible_transfer_amounts = list(1,5,10)
Expand Down Expand Up @@ -40,10 +40,8 @@
if(fixed_state && !force)
return
if(isemptylist(reagents.reagent_volumes))
icon_state = "emptycondiment"
name = "condiment bottle"
desc = "An empty condiment bottle."
center_of_mass = list("x"=16, "y"=6)
return

var/singleton/reagent/master = reagents.get_primary_reagent_decl()
Expand All @@ -64,12 +62,10 @@

/obj/item/reagent_containers/food/condiment/shaker
name = "shaker"
empty_icon_state = "emptyshaker"
volume = 20
fixed_state = TRUE
center_of_mass = list("x"=17, "y"=11)
amount_per_transfer_from_this = 1
volume = 20
fixed_state = TRUE

/obj/item/reagent_containers/food/condiment/shaker/Initialize()
. = ..()
Expand Down
59 changes: 14 additions & 45 deletions code/modules/reagents/reagent_containers/food/drinks.dm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
Standards for trash/empty states under the /drinks path:
Adding Empty States: Trash/Empty states should be placed in the drinks_empty.dmi and should be the drink's icon_state name followed by _empty (ex: whiskeybottle_empty) and the NO_EMPTY_ICON flag should be removed.
If your trash state applies to multiple drinks, to avoid duplicating sprites, use UNIQUE_EMPTY_ICON and set the empty_icon_state var to that icon state. These will still need to be placed in drinks_empty.dmi
If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_ICON, else it will turn invisible when empty.
Adding Empty States: Trash/Empty states should be placed in the same icon as the drink and should be the drink's icon_state name followed by _empty (ex: whiskeybottle_empty).
If your trash state applies to multiple drinks, to avoid duplicating sprites, set the empty_icon_state var to that icon state. These will still need to be placed in the same icon file.
If you add a drink with an empty icon sprite, ensure it is in the same folder, else it will not work.
*/


Expand All @@ -20,8 +20,7 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
amount_per_transfer_from_this = 5
volume = 50
var/shaken = 0
var/drink_flags = NO_EMPTY_ICON
var/empty_icon_state = null //This icon_state should be the one set in drinks_empty.dmi and ONLY if it's a UNIQUE_EMPTY_ICON
var/drink_flags

/obj/item/reagent_containers/food/drinks/Initialize()
. = ..()
Expand All @@ -34,20 +33,6 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
/obj/item/reagent_containers/food/drinks/on_rag_wipe(var/obj/item/reagent_containers/glass/rag/R)
clean_blood()

/obj/item/reagent_containers/food/drinks/update_icon()
if(!reagents.total_volume)
if(drink_flags & UNIQUE_EMPTY_ICON)
icon = 'icons/obj/drinks_empty.dmi'
icon_state = empty_icon_state
else if(drink_flags & UNIQUE_EMPTY_ICON_FILE)
icon_state = empty_icon_state
else if(!(drink_flags & NO_EMPTY_ICON))
icon = 'icons/obj/drinks_empty.dmi'
icon_state = "[initial(icon_state)]_empty"
else
icon = initial(icon) //Necessary for refilling empty drinks
icon_state = initial(icon_state)

/obj/item/reagent_containers/food/drinks/attack_self(mob/user as mob)
if(!is_open_container())
if(user.a_intent == I_HURT && !shaken)
Expand Down Expand Up @@ -161,7 +146,6 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
icon_state = "coffee_vended"
item_state = "coffee"
trash = /obj/item/trash/coffee
drink_flags = null
drop_sound = 'sound/items/drop/papercup.ogg'
pickup_sound = 'sound/items/pickup/papercup.ogg'
center_of_mass = list("x"=16, "y"=11)
Expand All @@ -173,7 +157,6 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
icon_state = "psl_vended"
item_state = "coffee"
trash = /obj/item/trash/coffee
drink_flags = UNIQUE_EMPTY_ICON
empty_icon_state = "coffee_vended_empty"
drop_sound = 'sound/items/drop/papercup.ogg'
pickup_sound = 'sound/items/pickup/papercup.ogg'
Expand All @@ -186,7 +169,6 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
icon_state = "coffee_vended"
item_state = "coffee"
trash = /obj/item/trash/coffee
drink_flags = null
drop_sound = 'sound/items/drop/papercup.ogg'
pickup_sound = 'sound/items/pickup/papercup.ogg'
center_of_mass = list("x"=16, "y"=14)
Expand All @@ -198,7 +180,7 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
icon_state = "greentea_vended"
item_state = "coffee"
trash = /obj/item/trash/coffee
drink_flags = UNIQUE_EMPTY_ICON

empty_icon_state = "coffee_vended_empty"
drop_sound = 'sound/items/drop/papercup.ogg'
pickup_sound = 'sound/items/pickup/papercup.ogg'
Expand All @@ -211,7 +193,6 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
icon_state = "soy_latte_vended"
item_state = "coffee"
trash = /obj/item/trash/coffee
drink_flags = UNIQUE_EMPTY_ICON
empty_icon_state = "coffee_vended_empty"
drop_sound = 'sound/items/drop/papercup.ogg'
pickup_sound = 'sound/items/pickup/papercup.ogg'
Expand All @@ -224,7 +205,6 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
icon_state = "chai_vended"
item_state = "coffee"
trash = /obj/item/trash/coffee
drink_flags = UNIQUE_EMPTY_ICON
empty_icon_state = "coffee_vended_empty"
drop_sound = 'sound/items/drop/papercup.ogg'
pickup_sound = 'sound/items/pickup/papercup.ogg'
Expand All @@ -237,7 +217,6 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
icon_state = "coffee_vended"
item_state = "coffee"
trash = /obj/item/trash/coffee
drink_flags = null
drop_sound = 'sound/items/drop/papercup.ogg'
pickup_sound = 'sound/items/pickup/papercup.ogg'
center_of_mass = list("x"=15, "y"=10)
Expand All @@ -249,7 +228,6 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
icon_state = "coffee_vended"
item_state = "coffee"
trash = /obj/item/trash/coffee
drink_flags = null
drop_sound = 'sound/items/drop/papercup.ogg'
pickup_sound = 'sound/items/pickup/papercup.ogg'
center_of_mass = list("x"=15, "y"=13)
Expand All @@ -261,7 +239,6 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
icon_state = "ramen"
item_state = "coffee"
trash = /obj/item/trash/ramen
drink_flags = null
drop_sound = 'sound/items/drop/papercup.ogg'
pickup_sound = 'sound/items/pickup/papercup.ogg'
center_of_mass = list("x"=16, "y"=11)
Expand All @@ -280,14 +257,22 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
desc = "A fresh bottle of water from the finest bottling plants on Silversun."
desc_extended = "Previously introduced to the vending machines by Skrellian request, this water used to come straight from the Martian poles. Ever since the Martian catastrophe, however, an Idris subsidiary has since stepped in to fill the gap in the market \
and 'Martian Water' has become a prized collector's item."
icon_state = "waterbottle"
icon_state = "smallbottle"
flags = 0 //starts closed
center_of_mass = list("x"=16, "y"=8)
drop_sound = 'sound/items/drop/disk.ogg'
pickup_sound = 'sound/items/pickup/disk.ogg'

reagents_to_add = list(/singleton/reagent/water = 30)

/obj/item/reagent_containers/food/drinks/waterbottle/update_icon()
cut_overlays()

if(reagents?.total_volume)
var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "[icon_state]-[get_filling_state()]")
filling.color = reagents.get_color()
add_overlay(filling)

//heehoo bottle flipping
/obj/item/reagent_containers/food/drinks/waterbottle/throw_impact()
. = ..()
Expand Down Expand Up @@ -626,16 +611,6 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
volume = 60
center_of_mass = list("x"=17, "y"=7)

/obj/item/reagent_containers/food/drinks/flask/shiny
name = "shiny flask"
desc = "A shiny metal flask. It appears to have a Greek symbol inscribed on it."
icon_state = "shinyflask"

/obj/item/reagent_containers/food/drinks/flask/lithium
name = "lithium flask"
desc = "A flask with a Lithium Atom symbol on it."
icon_state = "lithiumflask"

/obj/item/reagent_containers/food/drinks/flask/detflask
name = "detective's flask"
desc = "A metal flask with a leather band and golden badge belonging to the detective."
Expand Down Expand Up @@ -747,7 +722,6 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
desc_extended = "Jyalra is created by peeling and mashing dyn until it becomes a thick blue puree. Unlike the fruit, it has a dry, savoury flavour to it. While used as a meal replacement by busy scientists, it is considered junk food by the Skrell and is eaten more as a snack than a proper meal."
icon_state = "jyalra"
item_state = "jyalra"
drink_flags = UNIQUE_EMPTY_ICON
empty_icon_state = "jyalra_empty"
drop_sound = 'sound/items/drop/disk.ogg'
pickup_sound = 'sound/items/pickup/disk.ogg'
Expand All @@ -760,7 +734,6 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
desc_extended = "Jyalra is created by peeling and mashing dyn until it becomes a thick blue puree. Unlike the fruit, it has a dry, savoury flavour to it. While used as a meal replacement by busy scientists, it is considered junk food by the Skrell and is eaten more as a snack than a proper meal."
icon_state = "jyalracheese"
item_state = "jyalracheese"
drink_flags = UNIQUE_EMPTY_ICON
empty_icon_state = "jyalra_empty"
drop_sound = 'sound/items/drop/disk.ogg'
pickup_sound = 'sound/items/pickup/disk.ogg'
Expand All @@ -773,7 +746,6 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
desc_extended = "Jyalra is created by peeling and mashing dyn until it becomes a thick blue puree. Unlike the fruit, it has a dry, savoury flavour to it. While used as a meal replacement by busy scientists, it is considered junk food by the Skrell and is eaten more as a snack than a proper meal."
icon_state = "jyalraapple"
item_state = "jyalraapple"
drink_flags = UNIQUE_EMPTY_ICON
empty_icon_state = "jyalra_empty"
drop_sound = 'sound/items/drop/disk.ogg'
pickup_sound = 'sound/items/pickup/disk.ogg'
Expand All @@ -786,11 +758,8 @@ If you add a drink with no empty icon sprite, ensure it is flagged as NO_EMPTY_I
desc_extended = "Jyalra is created by peeling and mashing dyn until it becomes a thick blue puree. Unlike the fruit, it has a dry, savoury flavour to it. While used as a meal replacement by busy scientists, it is considered junk food by the Skrell and is eaten more as a snack than a proper meal."
icon_state = "jyalracherry"
item_state = "jyalracherry"
drink_flags = UNIQUE_EMPTY_ICON
empty_icon_state = "jyalra_empty"
drop_sound = 'sound/items/drop/disk.ogg'
pickup_sound = 'sound/items/pickup/disk.ogg'
center_of_mass = list("x"=16, "y"=11)
reagents_to_add = list(/singleton/reagent/drink/jyalracherry = 40)