1 using System.Collections.Generic;
12 public Identifier
NPCTag {
get;
set; }
15 public bool Wait {
get;
set; }
17 private bool isFinished =
false;
22 private IEnumerable<Character> affectedNpcs;
24 public override void Update(
float deltaTime)
26 if (isFinished) {
return; }
30 foreach (var npc
in affectedNpcs)
32 if (npc.Removed) {
continue; }
40 FaceTargetOnCompleted =
false,
41 OverridePriority = 100.0f,
42 SourceEventAction =
this,
46 humanAiController.ObjectiveManager.AddObjective(gotoObjective);
47 humanAiController.ObjectiveManager.WaitTimer = 0.0f;
51 AbandonGoToObjectives(humanAiController);
64 if (affectedNpcs !=
null)
66 foreach (var npc
in affectedNpcs)
68 if (npc.Removed || npc.AIController is not
HumanAIController aiController) {
continue; }
69 AbandonGoToObjectives(aiController);
82 gotoObjective.Abandon =
true;
89 return $
"{ToolBox.GetDebugSymbol(isFinished)} {nameof(NPCWaitAction)} -> (NPCTag: {NPCTag.ColorizeObject()}, Wait: {Wait.ColorizeObject()})";
EventAction SourceEventAction
Which event action (if any) created this objective
List< AIObjective > Objectives
Excluding the current order.
readonly ScriptedEvent ParentEvent
AIObjectiveManager ObjectiveManager
Makes an NPC stop and wait.
override bool IsFinished(ref string goTo)
Has the action finished.
NPCWaitAction(ScriptedEvent parentEvent, ContentXElement element)
override void Update(float deltaTime)
override string ToDebugString()
Rich test to display in debugdraw
IEnumerable< Entity > GetTargets(Identifier tag)