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 bfa301b53e.

* 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>
This commit is contained in:
2013HORSEMEATSCANDAL
2023-11-16 16:04:50 -05:00
committed by GitHub
parent c177b4eb41
commit 23b54dae79
5 changed files with 237 additions and 13 deletions

View 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";

View 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)
{

View 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]

View File

@@ -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

View File

@@ -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