Пример #1
0
        private void UpdateButton(SkillSelectButton p_btn, ESkillID p_skill)
        {
            DummyCharacter           selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter();
            CharacterClassStaticData staticData             = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)selectedDummyCharacter.Class);
            ETier etier = ETier.NONE;

            for (Int32 i = 0; i < staticData.GrandMasterSkills.Length; i++)
            {
                if (staticData.GrandMasterSkills[i] == (Int32)p_skill)
                {
                    etier = ETier.GRAND_MASTER;
                }
            }
            for (Int32 j = 0; j < staticData.MasterSkills.Length; j++)
            {
                if (staticData.MasterSkills[j] == (Int32)p_skill)
                {
                    etier = ETier.MASTER;
                }
            }
            for (Int32 k = 0; k < staticData.ExpertSkills.Length; k++)
            {
                if (staticData.ExpertSkills[k] == (Int32)p_skill)
                {
                    etier = ETier.EXPERT;
                }
            }
            SkillStaticData staticData2 = StaticDataHandler.GetStaticData <SkillStaticData>(EDataType.SKILL, (Int32)p_skill);

            p_btn.Init(staticData2, isDefaultSkill(staticData, staticData2), !isStartSkill(staticData, staticData2) && etier != ETier.NONE, selectedDummyCharacter.IsSkillPicked(staticData2.StaticID) || isStartSkill(staticData, staticData2), etier);
        }
Пример #2
0
 public Skill(Int32 p_skillStaticID, ETier p_maxTier)
 {
     m_tier1Effects = new List <SkillEffectStaticData>();
     m_tier2Effects = new List <SkillEffectStaticData>();
     m_tier3Effects = new List <SkillEffectStaticData>();
     m_tier4Effects = new List <SkillEffectStaticData>();
     m_currentlyAvailableEffects     = new List <SkillEffectStaticData>();
     m_availableScalingEffects       = new List <SkillEffectStaticData>();
     m_tier1ScalingEffects           = new List <SkillEffectStaticData>();
     m_requiredSkillLevelNovice      = ConfigManager.Instance.Game.RequiredSkillLevelNovice;
     m_requiredSkillLevelExpert      = ConfigManager.Instance.Game.RequiredSkillLevelExpert;
     m_requiredSkillLevelMaster      = ConfigManager.Instance.Game.RequiredSkillLevelMaster;
     m_requiredSkillLevelGrandMaster = ConfigManager.Instance.Game.RequiredSkillLevelGrandMaster;
     m_maxTier    = p_maxTier;
     m_staticData = StaticDataHandler.GetStaticData <SkillStaticData>(EDataType.SKILL, p_skillStaticID);
     if (m_maxTier >= ETier.NOVICE)
     {
         InitSkillEffectData(m_staticData.Tier1Effects, m_tier1Effects);
     }
     if (m_maxTier >= ETier.EXPERT)
     {
         InitSkillEffectData(m_staticData.Tier2Effects, m_tier2Effects);
     }
     if (m_maxTier >= ETier.MASTER)
     {
         InitSkillEffectData(m_staticData.Tier3Effects, m_tier3Effects);
     }
     if (m_maxTier >= ETier.GRAND_MASTER)
     {
         InitSkillEffectData(m_staticData.Tier4Effects, m_tier4Effects);
     }
 }
 public InitTrainingDialogArgs(String caption, ETier skillRank, SkillStaticData skillData, String skillName)
 {
     Caption   = caption;
     SkillRank = skillRank;
     SkillData = skillData;
     SkillName = skillName;
 }
Пример #4
0
        private ETier GetMaxTier(DummyCharacter p_char, SkillStaticData p_skill)
        {
            CharacterClassStaticData staticData = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)p_char.Class);
            ETier result = ETier.NONE;

            for (Int32 i = 0; i < staticData.GrandMasterSkills.Length; i++)
            {
                if (staticData.GrandMasterSkills[i] == p_skill.StaticID)
                {
                    result = ETier.GRAND_MASTER;
                }
            }
            for (Int32 j = 0; j < staticData.MasterSkills.Length; j++)
            {
                if (staticData.MasterSkills[j] == p_skill.StaticID)
                {
                    result = ETier.MASTER;
                }
            }
            for (Int32 k = 0; k < staticData.ExpertSkills.Length; k++)
            {
                if (staticData.ExpertSkills[k] == p_skill.StaticID)
                {
                    result = ETier.EXPERT;
                }
            }
            return(result);
        }
Пример #5
0
        public void Init(SkillStaticData p_skill, Boolean p_isDefault, Boolean p_isEnabled, Boolean p_selected, ETier p_maxTier)
        {
            m_skill = p_skill;
            gameObject.SetActive(true);
            m_icon.spriteName = p_skill.Icon;
            ETier p_maxTier2 = (p_maxTier <= ETier.NOVICE) ? ETier.NOVICE : p_maxTier;

            m_skillForTT       = new Skill(p_skill.StaticID, p_maxTier2);
            m_skillForTT.Level = ((!p_selected) ? 0 : 1);
            m_isDefault        = p_isDefault;
            m_isEnabled        = p_isEnabled;
            m_selected         = p_selected;
            NGUITools.SetActiveSelf(m_selectionEffect, p_selected);
            if (p_maxTier == ETier.GRAND_MASTER)
            {
                m_tierIcon.spriteName = "ICO_skillrank_3";
                NGUITools.SetActive(m_tierIcon.gameObject, true);
                NGUITools.SetActive(m_tierIconBG.gameObject, true);
            }
            else if (p_maxTier == ETier.MASTER)
            {
                m_tierIcon.spriteName = "ICO_skillrank_2";
                NGUITools.SetActive(m_tierIcon.gameObject, true);
                NGUITools.SetActive(m_tierIconBG.gameObject, true);
            }
            else if (p_maxTier == ETier.EXPERT)
            {
                m_tierIcon.spriteName = "ICO_skillrank_1";
                NGUITools.SetActive(m_tierIcon.gameObject, true);
                NGUITools.SetActive(m_tierIconBG.gameObject, true);
            }
            else
            {
                NGUITools.SetActive(m_tierIcon.gameObject, false);
                NGUITools.SetActive(m_tierIconBG.gameObject, false);
            }
            NGUITools.SetActive(m_corners.gameObject, m_isDefault);
            if (m_selected)
            {
                m_icon.color       = m_normalColor;
                m_tierIconBG.color = m_highLightColor;
                m_corners.color    = m_highLightColor;
                m_frame.color      = m_highLightColor;
            }
            else if (!m_isEnabled)
            {
                m_icon.color       = m_disabledColor;
                m_tierIconBG.color = m_normalColor;
                m_corners.color    = m_normalColor;
                m_frame.color      = m_disabledColor;
            }
            else
            {
                m_icon.color       = m_normalColor;
                m_tierIconBG.color = m_normalColor;
                m_corners.color    = m_normalColor;
                m_frame.color      = m_normalColor;
            }
        }
Пример #6
0
 public static void OpenWindow(SkillStaticData data)
 {
     m_data = data;
     if (m_data == null)
     {
         m_data = new SkillStaticData();
     }
     GetWindow <WindowAddNewSkill>();
 }
Пример #7
0
        public void Fill(CharacterSpell p_spell)
        {
            m_name.UpdateText(LocaManager.GetText(p_spell.NameKey));
            Single num = m_outerPadding + m_name.Size.y + m_innerPadding;

            m_itemSlot.SetSpell(p_spell.StaticData.Icon);
            m_itemSlot.HideItem();
            m_itemSlot.UpdatePosition(new Vector3(-m_name.Size.x / 2f, -num, 0f));
            m_description.MinHeight     = m_itemSlot.Size.y;
            m_description.VerticalAlign = TooltipGroup.Align.CENTER;
            if (p_spell.StaticData.ManaCost > 0)
            {
                m_description.UpdateText(LocaManager.GetText("SPELLBOOK_SPELL_MANA", p_spell.StaticData.ManaCost));
            }
            else
            {
                m_description.UpdateText(LocaManager.GetText("SPELL_DESCRIPTION_MANA_ALL"));
            }
            m_description.UpdatePositionY(-num);
            num += m_description.Size.y + m_innerPadding;
            Character selectedCharacter = LegacyLogic.Instance.WorldManager.Party.SelectedCharacter;
            Single    magicFactor       = p_spell.GetMagicFactor(selectedCharacter, false, 0);

            m_details.UpdateText(p_spell.GetDescription(magicFactor));
            m_details.UpdatePositionY(-num);
            num += m_details.Size.y + m_innerPadding;
            m_requirements.SetVisible(true);
            SkillStaticData staticData = StaticDataHandler.GetStaticData <SkillStaticData>(EDataType.SKILL, (Int32)p_spell.StaticData.SkillID);
            String          text       = LocaManager.GetText(staticData.Name);
            String          text2      = LocaManager.GetText("SKILL_TIER_" + (Int32)p_spell.StaticData.Tier);
            Boolean         flag;

            if (p_spell.StaticData.ClassOnly == EClass.NONE)
            {
                flag = IsSkillRequirementFulfilled((Int32)p_spell.StaticData.SkillID, p_spell.StaticData.Tier);
                m_requirements.UpdateText(LocaManager.GetText("SKILL_TIER_REQUIREMENT_TT", text, text2));
            }
            else
            {
                flag = selectedCharacter.Class.IsAdvanced;
                String str = (selectedCharacter.Gender != EGender.MALE) ? "_F" : "_M";
                if (p_spell.StaticData.SkillID == ESkillID.SKILL_WARFARE)
                {
                    m_requirements.UpdateText(LocaManager.GetText("ABILITY_REQUIREMENT_ADVANCED_CLASS" + str, selectedCharacter.Name, LocaManager.GetText(selectedCharacter.Class.AdvancedNameKey + str)));
                }
                else
                {
                    m_requirements.UpdateText(LocaManager.GetText("SPELL_REQUIREMENT_ADVANCED_CLASS" + str, selectedCharacter.Name, LocaManager.GetText(selectedCharacter.Class.AdvancedNameKey + str)));
                }
            }
            m_requirements.UpdatePositionY(-num);
            m_requirements.Label.color = ((!flag) ? Color.red : Color.white);
            num += m_requirements.Size.y + m_innerPadding;
            m_background.Scale(m_name.Size.x + m_outerPadding * 2f, num - m_innerPadding + m_outerPadding);
        }
Пример #8
0
 private Boolean isStartSkill(CharacterClassStaticData sd, SkillStaticData skillData)
 {
     foreach (Int32 num in sd.StartSkills)
     {
         if (num == skillData.StaticID)
         {
             return(true);
         }
     }
     return(false);
 }
Пример #9
0
 public void AddNewSkill(SkillStaticData data)
 {
     if (m_Datas.ContainsKey(data.id))
     {
         EditorUtility.DisplayDialog("错误", "ID错误,请检查!!!", "确定");
     }
     else
     {
         m_Datas.Add(data.id, data);
     }
 }
Пример #10
0
 private void UpdateSkill(Int32 p_index, Int32 p_skill)
 {
     if (p_skill > 0)
     {
         SkillStaticData staticData = StaticDataHandler.GetStaticData <SkillStaticData>(EDataType.SKILL, p_skill);
         m_selectedSkills[p_index].Init(staticData, m_character);
     }
     else
     {
         m_selectedSkills[p_index].Init(null, m_character);
     }
 }
Пример #11
0
    public void Create(ISkillCaster caster, SkillStaticData data)
    {
        holder           = caster;
        skillStaticData  = data;
        skillDynamicData = new SkillDynamicData(this);

        m_Machine  = new Machine <Skill>(this);
        skillState = new SkillDynamicState(this);

        timeLine = new TimeLine <Skill>(skillStaticData.id, this, skillStaticData.skill_time);
        timeLine.AddEvent(GameCenter.Instance.DataManager.timelineDB.GetTimeLineEvents(skillStaticData.id));
        //timeLine.AddEvent(new TimeEventSkillSummon((int)skillStaticData.id, 10020001, 0.5f));

        m_Machine.Register <SkillStReady>();
        m_Machine.Register <SkillStSing>();
        m_Machine.Register <SkillStCast>();
        m_Machine.Register <SkillStCoolDown>();
    }
Пример #12
0
 public void Init(SkillStaticData sd, DummyCharacter p_char)
 {
     if (sd != null)
     {
         ETier maxTier = GetMaxTier(p_char, sd);
         m_icon.spriteName = sd.Icon;
         NGUITools.SetActive(m_icon.gameObject, true);
         NGUITools.SetActive(m_border.gameObject, true);
         m_skillForTT       = new Skill(sd.StaticID, maxTier);
         m_skillForTT.Level = 1;
     }
     else
     {
         NGUITools.SetActive(m_icon.gameObject, false);
         NGUITools.SetActive(m_border.gameObject, false);
         m_skillForTT = null;
     }
 }
Пример #13
0
        public override void InitSqlite()
        {
            //SkillStaticData[] data = LocalDB.instance.ReadTable<SkillStaticData>("skill");

            //for (int i = 0; i < data.Length; i++ )
            //{
            //    if(!m_Datas.ContainsKey(data[i].id))
            //    {
            //        m_Datas.Add(data[i].id,data[i]);
            //    }
            //    else
            //    {
            //        MyLog.LogError("技能ID相同:" + data[i].id);
            //    }
            //}


            using (SqliteDataReader reader = LocalDB.instance.ExecuteReader("select * from " + m_FileName))
            {
                while (true)
                {
                    if (!reader.Read())
                    {
                        break;
                    }
                    List <string> prop_list = new List <string>();
                    uint          id        = 0;
                    for (int i = 0; i < reader.FieldCount; i++)
                    {
                        if (reader.GetName(i).Equals(PropertiesKey.SKILL_PROP))
                        {
                            string str = reader.GetValue(i).ToString();


                            string[] prop_array = str.Split(new char[] { ';' }, System.StringSplitOptions.RemoveEmptyEntries);
                            //string[] prop_array = str.Split(new char[] { '{', '}' }, System.StringSplitOptions.RemoveEmptyEntries);

                            //for (int prop_array_index = 0; prop_array_index < prop_array.Length; prop_array_index++ )
                            //{
                            //    prop_array[prop_array_index] = prop_array[prop_array_index].Replace("->",":");
                            //    prop_list.Add(prop_array[prop_array_index]);
                            //}
                        }
                        else
                        {
                            prop_list.Add(reader.GetName(i) + ":" + reader.GetValue(i));
                        }
                    }

                    //string prop_str =

                    SkillStaticData skill = new SkillStaticData();
                    skill.prop       = new Prop(prop_list);
                    skill.id         = skill.prop.GetUint(PropertiesKey.SKILL_ID);
                    skill.name       = skill.prop.GetString(PropertiesKey.SKILL_NAME);
                    skill.cd         = skill.prop.GetFloat(PropertiesKey.SKILL_CD);
                    skill.skill_time = skill.prop.GetFloat(PropertiesKey.SKILL_TIME);
                    skill.prop.Remove(PropertiesKey.SKILL_ID);
                    skill.prop.Remove(PropertiesKey.SKILL_NAME);
                    skill.prop.Remove(PropertiesKey.SKILL_CD);
                    skill.prop.Remove(PropertiesKey.SKILL_PROP);
                    skill.prop.Remove(PropertiesKey.SKILL_TIME);
                    m_Datas.Add(skill.id, skill);
                }
            }
        }