Localize traitor codeverbs datasets (#35737)

* Localize verbs dataset

* Localize adjectives dataset

* Localize corporations dataset

* Update TraitorRuleSystem to use LocalizedDatasetPrototype instead of DatasetPrototype
This commit is contained in:
MilenVolf
2025-03-10 05:20:05 +03:00
committed by GitHub
parent 75a7407e33
commit b1ddc1a20d
8 changed files with 1053 additions and 1046 deletions

View File

@@ -24,13 +24,13 @@ public sealed partial class TraitorRuleComponent : Component
public ProtoId<NpcFactionPrototype> SyndicateFaction = "Syndicate";
[DataField]
public ProtoId<DatasetPrototype> CodewordAdjectives = "adjectives";
public ProtoId<LocalizedDatasetPrototype> CodewordAdjectives = "Adjectives";
[DataField]
public ProtoId<DatasetPrototype> CodewordVerbs = "verbs";
public ProtoId<LocalizedDatasetPrototype> CodewordVerbs = "Verbs";
[DataField]
public ProtoId<DatasetPrototype> ObjectiveIssuers = "TraitorCorporations";
public ProtoId<LocalizedDatasetPrototype> ObjectiveIssuers = "TraitorCorporations";
/// <summary>
/// Give this traitor an Uplink on spawn.

View File

@@ -12,6 +12,7 @@ using Content.Shared.GameTicking.Components;
using Content.Shared.Mind;
using Content.Shared.NPC.Systems;
using Content.Shared.PDA;
using Content.Shared.Random.Helpers;
using Content.Shared.Roles;
using Content.Shared.Roles.Jobs;
using Content.Shared.Roles.RoleCodeword;
@@ -74,7 +75,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
string[] codewords = new string[finalCodewordCount];
for (var i = 0; i < finalCodewordCount; i++)
{
codewords[i] = _random.PickAndTake(codewordPool);
codewords[i] = Loc.GetString(_random.PickAndTake(codewordPool));
}
return codewords;
}
@@ -98,7 +99,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
briefing = Loc.GetString("traitor-role-codewords-short", ("codewords", string.Join(", ", component.Codewords)));
}
var issuer = _random.Pick(_prototypeManager.Index(component.ObjectiveIssuers).Values);
var issuer = _random.Pick(_prototypeManager.Index(component.ObjectiveIssuers));
// Uplink code will go here if applicable, but we still need the variable if there aren't any
Note[]? code = null;