Mind ecs (#14412)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Linq;
|
||||
using Content.Server.Chat.Managers;
|
||||
using Content.Server.Mind;
|
||||
using Content.Server.Objectives.Interfaces;
|
||||
using Content.Server.Players;
|
||||
using Content.Server.Roles;
|
||||
@@ -36,6 +37,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem
|
||||
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
|
||||
[Dependency] private readonly UplinkSystem _uplink = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
|
||||
[Dependency] private readonly MindSystem _mindSystem = default!;
|
||||
|
||||
private ISawmill _sawmill = default!;
|
||||
|
||||
@@ -254,7 +256,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem
|
||||
|
||||
var antagPrototype = _prototypeManager.Index<AntagPrototype>(TraitorPrototypeID);
|
||||
var traitorRole = new TraitorRole(mind, antagPrototype);
|
||||
mind.AddRole(traitorRole);
|
||||
_mindSystem.AddRole(mind, traitorRole);
|
||||
Traitors.Add(traitorRole);
|
||||
traitorRole.GreetTraitor(Codewords);
|
||||
|
||||
@@ -270,7 +272,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem
|
||||
{
|
||||
var objective = _objectivesManager.GetRandomObjective(traitorRole.Mind, "TraitorObjectiveGroups");
|
||||
if (objective == null) continue;
|
||||
if (traitorRole.Mind.TryAddObjective(objective))
|
||||
if (_mindSystem.TryAddObjective(traitorRole.Mind, objective))
|
||||
difficulty += objective.Difficulty;
|
||||
}
|
||||
|
||||
@@ -342,7 +344,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem
|
||||
foreach (var traitor in Traitors)
|
||||
{
|
||||
var name = traitor.Mind.CharacterName;
|
||||
traitor.Mind.TryGetSession(out var session);
|
||||
_mindSystem.TryGetSession(traitor.Mind, out var session);
|
||||
var username = session?.Name;
|
||||
|
||||
var objectives = traitor.Mind.AllObjectives.ToArray();
|
||||
|
||||
Reference in New Issue
Block a user