// Token: 0x0600E3ED RID: 58349 RVA: 0x003D3E14 File Offset: 0x003D2014
        public void InitFettersConfessionUnlockCondition(int heroFetterId, int confessLevel, bool isFetterUnLock, int curLevel)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_InitFettersConfessionUnlockConditionInt32Int32BooleanInt32_hotfix != null)
            {
                this.m_InitFettersConfessionUnlockConditionInt32Int32BooleanInt32_hotfix.call(new object[]
                {
                    this,
                    heroFetterId,
                    confessLevel,
                    isFetterUnLock,
                    curLevel
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            IConfigDataLoader        configDataLoader         = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;
            ConfigDataHeroFetterInfo configDataHeroFetterInfo = configDataLoader.GetConfigDataHeroFetterInfo(heroFetterId);

            if (!isFetterUnLock)
            {
                this.m_stateCtrl.SetToUIState("Lock", false, true);
            }
            else
            {
                if (curLevel != confessLevel)
                {
                    this.m_skillCurLevelValue.text = curLevel.ToString();
                    this.m_skillMaxLevelValue.text = confessLevel.ToString();
                    this.m_stateCtrl.SetToUIState("Normal", false, true);
                }
                else
                {
                    this.m_stateCtrl.SetToUIState("Max", false, true);
                }
                this.m_skillIconImage.sprite = AssetUtility.Instance.GetSprite(configDataHeroFetterInfo.Icon);
                this.m_skillNameText.text    = configDataHeroFetterInfo.Name;
            }
        }
Exemplo n.º 2
0
        // Token: 0x06003B16 RID: 15126 RVA: 0x0010D864 File Offset: 0x0010BA64
        public static BattleActorSetup CreateBattleActorSetupFromBattleHero(IConfigDataLoader configDataLoader, BattleHero hero, int level = 0, int behaviorId = -1, int groupId = 0)
        {
            BattleActorSetup battleActorSetup = new BattleActorSetup();

            battleActorSetup.HeroInfo          = configDataLoader.GetConfigDataHeroInfo(hero.HeroId);
            battleActorSetup.JobConnectionInfo = configDataLoader.GetConfigDataJobConnectionInfo(hero.ActiveHeroJobRelatedId);
            battleActorSetup.SoldierInfo       = configDataLoader.GetConfigDataSoldierInfo(hero.SelectedSoldierId);
            battleActorSetup.HeroStar          = hero.StarLevel;
            battleActorSetup.JobLevel          = hero.GetJob(hero.ActiveHeroJobRelatedId).JobLevel;
            battleActorSetup.SoldierCount      = configDataLoader.Const_SoldierCountMax;
            battleActorSetup.ActionValue       = hero.ActionValue;
            battleActorSetup.BehaviorId        = behaviorId;
            battleActorSetup.GroupId           = groupId;
            battleActorSetup.PlayerIndex       = -1;
            if (level > 0)
            {
                battleActorSetup.HeroLevel = level;
            }
            else
            {
                battleActorSetup.HeroLevel = hero.Level;
            }
            if (hero.SelectedSkillList.Count > 0)
            {
                List <ConfigDataSkillInfo> list = new List <ConfigDataSkillInfo>();
                foreach (int key in hero.SelectedSkillList)
                {
                    ConfigDataSkillInfo configDataSkillInfo = configDataLoader.GetConfigDataSkillInfo(key);
                    if (configDataSkillInfo != null)
                    {
                        list.Add(configDataSkillInfo);
                    }
                }
                if (list.Count > 0)
                {
                    battleActorSetup.SkillInfos = list.ToArray();
                }
            }
            if (hero.Jobs.Count > 0)
            {
                List <ConfigDataJobInfo> list2 = new List <ConfigDataJobInfo>();
                foreach (BattleHeroJob battleHeroJob in hero.Jobs)
                {
                    ConfigDataJobConnectionInfo configDataJobConnectionInfo = configDataLoader.GetConfigDataJobConnectionInfo(battleHeroJob.JobRelatedId);
                    if (configDataJobConnectionInfo.IsJobLevelMax(battleHeroJob.JobLevel))
                    {
                        list2.Add(configDataJobConnectionInfo.m_jobInfo);
                    }
                }
                if (list2.Count > 0)
                {
                    battleActorSetup.MasterJobInfos = list2.ToArray();
                }
            }
            if (hero.Fetters.Count > 0)
            {
                List <ConfigDataSkillInfo> list3 = new List <ConfigDataSkillInfo>();
                foreach (KeyValuePair <int, int> keyValuePair in hero.Fetters)
                {
                    ConfigDataHeroFetterInfo configDataHeroFetterInfo = configDataLoader.GetConfigDataHeroFetterInfo(keyValuePair.Key);
                    if (configDataHeroFetterInfo != null)
                    {
                        int num = keyValuePair.Value - 1;
                        if (num < configDataHeroFetterInfo.GotSkills_ID.Count)
                        {
                            ConfigDataSkillInfo configDataSkillInfo2 = configDataLoader.GetConfigDataSkillInfo(configDataHeroFetterInfo.GotSkills_ID[num]);
                            if (configDataSkillInfo2 != null)
                            {
                                list3.Add(configDataSkillInfo2);
                            }
                        }
                    }
                }
                if (list3.Count > 0)
                {
                    battleActorSetup.FetterSkillInfos = list3.ToArray();
                }
            }
            if (hero.Equipments.Count > 0)
            {
                List <BattleActorEquipment> list4 = new List <BattleActorEquipment>();
                foreach (BattleHeroEquipment battleHeroEquipment in hero.Equipments)
                {
                    ConfigDataEquipmentInfo configDataEquipmentInfo = configDataLoader.GetConfigDataEquipmentInfo(battleHeroEquipment.Id);
                    if (configDataEquipmentInfo != null)
                    {
                        BattleActorEquipment battleActorEquipment = new BattleActorEquipment();
                        battleActorEquipment.EquipmentInfo = configDataEquipmentInfo;
                        battleActorEquipment.Level         = battleHeroEquipment.Level;
                        if (battleHeroEquipment.EnchantProperties.Count > 0)
                        {
                            battleActorEquipment.EnchantProperties = new CommonBattleProperty[battleHeroEquipment.EnchantProperties.Count];
                            for (int i = 0; i < battleHeroEquipment.EnchantProperties.Count; i++)
                            {
                                battleActorEquipment.EnchantProperties[i] = battleHeroEquipment.EnchantProperties[i];
                            }
                        }
                        list4.Add(battleActorEquipment);
                    }
                }
                if (list4.Count > 0)
                {
                    battleActorSetup.Equipments = list4.ToArray();
                }
                List <ConfigDataSkillInfo> equipmentResonanceSkillInfos = BattleUtility.GetEquipmentResonanceSkillInfos(configDataLoader, hero.Equipments);
                if (equipmentResonanceSkillInfos.Count > 0)
                {
                    battleActorSetup.ResonanceSkillInfos = equipmentResonanceSkillInfos.ToArray();
                }
            }
            battleActorSetup.HeroCharImageSkinResourceInfo = hero.GetHeroCharImageSkinResourceInfo(configDataLoader);
            battleActorSetup.HeroModelSkinResourceInfo     = hero.GetHeroActiveJobModelSkinResourceInfo(configDataLoader);
            battleActorSetup.SoldierModelSkinResourceInfo  = hero.GetSelectedSoldierModelSkinResourceInfo(configDataLoader);
            return(battleActorSetup);
        }