本文整理汇总了C#中LeagueSharp.Common.Spell.IsReady方法的典型用法代码示例。如果您正苦于以下问题:C# Spell.IsReady方法的具体用法?C# Spell.IsReady怎么用?C# Spell.IsReady使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LeagueSharp.Common.Spell
的用法示例。
在下文中一共展示了Spell.IsReady方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CastSkillshot
public void CastSkillshot(Obj_AI_Hero t, Spell s, HitChance hc = HitChance.High)
{
if (!s.IsSkillshot)
return;
PredictionOutput p = s.GetPrediction(t);
if (s.Collision)
{
for (int i = 0; i < p.CollisionObjects.Count; i++)
if (!p.CollisionObjects[i].IsDead && (p.CollisionObjects[i].IsEnemy || p.CollisionObjects[i].IsMinion))
return;
}
if ((t.HasBuffOfType(BuffType.Slow) && p.Hitchance >= HitChance.High) || p.Hitchance == HitChance.Immobile)
s.Cast(p.CastPosition);
else if (t.IsRecalling())
s.Cast(t.ServerPosition);
else
{
if (s.IsReady())
{
s.SPredictionCast(t, hc);
}
}
}
示例2: CastBasicFarm
public static void CastBasicFarm(Spell spell)
{
if (!spell.IsReady())
return;
var minion = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, spell.Range, MinionTypes.All, MinionTeam.NotAlly);
if (minion.Count == 0)
return;
if (spell.Type == SkillshotType.SkillshotCircle)
{
spell.UpdateSourcePosition();
var predPosition = spell.GetCircularFarmLocation(minion);
if (predPosition.MinionsHit >= 2)
{
spell.Cast(predPosition.Position);
}
}
else if (spell.Type == SkillshotType.SkillshotLine || spell.Type == SkillshotType.SkillshotCone)
{
spell.UpdateSourcePosition();
var predPosition = spell.GetLineFarmLocation(minion);
if (predPosition.MinionsHit >= 2)
spell.Cast(predPosition.Position);
}
}
示例3: Cast_BasicSkillshot_AOE_Farm
public void Cast_BasicSkillshot_AOE_Farm(Spell spell, int extrawidth = 0)
{
if(!spell.IsReady())
return;
var minions = MinionManager.GetMinions(MyHero.ServerPosition, spell.Type == SkillshotType.SkillshotLine ? spell.Range : spell.Range + ((spell.Width + extrawidth) / 2), MinionTypes.All, MinionTeam.NotAlly);
if(minions.Count == 0)
return;
MinionManager.FarmLocation castPostion;
switch(spell.Type)
{
case SkillshotType.SkillshotCircle:
castPostion = MinionManager.GetBestCircularFarmLocation(minions.Select(minion => minion.ServerPosition.To2D()).ToList(), spell.Width + extrawidth, spell.Range);
break;
case SkillshotType.SkillshotLine:
castPostion = MinionManager.GetBestLineFarmLocation(
minions.Select(minion => minion.ServerPosition.To2D()).ToList(), spell.Width, spell.Range);
break;
default:
return;
}
spell.UpdateSourcePosition();
if(castPostion.MinionsHit >= 2 || minions.Any(x => x.Team == GameObjectTeam.Neutral))
spell.Cast(castPostion.Position, UsePackets());
}
示例4: 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);
}
}
示例5: CastMec
private static void CastMec(Spell spell, int minHit)
{
if (!spell.IsReady() || ObjectManager.Player.HealthPercent <= 10)
return;
foreach (var target in HeroManager.Enemies.Where(x => x.IsValidTarget(spell.Range)))
{
var pred = spell.GetPrediction(target, true);
var nearByEnemies = 1;
if (spell.Type == SkillshotType.SkillshotLine && spell.Collision)
{
var poly = new Geometry.Polygon.Circle(pred.UnitPosition, spell.Width);
nearByEnemies +=
HeroManager.Enemies.Where(x => x.NetworkId != target.NetworkId)
.Count(enemy => poly.IsInside(enemy.ServerPosition));
}
else
{
nearByEnemies = pred.AoeTargetsHitCount;
}
if (nearByEnemies >= minHit)
{
spell.Cast(target);
return;
}
}
}
示例6: UseSpellOnTeleport
public void UseSpellOnTeleport(Spell spell)
{
if (!IsMenuEnabled("EOnTP") || (Environment.TickCount - LastCheck) < 1500)
{
return;
}
LastCheck = Environment.TickCount;
var player = ObjectManager.Player;
if (!spell.IsReady())
{
return;
}
foreach (
var targetPosition in
ObjectManager.Get<Obj_AI_Hero>()
.Where(
obj =>
obj.Distance(player) < spell.Range && obj.Team != player.Team &&
obj.HasBuff("teleport_target", true)))
{
spell.Cast(targetPosition.ServerPosition);
}
}
示例7: CheckFor
private static bool CheckFor(Spell spell, Obj_AI_Base target, float spellrange, string menuitem)
{
if (spell.IsReady() && target.IsValidTarget(spellrange) && !target.HasBuffOfType(BuffType.Invulnerability) && !target.HasBuff("UndyingRage") && !target.IsDead && Config.Item(menuitem).GetValue<bool>() == true)
{
return true;
}
else return false;
}
示例8: wardJump
public static void wardJump(Vector2 pos)
{
Q = new Spell(SpellSlot.Q, 700);
if (!Q.IsReady())
return;
var wardIs = false;
if (!InDistance(pos, Player.ServerPosition.LSTo2D(), Q.Range))
{
pos = Player.ServerPosition.LSTo2D() + Vector2.Normalize(pos - Player.ServerPosition.LSTo2D())*600;
}
if (!Q.IsReady())
return;
foreach (var ally in ObjectManager.Get<Obj_AI_Base>().Where(ally => ally.IsAlly && !(ally is Obj_AI_Turret) && InDistance(pos, ally.ServerPosition.LSTo2D(), 200)))
{
wardIs = true;
moveTo(pos);
if (InDistance(Player.ServerPosition.LSTo2D(), ally.ServerPosition.LSTo2D(), Q.Range + ally.BoundingRadius))
{
if (last < Environment.TickCount)
{
Q.Cast(ally);
last = Environment.TickCount + 2000;
}
else return;
}
return;
}
Polygon pol;
if ((pol = Program.map.getInWhichPolygon(pos)) != null)
{
if (InDistance(pol.getProjOnPolygon(pos), Player.ServerPosition.LSTo2D(), Q.Range) && !wardIs &&
InDistance(pol.getProjOnPolygon(pos), pos, 250))
{
putWard(pos);
}
}
else if (!wardIs)
{
putWard(pos);
}
}
示例9: wardJump
public static void wardJump(Vector2 pos)
{
W = new Spell(SpellSlot.Q, 700);
Vector2 posStart = pos;
if (!W.IsReady())
return;
bool wardIs = false;
if (!inDistance(pos, Player.ServerPosition.To2D(), W.Range+15))
{
pos = Player.ServerPosition.To2D() + Vector2.Normalize(pos - Player.ServerPosition.To2D())*600;
}
if(!W.IsReady() && W.ChargedSpellName == "")
return;
foreach (Obj_AI_Base ally in ObjectManager.Get<Obj_AI_Base>().Where(ally => ally.IsAlly
&& !(ally is Obj_AI_Turret) && inDistance(pos, ally.ServerPosition.To2D(), 200)))
{
wardIs = true;
moveTo(pos);
if (inDistance(Player.ServerPosition.To2D(), ally.ServerPosition.To2D(), W.Range + ally.BoundingRadius))
{
if (last < Environment.TickCount)
{
W.Cast(ally);
last = Environment.TickCount + 2000;
}
else return;
}
return;
}
Polygon pol;
if ((pol = Program.map.getInWhichPolygon(pos)) != null)
{
if (inDistance(pol.getProjOnPolygon(pos), Player.ServerPosition.To2D(), W.Range + 15) && !wardIs && inDistance(pol.getProjOnPolygon(pos), pos, 200))
{
putWard(pos);
}
}
else if(!wardIs)
{
putWard(pos);
}
}
示例10: CastBasicSkillShot
public static void CastBasicSkillShot(Spell spell, float range, LeagueSharp.Common.TargetSelector.DamageType type, HitChance hitChance)
{
var target = LeagueSharp.Common.TargetSelector.GetTarget(range, type);
if (target == null || !spell.IsReady())
return;
spell.UpdateSourcePosition();
if (spell.GetPrediction(target).Hitchance >= hitChance)
spell.Cast(target, packets());
}
示例11: Cast_BasicSkillshot_Enemy
public Obj_AI_Hero Cast_BasicSkillshot_Enemy(Spell spell, TargetSelector.PriorityMode prio = TargetSelector.PriorityMode.AutoPriority, float extrarange = 0)
{
if(!spell.IsReady())
return null;
var target = TargetSelector.GetTarget(spell.Range, prio);
if(target == null)
return null;
if (!target.IsValidTarget(spell.Range + extrarange) || spell.GetPrediction(target).Hitchance < HitChance.High)
return null;
spell.Cast(target, UsePackets());
return target;
}
示例12: Karma
static void Karma()
{
Game.PrintChat("Karma supported");
var shield = new Spell(SpellSlot.E, 400);
Game.OnUpdate += eventArgs =>
{
if (shield.IsReady() && ObjectManager.Player.CountEnemiesInRange(1500) > 0)
{
shield.CastOnUnit(ObjectManager.Player);
}
};
}
示例13: castLineSkillShot
/// <summary>
/// Casts a basic line skillshot towards target if hitchance is high
/// </summary>
/// <param name="spell"></param>
/// <param name="damageType"></param>
/// <returns> target </returns>
public Obj_AI_Hero castLineSkillShot(Spell spell,
SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical)
{
if (!spell.IsReady())
return null;
Obj_AI_Hero target = SimpleTs.GetTarget(spell.Range, damageType);
if (target == null)
return null;
if (!target.IsValidTarget(spell.Range) || spell.GetPrediction(target).Hitchance < HitChance.High)
return null;
spell.Cast(target, true);
return target;
}
示例14: castCircleSkillShot
/// <summary>
/// Casts a basic circle skillshot towards target if hitchance is high
/// </summary>
/// <param name="spell"></param>
/// <param name="damageType"></param>
/// <param name="extrarange"></param>
/// <returns></returns>
public Obj_AI_Base castCircleSkillShot(Spell spell,
SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical, float extrarange = 0)
{
if (!spell.IsReady())
return null;
Obj_AI_Hero target = SimpleTs.GetTarget(spell.Range + extrarange, damageType);
if (target == null)
return null;
if (target.IsValidTarget(spell.Range + extrarange) &&
spell.GetPrediction(target).Hitchance >= HitChance.High)
spell.Cast(target, true);
return target;
}
示例15: TargetSkill
public static void TargetSkill(Obj_AI_Base target, Spell spell, bool packet = false, bool towerCheck = false)
{
if (!spell.IsReady())
{
return;
}
if (target == null || towerCheck && target.UnderTurret(true))
{
return;
}
spell.Cast(target, packet);
}