private async Task <bool> SearchingForGizmo() { if (PluginSettings.Current.BountyZerg) { SafeZerg.Instance.EnableZerg(); } EnablePulse(); _currentGizmo = _guardedGizmos.Values.Where(g => !g.HasBeenOperated) .OrderBy(g => g.Position.DistanceSqr(AdvDia.MyPosition)) .FirstOrDefault(); if (_currentGizmo != null) { State = States.MovingToGizmo; return(false); } if (!await ExplorationCoroutine.Explore(BountyData.LevelAreaIds)) { return(false); } ScenesStorage.Reset(); return(false); }
public void Reset() { State = States.NotStarted; _isDone = false; _guardedGizmos = new Dictionary <Vector3, GuardedGizmo>(); _currentGizmo = null; }
private void PulseChecks() { var gizmos = ZetaDia.Actors.GetActorsOfType <DiaGizmo>(true).Where(g => g.IsFullyValid() && g.ActorSNO == GizmoSNO && g.Distance < ObjectSearchRadius); foreach (var gizmo in gizmos.Where(gizmo => gizmo.IsFullyValid())) { Vector3 position; bool hasBeenOperated; bool untargetable; try { position = gizmo.Position; hasBeenOperated = gizmo.HasBeenOperated; untargetable = gizmo.CommonData.GetAttribute <int>(ActorAttributeType.Untargetable) == 1; } catch (ACDAttributeLookupFailedException) { continue; } catch (Exception ex) { if (ex.Message.Contains("ReadProcessMemory")) { continue; } throw; } GuardedGizmo guardedGizmo; if (!_guardedGizmos.ContainsKey(position)) { guardedGizmo = new GuardedGizmo(); guardedGizmo.Position = position; guardedGizmo.InteractDistance = (int)Math.Round(gizmo.CollisionSphere.Radius + 1, MidpointRounding.AwayFromZero); _guardedGizmos.Add(position, guardedGizmo); } else { guardedGizmo = _guardedGizmos[gizmo.Position]; } guardedGizmo.HasBeenOperated = hasBeenOperated; guardedGizmo.Untargateble = untargetable; } }
private void PulseChecks() { var gizmos = ZetaDia.Actors.GetActorsOfType<DiaGizmo>(true).Where(g => g.IsFullyValid() && g.ActorSNO == GizmoSNO && g.Distance < ObjectSearchRadius); foreach (var gizmo in gizmos.Where(gizmo => gizmo.IsFullyValid())) { Vector3 position; bool hasBeenOperated; bool untargetable; try { position = gizmo.Position; hasBeenOperated = gizmo.HasBeenOperated; untargetable = gizmo.CommonData.GetAttribute<int>(ActorAttributeType.Untargetable) == 1; } catch (ACDAttributeLookupFailedException) { continue; } catch (Exception ex) { if (ex.Message.Contains("ReadProcessMemory")) { continue; } throw; } GuardedGizmo guardedGizmo; if (!_guardedGizmos.ContainsKey(position)) { guardedGizmo = new GuardedGizmo(); guardedGizmo.Position = position; guardedGizmo.InteractDistance = (int)Math.Round(gizmo.CollisionSphere.Radius + 1, MidpointRounding.AwayFromZero); _guardedGizmos.Add(position, guardedGizmo); } else { guardedGizmo = _guardedGizmos[gizmo.Position]; } guardedGizmo.HasBeenOperated = hasBeenOperated; guardedGizmo.Untargateble = untargetable; } }
private async Task<bool> SearchingForGizmo() { if (PluginSettings.Current.BountyZerg) SafeZerg.Instance.EnableZerg(); EnablePulse(); _currentGizmo = _guardedGizmos.Values.Where(g => !g.HasBeenOperated) .OrderBy(g => g.Position.DistanceSqr(AdvDia.MyPosition)) .FirstOrDefault(); if (_currentGizmo != null) { State = States.MovingToGizmo; return false; } if (!await ExplorationCoroutine.Explore(BountyData.LevelAreaIds)) return false; ScenesStorage.Reset(); return false; }
public void Reset() { State = States.NotStarted; _isDone = false; _guardedGizmos = new Dictionary<Vector3, GuardedGizmo>(); _currentGizmo = null; }