ERT tweak (#530)

* tweak values

* tweak spawn logic
This commit is contained in:
Aviu00
2023-11-02 10:49:17 +09:00
committed by Aviu00
parent 890e75826f
commit d9ce4781d3
2 changed files with 8 additions and 2 deletions

View File

@@ -21,6 +21,8 @@ public sealed class GhostRecruitmentSystem : EntitySystem
{
[Dependency] private readonly EuiManager _eui = default!;
[Dependency] private readonly MindSystem _mind = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
private readonly Dictionary<ICommonSession, GhostRecruitmentEuiAccept> _openUis = new();
@@ -57,10 +59,12 @@ public sealed class GhostRecruitmentSystem : EntitySystem
var spawners = GetEventSpawners(recruitmentName).ToList();
// We prioritize the queue, for example, the commander first, and then the engineer
spawners = spawners.OrderBy(o => o.Item2.Priority).ToList();
spawners = spawners.OrderBy(o => o.Item2.Priority).ThenBy(_ => _random.Next()).ToList();
var count = 0;
var maxCount = Math.Max(3, _playerManager.PlayerCount / 6);
var query = EntityQueryEnumerator<GhostRecruitedComponent>();
while (query.MoveNext(out var uid,out var ghostRecruitedComponent))
@@ -72,7 +76,7 @@ public sealed class GhostRecruitmentSystem : EntitySystem
continue;
// if there are too many recruited, then just skip
if(count >= spawners.Count)
if(count >= spawners.Count || count >= maxCount)
continue;
var (spawnerUid, spawnerComponent) = spawners[count];

View File

@@ -98,6 +98,7 @@
- type: GhostRecruitmentSpawnPoint
prototype: RandomHumanoidSpawnerERTSecurity
recruitmentName: ERTRecruitment
priority: 2
- type: Sprite
layers:
- state: green
@@ -111,6 +112,7 @@
- type: GhostRecruitmentSpawnPoint
prototype: RandomHumanoidSpawnerERTSecurityEVA
recruitmentName: ERTRecruitment
priority: 2
- type: Sprite
layers:
- state: green