Example #1
0
 public void EnterAttackMode()
 {
     mapCursorMode    = MapCursorMode.AttackUnit;
     actionBar.Active = false;
     currentContext   = mapContext;
     selectedUnit.UpdateAttackTiles();
 }
Example #2
0
 private void OnBackPauseMenu()
 {
     currentContext = mapContext;
     mapCursorMode  = MapCursorMode.MoveCursor;
     Game1.backSound.Play();
     pauseMenu.Active = false;
 }
Example #3
0
        private void OnSelectUnit()
        {
            if (CursorOverUnit && hoveredUnit.active && mapCursorMode == MapCursorMode.MoveCursor)
            {
                if (hoveredUnit.team == Team.Blue)
                {
                    selectedUnit         = hoveredUnit;
                    selectionPreviousPos = hoveredUnit.Position;

                    RegisterValidMoveTiles();
                }
                else
                {
                    ToggleDangerZone(hoveredUnit);
                }
            }
            else
            {
                Game1.deniedSound.Play();
            }

            if (selectedUnit != null && selectedUnit.team == Team.Blue)
            {
                mapCursorMode = MapCursorMode.MoveUnit;
                Game1.menuSound.Play();
            }
        }
Example #4
0
 private void OnBackActionBar()
 {
     selectedUnit.Position = selectionPreviousPos;
     Position         = selectedUnit.Position;
     currentContext   = mapContext;
     actionBar.Active = false;
     mapCursorMode    = MapCursorMode.MoveUnit;
     Game1.backSound.Play();
 }
Example #5
0
        private void OnBackMoveUnit()
        {
            validMoveTiles.Clear();
            selectedUnit.validAttackPoints.Clear();
            selectedUnit.Position = selectionPreviousPos;
            selectedUnit          = null;
            hoveredUnit           = Game1.GetUnit(position);
            mapCursorMode         = MapCursorMode.MoveCursor;

            Game1.backSound.Play();
        }
Example #6
0
 public void FinishSelection()
 {
     if (selectedUnit != null)
     {
         selectedUnit.validAttackPoints.Clear();
     }
     selectedUnit         = null;
     selectionPreviousPos = Position;
     currentContext       = mapContext;
     actionBar.Active     = false;
     mapCursorMode        = MapCursorMode.MoveCursor;
     validMoveTiles.Clear();
     Game1.CheckForEndTurn();
 }
Example #7
0
        public Cursor(Point startingPosition, AnimatedTexture texture, Texture2D moveArrowTexture, ActionBar actionBar, PauseMenu pauseMenu)
        {
            currentContext        = mapContext;
            mapCursorMode         = MapCursorMode.MoveCursor;
            this.texture          = texture;
            this.moveArrowTexture = moveArrowTexture;
            Cursor.actionBar      = actionBar;
            Cursor.pauseMenu      = pauseMenu;

            position    = startingPosition;
            hoveredUnit = Game1.GetUnit(startingPosition);
            hoveredTile = Level.GetTile(startingPosition);

            prevKeyboardState = Keyboard.GetState();
            prevGamePadState  = GamePad.GetState(0);
        }