public void OverEnemy(IEnemy enemy) { //only works if is the player's turn if (_turnManager.GetStage() != TurnStage.PlayerTurn) { return; } //TODO check if is area effect if (_playerActionManager.IsSelectingTarget()) { if (_playerActionManager.GetCurMove().IsAreaFX()) { Debug.Log("this is an area affect move"); _enemyManager.AreaAffect(); //TODO change to area effect text _infoLabelManager.OverEnemy(enemy); return; } //check if the enemy can be targeted by the current move if (!enemy.CanTarget(_playerActionManager.GetCurMove())) { _infoLabelManager.BlockedEnemy(enemy); return; } _infoLabelManager.OverEnemy(enemy); enemy.SetState(SelectState.Targeted); } }
public void EnemyPressed(IEnemy enemy) { //make sure it is the player's turn bool isTurn = _turnManager.GetStage() == TurnStage.PlayerTurn; //make sure we are selecting a target bool selectingTarget = _playerActionManager.IsSelectingTarget(); //make sure we can target the enemy with this move bool canTarget = enemy.CanTarget(_playerActionManager.GetCurMove()); //return if any are not true if (!isTurn || !selectingTarget || !canTarget) { return; } //Check if it is an area affect move an sould target everyone if (_playerActionManager.GetCurMove().IsAreaFX()) { _playerActionManager.SelectTargets(_enemyManager.GetEnemiesAsArray()); } else { _playerActionManager.SelectTargets(new IEnemy[] { enemy }); } _categoryManager.CheckCategories(_playerActionManager.GetUsedParts()); _infoLabelManager.MoveSelected(); enemy.SetState(SelectState.Over); _enemyManager.ClearTargets(); }