本文整理汇总了C#中Obj_AI_Base.IsMelee方法的典型用法代码示例。如果您正苦于以下问题:C# Obj_AI_Base.IsMelee方法的具体用法?C# Obj_AI_Base.IsMelee怎么用?C# Obj_AI_Base.IsMelee使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj_AI_Base
的用法示例。
在下文中一共展示了Obj_AI_Base.IsMelee方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: onMeleeStartAutoAttack
private static void onMeleeStartAutoAttack(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
{
if (sender is Obj_AI_Turret)
{
activeTowerTargets.Remove(sender.NetworkId);
var dMake = new DamageMaker(sender,
(Obj_AI_Base)args.Target,
null,
args.SData,
true);
activeTowerTargets.Add(sender.NetworkId, dMake);
}
if (!args.SData.IsAutoAttack())
return;
if (args.Target != null && args.Target is Obj_AI_Base && !sender.IsMe)
{
var tar = (Obj_AI_Base) args.Target;
if (damagerSources.ContainsKey(sender.NetworkId))
{
damagerSources[sender.NetworkId].setTarget(tar);
}
else
{
damagerSources.Add(sender.NetworkId, new Damager(sender, tar));
}
}
if(!sender.IsMelee())
return;
if (args.Target is Obj_AI_Base)
{
activeDamageMakers.Remove(sender.NetworkId);
var dMake = new DamageMaker(sender,
(Obj_AI_Base)args.Target,
null,
args.SData,
true);
activeDamageMakers.Add(sender.NetworkId, dMake);
}
if (sender is Obj_AI_Hero)
{
DeathWalker.lastDmg = now;
}
}
示例2: enemIsOnMe
public static bool enemIsOnMe(Obj_AI_Base target)
{
if (!target.IsMelee() || target.IsAlly || target.IsDead)
return false;
var distTo = target.Distance(Properties.PlayerHero, true);
var targetReack = target.AttackRange + target.BoundingRadius + Properties.PlayerHero.BoundingRadius + 100;
if (distTo > targetReack * targetReack)
return false;
var per = target.Direction.To2D().Perpendicular();
var dir = new Vector3(per, 0);
var enemDir = target.Position + dir * 40;
return !(distTo < enemDir.Distance(Properties.PlayerHero.Position, true));
}
示例3: ObjAiBaseOnOnProcessSpellCast
private static void ObjAiBaseOnOnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
{
if (!sender.IsValidTarget(3000, false) || sender.Team != ObjectManager.Player.Team || sender is Obj_AI_Hero ||
!Orbwalking.IsAutoAttack(args.SData.Name) || !(args.Target is Obj_AI_Base))
{
return;
}
var target = (Obj_AI_Base) args.Target;
ActiveAttacks.Remove(sender.NetworkId);
var attackData = new PredictedDamage(
sender, target, Utils.TickCount - Game.Ping / 2, sender.AttackCastDelay * 1000,
sender.AttackDelay * 1000 - (sender is Obj_AI_Turret ? 70 : 0),
sender.IsMelee() ? int.MaxValue : (int) args.SData.MissileSpeed,
(float) sender.GetAutoAttackDamage(target, true));
ActiveAttacks.Add(sender.NetworkId, attackData);
}
示例4: OnProcessSpell
private static void OnProcessSpell(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs Spell)
{
try
{
var spellName = Spell.SData.Name;
if (IsAutoAttackReset(spellName) && unit.IsMe)
{
Utility.DelayAction.Add(250, ResetAutoAttackTimer);
}
if (!IsAutoAttack(spellName))
{
return;
}
if (unit.IsMe &&
(Spell.Target is Obj_AI_Base || Spell.Target is Obj_BarracksDampener || Spell.Target is Obj_HQ))
{
LastAATick = Utils.TickCount - Game.Ping / 2;
if (Spell.Target is Obj_AI_Base)
{
var target = (Obj_AI_Base)Spell.Target;
if (target.IsValid)
{
FireOnTargetSwitch(target);
_lastTarget = target;
}
if (unit.IsMelee())
{
Utility.DelayAction.Add(
(int)(unit.AttackCastDelay * 1000 + 40 - Game.Ping/2), () => FireAfterAttack(unit, _lastTarget));
}
}
}
FireOnAttack(unit, _lastTarget);
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
示例5: Obj_AI_Base_OnProcessSpellCast
public static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs args)
{
if (args.Target != null && Config.Item("autoE").GetValue<bool>() && args.Target.IsMe && unit.IsValid<Obj_AI_Hero>() && unit.IsMelee() && Q.IsReady() && args.SData.IsAutoAttack()
&& ObjectManager.Player.Position.Extend(Game.CursorPos, Q.Range).CountEnemiesInRange(500) < 3)
{
Q.Cast(Game.CursorPos, true);
}
}
示例6: OnProcessSpell
private static void OnProcessSpell(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs spell)
{
if (IsAutoAttackReset(spell.SData.Name) && unit.IsMe)
{
Console.WriteLine("Reset");
Utility.DelayAction.Add(250, ResetAutoAttackTimer);
}
if (!IsAutoAttack(spell.SData.Name))
return;
if (unit.IsMe)
{
_lastAATick = Environment.TickCount;
// ReSharper disable once CanBeReplacedWithTryCastAndCheckForNull
if (spell.Target is Obj_AI_Base)
{
FireOnTargetSwitch((Obj_AI_Base)spell.Target);
_lastTarget = (Obj_AI_Base)spell.Target;
}
if (unit.IsMelee())
Utility.DelayAction.Add(
(int)(unit.AttackCastDelay * 1000 + Game.Ping * 0.5) + 50, () => FireAfterAttack(unit, _lastTarget));
}
FireOnAttack(unit, _lastTarget);
}
示例7: OnProcessSpell
private static void OnProcessSpell(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs spell)
{
var spellName = spell.SData.Name;
if (unit.IsMe && IsAutoAttackReset(spellName) && spell.SData.SpellCastTime == 0)
{
ResetAutoAttackTimer();
}
if (!IsAutoAttack(spellName))
{
return;
}
if (IsAutoAttackReset(spell.SData.Name) && unit.IsMe)
LeagueSharp.Common.Utility.DelayAction.Add(100, ResetAutoAttackTimer);
if (unit.IsMe)
{
_lastAATick = Environment.TickCount - Game.Ping / 2; // need test todo
// ReSharper disable once CanBeReplacedWithTryCastAndCheckForNull
if (spell.Target is Obj_AI_Base)
{
FireOnTargetSwitch((Obj_AI_Base)spell.Target);
_lastTarget = (Obj_AI_Base)spell.Target;
}
if (unit.IsMelee())
LeagueSharp.Common.Utility.DelayAction.Add((int)(unit.AttackCastDelay * 1000 + Game.Ping * 0.5) + 50, () => FireAfterAttack(unit, _lastTarget));
FireOnAttack(unit, _lastTarget);
}
else
{
FireOnAttack(unit, (Obj_AI_Base)spell.Target);
}
}
示例8: OnProcessSpell
private static void OnProcessSpell(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs spell)
{
SpellSlot castedSlot = MyHero.GetSpellSlot(spell.SData.Name);
if (castedSlot == SpellSlot.R && MyHero.ChampionName == "Katarina")
{
R.LastCastAttemptT = Environment.TickCount;
}
if (IsAutoAttackReset(spell.SData.Name) && unit.IsMe)
Utility.DelayAction.Add(100, ResetAutoAttackTimer);
if (!IsAutoAttack(spell.SData.Name))
return;
if (unit.IsMe)
{
_lastAATick = Environment.TickCount - Game.Ping / 2; // need test todo
// ReSharper disable once CanBeReplacedWithTryCastAndCheckForNull
if (spell.Target is Obj_AI_Base)
{
FireOnTargetSwitch((Obj_AI_Base)spell.Target);
_lastTarget = (Obj_AI_Base)spell.Target;
}
if (unit.IsMelee())
Utility.DelayAction.Add(
(int)(unit.AttackCastDelay * 1000 + Game.Ping * 0.5) + 50, () => FireAfterAttack(unit, _lastTarget));
FireOnAttack(unit, _lastTarget);
}
else
{
if (spell.Target is Obj_AI_Base)
{
FireOnAttack(unit, (Obj_AI_Base)spell.Target);
}
}
}
示例9: OnProcessSpell
private static void OnProcessSpell(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs spell)
{
if (IsAutoAttackReset(spell.SData.Name) && unit.IsMe)
{
Console.WriteLine("reset AA");
// if (spell.SData.Name == "LucianQ")
// Utility.DelayAction.Add(400, ResetAutoAttackTimer);
//else
Utility.DelayAction.Add(250, ResetAutoAttackTimer);
}
if (!IsAutoAttack(spell.SData.Name))
return;
if (unit.IsMe)
{
_lastAATick = Environment.TickCount;
if (spell.Target is Obj_AI_Base)
{
FireOnTargetSwitch((Obj_AI_Base)spell.Target);
_lastTarget = (Obj_AI_Base)spell.Target;
}
if (unit.IsMelee())
Utility.DelayAction.Add(
(int)(unit.AttackCastDelay * 1000 + Game.Ping * 0.5) + 50, () => FireAfterAttack(unit, _lastTarget));
}
FireOnAttack(unit, _lastTarget);
}
示例10: OnProcessSpellCast
protected override void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
{
#region ward brush after condemn
if (sender.IsMe && args.SData.Name.ToLower().Contains("condemn"))
{
if (NavMesh.IsWallOfGrass(_condemnEndPos, 150))
{
var blueTrinket = ItemId.Scrying_Orb_Trinket;
if (Items.HasItem((int)ItemId.Farsight_Orb_Trinket, Player)) blueTrinket = ItemId.Farsight_Orb_Trinket;
var yellowTrinket = ItemId.Warding_Totem_Trinket;
if (Items.HasItem((int)ItemId.Greater_Stealth_Totem_Trinket, Player)) yellowTrinket = ItemId.Greater_Stealth_Totem_Trinket;
if (Items.CanUseItem((int)blueTrinket))
Items.UseItem((int)blueTrinket, _condemnEndPos.Randomize(0, 150));
if (Items.CanUseItem((int)yellowTrinket))
Items.UseItem((int)yellowTrinket, _condemnEndPos.Randomize(0, 150));
}
}
#endregion
if (ShouldSaveCondemn()) return;
if (sender.Distance(Player) > 700 || !sender.IsMelee() || !args.Target.IsMe || sender.Distance(Player) > 700 ||
!sender.IsValid<Obj_AI_Hero>() || !sender.IsEnemy || args.SData == null)
return;
//how to milk alistar/thresh/everytoplaner
var spellData = SpellDb.GetByName(args.SData.Name);
if (spellData != null)
{
if (spellData.CcType == CcType.Knockup || spellData.CcType == CcType.Stun)
{
if (E.CanCast(sender))
{
E.Cast(sender);
}
}
}
if (args.SData.Name.ToLower().Contains("talonshadow"))
{
if (Items.HasItem((int)ItemId.Oracles_Lens_Trinket))
{
Items.UseItem((int)ItemId.Oracles_Lens_Trinket, Player.Position);
}
else if (Items.HasItem((int)ItemId.Vision_Ward, Player))
{
Items.UseItem((int)ItemId.Vision_Ward, Player.Position.Randomize(0, 125));
}
}
}
示例11: OnProcessSpell
private static void OnProcessSpell(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs Spell)
{
if (IsAutoAttackReset(Spell.SData.Name) && unit.IsMe)
{
Utility.DelayAction.Add(250, ResetAutoAttackTimer);
}
if (IsAutoAttack(Spell.SData.Name))
{
if (unit.IsMe)
{
LastAATick = Environment.TickCount - Game.Ping / 2;
if (Spell.Target is Obj_AI_Base)
{
FireOnTargetSwitch((Obj_AI_Base) Spell.Target);
_lastTarget = (Obj_AI_Base) Spell.Target;
}
if (unit.IsMelee())
{
Utility.DelayAction.Add(
(int) (unit.AttackCastDelay * 1000 + 40), () => FireAfterAttack(unit, _lastTarget));
}
}
FireOnAttack(unit, _lastTarget);
}
}
示例12: Obj_AI_Base_OnProcessSpellCast
private static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
{
if (!sender.IsValidTarget(3000, false) || sender.Team != ObjectManager.Player.Team || sender is Obj_AI_Hero || !Orbwalking.Utility.IsAutoAttack(args.SData.Name) || !(args.Target is Obj_AI_Base) || sender.Type == GameObjectType.obj_AI_Turret)
return;
var target = (Obj_AI_Base)args.Target;
if(ActiveAttacks.ContainsKey(sender.NetworkId))
ActiveAttacks.Remove(sender.NetworkId);
var attackData = new PredictedDamage(
sender,
target,
Utils.TickCount,
sender.AttackCastDelay * 1000f,
sender.AttackDelay * 1000f,
sender.IsMelee() ? float.MaxValue : args.SData.MissileSpeed,
(float)sender.GetAutoAttackDamage(target) - 1);
ActiveAttacks.Add(sender.NetworkId, attackData);
}
示例13: OnProcessSpell
private static void OnProcessSpell(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs spell)
{
if (IsAutoAttackReset(spell.SData.Name) && unit.IsMe)
{
Utility.DelayAction.Add(GetResetDelay(), ResetAutoAttackTimer);
}
if (!IsAutoAttack(spell.SData.Name))
{
if (unit.IsMe)
{
var ct = (unit.Spellbook.CastTime - Game.Time) * 1000;
if (ct > 0)
{
LastCastTime = myUtility.TickCount + (int)ct;
}
}
return;
}
if (unit.IsMe && spell.Target is Obj_AI_Base)
{
LastAATick = myUtility.TickCount;
MissileLaunched = false;
var target = (Obj_AI_Base)spell.Target;
if (target.IsValid)
{
FireOnTargetSwitch(target);
ProcessSpellLastTarget = target;
}
if (unit.IsMelee())
{
Utility.DelayAction.Add((int)(unit.AttackCastDelay * 1000 + 50), () => FireAfterAttack(unit, ProcessSpellLastTarget));
}
}
FireOnAttack(unit, ProcessSpellLastTarget);
}
示例14: ObjAiBaseOnOnProcessSpellCast
private static void ObjAiBaseOnOnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
{
if (sender.IsValidTarget(3000, false) && sender.Team == ObjectManager.Player.Team &&
!(sender is Obj_AI_Hero))
{
if (Orbwalking.IsAutoAttack(args.SData.Name))
{
if (args.Target is Obj_AI_Base)
{
var target = (Obj_AI_Base) args.Target;
ActiveAttacks.Remove(sender.NetworkId);
var attackData = new PredictedDamage(
sender, target, Environment.TickCount - Game.Ping / 2, sender.AttackCastDelay * 1000,
sender.AttackDelay * 1000 - (sender is Obj_AI_Turret ? 70 : 0), sender.IsMelee() ? int.MaxValue : (int) args.SData.MissileSpeed,
(float) CalcMinionToMinionDmg(sender, target));
ActiveAttacks.Add(sender.NetworkId, attackData);
}
}
}
}
示例15: PassiveFlatMod
private static double PassiveFlatMod(Obj_AI_Base source, Obj_AI_Base target)
{
double d = 0;
//Offensive masteries:
//Butcher
// Basic attacks and single target abilities do 2 bonus damage to minions and monsters.
var hero = source as Obj_AI_Hero;
if (hero != null && target is Obj_AI_Minion)
{
if (hero.Masteries.Any(m => m.Page == MasteryPage.Offense && m.Id == 65 && m.Points == 1))
{
d = d + 2;
}
}
//Defensive masteries:
//Block
//Reduces incoming damage from champion basic attacks by 1 / 2
if (source is Obj_AI_Hero && target is Obj_AI_Hero)
{
var mastery =
((Obj_AI_Hero) target).Masteries.FirstOrDefault(m => m.Page == MasteryPage.Defense && m.Id == 65);
if (mastery != null && mastery.Points >= 1)
{
d = d - 1 * mastery.Points;
}
}
//Tough Skin
//Reduces damage taken from neutral monsters by 1 / 2
if (source is Obj_AI_Minion && target is Obj_AI_Hero && source.Team == GameObjectTeam.Neutral)
{
var mastery =
((Obj_AI_Hero) target).Masteries.FirstOrDefault(m => m.Page == MasteryPage.Defense && m.Id == 68);
if (mastery != null && mastery.Points >= 1)
{
d = d - 1 * mastery.Points;
}
}
//Unyielding
//Melee - Reduces all incoming damage from champions by 2
//Ranged - Reduces all incoming damage from champions by 1
if (source is Obj_AI_Hero && target is Obj_AI_Hero)
{
var mastery =
((Obj_AI_Hero) target).Masteries.FirstOrDefault(m => m.Page == MasteryPage.Defense && m.Id == 81);
if (mastery != null && mastery.Points == 1)
{
if (source.IsMelee())
{
d = d - 2;
}
else
{
d = d - 1;
}
}
}
return d;
}