示例#1
0
        public static bool IsGizmoInteractable(DiaGizmo gizmo)
        {
            if (!gizmo.IsFullyValid())
            {
                return(false);
            }
            if (GuardedGizmos.Contains(gizmo.ActorSNO) && gizmo.HasBeenOperated)
            {
                return(false);
            }
            if (GuardedGizmos.Contains(gizmo.ActorSNO) && !gizmo.HasBeenOperated && gizmo.CommonData.GetAttribute <int>(ActorAttributeType.Untargetable) != 1)
            {
                return(true);
            }
            switch (gizmo.CommonData.GizmoType)
            {
            case GizmoType.Portal:
            case GizmoType.DungeonPortal:
                return(!AdvDia.CurrentWorldMarkers.Any(m => m.Position.Distance2D(gizmo.Position) < 10 && EntryPortals.IsEntryPortal(AdvDia.CurrentWorldDynamicId, m.NameHash)));

            case GizmoType.PortalDestination:
            case GizmoType.PoolOfReflection:
            case GizmoType.Headstone:
            case GizmoType.HealingWell:
            case GizmoType.PowerUp:
                return(false);

            case GizmoType.LootRunSwitch:
                return(true);

            case GizmoType.Switch:
                if (gizmo.ActorSNO == 328830)
                {
                    return(true);
                }
                break;
            }
            if (GizmoInteractBlacklist.Contains(gizmo.ActorSNO))
            {
                return(false);
            }
            //if (GizmoInteractWhitelist.Contains(gizmo.ActorSNO))
            //{
            //    return true;
            //}
            if (gizmo.IsGizmoDisabledByScript || gizmo.CommonData.GetAttribute <int>(ActorAttributeType.Untargetable) == 1)
            {
                return(false);
            }

            if (gizmo.HasBeenOperated)
            {
                return(false);
            }
            //if (gizmo is GizmoLootContainer || gizmo is GizmoShrine || gizmo.CommonData.GizmoType == GizmoType.Switch)
            //{
            //    return true;
            //}
            if ((gizmo.CommonData.MinimapVisibilityFlags & 0x80) != 0)
            {
                return(true);
            }
            if (gizmo.CommonData.GetAttribute <int>(ActorAttributeType.MinimapActive) == 1)
            {
                return(true);
            }
            if (CursedGizmos.Contains(gizmo.ActorSNO))
            {
                return(true);
            }
            if (InteractWhitelist.Contains(gizmo.ActorSNO))
            {
                return(true);
            }

            return(false);
        }
示例#2
0
        public static bool IsGizmoInteractable(DiaGizmo gizmo)
        {
            if (!gizmo.IsFullyValid())
            {
                return(false);
            }
            if (GuardedGizmos.Contains(gizmo.ActorSnoId) && (gizmo.HasBeenOperated || gizmo.CommonData.ChestOpen > 0))
            {
                return(false);
            }
            if (UsedGizmoAnimations.Contains(gizmo.CommonData.CurrentAnimation))
            {
                return(false);
            }
            if (GuardedGizmos.Contains(gizmo.ActorSnoId) && !gizmo.HasBeenOperated &&
                gizmo.CommonData.GetAttribute <int>(ActorAttributeType.Untargetable) != 1)
            {
                return(true);
            }
            if (gizmo is GizmoShrine && gizmo.CommonData.GizmoHasBeenOperated != 1 && gizmo.CommonData.GizmoState != 1)
            // Buggy Cursed Shrine
            {
                return(true);
            }
            switch (gizmo.CommonData.GizmoType)
            {
            case GizmoType.Chest:
                return(gizmo.CommonData.ChestOpen == 0);

            case GizmoType.Portal:
            case GizmoType.DungeonPortal:
                return
                    (!AdvDia.CurrentWorldMarkers.Any(
                         m =>
                         m.Position.Distance(gizmo.Position) < 10 &&
                         EntryPortals.IsEntryPortal(AdvDia.CurrentWorldDynamicId, m.NameHash)));

            case GizmoType.PortalDestination:
            case GizmoType.PoolOfReflection:
            case GizmoType.Headstone:
            case GizmoType.HealingWell:
            case GizmoType.PowerUp:
                return(false);

            case GizmoType.LootRunSwitch:
            case GizmoType.MultiClick:
                return(true);

            case GizmoType.Switch:
                if (gizmo.ActorSnoId == SNOActor.x1_Fortress_Portal_Switch)
                {
                    return(true);
                }
                break;
            }
            if (GizmoInteractBlacklist.Contains(gizmo.ActorSnoId))
            {
                return(false);
            }
            //if (GizmoInteractWhitelist.Contains(gizmo.ActorSnoId))
            //{
            //    return true;
            //}
            if (gizmo.IsGizmoDisabledByScript ||
                gizmo.CommonData.GetAttribute <int>(ActorAttributeType.Untargetable) == 1)
            {
                return(false);
            }
            if (gizmo.ActorSnoId == SNOActor.p43_AD_Valor_Pedestal && gizmo.CommonData?.MinimapActive == 1)
            {
                return(true); //p43_AD_Valor_Pedestal-19848 Special Valor Event in Diablo1 Area
            }

            if (gizmo.HasBeenOperated)
            {
                return(false);
            }

            //if (gizmo is GizmoLootContainer || gizmo is GizmoShrine || gizmo.CommonData.GizmoType == GizmoType.Switch)
            //{
            //    return true;
            //}
            if

            ((gizmo.CommonData.MinimapVisibilityFlags & 0x80) != 0)
            {
                return(true);
            }
            if (gizmo.CommonData.GetAttribute <int>(ActorAttributeType.MinimapActive) == 1)
            {
                return(true);
            }
            if (CursedGizmos.Contains(gizmo.ActorSnoId))
            {
                return(true);
            }
            if (InteractWhitelist.Contains(gizmo.ActorSnoId))
            {
                return(true);
            }

            return(false);
        }
示例#3
0
        private async Task <bool> MovingToDeathGate()
        {
            if (_deathGate != null && _deathGate.IsFullyValid())
            {
                if (AdvDia.MyPosition.Distance(_deathGate.Position) <= 7f)
                {
                    Navigator.PlayerMover.MoveStop();
                    MoveResult = MoveResult.ReachedDestination;
                }
                else
                {
                    _deathGate = ActorFinder.FindNearestDeathGate(_deathGateIgnoreList);
                    if (_deathGate == null)
                    {
                        MoveResult = MoveResult.Failed;
                        State      = States.Failed;
                        return(false);
                    }
                    MoveResult = await CommonCoroutines.MoveTo(_deathGate.Position);
                }
                switch (MoveResult)
                {
                case MoveResult.ReachedDestination:
                    var distance = AdvDia.MyPosition.Distance(_deathGate.Position);
                    if (distance <= 7f)
                    {
                        _interactionCoroutine = new InteractionCoroutine(_deathGate.ActorSnoId, new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 3));
                        State = States.InteractingWithDeathGate;
                    }
                    else
                    {
                        _deathGateIgnoreList.Add(_deathGate.ACDId);
                        State = States.Moving;
                    }
                    break;

                case MoveResult.Failed:
                case MoveResult.PathGenerationFailed:
                    State = States.Failed;
                    break;

                case MoveResult.PathGenerated:
                    break;

                case MoveResult.UnstuckAttempt:
                    if (_unstuckAttemps > 1)
                    {
                        State = States.Failed;
                        return(false);
                    }
                    _unstuckAttemps++;
                    Logger.Debug("[Navigation] Unstuck attempt #{0}", _unstuckAttemps);
                    break;

                case MoveResult.Moved:
                case MoveResult.PathGenerating:
                    break;
                }
                return(false);
            }
            State = States.Failed;
            return(false);
        }