Exemplo n.º 1
0
        public bool SkillCoolDown(int skillID)
        {
            CoolDownItem coolDownItem = null;
            bool         result;

            if (!this.SkillCoolDownDict.TryGetValue(skillID, out coolDownItem))
            {
                result = true;
            }
            else
            {
                long ticks = TimeUtil.NOW();
                result = (ticks > coolDownItem.StartTicks + coolDownItem.CDTicks);
            }
            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 判断技能是否处于冷却状态
        /// </summary>
        /// <param name="magicCode"></param>
        /// <returns></returns>
        public bool SkillCoolDown(int skillID)
        {
            CoolDownItem coolDownItem = null;

            if (!SkillCoolDownDict.TryGetValue(skillID, out coolDownItem))
            {
                return(true);
            }

            long ticks = DateTime.Now.Ticks / 10000;

            if (ticks > (coolDownItem.StartTicks + coolDownItem.CDTicks))
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 判断物品是否处于冷却状态
        /// </summary>
        /// <param name="magicCode"></param>
        /// <returns></returns>
        public bool GoodsCoolDown(int goodsID)
        {
            CoolDownItem coolDownItem = null;

            if (!GoodsCoolDownDict.TryGetValue(goodsID, out coolDownItem))
            {
                //物品不在冷却辞典中,当已冷却处理, 主要针对第一次使用获取非cooldownitem
                return(true);
            }

            long ticks = TimeUtil.NOW();

            if (ticks > (coolDownItem.StartTicks + coolDownItem.CDTicks))
            {
                return(true);
            }

            return(false);
        }