本文整理汇总了C#中SNOPower类的典型用法代码示例。如果您正苦于以下问题:C# SNOPower类的具体用法?C# SNOPower怎么用?C# SNOPower使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SNOPower类属于命名空间,在下文中一共展示了SNOPower类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: HasBuff
public static bool HasBuff(SNOPower power)
{
if (ShouldRefreshBuffs) RefreshCurrentBuffs();
int id = (int)power;
return CurrentBuffs.Keys.Any(u => u == id);
}
开发者ID:herbfunk,项目名称:Funky,代码行数:7,代码来源:Hotbar.cs
示例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;
}
开发者ID:mythsya,项目名称:db-plugins,代码行数:16,代码来源:AbilitySelector.cs
示例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;
}
开发者ID:ipo,项目名称:AGBA,代码行数:17,代码来源:SpellCast.cs
示例4: Reset
public void Reset()
{
_isDone = false;
_state = States.NotStarted;
_actor = null;
_attackSkill = SNOPower.None;
_attackRange = 10;
}
开发者ID:dachidahu,项目名称:AutoFollow,代码行数:8,代码来源:AttackCoroutine.cs
示例5: GetBuffStacks
internal int GetBuffStacks(SNOPower thispower)
{
int iStacks;
if (CurrentBuffs.TryGetValue((int)thispower, out iStacks))
{
return iStacks;
}
return 0;
}
开发者ID:BUFORD,项目名称:Funky,代码行数:9,代码来源:Hotbar.cs
示例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;
}
开发者ID:herbfunk,项目名称:Funky,代码行数:11,代码来源:Hotbar.cs
示例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();
}
开发者ID:MGramolini,项目名称:Trinity,代码行数:16,代码来源:SkillUtils.cs
示例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();
}
开发者ID:mythsya,项目名称:db-plugins,代码行数:16,代码来源:PassiveUtils.cs
示例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;
}
开发者ID:MGramolini,项目名称:Trinity,代码行数:14,代码来源:SpellHistory.cs
示例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);
})
);
}
开发者ID:murrain,项目名称:Mammon,代码行数:32,代码来源:Spell.cs
示例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());
})
);
}
开发者ID:ipo,项目名称:AGBA,代码行数:32,代码来源:Spell.cs
示例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);
}
开发者ID:ipo,项目名称:AGBA,代码行数:16,代码来源:Spell.cs
示例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);
}
开发者ID:ipo,项目名称:AGBA,代码行数:16,代码来源:Spell.cs
示例14: HasBuff
internal bool HasBuff(SNOPower power)
{
int id = (int)power;
return CurrentBuffs.Keys.Any(u => u == id);
}
开发者ID:BUFORD,项目名称:Funky,代码行数:5,代码来源:Hotbar.cs
示例15: HasDebuff
internal bool HasDebuff(SNOPower power)
{
int id = (int)power;
return CurrentDebuffs.Contains(id);
}
开发者ID:BUFORD,项目名称:Funky,代码行数:5,代码来源:Hotbar.cs
示例16: CanCastMantra
private static bool CanCastMantra(SNOPower mantraPower, float combatRange = 10f, int timeSpan = 2950)
{
var mantraBuff = Skills.Monk.MantraOfConviction.IsActive
? SNOPower.X1_Monk_MantraOfConviction_v2_Passive
: Skills.Monk.MantraOfHealing.IsActive
? SNOPower.X1_Monk_MantraOfHealing_v2_Passive
: Skills.Monk.MantraOfRetribution.IsActive
? SNOPower.X1_Monk_MantraOfRetribution_v2_Passive
: SNOPower.X1_Monk_MantraOfEvasion_v2_Passive;
return CanCast(mantraPower) && Player.PrimaryResource >= 50 && TimeSincePowerUse(mantraPower) > timeSpan &&
(!CacheData.Buffs.HasBuff(mantraBuff,1) || (_hasSwk && TargetUtil.AnyMobsInRange(combatRange)));
}
开发者ID:mythsya,项目名称:db-plugins,代码行数:13,代码来源:MonkCombat.cs
示例17: MobsWithDebuff
internal static int MobsWithDebuff(SNOPower power, float maxRange = 30f)
{
return (from u in ObjectCache
where u.IsUnit && u.IsFullyValid() &&
u.RadiusDistance <= maxRange &&
u.HasDebuff(power)
select u).Count();
}
开发者ID:mythsya,项目名称:db-plugins,代码行数:8,代码来源:TargetUtil.cs
示例18: CreateAbility
public override Ability CreateAbility(SNOPower Power)
{
Ability returnAbility=null;
#region Spirit Walk
// Spirit Walk Cast on 65% health or while avoiding anything but molten core or incapacitated or Chasing Goblins
if (Power.Equals(SNOPower.Witchdoctor_SpiritWalk))
{
return new Ability
{
Power=Power,
UsageType=AbilityUseType.Buff,
WaitVars=new WaitLoops(0, 0, true),
Cost=49,
UseAvoiding=true,
UseOOCBuff=true,
IsNavigationSpecial=true,
Priority=AbilityPriority.High,
PreCastConditions=(AbilityConditions.CheckEnergy|AbilityConditions.CheckCanCast),
//TestCustomCombatConditionAlways=true,
Fcriteria=new Func<bool>(() =>
{
return (Bot.Character.dCurrentHealthPct<=0.65
||(Bot.Combat.FleeingLastTarget&&Bot.Combat.iAnythingWithinRange[(int)RangeIntervals.Range_25]>1)
||(Bot.Combat.AvoidanceLastTarget&&Bot.Combat.NearbyAvoidances.Count>0)
||Bot.Character.bIsIncapacitated
||Bot.Character.bIsRooted
||Bot.SettingsFunky.OutOfCombatMovement);
}),
};
}
#endregion
#region Soul Harvest
// Soul Harvest Any Elites or 2+ Norms and baby it's harvest season
if (Power.Equals(SNOPower.Witchdoctor_SoulHarvest))
{
return new Ability
{
Power=Power,
UsageType=AbilityUseType.Buff,
WaitVars=new WaitLoops(0, 1, true),
Cost=59,
Counter=5,
UseAvoiding=true,
UseOOCBuff=false,
Priority=AbilityPriority.High,
PreCastConditions=(AbilityConditions.CheckPlayerIncapacitated| AbilityConditions.CheckCanCast | AbilityConditions.CheckExisitingBuff | AbilityConditions.CheckEnergy),
UnitsWithinRangeConditions=new Tuple<RangeIntervals, int>(RangeIntervals.Range_12, 3),
};
}
#endregion
#region Sacrifice
// Sacrifice AKA Zombie Dog Jihad, use on Elites Only or to try and Save yourself
if (Power.Equals(SNOPower.Witchdoctor_Sacrifice))
{
return new Ability
{
Power=Power,
UsageType=AbilityUseType.Buff,
WaitVars=new WaitLoops(1, 0, true),
Cost=10,
Range=48,
UseAvoiding=true,
UseOOCBuff=false,
Priority=AbilityPriority.None,
PreCastConditions=(AbilityConditions.CheckPlayerIncapacitated| AbilityConditions.CheckCanCast),
ElitesWithinRangeConditions=new Tuple<RangeIntervals, int>(RangeIntervals.Range_15, 1),
TargetUnitConditionFlags=new UnitTargetConditions(TargetProperties.IsSpecial, 15),
};
}
#endregion
#region Gargantuan
// Gargantuan, Recast on 1+ Elites or Bosses to trigger Restless Giant
if (Power.Equals(SNOPower.Witchdoctor_Gargantuan))
{
return new Ability
{
Power=Power,
UsageType=AbilityUseType.Buff,
WaitVars=new WaitLoops(2, 1, true),
Cost=147,
Counter=1,
UseAvoiding=true,
UseOOCBuff=true,
Priority=AbilityPriority.High,
PreCastConditions=(AbilityConditions.CheckPlayerIncapacitated| AbilityConditions.CheckCanCast | AbilityConditions.CheckEnergy | AbilityConditions.CheckPetCount),
Fbuff=new Func<bool>(() => { return this.RuneIndexCache[SNOPower.Witchdoctor_Gargantuan]!=0&&Bot.Character.PetData.Gargantuan==0; }),
Fcriteria=new Func<bool>(() =>
{
return (this.RuneIndexCache[SNOPower.Witchdoctor_Gargantuan]==0&&(Bot.Combat.iElitesWithinRange[(int)RangeIntervals.Range_15]>=1||(Bot.Target.CurrentUnitTarget.IsEliteRareUnique&&Bot.Target.CurrentTarget.RadiusDistance<=15f))
||this.RuneIndexCache[SNOPower.Witchdoctor_Gargantuan]!=0&&Bot.Character.PetData.Gargantuan==0);
}),
};
}
#endregion
#region Zombie dogs
// Zombie dogs Woof Woof, good for being blown up, cast when less than or equal to 1 Dog or Not Blowing them up and cast when less than 4
if (Power.Equals(SNOPower.Witchdoctor_SummonZombieDog))
//.........这里部分代码省略.........
开发者ID:NEVEROYATNII,项目名称:Funky,代码行数:101,代码来源:WitchDoctor.cs
示例19: SkillDamagePercent
public static double SkillDamagePercent(this ACDItem acdItem, SNOPower power)
{
return Math.Round(acdItem.GetAttribute<float>(((int) power << 12) + ((int) ActorAttributeType.PowerDamagePercentBonus & 0xFFF))*100, MidpointRounding.AwayFromZero);
}
开发者ID:artious,项目名称:unifiedTrinity-2.x.x,代码行数:4,代码来源:GetAttributeExtensions.cs
示例20: GetHasBuff
/// <summary>
/// Check if a particular buff is present
/// </summary>
/// <param name="power"></param>
/// <returns></returns>
public static bool GetHasBuff(SNOPower power)
{
return GetBuffStacks(power) > 0;
}
开发者ID:mythsya,项目名称:db-plugins,代码行数:9,代码来源:AbilitySelector.cs
注:本文中的SNOPower类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论