Merge pull request #4838 from FalseIncarnate/paradise_pop

Paradise Pop
This commit is contained in:
Fox McCloud
2016-07-14 23:58:24 -04:00
committed by GitHub
13 changed files with 703 additions and 51 deletions
+414
View File
@@ -0,0 +1,414 @@
//adjust these to change the maximum capacity of the bottler for each container type
#define MAX_GLASS 10
#define MAX_PLAST 20
#define MAX_METAL 25
//adjust these to change the number of containers the bottler will make per sheet
#define RATIO_GLASS 1
#define RATIO_PLAST 2
#define RATIO_METAL 5
/obj/machinery/bottler
name = "bottler unit"
desc = "A machine that combines ingredients and bottles the resulting beverages."
icon = 'icons/obj/kitchen.dmi'
icon_state = "bottler_off"
density = 1
anchored = 1
var/list/slots[3]
var/list/datum/bottler_recipe/available_recipes
var/list/acceptable_items
var/list/containers = list("glass bottle" = 10, "plastic bottle" = 20, "metal can" = 25)
var/bottling = 0
/obj/machinery/bottler/New()
if(!available_recipes)
available_recipes = list()
acceptable_items = list()
//These are going to be acceptable even if they aren't in a recipe
acceptable_items |= /obj/item/weapon/reagent_containers/food/snacks
acceptable_items |= /obj/item/weapon/reagent_containers/food/drinks/cans
//the rest is based on what is used in recipes so we don't have people destroying the nuke disc
for(var/type in subtypesof(/datum/bottler_recipe))
var/datum/bottler_recipe/recipe = new type
if(recipe.result) // Ignore recipe subtypes that lack a result
available_recipes += recipe
for(var/i = 1, i <= recipe.ingredients.len, i++)
acceptable_items |= recipe.ingredients[i]
else
qdel(recipe)
/obj/machinery/bottler/attackby(obj/item/O, mob/user, params)
if(iswrench(O)) //This being before the canUnequip check allows borgs to (un)wrench bottlers in case they need move them to fix stuff
playsound(src, 'sound/items/Ratchet.ogg', 50, 1)
if(anchored)
anchored = 0
to_chat(user, "<span class='alert'>[src] can now be moved.</span>")
else
anchored = 1
to_chat(user, "<span class='alert'>[src] is now secured.</span>")
return 1
if(!user.canUnEquip(O, 0))
to_chat(user, "<span class='warning'>[O] is stuck to your hand, you can't seem to put it down!</span>")
return 0
if(is_type_in_list(O,acceptable_items))
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks))
var/obj/item/weapon/reagent_containers/food/snacks/S = O
user.unEquip(S)
if(S.reagents && !S.reagents.total_volume) //This prevents us from using empty foods, should one occur due to some sort of error
to_chat(user, "<span class='warning'>[S] is gone, oh no!</span>")
qdel(S) //Delete the food object because it is useless even as food due to the lack of reagents
else
insert_item(S, user)
return 1
else if(istype(O, /obj/item/weapon/reagent_containers/food/drinks/cans))
var/obj/item/weapon/reagent_containers/food/drinks/cans/C = O
if(C.reagents)
if(C.canopened && C.reagents.total_volume) //This prevents us from using opened cans that still have something in them
to_chat(user, "<span class='warning'>Only unopened cans and bottles can be processed to ensure product integrity.</span>")
return 0
user.unEquip(C)
if(!C.reagents.total_volume) //Empty cans get recycled, even if they have somehow remained unopened due to some sort of error
recycle_container(C)
else //Full cans that are unopened get inserted for processing as ingredients
insert_item(C, user)
return 1
else
user.unEquip(O)
insert_item(O, user)
return 1
else if(istype(O, /obj/item/trash/can)) //Crushed cans (and bottles) are returnable still
var/obj/item/trash/can/C = O
user.unEquip(C)
recycle_container(C)
return 1
else if(istype(O, /obj/item/stack/sheet)) //Sheets of materials can replenish the machine's supply of drink containers (when people inevitably don't return them)
var/obj/item/stack/sheet/S = O
user.unEquip(S)
process_sheets(S)
return 1
else //If it doesn't qualify in the above checks, we don't want it. Inform the person so they (ideally) stop trying to put the nuke disc in.
to_chat(user, "<span class='warning'>You aren't sure this is able to be processed by the machine.</span>")
return 0
//..()
/obj/machinery/bottler/proc/insert_item(obj/item/O, mob/user)
if(!O || !user)
return
if(slots[1] && slots[2] && slots[3])
to_chat(user, "<span class='warning'>[src] is full, please remove or process the contents first.</span>")
return
var/slot_inserted = 0
for(var/i = 1, i <= slots.len, i++)
if(!slots[i])
slots[i] = O
slot_inserted = i
break
if(!slot_inserted)
to_chat(user, "<span class='warning'>Something went wrong and the machine spits out [O].</span>")
O.forceMove(loc)
else
to_chat(user, "<span class='notice'>You load [O] into the [slot_inserted]\th ingredient tray.</span>")
O.forceMove(src)
updateUsrDialog()
/obj/machinery/bottler/proc/eject_items(var/slot)
var/obj/item/O = null
if(!slot)
for(var/i = 1, i <= slots.len, i++)
if(slots[i])
O = slots[i]
O.forceMove(loc)
slots[i] = null
visible_message("<span class='notice'>[src] beeps as it ejects the contents of all the ingredient trays.</span>")
else
if(slots[slot]) //ensures the tray actually has something to eject so we don't runtime on trying to reference null
O = slots[slot]
O.forceMove(loc)
slots[slot] = null
visible_message("<span class='notice'>[src] beeps as it ejects [O.name] from the [slot]\th ingredient tray.</span>")
updateUsrDialog()
/obj/machinery/bottler/proc/recycle_container(obj/item/O)
if(!O)
return
var/con_type
var/max_define
if(istype(O, /obj/item/trash/can))
var/obj/item/trash/can/C = O
if(C.is_glass)
con_type = "glass bottle"
max_define = MAX_GLASS
else if(C.is_plastic)
con_type = "plastic bottle"
max_define = MAX_PLAST
else
con_type = "metal can"
max_define = MAX_METAL
else if(istype(O, /obj/item/weapon/reagent_containers/food/drinks/cans))
var/obj/item/weapon/reagent_containers/food/drinks/cans/C = O
if(C.is_glass)
con_type = "glass bottle"
max_define = MAX_GLASS
else if(C.is_plastic)
con_type = "plastic bottle"
max_define = MAX_PLAST
else
con_type = "metal can"
max_define = MAX_METAL
if(con_type)
if(containers[con_type] < max_define)
containers[con_type]++
visible_message("<span class='notice'>[src] whirs briefly as it prepares the container for reuse.</span>")
qdel(O)
updateUsrDialog()
else
visible_message("<span class='warning'>[src] cannot store any more cans at this time. Please fill some before recycling more.</span>")
O.forceMove(loc)
/obj/machinery/bottler/proc/process_sheets(obj/item/stack/sheet/S)
if(!S)
return
S.forceMove(loc)
var/con_type
var/max_define
var/mat_ratio
//Glass sheets for glass bottles (1 bottle per sheet)
if(istype(S, /obj/item/stack/sheet/glass))
con_type = "glass bottle"
max_define = MAX_GLASS
mat_ratio = RATIO_GLASS
else if(istype(S, /obj/item/stack/sheet/mineral/plastic))
con_type = "plastic bottle"
max_define = MAX_PLAST
mat_ratio = RATIO_PLAST
else if(istype(S, /obj/item/stack/sheet/metal))
con_type = "metal can"
max_define = MAX_METAL
mat_ratio = RATIO_METAL
else
visible_message("<span class='warning'>[src] rejects the unusable materials.</span>")
return
var/missing
var/sheets_needed
var/sheets_to_use
if(con_type)
missing = max_define - containers[con_type]
sheets_needed = round(missing / mat_ratio, 1)
if(missing % mat_ratio)
sheets_needed += 1
sheets_to_use = min(sheets_needed, S.amount)
if(missing)
visible_message("<span class='notice'>[src] shudders as it converts [sheets_to_use] [S.singular_name]\s into new [con_type]s.</span>")
containers[con_type] += sheets_to_use * mat_ratio
containers[con_type] = min(containers[con_type], max_define)
S.use(sheets_to_use)
else
visible_message("<span class='warning'>[src] rejects the [S] because it already is fully stocked with [con_type]s.</span>")
/obj/machinery/bottler/proc/select_recipe()
for(var/datum/bottler_recipe/recipe in available_recipes)
var/number_matches = 0
for(var/i = 1, i <= slots.len, i++)
var/obj/item/O = slots[i]
if(istype(O, recipe.ingredients[i]))
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown))
var/obj/item/weapon/reagent_containers/food/snacks/grown/G = O
if(G.seed && G.seed.kitchen_tag == recipe.tags[i])
number_matches++
else
number_matches++
if(number_matches == 3)
return recipe
return null
/obj/machinery/bottler/proc/dispense_empty_container(container)
var/con_type
var/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/drink_container
switch(container)
if(1) //glass bottle
con_type = "glass bottle"
drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/glass_bottle
if(2) //plastic bottle
con_type = "plastic bottle"
drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/plastic_bottle
if(3) //metal can
con_type = "metal can"
drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/metal_can
if(containers[con_type])
//empties aren't sealed, so let's open it quietly
drink_container = new drink_container()
drink_container.canopened = 1
drink_container.flags |= OPENCONTAINER
drink_container.forceMove(loc)
containers[con_type]--
/obj/machinery/bottler/proc/process_ingredients(container)
//stop if we have ZERO ingredients (what would you process?)
if(!slots[1] && !slots[2] && !slots[3])
visible_message("<span class='warning'>There are no ingredients to process! Please insert some first.</span>")
return
//prep a container
var/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/drink_container
var/con_type
switch(container)
if(1) //glass bottle
con_type = "glass bottle"
drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/glass_bottle
if(2) //plastic bottle
con_type = "plastic bottle"
drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/plastic_bottle
if(3) //metal can
con_type = "metal can"
drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/metal_can
if(!con_type)
visible_message("<span class='warning'>Error 404: Drink Container Not Found.</span>")
return
if(!containers[con_type])
visible_message("<span class='warning'>Error 503: Out of [con_type]s.</span>")
return
else
drink_container = new drink_container()
containers[con_type]--
//select and process a recipe based on inserted ingredients
visible_message("<span class='notice'>[src] hums as it processes the ingredients...</span>")
bottling = 1
var/datum/bottler_recipe/recipe_to_use = select_recipe()
if(!recipe_to_use)
//bad recipe, ruins the drink
var/contents = pick("thick goop", "pungent sludge", "unspeakable slurry", "gross-looking concoction", "eldritch abomination of liquids")
visible_message("<span class='warning'>The [con_type] fills with \an [contents]...</span>")
drink_container.reagents.add_reagent(pick("????", "toxic_slurry", "meatslurry", "glowing_slury", "fishwater"), pick(30, 50))
drink_container.name = "Liquid Mistakes"
drink_container.desc = "WARNING: CONTENTS MAY BE AWFUL, DRINK AT OWN RISK."
else
//good recipe, make it
visible_message("<span class='notice'>The [con_type] fills with a delicious-looking beverage!</span>")
drink_container.reagents.add_reagent(recipe_to_use.result, 50)
drink_container.name = "[recipe_to_use.name]"
drink_container.desc = "[recipe_to_use.description]"
flick("bottler_on", src)
spawn(45)
for(var/i = 1, i <= slots.len, i++)
qdel(slots[i])
slots[i] = null
bottling = 0
drink_container.forceMove(loc)
updateUsrDialog()
/obj/machinery/bottler/attack_ai(mob/user)
attack_hand(user)
/obj/machinery/bottler/attack_ghost(mob/user)
attack_hand(user)
/obj/machinery/bottler/attack_hand(mob/user)
if(stat & BROKEN)
return
interact(user)
/obj/machinery/bottler/interact(mob/user)
user.set_machine(src)
//html ahoy
var/dat = ""
if(bottling)
dat = "<h2>Bottling in process, please wait...</h2>"
else
dat += "<table border='1' style='width:75%'>"
dat += "<tr>"
dat += "<th colspan='3'>Containers:</th>"
dat += "</tr>"
dat += "<tr>"
dat += "<td>Glass Bottles: [containers["glass bottle"]]</td>"
dat += "<td>Plastic Bottles: [containers["plastic bottle"]]</td>"
dat += "<td>Metal Cans: [containers["metal can"]]</td>"
dat += "</tr>"
dat += "<tr>"
if(containers["glass bottle"])
dat += "<td><A href='?src=\ref[src];dispense=1'>Dispense</a></td>"
else
dat += "<td>Out of stock</td>"
if(containers["plastic bottle"])
dat += "<td><A href='?src=\ref[src];dispense=2'>Dispense</a></td>"
else
dat += "<td>Out of stock</td>"
if(containers["metal can"])
dat += "<td><A href='?src=\ref[src];dispense=3'>Dispense</a></td>"
else
dat += "<td>Out of stock</td>"
dat += "</tr>"
dat += "</table>"
dat += "<hr>"
dat += "<table border='1' style='width:75%'>"
dat += "<tr>"
dat += "<th colspan='4'>Ingredient Tray Contents:</th>"
dat += "</tr>"
dat += "<tr>"
for(var/i = 1, i <= slots.len, i++)
var/obj/O = slots[i]
if(O)
dat += "<td>[bicon(O)]<br>[O.name]</td>"
else
dat += "<td>Tray Empty</td>"
if(slots[1] && slots[2] && slots[3])
dat += "<td><A href='?src=\ref[src];process=1'>Process Ingredients</a></td>"
else
dat += "<td>Insufficient Ingredients</td>"
dat += "</tr>"
dat += "<tr>"
for(var/i = 1, i <= slots.len, i++)
if(slots[i])
dat += "<td><A href='?src=\ref[src];eject=[i]'>Eject</a></td>"
else
dat += "<td>N/A</td>"
dat += "<td><A href='?src=\ref[src];eject=0'>Eject All</a></td>"
dat += "</tr>"
dat += "</table>"
dat += "<hr>"
dat += "<p>Insert three ingredients and press process to create a beverage. You will be able to select a container for the beverage before processing begins.</p>"
dat += "<p>Inserting empty bottles and cans, as well as sheets of glass, plastic, or metal will restock the appropriate container supply.</p>"
var/datum/browser/popup = new(user, "bottler", "Bottler Menu", 575, 400)
popup.set_content(dat)
popup.open()
/obj/machinery/bottler/Topic(href, href_list)
if(..())
return 1
if(bottling)
return
add_fingerprint(usr)
usr.set_machine(src)
if(href_list["process"])
var/list/choices = list("Glass Bottle" = 1, "Plastic Bottle" = 2, "Metal Can" = 3)
var/selection = input("Select a container for your beverage.", "Container") as null|anything in choices
if(!selection)
return
else
selection = choices[selection]
process_ingredients(selection)
if(href_list["eject"])
var/slot = text2num(href_list["eject"])
eject_items(slot)
if(href_list["dispense"])
var/container = text2num(href_list["dispense"])
dispense_empty_container(container)
updateUsrDialog()
return
/obj/machinery/bottler/update_icon()
if(stat & BROKEN)
icon_state = "bottler_broken"
else if(bottling)
icon_state = "bottler_on"
else
icon_state = "bottler_off"
@@ -0,0 +1,86 @@
/datum/bottler_recipe
var/name = ""
var/description = ""
var/list/ingredients[3]
var/list/tags[3]
var/datum/reagent/result = null
/* Example of how a bottler_recipe should look:
/datum/bottler_recipe/example
name = "Example"
description = "This is an example."
ingredients = list(thing_1, thing_2, thing_3)
tags = list(null, "tag_2", null)
result = "water"
The ingredients list must have 3 non-null entries.
The tags list must have 3 entries, using null where a tag is unused.
Failing to ensure both lists have EXACTLY 3 entries (unless the system is updated in the future to use a different number) will result in runtimes.
There is no excuse to do this wrong now that there is an example for you. --FalseIncarnate
*/
/datum/bottler_recipe/Paradise_Punch
name = "Paradise Punch"
description = "Tastes just how you'd think Paradise would if you could bottle it."
ingredients = list(/obj/item/weapon/reagent_containers/food/snacks/grown,
/obj/item/weapon/reagent_containers/food/snacks/grown,
/obj/item/weapon/reagent_containers/food/snacks/grown)
tags = list("grapes", "banana", "cherries")
result = "paradise_punch"
/datum/bottler_recipe/Applepocalypse
name = "Apple-pocalypse"
description = "If doomsday came in fruit form, it'd probably be apples."
ingredients = list(/obj/item/weapon/reagent_containers/food/snacks/grown,
/obj/item/weapon/reagent_containers/food/snacks/grown,
/obj/item/weapon/reagent_containers/food/snacks/grown)
tags = list("apple", "apple", "apple")
result = "apple-pocalypse"
/datum/bottler_recipe/Berry_Banned
name = "Berry Banned"
description = "Reason for ban: Excessive Flavor."
ingredients = list(/obj/item/weapon/reagent_containers/food/snacks/grown,
/obj/item/weapon/reagent_containers/food/snacks/grown,
/obj/item/weapon/reagent_containers/food/snacks/grown)
tags = list("berries", "berries", "berries")
result = "berry_banned"
/datum/bottler_recipe/Berry_Banned2
name = "Berry Banned"
description = "Reason for ban: Excessive Flavor."
ingredients = list(/obj/item/weapon/reagent_containers/food/snacks/grown,
/obj/item/weapon/reagent_containers/food/snacks/grown,
/obj/item/weapon/reagent_containers/food/snacks/grown)
tags = list("poisonberries", "poisonberries", "poisonberries")
result = "berry_banned2"
/datum/bottler_recipe/Blackeye_Brew
name = "Blackeye Brew"
description = "Creamy, smooth flavor, just like the bald heads of the masses. Supposedly aged for 30 years."
ingredients = list(/obj/item/weapon/reagent_containers/food/drinks/cans/cola,
/obj/item/weapon/reagent_containers/food/snacks/grown,
/obj/item/weapon/reagent_containers/food/snacks/icecream)
tags = list(null, "sugarcane", null)
result = "blackeye_brew"
/datum/bottler_recipe/Grape_Granade
name = "Grape Granade"
description = "Exploding with grape flavor and a favorite among ERT members system-wide."
ingredients = list(/obj/item/weapon/reagent_containers/food/drinks/cans/grape_juice,
/obj/item/weapon/reagent_containers/food/snacks/grown,
/obj/item/device/flash)
tags = list(null, "grapes", null)
result = "grape_granade"
/datum/bottler_recipe/Meteor_Malt
name = "Meteor Malt"
description = "Soft drinks have been detected on collision course with your tastebuds."
ingredients = list(/obj/item/weapon/ore,
/obj/item/weapon/reagent_containers/food/snacks/grown,
/obj/item/weapon/ore)
tags = list(null, "wheat", null)
result = "meteor_malt"
+2
View File
@@ -825,6 +825,7 @@
display_name = "grapevines"
mutants = list("greengrapes")
chems = list("plantmatter" = list(1,10), "sugar" = list(1,5))
kitchen_tag = "grapes"
preset_icon = "grapes"
/datum/seed/grapes/New()
@@ -1089,6 +1090,7 @@
seed_name = "sugarcane"
display_name = "sugarcanes"
chems = list("sugar" = list(4,5))
kitchen_tag = "sugarcane"
preset_icon = "sugarcane"
/datum/seed/sugarcane/New()
@@ -0,0 +1,66 @@
/*
Paradise Pop reagents
Created through the bottler machine via bottler_recipes, not through standard reactions
Eventually will have special effects (minor mostly) tied to their reagents, but for now are purely for flavor
Make sure to yell at me to finish giving them effects later
-FalseIncarnate
*/
//Paradise Punch: No effect, aside from maybe messages about how tasty it is or something
/datum/reagent/paradise_punch
name = "Paradise Punch"
id = "paradise_punch"
description = "Tastes just how you'd think Paradise would if you could bottle it."
reagent_state = LIQUID
color = "#cc0044"
//Apple-pocalypse: Low chance to cause a goonchem vortex that pulls things within a very small radius (2 tiles?) towards the drinker
/datum/reagent/apple_pocalypse
name = "Apple-pocalypse"
id = "apple-pocalypse"
description = "If doomsday came in fruit form, it'd probably be apples."
reagent_state = LIQUID
color = "#44FF44"
//Berry Banned: This one is tasty and safe to drink, might have a low chance of healing a random damage type?
/datum/reagent/berry_banned
name = "Berry Banned"
id = "berry_banned"
description = "Reason for ban: Excessive Flavor."
reagent_state = LIQUID
color = "#FF44FF"
//Berry Banned 2: This one is tasty and toxic. Deals toxin damage and MAYBE plays the "BWOINK!" sound if it kills someone?
/datum/reagent/berry_banned2
name = "Berry Banned"
id = "berry_banned2"
description = "Reason for ban: Excessive Flavor."
reagent_state = LIQUID
color = "#FF44FF"
//Blackeye Brew: Chance to make the drinker say greytider-themed things like "I thought clown was valid!"
/datum/reagent/blackeye_brew
name = "Blackeye Brew"
id = "blackeye_brew"
description = "Creamy, smooth flavor, just like the bald heads of the masses. Supposedly aged for 30 years."
reagent_state = LIQUID
color = "#4d2600"
//Grape Granade: causes the drinker to sometimes burp, has a low chance to cause a goonchem vortex that pushes things within a very small radius (1-2 tiles) away from the drinker
/datum/reagent/grape_granade
name = "Grape Granade"
id = "grape_granade"
description = "Exploding with grape flavor and a favorite among ERT members system-wide."
reagent_state = LIQUID
color = "#9933ff"
//Meteor Malt: Sometimes causes screen shakes for the drinker like a meteor impact, low chance to add 1-5 units of a random mineral reagent to the drinker's blood (iron, copper, silver, gold, uranium, carbon, etc)
/datum/reagent/meteor_malt
name = "Meteor Malt"
id = "meteor_malt"
description = "Soft drinks have been detected on collision course with your tastebuds."
reagent_state = LIQUID
color = "#cc9900"
@@ -1,6 +1,7 @@
/obj/item/weapon/reagent_containers/food/drinks/cans
var canopened = 0
var is_glass = 0
var/canopened = 0
var/is_glass = 0
var/is_plastic = 0
/obj/item/weapon/reagent_containers/food/drinks/cans/New()
..()
@@ -16,6 +17,9 @@
/obj/item/weapon/reagent_containers/food/drinks/cans/proc/crush(mob/user)
var/obj/item/trash/can/crushed_can = new /obj/item/trash/can(user.loc)
crushed_can.icon_state = icon_state
//inherit material vars for recycling purposes
crushed_can.is_glass = is_glass
crushed_can.is_plastic = is_plastic
if(is_glass)
playsound(user.loc, 'sound/effects/Glassbr3.ogg', rand(10, 50), 1)
crushed_can.name = "broken bottle"
@@ -85,6 +89,7 @@
name = "Bottled Water"
desc = "Introduced to the vending machines by Skrellian request, this water comes straight from the Martian poles."
icon_state = "waterbottle"
is_plastic = 1
New()
..()
reagents.add_reagent("water", 30)
@@ -259,3 +264,62 @@
New()
..()
reagents.add_reagent("synthanol", 50)
/obj/item/weapon/reagent_containers/food/drinks/cans/bottler
name = "generic beverage container"
desc = "this shouldn't ever be spawned. shame on you"
icon_state = "glass_bottle"
/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/on_reagent_change()
update_icon()
/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/pickup(mob/user)
..()
update_icon()
/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/dropped(mob/user)
..()
update_icon()
/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/attack_hand()
..()
update_icon()
/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/update_icon()
overlays.Cut()
if(reagents.total_volume)
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]10")
switch(round(reagents.total_volume))
if(0 to 9)
filling.icon_state = "[icon_state]-10"
if(10 to 19)
filling.icon_state = "[icon_state]10"
if(20 to 29)
filling.icon_state = "[icon_state]20"
if(30 to 39)
filling.icon_state = "[icon_state]30"
if(40 to 49)
filling.icon_state = "[icon_state]40"
if(50 to INFINITY)
filling.icon_state = "[icon_state]50"
filling.icon += mix_color_from_reagents(reagents.reagent_list)
overlays += filling
/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/glass_bottle
name = "glass bottle"
desc = "A glass bottle suitable for beverages."
icon_state = "glass_bottle"
is_glass = 1
/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/plastic_bottle
name = "plastic bottle"
desc = "A plastic bottle suitable for beverages."
icon_state = "plastic_bottle"
is_plastic = 1
/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/metal_can
name = "metal can"
desc = "A metal can suitable for beverages."
icon_state = "metal_can"
@@ -205,13 +205,20 @@
var/percent = round((reagents.total_volume / volume) * 100)
switch(percent)
if(0 to 9) filling.icon_state = "[icon_state]-10"
if(10 to 24) filling.icon_state = "[icon_state]10"
if(25 to 49) filling.icon_state = "[icon_state]25"
if(50 to 74) filling.icon_state = "[icon_state]50"
if(75 to 79) filling.icon_state = "[icon_state]75"
if(80 to 90) filling.icon_state = "[icon_state]80"
if(91 to INFINITY) filling.icon_state = "[icon_state]100"
if(0 to 9)
filling.icon_state = "[icon_state]-10"
if(10 to 24)
filling.icon_state = "[icon_state]10"
if(25 to 49)
filling.icon_state = "[icon_state]25"
if(50 to 74)
filling.icon_state = "[icon_state]50"
if(75 to 79)
filling.icon_state = "[icon_state]75"
if(80 to 90)
filling.icon_state = "[icon_state]80"
if(91 to INFINITY)
filling.icon_state = "[icon_state]100"
filling.icon += mix_color_from_reagents(reagents.reagent_list)
overlays += filling