Skip to content

Commit

Permalink
New Trait: Sign Language (#677)
Browse files Browse the repository at this point in the history
# Description

**Sign Language** is a 1-point Visual trait that allows you to use
Galactic Sign Language.

## Media


![image](https://github.com/user-attachments/assets/ef9a3ed0-6157-4604-9db4-d7114595195b)


![image](https://github.com/user-attachments/assets/805b4a8f-a2d3-469c-b4ab-e46c787a55b6)


# Changelog

:cl: Skubman
- add: Add a new 1-point trait called Sign Language, a trait that allows
you to communicate in Galactic Sign Language.

---------

Signed-off-by: Angelo Fallaria <[email protected]>
  • Loading branch information
angelofallars committed Aug 5, 2024
1 parent 27c2c35 commit 17aca3c
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Content.Shared.Language;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;

namespace Content.Server.Traits.Assorted;

/// <summary>
/// Used for traits that modify entities' language knowledge.
/// </summary>
[RegisterComponent]
public sealed partial class LanguageKnowledgeModifierComponent : Component
{
/// <summary>
/// List of languages this entity will learn to speak.
/// </summary>
[DataField("speaks")]
public List<string> NewSpokenLanguages = new();

/// <summary>
/// List of languages this entity will learn to understand.
/// </summary>
[DataField("understands")]
public List<string> NewUnderstoodLanguages = new();
}
35 changes: 35 additions & 0 deletions Content.Server/Traits/Assorted/LanguageKnowledgeModifierSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Linq;
using Content.Server.Language;
using Content.Shared.Language.Components;

namespace Content.Server.Traits.Assorted;

public sealed class LanguageKnowledgeModifierSystem : EntitySystem
{
[Dependency] private readonly LanguageSystem _languages = default!;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<LanguageKnowledgeModifierComponent, ComponentInit>(OnStartup);
}

private void OnStartup(Entity<LanguageKnowledgeModifierComponent> entity, ref ComponentInit args)
{
if (!TryComp<LanguageKnowledgeComponent>(entity, out var knowledge))
{
Log.Warning($"Entity {entity.Owner} does not have a LanguageKnowledge but has a LanguageKnowledgeModifier!");
return;
}

foreach (var spokenLanguage in entity.Comp.NewSpokenLanguages)
{
_languages.AddLanguage(entity, spokenLanguage, true, false, knowledge);
}

foreach (var understoodLanguage in entity.Comp.NewUnderstoodLanguages)
{
_languages.AddLanguage(entity, understoodLanguage, false, true, knowledge);
}
}
}
6 changes: 3 additions & 3 deletions Resources/Locale/en-US/language/languages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ language-Moffic-description = The language of the mothpeople borders on complete
language-RobotTalk-name = RobotTalk
language-RobotTalk-description = A language consisting of harsh binary chirps, whistles, hisses, and whines. Organic tongues cannot speak it without aid from special translators.
language-Sign-name = Galactic Sign Language
language-Sign-description = GSL for short, this sign language is prevalent among mute and deaf people.
language-Cat-name = Cat
language-Cat-description = Meow
Expand Down Expand Up @@ -72,6 +75,3 @@ language-Kobold-description = Hiss!
language-Hissing-name = Hissing
language-Hissing-description = Hiss!
language-Sign-name = Sign Language
language-Sign-description = The standard Galactic sign language, used by those that are unable to speak Galactic Common or at all.
5 changes: 5 additions & 0 deletions Resources/Locale/en-US/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ trait-description-Foreigner =
For one reason or another you do not speak this station's primary language.
Instead, you have a translator issued to you that only you can use.
trait-name-SignLanguage = Sign Language
trait-description-SignLanguage =
You can understand and use Galactic Sign Language (GSL).
If you are mute for any reason, you can still communicate with sign language.
trait-name-Voracious = Voracious
trait-description-Voracious =
Nothing gets between you and your food.
Expand Down
11 changes: 11 additions & 0 deletions Resources/Prototypes/Traits/skills.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@
species:
- Felinid

- type: trait
id: SignLanguage
category: Visual
points: -1
components:
- type: LanguageKnowledgeModifier
speaks:
- Sign
understands:
- Sign

- type: trait
id: Voracious
category: Physical
Expand Down

0 comments on commit 17aca3c

Please sign in to comment.