private bool CheckCostToSpanSkill()
        {
            this.SkillDesNodeData = (SkillDesNodeData)this.BelongtoRuntimeTree.BelongNP_DataSupportor.BuffNodeDataDic[this.DataId.Value];
            //TODO 相关状态检测,例如沉默,眩晕等,下面是示例代码

            /*
             * if (Game.Scene.GetComponent<UnitComponent>().Get(this.Unitid).GetComponent<BuffManagerComponent>()
             *      .FindBuffByWorkType(BuffWorkTypes.Silence))
             * {
             *  return false;
             * }
             */
            //给要修改的黑板节点进行赋值
            HeroDataComponent heroDataComponent = Game.Scene.GetComponent <UnitComponent>().Get(this.Unitid).GetComponent <HeroDataComponent>();

            switch (this.SkillDesNodeData.SkillCostTypes)
            {
            case SkillCostTypes.MagicValue:
                //依据技能具体消耗来进行属性改变操作
                return(true);

            case SkillCostTypes.Other:
                return(true);

            case SkillCostTypes.HPValue:
                return(true);

            default:
                return(true);
            }
        }
        public Action.Result WaitTime(bool hasDown)
        {
            if (!this.hasInit)
            {
                this.m_Unit           = UnitComponent.Instance.Get(this.Unitid);
                tempBlackboard        = this.BelongtoRuntimeTree.GetBlackboard();
                this.SkillDesNodeData = (SkillDesNodeData)this.BelongtoRuntimeTree.BelongNP_DataSupportor.BuffNodeDataDic[this.DataId.Value];
                this.lastElapsedTime  = SyncContext.Instance.GetClock().ElapsedTime;
                tempBlackboard.Set(this.TheTimeToWait.BBKey,
                                   this.SkillDesNodeData.SkillCD[
                                       this.m_Unit.GetComponent <SkillCanvasManagerComponent>().GetSkillLevel(this.SkillIdBelongTo.Value)]);
                //Log.Info($"第一次设置Q技能CD:{tempBlackboard[NpBlackBoardRelationData.DicKey]}");
                this.hasInit = true;
            }

            //刷新黑板上的CD信息
            tempBlackboard.Set(this.TheTimeToWait.BBKey,
                               tempBlackboard.Get <float>(this.TheTimeToWait.BBKey) -
                               (float)(SyncContext.Instance.GetClock().ElapsedTime - lastElapsedTime));

            this.lastElapsedTime = SyncContext.Instance.GetClock().ElapsedTime;
            // Log.Info(
            //     $"在执行改变CD逻辑,此时剩余CD为{tempBlackboard.Get<float>(this.TheTimeToWait.BBKey)}");
            if (tempBlackboard.Get <float>(this.TheTimeToWait.BBKey) <= 0)
            {
                //Log.Info("CD刷新完成");
                lastElapsedTime = -1;
                //下次再运行就会初始化了,即重新从技能数据块获取并填充CD
                this.hasInit = false;
                return(NPBehave.Action.Result.SUCCESS);
            }

            return(NPBehave.Action.Result.PROGRESS);
        }
예제 #3
0
        private bool CheckCostToSpanSkill()
        {
            this.SkillDesNodeData = (SkillDesNodeData)this.BelongtoRuntimeTree.BelongNP_DataSupportor.BuffNodeDataDic[this.DataId.Value];
            // 相关状态检测,例如沉默,眩晕等,下面是示例代码

            if (Game.Scene.GetComponent <UnitComponent>().Get(this.Unitid).GetComponent <StackFsmComponent>()
                .CheckConflictState(ConfliectType))
            {
                return(false);
            }

            //给要修改的黑板节点进行赋值
            HeroDataComponent heroDataComponent = UnitComponent.Instance.Get(this.Unitid).GetComponent <HeroDataComponent>();

            switch (this.SkillDesNodeData.SkillCostTypes)
            {
            case SkillCostTypes.MagicValue:
                //依据技能具体消耗来进行属性改变操作
                return(true);

            case SkillCostTypes.Other:
                return(true);

            case SkillCostTypes.HPValue:
                return(true);

            default:
                return(true);
            }
        }