Пример #1
0
 public override void InitState(SkillObj self, BuffInfo_New biffInfo, BuffConfig_New buffConfig, double fixTime)
 {
     int index = self.GetBuffStateIndex(biffInfo);
     var time = self.GetBuffStateTime(buffConfig, index) + fixTime;
     self.SetBuffStateTime(biffInfo, time);
     self.SetBuffDoubleParam(biffInfo, time, key_ticlLeftTime_BuffInfo);
 }
Пример #2
0
        public override void InitState(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig, double fixTime)
        {
            int index = self.GetBuffStateIndex(buffInfo);
            var time  = self.GetBuffStateTime(buffConfig, index);

            self.SetBuffStateTime(buffInfo, time + fixTime);
        }
Пример #3
0
 public override LogicStateTickRet Tick(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     LogicStateTickRet ret = base.Tick(self, buffInfo, buffConfig);
     if (ret == LogicStateTickRet.TimeFinish)
     {
         return ret;
     }
     double effectTickTime = self.GetBuffStateDoubleParam(buffConfig, key_EffectTickTime, self.GetBuffStateIndex(buffInfo));
     if(effectTickTime < 0)
     {
         self.LogInfo("TickBuffState:buffObj[{0}] buff:[{1}] Tick Effect effectTickTime< 0".F(self.GetID(), self.GetBuffID(buffInfo)));
         return LogicStateTickRet.TimeFinish;
     }
     self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) - self.GetDeltaTime());
     var leftTickTime = self.GetBuffDoubleParam(buffInfo, key_ticlLeftTime_BuffInfo);
     if (leftTickTime - self.GetBuffStateTime(buffInfo) >= effectTickTime)
     {
         self.SetBuffDoubleParam(buffInfo, leftTickTime - effectTickTime, key_ticlLeftTime_BuffInfo);
         self.LogInfo("TickBuffState:buffObj[{0}] buff:[{1}] Tick Effect".F(self.GetID(), self.GetBuffID(buffInfo)));
         ret = LogicStateTickRet.OnEffect;
     }
     else if (self.GetBuffStateTime(buffInfo) <= 0)
     {
         ret = LogicStateTickRet.NextState;
         self.LogInfo("TickBuffState:buffObj[{0}] buff:[{1}] Tick Finish".F(self.GetID(), self.GetBuffID(buffInfo)));
     }
     else
     {
         ret = LogicStateTickRet.None;
     }
     return ret;
 }
 public override LogicStateTickRet Tick(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     LogicStateTickRet ret = base.Tick(self, buffInfo, buffConfig);
     if (ret == LogicStateTickRet.TimeFinish)
     {
         return ret;
     }
     self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) - self.GetDeltaTime());
     //help harm 判断是否停留
     int harmHelpType = self.GetBuffStateIntParam(buffConfig, Key_Int__BuffConfig, self.GetBuffStateIndex(buffInfo));
     bool needNextState = false;
     switch(harmHelpType)
     {
         case 1:
             //这个是友好,没错
             needNextState = self.GetCamp() != self.GetSrcCamp(buffInfo);
             break;
         case 2:
             //这个是友好,没错敌对
             needNextState = self.GetCamp() == self.GetSrcCamp(buffInfo);
             break;
     }
     if (self.GetBuffStateTime(buffInfo) <= 0 || needNextState)
     {
         ret = LogicStateTickRet.NextState;
         self.LogInfo("ChargeState:buffObj[{0}] buff:[{1}] ShowEffectState Finish".F(self.GetID(), self.GetBuffID(buffInfo)));
     }
     return ret;
 }
Пример #5
0
        public override void InitState(SkillObj self, BuffInfo_New biffInfo, BuffConfig_New buffConfig, double fixTime)
        {
            int index = self.GetBuffStateIndex(biffInfo);
            var time  = self.GetBuffStateTime(buffConfig, index) + fixTime;

            self.SetBuffStateTime(biffInfo, time);
            self.SetBuffStateDoubleParam(biffInfo, key_ticlLeftTime_BuffInfo, time);
        }
Пример #6
0
 public override bool IsActionLimited(SkillObj self, ActionLimitType limit, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     int iLimit = -1;
     switch (limit)
     {
         case ActionLimitType.Attack:
             iLimit = self.GetBuffStateIntParam(buffConfig, key_AttackLimit_SkillConfig, self.GetBuffStateIndex(buffInfo));
             break;
         case ActionLimitType.Move:
             iLimit = self.GetBuffStateIntParam(buffConfig, key_MoveLimit_SkillConfig, self.GetBuffStateIndex(buffInfo));
             break;
         case ActionLimitType.UseSkill:
             iLimit = self.GetBuffStateIntParam(buffConfig, key_UseSkillLimit_SkillConfig, self.GetBuffStateIndex(buffInfo));
             break;
         default:
             Debug.Assert(false, "limit == default IsActionLimited:[{0}]".F(limit));
             break;
     }
     if (iLimit == 1)
     {
         return true;
     }
     return false;
 }
Пример #7
0
        public override LogicStateTickRet Tick(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
        {
            LogicStateTickRet ret = base.Tick(self, buffInfo, buffConfig);

            if (ret == LogicStateTickRet.TimeFinish)
            {
                return(ret);
            }
            double effectTickTime = self.GetBuffStateDoubleParam(buffConfig, key_EffectTickTime, self.GetBuffStateIndex(buffInfo));

            if (effectTickTime < 0)
            {
                self.LogInfo("TickBuffState:buffObj[{0}] buff:[{1}] Tick Effect effectTickTime< 0".F(self.GetID(), self.GetBuffID(buffInfo)));
                return(LogicStateTickRet.TimeFinish);
            }
            self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) - self.GetDeltaTime());
            var leftTickTime = self.GetBuffStateDoubleParam(buffInfo, key_ticlLeftTime_BuffInfo);

            if (leftTickTime - self.GetBuffStateTime(buffInfo) >= effectTickTime)
            {
                self.SetBuffStateDoubleParam(buffInfo, key_ticlLeftTime_BuffInfo, leftTickTime - effectTickTime);
                self.LogInfo("TickBuffState:buffObj[{0}] buff:[{1}] Tick Effect".F(self.GetID(), self.GetBuffID(buffInfo)));
                ret = LogicStateTickRet.OnEffect;
            }
            else if (self.GetBuffStateTime(buffInfo) <= 0)
            {
                ret = LogicStateTickRet.NextState;
                self.LogInfo("TickBuffState:buffObj[{0}] buff:[{1}] Tick Finish".F(self.GetID(), self.GetBuffID(buffInfo)));
            }
            else
            {
                ret = LogicStateTickRet.None;
            }
            return(ret);
        }
Пример #8
0
        public override LogicStateTickRet Tick(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
        {
            LogicStateTickRet ret = base.Tick(self, buffInfo, buffConfig);

            if (ret == LogicStateTickRet.TimeFinish)
            {
                return(ret);
            }
            self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) - self.GetDeltaTime());
            //help harm 判断是否停留
            int  harmHelpType  = self.GetBuffStateIntParam(buffConfig, Key_Int__BuffConfig, self.GetBuffStateIndex(buffInfo));
            bool needNextState = false;

            switch (harmHelpType)
            {
            case 1:
                //这个是友好,没错
                needNextState = self.GetCamp() != self.GetSrcCamp(buffInfo);
                break;

            case 2:
                //这个是友好,没错敌对
                needNextState = self.GetCamp() == self.GetSrcCamp(buffInfo);
                break;
            }
            if (self.GetBuffStateTime(buffInfo) <= 0 || needNextState)
            {
                ret = LogicStateTickRet.NextState;
                self.LogInfo("ChargeState:buffObj[{0}] buff:[{1}] ShowEffectState Finish".F(self.GetID(), self.GetBuffID(buffInfo)));
            }
            return(ret);
        }
Пример #9
0
        public override bool IsActionLimited(SkillObj self, ActionLimitType limit, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
        {
            int iLimit = -1;

            switch (limit)
            {
            case ActionLimitType.Attack:
                iLimit = self.GetBuffStateIntParam(buffConfig, key_AttackLimit_SkillConfig, self.GetBuffStateIndex(buffInfo));
                break;

            case ActionLimitType.Move:
                iLimit = self.GetBuffStateIntParam(buffConfig, key_MoveLimit_SkillConfig, self.GetBuffStateIndex(buffInfo));
                break;

            case ActionLimitType.UseSkill:
                iLimit = self.GetBuffStateIntParam(buffConfig, key_UseSkillLimit_SkillConfig, self.GetBuffStateIndex(buffInfo));
                break;

            default:
                Debug.Assert(false, "limit == default IsActionLimited:[{0}]".F(limit));
                break;
            }
            if (iLimit == 1)
            {
                return(true);
            }
            return(false);
        }
Пример #10
0
 public override void InitState(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig, double fixTime)
 {
     int index = self.GetBuffStateIndex(buffInfo);
     var time = self.GetBuffStateTime(buffConfig, index);
     self.SetBuffStateTime(buffInfo, time + fixTime);
 }
Пример #11
0
        public virtual void Tick(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
        {
            if (!CommonCheck(self, buffInfo, buffConfig))
            {
                return;
            }
            var logicState = BattleModule.GetBuffLogicState(buffInfo, self);

            if (logicState == null)
            {
                return;
            }
            var ret = logicState.Tick(self, buffInfo, buffConfig);

            switch (ret)
            {
            case LogicStateTickRet.TimeFinish:
                BuffOnEnd(self, buffInfo, buffConfig);
                break;

            case LogicStateTickRet.NextState:
                int    index         = self.GetBuffStateIndex(buffInfo);
                string nextStateName = self.GetLogicState(buffConfig, ++index);
                if (nextStateName == null || nextStateName.Equals(""))
                {
                    BuffOnEnd(self, buffInfo, buffConfig);
                    return;
                }
                var nextLogicState = BattleModule.GetBuffLogicState(nextStateName);
                if (nextLogicState == null)
                {
                    self.LogInfo("startLogicState {0} not found".F(nextStateName));
                    return;
                }
                double fixTime = logicState.OnStateChanged(nextStateName, self, buffInfo, buffConfig);
                self.SetBuffStateIndex(buffInfo, index);
                nextLogicState.InitState(self, buffInfo, buffConfig, fixTime);
                self.NotifyBuffInfo(buffInfo, BattleInfoNotifyType.ChangeState_Buff, BattleNotifyTime.TickEnd);
                break;

            case LogicStateTickRet.OnEffect:
                //var srcObj = self.GetBuffSrcObj(buffInfo);
            {
                var targetSelectName = self.GetTargetSelect(buffConfig);
                var targetSelect     = BattleModule.GetTargetSelect(targetSelectName);
                if (targetSelect == null)
                {
                    self.LogInfo("targetSelect == null buffId:[{0}] targetSelectName:[{1}]".F(self.GetBuffID(buffInfo), targetSelectName));
                    return;
                }
                var targetTypeName = self.GetTargetType(buffConfig);
                var targetType     = BattleModule.GetTargetType(targetTypeName);
                if (targetType == null)
                {
                    self.LogInfo("targetSelect == null buffId:[{0}] targetType:[{1}]".F(self.GetBuffID(buffInfo), targetTypeName));
                    return;
                }
                var targets = BattleModule.GetTargets(self, targetSelect, targetType, buffInfo, buffConfig);
                foreach (var tar in targets)
                {
                    OnEffect(self, tar, buffInfo, buffConfig);
                }
            }
            break;
            }
        }