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);
        }
Example #2
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);
        }
Example #3
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);
        }