Station AI (#30944)

* Station AI overlay

* implement

* Bunch of ports

* Fix a heap of bugs and basic scouting

* helldivers

* Shuffle interactions a bit

* navmap stuff

* Revert "navmap stuff"

This reverts commit d1f89dd4be83233e22cf5dd062b2581f3c6da062.

* AI wires implemented

* Fix examines

* Optimise the overlay significantly

* Back to old static

* BUI radial working

* lots of work

* Saving work

* thanks fork

* alright

* pc

* AI upload console

* AI upload

* stuff

* Fix copy-paste shitcode

* AI actions

* navmap work

* Fixes

* first impressions

* a

* reh

* Revert "navmap work"

This reverts commit 6f63fea6e9245e189f368f97be3e32e9b210580e.

# Conflicts:
#	Content.Client/Silicons/StationAi/StationAiOverlay.cs

* OD

* radar

* weh

* Fix examines

* scoop mine eyes

* fixes

* reh

* Optimise

* Final round of optimisations

* Fixes

* fixes
This commit is contained in:
metalgearsloth
2024-08-28 10:57:12 +10:00
committed by GitHub
parent 3a4affd438
commit afd0618a60
153 changed files with 2384 additions and 344 deletions

View File

@@ -17,6 +17,7 @@ using Content.Shared.Humanoid.Prototypes;
using Content.Shared.PDA;
using Content.Shared.Preferences;
using Content.Shared.Preferences.Loadouts;
using Content.Shared.Preferences.Loadouts.Effects;
using Content.Shared.Random;
using Content.Shared.Random.Helpers;
using Content.Shared.Roles;
@@ -150,6 +151,22 @@ public sealed class StationSpawningSystem : SharedStationSpawningSystem
EntityUid? entity = null)
{
_prototypeManager.TryIndex(job?.Prototype ?? string.Empty, out var prototype);
RoleLoadout? loadout = null;
// Need to get the loadout up-front to handle names if we use an entity spawn override.
var jobLoadout = LoadoutSystem.GetJobPrototype(prototype?.ID);
if (_prototypeManager.TryIndex(jobLoadout, out RoleLoadoutPrototype? roleProto))
{
profile?.Loadouts.TryGetValue(jobLoadout, out loadout);
// Set to default if not present
if (loadout == null)
{
loadout = new RoleLoadout(jobLoadout);
loadout.SetDefault(profile, _actors.GetSession(entity), _prototypeManager);
}
}
// If we're not spawning a humanoid, we're gonna exit early without doing all the humanoid stuff.
if (prototype?.JobEntity != null)
@@ -157,6 +174,13 @@ public sealed class StationSpawningSystem : SharedStationSpawningSystem
DebugTools.Assert(entity is null);
var jobEntity = EntityManager.SpawnEntity(prototype.JobEntity, coordinates);
MakeSentientCommand.MakeSentient(jobEntity, EntityManager);
// Make sure custom names get handled, what is gameticker control flow whoopy.
if (loadout != null)
{
EquipRoleName(jobEntity, loadout, roleProto!);
}
DoJobSpecials(job, jobEntity);
_identity.QueueIdentityUpdate(jobEntity);
return jobEntity;
@@ -188,21 +212,9 @@ public sealed class StationSpawningSystem : SharedStationSpawningSystem
profile = HumanoidCharacterProfile.RandomWithSpecies(speciesId);
}
var jobLoadout = LoadoutSystem.GetJobPrototype(prototype?.ID);
if (_prototypeManager.TryIndex(jobLoadout, out RoleLoadoutPrototype? roleProto))
if (loadout != null)
{
RoleLoadout? loadout = null;
profile?.Loadouts.TryGetValue(jobLoadout, out loadout);
// Set to default if not present
if (loadout == null)
{
loadout = new RoleLoadout(jobLoadout);
loadout.SetDefault(profile, _actors.GetSession(entity), _prototypeManager);
}
EquipRoleLoadout(entity.Value, loadout, roleProto);
EquipRoleLoadout(entity.Value, loadout, roleProto!);
}
if (prototype?.StartingGear != null)