1
0

DiceComponent.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using Robust.Shared.Audio;
  2. using Robust.Shared.GameStates;
  3. namespace Content.Shared.Dice;
  4. [RegisterComponent, NetworkedComponent, Access(typeof(SharedDiceSystem))]
  5. [AutoGenerateComponentState(true)]
  6. public sealed partial class DiceComponent : Component
  7. {
  8. [DataField]
  9. public SoundSpecifier Sound { get; private set; } = new SoundCollectionSpecifier("Dice");
  10. /// <summary>
  11. /// Multiplier for the value of a die. Applied after the <see cref="Offset"/>.
  12. /// </summary>
  13. [DataField]
  14. public int Multiplier { get; private set; } = 1;
  15. /// <summary>
  16. /// Quantity that is subtracted from the value of a die. Can be used to make dice that start at "0". Applied
  17. /// before the <see cref="Multiplier"/>
  18. /// </summary>
  19. [DataField]
  20. public int Offset { get; private set; } = 0;
  21. [DataField]
  22. public int Sides { get; private set; } = 20;
  23. /// <summary>
  24. /// The currently displayed value.
  25. /// </summary>
  26. [DataField]
  27. [AutoNetworkedField]
  28. public int CurrentValue { get; set; } = 20;
  29. }