using Content.Shared._NF.Research.Prototypes;
using Content.Shared.Construction.Prototypes;
using Content.Shared.Materials;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared._NF.Lathe;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class BlueprintLatheComponent : Component
{
///
/// The lathe's construction queue
///
[DataField]
public List Queue = new();
///
/// The sound that plays when the lathe is producing an item, if any
///
[DataField]
public SoundSpecifier? ProducingSound;
///
/// The default amount that's displayed in the UI for selecting the print amount.
///
[DataField, AutoNetworkedField]
public int DefaultProductionAmount = 1;
///
/// The materials required to make an individual blueprint
///
[DataField(required: true)]
public Dictionary, int> BlueprintPrintMaterials = new();
///
/// The time required to print an individual blueprint
///
[DataField(required: true)]
public TimeSpan BlueprintPrintTime;
///
/// If true, blueprints will receive a discount based on the quality of the components in the machine.
///
[ViewVariables]
public bool ApplyMaterialDiscount;
#region Visualizer info
[DataField]
public string? IdleState;
[DataField]
public string? RunningState;
[DataField]
public string? UnlitIdleState;
[DataField]
public string? UnlitRunningState;
#endregion
///
/// The blueprint type the lathe is currently producing.
///
[ViewVariables]
public ProtoId? CurrentBlueprintType;
///
/// The recipe types the blueprint the lathe is currently producing.
///
[ViewVariables]
public int[]? CurrentRecipeSets;
#region MachineUpgrading
///
/// A modifier that changes how long it takes to print a recipe
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float TimeMultiplier = 1;
///
/// A modifier that changes how much of a material is needed to print a recipe
///
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public float MaterialUseMultiplier = 1;
///
/// A modifier that changes how long it takes to print a recipe
///
[DataField, ViewVariables(VVAccess.ReadOnly), AutoNetworkedField]
public float FinalTimeMultiplier = 1;
///
/// A modifier that changes how much of a material is needed to print a recipe
///
[DataField, ViewVariables(VVAccess.ReadOnly), AutoNetworkedField]
public float FinalMaterialUseMultiplier = 1;
public const float DefaultPartRatingMaterialUseMultiplier = 0.85f;
///
/// The machine part that reduces how long it takes to print a recipe.
///
[DataField]
public ProtoId MachinePartPrintSpeed = "Manipulator";
///
/// The value that is used to calculate the modified
///
[DataField]
public float PartRatingPrintTimeMultiplier = 0.5f;
///
/// The machine part that reduces how much material it takes to print a recipe.
///
[DataField]
public ProtoId MachinePartMaterialUse = "MatterBin";
///
/// The value that is used to calculate the modifier
///
[DataField]
public float PartRatingMaterialUseMultiplier = DefaultPartRatingMaterialUseMultiplier;
#endregion
}
[Serializable]
public sealed partial class BlueprintLatheRecipeBatch : EntityEventArgs
{
public ProtoId BlueprintType;
public int[] Recipes;
public int ItemsPrinted;
public int ItemsRequested;
public BlueprintLatheRecipeBatch(ProtoId blueprintType, int[] recipes, int itemsPrinted, int itemsRequested)
{
BlueprintType = blueprintType;
Recipes = recipes;
ItemsPrinted = itemsPrinted;
ItemsRequested = itemsRequested;
}
}
public sealed class BlueprintLatheGetRecipesEvent : EntityEventArgs
{
public readonly EntityUid Lathe;
public Dictionary, int[]> UnlockedRecipes = new();
public BlueprintLatheGetRecipesEvent(EntityUid lathe)
{
Lathe = lathe;
}
}