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:
committed by
GitHub
parent
c177b4eb41
commit
23b54dae79
@@ -10,6 +10,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|||||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
|
|
||||||
namespace Content.Server.GameTicking.Rules.Components;
|
namespace Content.Server.GameTicking.Rules.Components;
|
||||||
|
|
||||||
[RegisterComponent, Access(typeof(NukeopsRuleSystem), typeof(LoneOpsSpawnRule))]
|
[RegisterComponent, Access(typeof(NukeopsRuleSystem), typeof(LoneOpsSpawnRule))]
|
||||||
@@ -136,6 +137,9 @@ public sealed partial class NukeopsRuleComponent : Component
|
|||||||
[DataField(customTypeSerializer: typeof(PrototypeIdSerializer<DatasetPrototype>))]
|
[DataField(customTypeSerializer: typeof(PrototypeIdSerializer<DatasetPrototype>))]
|
||||||
public string EliteNames = "SyndicateNamesElite";
|
public string EliteNames = "SyndicateNamesElite";
|
||||||
|
|
||||||
|
[DataField]
|
||||||
|
public string OperationName = "Test Operation";
|
||||||
|
|
||||||
[DataField(customTypeSerializer: typeof(PrototypeIdSerializer<DatasetPrototype>))]
|
[DataField(customTypeSerializer: typeof(PrototypeIdSerializer<DatasetPrototype>))]
|
||||||
public string NormalNames = "SyndicateNamesNormal";
|
public string NormalNames = "SyndicateNamesNormal";
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using Content.Server.Administration.Commands;
|
|||||||
using Content.Server.Chat.Managers;
|
using Content.Server.Chat.Managers;
|
||||||
using Content.Server.Chat.Systems;
|
using Content.Server.Chat.Systems;
|
||||||
using Content.Server.Communications;
|
using Content.Server.Communications;
|
||||||
|
using Content.Server.RandomMetadata;
|
||||||
using Content.Server.GameTicking.Rules.Components;
|
using Content.Server.GameTicking.Rules.Components;
|
||||||
using Content.Server.Ghost.Roles.Components;
|
using Content.Server.Ghost.Roles.Components;
|
||||||
using Content.Server.Ghost.Roles.Events;
|
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 IServerPreferencesManager _prefs = default!;
|
||||||
[Dependency] private readonly MapLoaderSystem _map = default!;
|
[Dependency] private readonly MapLoaderSystem _map = default!;
|
||||||
[Dependency] private readonly MetaDataSystem _metaData = default!;
|
[Dependency] private readonly MetaDataSystem _metaData = default!;
|
||||||
|
[Dependency] private readonly RandomMetadataSystem _randomMetadata = default!;
|
||||||
[Dependency] private readonly MindSystem _mind = default!;
|
[Dependency] private readonly MindSystem _mind = default!;
|
||||||
[Dependency] private readonly NpcFactionSystem _npcFaction = default!;
|
[Dependency] private readonly NpcFactionSystem _npcFaction = default!;
|
||||||
[Dependency] private readonly PopupSystem _popupSystem = 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 TagSystem _tag = default!;
|
||||||
[Dependency] private readonly WarDeclaratorSystem _warDeclarator = default!;
|
[Dependency] private readonly WarDeclaratorSystem _warDeclarator = default!;
|
||||||
|
|
||||||
|
|
||||||
[ValidatePrototypeId<CurrencyPrototype>]
|
[ValidatePrototypeId<CurrencyPrototype>]
|
||||||
private const string TelecrystalCurrencyPrototype = "Telecrystal";
|
private const string TelecrystalCurrencyPrototype = "Telecrystal";
|
||||||
|
|
||||||
@@ -88,6 +91,12 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
|||||||
[ValidatePrototypeId<AntagPrototype>]
|
[ValidatePrototypeId<AntagPrototype>]
|
||||||
public const string NukeopsId = "Nukeops";
|
public const string NukeopsId = "Nukeops";
|
||||||
|
|
||||||
|
[ValidatePrototypeId<DatasetPrototype>]
|
||||||
|
private const string OperationPrefixDataset = "operationPrefix";
|
||||||
|
|
||||||
|
[ValidatePrototypeId<DatasetPrototype>]
|
||||||
|
private const string OperationSuffixDataset = "operationSuffix";
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
@@ -344,6 +353,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
component.TargetStation = _random.Pick(eligible);
|
component.TargetStation = _random.Pick(eligible);
|
||||||
|
component.OperationName = _randomMetadata.GetRandomFromSegments(new List<string> {OperationPrefixDataset, OperationSuffixDataset}, " ");
|
||||||
|
|
||||||
var filter = Filter.Empty();
|
var filter = Filter.Empty();
|
||||||
var query = EntityQueryEnumerator<NukeOperativeComponent, ActorComponent>();
|
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)
|
private void SpawnOperativesForGhostRoles(EntityUid uid, NukeopsRuleComponent? component = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref component))
|
if (!Resolve(uid, ref component))
|
||||||
@@ -990,18 +1013,6 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
|||||||
SpawnOperatives(numNukies, operatives, true, component);
|
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.
|
//For admins forcing someone to nukeOps.
|
||||||
public void MakeLoneNukie(EntityUid mindId, MindComponent mind)
|
public void MakeLoneNukie(EntityUid mindId, MindComponent mind)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ nukeops-description = Nuclear operatives have targeted the station. Try to keep
|
|||||||
|
|
||||||
nukeops-welcome =
|
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.
|
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-opsmajor = [color=crimson]Syndicate major victory![/color]
|
||||||
nukeops-opsminor = [color=crimson]Syndicate minor victory![/color]
|
nukeops-opsminor = [color=crimson]Syndicate minor victory![/color]
|
||||||
|
|||||||
105
Resources/Prototypes/Datasets/Names/Operation_prefix.yml
Normal file
105
Resources/Prototypes/Datasets/Names/Operation_prefix.yml
Normal 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
|
||||||
104
Resources/Prototypes/Datasets/Names/Operation_suffix.yml
Normal file
104
Resources/Prototypes/Datasets/Names/Operation_suffix.yml
Normal 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
|
||||||
Reference in New Issue
Block a user