本文整理汇总了C#中WoWUnit.HasAuraExpired方法的典型用法代码示例。如果您正苦于以下问题:C# WoWUnit.HasAuraExpired方法的具体用法?C# WoWUnit.HasAuraExpired怎么用?C# WoWUnit.HasAuraExpired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WoWUnit
的用法示例。
在下文中一共展示了WoWUnit.HasAuraExpired方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Buff
public static Composite Buff(SimpleStringDelegate name, TimeSpan expires, UnitSelectionDelegate onUnit = null, SimpleBooleanDelegate require = null, bool myBuff = true, HasGcd gcd = HasGcd.Yes, params string[] buffNames)
{
if (onUnit == null)
onUnit = u => Me.CurrentTarget;
if (require == null)
require = req => true;
return new Decorator(
ret =>
{
if (onUnit == null || name == null || require == null)
return false;
_buffUnit = onUnit(ret);
if (_buffUnit == null)
return false;
_buffName = name(ret);
if (_buffName == null)
return false;
SpellFindResults sfr;
if (!SpellManager.FindSpell(_buffName, out sfr))
{
AddUndefinedSpell(_buffName);
return false;
}
WoWSpell spell = sfr.Override ?? sfr.Original;
_buffName = spell.Name;
if (DoubleCastContains(_buffUnit, _buffName))
return false;
if (!spell.CanCast && (sfr.Override == null || !sfr.Original.CanCast))
{
if (SingularSettings.DebugSpellCasting)
Logger.WriteFile("BuffCanCast[{0}]: spell specific CanCast failed (#{1})", spell.Name, spell.Id);
return false;
}
bool hasExpired;
if (!buffNames.Any())
{
hasExpired = _buffUnit.HasAuraExpired(_buffName, expires, myBuff);
if (SingularSettings.DebugSpellCasting)
{
if (hasExpired )
Logger.WriteDebug("Buff=expired: '{0}')={1}: hasspell={2}, auraleft={3:F1} secs", _buffName, hasExpired, SpellManager.HasSpell(_buffName).ToYN(), _buffUnit.GetAuraTimeLeft(_buffName, true).TotalSeconds);
else
Logger.WriteDebug("Buff=present: '{0}')={1}: hasspell={2}, auraleft={3:F1} secs", _buffName, hasExpired, SpellManager.HasSpell(_buffName).ToYN(), _buffUnit.GetAuraTimeLeft(_buffName, true).TotalSeconds);
}
return hasExpired;
}
hasExpired = SpellManager.HasSpell(_buffName) && buffNames.All(b => _buffUnit.HasKnownAuraExpired(b, expires, myBuff));
if (hasExpired && SingularSettings.DebugSpellCasting)
Logger.WriteDebug("Spell.Buff(r=>'{0}')={1}: hasspell={2}, all auras less than {3:F1} secs", _buffName, hasExpired, SpellManager.HasSpell(_buffName).ToYN(), expires.TotalSeconds);
return hasExpired;
},
new Sequence(
// new Action(ctx => _lastBuffCast = name),
Cast(sp => _buffName, chkMov => true, onUnit, require, cancel => false /* causes cast to complete */, gcd: gcd ),
new Action(ret => UpdateDoubleCast( _buffName, _buffUnit))
)
);
}
示例2: GetDotsMissing
private static int GetDotsMissing(WoWUnit unit)
{
int dotCount = 0;
if (unit.HasAuraExpired("Agony", 0))
dotCount++;
if (unit.HasAuraExpired("Corruption", 0))
dotCount++;
if (unit.HasAuraExpired("Unstable Affliction", 0))
dotCount++;
return dotCount;
}
示例3: GetSoulSwapDotsNeeded
private static int GetSoulSwapDotsNeeded(WoWUnit unit)
{
int dotCount = 0;
if (unit.HasAuraExpired("Agony"))
dotCount++;
if (unit.HasAuraExpired("Corruption"))
dotCount++;
if (unit.HasAuraExpired("Unstable Affliction"))
dotCount++;
return dotCount;
}
示例4: Buff
public static Composite Buff(SimpleStringDelegate name, bool myBuff, UnitSelectionDelegate onUnit, SimpleBooleanDelegate requirements, int expirSecs, params string[] buffNames)
{
return new Decorator(
ret =>
{
if (onUnit == null || name == null || requirements == null)
return false;
_buffUnit = onUnit(ret);
if (_buffUnit == null)
return false;
_buffName = name(ret);
if (_buffName == null)
return false;
if (DoubleCastPreventionDict.Contains(_buffUnit, _buffName))
return false;
bool hasExpired;
if (!buffNames.Any())
{
hasExpired = _buffUnit.HasAuraExpired(_buffName, expirSecs, myBuff);
if (hasExpired && SingularSettings.Debug)
Logger.WriteDebug("Spell.Buff(r=>'{0}'): hasspell={1}, auraleft={2:F1} secs", _buffName, SpellManager.HasSpell(_buffName).ToYN(), _buffUnit.GetAuraTimeLeft(_buffName, true).TotalSeconds);
return hasExpired;
}
hasExpired = SpellManager.HasSpell(_buffName) && buffNames.All(b => _buffUnit.HasKnownAuraExpired(b, expirSecs, myBuff));
if (hasExpired && SingularSettings.Debug)
Logger.WriteDebug("Spell.Buff(r=>'{0}'): hasspell={1}, all auras less than {2:F1} secs", _buffName, SpellManager.HasSpell(_buffName).ToYN(), expirSecs );
return hasExpired;
},
new Sequence(
// new Action(ctx => _lastBuffCast = name),
Cast(name, chkMov => true, onUnit, requirements, cancel => false /* causes cast to complete */ ),
new Action(ret => UpdateDoubleCastDict(name(ret), onUnit(ret)))
)
);
}