]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
[Tweak] Adjusted cake sizes (#15382)
authorHunter Sagerer <hsagerer@umich.edu>
Sat, 15 Apr 2023 22:40:51 +0000 (18:40 -0400)
committerGitHub <noreply@github.com>
Sat, 15 Apr 2023 22:40:51 +0000 (16:40 -0600)
Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs
Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/cake.yml

index 2e7b037d335c190cc5f248c9fd31345e36c2cd36..3825d780454bda6cdde39ee190cdbd4116538f8e 100644 (file)
@@ -6,6 +6,7 @@ using Content.Shared.Examine;
 using Content.Shared.FixedPoint;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
+using Content.Shared.Item;
 using Robust.Shared.Audio;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
@@ -78,7 +79,15 @@ namespace Content.Server.Nutrition.EntitySystems
             SoundSystem.Play(component.Sound.GetSound(), Filter.Pvs(uid),
                 transform.Coordinates, AudioParams.Default.WithVolume(-2));
 
+            // Decrease size of item based on count - Could implement in the future
+            // Bug with this currently is the size in a container is not updated
+            // if (TryComp(uid, out ItemComponent? itemComp) && TryComp(sliceUid, out ItemComponent? sliceComp))
+            // {
+            //     itemComp.Size -= sliceComp.Size;
+            // }
+
             component.Count--;
+
             // If someone makes food proto with 1 slice...
             if (component.Count < 1)
             {
index 47067b654db0c8fff89c0056ea3486791a466c28..96bc3d85b9cf3ac35eb06146a7946896ba666d13 100644 (file)
@@ -22,6 +22,8 @@
           Quantity: 20
         - ReagentId: Vitamin
           Quantity: 5
+  - type: Item
+    size: 25
 
 - type: entity
   parent: FoodCakeBase
@@ -43,6 +45,8 @@
           Quantity: 4
         - ReagentId: Vitamin
           Quantity: 1
+  - type: Item
+    size: 5
 
 # Custom Cake Example
 
@@ -90,6 +94,8 @@
   - type: SliceableFood
     slice: FoodCakePlainSlice
 
+# Added in type lines above
+
 - type: entity
   name: slice of cake
   parent: FoodCakeSliceBase