Files
wwdpublic/Content.Server/Traits/Assorted/SelfAwareComponent.cs
Angelo Fallaria 22ff27c098 New Trait: Self-Aware (#680)
# Description

**Self-Aware** is a 2-point Mental trait that allows you to precisely
examine your Brute/Burn damage as if using a health analyzer, and
estimate the level of your toxin/airloss damage.

Inspired by the SS13 trait of the same name.

## Media

<details><summary>Expand</summary>

**Trait entry**


![image](https://github.com/user-attachments/assets/8faae16f-7dd5-42cd-8332-c65a0c610429)

**No damage**


![image](https://github.com/user-attachments/assets/72bfa0f4-57fa-4b8d-b974-a604b4030ea6)

**Damaged**


![image](https://github.com/user-attachments/assets/ec6318b4-41dc-4d3b-9aec-8f02333363e7)
</details>

# Changelog

🆑 Skubman
add: Add the Self-Aware trait, a 2-point trait that allows you to
examine your Brute/Burn damage numbers like a health analyzer, and
estimate your toxin/airloss damage.

---------

Signed-off-by: Angelo Fallaria <ba.fallaria@gmail.com>
Co-authored-by: VMSolidus <evilexecutive@gmail.com>
2024-08-06 09:05:58 +01:00

32 lines
1.4 KiB
C#

using Content.Shared.Damage.Prototypes;
using Content.Shared.FixedPoint;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
namespace Content.Server.Traits.Assorted;
/// <summary>
/// This is used for the Self-Aware trait to enhance the information received from HealthExaminableSystem.
/// </summary>
[RegisterComponent]
public sealed partial class SelfAwareComponent : Component
{
// <summary>
// Damage types that an entity is able to precisely analyze like a health analyzer when they examine themselves.
// </summary>
[DataField(required: true, customTypeSerializer:typeof(PrototypeIdHashSetSerializer<DamageTypePrototype>))]
public HashSet<string> AnalyzableTypes = default!;
// <summary>
// Damage groups that an entity is able to detect the presence of when they examine themselves.
// </summary>
[DataField(required: true, customTypeSerializer:typeof(PrototypeIdHashSetSerializer<DamageGroupPrototype>))]
public HashSet<string> DetectableGroups = default!;
// <summary>
// The thresholds for determining the examine text of DetectableGroups for certain amounts of damage.
// These are calculated as a percentage of the entity's critical threshold.
// </summary>
public List<FixedPoint2> Thresholds = new()
{ FixedPoint2.New(0.10), FixedPoint2.New(0.25), FixedPoint2.New(0.40), FixedPoint2.New(0.60) };
}