/// <summary> /// Checks a point to see if it is in an ally or enemy fountain /// </summary> public static bool InFountain(this Vector2 position, FountainType fountain) { float fountainRange = 562500; //750 * 750 var map = Map.GetMap(); if (map != null && map.Type == Map.MapType.SummonersRift) { fountainRange = 1210000; //1100 * 1100 } var fpos = fountain == FountainType.OwnFountain ? MiniCache.AllyFountain : MiniCache.EnemyFountain; return(position.Distance(fpos, true) <= fountainRange); }
public void SetFountainType(FountainType type) { switch (type) { case FountainType.Earth: GetComponent <SpriteRenderer>().sprite = earthFountain; break; case FountainType.Water: GetComponent <SpriteRenderer>().sprite = waterFountain; break; case FountainType.Fire: GetComponent <SpriteRenderer>().sprite = fireFountain; break; case FountainType.Electric: GetComponent <SpriteRenderer>().sprite = electricFountain; break; } }
/// <summary> /// Returns true if unit is in fountain range (range in which fountain heals). /// The second optional parameter allows you to indicate which fountain you want to check against. /// </summary> public static bool InFountain(this Obj_AI_Base unit, FountainType ftype = FountainType.OwnFountain) { float fountainRange = 562500; //750 * 750 var map = Map.GetMap(); if (map != null && map.Type == Map.MapType.SummonersRift) { fountainRange = 1210000; //1100 * 1100 } var fpos = new Vector3(); if (ftype == FountainType.OwnFountain) { fpos = unit.Team == HeroManager.Player.Team ? MiniCache.AllyFountain : MiniCache.EnemyFountain; } if (ftype == FountainType.EnemyFountain) { fpos = unit.Team == HeroManager.Player.Team ? MiniCache.EnemyFountain : MiniCache.AllyFountain; } return(unit.IsVisible && unit.Distance(fpos, true) <= fountainRange); }
/// <summary> /// Checks a point to see if it is in an ally or enemy fountain /// </summary> public static bool InFountain(this Vector3 position, FountainType fountain) { return(position.To2D().InFountain(fountain)); }