本文整理汇总了C#中Obj_AI_Hero.GetSpell方法的典型用法代码示例。如果您正苦于以下问题:C# Obj_AI_Hero.GetSpell方法的具体用法?C# Obj_AI_Hero.GetSpell怎么用?C# Obj_AI_Hero.GetSpell使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj_AI_Hero
的用法示例。
在下文中一共展示了Obj_AI_Hero.GetSpell方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetHeroAvgDamage
/// <summary>
/// Gets the hero average damage to the opposing team.
/// </summary>
/// <param name="player">The player.</param>
/// <param name="Enemies">The enemies.</param>
/// <returns></returns>
public static float GetHeroAvgDamage(Obj_AI_Hero player, List<Obj_AI_Hero> Enemies)
{
var totalEnemies = Enemies.Count();
if (totalEnemies == 0)
{
return -1;
}
var AADamage = Enemies.Aggregate(0, (current, s) => (int) (current + player.GetAutoAttackDamage(s) * 2));
var QDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.Q).IsReady() ? player.GetSpellDamage(s, SpellSlot.Q) : 0f)));
var WDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.W).IsReady() ? player.GetSpellDamage(s, SpellSlot.W) : 0f)));
var EDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.E).IsReady() ? player.GetSpellDamage(s, SpellSlot.E) : 0f)));
var RDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.R).IsReady() ? player.GetSpellDamage(s, SpellSlot.R) : 0f)));
var itemsDamage = 0f;
foreach (var item in player.InventoryItems)
{
foreach (var hero in Enemies)
{
var itemID = item.Id;
switch (itemID)
{
case ItemId.Bilgewater_Cutlass:
itemsDamage +=
(float) player.GetItemDamage(hero, Damage.DamageItems.Bilgewater);
break;
case ItemId.Blade_of_the_Ruined_King:
itemsDamage += (float) player.GetItemDamage(hero, Damage.DamageItems.Botrk);
break;
case ItemId.Hextech_Gunblade:
itemsDamage += (float) player.GetItemDamage(hero, Damage.DamageItems.Hexgun);
break;
case ItemId.Frost_Queens_Claim:
itemsDamage +=
(float) player.GetItemDamage(hero, Damage.DamageItems.FrostQueenClaim);
break;
case ItemId.Tiamat_Melee_Only:
itemsDamage += player.IsMelee
? (float) player.GetItemDamage(hero, Damage.DamageItems.Tiamat)
: 0f;
break;
case ItemId.Ravenous_Hydra_Melee_Only:
itemsDamage += player.IsMelee
? (float) player.GetItemDamage(hero, Damage.DamageItems.Hydra)
: 0f;
break;
case ItemId.Liandrys_Torment:
itemsDamage +=
(float) player.GetItemDamage(hero, Damage.DamageItems.LiandrysTorment);
break;
}
}
}
var totalDamage = AADamage + QDamage + WDamage + EDamage + RDamage + itemsDamage;
return (float) totalDamage / totalEnemies;
}
示例2: DrawDamage
private void DrawDamage(Obj_AI_Hero sender, Obj_AI_Hero target)
{
if (!target.IsVisible || target.IsDead)
return;
var screenPos = Drawing.WorldToScreen(target.Position);
if (_slots.Sum(slot => sender.GetSpell(slot).Cooldown <= 0 ? sender.GetSpellDamage(target, slot) : 0) > target.Health)
Drawing.DrawText(screenPos.X, screenPos.Y, Color.Red, "Combo");
else
{
var dps = _slots.Sum(slot => sender.GetSpellDamage(target, slot) / sender.GetSpell(slot).Cooldown) + sender.TotalAttackDamage * (1 / sender.AttackDelay) * ((sender.Crit + 100) / 100f) * (100 / (100f + target.Armor));
// Console.WriteLine(dps + " / "+ sender.TotalAttackDamage * (1 / sender.AttackDelay) * ((sender.Crit + 100) / 100f) * (100 / (100f + target.Armor)));
Drawing.DrawText(screenPos.X, screenPos.Y, Color.Red, "> " + string.Format("{0:0.0} s", target.Health / dps));
}
}
示例3: GetHeroAvgDamage
/// <summary>
/// Gets the hero average damage to the opposing team.
/// </summary>
/// <param name="player">The player.</param>
/// <param name="Enemies">The enemies.</param>
/// <returns></returns>
public static float GetHeroAvgDamage(Obj_AI_Hero player, List<Obj_AI_Hero> Enemies)
{
var totalEnemies = Enemies.Count();
if (totalEnemies == 0)
{
return -1;
}
var AADamage = Enemies.Aggregate(0, (current, s) => (int) (current + player.GetAutoAttackDamage(s)));
var QDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.Q).IsReady() ? player.GetSpellDamage(s, SpellSlot.Q) : 0)));
var WDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.W).IsReady() ? player.GetSpellDamage(s, SpellSlot.W) : 0)));
var EDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.E).IsReady() ? player.GetSpellDamage(s, SpellSlot.E) : 0)));
var RDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.R).IsReady() ? player.GetSpellDamage(s, SpellSlot.R) : 0)));
var totalDamage = AADamage + QDamage + WDamage + EDamage + RDamage;
return (float) totalDamage / totalEnemies;
}
示例4: Game_OnGameLoad
private static void Game_OnGameLoad(EventArgs args)
{
_player = ObjectManager.Player;
if (_player.ChampionName != "Rengar") return;
_q = new Spell(SpellSlot.Q, 250f);
_w = new Spell(SpellSlot.W, 400);
_e = new Spell(SpellSlot.E, 980f);
_r = new Spell(SpellSlot.R, 2000f);
_e.SetSkillshot(0.125f, 70f, 1500f, true, SkillshotType.SkillshotLine);
_bilge = new Items.Item(3144, 450f);
_blade = new Items.Item(3153, 450f);
_hydra = new Items.Item(3074, 250f);
_tiamat = new Items.Item(3077, 250f);
_rand = new Items.Item(3143, 490f);
_lotis = new Items.Item(3190, 590f);
_youmuu = new Items.Item(3142, 10);
_igniteSlot = _player.GetSpellSlot("SummonerDot");
if (_player.GetSpell(SpellSlot.Summoner1).Name.ToLower().Contains("smite"))
{
_smite = new Spell(SpellSlot.Summoner1, 570f);
_smiteSlot = SpellSlot.Summoner1;
}
else if (_player.GetSpell(SpellSlot.Summoner2).Name.ToLower().Contains("smite"))
{
_smite = new Spell(SpellSlot.Summoner2, 570f);
_smiteSlot = SpellSlot.Summoner2;
}
//D rengar
_config = new Menu("D-Rengar", "D-Rengar", true);
//TargetSelector
var targetSelectorMenu = new Menu("Target Selector", "Target Selector");
TargetSelector.AddToMenu(targetSelectorMenu);
_config.AddSubMenu(targetSelectorMenu);
//Orbwalker
_config.AddSubMenu(new Menu("Orbwalking", "Orbwalking"));
Orbwalker = new Orbwalking.Orbwalker(_config.SubMenu("Orbwalking"));
//Combo
_config.AddSubMenu(new Menu("Combo", "Combo"));
_config.SubMenu("Combo")
.AddItem(
new MenuItem("Switch", "Switch Empowered Priority").SetValue(
new KeyBind("M".ToCharArray()[0], KeyBindType.Press)));
_config.SubMenu("Combo")
.AddItem(
new MenuItem("ComboPrio", "Empowered Priority").SetValue(new StringList(new[] { "Q", "W", "E" }, 2)));
_config.SubMenu("Combo").AddItem(new MenuItem("UseIgnite", "Use Ignite")).SetValue(true);
_config.SubMenu("Combo").AddItem(new MenuItem("smitecombo", "Use Smite in target")).SetValue(true);
_config.SubMenu("Combo").AddItem(new MenuItem("UseQC", "Use Q")).SetValue(true);
_config.SubMenu("Combo").AddItem(new MenuItem("UseWC", "Use W")).SetValue(true);
_config.SubMenu("Combo").AddItem(new MenuItem("UseEC", "Use E")).SetValue(true);
_config.SubMenu("Combo")
.AddItem(new MenuItem("UseEEC", "Use Empower E when Q(range) < target(range)"))
.SetValue(true);
_config.SubMenu("Combo")
.AddItem(new MenuItem("ActiveCombo", "Combo!").SetValue(new KeyBind(32, KeyBindType.Press)));
_config.AddSubMenu(new Menu("items", "items"));
_config.SubMenu("items").AddSubMenu(new Menu("Offensive", "Offensive"));
_config.SubMenu("items").SubMenu("Offensive").AddItem(new MenuItem("Youmuu", "Use Youmuu's")).SetValue(true);
_config.SubMenu("items").SubMenu("Offensive").AddItem(new MenuItem("Tiamat", "Use Tiamat")).SetValue(true);
_config.SubMenu("items").SubMenu("Offensive").AddItem(new MenuItem("Hydra", "Use Hydra")).SetValue(true);
_config.SubMenu("items").SubMenu("Offensive").AddItem(new MenuItem("Bilge", "Use Bilge")).SetValue(true);
_config.SubMenu("items")
.SubMenu("Offensive")
.AddItem(new MenuItem("BilgeEnemyhp", "If Enemy Hp <").SetValue(new Slider(85, 1, 100)));
_config.SubMenu("items")
.SubMenu("Offensive")
.AddItem(new MenuItem("Bilgemyhp", "Or your Hp < ").SetValue(new Slider(85, 1, 100)));
_config.SubMenu("items").SubMenu("Offensive").AddItem(new MenuItem("Blade", "Use Blade")).SetValue(true);
_config.SubMenu("items")
.SubMenu("Offensive")
.AddItem(new MenuItem("BladeEnemyhp", "If Enemy Hp <").SetValue(new Slider(85, 1, 100)));
_config.SubMenu("items")
.SubMenu("Offensive")
.AddItem(new MenuItem("Blademyhp", "Or Your Hp <").SetValue(new Slider(85, 1, 100)));
_config.SubMenu("items").AddSubMenu(new Menu("Deffensive", "Deffensive"));
_config.SubMenu("items")
.SubMenu("Deffensive")
.AddItem(new MenuItem("Omen", "Use Randuin Omen"))
.SetValue(true);
_config.SubMenu("items")
.SubMenu("Deffensive")
.AddItem(new MenuItem("Omenenemys", "Randuin if enemys>").SetValue(new Slider(2, 1, 5)));
_config.SubMenu("items")
.SubMenu("Deffensive")
.AddItem(new MenuItem("lotis", "Use Iron Solari"))
.SetValue(true);
_config.SubMenu("items")
.SubMenu("Deffensive")
.AddItem(new MenuItem("lotisminhp", "Solari if Ally Hp<").SetValue(new Slider(35, 1, 100)));
_config.SubMenu("items")
.SubMenu("Deffensive")
.AddItem(new MenuItem("Righteous", "Use Righteous Glory"))
//.........这里部分代码省略.........
示例5: Game_OnGameLoad
//.........这里部分代码省略.........
Config.SubMenu("R").AddItem(new MenuItem("EnableRUsage", "Auto use charges").SetValue(true));
Config.SubMenu("R").AddItem(new MenuItem("rMode", "Mode").SetValue(new StringList(new[] { "Normal", "Custom delays", "OnTap"})));
Config.SubMenu("R").AddItem(new MenuItem("rModeKey", "OnTap key").SetValue(new KeyBind('T', KeyBindType.Press)));
Config.SubMenu("R").AddSubMenu(new Menu("Custom delays", "Custom delays"));
for (int i = 1; i <= 5; i++)
Config.SubMenu("R").SubMenu("Custom delays").AddItem(new MenuItem("Delay"+i, "Delay"+i).SetValue(new Slider(0, 1500, 0)));
Config.SubMenu("R").AddItem(new MenuItem("PingRKillable", "Ping on killable targets (only local)").SetValue(true));
Config.SubMenu("R").AddItem(new MenuItem("BlockMovement", "Block right click while casting R").SetValue(false));
Config.SubMenu("R").AddItem(new MenuItem("OnlyNearMouse", "Focus only targets near mouse").SetValue(false));
Config.SubMenu("R").AddItem(new MenuItem("MRadius", "Radius").SetValue(new Slider(700, 1500, 300)));
//Harass menu:
Config.AddSubMenu(new Menu("Harass", "Harass"));
Config.SubMenu("Harass").AddItem(new MenuItem("UseQHarass", "Use Q").SetValue(true));
Config.SubMenu("Harass").AddItem(new MenuItem("UseWHarass", "Use W").SetValue(false));
Config.SubMenu("Harass")
.AddItem(
new MenuItem("HarassActive", "Harass!").SetValue(
new KeyBind(Config.Item("Farm").GetValue<KeyBind>().Key, KeyBindType.Press)));
Config.SubMenu("Harass")
.AddItem(
new MenuItem("HarassActiveT", "Harass (toggle)!").SetValue(new KeyBind('Y',
KeyBindType.Toggle)));
//Farming menu:
Config.AddSubMenu(new Menu("Farm", "Farm"));
Config.SubMenu("Farm")
.AddItem(
new MenuItem("UseQFarm", "Use Q").SetValue(
new StringList(new[] { "Freeze", "LaneClear", "Both", "No" }, 2)));
Config.SubMenu("Farm")
.AddItem(
new MenuItem("UseWFarm", "Use W").SetValue(
new StringList(new[] { "Freeze", "LaneClear", "Both", "No" }, 1)));
Config.SubMenu("Farm")
.AddItem(
new MenuItem("FreezeActive", "Freeze!").SetValue(
new KeyBind(Config.Item("Farm").GetValue<KeyBind>().Key, KeyBindType.Press)));
Config.SubMenu("Farm")
.AddItem(
new MenuItem("LaneClearActive", "LaneClear!").SetValue(
new KeyBind(Config.Item("LaneClear").GetValue<KeyBind>().Key, KeyBindType.Press)));
//JungleFarm menu:
Config.AddSubMenu(new Menu("JungleFarm", "JungleFarm"));
Config.SubMenu("JungleFarm").AddItem(new MenuItem("UseQJFarm", "Use Q").SetValue(true));
Config.SubMenu("JungleFarm").AddItem(new MenuItem("UseWJFarm", "Use W").SetValue(true));
Config.SubMenu("JungleFarm")
.AddItem(
new MenuItem("JungleFarmActive", "JungleFarm!").SetValue(
new KeyBind(Config.Item("LaneClear").GetValue<KeyBind>().Key, KeyBindType.Press)));
//Misc
Config.AddSubMenu(new Menu("Misc", "Misc"));
Config.SubMenu("Misc").AddItem(new MenuItem("InterruptSpells", "Interrupt spells").SetValue(true));
Config.SubMenu("Misc").AddItem(new MenuItem("AutoEGC", "AutoE gapclosers").SetValue(true));
Config.SubMenu("Misc").AddItem(new MenuItem("UseVHHC", "Use very high hit chance").SetValue(true));
//Damage after combo:
var dmgAfterComboItem = new MenuItem("DamageAfterR", "Draw damage after (3 - 5)xR").SetValue(true);
Utility.HpBarDamageIndicator.DamageToUnit += hero => (float)Player.GetSpellDamage(hero, SpellSlot.R) * new int[] {0, 3, 4, 5 }[Player.GetSpell(SpellSlot.R).Level];
Utility.HpBarDamageIndicator.Enabled = dmgAfterComboItem.GetValue<bool>();
dmgAfterComboItem.ValueChanged += delegate(object sender, OnValueChangeEventArgs eventArgs)
{
Utility.HpBarDamageIndicator.Enabled = eventArgs.GetNewValue<bool>();
};
//Drawings menu:
Config.AddSubMenu(new Menu("Drawings", "Drawings"));
Config.SubMenu("Drawings")
.AddItem(
new MenuItem("QRange", "Q range").SetValue(new Circle(true, Color.FromArgb(150, Color.DodgerBlue))));
Config.SubMenu("Drawings")
.AddItem(
new MenuItem("WRange", "W range").SetValue(new Circle(true, Color.FromArgb(150, Color.DodgerBlue))));
Config.SubMenu("Drawings")
.AddItem(
new MenuItem("ERange", "E range").SetValue(new Circle(false, Color.FromArgb(150, Color.DodgerBlue))));
Config.SubMenu("Drawings")
.AddItem(
new MenuItem("RRange", "R range").SetValue(new Circle(false, Color.FromArgb(150, Color.DodgerBlue))));
Config.SubMenu("Drawings")
.AddItem(
new MenuItem("RRangeM", "R range (minimap)").SetValue(new Circle(false,
Color.FromArgb(150, Color.DodgerBlue))));
Config.SubMenu("Drawings")
.AddItem(dmgAfterComboItem);
Config.AddToMainMenu();
//Add the events we are going to use:
Game.OnUpdate += Game_OnGameUpdate;
Drawing.OnDraw += Drawing_OnDraw;
Drawing.OnEndScene += Drawing_OnEndScene;
Interrupter2.OnInterruptableTarget += Interrupter2_OnInterruptableTarget;
AntiGapcloser.OnEnemyGapcloser += AntiGapcloser_OnEnemyGapcloser;
Obj_AI_Hero.OnProcessSpellCast += Obj_AI_Hero_OnProcessSpellCast;
Game.OnWndProc += Game_OnWndProc;
Orbwalking.BeforeAttack += OrbwalkingOnBeforeAttack;
Obj_AI_Hero.OnIssueOrder += Obj_AI_Hero_OnIssueOrder;
}
示例6: GetChampionRangeCircle
/// <summary>
/// Returns a circle with center at hero position and radius of the highest impact range a hero has.
/// </summary>
/// <param name="hero">The target hero.</param>
internal static Geometry.Circle GetChampionRangeCircle(Obj_AI_Hero hero)
{
var heroSpells = new List<SpellData>
{
SpellData.GetSpellData(hero.GetSpell(SpellSlot.Q).Name),
SpellData.GetSpellData(hero.GetSpell(SpellSlot.W).Name),
SpellData.GetSpellData(hero.GetSpell(SpellSlot.E).Name),
};
var spellsOrderedByRange = heroSpells.OrderBy(s => s.CastRange);
if (spellsOrderedByRange.FirstOrDefault() != null)
{
var highestSpellRange = spellsOrderedByRange.FirstOrDefault().CastRange;
return new Geometry.Circle(hero.ServerPosition.To2D(), highestSpellRange > hero.AttackRange ? highestSpellRange : hero.AttackRange);
}
return new Geometry.Circle(hero.ServerPosition.To2D(), hero.AttackRange);
}
示例7: IsDangerous
private static bool IsDangerous(Obj_AI_Hero sender, Vector3 startPosition, Vector3 endPosition, bool targeted)
{
try
{
var endDistance = endPosition.Distance(ObjectManager.Player.Position);
var startDistance = startPosition.Distance(ObjectManager.Player.Position);
if (targeted)
{
return true;
}
if (endDistance <= 150f)
{
return true;
}
if (startDistance - 100f > endDistance)
{
var spell = sender.GetSpell(SpellSlot.R);
if (spell != null && endDistance <= 600)
{
return spell.Cooldown >= 20 && spell.IsReady(2500);
}
if (endDistance <= 500 && ObjectManager.Player.HealthPercent < 50)
{
return true;
}
}
if (endDistance > startDistance)
{
return false;
}
if (endDistance >= 450)
{
return false;
}
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
return true;
}