Client LuaCsForBarotrauma
AbilityConditionHasStatusTag.cs
1 using System.Linq;
2 using System.Xml.Linq;
3 
4 namespace Barotrauma.Abilities
5 {
7  {
8  private readonly Identifier tag;
9 
10 
12  {
13  tag = conditionElement.GetAttributeIdentifier("tag", Identifier.Empty);
14  if (tag.IsEmpty)
15  {
16  DebugConsole.AddWarning($"Error in talent \"{characterTalent.Prefab.OriginalName}\" - tag not defined in AbilityConditionHasStatusTag.",
18  }
19  }
20 
21  protected override bool MatchesConditionSpecific()
22  {
23  if (!tag.IsEmpty)
24  {
25  return
26  StatusEffect.DurationList.Any(d => d.Targets.Contains(character) && d.Parent.HasTag(tag)) ||
27  DelayedEffect.DelayList.Any(d => d.Targets.Contains(character) && d.Parent.HasTag(tag));
28  }
29  return false;
30  }
31  }
32 }
AbilityConditionHasStatusTag(CharacterTalent characterTalent, ContentXElement conditionElement)
readonly TalentPrefab Prefab
Identifier GetAttributeIdentifier(string key, string def)
static readonly List< DelayedListElement > DelayList
ContentPackage? ContentPackage
Definition: Prefab.cs:37
StatusEffects can be used to execute various kinds of effects: modifying the state of some entity in ...
static readonly List< DurationListElement > DurationList