using Content.Shared.Damage.Prototypes;
using Content.Shared.Damage;
using Content.Shared.FixedPoint;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared._Offbrand.Wounds;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
[Access(typeof(WoundableSystem))]
public sealed partial class WoundComponent : Component
{
///
/// The amount of damage this wound represents
///
[DataField, AutoNetworkedField]
public Damages Damage = new();
///
/// The maximum amount of damage this wound can take
///
[DataField(required: true)]
public FixedPoint2 MaximumDamage;
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
[AutoNetworkedField]
public TimeSpan WoundedAt;
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
[AutoNetworkedField]
public TimeSpan CreatedAt;
}
[RegisterComponent, NetworkedComponent]
[Access(typeof(WoundableSystem))]
public sealed partial class WoundDescriptionComponent : Component
{
///
/// The description to use for this wound. Highest threshold used.
///
[DataField(required: true)]
public SortedDictionary Descriptions;
[DataField]
public LocId BleedingModifier = "wound-bleeding-modifier";
[DataField]
public LocId TendedModifier = "wound-tended-modifier";
}
[RegisterComponent, NetworkedComponent]
[Access(typeof(WoundableSystem), typeof(SharedWoundableHealthAnalyzerSystem))]
public sealed partial class AnalyzableWoundComponent : Component
{
///
/// The analyzer message to report for this wound. Highest threshold used.
///
[DataField(required: true)]
public SortedDictionary Descriptions;
}
[RegisterComponent, NetworkedComponent]
[Access(typeof(WoundableSystem))]
public sealed partial class PainfulWoundComponent : Component
{
///
/// Coefficients for damage to pain
///
[DataField(required: true)]
public Dictionary, FixedPoint2> PainCoefficients;
///
/// Coefficients for damage to initial pain
///
[DataField(required: true)]
public Dictionary, FixedPoint2> FreshPainCoefficients;
[DataField]
public double FreshPainDecreasePerSecond = 0.05d;
}
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(WoundableSystem))]
public sealed partial class HealableWoundComponent : Component
{
///
/// Whether or not the wound can heal
///
[DataField, AutoNetworkedField]
public bool CanHeal = true;
}
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(WoundableSystem))]
public sealed partial class TendableWoundComponent : Component
{
///
/// Whether or not the wound has been tended
///
[DataField, AutoNetworkedField]
public bool Tended;
}
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(WoundableSystem))]
public sealed partial class ClampableWoundComponent : Component
{
///
/// Whether or not the wound has been clamped
///
[DataField, AutoNetworkedField]
public bool Clamped;
}
[RegisterComponent, NetworkedComponent]
[Access(typeof(WoundableSystem))]
public sealed partial class BleedingWoundComponent : Component
{
///
/// Coefficient of damage type from this wound to bleeding rate
///
[DataField(required: true)]
public Dictionary, float> BleedingCoefficients;
///
/// Coefficient of damage type from this wound to bleeding duration
///
[DataField(required: true)]
public Dictionary, FixedPoint2> BleedingDurationCoefficients;
///
/// Wound must have at least this much damage to start bleeding
///
[DataField(required: true)]
public FixedPoint2 StartsBleedingAbove;
///
/// Wound must be tended before bleeding ends if it has this much damage
///
[DataField(required: true)]
public FixedPoint2 RequiresTendingAbove;
}
///
/// Raised on an entity to determine which of its wounds can take on the given damage
///
[ByRefEvent]
public record struct GetWoundsWithSpaceEvent(List Wounds, DamageSpecifier Damage);
///
/// Raised on an entity to attempt to heal its wounds with the given damage
///
[ByRefEvent]
public record struct HealWoundsEvent(DamageSpecifier Damage);
///
/// Raised on an entity to get the sum total of pain
///
[ByRefEvent]
public record struct GetPainEvent(FixedPoint2 Pain);
///
/// Raised on an entity to get the amount it should bleed
///
[ByRefEvent]
public record struct GetBleedLevelEvent(float BleedLevel);
///
/// Raised on an entity to modify the bleed level before committing to bleeding
///
[ByRefEvent]
public record struct ModifyBleedLevelEvent(float BleedLevel);
///
/// Raised on an entity's wounds to clamp them with the given probability
///
[ByRefEvent]
public record struct ClampWoundsEvent(float Probability);