コード例 #1
0
    //克隆详细信息
    public void ClonetExtraInfo(CObject_Item_Equip pItemSource)
    {
        if (m_pExtraDefine != null)
        {
            m_pExtraDefine = new EXTRA_DEFINE();
        }

        EXTRA_DEFINE pNewExtraDefine = pItemSource.GetExtraInfo();

        m_pExtraDefine.m_CurDurPoint = pNewExtraDefine.m_CurDurPoint;
        m_pExtraDefine.m_MaxDurPoint = pNewExtraDefine.m_MaxDurPoint;
        m_pExtraDefine.m_nLevelNeed  = pNewExtraDefine.m_nLevelNeed;
        //	m_pExtraDefine.m_nFrogLevel  = pItemInfo.GetEquipData().m_Level;
        m_pExtraDefine.m_nRepairFailureTimes = pNewExtraDefine.m_nRepairFailureTimes;
        m_pExtraDefine.m_nSellPrice          = pNewExtraDefine.m_nSellPrice;
        m_pExtraDefine.M_nEquipBindInfo      = pNewExtraDefine.M_nEquipBindInfo;
        // 增加克隆时候的可以镶嵌的宝石个数、强化等级 [9/14/2011 edit by ZL]
        m_pExtraDefine.m_EnableGemCount    = pNewExtraDefine.m_EnableGemCount;
        m_pExtraDefine.m_EquipEnhanceLevel = pNewExtraDefine.m_EquipEnhanceLevel;

        m_pExtraDefine.m_vEquipAttachGem.Clear();
        m_pExtraDefine.m_vBlueEquipAttributes.Clear();
        m_pExtraDefine.m_vEquipAttributes.Clear();

        for (int i = 0; i < pNewExtraDefine.m_vEquipAttachGem.Count; i++)
        {
            m_pExtraDefine.m_vEquipAttachGem.Add(pNewExtraDefine.m_vEquipAttachGem[i]);
        }

        for (int i = 0; i < pNewExtraDefine.m_vBlueEquipAttributes.Count; i++)
        {
            m_pExtraDefine.m_vBlueEquipAttributes.Add(pNewExtraDefine.m_vBlueEquipAttributes[i]);
        }
        // 增加基础属性克隆 [9/14/2011 edit by ZL]
        for (int i = 0; i < pNewExtraDefine.m_vEquipAttributes.Count; i++)
        {
            m_pExtraDefine.m_vEquipAttributes.Add(pNewExtraDefine.m_vEquipAttributes[i]);
        }
        SetNumber(pItemSource.GetNumber());

        m_Quality    = pItemSource.GetEquipQuantity();
        m_theBaseDef = pItemSource.GetEquipBaseDefine();

        // 装备是否鉴定过属性。2006-4-10。
        m_EquipAttrib = pItemSource.m_EquipAttrib;
    }
コード例 #2
0
    public void CloneForUpLevel(CObject_Item_Equip pItemSource)
    {
        //克隆额外属性
        if (m_pExtraDefine != null)
        {
            m_pExtraDefine = new EXTRA_DEFINE();
        }

        EXTRA_DEFINE pNewExtraDefine = pItemSource.GetExtraInfo();

        m_pExtraDefine.m_CurDurPoint = pNewExtraDefine.m_CurDurPoint;
        m_pExtraDefine.m_MaxDurPoint = pNewExtraDefine.m_MaxDurPoint;
        m_pExtraDefine.m_nLevelNeed  = pNewExtraDefine.m_nLevelNeed;
        //	m_pExtraDefine.m_nFrogLevel  = pItemInfo.GetEquipData().m_Level;
        m_pExtraDefine.m_nRepairFailureTimes = pNewExtraDefine.m_nRepairFailureTimes;
        m_pExtraDefine.m_nSellPrice          = pNewExtraDefine.m_nSellPrice;
        m_pExtraDefine.M_nEquipBindInfo      = pNewExtraDefine.M_nEquipBindInfo;
        // 增加克隆时候的可以镶嵌的宝石个数、强化等级 [9/14/2011 edit by ZL]
        m_pExtraDefine.m_EnableGemCount    = pNewExtraDefine.m_EnableGemCount;
        m_pExtraDefine.m_EquipEnhanceLevel = pNewExtraDefine.m_EquipEnhanceLevel;

        m_pExtraDefine.m_vEquipAttachGem.Clear();
        m_pExtraDefine.m_vBlueEquipAttributes.Clear();


        for (int i = 0; i < pNewExtraDefine.m_vEquipAttachGem.Count; i++)
        {
            m_pExtraDefine.m_vEquipAttachGem.Add(pNewExtraDefine.m_vEquipAttachGem[i]);
        }

        for (int i = 0; i < pNewExtraDefine.m_vBlueEquipAttributes.Count; i++)
        {
            m_pExtraDefine.m_vBlueEquipAttributes.Add(pNewExtraDefine.m_vBlueEquipAttributes[i]);
        }

        //升档回退强化
        if (m_pExtraDefine.m_EquipEnhanceLevel >= 5)
        {
            m_pExtraDefine.m_EquipEnhanceLevel -= 5;
        }

        //基础属性根据新的强化等级计算
        int nEnchanceIndex = m_theBaseDef.nEquipPoint * 110 + m_pExtraDefine.m_EquipEnhanceLevel;

        for (int i = 0; i < pNewExtraDefine.m_vEquipAttributes.Count; i++)
        {
            _ITEM_ATTR value = pNewExtraDefine.m_vEquipAttributes[i];
            if (value.m_Value.m_Value > 0)
            {
                value.m_Value.m_Value = (short)(m_theBaseDef.nBaseAttr[value.m_AttrType] * CaclStrendthValue(value.m_AttrType, m_theBaseDef.nEquipPoint, m_pExtraDefine.m_EquipEnhanceLevel) + 0.5f);
            }
            m_pExtraDefine.m_vEquipAttributes.Add(value);
        }
        SetNumber(pItemSource.GetNumber());

        m_Quality = pItemSource.GetEquipQuantity();

        m_EquipAttrib = pItemSource.m_EquipAttrib;

        base.Clone(pItemSource);
    }