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); }
public static int NeedToKill(Hero _Enemy, List <RemoteBomb> _Bombs) { if (_Enemy.ClassId == ClassId.CDOTA_Unit_Hero_StormSpirit) { if ((double)Core.Config._StormLastUlt + 0.6 > (double)Game.RawGameTime) { return(100); } } else if (_Enemy.ClassId == ClassId.CDOTA_Unit_Hero_EmberSpirit && (double)Core.Config._EmberLastUlt + 0.6 > (double)Game.RawGameTime) { return(100); } float num1 = Core.Config._RSpell.GetDamageReduction((Unit)_Enemy); if (Core.Config._Menu.DamageHelpersMenu.UseVeil && Core.Config._Items.Veil != null && (Core.Config._Items.Veil.CanBeCasted && (double)Core.Config._Hero.Distance2D((Unit)_Enemy, false) < (double)Core.Config._Items.Veil.CastRange)) { num1 = (float)(1.0 - (1.0 - (double)num1) * 1.25); } float _Ab = 1f - num1; if (_Enemy.ClassId == ClassId.CDOTA_Unit_Hero_Bristleback && (Entity)_Enemy.GetAbilityById(AbilityId.bristleback_bristleback) != (Entity)null && ((double)_Enemy.FindRotationAngle(_Bombs.First <RemoteBomb>()._Unit.Position) > 0.35 || _Enemy.IsRotating())) { return(100); } float _Health = (float)_Enemy.Health + _Enemy.HealthRegeneration * 1.5f; Item itemById1 = _Enemy.GetItemById(AbilityId.item_infused_raindrop); if ((Entity)itemById1 != (Entity)null && (double)itemById1.Cooldown == 0.0) { _Health += 90f; } Item itemById2 = _Enemy.GetItemById(AbilityId.item_aeon_disk); float num2 = _Health - (float)_Enemy.MaximumHealth * 0.8f; bool flag = false; if ((Entity)itemById2 != (Entity)null && (double)itemById2.Cooldown == 0.0 && (double)_Health > (double)num2) { _Health = num2; flag = true; } if (_Enemy.HasModifier("modifier_abaddon_aphotic_shield")) { _Health += 200f; } if (_Enemy.HasModifier("modifier_abaddon_borrowed_time_passive")) { _Health -= 350f; } if (_Enemy.ClassId == ClassId.CDOTA_Unit_Hero_Huskar) { return(DamageManager.NeedToKillHuskar(_Enemy, _Bombs)); } if (_Enemy.ClassId == ClassId.CDOTA_Unit_Hero_Spectre) { uint level = _Enemy.GetAbilityById(AbilityId.spectre_dispersion).Level; if (level > 0U) { switch (level) { case 1: _Health *= 1.1111f; break; case 2: _Health *= 1.1628f; break; case 3: _Health *= 1.2195f; break; case 4: _Health *= 1.2821f; break; } } } if (_Enemy.ClassId == ClassId.CDOTA_Unit_Hero_Medusa) { return(DamageManager.NeedToKillMedusa(_Enemy, _Bombs, _Ab)); } if (_Enemy.HasModifier("modifier_visage_gravekeepers_cloak")) { return(DamageManager.NeedToKillVisage(_Enemy, _Bombs)); } Modifier modifierByName = _Enemy.GetModifierByName("modifier_templar_assassin_refraction_absorb"); int num3 = modifierByName != null ? modifierByName.StackCount : 0; if (num3 > 0 && !Core.Config._Menu.Features.DetonateOnTAShield) { return(100); } if (!flag) { DamageManager.UseDagon(_Enemy, _Ab, ref _Health); } int num4 = 0; if (!_Bombs.Any <RemoteBomb>()) { num4 = 100; } foreach (RemoteBomb remoteBomb in (IEnumerable <RemoteBomb>)_Bombs.OrderBy <RemoteBomb, float>((Func <RemoteBomb, float>)(x => x._Damage))) { if ((double)_Health > 0.0) { _Health -= remoteBomb._Damage * _Ab; ++num4; } else { break; } } if ((double)_Health > 0.0) { num4 = 100; } return(num4 + num3); }