public override void RunBehaviorTree() { if (Me.IsChild) { return; } if (CurrentTarget != null) { if (IsAware) { if (Me.DistanceTo(CurrentTarget) > 4 || WaitForAnimation(AnimNoticeHash)) { GoTo(CurrentTarget.Position); if (CurrentTarget.Interaction.RunInteraction(Me)) { Stop(); IsAware = false; CurrentTarget = null; } } return; } if (Me.DistanceTo(CurrentTarget) > 2) { PlayAnimation(AnimNoticeHash); IsAware = true; return; } if (Me.DistanceTo(CurrentTarget) > BrainModule.AwarenessRadius) { CurrentTarget = null; return; } return; } CurrentTarget = Awareness.Find("KFC", true); }
public override void RunBehaviorTree() { if (Me.IsChild) { return; } Entity friend = Awareness.Find("Duck"); if (friend != null) { Leash(friend, 0.5f, 1.5f); return; } if (Me.DistanceTo(PlayerEntity.Player) < 4) { Leash(PlayerEntity.Player, 1.5f, 2); return; } Stop(); }