DamagedSiliconAccentComponent.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using Content.Shared.FixedPoint;
  2. using Robust.Shared.GameStates;
  3. namespace Content.Shared.Speech.Components;
  4. [RegisterComponent]
  5. [NetworkedComponent]
  6. public sealed partial class DamagedSiliconAccentComponent : Component
  7. {
  8. /// <summary>
  9. /// Enable damage corruption effects
  10. /// </summary>
  11. [DataField]
  12. public bool EnableDamageCorruption = true;
  13. /// <summary>
  14. /// Override total damage for damage corruption effects
  15. /// </summary>
  16. [DataField]
  17. public FixedPoint2? OverrideTotalDamage;
  18. /// <summary>
  19. /// The probability that a character will be corrupted when total damage at or above <see cref="MaxDamageCorruption" />.
  20. /// </summary>
  21. [DataField]
  22. public float MaxDamageCorruption = 0.5f;
  23. /// <summary>
  24. /// Probability of character corruption will increase linearly to <see cref="MaxDamageCorruption" /> once until
  25. /// total damage is at or above this value.
  26. /// </summary>
  27. [DataField]
  28. public FixedPoint2 DamageAtMaxCorruption = 300;
  29. /// <summary>
  30. /// Enable charge level corruption effects
  31. /// </summary>
  32. [DataField]
  33. public bool EnableChargeCorruption = true;
  34. /// <summary>
  35. /// Override charge level for charge level corruption effects
  36. /// </summary>
  37. [DataField]
  38. public float? OverrideChargeLevel;
  39. /// <summary>
  40. /// If the power cell charge is below this value (as a fraction of maximum charge),
  41. /// power corruption will begin to be applied.
  42. /// </summary>
  43. [DataField]
  44. public float ChargeThresholdForPowerCorruption = 0.15f;
  45. /// <summary>
  46. /// Regardless of charge level, this is how many characters at the start of a message will be 100% safe
  47. /// from being dropped.
  48. /// </summary>
  49. [DataField]
  50. public int StartPowerCorruptionAtCharIdx = 8;
  51. /// <summary>
  52. /// The probability that a character will be dropped due to charge level will be maximum for characters past
  53. /// this index. This has the effect of longer messages dropping more characters later in the message.
  54. /// </summary>
  55. [DataField]
  56. public int MaxPowerCorruptionAtCharIdx = 40;
  57. /// <summary>
  58. /// The maximum probability that a character will be dropped due to charge level.
  59. /// </summary>
  60. [DataField]
  61. public float MaxDropProbFromPower = 0.5f;
  62. /// <summary>
  63. /// If a character is "dropped", this is the probability that the character will be turned into a period instead
  64. /// of completely deleting the character.
  65. /// </summary>
  66. [DataField]
  67. public float ProbToCorruptDotFromPower = 0.6f;
  68. }