Aspects (#399)
* base * remove redudant shit * implement needed * doc * manager * Commands * Update AspectManager.cs * oops, hardcoded! * fix * похуй * да похуй * увфывфывфывфыв * Update AspectManager.cs * RandomAccentAspect * avoid repeating * FastAndFuriousAccent * Update Aspects.yml * Update FastandFuriousAspect.cs * RandomAppearanceAspect * helpers and some shit * Bombassssssss * DrunkAspect * CargoRich * TraitoredAspect * require info and feature to force aspect * add exec only in lobby * deforce command * Update TraitoredAspect.cs * Prepare for Bloody and Weak Aspects. * comments * WeakWallsAspect * tweak * NoEngineAspect * airunlock aspect * BloodyAspect * WeakAspect * BattledAspect * I Have Two Butts But I must Seat * веса * Update WhiteCVars.cs
This commit is contained in:
@@ -340,6 +340,39 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
|
||||
args.AgentName = Loc.GetString("traitor-round-end-agent-name");
|
||||
}
|
||||
|
||||
public List<(EntityUid Id, MindComponent Mind)> GetAllLivingConnectedTraitors()
|
||||
{
|
||||
var traitors = new List<(EntityUid Id, MindComponent Mind)>();
|
||||
|
||||
var traitorRules = EntityQuery<TraitorRuleComponent>();
|
||||
|
||||
foreach (var traitorRule in traitorRules)
|
||||
{
|
||||
traitors.AddRange(GetLivingConnectedTraitors(traitorRule));
|
||||
}
|
||||
|
||||
return traitors;
|
||||
}
|
||||
|
||||
private List<(EntityUid Id, MindComponent Mind)> GetLivingConnectedTraitors(TraitorRuleComponent traitorRule)
|
||||
{
|
||||
var traitors = new List<(EntityUid Id, MindComponent Mind)>();
|
||||
|
||||
foreach (var traitor in traitorRule.TraitorMinds)
|
||||
{
|
||||
if (TryComp(traitor, out MindComponent? mind) &&
|
||||
mind.OwnedEntity != null &&
|
||||
mind.Session != null &&
|
||||
_mobStateSystem.IsAlive(mind.OwnedEntity.Value) &&
|
||||
mind.CurrentEntity == mind.OwnedEntity)
|
||||
{
|
||||
traitors.Add((traitor, mind));
|
||||
}
|
||||
}
|
||||
|
||||
return traitors;
|
||||
}
|
||||
|
||||
private void OnObjectivesTextPrepend(EntityUid uid, TraitorRuleComponent comp, ref ObjectivesTextPrependEvent args)
|
||||
{
|
||||
args.Text += "\n" + Loc.GetString("traitor-round-end-codewords", ("codewords", string.Join(", ", comp.Codewords)));
|
||||
|
||||
Reference in New Issue
Block a user