]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Operations (#21154)
author2013HORSEMEATSCANDAL <146540817+2013HORSEMEATSCANDAL@users.noreply.github.com>
Thu, 16 Nov 2023 21:04:50 +0000 (16:04 -0500)
committerGitHub <noreply@github.com>
Thu, 16 Nov 2023 21:04:50 +0000 (14:04 -0700)
* 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>
Content.Server/GameTicking/Rules/Components/NukeopsRuleComponent.cs
Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs
Resources/Locale/en-US/game-ticking/game-presets/preset-nukeops.ftl
Resources/Prototypes/Datasets/Names/Operation_prefix.yml [new file with mode: 0644]
Resources/Prototypes/Datasets/Names/Operation_suffix.yml [new file with mode: 0644]

index 522202df1aa98d51f7830a745a248a6b59c25c10..8d9da3646d8ee65c3982edab983132a7c6a03c7c 100644 (file)
@@ -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<DatasetPrototype>))]
     public string EliteNames = "SyndicateNamesElite";
 
+    [DataField]
+    public string OperationName = "Test Operation";
+
     [DataField(customTypeSerializer: typeof(PrototypeIdSerializer<DatasetPrototype>))]
     public string NormalNames = "SyndicateNamesNormal";
 
index 779c47885f2f21c29f3adcb4679537a2cedfc704..2c3136d5777844f83e3a45a5157f1c4ed8143afd 100644 (file)
@@ -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<NukeopsRuleComponent>
     [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<NukeopsRuleComponent>
     [Dependency] private readonly TagSystem _tag = default!;
     [Dependency] private readonly WarDeclaratorSystem _warDeclarator = default!;
 
+
     [ValidatePrototypeId<CurrencyPrototype>]
     private const string TelecrystalCurrencyPrototype = "Telecrystal";
 
@@ -88,6 +91,12 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
     [ValidatePrototypeId<AntagPrototype>]
     public const string NukeopsId = "Nukeops";
 
+    [ValidatePrototypeId<DatasetPrototype>]
+    private const string OperationPrefixDataset = "operationPrefix";
+
+    [ValidatePrototypeId<DatasetPrototype>]
+    private const string OperationSuffixDataset = "operationSuffix";
+
     public override void Initialize()
     {
         base.Initialize();
@@ -344,6 +353,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
             return;
 
         component.TargetStation = _random.Pick(eligible);
+        component.OperationName = _randomMetadata.GetRandomFromSegments(new List<string> {OperationPrefixDataset, OperationSuffixDataset}, " ");
 
         var filter = Filter.Empty();
         var query = EntityQueryEnumerator<NukeOperativeComponent, ActorComponent>();
@@ -969,6 +979,19 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
         }
     }
 
+    /// <summary>
+    /// Display a greeting message and play a sound for a nukie
+    /// </summary>
+    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<NukeopsRuleComponent>
         SpawnOperatives(numNukies, operatives, true, component);
     }
 
-    /// <summary>
-    /// Display a greeting message and play a sound for a nukie
-    /// </summary>
-    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)
     {
index 686468815722b2a0d0390eb3fa905986a91c6e07..1a4fcafbf862d61178eec8323e4ef6114ce9cd1d 100644 (file)
@@ -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 (file)
index 0000000..f9696d7
--- /dev/null
@@ -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 (file)
index 0000000..2dd9588
--- /dev/null
@@ -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