本文整理汇总了C#中Obj_AI_Hero.CountEnemiesInRange方法的典型用法代码示例。如果您正苦于以下问题:C# Obj_AI_Hero.CountEnemiesInRange方法的具体用法?C# Obj_AI_Hero.CountEnemiesInRange怎么用?C# Obj_AI_Hero.CountEnemiesInRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj_AI_Hero
的用法示例。
在下文中一共展示了Obj_AI_Hero.CountEnemiesInRange方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Fuckingw
private static void Fuckingw(Obj_AI_Hero hero)
{
if (hero == null) return;
var qmana = _player.Spellbook.GetSpell(SpellSlot.Q).ManaCost;
var wmana = _player.Spellbook.GetSpell(SpellSlot.W).ManaCost;
var emana = _player.Spellbook.GetSpell(SpellSlot.E).ManaCost;
var rmana = _player.Spellbook.GetSpell(SpellSlot.R).ManaCost;
var diveTower = _config.Item("diveintower").GetValue<bool>();
if ((hero.UnderTurret() && !diveTower) || !_w.IsReady()) return;
var usewhE = (100 * (_player.Health / _player.MaxHealth)) > _config.Item("UseWHE").GetValue<Slider>().Value;
if (usewhE && hero.IsValidTarget(_q.Range + _w.Range) &&
hero.CountEnemiesInRange(_q.Range + _w.Range) <= _config.Item("EnemyC").GetValue<Slider>().Value &&
_player.Distance(hero) > Orbwalking.GetRealAutoAttackRange(_player))
{
if (hero.Health < (_player.GetAutoAttackDamage(hero, true) * 2))
{
_w.Cast(hero.Position);
}
else if (hero.Health < _q.GetDamage(hero) && _player.MaxMana > qmana + wmana && _q.IsReady())
{
_w.Cast(hero.Position);
}
else if (hero.Health < _e.GetDamage(hero) && _player.MaxMana > emana + wmana && _e.IsReady())
{
_w.Cast(hero.Position);
}
else if (hero.Health < _e.GetDamage(hero) + _q.GetDamage(hero) && _player.MaxMana > qmana + emana + wmana &&
_e.IsReady() && _e.IsReady())
{
_w.Cast(hero.Position);
}
else if (hero.Health < _q.GetDamage(hero) + _r.GetDamage(hero) && _q.IsReady() && _r.IsReady() &&
_player.MaxMana > qmana + wmana + rmana)
{
_w.Cast(hero.Position);
}
}
}
示例2: Game_OnUpdate
private static void Game_OnUpdate(EventArgs args)
{
didhs = menu.Item("harasskey").GetValue<KeyBind>().Active;
// ulti check
uo = player.GetSpell(SpellSlot.R).Name != "RivenFengShuiEngine";
// hydra check
hashd = Items.HasItem(3077) || Items.HasItem(3074);
canhd = !didaa && (Items.CanUseItem(3077) || Items.CanUseItem(3074));
// main target (riven targ)
rtarg = TargetSelector.GetTarget(900, TargetSelector.DamageType.Physical);
ctarg = TargetSelector.GetTarget(q.Range + w.Range, TargetSelector.DamageType.Physical);
btarg = rtarg != null && ctarg != null &&
TargetSelector.GetPriority(rtarg) > TargetSelector.GetPriority(ctarg)
? rtarg
: ctarg;
truerange = player.AttackRange + player.Distance(player.BBox.Minimum) + 1;
// if no valid target cancel to cursor pos
if (!qtarg.IsValidTarget(truerange + 100))
qtarg = player;
// can we burst?
cb = rtarg != null && r.IsReady() && q.IsReady() &&
((ComboDamage(rtarg)/1.6) >= rtarg.Health || rtarg.CountEnemiesInRange(w.Range) >= menuslide("multic"));
// set player skin
player.SetSkin(player.BaseSkinName, menu.Item("skinset").GetValue<StringList>().SelectedIndex);
// move behind me
if (qtarg != player && qtarg.IsFacing(player) && qtarg.Distance(player.ServerPosition) < truerange + 120)
movepos = player.ServerPosition + (player.ServerPosition - qtarg.ServerPosition).Normalized()*28;
// move towards target (thanks yol0)
if (qtarg != player && (!qtarg.IsFacing(player) || qtarg.Distance(player.ServerPosition) > truerange + 120))
movepos = player.ServerPosition.Extend(qtarg.ServerPosition, 350);
// move to game cursor pos
if (qtarg == player)
movepos = Game.CursorPos;
// orbwalk movement
orbwalker.SetAttack(canmv);
orbwalker.SetMovement(canmv);
// reqs ->
SemiQ();
AuraUpdate();
CombatCore();
Windslash();
if (btarg.IsValidTarget() &&
menu.Item("combokey").GetValue<KeyBind>().Active)
{
ComboTarget(btarg);
}
if (rtarg.IsValidTarget() &&
menu.Item("shycombo").GetValue<KeyBind>().Active)
{
if (rtarg.Distance(player.ServerPosition) <= truerange)
{
if ((Items.HasItem(3077) || Items.HasItem(3074)))
{
if ((Items.CanUseItem(3077) || Items.CanUseItem(3074)))
{
OrbTo(rtarg);
}
}
}
if (rtarg.IsValidTarget(w.Range))
{
if (w.IsReady())
w.Cast();
}
TryFlashInitiate(rtarg);
}
if (didhs && ctarg.IsValidTarget())
{
HarassTarget(ctarg);
}
if (player.IsValid &&
menu.Item("clearkey").GetValue<KeyBind>().Active)
{
Clear();
Wave();
}
if (player.IsValid &&
menu.Item("fleekey").GetValue<KeyBind>().Active)
{
Flee();
//.........这里部分代码省略.........
示例3: UseItems
public static void UseItems(Obj_AI_Hero target, Menu config, float comboDmg = 0f, bool cleanseSpell=false)
{
if (config.Item("hyd").GetValue<bool>() && player.BaseSkinName != "Renekton")
{
castHydra(target);
}
if (config.Item("ran").GetValue<bool>() && Items.HasItem(randuins.Id) && Items.CanUseItem(randuins.Id))
{
if (target != null && player.Distance(target) < randuins.Range &&
player.CountEnemiesInRange(randuins.Range) >= config.Item("ranmin").GetValue<Slider>().Value)
{
Items.UseItem(randuins.Id);
}
}
if (config.Item("odin").GetValue<bool>() && target != null && Items.HasItem(odins.Id) &&
Items.CanUseItem(odins.Id))
{
var odinDmg = Damage.GetItemDamage(player, target, Damage.DamageItems.OdingVeils);
if (config.Item("odinonlyks").GetValue<bool>())
{
if (odinDmg > target.Health)
{
odins.Cast(target);
}
}
else if (player.CountEnemiesInRange(odins.Range) >= config.Item("odinmin").GetValue<Slider>().Value ||
(Math.Max(comboDmg, odinDmg) > target.Health && player.HealthPercent<30 && player.Distance(target) < odins.Range &&
!CombatHelper.CheckCriticalBuffs(target)))
{
odins.Cast();
}
}
if (target != null && config.Item("bil").GetValue<bool>() && Items.HasItem(bilgewater.Id) &&
Items.CanUseItem(bilgewater.Id))
{
var bilDmg = Damage.GetItemDamage(player, target, Damage.DamageItems.Bilgewater);
if (config.Item("bilonlyks").GetValue<bool>())
{
if (bilDmg > target.Health)
{
bilgewater.Cast(target);
}
}
else if ((player.Distance(target) > config.Item("bilminr").GetValue<Slider>().Value &&
IsHeRunAway(target) && (target.Health / target.MaxHealth * 100f) < 40 &&
target.Distance(player) > player.AttackRange) ||
(Math.Max(comboDmg, bilDmg) > target.Health && (player.Health / player.MaxHealth * 100f) < 50))
{
bilgewater.Cast(target);
}
}
if (target != null && config.Item("botr").GetValue<bool>() && Items.HasItem(botrk.Id) &&
Items.CanUseItem(botrk.Id))
{
var botrDmg = Damage.GetItemDamage(player, target, Damage.DamageItems.Botrk);
if (config.Item("botronlyks").GetValue<bool>())
{
if (botrDmg > target.Health)
{
botrk.Cast(target);
}
}
else if ((player.Distance(target) > config.Item("botrminr").GetValue<Slider>().Value &&
(player.Health / player.MaxHealth * 100f) <
config.Item("botrmyhealth").GetValue<Slider>().Value &&
(target.Health / target.MaxHealth * 100f) <
config.Item("botrenemyhealth").GetValue<Slider>().Value) ||
(IsHeRunAway(target) && (target.Health / target.MaxHealth * 100f) < 40 &&
target.Distance(player) > player.AttackRange) ||
(Math.Max(comboDmg, botrDmg) > target.Health && (player.Health / player.MaxHealth * 100f) < 50))
{
botrk.Cast(target);
}
}
if (target != null && config.Item("hex").GetValue<bool>() && Items.HasItem(hexgun.Id) &&
Items.CanUseItem(hexgun.Id))
{
var hexDmg = Damage.GetItemDamage(player, target, Damage.DamageItems.Hexgun);
if (config.Item("hexonlyks").GetValue<bool>())
{
if (hexDmg > target.Health)
{
hexgun.Cast(target);
}
}
else if ((player.Distance(target) > config.Item("hexminr").GetValue<Slider>().Value &&
IsHeRunAway(target) && (target.Health / target.MaxHealth * 100f) < 40 &&
target.Distance(player) > player.AttackRange) ||
(Math.Max(comboDmg, hexDmg) > target.Health && (player.Health / player.MaxHealth * 100f) < 50))
{
hexgun.Cast(target);
}
}
if (config.Item("Muramana").GetValue<bool>() &&
((!MuramanaEnabled && config.Item("MuramanaMinmana").GetValue<Slider>().Value < player.ManaPercent) ||
(MuramanaEnabled && config.Item("MuramanaMinmana").GetValue<Slider>().Value > player.ManaPercent)))
{
if (Muramana.IsOwned() && Muramana.IsReady())
{
Muramana.Cast();
//.........这里部分代码省略.........
示例4: enemiesInRange
public int enemiesInRange(Obj_AI_Hero obj, float range)
{
return obj.CountEnemiesInRange(range);
}
示例5: Checkinrange
private static bool Checkinrange(Obj_AI_Hero i)
{
if (i.CountEnemiesInRange(750) >= 1 && i.CountEnemiesInRange(750) < 3)
{
return true;
}
return false;
}
示例6: Combo
private void Combo(Obj_AI_Hero target, float cmbDmg, bool canKill, bool bush)
{
if (target == null || !target.IsValidTarget())
{
return;
}
if (config.Item("useItems").GetValue<bool>())
{
ItemHandler.UseItems(target, config);
}
if (config.Item("usew", true).GetValue<bool>() && W.IsReady() && W.CanCast(target))
{
var tarPered = W.GetPrediction(target);
if (justE && ePos.IsValid() && target.Distance(ePos) < 375)
{
if (W.Range - 80 > tarPered.CastPosition.Distance(player.Position) &&
tarPered.Hitchance >= HitChance.High)
{
W.Cast(target.Position, config.Item("packets").GetValue<bool>());
}
}
else
{
if (W.Range - 80 > tarPered.CastPosition.Distance(player.Position) &&
tarPered.Hitchance >= HitChance.VeryHigh)
{
W.Cast(tarPered.CastPosition, config.Item("packets").GetValue<bool>());
}
}
}
if (config.Item("usee", true).GetValue<bool>() && E.IsReady() &&
(((canKill && config.Item("useekill", true).GetValue<bool>()) ||
(!config.Item("useekill", true).GetValue<bool>() && CheckMana())) ||
config.Item("startWithE", true).GetValue<bool>()))
{
switch (config.Item("eType", true).GetValue<StringList>().SelectedIndex)
{
case 0:
CastE(target);
return;
case 1:
CastE(target, false);
return;
break;
}
}
if (config.Item("useq", true).GetValue<bool>() && Q.IsReady() && Q.CanCast(target) && target.IsValidTarget() &&
!bush && !Estun)
{
CastQHero(target);
}
var ignitedmg = (float) player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
bool hasIgnite = player.Spellbook.CanUseSpell(player.GetSpellSlot("SummonerDot")) == SpellState.Ready;
if (config.Item("useIgnite", true).GetValue<bool>() &&
((ignitedmg > target.Health && hasIgnite && !player.IsChannelingImportantSpell() && !justQ &&
!Q.CanCast(target) && !justR && !R.CanCast(target) && CheckW(target)) || IgniteTarget != null))
{
if (IgniteTarget != null)
{
player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), IgniteTarget);
return;
}
player.Spellbook.CastSpell(player.GetSpellSlot("SummonerDot"), target);
}
var castR = false;
if (target.CountEnemiesInRange(2000) == 1)
{
castR = true;
}
else if (!config.Item("ult" + target.SkinName, true).GetValue<bool>())
{
castR = true;
}
if (R.IsReady() && R.CanCast(target) && config.Item("user", true).GetValue<bool>() && castR &&
R.Instance.ManaCost < player.Mana && !target.Buffs.Any(b => CombatHelper.invulnerable.Contains(b.Name)) &&
!CombatHelper.CheckCriticalBuffs(target))
{
if (config.Item("userPred", true).GetValue<bool>())
{
var Whit = wPos.IsValid() && System.Environment.TickCount - wTime > 700 &&
Prediction.GetPrediction(target, 0.55f).UnitPosition.Distance(wPos) < W.Width;
var targetHP = HealthPrediction.GetHealthPrediction(target, 400);
var killWithIgnite = hasIgnite && config.Item("useIgnite", true).GetValue<bool>() &&
R.GetDamage(target) + ignitedmg > targetHP && targetHP > R.GetDamage(target);
var killWithW = wPos != null && Whit && R.GetDamage(target) + W.GetDamage(target) > targetHP &&
target.Health > R.GetDamage(target);
var killWithIgniteAndW = !killWithW && Whit && hasIgnite &&
config.Item("useIgnite", true).GetValue<bool>() &&
R.GetDamage(target) + W.GetDamage(target) + ignitedmg > targetHP &&
targetHP > R.GetDamage(target) + W.GetDamage(target);
if (killWithW || (targetHP < R.GetDamage(target) && !justQ && CheckW(target)))
{
R.CastOnUnit(target, config.Item("packets").GetValue<bool>());
}
//.........这里部分代码省略.........
示例7: CastR
private void CastR(Obj_AI_Hero target)
{
if (R.IsReady() && !maoR &&
player.Mana / player.MaxMana * 100 > config.Item("rmana", true).GetValue<Slider>().Value &&
config.Item("user", true).GetValue<Slider>().Value <= target.CountEnemiesInRange(R.Range - 50))
{
R.Cast(config.Item("packets").GetValue<bool>());
}
}
示例8: Game_OnUpdate
private static void Game_OnUpdate(EventArgs args)
{
didhs = menu.Item("harasskey").GetValue<KeyBind>().Active;
// ulti check
uo = player.GetSpell(SpellSlot.R).Name != "RivenFengShuiEngine";
// hydra check
hashd = Items.HasItem(3077) || Items.HasItem(3074);
canhd = !didaa && (Items.CanUseItem(3077) || Items.CanUseItem(3074));
// main target (riven targ)
rtarg = TargetSelector.GetTarget(1100, TargetSelector.DamageType.Physical);
// my radius
truerange = player.AttackRange + player.Distance(player.BBox.Minimum) + 1;
// if no valid target cancel to cursor pos
if (!qtarg.IsValidTarget(truerange + 100))
qtarg = player;
// riven w range
wrange = uo ? w.Range + 25 : w.Range;
// can we burst?
cb = rtarg != null && r.IsReady() && q.IsReady() &&
((ComboDamage(rtarg)/1.6) >= rtarg.Health || rtarg.CountEnemiesInRange(w.Range) >= menuslide("multic"));
// move behind me
if (qtarg != player && qtarg.IsFacing(player) && qtarg.Distance(player.ServerPosition) < truerange + 120)
movepos = player.ServerPosition + (player.ServerPosition - qtarg.ServerPosition).Normalized()*28;
// move towards target (thanks yol0)
if (qtarg != player && (!qtarg.IsFacing(player) || qtarg.Distance(player.ServerPosition) > truerange + 120))
movepos = player.ServerPosition.Extend(qtarg.ServerPosition, 350);
// move to game cursor pos
if (qtarg == player)
movepos = Game.CursorPos;
// orbwalk movement
orbwalker.SetAttack(canmv);
orbwalker.SetMovement(canmv);
// reqs ->
SemiQ();
AuraUpdate();
CombatCore();
Windslash();
if (rtarg.IsValidTarget() &&
menu.Item("combokey").GetValue<KeyBind>().Active)
{
ComboTarget(rtarg);
TryIgnote(rtarg);
}
if (rtarg.IsValidTarget() &&
menu.Item("shycombo").GetValue<KeyBind>().Active)
{
if (rtarg.Distance(player.ServerPosition) <= wrange)
{
w.Cast();
}
OrbTo(rtarg, 350);
TryFlashInitiate(rtarg);
TryIgnote(rtarg);
if (q.IsReady() && rtarg.Distance(player.ServerPosition) <= q.Range + 30)
{
useinventoryitems(rtarg);
CheckR();
if (menulist("emode") == 0 || (ComboDamage(rtarg) / 1.7) >= rtarg.Health)
{
if (Items.CanUseItem(3077) || Items.CanUseItem(3074))
return;
}
if (canq)
q.Cast(rtarg.ServerPosition);
}
}
if (didhs && rtarg.IsValidTarget())
{
HarassTarget(rtarg);
}
if (player.IsValid &&
menu.Item("clearkey").GetValue<KeyBind>().Active)
{
Clear();
Wave();
}
if (player.IsValid &&
menu.Item("fleekey").GetValue<KeyBind>().Active)
{
//.........这里部分代码省略.........