Client LuaCsForBarotrauma
AbilityConditionLevelsBehindHighest.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 levelsBehind;
11  {
12  levelsBehind = conditionElement.GetAttributeInt("levelsbehind", 0);
13  }
14 
15  protected override bool MatchesConditionSpecific()
16  {
17  return Character.GetFriendlyCrew(character).Where(c => c.Info != null && (c.Info.GetCurrentLevel() - character.Info.GetCurrentLevel() >= levelsBehind)).Any();
18  }
19  }
20 }
AbilityConditionLevelsBehindHighest(CharacterTalent characterTalent, ContentXElement conditionElement)
static IEnumerable< Character > GetFriendlyCrew(Character character)
int GetAttributeInt(string key, int def)