Example #1
0
 public ObjectiveInhibitor(Vector2 position, ObjectiveInhibitorTurret inhibTower)
     : base(position)
 {
     _tower = inhibTower;
     _inhibitor = ObjectManager.Get<Obj_BarracksDampener>().First(tower => Math.Abs(tower.Position.X - position.X) < EstimatedPositionRange && Math.Abs(tower.Position.Y - position.Y) < EstimatedPositionRange);
     RequiredObjectives.Add(inhibTower);
 }
Example #2
0
 public ObjectBarrack(Obj_BarracksDampener obj, float respawnTime, bool taken = false)
 {
     Object          = obj;
     MinimapPosition = Drawing.WorldToMinimap(obj.Position);
     RespawnTime     = respawnTime;
     Taken           = taken;
 }
Example #3
0
 public InhibitorObject(Obj_BarracksDampener inhibitor)
 {
     Object          = inhibitor;
     Destroyed       = false;
     NextRespawnTime = -1;
     RespawnTime     = 300;
     LastHealth      = float.MinValue;
 }
Example #4
0
 public InhibitorObject(Obj_BarracksDampener obj)
 {
     Obj             = obj;
     SpawnTime       = (int)Game.ClockTime;
     RespawnTime     = 300;
     NextRespawnTime = 0;
     Locked          = false;
     Called          = false;
     TextMinimap     = new Render.Text(0, 0, "", Timer.Timers.GetMenuItem("SAssembliesTimersTextScale").GetValue <Slider>().Value, new ColorBGRA(Color4.White));
     Timer.Timers.GetMenuItem("SAssembliesTimersTextScale").ValueChanged += InhibitorObject_ValueChanged;
     TextMinimap.TextUpdate = delegate
     {
         return((NextRespawnTime - (int)Game.ClockTime).ToString());
     };
     TextMinimap.PositionUpdate = delegate
     {
         if (Obj.Position.Length().Equals(0.0f))
         {
             return(new Vector2(0, 0));
         }
         Vector2 sPos = Drawing.WorldToMinimap(Obj.Position);
         return(new Vector2(sPos.X, sPos.Y));
     };
     TextMinimap.VisibleCondition = sender =>
     {
         return(Timer.Timers.GetActive() && InhibitorTimer.GetActive() && NextRespawnTime > 0);
     };
     TextMinimap.OutLined = true;
     TextMinimap.Centered = true;
     TextMinimap.Add();
     TextMap            = new Render.Text(0, 0, "", (int)(Timer.Timers.GetMenuItem("SAssembliesTimersTextScale").GetValue <Slider>().Value * 3.5), new ColorBGRA(Color4.White));
     TextMap.TextUpdate = delegate
     {
         return((NextRespawnTime - (int)Game.ClockTime).ToString());
     };
     TextMap.PositionUpdate = delegate
     {
         if (Obj.Position.Length().Equals(0.0f))
         {
             return(new Vector2(0, 0));
         }
         Vector2 sPos = Drawing.WorldToScreen(Obj.Position);
         return(new Vector2(sPos.X, sPos.Y));
     };
     TextMap.VisibleCondition = sender =>
     {
         return(Timer.Timers.GetActive() && InhibitorTimer.GetActive() && NextRespawnTime > 0);
     };
     TextMap.OutLined = true;
     TextMap.Centered = true;
     TextMap.Add();
 }
Example #5
0
        private static bool isValidAATarget(this Obj_BarracksDampener inhib)
        {
            if (inhib.IsDead || inhib.IsAlly)
            {
                return(false);
            }
            var attackrange = Me.AttackRange + Me.BoundingRadius + inhib.BoundingRadius;

            if (!inhib.IsValidTarget(attackrange, true))
            {
                return(false);
            }
            return(true);
        }
Example #6
0
        void Game_OnGameUpdate(EventArgs args)
        {
            if (!IsActive() || lastGameUpdateTime + new Random().Next(500, 1000) > Environment.TickCount)
            {
                return;
            }

            lastGameUpdateTime = Environment.TickCount;

            foreach (Health.HealthConf health in healthConf.ToArray())
            {
                Obj_BarracksDampener objBarracks = health.Obj as Obj_BarracksDampener;
                if (objBarracks != null)
                {
                    if (objBarracks.IsValid)
                    {
                        if (((objBarracks.Health / objBarracks.MaxHealth) * 100) > 75)
                        {
                            health.Text.Color = Color.LightGreen;
                        }
                        else if (((objBarracks.Health / objBarracks.MaxHealth) * 100) <= 75)
                        {
                            health.Text.Color = Color.LightYellow;
                        }
                        else if (((objBarracks.Health / objBarracks.MaxHealth) * 100) <= 50)
                        {
                            health.Text.Color = Color.Orange;
                        }
                        else if (((objBarracks.Health / objBarracks.MaxHealth) * 100) <= 25)
                        {
                            health.Text.Color = Color.IndianRed;
                        }
                    }
                    else
                    {
                        healthConf.Remove(health);
                    }
                }
            }
        }
Example #7
0
 public Inhibitor(Obj_BarracksDampener obj)
 {
     Obj = obj;
     SpawnTime = (int) Game.ClockTime;
     RespawnTime = 300;
     NextRespawnTime = 0;
     Locked = false;
     Called = false;
 }
Example #8
0
 public ObjectBarrack(Obj_BarracksDampener obj, float respawnTime, bool taken = false)
 {
     Object = obj;
     MinimapPosition = Drawing.WorldToMinimap(obj.Position);
     RespawnTime = respawnTime;
     Taken = taken;
 }
Example #9
0
        void Game_OnGameUpdate(EventArgs args)
        {
            if (!IsActive() || !Menu.InhibitorHealth.GetActive())
            {
                return;
            }

            foreach (HealthConf health in healthConf.ToArray())
            {
                Obj_BarracksDampener objBarracks = health.Obj as Obj_BarracksDampener;
                if (objBarracks != null)
                {
                    if (objBarracks.IsValid)
                    {
                        if (((objBarracks.Health / objBarracks.MaxHealth) * 100) > 75)
                        {
                            health.Text.Color = Color.LightGreen;
                        }
                        else if (((objBarracks.Health / objBarracks.MaxHealth) * 100) <= 75)
                        {
                            health.Text.Color = Color.LightYellow;
                        }
                        else if (((objBarracks.Health / objBarracks.MaxHealth) * 100) <= 50)
                        {
                            health.Text.Color = Color.Orange;
                        }
                        else if (((objBarracks.Health / objBarracks.MaxHealth) * 100) <= 25)
                        {
                            health.Text.Color = Color.IndianRed;
                        }
                    }
                    else
                    {
                        healthConf.Remove(health);
                    }
                }
                Obj_AI_Turret objAiTurret = health.Obj as Obj_AI_Turret;
                if (objAiTurret != null)
                {
                    if (objAiTurret.IsValid)
                    {
                        if (((objAiTurret.Health / objAiTurret.MaxHealth) * 100) > 75)
                        {
                            health.Text.Color = Color.LightGreen;
                        }
                        else if (((objAiTurret.Health / objAiTurret.MaxHealth) * 100) <= 75)
                        {
                            health.Text.Color = Color.LightYellow;
                        }
                        else if (((objAiTurret.Health / objAiTurret.MaxHealth) * 100) <= 50)
                        {
                            health.Text.Color = Color.Orange;
                        }
                        else if (((objAiTurret.Health / objAiTurret.MaxHealth) * 100) <= 25)
                        {
                            health.Text.Color = Color.IndianRed;
                        }
                    }
                    else
                    {
                        healthConf.Remove(health);
                    }
                }
            }
        }
Example #10
0
 public InhibitorObject(Obj_BarracksDampener obj)
 {
     Obj = obj;
     SpawnTime = (int)Game.ClockTime;
     RespawnTime = 300;
     NextRespawnTime = 0;
     Locked = false;
     Called = false;
     TextMinimap = new Render.Text(0, 0, "", Timer.Timers.GetMenuItem("SAssembliesTimersTextScale").GetValue<Slider>().Value, new ColorBGRA(Color4.White));
     Timer.Timers.GetMenuItem("SAssembliesTimersTextScale").ValueChanged += InhibitorObject_ValueChanged;
     TextMinimap.TextUpdate = delegate
     {
         return (NextRespawnTime - (int)Game.ClockTime).ToString();
     };
     TextMinimap.PositionUpdate = delegate
     {
         if (Obj.Position.Length().Equals(0.0f))
             return new Vector2(0, 0);
         Vector2 sPos = Drawing.WorldToMinimap(Obj.Position);
         return new Vector2(sPos.X, sPos.Y);
     };
     TextMinimap.VisibleCondition = sender =>
     {
         return IsActive() && NextRespawnTime > 0;
     };
     TextMinimap.OutLined = true;
     TextMinimap.Centered = true;
     TextMinimap.Add();
     TextMap = new Render.Text(0, 0, "", (int)(Timer.Timers.GetMenuItem("SAssembliesTimersTextScale").GetValue<Slider>().Value * 3.5), new ColorBGRA(Color4.White));
     TextMap.TextUpdate = delegate
     {
         return (NextRespawnTime - (int)Game.ClockTime).ToString();
     };
     TextMap.PositionUpdate = delegate
     {
         if (Obj.Position.Length().Equals(0.0f))
             return new Vector2(0, 0);
         Vector2 sPos = Drawing.WorldToScreen(Obj.Position);
         return new Vector2(sPos.X, sPos.Y);
     };
     TextMap.VisibleCondition = sender =>
     {
         return IsActive() && InhibitorTimer.GetActive() && NextRespawnTime > 0;
     };
     TextMap.OutLined = true;
     TextMap.Centered = true;
     TextMap.Add();
 }
Example #11
0
 public ObjectiveInhibitor(Vector2 position, ObjectiveInhibitorTurret inhibTower) : base(position)
 {
     _tower     = inhibTower;
     _inhibitor = ObjectManager.Get <Obj_BarracksDampener>().First(tower => Math.Abs(tower.Position.X - position.X) < EstimatedPositionRange && Math.Abs(tower.Position.Y - position.Y) < EstimatedPositionRange);
     RequiredObjectives.Add(inhibTower);
 }