Exemplo n.º 1
0
        private bool FindGatherSpot()
        {
            if (GatherSpot != null)
            {
                return(false);
            }

            if (GatherSpots != null && Node.Location.Distance3D(ExProfileBehavior.Me.Location) > Distance)
            {
                GatherSpot =
                    GatherSpots.OrderBy(gs => gs.NodeLocation.Distance3D(Node.Location))
                    .FirstOrDefault(gs => gs.NodeLocation.Distance3D(Node.Location) <= Distance);
            }

            // Either GatherSpots is null, the node is already in range, or there are no matches, use fallback
            if (GatherSpot == null)
            {
                if (Node == null || Node.Location == Vector3.Zero)
                {
                    ResetInternal();
                    return(false);
                }

                SetFallbackGatherSpot(Node.Location, true);
            }

            Logger.Info(Localization.Localization.ExGather_GatherSpotSet + GatherSpot);

            return(true);
        }
Exemplo n.º 2
0
 internal void ResetInternal()
 {
     interactedWithNode = false;
     GatherSpot         = null;
     Node            = null;
     GatherItem      = null;
     CollectableItem = null;
 }
Exemplo n.º 3
0
        private void SetFallbackGatherSpot(Vector3 location, bool useMesh)
        {
            switch (DefaultGatherSpotType)
            {
            // TODO: Smart stealth implementation (where any enemy within x distance and i'm not behind them, use stealth approach and set stealth location as current)
            // If flying, land in area closest to node not in sight of an enemy and stealth.
            case GatherSpotType.StealthGatherSpot:
                GatherSpot = new StealthGatherSpot {
                    NodeLocation = location, UseMesh = useMesh
                };
                break;

            // ReSharper disable once RedundantCaseLabel
            case GatherSpotType.GatherSpot:
            default:
                GatherSpot = new GatherSpot {
                    NodeLocation = location, UseMesh = useMesh
                };
                break;
            }
        }
Exemplo n.º 4
0
		private bool FindGatherSpot()
		{
			if (GatherSpot != null)
			{
				return false;
			}

			if (GatherSpots != null && Node.Location.Distance3D(Me.Location) > Distance)
			{
				GatherSpot =
					GatherSpots.OrderBy(gs => gs.NodeLocation.Distance3D(Node.Location))
						.FirstOrDefault(gs => gs.NodeLocation.Distance3D(Node.Location) <= Distance);
			}

			// Either GatherSpots is null, the node is already in range, or there are no matches, use fallback
			if (GatherSpot == null)
			{
				SetFallbackGatherSpot(Node.Location, true);
			}

			Logger.Info("GatherSpot set -> " + GatherSpot);

			return true;
		}
Exemplo n.º 5
0
		internal void ResetInternal()
		{
			interactedWithNode = false;
			GatherSpot = null;
			Node = null;
			GatherItem = null;
			CollectableItem = null;
		}
Exemplo n.º 6
0
		private void SetFallbackGatherSpot(Vector3 location, bool useMesh)
		{
			switch (DefaultGatherSpotType)
			{
				// TODO: Smart stealth implementation (where any enemy within x distance and i'm not behind them, use stealth approach and set stealth location as current)
				// If flying, land in area closest to node not in sight of an enemy and stealth.
				case GatherSpotType.StealthApproachGatherSpot:
				case GatherSpotType.StealthGatherSpot:
					GatherSpot = new StealthGatherSpot { NodeLocation = location, UseMesh = useMesh };
					break;
				// ReSharper disable once RedundantCaseLabel
				case GatherSpotType.GatherSpot:
				default:
					GatherSpot = new GatherSpot { NodeLocation = location, UseMesh = useMesh };
					break;
			}
		}
Exemplo n.º 7
0
		private bool FindGatherSpot()
		{
			if (GatherSpot != null)
			{
				return false;
			}

			if (GatherSpots != null && Node.Location.Distance3D(ExProfileBehavior.Me.Location) > Distance)
			{
				GatherSpot =
					GatherSpots.OrderBy(gs => gs.NodeLocation.Distance3D(Node.Location))
						.FirstOrDefault(gs => gs.NodeLocation.Distance3D(Node.Location) <= Distance);
			}

			// Either GatherSpots is null, the node is already in range, or there are no matches, use fallback
			if (GatherSpot == null)
			{
				if (Node == null || Node.Location == Vector3.Zero)
				{
					ResetInternal();
					return false;
				}

				SetFallbackGatherSpot(Node.Location, true);
			}

			Logger.Info(Localization.Localization.ExGather_GatherSpotSet + GatherSpot);

			return true;
		}