Files
tbd-station-14/Content.Shared/Damage/ForceSay/DamageForceSayComponent.cs
Coolsurf6 012c835559 Added Pain Numbness Trait (#34538)
* added pain-numbness component and system

* added numb as a trait that pulls the pain numbness component

* removed new event as mob threshold event as already being fired

* checked for MobThresholdsComponent first before running VerifyThresholds

* refacted force say to using LocalizedDatasetPrototype and added numb messages

* added severity check alert

* added comment for BeforeForceSayEvent

* removed space formatting

* changed Cancelled to CancelUpdate, fixed spacing and added two more damage-force-say-numb

* changed prefix damage-force-say-numb to 5 (whoops)
2025-01-27 11:34:20 +01:00

60 lines
2.0 KiB
C#

using Content.Shared.Damage.Prototypes;
using Content.Shared.Dataset;
using Content.Shared.FixedPoint;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.Damage.ForceSay;
/// <summary>
/// This is used for forcing clients to send messages with a suffix attached (like -GLORF) when taking large amounts
/// of damage, or things like entering crit or being stunned.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class DamageForceSayComponent : Component
{
/// <summary>
/// The localization string that the message & suffix will be passed into
/// </summary>
[DataField]
public LocId ForceSayMessageWrap = "damage-force-say-message-wrap";
/// <summary>
/// Same as <see cref="ForceSayMessageWrap"/> but for cases where no suffix is used,
/// such as when going into crit.
/// </summary>
[DataField]
public LocId ForceSayMessageWrapNoSuffix = "damage-force-say-message-wrap-no-suffix";
/// <summary>
/// The fluent string prefix to use when picking a random suffix
/// </summary>
[DataField]
public ProtoId<LocalizedDatasetPrototype> ForceSayStringDataset = "ForceSayStringDataset";
/// <summary>
/// The amount of total damage between <see cref="ValidDamageGroups"/> that needs to be taken before
/// a force say occurs.
/// </summary>
[DataField]
public FixedPoint2 DamageThreshold = FixedPoint2.New(5);
/// <summary>
/// A list of damage group types that are considered when checking <see cref="DamageThreshold"/>.
/// </summary>
[DataField]
public HashSet<ProtoId<DamageGroupPrototype>>? ValidDamageGroups = new()
{
"Brute",
"Burn",
};
/// <summary>
/// The time enforced between force says to avoid spam.
/// </summary>
[DataField]
public TimeSpan Cooldown = TimeSpan.FromSeconds(5.0);
public TimeSpan? NextAllowedTime = null;
}