Skip to content

Commit

Permalink
Keg based brewing system (#5421)
Browse files Browse the repository at this point in the history
* untested but for show

* craftable bottler + storge ui fixes

also a few mix fixes with the system itself

* whisky and balancing

* distillation -> fermentation

also more repices and deeper level fermentation

* fixes

* complie

* more fixes:tm:

* Update brewing.dm

* lots of fixes

* Apply suggestions from code review

Co-authored-by: benj8560 <[email protected]>

* K5's rework done before health scanners

how quaint!

* fixes

* fixes

* real fixes

* more brewing tweaks

* more framework more repices more more more

* salt

* 36 repices in total

---------

Co-authored-by: benj8560 <[email protected]>
  • Loading branch information
Trilbyspaceclone and benj8560 authored Jun 24, 2024
1 parent 9f697c7 commit 9f88992
Show file tree
Hide file tree
Showing 16 changed files with 860 additions and 58 deletions.
11 changes: 10 additions & 1 deletion code/datums/craft/recipes/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
category = "Consumer"
time = 200
related_stats = list(STAT_MEC)
icon_state = "device"
icon_state = "electronic"


/datum/craft_recipe/consumer/toaster
Expand All @@ -115,3 +115,12 @@
list(QUALITY_SCREW_DRIVING, 35, "time" = 170),
list(QUALITY_PRYING, 35, "time" = 170)
)

/datum/craft_recipe/consumer/bottling_kit
name = "bottling kit"
result = /obj/item/bottle_kit
steps = list(
list(CRAFT_MATERIAL, 10, MATERIAL_WOOD),
list(CRAFT_MATERIAL, 10, MATERIAL_GLASS),
list(/obj/item/circuitboard/autolathe, 1)
)
11 changes: 11 additions & 0 deletions code/datums/craft/recipes/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,14 @@
list(CRAFT_MATERIAL, 25, MATERIAL_STEEL),
list(QUALITY_WELDING, 10, 20)
)

//Techinally it stores produce
/datum/craft_recipe/storage/fermentation_keg
name = "fermentation keg"
result = /obj/structure/fermentation_keg
related_stats = list(STAT_MEC)
icon_state = "woodworking"
steps = list(
list(CRAFT_MATERIAL, 10, MATERIAL_WOOD),
list(/obj/item/stack/rods, 2)
)
2 changes: 2 additions & 0 deletions code/game/machinery/biogenerator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
else if(processing)
to_chat(user, SPAN_NOTICE("\The [src] is currently processing."))
else if(istype(I, /obj/item/storage/bag/produce))
var/obj/item/storage/bag/produce/produce_bag = I
var/i = 0
for(var/obj/item/reagent_containers/food/snacks/grown/G in contents)
i++
Expand All @@ -136,6 +137,7 @@
break
if(i < 10)
to_chat(user, SPAN_NOTICE("You empty \the [I] into \the [src]."))
produce_bag.refresh_all()


else if(!istype(I, /obj/item/reagent_containers/food/snacks/grown))
Expand Down
3 changes: 2 additions & 1 deletion code/game/machinery/kitchen/smartfridge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@
else
P.remove_from_storage(G,src)
plants_loaded++
P.refresh_all()
if(plants_loaded)
update_icon()
user.visible_message(SPAN_NOTICE("[user] loads \the [src] with \the [P]."), SPAN_NOTICE("You load \the [src] with \the [P]."))
Expand Down Expand Up @@ -391,7 +392,7 @@
data["emagged"] = emagged
data["secure"] = is_secure
data["allowed"] = allowed(user)

var/list/items = list()

for(var/obj/item/I in src)
Expand Down
66 changes: 12 additions & 54 deletions code/modules/hydroponics/grown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -324,60 +324,18 @@
qdel(src)

/obj/item/reagent_containers/food/snacks/grown/pre_pickup(mob/user)
if(!seed)
return FALSE
if(seed.get_trait(TRAIT_STINGS))
var/mob/living/carbon/human/H = user
if(istype(H) && H.gloves)
return ..()
if(!reagents || reagents.total_volume <= 0)
return ..()
reagents.remove_any(rand(1,3)) //Todo, make it actually remove the reagents the seed uses.
seed.do_thorns(H,src)
seed.do_sting(H,src,pick(BP_R_ARM, BP_L_ARM))
return ..()

// Predefined types for placing on the map.
/obj/plant_spawner
name = "plant spawner"
var/seedtype = "ambrosia" //default to ambrosia for roach taming
/*
/obj/plant_spawner/Initialize(mapload)
var/datum/seed/S = plant_controller.seeds[seedtype]
S.harvest(loc,0,0,1)
spawn(1) if(src) qdel(src)
*/
/obj/plant_spawner/New()
addtimer(CALLBACK(src, /obj/plant_spawner/proc/spawn_growth), 2)

/obj/plant_spawner/proc/spawn_growth()
var/datum/seed/S = plant_controller.seeds[seedtype]
S.harvest(loc,force_amount = 1, harvest_sample = FALSE)
spawn(5) if(src) qdel(src)

/obj/plant_spawner/libertycap
seedtype = "libertycap"

/obj/plant_spawner/ambrosiavulgaris
seedtype = "ambrosia"

/obj/plant_spawner/grass
seedtype = "grass"

/obj/plant_spawner/wheat
seedtype = "wheat"

/obj/plant_spawner/poppy
seedtype = "poppies"

/obj/plant_spawner/sunflower
seedtype = "sunflowers"

/obj/plant_spawner/harebells
seedtype = "harebells"

/obj/plant_spawner/towercaps
seedtype = "towercap"
if(!seed)
return FALSE
if(seed.get_trait(TRAIT_STINGS))
var/mob/living/carbon/human/H = user
if(istype(H) && H.gloves)
return ..()
if(!reagents || reagents.total_volume <= 0)
return ..()
reagents.remove_any(rand(1,3)) //Todo, make it actually remove the reagents the seed uses.
seed.do_thorns(H,src)
seed.do_sting(H,src,pick(BP_R_ARM, BP_L_ARM))
return ..()

/obj/item/reagent_containers/food/snacks/fruit_slice
name = "fruit slice"
Expand Down
74 changes: 73 additions & 1 deletion code/modules/hydroponics/grown_predefined.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,76 @@
plantname = "ambrosia"

/obj/item/reagent_containers/food/snacks/grown/ambrosiadeus
plantname = "ambrosiadeus"
plantname = "ambrosiadeus"

// Predefined types for placing on the map.
/obj/plant_spawner
name = "plant spawner"
var/seedtype = "ambrosia" //default to ambrosia for roach taming
var/spawn_growth_auto = TRUE

/obj/plant_spawner/non_auto_spawn
spawn_growth_auto = FALSE

/*
/obj/plant_spawner/Initialize(mapload)
var/datum/seed/S = plant_controller.seeds[seedtype]
S.harvest(loc,0,0,1)
spawn(1) if(src) qdel(src)
*/
/obj/plant_spawner/New()
if(spawn_growth_auto)
addtimer(CALLBACK(src, /obj/plant_spawner/proc/spawn_growth), 2)

/obj/plant_spawner/proc/spawn_growth()
var/datum/seed/S = plant_controller.seeds[seedtype]
S.harvest(loc,force_amount = 1, harvest_sample = FALSE)
spawn(5) if(src) qdel(src)

/obj/plant_spawner/libertycap
seedtype = "libertycap"

/obj/plant_spawner/ambrosiavulgaris
seedtype = "ambrosia"

/obj/plant_spawner/grass
seedtype = "grass"

/obj/plant_spawner/wheat
seedtype = "wheat"

/obj/plant_spawner/poppy
seedtype = "poppies"

/obj/plant_spawner/sunflower
seedtype = "sunflowers"

/obj/plant_spawner/harebells
seedtype = "harebells"

/obj/plant_spawner/towercaps
seedtype = "towercap"

/obj/plant_spawner/grapes
seedtype = "grapes"

/obj/plant_spawner/green_grapes
seedtype = "greengrapes"

/obj/plant_spawner/sugarcane
seedtype = "sugarcane"

/obj/plant_spawner/potato
seedtype = "potato"

/obj/plant_spawner/corn
seedtype = "corn"

/obj/plant_spawner/plumphelmet
seedtype = "plumphelmet"

/obj/plant_spawner/soybeans
seedtype = "soybean"

/obj/plant_spawner/pineapple
seedtype = "pineapple"
4 changes: 4 additions & 0 deletions code/modules/hydroponics/seed_datums.dm
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@
display_name = "tower caps"
chems = list("woodpulp" = list(10,1))
mutants = list("metalcap")
kitchen_tag = "towercap"

/datum/seed/mushroom/towercap/New()
..()
Expand Down Expand Up @@ -777,6 +778,7 @@
display_name = "harebells"
mutants = list("silverbells")
chems = list("nutriment" = list(1,20))
kitchen_tag = "harebell"

/datum/seed/flower/New()
..()
Expand Down Expand Up @@ -868,6 +870,7 @@
display_name = "green grapevines"
mutants = null
chems = list("nutriment" = list(1,10), "kelotane" = list(3,5), "grapejuice" = list(10,10))
kitchen_tag = "greengrape"

/datum/seed/grapes/green/New()
..()
Expand Down Expand Up @@ -1108,6 +1111,7 @@
seed_name = "sugarcane"
display_name = "sugarcanes"
chems = list("sugar" = list(4,5))
kitchen_tag = "sugarcane"

/datum/seed/sugarcane/New()
..()
Expand Down
10 changes: 9 additions & 1 deletion code/modules/reagents/reagent_containers/food/drinks/bottle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
desc = "A bottle of what looks like a beer but is a mix of sleeping agents, malt and hops."
icon_state = "beer"
center_of_mass = list("x"=16, "y"=12)
preloaded_reagents = list("beer" = 30)
preloaded_reagents = list("beer2" = 30)

/obj/item/reagent_containers/food/drinks/bottle/small/ale
name = "\improper Magm-Ale"
Expand All @@ -440,3 +440,11 @@
isGlass = 0
center_of_mass = list("x"=16, "y"=12)
preloaded_reagents = list("Kvass" = 30)

//glassess bottle
/obj/item/reagent_containers/food/drinks/bottle/small/brewing_bottle
name = "Flash Bottle"
desc = "A quickly printed bottle using a non-recycleable glass."
icon_state = "brew_bottle"
matter = null
isGlass = FALSE
Binary file modified icons/obj/drinks.dmi
Binary file not shown.
Binary file modified icons/obj/objects.dmi
Binary file not shown.
54 changes: 54 additions & 0 deletions modular_sojourn/bottler.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/obj/item/bottle_kit
name = "Bottling Kit"
desc = "A box that holds glasses fabricators, lables, caps and quarks ready for home brewing and bottling."
icon = 'icons/obj/objects.dmi'
icon_state = "bottler_box"
w_class = ITEM_SIZE_NORMAL
matter = list(MATTER_STEEL = 10, MATTER_GLASS = 10)
var/glass_colour = "brew_bottle"
var/fake_glass_name = "Kinda Blue"

/obj/item/bottle_kit/examine(mob/user)
..()
to_chat(user, "<span class='info'>Current Glass Bottle Printing Type: [fake_glass_name].</span>")


/obj/item/bottle_kit/attack_self(mob/user as mob)
..()
glass_picker(user)

/obj/item/bottle_kit/proc/glass_picker(mob/user as mob)
var/list/options = list()
options["Kinda Blue"] = "brew_bottle"
options["Redish"] = "brew_red_bottle"
options["Green-Adjcent"] = "brew_green_bottle"
options["Scuffed Platium"] = "brew_white_bottle"
options["Sorta Coal"] = "brew_coal_bottle"
options["Maybe Bronze"] = "brew_fancy_bottle"
options["Off-Amethyst"] = "brew_funky_bottle"
options["Odd Sky Shade"] = "brew_sky_bottle"
options["Washed Out Brass"] = "brew_saint_po_bottle"
options["Faded Caramel"] = "brew_gold_bottle"
options["Approximate Sea Shore"] = "brew_pianowoman_bottle"
options["Faded Dust"] = "brew_noir_bottle"
options["Close Honeycomb"] = "brew_bees_bottle"


if(!options.len)
to_chat(user, "<span class='info'>The bottle kit is limited to only normal blue bottles. Oh no!</span>")
glass_colour = "brew_bottle"
fake_glass_name = "Blue"
return

var/choice = input(user,"What colour do you pick?") as null|anything in options

var/printing_choice = options[choice]

if(!printing_choice)
glass_colour = "brew_bottle"
fake_glass_name = "Kinda Blue"
return

fake_glass_name = choice
glass_colour = printing_choice

Loading

0 comments on commit 9f88992

Please sign in to comment.