make nukies actual antags (#9844)

This commit is contained in:
Nemanja
2022-07-17 17:57:52 -04:00
committed by GitHub
parent 9b3fdc874f
commit d6c4a29dcb

View File

@@ -22,6 +22,7 @@ using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Utility;
using Content.Server.Traitor;
namespace Content.Server.GameTicking.Rules;
@@ -242,20 +243,24 @@ public sealed class NukeopsRuleSystem : GameRuleSystem
for (var i = 0; i < operatives.Count; i++)
{
string name;
string role;
StartingGearPrototype gear;
switch (i)
{
case 0:
name = $"Commander " + _random.PickAndTake<string>(syndicateNamesElite);
role = NukeopsCommanderPrototypeId;
gear = commanderGear;
break;
case 1:
name = $"Agent " + _random.PickAndTake<string>(syndicateNamesNormal);
role = NukeopsPrototypeId;
gear = medicGear;
break;
default:
name = $"Operator " + _random.PickAndTake<string>(syndicateNamesNormal);
role = NukeopsPrototypeId;
gear = starterGear;
break;
}
@@ -266,6 +271,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem
CharacterName = name
};
newMind.ChangeOwningPlayer(session.UserId);
newMind.AddRole(new TraitorRole(newMind, _prototypeManager.Index<AntagPrototype>(role)));
var mob = EntityManager.SpawnEntity("MobHuman", _random.Pick(spawns));
EntityManager.GetComponent<MetaDataComponent>(mob).EntityName = name;