예제 #1
0
        protected override bool AddBuff(ISkill srcSkill, ISkillPlayer caster, ISkillPlayer target, bool pureFlag, int last, int rate)
        {
            if (this.BlurCode == (int)EnumBlurBuffCode.Stun)
            {
                last = srcSkill.Context.GetBuffLast(srcSkill, caster, last, target);
            }
            if (!pureFlag)
            {
                if (BoostUtil.IfAntiDebuff(this, srcSkill, target, true, (int)EnumBoostRootType.AntiBlur, this.BlurCode))
                {
                    return(true);
                }
                BoostUtil.GetEaseRate(out rate, rate, target, (int)EnumBoostRootType.BlurRate, this.BlurCode);
                if (this.Last > 0)
                {
                    BoostUtil.GetEaseLast(out last, last, target, (int)EnumBoostRootType.BlurLast, this.BlurCode);
                    last = srcSkill.Context.GetBuffLast(srcSkill, caster, last);
                }
            }
            if (!BuffUtil.ExecRate(out rate, rate, srcSkill.Context, this.ExecType))
            {
                return(false);
            }
            if (rate <= 0)
            {
                return(true);
            }
            int buffId = this.BuffId[0];

            if (buffId == (int)EnumBlurType.BanMan)
            {
                target.DisableState = (int)this.BlurCode;
                target.RaiseBlurEvent(new BlurEventArgs(target.BlurSrcSkill, target, target, (EnumBlurType)buffId, (EnumBlurBuffCode)this.BlurCode));
            }
            else
            {
                if (buffId == (int)EnumBlurType.LockMotion)
                {
                    target.RemoveBuff(buffId, 0);
                }
                if (!target.AddBuff(InnerCreateBuff(srcSkill, target, (short)last, rate)))
                {
                    return(false);
                }
                if (this.BlurCode == (int)EnumBlurBuffCode.Rebel)
                {
                    ((IPlayer)target).AddSilenceBuff(last);
                }
                if (this.BlurCode == (int)EnumBlurBuffCode.Falldown)
                {
                    target.RaiseBlurEvent(new BlurEventArgs(target.BlurSrcSkill, target, target, (EnumBlurType)buffId, (EnumBlurBuffCode)this.BlurCode));
                }
            }
            this.AddTgtShowModel(srcSkill, target, last);
            return(true);
        }
예제 #2
0
        protected virtual bool AddBuff(ISkill srcSkill, ISkillPlayer caster, ISkillPlayer target, bool pureFlag, int last, int rate)
        {
            if (!pureFlag)
            {
                if (BoostUtil.IfAntiDebuff(this, srcSkill, target, true, (int)EnumBoostRootType.AntiBlur, this.BlurCode))
                {
                    return(true);
                }
                BoostUtil.GetEaseRate(out rate, rate, target, (int)EnumBoostRootType.BlurRate, this.BlurCode);
                if (this.Last > 0)
                {
                    BoostUtil.GetEaseLast(out last, last, target, (int)EnumBoostRootType.BlurLast, this.BlurCode);
                    last = srcSkill.Context.GetBuffLast(srcSkill, caster, last);
                }
            }
            if (!BuffUtil.ExecRate(out rate, rate, srcSkill.Context, this.ExecType))
            {
                return(false);
            }
            if (rate <= 0)
            {
                return(true);
            }
            int buffId = this.BuffId[0];

            if (buffId == (int)EnumBlurType.BanMan)
            {
                target.DisableState = (int)this.BlurCode;
            }
            else
            {
                if (buffId == (int)EnumBlurType.LockMotion)
                {
                    target.RemoveBuff(buffId, 0);
                }
                if (!target.AddBuff(InnerCreateBuff(srcSkill, target, (short)last, rate)))
                {
                    return(false);
                }
            }
            this.AddTgtShowModel(srcSkill, target, last);
            return(true);
        }
예제 #3
0
 protected virtual bool AddBuff(ISkill srcSkill, ISkillPlayer target, short last)
 {
     if (this.Last == 0)
     {
         int maxRate = SkillDefines.MAXStorePercent;
         if (this.Rate <= 0 || this.Rate < maxRate && srcSkill.Context.RandomPercent(maxRate) > this.Rate)
         {
             return(false);
         }
         if (!target.ForceState(this.ForceState))
         {
             return(false);
         }
     }
     else
     {
         if (!target.AddBuff(InnerCreateForceBuff(srcSkill, last)))
         {
             return(false);
         }
     }
     this.AddTgtShowModel(srcSkill, target, last);
     return(true);
 }