Esempio n. 1
0
        public BaseStatus GetJobTransfarStatus(int lv, EElement element)
        {
            if (this.ranks == null || lv < 0 || lv >= this.ranks.Length)
            {
                return((BaseStatus)null);
            }
            BaseStatus status = new BaseStatus();

            for (int index = 0; index < lv; ++index)
            {
                if (this.ranks[index].buff_list != null)
                {
                    foreach (BuffEffect.BuffValues buff in this.ranks[index].buff_list)
                    {
                        bool flag = false;
                        switch (buff.param_type)
                        {
                        case ParamTypes.UnitDefenseFire:
                            flag = element != EElement.Fire;
                            break;

                        case ParamTypes.UnitDefenseWater:
                            flag = element != EElement.Water;
                            break;

                        case ParamTypes.UnitDefenseWind:
                            flag = element != EElement.Wind;
                            break;

                        case ParamTypes.UnitDefenseThunder:
                            flag = element != EElement.Thunder;
                            break;

                        case ParamTypes.UnitDefenseShine:
                            flag = element != EElement.Shine;
                            break;

                        case ParamTypes.UnitDefenseDark:
                            flag = element != EElement.Dark;
                            break;
                        }
                        if (!flag)
                        {
                            BuffEffect.SetBuffValues(buff.param_type, buff.method_type, ref status, buff.value);
                        }
                    }
                }
            }
            return(status);
        }
Esempio n. 2
0
 private void InternalBuffSkill(BuffEffect effect, BuffTypes buffType, SkillParamCalcTypes calcType, BaseStatus status)
 {
     for (int index = 0; index < effect.targets.Count; ++index)
     {
         BuffEffect.BuffTarget target = effect.targets[index];
         if (target != null && target.buffType == buffType && target.calcType == calcType)
         {
             BuffMethodTypes buffMethodType = this.GetBuffMethodType(target.buffType, calcType);
             ParamTypes      paramType      = target.paramType;
             int             num            = (int)target.value;
             effect.SetBuffValues(paramType, buffMethodType, ref status, num);
         }
     }
 }
Esempio n. 3
0
        public void CalcBuffStatus(ref BaseStatus status, EElement element, BuffTypes buffType, bool is_check_negative_value, bool is_negative_value_is_buff, SkillParamCalcTypes calcType, int up_count = 0)
        {
            for (int index = 0; index < this.targets.Count; ++index)
            {
                BuffEffect.BuffTarget target = this.targets[index];
                if (target.buffType == buffType && (!is_check_negative_value || BuffEffectParam.IsNegativeValueIsBuff(target.paramType) == is_negative_value_is_buff) && target.calcType == calcType)
                {
                    if (element != EElement.None)
                    {
                        bool flag = false;
                        switch (target.paramType)
                        {
                        case ParamTypes.Assist_Fire:
                        case ParamTypes.UnitDefenseFire:
                            flag = element != EElement.Fire;
                            break;

                        case ParamTypes.Assist_Water:
                        case ParamTypes.UnitDefenseWater:
                            flag = element != EElement.Water;
                            break;

                        case ParamTypes.Assist_Wind:
                        case ParamTypes.UnitDefenseWind:
                            flag = element != EElement.Wind;
                            break;

                        case ParamTypes.Assist_Thunder:
                        case ParamTypes.UnitDefenseThunder:
                            flag = element != EElement.Thunder;
                            break;

                        case ParamTypes.Assist_Shine:
                        case ParamTypes.UnitDefenseShine:
                            flag = element != EElement.Shine;
                            break;

                        case ParamTypes.Assist_Dark:
                        case ParamTypes.UnitDefenseDark:
                            flag = element != EElement.Dark;
                            break;
                        }
                        if (flag)
                        {
                            continue;
                        }
                    }
                    BuffMethodTypes buffMethodType = this.GetBuffMethodType(target.buffType, calcType);
                    ParamTypes      paramType      = target.paramType;
                    int             val1           = (int)target.value;
                    if ((bool)this.param.mIsUpBuff)
                    {
                        val1 = (int)target.value_one * up_count;
                        if (val1 > 0)
                        {
                            val1 = Math.Min(val1, (int)target.value);
                        }
                        else if (val1 < 0)
                        {
                            val1 = Math.Max(val1, (int)target.value);
                        }
                    }
                    BuffEffect.SetBuffValues(paramType, buffMethodType, ref status, val1);
                }
            }
        }
Esempio n. 4
0
        private void InternalBuffSkill(BuffEffect effect, EElement element, BuffTypes buffType, bool is_check_negative_value, bool is_negative_value_is_buff, SkillParamCalcTypes calcType, BaseStatus status, List <BuffEffect.BuffValues> list = null)
        {
            for (int index1 = 0; index1 < effect.targets.Count; ++index1)
            {
                BuffEffect.BuffTarget target = effect.targets[index1];
                if (target != null && target.buffType == buffType && (!is_check_negative_value || BuffEffectParam.IsNegativeValueIsBuff(target.paramType) == is_negative_value_is_buff) && target.calcType == calcType)
                {
                    if (element != EElement.None)
                    {
                        bool flag = false;
                        switch (target.paramType)
                        {
                        case ParamTypes.Assist_Fire:
                        case ParamTypes.UnitDefenseFire:
                            flag = element != EElement.Fire;
                            break;

                        case ParamTypes.Assist_Water:
                        case ParamTypes.UnitDefenseWater:
                            flag = element != EElement.Water;
                            break;

                        case ParamTypes.Assist_Wind:
                        case ParamTypes.UnitDefenseWind:
                            flag = element != EElement.Wind;
                            break;

                        case ParamTypes.Assist_Thunder:
                        case ParamTypes.UnitDefenseThunder:
                            flag = element != EElement.Thunder;
                            break;

                        case ParamTypes.Assist_Shine:
                        case ParamTypes.UnitDefenseShine:
                            flag = element != EElement.Shine;
                            break;

                        case ParamTypes.Assist_Dark:
                        case ParamTypes.UnitDefenseDark:
                            flag = element != EElement.Dark;
                            break;
                        }
                        if (flag)
                        {
                            continue;
                        }
                    }
                    BuffMethodTypes buffMethodType = this.GetBuffMethodType(target.buffType, calcType);
                    ParamTypes      paramType      = target.paramType;
                    int             num            = (int)target.value;
                    if ((bool)effect.param.mIsUpBuff)
                    {
                        num = 0;
                    }
                    if (list == null)
                    {
                        BuffEffect.SetBuffValues(paramType, buffMethodType, ref status, num);
                    }
                    else
                    {
                        bool flag = true;
                        for (int index2 = 0; index2 < list.Count; ++index2)
                        {
                            BuffEffect.BuffValues buffValues = list[index2];
                            if (buffValues.param_type == paramType && buffValues.method_type == buffMethodType)
                            {
                                buffValues.value += num;
                                list[index2]      = buffValues;
                                flag              = false;
                                break;
                            }
                        }
                        if (flag)
                        {
                            list.Add(new BuffEffect.BuffValues()
                            {
                                param_type  = paramType,
                                method_type = buffMethodType,
                                value       = num
                            });
                        }
                    }
                }
            }
        }