Пример #1
0
    private void GetBelleFragmentNum(out int have, out int need)
    {
        have = 0;
        need = 0;
        if (null == BelleInfoWindow.Instance())
        {
            return;
        }
        Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

        if (null == belleTab)
        {
            return;
        }
        Belle curBelleData = null;

        if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
        {
            curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
        }
        if (null == curBelleData)
        {
            return;
        }
        Tab_BelleLevelup curTabBelleLevelup = TableManager.GetBelleLevelupByID(curBelleData.id * Belle.ID_FACTOR + curBelleData.orgLevel, 0);

        if (null != curTabBelleLevelup && curTabBelleLevelup.getConsumeTypeCount() > 0)
        {
            need = curTabBelleLevelup.GetConsumeNumbyIndex(0);
        }
        BelleData.OwnedBelleAbsorbNum.TryGetValue(belleTab.Id, out have);
    }
Пример #2
0
    public void Advanced()
    {
        Tab_Belle belleTabC = BelleInfoWindow.Instance().CurSellectedBelleData;

        if (belleTabC != null && BelleData.OwnedBelleMap.ContainsKey(belleTabC.Id))
        {
            if (BelleData.OwnedBelleMap[belleTabC.Id].colorLevel == 5 && BelleData.OwnedBelleMap[belleTabC.Id].subLevel == 9)
            {
                GUIData.AddNotifyData2Client(false, "#{11321}");
                return;
            }
        }
        int have = 0;
        int need = 0;

        GetBelleFragmentNum(out have, out need);
        if (have >= need)
        {
            Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;
            if (belleTab == null || !BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
            {
                return;
            }

            Tab_BelleLevelup belleLevL = TableManager.GetBelleLevelupByID(belleTab.Id * Belle.ID_FACTOR + BelleData.OwnedBelleMap[belleTab.Id].orgLevel, 0);
            if (belleLevL.GetConsumeTypebyIndex(1) == 2)
            {
                MessageBoxLogic.OpenCostBox(StrDictionary.GetClientDictionaryString("#{11467}"), "", StrDictionary.GetClientDictionaryString("#{11466}"), StrDictionary.GetClientDictionaryString("#{11312}"), "qian1", "X" + belleLevL.GetConsumeNumbyIndex(1), AdvanceOK, null);
            }
        }
        else
        {
            if (AdvancePlane != null)
            {
                AdvancePlane.SetActive(!AdvancePlane.activeInHierarchy);
            }
        }
        if (BelleController.Instance() != null)
        {
            if (BelleController.Instance().FTEIndex == 3)
            {
                BelleController.Instance().DoFTE(4);
            }
            else if (BelleController.Instance().FTEIndex == 5)
            {
                BelleController.Instance().DoFTE(6);
            }
        }
    }
Пример #3
0
    /// <summary>
    /// 进化确认界面数据填充
    /// </summary>
    /// <param name="belle"></param>
    public void SetEvaWinData(Belle curBelleData)
    {
        if (null == curBelleData)
        {
            return;
        }

        m_EvaCurMianColor.text          = BelleData.GetBelleDescByColorLevel(curBelleData.colorLevel);
        m_EvaCurMianColorPic.spriteName = BelleData.GetBelleColorPicByColorLevel(curBelleData.colorLevel);
        m_EvaCurSubColor.text           = StrDictionary.GetClientDictionaryString("#{10811}", curBelleData.subLevel);
        // m_EvaCurMianColor.color = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);
        // m_EvaCurSubColor.color = m_EvaCurMianColor.color;

        Tab_BelleLevelup curTabBelleLevelup  = TableManager.GetBelleLevelupByID(curBelleData.id * Belle.ID_FACTOR + curBelleData.orgLevel, 0);
        Tab_BelleLevelup nextTabBelleLevelup = TableManager.GetBelleLevelupByID(curBelleData.id * Belle.ID_FACTOR + curBelleData.orgLevel + 1, 0);

        if (null != curTabBelleLevelup && nextTabBelleLevelup != null)
        {
            m_EvaNextMainColor.text = BelleData.GetBelleDescByColorLevel(nextTabBelleLevelup.MainLevel);

            m_EvaNextMainColorPic.spriteName = BelleData.GetBelleColorPicByColorLevel(curBelleData.colorLevel);
            m_EvaNextSubColor.text           = StrDictionary.GetClientDictionaryString("#{10811}", nextTabBelleLevelup.SubLevel);
            //  m_EvaNextMainColor.color = BelleData.GetBelleColorByColorLevel(nextTabBelleLevelup.MainLevel);
            //m_EvaNextSubColor.color = m_EvaNextMainColor.color;

            //消耗类型图片 理论上应该消耗的统一接口,这里先这么着吧,改动不会经常改

            Tab_CommonItem item1 = TableManager.GetCommonItemByID(curTabBelleLevelup.GetConsumeSubTypebyIndex(0), 0);
            if (item1 != null)
            {
                m_EvaCostItem_1_Icon.spriteName = item1.Icon;
            }

            m_EvaCostItem_1_Count.text = curTabBelleLevelup.GetConsumeNumbyIndex(0).ToString();
            m_EvaCostItem_2_Count.text = curTabBelleLevelup.GetConsumeNumbyIndex(1).ToString();
            //
            //             string attrTypeName = BelleData.GetBelleDescByColorLevel(nextTabBelleLevelup.MainLevel);
            //             strTip = StrDictionary.GetClientDictionaryString("#{1404}", attrTypeName, nextTabBelleLevelup.SubLevel, curTabBelleLevelup.GetConsumeNumbyIndex(0), curTabBelleLevelup.GetConsumeNumbyIndex(1));
        }
        // MessageBoxLogic.OpenOKCancelBox(strTip, "", DoEvlolution);
    }
Пример #4
0
    /// <summary>
    /// 设置基本属性界面
    /// </summary>
    public void SetBelleAttrData()
    {
        if (null == BelleInfoWindow.Instance())
        {
            return;
        }

        Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

        if (null == belleTab)
        {
            return;
        }

        Belle curBelleData = null;
        bool  bOwned       = false;

        if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
        {
            curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
            bOwned       = true;
        }
        if (null == curBelleData)
        {
            return;
        }

//         Tab_CommonItem commItem = TableManager.GetCommonItemByID(belleTab.BelleItemID, 0);
//         if (commItem != null)
//             m_bellePic.spriteName = commItem.Icon;
//         //美人等级
//         m_belleLevel.text = StrDictionary.GetClientDictionaryString("#{1308}", BelleData.GetBelleDescByColorLevel(curBelleData.colorLevel), curBelleData.subLevel);
//         m_belleLevel.color = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);

        //  UpdateEvalutionInfo();
        curBelleData.UpdateAttrMap();
        int nextAttrTypeIndex      = curBelleData.GetNextLevelAttrType(curBelleData.orgLevel + 1);
        int nextAttrValue          = curBelleData.GetNextLevelAttrValue(curBelleData.orgLevel + 1);
        Tab_BelleLevelup belleLevL = TableManager.GetBelleLevelupByID(curBelleData.id * Belle.ID_FACTOR + curBelleData.orgLevel, 0);

        if (null == belleLevL)
        {
            return;
        }
        //美人属性值
        for (int i = 0; i < belleTab.getAttrTypeCount(); i++)
        {
            m_shrapPic[i].gameObject.SetActive(false);
            m_defaultText[i].gameObject.SetActive(true);
            m_nextValues[i].text    = "";
            m_attrTypeNames[i].text = Utils.GetAttrTypeString(belleTab.GetAttrTypebyIndex(i));

            int closeValue = 0;
            //亲密值
            if (belleTab.GetAttrTypebyIndex(i) == belleTab.CloseAddAttrType)
            {
                closeValue = curBelleData.closeAddValue;
            }
            //非第六条属性,受颜色等级控制
            if (i != belleTab.getAttrTypeCount() - 1)
            {
                if (i < curBelleData.colorLevel)
                {
                    m_attrValues[i].text = "+" + (belleLevL.GetAttrValuebyIndex(i) /*+ closeValue*/);
                }
                else
                {
                    m_attrValues[i].text = "+" + (belleTab.GetAttrValuebyIndex(i) /*+ closeValue*/);
                }
            }
            else //第六条属性,不受颜色等级控制
            {
                m_attrValues[i].text = "+" + ((curBelleData.IsMaxLevel()? belleLevL.GetAttrValuebyIndex(i):belleTab.GetAttrValuebyIndex(i)) /*+ closeValue*/);
                m_attrTypeNames[i].gameObject.SetActive(false);
            }

            //亲密值
            if (i == 0)
            {
                m_closeValueText.text = StrDictionary.GetClientDictionaryString("#{10817}", closeValue);
                m_closeValueText.gameObject.SetActive(closeValue > 0);
            }

            if (belleTab.getAttrTypeCount() - 1 != i && nextAttrTypeIndex == i)
            {
                //  LogModule.DebugLog("nextAttrType ===    " + nextAttrType + "   BelleTab.getAttrTypeByIndex " + i + "  " + belleTab.GetAttrTypebyIndex(i));
                if (i < curBelleData.colorLevel && nextAttrValue > 0)
                {
                    m_nextValues[i].text = "+" + nextAttrValue.ToString();
                    m_shrapPic[i].gameObject.SetActive(true);
                }
                else
                {
                    m_nextValues[i].text = "";
                }
            }
            else
            {
                m_shrapPic[i].gameObject.SetActive(false);
                m_nextValues[i].text = "";
            }

            if (null != curBelleData && bOwned)
            {
                if (i != belleTab.getAttrTypeCount() - 1)
                {
                    m_attrTypeNames[i].color = i < curBelleData.colorLevel ? m_ColorHighlight : m_ColorDisable;
                    m_attrValues[i].color    = i < curBelleData.colorLevel ? m_ColorHighlight : m_ColorDisable;
//                     m_nextValues[i].color = i < curBelleData.colorLevel ? m_ColorHighlight : m_ColorDisable;

                    m_defaultText[i].gameObject.SetActive(i >= curBelleData.colorLevel);
                }
                else
                {
                    m_attrTypeNames[i].color = curBelleData.IsMaxLevel() ? m_ColorHighlight : m_ColorDisable;
                    m_attrValues[i].color    = curBelleData.IsMaxLevel() ? m_ColorHighlight : m_ColorDisable;
//                     m_nextValues[i].color = curBelleData.IsMaxLevel() ? m_ColorHighlight : m_ColorDisable;
                    m_defaultText[i].gameObject.SetActive(!curBelleData.IsMaxLevel());
                }
            }
            else
            {
                m_attrTypeNames[i].color = m_ColorDisable;
                m_attrValues[i].color    = m_ColorDisable;
//                 m_nextValues[i].color = m_ColorDisable;
                m_shrapPic[i].gameObject.SetActive(false);
                m_defaultText[i].gameObject.SetActive(true);
                m_nextValues[i].text = "";
            }
        }
        //回调的时候等级变化,需要设置战力值
        //   SetCombatValue();
        //触发更新Item数量
        //据策划说,没有第六条属性
        m_attrTypeNames[5].gameObject.SetActive(false);
        m_attrValues[5].gameObject.SetActive(false);
        m_nextValues[5].gameObject.SetActive(false);
        m_shrapPic[5].gameObject.SetActive(false);
        m_defaultText[5].gameObject.SetActive(false);
        //
    }
Пример #5
0
    public void UpdateEvalutionInfo()
    {
        if (null == BelleInfoWindow.Instance())
        {
            return;
        }

        Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

        if (null == belleTab)
        {
            return;
        }

        Belle curBelleData = null;

        if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
        {
            curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
        }
        if (null == curBelleData)
        {
            return;
        }
        int belleSubItemId     = belleTab.BelleItemID;
        int belleTotalSubCount = 0;
        int belleCoinCount     = 0;
        Tab_BelleLevelup curTabBelleLevelup = TableManager.GetBelleLevelupByID(curBelleData.id * Belle.ID_FACTOR + curBelleData.orgLevel, 0);

        if (null != curTabBelleLevelup && curTabBelleLevelup.getConsumeTypeCount() > 0)
        {
            belleTotalSubCount = curTabBelleLevelup.GetConsumeNumbyIndex(0);
            belleCoinCount     = curTabBelleLevelup.GetConsumeNumbyIndex(1);
        }

        if (GameManager.gameManager.PlayerDataPool == null)
        {
            return;
        }
        Games.Item.GameItemContainer backPack = GameManager.gameManager.PlayerDataPool.BackPack;
        if (backPack == null)
        {
            return;
        }
        int belleSubItemCount = backPack.GetItemCountByDataId(belleSubItemId);
        int have = 0; int need = 0;

        GetBelleFragmentNum(out have, out need);
        m_curBelleItemCount.text = have.ToString() + "/" + need.ToString();
        if (need > 0)
        {
            BelleFragmentUS.transform.localScale = new Vector3((float)have / need, 1f, 1f);
        }
        Tab_CommonItem commItem = TableManager.GetCommonItemByID(belleTab.BelleItemID, 0);

        if (commItem != null)
        {
            m_curBelleItemIcon.spriteName = commItem.Icon;
        }
        if (belleSubItemCount < belleTotalSubCount)
        {
            m_curBelleEvaluteLab.text = StrDictionary.GetClientDictionaryString("#{10812}");
            messageBtn.functionName   = "OnGetItem";
            evoRedTipObj.gameObject.SetActive(false);
            if (BelleConfig.GetBelleEvoBitByIndex(belleTab.Id))
            {
                BelleConfig.SetBelleEvoCountByBit(belleTab.Id, '0');
            }
        }
        else
        {
            m_curBelleEvaluteLab.text = StrDictionary.GetClientDictionaryString("#{10813}");
            messageBtn.functionName   = "OnEvolutionClick";
            evoRedTipObj.gameObject.SetActive(!curBelleData.IsMaxLevel());
        }

        BelleData.m_belleEvoCount = BelleConfig.GetBelleEvoCount();
        //最大等级的一个判断


        m_EvaluBtnObj.SetActive(!curBelleData.IsMaxLevel());
        m_EvaluMaxLabel.gameObject.SetActive(curBelleData.IsMaxLevel());
    }