Fix declaration of war (#20399)

This commit is contained in:
Repo
2023-09-24 09:00:12 +13:00
committed by GitHub
parent f5ddbcf123
commit 16b70ca8f6
2 changed files with 16 additions and 5 deletions

View File

@@ -122,11 +122,14 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
if (!GameTicker.IsGameRuleAdded(ruleEnt, gameRule)) if (!GameTicker.IsGameRuleAdded(ruleEnt, gameRule))
continue; continue;
var found = nukeops.OperativePlayers.Values.Any(v => v == opUid); if (_mind.TryGetMind(opUid, out var mind, out _))
if (found)
{ {
comps = (nukeops, gameRule); var found = nukeops.OperativePlayers.Values.Any(v => v == mind);
return true; if (found)
{
comps = (nukeops, gameRule);
return true;
}
} }
} }
@@ -990,6 +993,14 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
//ok hardcoded value bad but so is everything else here //ok hardcoded value bad but so is everything else here
_roles.MindAddRole(mindId, new NukeopsRoleComponent { PrototypeId = NukeopsId }, mind); _roles.MindAddRole(mindId, new NukeopsRoleComponent { PrototypeId = NukeopsId }, mind);
if (mind.CurrentEntity != null)
{
foreach (var (nukeops, gameRule) in EntityQuery<NukeopsRuleComponent, GameRuleComponent>())
{
nukeops.OperativePlayers.Add(mind.CharacterName!, mind.CurrentEntity.GetValueOrDefault());
}
}
SetOutfitCommand.SetOutfit(mind.OwnedEntity.Value, "SyndicateOperativeGearFull", EntityManager); SetOutfitCommand.SetOutfit(mind.OwnedEntity.Value, "SyndicateOperativeGearFull", EntityManager);
} }

View File

@@ -1,7 +1,7 @@
- type: entity - type: entity
parent: BaseItem parent: BaseItem
id: NukeOpsDeclarationOfWar id: NukeOpsDeclarationOfWar
name: the declaration of war name: declaration of war
description: Use to send a declaration of hostilities to the target, delaying your shuttle departure while they prepare for your assault. Such a brazen move will attract the attention of powerful benefactors within the Syndicate, who will supply your team with a massive amount of bonus telecrystals. Must be used at start of mission, or your benefactors will lose interest. description: Use to send a declaration of hostilities to the target, delaying your shuttle departure while they prepare for your assault. Such a brazen move will attract the attention of powerful benefactors within the Syndicate, who will supply your team with a massive amount of bonus telecrystals. Must be used at start of mission, or your benefactors will lose interest.
components: components:
- type: Sprite - type: Sprite