public void BackgroundClick() { if (_currentActiveCard != null) { _currentActiveCard.Hide(); _currentActiveCard = null; _currentActiveAbility = null; } }
public void CardClick(BattleCardShell card) { if (_currentActiveAbility == null) { // Debug.Log (1); if (CheckPlayerCardActivity(card)) { { // Debug.Log (2); if (_currentActiveCard == card) { // Debug.Log (3); _currentActiveCard.Hide(); _currentActiveCard = null; } else { // Debug.Log (4); if (_currentActiveCard != null) { _currentActiveCard.Hide(); } _currentActiveCard = card; card.Show(); } } } else { // Debug.Log (5); card.Deny(); } } else { // Debug.Log(6); bool canCast = false; switch (_currentActiveAbility.ability.targetType) { case TargetType.All: { canCast = true; break; } case TargetType.Friend: { if (card.shellType == ShellType.Player) { canCast = true; } break; } case TargetType.Enemy: { // Debug.Log(7); if (card.shellType == ShellType.Enemy) { canCast = true; } break; } case TargetType.Self: { if (card == _currentActiveCard) { canCast = true; } break; } default: break; } if (canCast) { // Debug.Log(8); if (_currentActiveAbility.ability.targetArea == TargetArea.Area) //If ability is AOE,cast at the middle of enemies; { _currentActiveCard.CastAbility(_currentActiveAbility.ability, _enemyCardShellSet [0].battleCard); } else { _currentActiveCard.CastAbility(_currentActiveAbility.ability, card.battleCard); } // _currentActiveAbility.UpdateCDTimer(); _currentActiveAbility = null; _currentActiveCard = null; CheckPlayerCardShellSetActivity(); } else { card.Deny(); } } }
public void AbilityClick(AbilityShell ability) { _currentActiveAbility = ability; }