本文整理汇总了C#中InventorySlot.Cast方法的典型用法代码示例。如果您正苦于以下问题:C# InventorySlot.Cast方法的具体用法?C# InventorySlot.Cast怎么用?C# InventorySlot.Cast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InventorySlot
的用法示例。
在下文中一共展示了InventorySlot.Cast方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: jumpKS
/// <summary>
/// Jumps and steals kills
/// </summary>
private static void jumpKS()
{
// Try to jump to any ward at first
foreach(Obj_AI_Minion ward in ObjectManager.Get<Obj_AI_Minion>().Where(ward =>
E.IsReady() && Q.IsReady() && ward.Name.ToLower().Contains("ward") &&
ward.Distance(target.ServerPosition) < Q.Range && ward.Distance(myHero.Position) < E.Range)) {
E.Cast(ward);
return;
}
// If that fails, try to jump to any hero
foreach(Obj_AI_Base hero in ObjectManager.Get<Obj_AI_Base>().Where(hero =>
E.IsReady() && Q.IsReady() && hero.Distance(target.ServerPosition) < Q.Range &&
hero.Distance(myHero.Position) < E.Range && hero.IsValidTarget(E.Range))) {
E.Cast(hero);
return;
}
// Finally, try a minion.
foreach(Obj_AI_Minion minion in ObjectManager.Get<Obj_AI_Minion>().Where(minion =>
E.IsReady() && Q.IsReady() && minion.Distance(target.ServerPosition) < Q.Range &&
minion.Distance(myHero.Position) < E.Range && minion.IsValidTarget(E.Range))) {
E.Cast(minion);
return;
}
// Cast Q if we are in range now
if(myHero.Distance(target.Position) < Q.Range) {
Q.Cast(target);
return;
}
// If we can't shunpo then there is no reason to even place the upcoming ward
if(Environment.TickCount <= LastPlaced + 3000 || !E.IsReady()) return;
// Calculate the ideal position of our ward
Vector3 position = myHero.ServerPosition + Vector3.Normalize(target.ServerPosition - myHero.ServerPosition) * 590;
// If the distance now is Q-able, wardKs away!
if(target.Distance(position) < Q.Range) {
// Find the best ward slot.
wardSlot = myHero.InventoryItems.FirstOrDefault(a => a.Id == ItemId.Warding_Totem_Trinket || a.Id == ItemId.Vision_Ward || a.Id == ItemId.Greater_Vision_Totem_Trinket || a.Id == ItemId.Greater_Stealth_Totem_Trinket); // || ItemId.Sightsone -> buggy
if(wardSlot == null) return;
// Cast and log.
wardSlot.Cast(position);
LastWardPos = position;
LastPlaced = Environment.TickCount;
}
// Last Q check, if we've jumped this will trigger.
if(myHero.Distance(target.Position) < Q.Range) {
Q.Cast(target);
}
}
示例2: WardJump
/// <summary>
/// Tries to cast any ward/trinket and then proceed to jump on it.
/// </summary>
public static void WardJump()
{
if(myHero.IsDead || !E.IsReady()) return; // しりません どして。。。
// Walk to cursor and try to grab the wardSlot
Orbwalker.OrbwalkTo(Game.CursorPos.Extend(Game.CursorPos, 200).To3D());
wardSlot = myHero.InventoryItems.FirstOrDefault(a => a.Id == ItemId.Warding_Totem_Trinket || a.Id == ItemId.Greater_Vision_Totem_Trinket || a.Id == ItemId.Greater_Stealth_Totem_Trinket);
if(wardSlot == null || !Player.GetSpell(wardSlot.SpellSlot).IsReady) return;
// Try to calculate our ideal ward position.
Vector3 position = myHero.ServerPosition + Vector3.Normalize(Game.CursorPos - myHero.ServerPosition) * 590;
// anti spam wards.
if(Environment.TickCount <= LastPlaced + 3000) return;
wardSlot.Cast(position);
LastWardPos = position;
LastPlaced = Environment.TickCount;
Core.DelayAction(delegate {
Console.Write("SHOULD JUMP?");
Player.CastSpell(SpellSlot.E, ObjectManager.Get<Obj_AI_Base>().FirstOrDefault(a => a.Distance(myHero.ServerPosition) <= E.Range && ( a.Name.ToLower().Contains("ward") || a.Name.ToLower().Contains("totem") || a.Name.ToLower().Contains("trinket") ) ));
Player.CastSpell(SpellSlot.E, position);
E.Cast(position);
}, 200);
}