public HashSet <Tile> GetAvailableTargets(Tile tile) { HashSet <Tile> ret = new HashSet <Tile>(RangeAndMelee.StaticGetTiles(tile)); ret.UnionWith(IncreasedRange.StaticGetTiles(tile)); return(ret); }
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); }
public HashSet <Tile> GetAvailableTargets(Tile tile) { HashSet <Tile> h = new HashSet <Tile>(Melee.StaticGetTiles(tile)); h.UnionWith(IncreasedRange.StaticGetTiles(tile)); return(h); }
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); }
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); }
/// <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); }
public HashSet <Tile> GetAvailableTargets(Tile tile) { return(new HashSet <Tile>(IncreasedRange.StaticGetTiles(tile))); }
public HashSet <Tile> GetAvailableTargets() { Tile t = GetComponent <Unit>().Tile; return(new HashSet <Tile>(IncreasedRange.StaticGetTiles(t))); }