Esempio n. 1
0
    /// <summary>
    /// 强化
    /// </summary>
    void UpdateEnchance()
    {
        ClearEnchanceContext();
        mIsEnableEnchance = false;
        if (mSelectedItem != null)
        {
            //属性
            mEnchanceSelectedAction.SetActionItem(mSelectedItem.GetID());
            string text = mSelectedItem.GetWhiteAttribute(0);
            mEnchanceSelectedAttri1.Text = UIString.Instance.ParserString_Runtime(text);
            text = mSelectedItem.GetWhiteAttribute(1);
            if (text == "")
            {
                mEnchanceSelectedAttri2.Hide(true);
            }
            else
            {
                mEnchanceSelectedAttri2.Hide(false);
                mEnchanceSelectedAttri2.Text = UIString.Instance.ParserString_Runtime(text);
            }

            //效果
            int nEnchanceLevel       = mSelectedItem.GetStrengthLevel() + 1;
            CObject_Item_Equip equip = mSelectedItem as CObject_Item_Equip;
            if (equip != null)
            {
                text = equip.GetStrengthAttributeValue(nEnchanceLevel, 0);
                mEnchanceResultAttri1.Text = UIString.Instance.ParserString_Runtime(text);
                text = equip.GetStrengthAttributeValue(nEnchanceLevel, 1);
                if (text == "")
                {
                    mEnchanceResultAttri2.Hide(true);
                }
                else
                {
                    mEnchanceResultAttri2.Hide(false);
                    mEnchanceResultAttri2.Text = UIString.Instance.ParserString_Runtime(text);
                }
            }
            Item_Enhance itemEnhance = LifeAbility.Instance.Get_Equip_EnhanceLevel(mSelectedItem);
            mEnchanceMoney.Text = itemEnhance.needMoney + "    金钱";

            //是否可强化
            if (mSelectedItem.GetStrengthLevel() < CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_Level() &&
                itemEnhance.needMoney <= CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_Money())
            {
                mEnchanceOK.controlIsEnabled = true;
            }
        }
    }