public override void OnClick() { if (!IsUnderCooldown()) { GridBhv.ShowSkillRange(RangeType, CharacterBhv, Id, OpponentBhvs, true); } }
private bool GetClose() { _gridBhv.ShowPm(_characterBhv, _characterBhv.OpponentBhvs, unlimitedPm: true); var posToReachByFeet = GetSmallestNearVisited(_opponentBhv.X, _opponentBhv.Y, transform.position); if (posToReachByFeet != null) { SetPathToOpponent(posToReachByFeet); } if (posToReachByFeet == null || _gridBhv.Cells[posToReachByFeet.X, posToReachByFeet.Y].GetComponent <CellBhv>().Visited > _characterBhv.Pm) { NewWeights(new List <int>()); for (int i = 0; i < 2; ++i) { if (_characterBhv.Character.Skills[i].Nature == SkillNature.Movement && !_characterBhv.Character.Skills[i].IsUnderCooldown() && _characterBhv.Pa > _characterBhv.Character.Skills[i].PaNeeded) { _weights.Add(_skillsWeight[i]); } } for (int i = 0; i < 2; ++i) { if (_characterBhv.Character.Skills[i].Nature == SkillNature.Movement && IsTheBiggest(_skillsWeight[i])) { _gridBhv.ShowSkillRange(_characterBhv.Character.Skills[i].RangeType, _characterBhv, i, _characterBhv.OpponentBhvs, true); _gridBhv.ShowPm(_opponentBhv, _opponentBhv.OpponentBhvs, unlimitedPm: true); var tmpPos = GetCellVisitedToPlayerBySkill(far: false); if (tmpPos == null || _gridBhv.Cells[tmpPos.X, tmpPos.Y].GetComponent <CellBhv>().Visited > _gridBhv.Cells[_characterBhv.PathfindingPos[_characterBhv.Pm].X, _characterBhv.PathfindingPos[_characterBhv.Pm].Y].GetComponent <CellBhv>().Visited) { break; } _characterBhv.Character.Skills[i].Activate(tmpPos.X, tmpPos.Y); return(true); } } } if (posToReachByFeet == null) { return(false); } return(MoveToNextCell()); }
public virtual void OnClick() { if (RangeType != RangeType.NoRange && !IsUnderCooldown()) { GridBhv.ShowSkillRange(RangeType, CharacterBhv, Id, OpponentBhvs); } else if (CooldownType == CooldownType.Passive) { GridBhv.ShowPm(CharacterBhv, OpponentBhvs); } }