public override void Start() { // if no pathing blocks, just randomly pick something. if (this.position == Vector3.zero) { int maxDistance = 30; if (this.theEntity.IsAlert) { this.position = RandomPositionGenerator.CalcAway(this.theEntity, 0, maxDistance, maxDistance, this.theEntity.LastTargetPos); } else { this.position = RandomPositionGenerator.Calc(this.theEntity, maxDistance, maxDistance); } } this.time = 0f; EntityUtilities.ChangeHandholdItem(this.theEntity.entityId, EntityUtilities.Need.Reset); // Turn off the entity jumping, and turn on breaking blocks, to allow for better pathing. if (this.theEntity is EntityAliveSDX) { (theEntity as EntityAliveSDX).canJump = false; (theEntity as EntityAliveSDX).moveHelper.CanBreakBlocks = true; } // Path finding has to be set for Breaking Blocks so it can path through doors PathFinderThread.Instance.FindPath(this.theEntity, this.position, this.theEntity.GetMoveSpeed(), true, this); return; }
public override void Start() { // if no pathing blocks, just randomly pick something. if (this.position == Vector3.zero) { Vector3 vector = Vector3.zero; int num2 = 30; if (this.theEntity.IsAlert) { vector = RandomPositionGenerator.CalcAway(this.theEntity, 0, num2, num2, this.theEntity.LastTargetPos); } else { vector = RandomPositionGenerator.Calc(this.theEntity, num2, num2); } this.position = vector; this.time = 0f; } else { this.time = -60f; } //Vector3 temp = Ent //EntityUtilities.GetNewPositon(this.theEntity.entityId); //if (temp != Vector3.zero) //{ // this.position = temp; // //Give them more time to path find.The CanContinue() stops at 30f, so we'll set it at -90, rather than 0. // this.time = 90f; //} // EntityUtilities.ChangeHandholdItem(this.theEntity.entityId, EntityUtilities.Need.Melee); // Path finding has to be set for Breaking Blocks so it can path through doors PathFinderThread.Instance.FindPath(this.theEntity, this.position, this.theEntity.GetMoveSpeed(), true, this); return; }