当前位置: 首页>>代码示例>>C#>>正文


C# SNOPower类代码示例

本文整理汇总了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);
        }
开发者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


注:本文中的SNOPower类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。