本文整理汇总了C#中SNOPower类的典型用法代码示例。如果您正苦于以下问题:C# SNOPower类的具体用法?C# SNOPower怎么用?C# SNOPower使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SNOPower类属于命名空间,在下文中一共展示了SNOPower类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HasBuff
public static bool HasBuff(SNOPower power)
{
if (ShouldRefreshBuffs) RefreshCurrentBuffs();
int id = (int)power;
return CurrentBuffs.Keys.Any(u => u == id);
}
示例2: SNOPowerUseTimer
/// <summary>
/// Check re-use timers on skills, returns true if we can use the power
/// </summary>
/// <param name="power">The power.</param>
/// <param name="recheck">if set to <c>true</c> check again.</param>
/// <returns>
/// Returns whether or not we can use a skill, or if it's on our own internal Trinity cooldown timer
/// </returns>
public static bool SNOPowerUseTimer(SNOPower power, bool recheck = false)
{
if (TimeSinceUse(power) >= CombatBase.GetSNOPowerUseDelay(power))
return true;
if (recheck && TimeSinceUse(power) >= 150 && TimeSinceUse(power) <= 600)
return true;
return false;
}
示例3: SpellCast
/// <summary>
/// Initializes a new instance of the <see cref="SpellCast"/> class.
/// </summary>
/// <param name="power">The power.</param>
/// <param name="posRetriever">The pos retriever.</param>
/// <param name="dynWorldRetriever">The dyn world retriever.</param>
/// <param name="targetRetriever">The target retriever.</param>
/// <param name="extra">The extra.</param>
/// <remarks>Created 2012-06-18</remarks>
public SpellCast(SNOPower power, ValueRetriever<Vector3> posRetriever = null, ValueRetriever<int> dynWorldRetriever = null, ValueRetriever<int> targetRetriever = null, ValueRetriever<bool> extra = null)
{
Power = power;
PositionRetriever = posRetriever;
DynamicWorldIdRetriever = dynWorldRetriever;
TargetGuidRetriever = targetRetriever;
ExtraCondition = extra;
}
示例4: Reset
public void Reset()
{
_isDone = false;
_state = States.NotStarted;
_actor = null;
_attackSkill = SNOPower.None;
_attackRange = 10;
}
示例5: GetBuffStacks
internal int GetBuffStacks(SNOPower thispower)
{
int iStacks;
if (CurrentBuffs.TryGetValue((int)thispower, out iStacks))
{
return iStacks;
}
return 0;
}
示例6: GetBuffStacks
public static int GetBuffStacks(SNOPower thispower)
{
if (ShouldRefreshBuffs) RefreshCurrentBuffs();
HotbarBuff buff;
if (CurrentBuffs.TryGetValue((int)thispower, out buff))
{
return buff.StackCount;
}
return 0;
}
示例7: ById
/// <summary>
/// Fast lookup for a Skill by SNOPower
/// </summary>
public static Skill ById(SNOPower power)
{
if (!_allSkillBySnoPower.Any())
_allSkillBySnoPower = All.ToDictionary(s => s.SNOPower, s => s);
Skill skill;
var result = _allSkillBySnoPower.TryGetValue(power, out skill);
if (!result)
{
Logger.LogDebug("Unable to find skill for power {0}", power);
}
return result ? skill : new Skill();
}
示例8: ById
/// <summary>
/// Fast lookup for a Skill by SNOPower
/// </summary>
public static Passive ById(SNOPower power)
{
if (!_allPassiveBySnoPower.Any())
_allPassiveBySnoPower = All.ToDictionary(s => s.SNOPower, s => s);
Passive passive;
var result = _allPassiveBySnoPower.TryGetValue(power, out passive);
if (!result)
{
Logger.LogDebug("Unable to find passive for power {0}", power);
}
return result ? passive : new Passive();
}
示例9: GetSpellLastused
public static DateTime GetSpellLastused(SNOPower power = SNOPower.None)
{
DateTime lastUsed;
if (power == SNOPower.None && CacheData.AbilityLastUsed.Any())
{
var pair = CacheData.AbilityLastUsed.LastOrDefault();
lastUsed = pair.Value;
}
else
{
CacheData.AbilityLastUsed.TryGetValue(power, out lastUsed);
}
return lastUsed;
}
示例10: Cast
/// <summary>
/// Casts the specified power.
/// </summary>
/// <param name="power">The sno power.</param>
/// <param name="positionRetriver">The position retriver.</param>
/// <param name="levelAreaRetriever">The level area retriever.</param>
/// <param name="extraCondition">The extra condition if any.</param>
/// <param name="powerType">Type of the power.</param>
/// <param name="onUnit">The target acd GUID retriever.</param>
/// <returns>
/// <c>RunStatus.Success</c> if successful, otherwise <c>RunStatus.Failure</c>.
/// </returns>
/// <remarks>Created 2012-04-09</remarks>
public static Composite Cast(SNOPower power, ValueRetriever<Vector3> positionRetriver, ValueRetriever<int> levelAreaRetriever, int powerType, ValueRetriever<int> onUnit, ValueRetriever<bool> extraCondition)
{
return new Decorator(ret =>
{
bool canCast = PowerManager.CanCast(power);
bool minReqs = extraCondition != null ? extraCondition(ret) : true;
return minReqs && canCast;
},
new Action(ctx =>
{
Vector3 position = positionRetriver != null ? positionRetriver(ctx) : Vector3.Zero;
int levelArea = levelAreaRetriever != null ? levelAreaRetriever(ctx) : 0;
int acdGuid = onUnit != null ? onUnit(ctx) : -1;
ZetaDia.Me.UsePower(power, position, levelArea, powerType, acdGuid);
})
);
}
示例11: Cast
/// <summary>
/// Casts the specified power.
/// </summary>
/// <param name="power">The sno power.</param>
/// <param name="positionRetriver">The position retriver.</param>
/// <param name="levelAreaRetriever">The level area retriever.</param>
/// <param name="extraCondition">The extra condition if any.</param>
/// <param name="onUnit">The target acd GUID retriever.</param>
/// <returns>
/// <c>RunStatus.Success</c> if successful, otherwise <c>RunStatus.Failure</c>.
/// </returns>
/// <remarks>Created 2012-04-09</remarks>
public static Composite Cast(SNOPower power, ValueRetriever<Vector3> positionRetriver, ValueRetriever<int> levelAreaRetriever, ValueRetriever<int> onUnit, ValueRetriever<bool> extraCondition)
{
return new Decorator(ret =>
{
bool canCast = PowerManager.CanCast(power);
bool minReqs = extraCondition != null ? extraCondition(ret) : true;
return minReqs && canCast;
},
new Action(ctx =>
{
Vector3 position = positionRetriver != null ? positionRetriver(ctx) : Vector3.Zero;
int worldId = levelAreaRetriever != null ? levelAreaRetriever(ctx) : 0;
int acdGuid = onUnit != null ? onUnit(ctx) : -1;
ZetaDia.Me.UsePower(power, position, worldId, acdGuid);
Logger.WriteVerbose("Using power: {0}", power.ToString());
})
);
}
示例12: CastAtLocation
/// <summary>
/// Casts a spell on a Vector.
/// </summary>
/// <param name="power">The sno power.</param>
/// <param name="position">The position.</param>
/// <param name="extraRequirements">The extra requirements.</param>
/// <returns>
/// <c>RunStatus.Success</c> if successful, otherwise <c>RunStatus.Failure</c>.
/// </returns>
/// <remarks>
/// Created 2012-04-09
/// </remarks>
public static Composite CastAtLocation(SNOPower power, ValueRetriever<Vector3> position, ValueRetriever<bool> extraRequirements = null)
{
return Cast(power, position, null, extraRequirements);
}
示例13: CastOnUnit
/// <summary>
/// Casts a spell on a unit.
/// </summary>
/// <param name="power">The sno power.</param>
/// <param name="onUnit">The on unit.</param>
/// <param name="extraRequirements">The extra requirements.</param>
/// <returns>
/// <c>RunStatus.Success</c> if successful, otherwise <c>RunStatus.Failure</c>.
/// </returns>
/// <remarks>
/// Created 2012-04-09
/// </remarks>
public static Composite CastOnUnit(SNOPower power, ValueRetriever<int> onUnit, ValueRetriever<bool> extraRequirements = null)
{
return Cast(power, null, null, onUnit, extraRequirements);
}
示例14: HasBuff
internal bool HasBuff(SNOPower power)
{
int id = (int)power;
return CurrentBuffs.Keys.Any(u => u == id);
}
示例15: HasDebuff
internal bool HasDebuff(SNOPower power)
{
int id = (int)power;
return CurrentDebuffs.Contains(id);
}