using Content.Shared._DV.Kitchen.Systems;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
using Content.Shared.Nutrition;
using Content.Shared.Whitelist;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared._DV.Kitchen.Components;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(SharedDeepFryerSystem))]
public sealed partial class DeepFryerComponent : Component
{
///
/// The of items that fit into the deep fryer
///
[DataField]
public EntityWhitelist Whitelist = new();
///
/// The of items that will never fit into the deep fryer, even if on the whitelist
///
[DataField]
public EntityWhitelist Blacklist = new();
///
/// The of cooking oil
///
[DataField]
public string Solution = "vat_oil";
///
/// The allowed reagents that will not cause a reaction when inserted
///
[DataField]
public List> FryingOils = new();
///
/// The container that holds items being fried
///
[DataField]
public string ContainerName = "fryer_basket";
///
/// Maximum number of items that can be in the fryer at once
///
[DataField]
public int MaxItems = 3;
///
/// Minimum amount of oil required to fry items (in units)
///
[DataField]
public FixedPoint2 MinimumOilVolume = 25;
///
/// Tracks cooking progress for each item in the fryer
/// Key: EntityUid of the item being fried
/// Value: CookingItem struct containing recipe and time
///
[DataField]
public Dictionary CookingItems = new();
///
/// The that will play once an item finishes cooking
///
[DataField]
public SoundSpecifier FinishedCookingSound = new SoundPathSpecifier("/Audio/Machines/Nuke/angry_beep.ogg");
///
/// The that will play once an item finishes burning
///
[DataField]
public SoundSpecifier FinishedBurningSound = new SoundPathSpecifier("/Audio/Effects/drop.ogg");
///
/// Current oil quality as a value from 0.0 (0%) to 1.0 (100%)
///
[DataField, AutoNetworkedField]
public float OilQuality = 1.0f;
///
/// How much the oil quality degrades per recipe cooked (as a percentage, e.g., 0.05 = 5%)
///
[DataField]
public float OilDegradationPerRecipe = 0.05f;
///
/// Degradation multiplier when at minimum oil volume (higher = faster degradation with less oil)
///
[DataField]
public float MinOilVolumeDegradationMultiplier = 4.0f;
///
/// How much quality is restored per unit of oil added (e.g., 0.01 = 1% quality per unit)
///
[DataField]
public float OilQualityRestorationPerUnit = 0.01f;
///
/// Chance (0.0 to 1.0) that BurnedResult will spawn when using Foul quality oil
///
[DataField]
public float FoulOilBurnChance = 0.3f;
///
/// Maps oil quality levels to the flavors that should be added to cooked items
///
[DataField]
public Dictionary>> OilQualityFlavors = new();
///
/// Time tolerance for multi-ingredient recipes (ingredients must be inserted within this window)
///
[DataField]
public TimeSpan CookingTolerance = TimeSpan.FromSeconds(5);
///
/// The time it will take for ingredients to start burning if not a part of any recipe
///
[DataField]
public TimeSpan BaseBurnTime = TimeSpan.FromSeconds(30);
///
/// The default result for when something burns
///
[DataField]
public EntProtoId BaseBurnedResult = "FoodBadRecipe";
///
/// Chance (0.0 to 1.0) that a thrown item will miss the fryer and land nearby instead.
/// Professional chefs always have a 0% miss chance regardless of this value.
///
///
[DataField]
public float MissChance = 0.25f;
///
/// Check for whether the cooking timer needs to be reset after powering down
///
[DataField]
public bool WasPreviouslyPowered = true;
}
///
/// Tracks an item being cooked in the deep fryer
///
[DataDefinition]
public partial record struct CookingItem
{
///
/// The deep fryer recipe being used to cook this item
///
[DataField]
public ProtoId? Recipe;
///
/// When this item started cooking or burning
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
public TimeSpan TimeStarted;
///
/// Whether this item has finished cooking and is now burning
///
[DataField]
public bool IsBurning;
public CookingItem(ProtoId? recipe, TimeSpan timeStarted, bool isBurning = false)
{
Recipe = recipe;
TimeStarted = timeStarted;
IsBurning = isBurning;
}
}
///
/// Represents the quality level of oil in the deep fryer
///
[Serializable, NetSerializable]
public enum OilQuality : byte
{
Pristine, // >= 90%
Clean, // >= 70%
Used, // >= 50%
Dirty, // >= 30%
Foul // >= 0%
}
[Serializable, NetSerializable]
public enum DeepFryerVisuals : byte
{
Bubbling
}