Пример #1
0
        public bool BuffSkill(ESkillTiming timing, EElement element, BaseStatus buff, BaseStatus buff_negative, BaseStatus buff_scale, BaseStatus debuff, BaseStatus debuff_negative, BaseStatus debuff_scale, RandXorshift rand = null, SkillEffectTargets buff_target = SkillEffectTargets.Target, bool is_resume = false, List <BuffEffect.BuffValues> list = null)
        {
            if (this.Timing != timing)
            {
                return(false);
            }
            BuffEffect buffEffect = this.GetBuffEffect(buff_target);

            if (buffEffect == null)
            {
                return(false);
            }
            if (!is_resume)
            {
                int rate = (int)buffEffect.param.rate;
                if (rate > 0 && rate < 100)
                {
                    DebugUtility.Assert(rand != null, "発動確率が設定されているスキルを正規タイミングで発動させたにも関わらず乱数生成器の設定がされていない");
                    if ((int)(rand.Get() % 100U) > rate)
                    {
                        return(false);
                    }
                }
            }
            if (list == null)
            {
                if (buff != null)
                {
                    this.InternalBuffSkill(buffEffect, element, BuffTypes.Buff, true, false, SkillParamCalcTypes.Add, buff, (List <BuffEffect.BuffValues>)null);
                }
                if (buff_negative != null)
                {
                    this.InternalBuffSkill(buffEffect, element, BuffTypes.Buff, true, true, SkillParamCalcTypes.Add, buff_negative, (List <BuffEffect.BuffValues>)null);
                }
                if (buff_scale != null)
                {
                    this.InternalBuffSkill(buffEffect, element, BuffTypes.Buff, false, false, SkillParamCalcTypes.Scale, buff_scale, (List <BuffEffect.BuffValues>)null);
                }
                if (debuff != null)
                {
                    this.InternalBuffSkill(buffEffect, element, BuffTypes.Debuff, true, false, SkillParamCalcTypes.Add, debuff, (List <BuffEffect.BuffValues>)null);
                }
                if (debuff_negative != null)
                {
                    this.InternalBuffSkill(buffEffect, element, BuffTypes.Debuff, true, true, SkillParamCalcTypes.Add, debuff_negative, (List <BuffEffect.BuffValues>)null);
                }
                if (debuff_scale != null)
                {
                    this.InternalBuffSkill(buffEffect, element, BuffTypes.Debuff, false, false, SkillParamCalcTypes.Scale, debuff_scale, (List <BuffEffect.BuffValues>)null);
                }
            }
            else
            {
                this.InternalBuffSkill(buffEffect, element, BuffTypes.Buff, false, false, SkillParamCalcTypes.Add, (BaseStatus)null, list);
                this.InternalBuffSkill(buffEffect, element, BuffTypes.Buff, false, false, SkillParamCalcTypes.Scale, (BaseStatus)null, list);
                this.InternalBuffSkill(buffEffect, element, BuffTypes.Debuff, false, false, SkillParamCalcTypes.Add, (BaseStatus)null, list);
                this.InternalBuffSkill(buffEffect, element, BuffTypes.Debuff, false, false, SkillParamCalcTypes.Scale, (BaseStatus)null, list);
            }
            return(true);
        }
Пример #2
0
        private void setup(string iname, int grid_x, int grid_y, string tag, Unit creator, int create_clock, int rank, int rankcap)
        {
            if (string.IsNullOrEmpty(iname))
            {
                return;
            }
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            if (!UnityEngine.Object.op_Implicit((UnityEngine.Object)instanceDirect))
            {
                return;
            }
            this.mTrickParam = instanceDirect.MasterParam.GetTrickParam(iname);
            if (this.mTrickParam == null)
            {
                return;
            }
            this.mRankCap         = (OInt)Math.Max(rankcap, 1);
            this.mRank            = (OInt)Math.Min(rank, (int)this.mRankCap);
            this.mBuffEffect      = BuffEffect.CreateBuffEffect(instanceDirect.MasterParam.GetBuffEffectParam(this.mTrickParam.BuffId), (int)this.mRank, (int)this.mRankCap);
            this.mCondEffect      = CondEffect.CreateCondEffect(instanceDirect.MasterParam.GetCondEffectParam(this.mTrickParam.CondId), (int)this.mRank, (int)this.mRankCap);
            this.mCreateUnit      = creator;
            this.mGridX           = (OInt)grid_x;
            this.mGridY           = (OInt)grid_y;
            this.mTag             = tag;
            this.mRestActionCount = this.mTrickParam.ActionCount;
            this.mCreateClock     = (OInt)create_clock;
            this.mValid           = (OBool)true;
        }
Пример #3
0
        public string GetBufText(BuffEffect effect, BuffEffect.BuffTarget target)
        {
            MasterParam   masterParam   = MonoSingleton <GameManager> .Instance.MasterParam;
            StringBuilder stringBuilder = new StringBuilder();
            ConceptCardConditionsParam conceptCardConditions = masterParam.GetConceptCardConditions(this.ConditionsIname);

            stringBuilder.Append(conceptCardConditions.GetConditionDescriptionEquip());
            UnitGroupParam unitGroup = masterParam.GetUnitGroup(effect.param.un_group);

            if (unitGroup != null)
            {
                stringBuilder.Append(unitGroup.GetName());
            }
            stringBuilder.Append(LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_OF"));
            string str = LocalizedText.Get("sys." + target.paramType.ToString());

            stringBuilder.Append(str);
            bool   flag  = 0 <= (int)target.value;
            int    num   = Mathf.Abs((int)target.value);
            string empty = string.Empty;

            switch (target.calcType)
            {
            case SkillParamCalcTypes.Add:
                if (flag)
                {
                    empty = LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_CALC_ADD_PLUS", new object[1]
                    {
                        (object)num.ToString()
                    });
                    break;
                }
                empty = LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_CALC_ADD_MINUS", new object[1]
                {
                    (object)num.ToString()
                });
                break;

            case SkillParamCalcTypes.Scale:
                if (flag)
                {
                    empty = LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_CALC_UP", new object[1]
                    {
                        (object)num.ToString()
                    });
                    break;
                }
                empty = LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_CALC_DOWN", new object[1]
                {
                    (object)num.ToString()
                });
                break;
            }
            stringBuilder.Append(empty);
            return(stringBuilder.ToString());
        }
Пример #4
0
        public void GetAddCardSkillBuffStatusLvMax(int lv, int lv_cap, int awake, ref BaseStatus total_add, ref BaseStatus total_scale)
        {
            total_add.Clear();
            total_scale.Clear();
            BuffEffect skillBuffEffectLvMax = this.CreateAddCardSkillBuffEffectLvMax(lv, lv_cap, awake);

            if (skillBuffEffectLvMax == null)
            {
                return;
            }
            skillBuffEffectLvMax.GetBaseStatus(ref total_add, ref total_scale);
        }
Пример #5
0
        public void GetAddCardSkillBuffStatusAwake(int awake, int awake_cap, ref BaseStatus total_add, ref BaseStatus total_scale)
        {
            total_add.Clear();
            total_scale.Clear();
            BuffEffect skillBuffEffectAwake = this.CreateAddCardSkillBuffEffectAwake(awake, awake_cap);

            if (skillBuffEffectAwake == null)
            {
                return;
            }
            skillBuffEffectAwake.GetBaseStatus(ref total_add, ref total_scale);
        }
Пример #6
0
        public void Setup(ConceptCardEffectsParam param, int lv, int lvcap, int awake_count, int awake_count_cap)
        {
            this.mEffectParam     = param;
            this.mConditionsIname = param.cnds_iname;
            this.is_levelmax      = lv >= lvcap;
            if (!string.IsNullOrEmpty(param.card_skill))
            {
                this.mCardSkill = new SkillData();
                this.mCardSkill.Setup(param.card_skill, lv, lvcap, (MasterParam)null);
            }
            if (!string.IsNullOrEmpty(param.add_card_skill_buff_awake) && awake_count > 0)
            {
                BuffEffectParam buffEffectParam = MonoSingleton <GameManager> .Instance.MasterParam.GetBuffEffectParam(param.add_card_skill_buff_awake);

                if (buffEffectParam != null)
                {
                    this.mAddCardSkillBuffEffectAwake = BuffEffect.CreateBuffEffect(buffEffectParam, awake_count, awake_count_cap);
                }
            }
            if (!string.IsNullOrEmpty(param.add_card_skill_buff_lvmax) && lv >= lvcap && awake_count > 0)
            {
                BuffEffectParam buffEffectParam = MonoSingleton <GameManager> .Instance.MasterParam.GetBuffEffectParam(param.add_card_skill_buff_lvmax);

                if (buffEffectParam != null)
                {
                    this.mAddCardSkillBuffEffectLvMax = BuffEffect.CreateBuffEffect(buffEffectParam, 1, 1);
                }
            }
            if (!string.IsNullOrEmpty(param.statusup_skill))
            {
                this.mEquipSkill = new SkillData();
                this.mEquipSkill.Setup(param.statusup_skill, lv, lvcap, (MasterParam)null);
            }
            if (!string.IsNullOrEmpty(param.skin))
            {
                this.mSkin = param.skin;
            }
            if (!string.IsNullOrEmpty(param.abil_iname) && MonoSingleton <GameManager> .Instance.GetAbilityParam(param.abil_iname) != null)
            {
                this.mAbilityDefault = new AbilityData();
                this.mAbilityDefault.Setup((UnitData)null, 0L, param.abil_iname, lv - 1, lvcap);
                this.mAbilityDefault.IsNoneCategory = true;
                this.mAbilityDefault.IsHideList     = false;
            }
            if (string.IsNullOrEmpty(param.abil_iname) || string.IsNullOrEmpty(param.abil_iname_lvmax) || MonoSingleton <GameManager> .Instance.GetAbilityParam(param.abil_iname_lvmax) == null)
            {
                return;
            }
            this.mAbilityLvMax = new AbilityData();
            this.mAbilityLvMax.Setup((UnitData)null, 0L, param.abil_iname_lvmax, lv - 1, lvcap);
            this.mAbilityLvMax.IsNoneCategory = true;
            this.mAbilityLvMax.IsHideList     = false;
        }
Пример #7
0
        public static BuffEffect CreateBuffEffect(BuffEffectParam param, int rank, int rankcap)
        {
            if (param == null || param.buffs == null || param.buffs.Length == 0)
            {
                return((BuffEffect)null);
            }
            BuffEffect buffEffect = new BuffEffect();

            buffEffect.param   = param;
            buffEffect.targets = new List <BuffEffect.BuffTarget>(param.buffs.Length);
            buffEffect.UpdateCurrentValues(rank, rankcap);
            return(buffEffect);
        }
Пример #8
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);
        }
Пример #9
0
        public static bool IsEnableCardSkillForUnit(Unit target, SkillData card_skill)
        {
            if (target == null || card_skill == null || card_skill.SkillParam.condition != ESkillCondition.CardSkill)
            {
                return(false);
            }
            BuffEffectParam buffEffectParam = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetBuffEffectParam(card_skill.SkillParam.target_buff_iname);

            if (buffEffectParam == null)
            {
                return(false);
            }
            return(BuffEffect.CreateBuffEffect(buffEffectParam, card_skill.Rank, card_skill.GetRankCap()).CheckEnableBuffTarget(target));
        }
Пример #10
0
        public BuffEffect CreateAddCardSkillBuffEffectAwake(int awake, int awake_cap)
        {
            if (string.IsNullOrEmpty(this.add_card_skill_buff_awake) || awake <= 0)
            {
                return((BuffEffect)null);
            }
            BuffEffectParam buffEffectParam = MonoSingleton <GameManager> .Instance.MasterParam.GetBuffEffectParam(this.add_card_skill_buff_awake);

            if (buffEffectParam == null)
            {
                return((BuffEffect)null);
            }
            return(BuffEffect.CreateBuffEffect(buffEffectParam, awake, awake_cap));
        }
Пример #11
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);
         }
     }
 }
Пример #12
0
        private bool attachBuffPassive(Unit target)
        {
            if (target == null)
            {
                return(false);
            }
            bool flag = false;

            using (List <BuffEffect> .Enumerator enumerator = this.mBuffEffectLists.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    BuffEffect current = enumerator.Current;
                    if (current != null && current.param.chk_timing == EffectCheckTimings.Eternal && current.CheckEnableBuffTarget(target))
                    {
                        BaseStatus status1 = new BaseStatus();
                        BaseStatus status2 = new BaseStatus();
                        BaseStatus status3 = new BaseStatus();
                        BaseStatus status4 = new BaseStatus();
                        current.CalcBuffStatus(ref status1, BuffTypes.Buff, SkillParamCalcTypes.Add);
                        current.CalcBuffStatus(ref status2, BuffTypes.Buff, SkillParamCalcTypes.Scale);
                        current.CalcBuffStatus(ref status3, BuffTypes.Debuff, SkillParamCalcTypes.Add);
                        current.CalcBuffStatus(ref status4, BuffTypes.Debuff, SkillParamCalcTypes.Scale);
                        if (current.CheckBuffCalcType(BuffTypes.Buff, SkillParamCalcTypes.Add))
                        {
                            BuffAttachment buffAttachment = this.createBuffAttachment(target, current, BuffTypes.Buff, SkillParamCalcTypes.Add, status1);
                            target.SetBuffAttachment(buffAttachment, false);
                        }
                        if (current.CheckBuffCalcType(BuffTypes.Buff, SkillParamCalcTypes.Scale))
                        {
                            BuffAttachment buffAttachment = this.createBuffAttachment(target, current, BuffTypes.Buff, SkillParamCalcTypes.Scale, status2);
                            target.SetBuffAttachment(buffAttachment, false);
                        }
                        if (current.CheckBuffCalcType(BuffTypes.Debuff, SkillParamCalcTypes.Add))
                        {
                            BuffAttachment buffAttachment = this.createBuffAttachment(target, current, BuffTypes.Debuff, SkillParamCalcTypes.Add, status3);
                            target.SetBuffAttachment(buffAttachment, false);
                        }
                        if (current.CheckBuffCalcType(BuffTypes.Debuff, SkillParamCalcTypes.Scale))
                        {
                            BuffAttachment buffAttachment = this.createBuffAttachment(target, current, BuffTypes.Debuff, SkillParamCalcTypes.Scale, status4);
                            target.SetBuffAttachment(buffAttachment, false);
                        }
                        flag = true;
                    }
                }
            }
            return(flag);
        }
Пример #13
0
        public int CalcBuffEffectValue(ParamTypes type, int src, SkillEffectTargets target = SkillEffectTargets.Target)
        {
            BuffEffect buffEffect = this.GetBuffEffect(target);

            if (buffEffect == null)
            {
                return(src);
            }
            BuffEffect.BuffTarget buffTarget = buffEffect[type];
            if (buffTarget == null)
            {
                return(src);
            }
            return(SkillParam.CalcSkillEffectValue(buffTarget.calcType, (int)buffTarget.value, src));
        }
Пример #14
0
        public void SetupLinkageBuff()
        {
            this.LinkageBuff = (BuffEffect)null;
            if (this.skill == null || this.mParam == null)
            {
                return;
            }
            string linkageBuffId = this.mParam.GetLinkageBuffId(this.Condition);

            if (string.IsNullOrEmpty(linkageBuffId))
            {
                return;
            }
            this.LinkageBuff = BuffEffect.CreateBuffEffect(MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetBuffEffectParam(linkageBuffId), this.skill.Rank, this.skill.GetRankCap());
        }
Пример #15
0
        public int GetBuffEffectValue(ParamTypes type, SkillEffectTargets target = SkillEffectTargets.Target)
        {
            BuffEffect buffEffect = this.GetBuffEffect(target);

            if (buffEffect == null)
            {
                return(0);
            }
            BuffEffect.BuffTarget buffTarget = buffEffect[type];
            if (buffTarget == null)
            {
                return(0);
            }
            return((int)buffTarget.value);
        }
Пример #16
0
        private void setup(string iname, Unit modify_unit, int rank, int rankcap)
        {
            if (string.IsNullOrEmpty(iname))
            {
                return;
            }
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            if (!UnityEngine.Object.op_Implicit((UnityEngine.Object)instanceDirect))
            {
                return;
            }
            this.mWeatherParam = instanceDirect.MasterParam.GetWeatherParam(iname);
            if (this.mWeatherParam == null)
            {
                return;
            }
            this.mRankCap = (OInt)Math.Max(rankcap, 1);
            this.mRank    = (OInt)Math.Min(rank, (int)this.mRankCap);
            this.mBuffEffectLists.Clear();
            using (List <string> .Enumerator enumerator = this.mWeatherParam.BuffIdLists.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    string     current    = enumerator.Current;
                    BuffEffect buffEffect = BuffEffect.CreateBuffEffect(instanceDirect.MasterParam.GetBuffEffectParam(current), rank, rankcap);
                    if (buffEffect != null)
                    {
                        this.mBuffEffectLists.Add(buffEffect);
                    }
                }
            }
            this.mCondEffectLists.Clear();
            using (List <string> .Enumerator enumerator = this.mWeatherParam.CondIdLists.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    string     current    = enumerator.Current;
                    CondEffect condEffect = CondEffect.CreateCondEffect(instanceDirect.MasterParam.GetCondEffectParam(current), rank, rankcap);
                    if (condEffect != null)
                    {
                        this.mCondEffectLists.Add(condEffect);
                    }
                }
            }
            this.mModifyUnit = modify_unit;
        }
Пример #17
0
 public bool IsFail(Unit unit)
 {
     if (this.param.DamageType == eTrickDamageType.DAMAGE)
     {
         return(true);
     }
     if (this.data.BuffEffect != null)
     {
         BuffEffect buffEffect = this.data.BuffEffect;
         for (int index = 0; index < buffEffect.targets.Count; ++index)
         {
             if (buffEffect.targets[index].buffType == BuffTypes.Debuff)
             {
                 return(true);
             }
         }
     }
     if (this.data.CondEffect != null)
     {
         CondEffectParam condEffectParam = this.data.CondEffect.param;
         if (condEffectParam.type == ConditionEffectTypes.CureCondition)
         {
             return(false);
         }
         if (condEffectParam.type == ConditionEffectTypes.DisableCondition)
         {
             for (int index = 0; index < condEffectParam.conditions.Length; ++index)
             {
                 if (!AIUtility.IsFailCondition(condEffectParam.conditions[index]))
                 {
                     return(true);
                 }
             }
         }
         else if (condEffectParam.type == ConditionEffectTypes.FailCondition || condEffectParam.type == ConditionEffectTypes.RandomFailCondition || condEffectParam.type == ConditionEffectTypes.ForcedFailCondition)
         {
             for (int index = 0; index < condEffectParam.conditions.Length; ++index)
             {
                 if (AIUtility.IsFailCondition(condEffectParam.conditions[index]))
                 {
                     return(true);
                 }
             }
         }
     }
     return(false);
 }
Пример #18
0
        public BuffEffect CreateAddCardSkillBuffEffectLvMax(int lv, int lv_cap, int awake)
        {
            if (lv < lv_cap)
            {
                return((BuffEffect)null);
            }
            if (string.IsNullOrEmpty(this.add_card_skill_buff_lvmax) || awake <= 0)
            {
                return((BuffEffect)null);
            }
            BuffEffectParam buffEffectParam = MonoSingleton <GameManager> .Instance.MasterParam.GetBuffEffectParam(this.add_card_skill_buff_lvmax);

            if (buffEffectParam == null)
            {
                return((BuffEffect)null);
            }
            return(BuffEffect.CreateBuffEffect(buffEffectParam, 1, 1));
        }
Пример #19
0
        public static void GetPassiveBuffStatus(SkillData skill, BuffEffect[] add_buff_effects, EElement element, ref BaseStatus status, ref BaseStatus negative_status, ref BaseStatus debuff_status, ref BaseStatus negative_debuff_status, ref BaseStatus scale_status)
        {
            if (skill == null || !skill.IsPassiveSkill())
            {
                return;
            }
            BuffEffect buffEffect1 = skill.GetBuffEffect(SkillEffectTargets.Target);

            if (buffEffect1 != null && buffEffect1.param != null && (buffEffect1.param.mAppType == EAppType.Standard && buffEffect1.param.mEffRange == EEffRange.Self) && !(bool)buffEffect1.param.mIsUpBuff)
            {
                skill.BuffSkill(ESkillTiming.Passive, element, status, negative_status, scale_status, debuff_status, negative_debuff_status, scale_status, (RandXorshift)null, SkillEffectTargets.Target, false, (List <BuffEffect.BuffValues>)null);
            }
            BuffEffect buffEffect2 = skill.GetBuffEffect(SkillEffectTargets.Self);

            if (buffEffect2 == null || buffEffect2.param == null || (buffEffect2.param.mAppType != EAppType.Standard || buffEffect2.param.mEffRange != EEffRange.Self) || (bool)buffEffect2.param.mIsUpBuff)
            {
                return;
            }
            skill.BuffSkill(ESkillTiming.Passive, element, status, negative_status, scale_status, debuff_status, negative_debuff_status, scale_status, (RandXorshift)null, SkillEffectTargets.Self, false, (List <BuffEffect.BuffValues>)null);
        }
Пример #20
0
        public static void GetHomePassiveBuffStatus(SkillData skill, EElement element, ref BaseStatus status, ref BaseStatus negative_status, ref BaseStatus debuff_status, ref BaseStatus negative_debuff_status, ref BaseStatus scale_status)
        {
            if (skill == null || !skill.IsPassiveSkill() || (skill.Target != ESkillTarget.Self || skill.Condition != ESkillCondition.None) || !string.IsNullOrEmpty(skill.SkillParam.tokkou))
            {
                return;
            }
            BuffEffect buffEffect1 = skill.GetBuffEffect(SkillEffectTargets.Target);

            if (buffEffect1 != null && buffEffect1.param != null && (buffEffect1.param.cond == ESkillCondition.None && buffEffect1.param.mAppType == EAppType.Standard) && (buffEffect1.param.mEffRange == EEffRange.Self && !(bool)buffEffect1.param.mIsUpBuff))
            {
                skill.BuffSkill(ESkillTiming.Passive, element, status, negative_status, scale_status, debuff_status, negative_debuff_status, scale_status, (RandXorshift)null, SkillEffectTargets.Target, false, (List <BuffEffect.BuffValues>)null);
            }
            BuffEffect buffEffect2 = skill.GetBuffEffect(SkillEffectTargets.Self);

            if (buffEffect2 == null || buffEffect2.param == null || (buffEffect2.param.cond != ESkillCondition.None || buffEffect2.param.mAppType != EAppType.Standard) || (buffEffect2.param.mEffRange != EEffRange.Self || (bool)buffEffect2.param.mIsUpBuff))
            {
                return;
            }
            skill.BuffSkill(ESkillTiming.Passive, element, status, negative_status, scale_status, debuff_status, negative_debuff_status, scale_status, (RandXorshift)null, SkillEffectTargets.Self, false, (List <BuffEffect.BuffValues>)null);
        }
Пример #21
0
 public void Setup(string iname, int rank, int rankcap = 1, MasterParam master = null)
 {
     if (string.IsNullOrEmpty(iname))
     {
         this.Reset();
     }
     else
     {
         if (master == null)
         {
             master = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam;
         }
         this.mSkillParam       = master.GetSkillParam(iname);
         this.mRankCap          = (int)this.mSkillParam.lvcap != 0 ? (OInt)Math.Max((int)this.mSkillParam.lvcap, 1) : (OInt)Math.Max(rankcap, 1);
         this.mRank             = (OInt)Math.Min(rank, (int)this.mRankCap);
         this.mTargetBuffEffect = BuffEffect.CreateBuffEffect(master.GetBuffEffectParam(this.SkillParam.target_buff_iname), (int)this.mRank, (int)this.mRankCap);
         this.mSelfBuffEffect   = BuffEffect.CreateBuffEffect(master.GetBuffEffectParam(this.SkillParam.self_buff_iname), (int)this.mRank, (int)this.mRankCap);
         this.mTargetCondEffect = CondEffect.CreateCondEffect(master.GetCondEffectParam(this.SkillParam.target_cond_iname), (int)this.mRank, (int)this.mRankCap);
         this.mSelfCondEffect   = CondEffect.CreateCondEffect(master.GetCondEffectParam(this.SkillParam.self_cond_iname), (int)this.mRank, (int)this.mRankCap);
         this.UpdateParam();
     }
 }
Пример #22
0
        private BuffAttachment createBuffAttachment(Unit target, BuffEffect effect, BuffTypes buff_type, SkillParamCalcTypes calc_type, BaseStatus status)
        {
            if (effect == null)
            {
                return((BuffAttachment)null);
            }
            BuffAttachment buffAttachment = new BuffAttachment(effect.param);

            buffAttachment.user           = this.mModifyUnit;
            buffAttachment.skill          = (SkillData)null;
            buffAttachment.skilltarget    = SkillEffectTargets.Self;
            buffAttachment.IsPassive      = (OBool)true;
            buffAttachment.CheckTarget    = (Unit)null;
            buffAttachment.DuplicateCount = 0;
            buffAttachment.CheckTiming    = effect.param.chk_timing;
            buffAttachment.turn           = effect.param.turn;
            buffAttachment.BuffType       = buff_type;
            buffAttachment.CalcType       = calc_type;
            buffAttachment.UseCondition   = ESkillCondition.Weather;
            status.CopyTo(buffAttachment.status);
            return(buffAttachment);
        }
Пример #23
0
            public int GetBuffPriority(Unit self)
            {
                int     val1 = 0;
                AIParam ai   = self.AI;

                if (!this.IsBuffEffect() || ai == null || ai.BuffPriorities == null)
                {
                    return(val1);
                }
                BuffEffect buffEffect = this.data.BuffEffect;

                if (buffEffect != null && buffEffect.targets != null)
                {
                    for (int index = 0; index < buffEffect.targets.Count; ++index)
                    {
                        int num = Array.IndexOf <ParamTypes>(ai.BuffPriorities, buffEffect.targets[index].paramType);
                        if (num != -1)
                        {
                            val1 = Math.Max(val1, ai.BuffPriorities.Length - num);
                        }
                    }
                }
                return(val1);
            }
Пример #24
0
        public void Refresh(UnitData unit, int slot)
        {
            if (unit == null)
            {
                unit = MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID((long)GlobalVars.SelectedUnitUniqueID);
            }
            if (unit == null)
            {
                return;
            }
            int selectedJobIndex = this.GetSelectedJobIndex(unit);

            EquipData[] rankupEquips = unit.GetRankupEquips(selectedJobIndex);
            if (slot < 0 || rankupEquips.Length <= slot)
            {
                return;
            }
            EquipData equipData = rankupEquips[slot];
            ItemParam itemParam = equipData.ItemParam;

            if (this.mItemParamTree.Count == 0 || this.mItemParamTree[0] != itemParam)
            {
                this.mItemParamTree.Clear();
                this.mItemParamTree.Add(itemParam);
            }
            bool is_common = false;

            if (equipData != null && equipData.IsValid() && equipData.IsEquiped())
            {
                this.mEquipmentData = equipData;
            }
            else
            {
                this.mEquipmentData = new EquipData();
                ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(itemParam.iname);

                ItemParam item_param = itemDataByItemId == null ? MonoSingleton <GameManager> .Instance.MasterParam.GetItemParam(itemParam.iname) : itemDataByItemId.Param;

                ItemParam commonEquip = MonoSingleton <GameManager> .Instance.MasterParam.GetCommonEquip(item_param, true);

                ItemData itemData = (ItemData)null;
                if (commonEquip != null)
                {
                    itemData = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(commonEquip.iname);
                }
                if ((itemDataByItemId == null || itemDataByItemId.Num <= 0) && (item_param.IsCommon && unit.Jobs[selectedJobIndex].Rank == 0) && (itemData != null && itemData.Num > 0))
                {
                    this.mEquipmentData.Setup(commonEquip.iname);
                    is_common = true;
                }
                else
                {
                    this.mEquipmentData.Setup(itemParam.iname);
                }
            }
            this.ActivateCommonUI(is_common);
            for (int index = 0; index < this.mEquipmentParameters.Count; ++index)
            {
                this.mEquipmentParameters[index].SetActive(false);
            }
            if (this.mEquipmentData != null && this.mEquipmentData.Skill != null)
            {
                BuffEffect buffEffect = this.mEquipmentData.Skill.GetBuffEffect(SkillEffectTargets.Target);
                if (buffEffect != null && buffEffect.targets != null)
                {
                    for (int index = 0; index < buffEffect.targets.Count; ++index)
                    {
                        if (index >= this.mEquipmentParameters.Count)
                        {
                            GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.EquipItemParamTemplate);
                            gameObject.get_transform().SetParent((Transform)this.EquipItemParamParent, false);
                            this.mEquipmentParameters.Add(gameObject);
                        }
                        GameObject         equipmentParameter = this.mEquipmentParameters[index];
                        EquipItemParameter data = DataSource.FindDataOfClass <EquipItemParameter>(equipmentParameter, (EquipItemParameter)null) ?? new EquipItemParameter();
                        data.equip       = this.mEquipmentData;
                        data.param_index = index;
                        DataSource.Bind <EquipItemParameter>(equipmentParameter, data);
                        equipmentParameter.SetActive(true);
                    }
                }
            }
            this.RefreshEquipButton(unit);
            DataSource.Bind <EquipData>(((Component)this).get_gameObject(), this.mEquipmentData);
            this.RefreshItemTree(this.mCreateItemSuccessed);
            this.RefreshRecipeItems();
            this.RefreshGainedQuests();
            ItemData itemDataByItemId1 = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(this.mEquipmentData.ItemParam.iname);

            ((Graphic)this.EquipAmount).set_color(itemDataByItemId1 == null || itemDataByItemId1.Num == 0 ? this.EquipAmountColorZero : this.EquipAmountColor);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Пример #25
0
        public static void SetBuffValues(ParamTypes param_type, BuffMethodTypes method_type, ref BaseStatus status, int value)
        {
            switch (param_type)
            {
            case ParamTypes.Hp:
                BuffEffect.SetBuffValue(method_type, ref status.param.values_hp, value);
                break;

            case ParamTypes.HpMax:
                BuffEffect.SetBuffValue(method_type, ref status.param.values_hp, value);
                break;

            case ParamTypes.Mp:
                BuffEffect.SetBuffValue(method_type, ref status.param.values[0], value);
                break;

            case ParamTypes.MpIni:
                BuffEffect.SetBuffValue(method_type, ref status.param.values[1], value);
                break;

            case ParamTypes.Atk:
                BuffEffect.SetBuffValue(method_type, ref status.param.values[2], value);
                break;

            case ParamTypes.Def:
                BuffEffect.SetBuffValue(method_type, ref status.param.values[3], value);
                break;

            case ParamTypes.Mag:
                BuffEffect.SetBuffValue(method_type, ref status.param.values[4], value);
                break;

            case ParamTypes.Mnd:
                BuffEffect.SetBuffValue(method_type, ref status.param.values[5], value);
                break;

            case ParamTypes.Rec:
                BuffEffect.SetBuffValue(method_type, ref status.param.values[6], value);
                break;

            case ParamTypes.Dex:
                BuffEffect.SetBuffValue(method_type, ref status.param.values[7], value);
                break;

            case ParamTypes.Spd:
                BuffEffect.SetBuffValue(method_type, ref status.param.values[8], value);
                break;

            case ParamTypes.Cri:
                BuffEffect.SetBuffValue(method_type, ref status.param.values[9], value);
                break;

            case ParamTypes.Luk:
                BuffEffect.SetBuffValue(method_type, ref status.param.values[10], value);
                break;

            case ParamTypes.Mov:
                BuffEffect.SetBuffValue(method_type, ref status.param.values[11], value);
                break;

            case ParamTypes.Jmp:
                BuffEffect.SetBuffValue(method_type, ref status.param.values[12], value);
                break;

            case ParamTypes.EffectRange:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[0], value);
                break;

            case ParamTypes.EffectScope:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[1], value);
                break;

            case ParamTypes.EffectHeight:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[2], value);
                break;

            case ParamTypes.Assist_Fire:
                BuffEffect.SetBuffValue(method_type, ref status.element_assist.values[1], value);
                break;

            case ParamTypes.Assist_Water:
                BuffEffect.SetBuffValue(method_type, ref status.element_assist.values[2], value);
                break;

            case ParamTypes.Assist_Wind:
                BuffEffect.SetBuffValue(method_type, ref status.element_assist.values[3], value);
                break;

            case ParamTypes.Assist_Thunder:
                BuffEffect.SetBuffValue(method_type, ref status.element_assist.values[4], value);
                break;

            case ParamTypes.Assist_Shine:
                BuffEffect.SetBuffValue(method_type, ref status.element_assist.values[5], value);
                break;

            case ParamTypes.Assist_Dark:
                BuffEffect.SetBuffValue(method_type, ref status.element_assist.values[6], value);
                break;

            case ParamTypes.Assist_Poison:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[0], value);
                break;

            case ParamTypes.Assist_Paralysed:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[1], value);
                break;

            case ParamTypes.Assist_Stun:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[2], value);
                break;

            case ParamTypes.Assist_Sleep:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[3], value);
                break;

            case ParamTypes.Assist_Charm:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[4], value);
                break;

            case ParamTypes.Assist_Stone:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[5], value);
                break;

            case ParamTypes.Assist_Blind:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[6], value);
                break;

            case ParamTypes.Assist_DisableSkill:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[7], value);
                break;

            case ParamTypes.Assist_DisableMove:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[8], value);
                break;

            case ParamTypes.Assist_DisableAttack:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[9], value);
                break;

            case ParamTypes.Assist_Zombie:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[10], value);
                break;

            case ParamTypes.Assist_DeathSentence:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[11], value);
                break;

            case ParamTypes.Assist_Berserk:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[12], value);
                break;

            case ParamTypes.Assist_Knockback:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[13], value);
                break;

            case ParamTypes.Assist_ResistBuff:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[14], value);
                break;

            case ParamTypes.Assist_ResistDebuff:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[15], value);
                break;

            case ParamTypes.Assist_Stop:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[16], value);
                break;

            case ParamTypes.Assist_Fast:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[17], value);
                break;

            case ParamTypes.Assist_Slow:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[18], value);
                break;

            case ParamTypes.Assist_AutoHeal:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[19], value);
                break;

            case ParamTypes.Assist_Donsoku:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[20], value);
                break;

            case ParamTypes.Assist_Rage:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[21], value);
                break;

            case ParamTypes.Assist_GoodSleep:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[22], value);
                break;

            case ParamTypes.Assist_ConditionAll:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[0], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[1], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[2], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[3], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[4], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[5], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[6], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[7], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[8], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[9], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[11], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[12], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[16], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[17], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[18], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[20], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[21], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[24], value);
                break;

            case ParamTypes.Resist_Fire:
                BuffEffect.SetBuffValue(method_type, ref status.element_resist.values[1], value);
                break;

            case ParamTypes.Resist_Water:
                BuffEffect.SetBuffValue(method_type, ref status.element_resist.values[2], value);
                break;

            case ParamTypes.Resist_Wind:
                BuffEffect.SetBuffValue(method_type, ref status.element_resist.values[3], value);
                break;

            case ParamTypes.Resist_Thunder:
                BuffEffect.SetBuffValue(method_type, ref status.element_resist.values[4], value);
                break;

            case ParamTypes.Resist_Shine:
                BuffEffect.SetBuffValue(method_type, ref status.element_resist.values[5], value);
                break;

            case ParamTypes.Resist_Dark:
                BuffEffect.SetBuffValue(method_type, ref status.element_resist.values[6], value);
                break;

            case ParamTypes.Resist_Poison:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[0], value);
                break;

            case ParamTypes.Resist_Paralysed:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[1], value);
                break;

            case ParamTypes.Resist_Stun:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[2], value);
                break;

            case ParamTypes.Resist_Sleep:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[3], value);
                break;

            case ParamTypes.Resist_Charm:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[4], value);
                break;

            case ParamTypes.Resist_Stone:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[5], value);
                break;

            case ParamTypes.Resist_Blind:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[6], value);
                break;

            case ParamTypes.Resist_DisableSkill:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[7], value);
                break;

            case ParamTypes.Resist_DisableMove:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[8], value);
                break;

            case ParamTypes.Resist_DisableAttack:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[9], value);
                break;

            case ParamTypes.Resist_Zombie:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[10], value);
                break;

            case ParamTypes.Resist_DeathSentence:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[11], value);
                break;

            case ParamTypes.Resist_Berserk:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[12], value);
                break;

            case ParamTypes.Resist_Knockback:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[13], value);
                break;

            case ParamTypes.Resist_ResistBuff:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[14], value);
                break;

            case ParamTypes.Resist_ResistDebuff:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[15], value);
                break;

            case ParamTypes.Resist_Stop:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[16], value);
                break;

            case ParamTypes.Resist_Fast:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[17], value);
                break;

            case ParamTypes.Resist_Slow:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[18], value);
                break;

            case ParamTypes.Resist_AutoHeal:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[19], value);
                break;

            case ParamTypes.Resist_Donsoku:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[20], value);
                break;

            case ParamTypes.Resist_Rage:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[21], value);
                break;

            case ParamTypes.Resist_GoodSleep:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[22], value);
                break;

            case ParamTypes.Resist_ConditionAll:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[0], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[1], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[2], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[3], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[4], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[5], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[6], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[7], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[8], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[9], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[11], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[12], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[16], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[18], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[20], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[21], value);
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[24], value);
                break;

            case ParamTypes.HitRate:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[3], value);
                break;

            case ParamTypes.AvoidRate:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[4], value);
                break;

            case ParamTypes.CriticalRate:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[5], value);
                break;

            case ParamTypes.GainJewel:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[13], value);
                break;

            case ParamTypes.UsedJewelRate:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[14], value);
                break;

            case ParamTypes.ActionCount:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[15], value);
                break;

            case ParamTypes.SlashAttack:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[6], value);
                break;

            case ParamTypes.PierceAttack:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[7], value);
                break;

            case ParamTypes.BlowAttack:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[8], value);
                break;

            case ParamTypes.ShotAttack:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[9], value);
                break;

            case ParamTypes.MagicAttack:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[10], value);
                break;

            case ParamTypes.ReactionAttack:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[11], value);
                break;

            case ParamTypes.JumpAttack:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[12], value);
                break;

            case ParamTypes.GutsRate:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[16], value);
                break;

            case ParamTypes.AutoJewel:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[17], value);
                break;

            case ParamTypes.ChargeTimeRate:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[18], value);
                break;

            case ParamTypes.CastTimeRate:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[19], value);
                break;

            case ParamTypes.BuffTurn:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[20], value);
                break;

            case ParamTypes.DebuffTurn:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[21], value);
                break;

            case ParamTypes.CombinationRange:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[22], value);
                break;

            case ParamTypes.HpCostRate:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[23], value);
                break;

            case ParamTypes.SkillUseCount:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[24], value);
                break;

            case ParamTypes.PoisonDamage:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[25], value);
                break;

            case ParamTypes.PoisonTurn:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[26], value);
                break;

            case ParamTypes.Assist_AutoJewel:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[23], value);
                break;

            case ParamTypes.Resist_AutoJewel:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[23], value);
                break;

            case ParamTypes.Assist_DisableHeal:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[24], value);
                break;

            case ParamTypes.Resist_DisableHeal:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[24], value);
                break;

            case ParamTypes.Resist_Slash:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[27], value);
                break;

            case ParamTypes.Resist_Pierce:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[28], value);
                break;

            case ParamTypes.Resist_Blow:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[29], value);
                break;

            case ParamTypes.Resist_Shot:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[30], value);
                break;

            case ParamTypes.Resist_Magic:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[31], value);
                break;

            case ParamTypes.Resist_Reaction:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[32], value);
                break;

            case ParamTypes.Resist_Jump:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[33], value);
                break;

            case ParamTypes.Avoid_Slash:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[34], value);
                break;

            case ParamTypes.Avoid_Pierce:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[35], value);
                break;

            case ParamTypes.Avoid_Blow:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[36], value);
                break;

            case ParamTypes.Avoid_Shot:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[37], value);
                break;

            case ParamTypes.Avoid_Magic:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[38], value);
                break;

            case ParamTypes.Avoid_Reaction:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[39], value);
                break;

            case ParamTypes.Avoid_Jump:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[40], value);
                break;

            case ParamTypes.GainJewelRate:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[41], value);
                break;

            case ParamTypes.UsedJewel:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[42], value);
                break;

            case ParamTypes.Assist_SingleAttack:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[25], value);
                break;

            case ParamTypes.Assist_AreaAttack:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[26], value);
                break;

            case ParamTypes.Resist_SingleAttack:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[25], value);
                break;

            case ParamTypes.Resist_AreaAttack:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[26], value);
                break;

            case ParamTypes.Assist_DecCT:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[27], value);
                break;

            case ParamTypes.Assist_IncCT:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[28], value);
                break;

            case ParamTypes.Resist_DecCT:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[27], value);
                break;

            case ParamTypes.Resist_IncCT:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[28], value);
                break;

            case ParamTypes.Assist_ESA_Fire:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[29], value);
                break;

            case ParamTypes.Assist_ESA_Water:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[30], value);
                break;

            case ParamTypes.Assist_ESA_Wind:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[31], value);
                break;

            case ParamTypes.Assist_ESA_Thunder:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[32], value);
                break;

            case ParamTypes.Assist_ESA_Shine:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[33], value);
                break;

            case ParamTypes.Assist_ESA_Dark:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[34], value);
                break;

            case ParamTypes.Resist_ESA_Fire:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[29], value);
                break;

            case ParamTypes.Resist_ESA_Water:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[30], value);
                break;

            case ParamTypes.Resist_ESA_Wind:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[31], value);
                break;

            case ParamTypes.Resist_ESA_Thunder:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[32], value);
                break;

            case ParamTypes.Resist_ESA_Shine:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[33], value);
                break;

            case ParamTypes.Resist_ESA_Dark:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[34], value);
                break;

            case ParamTypes.UnitDefenseFire:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[43], value);
                break;

            case ParamTypes.UnitDefenseWater:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[44], value);
                break;

            case ParamTypes.UnitDefenseWind:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[45], value);
                break;

            case ParamTypes.UnitDefenseThunder:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[46], value);
                break;

            case ParamTypes.UnitDefenseShine:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[47], value);
                break;

            case ParamTypes.UnitDefenseDark:
                BuffEffect.SetBuffValue(method_type, ref status.bonus.values[48], value);
                break;

            case ParamTypes.Assist_MaxDamageHp:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[35], value);
                break;

            case ParamTypes.Assist_MaxDamageMp:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_assist.values[36], value);
                break;

            case ParamTypes.Resist_MaxDamageHp:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[35], value);
                break;

            case ParamTypes.Resist_MaxDamageMp:
                BuffEffect.SetBuffValue(method_type, ref status.enchant_resist.values[36], value);
                break;
            }
        }
Пример #26
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);
                }
            }
        }
Пример #27
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
                            });
                        }
                    }
                }
            }
        }
Пример #28
0
        private void RefreshData()
        {
            JobData jobData = this.mUnit.GetJobData(this.mJobIndex);

            DataSource.Bind <UnitData>(this.Unit, this.mUnit);
            for (int index = 0; index < this.Equipments.Count; ++index)
            {
                EquipData equip = jobData.Equips[index];
                DataSource.Bind <EquipData>(((Component)this.Equipments[index]).get_gameObject(), equip);
                bool flag = equip != null && (equip.IsValid() && equip.IsEquiped());
                ((Selectable)this.Equipments[index]).set_interactable(flag);
                ((Component)this.EquipmentRawImages[index]).get_gameObject().SetActive(flag);
                this.EquipmentCursors[index].SetActive(Object.op_Equality((Object)this.mSelectedEquipItem, (Object)((Component)this.Equipments[index]).get_gameObject()));
            }
            this.mEnhanceEquipData.equip       = (EquipData)null;
            this.mEnhanceEquipData.gainexp     = 0;
            this.mEnhanceEquipData.is_enhanced = false;
            for (int index = 0; index < this.mEnhanceParameters.Count; ++index)
            {
                this.mEnhanceParameters[index].SetActive(false);
            }
            ((Selectable)this.BtnEnhance).set_interactable(false);
            EquipData equipData = !Object.op_Inequality((Object)this.mSelectedEquipItem, (Object)null) ? (EquipData)null : DataSource.FindDataOfClass <EquipData>(this.mSelectedEquipItem, (EquipData)null);
            int       num1      = 0;
            int       num2      = 0;

            for (int index = 0; index < this.mMaterialItems.Count; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                EnhanceEquipDetailWindow.\u003CRefreshData\u003Ec__AnonStorey242 dataCAnonStorey242 = new EnhanceEquipDetailWindow.\u003CRefreshData\u003Ec__AnonStorey242();
                // ISSUE: reference to a compiler-generated field
                dataCAnonStorey242.item = this.mMaterialItems[index];
                // ISSUE: reference to a compiler-generated method
                EnhanceMaterial enhanceMaterial1 = this.mEnhanceMaterials.Find(new Predicate <EnhanceMaterial>(dataCAnonStorey242.\u003C\u003Em__26F));
                if (enhanceMaterial1 == null)
                {
                    EnhanceMaterial enhanceMaterial2 = new EnhanceMaterial();
                    // ISSUE: reference to a compiler-generated field
                    enhanceMaterial2.item = dataCAnonStorey242.item;
                    enhanceMaterial2.num  = 0;
                    this.mEnhanceMaterials.Add(enhanceMaterial2);
                    enhanceMaterial1 = enhanceMaterial2;
                }
                if (equipData != null)
                {
                    // ISSUE: reference to a compiler-generated field
                    num1 += (int)dataCAnonStorey242.item.Param.enhace_cost * equipData.GetEnhanceCostScale() / 100 * enhanceMaterial1.num;
                    // ISSUE: reference to a compiler-generated field
                    num2 += (int)dataCAnonStorey242.item.Param.enhace_point * enhanceMaterial1.num;
                }
            }
            bool flag1 = false;

            if (Object.op_Inequality((Object)this.EquipSelectParent, (Object)null))
            {
                DataSource.Bind <EnhanceEquipData>(this.EquipSelectParent, (EnhanceEquipData)null);
                this.EquipSelectParent.get_gameObject().SetActive(false);
            }
            if (Object.op_Inequality((Object)this.TxtComment, (Object)null))
            {
                ((Component)this.TxtComment).get_gameObject().SetActive(false);
            }
            if (Object.op_Inequality((Object)this.mSelectedEquipItem, (Object)null))
            {
                this.mEnhanceEquipData.equip   = equipData;
                this.mEnhanceEquipData.gainexp = num2;
                if (equipData != null)
                {
                    BuffEffect buffEffect = equipData.Skill.GetBuffEffect(SkillEffectTargets.Target);
                    if (buffEffect != null && buffEffect.targets != null)
                    {
                        for (int index = 0; index < buffEffect.targets.Count; ++index)
                        {
                            if (index >= this.mEnhanceParameters.Count)
                            {
                                this.ParamUpTemplate.SetActive(true);
                                GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ParamUpTemplate);
                                gameObject.get_transform().SetParent(this.ParamUpLayoutParent, false);
                                this.mEnhanceParameters.Add(gameObject);
                                this.ParamUpTemplate.SetActive(false);
                            }
                            GameObject         enhanceParameter = this.mEnhanceParameters[index];
                            EquipItemParameter data             = DataSource.FindDataOfClass <EquipItemParameter>(enhanceParameter, (EquipItemParameter)null) ?? new EquipItemParameter();
                            data.equip       = equipData;
                            data.param_index = index;
                            DataSource.Bind <EquipItemParameter>(enhanceParameter, data);
                            enhanceParameter.SetActive(true);
                        }
                    }
                    flag1 = true;
                    if (equipData.Rank == equipData.GetRankCap())
                    {
                        if (Object.op_Inequality((Object)this.TxtComment, (Object)null))
                        {
                            this.TxtComment.set_text(LocalizedText.Get("sys.DIABLE_ENHANCE_RANKCAP_MESSAGE"));
                            ((Component)this.TxtComment).get_gameObject().SetActive(true);
                        }
                        flag1 = false;
                    }
                }
                if (Object.op_Inequality((Object)this.EquipSelectParent, (Object)null))
                {
                    DataSource.Bind <EnhanceEquipData>(this.EquipSelectParent, this.mEnhanceEquipData);
                    this.EquipSelectParent.get_gameObject().SetActive(true);
                }
            }
            else if (Object.op_Inequality((Object)this.TxtComment, (Object)null))
            {
                this.TxtComment.set_text(LocalizedText.Get("sys.ENHANCE_EQUIPMENT_MESSAGE"));
                ((Component)this.TxtComment).get_gameObject().SetActive(true);
            }
            this.mEnhanceEquipData.is_enhanced = flag1;
            if (Object.op_Inequality((Object)this.SelectedParent, (Object)null))
            {
                DataSource.Bind <EnhanceEquipData>(this.SelectedParent, this.mEnhanceEquipData);
                this.SelectedParent.get_gameObject().SetActive(flag1);
            }
            if (Object.op_Inequality((Object)this.TxtDisableEnhanceOnGauge, (Object)null))
            {
                ((Component)this.TxtDisableEnhanceOnGauge).get_gameObject().SetActive(!flag1);
            }
            if (Object.op_Inequality((Object)this.TxtCost, (Object)null))
            {
                this.TxtCost.set_text(num1.ToString());
            }
            if (Object.op_Inequality((Object)this.TxtJob, (Object)null))
            {
                this.TxtJob.set_text(jobData.Name);
            }
            if (flag1)
            {
                int num3 = equipData.CalcRankFromExp(equipData.Exp + num2);
                ((Selectable)this.BtnEnhance).set_interactable(equipData != null && equipData.Rank < num3);
            }
            if (Object.op_Inequality((Object)this.BtnAdd, (Object)null))
            {
                ((Selectable)this.BtnAdd).set_interactable(flag1 && Object.op_Inequality((Object)this.mSelectedMaterialItem, (Object)null));
            }
            if (Object.op_Inequality((Object)this.BtnSub, (Object)null))
            {
                ((Selectable)this.BtnSub).set_interactable(flag1 && Object.op_Inequality((Object)this.mSelectedMaterialItem, (Object)null));
            }
            this.mEnableEnhanceMaterials.Clear();
            for (int index = 0; index < this.mEnhanceMaterials.Count; ++index)
            {
                if (this.mEnhanceMaterials[index].item != null && this.mEnhanceMaterials[index].item.Num != 0)
                {
                    this.mEnableEnhanceMaterials.Add(this.mEnhanceMaterials[index]);
                }
            }
            this.SetData((object[])this.mEnableEnhanceMaterials.ToArray(), typeof(EnhanceMaterial));
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Пример #29
0
        public void Refresh(UnitData unit, int slot)
        {
            if (unit == null)
            {
                unit = MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID((long)GlobalVars.SelectedUnitUniqueID);
            }
            if (unit == null)
            {
                return;
            }
            int selectedJobIndex = this.GetSelectedJobIndex(unit);

            EquipData[] rankupEquips = unit.GetRankupEquips(selectedJobIndex);
            if (slot < 0 || rankupEquips.Length <= slot)
            {
                return;
            }
            EquipData equipData = rankupEquips[slot];
            ItemParam itemParam = equipData.ItemParam;

            if (this.mItemParamTree.Count == 0 || this.mItemParamTree[0] != itemParam)
            {
                this.mItemParamTree.Clear();
                this.mItemParamTree.Add(itemParam);
            }
            if (equipData != null && equipData.IsValid() && equipData.IsEquiped())
            {
                this.mEquipmentData = equipData;
            }
            else
            {
                this.mEquipmentData = new EquipData();
                this.mEquipmentData.Setup(itemParam.iname);
            }
            for (int index = 0; index < this.mEquipmentParameters.Count; ++index)
            {
                this.mEquipmentParameters[index].SetActive(false);
            }
            if (this.mEquipmentData != null && this.mEquipmentData.Skill != null)
            {
                BuffEffect buffEffect = this.mEquipmentData.Skill.GetBuffEffect(SkillEffectTargets.Target);
                if (buffEffect != null && buffEffect.targets != null)
                {
                    for (int index = 0; index < buffEffect.targets.Count; ++index)
                    {
                        if (index >= this.mEquipmentParameters.Count)
                        {
                            GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.EquipItemParamTemplate);
                            gameObject.get_transform().SetParent((Transform)this.EquipItemParamParent, false);
                            this.mEquipmentParameters.Add(gameObject);
                        }
                        GameObject         equipmentParameter = this.mEquipmentParameters[index];
                        EquipItemParameter data = DataSource.FindDataOfClass <EquipItemParameter>(equipmentParameter, (EquipItemParameter)null) ?? new EquipItemParameter();
                        data.equip       = this.mEquipmentData;
                        data.param_index = index;
                        DataSource.Bind <EquipItemParameter>(equipmentParameter, data);
                        equipmentParameter.SetActive(true);
                    }
                }
            }
            this.RefreshEquipButton(unit);
            DataSource.Bind <EquipData>(((Component)this).get_gameObject(), this.mEquipmentData);
            this.RefreshItemTree(this.mCreateItemSuccessed);
            this.RefreshRecipeItems();
            this.RefreshGainedQuests();
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }