コード例 #1
0
 public void BeginHighlightingPlayableCharacters(IMap map, IMapEntityProvider entityProvider)
 {
     //IL_0021: Unknown result type (might be due to invalid IL or missing references)
     //IL_0026: Unknown result type (might be due to invalid IL or missing references)
     //IL_0036: Unknown result type (might be due to invalid IL or missing references)
     //IL_003b: Unknown result type (might be due to invalid IL or missing references)
     //IL_0040: Unknown result type (might be due to invalid IL or missing references)
     //IL_0050: Unknown result type (might be due to invalid IL or missing references)
     //IL_0055: Unknown result type (might be due to invalid IL or missing references)
     //IL_005a: Unknown result type (might be due to invalid IL or missing references)
     //IL_009c: Unknown result type (might be due to invalid IL or missing references)
     //IL_00a1: Unknown result type (might be due to invalid IL or missing references)
     //IL_00c0: Unknown result type (might be due to invalid IL or missing references)
     //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
     //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
     //IL_00cb: Unknown result type (might be due to invalid IL or missing references)
     //IL_00ce: Unknown result type (might be due to invalid IL or missing references)
     //IL_00d0: Unknown result type (might be due to invalid IL or missing references)
     if (!m_displayPlayableCharactersHighlights)
     {
         GameObjectPool pool = m_pool;
         if (pool != null)
         {
             List <CellPointer> active          = m_active;
             Quaternion         inverseRotation = m_mapRotation.GetInverseRotation();
             Vector3            val             = inverseRotation * new Vector3(-0.01f, 0.51f, -0.01f);
             Quaternion         val2            = inverseRotation * Quaternion.Euler(90f, 0f, 0f);
             Transform          val3            = (null != m_cursor) ? m_cursor.get_transform().get_parent() : null;
             foreach (ICharacterEntity item in entityProvider.EnumeratePlayableCharacters())
             {
                 Vector2Int  refCoord  = item.area.refCoord;
                 Transform   transform = map.GetCellObject(refCoord.get_x(), refCoord.get_y()).get_transform();
                 Vector3     val4      = transform.get_position() + val;
                 GameObject  obj       = pool.Instantiate(val4, val2, transform);
                 CellPointer component = obj.GetComponent <CellPointer>();
                 component.SetAnimated(value: true);
                 component.Show();
                 obj.SetActive(true);
                 active.Add(component);
                 if (transform == val3)
                 {
                     m_cursor.get_gameObject().SetActive(false);
                 }
             }
             m_displayPlayableCharactersHighlights = true;
         }
     }
 }
コード例 #2
0
        public FightMapMovementContext([NotNull] IMapStateProvider stateProvider, [NotNull] IMapEntityProvider entityProvider)
        {
            //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_002d: 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_00c9: Unknown result type (might be due to invalid IL or missing references)
            this.stateProvider  = stateProvider;
            this.entityProvider = entityProvider;
            Vector2Int sizeMin = stateProvider.sizeMin;
            Vector2Int val     = stateProvider.sizeMax - sizeMin;
            int        num     = val.get_y() * val.get_x();
            int        num2    = sizeMin.get_y() * val.get_x() + sizeMin.get_x();

            grid = new Cell[num];
            Vector2Int coords = default(Vector2Int);

            for (int i = 0; i < num; i++)
            {
                FightCellState cellState = stateProvider.GetCellState(i);
                int            num3      = sizeMin.get_x() + i % val.get_x();
                int            num4      = (i + num2 - num3) / val.get_x();
                coords._002Ector(num3, num4);
                CellState state;
                switch (cellState)
                {
                case FightCellState.None:
                    state = CellState.None;
                    break;

                case FightCellState.Movement:
                    state = CellState.Movement;
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
                grid[i] = new Cell(coords, state, null);
            }
        }
コード例 #3
0
 public void RefreshPlayableCharactersHighlights(IMap map, IMapEntityProvider entityProvider)
 {
     EndHighlightingPlayableCharacters();
     BeginHighlightingPlayableCharacters(map, entityProvider);
 }
コード例 #4
0
ファイル: FightMap.cs プロジェクト: hussein-aitlahcen/nevaw
        protected override Color GetHighlightColor(FightMapFeedbackColors feedbackColors, IMapEntityProvider mapEntityProvider, ICharacterEntity trackedCharacter)
        {
            //IL_0045: Unknown result type (might be due to invalid IL or missing references)
            FightStatus local      = FightStatus.local;
            PlayerType  playerType = (local != mapEntityProvider) ? ((trackedCharacter.teamIndex == GameStatus.localPlayerTeamIndex) ? PlayerType.Ally : PlayerType.Opponent) : ((local.localPlayerId != trackedCharacter.ownerId) ? ((trackedCharacter.teamIndex == GameStatus.localPlayerTeamIndex) ? (PlayerType.Ally | PlayerType.Local) : (PlayerType.Opponent | PlayerType.Local)) : PlayerType.Player);

            return(feedbackColors.GetPlayerColor(playerType));
        }
コード例 #5
0
 protected virtual Color GetHighlightColor([NotNull] FightMapFeedbackColors feedbackColors, [NotNull] IMapEntityProvider mapEntityProvider, [NotNull] ICharacterEntity trackedCharacter)
 {
     //IL_0001: Unknown result type (might be due to invalid IL or missing references)
     return(feedbackColors.targetableAreaColor);
 }
コード例 #6
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;
                }
            }
        }
コード例 #7
0
        public void Begin([NotNull] ICharacterEntity tracked, FightPathFinder pathFinder)
        {
            //IL_0067: Unknown result type (might be due to invalid IL or missing references)
            //IL_006c: Unknown result type (might be due to invalid IL or missing references)
            //IL_006f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0097: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c3: Unknown result type (might be due to invalid IL or missing references)
            //IL_013a: Unknown result type (might be due to invalid IL or missing references)
            //IL_013f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0142: Unknown result type (might be due to invalid IL or missing references)
            //IL_019d: Unknown result type (might be due to invalid IL or missing references)
            //IL_01fb: Unknown result type (might be due to invalid IL or missing references)
            //IL_0200: Unknown result type (might be due to invalid IL or missing references)
            //IL_0203: Unknown result type (might be due to invalid IL or missing references)
            //IL_025e: Unknown result type (might be due to invalid IL or missing references)
            IMapStateProvider  mapStateProvider  = stateProvider;
            IMapEntityProvider mapEntityProvider = entityProvider;
            HashSet <IObjectTargetableByAction> objectsTargetableByAction = m_objectsTargetableByAction;

            canMove             = tracked.canMove;
            canPassThrough      = tracked.HasProperty(PropertyId.CanPassThrough);
            canDoActionOnTarget = tracked.canDoActionOnTarget;
            int num = grid.Length;

            for (int i = 0; i < num; i++)
            {
                Cell cell = grid[i];
                if (cell.state != 0)
                {
                    Vector2Int coords = cell.coords;
                    IEntityWithBoardPresence entity;
                    CellState state = (!mapEntityProvider.TryGetEntityBlockingMovementAt(coords, out entity)) ? CellState.Movement : ((entity != tracked) ? (CellState.Movement | CellState.Occupied) : (CellState.Movement | CellState.Reachable | CellState.Tracked));
                    grid[i] = new Cell(cell.coords, state, entity);
                }
            }
            pathFinder.FloodFill(mapStateProvider, grid, tracked.area.refCoord, tracked.movementPoints, canPassThrough);
            ActionType      actionType         = tracked.actionType;
            IEntitySelector customActionTarget = tracked.customActionTarget;

            if (customActionTarget != null)
            {
                CharacterActionValueContext context = new CharacterActionValueContext((FightStatus)mapEntityProvider, tracked);
                foreach (IEntity item in customActionTarget.EnumerateEntities(context))
                {
                    IEntityTargetableByAction entityTargetableByAction;
                    if (item != tracked && (entityTargetableByAction = (item as IEntityTargetableByAction)) != null)
                    {
                        Vector2Int refCoord = entityTargetableByAction.area.refCoord;
                        if (IsInActionRange(refCoord, tracked))
                        {
                            IObjectTargetableByAction objectTargetableByAction;
                            if ((objectTargetableByAction = (entityTargetableByAction.view as IObjectTargetableByAction)) != null)
                            {
                                objectTargetableByAction.ShowActionTargetFeedback(actionType, isSelected: false);
                                objectsTargetableByAction.Add(objectTargetableByAction);
                            }
                            int  cellIndex = mapStateProvider.GetCellIndex(refCoord.get_x(), refCoord.get_y());
                            Cell cell2     = grid[cellIndex];
                            grid[cellIndex] = new Cell(refCoord, cell2.state | CellState.Targetable, entityTargetableByAction);
                        }
                    }
                }
            }
            else
            {
                foreach (IEntityTargetableByAction item2 in mapEntityProvider.EnumerateEntities <IEntityTargetableByAction>())
                {
                    if (item2 != tracked)
                    {
                        Vector2Int refCoord2 = item2.area.refCoord;
                        if (IsInActionRange(refCoord2, tracked))
                        {
                            IObjectTargetableByAction objectTargetableByAction2;
                            if ((objectTargetableByAction2 = (item2.view as IObjectTargetableByAction)) != null)
                            {
                                objectTargetableByAction2.ShowActionTargetFeedback(actionType, isSelected: false);
                                objectsTargetableByAction.Add(objectTargetableByAction2);
                            }
                            int  cellIndex2 = mapStateProvider.GetCellIndex(refCoord2.get_x(), refCoord2.get_y());
                            Cell cell3      = grid[cellIndex2];
                            grid[cellIndex2] = new Cell(refCoord2, cell3.state | CellState.Targetable, item2);
                        }
                    }
                }
            }
            trackedCharacter = tracked;
            targetedEntity   = null;
        }