本文整理汇总了C#中Obj_AI_Hero.HasBuff方法的典型用法代码示例。如果您正苦于以下问题:C# Obj_AI_Hero.HasBuff方法的具体用法?C# Obj_AI_Hero.HasBuff怎么用?C# Obj_AI_Hero.HasBuff使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj_AI_Hero
的用法示例。
在下文中一共展示了Obj_AI_Hero.HasBuff方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnemyHasShield
public static bool EnemyHasShield(Obj_AI_Hero target)
{
var status = false;
if (target.HasBuff("blackshield"))
{
status = true;
}
if (target.HasBuff("sivire"))
{
status = true;
}
if (target.HasBuff("nocturneshroudofdarkness"))
{
status = true;
}
if (target.HasBuff("bansheesveil"))
{
status = true;
}
return status;
}
示例2: calcDamage
private static int calcDamage(Obj_AI_Hero target)
{
//var vTarget = SimpleTs.GetTarget(Q.Range, SimpleTs.DamageType.Physical);
// normal damage 2 Auto Attacks
var AA = Player.CalcDamage(target, Damage.DamageType.Physical, Player.FlatPhysicalDamageMod + Player.BaseAttackDamage);
var damage = AA;
if (_igniteSlot != SpellSlot.Unknown &&
Player.SummonerSpellbook.CanUseSpell(_igniteSlot) == SpellState.Ready)
damage += ObjectManager.Player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite);
if (Items.HasItem(3153) && Items.CanUseItem(3153))
damage += Player.GetItemDamage(target, Damage.DamageItems.Botrk); //ITEM BOTRK
if (E.IsReady() && Config.Item("UseE").GetValue<bool>()) // edamage
{
damage += Player.CalcDamage(target, Damage.DamageType.Physical,
10 + (E.Level * 30) + (Player.FlatPhysicalDamageMod * 0.2));
}
if (Q.IsReady() && Config.Item("UseQ").GetValue<bool>()) // qdamage
{
damage += Player.CalcDamage(target, Damage.DamageType.Physical,
30 + (Q.Level * 40) + (Player.FlatPhysicalDamageMod * 0.65));
}
if (!IsValorMode() && target.HasBuff("QuinnW") && E.IsReady())
{
damage += Player.CalcDamage(target, Damage.DamageType.Physical,
15 + (Player.Level * 10) + (Player.FlatPhysicalDamageMod * 0.5)) * 2; // //if target has buff and E is ready passive*2
}
if (!IsValorMode() && !target.HasBuff("QuinnW") && E.IsReady()) // if e ISANT ready then calculate only 1 time passive
{
damage += Player.CalcDamage(target, Damage.DamageType.Physical,
15 + (Player.Level * 10) + (Player.FlatPhysicalDamageMod * 0.5)); // passive
}
if (!IsValorMode() && target.HasBuff("QuinnW") && !E.IsReady()) // if e ISANT ready then calculate only 1 time passive
{
damage += Player.CalcDamage(target, Damage.DamageType.Physical,
15 + (Player.Level * 10) + (Player.FlatPhysicalDamageMod * 0.5)); // passive
}
if (R.IsReady() && Config.Item("UseR").GetValue<bool>()) // rdamage
{
if (Player.CalcDamage(target, Damage.DamageType.Physical, (75 + (R.Level * 55) + (Player.FlatPhysicalDamageMod * 0.5)) * (2 - ((target.Health - damage - AA*3) / target.MaxHealth))) > target.Health)
{
damage += Player.CalcDamage(target, Damage.DamageType.Physical, (75 + (R.Level * 55) + (Player.FlatPhysicalDamageMod * 0.5)) * (2 - ((target.Health - damage) / target.MaxHealth)));
}
}
return (int)damage;
}
示例3: ShouldUseCleanse
public static bool ShouldUseCleanse(Obj_AI_Hero target)
{
return target.HasBuffOfType(BuffType.Charm)
|| target.HasBuffOfType(BuffType.Flee)
|| target.HasBuffOfType(BuffType.Polymorph)
|| target.HasBuffOfType(BuffType.Snare)
|| target.HasBuffOfType(BuffType.Stun)
|| target.HasBuffOfType(BuffType.Taunt)
|| target.HasBuff("summonerexhaust")
|| target.HasBuff("summonerdot");
}
示例4: ShouldUseCleanse
/// <summary>
/// Defines whether the player should use cleanse.
/// </summary>
public static bool ShouldUseCleanse(Obj_AI_Hero target)
=>
!ObjectManager.Player.IsInvulnerable &&
!IsSpellShielded(ObjectManager.Player) &&
(
Bools.IsValidStun() ||
Bools.IsValidSnare() ||
target.HasBuff("summonerdot") ||
target.HasBuff("summonerexhaust") ||
target.HasBuffOfType(BuffType.Flee) ||
target.HasBuffOfType(BuffType.Charm) ||
target.HasBuffOfType(BuffType.Taunt) ||
target.HasBuffOfType(BuffType.Polymorph)
);
示例5: Check
public static bool Check(Obj_AI_Hero target, DamageType damageType = DamageType.True, bool ignoreShields = true)
{
try
{
if (target.HasBuffOfType(BuffType.Invulnerability) || target.IsInvulnerable)
{
return true;
}
foreach (var invulnerable in Items)
{
if (invulnerable.Champion == null || invulnerable.Champion == target.ChampionName)
{
if (invulnerable.DamageType == null || invulnerable.DamageType == damageType)
{
if (!ignoreShields && invulnerable.IsShield && target.HasBuff(invulnerable.BuffName))
{
return true;
}
if (invulnerable.CustomCheck != null && CustomCheck(invulnerable, target, damageType))
{
return true;
}
}
}
}
return false;
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
return false;
}
示例6: Check
public static bool Check(Obj_AI_Hero target, DamageType damageType = DamageType.True, bool ignoreShields = true)
{
if (target.HasBuffOfType(BuffType.Invulnerability) || target.IsInvulnerable)
{
return true;
}
foreach (var invulnerable in Items)
{
if (invulnerable.Champion == null || invulnerable.Champion == target.ChampionName)
{
if (invulnerable.DamageType == null || invulnerable.DamageType == damageType)
{
if (!ignoreShields && invulnerable.IsShield && target.HasBuff(invulnerable.BuffName))
{
return true;
}
if (invulnerable.CustomCheck != null)
{
return CustomCheck(invulnerable, target, damageType);
}
}
}
}
return false;
}
示例7: Execute
public override void Execute(Obj_AI_Hero target)
{
if (target == null)
target = TargetSelector.GetTarget(1200, TargetSelector.DamageType.Magical);
if (target == null) return;
var dmgPerBounce = ObjectManager.Player.GetSpellDamage(target, Slot) + BrandCombo.GetPassiveDamage(target);
if (dmgPerBounce > target.Health && target.Distance(ObjectManager.Player) > 750)
{
TryBridgeUlt(target);
// Console.WriteLine("ayy lmao bridge bois");
}
if (dmgPerBounce > target.Health && !Provider.ShouldBeDead(target) && ObjectManager.Player.GetAutoAttackDamage(target, true) < target.Health && ((_otherSkills.All(skill => skill.Instance.State != SpellState.Ready && skill.Instance.State != SpellState.Surpressed /*&& !skill.IsSafeCasting(1)*/) /*|| target.Distance(ObjectManager.Player) > 650*/) || ObjectManager.Player.GetSpellDamage(target, SpellSlot.Q) + dmgPerBounce + ObjectManager.Player.GetAutoAttackDamage(target) > target.Health && !target.HasBuff("brandablaze") && target.Distance(ObjectManager.Player) < 750))
{
if (ObjectManager.Player.HealthPercent - target.HealthPercent < OverkillPercent || !AntiOverkill || IgnoreAntiOverkillOnFlee && target.Distance(ObjectManager.Player) > ObjectManager.Player.AttackRange)
{
Cast(target);
}
else if (ObjectManager.Player.HealthPercent < target.HealthPercent && IgniteManager.CanBeUsed() && IgniteManager.GetDamage() + dmgPerBounce > target.Health)
{
if (target.Distance(ObjectManager.Player) < 600)
IgniteManager.UseIgnite(target);
Cast(target);
}
}
// if (target.Distance(ObjectManager.Player) > 750) return;
var inBounce = new bool[HeroManager.Enemies.Count];
var canBounce = BounceCheck(target, inBounce);
if (canBounce)
{
var inBounceEnemies = HeroManager.Enemies.Where(enemy => inBounce[HeroManager.Enemies.IndexOf(enemy)]).ToArray();
var distance = target.Distance(ObjectManager.Player);
var bounceCount = inBounce.Count(item => item);
if (bounceCount <= 1) return;
//Console.WriteLine("bounce r " + bounceCount);
if ((inBounceEnemies.Any(enemy => (dmgPerBounce > enemy.Health && MaxDamage > enemy.Health)) && (bounceCount == 2 || RiskyUlt)))
{
TryUlt(target, inBounceEnemies, distance);
}
else if (bounceCount == 2 && dmgPerBounce * 3 > target.Health && MaxDamage > target.Health && distance < 750 && RiskyUlt)
{
Cast(target);
}
else if (dmgPerBounce * 2 > target.Health && MaxDamage > target.Health)
{
TryUlt(target, inBounceEnemies, distance);
}
else if (UltNonKillable && MinBounceTargets <= bounceCount)
{
TryUlt(target, inBounceEnemies, distance, false);
}
}
}
示例8: Interruptable
public override void Interruptable(ComboProvider combo, Obj_AI_Hero sender, ComboProvider.InterruptableSpell interruptableSpell, float endTime)
{
var distance = sender.Distance(ObjectManager.Player);
if (sender.HasBuff("brandablaze") || Provider.IsMarked(sender) || !_brandQ.CouldHit(sender) || !InterruptW) return;
if (Cast(sender) == CastStates.SuccessfullyCasted)
Provider.SetMarked(sender); //Todo: risky, keep an eye on this. If the W misses u r fucked
}
示例9: GetRealDamage
public static float GetRealDamage(Obj_AI_Hero target)
{
if (target.HasBuff("ferocioushowl"))
{
return Program.E.GetDamage(target) * 0.7f;
}
return Program.E.GetDamage(target);
}
示例10: Check
public static bool Check(Obj_AI_Hero target, DamageType damageType = DamageType.True, bool ignoreShields = true)
{
return target.HasBuffOfType(BuffType.Invulnerability) || target.IsInvulnerable ||
(from invulnerable in Items
where invulnerable.Champion == null || invulnerable.Champion == target.ChampionName
where invulnerable.DamageType == null || invulnerable.DamageType == damageType
where target.HasBuff(invulnerable.BuffName)
where !ignoreShields || !invulnerable.IsShield
select invulnerable).Any(
invulnerable =>
invulnerable.CheckFunction == null || CheckFunction(invulnerable, target, damageType));
}
示例11: Combo
//some part of combo from diabaths
private void Combo(Obj_AI_Hero t)
{
if (R.IsReady())
{
if (t.IsValidTarget(Q.Range) && !haveUlti)
if (!t.HasBuff("JudicatorIntervention") && !t.HasBuff("Undying Rage"))
R.CastIfHitchanceEquals(t, HitChance.Medium);
}
if ( E.IsReady() && t.IsValidTarget(Q.Range) && Q.IsReady())
{
//xsalice Code
var vec = t.ServerPosition - Player.ServerPosition;
var castBehind = E.GetPrediction(t).CastPosition + Vector3.Normalize(vec) * 100;
E.Cast(castBehind);
}
if (t.IsValidTarget(Q.Range) && Q.IsReady() && _epos != default(Vector3) &&
t.IsValidTarget(200, true, _epos))
{
Q.Cast(_epos);
}
if (W.IsReady())
{
if (t.IsValidTarget(W.Range))
W.Cast();
}
if (Q.IsReady() && !E.IsReady())
{
if (t.IsValidTarget(Q.Range))
Q.Cast(t, UsePackets, true);
}
if (R.IsReady() && !haveUlti)
{
if (GetNumberHitByR(t) >= 2)
R.Cast(t, UsePackets, true);
}
}
示例12: GetKsDamage
public static float GetKsDamage(Obj_AI_Hero t, Spell QWER)
{
var totalDmg = QWER.GetDamage(t);
totalDmg -= t.HPRegenRate;
if (totalDmg > t.Health)
{
if (ObjectManager.Player.HasBuff("summonerexhaust"))
totalDmg = totalDmg * 0.6f;
if (t.HasBuff("ferocioushowl"))
totalDmg = totalDmg * 0.7f;
if (t.ChampionName == "Blitzcrank" && !t.HasBuff("BlitzcrankManaBarrierCD") && !t.HasBuff("ManaBarrier"))
{
totalDmg -= t.Mana / 2f;
}
}
//if (Thunderlord && !Player.HasBuff( "masterylordsdecreecooldown"))
//totalDmg += (float)Player.CalcDamage(t, Damage.DamageType.Magical, 10 * Player.Level + 0.1 * Player.FlatMagicDamageMod + 0.3 * Player.FlatPhysicalDamageMod);
totalDmg += (float)OktwCommon.GetIncomingDamage(t);
return totalDmg;
}
示例13: CanMove
/// <summary>
/// Judge Target MoveMent Status (This Part From SebbyLib)
/// </summary>
/// <param name="Target">Target</param>
/// <returns></returns>
public static bool CanMove(Obj_AI_Hero Target)
{
if (Target.MoveSpeed < 50 || Target.IsStunned || Target.HasBuffOfType(BuffType.Stun) ||
Target.HasBuffOfType(BuffType.Fear) || Target.HasBuffOfType(BuffType.Snare) ||
Target.HasBuffOfType(BuffType.Knockup) || Target.HasBuff("Recall") ||
Target.HasBuffOfType(BuffType.Knockback) || Target.HasBuffOfType(BuffType.Charm) ||
Target.HasBuffOfType(BuffType.Taunt) || Target.HasBuffOfType(BuffType.Suppression)
|| (Target.IsCastingInterruptableSpell() && !Target.IsMoving))
{
return false;
}
else
return true;
}
示例14: Execute
public override void Execute(Obj_AI_Hero target)
{
if (_brandQWE.Any(spell => spell.Instance.State == SpellState.Ready || spell.Instance.CooldownExpires > Game.Time && spell.Instance.CooldownExpires - Game.Time < spell.Instance.Cooldown / 2f) || _w.Instance.Cooldown - (_w.Instance.CooldownExpires - Game.Time) < 1)
{
if ((!target.HasBuff("brandablaze") || target.GetBuff("brandablaze").EndTime - Game.Time < Delay) && !Provider.IsMarked(target) && !(ObjectManager.Player.GetSpellDamage(target, Instance.Slot) + ObjectManager.Player.GetAutoAttackDamage(target, true) > target.Health))
return;
}
//if ((((!target.HasBuff("brandablaze") || target.GetBuff("brandablaze").EndTime - Game.Time < Delay) && !Provider.IsMarked(target)) &&
// (!(ObjectManager.Player.GetSpellDamage(target, Instance.Slot) + ObjectManager.Player.GetAutoAttackDamage(target, true) > target.Health))) &&
// _brandQWE.Any(spell => spell.Instance.State == SpellState.Ready || spell.Instance.CooldownExpires > Game.Time && spell.Instance.CooldownExpires - Game.Time < spell.Instance.Cooldown / 2f)) return;
//// wenn any skill ready || half cooldown
Cast(target);
}
示例15: Q2Damage
public static float Q2Damage(Obj_AI_Hero target,Spell Q)
{
if (target == null)
{
return 0f;
}
var damage = 0f;
if (target.HasBuff("BlindMonkQOne") && Q.Instance.Name == "blindmonkqtwo")
{
var total = Q2Dmg[Q.Level - 1] + 0.9*ObjectManager.Player.FlatPhysicalDamageMod +
0.08*(target.MaxHealth - target.Health);
damage += (float)ObjectManager.Player.CalcDamage(target, Damage.DamageType.Physical, total);
}
return (float)damage;
}