Пример #1
0
        private void OnEntitiesChanged(FightStatus fightStatus, EntitiesChangedFlags flags)
        {
            int fightId = fightStatus.fightId;
            FightMapMovementContext fightMapMovementContext = m_movementContexts[fightId];

            if ((flags & (EntitiesChangedFlags.Added | EntitiesChangedFlags.Removed | EntitiesChangedFlags.AreaMoved)) != 0 && m_activeMovementContext == fightMapMovementContext)
            {
                ICharacterEntity trackedCharacter = fightMapMovementContext.trackedCharacter;
                if (trackedCharacter != null)
                {
                    fightMapMovementContext.End();
                    if (!trackedCharacter.isDirty)
                    {
                        fightMapMovementContext.Begin(trackedCharacter, m_pathFinder);
                    }
                    else
                    {
                        m_activeMovementContext = null;
                    }
                    m_feedbackNeedsUpdate = true;
                }
            }
            if (m_targetContext != null && (flags & (EntitiesChangedFlags.Removed | EntitiesChangedFlags.AreaMoved)) != 0)
            {
                m_targetContext.Refresh();
                m_feedbackNeedsUpdate = true;
            }
            if (m_interactiveMode == InteractiveMode.Movement && m_localMovementContext == fightMapMovementContext)
            {
                m_cellPointerManager.RefreshPlayableCharactersHighlights(this, fightStatus);
            }
            m_inputHandler.SetDirty();
        }
Пример #2
0
        public void SetMovementPhase()
        {
            EndCurrentPhase();
            m_interactiveMode = InteractiveMode.Movement;
            FightMapMovementContext localMovementContext = m_localMovementContext;

            if (localMovementContext != null)
            {
                m_cellPointerManager.BeginHighlightingPlayableCharacters(this, localMovementContext.entityProvider);
            }
        }
Пример #3
0
        public IEnumerator Initialize()
        {
            CameraHandler.AddMapRotationListener(OnMapRotationChanged);
            FightStatus local       = FightStatus.local;
            int         regionCount = m_mapDefinition.regionCount;

            m_movementContexts = new FightMapMovementContext[regionCount];
            for (int i = 0; i < regionCount; i++)
            {
                FightStatus fightStatus = FightLogicExecutor.GetFightStatus(i);
                fightStatus.EntitiesChanged += OnEntitiesChanged;
                FightMapMovementContext fightMapMovementContext = new FightMapMovementContext(fightStatus.mapStatus, fightStatus);
                if (fightStatus == local)
                {
                    m_localMovementContext = fightMapMovementContext;
                }
                m_movementContexts[i] = fightMapMovementContext;
            }
            if (m_localMovementContext != null)
            {
                IMapStateProvider stateProvider = m_localMovementContext.stateProvider;
                m_targetContext = new FightMapTargetContext(stateProvider);
            }
            BoxCollider mapCollider = CreateCollider();

            InitializeHandlers(mapCollider, giveUserControl: false);
            MonsterSpawnCellDefinition monsterSpawnCellDefinition = m_bossFightMapResources.monsterSpawnCellDefinition;

            if (null != monsterSpawnCellDefinition)
            {
                yield return(monsterSpawnCellDefinition.Initialize());

                m_monsterSpawnCellDictionary = new Dictionary <int, GameObject>();
            }
            if (AudioManager.isReady)
            {
                m_audioContext.Initialize();
                m_worldMusicRequest = AudioManager.LoadWorldMusic(m_musicGroup, m_ambianceGroup, m_audioContext);
                while (m_worldMusicRequest.state == AudioWorldMusicRequest.State.Loading)
                {
                    yield return(null);
                }
            }
        }
Пример #4
0
        private void UpdatePreviewMode()
        {
            //IL_002b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0030: Unknown result type (might be due to invalid IL or missing references)
            //IL_0032: Unknown result type (might be due to invalid IL or missing references)
            //IL_004d: Unknown result type (might be due to invalid IL or missing references)
            FightMapInputHandler inputHandler = m_inputHandler;

            if (inputHandler.pressedMouseButton)
            {
                if (!inputHandler.mouseButtonPressLocation.HasValue)
                {
                    return;
                }
                Vector2Int value = inputHandler.mouseButtonPressLocation.Value;
                if (!TryGetRegionIndex(value, out int regionIndex))
                {
                    return;
                }
                FightMapMovementContext fightMapMovementContext = m_movementContexts[regionIndex];
                if (fightMapMovementContext.entityProvider.TryGetEntityAt(value, out ICharacterEntity character))
                {
                    if (m_activeMovementContext != null)
                    {
                        m_activeMovementContext.End();
                    }
                    fightMapMovementContext.Begin(character, m_pathFinder);
                    m_activeMovementContext = fightMapMovementContext;
                    m_feedbackNeedsUpdate   = true;
                }
            }
            else if (inputHandler.releasedMouseButton)
            {
                FightMapMovementContext activeMovementContext = m_activeMovementContext;
                if (activeMovementContext != null)
                {
                    activeMovementContext.End();
                    m_activeMovementContext = null;
                    m_feedbackNeedsUpdate   = true;
                }
            }
        }
Пример #5
0
        public static void SetupMovementAreaHighlight([NotNull] FightMapFeedbackResources resources, [NotNull] FightMapMovementContext context, Vector2Int coords, [NotNull] CellHighlight highlight, Color color)
        {
            //IL_0001: Unknown result type (might be due to invalid IL or missing references)
            //IL_0020: Unknown result type (might be due to invalid IL or missing references)
            //IL_0025: Unknown result type (might be due to invalid IL or missing references)
            //IL_0027: Unknown result type (might be due to invalid IL or missing references)
            //IL_002c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0527: Unknown result type (might be due to invalid IL or missing references)
            //IL_0557: Unknown result type (might be due to invalid IL or missing references)
            //IL_056a: Unknown result type (might be due to invalid IL or missing references)
            if ((context.GetCell(coords).state & (FightMapMovementContext.CellState.Reachable | FightMapMovementContext.CellState.Occupied)) != FightMapMovementContext.CellState.Reachable)
            {
                highlight.ClearSprite();
                return;
            }
            IMapStateProvider stateProvider = context.stateProvider;
            Vector2Int        sizeMin       = stateProvider.sizeMin;
            Vector2Int        sizeMax       = stateProvider.sizeMax;

            FightMapMovementContext.Cell[] grid = context.grid;
            Sprite[]   areaFeedbackSprites      = resources.areaFeedbackSprites;
            Vector2Int val = default(Vector2Int);

            val._002Ector(coords.get_x(), coords.get_y() + 1);
            Vector2Int val2 = default(Vector2Int);

            val2._002Ector(coords.get_x() - 1, coords.get_y());
            Vector2Int val3 = default(Vector2Int);

            val3._002Ector(coords.get_x() + 1, coords.get_y());
            Vector2Int val4 = default(Vector2Int);

            val4._002Ector(coords.get_x(), coords.get_y() - 1);
            FightMapMovementContext.CellState cellState  = (val.get_x() >= sizeMin.get_x() && val.get_x() < sizeMax.get_x() && val.get_y() >= sizeMin.get_y() && val.get_y() < sizeMax.get_y()) ? grid[stateProvider.GetCellIndex(val.get_x(), val.get_y())].state : FightMapMovementContext.CellState.None;
            FightMapMovementContext.CellState cellState2 = (val2.get_x() >= sizeMin.get_x() && val2.get_x() < sizeMax.get_x() && val2.get_y() >= sizeMin.get_y() && val2.get_y() < sizeMax.get_y()) ? grid[stateProvider.GetCellIndex(val2.get_x(), val2.get_y())].state : FightMapMovementContext.CellState.None;
            FightMapMovementContext.CellState cellState3 = (val3.get_x() >= sizeMin.get_x() && val3.get_x() < sizeMax.get_x() && val3.get_y() >= sizeMin.get_y() && val3.get_y() < sizeMax.get_y()) ? grid[stateProvider.GetCellIndex(val3.get_x(), val3.get_y())].state : FightMapMovementContext.CellState.None;
            FightMapMovementContext.CellState num        = (val4.get_x() >= sizeMin.get_x() && val4.get_x() < sizeMax.get_x() && val4.get_y() >= sizeMin.get_y() && val4.get_y() < sizeMax.get_y()) ? grid[stateProvider.GetCellIndex(val4.get_x(), val4.get_y())].state : FightMapMovementContext.CellState.None;
            int num2 = ((cellState & (FightMapMovementContext.CellState.Reachable | FightMapMovementContext.CellState.Occupied)) == FightMapMovementContext.CellState.Reachable) ? 1 : 0;
            int num3 = ((cellState2 & (FightMapMovementContext.CellState.Reachable | FightMapMovementContext.CellState.Occupied)) == FightMapMovementContext.CellState.Reachable) ? 1 : 0;
            int num4 = ((cellState3 & (FightMapMovementContext.CellState.Reachable | FightMapMovementContext.CellState.Occupied)) == FightMapMovementContext.CellState.Reachable) ? 1 : 0;
            int num5 = ((num & (FightMapMovementContext.CellState.Reachable | FightMapMovementContext.CellState.Occupied)) == FightMapMovementContext.CellState.Reachable) ? 1 : 0;

            switch (4 - (num2 + num3 + num4 + num5))
            {
            case 0:
            case 1:
            case 2:
            {
                Vector2Int val5 = default(Vector2Int);
                val5._002Ector(coords.get_x() - 1, coords.get_y() + 1);
                Vector2Int val6 = default(Vector2Int);
                val6._002Ector(coords.get_x() + 1, coords.get_y() + 1);
                Vector2Int val7 = default(Vector2Int);
                val7._002Ector(coords.get_x() - 1, coords.get_y() - 1);
                Vector2Int val8 = default(Vector2Int);
                val8._002Ector(coords.get_x() + 1, coords.get_y() - 1);
                FightMapMovementContext.CellState cellState4 = (val5.get_x() >= sizeMin.get_x() && val5.get_x() < sizeMax.get_x() && val5.get_y() >= sizeMin.get_y() && val5.get_y() < sizeMax.get_y()) ? grid[stateProvider.GetCellIndex(val5.get_x(), val5.get_y())].state : FightMapMovementContext.CellState.None;
                FightMapMovementContext.CellState cellState5 = (val6.get_x() >= sizeMin.get_x() && val6.get_x() < sizeMax.get_x() && val6.get_y() >= sizeMin.get_y() && val6.get_y() < sizeMax.get_y()) ? grid[stateProvider.GetCellIndex(val6.get_x(), val6.get_y())].state : FightMapMovementContext.CellState.None;
                FightMapMovementContext.CellState cellState6 = (val7.get_x() >= sizeMin.get_x() && val7.get_x() < sizeMax.get_x() && val7.get_y() >= sizeMin.get_y() && val7.get_y() < sizeMax.get_y()) ? grid[stateProvider.GetCellIndex(val7.get_x(), val7.get_y())].state : FightMapMovementContext.CellState.None;
                FightMapMovementContext.CellState num6       = (val8.get_x() >= sizeMin.get_x() && val8.get_x() < sizeMax.get_x() && val8.get_y() >= sizeMin.get_y() && val8.get_y() < sizeMax.get_y()) ? grid[stateProvider.GetCellIndex(val8.get_x(), val8.get_y())].state : FightMapMovementContext.CellState.None;
                int num7  = ((cellState4 & (FightMapMovementContext.CellState.Reachable | FightMapMovementContext.CellState.Occupied)) != FightMapMovementContext.CellState.Reachable) ? 1 : 0;
                int num8  = ((cellState5 & (FightMapMovementContext.CellState.Reachable | FightMapMovementContext.CellState.Occupied)) != FightMapMovementContext.CellState.Reachable) ? 1 : 0;
                int num9  = ((cellState6 & (FightMapMovementContext.CellState.Reachable | FightMapMovementContext.CellState.Occupied)) != FightMapMovementContext.CellState.Reachable) ? 1 : 0;
                int num10 = ((num6 & (FightMapMovementContext.CellState.Reachable | FightMapMovementContext.CellState.Occupied)) != FightMapMovementContext.CellState.Reachable) ? 1 : 0;
                int num11 = 1 - num2;
                int num12 = 1 - num3;
                int num13 = 1 - num4;
                int num14 = 1 - num5;
                int num15 = num11 | num12 | (num7 * num2 * num3);
                int num16 = num11 | num13 | (num8 * num2 * num4);
                int num17 = num14 | num12 | (num9 * num5 * num3);
                int num18 = num14 | num13 | (num10 * num5 * num4);
                Compute(num15 | (num16 << 1) | (num17 << 2) | (num18 << 3) | (num11 << 4) | (num12 << 5) | (num13 << 6) | (num14 << 7), areaFeedbackSprites, highlight, color);
                break;
            }

            case 3:
            {
                Sprite sprite2 = areaFeedbackSprites[4];
                float  angle   = (float)num2 * -90f + (float)num4 * 180f + (float)num5 * 90f;
                highlight.SetSprite(sprite2, color, angle);
                break;
            }

            case 4:
            {
                Sprite sprite = areaFeedbackSprites[5];
                highlight.SetSprite(sprite, color);
                break;
            }

            default:
                throw new ArgumentException();
            }
        }
Пример #6
0
        private void UpdateFeedbacks()
        {
            //IL_0046: Unknown result type (might be due to invalid IL or missing references)
            //IL_004b: Unknown result type (might be due to invalid IL or missing references)
            //IL_004d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0052: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ef: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f4: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f6: Unknown result type (might be due to invalid IL or missing references)
            //IL_00fb: Unknown result type (might be due to invalid IL or missing references)
            //IL_0103: Unknown result type (might be due to invalid IL or missing references)
            //IL_0108: Unknown result type (might be due to invalid IL or missing references)
            //IL_0146: Unknown result type (might be due to invalid IL or missing references)
            //IL_0152: Unknown result type (might be due to invalid IL or missing references)
            //IL_01a1: Unknown result type (might be due to invalid IL or missing references)
            //IL_01a6: Unknown result type (might be due to invalid IL or missing references)
            //IL_01a8: Unknown result type (might be due to invalid IL or missing references)
            //IL_01ad: Unknown result type (might be due to invalid IL or missing references)
            //IL_024d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0252: Unknown result type (might be due to invalid IL or missing references)
            //IL_0264: Unknown result type (might be due to invalid IL or missing references)
            //IL_0269: Unknown result type (might be due to invalid IL or missing references)
            //IL_026b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0270: Unknown result type (might be due to invalid IL or missing references)
            //IL_02af: Unknown result type (might be due to invalid IL or missing references)
            //IL_02bb: Unknown result type (might be due to invalid IL or missing references)
            //IL_0311: Unknown result type (might be due to invalid IL or missing references)
            FightMapFeedbackResources feedbackResources = m_feedbackResources;

            if (null == feedbackResources)
            {
                return;
            }
            FightMapMovementContext[] movementContexts = m_movementContexts;
            int num = movementContexts.Length;

            for (int i = 0; i < num; i++)
            {
                FightMapMovementContext fightMapMovementContext = movementContexts[i];
                if (!fightMapMovementContext.hasEnded)
                {
                    continue;
                }
                IMapDefinition    mapDefinition = m_mapDefinition;
                IMapStateProvider stateProvider = fightMapMovementContext.stateProvider;
                Vector2Int        sizeMin       = stateProvider.sizeMin;
                Vector2Int        sizeMax       = stateProvider.sizeMax;
                for (int j = sizeMin.get_y(); j < sizeMax.get_y(); j++)
                {
                    for (int k = sizeMin.get_x(); k < sizeMax.get_x(); k++)
                    {
                        int        cellIndex  = mapDefinition.GetCellIndex(k, j);
                        CellObject cellObject = m_cellObjectsByIndex[cellIndex];
                        if (!(null == cellObject))
                        {
                            cellObject.highlight.ClearSprite();
                        }
                    }
                }
            }
            FightMapTargetContext targetContext = m_targetContext;

            if (targetContext != null)
            {
                if (targetContext.isActive)
                {
                    IMapDefinition    mapDefinition2      = m_mapDefinition;
                    IMapStateProvider stateProvider2      = targetContext.stateProvider;
                    Vector2Int        sizeMin2            = stateProvider2.sizeMin;
                    Vector2Int        sizeMax2            = stateProvider2.sizeMax;
                    Color             targetableAreaColor = feedbackResources.feedbackColors.targetableAreaColor;
                    for (int l = sizeMin2.get_y(); l < sizeMax2.get_y(); l++)
                    {
                        for (int m = sizeMin2.get_x(); m < sizeMax2.get_x(); m++)
                        {
                            int        cellIndex2  = mapDefinition2.GetCellIndex(m, l);
                            CellObject cellObject2 = m_cellObjectsByIndex[cellIndex2];
                            if (!(null == cellObject2))
                            {
                                FightMapFeedbackHelper.SetupSpellTargetHighlight(feedbackResources, targetContext, cellObject2.coords, cellObject2.highlight, targetableAreaColor);
                            }
                        }
                    }
                    m_pathFinderFeedbackManager.Clear();
                    return;
                }
                if (targetContext.hasEnded)
                {
                    IMapDefinition    mapDefinition3 = m_mapDefinition;
                    IMapStateProvider stateProvider3 = targetContext.stateProvider;
                    Vector2Int        sizeMin3       = stateProvider3.sizeMin;
                    Vector2Int        sizeMax3       = stateProvider3.sizeMax;
                    for (int n = sizeMin3.get_y(); n < sizeMax3.get_y(); n++)
                    {
                        for (int num2 = sizeMin3.get_x(); num2 < sizeMax3.get_x(); num2++)
                        {
                            int        cellIndex3  = mapDefinition3.GetCellIndex(num2, n);
                            CellObject cellObject3 = m_cellObjectsByIndex[cellIndex3];
                            if (!(null == cellObject3))
                            {
                                cellObject3.highlight.ClearSprite();
                            }
                        }
                    }
                }
            }
            FightMapMovementContext activeMovementContext = m_activeMovementContext;

            if (activeMovementContext == null)
            {
                m_pathFinderFeedbackManager.Clear();
                return;
            }
            ICharacterEntity trackedCharacter = activeMovementContext.trackedCharacter;

            if (trackedCharacter != null)
            {
                Color             highlightColor = GetHighlightColor(feedbackResources.feedbackColors, activeMovementContext.entityProvider, trackedCharacter);
                IMapDefinition    mapDefinition4 = m_mapDefinition;
                IMapStateProvider stateProvider4 = activeMovementContext.stateProvider;
                Vector2Int        sizeMin4       = stateProvider4.sizeMin;
                Vector2Int        sizeMax4       = stateProvider4.sizeMax;
                for (int num3 = sizeMin4.get_y(); num3 < sizeMax4.get_y(); num3++)
                {
                    for (int num4 = sizeMin4.get_x(); num4 < sizeMax4.get_x(); num4++)
                    {
                        int        cellIndex4  = mapDefinition4.GetCellIndex(num4, num3);
                        CellObject cellObject4 = m_cellObjectsByIndex[cellIndex4];
                        if (!(null == cellObject4))
                        {
                            FightMapFeedbackHelper.SetupMovementAreaHighlight(feedbackResources, activeMovementContext, cellObject4.coords, cellObject4.highlight, highlightColor);
                        }
                    }
                }
            }
            if (m_pathFinder.tracking)
            {
                Vector2Int?target = activeMovementContext.targetedEntity?.area.refCoord;
                m_pathFinderFeedbackManager.Setup(feedbackResources.movementFeedbackResources, m_pathFinder.currentPath, target);
            }
            else
            {
                m_pathFinderFeedbackManager.Clear();
            }
        }
Пример #7
0
        private void UpdateMovementMode()
        {
            //IL_003e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0043: Unknown result type (might be due to invalid IL or missing references)
            //IL_0045: Unknown result type (might be due to invalid IL or missing references)
            //IL_0067: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
            FightMapInputHandler inputHandler = m_inputHandler;

            if (inputHandler.pressedMouseButton)
            {
                if (m_pathFinder.tracking || !inputHandler.mouseButtonPressLocation.HasValue)
                {
                    return;
                }
                Vector2Int value = inputHandler.mouseButtonPressLocation.Value;
                if (!TryGetRegionIndex(value, out int regionIndex))
                {
                    return;
                }
                FightMapMovementContext fightMapMovementContext = m_movementContexts[regionIndex];
                IMapEntityProvider      entityProvider          = fightMapMovementContext.entityProvider;
                if (entityProvider.TryGetEntityAt(value, out ICharacterEntity character))
                {
                    if (m_activeMovementContext != null)
                    {
                        m_activeMovementContext.End();
                    }
                    fightMapMovementContext.Begin(character, m_pathFinder);
                    m_activeMovementContext = fightMapMovementContext;
                    m_feedbackNeedsUpdate   = true;
                    if (entityProvider.IsCharacterPlayable(character))
                    {
                        m_pathFinder.Begin(value, character.movementPoints, fightMapMovementContext.canPassThrough);
                        m_cellPointerManager.EndHighlightingPlayableCharacters();
                    }
                    m_cellPointerManager.ShowCursor();
                    m_cellPointerManager.SetAnimatedCursor(value: false);
                }
            }
            else
            {
                if (!inputHandler.releasedMouseButton)
                {
                    return;
                }
                FightMapMovementContext activeMovementContext = m_activeMovementContext;
                if (activeMovementContext != null)
                {
                    if (m_pathFinder.tracking)
                    {
                        m_cellPointerManager.BeginHighlightingPlayableCharacters(this, activeMovementContext.entityProvider);
                        Vector2Int[] path = m_pathFinder.currentPath.ToArray();
                        ApplyMovement(path, activeMovementContext.trackedCharacter, activeMovementContext.targetedEntity);
                        m_pathFinder.End();
                        m_cellPointerManager.SetAnimatedCursor(value: false);
                    }
                    activeMovementContext.End();
                    m_activeMovementContext = null;
                    m_feedbackNeedsUpdate   = true;
                }
            }
        }
Пример #8
0
        private void UpdateSystems()
        {
            //IL_004d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0052: Unknown result type (might be due to invalid IL or missing references)
            //IL_0054: Unknown result type (might be due to invalid IL or missing references)
            //IL_0073: Unknown result type (might be due to invalid IL or missing references)
            //IL_0082: Unknown result type (might be due to invalid IL or missing references)
            //IL_010d: Unknown result type (might be due to invalid IL or missing references)
            //IL_016c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0177: Unknown result type (might be due to invalid IL or missing references)
            //IL_019b: Unknown result type (might be due to invalid IL or missing references)
            //IL_01ed: Unknown result type (might be due to invalid IL or missing references)
            //IL_0212: Unknown result type (might be due to invalid IL or missing references)
            //IL_0222: Unknown result type (might be due to invalid IL or missing references)
            //IL_0244: Unknown result type (might be due to invalid IL or missing references)
            FightMapInputHandler inputHandler = m_inputHandler;

            if (!inputHandler.Update(m_mapDefinition))
            {
                return;
            }
            if (m_objectFocusedByCursor != null)
            {
                m_objectFocusedByCursor.SetFocus(value: false);
                m_objectFocusedByCursor = null;
            }
            FightMapCellPointerManager cellPointerManager = m_cellPointerManager;
            Vector2Int?targetCell = inputHandler.targetCell;

            if (targetCell.HasValue)
            {
                Vector2Int value = targetCell.Value;
                if (TryGetRegionIndex(value, out int regionIndex))
                {
                    FightMapMovementContext fightMapMovementContext = m_movementContexts[regionIndex];
                    fightMapMovementContext.entityProvider.TryGetEntityAt(value, out IEntityWithBoardPresence character);
                    CellObject referenceCell = m_virtualGrid.GetReferenceCell(value);
                    if (null != referenceCell)
                    {
                        cellPointerManager.SetCursorPosition(referenceCell);
                        cellPointerManager.ShowCursor();
                    }
                    else
                    {
                        cellPointerManager.HideCursor();
                    }
                    IObjectWithFocus objectWithFocus;
                    if (character != null && (objectWithFocus = (character.view as IObjectWithFocus)) != null)
                    {
                        objectWithFocus.SetFocus(value: true);
                        m_objectFocusedByCursor = objectWithFocus;
                    }
                    if (m_pathFinder.tracking)
                    {
                        if (fightMapMovementContext == m_activeMovementContext)
                        {
                            ICharacterEntity trackedCharacter = fightMapMovementContext.trackedCharacter;
                            bool             flag;
                            if (fightMapMovementContext.canDoActionOnTarget)
                            {
                                IEntityWithBoardPresence entityWithBoardPresence = null;
                                if (character != null && character != trackedCharacter && (fightMapMovementContext.GetCell(value).state & FightMapMovementContext.CellState.Targetable) != 0)
                                {
                                    entityWithBoardPresence = character;
                                }
                                fightMapMovementContext.UpdateTarget(entityWithBoardPresence);
                                flag = (entityWithBoardPresence != null);
                            }
                            else
                            {
                                flag = false;
                            }
                            if (fightMapMovementContext.canMove)
                            {
                                if (flag)
                                {
                                    if (trackedCharacter.hasRange)
                                    {
                                        m_pathFinder.Reset();
                                    }
                                    else
                                    {
                                        m_pathFinder.Move(fightMapMovementContext.stateProvider, fightMapMovementContext.grid, value, isTargeting: true);
                                    }
                                }
                                else if ((fightMapMovementContext.GetCell(value).state & (FightMapMovementContext.CellState.Reachable | FightMapMovementContext.CellState.Occupied)) == FightMapMovementContext.CellState.Reachable)
                                {
                                    m_pathFinder.Move(fightMapMovementContext.stateProvider, fightMapMovementContext.grid, value, isTargeting: false);
                                }
                                else
                                {
                                    m_pathFinder.Reset();
                                }
                            }
                            cellPointerManager.SetAnimatedCursor(flag);
                        }
                        else
                        {
                            m_pathFinder.Reset();
                            cellPointerManager.SetAnimatedCursor(value: false);
                        }
                        m_feedbackNeedsUpdate = true;
                    }
                    else
                    {
                        if (m_interactiveMode != InteractiveMode.Target || onTargetChanged == null)
                        {
                            return;
                        }
                        if (m_targetContext.TryGetTargetAt(value, out Target target))
                        {
                            if (target.type == Target.Type.Entity && target.entity == character)
                            {
                                m_targetContext.UpdateTarget(value, character);
                            }
                            else
                            {
                                m_targetContext.UpdateTarget(value, null);
                            }
                            onTargetChanged(target, referenceCell);
                        }
                        else
                        {
                            m_targetContext.UpdateTarget(value, null);
                            onTargetChanged(null, null);
                        }
                    }
                    return;
                }
            }
            if (m_pathFinder.tracking)
            {
                m_pathFinder.Reset();
                m_feedbackNeedsUpdate = true;
            }
            m_cellPointerManager.HideCursor();
            if (m_interactiveMode == InteractiveMode.Target)
            {
                onTargetChanged?.Invoke(null, null);
            }
        }