本文整理汇总了C#中Spell.Cast方法的典型用法代码示例。如果您正苦于以下问题:C# Spell.Cast方法的具体用法?C# Spell.Cast怎么用?C# Spell.Cast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spell
的用法示例。
在下文中一共展示了Spell.Cast方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CastE
public static void CastE(Spell.Skillshot E, Obj_AI_Base target)
{
var pred = E.GetPrediction(target);
if (Config.EHitChance == 3)
{
if (pred.HitChance >= HitChance.High)
{
E.Cast(target);
}
return;
}
if (Config.EHitChance == 2)
{
if (pred.HitChance >= HitChance.AveragePoint)
{
E.Cast(target);
}
return;
}
if (Config.EHitChance == 1)
{
if (pred.HitChance >= HitChance.Medium)
{
E.Cast(target);
return;
}
}
if (Config.EHitChance == 0)
{
if (pred.HitChance >= HitChance.Low)
{
E.Cast(target);
}
}
}
示例2: HitChanceCast
public virtual bool HitChanceCast(Spell.Skillshot spell, Obj_AI_Base target, float chance = 85)
{
var pred = spell.GetPrediction(target);
if (pred.HitChancePercent >= chance)
if (spell.Cast(pred.CastPosition))
return true;
return false;
}
示例3: CastSpell
private static void CastSpell(Spell.Skillshot qwer, Obj_AI_Base target)
{
var predInput2 = new PredictionInput
{
Speed = qwer.Speed,
Delay = qwer.CastDelay,
Range = qwer.Range,
From = Player.Instance.ServerPosition,
Radius = qwer.Width,
Unit = target,
Type = SkillshotType.SkillshotLine
};
var poutput2 = P.GetPrediction(predInput2);
var Standard = qwer.GetPrediction(target);
if (poutput2.Hitchance >= HitChance.High)
qwer.Cast(poutput2.CastPosition);
else
if (Standard.HitChance >= EloBuddy.SDK.Enumerations.HitChance.Medium)
qwer.Cast(P.GetPrediction(target, 150).CastPosition);
}
示例4: KS
public static void KS(Spell.SpellBase spell, float damage)
{
foreach (var hero in
HeroManager.Enemies
.Where(x => x.Position.Distance(ObjectManager.Player) < spell.Range))
{
if (!hero.IsDead && !hero.IsZombie && damage > hero.Health)
{
spell.Cast(hero);
}
}
}
示例5: CastSpell
public static void CastSpell(Spell.Skillshot qwer, Obj_AI_Base target)
{
var predInput2 = new PredictionInput
{
Speed = qwer.Speed,
Delay = qwer.CastDelay,
Range = qwer.Range,
From = Player.Instance.ServerPosition,
Radius = qwer.Width,
Unit = target,
Type = SkillshotType.SkillshotLine
};
var poutput2 = P.GetPrediction(predInput2);
if (poutput2.Hitchance >= HitChance.Low)
qwer.Cast(poutput2.CastPosition);
}
示例6: CastSpell
public static void CastSpell(Spell.Skillshot QWER, Obj_AI_Base target)
{
if (QWER.Slot == SpellSlot.W)
{
var pred = W.GetPrediction(target);
if (pred.HitChancePercent >= MenuConfig.Wpred)
{
QWER.Cast(pred.CastPosition);
}
}
if (QWER.Slot == SpellSlot.E)
{
var pred = E.GetPrediction(target);
QWER.Cast(pred.CastPosition);
}
if (QWER.Slot == SpellSlot.R)
{
var pred = R.GetPrediction(target);
if (pred.HitChancePercent >= MenuConfig.Rpred)
{
QWER.Cast(pred.CastPosition);
}
}
}
示例7: CastSpell
private static void CastSpell(Spell.Skillshot QWER, Obj_AI_Base target, HitChance hitchance, int MaxRange)
{
var coreType2 = SkillshotType.SkillshotLine;
var aoe2 = false;
if ((int)QWER.Type == (int)SkillshotType.SkillshotCircle)
{
coreType2 = SkillshotType.SkillshotCircle;
aoe2 = true;
}
if (QWER.Width > 80 && QWER.AllowedCollisionCount < 100)
aoe2 = true;
var predInput2 = new PredictionInput
{
Aoe = aoe2,
Collision = QWER.AllowedCollisionCount < 100,
Speed = QWER.Speed,
Delay = QWER.CastDelay,
Range = MaxRange,
From = Player.ServerPosition,
Radius = QWER.Radius,
Unit = target,
Type = coreType2
};
var poutput2 = Prediction.GetPrediction(predInput2);
Chat.Print(QWER.Slot + " " + predInput2.Collision + poutput2.Hitchance);
if (QWER.Speed < float.MaxValue && Utils.CollisionYasuo(Player.ServerPosition, poutput2.CastPosition))
return;
if (hitchance == HitChance.VeryHigh)
{
if (poutput2.Hitchance >= HitChance.VeryHigh)
QWER.Cast(poutput2.CastPosition);
else if (predInput2.Aoe && poutput2.AoeTargetsHitCount > 1 &&
poutput2.Hitchance >= HitChance.High)
{
QWER.Cast(poutput2.CastPosition);
}
}
else if (hitchance == HitChance.High)
{
if (poutput2.Hitchance >= HitChance.High)
QWER.Cast(poutput2.CastPosition);
}
else if (hitchance == HitChance.Medium)
{
if (poutput2.Hitchance >= HitChance.Medium)
QWER.Cast(poutput2.CastPosition);
}
else if (hitchance == HitChance.Low)
{
if (poutput2.Hitchance >= HitChance.Low)
QWER.Cast(poutput2.CastPosition);
}
}
示例8: SingleTargetHero
internal static void SingleTargetHero(Spell.Skillshot spell, DamageType damageType,
int range = 0, HitChance hitChance = HitChance.Medium, AIHeroClient targetHero = null)
{
if ((spell.Slot != SpellSlot.Q || !TickManager.NoLag(1)) &&
(spell.Slot != SpellSlot.W || !TickManager.NoLag(2)) &&
(spell.Slot != SpellSlot.E || !TickManager.NoLag(3)) &&
(spell.Slot != SpellSlot.R || !TickManager.NoLag(4))) return;
if (!spell.IsReady() || IsAutoAttacking) return;
AIHeroClient target;
if (targetHero == null)
target = range != 0
? TargetManager.Target(range, damageType)
: TargetManager.Target(spell, damageType);
else target = targetHero;
if (target == null) return;
if (!VolatileMenu["vpred"].Cast<CheckBox>().CurrentValue)
{
if (!target.IsValidTarget(spell.Range) || spell.GetPrediction(target).HitChance < hitChance)
return;
spell.Cast(spell.GetPrediction(target).CastPosition);
}
/*else
{
var CoreType2 = SkillshotType.SkillshotLine;
bool aoe2 = false;
if ((int) spell.Type == (int) SkillshotType.SkillshotCircle)
{
CoreType2 = SkillshotType.SkillshotCircle;
aoe2 = true;
}
if (spell.Width > 80 && spell.AllowedCollisionCount < 100)
aoe2 = true;
var predInput2 = new PredictionInput
{
Aoe = aoe2,
Collision = spell.AllowedCollisionCount < 100,
Speed = spell.Speed,
Delay = spell.CastDelay,
Range = spell.Range,
From = Player.ServerPosition,
Radius = spell.Radius,
Unit = target,
Type = CoreType2
};
var poutput2 = Test.TopSecret.Prediction.GetPrediction(predInput2);
//var poutput2 = spell.GetPrediction(target);
Chat.Print(spell.Slot+" "+predInput2.Collision+poutput2.Hitchance);
if (spell.Speed != float.MaxValue && CollisionYasuo(Player.ServerPosition, poutput2.CastPosition))
return;
if (VolatileMenu["vpred2"].Cast<Slider>().CurrentValue == 0)
{
if (poutput2.Hitchance >= Test.TopSecret.HitChance.VeryHigh)
spell.Cast(poutput2.CastPosition);
else if (predInput2.Aoe && poutput2.AoeTargetsHitCount > 1 &&
poutput2.Hitchance >= Test.TopSecret.HitChance.High)
{
spell.Cast(poutput2.CastPosition);
}
}
else if (VolatileMenu["vpred2"].Cast<Slider>().CurrentValue == 1)
{
if (poutput2.Hitchance >= Test.TopSecret.HitChance.High)
spell.Cast(poutput2.CastPosition);
}
else if (VolatileMenu["vpred2"].Cast<Slider>().CurrentValue == 2)
{
if (poutput2.Hitchance >= Test.TopSecret.HitChance.Medium)
spell.Cast(poutput2.CastPosition);
}
}*/
}
示例9: NewPredTest
internal static void NewPredTest(Spell.Skillshot spell, DamageType damageType,
int range = 0, Utils.HitChance hitChance = Utils.HitChance.Medium, AIHeroClient targetHero = null)
{
if ((spell.Slot != SpellSlot.Q || !TickManager.NoLag(1)) &&
(spell.Slot != SpellSlot.W || !TickManager.NoLag(2)) &&
(spell.Slot != SpellSlot.E || !TickManager.NoLag(3)) &&
(spell.Slot != SpellSlot.R || !TickManager.NoLag(4)))
return;
if (!spell.IsReady() || IsAutoAttacking) return;
AIHeroClient target;
if (targetHero == null)
target = range != 0
? TargetManager.Target(range, damageType)
: TargetManager.Target(spell, damageType);
else target = targetHero;
if (target == null) return;
if (!target.IsValidTarget(spell.Range))
return;
var coreType2 = SkillshotType.SkillshotLine;
bool aoe2 = false;
if ((int)spell.Type == (int)SkillshotType.SkillshotCircle)
{
coreType2 = SkillshotType.SkillshotCircle;
aoe2 = true;
}
if (spell.Width > 80 && spell.AllowedCollisionCount < 100)
aoe2 = true;
var predInput2 = new PredictionInput
{
Aoe = aoe2,
Collision = spell.AllowedCollisionCount < 100,
Speed = spell.Speed,
Delay = spell.CastDelay,
Range = spell.Range,
From = Player.ServerPosition,
Radius = spell.Radius,
Unit = target,
Type = coreType2
};
var poutput2 = VPrediction.GetPrediction(predInput2);
//var poutput2 = spell.GetPrediction(target);
Chat.Print(spell.Slot + " " + predInput2.Collision + poutput2.Hitchance);
if (spell.Speed < float.MaxValue && CollisionYasuo(Player.ServerPosition, poutput2.CastPosition))
return;
if (hitChance == Utils.HitChance.VeryHigh)
{
if (poutput2.Hitchance >= Utils.HitChance.VeryHigh)
spell.Cast(poutput2.CastPosition);
else if (predInput2.Aoe && poutput2.AoeTargetsHitCount > 1 &&
poutput2.Hitchance >= Utils.HitChance.High)
{
spell.Cast(poutput2.CastPosition);
}
}
else if (hitChance == Utils.HitChance.High)
{
if (poutput2.Hitchance >= Utils.HitChance.High)
spell.Cast(poutput2.CastPosition);
}
else if (hitChance == Utils.HitChance.Medium)
{
if (poutput2.Hitchance >= Utils.HitChance.Medium)
spell.Cast(poutput2.CastPosition);
}
}
示例10: Farm
internal static void Farm(Spell.Skillshot spell, int minHit = 1)
{
if ((spell.Slot != SpellSlot.Q || !TickManager.NoLag(1)) &&
(spell.Slot != SpellSlot.W || !TickManager.NoLag(2)) &&
(spell.Slot != SpellSlot.E || !TickManager.NoLag(3)) &&
(spell.Slot != SpellSlot.R || !TickManager.NoLag(4))) return;
if (!spell.IsReady() || IsAutoAttacking) return;
var minions =
MinionManager.GetMinions(Player.ServerPosition, spell.Range + spell.Radius)
.Select(
minion =>
Prediction.Position.PredictUnitPosition(minion,
(int) (spell.CastDelay + (Player.Distance(minion)/spell.Speed))))
.ToList();
if (MinionManager.GetBestCircularFarmLocation(minions, spell.Width, spell.Range).MinionsHit <
minHit) return;
spell.Cast(
MinionManager.GetBestCircularFarmLocation(minions, spell.Width, spell.Range).Position.To3D());
}
示例11: CastwithPred
private static void CastwithPred(Spell.Skillshot x, AIHeroClient t)
{
var pred = x.GetPrediction(t);
if (pred.HitChance >= HitChance.High)
x.Cast(pred.CastPosition);
}
示例12: SingleTargetHero
internal static void SingleTargetHero(Spell.Skillshot spell, DamageType damageType,
int range = 0, HitChance hitChance = HitChance.Medium, AIHeroClient targetHero = null)
{
if ((spell.Slot != SpellSlot.Q || !TickManager.NoLag(1)) &&
(spell.Slot != SpellSlot.W || !TickManager.NoLag(2)) &&
(spell.Slot != SpellSlot.E || !TickManager.NoLag(3)) &&
(spell.Slot != SpellSlot.R || !TickManager.NoLag(4))) return;
if (!spell.IsReady() || _isAutoAttacking) return;
AIHeroClient target;
if (targetHero == null)
target = range != 0
? TargetManager.Target(range, damageType)
: TargetManager.Target(spell, damageType);
else target = targetHero;
if (target == null) return;
if (!target.IsValidTarget(spell.Range) || spell.GetPrediction(target).HitChance < hitChance)
return;
spell.Cast(spell.GetPrediction(target).CastPosition);
lock (_lastSpells)
{
_lastSpells.RemoveAll(p => Environment.TickCount - p.tick > 2000);
if (_lastSpells.Exists(p => p.name == spell.Name) || spell.Slot != SpellSlot.Q)
return;
_lastSpells.Add(new LastSpells(spell.Name, Environment.TickCount,
Player.GetSpellDamage(target, spell.Slot), target.Name));
CastCount++;
}
}
示例13: WujuStyle
internal static void WujuStyle(Spell.Skillshot spell, DamageType damageType,
int range = 0, int minHit = 1, HitChance hitChance = HitChance.Medium, AIHeroClient targetHero = null)
{
//Credits to WujuSan for the original algorithm, now optimized by turkey for better hitchance
if ((spell.Slot != SpellSlot.Q || !TickManager.NoLag(1)) &&
(spell.Slot != SpellSlot.W || !TickManager.NoLag(2)) &&
(spell.Slot != SpellSlot.E || !TickManager.NoLag(3)) &&
(spell.Slot != SpellSlot.R || !TickManager.NoLag(4)))
return;
if (!spell.IsReady() || _isAutoAttacking) return;
AIHeroClient target;
if (targetHero == null)
target = range != 0
? TargetManager.Target(range, damageType)
: TargetManager.Target(spell, damageType);
else target = targetHero;
if (target == null) return;
if (!target.IsValidTarget(spell.Range + spell.Radius) ||
spell.GetPrediction(target).HitChance < hitChance)
return;
var posAndHits = CircleSpellPos(spell.GetPrediction(target).CastPosition.To2D(), spell);
if (posAndHits.First().Value >= minHit)
spell.Cast(posAndHits.First().Key.To3D());
}
示例14: Farm
internal static void Farm(Spell.Skillshot spell, int minHit = 1)
{
if ((spell.Slot != SpellSlot.Q || !TickManager.NoLag(1)) &&
(spell.Slot != SpellSlot.W || !TickManager.NoLag(2)) &&
(spell.Slot != SpellSlot.E || !TickManager.NoLag(3)) &&
(spell.Slot != SpellSlot.R || !TickManager.NoLag(4))) return;
if (!spell.IsReady() || _isAutoAttacking) return;
var minionWaves = GetMinionWaves();
foreach (
var wave in
minionWaves.Where(
vector =>
Player.Distance(GetMinionWaveVector(vector)) >
(spell.Range + spell.Radius)).ToList()
)
{
minionWaves.Remove(wave);
}
var biggestWaveInRange = new List<Obj_AI_Minion>();
foreach (var wave in minionWaves)
{
if (wave.Count > biggestWaveInRange.Count)
{
biggestWaveInRange = wave;
}
}
if (biggestWaveInRange.Count>=minHit)
spell.Cast(GetMinionWaveVector(biggestWaveInRange).To3D());
}
示例15: CastSpell
public static void CastSpell(Spell QWER, Obj_AI_Base target)
{
if (Config.Item("PredictionMODE", true).GetValue<StringList>().SelectedIndex == 1)
{
Core.SkillshotType CoreType2 = Core.SkillshotType.SkillshotLine;
bool aoe2 = false;
if (QWER.Type == SkillshotType.SkillshotCircle)
{
CoreType2 = Core.SkillshotType.SkillshotCircle;
aoe2 = true;
}
if (QWER.Width > 80 && !QWER.Collision)
aoe2 = true;
var predInput2 = new Core.PredictionInput
{
Aoe = aoe2,
Collision = QWER.Collision,
Speed = QWER.Speed,
Delay = QWER.Delay,
Range = QWER.Range,
From = Player.ServerPosition,
Radius = QWER.Width,
Unit = target,
Type = CoreType2
};
var poutput2 = Core.Prediction.GetPrediction(predInput2);
//var poutput2 = QWER.GetPrediction(target);
if (QWER.Speed != float.MaxValue && OktwCommon.CollisionYasuo(Player.ServerPosition, poutput2.CastPosition))
return;
if (Config.Item("HitChance", true).GetValue<StringList>().SelectedIndex == 0)
{
if (poutput2.Hitchance >= Core.HitChance.VeryHigh)
QWER.Cast(poutput2.CastPosition);
else if (predInput2.Aoe && poutput2.AoeTargetsHitCount > 1 && poutput2.Hitchance >= Core.HitChance.High)
{
QWER.Cast(poutput2.CastPosition);
}
}
else if (Config.Item("HitChance", true).GetValue<StringList>().SelectedIndex == 1)
{
if (poutput2.Hitchance >= Core.HitChance.High)
QWER.Cast(poutput2.CastPosition);
}
else if (Config.Item("HitChance", true).GetValue<StringList>().SelectedIndex == 2)
{
if (poutput2.Hitchance >= Core.HitChance.Medium)
QWER.Cast(poutput2.CastPosition);
}
if (Game.Time - DrawSpellTime > 0.5)
{
DrawSpell = QWER;
DrawSpellTime = Game.Time;
}
DrawSpellPos = poutput2;
}
else if (Config.Item("PredictionMODE", true).GetValue<StringList>().SelectedIndex == 0)
{
if (Config.Item("HitChance", true).GetValue<StringList>().SelectedIndex == 0)
{
QWER.CastIfHitchanceEquals(target, HitChance.VeryHigh);
return;
}
else if (Config.Item("HitChance", true).GetValue<StringList>().SelectedIndex == 1)
{
QWER.CastIfHitchanceEquals(target, HitChance.High);
return;
}
else if (Config.Item("HitChance ", true).GetValue<StringList>().SelectedIndex == 2)
{
QWER.CastIfHitchanceEquals(target, HitChance.Medium);
return;
}
}
else if (Config.Item("PredictionMODE", true).GetValue<StringList>().SelectedIndex == 2 )
{
if (target is Obj_AI_Hero && target.IsValid)
{
var t = target as Obj_AI_Hero;
if (Config.Item("HitChance", true).GetValue<StringList>().SelectedIndex == 0)
{
QWER.SPredictionCast(t, HitChance.VeryHigh);
return;
}
else if (Config.Item("HitChance", true).GetValue<StringList>().SelectedIndex == 1)
{
QWER.SPredictionCast(t, HitChance.High);
return;
}
else if (Config.Item("HitChance ", true).GetValue<StringList>().SelectedIndex == 2)
{
//.........这里部分代码省略.........