Esempio n. 1
0
        public IReadOnlyList <Vector3Int> FindRaiseTargets()
        {
            var result = new List <Vector3Int>();

            foreach (var pos in UnitAlgorithm.FindTarget(transform.position.WorldToArray(), 0, 0))
            {
                if (Tombstone.array[pos.x][pos.y] && !array[pos.x][pos.y])
                {
                    result.Add(pos);
                }
            }

            return(result);
        }
Esempio n. 2
0
        public IReadOnlyList <Vector3Int> FindHealTargets()
        {
            var result = new List <Vector3Int>();

            foreach (var pos in UnitAlgorithm.FindTarget(transform.position.WorldToArray(), 0, 1))
            {
                if (array[pos.x][pos.y]?.army.group == army.group)
                {
                    result.Add(pos);
                }
            }

            return(result);
        }
Esempio n. 3
0
        public virtual IReadOnlyList <Vector3Int> FindAttackTargets()
        {
            var result = new List <Vector3Int>();

            foreach (var pos in UnitAlgorithm.FindTarget(transform.position.WorldToArray(), 0, 0))
            {
                var unit = array[pos.x][pos.y];
                if (unit && unit.army.group != army.group)
                {
                    result.Add(pos);
                }
            }

            return(result);
        }
Esempio n. 4
0
        public override IReadOnlyList <Vector3Int> FindAttackTargets()
        {
            if (army != Battle.instance.army)
            {
                return(base.FindAttackTargets());
            }
            var result = new List <Vector3Int>();

            foreach (var pos in UnitAlgorithm.FindTarget(transform.position.WorldToArray(), 0, 1))
            {
                var unit = array[pos.x][pos.y];
                if (unit && unit.army.group != army.group)
                {
                    result.Add(pos);
                }
            }

            return(result);
        }
Esempio n. 5
0
        public override IReadOnlyList <Vector3Int> FindAttackTargets()
        {
            var result = new List <Vector3Int>();

            if (isMoving || Castle.isBuying || army != Battle.instance.army)
            {
                return(result);
            }

            foreach (var pos in UnitAlgorithm.FindTarget(transform.position.WorldToArray(), 1, 3))
            {
                var unit    = array[pos.x][pos.y];
                var terrain = AETerrain.array[pos.x][pos.y];
                if (unit && unit.army.group != army.group || terrain is House && (terrain as House).CanBreak())
                {
                    result.Add(pos);
                }
            }

            return(result);
        }