Exemple #1
0
    public HashSet <Tile> GetAvailableTargets(Tile tile)
    {
        Unit           host   = GetComponent <Unit>();
        HashSet <Tile> retVal = new HashSet <Tile>();

        if (host == null)
        {
            Debug.LogError("host not found for Cure");
        }
        else
        {
            foreach (Tile t in Melee.StaticGetTiles(tile))
            {
                if (t.isOccuppied && !host.isHostile(t.Unit))
                {
                    retVal.Add(t);
                }
            }
            foreach (Tile t in IncreasedRange.StaticGetTiles(tile))
            {
                if (t.isOccuppied && !host.isHostile(t.Unit))
                {
                    retVal.Add(t);
                }
            }
        }
        return(retVal);
    }
Exemple #2
0
    public HashSet <Tile> GetAvailableTargets(Tile tile)
    {
        HashSet <Tile> h = new HashSet <Tile>(Melee.StaticGetTiles(tile));

        h.UnionWith(IncreasedRange.StaticGetTiles(tile));
        return(h);
    }
Exemple #3
0
    public HashSet <Tile> GetAvailableTargets(Tile tile)
    {
        Unit           host   = GetComponent <Unit>();
        HashSet <Tile> retVal = new HashSet <Tile>();

        foreach (Tile t in Melee.StaticGetTiles(tile))
        {
            if (t.isOccuppied && host.isHostile(t.Unit) && !t.Unit.invisible)
            {
                retVal.Add(t);
            }
        }
        return(retVal);
    }
Exemple #4
0
    public HashSet <Tile> GetAvailableTargets(Tile tile)
    {
        HashSet <Tile> rv = new HashSet <Tile>();

        foreach (Tile t in Melee.StaticGetTiles(tile))
        {
            if (t.isOccuppied)
            {
                rv.Add(t);
            }
        }

        return(rv);
    }
Exemple #5
0
    public HashSet <Tile> GetAvailableTargets(Tile tile)
    {
        HashSet <Tile> retVal = new HashSet <Tile>();

        foreach (Tile t in Melee.StaticGetTiles(tile))
        {
            if (t.isOccuppied && _unit.isHostile(t.Unit))
            {
                retVal.Add(t);
            }
        }

        return(retVal);
    }
Exemple #6
0
    public float judgeAbility(Unit user, Tile move, out Tile target)
    {
        HashSet <Tile> possibleTargets = GetAvailableTargets(move);

        target = null;
        if (possibleTargets.Count == 0)
        {
            return(0);
        }

        float value    = 0;
        float maxValue = 0;

        foreach (Tile q in possibleTargets)
        {
            value = 0;
            if (q.Unit.damageTaken < user.Character.Level + 10)
            {
                value = 0;
            }
            else
            {
                value  = q.Unit.damageTaken;
                value += 5;
                HashSet <Unit> enemyUnits = UnitManager.Instance.GetUnitsByHostility(user);
                foreach (Unit u in enemyUnits)
                {
                    if (Melee.StaticGetTiles(u.Tile).Contains(move))
                    {
                        value -= 1;
                    }
                    if (Ranged.staticGetTiles(u.Tile).Contains(move))
                    {
                        value -= 1;
                    }
                }
            }

            if (value > maxValue)
            {
                target   = q;
                maxValue = value;
            }
        }
        return(maxValue);
    }
Exemple #7
0
    public System.Collections.Generic.HashSet <Tile> GetAvailableTargets()
    {
        Unit           host   = GetComponent <Unit>();
        HashSet <Tile> retVal = new HashSet <Tile>();

        if (host == null)
        {
            Debug.LogError("Unit not found on ability, does the ability sit on something?");
        }
        else
        {
            foreach (Tile t in Melee.StaticGetTiles(host.Tile))
            {
                if (!t.isOccuppied)
                {
                    retVal.Add(t);
                }
            }
        }
        return(retVal);
    }
Exemple #8
0
    public HashSet <Tile> GetAvailableTargets(Tile tile)
    {
        Unit           host   = GetComponent <Unit>();
        HashSet <Tile> retVal = new HashSet <Tile>();

        if (host == null)
        {
            Debug.LogError("host not found, is the gossamer wings ability sitting on a unit?");
        }
        else
        {
            retVal.Add(host.Tile);
            foreach (Tile t in Melee.StaticGetTiles(tile))
            {
                if (t.isOccuppied && !host.isHostile(t.Unit))
                {
                    retVal.Add(t);
                }
            }
        }
        return(retVal);
    }