diff --git a/Content.Server/RatKing/RatKingComponent.cs b/Content.Server/RatKing/RatKingComponent.cs index 4bdfcf216f..08fc92f108 100644 --- a/Content.Server/RatKing/RatKingComponent.cs +++ b/Content.Server/RatKing/RatKingComponent.cs @@ -1,4 +1,5 @@ using Content.Shared.Actions.ActionTypes; +using Content.Shared.Dataset; using Content.Shared.Disease; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; @@ -43,5 +44,11 @@ namespace Content.Server.RatKing /// [ViewVariables, DataField("molesMiasmaPerDomain")] public float MolesMiasmaPerDomain = 100f; + + // Both of these are used to generate the random name for rat king. + [DataField("titleNameDataset", customTypeSerializer: typeof(PrototypeIdSerializer))] + public string TitleNameDataset = "RegalRatNameTitle"; + [DataField("kingdomNameDataset", customTypeSerializer: typeof(PrototypeIdSerializer))] + public string KingdomNameDataset = "RegalRatNameKingdom"; } }; diff --git a/Content.Server/RatKing/RatKingSystem.cs b/Content.Server/RatKing/RatKingSystem.cs index 81176e4221..c4c84038db 100644 --- a/Content.Server/RatKing/RatKingSystem.cs +++ b/Content.Server/RatKing/RatKingSystem.cs @@ -6,13 +6,18 @@ using Content.Server.Nutrition.Components; using Content.Server.Popups; using Content.Shared.Actions; using Content.Shared.Atmos; +using Content.Shared.Dataset; using Robust.Server.GameObjects; using Robust.Shared.Player; +using Robust.Shared.Prototypes; +using Robust.Shared.Random; namespace Content.Server.RatKing { public sealed class RatKingSystem : EntitySystem { + [Dependency] private readonly IPrototypeManager _proto = default!; + [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly PopupSystem _popup = default!; [Dependency] private readonly ActionsSystem _action = default!; [Dependency] private readonly AtmosphereSystem _atmos = default!; @@ -32,6 +37,11 @@ namespace Content.Server.RatKing { _action.AddAction(uid, component.ActionRaiseArmy, null); _action.AddAction(uid, component.ActionDomain, null); + + var kingdom = _proto.Index(component.KingdomNameDataset); + var title = _proto.Index(component.TitleNameDataset); + + MetaData(uid).EntityName = $"{_random.Pick(kingdom.Values)} {_random.Pick(title.Values)}"; } /// diff --git a/Resources/Prototypes/Datasets/Names/regalrat.yml b/Resources/Prototypes/Datasets/Names/regalrat.yml new file mode 100644 index 0000000000..99f78a8696 --- /dev/null +++ b/Resources/Prototypes/Datasets/Names/regalrat.yml @@ -0,0 +1,39 @@ +- type: dataset + id: RegalRatNameKingdom + values: + - Plague + - Miasma + - Maintenance + - Trash + - Garbage + - Rat + - Vermin + - Cheese + - Munching + - Big + - Filth + - Sewer + - Disposal + - Service + - The + +- type: dataset + id: RegalRatNameTitle + values: + - King + - Lord + - Prince + - Emperor + - Supreme + - Overlord + - Master + - Shogun + - Bojar + - Tsar + - Fan #vs + - Enjoyer + - President + - Mayor + - Boss + - Prophet + - Cheese \ No newline at end of file