Exemple #1
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);
        }
Exemple #2
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;
 }
Exemple #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.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);
        }
 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;
 }
 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());
     if (self.GetBuffStateTime(buffInfo) <= 0)
     {
         ret = LogicStateTickRet.NextState;
         self.LogInfo("ChargeState:buffObj[{0}] buff:[{1}] ShowEffectState Finish".F(self.GetID(), self.GetBuffID(buffInfo)));
     }
     return ret;
 }
Exemple #6
0
        override public BuffSuperpositionRet OnBuffSuperposition(SkillObj tarObj, SkillObj srcObj, BattleReason reason, BuffConfig_New buffConfig)
        {
            BuffSuperpositionRet ret;

            ret.bType = BuffSuperpositionType.None;
            ret.buff  = null;
            var tarBuff = tarObj.GetBuffList().Where(b => tarObj.GetBuffID(b) == tarObj.GetBuffID(buffConfig));

            if (tarBuff != null && tarBuff.FirstOrDefault() != null)
            {
                ret.bType = BuffSuperpositionType.AddStateTime;
                var buff = tarBuff.First();
                ret.buff = buff;
                double addTime = tarObj.GetBuffSuperpositionDoubleParam(buffConfig, Key_AddTime_SkillConfig);
                tarObj.SetBuffTime(buff, tarObj.GetBuffTime(buff) + addTime);
                tarObj.SetBuffStateTime(buff, tarObj.GetBuffStateTime(buff) + addTime);
                tarObj.NotifyBuffInfo(buff, BattleInfoNotifyType.Time_Buff, BattleNotifyTime.TickEnd);
            }
            else
            {
                ret.bType = BuffSuperpositionType.Add;
                ret.buff  = new BuffInfo_New();
            }
            return(ret);
        }
		public override void Tick(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
		{
			Dictionary<int, int> keyValues = new Dictionary<int, int>();
			foreach(var buff in self.GetBuffIntParams(buffConfig).Skip(Key_Int_SummonId_BuffConfig+1))
			{
				keyValues.Add(buff, buff);
			}
			bool bAddTime = false;
			foreach (var buff in self.GetBuffList(true))
			{
				int buffId = self.GetBuffID(buff);
				if(keyValues.ContainsKey(buffId))
				{
					bAddTime = true;
					break;
				}
			}
			if (bAddTime)
			{
				self.SetBuffTime(buffInfo, self.GetBuffTime(buffInfo) + self.GetDeltaTime());
				self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) + self.GetDeltaTime());
				self.NotifyBuffInfo(buffInfo, BattleInfoNotifyType.Time_Buff, BattleNotifyTime.TickEnd);
			}
			base.Tick(self, buffInfo, buffConfig);

		}
        public override void Tick(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
        {
            Dictionary <int, int> keyValues = new Dictionary <int, int>();

            foreach (var buff in self.GetBuffIntParams(buffConfig).Skip(Key_Int_SummonId_BuffConfig + 1))
            {
                keyValues.Add(buff, buff);
            }
            bool bAddTime = false;

            foreach (var buff in self.GetBuffList(true))
            {
                int buffId = self.GetBuffID(buff);
                if (keyValues.ContainsKey(buffId))
                {
                    bAddTime = true;
                    break;
                }
            }
            if (bAddTime)
            {
                self.SetBuffTime(buffInfo, self.GetBuffTime(buffInfo) + self.GetDeltaTime());
                self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) + self.GetDeltaTime());
                self.NotifyBuffInfo(buffInfo, BattleInfoNotifyType.Time_Buff, BattleNotifyTime.TickEnd);
            }
            base.Tick(self, buffInfo, buffConfig);
        }
        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());
            if (self.GetBuffStateTime(buffInfo) <= 0)
            {
                ret = LogicStateTickRet.NextState;
                self.LogInfo("ChargeState:buffObj[{0}] buff:[{1}] ShowEffectState Finish".F(self.GetID(), self.GetBuffID(buffInfo)));
            }
            return(ret);
        }
Exemple #10
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);
 }
        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);
        }
Exemple #12
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);
        }
 public override void OnDamageTarget(SkillObj self, SkillObj target, Damage damage, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     if (damage.value > 0 && self != target)
     {
         double addTime = self.GetBuffDoubleParam(buffConfig, Key_Double_AddTime_BuffConfig);
         self.SetBuffTime(buffInfo, self.GetBuffTime(buffInfo) + addTime);
         self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) + addTime);
         self.NotifyBuffInfo(buffInfo, BattleInfoNotifyType.Time_Buff, BattleNotifyTime.TickEnd);
     }
 }
		public override void OnDamageTarget(SkillObj self, SkillObj target, Damage damage, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
		{
			if(damage.value > 0 && self != target)
			{
				double addTime = self.GetBuffDoubleParam(buffConfig, Key_Double_AddTime_BuffConfig);
				self.SetBuffTime(buffInfo, self.GetBuffTime(buffInfo) + addTime);
				self.SetBuffStateTime(buffInfo, self.GetBuffStateTime(buffInfo) + addTime);
				self.NotifyBuffInfo(buffInfo, BattleInfoNotifyType.Time_Buff, BattleNotifyTime.TickEnd);
			}
		}
 public override BuffSuperpositionRet OnBuffSuperposition(SkillObj tarObj, SkillObj srcObj, BattleReason reason, BuffConfig_New buffConfig)
 {
     BuffSuperpositionRet ret;
     ret.bType = BuffSuperpositionType.None;
     ret.buff = null;
     var tarBuff = tarObj.GetBuffList().Where(b => tarObj.GetBuffID(b) == tarObj.GetBuffID(buffConfig));
     if (tarBuff != null && tarBuff.FirstOrDefault() != null)
     {
         ret.bType = BuffSuperpositionType.AddStateTime;
         var buff = tarBuff.First();
         double addTime = tarObj.GetBuffSuperpositionDoubleParam(buffConfig, Key_AddTime_SkillConfig);
         tarObj.SetBuffTime(buff, tarObj.GetBuffTime(buff) + addTime);
         tarObj.SetBuffStateTime(buff, tarObj.GetBuffStateTime(buff) + addTime);
         tarObj.NotifyBuffInfo(buff, BattleInfoNotifyType.Time_Buff, BattleNotifyTime.TickEnd);
     }
     else
     {
         ret.bType = BuffSuperpositionType.Add;
         ret.buff = new BuffInfo_New();
     }
     return ret;
 }
Exemple #16
0
 public override void OnEffect(SkillObj self, SkillObj tarObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     int key = Key_Double_AddTime1_BuffConfig;
     if (self.GetSrcID(buffInfo) == tarObj.GetID() || self.GetSrcParentID(buffInfo) == tarObj.GetID())
     {
         key = Key_Double_AddTime1_BuffConfig;
     }
     else
     {
         key = Key_Double_AddTime2_BuffConfig;
     }
     foreach (var buff in self.GetBuffList(true))
     {
         int buffId = self.GetBuffID(buff);
         if (buffId > 0 && buffId == self.GetBuffIntParam(buffConfig, Key_Int_BuffId_BuffConfig))
         {
             double addTime = self.GetBuffDoubleParam(buffConfig, key);
             self.SetBuffTime(buff, self.GetBuffTime(buff) + addTime);
             self.SetBuffStateTime(buff, self.GetBuffStateTime(buff) + addTime);
             self.NotifyBuffInfo(buff, BattleInfoNotifyType.Time_Buff, BattleNotifyTime.TickEnd);
         }
     }
 }
Exemple #17
0
        public override void OnEffect(SkillObj self, SkillObj tarObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
        {
            int key = Key_Double_AddTime1_BuffConfig;

            if (self.GetSrcID(buffInfo) == tarObj.GetID() || self.GetSrcParentID(buffInfo) == tarObj.GetID())
            {
                key = Key_Double_AddTime1_BuffConfig;
            }
            else
            {
                key = Key_Double_AddTime2_BuffConfig;
            }
            foreach (var buff in self.GetBuffList(true))
            {
                int buffId = self.GetBuffID(buff);
                if (buffId > 0 && buffId == self.GetBuffIntParam(buffConfig, Key_Int_BuffId_BuffConfig))
                {
                    double addTime = self.GetBuffDoubleParam(buffConfig, key);
                    self.SetBuffTime(buff, self.GetBuffTime(buff) + addTime);
                    self.SetBuffStateTime(buff, self.GetBuffStateTime(buff) + addTime);
                    self.NotifyBuffInfo(buff, BattleInfoNotifyType.Time_Buff, BattleNotifyTime.TickEnd);
                }
            }
        }
Exemple #18
0
 public override double OnStateChanged(string tarState, SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     return(self.GetBuffStateTime(buffInfo));
 }
 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);
 }