Beispiel #1
0
        private void HasRangeAttackPenalty(BattleTerrain battleTerrain,
            Heroes.Core.Battle.Armies.Army currentArmy, Heroes.Core.Battle.Armies.Army targetArmy,
            out bool hasRangePenalty, out bool hasObstaclePenalty)
        {
            hasRangePenalty = false;
            hasObstaclePenalty = false;

            // Range Penalty
            // Whenever any shooter, except Sharpshooters or those under the command of a hero with the Golden Bow or Bow of the Sharpshooter equipped, attacks a unit standing more than 10(?) hexes away, they will only do half damage. This is cumulative with the Obstacle Penalty.

            // obstacle Penalty
            // Whenever most units tries shooting over Walls into a castle, they will only do half Damage. Certain units don't have this penalty, and neither do units under the command of a hero with the Golden Bow or Bow of the Sharpshooter. This penalty is cumulative with the Range Penalty

            // find attack range
            ArrayList path = new ArrayList();
            battleTerrain.FindPath(currentArmy._cell, targetArmy._cell, path, true, true);

            if (path.Count > 10) hasRangePenalty = true;
        }