本文整理汇总了C#中LeagueSharp.Common.Spell.UpdateSourcePosition方法的典型用法代码示例。如果您正苦于以下问题:C# Spell.UpdateSourcePosition方法的具体用法?C# Spell.UpdateSourcePosition怎么用?C# Spell.UpdateSourcePosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LeagueSharp.Common.Spell
的用法示例。
在下文中一共展示了Spell.UpdateSourcePosition方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
示例2: 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);
}
}
示例3: 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());
}
示例4: CastSingleLine
public static void CastSingleLine(Spell spell, Spell spell2, bool wallCheck, float extraPrerange = 1)
{
if (!spell.IsReady() || Utils.TickCount - _lastCast < 0)
return;
//-------------------------------Single---------------------------
var target = TargetSelector.GetTarget(spell.Range + spell2.Range, TargetSelector.DamageType.Magical);
if (target == null)
return;
var vector1 = Player.ServerPosition + Vector3.Normalize(target.ServerPosition - Player.ServerPosition) * (spell.Range * extraPrerange);
spell2.UpdateSourcePosition(vector1, vector1);
var pred = Prediction.GetPrediction(target, spell.Delay);
Geometry.Polygon.Rectangle rec1 = new Geometry.Polygon.Rectangle(vector1, vector1.Extend(pred.CastPosition, spell2.Range), spell.Width);
if (Player.Distance(target) < spell.Range)
{
var vector2 = pred.CastPosition.Extend(target.ServerPosition, spell2.Range*.3f);
Geometry.Polygon.Rectangle rec2 = new Geometry.Polygon.Rectangle(vector2, vector2.Extend(pred.CastPosition, spell2.Range), spell.Width);
if ((!rec2.Points.Exists(Util.IsWall) || !wallCheck) && pred.Hitchance >= HitChance.Medium && target.IsMoving)
{
spell2.UpdateSourcePosition(vector2, vector2);
CastLineSpell(vector2, vector2.Extend(pred.CastPosition, spell2.Range));
_lastCast = Utils.TickCount + 500;
}
}
else if (!rec1.Points.Exists(Util.IsWall) || !wallCheck)
{
//wall check
if (pred.Hitchance >= HitChance.High)
{
CastLineSpell(vector1, pred.CastPosition);
}
}
}
示例5: SkillShot
public static void SkillShot(Obj_AI_Base target,
Spell spell,
HitChance hitChance,
bool aoe = false,
bool towerCheck = false)
{
if (!spell.IsReady())
{
return;
}
if (target == null || towerCheck && target.UnderTurret(true))
{
return;
}
spell.UpdateSourcePosition();
var prediction = spell.GetPrediction(target, aoe);
if (prediction.Hitchance >= hitChance)
{
spell.Cast(prediction.CastPosition);
}
}
示例6: CastBestLine
public static void CastBestLine(bool forceUlt, Spell spell, Spell spell2, int midPointRange, Menu menu, float extraPrerange = 1, bool wallCheck = true)
{
if (!spell.IsReady())
return;
int maxHit = 0;
Vector3 start = Vector3.Zero;
Vector3 end = Vector3.Zero;
//loop one
foreach (var target in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range)))
{
//loop 2
var target1 = target;
var target2 = target;
foreach (var enemy in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target1.NetworkId
&& x.Distance(target1.Position) < spell2.Range - 100).OrderByDescending(x => x.Distance(target2.Position)))
{
int hit = 2;
var targetPred = Prediction.GetPrediction(target, spell.Delay);
var enemyPred = Prediction.GetPrediction(enemy, spell.Delay);
var midpoint = (enemyPred.CastPosition + targetPred.CastPosition) / 2;
var startpos = midpoint + Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange;
var endPos = midpoint - Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange;
Geometry.Polygon.Rectangle rec1 = new Geometry.Polygon.Rectangle(startpos, endPos, spell.Width);
if (!rec1.Points.Exists(Util.IsWall) && Player.CountEnemiesInRange(spell.Range + spell2.Range) > 2)
{
//loop 3
var target3 = target;
var enemy1 = enemy;
foreach (var enemy2 in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target3.NetworkId && x.NetworkId != enemy1.NetworkId && x.Distance(target3.Position) < 1000))
{
var enemy2Pred = Prediction.GetPrediction(enemy2, spell.Delay);
Object[] obj = Util.VectorPointProjectionOnLineSegment(startpos.To2D(), endPos.To2D(), enemy2Pred.CastPosition.To2D());
var isOnseg = (bool)obj[2];
var pointLine = (Vector2)obj[1];
if (pointLine.Distance(enemy2Pred.CastPosition.To2D()) < spell.Width && isOnseg)
{
hit++;
}
}
}
if (hit > maxHit && hit > 1 && !rec1.Points.Exists(Util.IsWall))
{
maxHit = hit;
start = startpos;
end = endPos;
}
}
}
if (start != Vector3.Zero && end != Vector3.Zero && spell.IsReady())
{
spell2.UpdateSourcePosition(start, start);
if (forceUlt)
CastLineSpell(start, end);
if (menu.Item("ComboActive", true).GetValue<KeyBind>().Active && maxHit >= menu.Item("Line_If_Enemy_Count_Combo", true).GetValue<Slider>().Value)
CastLineSpell(start, end);
if (maxHit >= menu.Item("Line_If_Enemy_Count", true).GetValue<Slider>().Value)
CastLineSpell(start, end);
}
//check if only one target
if (forceUlt)
{
CastSingleLine(spell, spell2, wallCheck, extraPrerange);
}
}
示例7: Cast_BasicLineSkillshot_Enemy
public void Cast_BasicLineSkillshot_Enemy(Spell spell, Vector3 sourcePosition, SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical)
{
if(!spell.IsReady() || !ManaManagerAllowCast(spell))
return;
spell.UpdateSourcePosition(sourcePosition, sourcePosition);
foreach (var hero in Program.Helper.EnemyTeam
.Where(hero => (hero.Distance(sourcePosition) < spell.Range) && hero.IsValidTarget()).Where(hero => spell.GetPrediction(hero).Hitchance >= HitChance.High))
{
spell.Cast(hero, Packets());
return;
}
}
示例8: 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());
}
示例9: Cast_BasicSkillshot_Enemy
public Obj_AI_Hero Cast_BasicSkillshot_Enemy(Spell spell, SimpleTs.DamageType prio = SimpleTs.DamageType.True, float extrarange = 0)
{
if(!spell.IsReady())
return null;
var target = SimpleTs.GetTarget(spell.Range + extrarange, prio);
if(target == null)
return null;
if(!target.IsValidTarget(spell.Range + extrarange) || spell.GetPrediction(target).Hitchance < HitChance.Medium)
return null;
spell.UpdateSourcePosition();
spell.Cast(target, UsePackets());
return target;
}
示例10: Farm
public static void Farm(Spell spell, int minHit = 2, float overrideWidth = -1f)
{
if (!spell.IsReady())
{
return;
}
var minions =
MinionManager.GetMinions(
ObjectManager.Player.ServerPosition, spell.Range, MinionTypes.All, MinionTeam.NotAlly,
MinionOrderTypes.MaxHealth).ToList();
if (minions.Count == 0)
{
return;
}
if (spell.Type == SkillshotType.SkillshotCircle)
{
spell.UpdateSourcePosition();
var prediction = spell.GetCircularFarmLocation(minions, overrideWidth);
if (prediction.MinionsHit >= minHit)
{
spell.Cast(prediction.Position);
}
}
else if (spell.Type == SkillshotType.SkillshotLine)
{
spell.UpdateSourcePosition();
var prediction = spell.GetLineFarmLocation(minions, overrideWidth);
if (prediction.MinionsHit >= minHit)
{
spell.Cast(prediction.Position);
}
}
}
示例11: CastBasicFarm
protected void CastBasicFarm(Spell spell)
{
if(!spell.IsReady())
return;
var minion = MinionManager.GetMinions(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, Player.ChampionName == "Kartus" || packets());
}
}
else if (spell.Type == SkillshotType.SkillshotLine)
{
spell.UpdateSourcePosition();
var predPosition = spell.GetLineFarmLocation(minion);
if(predPosition.MinionsHit >= 2)
spell.Cast(predPosition.Position, packets());
}
}
示例12: CastBasicSkillShot
protected 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.GetPrediction(target).Hitchance >= hitChance)
spell.Cast(target, packets());
}