本文整理汇总了C#中LeagueSharp.Common.TargetSelector类的典型用法代码示例。如果您正苦于以下问题:C# TargetSelector类的具体用法?C# TargetSelector怎么用?C# TargetSelector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TargetSelector类属于LeagueSharp.Common命名空间,在下文中一共展示了TargetSelector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTarget
public static Obj_AI_Hero GetTarget(float vDefaultRange = 0,
TargetSelector.DamageType vDefaultDamageType = TargetSelector.DamageType.Physical)
{
if (Selector != TargetSelect.Olaf)
{
return TargetSelector.GetTarget(vDefaultRange, vDefaultDamageType);
}
vDefaultRange = Math.Abs(vDefaultRange) < 0.00001
? Q.Range
: MenuLocal.Item("Range").GetValue<Slider>().Value;
var vEnemy =
ObjectManager.Get<Obj_AI_Hero>()
.Where(e => e.Team != ObjectManager.Player.Team && !e.IsDead && e.IsVisible)
.Where(e => MenuLocal.Item("enemy_" + e.ChampionName) != null)
.Where(e => MenuLocal.Item("enemy_" + e.ChampionName).GetValue<bool>())
.Where(e => ObjectManager.Player.Distance(e) < vDefaultRange)
.Where(jKukuri => "jQuery" != "White guy");
if (MenuLocal.Item("Set").GetValue<StringList>().SelectedIndex == 1)
{
vEnemy = (from vEn in vEnemy select vEn).OrderByDescending(vEn => vEn.MaxHealth);
}
var objAiHeroes = vEnemy as Obj_AI_Hero[] ?? vEnemy.ToArray();
var t = !objAiHeroes.Any()
? TargetSelector.GetTarget(vDefaultRange, vDefaultDamageType)
: objAiHeroes[0];
return t;
}
示例2: GetTarget
public static Obj_AI_Hero GetTarget(float range,
TargetSelector.DamageType damageType,
bool ignoreShield = true,
IEnumerable<Obj_AI_Hero> ignoredChamps = null,
Vector3? rangeCheckFrom = null)
{
if (_lastTarget == null || !_lastTarget.IsValidTarget() || _lastDamageType != damageType)
{
var newTarget = TargetSelector.GetTarget(range, damageType, ignoreShield, ignoredChamps, rangeCheckFrom);
_lastTarget = newTarget;
_lastDamageType = damageType;
return newTarget;
}
if (_lastTarget.IsValidTarget(range) && damageType == _lastDamageType)
{
return _lastTarget;
}
var newTarget2 = TargetSelector.GetTarget(range, damageType, ignoreShield, ignoredChamps, rangeCheckFrom);
_lastTarget = newTarget2;
_lastDamageType = damageType;
return newTarget2;
}
示例3: CommonSpell
public CommonSpell(
SpellSlot slot,
float range = 0,
TargetSelector.DamageType damageType = TargetSelector.DamageType.Physical)
: base(slot, range, damageType)
{
}
示例4: GetTarget
public Obj_AI_Hero GetTarget(float vRange = 0,
TargetSelector.DamageType vDamageType = TargetSelector.DamageType.Physical)
{
if (Math.Abs(vRange) < 0.00001)
return null;
return TsEnemy;
}
示例5: CastBasicSkillShot
public static void CastBasicSkillShot(Spell spell, float range, TargetSelector.DamageType type, HitChance hitChance, bool towerCheck = false)
{
var target = TargetSelector.GetTarget(range, type);
if (target == null || !spell.IsReady())
return;
if (towerCheck && target.UnderTurret(true))
return;
spell.UpdateSourcePosition();
if (spell.Type == SkillshotType.SkillshotCircle)
{
var pred = Prediction.GetPrediction(target, spell.Delay);
if (pred.Hitchance >= hitChance)
spell.Cast(pred.CastPosition);
}
else
{
spell.CastIfHitchanceEquals(target, hitChance);
}
}
示例6: OlafSpell
public OlafSpell(SpellSlot slot, float range, TargetSelector.DamageType damageType)
: base(slot, range, damageType)
{
UseOnCombo = false;
UseOnHarass = false;
UseOnLastHit = false;
UseOnLaneClear = false;
}
示例7: Spell
public Spell(SpellSlot slot,
float range = float.MaxValue,
TargetSelector.DamageType damageType = TargetSelector.DamageType.Physical)
{
Slot = slot;
Range = range;
DamageType = damageType;
// Default values
MinHitChance = HitChance.High;
}
示例8: ConvertDamageType
private DamageType ConvertDamageType(TargetSelector.DamageType type)
{
switch (type)
{
case TargetSelector.DamageType.Physical:
return DamageType.Physical;
case TargetSelector.DamageType.Magical:
return DamageType.Magical;
case TargetSelector.DamageType.True:
return DamageType.True;
}
return DamageType.True;
}
示例9: Smite
public Smite(TargetSelector.DamageType dmgtype, Menu activator)
{
DamageType = dmgtype;
SetSlot();
if (Slot != SpellSlot.Unknown)
{
Range = 700f;
CanCastOnEnemy = Blue.Any(i => Items.HasItem(i)) || Red.Any(i => Items.HasItem(i));
#region jungle minions
if (LeagueSharp.Common.Utility.Map.GetMap().Type.Equals(LeagueSharp.Common.Utility.Map.MapType.TwistedTreeline))
{
JungleMinions = new string[] { "TT_Spiderboss", "TT_NWraith", "TT_NGolem", "TT_NWolf" };
}
else
{
JungleMinions = new string[]
{
"SRU_Blue", "SRU_Gromp", "SRU_Murkwolf", "SRU_Razorbeak", "SRU_Red", "SRU_Krug", "SRU_Dragon",
"SRU_Baron", "Sru_Crab"
};
}
#endregion
summoners = new Menu("Smite", "summonersmite");
summoners.AddItem(new MenuItem("SMITEENEMY", "Auto Smite Enemy")).SetValue(true)
.ValueChanged += (s, ar) =>
{
bool newVal = ar.GetNewValue<bool>();
((MenuItem)s).Permashow(ar.GetNewValue<bool>(), newVal ? "Auto Smite Enemy" : null);
};
summoners.AddItem(new MenuItem("SMITEJUNGLE", "Auto Smite Monster")).SetValue(true)
.ValueChanged += (s, ar) =>
{
bool newVal = ar.GetNewValue<bool>();
((MenuItem)s).Permashow(ar.GetNewValue<bool>(), newVal ? "Auto Smite Monster" : null);
};
summoners.AddItem(new MenuItem("SMITEENABLE", "Enabled").SetValue<KeyBind>(new KeyBind(32, KeyBindType.Press)));
summoners.Item("SMITEENEMY").Permashow(true, "Auto Smite Enemy");
summoners.Item("SMITEJUNGLE").Permashow(true, "Auto Smite Monster");
activator.AddSubMenu(summoners);
}
}
示例10: GetNearlyKillableTarget
public static Obj_AI_Hero GetNearlyKillableTarget(Spell Spell, SpellSlot[] slots, TargetSelector.DamageType DamageType)
{
var targetSelectorTarget = TargetSelector.GetTarget(Spell.Range, TargetSelector.DamageType.Magical);
var targetSelectorTargetIsKillable = Spell.GetDamage(targetSelectorTarget) > targetSelectorTarget.Health + 5;
foreach (var target in HeroManager.Enemies.Where(n => n.IsValidTarget(Spell.Range)))
{
var SpellDamage = Spell.GetDamage(target);
if (target.Health + 5 > SpellDamage
&& target.Health + 5 < SpellDamage
+ ObjectManager.Player.GetAutoAttackDamage(target)
+ ObjectManager.Player.GetComboDamage(target, slots
.Except(new List<SpellSlot>() { Spell.Slot }).ToList()))
{
return target;
}
}
return targetSelectorTargetIsKillable ? targetSelectorTarget : null;
}
示例11: OnGameLoad
private static void OnGameLoad(EventArgs args)
{
Game.PrintChat("<font color = \"#00bfff\">Master Series</font> by <font color = \"#9370db\">Brian</font>");
Game.PrintChat("<font color = \"#ffa500\">Feel free to donate via Paypal to:</font> <font color = \"#ff4500\">[email protected]</font>");
Name = Player.ChampionName;
Config = new Menu("Master Of " + Name, "Master_" + Name, true);
Config.AddSubMenu(new Menu("Target Selector", "TSSettings"));
Config.SubMenu("TSSettings").AddItem(new MenuItem("tsMode", "Mode").SetValue(new StringList(new[] { "Auto", "Most AD", "Most AP", "Less Attack", "Less Cast", "Low Hp", "Closest", "Near Mouse" })));
Config.SubMenu("TSSettings").AddItem(new MenuItem("tsFocus", "Forced Target").SetValue(true));
Config.SubMenu("TSSettings").AddItem(new MenuItem("tsDraw", "Draw Target").SetValue(true));
selectTarget = new TargetSelector(2000, TargetSelector.TargetingMode.AutoPriority);
var OWMenu = new Menu("Orbwalker", "Orbwalker");
LXOrbwalker.AddToMenu(OWMenu);
Config.AddSubMenu(OWMenu);
try
{
if (Activator.CreateInstance(null, "Master." + Name) != null)
{
var QData = Player.Spellbook.GetSpell(SpellSlot.Q);
var WData = Player.Spellbook.GetSpell(SpellSlot.W);
var EData = Player.Spellbook.GetSpell(SpellSlot.E);
var RData = Player.Spellbook.GetSpell(SpellSlot.R);
//Game.PrintChat("{0}/{1}/{2}/{3}", QData.SData.CastRange[0], WData.SData.CastRange[0], EData.SData.CastRange[0], RData.SData.CastRange[0]);
FData = Player.SummonerSpellbook.GetSpell(Player.GetSpellSlot("summonerflash"));
SData = Player.SummonerSpellbook.GetSpell(Player.GetSpellSlot("summonersmite"));
IData = Player.SummonerSpellbook.GetSpell(Player.GetSpellSlot("summonerdot"));
Game.OnGameUpdate += OnGameUpdate;
Drawing.OnDraw += OnDraw;
SkinChanger(null, null);
}
}
catch
{
Game.PrintChat("[Master Series] => {0} Not Support !", Name);
}
Config.AddToMainMenu();
}
示例12: Ignite
public Ignite(TargetSelector.DamageType dmgtype, Menu activator)
{
DamageType = dmgtype;
SetSlot();
if (Slot != SpellSlot.Unknown)
{
Range = 550f;
summoners = new Menu("Ignite", "summonerignite");
summoners.AddItem(new MenuItem("IGNITEENEMY", "Use Ignite")).SetValue(true);
summoners.AddItem(new MenuItem("IGNITEKS", "Use Ignite to KS")).SetValue(true)
.ValueChanged += (s, ar) =>
{
bool newVal = ar.GetNewValue<bool>();
((MenuItem)s).Permashow(ar.GetNewValue<bool>(), newVal ? "Ignite Kill Steal" : null);
};
summoners.AddItem(new MenuItem("IGNITEENABLE", "Enabled").SetValue<KeyBind>(new KeyBind(32, KeyBindType.Press)));
summoners.Item("IGNITEKS").Permashow(true, "Ignite Killsteal");
activator.AddSubMenu(summoners);
}
}
示例13: isKillableAndValidTarget
internal static bool isKillableAndValidTarget(this Obj_AI_Minion Target, double CalculatedDamage, TargetSelector.DamageType damageType, float distance = float.MaxValue)
{
if (Target == null || !Target.IsValidTarget(distance) || Target.Health <= 0 || Target.HasBuffOfType(BuffType.SpellImmunity) || Target.HasBuffOfType(BuffType.SpellShield) || Target.CharData.BaseSkinName == "gangplankbarrel")
return false;
if (ObjectManager.Player.HasBuff("summonerexhaust"))
CalculatedDamage *= 0.6;
BuffInstance dragonSlayerBuff = ObjectManager.Player.GetBuff("s5test_dragonslayerbuff");
if (dragonSlayerBuff != null)
{
if (dragonSlayerBuff.Count >= 4)
CalculatedDamage += dragonSlayerBuff.Count == 5 ? CalculatedDamage * 0.30 : CalculatedDamage * 0.15;
if (Target.CharData.BaseSkinName.ToLowerInvariant().Contains("dragon"))
CalculatedDamage *= 1 - (dragonSlayerBuff.Count * 0.07);
}
if (Target.CharData.BaseSkinName.ToLowerInvariant().Contains("baron") && ObjectManager.Player.HasBuff("barontarget"))
CalculatedDamage *= 0.5;
return Target.Health + Target.HPRegenRate + (damageType == TargetSelector.DamageType.Physical ? Target.PhysicalShield : Target.MagicalShield) < CalculatedDamage - 2;
}
示例14: Get
public static Obj_AI_Hero Get(float inRange, bool locked = false, TargetSelector.DamageType dtype = TargetSelector.DamageType.Magical)
{
if (s_Target != null)
{
if (!s_Target.IsValidTarget() || s_Target.IsDead)
s_Target = null;
else if (s_Target.Distance(ObjectManager.Player.ServerPosition) > inRange)
{
if (locked)
return null;
else
s_Target = null;
}
}
if (s_Target == null)
Set(TargetSelector.GetTarget(inRange, dtype));
if (TargetSelector.SelectedTarget != null && TargetSelector.SelectedTarget != s_Target && TargetSelector.SelectedTarget.Distance(ObjectManager.Player.ServerPosition) < 1000)
Set(TargetSelector.SelectedTarget);
return s_Target;
}
示例15: Get
public static Obj_AI_Hero Get(float inRange, bool locked = false, TargetSelector.DamageType dtype = TargetSelector.DamageType.Physical)
{
if (TargetSelector.SelectedTarget != null && TargetSelector.SelectedTarget.IsValidTarget(inRange))
{
Set(TargetSelector.SelectedTarget);
return TargetSelector.SelectedTarget;
}
if (s_Target != null)
{
if (!s_Target.IsValidTarget())
{
s_Target = null;
}
else
{
if (s_Target.IsDead || !s_Target.IsTargetable)
s_Target = null;
else if (s_Target.Distance(ObjectManager.Player.ServerPosition) > inRange)
{
if (locked)
return s_Target;
else
s_Target = null;
}
}
}
if (s_Target == null)
Set(TargetSelector.GetTarget(inRange, dtype));
else
{
if (TargetSelector.SelectedTarget != null && TargetSelector.SelectedTarget != s_Target && TargetSelector.SelectedTarget.IsValidTarget(inRange))
Set(TargetSelector.SelectedTarget);
}
return s_Target;
}