Exemplo n.º 1
0
        public AbilityData CreateDeriveAbility(AbilityDeriveParam deriveParam)
        {
            AbilityData abilityData = new AbilityData();

            abilityData.Setup(this.Owner, this.UniqueID, deriveParam.DeriveAbilityIname, this.Exp, 0);
            abilityData.m_BaseAbility        = this;
            abilityData.IsNoneCategory       = this.IsNoneCategory;
            abilityData.m_AbilityDeriveParam = deriveParam;
            return(abilityData);
        }
Exemplo n.º 2
0
        private void UpdateLearningAbilities(bool bRarityUp = false)
        {
            if (!this.IsValid() || this.mArtifactParam == null || this.mArtifactParam.abil_inames == null)
            {
                return;
            }
            if (this.mLearningAbilities == null)
            {
                this.mLearningAbilities = new List <AbilityData>(this.mArtifactParam.abil_inames.Length);
            }
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            for (int index = 0; index < this.mArtifactParam.abil_inames.Length; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                ArtifactData.\u003CUpdateLearningAbilities\u003Ec__AnonStorey1E8 abilitiesCAnonStorey1E8 = new ArtifactData.\u003CUpdateLearningAbilities\u003Ec__AnonStorey1E8();
                if ((int)this.mLv >= this.mArtifactParam.abil_levels[index] && (int)this.mRarity >= this.mArtifactParam.abil_rareties[index])
                {
                    // ISSUE: reference to a compiler-generated field
                    abilitiesCAnonStorey1E8.param = instanceDirect.GetAbilityParam(this.mArtifactParam.abil_inames[index]);
                    // ISSUE: reference to a compiler-generated field
                    if (abilitiesCAnonStorey1E8.param != null)
                    {
                        // ISSUE: reference to a compiler-generated method
                        AbilityData abilityData1 = this.mLearningAbilities.Find(new Predicate <AbilityData>(abilitiesCAnonStorey1E8.\u003C\u003Em__1A4));
                        if (abilityData1 == null)
                        {
                            AbilityData abilityData2 = new AbilityData();
                            // ISSUE: reference to a compiler-generated field
                            abilityData2.Setup((UnitData)null, 0L, abilitiesCAnonStorey1E8.param.iname, (int)this.mRarity);
                            abilityData2.IsNoneCategory = true;
                            abilityData2.IsHideList     = this.mArtifactParam.abil_shows[index] == 0;
                            this.mLearningAbilities.Add(abilityData2);
                        }
                        else if (bRarityUp)
                        {
                            // ISSUE: reference to a compiler-generated field
                            abilityData1.Setup((UnitData)null, 0L, abilitiesCAnonStorey1E8.param.iname, (int)this.mRarity);
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        public static void TryCraeteAbilityData(TobiraParam tobiraParam, int currentLv, List <AbilityData> newAbilitys, List <AbilityData> oldAbilitys, bool isJust = false)
        {
            List <TobiraLearnAbilityParam> learnAbilityParamList = !isJust ? ((IEnumerable <TobiraLearnAbilityParam>)tobiraParam.LeanAbilityParam).Where <TobiraLearnAbilityParam>((Func <TobiraLearnAbilityParam, bool>)(learnAbil => learnAbil.Level <= currentLv)).ToList <TobiraLearnAbilityParam>() : ((IEnumerable <TobiraLearnAbilityParam>)tobiraParam.LeanAbilityParam).Where <TobiraLearnAbilityParam>((Func <TobiraLearnAbilityParam, bool>)(learnAbil => learnAbil.Level == currentLv)).ToList <TobiraLearnAbilityParam>();

            newAbilitys.Clear();
            oldAbilitys.Clear();
            newAbilitys.Capacity = learnAbilityParamList.Count;
            oldAbilitys.Capacity = learnAbilityParamList.Count;
            for (int index = 0; index < learnAbilityParamList.Count; ++index)
            {
                AbilityData abilityData1 = new AbilityData();
                AbilityData abilityData2 = (AbilityData)null;
                abilityData1.Setup((UnitData)null, 0L, learnAbilityParamList[index].AbilityIname, 1, 0);
                newAbilitys.Add(abilityData1);
                if (!string.IsNullOrEmpty(learnAbilityParamList[index].AbilityOverwrite) && (learnAbilityParamList[index].AbilityAddType == TobiraLearnAbilityParam.AddType.JobOverwrite || learnAbilityParamList[index].AbilityAddType == TobiraLearnAbilityParam.AddType.MasterOverwrite))
                {
                    abilityData2 = new AbilityData();
                    abilityData2.Setup((UnitData)null, 0L, learnAbilityParamList[index].AbilityOverwrite, 0, 0);
                }
                oldAbilitys.Add(abilityData2);
            }
        }
Exemplo n.º 4
0
        private void UpdateLearningAbilities(bool bRarityUp = false)
        {
            if (!this.IsValid() || this.mArtifactParam == null || this.mArtifactParam.abil_inames == null)
            {
                return;
            }
            if (this.mLearningAbilities == null)
            {
                this.mLearningAbilities = new List <AbilityData>(this.mArtifactParam.abil_inames.Length);
            }
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            for (int index = 0; index < this.mArtifactParam.abil_inames.Length; ++index)
            {
                if ((int)this.mLv >= this.mArtifactParam.abil_levels[index] && (int)this.mRarity >= this.mArtifactParam.abil_rareties[index])
                {
                    AbilityParam param = instanceDirect.GetAbilityParam(this.mArtifactParam.abil_inames[index]);
                    if (param != null)
                    {
                        AbilityData abilityData1 = this.mLearningAbilities.Find((Predicate <AbilityData>)(p => p.Param == param));
                        if (abilityData1 == null)
                        {
                            AbilityData abilityData2 = new AbilityData();
                            abilityData2.Setup((UnitData)null, 0L, param.iname, (int)this.mRarity, 0);
                            abilityData2.IsNoneCategory = true;
                            abilityData2.IsHideList     = this.mArtifactParam.abil_shows[index] == 0;
                            this.mLearningAbilities.Add(abilityData2);
                        }
                        else if (bRarityUp)
                        {
                            abilityData1.Setup((UnitData)null, 0L, param.iname, (int)this.mRarity, 0);
                        }
                    }
                }
            }
        }
Exemplo n.º 5
0
 public void JobRankUp()
 {
     ++this.mRank;
     for (int index = 0; index < this.mEquips.Length; ++index)
     {
         this.mEquips[index].Setup(this.GetRankupItemID(this.Rank, index));
     }
     if ((int)this.mRank == 1 && !string.IsNullOrEmpty(this.mJobParam.fixed_ability) && this.mLearnAbilitys.Find((Predicate <AbilityData>)(p => p.AbilityID == this.mJobParam.fixed_ability)) == null)
     {
         AbilityData        ability          = new AbilityData();
         List <AbilityData> learnedAbilities = this.mOwner.GetAllLearnedAbilities(false);
         string             fixedAbility     = this.mJobParam.fixed_ability;
         long val1 = 0;
         int  exp  = 0;
         for (int index = 0; index < learnedAbilities.Count; ++index)
         {
             val1 = Math.Max(val1, learnedAbilities[index].UniqueID);
         }
         long iid = val1 + 1L;
         try
         {
             ability.Setup(this.mOwner, iid, fixedAbility, exp, 0);
             this.mLearnAbilitys.Add(ability);
             this.SetAbilitySlot(0, ability);
         }
         catch (Exception ex)
         {
             DebugUtility.LogException(ex);
         }
     }
     OString[] learningAbilitys = this.GetLearningAbilitys((int)this.mRank);
     if (learningAbilitys == null)
     {
         return;
     }
     for (int index1 = 0; index1 < learningAbilitys.Length; ++index1)
     {
         string abilityID = (string)learningAbilitys[index1];
         if (!string.IsNullOrEmpty(abilityID) && this.mLearnAbilitys.Find((Predicate <AbilityData>)(p => p.AbilityID == abilityID)) == null)
         {
             AbilityData        abilityData      = new AbilityData();
             string             iname            = abilityID;
             List <AbilityData> learnedAbilities = this.mOwner.GetAllLearnedAbilities(false);
             long val1 = 0;
             int  exp  = 0;
             for (int index2 = 0; index2 < learnedAbilities.Count; ++index2)
             {
                 val1 = Math.Max(val1, learnedAbilities[index2].UniqueID);
             }
             long iid = val1 + 1L;
             try
             {
                 abilityData.Setup(this.mOwner, iid, iname, exp, 0);
                 this.mLearnAbilitys.Add(abilityData);
             }
             catch (Exception ex)
             {
                 DebugUtility.LogException(ex);
             }
         }
     }
 }
Exemplo n.º 6
0
        public void Deserialize(UnitData owner, Json_Job json)
        {
            if (json == null)
            {
                throw new InvalidJSONException();
            }
            this.mJobParam = MonoSingleton <GameManager> .GetInstanceDirect().GetJobParam(json.iname);

            this.mUniqueID   = json.iid;
            this.mRank       = (OInt)json.rank;
            this.mOwner      = owner;
            this.mSelectSkin = json.cur_skin;
            for (int index = 0; index < this.mEquips.Length; ++index)
            {
                this.mEquips[index].Setup(this.mJobParam.GetRankupItemID((int)this.mRank, index));
            }
            if (json.equips != null)
            {
                for (int index = 0; index < json.equips.Length; ++index)
                {
                    this.mEquips[index].Equip(json.equips[index]);
                }
            }
            if (!string.IsNullOrEmpty(this.Param.atkskill[0]))
            {
                this.mNormalAttackSkill.Setup(this.Param.atkskill[0], 1, 1, (MasterParam)null);
            }
            else
            {
                this.mNormalAttackSkill.Setup(this.Param.atkskill[(int)owner.UnitParam.element], 1, 1, (MasterParam)null);
            }
            if (!string.IsNullOrEmpty(this.Param.master) && MonoSingleton <GameManager> .Instance.MasterParam.FixParam.IsJobMaster)
            {
                if (this.mJobMaster == null)
                {
                    this.mJobMaster = new SkillData();
                }
                this.mJobMaster.Setup(this.Param.master, 1, 1, (MasterParam)null);
            }
            if (json.abils != null)
            {
                Array.Sort <Json_Ability>(json.abils, (Comparison <Json_Ability>)((src, dsc) => (int)(src.iid - dsc.iid)));
                for (int index = 0; index < json.abils.Length; ++index)
                {
                    AbilityData abilityData = new AbilityData();
                    string      iname       = json.abils[index].iname;
                    long        iid         = json.abils[index].iid;
                    int         exp         = json.abils[index].exp;
                    abilityData.Setup(this.mOwner, iid, iname, exp, 0);
                    this.mLearnAbilitys.Add(abilityData);
                }
            }
            Array.Clear((Array)this.mAbilitySlots, 0, this.mAbilitySlots.Length);
            if (json.select != null && json.select.abils != null)
            {
                for (int index = 0; index < json.select.abils.Length && index < this.mAbilitySlots.Length; ++index)
                {
                    this.mAbilitySlots[index] = json.select.abils[index];
                }
            }
            for (int index = 0; index < this.mArtifactDatas.Length; ++index)
            {
                this.mArtifactDatas[index] = (ArtifactData)null;
            }
            Array.Clear((Array)this.mArtifacts, 0, this.mArtifacts.Length);
            if (json.select != null && json.select.artifacts != null)
            {
                for (int index = 0; index < json.select.artifacts.Length && index < this.mArtifacts.Length; ++index)
                {
                    this.mArtifacts[index] = json.select.artifacts[index];
                }
            }
            if (json.artis != null)
            {
                for (int index1 = 0; index1 < json.artis.Length; ++index1)
                {
                    if (json.artis[index1] != null)
                    {
                        int index2 = Array.IndexOf <long>(this.mArtifacts, json.artis[index1].iid);
                        if (index2 >= 0)
                        {
                            ArtifactData artifactData = new ArtifactData();
                            artifactData.Deserialize(json.artis[index1]);
                            this.mArtifactDatas[index2] = artifactData;
                        }
                    }
                }
            }
            if (string.IsNullOrEmpty(json.cur_skin))
            {
                return;
            }
            ArtifactData artifactData1 = new ArtifactData();

            artifactData1.Deserialize(new Json_Artifact()
            {
                iname = json.cur_skin
            });
            this.mSelectSkinData = artifactData1;
        }
Exemplo n.º 7
0
 public void JobRankUp()
 {
     ++this.mRank;
     for (int index = 0; index < this.mEquips.Length; ++index)
     {
         this.mEquips[index].Setup(this.GetRankupItemID(this.Rank, index));
     }
     if ((int)this.mRank == 1 && !string.IsNullOrEmpty(this.mJobParam.fixed_ability) && this.mLearnAbilitys.Find((Predicate <AbilityData>)(p => p.AbilityID == this.mJobParam.fixed_ability)) == null)
     {
         AbilityData        ability          = new AbilityData();
         List <AbilityData> learnedAbilities = this.mOwner.GetAllLearnedAbilities();
         string             fixedAbility     = this.mJobParam.fixed_ability;
         long val1 = 0;
         int  exp  = 0;
         for (int index = 0; index < learnedAbilities.Count; ++index)
         {
             val1 = Math.Max(val1, learnedAbilities[index].UniqueID);
         }
         long iid = val1 + 1L;
         try
         {
             ability.Setup(this.mOwner, iid, fixedAbility, exp);
             this.mLearnAbilitys.Add(ability);
             this.SetAbilitySlot(0, ability);
         }
         catch (Exception ex)
         {
             DebugUtility.LogException(ex);
         }
     }
     OString[] learningAbilitys = this.GetLearningAbilitys((int)this.mRank);
     if (learningAbilitys == null)
     {
         return;
     }
     for (int index1 = 0; index1 < learningAbilitys.Length; ++index1)
     {
         // ISSUE: object of a compiler-generated type is created
         // ISSUE: variable of a compiler-generated type
         JobData.\u003CJobRankUp\u003Ec__AnonStorey28E upCAnonStorey28E = new JobData.\u003CJobRankUp\u003Ec__AnonStorey28E();
         // ISSUE: reference to a compiler-generated field
         upCAnonStorey28E.abilityID = (string)learningAbilitys[index1];
         // ISSUE: reference to a compiler-generated field
         // ISSUE: reference to a compiler-generated method
         if (!string.IsNullOrEmpty(upCAnonStorey28E.abilityID) && this.mLearnAbilitys.Find(new Predicate <AbilityData>(upCAnonStorey28E.\u003C\u003Em__330)) == null)
         {
             AbilityData abilityData = new AbilityData();
             // ISSUE: reference to a compiler-generated field
             string             abilityId        = upCAnonStorey28E.abilityID;
             List <AbilityData> learnedAbilities = this.mOwner.GetAllLearnedAbilities();
             long val1 = 0;
             int  exp  = 0;
             for (int index2 = 0; index2 < learnedAbilities.Count; ++index2)
             {
                 val1 = Math.Max(val1, learnedAbilities[index2].UniqueID);
             }
             long iid = val1 + 1L;
             try
             {
                 abilityData.Setup(this.mOwner, iid, abilityId, exp);
                 this.mLearnAbilitys.Add(abilityData);
             }
             catch (Exception ex)
             {
                 DebugUtility.LogException(ex);
             }
         }
     }
 }