[Add] Adds the accentless trait (#18303)
* Accentless trait revival, not done yet * Works for lizard, but for some reason dwarf crashes it * Fixed!
This commit is contained in:
16
Content.Shared/Traits/Assorted/AccentlessComponent.cs
Normal file
16
Content.Shared/Traits/Assorted/AccentlessComponent.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
|
namespace Content.Shared.Traits.Assorted;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This is used for the accentless trait
|
||||||
|
/// </summary>
|
||||||
|
[RegisterComponent]
|
||||||
|
public sealed class AccentlessComponent : Component
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The accents removed by the accentless trait.
|
||||||
|
/// </summary>
|
||||||
|
[DataField("removes"), ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public ComponentRegistry RemovedAccents = new();
|
||||||
|
}
|
||||||
26
Content.Shared/Traits/Assorted/AccentlessSystem.cs
Normal file
26
Content.Shared/Traits/Assorted/AccentlessSystem.cs
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
using Robust.Shared.Serialization.Manager;
|
||||||
|
|
||||||
|
namespace Content.Shared.Traits.Assorted;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This handles removing accents when using the accentless trait.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class AccentlessSystem : EntitySystem
|
||||||
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
SubscribeLocalEvent<AccentlessComponent, ComponentStartup>(RemoveAccents);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RemoveAccents(EntityUid uid, AccentlessComponent component, ComponentStartup args)
|
||||||
|
{
|
||||||
|
foreach (var accent in component.RemovedAccents.Values)
|
||||||
|
{
|
||||||
|
var accentComponent = accent.Component;
|
||||||
|
RemComp(uid, accentComponent.GetType());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,3 +25,6 @@ trait-pirate-accent-desc = You can't stop speaking like a pirate!
|
|||||||
|
|
||||||
trait-archaic-accent-name = Archaic Accent
|
trait-archaic-accent-name = Archaic Accent
|
||||||
trait-archaic-accent-desc = You speak in a way that many others find outdated
|
trait-archaic-accent-desc = You speak in a way that many others find outdated
|
||||||
|
|
||||||
|
trait-accentless-name = Accentless
|
||||||
|
trait-accentless-desc = You don't have the accent that your species would usually have
|
||||||
|
|||||||
@@ -10,4 +10,15 @@
|
|||||||
name: trait-archaic-accent-name
|
name: trait-archaic-accent-name
|
||||||
description: trait-archaic-accent-desc
|
description: trait-archaic-accent-desc
|
||||||
components:
|
components:
|
||||||
- type: ArchaicAccent
|
- type: ArchaicAccent
|
||||||
|
|
||||||
|
- type: trait
|
||||||
|
id: Accentless
|
||||||
|
name: trait-accentless-name
|
||||||
|
description: trait-accentless-desc
|
||||||
|
components:
|
||||||
|
- type: Accentless
|
||||||
|
removes:
|
||||||
|
- type: LizardAccent
|
||||||
|
- type: ReplacementAccent
|
||||||
|
accent: dwarf
|
||||||
|
|||||||
Reference in New Issue
Block a user