示例#1
0
        private static int NeedToKillMedusa(Hero _Enemy, List <RemoteBomb> _Bomds, float _Ab)
        {
            float num1 = 0.0f;

            Ensage.Ability abilityById = _Enemy.GetAbilityById(AbilityId.medusa_mana_shield);
            if (abilityById.IsToggled)
            {
                num1 = abilityById.GetAbilitySpecialData("damage_per_mana", 0U);
            }
            float _Health = (float)_Enemy.Health;

            if ((double)num1 > 0.0)
            {
                float num2 = _Enemy.Mana * num1;
                float num3 = (float)(_Enemy.Health / 40U * 60U);
                _Health = (double)num3 <= (double)num2 ? num3 + (float)_Enemy.Health : num2 + (float)_Enemy.Health;
            }
            int num4 = 0;
            Stack <RemoteBomb> source = new Stack <RemoteBomb>((IEnumerable <RemoteBomb>)_Bomds.OrderBy <RemoteBomb, float>((Func <RemoteBomb, float>)(x => x._Damage)));

            DamageManager.UseDagon(_Enemy, _Ab, ref _Health);
            while ((double)_Health > 0.0)
            {
                if (!source.Any <RemoteBomb>())
                {
                    return(100);
                }
                _Health -= source.Pop()._Damage;
                ++num4;
            }
            return(num4);
        }
示例#2
0
        public Ability(Ensage.Ability ability)
        {
            Source  = ability;
            Name    = ability.Name;
            Texture = Drawing.GetTexture("materials/ensage_ui/spellicons/" + Name);
            Handle  = ability.Handle;

            var towerDamageReduction = 0;

            if (AbilityAdjustments.TowerDamageAbilities.TryGetValue(Name, out towerDamageReduction))
            {
                DoesTowerDamage      = true;
                TowerDamageReduction = towerDamageReduction;
            }
        }
示例#3
0
        public static bool CanCounter(Hero _Enemy)
        {
            Item  itemById1   = _Enemy.GetItemById(AbilityId.item_blink);
            float rawGameTime = Game.RawGameTime;

            if (_Enemy.ClassId == ClassId.CDOTA_Unit_Hero_Juggernaut)
            {
                Ensage.Ability abilityById = _Enemy.GetAbilityById(AbilityId.juggernaut_blade_fury);
                if ((Entity)abilityById != (Entity)null && (double)abilityById.Cooldown == 0.0 && ((double)_Enemy.Mana >= (double)abilityById.ManaCost && _Enemy.CanCastAbilities()))
                {
                    if (!Core.Config._Delays.ContainsKey("juggernaut_blade_fury"))
                    {
                        Core.Config._Delays.Add("juggernaut_blade_fury", new TimeModel()
                        {
                            AddedTime = rawGameTime,
                            Delay     = 0.5f
                        });
                        return(true);
                    }
                    TimeModel delay = Core.Config._Delays["juggernaut_blade_fury"];
                    if ((double)delay.AddedTime + 3.0 < (double)rawGameTime)
                    {
                        delay.AddedTime = rawGameTime;
                        return(true);
                    }
                    if ((double)delay.AddedTime + (double)delay.Delay > (double)rawGameTime)
                    {
                        return(true);
                    }
                }
            }
            else if (_Enemy.ClassId == ClassId.CDOTA_Unit_Hero_Riki)
            {
                Ensage.Ability abilityById = _Enemy.GetAbilityById(AbilityId.riki_tricks_of_the_trade);
                if ((Entity)abilityById != (Entity)null)
                {
                    if (abilityById.IsChanneling || abilityById.IsInAbilityPhase)
                    {
                        return(true);
                    }
                    if ((double)abilityById.Cooldown == 0.0 && (double)_Enemy.Mana >= (double)abilityById.ManaCost && _Enemy.CanCastAbilities())
                    {
                        if (!Core.Config._Delays.ContainsKey("riki_tricks_of_the_trade"))
                        {
                            Core.Config._Delays.Add("riki_tricks_of_the_trade", new TimeModel()
                            {
                                AddedTime = rawGameTime,
                                Delay     = 0.25f
                            });
                            return(true);
                        }
                        TimeModel delay = Core.Config._Delays["riki_tricks_of_the_trade"];
                        if ((double)delay.AddedTime + 3.0 < (double)rawGameTime)
                        {
                            delay.AddedTime = rawGameTime;
                            return(true);
                        }
                        if ((double)delay.AddedTime + (double)delay.Delay > (double)rawGameTime)
                        {
                            return(true);
                        }
                    }
                }
            }
            else if (_Enemy.ClassId == ClassId.CDOTA_Unit_Hero_Tusk)
            {
                if ((Entity)itemById1 != (Entity)null && (double)itemById1.CooldownLength - (double)itemById1.Cooldown < 0.600000023841858 && (double)itemById1.CooldownLength - (double)itemById1.Cooldown > 0.0)
                {
                    Ensage.Ability abilityById = _Enemy.GetAbilityById(AbilityId.tusk_snowball);
                    if ((Entity)abilityById != (Entity)null)
                    {
                        if (abilityById.IsChanneling || abilityById.IsInAbilityPhase)
                        {
                            return(true);
                        }
                        if ((double)abilityById.Cooldown == 0.0 && (double)_Enemy.Mana >= (double)abilityById.ManaCost && _Enemy.CanCastAbilities())
                        {
                            if (!Core.Config._Delays.ContainsKey("tusk_snowball"))
                            {
                                Core.Config._Delays.Add("tusk_snowball", new TimeModel()
                                {
                                    AddedTime = rawGameTime,
                                    Delay     = 0.75f
                                });
                                return(true);
                            }
                            TimeModel delay = Core.Config._Delays["tusk_snowball"];
                            if ((double)delay.AddedTime + 3.0 < (double)rawGameTime)
                            {
                                delay.AddedTime = rawGameTime;
                                return(true);
                            }
                            if ((double)delay.AddedTime + (double)delay.Delay > (double)rawGameTime)
                            {
                                return(true);
                            }
                        }
                    }
                }
            }
            else if (_Enemy.ClassId == ClassId.CDOTA_Unit_Hero_Phoenix)
            {
                Ensage.Ability abilityById = _Enemy.GetAbilityById(AbilityId.phoenix_supernova);
                if ((Entity)abilityById != (Entity)null)
                {
                    if (abilityById.IsChanneling || abilityById.IsInAbilityPhase)
                    {
                        return(true);
                    }
                    if ((double)abilityById.Cooldown == 0.0 && (double)_Enemy.Mana >= (double)abilityById.ManaCost && _Enemy.CanCastAbilities())
                    {
                        if (!Core.Config._Delays.ContainsKey("phoenix_supernova"))
                        {
                            Core.Config._Delays.Add("phoenix_supernova", new TimeModel()
                            {
                                AddedTime = rawGameTime,
                                Delay     = 0.75f
                            });
                            return(true);
                        }
                        TimeModel delay = Core.Config._Delays["phoenix_supernova"];
                        if ((double)delay.AddedTime + 3.0 < (double)rawGameTime)
                        {
                            delay.AddedTime = rawGameTime;
                            return(true);
                        }
                        if ((double)delay.AddedTime + (double)delay.Delay > (double)rawGameTime)
                        {
                            return(true);
                        }
                    }
                }
            }
            Item itemById2 = _Enemy.GetItemById(AbilityId.item_black_king_bar);

            if ((Entity)itemById2 != (Entity)null && (double)itemById2.Cooldown == 0.0)
            {
                if (!Core.Config._Delays.ContainsKey(_Enemy.Name + "item_black_king_bar"))
                {
                    Core.Config._Delays.Add(_Enemy.Name + "item_black_king_bar", new TimeModel()
                    {
                        AddedTime = rawGameTime,
                        Delay     = 0.5f
                    });
                    return(true);
                }
                TimeModel delay = Core.Config._Delays[_Enemy.Name + "item_black_king_bar"];
                if ((double)delay.AddedTime + 1.0 < (double)rawGameTime)
                {
                    delay.AddedTime = rawGameTime;
                    return(true);
                }
                if ((double)delay.AddedTime + (double)delay.Delay > (double)rawGameTime)
                {
                    return(true);
                }
            }
            if ((Entity)itemById1 != (Entity)null && (double)itemById1.CooldownLength - (double)itemById1.Cooldown < 0.600000023841858 && (double)itemById1.CooldownLength - (double)itemById1.Cooldown > 0.0)
            {
                Item itemById3 = _Enemy.GetItemById(AbilityId.item_cyclone);
                if ((Entity)itemById3 != (Entity)null && (double)itemById3.Cooldown == 0.0)
                {
                    return(true);
                }
                Item itemById4 = _Enemy.GetItemById(AbilityId.item_black_king_bar);
                if ((Entity)itemById4 != (Entity)null && (double)itemById4.Cooldown == 0.0)
                {
                    return(true);
                }
                if (_Enemy.ClassId == ClassId.CDOTA_Unit_Hero_Puck)
                {
                    Ensage.Ability abilityById = _Enemy.GetAbilityById(AbilityId.puck_phase_shift);
                    if ((Entity)abilityById != (Entity)null && ((double)abilityById.Cooldown == 0.0 || abilityById.IsChanneling || abilityById.IsInAbilityPhase))
                    {
                        return(true);
                    }
                }
                if (_Enemy.ClassId == ClassId.CDOTA_Unit_Hero_SandKing)
                {
                    Ensage.Ability abilityById = _Enemy.GetAbilityById(AbilityId.sandking_burrowstrike);
                    if ((Entity)abilityById != (Entity)null && ((double)abilityById.Cooldown == 0.0 || abilityById.IsChanneling || abilityById.IsInAbilityPhase))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }