本文整理汇总了C#中Spell.Skillshot.Cast方法的典型用法代码示例。如果您正苦于以下问题:C# Spell.Skillshot.Cast方法的具体用法?C# Spell.Skillshot.Cast怎么用?C# Spell.Skillshot.Cast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spell.Skillshot
的用法示例。
在下文中一共展示了Spell.Skillshot.Cast方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string[] args)
{
Loading.OnLoadingComplete += delegate
{
if (Player.Instance.ChampionName != "Blitzcrank")
{
return;
}
#region Menu Stuff
var menu = MainMenu.AddMenu("Blitzcrank", "blitziii");
menu.AddGroupLabel("Hitchance");
var hitchances = new List<HitChance>();
for (var i = (int) HitChance.Medium; i <= (int) HitChance.Immobile; i++)
{
hitchances.Add((HitChance) i);
}
var slider = new Slider(hitchances[0].ToString(), 0, 0, hitchances.Count - 1);
slider.OnValueChange += delegate(ValueBase<int> sender, ValueBase<int>.ValueChangeArgs changeArgs) { slider.DisplayName = hitchances[changeArgs.NewValue].ToString(); };
menu.Add("hitchance", slider);
if (HeroManager.Enemies.Count > 0)
{
menu.AddSeparator();
menu.AddGroupLabel("Enabled targets");
var addedChamps = new List<string>();
foreach (var enemy in HeroManager.Enemies.Where(enemy => !addedChamps.Contains(enemy.ChampionName)))
{
addedChamps.Add(enemy.ChampionName);
menu.Add(enemy.ChampionName, new CheckBox(string.Format("{0} ({1})", enemy.ChampionName, enemy.Name)));
}
}
menu.AddSeparator();
menu.AddGroupLabel("Drawings");
var qRange = menu.Add("rangeQ", new CheckBox("Q range"));
var predictions = menu.Add("predictions", new CheckBox("Visualize prediction"));
#endregion
var Q = new Spell.Skillshot(SpellSlot.Q, 925, SkillShotType.Linear, 250, 1800, 70);
var predictedPositions = new Dictionary<int, Tuple<int, PredictionResult>>();
Game.OnTick += delegate
{
if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) && Q.IsReady())
{
foreach (var enemy in HeroManager.Enemies.Where(enemy => menu[enemy.ChampionName].Cast<CheckBox>().CurrentValue &&
enemy.IsValidTarget(Q.Range + 150)))
{
var prediction = Q.GetPrediction(enemy);
if (prediction.HitChance >= hitchances[0])
{
predictedPositions[enemy.NetworkId] = new Tuple<int, PredictionResult>(Environment.TickCount, prediction);
// Cast if hitchance is high enough
if (prediction.HitChance >= hitchances[slider.CurrentValue])
{
Q.Cast(prediction.CastPosition);
}
}
}
}
};
Drawing.OnDraw += delegate
{
if (qRange.CurrentValue && Q.IsLearned)
{
Circle.Draw(Q.IsReady() ? Color.Blue : Color.Red, Q.Range, Player.Instance.Position);
}
if (!predictions.CurrentValue)
{
return;
}
foreach (var prediction in predictedPositions.ToArray())
{
if (Environment.TickCount - prediction.Value.Item1 > 1500)
{
predictedPositions.Remove(prediction.Key);
continue;
}
Circle.Draw(Color.Red, 75, prediction.Value.Item2.CastPosition);
Line.DrawLine(System.Drawing.Color.GreenYellow, Player.Instance.Position, prediction.Value.Item2.CastPosition);
Line.DrawLine(System.Drawing.Color.CornflowerBlue, HeroManager.Enemies.Find(o => o.NetworkId == prediction.Key).Position, prediction.Value.Item2.CastPosition);
Drawing.DrawText(prediction.Value.Item2.CastPosition.WorldToScreen() + new Vector2(0, -20), System.Drawing.Color.LimeGreen,
string.Format("Hitchance: {0}%", Math.Ceiling(prediction.Value.Item2.HitChancePercent)), 10);
}
};
};
}
示例2: Game_OnUpdate
private static void Game_OnUpdate(EventArgs args)
{
if (MobsToSmite["killsmite"].Cast<CheckBox>().CurrentValue)
{
var KillEnemy =
EntityManager.Heroes.Enemies.FirstOrDefault(hero => hero.IsValidTarget(500f)
&& SmiteChampDamage() >= hero.Health);
if (KillEnemy != null)
Player.CastSpell(Smite.Slot, KillEnemy);
}
if (SmiteGHMenu["active"].Cast<CheckBox>().CurrentValue || SmiteGHMenu["activekey"].Cast<KeyBind>().CurrentValue)
{
double SpellDamage = 0;
Monster = GetNearest(ObjectManager.Player.ServerPosition);
if (Monster != null && MobsToSmite[Monster.BaseSkinName].Cast<CheckBox>().CurrentValue)
{
if (SupportedChampions.Contains(ObjectManager.Player.ChampionName))
{
if (SmiteGHMenu["disable"].Cast<CheckBox>().CurrentValue)
{
switch (ObjectManager.Player.ChampionName)
{
#region Diana
case "Diana":
{
Spell.Skillshot Q = new Spell.Skillshot(SpellSlot.Q, (uint)895, SkillShotType.Circular);
Spell.Targeted R = new Spell.Targeted(SpellSlot.R, (uint)825);
//Smite and Spell ==> OKAY
if (Smite.IsReady() && Q.IsReady() && Vector3.Distance(ObjectManager.Player.ServerPosition, Monster.ServerPosition) < Q.Range
&& Vector3.Distance(ObjectManager.Player.ServerPosition, Monster.ServerPosition) < Smite.Range)
{
SpellDamage = GetDamages.DianaQ(Q.Level) + GetDamages.DianaR(R.Level);
TotalDamage = SpellDamage + GetSmiteDamage();
if (Monster.Health <= TotalDamage)
{
Q.Cast(Monster.ServerPosition);
//Smite.Cast(Monster);
}
}
else if (Smite.IsReady() && R.IsReady() && Vector3.Distance(ObjectManager.Player.ServerPosition, Monster.ServerPosition) < R.Range
&& Vector3.Distance(ObjectManager.Player.ServerPosition, Monster.ServerPosition) < Smite.Range && GetDamages.HasBuffs(Monster, "dianamoonlight"))
{
SpellDamage = GetDamages.DianaR(R.Level);
TotalDamage = SpellDamage + GetSmiteDamage();
if (Monster.Health <= TotalDamage)
{
R.Cast(Monster);
//Smite.Cast(Monster);
}
}
//If Spell is busy, Go Smite only! ^_^
else if (Smite.IsReady() && Vector3.Distance(ObjectManager.Player.ServerPosition, Monster.ServerPosition) < Smite.Range)
{
if (Monster.Health <= GetSmiteDamage())
{
Smite.Cast(Monster);
}
TotalDamage = 0;
}
break;
}
#endregion
#region Evelynn
case "Evelynn":
{
Spell.Targeted E = new Spell.Targeted(SpellSlot.E, (uint)(225f + 2 * 65f));
//Smite and Spell ==> OKAY
if (Smite.IsReady() && E.IsReady() && Vector3.Distance(ObjectManager.Player.ServerPosition, Monster.ServerPosition) < E.Range
&& Vector3.Distance(ObjectManager.Player.ServerPosition, Monster.ServerPosition) < Smite.Range)
{
SpellDamage = GetDamages.Evelynn(E.Level);
TotalDamage = SpellDamage + GetSmiteDamage();
if (Monster.Health <= TotalDamage)
{
E.Cast(Monster);
//Smite.Cast(Monster);
}
}
//If Spell is busy, Go Smite only! ^_^
else if (Smite.IsReady() && Vector3.Distance(ObjectManager.Player.ServerPosition, Monster.ServerPosition) < Smite.Range)
{
if (Monster.Health <= GetSmiteDamage())
{
Smite.Cast(Monster);
}
TotalDamage = 0;
}
break;
}
#endregion
#region Irelia
case "Irelia":
{
Spell.Targeted Q = new Spell.Targeted(SpellSlot.Q, (uint)650f + 20);
//Smite and Spell ==> OKAY
if (Smite.IsReady() && Q.IsReady() && Vector3.Distance(ObjectManager.Player.ServerPosition, Monster.ServerPosition) < Q.Range
&& Vector3.Distance(ObjectManager.Player.ServerPosition, Monster.ServerPosition) < Smite.Range)
{
SpellDamage = GetDamages.Irelia(Q.Level);
//.........这里部分代码省略.........
示例3: Execute
public override void Execute()
{
flashSpell = new Spell.Skillshot(Player.Instance.GetSpellSlotFromName("summonerflash"), 425,
SkillShotType.Linear);
var target = GetTarget(Q, DamageType.Magical);
PredictionResult pred;
if (target != null && target.IsTargetable && !target.HasBuffOfType(BuffType.SpellImmunity) && Settings.UseQ &&
!target.IsDead)
{
pred = Q.GetPrediction(target);
if (Humanizer.QCastDelayEnabled)
{
if (pred.HitChancePercent >= Settings.QMinHitChance)
Core.DelayAction(() => { Q.Cast(pred.CastPosition); },
Humanizer.QRndmDelay
? new Random().Next(250, Humanizer.QCastDelay)
: Humanizer.QCastDelay);
}
else
{
if (pred.HitChancePercent >= Settings.QMinHitChance)
Q.Cast(pred.CastPosition);
}
}
if (Settings.WImmobileOnly)
{
if (target != null && target.IsTargetable && !target.HasBuffOfType(BuffType.SpellImmunity) &&
Settings.UseW && !target.IsDead && Player.Instance.IsInRange(target, W.Range) && IsImmobile(target))
{
pred = W.GetPrediction(target);
W.Cast(pred.CastPosition);
}
}
else
{
if (target != null && target.IsTargetable && !target.HasBuffOfType(BuffType.SpellImmunity) &&
Settings.UseW && !target.IsDead && Player.Instance.IsInRange(target, W.Range))
{
pred = W.GetPrediction(target);
if (Settings.UseQBeforeW)
{
if (Q.IsOnCooldown)
{
W.Cast(pred.CastPosition);
}
}
else
{
W.Cast(pred.CastPosition);
}
}
}
target = GetTarget(R, DamageType.Magical);
if (!R.IsReady() || !Settings.UseR || target == null || !target.IsTargetable ||
target.HasBuffOfType(BuffType.SpellImmunity) || target.IsDead) return;
if (Player.Instance.CountEnemiesInRange(Settings.UltMinRange) == 0 && Settings.FlashUlt)
{
var enemiesFaced = 0;
foreach (var enemy in EntityManager.Heroes.Enemies)
{
if (Player.Instance.IsFacing(enemy))
enemiesFaced++;
if (enemiesFaced < Settings.RMinEnemies ||
Player.Instance.CountEnemiesInRange(Settings.UltMinRange + flashSpell.Range) <
Settings.RMinEnemies) continue;
flashSpell.Cast(Player.Instance.Position.Extend(enemy.Position, flashSpell.Range).To3D());
R.Cast();
if (Settings.UltZhonya)
zhonyasHourglass.Cast();
enemiesFaced = 0;
}
}
else
{
if (!target.IsTargetable || target.HasBuffOfType(BuffType.SpellImmunity) || !Settings.UseR ||
Player.Instance.CountEnemiesInRange(Settings.UltMinRange) < Settings.RMinEnemies || target.IsDead)
return;
if (Humanizer.RCastDelayEnabled)
{
if (Humanizer.RRndmDelay)
{
Core.DelayAction(() => { R.Cast(); }, new Random().Next(250, Humanizer.RCastDelay));
if (Settings.UltZhonya)
//.........这里部分代码省略.........
示例4: OnTick
private static void OnTick(EventArgs args)
{
if (myHero.IsDead) return;
W = new Spell.Active(SpellSlot.W, (uint)(565 + 60 + W.Level * 30 + 65));
R = new Spell.Skillshot(SpellSlot.R, (uint)(900 + R.Level * 300), SkillShotType.Circular, 1500, int.MaxValue,
225);
if (human && wActive)
{
if (1 / myHero.AttackDelay > Convert.ToSingle(esw) / 100)
{
if (EntityManager.Heroes.Enemies.Any(x => x.IsValidTarget(130 + swez)) ||
!EntityManager.Heroes.Enemies.Any(x => x.IsValidTarget(130 + swchz)))
{
Orbwalker.DisableMovement = false;
Orbwalker.DisableAttacking = !(Environment.TickCount + Game.Ping / 2 + 25 >= LastAATick + 1.0 / Convert.ToSingle(swatk) * 1000 * 100);
}
else
{
Orbwalker.DisableAttacking = false;
Orbwalker.DisableMovement = true;
}
}
else
{
Orbwalker.DisableAttacking = false;
Orbwalker.DisableMovement = false;
}
}
if (CanMove(100))
{
if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
{
if (useQ)
{
if (QIsReadyPerfectly())
{
if (!manaW || W.Level <= 0 || myHero.Mana - getSpellMana(SpellSlot.Q) >= getSpellMana(SpellSlot.W))
{
var target = TargetSelector.GetTarget(Q.Range, DamageType.Magical);
if (target != null)
{
Q.Cast(target);
}
}
}
}
if (useW)
{
if (WIsReadyPerfectly())
{
if (EntityManager.Heroes.Enemies.Any(x => x.IsValidTarget(W.Range)))
{
W.Cast();
}
}
}
if (useE)
{
if (EIsReadyPerfectly())
{
if (!manaW || W.Level <= 0 || myHero.Mana - getSpellMana(SpellSlot.E) >= getSpellMana(SpellSlot.W))
{
var target = TargetSelector.GetTarget(E.Range, DamageType.Magical);
if (target != null)
{
E.Cast(target);
}
}
}
}
if (useR)
{
if (RIsReadyPerfectly())
{
if (!manaW || W.Level <= 0 || myHero.Mana - getSpellMana(SpellSlot.R) >= getSpellMana(SpellSlot.W))
{
if (myHero.GetBuffCount("kogmawlivingartillerycost") < rLimit)
{
var target = TargetSelector.GetTarget(R.Range, DamageType.Magical);
if (target != null)
{
if (onlyRHP)
{
if (target.HealthPercent < hpOfTarget)
{
R.Cast(target);
}
}
else
{
R.Cast(target);
}
}
}
//.........这里部分代码省略.........
示例5: FlashQCombo
internal static void FlashQCombo()
{
Player.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos);
var target = TargetSelector2.GetTarget(Program.Q.Range + 425, DamageType.Magical);
var qPred = Program.Q.GetPrediction(target);
var closestMinion = qPred.CollisionObjects.Count(h => h.IsEnemy && !h.IsDead && h is Obj_AI_Minion) < 1;
var FlashSlot = Player.Spells.FirstOrDefault(o => o.SData.Name == "summonerflash"); // Thanks finn
SpellSlot flSlot = extent.GetSpellSlotFromName(_Player, "summonerflash");
flash = new Spell.Skillshot(flSlot, 32767, SkillShotType.Linear);
if (target == null) return;
var x = target.Position.Extend(target, 425f);
if (qPred.HitChance != HitChance.Collision)
{
if (qPred.HitChance >= HitChance.High && closestMinion && flash.IsReady())
{
flash.Cast((Vector3)x);
Program.Q.Cast((Vector3)x);
}
}
}
示例6: LaneClear
/// <summary>
/// Does LaneClear
/// </summary>
private static void LaneClear()
{
Q = new Spell.Skillshot(SpellSlot.Q, 1175, SkillShotType.Linear, 250, 70, 1300)
{
AllowedCollisionCount = 1
};
//E = new Spell.Skillshot(SpellSlot.E, 1200, SkillShotType.Circular, 250, 280, 950);
//R = new Spell.Skillshot(SpellSlot.R, 3300, SkillShotType.Circular, 1000, 190, int.MaxValue);
var useQ = LaneClearMenu["useQ"].Cast<CheckBox>().CurrentValue;
var useE = LaneClearMenu["useE"].Cast<CheckBox>().CurrentValue;
var useR = LaneClearMenu["useR"].Cast<CheckBox>().CurrentValue;
var useQs = LaneClearMenu["useQs"].Cast<Slider>().CurrentValue;
var useEs = LaneClearMenu["useEs"].Cast<Slider>().CurrentValue;
var useRs = LaneClearMenu["useRs"].Cast<Slider>().CurrentValue;
if (useQ && Q.IsReady() && ManaManager(SpellSlot.Q))
{
var target = EntityManager.MinionsAndMonsters.EnemyMinions.Where(t => t.IsValidTarget() && Q.IsInRange(t));
var pred = EntityManager.MinionsAndMonsters.GetLineFarmLocation(target, Q.Width, (int)Q.Range);
if (pred.HitNumber >= useQs)
{
Q.Cast(pred.CastPosition);
}
}
if (useE && E.IsReady() && ManaManager(SpellSlot.E) && LuxEObject == null)
{
var target = EntityManager.MinionsAndMonsters.GetLaneMinions(
EntityManager.UnitTeam.Enemy,
Player.Instance.ServerPosition,
E.Radius);
var pred = EntityManager.MinionsAndMonsters.GetCircularFarmLocation(target, E.Width, (int)E.Range);
if (pred.HitNumber >= useEs)
{
E.Cast(pred.CastPosition);
}
}
if (useE && E.IsReady() && LuxEObject != null)
{
var target =
EntityManager.MinionsAndMonsters.EnemyMinions.Where(
t => t.IsValidTarget() && t.Distance(LuxEObject.Position) <= LuxEObject.BoundingRadius);
if (target.Any() && LuxEObject != null)
{
E2.Cast();
}
}
if (!useR || !R.IsReady() || !ManaManager(SpellSlot.R))
{
return;
}
var rTarget = EntityManager.MinionsAndMonsters.GetLaneMinions(
EntityManager.UnitTeam.Enemy,
Player.Instance.ServerPosition,
R.Radius);
if (rTarget == null)
{
return;
}
var rPrediction = EntityManager.MinionsAndMonsters.GetLineFarmLocation(rTarget, R.Width, (int)R.Range);
if (rPrediction.HitNumber >= useRs)
{
R.Cast(rPrediction.CastPosition);
}
}