Example #1
0
    void HandleFitOnEquipment(int nGoodsId, int nDataID)
    {
        m_FitOnVisual.FellowGoodsID = GlobeVar.INVALID_ID;
        m_FitOnVisual.MountGoodsID  = GlobeVar.INVALID_ID;

        m_FitOnVisual.FellowID = GlobeVar.INVALID_ID;
        m_FitOnVisual.MountID  = GlobeVar.INVALID_ID;

        Tab_CommonItem tabCommonItem = TableManager.GetCommonItemByID(nDataID, 0);

        if (tabCommonItem == null)
        {
            return;
        }

        Tab_EquipAttr tabEquipAttr = TableManager.GetEquipAttrByID(nDataID, 0);

        if (tabEquipAttr == null)
        {
            return;
        }

        // 武器装备
        if (tabEquipAttr.Component == (int)EquipPackSlot.Slot_WEAPON + 1)
        {
            HandleFitOnWeapon(nGoodsId, nDataID, tabEquipAttr);
        }
        if (tabEquipAttr.Component == (int)EquipPackSlot.Slot_ARMOR + 1)
        {
            HandleFitOnArmor(nGoodsId, nDataID, tabEquipAttr);
        }
    }
    private void CreatePartnerFakeObj(int pro, Tab_EquipAttr eqTab = null)
    {
        if (m_FakeObj != null)
        {
            DestroyFakeObj();
        }
        CharacterDefine.PROFESSION profession = (CharacterDefine.PROFESSION)pro;
        //对应FakeObject.txt配置
        switch (profession)
        {
        case CharacterDefine.PROFESSION.SHAOLIN:
            m_PlayerFakeObjID = 3;
            break;

        case CharacterDefine.PROFESSION.TIANSHAN:
            m_PlayerFakeObjID = 4;
            break;

        case CharacterDefine.PROFESSION.DALI:
            m_PlayerFakeObjID = 6;
            break;

        case CharacterDefine.PROFESSION.XIAOYAO:
            m_PlayerFakeObjID = 5;
            break;

        case CharacterDefine.PROFESSION.GAIBANG:
            m_PlayerFakeObjID = 62;
            break;

        default:
            m_PlayerFakeObjID = 4;
            break;
        }

        m_FakeObj = new FakeObject();
        if (m_FakeObj == null)
        {
            return;
        }
        GameManager.gameManager.ActiveScene.InitFakeObjRoot(m_FakeObjLeft_Character, m_FakeObjRight_Character);
        //  m_PlayerFakeObjID = fakeObjId;
        m_FakeObj.initFakeObject(m_PlayerFakeObjID, GameManager.gameManager.ActiveScene.FakeObjTrans, out m_FakeObjGameObject);
        m_ModelDrag.ModelTrans = m_FakeObj.ObjAnim.transform;
    }
Example #3
0
    void HandleFitOnArmor(int nGoodsId, int nDataID, Tab_EquipAttr tabArmorEquipAttr)
    {
        Tab_ItemVisual tabItemVisual = TableManager.GetItemVisualByID(tabArmorEquipAttr.ModelId, 0);

        if (tabItemVisual == null)
        {
            return;
        }

        int nCharModelID = Singleton <ObjManager> .Instance.MainPlayer.GetCharModelID(tabItemVisual);

        Tab_CharModel tabCharModel = TableManager.GetCharModelByID(nCharModelID, 0);

        if (tabCharModel == null)
        {
            return;
        }

        Tab_FakeObject tabFakeObject = TableManager.GetFakeObjectByID(m_FakeObjID, 0);

        if (tabFakeObject == null)
        {
            return;
        }

        m_FitOnVisual.ArmorGoodsID = nGoodsId;
        m_FitOnVisual.ArmorID      = nDataID;

        // 装备 时装 不同时预览
        m_FitOnVisual.FashionGoodsID  = GlobeVar.INVALID_ID;
        m_FitOnVisual.FashionID       = GlobeVar.INVALID_ID;
        m_FitOnVisual.FashionDeadline = YuanBaoShopItemLogic.DEADLINE_PRICE.PRICE_FOREVER;

        List <object> param = new List <object>();

        param.Add(tabFakeObject);
        param.Add(m_FitOnFakeObj);
        param.Add(m_FitOnVisual);

        Singleton <ObjManager> .GetInstance().ReloadModel(m_FitOnGameObject,
                                                          tabCharModel.ResPath,
                                                          Singleton <ObjManager> .GetInstance().AsycLoadFitOnObjOver,
                                                          param);
    }
    bool ShowEquip(int equipId, int profession)
    {
        bool res = false;

        if (null != m_FakeObj)
        {
            DestroyFakeObj();
        }
        Tab_EquipAttr eqTab = TableManager.GetEquipAttrByID(equipId, 0);

        if (eqTab == null)
        {
            return(false);
        }
//        EquipSubClass equipSubClass = (EquipSubClass)eqTab.Component;
        CreatePartnerFakeObj(profession, eqTab);
        UpdateFakeObj(eqTab);
        return(res);
    }
Example #5
0
        public void InitFakeObjWeapon(GameObject Obj, int nCurWeaponID, Tab_FakeObject FakeObjTable)
        {
            // 重载武器
            bool           defaultVisual = false;
            Tab_ItemVisual WeaponVisual  = null;
            Tab_EquipAttr  tabEquipAttr  = TableManager.GetEquipAttrByID(nCurWeaponID, 0);

            if (tabEquipAttr != null)
            {
                Tab_ItemVisual tabWeaponVisual = TableManager.GetItemVisualByID(tabEquipAttr.ModelId, 0);
                if (tabWeaponVisual != null)
                {
                    WeaponVisual = tabWeaponVisual;
                }
                else
                {
                    defaultVisual = true;
                }
            }
            else
            {
                defaultVisual = true;
            }

            if (defaultVisual)
            {
                Tab_ItemVisual tabDefaultVisual = TableManager.GetItemVisualByID(GlobeVar.DEFAULT_VISUAL_ID, 0);
                if (tabDefaultVisual == null)
                {
                    return;
                }

                WeaponVisual = tabDefaultVisual;
            }

            int nWeaponModelID = -1;

            if (WeaponVisual == null)
            {
                return;
            }


            if (Singleton <ObjManager> .Instance.MainPlayer == null)
            {
                if (UIControllerBase <RoleChooseLogic> .Instance() != null)
                {
                    int nProfession = -1;
                    nProfession = UIControllerBase <RoleChooseLogic> .Instance().GetRoleProfess();

                    if (nProfession == (int)CharacterDefine.PROFESSION.SHAOLIN)
                    {
                        nWeaponModelID = WeaponVisual.WeaponModelIDShaoLin;
                    }
                    else if (nProfession == (int)CharacterDefine.PROFESSION.TIANSHAN)
                    {
                        nWeaponModelID = WeaponVisual.WeaponModelIDTianShan;
                    }
                    else if (nProfession == (int)CharacterDefine.PROFESSION.DALI)
                    {
                        nWeaponModelID = WeaponVisual.WeaponModelIDDaLi;
                    }
                    else if (nProfession == (int)CharacterDefine.PROFESSION.XIAOYAO)
                    {
                        nWeaponModelID = WeaponVisual.WeaponModelIDXiaoYao;
                    }
                    else if (nProfession == (int)CharacterDefine.PROFESSION.GAIBANG)
                    {
                        nWeaponModelID = WeaponVisual.WeaponModelIDGaiBang;
                    }
                }
            }

            else
            {
                nWeaponModelID = Singleton <ObjManager> .Instance.MainPlayer.GetWeaponModelID(WeaponVisual);
            }


            Tab_WeaponModel tabWeaponModel = TableManager.GetWeaponModelByID(nWeaponModelID, 0);

            if (tabWeaponModel == null)
            {
                return;
            }

            int playerProfession = -1;

            if (Singleton <ObjManager> .Instance.MainPlayer == null)
            {
                if (UIControllerBase <RoleChooseLogic> .Instance())
                {
                    playerProfession = UIControllerBase <RoleChooseLogic> .Instance().GetRoleProfess();
                }
            }

            else
            {
                playerProfession = Singleton <ObjManager> .Instance.MainPlayer.Profession;
            }

            if (playerProfession == (int)CharacterDefine.PROFESSION.TIANSHAN ||
                playerProfession == (int)CharacterDefine.PROFESSION.GAIBANG)
            {
                LoadWeapon(Obj, "Weapon_L", tabWeaponModel.ResPath + "_L", tabWeaponModel);
                LoadWeapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", tabWeaponModel);
            }
            else if (playerProfession == (int)CharacterDefine.PROFESSION.XIAOYAO)
            {
                LoadWeapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", tabWeaponModel);
            }
            else
            {
                LoadWeapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", tabWeaponModel);
            }
        }
    //显示装备属性
    public void ShowAttr(GameItem item, bool bUnEquiped = false)
    {
        ClearInfo();
        //获得身上对应槽位的装备
        int      slotindex    = item.GetEquipSlotIndex();
        GameItem compareEquip = GameManager.gameManager.PlayerDataPool.EquipPack.GetItem(slotindex);

        Tab_EquipAttr line = TableManager.GetEquipAttrByID(item.DataID, 0);

        if (line != null)
        {
            int index = 0;
            //血上限
            if (line.HP > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.HP, "HP");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAXHP);
                m_AttrValue[index].text = strColor + string.Format("+{0}", (int)(line.HP * item.GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                SetEnchanceAndStarAttr(item, index, line.HP);
                ++index;
            }
            //血上限(百分比)
            if (line.HPPer > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.HPPer, "HPPer");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAXHP);
                m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(line.HPPer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //蓝上限
            if (line.MP > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MP, "MP");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAXMP);
                m_AttrValue[index].text = strColor + string.Format("+{0}", (int)(line.MP * item.GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                SetEnchanceAndStarAttr(item, index, line.MP);
                ++index;
            }
            //蓝上限(百分比)
            if (line.MPPer > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MPPer, "MPPer");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAXMP);
                m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(line.MPPer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //物理攻击
            if (line.PhysicsAttack > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.PhysicsAttack, "PhysicsAttack");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.PYSATTACK);
                m_AttrValue[index].text = strColor + string.Format("+{0}", (int)(line.PhysicsAttack * item.GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                SetEnchanceAndStarAttr(item, index, line.PhysicsAttack);
                ++index;
            }
            //物理攻击(百分比)
            if (line.PhysicsAttackPer > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.PhysicsAttackPer, "PhysicsAttackPer");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.PYSATTACK);
                m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(line.PhysicsAttackPer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //法术攻击
            if (line.MagicAttack > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MagicAttack, "MagicAttack");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAGATTACK);
                m_AttrValue[index].text = strColor + string.Format("+{0}", (int)(line.MagicAttack * item.GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                SetEnchanceAndStarAttr(item, index, line.MagicAttack);
                ++index;
            }
            //法术攻击(百分比)
            if (line.MagicAttackPer > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MagicAttackPer, "MagicAttackPer");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAGATTACK);
                m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(line.MagicAttackPer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //物理防御
            if (line.PhysicsDefence > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.PhysicsDefence, "PhysicsDefence");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.PYSDEF);
                m_AttrValue[index].text = strColor + string.Format("+{0}", (int)(line.PhysicsDefence * item.GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                SetEnchanceAndStarAttr(item, index, line.PhysicsDefence);
                ++index;
            }
            //物理防御(百分比)
            if (line.PhysicsDefencePer > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.PhysicsDefencePer, "PhysicsDefencePer");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.PYSDEF);
                m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(line.PhysicsDefencePer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //法术防御
            if (line.MagicDefence > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MagicDefence, "MagicDefence");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAGDEF);
                m_AttrValue[index].text = strColor + string.Format("+{0}", (int)(line.MagicDefence * item.GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                SetEnchanceAndStarAttr(item, index, line.MagicDefence);
                ++index;
            }
            //法术防御(百分比)
            if (line.MagicDefencePer > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MagicDefencePer, "MagicDefencePer");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAGDEF);
                m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(line.MagicDefencePer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //攻击速度
            if (line.AttackSpeed > 0 && index < m_Attr.Length && index >= 0)
            {
                //策划要求 隐藏装备攻速属性
                //m_Attr[index].text = string.Format("{0}+{1}", ConvertAttrToString(COMBATATTE.ATTACKSPEED), line.AttackSpeed);
                //m_Attr[index].gameObject.SetActive(true);
                ////策划要求 攻速不受强化和打星影响
                //++index;
            }
            //攻击速度(百分比)
            if (line.AttackSpeedPer > 0 && index < m_Attr.Length && index >= 0)
            {
                //策划要求 隐藏装备攻速属性
                //m_Attr[index].text = string.Format("{0}+{1}%", ConvertAttrToString(COMBATATTE.ATTACKSPEED), line.AttackSpeedPer * 100);
                //m_Attr[index].gameObject.SetActive(true);
                //++index;
            }
            //全攻击
            if (line.AllAttack > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.AllAttack, "AllAttack");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString((COMBATATTE)1000);
                m_AttrValue[index].text = strColor + string.Format("+{0}", (int)(line.AllAttack * item.GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                SetEnchanceAndStarAttr(item, index, line.AllAttack);
                ++index;
            }
            //全攻击(百分比)
            if (line.AllAttackPer > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.AllAttackPer, "AllAttackPer");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString((COMBATATTE)1000);
                m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(line.AllAttackPer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //全防御
            if (line.AllDefence > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.AllDefence, "AllDefence");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString((COMBATATTE)1001);
                m_AttrValue[index].text = strColor + string.Format("+{0}", (int)(line.AllDefence * item.GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                SetEnchanceAndStarAttr(item, index, line.AllDefence);
                ++index;
            }
            //全防御(百分比)
            if (line.AllDefencePer > 0 && index < m_Attr.Length && index >= 0)
            {
                string strColor = GetAttrColor(bUnEquiped, compareEquip, line.AllDefencePer, "AllDefencePer");
                m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString((COMBATATTE)1001);
                m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(line.AllDefencePer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            // delete cut lines
            //if (index >= 1)
            //{
            //    if ((index - 1) >= 0 && (index - 1) < m_CutLine.Length)
            //    {
            //        m_CutLine[index - 1].SetActive(true);
            //    }

            //}
            //附加属性
            for (int attrIndex = 0; attrIndex < line.getAddAttrTypeCount(); ++attrIndex)
            {
                int   attrType  = line.GetAddAttrTypebyIndex(attrIndex);
                float attrValue = line.GetAddAttrValuebyIndex(attrIndex);
                if ((attrType >= (int)COMBATATTE.MAXHP && attrType < (int)COMBATATTE.COMBATATTE_MAXNUM) || attrType == 1000 || attrType == 1001)
                {
                    if (attrValue > 0)
                    {
                        if (index < m_Attr.Length && index >= 0)
                        {
                            //策划要求隐藏装备攻速属性
                            if (attrType == (int)COMBATATTE.ATTACKSPEED)
                            {
                                continue;
                            }

                            string strColor = GetAttrColor(bUnEquiped, compareEquip, attrValue, "AddAttr", attrIndex);
                            m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString((COMBATATTE)attrType);
                            m_AttrValue[index].text = strColor + string.Format("+{0}", (int)attrValue);
                            m_AttrWhole[index].SetActive(true);
                            if (attrType != (int)COMBATATTE.ATTACKSPEED) //策划要求 攻速不受强化和打星影响
                            {
                                //强化
                                SetEnchanceAndStarAttr(item, index, attrValue, true);
                                //策划要求 附加属性不受打星影响
                            }
                            ++index;
                        }
                    }
                }
            }
            //附加属性(百分比)
            for (int attrIndex = 0; attrIndex < line.getAddAttrTypeCount(); ++attrIndex)
            {
                int   attrType = line.GetAddAttrTypebyIndex(attrIndex);
                float attrPer  = line.GetAddAttrPerbyIndex(attrIndex);
                if (attrType >= (int)COMBATATTE.MAXHP && attrType < (int)COMBATATTE.COMBATATTE_MAXNUM && attrPer > 0)
                {
                    if (index < m_Attr.Length && index >= 0)
                    {
                        string strColor = GetAttrColor(bUnEquiped, compareEquip, attrPer, "AddAttrPer", attrIndex);

                        m_Attr[index].text      = strColor + ItemTool.ConvertAttrToString((COMBATATTE)attrIndex);
                        m_AttrValue[index].text = strColor + string.Format("+{0}%", (int)(attrPer * 100));
                        m_AttrWhole[index].SetActive(true);
                        ++index;
                    }
                }
            }

            //神器属性
            if (item != null && item.IsShenQiEquipMent())
            {
                Tab_ShenQiInfo _ShenQiInfo = TableManager.GetShenQiInfoByID(item.DataID, 0);
                if (_ShenQiInfo != null)
                {
                    //   技能信息
                    int SkillInfIndex = (int)ShenQiDyData.SkillId;
                    if (SkillInfIndex >= 0 && SkillInfIndex < item.DynamicData.Length)
                    {
                        Tab_SkillEx _skillEx = TableManager.GetSkillExByID(item.DynamicData[(int)ShenQiDyData.SkillId], 0);
                        if (_skillEx != null)
                        {
                            Tab_SkillBase _SkillBase = TableManager.GetSkillBaseByID(_skillEx.BaseId, 0);
                            if (_SkillBase != null)
                            {
                                // delete cut lines
                                //if (index >= 1 && index - 1 < m_CutLine.Length)
                                //{
                                //    m_CutLine[index - 1].SetActive(true);
                                //}
                                m_ShenQiSkillNameLable.text = _SkillBase.Name + "(" + _skillEx.Level + "/" + _ShenQiInfo.MaxSkillLev + ")";
                                m_ShenQiSkillDescLable.text = _skillEx.SkillDesc;
                                m_ShenQiSkillName.SetActive(true);
                                m_ShenQiSkillDesc.SetActive(true);
                            }
                        }
                    }
                    //属性条
                    int nLastAttrIndex = -1;
                    for (int i = 0; i < (int)ShenQiInfo.MAXRANDATTRNUM && i < m_ShenQiAttrWhole.Length; i++)
                    {
                        if (i + (int)ShenQiDyData.Attr1Info >= 0 && i + (int)ShenQiDyData.Attr1Info < item.DynamicData.Length)
                        {
                            int AttrRandData = item.DynamicData[i + (int)ShenQiDyData.Attr1Info];
                            if (AttrRandData > 0)
                            {
                                int AttrType    = item.GetShenQiRandAttrType(AttrRandData);
                                int AttrNum     = item.GetShenQiRandAttrNum(AttrRandData);
                                int AttrQuality = item.GetShenQiRandAttrQuality(AttrRandData);
                                m_ShenQiAttrName[i].text = Utils.GetItemNameColor(AttrQuality + 1) + Utils.GetAttrTypeString(AttrType);
                                //if (1 + _ShenQiInfo.ShenQiRefixPer > 0 && _ShenQiInfo.ShenQiRefixPer > 0)
                                //{
                                //    int nBaseAttr = (int)((AttrNum * 1.0f) / (1 + _ShenQiInfo.ShenQiRefixPer));
                                //    int nFixAttr = (int)(AttrNum * _ShenQiInfo.ShenQiRefixPer);
                                //    m_ShenQiAttrValue[i].text = Utils.GetItemNameColor(AttrQuality+1) + "+" + nBaseAttr.ToString() + "+" + nFixAttr.ToString();
                                //}
                                //else
                                {
                                    m_ShenQiAttrValue[i].text = Utils.GetItemNameColor(AttrQuality + 1) + "+" + AttrNum;
                                }
                                m_ShenQiAttrWhole[i].SetActive(true);
                                nLastAttrIndex = i;
                            }
                        }
                    }
                    //分界线
                    //   m_ShenQiSkillCutLine.SetActive(true);
                    if (nLastAttrIndex >= 0 && nLastAttrIndex < m_ShenQiAttrCutLine.Length)
                    {
                        m_ShenQiAttrCutLine[nLastAttrIndex].SetActive(true);
                    }
                    //m_ShenQiCutLine2.SetActive(true);
                }
            }
            //m_Grid.Reposition();
            //m_TopGrid.Recenter(true);
            m_Table.sorted          = true;
            m_Table.hideInactive    = true;
            m_Table.keepWithinPanel = true;
            m_Table.repositionNow   = true;
        }
    }
    string GetAttrColor(bool bUnEquiped, GameItem compareEquip, float newEquipAttrValue, string attrName, int AddAttrIndex = 0)
    {
        if (!bUnEquiped)
        {
            return("");
        }

        bool          bHaveEquip  = false;
        Tab_EquipAttr compareLine = null;

        if (compareEquip != null && compareEquip.IsValid())
        {
            bHaveEquip  = true;
            compareLine = TableManager.GetEquipAttrByID(compareEquip.DataID, 0);
        }

        if (!bHaveEquip)
        {
            return("[FF2222]");
        }
        else
        {
            float oldEquipAttrValue = 0;
            switch (attrName)
            {
            case "HP":
                oldEquipAttrValue = compareLine.HP + GetStarAttr(compareEquip, compareLine.HP);
                break;

            case "HPPer":
                oldEquipAttrValue = compareLine.HPPer;
                break;

            case "MP":
                oldEquipAttrValue = compareLine.MP + GetStarAttr(compareEquip, compareLine.MP);
                break;

            case "MPPer":
                oldEquipAttrValue = compareLine.MPPer;
                break;

            case "PhysicsAttack":
                oldEquipAttrValue = compareLine.PhysicsAttack + GetStarAttr(compareEquip, compareLine.PhysicsAttack);
                break;

            case "PhysicsAttackPer":
                oldEquipAttrValue = compareLine.PhysicsAttackPer;
                break;

            case "MagicAttack":
                oldEquipAttrValue = compareLine.MagicAttack + GetStarAttr(compareEquip, compareLine.MagicAttack);
                break;

            case "MagicAttackPer":
                oldEquipAttrValue = compareLine.MagicAttackPer;
                break;

            case "PhysicsDefence":
                oldEquipAttrValue = compareLine.PhysicsDefence + GetStarAttr(compareEquip, compareLine.PhysicsDefence);
                break;

            case "PhysicsDefencePer":
                oldEquipAttrValue = compareLine.PhysicsDefencePer;
                break;

            case "MagicDefence":
                oldEquipAttrValue = compareLine.MagicDefence + GetStarAttr(compareEquip, compareLine.MagicDefence);
                break;

            case "MagicDefencePer":
                oldEquipAttrValue = compareLine.MagicDefencePer;
                break;

            case "AllAttack":
                oldEquipAttrValue = compareLine.AllAttack + GetStarAttr(compareEquip, compareLine.AllAttack);
                break;

            case "AllAttackPer":
                oldEquipAttrValue = compareLine.AllAttackPer;
                break;

            case "AllDefence":
                oldEquipAttrValue = compareLine.AllDefence + GetStarAttr(compareEquip, compareLine.AllDefence);
                break;

            case "AllDefencePer":
                oldEquipAttrValue = compareLine.AllDefencePer;
                break;

            case "AddAttr":
                oldEquipAttrValue = compareLine.GetAddAttrValuebyIndex(AddAttrIndex);
                break;

            case "AddAttrPer":
                oldEquipAttrValue = compareLine.GetAddAttrPerbyIndex(AddAttrIndex);
                break;

            default:
                break;
            }

            if (oldEquipAttrValue < newEquipAttrValue)
            {
                return("[FF2222]");
            }
            else if (oldEquipAttrValue == newEquipAttrValue)
            {
                return("[00A0FF]");
            }
            else
            {
                return("[32A100]");
            }
        }
    }
Example #8
0
    void HandleFitOnWeapon(int nGoodsId, int nDataID, Tab_EquipAttr tabWeaponEquipAttr)
    {
        Tab_ItemVisual tabItemVisual = TableManager.GetItemVisualByID(tabWeaponEquipAttr.ModelId, 0);

        if (tabItemVisual == null)
        {
            return;
        }

        int nWeaponModelID = Singleton <ObjManager> .Instance.MainPlayer.GetWeaponModelID(tabItemVisual);

        Tab_WeaponModel tabWeaponModel = TableManager.GetWeaponModelByID(nWeaponModelID, 0);

        if (tabWeaponModel == null)
        {
            return;
        }

        /// 因为可能显示过伙伴 坐骑的模型 所以要重载玩家模型预览 设置玩家外观
        Tab_ItemVisual tabModelVisual = null;

        if (m_FitOnVisual.FashionID != GlobeVar.INVALID_ID)
        {
            Tab_FashionData tabFashionData = TableManager.GetFashionDataByID(m_FitOnVisual.FashionID, 0);
            if (tabFashionData == null)
            {
                return;
            }
            tabModelVisual = TableManager.GetItemVisualByID(tabFashionData.ItemVisualID, 0);
        }
        else if (m_FitOnVisual.ArmorID != GlobeVar.INVALID_ID)
        {
            Tab_EquipAttr tabArmorEquipAttr = TableManager.GetEquipAttrByID(m_FitOnVisual.ArmorID, 0);
            if (tabArmorEquipAttr == null)
            {
                return;
            }
            tabModelVisual = TableManager.GetItemVisualByID(tabArmorEquipAttr.ModelId, 0);
        }
        else
        {
            if (Singleton <ObjManager> .Instance.MainPlayer.ModelVisualID == GlobeVar.INVALID_ID)
            {
                tabModelVisual = TableManager.GetItemVisualByID(GlobeVar.DEFAULT_VISUAL_ID, 0);
            }
            else
            {
                tabModelVisual = TableManager.GetItemVisualByID(Singleton <ObjManager> .Instance.MainPlayer.ModelVisualID, 0);
            }
        }

        if (tabModelVisual == null)
        {
            return;
        }
        // 设置结束 下面与武器一起重载

        int nCharModelID = Singleton <ObjManager> .Instance.MainPlayer.GetCharModelID(tabModelVisual);

        Tab_CharModel tabCharModel = TableManager.GetCharModelByID(nCharModelID, 0);

        if (tabCharModel == null)
        {
            return;
        }

        Tab_FakeObject tabFakeObject = TableManager.GetFakeObjectByID(m_FakeObjID, 0);

        if (tabFakeObject == null)
        {
            return;
        }

        m_FitOnVisual.WeaponGoodsID = nGoodsId;
        m_FitOnVisual.WeaponID      = nDataID;

        List <object> param = new List <object>();

        param.Add(tabFakeObject);
        param.Add(m_FitOnFakeObj);
        param.Add(m_FitOnVisual);

        Singleton <ObjManager> .GetInstance().ReloadModel(m_FitOnGameObject,
                                                          tabCharModel.ResPath,
                                                          Singleton <ObjManager> .GetInstance().AsycLoadFitOnObjOver,
                                                          param);
    }
Example #9
0
    void ShowEquipAttrInfo(EquipStrengthenItemLogic itemLogic)
    {
        ClearInfo();
        int           itemId = itemLogic.getGameItem().DataID;
        Tab_EquipAttr line   = TableManager.GetEquipAttrByID(itemId, 0);

        if (line != null)
        {
            int index = 0;
            //血上限
            if (line.HP > 0 && index < m_Attr.Length && index >= 0)
            {
                //string strColor = GetAttrColor(bUnEquiped, compareEquip, line.HP, "HP");
                m_Attr[index].text      = ItemTool.ConvertAttrToString(COMBATATTE.MAXHP);
                m_AttrValue[index].text = string.Format("+{0}", (int)(line.HP * itemLogic.getGameItem().GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                //SetEnchanceAndStarAttr(item, index, line.HP);
                ++index;
            }
            //血上限(百分比)
            if (line.HPPer > 0 && index < m_Attr.Length && index >= 0)
            {
                //string strColor = GetAttrColor(bUnEquiped, compareEquip, line.HPPer, "HPPer");
                m_Attr[index].text      = ItemTool.ConvertAttrToString(COMBATATTE.MAXHP);
                m_AttrValue[index].text = string.Format("+{0}%", (int)(line.HPPer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //蓝上限
            if (line.MP > 0 && index < m_Attr.Length && index >= 0)
            {
                //string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MP, "MP");
                m_Attr[index].text      = ItemTool.ConvertAttrToString(COMBATATTE.MAXMP);
                m_AttrValue[index].text = string.Format("+{0}", (int)(line.MP * itemLogic.getGameItem().GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                //SetEnchanceAndStarAttr(item, index, line.MP);
                ++index;
            }
            //蓝上限(百分比)
            if (line.MPPer > 0 && index < m_Attr.Length && index >= 0)
            {
                //string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MPPer, "MPPer");
                m_Attr[index].text      = ItemTool.ConvertAttrToString(COMBATATTE.MAXMP);
                m_AttrValue[index].text = string.Format("+{0}%", (int)(line.MPPer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //物理攻击
            if (line.PhysicsAttack > 0 && index < m_Attr.Length && index >= 0)
            {
                //string strColor = GetAttrColor(bUnEquiped, compareEquip, line.PhysicsAttack, "PhysicsAttack");
                m_Attr[index].text      = ItemTool.ConvertAttrToString(COMBATATTE.PYSATTACK);
                m_AttrValue[index].text = string.Format("+{0}", (int)(line.PhysicsAttack * itemLogic.getGameItem().GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                //SetEnchanceAndStarAttr(item, index, line.PhysicsAttack);
                ++index;
            }
            //物理攻击(百分比)
            if (line.PhysicsAttackPer > 0 && index < m_Attr.Length && index >= 0)
            {
                //string strColor = GetAttrColor(bUnEquiped, compareEquip, line.PhysicsAttackPer, "PhysicsAttackPer");
                m_Attr[index].text      = ItemTool.ConvertAttrToString(COMBATATTE.PYSATTACK);
                m_AttrValue[index].text = string.Format("+{0}%", (int)(line.PhysicsAttackPer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //法术攻击
            if (line.MagicAttack > 0 && index < m_Attr.Length && index >= 0)
            {
                //string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MagicAttack, "MagicAttack");
                m_Attr[index].text      = ItemTool.ConvertAttrToString(COMBATATTE.MAGATTACK);
                m_AttrValue[index].text = string.Format("+{0}", (int)(line.MagicAttack * itemLogic.getGameItem().GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                //SetEnchanceAndStarAttr(item, index, line.MagicAttack);
                ++index;
            }
            //法术攻击(百分比)
            if (line.MagicAttackPer > 0 && index < m_Attr.Length && index >= 0)
            {
                //string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MagicAttackPer, "MagicAttackPer");
                m_Attr[index].text      = ItemTool.ConvertAttrToString(COMBATATTE.MAGATTACK);
                m_AttrValue[index].text = string.Format("+{0}%", (int)(line.MagicAttackPer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //物理防御
            if (line.PhysicsDefence > 0 && index < m_Attr.Length && index >= 0)
            {
                //string strColor = GetAttrColor(bUnEquiped, compareEquip, line.PhysicsDefence, "PhysicsDefence");
                m_Attr[index].text      = ItemTool.ConvertAttrToString(COMBATATTE.PYSDEF);
                m_AttrValue[index].text = string.Format("+{0}", (int)(line.PhysicsDefence * itemLogic.getGameItem().GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                //SetEnchanceAndStarAttr(item, index, line.PhysicsDefence);
                ++index;
            }
            //物理防御(百分比)
            if (line.PhysicsDefencePer > 0 && index < m_Attr.Length && index >= 0)
            {
                //string strColor = GetAttrColor(bUnEquiped, compareEquip, line.PhysicsDefencePer, "PhysicsDefencePer");
                m_Attr[index].text      = ItemTool.ConvertAttrToString(COMBATATTE.PYSDEF);
                m_AttrValue[index].text = string.Format("+{0}%", (int)(line.PhysicsDefencePer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //法术防御
            if (line.MagicDefence > 0 && index < m_Attr.Length && index >= 0)
            {
                //string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MagicDefence, "MagicDefence");
                m_Attr[index].text      = ItemTool.ConvertAttrToString(COMBATATTE.MAGDEF);
                m_AttrValue[index].text = string.Format("+{0}", (int)(line.MagicDefence * itemLogic.getGameItem().GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                //SetEnchanceAndStarAttr(item, index, line.MagicDefence);
                ++index;
            }
            //法术防御(百分比)
            if (line.MagicDefencePer > 0 && index < m_Attr.Length && index >= 0)
            {
                //string strColor = GetAttrColor(bUnEquiped, compareEquip, line.MagicDefencePer, "MagicDefencePer");
                m_Attr[index].text      = ItemTool.ConvertAttrToString(COMBATATTE.MAGDEF);
                m_AttrValue[index].text = string.Format("+{0}%", (int)(line.MagicDefencePer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //全攻击
            if (line.AllAttack > 0 && index < m_Attr.Length && index >= 0)
            {
                //string strColor = GetAttrColor(bUnEquiped, compareEquip, line.AllAttack, "AllAttack");
                m_Attr[index].text      = ItemTool.ConvertAttrToString((COMBATATTE)1000);
                m_AttrValue[index].text = string.Format("+{0}", (int)(line.AllAttack * itemLogic.getGameItem().GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                //SetEnchanceAndStarAttr(item, index, line.AllAttack);
                ++index;
            }
            //全攻击(百分比)
            if (line.AllAttackPer > 0 && index < m_Attr.Length && index >= 0)
            {
                //string strColor = GetAttrColor(bUnEquiped, compareEquip, line.AllAttackPer, "AllAttackPer");
                m_Attr[index].text      = ItemTool.ConvertAttrToString((COMBATATTE)1000);
                m_AttrValue[index].text = string.Format("+{0}%", (int)(line.AllAttackPer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //全防御
            if (line.AllDefence > 0 && index < m_Attr.Length && index >= 0)
            {
                //string strColor = GetAttrColor(bUnEquiped, compareEquip, line.AllDefence, "AllDefence");
                m_Attr[index].text      = ItemTool.ConvertAttrToString((COMBATATTE)1001);
                m_AttrValue[index].text = string.Format("+{0}", (int)(line.AllDefence * itemLogic.getGameItem().GetAttrFactorRefix()));
                m_AttrWhole[index].SetActive(true);
                //强化
                //SetEnchanceAndStarAttr(item, index, line.AllDefence);
                ++index;
            }
            //全防御(百分比)
            if (line.AllDefencePer > 0 && index < m_Attr.Length && index >= 0)
            {
                //string strColor = GetAttrColor(bUnEquiped, compareEquip, line.AllDefencePer, "AllDefencePer");
                m_Attr[index].text      = ItemTool.ConvertAttrToString((COMBATATTE)1001);
                m_AttrValue[index].text = string.Format("+{0}%", (int)(line.AllDefencePer * 100));
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //附加属性
            for (int attrIndex = 0; attrIndex < line.getAddAttrTypeCount(); ++attrIndex)
            {
                int   attrType  = line.GetAddAttrTypebyIndex(attrIndex);
                float attrValue = line.GetAddAttrValuebyIndex(attrIndex);
                if ((attrType >= (int)COMBATATTE.MAXHP && attrType < (int)COMBATATTE.COMBATATTE_MAXNUM) || attrType == 1000 || attrType == 1001)
                {
                    if (attrValue > 0)
                    {
                        if (index < m_Attr.Length && index >= 0)
                        {
                            //策划要求隐藏装备攻速属性
                            if (attrType == (int)COMBATATTE.ATTACKSPEED)
                            {
                                continue;
                            }

                            //string strColor = GetAttrColor(bUnEquiped, compareEquip, attrValue, "AddAttr", attrIndex);
                            m_Attr[index].text      = ItemTool.ConvertAttrToString((COMBATATTE)attrType);
                            m_AttrValue[index].text = string.Format("+{0}", (int)attrValue);
                            m_AttrWhole[index].SetActive(true);
                            if (attrType != (int)COMBATATTE.ATTACKSPEED) //策划要求 攻速不受强化和打星影响
                            {
                                //强化
                                //SetEnchanceAndStarAttr(item, index, attrValue, true);
                                //策划要求 附加属性不受打星影响
                            }
                            ++index;
                        }
                    }
                }
            }
            //附加属性(百分比)
            for (int attrIndex = 0; attrIndex < line.getAddAttrTypeCount(); ++attrIndex)
            {
                int   attrType = line.GetAddAttrTypebyIndex(attrIndex);
                float attrPer  = line.GetAddAttrPerbyIndex(attrIndex);
                if (attrType >= (int)COMBATATTE.MAXHP && attrType < (int)COMBATATTE.COMBATATTE_MAXNUM && attrPer > 0)
                {
                    if (index < m_Attr.Length && index >= 0)
                    {
                        //string strColor = GetAttrColor(bUnEquiped, compareEquip, attrPer, "AddAttrPer", attrIndex);

                        m_Attr[index].text      = ItemTool.ConvertAttrToString((COMBATATTE)attrIndex);
                        m_AttrValue[index].text = string.Format("+{0}%", (int)(attrPer * 100));
                        m_AttrWhole[index].SetActive(true);
                        ++index;
                    }
                }
            }
        }
    }
    //显示装备属性
    public void ShowAttr(GameItem item)
    {
        for (int i = 0; i < m_AttrName.Length; ++i)
        {
            m_AttrName[i].text  = "";
            m_AddAttr[i].text   = "";
            m_AttrValue[i].text = "";
            m_AttrWhole[i].SetActive(false);
            m_CurAttr[i].text = "";
        }
        string        strStar     = "";
        string        curStrStar  = "";
        Tab_EquipStar starline    = TableManager.GetEquipStarByID(item.StarLevel + 1, 0);
        Tab_EquipStar curStarline = TableManager.GetEquipStarByID(item.StarLevel, 0);

        //if (starline != null && curStarline != null)
        if (starline != null)
        {
            strStar = (starline.AttrRate * 100 + 100).ToString() + "%";
            if (curStarline != null)
            {
                curStrStar = (curStarline.AttrRate * 100 + 100).ToString() + "%";
            }
            else
            {
                curStrStar = "0%";
            }
        }
        string        strColor = "[00A0FF]";
        Tab_EquipAttr line     = TableManager.GetEquipAttrByID(item.DataID, 0);

        if (line != null)
        {
            int index = 0;
            //血上限
            if (line.HP > 0 && index < m_AttrName.Length && index >= 0)
            {
                //打星加成属性
                m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAXHP);
                m_AddAttr[index].text  = strStar;
                m_CurAttr[index].text  = curStrStar;
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //蓝上限
            if (line.MP > 0 && index < m_AttrName.Length && index >= 0)
            {
                m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAXMP);
                m_AddAttr[index].text  = strStar;
                m_CurAttr[index].text  = curStrStar;
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //物理攻击
            if (line.PhysicsAttack > 0 && index < m_AttrName.Length && index >= 0)
            {
                m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString(COMBATATTE.PYSATTACK);
                m_AddAttr[index].text  = strStar;
                m_CurAttr[index].text  = curStrStar;
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //法术攻击
            if (line.MagicAttack > 0 && index < m_AttrName.Length && index >= 0)
            {
                m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAGATTACK);
                m_AddAttr[index].text  = strStar;
                m_CurAttr[index].text  = curStrStar;
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //物理防御
            if (line.PhysicsDefence > 0 && index < m_AttrName.Length && index >= 0)
            {
                m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString(COMBATATTE.PYSDEF);
                m_AddAttr[index].text  = strStar;
                m_CurAttr[index].text  = curStrStar;
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //法术防御
            if (line.MagicDefence > 0 && index < m_AttrName.Length && index >= 0)
            {
                m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAGDEF);
                m_AddAttr[index].text  = strStar;
                m_CurAttr[index].text  = curStrStar;
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //全攻击
            if (line.AllAttack > 0 && index < m_AttrName.Length && index >= 0)
            {
                m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString((COMBATATTE)1000);
                m_AddAttr[index].text  = strStar;
                m_CurAttr[index].text  = curStrStar;
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            //全防御
            if (line.AllDefence > 0 && index < m_AttrName.Length && index >= 0)
            {
                m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString((COMBATATTE)1001);
                m_AddAttr[index].text  = strStar;
                m_CurAttr[index].text  = curStrStar;
                m_AttrWhole[index].SetActive(true);
                ++index;
            }
            ////打星不加附加属性
            //for (int attrIndex = 0; attrIndex < line.getAddAttrTypeCount(); ++attrIndex)
            //{
            //    int attrType = line.GetAddAttrTypebyIndex(attrIndex);
            //    float attrValue = line.GetAddAttrValuebyIndex(attrIndex);
            //    if ((attrType >= (int)COMBATATTE.MAXHP && attrType < (int)COMBATATTE.COMBATATTE_MAXNUM) || attrType == 1000 || attrType == 1001)
            //    {
            //        if (attrValue > 0)
            //        {
            //            if (index < m_AttrName.Length && index >= 0)
            //            {
            //                //策划要求隐藏装备攻速属性
            //                if (attrType == (int)COMBATATTE.ATTACKSPEED)
            //                {
            //                    continue;
            //                }
            //                m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString((COMBATATTE)attrType);
            //                m_AddAttr[index].text = strStar;
            //                m_AttrWhole[index].SetActive(true);
            //                ++index;
            //            }
            //        }
            //    }
            //}
            m_Grid.Reposition();
            m_TopGrid.Recenter(true);
        }
    }
    void UpdateFakeObj(Tab_EquipAttr eqTab = null)
    {
        int weaponId = -1;
        int modelId  = -1;

        if (eqTab != null)
        {
            EquipSubClass equipSubClass = (EquipSubClass)eqTab.Component;
            if (equipSubClass == EquipSubClass.WEAPON)
            {
                weaponId = eqTab.Id;
                FakeObjExtraData.weaponId = weaponId;
            }
            modelId = eqTab.ModelId;
        }
        //Debug.LogError("EQTab:"+eqTab.Id+","+modelId);
        int nModelVisualID = Singleton <ObjManager> .Instance.MainPlayer.ModelVisualID;
        //Debug.LogError("nModelVisualID is:" + nModelVisualID);

        bool           isDefaultVisual = false;
        Tab_ItemVisual tabItemVisual   = TableManager.GetItemVisualByID(nModelVisualID, 0);

        if (tabItemVisual == null)
        {
            isDefaultVisual = true;
        }
        else
        {
            isDefaultVisual = false;
        }

        if (isDefaultVisual)
        {
            tabItemVisual = TableManager.GetItemVisualByID(GlobeVar.DEFAULT_VISUAL_ID, 0);
            if (tabItemVisual == null)
            {
                return;
            }
        }
        //武器不影响外观
        if (weaponId == -1 && modelId != -1)
        {
            tabItemVisual = TableManager.GetItemVisualByID(modelId, 0);
        }

        int nCharModelID = Singleton <ObjManager> .Instance.MainPlayer.GetCharModelID(tabItemVisual);

        //Debug.LogError("nCharModelID is:" + nCharModelID);
        Tab_CharModel tabCharModel = TableManager.GetCharModelByID(nCharModelID, 0);

        if (tabCharModel == null)
        {
            return;
        }
        Tab_FakeObject tabFakeObject = TableManager.GetFakeObjectByID(m_PlayerFakeObjID, 0);

        if (tabFakeObject == null)
        {
            return;
        }
        //m_PlayerFakeObj = new FakeObject();
        Singleton <ObjManager> .GetInstance().ReloadModel(m_FakeObjGameObject,
                                                          tabCharModel.ResPath,
                                                          Singleton <ObjManager> .GetInstance().AsycLoadFakeObjOver,
                                                          tabFakeObject,
                                                          m_FakeObj
                                                          // weaponId:
                                                          );

        GameManager.gameManager.ActiveScene.ShowFakeObj();
    }
Example #12
0
    //显示装备属性
    public void ShowAttr(GameItem item)
    {
        for (int i = 0; i < m_AttrName.Length; ++i)
        {
            m_AttrName[i].text = "";
            m_AddAttr[i].text  = "";
            m_AttrWhole[i].SetActive(false);
            m_CurAttr[i].text = "";
        }
        string strColor = "[00A0FF]";
        //Tab_EquipEnchance curEnchanceLine = TableManager.GetEquipEnchanceByID(item.EnchanceLevel.ToString(), 0);
        Tab_EquipEnchance nextEnchanceLine = TableManager.GetEquipEnchanceByID(item.EnchanceLevel + 1, 0);

//        Tab_EquipEnchance curEnchanceLine = TableManager.GetEquipEnchanceByID(item.EnchanceLevel, 0);
        //if (nextEnchanceLine != null && curEnchanceLine != null)
        if (nextEnchanceLine != null)
        {
            Tab_EquipAttr line = TableManager.GetEquipAttrByID(item.DataID, 0);
            if (line != null)
            {
                int index = 0;
                //血上限
                if (line.HP > 0 && index < m_AttrName.Length && index >= 0)
                {
                    //打星加成属性
                    m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAXHP);
                    m_AddAttr[index].text  = string.Format("+{0}", GetNextEnchanceAttr(item, (int)line.HP).ToString());
                    m_CurAttr[index].text  = string.Format("+{0}", GetCurEnchanceAttr(item, (int)line.HP).ToString());
                    m_AttrWhole[index].SetActive(true);
                    ++index;
                }
                //蓝上限
                if (line.MP > 0 && index < m_AttrName.Length && index >= 0)
                {
                    m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAXMP);
                    m_AddAttr[index].text  = string.Format("+{0}", GetNextEnchanceAttr(item, (int)line.MP).ToString());
                    m_CurAttr[index].text  = string.Format("+{0}", GetCurEnchanceAttr(item, (int)line.MP).ToString());
                    m_AttrWhole[index].SetActive(true);
                    ++index;
                }
                //物理攻击
                if (line.PhysicsAttack > 0 && index < m_AttrName.Length && index >= 0)
                {
                    m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString(COMBATATTE.PYSATTACK);
                    m_AddAttr[index].text  = string.Format("+{0}", GetNextEnchanceAttr(item, (int)line.PhysicsAttack).ToString());
                    m_CurAttr[index].text  = string.Format("+{0}", GetCurEnchanceAttr(item, (int)line.PhysicsAttack).ToString());
                    m_AttrWhole[index].SetActive(true);
                    ++index;
                }
                //法术攻击
                if (line.MagicAttack > 0 && index < m_AttrName.Length && index >= 0)
                {
                    m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAGATTACK);
                    m_AddAttr[index].text  = string.Format("+{0}", GetNextEnchanceAttr(item, (int)line.MagicAttack).ToString());
                    m_CurAttr[index].text  = string.Format("+{0}", GetCurEnchanceAttr(item, (int)line.MagicAttack).ToString());
                    m_AttrWhole[index].SetActive(true);
                    ++index;
                }
                //物理防御
                if (line.PhysicsDefence > 0 && index < m_AttrName.Length && index >= 0)
                {
                    m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString(COMBATATTE.PYSDEF);
                    m_AddAttr[index].text  = string.Format("+{0}", GetNextEnchanceAttr(item, (int)line.PhysicsDefence).ToString());
                    m_CurAttr[index].text  = string.Format("+{0}", GetCurEnchanceAttr(item, (int)line.PhysicsDefence).ToString());
                    m_AttrWhole[index].SetActive(true);
                    ++index;
                }
                //法术防御
                if (line.MagicDefence > 0 && index < m_AttrName.Length && index >= 0)
                {
                    m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString(COMBATATTE.MAGDEF);
                    m_AddAttr[index].text  = string.Format("+{0}", GetNextEnchanceAttr(item, (int)line.MagicDefence).ToString());
                    m_CurAttr[index].text  = string.Format("+{0}", GetCurEnchanceAttr(item, (int)line.MagicDefence).ToString());
                    m_AttrWhole[index].SetActive(true);
                    ++index;
                }
                //全攻击
                if (line.AllAttack > 0 && index < m_AttrName.Length && index >= 0)
                {
                    m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString((COMBATATTE)1000);
                    m_AddAttr[index].text  = string.Format("+{0}", GetNextEnchanceAttr(item, (int)line.AllAttack).ToString());
                    m_CurAttr[index].text  = string.Format("+{0}", GetCurEnchanceAttr(item, (int)line.AllAttack).ToString());
                    m_AttrWhole[index].SetActive(true);
                    ++index;
                }
                //全防御
                if (line.AllDefence > 0 && index < m_AttrName.Length && index >= 0)
                {
                    m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString((COMBATATTE)1001);
                    m_AddAttr[index].text  = string.Format("+{0}", GetNextEnchanceAttr(item, (int)line.AllDefence).ToString());
                    m_CurAttr[index].text  = string.Format("+{0}", GetCurEnchanceAttr(item, (int)line.AllDefence).ToString());
                    m_AttrWhole[index].SetActive(true);
                    ++index;
                }
                //附加属性
                for (int attrIndex = 0; attrIndex < line.getAddAttrTypeCount(); ++attrIndex)
                {
                    int   attrType  = line.GetAddAttrTypebyIndex(attrIndex);
                    float attrValue = line.GetAddAttrValuebyIndex(attrIndex);
                    if ((attrType >= (int)COMBATATTE.MAXHP && attrType < (int)COMBATATTE.COMBATATTE_MAXNUM) || attrType == 1000 || attrType == 1001)
                    {
                        if (attrValue > 0)
                        {
                            if (index < m_AttrName.Length && index >= 0)
                            {
                                //策划要求隐藏装备攻速属性
                                if (attrType == (int)COMBATATTE.ATTACKSPEED)
                                {
                                    continue;
                                }
                                m_AttrName[index].text = strColor + ItemTool.ConvertAttrToString((COMBATATTE)attrType);
                                m_AddAttr[index].text  = string.Format("+{0}", GetNextEnchanceAttr(item, (int)attrValue).ToString());
                                m_CurAttr[index].text  = string.Format("+{0}", GetCurEnchanceAttr(item, (int)attrValue).ToString());
                                m_AttrWhole[index].SetActive(true);
                                ++index;
                            }
                        }
                    }
                }
                m_Grid.Reposition();
                m_TopGrid.Recenter(true);
            }
        }
    }
Example #13
0
        public void InitFakeObjWeapon(GameObject Obj, int nCurWeaponID, Tab_FakeObject FakeObjTable)
        {
            // 重载武器
            bool           defaultVisual = false;
            Tab_ItemVisual WeaponVisual  = null;
            Tab_EquipAttr  tabEquipAttr  = TableManager.GetEquipAttrByID(nCurWeaponID, 0);

            if (tabEquipAttr != null)
            {
                Tab_ItemVisual tabWeaponVisual = TableManager.GetItemVisualByID(tabEquipAttr.ModelId, 0);
                if (tabWeaponVisual != null)
                {
                    WeaponVisual = tabWeaponVisual;
                }
                else
                {
                    defaultVisual = true;
                }
            }
            else
            {
                defaultVisual = true;
            }

            if (defaultVisual)
            {
                Tab_ItemVisual tabDefaultVisual = TableManager.GetItemVisualByID(GlobeVar.DEFAULT_VISUAL_ID, 0);
                if (tabDefaultVisual == null)
                {
                    return;
                }

                WeaponVisual = tabDefaultVisual;
            }

            if (WeaponVisual == null)
            {
                return;
            }

            int nWeaponModelID = GetWeaponModelID(WeaponVisual, GameManager.gameManager.OtherPlayerData.Profession);

            Tab_WeaponModel tabWeaponModel = TableManager.GetWeaponModelByID(nWeaponModelID, 0);

            if (tabWeaponModel == null)
            {
                return;
            }

            if (GameManager.gameManager.OtherPlayerData == null)
            {
                return;
            }
            if (GameManager.gameManager.OtherPlayerData.Profession == (int)CharacterDefine.PROFESSION.TIANSHAN ||
                GameManager.gameManager.OtherPlayerData.Profession == (int)CharacterDefine.PROFESSION.GAIBANG)
            {
                LoadOtherViewWapon(Obj, "Weapon_L", tabWeaponModel.ResPath + "_L", new Vector3(tabWeaponModel.LeftRotX, tabWeaponModel.LeftRotY, tabWeaponModel.LeftRotZ));
                LoadOtherViewWapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", new Vector3(tabWeaponModel.RightRotX, tabWeaponModel.RightRotY, tabWeaponModel.RightRotZ));
            }
            else if (GameManager.gameManager.OtherPlayerData.Profession == (int)CharacterDefine.PROFESSION.XIAOYAO)
            {
                LoadOtherViewWapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", Vector3.zero);
            }
            else
            {
                LoadOtherViewWapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", new Vector3(tabWeaponModel.RightRotX, tabWeaponModel.RightRotY, tabWeaponModel.RightRotZ));
            }
        }