CatStation/Content.Shared/Body/VisualOrganComponent.cs
SlamBamActionman 24485c39ee
Change dwarves to use displacement maps instead of sprite scaling (#43816)
* ach, ye initial commit

* Review changes...?

* Change parentage

* Widen the dwarf sprite

* Widen the dwarf sprite

* Solve the murder at the Portermeister Estate

* The rest of the fucking owl

* Fix female displacement, fix the displacement error

* Review changes

* Review fixes

* IPrototypeManager to ProtoMan

* Review changes
2026-07-05 22:17:17 +00:00

73 lines
2.1 KiB
C#

using Content.Shared.DisplacementMap;
using Content.Shared.Humanoid;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.Body;
/// <summary>
/// Defines an organ that applies a sprite to the specified <see cref="Layer" /> within the body
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
[Access(typeof(SharedVisualBodySystem))]
public sealed partial class VisualOrganComponent : Component
{
/// <summary>
/// The sprite layer on the entity that this contributes to
/// </summary>
[DataField(required: true)]
public Enum Layer;
/// <summary>
/// The sprite data for the layer
/// </summary>
[DataField(required: true), AutoNetworkedField, AlwaysPushInheritance]
public PrototypeLayerData Data;
/// <summary>
/// When applying a profile, if the sex is present in this dictionary, overrides the state of the sprite data.
/// Used for e.g. male vs female torsoes.
/// </summary>
[DataField]
public Dictionary<Sex, string>? SexStateOverrides;
/// <summary>
/// The current profile data of this organ, used for alternate sprite selection and colouration.
/// </summary>
[DataField, AutoNetworkedField]
public OrganProfileData Profile = new();
/// <summary>
/// Displacement data prototype applied to the organ's visualization.
/// </summary>
[DataField, AutoNetworkedField]
public ProtoId<DisplacementDataPrototype>? Displacement;
}
/// <summary>
/// Defines the coloration, sex, etc. of organs
/// </summary>
[DataDefinition]
[Serializable, NetSerializable]
public partial record struct OrganProfileData
{
/// <summary>
/// The "sex" of this organ
/// </summary>
[DataField]
public Sex Sex;
/// <summary>
/// The "eye color" of this organ
/// </summary>
[DataField]
public Color EyeColor = Color.White;
/// <summary>
/// The "skin color" of this organ
/// </summary>
[DataField]
public Color SkinColor = Color.White;
}