Example #1
0
    //检查是否有能升级
    public static void CheckSkill()
    {
        RoleInfo role = LobbyClient.Instance.CurrentRole;

        if (role == null)
        {
            return;
        }
        bool             has       = false;
        List <SkillInfo> skillList = role.SkillInfos;

        foreach (SkillInfo info in skillList)
        {
            if (info != null)
            {
                bool currHas = false;
                if (info.SkillLevel > 0)
                {     //已解锁
                    if (info.SkillLevel < role.Level)
                    { //等级
                        SkillLogicData skillCfg = SkillConfigProvider.Instance.ExtractData(SkillConfigType.SCT_SKILL, info.SkillId) as SkillLogicData;
                        if (skillCfg != null)
                        {
                            SkillLevelupConfig levelUpCfg = SkillLevelupConfigProvider.Instance.GetDataById(info.SkillLevel);
                            int needMoney = 0;
                            int needVigor = 0;
                            if (levelUpCfg != null)
                            {
                                if (skillCfg.LevelUpCostType >= 1 && skillCfg.LevelUpCostType <= levelUpCfg.m_TypeList.Count)
                                {
                                    needMoney = levelUpCfg.m_TypeList[skillCfg.LevelUpCostType - 1];
                                }
                                if (skillCfg.LevelUpVigorType >= 1 && skillCfg.LevelUpVigorType <= levelUpCfg.m_VigorList.Count)
                                {
                                    needVigor = levelUpCfg.m_VigorList[skillCfg.LevelUpVigorType - 1];
                                }
                                int vigor = UIDataCache.Instance.vigor;
                                if (role.Money >= needMoney && vigor >= needVigor)
                                {
                                    has     = true;
                                    currHas = true;
                                }
                            }
                        }
                    }
                }
                if (UIManager.Instance.IsWindowVisible("SkillPanel"))
                {
                    ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("ge_skillslot_state_change", "skill", info.SkillId, currHas);
                }
            }
        }
        ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("ge_systemnewtip_state_change", "ui", SystemNewTipType.Skill, has);
    }
Example #2
0
    //检查是否有能升级
    private void CheckHasUpgrade()
    {
        RoleInfo role = LobbyClient.Instance.CurrentRole;

        if (role == null)
        {
            return;
        }
        bool             has       = false;
        List <SkillInfo> skillList = role.SkillInfos;

        foreach (SkillInfo info in skillList)
        {
            if (info != null)
            {
                bool currHas = false;
                if (info.SkillLevel > 0)
                {     //已解锁
                    if (info.SkillLevel < role.Level)
                    { //等级
                        SkillLogicData skillCfg = SkillConfigProvider.Instance.ExtractData(SkillConfigType.SCT_SKILL, info.SkillId) as SkillLogicData;
                        if (skillCfg != null)
                        {
                            SkillLevelupConfig levelUpCfg = SkillLevelupConfigProvider.Instance.GetDataById(info.SkillLevel);
                            int needMoney = 0;
                            int needVigor = 0;
                            if (levelUpCfg != null)
                            {
                                if (skillCfg.LevelUpCostType >= 1 && skillCfg.LevelUpCostType <= levelUpCfg.m_TypeList.Count)
                                {
                                    needMoney = levelUpCfg.m_TypeList[skillCfg.LevelUpCostType - 1];
                                }
                                if (skillCfg.LevelUpVigorType >= 1 && skillCfg.LevelUpVigorType <= levelUpCfg.m_VigorList.Count)
                                {
                                    needVigor = levelUpCfg.m_VigorList[skillCfg.LevelUpVigorType - 1];
                                }
                                int vigor = isEnable ? m_foreVigor : m_backVigor;
                                if (role.Money >= needMoney && vigor >= needVigor)
                                {
                                    has     = true;
                                    currHas = true;
                                }
                            }
                        }
                    }
                }
                if (hasInitSkills)
                {
                    ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("ge_skillslot_state_change", "skill", info.SkillId, currHas);
                }
            }
        }
        hasCanUpgrade = has;
        ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("ge_systemnewtip_state_change", "ui", SystemNewTipType.Skill, has);

        //foreach (UISkillSlot slot in skillStorageArr) {
        //  if (null != slot) {
        //    if (slot.m_IsUnlock == true) {//已解锁
        //      if (slot.SkillLv < role.Level) {//等级
        //        SkillLogicData skillCfg = SkillConfigProvider.Instance.ExtractData(SkillConfigType.SCT_SKILL, slot.SkillId) as SkillLogicData;
        //        if (skillCfg != null) {
        //          SkillLevelupConfig levelUpCfg = SkillLevelupConfigProvider.Instance.GetDataById(slot.SkillLv);
        //          int needMoney = 0;
        //          int needVigor = 0;
        //          if (levelUpCfg != null) {
        //            if (skillCfg.LevelUpCostType >= 1 && skillCfg.LevelUpCostType <= levelUpCfg.m_TypeList.Count)
        //              needMoney = levelUpCfg.m_TypeList[skillCfg.LevelUpCostType - 1];
        //            if (skillCfg.LevelUpVigorType >= 1 && skillCfg.LevelUpVigorType <= levelUpCfg.m_VigorList.Count)
        //              needVigor = levelUpCfg.m_VigorList[skillCfg.LevelUpVigorType - 1];

        //            if (role.Money >= needMoney && uiSkillInfo != null && uiSkillInfo.PlayerVigor > needVigor) {
        //              has = true;
        //            }
        //          }
        //        }
        //      }
        //    }
        //  }
        //}
    }
Example #3
0
    //设置升级界面信息
    public void SetSkillLevelUpInfo(int skillId, bool isUpgrade = false)
    {
        SetSkillInfo(skillId);
        int skillLevel = 0;

        foreach (SkillInfo info in LobbyClient.Instance.CurrentRole.SkillInfos)
        {
            if (info.SkillId == m_SkillId)
            {
                skillLevel = info.SkillLevel;
                break;
            }
        }
        string str = StrDictionaryProvider.Instance.GetDictString(352);

        str = StrDictionaryProvider.Instance.GetDictString(353);
        if (lblLv0Level != null)
        {
            lblLv0Level.text = str + skillLevel.ToString();
        }
        if (lblLv1Level != null)
        {
            lblLv1Level.text = str + (skillLevel + 1).ToString();
        }
        SkillLogicData skillCfg = SkillConfigProvider.Instance.ExtractData(SkillConfigType.SCT_SKILL, m_SkillId) as SkillLogicData;

        if (skillCfg != null)
        {
            if (lblLvDesc != null)
            {
                lblLvDesc.text = skillCfg.ShowDescription;
            }
            str = StrDictionaryProvider.Instance.GetDictString(354);
            if (lblLv0Cd != null)
            {
                if (isUpgrade == true && lblLv0Cd.text != str + skillCfg.ShowCd + "S")
                {
                    PlayParticle(goEffectPos1);
                }
                lblLv0Cd.text = str + skillCfg.ShowCd + "S";
            }
            if (lblLv1Cd != null)
            {
                lblLv1Cd.text = str + skillCfg.ShowCd + "S";
            }
            str = StrDictionaryProvider.Instance.GetDictString(355);
            if (lblLv0Cost != null)
            {
                if (isUpgrade == true && lblLv0Cost.text != str + skillCfg.ShowCostEnergy.ToString())
                {
                    PlayParticle(goEffectPos3);
                }
                lblLv0Cost.text = str + skillCfg.ShowCostEnergy.ToString();
            }
            if (lblLv1Cost != null)
            {
                lblLv1Cost.text = str + skillCfg.ShowCostEnergy.ToString();
            }
            str = StrDictionaryProvider.Instance.GetDictString(356);
            if (lblLv0HitNum != null)
            {
                if (isUpgrade == true && lblLv0HitNum.text != str + skillCfg.ShowHitNum)
                {
                    PlayParticle(goEffectPos4);
                }
                lblLv0HitNum.text = str + skillCfg.ShowHitNum;
            }
            if (lblLv1HitNum != null)
            {
                lblLv1HitNum.text = str + skillCfg.ShowHitNum;
            }
            str = StrDictionaryProvider.Instance.GetDictString(357);
            float totalDamage = (skillCfg.ShowBaseDamage + skillCfg.DamagePerLevel * skillLevel) * 100;
            if (lblLv0Damage != null)
            {
                if (isUpgrade == true && lblLv0Damage.text != str + ((int)totalDamage).ToString() + "%")
                {
                    PlayParticle(goEffectPos2);
                }
                lblLv0Damage.text = str + ((int)totalDamage).ToString() + "%";
            }
            totalDamage = (skillCfg.ShowBaseDamage + skillCfg.DamagePerLevel * (skillLevel + 1)) * 100;
            if (lblLv1Damage != null)
            {
                lblLv1Damage.text = str + ((int)totalDamage).ToString() + "%";
            }

            SkillLevelupConfig levelUpCfg = SkillLevelupConfigProvider.Instance.GetDataById(skillLevel);
            if (levelUpCfg != null)
            {
                if (skillCfg.LevelUpCostType >= 1 && skillCfg.LevelUpCostType <= levelUpCfg.m_TypeList.Count && lblLvMoney != null)
                {
                    lblLvMoney.text = levelUpCfg.m_TypeList[skillCfg.LevelUpCostType - 1].ToString();
                }
                if (skillCfg.LevelUpVigorType >= 1 && skillCfg.LevelUpVigorType <= levelUpCfg.m_VigorList.Count && lblCurrentVigor != null)
                {
                    lblCurrentVigor.text = levelUpCfg.m_VigorList[skillCfg.LevelUpVigorType - 1].ToString();
                }
            }
            else
            {
                if (lblLvMoney != null)
                {
                    lblLvMoney.text = "0";
                }
            }
        }
        if (skillLevel == 0)
        {
            string CHN = StrDictionaryProvider.Instance.GetDictString(354);
            if (lblLv0Cd != null)
            {
                lblLv0Cd.text = CHN + 0 + "S";
            }
            CHN = StrDictionaryProvider.Instance.GetDictString(355);
            if (lblLv0Cost != null)
            {
                lblLv0Cost.text = CHN + "0";
            }
            CHN = StrDictionaryProvider.Instance.GetDictString(356);
            if (lblLv0HitNum != null)
            {
                lblLv0HitNum.text = CHN + "0";
            }
            CHN = StrDictionaryProvider.Instance.GetDictString(357);
            if (lblLv0Damage != null)
            {
                lblLv0Damage.text = CHN + 0 + "%";
            }
        }
    }