Client LuaCsForBarotrauma
AbilityConditionHasDifferentJobs.cs
1 using System.Collections.Generic;
2 using System.Linq;
3 using System.Xml.Linq;
4 
5 namespace Barotrauma.Abilities
6 {
8  {
9  private readonly int amount;
11  {
12  amount = conditionElement.GetAttributeInt("amount", 0);
13  }
14 
15  protected override bool MatchesConditionSpecific()
16  {
17  IEnumerable<Character> crewmembers = Character.GetFriendlyCrew(character);
18  int differentCrewAmount = crewmembers.Select(c => c.Info?.Job?.Prefab.Identifier).Distinct().Count();
19  return differentCrewAmount >= amount;
20  }
21  }
22 }
AbilityConditionHasDifferentJobs(CharacterTalent characterTalent, ContentXElement conditionElement)
static IEnumerable< Character > GetFriendlyCrew(Character character)
int GetAttributeInt(string key, int def)