Added all recipes

This commit is contained in:
Pasha Bibko
2026-04-28 11:05:02 +01:00
parent ba386f4c88
commit 5e7507058b
4 changed files with 128 additions and 26 deletions

View File

@@ -21,13 +21,60 @@ namespace Fruitomation.Game
} }
} }
private static Recipe[] Recipes = new Recipe[1] private static Recipe[] Recipes =
{ {
new new
( (
new[] { ItemType.Apple, ItemType.Grape }, new[]
ItemType.Banana {
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")] [Header("Mixer Specific")]

View File

@@ -13,15 +13,45 @@ namespace Fruitomation.Game
{ {
Trigger.SetAction(other => Trigger.SetAction(other =>
{ {
bool isItem = other.transform.parent.TryGetComponent(out ItemBehaviour item); bool isItem = other.transform.parent.TryGetComponent(out ItemBehaviour item1);
if (!isItem) if (!isItem)
{ {
return; return;
} }
item.transform.position = OutputLocation.position; ItemBehaviour item2 = null;
item.SendToTheGhostRealm();
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();
if (item2 is not null)
{
item2.transform.position = OutputLocation.position;
item2.SendToTheGhostRealm();
}
}, TriggerType.Enter); }, TriggerType.Enter);
} }
} }

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using Fruitomation.Game.Items; using Fruitomation.Game.Items;
using JetBrains.Annotations; using JetBrains.Annotations;
using UnityEngine.Scripting; using UnityEngine.Scripting;
@@ -74,26 +75,49 @@ namespace Fruitomation.Game
return; return;
} }
item.CurrentType = item.CurrentType switch switch (item.CurrentType)
{ {
ItemType.Apple => UpgradeManager.Is(BasicUpgrade.AppleSlices) case ItemType.Apple:
? ItemType.AppleSlices item.CurrentType = UpgradeManager.Is(BasicUpgrade.AppleJuice)
: ItemType.Apple, ? ItemType.AppleJuice
: ItemType.Apple;
break;
ItemType.Grape => UpgradeManager.Is(BasicUpgrade.GrapeJuice) case ItemType.Grape:
? ItemType.GrapeJuice item.CurrentType = UpgradeManager.Is(BasicUpgrade.GrapeJuice)
: ItemType.Grape, ? ItemType.GrapeJuice
: ItemType.Grape;
break;
ItemType.Kiwi => UpgradeManager.Is(BasicUpgrade.KiwiPresser) case ItemType.BananaSkin:
? ItemType.KiwiJuice item.CurrentType = UpgradeManager.Is(BasicUpgrade.BananaBacon)
: ItemType.Kiwi, ? ItemType.BananaBacon
: ItemType.BananaSkin;
break;
ItemType.PitayaSkin => UpgradeManager.Is(BasicUpgrade.PitayaFoodDye) case ItemType.Kiwi:
? ItemType.PitayaFoodDye item.CurrentType = UpgradeManager.Is(BasicUpgrade.KiwiPresser) // BYPRODUCT NEEDED
: ItemType.PitayaSkin, ? ItemType.KiwiJuice
: ItemType.Kiwi;
FruitSpawner.SpawnItem(ItemType.KiwiSeeds, transform.position);
break;
var _ => item.CurrentType // Default 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;
default:
item.CurrentType = item.CurrentType;
break;
}
} }
} }
} }

View File

@@ -59,6 +59,7 @@ namespace Fruitomation.Game.Items
AppleAndMangoJuice, AppleAndMangoJuice,
DriedFruitSelection, DriedFruitSelection,
ExoticFruitSelection,
SpicedBananaIceCream, SpicedBananaIceCream,
SpicedPitayaIceCream, SpicedPitayaIceCream,
} }