Browse Source

Brewing Basics (#243)

* brewing basics

* yeast system

* yaml typo

* Update Resources/Prototypes/Civ14/Recipes/Chemical/brewing.yml

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update brewing.yml

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Taislin 5 months ago
parent
commit
1a5d979fb5

+ 8 - 8
Content.Server/Civ14/Composting/CompostingSystem.cs

@@ -39,7 +39,7 @@ private void OnInteractUsing(EntityUid uid, CompostingComponent component, Inter
         var item = args.Used;
         if (!IsCompostable(item, component))
         {
-            _popup.PopupEntity("This item cannot be composted.", uid, args.User);
+            _popup.PopupEntity($"This item cannot be used to make {component.OutputName}.", uid, args.User);
             return;
         }
 
@@ -54,7 +54,7 @@ private void OnInteractUsing(EntityUid uid, CompostingComponent component, Inter
         // Add item to composting process and delete it from the world
         component.CompostingItems[item] = _gameTiming.CurTime + TimeSpan.FromMinutes(component.CompostTime);
         QueueDel(item);
-        _popup.PopupEntity("You add the item to compost.", uid, args.User);
+        _popup.PopupEntity("You add the item.", uid, args.User);
         args.Handled = true;
     }
 
@@ -77,11 +77,11 @@ private void OnInteractHand(EntityUid uid, CompostingComponent component, Intera
             return;
 
         // Spawn compost and try to place it in the player's hand
-        var compost = Spawn("Compost", Transform(uid).MapPosition);
+        var compost = Spawn(component.OutputPrototype, Transform(uid).MapPosition);
         if (_hands.TryPickupAnyHand(args.User, compost))
         {
             component.ReadyCompost--;
-            _popup.PopupEntity("You collect a unit of compost.", uid, args.User);
+            _popup.PopupEntity($"You collect a unit of {component.OutputName}.", uid, args.User);
         }
         else
         {
@@ -141,12 +141,12 @@ private void OnExamined(EntityUid uid, CompostingComponent component, ExaminedEv
 
         if (compostingCount > 0)
         {
-            args.PushMarkup($"Its currently composting.");
+            args.PushMarkup($"Its currently processing.");
         }
 
         if (readyCompost > 0)
         {
-            args.PushMarkup($"There are {readyCompost} units of compost ready.");
+            args.PushMarkup($"There are {readyCompost} units of {component.OutputName} ready.");
         }
     }
 
@@ -155,7 +155,7 @@ private void OnDestroyed(EntityUid uid, CompostingComponent component, Destructi
         // Drops all ready compost
         for (int i = 0; i < component.ReadyCompost; i++)
         {
-            Spawn("Compost", Transform(uid).MapPosition);
+            Spawn(component.OutputPrototype, Transform(uid).MapPosition);
         }
     }
-}
+}

+ 12 - 0
Content.Shared/Civ14/Composting/CompostingComponent.cs

@@ -38,4 +38,16 @@ public sealed partial class CompostingComponent : Component
     /// </summary>
     [DataField("maxCapacity")]
     public int MaxCapacity = 10;
+
+    /// <summary>
+    /// What actually is generated to output.
+    /// </summary>
+    [DataField("outputPrototype")]
+    public string OutputPrototype = "Compost";
+
+    /// <summary>
+    /// What the output is called when interacting.
+    /// </summary>
+    [DataField("outputName")]
+    public string OutputName = "compost";
 }

+ 3 - 0
Resources/Locale/en-US/chemistry/components/mixing-component.ftl

@@ -9,6 +9,9 @@ mixing-verb-holy = bless
 mixing-verb-stir = stir
 mixing-verb-shake = shake
 
+mixing-verb-distillation = distill
+mixing-verb-fermentation = ferment
+
 ## Entity
 
 default-mixing-success = You mix the {$mixed} with the {$mixer}

+ 3 - 0
Resources/Locale/en-US/reagents/meta/biological.ftl

@@ -30,3 +30,6 @@ reagent-desc-vomit = You can see a few chunks of someone's last meal in it.
 
 reagent-name-grey-matter = grey matter
 reagent-desc-grey-matter = Thought juice, the stuff that leaks out of your ears.
+
+reagent-name-yeast = yeast
+reagent-desc-yeast = A single celled fungus that can be used to make alcohol.

File diff suppressed because it is too large
+ 1 - 1
Resources/Maps/civ/nomads_classic.yml


+ 15 - 0
Resources/Prototypes/Chemistry/mixing_types.yml

@@ -65,3 +65,18 @@
   icon:
     sprite: Objects/Misc/utensils.rsi
     state: spoon
+
+# Civ brewing
+- type: mixingCategory
+  id: Fermentation
+  verbText: mixing-verb-fermentation
+  icon:
+    sprite: Civ14/Objects/barrel.rsi
+    state: beer_barrel
+
+- type: mixingCategory
+  id: Distillation
+  verbText: mixing-verb-distillation
+  icon:
+    sprite: Civ14/Objects/structures.rsi
+    state: distillery

+ 102 - 0
Resources/Prototypes/Civ14/Entities/Structures/Machines/brewing.yml

@@ -0,0 +1,102 @@
+- type: entity
+  id: BrewingBarrel
+  parent: BaseTabletopChemicalMachine
+  name: fermentation barrel
+  description: A large wooden barrel for brewing fermentable drinks.
+  components:
+    - type: SolutionContainerMixer
+      mixDuration: 80
+      mixingSound:
+        path: /Audio/Effects/Chemistry/bubbles.ogg
+        params:
+          volume: -4
+    - type: ReactionMixer
+      reactionTypes:
+        - Fermentation
+    - type: Sprite
+      sprite: Civ14/Objects/barrel.rsi
+      state: beer_barrel
+    - type: ItemSlots
+      slots:
+        mixer:
+          whitelist:
+            tags:
+              - FermentationCompatible
+    - type: ApcPowerReceiver
+      needsPower: false
+      powerLoad: 0
+    - type: Anchorable
+      delay: 2
+    - type: Construction
+      graph: BrewingBarrel
+      node: end
+
+- type: entity
+  parent: [ReagentPacketBase, ItemHeftyBase]
+  id: ReagentContainerYeast
+  name: yeast
+  description: A clump of yeast. Good for making beer!
+  components:
+    - type: Sprite
+      sprite: Civ14/Objects/food/food.rsi
+      state: enzyme
+    - type: SolutionContainerManager
+      solutions:
+        food:
+          maxVol: 5
+          reagents:
+            - ReagentId: Yeast
+              Quantity: 5
+
+- type: entity
+  id: StarterJar
+  parent: BaseStructure
+  name: "fermentation starter jar"
+  description: A crude jar used to make yeast.
+  components:
+    - type: Sprite
+      sprite: Civ14/Objects/drinks.rsi
+      state: jarF
+    - type: Appearance
+    - type: Damageable
+      damageModifierSet: Wood
+      damageContainer: StructuralInorganic
+    - type: Destructible
+      thresholds:
+        - trigger: !type:DamageTrigger
+            damage: 30
+          behaviors:
+            - !type:PlaySoundBehavior
+              sound:
+                collection: WoodDestroyHeavy
+            - !type:SpawnEntitiesBehavior
+              spawn:
+                MaterialWoodPlank:
+                  min: 2
+                  max: 3
+            - !type:DoActsBehavior
+              acts: ["Destruction"]
+    - type: Tag
+      tags:
+        - Structure
+        - Wooden
+    - type: Transform
+      anchored: true
+    - type: Physics
+      bodyType: Static
+    - type: Anchorable
+    - type: Pullable
+    - type: InteractionOutline
+    - type: Composting
+      whitelist:
+        - Fruit
+        - Bread
+        - Wheat
+      compostTime: 10.0
+      outputName: "yeast"
+      outputPrototype: "ReagentContainerYeast"
+    - type: Construction
+      agemin: 0
+      agemax: 8
+      graph: StarterJar
+      node: end

+ 70 - 0
Resources/Prototypes/Civ14/Recipes/Chemical/brewing.yml

@@ -0,0 +1,70 @@
+- type: reaction
+  id: BrewingBeer
+  source: true
+  requiredMixerCategories:
+    - Fermentation
+  reactants:
+    Water:
+      amount: 20
+    Flour:
+      amount: 10
+    Yeast:
+      amount: 1
+  products:
+    Beer: 20
+
+- type: construction
+  name: brewing barrel
+  id: BrewingBarrel
+  graph: BrewingBarrel
+  startNode: start
+  targetNode: end
+  category: construction-category-production
+  description: A large wooden barrel for brewing fermentable drinks.
+  icon: { sprite: Civ14/Objects/barrel.rsi, state: beer_barrel }
+  objectType: Item
+  agemin: 0
+  agemax: 8
+
+- type: constructionGraph
+  id: BrewingBarrel
+  start: start
+  graph:
+    - node: start
+      edges:
+        - to: end
+          steps:
+            - material: WoodPlank
+              amount: 12
+              doAfter: 10
+    - node: end
+      entity: BrewingBarrel
+
+- type: construction
+  name: fermentation starter jar
+  id: StarterJar
+  graph: StarterJar
+  startNode: start
+  targetNode: end
+  category: construction-category-production
+  description: A crude jar used to make yeast.
+  icon: { sprite: Civ14/Objects/drinks.rsi, state: jarF }
+  objectType: Structure
+  agemin: 0
+  agemax: 8
+
+- type: constructionGraph
+  id: StarterJar
+  start: start
+  graph:
+    - node: start
+      edges:
+        - to: end
+          completed:
+            - !type:SnapToGrid
+          steps:
+            - material: WoodPlank
+              amount: 3
+              doAfter: 6
+    - node: end
+      entity: StarterJar

+ 14 - 0
Resources/Prototypes/Civ14/Recipes/Chemical/reagents.yml

@@ -0,0 +1,14 @@
+- type: reagent
+  id: Yeast
+  name: reagent-name-yeast
+  group: Foods
+  desc: reagent-desc-yeast
+  physicalDesc: reagent-physical-desc-powdery
+  flavor: chalky
+  color: tan
+  metabolisms:
+    Food:
+      effects:
+        - !type:AdjustReagent
+          reagent: Nutriment
+          amount: 0.1

+ 1 - 0
Resources/Prototypes/Entities/Objects/Tools/bucket.yml

@@ -68,6 +68,7 @@
     - type: Tag
       tags:
         - Bucket
+        - FermentationCompatible
     - type: PhysicalComposition
       materialComposition:
         Plastic: 50

+ 3 - 0
Resources/Prototypes/tags.yml

@@ -304,6 +304,9 @@
 - type: Tag
   id: CentrifugeCompatible
 
+- type: Tag
+  id: FermentationCompatible
+
 - type: Tag
   id: Chicken
 

Some files were not shown because too many files changed in this diff