public List <HexCell> DefaultGetBasicAttackCells() { // if (Abilities.Any(a => a.OverridesGetBasicAttackCells)) // { // if (Abilities.Count(a => a.OverridesGetBasicAttackCells) > 1) // throw new Exception("Więcej niż jedna umiejętność próbuje nadpisać komórki podstawowego ataku!"); // // return Abilities.Single(a => a.OverridesGetBasicAttackCells).GetBasicAttackCells(); // } List <HexCell> cellRange; switch (Type) { case FightType.Ranged: cellRange = ParentCell.GetNeighbors(BasicAttackRange.Value, false, false, true); break; case FightType.Melee: cellRange = ParentCell.GetNeighbors(BasicAttackRange.Value, true, false, true); break; default: throw new ArgumentOutOfRangeException(); } return(cellRange); }
public List <HexCell> DefaultGetBasicMoveCells() { // if (Abilities.Any(a => a.OverridesGetMoveCells)) // { // if (Abilities.Count(a => a.OverridesGetMoveCells) > 1) // throw new Exception("Więcej niż jedna umiejętność próbuje nadpisać komórki ruchu!"); // // return Abilities.Single(a => a.OverridesGetMoveCells).GetMoveCells(); // } List <HexCell> cellRange = ParentCell.GetNeighbors(Speed.Value, true, true); cellRange.RemoveAll(cell => cell.CharacterOnCell != null); //we don't want to allow stepping into our characters! return(cellRange); }
public List <HexCell> DefaultGetBasicMoveCells() => IsFlying ? ParentCell.GetNeighbors(Speed.Value, SearchFlags.StopAtEnemyCharacters) : ParentCell.GetNeighbors(Speed.Value, SearchFlags.StopAtEnemyCharacters | SearchFlags.StopAtWalls);