Beispiel #1
0
        public static ConceptCardSkillDatailData CreateConceptCardSkillDatailData(SkillData groupSkill)
        {
            ConceptCardSkillDatailData cardSkillDatailData = (ConceptCardSkillDatailData)null;

            if (groupSkill == null)
            {
                return(cardSkillDatailData);
            }
            return(new ConceptCardSkillDatailData(ConceptCardEquipEffect.CreateFromGroupSkill(groupSkill), groupSkill, ConceptCardDetailAbility.ShowType.Skill, (LearningSkill)null));
        }
Beispiel #2
0
        private void Start()
        {
            ConceptCardSkillDatailData dataOfClass = DataSource.FindDataOfClass <ConceptCardSkillDatailData>(((Component)this).get_gameObject(), (ConceptCardSkillDatailData)null);

            if (dataOfClass == null)
            {
                return;
            }
            this.SetData(dataOfClass);
        }
        private static void SetupConceptCard(GameObject obj, ConceptCardSkillDatailData conceptCardSkillDatailData, ConceptCardDetailAbility.ClickDetail onClickDetail)
        {
            ConceptCardDetailAbility component = (ConceptCardDetailAbility)obj.GetComponent <ConceptCardDetailAbility>();

            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
            {
                return;
            }
            component.SetCardSkill(conceptCardSkillDatailData);
            component.SetAbilityDetailParent(onClickDetail);
        }
 public void OnClickDetail(ConceptCardSkillDatailData data)
 {
     if (Object.op_Equality((Object)this.mAbilityDetailParent, (Object)null) || Object.op_Inequality((Object)this.mCardAbilityDescription, (Object)null))
     {
         return;
     }
     this.mCardAbilityDescription = (GameObject)Object.Instantiate <GameObject>((M0)this.mCardAbilityDescriptionPrefab);
     DataSource.Bind <ConceptCardSkillDatailData>(this.mCardAbilityDescription, data);
     this.abilityCanvas = UIUtility.PushCanvas(false, -1);
     this.mCardAbilityDescription.get_transform().SetParent(((Component)this.abilityCanvas).get_transform(), false);
     ((DestroyEventListener)this.mCardAbilityDescription.AddComponent <DestroyEventListener>()).Listeners += new DestroyEventListener.DestroyEvent(this.OnDestroyAbilityDescription);
 }
        public void SetupWithConceptCard(ConceptCardSkillDatailData conceptCardSkillDatailData, UnitData unitData, ConceptCardDetailAbility.ClickDetail onClickDetail)
        {
            bool flag = conceptCardSkillDatailData.effect != null && conceptCardSkillDatailData.effect.Ability != null;

            if (unitData != null && conceptCardSkillDatailData.type != ConceptCardDetailAbility.ShowType.LockSkill && flag)
            {
                List <AbilityData> abilityDataList = new List <AbilityData>();
                AbilityData        ability         = conceptCardSkillDatailData.effect.Ability;
                using (List <AbilityData> .Enumerator enumerator1 = unitData.SearchDerivedAbilitys(ability).GetEnumerator())
                {
                    while (enumerator1.MoveNext())
                    {
                        using (List <ConceptCardSkillDatailData> .Enumerator enumerator2 = ConceptCardUtility.CreateConceptCardSkillDatailData(enumerator1.Current).GetEnumerator())
                        {
                            while (enumerator2.MoveNext())
                            {
                                ConceptCardSkillDatailData current = enumerator2.Current;
                                if (current.type == ConceptCardDetailAbility.ShowType.Ability)
                                {
                                    AbilityDeriveList.SetupConceptCard(this.CreateDeriveAbilityItem(current.effect.Ability), current, onClickDetail);
                                }
                            }
                        }
                    }
                }
            }
            if (!this.HasDerive)
            {
                this.ShowFlags_IsOn(AbilityDeriveList.ShowFlags.ShowBaseAbility);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_BaseAbilityRoot, (UnityEngine.Object)null))
            {
                if (flag)
                {
                    AbilityData ability = conceptCardSkillDatailData.effect.Ability;
                    AbilityDeriveList.SetupConceptCard(this.m_BaseAbilityRoot, conceptCardSkillDatailData, onClickDetail);
                    DataSource.Bind <AbilityData>(this.m_BaseAbilityRoot, ability);
                }
                else
                {
                    SkillData skillData = conceptCardSkillDatailData.skill_data;
                    AbilityDeriveList.SetupConceptCard(this.m_BaseAbilityRoot, conceptCardSkillDatailData, onClickDetail);
                    DataSource.Bind <SkillData>(this.m_BaseAbilityRoot, skillData);
                }
            }
            this.UpdateUIActive();
        }
Beispiel #6
0
        public void SetData(ConceptCardSkillDatailData data)
        {
            switch (data.type)
            {
            case ConceptCardDetailAbility.ShowType.Skill:
                this.SetGroup(data);
                break;

            case ConceptCardDetailAbility.ShowType.Ability:
                this.SetGroup(data);
                break;

            case ConceptCardDetailAbility.ShowType.LockSkill:
                this.SetGroup(data);
                break;
            }
        }
Beispiel #7
0
 public void SetGroup(ConceptCardSkillDatailData data)
 {
     if (data.skill_data == null)
     {
         return;
     }
     this.SetText(this.mAbilityName, data.skill_data.Name);
     if (data.type == ConceptCardDetailAbility.ShowType.LockSkill)
     {
         if (data.learning_skill == null)
         {
             return;
         }
         this.SetText(this.mDescriptionText, LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_LV", new object[1]
         {
             (object)data.learning_skill.locklv
         }));
     }
     else
     {
         this.SetText(this.mDescriptionText, GameUtility.GetExternalLocalizedText("skill", data.skill_data.SkillParam.iname, "CONCEPT_TXT"));
     }
 }
        public void CreateSkillPrefab(GameObject ability_detail_parent)
        {
            List <ConceptCardSkillDatailData> abilityDatailData = this.mConceptCardData.GetAbilityDatailData();

            this.mAbilityDetailParent = ability_detail_parent;
            if (Object.op_Inequality((Object)this.m_ShowBaseToggle, (Object)null))
            {
                this.m_ShowBaseToggle.set_interactable(false);
            }
            for (int index = 0; index < this.m_AbilityDeriveList.Count; ++index)
            {
                ((Component)this.m_AbilityDeriveList[index]).get_gameObject().SetActive(false);
            }
            for (int index = 0; index < abilityDatailData.Count; ++index)
            {
                ConceptCardSkillDatailData conceptCardSkillDatailData = abilityDatailData[index];
                AbilityDeriveList          abilityDeriveList;
                if (index < this.m_AbilityDeriveList.Count)
                {
                    abilityDeriveList = this.m_AbilityDeriveList[index];
                }
                else
                {
                    abilityDeriveList = this.CreateAbilityListItem();
                    this.m_AbilityDeriveList.Add(abilityDeriveList);
                }
                abilityDeriveList.SetupWithConceptCard(conceptCardSkillDatailData, this.m_UnitData, new ConceptCardDetailAbility.ClickDetail(this.OnClickDetail));
                if (Object.op_Inequality((Object)this.m_ShowBaseToggle, (Object)null))
                {
                    Selectable showBaseToggle = this.m_ShowBaseToggle;
                    showBaseToggle.set_interactable(showBaseToggle.get_interactable() | abilityDeriveList.HasDerive);
                }
                GameUtility.SetGameObjectActive((Component)abilityDeriveList, true);
            }
            GameUtility.SetGameObjectActive(this.AbilityTemplate, false);
            this.AbilityTemplate.get_gameObject().SetActive(false);
        }
 public void SetCardSkill(ConceptCardSkillDatailData data)
 {
     this.SwitchObject(true, this.mCardSkillObject, this.mCardAbilityObject);
     this.SwitchObject(data.type == ConceptCardDetailAbility.ShowType.Skill, this.mCardSkillNameObject, this.mCardAbilityNameObject);
     if (data.skill_data == null)
     {
         this.SetText(this.mCardAbilityDescription, string.Empty);
     }
     else
     {
         DataSource.Bind <AbilityData>(((Component)this).get_gameObject(), data.effect == null || data.effect.Ability == null ? (AbilityData)null : data.effect.Ability);
         DataSource.Bind <SkillData>(((Component)this).get_gameObject(), data.skill_data);
         StringBuilder stringBuilder = new StringBuilder();
         stringBuilder.Append(data.skill_data.SkillParam.expr);
         this.SetText(this.mCardAbilityDescription, stringBuilder.ToString());
         if (Object.op_Inequality((Object)this.mCardSkillStatusList, (Object)null))
         {
             ((Component)this.mCardSkillStatusList).get_gameObject().SetActive(false);
         }
         if (data.skill_data.Condition == ESkillCondition.CardSkill && Object.op_Inequality((Object)this.mCardSkillStatusList, (Object)null) && data.skill_data != null)
         {
             ((Component)this.mCardSkillStatusList).get_gameObject().SetActive(true);
             BaseStatus status       = new BaseStatus();
             BaseStatus scale_status = new BaseStatus();
             BaseStatus baseStatus1  = new BaseStatus();
             BaseStatus baseStatus2  = new BaseStatus();
             SkillData.GetPassiveBuffStatus(data.skill_data, (BuffEffect[])null, EElement.None, ref status, ref scale_status);
             if (data.effect != null && data.effect.AddCardSkillBuffEffectAwake != null)
             {
                 BaseStatus total_add   = new BaseStatus();
                 BaseStatus total_scale = new BaseStatus();
                 data.effect.AddCardSkillBuffEffectAwake.GetBaseStatus(ref total_add, ref total_scale);
                 baseStatus1.Add(total_add);
                 baseStatus2.Add(total_scale);
             }
             if (data.effect != null && data.effect.AddCardSkillBuffEffectLvMax != null)
             {
                 BaseStatus total_add   = new BaseStatus();
                 BaseStatus total_scale = new BaseStatus();
                 data.effect.AddCardSkillBuffEffectLvMax.GetBaseStatus(ref total_add, ref total_scale);
                 baseStatus1.Add(total_add);
                 baseStatus2.Add(total_scale);
             }
             if (ConceptCardDescription.EnhanceInfo == null)
             {
                 this.mCardSkillStatusList.SetValues_TotalAndBonus(status, scale_status, status, scale_status, baseStatus1, baseStatus2, baseStatus1, baseStatus2);
             }
             else
             {
                 int        lvCap         = (int)ConceptCardDescription.EnhanceInfo.Target.LvCap;
                 int        predictLv     = ConceptCardDescription.EnhanceInfo.predictLv;
                 int        predictAwake  = ConceptCardDescription.EnhanceInfo.predictAwake;
                 int        awakeCountCap = ConceptCardDescription.EnhanceInfo.Target.AwakeCountCap;
                 BaseStatus add           = new BaseStatus();
                 BaseStatus scale         = new BaseStatus();
                 ConceptCardParam.GetSkillAllStatus(data.skill_data.SkillID, lvCap, predictLv, ref add, ref scale);
                 BaseStatus total_add1   = new BaseStatus();
                 BaseStatus total_scale1 = new BaseStatus();
                 data.effect.GetAddCardSkillBuffStatusAwake(predictAwake, awakeCountCap, ref total_add1, ref total_scale1);
                 BaseStatus total_add2   = new BaseStatus();
                 BaseStatus total_scale2 = new BaseStatus();
                 data.effect.GetAddCardSkillBuffStatusLvMax(predictLv, lvCap, predictAwake, ref total_add2, ref total_scale2);
                 BaseStatus modBonusAdd = new BaseStatus();
                 BaseStatus modBonusMul = new BaseStatus();
                 modBonusAdd.Add(total_add1);
                 modBonusAdd.Add(total_add2);
                 modBonusMul.Add(total_scale1);
                 modBonusMul.Add(total_scale2);
                 this.mCardSkillStatusList.SetValues_TotalAndBonus(status, scale_status, add, scale, baseStatus1, baseStatus2, modBonusAdd, modBonusMul);
             }
         }
         if (Object.op_Inequality((Object)this.mLock, (Object)null))
         {
             this.mLock.SetActive(data.type == ConceptCardDetailAbility.ShowType.LockSkill);
         }
         this.mShowData = data;
         GameParameter.UpdateAll(((Component)this).get_gameObject());
     }
 }