Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language Traits and some fixes #782

Merged
merged 10 commits into from
Jan 13, 2025
30 changes: 30 additions & 0 deletions Content.Server/Jobs/AddTraitSpecial.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Content.Server.Traits;
using Content.Shared.Roles;
using Content.Shared.Traits;
using JetBrains.Annotations;
using Robust.Shared.Prototypes;

namespace Content.Server.Jobs;


[UsedImplicitly]
public sealed partial class AddTraitSpecial : JobSpecial
{
// Datafield for storing multiple trait prototype IDs as strings
[DataField(required: true)]
public HashSet<string> Traits { get; private set; } = new();

public override void AfterEquip(EntityUid mob)
{
// Resolve the necessary systems
var entityManager = IoCManager.Resolve<IEntityManager>();
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
var traitSystem = entityManager.System<TraitSystem>();

// Iterate through each trait and add it to the entity
foreach (var traitId in Traits)
if (prototypeManager.TryIndex<TraitPrototype>(traitId, out var traitPrototype))

traitSystem.AddTrait(mob, traitPrototype);
}
}
2 changes: 2 additions & 0 deletions Resources/IgnoredPrototypes/ignoredPrototypes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
- /Prototypes/Catalog/Jukebox
- /Prototypes/DeltaV/Catalog/Jukebox
- /Prototypes/WhiteDream/Entities/Objects/Runes/cult.yml
- /Prototypes/Traits/species.yml
- /Prototypes/Traits/mental.yml
# Loadouts
- /Prototypes/Loadouts/eyes.yml
- /Prototypes/Loadouts/hands.yml
Expand Down
11 changes: 11 additions & 0 deletions Resources/Locale/en-US/_Nuclear14/traits.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
trait-name-LanguageTribal = Tribal Language
trait-description-LanguageTribal = You can understand and speak the local Tribal language. Whether through learning or backstory.
trait-name-LanguageChinese = Chinese Language
trait-description-Chinese = You can understand and speak the Chinese language. Whether through learning or backstory.

language-English-name = English
language-English-description = The common language of the Wasteland.
language-Chinese-name = Chinese
language-Chinese-description = You can understand and speak the Chinese language. Whether through learning or backstory.
language-Tribal-name = Tribal
language-Tribal-description = You can understand and speak the local Tribal language. Whether through learning or backstory.
6 changes: 2 additions & 4 deletions Resources/Prototypes/Entities/Mobs/Species/human.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@
- Snout
- type: LanguageKnowledge
speaks:
- TauCetiBasic
- SolCommon
- English
understands:
- TauCetiBasic
- SolCommon
- English
- type: FootPrints
- type: PsionicInsulation

Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Roles/Antags/traitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
id: Traitor
name: roles-antag-syndicate-agent-name
antagonist: true
setPreference: true
setPreference: false
objective: roles-antag-syndicate-agent-objective

- type: antag
id: TraitorSleeper
name: roles-antag-syndicate-agent-sleeper-name
antagonist: true
setPreference: true
setPreference: false
objective: roles-antag-syndicate-agent-sleeper-objective

# Syndicate Operative Outfit - Monkey
Expand Down
78 changes: 39 additions & 39 deletions Resources/Prototypes/Traits/inconveniences.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,43 +43,43 @@
threeRandomProb: 0
cutRandomProb: 0

- type: trait
id: ForeignerLight
category: TraitsSpeechLanguages
points: 2
requirements:
- !type:CharacterTraitRequirement
inverted: true
traits:
- Foreigner
- Muted
- !type:CharacterJobRequirement
inverted: true
jobs:
- Mime
functions:
- !type:TraitAddComponent
components:
- type: ForeignerTrait
cantUnderstand: false
baseTranslator: TranslatorForeigner
# - type: trait
# id: ForeignerLight
# category: TraitsSpeechLanguages
# points: 2
# requirements:
# - !type:CharacterTraitRequirement
# inverted: true
# traits:
# - Foreigner
# - Muted
# - !type:CharacterJobRequirement
# inverted: true
# jobs:
# - Mime
# functions:
# - !type:TraitAddComponent
# components:
# - type: ForeignerTrait
# cantUnderstand: false
# baseTranslator: TranslatorForeigner

- type: trait
id: Foreigner
category: TraitsSpeechLanguages
points: 4
requirements: # TODO: Add a requirement to know at least 1 non-gc language
- !type:CharacterTraitRequirement
inverted: true
traits:
- ForeignerLight
- Muted
- !type:CharacterJobRequirement
inverted: true
jobs:
- Mime
functions:
- !type:TraitAddComponent
components:
- type: ForeignerTrait
baseTranslator: TranslatorForeigner
# - type: trait
# id: Foreigner
# category: TraitsSpeechLanguages
# points: 4
# requirements: # TODO: Add a requirement to know at least 1 non-gc language
# - !type:CharacterTraitRequirement
# inverted: true
# traits:
# - ForeignerLight
# - Muted
# - !type:CharacterJobRequirement
# inverted: true
# jobs:
# - Mime
# functions:
# - !type:TraitAddComponent
# components:
# - type: ForeignerTrait
# baseTranslator: TranslatorForeigner
178 changes: 89 additions & 89 deletions Resources/Prototypes/Traits/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,97 +12,97 @@
languagesUnderstood:
- Sign

- type: trait
id: SolCommon
category: TraitsSpeechLanguages
points: 0
requirements:
- !type:CharacterItemGroupRequirement
group: TraitsLanguagesBasic
- !type:CharacterSpeciesRequirement
inverted: true
species:
- Human
functions:
- !type:TraitModifyLanguages
languagesSpoken:
- SolCommon
languagesUnderstood:
- SolCommon
# - type: trait
# id: SolCommon
# category: TraitsSpeechLanguages
# points: 0
# requirements:
# - !type:CharacterItemGroupRequirement
# group: TraitsLanguagesBasic
# - !type:CharacterSpeciesRequirement
# inverted: true
# species:
# - Human
# functions:
# - !type:TraitModifyLanguages
# languagesSpoken:
# - SolCommon
# languagesUnderstood:
# - SolCommon

- type: trait
id: Tradeband
category: TraitsSpeechLanguages
points: 0
requirements:
- !type:CharacterItemGroupRequirement
group: TraitsLanguagesBasic
- !type:CharacterSpeciesRequirement
inverted: true
species:
- Harpy
functions:
- !type:TraitModifyLanguages
languagesSpoken:
- Tradeband
languagesUnderstood:
- Tradeband
# - type: trait
# id: Tradeband
# category: TraitsSpeechLanguages
# points: 0
# requirements:
# - !type:CharacterItemGroupRequirement
# group: TraitsLanguagesBasic
# - !type:CharacterSpeciesRequirement
# inverted: true
# species:
# - Harpy
# functions:
# - !type:TraitModifyLanguages
# languagesSpoken:
# - Tradeband
# languagesUnderstood:
# - Tradeband

- type: trait
id: Freespeak
category: TraitsSpeechLanguages
points: 0
requirements:
- !type:CharacterItemGroupRequirement
group: TraitsLanguagesBasic
functions:
- !type:TraitModifyLanguages
languagesSpoken:
- Freespeak
languagesUnderstood:
- Freespeak
# - type: trait
# id: Freespeak
# category: TraitsSpeechLanguages
# points: 0
# requirements:
# - !type:CharacterItemGroupRequirement
# group: TraitsLanguagesBasic
# functions:
# - !type:TraitModifyLanguages
# languagesSpoken:
# - Freespeak
# languagesUnderstood:
# - Freespeak

- type: trait
id: Elyran
category: TraitsSpeechLanguages
points: 0
requirements:
- !type:CharacterItemGroupRequirement
group: TraitsLanguagesBasic
functions:
- !type:TraitModifyLanguages
languagesSpoken:
- Elyran
languagesUnderstood:
- Elyran
# - type: trait
# id: Elyran
# category: TraitsSpeechLanguages
# points: 0
# requirements:
# - !type:CharacterItemGroupRequirement
# group: TraitsLanguagesBasic
# functions:
# - !type:TraitModifyLanguages
# languagesSpoken:
# - Elyran
# languagesUnderstood:
# - Elyran

- type: trait
id: ValyrianStandard
category: TraitsSpeechLanguages
points: -1
requirements:
- !type:CharacterItemGroupRequirement
group: TraitsLanguagesBasic
functions:
- !type:TraitModifyLanguages
languagesSpoken:
- ValyrianStandard
languagesUnderstood:
- ValyrianStandard
# - type: trait
# id: ValyrianStandard
# category: TraitsSpeechLanguages
# points: -1
# requirements:
# - !type:CharacterItemGroupRequirement
# group: TraitsLanguagesBasic
# functions:
# - !type:TraitModifyLanguages
# languagesSpoken:
# - ValyrianStandard
# languagesUnderstood:
# - ValyrianStandard

- type: trait
id: Azaziba
category: TraitsSpeechLanguages
points: -1
requirements:
- !type:CharacterSpeciesRequirement
species:
- Reptilian
- !type:CharacterItemGroupRequirement
group: TraitsLanguagesBasic
functions:
- !type:TraitModifyLanguages
languagesSpoken:
- Azaziba
languagesUnderstood:
- Azaziba
# - type: trait
# id: Azaziba
# category: TraitsSpeechLanguages
# points: -1
# requirements:
# - !type:CharacterSpeciesRequirement
# species:
# - Reptilian
# - !type:CharacterItemGroupRequirement
# group: TraitsLanguagesBasic
# functions:
# - !type:TraitModifyLanguages
# languagesSpoken:
# - Azaziba
# languagesUnderstood:
# - Azaziba
Loading
Loading