public override bool CanExecute() { DisplayLog("CanExecute() Start"); bool result = false; if (entityAliveSDX) { result = entityAliveSDX.CanExecuteTask(EntityAliveSDX.Orders.Follow); DisplayLog("CanExecute() Follow Task? " + result); // Since SetPatrol also uses this method, we'll add an extra check. if (result == false) { result = entityAliveSDX.CanExecuteTask(EntityAliveSDX.Orders.SetPatrolPoint); DisplayLog(" CanExecute() Set Patrol Point? " + result); } } if (!this.theEntity.Buffs.HasCustomVar("Leader")) { DisplayLog("CanExecute() No Leader"); result = false; } // Change the distance allowed each time. This will give it more of a variety in how close it can get to you. distanceToEntity = UnityEngine.Random.Range(2f, 5.0f); // If there is an entity in bounds, then let this AI Task roceed. Otherwise, don't do anything with it. if (result) { result = ConfigureTargetEntity(); DisplayLog("CanExecute() Configure Target Result: " + result); } DisplayLog("CanExecute() End: " + result); return(result); }
public override bool CanExecute() { return(false); DisplayLog("CanExecute()"); bool result = false; if (entityAliveSDX) { result = entityAliveSDX.CanExecuteTask(EntityAliveSDX.Orders.Loot); DisplayLog("CanExecute() Loot Task? " + result); if (result == false) { return(false); } } if (FindBoundsOfPrefab()) { DisplayLog(" Within the Bounds of a Prefab"); ScanForTileEntityInList(); DisplayLog(" Searching for closes container: " + this.lstTileContainers.Count); result = FindNearestContainer(); } DisplayLog("CanExecute() End: " + result); return(result); }
public override bool CanExecute() { DisplayLog("CanExecute() Start"); bool result = false; if (entityAliveSDX) { result = entityAliveSDX.CanExecuteTask(EntityAliveSDX.Orders.Patrol); DisplayLog("CanExecute() Follow Task? " + result); if (result == false) { return(false); } } // if The entity is busy, don't continue patrolling. bool isBusy = false; if (this.theEntity.emodel.avatarController.TryGetBool("IsBusy", out isBusy)) { if (isBusy) { return(true); } } //if (!FetchOrders()) // result = false; SetPatrolVectors(); if (entityAliveSDX.PatrolCoordinates.Count > 0) { if (PatrolPointsCounter > entityAliveSDX.PatrolCoordinates.Count - 1) { PatrolPointsCounter = entityAliveSDX.PatrolCoordinates.Count - 1; } } else { return(false); } this.theEntity.SetInvestigatePosition(this.lstPatrolPoints[PatrolPointsCounter], 1200); if (this.theEntity.HasInvestigatePosition) { DisplayLog(" I have an intesgation Position. Starting to Patrol"); this.theEntity.emodel.avatarController.SetTrigger("IsPatrolling"); result = true; } DisplayLog("CanExecute() End: " + result); return(result); }