本文整理汇总了C#中Obj_AI_Base类的典型用法代码示例。如果您正苦于以下问题:C# Obj_AI_Base类的具体用法?C# Obj_AI_Base怎么用?C# Obj_AI_Base使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Obj_AI_Base类属于命名空间,在下文中一共展示了Obj_AI_Base类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessSpell_TwitchSprayandPrayAttack
private void ProcessSpell_TwitchSprayandPrayAttack(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
{
if (spellData.spellName == "TwitchSprayandPrayAttack")
{
spellData.spellDelay = hero.AttackCastDelay * 1000;
}
}
示例2: Obj_AI_Hero_OnAggro
private void Obj_AI_Hero_OnAggro(Obj_AI_Base sender, GameObjectAggroEventArgs args)
{
if (sender.IsEnemy && args.NetworkId == player.NetworkId && !aggroList.Contains(sender.NetworkId))
{
aggroList.Add(sender.NetworkId);
}
}
示例3: GetAARange
/// <summary>
/// Gets auto attack range of given unit
/// </summary>
/// <param name="_unit">Unit to get aa range</param>
/// <returns>Auto attack range of unit</returns>
public static float GetAARange(Obj_AI_Base _unit = null)
{
Obj_AI_Base unit = CorrectUnit(_unit);
if (unit.CharData.BaseSkinName == "Azir")
return 1000f;
return unit.AttackRange + unit.BoundingRadius;
}
示例4: Contains
public static bool Contains(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs args)
{
var name = unit.CharData.BaseSkinName;
var slot = unit.GetSpellSlot(args);
if (!List.ContainsKey(name) || !Program.Menu.Item(name).IsActive())
{
return false;
}
var correctSlot = List[name].Equals(slot);
if (args.SData.IsAutoAttack())
{
if (name.Equals("Blitzcrank")) {}
}
if (name.Equals("Jayce"))
{
correctSlot = correctSlot && unit.CharData.BaseSkinName.Equals("JayceHammerForm");
}
if (name.Equals("LeBlanc"))
{
correctSlot = args.SData.Name.Equals("LeblancChaosOrbM");
}
if (name.Equals("Lissandra"))
{
//correctSlot = spellslot 48
}
//Game.PrintChat("{0} {1} {2}", name, slot, active);
return correctSlot;
}
示例5: GetSpellDamage
public static float GetSpellDamage(this SpellSlot slot, Obj_AI_Base target, int typeOfDamage = 1)
{
if (target != null)
{
var level = Util.MyHero.Spellbook.GetSpell(slot).Level;
switch (slot)
{
case SpellSlot.Q:
return Util.MyHero.CalculateDamageOnUnit(target, DamageType.Physical, 1.1f * Util.MyHero.TotalAttackDamage);
case SpellSlot.W:
return Util.MyHero.CalculateDamageOnUnit(target, DamageType.Physical, 10f + 50f * level + 1.4f * Util.MyHero.TotalAttackDamage);
case SpellSlot.E:
return Util.MyHero.CalculateDamageOnUnit(target, DamageType.Magical, 25f + 55f * level + 1f * Util.MyHero.TotalMagicalDamage);
case SpellSlot.R:
var percentMod = Math.Min((int)(Vector3.Distance(target.ServerPosition, Util.MyHero.ServerPosition) / 100f) * 6f + 10f, 100f) / 100f;
float rawDamage;
if (typeOfDamage == 2)
{
rawDamage = 0.8f * percentMod * (200f + 50f * level + Util.MyHero.TotalAttackDamage + (0.25f + 0.05f * level) * (target.MaxHealth - target.Health));
}
else
{
rawDamage = percentMod * (200f + 50f * level + Util.MyHero.TotalAttackDamage + (0.25f + 0.05f * level) * (target.MaxHealth - target.Health));
}
return Util.MyHero.CalculateDamageOnUnit(target, DamageType.Physical, rawDamage);
}
}
return Util.MyHero.GetSpellDamage(target, slot);
}
示例6: SpellCast
public static void SpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
{
if (!sender.IsMe) return;
if ((Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) &&
Manager.MenuManager.UseQLC && Variables._Player.ManaPercent >= Manager.MenuManager.UseQLCMana) &&
Manager.SpellManager.Q.IsReady())
{
if (Orbwalker.CanAutoAttack)
{
return;
}
foreach (var minion in EntityManager.MinionsAndMonsters.GetLaneMinions(EntityManager.UnitTeam.Enemy,
Variables._Player.ServerPosition, Variables._Player.GetAutoAttackRange()))
{
if (minion == null) return;
var dmg = Variables._Player.GetSpellDamage(minion, SpellSlot.Q) +
Variables._Player.GetAutoAttackDamage(minion);
if (Prediction.Health.GetPrediction(minion, (int)(Variables._Player.AttackDelay * 1000)) <= dmg / 2 &&
(Orbwalker.LastTarget == null || Orbwalker.LastTarget.NetworkId != minion.NetworkId))
{
Player.CastSpell(SpellSlot.Q, Game.CursorPos);
}
}
}
}
示例7: CastSpellQShot
public static void CastSpellQShot(Obj_AI_Base target, int spellAoE)
{
var po = Q.GetPrediction(target);
if (po.CollisionObjects.Count > 0)
{
var firstCol = po.CollisionObjects.OrderBy(unit => unit.Distance(Player.ServerPosition)).First();
if (firstCol.IsValidTarget() && (/*firstCol.Distance(target.ServerPosition) < spellAoE ||*/ firstCol.Distance(po.UnitPosition) < spellAoE))
{
if(firstCol.Type == GameObjectType.obj_AI_Hero)
if (Program.Config.Item("MURAMANA").GetValue<bool>() && (Items.HasItem(ItemData.Muramana.Id) || Items.HasItem(ItemData.Muramana2.Id)))
{
if (!Player.HasBuff("Muramana"))
{
Items.UseItem(ItemData.Muramana.Id);
Items.UseItem(ItemData.Muramana2.Id);
}
}
Q.Cast(po.CastPosition);
}
}
else
{
if (Program.Config.Item("MURAMANA").GetValue<bool>() && (Items.HasItem(ItemData.Muramana.Id) || Items.HasItem(ItemData.Muramana2.Id)))
{
if (!Player.HasBuff("Muramana"))
{
Items.UseItem(ItemData.Muramana.Id);
Items.UseItem(ItemData.Muramana2.Id);
}
}
Q.Cast(po.CastPosition);
}
}
示例8: CastQ
private static void CastQ(Obj_AI_Base unit, Vector2 unitPosition, int minTargets = 0)
{
var points = new List<Vector2>();
var hitBoxes = new List<int>();
var startPoint = ObjectManager.Player.ServerPosition.To2D();
var originalDirection = Q.Range*(unitPosition - startPoint).Normalized();
foreach (var enemy in ObjectManager.Get<Obj_AI_Hero>())
{
if (enemy.IsValidTarget() && enemy.NetworkId != unit.NetworkId)
{
var pos = Q.GetPrediction(enemy);
if (pos.HitChance >= Prediction.HitChance.LowHitchance)
{
points.Add(pos.Position.To2D());
hitBoxes.Add((int) enemy.BoundingRadius);
}
}
}
var posiblePositions = new List<Vector2>();
for (var i = 0; i < 3; i++)
{
if (i == 0) posiblePositions.Add(unitPosition + originalDirection.Rotated(0));
if (i == 1) posiblePositions.Add(startPoint + originalDirection.Rotated(Qangle));
if (i == 2) posiblePositions.Add(startPoint + originalDirection.Rotated(-Qangle));
}
if (startPoint.Distance(unitPosition) < 900)
{
for (var i = 0; i < 3; i++)
{
var pos = posiblePositions[i];
var direction = (pos - startPoint).Normalized().Perpendicular();
var k = (2/3*(unit.BoundingRadius + Q.Width));
posiblePositions.Add(startPoint - k*direction);
posiblePositions.Add(startPoint + k*direction);
}
}
var bestPosition = new Vector2();
var bestHit = -1;
foreach (var position in posiblePositions)
{
var hits = CountHits(position, points, hitBoxes);
if (hits > bestHit)
{
bestPosition = position;
bestHit = hits;
}
}
if (bestHit + 1 <= minTargets)
return;
Q.Cast(bestPosition.To3D(), true);
}
示例9: CastE
protected bool CastE(Obj_AI_Base target)
{
var collision = E.GetPrediction(target).CollisionObjects;
if (collision != null && collision.Length == 1)
{
var distance1 = target.Distance(Player.Instance);
var distance2 =
E.GetPrediction(target)
.CollisionObjects.OrderBy(x => x.Distance(Player.Instance))
.FirstOrDefault()
.Distance(Player.Instance);
if (distance1 - distance2 > 50)
{
return false;
}
E.Cast(E.GetPrediction(target).CastPosition);
}
else if (E.GetPrediction(target).HitChance >= HitChance.High)
{
E.Cast(target);
}
else
{
return false;
}
Orbwalker.ResetAutoAttack();
Player.IssueOrder(GameObjectOrder.AttackUnit, target);
return true;
}
示例10: EvadeData
public EvadeData(Vector2 v, bool bl1, bool bl2, Obj_AI_Base obj)
{
Position = v;
IsTargetted = bl1;
IsSelfCast = bl2;
Target = obj;
}
示例11: getComboDamage
static float getComboDamage(Obj_AI_Base enemy)
{
if (enemy != null)
{
float damage = 0;
if (_Q.IsReady())
if (_R.IsReady() || _W.IsReady() || _E.IsReady())
{
damage += (_Q.GetDamage(enemy) * 2);
}
else
{
damage += _Q.GetDamage(enemy);
}
if (_W.IsReady())
damage += _W.GetDamage(enemy);
if (_E.IsReady())
damage += (_E.GetDamage(enemy));
if (_R.IsReady())
if (_Q.IsReady())
{
damage += (_Q.GetDamage(enemy) * 1.5f * 2f);
}
else
{
damage += _R.GetDamage(enemy);
}
if (!Player.IsWindingUp)
damage += (float)Player.GetAutoAttackDamage(enemy, true);
return damage;
}
return 0;
}
示例12: CalculateDamage
/// <summary>
/// Gets the calculated damage based on the given damage type onto the target from source.
/// </summary>
/// <param name="source">
/// The source
/// </param>
/// <param name="target">
/// The target
/// </param>
/// <param name="damageType">
/// The damage type
/// </param>
/// <param name="amount">
/// The amount
/// </param>
/// <returns>
/// The estimated damage from calculations.
/// </returns>
public static double CalculateDamage(
this Obj_AI_Base source,
Obj_AI_Base target,
DamageType damageType,
double amount)
{
var damage = 0d;
switch (damageType)
{
case DamageType.Magical:
damage = source.CalculateMagicDamage(target, amount);
break;
case DamageType.Physical:
damage = source.CalculatePhysicalDamage(target, amount);
break;
case DamageType.Mixed:
damage = source.CalculateMixedDamage(target, damage / 2, damage / 2);
break;
case DamageType.True:
damage = Math.Max(Math.Floor(amount), 0);
break;
}
return damage;
}
示例13: Obj_AI_Base_OnProcessSpellCast
private static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
{
/*if (args.Target.Equals(Player))
{
args.SData.
}*/
}
示例14: GetComboDamage
private static float GetComboDamage(Obj_AI_Base enemy)
{
var damage = 0d;
if (spells[Spells.Q].IsReady())
{
damage += Player.GetSpellDamage(enemy, SpellSlot.Q);
}
if (spells[Spells.W].IsReady())
{
damage += Player.GetSpellDamage(enemy, SpellSlot.W);
}
if (spells[Spells.E].IsReady())
{
damage += Player.GetSpellDamage(enemy, SpellSlot.E);
}
if (spells[Spells.R].IsReady())
{
//damage += Player.GetSpellDamage(enemy, SpellSlot.R);
damage += enemy.Buffs.Where(buff => buff.Name == "dariushemo").Sum(buff => Player.GetSpellDamage(enemy, SpellSlot.R, 1) * (1 + buff.Count / 5) - 1);
}
return (float)damage;
}
示例15: GetDragonReduction
public static float GetDragonReduction(Obj_AI_Base target)
{
return Player.HasBuff("s5test_dragonslayerbuff")
? SpellManager.E.GetDamage(target)
* (1 - (.07f * Player.GetBuffCount("s5test_dragonslayerbuff")))
: SpellManager.E.GetDamage(target);
}