From: 2013HORSEMEATSCANDAL <146540817+2013HORSEMEATSCANDAL@users.noreply.github.com> Date: Thu, 16 Nov 2023 21:04:50 +0000 (-0500) Subject: Operations (#21154) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=23b54dae793b4b88e20543505ef10a1324071fd8;p=space-station-14.git Operations (#21154) * Creates an operation name when Nukies spawn. * Fixed each nukie getting a different name * Fixed it again for real this time * commit name * Revert "fix (#20719)" This reverts commit bfa301b53e1697a93e8ccff37fb254bfa0bd4d5a. * Fixed it (for real this time it works now I swear) * Update Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs Co-authored-by: faint <46868845+ficcialfaint@users.noreply.github.com> * shortened variable names * moved a method * typo fix * rewrote the lists in alphabetical order --------- Co-authored-by: faint <46868845+ficcialfaint@users.noreply.github.com> --- diff --git a/Content.Server/GameTicking/Rules/Components/NukeopsRuleComponent.cs b/Content.Server/GameTicking/Rules/Components/NukeopsRuleComponent.cs index 522202df1a..8d9da3646d 100644 --- a/Content.Server/GameTicking/Rules/Components/NukeopsRuleComponent.cs +++ b/Content.Server/GameTicking/Rules/Components/NukeopsRuleComponent.cs @@ -10,6 +10,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Utility; + namespace Content.Server.GameTicking.Rules.Components; [RegisterComponent, Access(typeof(NukeopsRuleSystem), typeof(LoneOpsSpawnRule))] @@ -136,6 +137,9 @@ public sealed partial class NukeopsRuleComponent : Component [DataField(customTypeSerializer: typeof(PrototypeIdSerializer))] public string EliteNames = "SyndicateNamesElite"; + [DataField] + public string OperationName = "Test Operation"; + [DataField(customTypeSerializer: typeof(PrototypeIdSerializer))] public string NormalNames = "SyndicateNamesNormal"; diff --git a/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs b/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs index 779c47885f..2c3136d577 100644 --- a/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs @@ -5,6 +5,7 @@ using Content.Server.Administration.Commands; using Content.Server.Chat.Managers; using Content.Server.Chat.Systems; using Content.Server.Communications; +using Content.Server.RandomMetadata; using Content.Server.GameTicking.Rules.Components; using Content.Server.Ghost.Roles.Components; using Content.Server.Ghost.Roles.Events; @@ -67,6 +68,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem [Dependency] private readonly IServerPreferencesManager _prefs = default!; [Dependency] private readonly MapLoaderSystem _map = default!; [Dependency] private readonly MetaDataSystem _metaData = default!; + [Dependency] private readonly RandomMetadataSystem _randomMetadata = default!; [Dependency] private readonly MindSystem _mind = default!; [Dependency] private readonly NpcFactionSystem _npcFaction = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; @@ -79,6 +81,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem [Dependency] private readonly TagSystem _tag = default!; [Dependency] private readonly WarDeclaratorSystem _warDeclarator = default!; + [ValidatePrototypeId] private const string TelecrystalCurrencyPrototype = "Telecrystal"; @@ -88,6 +91,12 @@ public sealed class NukeopsRuleSystem : GameRuleSystem [ValidatePrototypeId] public const string NukeopsId = "Nukeops"; + [ValidatePrototypeId] + private const string OperationPrefixDataset = "operationPrefix"; + + [ValidatePrototypeId] + private const string OperationSuffixDataset = "operationSuffix"; + public override void Initialize() { base.Initialize(); @@ -344,6 +353,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem return; component.TargetStation = _random.Pick(eligible); + component.OperationName = _randomMetadata.GetRandomFromSegments(new List {OperationPrefixDataset, OperationSuffixDataset}, " "); var filter = Filter.Empty(); var query = EntityQueryEnumerator(); @@ -969,6 +979,19 @@ public sealed class NukeopsRuleSystem : GameRuleSystem } } + /// + /// Display a greeting message and play a sound for a nukie + /// + private void NotifyNukie(ICommonSession session, NukeOperativeComponent nukeop, NukeopsRuleComponent nukeopsRule) + { + if (nukeopsRule.TargetStation is not { } station) + return; + + _chatManager.DispatchServerMessage(session, Loc.GetString("nukeops-welcome", ("station", station), ("name", nukeopsRule.OperationName))); + _audio.PlayGlobal(nukeop.GreetSoundNotification, session); + } + + private void SpawnOperativesForGhostRoles(EntityUid uid, NukeopsRuleComponent? component = null) { if (!Resolve(uid, ref component)) @@ -990,18 +1013,6 @@ public sealed class NukeopsRuleSystem : GameRuleSystem SpawnOperatives(numNukies, operatives, true, component); } - /// - /// Display a greeting message and play a sound for a nukie - /// - private void NotifyNukie(ICommonSession session, NukeOperativeComponent nukeop, NukeopsRuleComponent nukeopsRule) - { - if (nukeopsRule.TargetStation is not { } station) - return; - - _chatManager.DispatchServerMessage(session, Loc.GetString("nukeops-welcome", ("station", station))); - _audio.PlayGlobal(nukeop.GreetSoundNotification, session); - } - //For admins forcing someone to nukeOps. public void MakeLoneNukie(EntityUid mindId, MindComponent mind) { diff --git a/Resources/Locale/en-US/game-ticking/game-presets/preset-nukeops.ftl b/Resources/Locale/en-US/game-ticking/game-presets/preset-nukeops.ftl index 6864688157..1a4fcafbf8 100644 --- a/Resources/Locale/en-US/game-ticking/game-presets/preset-nukeops.ftl +++ b/Resources/Locale/en-US/game-ticking/game-presets/preset-nukeops.ftl @@ -3,7 +3,7 @@ nukeops-description = Nuclear operatives have targeted the station. Try to keep nukeops-welcome = You are a nuclear operative. Your goal is to blow up {$station}, and ensure that it is nothing but a pile of rubble. Your bosses, the Syndicate, have provided you with the tools you'll need for the task. - Death to Nanotrasen! + Operation {$name} is a go ! Death to Nanotrasen! nukeops-opsmajor = [color=crimson]Syndicate major victory![/color] nukeops-opsminor = [color=crimson]Syndicate minor victory![/color] diff --git a/Resources/Prototypes/Datasets/Names/Operation_prefix.yml b/Resources/Prototypes/Datasets/Names/Operation_prefix.yml new file mode 100644 index 0000000000..f9696d71cc --- /dev/null +++ b/Resources/Prototypes/Datasets/Names/Operation_prefix.yml @@ -0,0 +1,105 @@ +- type: dataset + id: operationPrefix + values: + - Ancient + - Angry + - Arachnid + - Atomic + - Benevolent + - Black + - Blessed + - Bloody + - Blue + - Blunt + - Boiling + - Bright + - Burning + - Clean + - Clown + - Cold + - Cursed + - Dark + - Dead + - Deep + - Derelict + - Desert + - Devil's + - Diamond + - Dismal + - Dwarven + - Eastern + - Endless + - Enemy + - Evil + - Exciting + - Explosive + - Extreme + - Fall + - Fresh + - Glorious + - God's + - Gold + - Green + - Grey + - Happy + - Holy + - Hot + - Human + - Illegal + - Impressive + - Iron + - Large + - Lizard + - Lovely + - Lucky + - Magical + - Monkey + - Moth + - Northern + - Nuclear + - Orange + - Outlaw + - Painful + - Phantasmagoric + - Plasma + - Plastic + - Purple + - Red + - Rival + - Robotic + - Robust + - Sad + - Secret + - Shadow + - Sick + - Silver + - Simian + - Skeleton + - Slime + - Southern + - Space + - Spring + - Stealth + - Steel + - Strange + - Summer + - Suspicious + - Tasty + - The + - Traitorous + - Turbo + - Unclean + - Unholy + - Unusual + - Vengeful + - Venomous + - Violent + - War + - Warm + - Weird + - Western + - Wet + - White + - Wild + - Winter + - Yellow diff --git a/Resources/Prototypes/Datasets/Names/Operation_suffix.yml b/Resources/Prototypes/Datasets/Names/Operation_suffix.yml new file mode 100644 index 0000000000..2dd9588dfb --- /dev/null +++ b/Resources/Prototypes/Datasets/Names/Operation_suffix.yml @@ -0,0 +1,104 @@ +- type: dataset + id: operationSuffix + values: + - Abyss + - Action + - Annihilation + - Bag- Bee + - Blast + - Bomb + - Bones + - Botanist + - Cannon + - Captain + - Chef + - City + - Clown + - Coccoon + - Crypt + - Curse + - Darkness + - Daze + - Death + - Den + - Destruction + - Disease + - Dungeon + - Dust + - End + - Energy + - Engine + - Engineer + - Fire + - Fruit + - Galaxy + - Garden + - Gentleman + - Glove + - Guitar + - Heart + - Hole + - Ice + - Janitor + - Justice + - Lady + - Legend + - Life + - Light + - Lighthouse + - Lung + - Mace + - Machine + - Maniac + - Market + - Meatgrinder + - Mime + - Money + - Monkey + - Moon + - Musician + - Offspring + - Organ + - Overdrive + - Pancreas + - Passenger + - Piano + - Pistol + - Pit + - Plains + - Planet + - Pool + - Power + - Puppy + - Rainbow + - Retribution + - Revengeance + - Rifle + - Rubble + - Sandwich + - Scientist + - Secret + - Security + - Shadows + - Shuttle + - Siren + - Soul + - Spell + - Spider + - Spire + - Staff + - Star + - Station + - Storm + - Stranger + - Strike + - Sun + - Sword + - Team + - Tide + - Tomb + - Toolbox + - Trumpet + - Vermin + - Wizard + - Wood