Client LuaCsForBarotrauma
AbilityConditionNoCrewDied.cs
1 namespace Barotrauma.Abilities
2 {
4  {
5  public bool assistantsDontCount;
6 
7  public AbilityConditionNoCrewDied(CharacterTalent characterTalent, ContentXElement conditionElement) : base(characterTalent, conditionElement)
8  {
9  assistantsDontCount = conditionElement.GetAttributeBool(nameof(assistantsDontCount), true);
10  }
11 
12  protected override bool MatchesConditionSpecific()
13  {
14  if (GameMain.GameSession == null) { return false; }
15 
17  {
18  if (assistantsDontCount && character.Info?.Job?.Prefab.Identifier == "assistant")
19  {
20  continue;
21  }
22  if (character.CauseOfDeath != null && character.CauseOfDeath.Type != CauseOfDeathType.Disconnected)
23  {
24  return false;
25  }
26  }
27  return true;
28  }
29  }
30 }
AbilityConditionNoCrewDied(CharacterTalent characterTalent, ContentXElement conditionElement)
readonly CauseOfDeathType Type
Definition: CauseOfDeath.cs:12
bool GetAttributeBool(string key, bool def)
static GameSession?? GameSession
Definition: GameMain.cs:88
JobPrefab Prefab
Definition: Job.cs:18
readonly Identifier Identifier
Definition: Prefab.cs:34