using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Construction.Prototypes;
using Content.Shared.EntityEffects;
using Content.Shared.FixedPoint;
using Content.Shared.Nutrition;
using Content.Shared.Nyanotrasen.Kitchen;
using Content.Shared.Nyanotrasen.Kitchen.Components;
using Content.Shared.Whitelist;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Nyanotrasen.Kitchen.Components;
// TODO: move to shared and get rid of SharedDeepFryerComponent
[RegisterComponent, Access(typeof(SharedDeepfryerSystem))]
public sealed partial class DeepFryerComponent : SharedDeepFryerComponent
{
// There are three levels to how the deep fryer treats entities.
//
// 1. An entity can be rejected by the blacklist and be untouched by
// anything other than heat damage.
//
// 2. An entity can be deep-fried but not turned into an edible. The
// change will be mostly cosmetic. Any entity that does not match
// the blacklist will fall into this category.
//
// 3. An entity can be deep-fried and turned into something edible. The
// change will permit the item to be permanently destroyed by eating
// it.
///
/// When will the deep fryer layer on the next stage of crispiness?
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
public TimeSpan NextFryTime;
///
/// How much waste needs to be added at the next update interval?
///
[DataField]
public FixedPoint2 WasteToAdd = FixedPoint2.Zero;
///
/// How often are items in the deep fryer fried?
///
[DataField]
public TimeSpan FryInterval = TimeSpan.FromSeconds(5);
///
/// What entities cannot be deep-fried no matter what?
///
[DataField]
public EntityWhitelist? Blacklist;
///
/// What entities can be deep-fried into being edible?
///
[DataField]
public EntityWhitelist? Whitelist;
///
/// What are over-cooked and burned entities turned into?
///
///
/// To prevent unwanted destruction of items, only food can be turned
/// into this.
///
[DataField]
public EntProtoId? CharredPrototype;
///
/// What reagents are considered valid cooking oils?
///
[DataField]
public HashSet> FryingOils = new();
///
/// What reagents are added to tasty deep-fried food?
///
[DataField]
public List GoodReagents = new();
///
/// What reagents are added to terrible deep-fried food?
///
[DataField]
public List BadReagents = new();
///
/// What reagents replace every 1 unit of oil spent on frying?
///
[DataField]
public List WasteReagents = new();
///
/// What flavors go well with deep frying?
///
[DataField]
public HashSet> GoodFlavors = new();
///
/// What flavors don't go well with deep frying?
///
[DataField]
public HashSet> BadFlavors = new();
///
/// How much is the price coefficiency of a food changed for each good flavor?
///
[DataField]
public float GoodFlavorPriceBonus = 0.2f;
///
/// How much is the price coefficiency of a food changed for each bad flavor?
///
[DataField]
public float BadFlavorPriceMalus = -0.3f;
///
/// What is the name of the solution container for the fryer's oil?
///
[DataField]
public string SolutionName = "vat_oil";
// TODO: Entity
public Solution Solution = default!;
///
/// What is the name of the entity container for items inside the deep fryer?
///
[DataField("storage")]
public string StorageName = "vat_entities";
public BaseContainer Storage = default!;
///
/// How much solution should be imparted based on an item's size?
///
[DataField]
public FixedPoint2 SolutionSizeCoefficient = 1f;
///
/// What's the maximum amount of solution that should ever be imparted?
///
[DataField]
public FixedPoint2 SolutionSplitMax = 10f;
///
/// What percent of the fryer's solution has to be oil in order for it to fry?
///
///
/// The chef will have to clean it out occasionally, and if too much
/// non-oil reagents are added, the vat will have to be drained.
///
[DataField]
public FixedPoint2 FryingOilThreshold = 0.5f;
///
/// What is the bare minimum number of oil units to prevent the fryer
/// from unsafe operation?
///
[DataField]
public FixedPoint2 SafeOilVolume = 10f;
[DataField]
public List UnsafeOilVolumeEffects = new();
///
/// What is the temperature of the vat when the deep fryer is powered?
///
[DataField]
public float PoweredTemperature = 550.0f;
///
/// How many entities can this deep fryer hold?
///
[DataField]
public int StorageMaxEntities = 4;
///
/// What sound is played when an item is inserted into hot oil?
///
[DataField]
public SoundSpecifier SoundInsertItem = new SoundPathSpecifier("/Audio/Nyanotrasen/Machines/deepfryer_basket_add_item.ogg");
///
/// What sound is played when an item is removed?
///
[DataField]
public SoundSpecifier SoundRemoveItem = new SoundPathSpecifier("/Audio/Nyanotrasen/Machines/deepfryer_basket_remove_item.ogg");
}