diff --git a/Content.Client/Clothing/ClientClothingSystem.cs b/Content.Client/Clothing/ClientClothingSystem.cs index 1c0d831226db73..96bbcc54f2a249 100644 --- a/Content.Client/Clothing/ClientClothingSystem.cs +++ b/Content.Client/Clothing/ClientClothingSystem.cs @@ -1,10 +1,12 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Numerics; +using Content.Client.DisplacementMap; using Content.Client.Inventory; using Content.Shared.Clothing; using Content.Shared.Clothing.Components; using Content.Shared.Clothing.EntitySystems; +using Content.Shared.DisplacementMap; using Content.Shared.Humanoid; using Content.Shared.Inventory; using Content.Shared.Inventory.Events; @@ -50,6 +52,7 @@ public sealed class ClientClothingSystem : ClothingSystem [Dependency] private readonly IResourceCache _cache = default!; [Dependency] private readonly ISerializationManager _serialization = default!; [Dependency] private readonly InventorySystem _inventorySystem = default!; + [Dependency] private readonly DisplacementMapSystem _displacement = default!; public override void Initialize() { @@ -64,15 +67,14 @@ public override void Initialize() private void OnAppearanceUpdate(EntityUid uid, InventoryComponent component, ref AppearanceChangeEvent args) { - // May need to update jumpsuit stencils if the sex changed. Also required to properly set the stencil on init + // May need to update displacement maps if the sex changed. Also required to properly set the stencil on init if (args.Sprite == null) return; - if (_inventorySystem.TryGetSlotEntity(uid, Jumpsuit, out var suit, component) - && TryComp(suit, out ClothingComponent? clothing)) + var enumerator = _inventorySystem.GetSlotEnumerator((uid, component)); + while (enumerator.NextItem(out var item, out var slot)) { - SetGenderedMask(uid, args.Sprite, clothing); - return; + RenderEquipment(uid, item, slot.Name, component); } // No clothing equipped -> make sure the layer is hidden, though this should already be handled by on-unequip. @@ -179,14 +181,6 @@ private void OnVisualsChanged(EntityUid uid, InventoryComponent component, Visua private void OnDidUnequip(EntityUid uid, SpriteComponent component, DidUnequipEvent args) { - // Hide jumpsuit mask layer. - if (args.Slot == Jumpsuit - && TryComp(uid, out SpriteComponent? sprite) - && sprite.LayerMapTryGet(HumanoidVisualLayers.StencilMask, out var maskLayer)) - { - sprite.LayerSetVisible(maskLayer, false); - } - if (!TryComp(uid, out InventorySlotsComponent? inventorySlots)) return; @@ -231,9 +225,6 @@ private void RenderEquipment(EntityUid equipee, EntityUid equipment, string slot return; } - if (slot == Jumpsuit) - SetGenderedMask(equipee, sprite, clothingComponent); - if (!_inventorySystem.TryGetSlot(equipee, slot, out var slotDef, inventory)) return; @@ -265,7 +256,25 @@ private void RenderEquipment(EntityUid equipee, EntityUid equipment, string slot // temporary, until layer draw depths get added. Basically: a layer with the key "slot" is being used as a // bookmark to determine where in the list of layers we should insert the clothing layers. bool slotLayerExists = sprite.LayerMapTryGet(slot, out var index); - var displacementData = inventory.Displacements.GetValueOrDefault(slot); + + // Select displacement maps + var displacementData = inventory.Displacements.GetValueOrDefault(slot); //Default unsexed map + + var equipeeSex = CompOrNull(equipee)?.Sex; + if (equipeeSex != null) + { + switch (equipeeSex) + { + case Sex.Male: + if (inventory.MaleDisplacements.Count > 0) + displacementData = inventory.MaleDisplacements.GetValueOrDefault(slot); + break; + case Sex.Female: + if (inventory.FemaleDisplacements.Count > 0) + displacementData = inventory.FemaleDisplacements.GetValueOrDefault(slot); + break; + } + } // add the new layers foreach (var (key, layerData) in ev.Layers) @@ -292,7 +301,7 @@ private void RenderEquipment(EntityUid equipee, EntityUid equipment, string slot index = sprite.LayerMapReserveBlank(key); if (sprite[index] is not Layer layer) - return; + continue; // In case no RSI is given, use the item's base RSI as a default. This cuts down on a lot of unnecessary yaml entries. if (layerData.RsiPath == null @@ -303,78 +312,19 @@ private void RenderEquipment(EntityUid equipee, EntityUid equipment, string slot layer.SetRsi(clothingSprite.BaseRSI); } - // Another "temporary" fix for clothing stencil masks. - // Sprite layer redactor when - // Sprite "redactor" just a week away. - if (slot == Jumpsuit) - layerData.Shader ??= "StencilDraw"; - sprite.LayerSetData(index, layerData); layer.Offset += slotDef.Offset; - if (displacementData != null) + if (displacementData is not null) { - if (displacementData.ShaderOverride != null) - sprite.LayerSetShader(index, displacementData.ShaderOverride); - - var displacementKey = $"{key}-displacement"; - if (!revealedLayers.Add(displacementKey)) - { - Log.Warning($"Duplicate key for clothing visuals DISPLACEMENT: {displacementKey}."); + //Checking that the state is not tied to the current race. In this case we don't need to use the displacement maps. + if (layerData.State is not null && inventory.SpeciesId is not null && layerData.State.EndsWith(inventory.SpeciesId)) continue; - } - - var displacementLayer = _serialization.CreateCopy(displacementData.Layer, notNullableOverride: true); - displacementLayer.CopyToShaderParameters!.LayerKey = key; - // Add before main layer for this item. - sprite.AddLayer(displacementLayer, index); - sprite.LayerMapSet(displacementKey, index); - - revealedLayers.Add(displacementKey); + _displacement.TryAddDisplacement(displacementData, sprite, index, key, revealedLayers); } } RaiseLocalEvent(equipment, new EquipmentVisualsUpdatedEvent(equipee, slot, revealedLayers), true); } - - - /// - /// Sets a sprite's gendered mask based on gender (obviously). - /// - /// Sprite to modify - /// Humanoid, to get gender from - /// Clothing component, to get mask sprite type - private void SetGenderedMask(EntityUid uid, SpriteComponent sprite, ClothingComponent clothing) - { - if (!sprite.LayerMapTryGet(HumanoidVisualLayers.StencilMask, out var layer)) - return; - - ClothingMask mask; - string prefix; - - switch (CompOrNull(uid)?.Sex) - { - case Sex.Male: - mask = clothing.MaleMask; - prefix = "male_"; - break; - case Sex.Female: - mask = clothing.FemaleMask; - prefix = "female_"; - break; - default: - mask = clothing.UnisexMask; - prefix = "unisex_"; - break; - } - - sprite.LayerSetState(layer, mask switch - { - ClothingMask.NoMask => $"{prefix}none", - ClothingMask.UniformTop => $"{prefix}top", - _ => $"{prefix}full", - }); - sprite.LayerSetVisible(layer, true); - } } diff --git a/Content.Client/DisplacementMap/DisplacementMapSystem.cs b/Content.Client/DisplacementMap/DisplacementMapSystem.cs new file mode 100644 index 00000000000000..6db164a09f092c --- /dev/null +++ b/Content.Client/DisplacementMap/DisplacementMapSystem.cs @@ -0,0 +1,65 @@ +using Content.Shared.DisplacementMap; +using Robust.Client.GameObjects; +using Robust.Client.Graphics; +using Robust.Shared.Serialization.Manager; + +namespace Content.Client.DisplacementMap; + +public sealed class DisplacementMapSystem : EntitySystem +{ + [Dependency] private readonly ISerializationManager _serialization = default!; + + public bool TryAddDisplacement(DisplacementData data, SpriteComponent sprite, int index, string key, HashSet revealedLayers) + { + if (data.ShaderOverride != null) + sprite.LayerSetShader(index, data.ShaderOverride); + + var displacementKey = $"{key}-displacement"; + if (!revealedLayers.Add(displacementKey)) + { + Log.Warning($"Duplicate key for DISPLACEMENT: {displacementKey}."); + return false; + } + + //allows you not to write it every time in the YML + foreach (var pair in data.SizeMaps) + { + pair.Value.CopyToShaderParameters??= new() + { + LayerKey = "dummy", + ParameterTexture = "displacementMap", + ParameterUV = "displacementUV", + }; + } + + if (!data.SizeMaps.ContainsKey(32)) + { + Log.Error($"DISPLACEMENT: {displacementKey} don't have 32x32 default displacement map"); + return false; + } + + // We choose a displacement map from the possible ones, matching the size with the original layer size. + // If there is no such a map, we use a standard 32 by 32 one + var displacementDataLayer = data.SizeMaps[EyeManager.PixelsPerMeter]; + var actualRSI = sprite.LayerGetActualRSI(index); + if (actualRSI is not null) + { + if (actualRSI.Size.X != actualRSI.Size.Y) + Log.Warning($"DISPLACEMENT: {displacementKey} has a resolution that is not 1:1, things can look crooked"); + + var layerSize = actualRSI.Size.X; + if (data.SizeMaps.ContainsKey(layerSize)) + displacementDataLayer = data.SizeMaps[layerSize]; + } + + var displacementLayer = _serialization.CreateCopy(displacementDataLayer, notNullableOverride: true); + displacementLayer.CopyToShaderParameters!.LayerKey = key; + + sprite.AddLayer(displacementLayer, index); + sprite.LayerMapSet(displacementKey, index); + + revealedLayers.Add(displacementKey); + + return true; + } +} diff --git a/Content.Client/Hands/Systems/HandsSystem.cs b/Content.Client/Hands/Systems/HandsSystem.cs index 7319b97b42b79c..ffa6dfd29d6537 100644 --- a/Content.Client/Hands/Systems/HandsSystem.cs +++ b/Content.Client/Hands/Systems/HandsSystem.cs @@ -1,5 +1,6 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; +using Content.Client.DisplacementMap; using Content.Client.Examine; using Content.Client.Strip; using Content.Client.Verbs.UI; @@ -28,6 +29,7 @@ public sealed class HandsSystem : SharedHandsSystem [Dependency] private readonly SharedContainerSystem _containerSystem = default!; [Dependency] private readonly StrippableSystem _stripSys = default!; [Dependency] private readonly ExamineSystem _examine = default!; + [Dependency] private readonly DisplacementMapSystem _displacement = default!; public event Action? OnPlayerAddHand; public event Action? OnPlayerRemoveHand; @@ -345,6 +347,10 @@ private void UpdateHandVisuals(EntityUid uid, EntityUid held, Hand hand, HandsCo } sprite.LayerSetData(index, layerData); + + //Add displacement maps + if (handComp.HandDisplacement is not null) + _displacement.TryAddDisplacement(handComp.HandDisplacement, sprite, index, key, revealedLayers); } RaiseLocalEvent(held, new HeldVisualsUpdatedEvent(uid, revealedLayers), true); diff --git a/Content.Shared/Clothing/Components/ClothingComponent.cs b/Content.Shared/Clothing/Components/ClothingComponent.cs index 846a78b8680c34..581125d4fe31ee 100644 --- a/Content.Shared/Clothing/Components/ClothingComponent.cs +++ b/Content.Shared/Clothing/Components/ClothingComponent.cs @@ -59,18 +59,6 @@ public sealed partial class ClothingComponent : Component [DataField("sprite")] public string? RsiPath; - [ViewVariables(VVAccess.ReadWrite)] - [DataField("maleMask")] - public ClothingMask MaleMask = ClothingMask.UniformFull; - - [ViewVariables(VVAccess.ReadWrite)] - [DataField("femaleMask")] - public ClothingMask FemaleMask = ClothingMask.UniformFull; - - [ViewVariables(VVAccess.ReadWrite)] - [DataField("unisexMask")] - public ClothingMask UnisexMask = ClothingMask.UniformFull; - /// /// Name of the inventory slot the clothing is in. /// diff --git a/Content.Shared/Clothing/EntitySystems/ClothingSystem.cs b/Content.Shared/Clothing/EntitySystems/ClothingSystem.cs index 381edc68baaf3e..14137b38365580 100644 --- a/Content.Shared/Clothing/EntitySystems/ClothingSystem.cs +++ b/Content.Shared/Clothing/EntitySystems/ClothingSystem.cs @@ -233,7 +233,6 @@ public void CopyVisuals(EntityUid uid, ClothingComponent otherClothing, Clothing clothing.ClothingVisuals = otherClothing.ClothingVisuals; clothing.EquippedPrefix = otherClothing.EquippedPrefix; clothing.RsiPath = otherClothing.RsiPath; - clothing.FemaleMask = otherClothing.FemaleMask; _itemSys.VisualsChanged(uid); Dirty(uid, clothing); diff --git a/Content.Shared/DisplacementMap/DisplacementData.cs b/Content.Shared/DisplacementMap/DisplacementData.cs new file mode 100644 index 00000000000000..7bd5b580e143c3 --- /dev/null +++ b/Content.Shared/DisplacementMap/DisplacementData.cs @@ -0,0 +1,14 @@ +namespace Content.Shared.DisplacementMap; + +[DataDefinition] +public sealed partial class DisplacementData +{ + /// + /// allows you to attach different maps for layers of different sizes. + /// + [DataField(required: true)] + public Dictionary SizeMaps = new(); + + [DataField] + public string? ShaderOverride = "DisplacedStencilDraw"; +} diff --git a/Content.Shared/Hands/Components/HandsComponent.cs b/Content.Shared/Hands/Components/HandsComponent.cs index 01579cccdb79ec..f218455c0bb7dc 100644 --- a/Content.Shared/Hands/Components/HandsComponent.cs +++ b/Content.Shared/Hands/Components/HandsComponent.cs @@ -1,3 +1,4 @@ +using Content.Shared.DisplacementMap; using Content.Shared.Hands.EntitySystems; using Robust.Shared.Containers; using Robust.Shared.GameStates; @@ -76,6 +77,9 @@ public sealed partial class HandsComponent : Component /// [DataField, ViewVariables(VVAccess.ReadWrite)] public TimeSpan ThrowCooldown = TimeSpan.FromSeconds(0.5f); + + [DataField] + public DisplacementData? HandDisplacement; } [Serializable, NetSerializable] diff --git a/Content.Shared/Inventory/InventoryComponent.cs b/Content.Shared/Inventory/InventoryComponent.cs index 02b3a5b2583a8d..629cf1169c4584 100644 --- a/Content.Shared/Inventory/InventoryComponent.cs +++ b/Content.Shared/Inventory/InventoryComponent.cs @@ -1,4 +1,5 @@ -using Robust.Shared.Containers; +using Content.Shared.DisplacementMap; +using Robust.Shared.Containers; using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; @@ -13,18 +14,21 @@ public sealed partial class InventoryComponent : Component [DataField("speciesId")] public string? SpeciesId { get; set; } - [DataField] public Dictionary Displacements = []; - public SlotDefinition[] Slots = Array.Empty(); public ContainerSlot[] Containers = Array.Empty(); - [DataDefinition] - public sealed partial class SlotDisplacementData - { - [DataField(required: true)] - public PrototypeLayerData Layer = default!; + [DataField] + public Dictionary Displacements = new(); + + /// + /// Alternate displacement maps, which if available, will be selected for the player of the appropriate gender. + /// + [DataField] + public Dictionary FemaleDisplacements = new(); - [DataField] - public string? ShaderOverride = "DisplacedStencilDraw"; - } + /// + /// Alternate displacement maps, which if available, will be selected for the player of the appropriate gender. + /// + [DataField] + public Dictionary MaleDisplacements = new(); } diff --git a/Resources/Prototypes/Entities/Clothing/Uniforms/jumpsuits.yml b/Resources/Prototypes/Entities/Clothing/Uniforms/jumpsuits.yml index a5e57a608d9283..9795c42b8fa363 100644 --- a/Resources/Prototypes/Entities/Clothing/Uniforms/jumpsuits.yml +++ b/Resources/Prototypes/Entities/Clothing/Uniforms/jumpsuits.yml @@ -210,7 +210,6 @@ sprite: Clothing/Uniforms/Jumpsuit/clown.rsi - type: Clothing sprite: Clothing/Uniforms/Jumpsuit/clown.rsi - femaleMask: UniformTop - type: Tag tags: - ClownSuit @@ -224,7 +223,6 @@ sprite: Clothing/Uniforms/Jumpsuit/clown_banana.rsi - type: Clothing sprite: Clothing/Uniforms/Jumpsuit/clown_banana.rsi - femaleMask: UniformTop - type: Construction graph: BananaClownJumpsuit node: jumpsuit diff --git a/Resources/Prototypes/Entities/Clothing/Uniforms/random_suit.yml b/Resources/Prototypes/Entities/Clothing/Uniforms/random_suit.yml index e113f0ffc76ce7..7d4dfc59905a2e 100644 --- a/Resources/Prototypes/Entities/Clothing/Uniforms/random_suit.yml +++ b/Resources/Prototypes/Entities/Clothing/Uniforms/random_suit.yml @@ -19,8 +19,6 @@ - state: mask_null map: [ "overlay" ] - type: Clothing - femaleMask: UniformTop - maleMask: UniformTop sprite: Clothing/Uniforms/procedural.rsi clothingVisuals: jumpsuit: diff --git a/Resources/Prototypes/Entities/Mobs/Species/arachnid.yml b/Resources/Prototypes/Entities/Mobs/Species/arachnid.yml index 8b3c66d5dd18f4..fa0f5356a66c67 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/arachnid.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/arachnid.yml @@ -28,8 +28,6 @@ spawned: - id: FoodMeatSpider amount: 5 - - type: Inventory - templateId: arachnid - type: Reactive reactions: - reagents: [Water] @@ -80,16 +78,6 @@ - map: [ "enum.HumanoidVisualLayers.LArm" ] - map: [ "enum.HumanoidVisualLayers.RLeg" ] - map: [ "enum.HumanoidVisualLayers.LLeg" ] - - shader: StencilClear - sprite: Mobs/Species/Human/parts.rsi #PJB on stencil clear being on the left leg: "...this is 'fine'" -https://github.com/space-wizards/space-station-14/pull/12217#issuecomment-1291677115 - # its fine, but its still very stupid that it has to be done like this instead of allowing sprites to just directly insert a stencil clear. - # sprite refactor when - state: l_leg - - shader: StencilMask - map: ["enum.HumanoidVisualLayers.StencilMask"] - sprite: Mobs/Customization/masking_helpers.rsi - state: unisex_full - visible: false - map: ["jumpsuit"] - map: ["enum.HumanoidVisualLayers.LFoot"] - map: ["enum.HumanoidVisualLayers.RFoot"] @@ -122,6 +110,9 @@ sprite: "Effects/creampie.rsi" state: "creampie_arachnid" visible: false + - type: Inventory + templateId: arachnid + - type: entity parent: BaseSpeciesDummy @@ -131,4 +122,5 @@ - type: HumanoidAppearance species: Arachnid -#88w88 + +#>88w88< diff --git a/Resources/Prototypes/Entities/Mobs/Species/base.yml b/Resources/Prototypes/Entities/Mobs/Species/base.yml index 8702bbe0218c3a..356f185fd13ed2 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/base.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/base.yml @@ -18,16 +18,6 @@ - map: [ "enum.HumanoidVisualLayers.LArm" ] - map: [ "enum.HumanoidVisualLayers.RLeg" ] - map: [ "enum.HumanoidVisualLayers.LLeg" ] - - shader: StencilClear - sprite: Mobs/Species/Human/parts.rsi #PJB on stencil clear being on the left leg: "...this is 'fine'" -https://github.com/space-wizards/space-station-14/pull/12217#issuecomment-1291677115 - # its fine, but its still very stupid that it has to be done like this instead of allowing sprites to just directly insert a stencil clear. - # sprite refactor when - state: l_leg - - shader: StencilMask - map: ["enum.HumanoidVisualLayers.StencilMask"] - sprite: Mobs/Customization/masking_helpers.rsi - state: unisex_full - visible: false - map: ["jumpsuit"] - map: ["enum.HumanoidVisualLayers.LFoot"] - map: ["enum.HumanoidVisualLayers.RFoot"] @@ -307,14 +297,6 @@ - map: [ "enum.HumanoidVisualLayers.LArm" ] - map: [ "enum.HumanoidVisualLayers.RLeg" ] - map: [ "enum.HumanoidVisualLayers.LLeg" ] - - shader: StencilClear - sprite: Mobs/Species/Human/parts.rsi - state: l_leg - - shader: StencilMask - map: ["enum.HumanoidVisualLayers.StencilMask"] - sprite: Mobs/Customization/masking_helpers.rsi - state: unisex_full - visible: false - map: ["jumpsuit"] - map: ["enum.HumanoidVisualLayers.LFoot"] - map: ["enum.HumanoidVisualLayers.RFoot"] @@ -352,4 +334,4 @@ - type: UserInterface interfaces: enum.HumanoidMarkingModifierKey.Key: # sure, this can go here too - type: HumanoidMarkingModifierBoundUserInterface + type: HumanoidMarkingModifierBoundUserInterface \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Mobs/Species/diona.yml b/Resources/Prototypes/Entities/Mobs/Species/diona.yml index 7edb3a19dbad6f..d6597ce65d3858 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/diona.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/diona.yml @@ -82,8 +82,6 @@ - MobMask layer: - MobLayer - - type: Inventory - templateId: diona - type: Speech speechVerb: Plant - type: Vocal @@ -101,13 +99,27 @@ actionPrototype: DionaGibAction allowedStates: - Dead + - type: Inventory + templateId: diona + femaleDisplacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Human/displacement.rsi + state: jumpsuit-female - type: entity parent: BaseSpeciesDummy id: MobDionaDummy noSpawn: true components: - - type: Inventory - templateId: diona - type: HumanoidAppearance species: Diona + - type: Inventory + templateId: diona + femaleDisplacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Human/displacement.rsi + state: jumpsuit-female diff --git a/Resources/Prototypes/Entities/Mobs/Species/dwarf.yml b/Resources/Prototypes/Entities/Mobs/Species/dwarf.yml index 5a54b56c48e0f3..932eda879efa46 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/dwarf.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/dwarf.yml @@ -56,6 +56,13 @@ hideLayersOnEquip: - Hair - Snout + - type: Inventory + femaleDisplacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Human/displacement.rsi + state: jumpsuit-female - type: entity parent: BaseSpeciesDummy @@ -64,3 +71,10 @@ components: - type: Sprite scale: 1, 0.8 + - type: Inventory + femaleDisplacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Human/displacement.rsi + state: jumpsuit-female diff --git a/Resources/Prototypes/Entities/Mobs/Species/gingerbread.yml b/Resources/Prototypes/Entities/Mobs/Species/gingerbread.yml index c514a6f1a050bf..d0b065bc212677 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/gingerbread.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/gingerbread.yml @@ -40,6 +40,14 @@ - MobMask layer: - MobLayer + - type: Inventory + femaleDisplacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Human/displacement.rsi + state: jumpsuit-female + - type: entity parent: BaseSpeciesDummy @@ -48,3 +56,10 @@ components: - type: HumanoidAppearance species: Gingerbread + - type: Inventory + femaleDisplacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Human/displacement.rsi + state: jumpsuit-female diff --git a/Resources/Prototypes/Entities/Mobs/Species/human.yml b/Resources/Prototypes/Entities/Mobs/Species/human.yml index 6716d3902b8225..392185ef77c379 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/human.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/human.yml @@ -20,8 +20,25 @@ hideLayersOnEquip: - Hair - Snout + - type: Inventory + femaleDisplacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Human/displacement.rsi + state: jumpsuit-female + - type: entity parent: BaseSpeciesDummy id: MobHumanDummy noSpawn: true + components: + - type: Inventory + femaleDisplacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Human/displacement.rsi + state: jumpsuit-female + diff --git a/Resources/Prototypes/Entities/Mobs/Species/moth.yml b/Resources/Prototypes/Entities/Mobs/Species/moth.yml index f6fde849efebee..f3eaeb32c79539 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/moth.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/moth.yml @@ -76,16 +76,6 @@ - map: [ "enum.HumanoidVisualLayers.LArm" ] - map: [ "enum.HumanoidVisualLayers.RLeg" ] - map: [ "enum.HumanoidVisualLayers.LLeg" ] - - shader: StencilClear - sprite: Mobs/Species/Human/parts.rsi #PJB on stencil clear being on the left leg: "...this is 'fine'" -https://github.com/space-wizards/space-station-14/pull/12217#issuecomment-1291677115 - # its fine, but its still very stupid that it has to be done like this instead of allowing sprites to just directly insert a stencil clear. - # sprite refactor when - state: l_leg - - shader: StencilMask - map: [ "enum.HumanoidVisualLayers.StencilMask" ] - sprite: Mobs/Customization/masking_helpers.rsi - state: unisex_full - visible: false - map: [ "jumpsuit" ] - map: [ "enum.HumanoidVisualLayers.LHand" ] - map: [ "enum.HumanoidVisualLayers.RHand" ] @@ -118,6 +108,14 @@ sprite: "Effects/creampie.rsi" state: "creampie_moth" visible: false + - type: Inventory + femaleDisplacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Human/displacement.rsi + state: jumpsuit-female + - type: entity parent: BaseSpeciesDummy @@ -126,3 +124,11 @@ components: - type: HumanoidAppearance species: Moth + - type: Inventory + femaleDisplacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Human/displacement.rsi + state: jumpsuit-female + diff --git a/Resources/Prototypes/Entities/Mobs/Species/reptilian.yml b/Resources/Prototypes/Entities/Mobs/Species/reptilian.yml index 0d93e6fe51a81f..6f0705635a0995 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/reptilian.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/reptilian.yml @@ -26,8 +26,6 @@ spawned: - id: FoodMeatLizard amount: 5 - - type: Inventory - speciesId: reptilian - type: LizardAccent - type: Speech speechSounds: Lizard @@ -62,6 +60,15 @@ types: Heat : 1.5 #per second, scales with temperature & other constants - type: Wagging + - type: Inventory + speciesId: reptilian + femaleDisplacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Human/displacement.rsi + state: jumpsuit-female + - type: entity parent: BaseSpeciesDummy @@ -77,5 +84,11 @@ - HeadSide - type: Inventory speciesId: reptilian + femaleDisplacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Human/displacement.rsi + state: jumpsuit-female #Weh diff --git a/Resources/Prototypes/Entities/Mobs/Species/skeleton.yml b/Resources/Prototypes/Entities/Mobs/Species/skeleton.yml index 41d81a0e9dd1f9..659bf7467e27de 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/skeleton.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/skeleton.yml @@ -102,11 +102,25 @@ - type: FireVisuals alternateState: Standing - type: FlashImmunity + - type: Inventory + femaleDisplacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Human/displacement.rsi + state: jumpsuit-female - type: entity parent: BaseSpeciesDummy id: MobSkeletonPersonDummy noSpawn: true components: - - type: HumanoidAppearance - species: Skeleton + - type: HumanoidAppearance + species: Skeleton + - type: Inventory + femaleDisplacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Human/displacement.rsi + state: jumpsuit-female diff --git a/Resources/Prototypes/Entities/Mobs/Species/slime.yml b/Resources/Prototypes/Entities/Mobs/Species/slime.yml index 6d5c8697f46de0..0420452ce95763 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/slime.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/slime.yml @@ -109,11 +109,25 @@ types: Asphyxiation: -1.0 maxSaturation: 15 + - type: Inventory + femaleDisplacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Human/displacement.rsi + state: jumpsuit-female - type: entity parent: MobHumanDummy id: MobSlimePersonDummy noSpawn: true components: - - type: HumanoidAppearance - species: SlimePerson + - type: HumanoidAppearance + species: SlimePerson + - type: Inventory + femaleDisplacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Human/displacement.rsi + state: jumpsuit-female diff --git a/Resources/Prototypes/Entities/Mobs/Species/vox.yml b/Resources/Prototypes/Entities/Mobs/Species/vox.yml index 02e2791e3541a1..5f4d4719397cfc 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/vox.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/vox.yml @@ -14,42 +14,6 @@ - type: HumanoidAppearance species: Vox #- type: VoxAccent # Not yet coded - - type: Inventory - speciesId: vox - displacements: - jumpsuit: - layer: - sprite: Mobs/Species/Vox/displacement.rsi - state: jumpsuit - copyToShaderParameters: - # Value required, provide a dummy. Gets overridden when applied. - layerKey: dummy - parameterTexture: displacementMap - parameterUV: displacementUV - eyes: - layer: - sprite: Mobs/Species/Vox/displacement.rsi - state: eyes - copyToShaderParameters: - layerKey: dummy - parameterTexture: displacementMap - parameterUV: displacementUV - gloves: - layer: - sprite: Mobs/Species/Vox/displacement.rsi - state: hand - copyToShaderParameters: - layerKey: dummy - parameterTexture: displacementMap - parameterUV: displacementUV - back: - layer: - sprite: Mobs/Species/Vox/displacement.rsi - state: back - copyToShaderParameters: - layerKey: dummy - parameterTexture: displacementMap - parameterUV: displacementUV - type: Speech speechVerb: Vox speechSounds: Vox @@ -126,6 +90,39 @@ sprite: "Effects/creampie.rsi" state: "creampie_vox" # Not default visible: false + - type: Inventory + speciesId: vox + displacements: + jumpsuit: + sizeMaps: + 32: + sprite: Mobs/Species/Vox/displacement.rsi + state: jumpsuit + eyes: + sizeMaps: + 32: + sprite: Mobs/Species/Vox/displacement.rsi + state: eyes + gloves: + sizeMaps: + 32: + sprite: Mobs/Species/Vox/displacement.rsi + state: hand + back: + sizeMaps: + 32: + sprite: Mobs/Species/Vox/displacement.rsi + state: back + ears: + sizeMaps: + 32: + sprite: Mobs/Species/Vox/displacement.rsi + state: ears + shoes: + sizeMaps: + 32: + sprite: Mobs/Species/Vox/displacement.rsi + state: shoes - type: entity parent: BaseSpeciesDummy @@ -140,36 +137,32 @@ speciesId: vox displacements: jumpsuit: - layer: - sprite: Mobs/Species/Vox/displacement.rsi - state: jumpsuit - copyToShaderParameters: - # Value required, provide a dummy. Gets overridden when applied. - layerKey: dummy - parameterTexture: displacementMap - parameterUV: displacementUV + sizeMaps: + 32: + sprite: Mobs/Species/Vox/displacement.rsi + state: jumpsuit eyes: - layer: - sprite: Mobs/Species/Vox/displacement.rsi - state: eyes - copyToShaderParameters: - layerKey: dummy - parameterTexture: displacementMap - parameterUV: displacementUV + sizeMaps: + 32: + sprite: Mobs/Species/Vox/displacement.rsi + state: eyes gloves: - layer: - sprite: Mobs/Species/Vox/displacement.rsi - state: hand - copyToShaderParameters: - layerKey: dummy - parameterTexture: displacementMap - parameterUV: displacementUV + sizeMaps: + 32: + sprite: Mobs/Species/Vox/displacement.rsi + state: hand back: - layer: - sprite: Mobs/Species/Vox/displacement.rsi - state: back - copyToShaderParameters: - layerKey: dummy - parameterTexture: displacementMap - parameterUV: displacementUV - + sizeMaps: + 32: + sprite: Mobs/Species/Vox/displacement.rsi + state: back + ears: + sizeMaps: + 32: + sprite: Mobs/Species/Vox/displacement.rsi + state: ears + shoes: + sizeMaps: + 32: + sprite: Mobs/Species/Vox/displacement.rsi + state: shoes diff --git a/Resources/Textures/Mobs/Species/Human/displacement.rsi/jumpsuit-female.png b/Resources/Textures/Mobs/Species/Human/displacement.rsi/jumpsuit-female.png new file mode 100644 index 00000000000000..be9c1064fbda3a Binary files /dev/null and b/Resources/Textures/Mobs/Species/Human/displacement.rsi/jumpsuit-female.png differ diff --git a/Resources/Textures/Mobs/Species/Human/displacement.rsi/meta.json b/Resources/Textures/Mobs/Species/Human/displacement.rsi/meta.json new file mode 100644 index 00000000000000..7ac587cad7051d --- /dev/null +++ b/Resources/Textures/Mobs/Species/Human/displacement.rsi/meta.json @@ -0,0 +1,18 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Made by TheShuEd", + "size": { + "x": 32, + "y": 32 + }, + "load": { + "srgb": false + }, + "states": [ + { + "name": "jumpsuit-female", + "directions": 4 + } + ] +} diff --git a/Resources/Textures/Mobs/Species/Vox/displacement.rsi/ears.png b/Resources/Textures/Mobs/Species/Vox/displacement.rsi/ears.png new file mode 100644 index 00000000000000..0b163821447d9d Binary files /dev/null and b/Resources/Textures/Mobs/Species/Vox/displacement.rsi/ears.png differ diff --git a/Resources/Textures/Mobs/Species/Vox/displacement.rsi/meta.json b/Resources/Textures/Mobs/Species/Vox/displacement.rsi/meta.json index 81bdd40e0cb0cd..2152470bd1f4c1 100644 --- a/Resources/Textures/Mobs/Species/Vox/displacement.rsi/meta.json +++ b/Resources/Textures/Mobs/Species/Vox/displacement.rsi/meta.json @@ -1,7 +1,7 @@ { "version": 1, "license": "CC-BY-SA-3.0", - "copyright": "jumpsuit state made by PJB3005. back, hand, and eyes states made by Flareguy", + "copyright": "jumpsuit state made by PJB3005. back, hand, and eyes states made by Flareguy, ears and shoes made by TheShuEd", "size": { "x": 32, "y": 32 @@ -22,9 +22,17 @@ "name": "hand", "directions": 4 }, + { + "name": "ears", + "directions": 4 + }, { "name": "eyes", "directions": 4 + }, + { + "name": "shoes", + "directions": 4 } ] } diff --git a/Resources/Textures/Mobs/Species/Vox/displacement.rsi/shoes.png b/Resources/Textures/Mobs/Species/Vox/displacement.rsi/shoes.png new file mode 100644 index 00000000000000..107a7500bb94e7 Binary files /dev/null and b/Resources/Textures/Mobs/Species/Vox/displacement.rsi/shoes.png differ