fish-station/Content.Shared/Dice/DiceComponent.cs
Sidzaru 1196b9e268
hyperDice & arrowRoulette (#3291)
Co-authored-by: Sidzaru <gruvlai@mail.ru>
2025-12-25 19:59:41 +03:00

52 lines
1.4 KiB
C#

using Robust.Shared.Audio;
using Robust.Shared.GameStates;
namespace Content.Shared.Dice;
[RegisterComponent, NetworkedComponent, Access(typeof(SharedDiceSystem))]
[AutoGenerateComponentState(true)]
public sealed partial class DiceComponent : Component
{
[DataField]
public SoundSpecifier Sound { get; private set; } = new SoundCollectionSpecifier("Dice");
/// <summary>
/// Multiplier for the value of a die. Applied after the <see cref="Offset"/>.
/// </summary>
[DataField]
public int Multiplier { get; private set; } = 1;
/// <summary>
/// Quantity that is subtracted from the value of a die. Can be used to make dice that start at "0". Applied
/// before the <see cref="Multiplier"/>
/// </summary>
[DataField]
public int Offset { get; private set; } = 0;
// Sunrise-Edit
[DataField]
[AutoNetworkedField]
public int Sides { get; set; } = 20;
// Sunrise-Edit-End
/// <summary>
/// The currently displayed value.
/// </summary>
[DataField]
[AutoNetworkedField]
public int CurrentValue { get; set; } = 20;
[DataField]
[AutoNetworkedField]
public int StartFromSide { get; set; } = 1;
public void SetSides(int startValue, int endValue)
{
StartFromSide = startValue;
Sides = endValue;
CurrentValue = endValue;
}
[DataField("IsNotStandardDice")]
public bool IsNotStandardDice = false;
}