Taislin 5 hónapja
szülő
commit
43c349a78f

+ 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";
 }

+ 58 - 2
Resources/Prototypes/Civ14/Entities/Structures/Machines/brewing.yml

@@ -27,6 +27,9 @@
       powerLoad: 0
     - type: Anchorable
       delay: 2
+    - type: Construction
+      graph: BrewingBarrel
+      node: end
 
 - type: entity
   parent: [ReagentPacketBase, ItemHeftyBase]
@@ -40,7 +43,60 @@
     - type: SolutionContainerManager
       solutions:
         food:
-          maxVol: 20
+          maxVol: 5
           reagents:
             - ReagentId: Yeast
-              Quantity: 20
+              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

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

@@ -12,3 +12,59 @@
       amount: 1
   products:
     Beer: 20
+
+- type: construction
+  name: brewing barrel
+  id: BrewingBarrel
+  graph: BrewingBarrel
+  startNode: start
+  targetNode: bedroll
+  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