Ejemplo n.º 1
0
    public HashSet <Tile> GetAvailableTargets(Tile tile)
    {
        HashSet <Tile> ret = new HashSet <Tile>(RangeAndMelee.StaticGetTiles(tile));

        ret.UnionWith(IncreasedRange.StaticGetTiles(tile));
        return(ret);
    }
Ejemplo n.º 2
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);
    }
Ejemplo n.º 3
0
    public HashSet <Tile> GetAvailableTargets(Tile tile)
    {
        HashSet <Tile> h = new HashSet <Tile>(Melee.StaticGetTiles(tile));

        h.UnionWith(IncreasedRange.StaticGetTiles(tile));
        return(h);
    }
Ejemplo n.º 4
0
    public HashSet <Tile> GetAvailableTargets()
    {
        Tile           t   = GetComponent <Unit>().Tile;
        HashSet <Tile> ret = new HashSet <Tile>(RangeAndMelee.StaticGetTiles(t));

        ret.UnionWith(IncreasedRange.StaticGetTiles(t));
        return(ret);
    }
Ejemplo n.º 5
0
    public float judgeAbility(Unit user, Tile move, out Tile target)
    {
        target = null;
        float          value      = 50;
        HashSet <Unit> enemyUnits = UnitManager.Instance.GetUnitsByHostility(user);

        foreach (Unit u in enemyUnits)
        {
            if (IncreasedRange.StaticGetTiles(u.Tile).Contains(move))
            {
                value += 3;
            }
        }
        return(value);
    }
Ejemplo n.º 6
0
    /// <summary>
    /// Get the weapon you generated.
    /// </summary>
    /// <returns></returns>
    public Weapon GetWeapon()
    {
        Weapon w = new Weapon();

        w.Name = Name;
        w.buff = new Stats();

        float power         = level + 4;
        float advantages    = 0f;
        float disadvantages = 0f;

        // advantages
        if (reach == MELEEANDRANGE)
        {
            advantages += 0.25f;
        }
        if (reach == LONGRANGE)
        {
            advantages += 0.15f;
        }
        if (defences == APIERCE)
        {
            advantages += 0.5f;
        }
        if (hitMod > 0)
        {
            advantages += hitMod / 20f;
        }
        if (critMod > 0)
        {
            advantages += critMod / 20f;
        }

        // disadvantages
        if (hitMod < 0)
        {
            disadvantages += hitMod / 20f;
        }

        // modify base damage to work with modifiers
        power /= 1f + advantages;
        power *= 1f + disadvantages;

        // grant the weapon appropiate range
        IReach ir;

        if (reach == MELEE)
        {
            ir = new Melee();
        }
        else if (reach == MELEEANDRANGE)
        {
            ir = new RangeAndMelee();
        }
        else if (reach == LONGRANGE)
        {
            ir = new IncreasedRange();
        }
        else
        {
            ir = new Ranged();
        }

        // Weapon Damage Stuffs
        WeaponDamage wd = new WeaponDamage();

        wd.StrScale   = strenght * 0.25f;
        wd.DexScale   = dexterity * 0.25f;
        wd.IntScale   = intelligence * 0.25f;
        wd.BaseDamage = (int)power;

        w.attackInfo = new AttackInfo(ir, wd, null, anim);

        w.buff.hitBonus  += hitMod * 0.1f;
        w.buff.critBonus += critMod * 0.15f;

        level  += 4;
        w.value = level * level * 2;

        w.icon = SpriteLibrary.GetIcon("weapon");

        return(w);
    }
Ejemplo n.º 7
0
 public HashSet <Tile> GetAvailableTargets(Tile tile)
 {
     return(new HashSet <Tile>(IncreasedRange.StaticGetTiles(tile)));
 }
Ejemplo n.º 8
0
    public HashSet <Tile> GetAvailableTargets()
    {
        Tile t = GetComponent <Unit>().Tile;

        return(new HashSet <Tile>(IncreasedRange.StaticGetTiles(t)));
    }