Gender Swap
This commit is contained in:
@@ -359,6 +359,21 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
public void SwapSex(EntityUid uid, HumanoidAppearanceComponent? humanoid = null)
|
||||
{
|
||||
if (!Resolve(uid, ref humanoid) || humanoid.Sex == Sex.Unsexed)
|
||||
return;
|
||||
|
||||
// Not set up for future possible alien sexes
|
||||
if (humanoid.Sex == Sex.Male)
|
||||
{
|
||||
SetSex(uid,Sex.Female);
|
||||
return;
|
||||
}
|
||||
SetSex(uid,Sex.Male);
|
||||
|
||||
}
|
||||
|
||||
public List<BodyTypePrototype> GetValidBodyTypes(SpeciesPrototype species, Sex sex)
|
||||
{
|
||||
return species.BodyTypes.Select(protoId => _proto.Index<BodyTypePrototype>(protoId))
|
||||
|
||||
39
Content.Shared/_Amour/GrammarSystem/GrammarSystem.cs
Normal file
39
Content.Shared/_Amour/GrammarSystem/GrammarSystem.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.GameObjects.Components.Localization;
|
||||
|
||||
namespace Content.Shared._Amour.GrammarSystem;
|
||||
|
||||
public sealed class GrammarSystem : EntitySystem
|
||||
{
|
||||
public void Clear(Entity<GrammarComponent> grammar)
|
||||
{
|
||||
grammar.Comp.Attributes.Clear();
|
||||
Dirty(grammar);
|
||||
}
|
||||
|
||||
public bool TryGet(Entity<GrammarComponent> grammar, string key, [NotNullWhen(true)] out string? value)
|
||||
{
|
||||
return grammar.Comp.Attributes.TryGetValue(key, out value);
|
||||
}
|
||||
|
||||
public void Set(Entity<GrammarComponent> grammar, string key, string? value)
|
||||
{
|
||||
if (value == null)
|
||||
grammar.Comp.Attributes.Remove(key);
|
||||
else
|
||||
grammar.Comp.Attributes[key] = value;
|
||||
|
||||
Dirty(grammar);
|
||||
}
|
||||
|
||||
public void SetGender(Entity<GrammarComponent> grammar, Gender? gender)
|
||||
{
|
||||
Set(grammar, "gender", gender?.ToString());
|
||||
}
|
||||
|
||||
public void SetProperNoun(Entity<GrammarComponent> grammar, bool? proper)
|
||||
{
|
||||
Set(grammar, "proper", proper?.ToString());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user