From 5e7507058b740ea2d7535115576d16931bbaeaae Mon Sep 17 00:00:00 2001 From: Pasha Bibko <156938226+PashaBibko@users.noreply.github.com> Date: Tue, 28 Apr 2026 11:05:02 +0100 Subject: [PATCH] Added all recipes --- .../Buildings/Automation/MixerBuilding.cs | 53 +++++++++++++++- .../Buildings/Automation/PeelerBuilding.cs | 38 ++++++++++-- .../Buildings/Automation/PresserBuilding.cs | 62 +++++++++++++------ .../Game/Items/SerializedItemInfoRegistry.cs | 1 + 4 files changed, 128 insertions(+), 26 deletions(-) diff --git a/Assets/Scripts/Game/Buildings/Automation/MixerBuilding.cs b/Assets/Scripts/Game/Buildings/Automation/MixerBuilding.cs index 023ec9f..e77f4e1 100644 --- a/Assets/Scripts/Game/Buildings/Automation/MixerBuilding.cs +++ b/Assets/Scripts/Game/Buildings/Automation/MixerBuilding.cs @@ -21,13 +21,60 @@ namespace Fruitomation.Game } } - private static Recipe[] Recipes = new Recipe[1] + private static Recipe[] Recipes = { new ( - new[] { ItemType.Apple, ItemType.Grape }, - ItemType.Banana + new[] + { + ItemType.DriedAppleSlices, + ItemType.Raisins, + ItemType.DriedBananaSlices + }, + ItemType.DriedFruitSelection ), + + new + ( + new[] + { + ItemType.AppleJuice, + ItemType.MangoJuice + }, + ItemType.AppleAndMangoJuice + ), + + new + ( + new[] + { + ItemType.BananaIceCream, + ItemType.DurainPowder + }, + ItemType.SpicedBananaIceCream + ), + + new + ( + new[] + { + ItemType.SlicedKiwi, + ItemType.MangoSlices, + ItemType.DurianSlices, + ItemType.BuddhasHandSlices + }, + ItemType.ExoticFruitSelection + ), + + new + ( + new[] + { + ItemType.PitayaIceCream, + ItemType.DurainPowder + }, + ItemType.SpicedPitayaIceCream + ) }; [Header("Mixer Specific")] diff --git a/Assets/Scripts/Game/Buildings/Automation/PeelerBuilding.cs b/Assets/Scripts/Game/Buildings/Automation/PeelerBuilding.cs index d501f0a..2768fad 100644 --- a/Assets/Scripts/Game/Buildings/Automation/PeelerBuilding.cs +++ b/Assets/Scripts/Game/Buildings/Automation/PeelerBuilding.cs @@ -13,15 +13,45 @@ namespace Fruitomation.Game { Trigger.SetAction(other => { - bool isItem = other.transform.parent.TryGetComponent(out ItemBehaviour item); + bool isItem = other.transform.parent.TryGetComponent(out ItemBehaviour item1); if (!isItem) { return; } + + ItemBehaviour item2 = null; + + switch (item1.CurrentType) + { + case ItemType.Banana: + if (UpgradeManager.Is(BasicUpgrade.BananaPeeler)) + { + item2 = FruitSpawner.SpawnItem(ItemType.BananaSkin); + item1.CurrentType = ItemType.MushedBanana; + } + break; + + case ItemType.Pitaya: + if (UpgradeManager.Is(BasicUpgrade.PitayaPeeler)) + { + item2 = FruitSpawner.SpawnItem(ItemType.PitayaSkin); + item1.CurrentType = ItemType.MushedPitaya; + } + break; + + case var _: + item1.CurrentType = item1.CurrentType; + break; + } + + item1.transform.position = OutputLocation.position; + item1.SendToTheGhostRealm(); - item.transform.position = OutputLocation.position; - item.SendToTheGhostRealm(); - + if (item2 is not null) + { + item2.transform.position = OutputLocation.position; + item2.SendToTheGhostRealm(); + } }, TriggerType.Enter); } } diff --git a/Assets/Scripts/Game/Buildings/Automation/PresserBuilding.cs b/Assets/Scripts/Game/Buildings/Automation/PresserBuilding.cs index b8bee25..bbbc2d7 100644 --- a/Assets/Scripts/Game/Buildings/Automation/PresserBuilding.cs +++ b/Assets/Scripts/Game/Buildings/Automation/PresserBuilding.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using Fruitomation.Game.Items; using JetBrains.Annotations; using UnityEngine.Scripting; @@ -74,26 +75,49 @@ namespace Fruitomation.Game return; } - item.CurrentType = item.CurrentType switch + switch (item.CurrentType) { - ItemType.Apple => UpgradeManager.Is(BasicUpgrade.AppleSlices) - ? ItemType.AppleSlices - : ItemType.Apple, + case ItemType.Apple: + item.CurrentType = UpgradeManager.Is(BasicUpgrade.AppleJuice) + ? ItemType.AppleJuice + : ItemType.Apple; + break; + + case ItemType.Grape: + item.CurrentType = UpgradeManager.Is(BasicUpgrade.GrapeJuice) + ? ItemType.GrapeJuice + : ItemType.Grape; + break; + + case ItemType.BananaSkin: + item.CurrentType = UpgradeManager.Is(BasicUpgrade.BananaBacon) + ? ItemType.BananaBacon + : ItemType.BananaSkin; + break; + + case ItemType.Kiwi: + item.CurrentType = UpgradeManager.Is(BasicUpgrade.KiwiPresser) // BYPRODUCT NEEDED + ? ItemType.KiwiJuice + : ItemType.Kiwi; + FruitSpawner.SpawnItem(ItemType.KiwiSeeds, transform.position); + break; + + case ItemType.Mango: + item.CurrentType = UpgradeManager.Is(BasicUpgrade.MangoJuice) + ? ItemType.MangoJuice + : ItemType.Mango; + break; + + case ItemType.PitayaSkin: + item.CurrentType = UpgradeManager.Is(BasicUpgrade.PitayaFoodDye) + ? ItemType.PitayaFoodDye + : ItemType.PitayaSkin; + break; - ItemType.Grape => UpgradeManager.Is(BasicUpgrade.GrapeJuice) - ? ItemType.GrapeJuice - : ItemType.Grape, - - ItemType.Kiwi => UpgradeManager.Is(BasicUpgrade.KiwiPresser) - ? ItemType.KiwiJuice - : ItemType.Kiwi, - - ItemType.PitayaSkin => UpgradeManager.Is(BasicUpgrade.PitayaFoodDye) - ? ItemType.PitayaFoodDye - : ItemType.PitayaSkin, - - var _ => item.CurrentType // Default - }; + default: + item.CurrentType = item.CurrentType; + break; + } } } } diff --git a/Assets/Scripts/Game/Items/SerializedItemInfoRegistry.cs b/Assets/Scripts/Game/Items/SerializedItemInfoRegistry.cs index 31ead0d..afffdf6 100644 --- a/Assets/Scripts/Game/Items/SerializedItemInfoRegistry.cs +++ b/Assets/Scripts/Game/Items/SerializedItemInfoRegistry.cs @@ -59,6 +59,7 @@ namespace Fruitomation.Game.Items AppleAndMangoJuice, DriedFruitSelection, + ExoticFruitSelection, SpicedBananaIceCream, SpicedPitayaIceCream, }