Пример #1
0
		public override void OnDie(SkillObj self, SkillObj attacker, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
		{
			return;
			if (self.GetBuffIntParam(buffInfo, Key_Int_Bombed_BuffInfo) != Key_Int_Bombed_Value)
			{
				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.Where(t => !t.IsDead()))
				{
					OnEffect(self, tar, buffInfo, buffConfig);
				}
			}
		}
Пример #2
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 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;
 }
Пример #4
0
		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);

		}
Пример #5
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;
 }
Пример #6
0
 public override void OnDamageTarget(SkillObj self, SkillObj target, Damage damage, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     var buffIds = self.GetBuffIntParams(buffConfig).Skip(Key_Int_SummonObjBuffId_BuffConfig+1);
     foreach (var buffId in buffIds.Where(b=>b>0))
     {
         BattleModule.AddBuff(target, self, buffId, BattleReason.Buff);
     }
     return ;
 }
Пример #7
0
 // 		private const int key_BuffId1_SkillConfig = 0;
 // 		private const int key_BuffId2_SkillConfig = 1;
 // 		private const int key_BuffId3_SkillConfig = 2;
 public override void OnEffect(SkillObj self, SkillObj tarObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     var buffIds = self.GetBuffIntParams(buffConfig);
     foreach(var buffId in buffIds)
     {
         BattleModule.AddBuff(tarObj, self, buffId, BattleReason.Skill);
     }
     return ;
 }
Пример #8
0
 public override void OnEffect(SkillObj self, SkillObj tarObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     int healValue = self.GetBuffIntParam(buffConfig, HealValueKey);
     if (healValue > 0)
     {
         Damage heal = BattleModule.CreateDamage(-healValue);
         BattleModule.DamageTarget(tarObj, self, heal);
     }
 }
Пример #9
0
		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);
			}
		}
Пример #10
0
 public override bool InitBuffInfo(SkillObj self, SkillObj srcObj, BattleReason reason, BuffInfo_New buffInfo, BuffConfig_New buffConfig, bool RefreshGUID = true)
 {
     base.InitBuffInfo(self, srcObj, reason, buffInfo, buffConfig, RefreshGUID);
     int absorbDamage = self.GetBuffIntParam(buffConfig, AbsorbDamageKey);
     if(absorbDamage > 0)
     {
         self.SetBuffIntParam(buffInfo, AbsorbDamageKey, absorbDamage);
     }
     return true;
 }
Пример #11
0
 public override void OnSummon(int id, SkillObj self, SkillObj summonObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     if(summonObj != null)
     {
         var summonId = self.GetBuffIntParam(buffConfig, Key_Int_AddBuffSummonObjId_BuffConfig);
         var buffId = self.GetBuffIntParam(buffConfig, Key_Int_SummonObjBuffId_BuffConfig);
         if(summonId == id)
         {
             BattleModule.AddBuff(summonObj, self, buffId, BattleReason.Buff);
         }
     }
 }
Пример #12
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());
     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;
 }
Пример #13
0
 public override Damage BeHurtDamageFix(SkillObj self, SkillObj source, Damage damage, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     int shield = self.GetBuffIntParam(buffInfo, AbsorbDamageKey);
     if(shield > damage.value)
     {
         shield -= damage.value;
         damage.value = 0;
     }
     else
     {
         damage.value -= shield;
         shield = 0;
         BuffOnEnd(self, buffInfo, buffConfig);
     }
     return damage;
 }
Пример #14
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;
     }
     if (self.GetBuffStateIntParam(buffInfo, key) == NotEffect)
     {
         self.SetBuffStateIntParam(buffInfo, key, Effected);
         return LogicStateTickRet.OnEffect;
     }
     else
     {
         return LogicStateTickRet.NextState;
     }
     return ret;
 }
Пример #15
0
		public override void OnEffect(SkillObj self, SkillObj tarObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
		{
			int damageValue = 999999999;
			int damageByMyHP = self.GetBuffIntParam(buffInfo, Key_Int_DamageByMyHP_BuffInfo);
			int damageTarPerByMyHP = self.GetBuffIntParam(buffConfig, Key_Int_DamageTarPerByMyHP_BuffConfig); 
			if (self == tarObj)
			{
				if (damageByMyHP <= 0)
				{
					damageByMyHP = self.GetHP()* damageTarPerByMyHP /10000;
					self.SetBuffIntParam(buffInfo, Key_Int_DamageByMyHP_BuffInfo, damageByMyHP);
				}
				if (damageValue > 0)
				{
					Damage damage = BattleModule.CreateDamage(damageValue, bNeedCalc : false);
					BattleModule.DamageTarget(tarObj, self, damage);
				}

				int summonId = self.GetBuffIntParam(buffConfig, Key_Int_SummonId_BuffConfig);
				if(summonId > 0)
				{
					var summonTar = BattleModule.Summon(summonId, self, self, null, null);
				}
			}
			else
			{
				if (damageByMyHP <= 0)
				{
					damageByMyHP = self.GetHP() * damageTarPerByMyHP / 10000;
					self.SetBuffIntParam(buffInfo, Key_Int_DamageByMyHP_BuffInfo, damageByMyHP);
					if(damageByMyHP < 0 )
					{
						damageByMyHP = 0;
					}
				}
				damageValue = self.GetBuffIntParam(buffConfig, Key_Int_DamageTarPer_BuffConfig) * tarObj.GetMaxHP()/10000 + damageByMyHP;
				if (damageValue > 0)
				{
					Damage damage = BattleModule.CreateDamage(damageValue, bNeedCalc: false);
					BattleModule.DamageTarget(tarObj, self, damage);
				}
			}
			self.SetBuffIntParam(buffInfo, Key_Int_Bombed_BuffInfo, Key_Int_Bombed_Value);
		}
Пример #16
0
        //public override double OnDataFix(SkillObj self, PropertyType pType, double pValue, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
        public override void OnAttach(SkillObj self, SkillObj srcObj, BuffInfo_New buff, BuffConfig_New buffConfig)
        {
            if (self is Object.Tank)
            {
                Object.Tank tank = self as Object.Tank;
                //double pValue = tank.Spd2011;
                int GChangeType = self.GetBuffIntParam(buffConfig, Key_Int_GChangeType_BuffConfig);
                int FChangeType = self.GetBuffIntParam(buffConfig, Key_Int_FChangeType_BuffConfig);
                int bGFChanged = self.GetBuffIntParam(buff, Key_Int_GFChanged_BuffInfo);
                if (bGFChanged == 0)
                {
                    self.SetBuffIntParam(buff, Key_Int_GFChanged_BuffInfo, 1);
                    switch (GChangeType)
                    {
                        case 1:
                            tank.AttAdd1004 += (float)self.GetBuffDoubleParam(buffConfig, Key_Double_GChange_BuffConfig);
                            break;
                        case 2:
                            if (1 + (float)self.GetBuffDoubleParam(buffConfig, Key_Double_GChange_BuffConfig) != 0)
                            {
                                tank.AttMult1003 += (float)self.GetBuffDoubleParam(buffConfig, Key_Double_GChange_BuffConfig);
                            }
                            break;
                    }
                    switch (FChangeType)
                    {
                        case 1:
                            tank.DefAdd1009 += (float)self.GetBuffDoubleParam(buffConfig, Key_Double_FChange_BuffConfig);
                            break;
                        case 2:
                            if (1 + (float)self.GetBuffDoubleParam(buffConfig, Key_Double_FChange_BuffConfig) != 0)
                            {
                                tank.DefMult1008 += (float)self.GetBuffDoubleParam(buffConfig, Key_Double_FChange_BuffConfig);
                            }
                            break;
                    }
                }

            }
            return ;
        }
Пример #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);
         }
     }
 }
Пример #18
0
 public override void OnEffect(SkillObj self, SkillObj tarObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     int damageType = self.GetBuffIntParam(buffConfig, Key_Int_DamageType_SkillConfig);
     double damageValue = self.GetBuffDoubleParam(buffConfig, Key_Double_DamageValue_SkillConfig);
     switch (damageType)
     {
         case 1:
             if (damageValue > 0)
             {
                 Damage damage = BattleModule.CreateDamage((int)damageValue, self.GetSrcID(buffInfo), eReason: BattleReason.Buff);
                 BattleModule.DamageTarget(tarObj, self, damage);
             }
             break;
         case 2:
             if (damageValue > 0)
             {
                 Damage damage = BattleModule.CreateDamage((int)damageValue * tarObj.GetMaxHP() / 10000, self.GetSrcID(buffInfo), eReason: BattleReason.Buff);
                 BattleModule.DamageTarget(tarObj, self, damage);
             }
             break;
     }
     // 			Damage damage = BattleModule.CreateDamage((int)damageType, self.GetSrcID(buffInfo), eReason: BattleReason.Buff);
     // 			BattleModule.DamageTarget(tarObj, self, damage);
 }
Пример #19
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;
 }
Пример #20
0
 private static BuffLogic GetBuffLogic(BuffInfo_New buffInfo, SkillObj logObj)
 {
     int buffId = logObj.GetBuffID(buffInfo);
     BuffConfig_New buffConfig = logObj.GetBuffConfig(buffId);
     if (buffConfig == null)
     {
         logObj.LogInfo("BuffConfig not found buffId[{0}]".F(buffId));
         return null;
     }
     string buffLogicId = logObj.GetBuffLogicId(buffConfig);
     if (!BuffLogics.ContainsKey(buffLogicId))
     {
         logObj.LogInfo("BuffLogic not found buffId[{0}] buffLogicId[{1}]".F(buffId, buffLogicId));
         return null;
     }
     BuffLogic buffLogic = BuffLogics[buffLogicId];
     return buffLogic;
 }
Пример #21
0
 public override IEnumerable<SkillObj> GetTargets(SkillObj skillObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     double width = skillObj.GetTargetSelectDoubleParam(buffConfig, key_Width);
     double height = skillObj.GetTargetSelectDoubleParam(buffConfig, key_Height);
     return GetTargets(skillObj, width, height);
 }
Пример #22
0
 public override IEnumerable<SkillObj> GetTargets(SkillObj skillObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     double range = skillObj.GetTargetSelectDoubleParam(buffConfig, key_Range);
     return GetTargets(skillObj, range);
 }
Пример #23
0
 public virtual IEnumerable<SkillObj> GetTargets(SkillObj skillObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     return null;
 }
Пример #24
0
 public virtual void Init(SkillObj skillObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     return;
 }
Пример #25
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);
 }
Пример #26
0
 public static BuffLogicState GetBuffLogicState(BuffInfo_New buffInfo, SkillObj logObj)
 {
     string stateName = logObj.GetBuffLogicStateName(buffInfo);
     BuffLogicState state = GetBuffLogicState(stateName);
     if (state == null && logObj != null)
     {
         logObj.LogInfo("BuffLogicState not found stateName[{0}]".F(stateName));
     }
     return state;
 }
Пример #27
0
 public static IEnumerable<SkillObj> GetTargets(SkillObj skillObj, TargetSelect select, TargetType tType, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
 {
     if (select == null || tType == null)
     {
         return null;
     }
     var ret = select.GetTargets(skillObj, buffInfo, buffConfig).Where(t => tType.IsTarget(skillObj, t));
     return ret;
 }
Пример #28
0
        public static void DetachBuff(SkillObj tarObj, SkillObj srcObj, BuffInfo_New buff, BuffConfig_New buffConfig)
        {
            var buffLogicId = tarObj.GetBuffLogicId(buffConfig);
            if (!BuffLogics.ContainsKey(buffLogicId))
            {
                return ;
            }
            BuffLogic buffLogic = BuffLogics[buffLogicId];

            //先从src方进行修正
            if (srcObj != null)
            {
                var srcSkillList = srcObj.GetSkillList();
                var srcBuffList = srcObj.GetBuffList();
                if (srcSkillList != null)
                {
                    foreach (var skillInfo in srcSkillList)
                    {
                        int skillId = srcObj.GetSkillID(skillInfo);
                        SkillConfig_New skillConfig = srcObj.GetSkillConfig(skillId);
                        var logic = GetSkillLogic(skillInfo, srcObj);
                        logic.OnClearBuff(tarObj, srcObj, buff, skillInfo, skillConfig);
                    }
                }
                if (srcBuffList != null)
                {
                    foreach (var buffInfo in srcBuffList)
                    {
                        int buffId = srcObj.GetBuffID(buffInfo);
                        BuffConfig_New srcBuffConfig = srcObj.GetBuffConfig(buffId);
                        var logic = GetBuffLogic(buffInfo, srcObj);
                        logic.OnClearBuff(tarObj, srcObj, buff, buffInfo, srcBuffConfig);
                    }
                }
            }
            {
                var tarSkillList = tarObj.GetSkillList();
                var tarBuffList = tarObj.GetBuffList();
                if (tarSkillList != null)
                {
                    foreach (var skillInfo in tarSkillList)
                    {
                        int skillId = tarObj.GetSkillID(skillInfo);
                        SkillConfig_New skillConfig = tarObj.GetSkillConfig(skillId);
                        var logic = GetSkillLogic(skillInfo, tarObj);
                        logic.OnDetachBuff(tarObj, srcObj, buff, skillInfo, skillConfig);
                    }
                }
                if (tarBuffList != null)
                {
                    foreach (var buffInfo in tarBuffList.Where(b=>b.buff!=buff.buff))
                    {
                        int buffId = tarObj.GetBuffID(buffInfo);
                        BuffConfig_New tarBuffConfig = tarObj.GetBuffConfig(buffId);
                        var logic = GetBuffLogic(buffInfo, tarObj);
                        logic.OnDetachBuff(tarObj, srcObj, buff, buffInfo, tarBuffConfig);
                    }
                }
            }
            buffLogic.BuffOnEnd(tarObj, buff, buffConfig);
            buffLogic.OnDetach(tarObj, srcObj, buff, buffConfig);
        }
Пример #29
0
 public override void InitState(SkillObj self, BuffInfo_New buffInfo, BuffConfig_New buffConfig, double fixTime)
 {
     self.SetBuffStateIntParam(buffInfo, key, NotEffect);
 }