2022-10-30 03:14:20 -04:00
|
|
|
using Content.Shared.Construction.Prototypes;
|
2020-05-04 13:54:54 -04:00
|
|
|
using Robust.Shared.Audio;
|
2021-03-01 15:24:46 -08:00
|
|
|
using Robust.Shared.Containers;
|
2022-08-27 19:40:29 -04:00
|
|
|
using Robust.Shared.Prototypes;
|
|
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
2020-04-26 15:44:20 -05:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Kitchen.Components
|
2020-04-26 15:44:20 -05:00
|
|
|
{
|
|
|
|
|
[RegisterComponent]
|
2022-08-27 19:40:29 -04:00
|
|
|
public sealed class MicrowaveComponent : Component
|
2020-04-26 15:44:20 -05:00
|
|
|
{
|
2022-10-30 03:14:20 -04:00
|
|
|
[DataField("cookTimeMultiplier"), ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public float CookTimeMultiplier = 1;
|
|
|
|
|
[DataField("machinePartCookTimeMultiplier", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
|
2023-04-28 23:23:49 -04:00
|
|
|
public string MachinePartCookTimeMultiplier = "Capacitor";
|
2022-10-30 03:14:20 -04:00
|
|
|
[DataField("cookTimeScalingConstant")]
|
|
|
|
|
public float CookTimeScalingConstant = 0.5f;
|
|
|
|
|
|
2022-08-27 19:40:29 -04:00
|
|
|
[DataField("failureResult", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
|
|
|
|
public string BadRecipeEntityId = "FoodBadRecipe";
|
|
|
|
|
|
|
|
|
|
#region audio
|
|
|
|
|
[DataField("beginCookingSound")]
|
|
|
|
|
public SoundSpecifier StartCookingSound = new SoundPathSpecifier("/Audio/Machines/microwave_start_beep.ogg");
|
|
|
|
|
[DataField("foodDoneSound")]
|
|
|
|
|
public SoundSpecifier FoodDoneSound = new SoundPathSpecifier("/Audio/Machines/microwave_done_beep.ogg");
|
2021-07-10 17:35:33 +02:00
|
|
|
[DataField("clickSound")]
|
2022-08-27 19:40:29 -04:00
|
|
|
public SoundSpecifier ClickSound = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");
|
|
|
|
|
[DataField("ItemBreakSound")]
|
2022-02-12 17:53:54 -07:00
|
|
|
public SoundSpecifier ItemBreakSound = new SoundPathSpecifier("/Audio/Effects/clang.ogg");
|
|
|
|
|
|
2022-08-27 19:40:29 -04:00
|
|
|
public IPlayingAudioStream? PlayingStream { get; set; }
|
|
|
|
|
[DataField("loopingSound")]
|
|
|
|
|
public SoundSpecifier LoopingSound = new SoundPathSpecifier("/Audio/Machines/microwave_loop.ogg");
|
|
|
|
|
#endregion
|
2020-05-03 23:58:29 -05:00
|
|
|
|
2022-08-27 19:40:29 -04:00
|
|
|
[ViewVariables]
|
2022-04-15 17:20:20 -04:00
|
|
|
public bool Broken;
|
2020-05-01 17:19:04 -05:00
|
|
|
|
2020-05-03 23:58:29 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// This is a fixed offset of 5.
|
|
|
|
|
/// The cook times for all recipes should be divisible by 5,with a minimum of 1 second.
|
|
|
|
|
/// For right now, I don't think any recipe cook time should be greater than 60 seconds.
|
|
|
|
|
/// </summary>
|
2022-08-27 19:40:29 -04:00
|
|
|
[DataField("currentCookTimerTime"), ViewVariables(VVAccess.ReadWrite)]
|
2023-06-07 19:44:42 +00:00
|
|
|
public uint CurrentCookTimerTime = 0;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The maximum number of seconds a microwave can be set to.
|
|
|
|
|
/// This is currently only used for validation and the client does not check this.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("maxCookTime"), ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public uint MaxCookTime = 30;
|
2020-05-03 23:58:29 -05:00
|
|
|
|
2022-02-12 17:53:54 -07:00
|
|
|
/// <summary>
|
|
|
|
|
/// The max temperature that this microwave can heat objects to.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("temperatureUpperThreshold")]
|
|
|
|
|
public float TemperatureUpperThreshold = 373.15f;
|
|
|
|
|
|
2022-08-27 19:40:29 -04:00
|
|
|
public int CurrentCookTimeButtonIndex;
|
2020-05-01 03:37:21 -05:00
|
|
|
|
2022-04-15 17:20:20 -04:00
|
|
|
public Container Storage = default!;
|
2020-04-26 15:44:20 -05:00
|
|
|
}
|
2022-02-12 17:53:54 -07:00
|
|
|
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class BeingMicrowavedEvent : HandledEntityEventArgs
|
2022-02-12 17:53:54 -07:00
|
|
|
{
|
|
|
|
|
public EntityUid Microwave;
|
2023-02-10 17:45:38 -06:00
|
|
|
public EntityUid? User;
|
2022-02-12 17:53:54 -07:00
|
|
|
|
2023-02-10 17:45:38 -06:00
|
|
|
public BeingMicrowavedEvent(EntityUid microwave, EntityUid? user)
|
2022-02-12 17:53:54 -07:00
|
|
|
{
|
|
|
|
|
Microwave = microwave;
|
2023-02-10 17:45:38 -06:00
|
|
|
User = user;
|
2022-02-12 17:53:54 -07:00
|
|
|
}
|
|
|
|
|
}
|
2020-04-26 15:44:20 -05:00
|
|
|
}
|