8 internal sealed
class CheckTalentAction : BinaryOptionAction
10 [Serialize(
"",
IsPropertySaveable.Yes, description:
"Identifier of the talent to check for.")]
11 public Identifier TalentIdentifier {
get;
set; }
14 public Identifier TargetTag {
get;
set; }
16 public CheckTalentAction(ScriptedEvent parentEvent, ContentXElement element) : base(parentEvent, element) { }
18 protected override bool? DetermineSuccess()
20 if (TargetTag.IsEmpty)
29 if (entity is Character character)
31 matchingCharacter = character;
36 return matchingCharacter is not
null && matchingCharacter.HasTalent(TalentIdentifier);
39 public override string ToDebugString()
41 string subActionStr =
"";
44 subActionStr = $
"\n Sub action: {(succeeded.Value ? Success : Failure)?.CurrentSubAction.ColorizeObject()}";
47 return $
"{ToolBox.GetDebugSymbol(DetermineFinished())} {nameof(CheckTalentAction)} -> (Talent: {TalentIdentifier.ColorizeObject()}" +
48 $
" Succeeded: {(succeeded.HasValue ? succeeded.Value.ToString() : "not determined
").ColorizeObject()})" +
readonly ScriptedEvent ParentEvent
IEnumerable< Entity > GetTargets(Identifier tag)
@ Character
Characters only