ParrotAccentComponent.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. namespace Content.Server.Speech.Components;
  2. /// <summary>
  3. /// Makes this entity speak like a parrot in all chat messages it sends.
  4. /// </summary>
  5. [RegisterComponent]
  6. public sealed partial class ParrotAccentComponent : Component
  7. {
  8. /// <summary>
  9. /// Chance that a message will have a squawk sound added before the first character.
  10. /// If it fails, the message with have a squawk as a postfix instead.
  11. /// If the longest word is repeated, no pre- or postfix will be added.
  12. /// </summary>
  13. [DataField]
  14. public float SquawkPrefixChance = 0.5f;
  15. /// <summary>
  16. /// Chance that the longest word in the message will be repeated as an
  17. /// exclamation at the end of the final message.
  18. /// </summary>
  19. [DataField]
  20. public float LongestWordRepeatChance = 0.5f;
  21. /// <summary>
  22. /// The longest word must be at least this many characters long to be
  23. /// repeated. This prevents repeating short words, which can sound weird.
  24. /// ex: "How are you? AWWK! How!" - bad
  25. /// ex: "Look out, it's the captain! RAWWK! Captain!" - good
  26. /// </summary>
  27. [DataField]
  28. public float LongestWordMinLength = 5;
  29. /// <summary>
  30. /// Strings to use as squawking noises.
  31. /// </summary>
  32. public readonly string[] Squawks = [
  33. "accent-parrot-squawk-1",
  34. "accent-parrot-squawk-2",
  35. "accent-parrot-squawk-3",
  36. "accent-parrot-squawk-4",
  37. "accent-parrot-squawk-5",
  38. "accent-parrot-squawk-6",
  39. "accent-parrot-squawk-7",
  40. "accent-parrot-squawk-8"
  41. ];
  42. }