Beispiel #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);
        }
 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;
 }
Beispiel #3
0
 public override bool IsTarget(SkillObj srcObj, SkillObj tarObj)
 {
     var srcCamp = srcObj.GetCamp();
     var tarCamp = tarObj.GetCamp();
     if (IsEnemy(srcCamp, tarCamp) || srcObj == tarObj)
     {
         return true;
     }
     return false;
 }
Beispiel #4
0
        public override bool IsTarget(SkillObj srcObj, SkillObj tarObj)
        {
            var srcCamp = srcObj.GetCamp();
            var tarCamp = tarObj.GetCamp();

            if (IsEnemy(srcCamp, tarCamp))
            {
                return(true);
            }
            return(false);
        }
        public override void OnEffect(SkillObj self, SkillObj tarObj, BuffInfo_New buffInfo, BuffConfig_New buffConfig)
        {
            int damageValue = self.GetBuffIntParam(buffConfig, Key_DamageValue_SkillConfig);

            if (damageValue > 0 && self.GetSrcCamp(buffInfo) >= 0)
            {
                if (tarObj.GetCamp() == self.GetSrcCamp(buffInfo))
                {
                    Damage heal = BattleModule.CreateDamage(-damageValue, self.GetSrcID(buffInfo));
                    BattleModule.DamageTarget(tarObj, self, heal);
                }
                else
                {
                    Damage damage = BattleModule.CreateDamage(damageValue, self.GetSrcID(buffInfo));
                    BattleModule.DamageTarget(tarObj, self, damage);
                }
            }
        }
 //private const int Key_Double_BuffBegin_SkillConfig = 0;
 public override bool OnEffect(SkillObj self, SkillObj target, SkillInfo_New skillInfo, SkillConfig_New skillConfig)
 {
     if(self.GetCamp()!=target.GetCamp())
     {
         int iDamamge = self.GetSkillIntParam(skillConfig, Key_Damege_SkillConfig);
         Damage damage = BattleModule.CreateDamage(iDamamge);
         BattleModule.DamageTarget(target, self, damage);
         var buffIds = self.GetSkillIntParams(skillConfig).Skip(Key_Damege_SkillConfig + 1);
         foreach (var buffId in buffIds)
         {
             BattleModule.AddBuff(target, self, buffId, BattleReason.Skill);
         }
     }
     else
     {
         var buffIds = self.GetSkillDoubleParams(skillConfig).Select(d=>(int)d);
         foreach (var buffId in buffIds)
         {
             BattleModule.AddBuff(target, self, buffId, BattleReason.Skill);
         }
     }
     return true;
 }
Beispiel #7
0
 //private const int Key_Double_BuffBegin_SkillConfig = 0;
 public override bool OnEffect(SkillObj self, SkillObj target, SkillInfo_New skillInfo, SkillConfig_New skillConfig)
 {
     if (self.GetCamp() != target.GetCamp())
     {
         int    iDamamge = self.GetSkillIntParam(skillConfig, Key_Damege_SkillConfig);
         Damage damage   = BattleModule.CreateDamage(iDamamge);
         BattleModule.DamageTarget(target, self, damage);
         var buffIds = self.GetSkillIntParams(skillConfig).Skip(Key_Damege_SkillConfig + 1);
         foreach (var buffId in buffIds)
         {
             BattleModule.AddBuff(target, self, buffId, BattleReason.Skill);
         }
     }
     else
     {
         var buffIds = self.GetSkillDoubleParams(skillConfig).Select(d => (int)d);
         foreach (var buffId in buffIds)
         {
             BattleModule.AddBuff(target, self, buffId, BattleReason.Skill);
         }
     }
     return(true);
 }