Client LuaCsForBarotrauma
AbilityConditionSkill.cs
1 using System.Xml.Linq;
2 
3 namespace Barotrauma.Abilities
4 {
6  {
7  private readonly string skillIdentifier;
8 
9  public AbilityConditionSkill(CharacterTalent characterTalent, ContentXElement conditionElement) : base(characterTalent, conditionElement)
10  {
11  skillIdentifier = conditionElement.GetAttributeString("skillidentifier", "").ToLowerInvariant();
12  }
13 
14  private bool MatchesConditionSpecific(Identifier skillIdentifier)
15  {
16  return this.skillIdentifier == skillIdentifier;
17  }
18 
19  protected override bool MatchesConditionSpecific(AbilityObject abilityObject)
20  {
21  if (abilityObject is IAbilitySkillIdentifier { SkillIdentifier: Identifier skillIdentifier })
22  {
23  return MatchesConditionSpecific(skillIdentifier);
24  }
25  else
26  {
27  LogAbilityConditionError(abilityObject, typeof(IAbilitySkillIdentifier));
28  return false;
29  }
30  }
31  }
32 }
void LogAbilityConditionError(AbilityObject abilityObject, Type expectedData)
AbilityConditionSkill(CharacterTalent characterTalent, ContentXElement conditionElement)
override bool MatchesConditionSpecific(AbilityObject abilityObject)
string? GetAttributeString(string key, string? def)