Client LuaCsForBarotrauma
CharacterAbilityMarkAsLooted.cs
1 namespace Barotrauma.Abilities
2 {
3  internal sealed class CharacterAbilityMarkAsLooted: CharacterAbility
4  {
5  private readonly Identifier identifier;
6  public CharacterAbilityMarkAsLooted(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement) : base(characterAbilityGroup, abilityElement)
7  {
8  identifier = abilityElement.GetAttributeIdentifier("identifier", Identifier.Empty);
9  if (identifier.IsEmpty)
10  {
11  DebugConsole.ThrowError($"Error in talent {CharacterTalent.DebugIdentifier}, identifier is empty in {nameof(CharacterAbilityMarkAsLooted)}.",
12  contentPackage: abilityElement.ContentPackage);
13  }
14  }
15 
16  protected override void ApplyEffect(AbilityObject abilityObject)
17  {
18  if (abilityObject is not IAbilityCharacter { Character: { } character }) { return; }
19 
20  character.MarkedAsLooted.Add(identifier);
21  }
22  }
23 }