Fix traitors not knowing who their friends are.

This commit is contained in:
Víctor Aguilera Puerto
2020-08-20 01:11:43 +02:00
parent f4909cdb98
commit 45380c129b
2 changed files with 17 additions and 1 deletions

View File

@@ -24,7 +24,7 @@ namespace Content.Server.Mobs.Roles
base.Greet();
var chat = IoCManager.Resolve<IChatManager>();
chat.DispatchServerMessage(Mind.Session, $"You're a {Name}!");
chat.DispatchServerMessage(Mind.Session, $"You're an {Name}!");
chat.DispatchServerMessage(Mind.Session, $"Objective: {Objective}");
}
}

View File

@@ -1,5 +1,8 @@
using Content.Server.GameObjects.Components.Suspicion;
using Content.Server.Interfaces.Chat;
using Content.Shared.Roles;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.Mobs.Roles
@@ -26,6 +29,19 @@ namespace Content.Server.Mobs.Roles
var chat = IoCManager.Resolve<IChatManager>();
chat.DispatchServerMessage(Mind.Session, $"You're a {Name}!");
chat.DispatchServerMessage(Mind.Session, $"Objective: {Objective}");
var traitors = "";
foreach (var sus in IoCManager.Resolve<IComponentManager>().EntityQuery<SuspicionRoleComponent>())
{
if (!sus.IsTraitor()) continue;
if (traitors.Length > 0)
traitors += $", {sus.Owner.Name}";
else
traitors += sus.Owner.Name;
}
chat.DispatchServerMessage(Mind.Session, $"The traitors are: {traitors}");
}
}
}