コード例 #1
0
        public BuffInfo(CharacterEntity character, CharacterEntity target, SkillInfo skillInfo, MechanicsData mechanics, BuffType buffType, SkillLevelBuffAddType skillLevelBuffAddType, BuffAddType buffAddType, int count, uint targetSkillId, float value, uint level, int judgeType)
        {
            this.mechanics   = mechanics;
            this.character   = character;
            this.target      = target;
            this.skillInfo   = skillInfo;
            this.buffType    = buffType;
            this.buffAddType = buffAddType;
            this.judgeType   = judgeType;
#if UNITY_EDITOR
            this.skillLevelBuffAddType = skillLevelBuffAddType;
#endif
            this.targetSkillId = targetSkillId;
            this.count         = count;
            switch (skillLevelBuffAddType)
            {
            case SkillLevelBuffAddType.Time:

                break;

            case SkillLevelBuffAddType.Value:
            {
                float result = Skill.SkillUtil.GetMechanicsValueByAdvanceLevel(value, character.characterInfo.dlevel);
                result     = BuffUtil.GetBuffValue(result, level);
                this.value = result;
            }
            break;
            }
            kindness      = BuffUtil.Judge(this.buffType, this.value);
            originalValue = this.value;
            interval      = 1;
        }
コード例 #2
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);
        }
コード例 #3
0
 public static void TriggerPlayerSkills(ISkillPlayer srcPlayer, byte timeFlag, bool checkFlag = false)
 {
     if (null != srcPlayer.SkillCore)
     {
         if (!checkFlag || !BuffUtil.IfSilence(srcPlayer))
         {
             srcPlayer.SkillCore.InvokeSkill(timeFlag);
         }
     }
 }
コード例 #4
0
 public BuffInfo(CharacterEntity target, MechanicsData mechanics, BuffType buffType, float time, float intervalTime, int count, float value)
 {
     this.mechanics = mechanics;
     this.target    = target;
     this.buffType  = buffType;
     this.time      = TimeController.instance.fightSkillTime + time;
     this.value     = value;
     this.count     = count;
     kindness       = BuffUtil.Judge(this.buffType, this.value);
     interval       = (int)intervalTime;
 }
コード例 #5
0
        public bool Trigger(ISkill srcSkill, ISkillPlayer caster)
        {
            if (TimeStep <= 0)
            {
                return(true);
            }
            int round  = srcSkill.Context.MatchRound;
            int weight = BuffUtil.GetTimeWeight(srcSkill.Context, TimeType);

            if (weight * TimeStep <= 1)
            {
                return(true);
            }
            return(round % (weight * TimeStep) == 1);
        }
コード例 #6
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);
        }
コード例 #7
0
        public BuffInfo(CharacterEntity character, CharacterEntity target, SkillInfo skillInfo, MechanicsData mechanics, BuffType buffType, SkillLevelBuffAddType skillLevelBuffAddType, BuffAddType buffAddType, float time, float value, uint level, int judgeType)
        {
            this.mechanics   = mechanics;
            this.character   = character;
            this.target      = target;
            this.skillInfo   = skillInfo;
            this.buffType    = buffType;
            this.buffAddType = buffAddType;
            this.judgeType   = judgeType;
#if UNITY_EDITOR
            this.skillLevelBuffAddType = skillLevelBuffAddType;
#endif
            switch (skillLevelBuffAddType)
            {
            case SkillLevelBuffAddType.Time:
            {
                float result = Skill.SkillUtil.GetMechanicsValueByAdvanceLevel(time, character.characterInfo.dlevel);
                result     = BuffUtil.GetBuffValue(result, level);
                this.time  = TimeController.instance.fightSkillTime + result;
                this.value = value;
                break;
            }

            case SkillLevelBuffAddType.Value:
            {
                float result = Skill.SkillUtil.GetMechanicsValueByAdvanceLevel(value, character.characterInfo.dlevel);
                result     = BuffUtil.GetBuffValue(result, level);
                this.value = result;
                this.time  = TimeController.instance.fightSkillTime + time;
                break;
            }

            default:
                this.time  = TimeController.instance.fightSkillTime + time;
                this.value = value;
                break;
            }
            kindness      = BuffUtil.Judge(this.buffType, this.value);
            originalValue = this.value;
            interval      = 1;
        }
コード例 #8
0
        protected override IBuff InnerCreatePropBuff(ISkill srcSkill, ISkillPlayer caster, double multiFact, double addFact)
        {
            short last = BuffUtil.GetBuffLast(srcSkill, caster, this.Last);

            if (last > 0)
            {
                last += srcSkill.Context.MatchRound;
            }
            //int arg;
            //if (!int.TryParse(srcSkill.Args, out arg))
            //    arg = 1;
            return(new FootballPropBuff(srcSkill, this.BuffId)
            {
                Rate = SkillDefines.MAXStorePercent,
                //Point = Convert.ToInt32(this.Point * (0.95 + arg * 0.05) * multiFact + addFact),
                //Percent = Convert.ToInt32(this.Percent * (0.95 + arg * 0.05) * multiFact + addFact),
                Point = Convert.ToInt32(this.Point * multiFact + addFact),
                Percent = Convert.ToInt32(this.Percent * multiFact + addFact),
                TimeEnd = last,
                Times = this.Repeat,
            });
        }
コード例 #9
0
        public bool Trigger(ISkill srcSkill, ISkillPlayer caster)
        {
            if (null == this.Values || this.Values.Length == 0)
            {
                return(true);
            }
            int round  = srcSkill.Context.MatchRound;
            int weight = BuffUtil.GetTimeWeight(srcSkill.Context, TimeType);
            int len    = Values.Length;

            for (int i = 0; i < len; i += 2)
            {
                if (i + 1 >= len)
                {
                    break;
                }
                if (Values[i] * weight <= round && round <= Values[i + 1] * weight)
                {
                    return(true);
                }
            }
            return(false);
        }
コード例 #10
0
        public void InvokeSkill(byte timeFlag)
        {
            short round = this._context.MatchRound;

            if (!this._invokeState.GetLoopFlag(timeFlag, round))
            {
                return;
            }
            var skills = timeFlag == 1 ? _skillDic[EnumSkillTimeType.PreDecide] : _skillDic[BuffUtil.CheckSkillTime(this._context)];
            int cnt    = skills.Count;

            if (cnt == 0)
            {
                return;
            }
            int    pos      = _invokeIndex % cnt + 1;
            int    idx      = 0;
            ISkill skill    = null;
            bool   loopFlag = false;

            for (int i = pos; i < cnt + pos; i++)
            {
                idx   = i % cnt;
                skill = skills[idx];
                if (skill.InvalidFlag)
                {
                    continue;
                }
                if (!skill.Invoke())
                {
                    continue;
                }
                if (_context.SkillSkip())
                {
                    break;
                }
                if (!loopFlag)
                {
                    loopFlag = true;
                }
                if (skill.RawSkill.ParalFlag <= 1)
                {
                    this._invokeIndex = idx;
                }
            }
            if (loopFlag)
            {
                this._invokeState.SetLoopFlag(timeFlag, round);
            }
        }
コード例 #11
0
        bool InvokeCore(ISkillPlayer caster, bool cdFlag, bool checkPreFlag, bool checkPostFlag)
        {
            byte paralFlag = this.RawSkill.ParalFlag;
            var  owner     = caster ?? this.Owner;

            if (null == owner.SkillCore)
            {
                checkPreFlag = checkPostFlag = false;
            }
            if (checkPreFlag && !owner.SkillCore.GetInvokeFlag(paralFlag))
            {
                return(false);
            }
            if (BuffUtil.IfSilence(this, owner))
            {
                return(false);
            }
            foreach (var item in this.RawSkill.Triggers)
            {
                if (cdFlag && item.Delay)
                {
                    continue;
                }
                if (!item.Trigger(this, caster))
                {
                    return(false);
                }
            }
            if (null != this.MainEffector)
            {
                if (!this.MainEffector.Effect(this, caster))
                {
                    return(false);
                }
                if (!cdFlag)
                {
                    this.MainEffector.AddShowClip(this, caster);
                }
            }
            if (cdFlag)
            {
                this.SkillState = EnumSkillState.Triggering;
                if (null != this.MainEffector && this.MainEffector.MainEffect.Repeat == (short)EnumBuffRepeat.WaitOnce)
                {
                    return(false);
                }
                if (!this.CoolDown(caster))
                {
                    return(false);
                }
            }
            else
            {
                foreach (var item in this.SubEffectors)
                {
                    item.Effect(this, caster);
                }
            }
            if (checkPostFlag)
            {
                owner.SkillCore.SetInvokeFlag(paralFlag);
            }
            return(true);
        }