ReactionMixerComponent.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using Content.Shared.Chemistry.Components;
  2. using Content.Shared.DoAfter;
  3. using Robust.Shared.Prototypes;
  4. using Robust.Shared.Serialization;
  5. namespace Content.Shared.Chemistry.Reaction;
  6. [RegisterComponent]
  7. public sealed partial class ReactionMixerComponent : Component
  8. {
  9. /// <summary>
  10. /// A list of IDs for categories of reactions that can be mixed (i.e. HOLY for a bible, DRINK for a spoon)
  11. /// </summary>
  12. [ViewVariables]
  13. [DataField]
  14. public List<ProtoId<MixingCategoryPrototype>> ReactionTypes = default!;
  15. /// <summary>
  16. /// A string which identifies the string to be sent when successfully mixing a solution
  17. /// </summary>
  18. [ViewVariables]
  19. [DataField]
  20. public LocId MixMessage = "default-mixing-success";
  21. /// <summary>
  22. /// Defines if interacting is enough to mix with this component
  23. /// </summary>
  24. [ViewVariables]
  25. [DataField]
  26. public bool MixOnInteract = true;
  27. /// <summary>
  28. /// How long it takes to mix with this
  29. /// </summary>
  30. [ViewVariables]
  31. [DataField]
  32. public TimeSpan TimeToMix = TimeSpan.Zero;
  33. }
  34. [ByRefEvent]
  35. public record struct MixingAttemptEvent(EntityUid Mixed, bool Cancelled = false);
  36. public readonly record struct AfterMixingEvent(EntityUid Mixed, EntityUid Mixer);
  37. [Serializable, NetSerializable]
  38. public sealed partial class ReactionMixDoAfterEvent : SimpleDoAfterEvent
  39. {
  40. }