public void EnterAttackMode() { mapCursorMode = MapCursorMode.AttackUnit; actionBar.Active = false; currentContext = mapContext; selectedUnit.UpdateAttackTiles(); }
private void OnBackPauseMenu() { currentContext = mapContext; mapCursorMode = MapCursorMode.MoveCursor; Game1.backSound.Play(); pauseMenu.Active = false; }
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(); } }
private void OnBackActionBar() { selectedUnit.Position = selectionPreviousPos; Position = selectedUnit.Position; currentContext = mapContext; actionBar.Active = false; mapCursorMode = MapCursorMode.MoveUnit; Game1.backSound.Play(); }
private void OnBackMoveUnit() { validMoveTiles.Clear(); selectedUnit.validAttackPoints.Clear(); selectedUnit.Position = selectionPreviousPos; selectedUnit = null; hoveredUnit = Game1.GetUnit(position); mapCursorMode = MapCursorMode.MoveCursor; Game1.backSound.Play(); }
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(); }
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); }