]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Vox nukies and ninjafix (#29783)
authorErrant <35878406+Errant-4@users.noreply.github.com>
Tue, 6 Aug 2024 10:58:28 +0000 (12:58 +0200)
committerGitHub <noreply@github.com>
Tue, 6 Aug 2024 10:58:28 +0000 (20:58 +1000)
* Nukie species gear

* antagselectionsystem autointernals

* nukie vox

* skrek

* Remove duplicate code

* skrek

* EVA tank loadouts, vox ninja update

* fix prototype duplication

* skrek

* fix summary

* fixed empty startinggear error

* enable vox ninjas

* Comments

* removed comment because startinggearprototype should not be used on antagselection aaaanyway

* squish that if

* Update Content.Shared/Clothing/LoadoutSystem.cs

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Content.Server/Antag/AntagSelectionSystem.cs
Content.Server/Antag/Components/AntagSelectionComponent.cs
Content.Shared/Clothing/LoadoutSystem.cs
Resources/Locale/en-US/preferences/loadout-groups.ftl
Resources/Prototypes/GameRules/events.yml
Resources/Prototypes/GameRules/roundstart.yml
Resources/Prototypes/Loadouts/Miscellaneous/survival.yml
Resources/Prototypes/Loadouts/loadout_groups.yml
Resources/Prototypes/Loadouts/role_loadouts.yml
Resources/Prototypes/Roles/Antags/ninja.yml
Resources/Prototypes/Roles/Antags/nukeops.yml

index 496fcbb550df3da205282e54fe22df5012b3daab..64b26509c48edac48383c3b4ea1282388751f874 100644 (file)
@@ -13,11 +13,14 @@ using Content.Server.Roles.Jobs;
 using Content.Server.Shuttles.Components;
 using Content.Server.Station.Systems;
 using Content.Shared.Antag;
+using Content.Shared.Clothing;
 using Content.Shared.GameTicking;
 using Content.Shared.GameTicking.Components;
 using Content.Shared.Ghost;
 using Content.Shared.Humanoid;
 using Content.Shared.Players;
+using Content.Shared.Preferences.Loadouts;
+using Content.Shared.Roles;
 using Content.Shared.Whitelist;
 using Robust.Server.Audio;
 using Robust.Server.GameObjects;
@@ -25,6 +28,7 @@ using Robust.Server.Player;
 using Robust.Shared.Enums;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Utility;
 
@@ -35,10 +39,13 @@ public sealed partial class AntagSelectionSystem : GameRuleSystem<AntagSelection
     [Dependency] private readonly IChatManager _chat = default!;
     [Dependency] private readonly IPlayerManager _playerManager = default!;
     [Dependency] private readonly IServerPreferencesManager _pref = default!;
+    [Dependency] private readonly ActorSystem _actors = default!;
     [Dependency] private readonly AudioSystem _audio = default!;
     [Dependency] private readonly GhostRoleSystem _ghostRole = default!;
     [Dependency] private readonly JobSystem _jobs = default!;
+    [Dependency] private readonly LoadoutSystem _loadout = default!;
     [Dependency] private readonly MindSystem _mind = default!;
+    [Dependency] private readonly IPrototypeManager _proto = default!;
     [Dependency] private readonly RoleSystem _role = default!;
     [Dependency] private readonly StationSpawningSystem _stationSpawning = default!;
     [Dependency] private readonly TransformSystem _transform = default!;
@@ -324,7 +331,13 @@ public sealed partial class AntagSelectionSystem : GameRuleSystem<AntagSelection
 
         // The following is where we apply components, equipment, and other changes to our antagonist entity.
         EntityManager.AddComponents(player, def.Components);
-        _stationSpawning.EquipStartingGear(player, def.StartingGear);
+
+        // Equip the entity's RoleLoadout and LoadoutGroup
+        List<ProtoId<StartingGearPrototype>>? gear = new();
+        if (def.StartingGear is not null)
+            gear.Add(def.StartingGear.Value);
+
+        _loadout.Equip(player, gear, def.RoleLoadout);
 
         if (session != null)
         {
index 1ab16e8aec8744354811a787cdd7bf2eba792ac3..0e5a0afc9bcec4b5809ef4f8796c136063a76573 100644 (file)
@@ -1,6 +1,7 @@
 using Content.Server.Administration.Systems;
 using Content.Shared.Antag;
 using Content.Shared.Destructible.Thresholds;
+using Content.Shared.Preferences.Loadouts;
 using Content.Shared.Roles;
 using Content.Shared.Storage;
 using Content.Shared.Whitelist;
@@ -154,6 +155,12 @@ public partial struct AntagSelectionDefinition()
     [DataField]
     public ProtoId<StartingGearPrototype>? StartingGear;
 
+    /// <summary>
+    /// A list of role loadouts, from which a randomly selected one will be equipped.
+    /// </summary>
+    [DataField]
+    public List<ProtoId<RoleLoadoutPrototype>>? RoleLoadout;
+
     /// <summary>
     /// A briefing shown to the player.
     /// </summary>
index 7605845626e07a5275704168617e41e268bf6299..2a686efd4fffc73d46c4dbcc2c14598f22e9ccd0 100644 (file)
@@ -139,22 +139,37 @@ public sealed class LoadoutSystem : EntitySystem
 
     private void OnMapInit(EntityUid uid, LoadoutComponent component, MapInitEvent args)
     {
-        // Use starting gear if specified
-        if (component.StartingGear != null)
+        Equip(uid, component.StartingGear, component.RoleLoadout);
+    }
+
+    public void Equip(EntityUid uid, List<ProtoId<StartingGearPrototype>>? startingGear,
+        List<ProtoId<RoleLoadoutPrototype>>? loadoutGroups)
+    {
+        // First, randomly pick a startingGear profile from those specified, and equip it.
+        if (startingGear != null && startingGear.Count > 0)
+            _station.EquipStartingGear(uid, _random.Pick(startingGear));
+
+        if (loadoutGroups == null)
         {
-            _station.EquipStartingGear(uid, _random.Pick(component.StartingGear));
+            GearEquipped(uid);
             return;
         }
 
-        if (component.RoleLoadout == null)
-            return;
-
-        // ...otherwise equip from role loadout
-        var id = _random.Pick(component.RoleLoadout);
+        // Then, randomly pick a RoleLoadout profile from those specified, and process/equip all LoadoutGroups from it.
+        // For non-roundstart mobs there is no SelectedLoadout data, so minValue must be set in each LoadoutGroup to force selection.
+        var id = _random.Pick(loadoutGroups);
         var proto = _protoMan.Index(id);
         var loadout = new RoleLoadout(id);
         loadout.SetDefault(GetProfile(uid), _actors.GetSession(uid), _protoMan, true);
         _station.EquipRoleLoadout(uid, loadout, proto);
+
+        GearEquipped(uid);
+    }
+
+    public void GearEquipped(EntityUid uid)
+    {
+        var ev = new StartingGearEquippedEvent(uid);
+        RaiseLocalEvent(uid, ref ev);
     }
 
     public HumanoidCharacterProfile GetProfile(EntityUid? uid)
index 28785e305c8943ef1d2b7e1bd988e836525050f5..b1fba215d9910310bb0fb5b81c917a5eece6c741 100644 (file)
@@ -14,6 +14,7 @@ loadout-group-survival-security = Security Survival Box
 loadout-group-survival-syndicate = Github is forcing me to write text that is literally twice-impossible for the player to ever see, send help
 loadout-group-breath-tool = Species-dependent breath tools
 loadout-group-tank-harness = Species-specific survival equipment
+loadout-group-EVA-tank = Species-specific gas tank
 
 # Command
 loadout-group-captain-head = Captain head
index 01a9f0025728ccd81b7fb988b3d6ee6ea2b5dc19..fe9d6410d042c6776ce384888c7c470649a8ee27 100644 (file)
     minimumPlayers: 30
   - type: SpaceSpawnRule
   - type: AntagLoadProfileRule
-    # Vox disabled until loadouts work on AntagSelection-based spawns
-    speciesOverride: Human
-    speciesOverrideBlacklist:
-    - Vox
   - type: AntagObjectives
     objectives:
     - StealResearchObjective
       max: 1
       pickPlayer: false
       startingGear: SpaceNinjaGear
+      roleLoadout:
+      - RoleSurvivalEVA
       briefing:
         text: ninja-role-greeting
         color: Green
index 3e4ea6d7b313d4b2c0cb4cedf5475a6ff6239143..a10a6c8d2a6f1ed3495d74f96214e1ebb4a24689 100644 (file)
@@ -86,7 +86,7 @@
     #Species that do not work with nukies should be included in this list.
     #Once the issues are fixed the species should be removed from this list to be enabled.
     #Balance concerns are not a valid reason to disable a species, except for high-impact Nukie-specific exploits.
-    - Vox
+    #- Vox
 
 - type: entity
   parent: BaseNukeopsRule
       fallbackRoles: [ Nukeops, NukeopsMedic ]
       spawnerPrototype: SpawnPointNukeopsCommander
       startingGear: SyndicateCommanderGearFull
+      roleLoadout:
+      - RoleSurvivalSyndicate
       components:
       - type: NukeOperative
       - type: RandomMetadata
       fallbackRoles: [ Nukeops, NukeopsCommander ]
       spawnerPrototype: SpawnPointNukeopsMedic
       startingGear: SyndicateOperativeMedicFull
+      roleLoadout:
+      - RoleSurvivalSyndicate
       components:
       - type: NukeOperative
       - type: RandomMetadata
       max: 3
       playerRatio: 10
       startingGear: SyndicateOperativeGearFull
+      roleLoadout:
+      - RoleSurvivalSyndicate
       components:
       - type: NukeOperative
       - type: RandomMetadata
index d308c625067ef4037998d54b242a1b57fd16fff6..001e8a188efb260c20b003ae14e89f05d53c5cbb 100644 (file)
 
 # Pre-equipped species gear
 
-# Full Tank Equipped
+# Full tank for vox as part of any Survival loadout
 - type: loadout
-  id: LoadoutSpeciesEVANitrogen
+  id: LoadoutSpeciesVoxNitrogen
   effects:
   - !type:GroupLoadoutEffect
     proto: EffectSpeciesVox
   equipment:
     suitstorage: NitrogenTankFilled
 
+# Full EVA Tank, Any Species
+- type: loadout
+  id: LoadoutSpeciesEVANitrogen
+  effects:
+  - !type:GroupLoadoutEffect
+    proto: NitrogenBreather
+  equipment:
+    suitstorage: NitrogenTankFilled
+
+- type: loadout
+  id: LoadoutSpeciesEVAOxygen
+  effects:
+  - !type:GroupLoadoutEffect
+    proto: OxygenBreather
+  equipment:
+    suitstorage: OxygenTankFilled
+
 # Tank Harness
 - type: loadout
   id: LoadoutTankHarness
index b1d267cc00c9ca808b1c23923c922f14d2a4798a..1df741b3c768e34e688dd3abf05a929ec4b9eb56 100644 (file)
   loadouts:
   - EmergencyNitrogen
   - EmergencyOxygen
+  - LoadoutSpeciesVoxNitrogen
+
+- type: loadoutGroup
+  id: GroupEVATank
+  name: loadout-group-EVA-tank
+  hidden: true
+  loadouts:
   - LoadoutSpeciesEVANitrogen
+  - LoadoutSpeciesEVAOxygen
 
 # Command
 - type: loadoutGroup
   loadouts:
   - EmergencyNitrogenClown
   - EmergencyOxygenClown
-  - LoadoutSpeciesEVANitrogen
+  - LoadoutSpeciesVoxNitrogen
 
 - type: loadoutGroup
   id: MimeHead
   loadouts:
   - EmergencyNitrogenExtended
   - EmergencyOxygenExtended
-  - LoadoutSpeciesEVANitrogen
+  - LoadoutSpeciesVoxNitrogen
 
 # Science
 - type: loadoutGroup
   loadouts:
   - EmergencyNitrogenSecurity
   - EmergencyOxygenSecurity
-  - LoadoutSpeciesEVANitrogen
+  - LoadoutSpeciesVoxNitrogen
 
 # Medical
 - type: loadoutGroup
   loadouts:
   - EmergencyNitrogenMedical
   - EmergencyOxygenMedical
-  - LoadoutSpeciesEVANitrogen
+  - LoadoutSpeciesVoxNitrogen
 
 # Wildcards
 - type: loadoutGroup
   loadouts:
   - EmergencyNitrogenSyndicate
   - EmergencyOxygenSyndicate
-  - LoadoutSpeciesEVANitrogen
+  - LoadoutSpeciesVoxNitrogen
 
 - type: loadoutGroup
   id: GroupSpeciesBreathTool
index bb30cc182a6131332511b82e39138773f54bf28d..c204f87c93bf60b0c38c183fb02867106497057c 100644 (file)
   - SurvivalSyndicate
   - GroupSpeciesBreathTool
   - GroupTankHarness
+
+- type: roleLoadout
+  id: RoleSurvivalEVA
+  groups:
+  - GroupEVATank
+  - SurvivalExtended
index 6df8a2317eb233d2daab8fd4b7c3bbd3c2c4296c..6a9a65bb13ec8784621b47bf7551c78c4810f9ce 100644 (file)
     pocket1: SpiderCharge
     pocket2: PinpointerStation
     belt: EnergyKatana
-    suitstorage: OxygenTankFilled
   inhand:
     - JetpackBlackFilled
   storage:
     back: # belt holds katana so satchel has the tools for sabotaging things
-    - BoxSurvival
     - Crowbar
     - Wrench
     - Screwdriver
index 8dec692ee56d15c2ce6fb5b8a8df47423122bf43..52d422876f75b875434ec0035838896c82b16a21 100644 (file)
@@ -55,7 +55,6 @@
     belt: ClothingBeltMilitaryWebbing
   storage:
     back:
-    - BoxSurvivalSyndicate
     - WeaponPistolViper
     - PinpointerSyndicateNuclear
     - DeathAcidifierImplanter
@@ -90,7 +89,6 @@
   storage:
     back:
     - SyndiHypo
-    - BoxSurvivalSyndicate
     - SawAdvanced
     - Cautery
     - CombatKnife