本文整理汇总了C#中Obj_AI_Base.LSIsValid方法的典型用法代码示例。如果您正苦于以下问题:C# Obj_AI_Base.LSIsValid方法的具体用法?C# Obj_AI_Base.LSIsValid怎么用?C# Obj_AI_Base.LSIsValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj_AI_Base
的用法示例。
在下文中一共展示了Obj_AI_Base.LSIsValid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Game_OnProcessSpell
private static void Game_OnProcessSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args)
{
var heroA = hero as AIHeroClient;
if (!getCheckBoxItem("enemy.ward"))
{
return;
}
if (hero.IsEnemy && hero is AIHeroClient && hero.LSIsValid())
{
WardData wardData;
if (WardDatabase.WardspellNames.TryGetValue(args.SData.Name.ToLower(), out wardData))
{
var pos = args.End.ToVector2();
if (args.SData.Name.ToLower().Contains("TrinketTotem") || args.SData.Name.ToLower().Contains("trinkettotem"))
{
wardData.Duration = 1000 * (60 + (int)Math.Round(3.5 * (heroA.Level - 1))); // Not sure.
}
DelayAction.Add((float)50, () =>
{
if (Wards.Any(ward => ward.Position.ToVector2().Distance(pos) < 50 && Variables.TickCount - ward.Timestamp < 100))
{
return;
}
var newWard = new WardTrackerInfo(wardData, pos.To3D(), null)
{
StartPos = args.Start.ToVector2(),
EndPos = args.End.ToVector2()
};
Wards.Add(newWard);
});
}
}
}
示例2: Cast
/// <summary>
/// Casts the spell.
/// </summary>
/// <param name="unit">Unit to cast on</param>
/// <param name="exactHitChance">
/// Is exact hit chance
/// </param>
/// <param name="areaOfEffect">
/// Is Area of Effect
/// </param>
/// <param name="minTargets">
/// Minimum of Targets
/// </param>
/// <param name="tempHitChance">
/// Temporary HitChance Override
/// </param>
/// <returns>
/// The <see cref="CastStates" />
/// </returns>
public CastStates Cast(
Obj_AI_Base unit,
bool exactHitChance = false,
bool areaOfEffect = false,
int minTargets = -1,
Enumerations.HitChance tempHitChance = Enumerations.HitChance.None)
{
if (!unit.LSIsValid() || !unit.IsVisible || !unit.IsHPBarRendered)
{
return CastStates.InvalidTarget;
}
if (!this.IsReady())
{
return CastStates.NotReady;
}
if (!this.minManaPercent.Equals(0) && ObjectManager.Player.ManaPercent < this.minManaPercent)
{
return CastStates.LowMana;
}
if (this.CastCondition != null && !this.CastCondition())
{
return CastStates.FailedCondition;
}
if (!areaOfEffect && minTargets != -1)
{
areaOfEffect = true;
}
if (!this.IsSkillshot)
{
if (this.RangeCheckFrom.LSDistanceSquared(unit.ServerPosition) > this.RangeSqr)
{
return CastStates.OutOfRange;
}
this.LastCastAttemptT = Variables.TickCount;
return !GameObjects.Player.Spellbook.CastSpell(this.Slot, unit)
? CastStates.NotCasted
: CastStates.SuccessfullyCasted;
}
var prediction = this.GetPrediction(unit, areaOfEffect);
if (minTargets != -1 && prediction.AoeTargetsHitCount <= minTargets)
{
return CastStates.NotEnoughTargets;
}
if (prediction.CollisionObjects.Count > 0)
{
return CastStates.Collision;
}
if (this.RangeCheckFrom.LSDistanceSquared(prediction.CastPosition) > this.RangeSqr)
{
return CastStates.OutOfRange;
}
if (prediction.Hitchance < ((tempHitChance == Enumerations.HitChance.None) ? this.MinHitChance : tempHitChance)
|| (exactHitChance
&& prediction.Hitchance != ((tempHitChance == Enumerations.HitChance.None) ? this.MinHitChance : tempHitChance)))
{
return CastStates.LowHitChance;
}
this.LastCastAttemptT = Variables.TickCount;
if (this.IsChargedSpell)
{
if (this.IsCharging)
{
ShootChargedSpell(this.Slot, prediction.CastPosition);
}
else
{
this.StartCharging();
//.........这里部分代码省略.........