Exemplo n.º 1
0
 public override bool OnEffect(SkillObj self, SkillObj target, SkillInfo_New skillInfo, SkillConfig_New skillConfig)
 {
     int iDamamge = self.GetSkillIntParam(skillConfig, DamegeKey);
     Damage damage = BattleModule.CreateDamage(iDamamge);
     BattleModule.DamageTarget(target, self, damage);
     return true;
 }
Exemplo n.º 2
0
        public override bool OnEffect(SkillObj self, SkillObj target, SkillInfo_New skillInfo, SkillConfig_New skillConfig)
        {
            int    iDamamge = self.GetSkillIntParam(skillConfig, DamegeKey);
            Damage damage   = BattleModule.CreateDamage(iDamamge);

            BattleModule.DamageTarget(target, self, damage);
            return(true);
        }
Exemplo n.º 3
0
        // 		private const int key_BuffId3_SkillConfig = 2;
        public override bool OnEffect(SkillObj self, SkillObj target, SkillInfo_New skillInfo, SkillConfig_New skillConfig)
        {
            var buffId1 = self.GetSkillIntParam(skillConfig, key_BuffId1_SkillConfig);
            var buffId2 = self.GetSkillIntParam(skillConfig, key_BuffId2_SkillConfig);
            var tarBuff = target.GetBuffList().Where(b => target.GetBuffID(b) == buffId1);
            if (tarBuff != null && tarBuff.FirstOrDefault() != null)
            {
                BattleModule.AddBuff(target, self, buffId2, BattleReason.Skill);
                BattleModule.RemoveBuff(target, self, buffId1, BattleReason.Skill);
            }
            else
            {
                BattleModule.AddBuff(target, self, buffId1, BattleReason.Skill);
                BattleModule.RemoveBuff(target, self, buffId2, BattleReason.Skill);
            }

            return true;
        }
Exemplo n.º 4
0
        public override bool InitSkillInfo(SkillObj self, SkillInfo_New skillInfo, SkillConfig_New skillConfig)
        {
            bool ret = base.InitSkillInfo(self, skillInfo, skillConfig);

            var targetSelectName = "Range";
            var targetSelect     = BattleModule.GetTargetSelect(targetSelectName);

            if (targetSelect == null)
            {
                self.LogInfo("targetSelect == null skillId:[{0}] targetSelectName:[{1}]".F(self.GetSkillID(skillInfo), targetSelectName));
                Debug.Assert(false, "targetSelect == null skillId:[{0}] targetSelectName:[{1}]".F(self.GetSkillID(skillInfo), targetSelectName));
                return(false);
            }
            var targetTypeName = "Harm";
            var targetType     = BattleModule.GetTargetType(targetTypeName);

            if (targetType == null)
            {
                self.LogInfo("targetSelect == null skillId:[{0}] targetType:[{1}]".F(self.GetSkillID(skillInfo), targetTypeName));
                Debug.Assert(false, "targetSelect == null skillId:[{0}] targetType:[{1}]".F(self.GetSkillID(skillInfo), targetTypeName));
                return(false);
            }
            var targets = BattleModule.GetTargets(self, targetSelect, targetType, skillInfo, skillConfig).ToList();

            if (targets == null || targets.Count <= 0)
            {
                return(true);
            }
            int count     = self.GetSkillIntParam(skillConfig, key_SummonCount_SkillConfig);
            int realCount = 0;
            int index     = 0;

            foreach (var tar in targets)
            {
                if (index < count)
                {
                    self.SetSkillIntParam(skillInfo, key_SummonTraceTarget_SkillInfo + index++, tar.GetID());
                    realCount++;
                }
                else
                {
                    break;
                }
            }
            if (index < count)
            {
                var tank = targets.OrderBy(t => t.GetHP()).FirstOrDefault();
                for (int i = index; i < count; i++)
                {
                    self.SetSkillIntParam(skillInfo, key_SummonTraceTarget_SkillInfo + i, tank.GetID());
                    realCount++;
                }
            }
            self.SetSkillIntParam(skillInfo, key_SummonIdx_SkillInfo, 0);
            ret = true;
            return(ret);
        }
Exemplo n.º 5
0
        public override bool OnEffect(SkillObj self, SkillObj target, SkillInfo_New skillInfo, SkillConfig_New skillConfig)
        {
            int id    = self.GetSkillIntParam(skillConfig, key_SummonId_SkillConfig);
            int count = self.GetSkillIntParam(skillConfig, key_SummonCount_SkillConfig);
            int idx   = self.GetSkillIntParam(skillInfo, key_SummonIdx_SkillInfo);

            if (idx < count)
            {
                int tarId = self.GetSkillIntParam(skillInfo, key_SummonTraceTarget_SkillInfo + idx);
                var tar   = self.GetTargetById(tarId);
                if (tar != null)
                {
                    var summonTar = BattleModule.Summon(id, self, tar, skillInfo, skillConfig);
                }
                self.SetSkillIntParam(skillInfo, key_SummonIdx_SkillInfo, idx + 1);
            }

            return(true);
        }
Exemplo n.º 6
0
//      private const int key_BuffId3_SkillConfig = 2;
        public override bool OnEffect(SkillObj self, SkillObj target, SkillInfo_New skillInfo, SkillConfig_New skillConfig)
        {
            var buffId1 = self.GetSkillIntParam(skillConfig, key_BuffId1_SkillConfig);
            var buffId2 = self.GetSkillIntParam(skillConfig, key_BuffId2_SkillConfig);
            var tarBuff = target.GetBuffList().Where(b => target.GetBuffID(b) == buffId1);

            if (tarBuff != null && tarBuff.FirstOrDefault() != null)
            {
                BattleModule.AddBuff(target, self, buffId2, BattleReason.Skill);
                BattleModule.RemoveBuff(target, self, buffId1, BattleReason.Skill);
            }
            else
            {
                BattleModule.AddBuff(target, self, buffId1, BattleReason.Skill);
                BattleModule.RemoveBuff(target, self, buffId2, BattleReason.Skill);
            }

            return(true);
        }
Exemplo n.º 7
0
        public override bool InitSkillInfo(SkillObj self, SkillInfo_New skillInfo, SkillConfig_New skillConfig)
        {
            bool ret = base.InitSkillInfo(self, skillInfo, skillConfig);

            var targetSelectName = "Range";
            var targetSelect = BattleModule.GetTargetSelect(targetSelectName);
            if (targetSelect == null)
            {
                self.LogInfo("targetSelect == null skillId:[{0}] targetSelectName:[{1}]".F(self.GetSkillID(skillInfo), targetSelectName));
                Debug.Assert(false, "targetSelect == null skillId:[{0}] targetSelectName:[{1}]".F(self.GetSkillID(skillInfo), targetSelectName));
                return false;
            }
            var targetTypeName = "Harm";
            var targetType = BattleModule.GetTargetType(targetTypeName);
            if (targetType == null)
            {
                self.LogInfo("targetSelect == null skillId:[{0}] targetType:[{1}]".F(self.GetSkillID(skillInfo), targetTypeName));
                Debug.Assert(false, "targetSelect == null skillId:[{0}] targetType:[{1}]".F(self.GetSkillID(skillInfo), targetTypeName));
                return false;
            }
            var targets = BattleModule.GetTargets(self, targetSelect, targetType, skillInfo, skillConfig).ToList();
            if(targets == null || targets.Count <= 0)
            {
                return true;
            }
            int count = self.GetSkillIntParam(skillConfig, key_SummonCount_SkillConfig);
            int realCount = 0;
            int index = 0;
            foreach (var tar in targets)
            {
                if(index < count)
                {
                    self.SetSkillIntParam(skillInfo, key_SummonTraceTarget_SkillInfo + index++, tar.GetID());
                    realCount++;
                }
                else
                {
                    break;
                }
            }
            if(index < count)
            {
                var tank = targets.OrderBy(t => t.GetHP()).FirstOrDefault();
                for (int i = index; i < count; i++)
                {
                    self.SetSkillIntParam(skillInfo, key_SummonTraceTarget_SkillInfo + i, tank.GetID());
                    realCount++;
                }
            }
            self.SetSkillIntParam(skillInfo, key_SummonIdx_SkillInfo, 0);
            ret = true;
            return ret;
        }
Exemplo n.º 8
0
 public override bool OnEffect(SkillObj self, SkillObj target, SkillInfo_New skillInfo, SkillConfig_New skillConfig)
 {
     int id = self.GetSkillIntParam(skillConfig, key_SummonId);
     var summonTar = BattleModule.Summon(id, self, target, skillInfo, skillConfig);
     if(summonTar != null)
     {
         var buffIds = self.GetSkillIntParams(skillConfig);
         foreach (var buffId in buffIds.Skip(key_SummonId + 1))
         {
             BattleModule.AddBuff(summonTar, self, buffId, BattleReason.Skill);
         }
     }
     {
         //int iBuffId = self.GetSkillIntParam(skillConfig, key_BuffId);
         //if (iBuffId > 0)
         //{
         //	BattleModule.AddBuff(summonTar, self, iBuffId, BattleReason.Skill);
         //}
     }
     return true;
 }
Exemplo n.º 9
0
        public override bool OnEffect(SkillObj self, SkillObj target, SkillInfo_New skillInfo, SkillConfig_New skillConfig)
        {
            int id        = self.GetSkillIntParam(skillConfig, key_SummonId);
            var summonTar = BattleModule.Summon(id, self, target, skillInfo, skillConfig);

            if (summonTar != null)
            {
                var buffIds = self.GetSkillIntParams(skillConfig);
                foreach (var buffId in buffIds.Skip(key_SummonId + 1))
                {
                    BattleModule.AddBuff(summonTar, self, buffId, BattleReason.Skill);
                }
            }
            {
                //int iBuffId = self.GetSkillIntParam(skillConfig, key_BuffId);
                //if (iBuffId > 0)
                //{
                //	BattleModule.AddBuff(summonTar, self, iBuffId, BattleReason.Skill);
                //}
            }
            return(true);
        }
Exemplo n.º 10
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;
 }
Exemplo n.º 11
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);
 }
Exemplo n.º 12
0
        public override bool OnEffect(SkillObj self, SkillObj target, SkillInfo_New skillInfo, SkillConfig_New skillConfig)
        {
            int id = self.GetSkillIntParam(skillConfig, key_SummonId_SkillConfig);
            int count = self.GetSkillIntParam(skillConfig, key_SummonCount_SkillConfig);
            int idx = self.GetSkillIntParam(skillInfo, key_SummonIdx_SkillInfo);
            if(idx < count)
            {
                int tarId = self.GetSkillIntParam(skillInfo, key_SummonTraceTarget_SkillInfo + idx);
                var tar = self.GetTargetById(tarId);
                if(tar != null)
                {
                    var summonTar = BattleModule.Summon(id, self, tar, skillInfo, skillConfig);
                }
                self.SetSkillIntParam(skillInfo, key_SummonIdx_SkillInfo, idx + 1);
            }

            return true;
        }