Skip to content

Commit

Permalink
inital
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealMasterChief117 committed Feb 20, 2025
1 parent 8f6aa7b commit 9a1d536
Show file tree
Hide file tree
Showing 47 changed files with 544 additions and 0 deletions.
47 changes: 47 additions & 0 deletions Content.Server/InteractionVerbs/Actions/ToggleLayersAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using Content.Server.Humanoid;
using Content.Shared.Humanoid;
using Content.Shared.Humanoid.Markings;
using Content.Shared.InteractionVerbs;

namespace Content.Server.InteractionVerbs.Actions;

/// <summary>
/// Toggles a humanoid visual layer.
/// </summary>
[Serializable]
public sealed partial class ToggleLayersAction : InteractionAction
{
[DataField]
public HumanoidVisualLayers? NeededMarkingCategory;

[DataField]
public HashSet<HumanoidVisualLayers> ToggleLayers;

public override bool CanPerform(InteractionArgs args, InteractionVerbPrototype proto, bool isBefore, VerbDependencies deps)
{
if (NeededMarkingCategory == null)
return true;

var markingCategory = MarkingCategoriesConversion.FromHumanoidVisualLayers(NeededMarkingCategory.Value);

return deps.EntMan.TryGetComponent(args.Target, out HumanoidAppearanceComponent? bodyAppearance)
&& bodyAppearance.MarkingSet.Markings.TryGetValue(markingCategory, out var markingList)
&& markingList.Count > 0; // Check if at least one entry exists
}

public override bool Perform(InteractionArgs args, InteractionVerbPrototype proto, VerbDependencies deps)
{
if (deps.EntMan.TryGetComponent<HumanoidAppearanceComponent>(args.Target, out var humanoidAppearance))
{
foreach (HumanoidVisualLayers layer in ToggleLayers)
{
deps.EntMan.System<HumanoidAppearanceSystem>().SetLayerVisibility(
args.Target,
layer, humanoidAppearance.HiddenLayers.Contains(layer)
);
}
}

return true;
}
}
2 changes: 2 additions & 0 deletions Content.Shared/Humanoid/HumanoidVisualLayers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public enum HumanoidVisualLayers : byte
Hair,
FacialHair,
Chest,
Underwear,
Undershirt,
Head,
Snout,
HeadSide, // side parts (i.e., frills)
Expand Down
4 changes: 4 additions & 0 deletions Content.Shared/Humanoid/Markings/MarkingCategories.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public enum MarkingCategories : byte
HeadSide,
Snout,
Chest,
Underwear,
Undershirt,
RightArm,
RightHand,
LeftArm,
Expand All @@ -38,6 +40,8 @@ public static MarkingCategories FromHumanoidVisualLayers(HumanoidVisualLayers la
HumanoidVisualLayers.HeadSide => MarkingCategories.HeadSide,
HumanoidVisualLayers.Snout => MarkingCategories.Snout,
HumanoidVisualLayers.Chest => MarkingCategories.Chest,
HumanoidVisualLayers.Underwear => MarkingCategories.Underwear,
HumanoidVisualLayers.Undershirt => MarkingCategories.Undershirt,
HumanoidVisualLayers.RArm => MarkingCategories.RightArm,
HumanoidVisualLayers.LArm => MarkingCategories.LeftArm,
HumanoidVisualLayers.RHand => MarkingCategories.RightHand,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Shared.DoAfter;
using Content.Shared.Humanoid;
using Content.Shared.InteractionVerbs.Events;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Shared.Inventory;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Content.Shared.Standing;
Expand Down Expand Up @@ -71,3 +72,17 @@ public override bool IsMet(InteractionArgs args, InteractionVerbPrototype proto,
return (args.Target == args.User) ^ Inverted;
}
}

/// <summary>
/// Requires a mob to not be wearing anything in this slot.
/// </summary>
[Serializable, NetSerializable]
public sealed partial class ClothingSlotBlacklistRequirement : InvertableInteractionRequirement
{
[DataField] public string Slot;

public override bool IsMet(InteractionArgs args, InteractionVerbPrototype proto, InteractionAction.VerbDependencies deps)
{
return !deps.EntMan.System<InventorySystem>().TryGetSlotEntity(args.Target, Slot, out _);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Shared.Contests;
using Content.Shared.DoAfter;
using Content.Shared.Ghost;
using Content.Shared.Humanoid;
using Content.Shared.Interaction;
using Content.Shared.InteractionVerbs.Events;
using Content.Shared.Popups;
Expand Down Expand Up @@ -32,6 +33,7 @@ public abstract class SharedInteractionVerbsSystem : EntitySystem
[Dependency] private readonly SharedContainerSystem _containers = default!;
[Dependency] private readonly ContestsSystem _contests = default!;
[Dependency] private readonly SharedInteractionSystem _interactions = default!;
[Dependency] private readonly SharedHumanoidAppearanceSystem _humanoid = default!;
[Dependency] private readonly INetManager _net = default!;
[Dependency] private readonly SharedPopupSystem _popups = default!;
[Dependency] private readonly IPrototypeManager _protoMan = default!;
Expand Down
19 changes: 19 additions & 0 deletions Resources/Locale/en-US/interaction/verbs/underwear.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
interaction-ToggleUndershirt-name = Toggle undershirt
interaction-ToggleUndershirt-description = Toggle the undershirt of this person!
interaction-ToggleUndershirt-success-self-popup = You toggle {THE($target)}'s undershirt.
interaction-ToggleUndershirt-success-target-popup = {THE($user)} toggles your undershirt!
interaction-ToggleUndershirt-fail-self-popup = You fail to toggle the undershirt.
interaction-ToggleUndershirt-delayed-self-popup = You try to toggle {THE($target)}'s undershirt.
interaction-ToggleUndershirt-delayed-target-popup = {THE($user)} is trying to toggle your undershirt!
interaction-ToggleUnderwear-name = Toggle underwear
interaction-ToggleUnderwear-description = Toggle the underwear of this person!
interaction-ToggleUnderwear-success-self-popup = You toggle {THE($target)}'s underwear.
interaction-ToggleUnderwear-success-target-popup = {THE($user)} toggles your underwear!
interaction-ToggleUnderwear-fail-self-popup = You fail to toggle the underwear.
interaction-ToggleUnderwear-delayed-self-popup = You try to toggle {THE($target)}'s underwear.
interaction-ToggleUnderwear-delayed-target-popup = {THE($user)} is trying to toggle your underwear!
41 changes: 41 additions & 0 deletions Resources/Locale/en-US/markings/underwear.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
markings-category-Undershirt = Undershirt
markings-category-Underwear = Underwear
marking-UndershirtStandard = Undershirt (Standard)
marking-UndershirtStandard-t_undershirt = Undershirt
marking-UndershirtSleeveless = Undershirt (Sleeveless)
marking-UndershirtSleeveless-t_undershirt_sleeveless = Undershirt
marking-UndershirtRolled = Undershirt (Rolled)
marking-UndershirtRolled-t_rolled_undershirt = Undershirt
marking-UndershirtRolledSleeveless = Undershirt (Sleeveless Rolled)
marking-UndershirtRolledSleeveless-t_rolled_undershirt_sleeveless = Undershirt
marking-UndershirtLong = Undershirt (Long)
marking-UndershirtLong-t_long_undershirt = Undershirt
marking-UndershirtClassic = Bra (Classic)
marking-UndershirtClassic-snow_classic = Bra
marking-UndershirtSports = Bra (Sport)
marking-UndershirtSports-snow_sports = Bra
marking-UndershirtStrapless = Bra (Strapless)
marking-UndershirtStrapless-snow_strapless = Bra
marking-UnderwearBoxers = Boxers
marking-UnderwearBoxers-snow_boxers = Boxers
marking-UnderwearBriefs = Briefs
marking-UnderwearBriefs-snow_briefs = Briefs
marking-UnderwearLowriders = Lowrides
marking-UnderwearLowriders-snow_lowriders = Lowrides
marking-UnderwearSatin = Satin
marking-UnderwearSatin-snow_satin = Satin
marking-UnderwearTanga = Tanga
marking-UnderwearTanga-snow_tanga = Tanga
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
- map: [ "enum.HumanoidVisualLayers.LArm" ]
- map: [ "enum.HumanoidVisualLayers.RLeg" ]
- map: [ "enum.HumanoidVisualLayers.LLeg" ]
- map: [ "enum.HumanoidVisualLayers.Underwear" ]
- map: [ "enum.HumanoidVisualLayers.Undershirt" ]
- map: [ "jumpsuit" ]
- map: [ "enum.HumanoidVisualLayers.LHand" ]
- map: [ "enum.HumanoidVisualLayers.RHand" ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
- map: [ "enum.HumanoidVisualLayers.LArm" ]
- map: [ "enum.HumanoidVisualLayers.RLeg" ]
- map: [ "enum.HumanoidVisualLayers.LLeg" ]
- map: [ "enum.HumanoidVisualLayers.Underwear" ]
- map: [ "enum.HumanoidVisualLayers.Undershirt" ]
- map: [ "jumpsuit" ]
- map: [ "enum.HumanoidVisualLayers.LHand" ]
- map: [ "enum.HumanoidVisualLayers.RHand" ]
Expand Down
9 changes: 9 additions & 0 deletions Resources/Prototypes/DeltaV/Species/rodentia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
FacialHair: MobHumanoidAnyMarking
Snout: MobHumanoidAnyMarking
Chest: MobRodentiaTorso
Underwear: MobHumanoidAnyMarking
Undershirt: MobHumanoidAnyMarking
HeadTop: MobHumanoidAnyMarking
HeadSide: MobHumanoidAnyMarking
Tail: MobHumanoidAnyMarking
Expand All @@ -45,6 +47,13 @@
- type: markingPoints
id: MobRodentiaMarkingLimits
points:
Underwear:
points: 1
required: true
defaultMarkings: [ UnderwearBoxers ]
Undershirt:
points: 1
required: false
Hair:
points: 1
required: false
Expand Down
9 changes: 9 additions & 0 deletions Resources/Prototypes/DeltaV/Species/vulpkanin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
FacialHair: MobHumanoidAnyMarking
Snout: MobHumanoidAnyMarking
Chest: MobVulpkaninTorso
Underwear: MobHumanoidAnyMarking
Undershirt: MobHumanoidAnyMarking
HeadTop: MobHumanoidAnyMarking
HeadSide: MobHumanoidAnyMarking
Tail: MobHumanoidAnyMarking
Expand All @@ -38,6 +40,13 @@
- type: markingPoints
id: MobVulpkaninMarkingLimits
points:
Underwear:
points: 1
required: true
defaultMarkings: [ UnderwearBoxers ]
Undershirt:
points: 1
required: false
Hair:
points: 1
required: false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
- type: marking
id: UndershirtStandard
bodyPart: Undershirt
markingCategory: Undershirt
speciesRestriction: [Shadowkin, Diona, Arachnid, Reptilian, Moth, SlimePerson, Resomi, Rodentia, Human, Rodentia, Felinid, Oni, Vulpkanin, Harpy]
coloring:
default:
type:
!type:SimpleColoring
color: "#FFFFFF"
sprites:
- sprite: Floof/Mobs/Customization/undershirt.rsi
state: t_undershirt

- type: marking
id: UndershirtSleeveless
bodyPart: Undershirt
markingCategory: Undershirt
speciesRestriction: [Shadowkin, Diona, Arachnid, Reptilian, Moth, SlimePerson, Resomi, Rodentia, Human, Rodentia, Felinid, Oni, Vulpkanin, Harpy]
coloring:
default:
type:
!type:SimpleColoring
color: "#FFFFFF"
sprites:
- sprite: Floof/Mobs/Customization/undershirt.rsi
state: t_undershirt_sleeveless

- type: marking
id: UndershirtRolled
bodyPart: Undershirt
markingCategory: Undershirt
speciesRestriction: [Shadowkin, Diona, Arachnid, Reptilian, Moth, SlimePerson, Resomi, Rodentia, Human, Rodentia, Felinid, Oni, Vulpkanin, Harpy]
coloring:
default:
type:
!type:SimpleColoring
color: "#FFFFFF"
sprites:
- sprite: Floof/Mobs/Customization/undershirt.rsi
state: t_rolled_undershirt

- type: marking
id: UndershirtRolledSleeveless
bodyPart: Undershirt
markingCategory: Undershirt
speciesRestriction: [Shadowkin, Diona, Arachnid, Reptilian, Moth, SlimePerson, Resomi, Rodentia, Human, Rodentia, Felinid, Oni, Vulpkanin, Harpy]
coloring:
default:
type:
!type:SimpleColoring
color: "#FFFFFF"
sprites:
- sprite: Floof/Mobs/Customization/undershirt.rsi
state: t_rolled_undershirt_sleeveless

- type: marking
id: UndershirtLong
bodyPart: Undershirt
markingCategory: Undershirt
speciesRestriction: [Shadowkin, Diona, Arachnid, Reptilian, Moth, SlimePerson, Resomi, Rodentia, Human, Rodentia, Felinid, Oni, Vulpkanin, Harpy]
coloring:
default:
type:
!type:SimpleColoring
color: "#FFFFFF"
sprites:
- sprite: Floof/Mobs/Customization/undershirt.rsi
state: t_long_undershirt

- type: marking
id: UndershirtClassic
bodyPart: Undershirt
markingCategory: Undershirt
speciesRestriction: [Shadowkin, Diona, Arachnid, Reptilian, Moth, SlimePerson, Resomi, Rodentia, Human, Rodentia, Felinid, Oni, Vulpkanin, Harpy]
coloring:
default:
type:
!type:SimpleColoring
color: "#FFFFFF"
sprites:
- sprite: Floof/Mobs/Customization/undershirt.rsi
state: snow_bra

- type: marking
id: UndershirtSports
bodyPart: Undershirt
markingCategory: Undershirt
speciesRestriction: [Shadowkin, Diona, Arachnid, Reptilian, Moth, SlimePerson, Resomi, Rodentia, Human, Rodentia, Felinid, Oni, Vulpkanin, Harpy]
coloring:
default:
type:
!type:SimpleColoring
color: "#FFFFFF"
sprites:
- sprite: Floof/Mobs/Customization/undershirt.rsi
state: snow_sports

- type: marking
id: UndershirtStrapless
bodyPart: Undershirt
markingCategory: Undershirt
speciesRestriction: [Shadowkin, Diona, Arachnid, Reptilian, Moth, SlimePerson, Resomi, Rodentia, Human, Rodentia, Felinid, Oni, Vulpkanin, Harpy]
coloring:
default:
type:
!type:SimpleColoring
color: "#FFFFFF"
sprites:
- sprite: Floof/Mobs/Customization/undershirt.rsi
state: snow_strapless
Loading

0 comments on commit 9a1d536

Please sign in to comment.