Ejemplo n.º 1
0
    public int GetHpDrugNum()
    {
        int num = 0;
        GameItemContainer BackPack = GameManager.gameManager.PlayerDataPool.BackPack;

        if (Singleton <ObjManager> .Instance.MainPlayer)
        {
            for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_HP; i <= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_HP; i++)
            {
                num += BackPack.GetItemCountByDataId(i);
            }
            for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_DYHP; i <= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_DYHP; i++)
            {
                num += BackPack.GetItemCountByDataId(i);
            }
        }
        return(num);
    }
Ejemplo n.º 2
0
    public void InitAutoFight()
    {
        m_HpItemCDPic.fillAmount = 1;
        m_MpItemCDPic.fillAmount = 1;
//         HpItemCDTime = 0;
//         HpItemCDTime = 0;
        GameItemContainer BackPack = GameManager.gameManager.PlayerDataPool.BackPack;
        Obj_MainPlayer    User     = Singleton <ObjManager> .Instance.MainPlayer;

        if (User)  //更新信息
        {
            if (User.AutoHpID != -1)
            {
                Tab_CommonItem curItem = TableManager.GetCommonItemByID(User.AutoHpID, 0);
                if (curItem != null)
                {
                    if (BackPack.GetItemCountByDataId(User.AutoHpID) <= 0)
                    {
                        m_HpItemCDPic.fillAmount = 1;
                        GameManager.gameManager.PlayerDataPool.HpItemCDTime = 0;
                    }
                }
            }
            if (User.AutoMpID != -1)
            {
                Tab_CommonItem curItem = TableManager.GetCommonItemByID(User.AutoMpID, 0);
                if (curItem != null)
                {
                    if (BackPack.GetItemCountByDataId(User.AutoMpID) <= 0)
                    {
                        m_MpItemCDPic.fillAmount = 1;
                        GameManager.gameManager.PlayerDataPool.MpItemCDTime = 0;
                    }
                }
            }
        }
    }
Ejemplo n.º 3
0
    public void UpdateItemNum()
    {
        if (null == m_CurSelect)
        {
            m_LableNumber.text = "";
            return;
        }
        int nCount = 0;
        GameItemContainer BackPack = GameManager.gameManager.PlayerDataPool.BackPack;

        if (BackPack != null)
        {
            nCount = BackPack.GetItemCountByDataId(m_CurSelect.ItemID());
        }
        m_LableNumber.text = StrDictionary.GetClientDictionaryString("#{5326}", nCount);
    }
Ejemplo n.º 4
0
    public void OnItemHPClick()
    {
        CalcalateHPMPPlusState();
        if (GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_FB_CABALINTRO)
        {
            return;
        }

        if (!GameManager.gameManager.PlayerDataPool.IsServerFlagOpen(SERVER_FLAGS_ENUM.FLAG_SYSTEMSHOP))
        {
            return;
        }
        GameItemContainer BackPack = GameManager.gameManager.PlayerDataPool.BackPack;
        Obj_MainPlayer    User     = Singleton <ObjManager> .Instance.MainPlayer;

        if (User)  //更新信息
        {
            if (User.AutoHpID != -1)
            {
                Tab_CommonItem curItem = TableManager.GetCommonItemByID(User.AutoHpID, 0);
                if (curItem != null)
                {
                    if (BackPack.GetItemCountByDataId(User.AutoHpID) <= 0)
                    {
                        UIManager.ShowUI(UIInfo.SysShop);
                        return;
                    }
                }
            }
        }
//         if (!m_HpItem.activeInHierarchy)
//         {
//             UIManager.ShowUI(UIInfo.SysShop);
//             return;
//         }

        if (Singleton <ObjManager> .Instance.MainPlayer)
        {
            if (Singleton <ObjManager> .Instance.MainPlayer.AutoPercent((int)MedicSubClass.HP) == false)
            {
                Singleton <ObjManager> .Instance.MainPlayer.UpdateSelectDrug(); //重新选择药

                Singleton <ObjManager> .Instance.MainPlayer.AutoPercent((int)MedicSubClass.HP);
            }
        }
    }
Ejemplo n.º 5
0
    //显示套装属性
    public void ShowEquipSetAttr(GameItem item)
    {
        ClearInfo();
        int setId = item.GetEquipSetId();

        if (setId >= 0)
        {
            Tab_EquipSet line = TableManager.GetEquipSetByID(setId, 0);
            if (line != null)
            {
                for (int index = 0; index < 8; index++)
                {
                    m_Attr[index].text = "[626262]";
                }
                GameItemContainer equipPack = GameManager.gameManager.PlayerDataPool.EquipPack;

                //显示套装名称
                int labelIndex = 0;
                m_Attr[labelIndex].text = "[FF9933]" + line.Name;
                m_AttrWhole[labelIndex].SetActive(true);
                labelIndex++;

                for (int index = 0; index < line.getEquipIdCount(); index++)
                {
                    int equipid = line.GetEquipIdbyIndex(index);
                    if (equipid != -1)
                    {
                        Tab_CommonItem lineCommonitem = TableManager.GetCommonItemByID(equipid, 0);
                        if (lineCommonitem != null)
                        {
                            int relatedId = ItemTool.GetEquipIdByTransferSetId(equipid);
                            if (equipPack.GetItemCountByDataId(equipid) > 0 ||
                                equipPack.GetItemCountByDataId(relatedId) > 0)
                            {
                                m_Attr[labelIndex].text += "[FF9933]";
                            }
                            else
                            {
                                m_Attr[labelIndex].text += "[626262]";
                            }
                            m_Attr[labelIndex].text += lineCommonitem.Name;
                            m_AttrWhole[labelIndex].SetActive(true);
                            labelIndex++;
                        }
                    }
                }

                //m_Attr[labelIndex].text = "[FF9933]套装属性:";
                m_Attr[labelIndex].text = StrDictionary.GetClientDictionaryString("#{2878}");
                m_AttrWhole[labelIndex].SetActive(true);
                labelIndex++;

                int    equipCount = equipPack.GetEquipCountBySetId(setId);
                string color      = "[626262]";
                //显示两件套效果
                if (line.GetEffectTypebyIndex(0) != -1)
                {
                    if (equipCount >= 2)
                    {
                        color += "[FF9933]";
                    }
                    m_Attr[labelIndex].text += color;
                    m_Attr[labelIndex].text += StrDictionary.GetClientDictionaryString("#{1448}");
                    m_AttrWhole[labelIndex].SetActive(true);
                    labelIndex++;
                    string text = string.Format("{0}+{1}", ItemTool.ConvertAttrToString((COMBATATTE)line.GetEffectTypebyIndex(0)), line.GetEffectValuebyIndex(0));
                    m_Attr[labelIndex].text += color;
                    m_Attr[labelIndex].text += "    " + text;
                    m_AttrWhole[labelIndex].SetActive(true);
                    labelIndex++;
                }
                color = "[626262]";
                //显示三件套效果
                if (line.GetEffectTypebyIndex(1) != -1)
                {
                    if (equipCount >= 3)
                    {
                        color += "[FF9933]";
                    }
                    m_Attr[labelIndex].text += color;
                    m_Attr[labelIndex].text += StrDictionary.GetClientDictionaryString("#{1449}");
                    m_AttrWhole[labelIndex].SetActive(true);
                    labelIndex++;
                    string text = string.Format("{0}+{1}", ItemTool.ConvertAttrToString((COMBATATTE)line.GetEffectTypebyIndex(1)), line.GetEffectValuebyIndex(1));
                    m_Attr[labelIndex].text += color;
                    m_Attr[labelIndex].text += "    " + text;
                    m_AttrWhole[labelIndex].SetActive(true);
                    labelIndex++;
                }
                color = "[626262]";
                //显示四件套效果
                if (line.GetEffectTypebyIndex(2) != -1)
                {
                    if (equipCount >= 4)
                    {
                        color += "[FF9933]";
                    }
                    m_Attr[labelIndex].text += color;
                    m_Attr[labelIndex].text += StrDictionary.GetClientDictionaryString("#{1450}");
                    m_AttrWhole[labelIndex].SetActive(true);
                    labelIndex++;
                    string text = string.Format("{0}+{1}", ItemTool.ConvertAttrToString((COMBATATTE)line.GetEffectTypebyIndex(2)), line.GetEffectValuebyIndex(2));
                    m_Attr[labelIndex].text += color;
                    m_Attr[labelIndex].text += "    " + text;
                    m_AttrWhole[labelIndex].SetActive(true);
                    labelIndex++;
                }
                //m_Grid.Reposition();
                // m_TopGrid.Recenter(true);
                m_Table.sorted          = true;
                m_Table.hideInactive    = true;
                m_Table.keepWithinPanel = true;
                m_Table.repositionNow   = true;
            }
        }
    }
Ejemplo n.º 6
0
    public void UpdateDrug()
    {
        m_AutoFightInfoHpIndex.spriteName = "";
        m_AutoFightInfoMpIndex.spriteName = "";
        m_NilAutoFightInfoHp.gameObject.SetActive(false);
        m_NilAutoFightInfoMp.gameObject.SetActive(false);
        m_AutoFightInfoEquipIndex.spriteName = "";
        m_NilAutoFightInfoEquip.gameObject.SetActive(false);
        GameItemContainer BackPack = GameManager.gameManager.PlayerDataPool.BackPack;
        Obj_MainPlayer    User     = Singleton <ObjManager> .Instance.MainPlayer;

        if (User)   //更新信息
        {
            if (User.AutoHpID != -1)
            {
                Tab_CommonItem curItem = TableManager.GetCommonItemByID(User.AutoHpID, 0);
                if (curItem != null)
                {
                    m_AutoFightInfoHpIndex.spriteName = curItem.Icon;
                    if (BackPack.GetItemCountByDataId(User.AutoHpID) <= 0)
                    {
                        m_NilAutoFightInfoHp.gameObject.SetActive(true);
                    }
                }
            }
            if (User.AutoMpID != -1)
            {
                Tab_CommonItem curItem = TableManager.GetCommonItemByID(User.AutoMpID, 0);
                if (curItem != null)
                {
                    m_AutoFightInfoMpIndex.spriteName = curItem.Icon;
                    if (BackPack.GetItemCountByDataId(User.AutoMpID) <= 0)
                    {
                        m_NilAutoFightInfoMp.gameObject.SetActive(true);
                    }
                }
            }
            m_AutoFightInfoEquipIndex.transform.parent.FindChild("Label").GetComponent <UILabel>().text = "";
            if (User.AutoEquipGuid != GlobeVar.INVALID_GUID)
            {
                GameItemContainer EquipPack  =  GameManager.gameManager.PlayerDataPool.EquipPack;
                if (EquipPack != null)
                {
                    for (int index = 0; index < EquipPack.ContainerSize; index++)
                    {
                        GameItem equip = EquipPack.GetItem(index);
                        if (equip != null && equip.IsValid() && equip.Guid == User.AutoEquipGuid)
                        {
                            Tab_CommonItem curItem = TableManager.GetCommonItemByID(equip.DataID, 0);
                            if (null != curItem)
                            {
                                m_AutoFightInfoEquipIndex.spriteName = curItem.Icon;
                                //m_NilAutoFightInfoEquip.gameObject.SetActive(true);
                                m_AutoFightInfoEquipQuality.spriteName = equip.GetQualityFrame();
                                m_AutoFightInfoEquipIndex.transform.parent.GetComponent <UISprite>().spriteName             = equip.GetQualityFrame();
                                m_AutoFightInfoEquipIndex.transform.parent.FindChild("Label").GetComponent <UILabel>().text = "+" + equip.EnchanceLevel.ToString();
                            }
                        }
                    }
                }
            }
        }
        if (PlayerFrameLogic.Instance())
        {
            PlayerFrameLogic.Instance().InitAutoFight();
        }
    }
Ejemplo n.º 7
0
    //======================================================
    private void CreateItem(int curType)
    {
        Utils.CleanGrid(m_ItemGrid);
        GameItemContainer BackPack = GameManager.gameManager.PlayerDataPool.BackPack;

        if (Singleton <ObjManager> .Instance.MainPlayer)
        {
            if (curType == 1)
            {
                for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_HP; i <= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_HP; i++)
                {
                    if (BackPack.GetItemCountByDataId(i) <= 0 &&
                        Singleton <ObjManager> .Instance.MainPlayer.AutoHpID != i &&
                        Singleton <ObjManager> .Instance.MainPlayer.AutoMpID != i)
                    {
                        continue;
                    }
                    Tab_CommonItem curItem = TableManager.GetCommonItemByID(i, 0);
                    if (null != curItem)
                    {
                        AutoitemLogicEx.CreateItem(m_ItemGrid, m_ResItem, curType, curItem);
                    }
                }
                for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_DYHP; i <= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_DYHP; i++)
                {
                    if (BackPack.GetItemCountByDataId(i) <= 0 &&
                        Singleton <ObjManager> .Instance.MainPlayer.AutoHpID != i &&
                        Singleton <ObjManager> .Instance.MainPlayer.AutoMpID != i)
                    {
                        continue;
                    }
                    Tab_CommonItem curItem = TableManager.GetCommonItemByID(i, 0);
                    if (null != curItem)
                    {
                        AutoitemLogicEx.CreateItem(m_ItemGrid, m_ResItem, curType, curItem);
                    }
                }
            }
            else if (curType == 2)
            {
                for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_MP; i <= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_MP; i++)
                {
                    if (BackPack.GetItemCountByDataId(i) <= 0 &&
                        Singleton <ObjManager> .Instance.MainPlayer.AutoHpID != i &&
                        Singleton <ObjManager> .Instance.MainPlayer.AutoMpID != i)
                    {
                        continue;
                    }
                    Tab_CommonItem curItem = TableManager.GetCommonItemByID(i, 0);
                    if (null != curItem)
                    {
                        AutoitemLogicEx.CreateItem(m_ItemGrid, m_ResItem, curType, curItem);
                    }
                }
                for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_DYMP; i <= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_DYMP; i++)
                {
                    if (BackPack.GetItemCountByDataId(i) <= 0 &&
                        Singleton <ObjManager> .Instance.MainPlayer.AutoHpID != i &&
                        Singleton <ObjManager> .Instance.MainPlayer.AutoMpID != i)
                    {
                        continue;
                    }
                    Tab_CommonItem curItem = TableManager.GetCommonItemByID(i, 0);
                    if (null != curItem)
                    {
                        AutoitemLogicEx.CreateItem(m_ItemGrid, m_ResItem, curType, curItem);
                    }
                }
            }
            else if (curType == 3)
            {
                GameItemContainer EquipPack = GameManager.gameManager.PlayerDataPool.EquipPack;
                if (EquipPack != null)
                {
                    for (int index = 0; index < EquipPack.ContainerSize; index++)
                    {
                        GameItem equip = EquipPack.GetItem(index);
                        if (equip != null && equip.IsValid() && equip.IsBelt() == false)
                        {
                            AutoitemLogicEx.CreateEquip(m_ItemGrid, m_ResItem, curType, equip);
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 8
0
        public void UpdateSelectDrug()
        {
            GameItemContainer BackPack = GameManager.gameManager.PlayerDataPool.BackPack;
            GameItem          eItem    = BackPack.GetItemByGuid(HpDrugGUID);
            //if (AutoIsSelectDrug == false) 永远可以自动选择药
            {
                //做自动选药处理
                bool isFind = false;
                if (eItem == null || (eItem != null && eItem.IsValid() == false) || AutoIsSelectDrug == false)
                {
                    //优先选择选择过的药品类型
                    if (AutoIsSelectDrug == true)
                    {
                        if (AutoIsSelectDrug == true)
                        {
                            if (BackPack.GetItemCountByDataId(AutoHpID) > 0)
                            {
                                HpDrugGUID = BackPack.GetItemGuidByDataID(AutoHpID);
                                isFind     = true;
                            }
                        }
                    }
                    if (!isFind)
                    {
                        for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_DYHP; i >= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_DYHP; --i)
                        {
                            Tab_CommonItem commonItem = TableManager.GetCommonItemByID(i, 0);
                            if (commonItem != null)
                            {
                                if (BaseAttr.Level >= commonItem.MinLevelRequire)
                                {
                                    for (int index = 0; index < BackPack.ContainerSize; ++index)
                                    {
                                        GameItem eItemEx = BackPack.GetItem(index);
                                        if (eItemEx != null && eItemEx.DataID == i) //身上有这个药
                                        {
                                            AutoHpID   = i;
                                            HpDrugGUID = BackPack.GetItemGuidByDataID(AutoHpID);
                                            isFind     = true;
                                            break;
                                        }
                                    }
                                    if (isFind)
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    if (!isFind)
                    {
                        for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_HP; i >= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_HP; --i)
                        {
                            Tab_CommonItem commonItem = TableManager.GetCommonItemByID(i, 0);
                            if (commonItem != null)
                            {
                                if (BaseAttr.Level >= commonItem.MinLevelRequire)
                                {
                                    for (int index = 0; index < BackPack.ContainerSize; ++index)
                                    {
                                        GameItem eItemEx = BackPack.GetItem(index);
                                        if (eItemEx != null && eItemEx.DataID == i) //身上有这个药
                                        {
                                            AutoHpID   = i;
                                            HpDrugGUID = BackPack.GetItemGuidByDataID(AutoHpID);
                                            isFind     = true;
                                            break;
                                        }
                                    }
                                    if (isFind)
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
                eItem = BackPack.GetItemByGuid(MpDrugGUID);
                if (eItem == null || (eItem != null && eItem.IsValid() == false) || AutoIsSelectDrug == false)
                {
                    isFind = false;
                    //优先选择选择过的药品类型
                    if (AutoIsSelectDrug == true)
                    {
                        if (BackPack.GetItemCountByDataId(AutoMpID) > 0)
                        {
                            MpDrugGUID = BackPack.GetItemGuidByDataID(AutoMpID);
                            isFind     = true;
                        }
                    }

                    if (!isFind)
                    {
                        for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_DYMP; i >= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_DYMP; --i)
                        {
                            Tab_CommonItem commonItem = TableManager.GetCommonItemByID(i, 0);
                            if (commonItem != null)
                            {
                                if (BaseAttr.Level >= commonItem.MinLevelRequire)
                                {
                                    for (int index = 0; index < BackPack.ContainerSize; ++index)
                                    {
                                        GameItem eItemEx = BackPack.GetItem(index);
                                        if (eItemEx != null && eItemEx.DataID == i) //身上有这个药
                                        {
                                            AutoMpID   = i;
                                            MpDrugGUID = BackPack.GetItemGuidByDataID(AutoMpID);
                                            isFind     = true;
                                            break;
                                        }
                                    }
                                    if (isFind)
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    if (!isFind)
                    {
                        for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_MP; i >= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_MP; --i)
                        {
                            Tab_CommonItem commonItem = TableManager.GetCommonItemByID(i, 0);
                            if (commonItem != null)
                            {
                                if (BaseAttr.Level >= commonItem.MinLevelRequire)
                                {
                                    for (int index = 0; index < BackPack.ContainerSize; ++index)
                                    {
                                        GameItem eItemEx = BackPack.GetItem(index);
                                        if (eItemEx != null && eItemEx.DataID == i) //身上有这个药
                                        {
                                            AutoMpID   = i;
                                            MpDrugGUID = BackPack.GetItemGuidByDataID(AutoMpID);
                                            isFind     = true;
                                            break;
                                        }
                                    }
                                    if (isFind)
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 9
0
    void OnLoadDrugItem(GameObject resItem, object param)
    {
        if (null == resItem)
        {
            LogModule.ErrorLog("OnLoadDrugItem resItem is null");
            return;
        }

        GameItemContainer BackPack = GameManager.gameManager.PlayerDataPool.BackPack;

        if (Singleton <ObjManager> .Instance.MainPlayer)
        {
            if (m_curType == 1)
            {
                for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_HP; i <= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_HP; i++)
                {
                    if (BackPack.GetItemCountByDataId(i) <= 0 &&
                        Singleton <ObjManager> .Instance.MainPlayer.AutoHpID != i &&
                        Singleton <ObjManager> .Instance.MainPlayer.AutoMpID != i)
                    {
                        continue;
                    }
                    Tab_CommonItem curItem = TableManager.GetCommonItemByID(i, 0);
                    if (null != curItem)
                    {
                        AutoDrugItem.CreateItem(ItemParent, resItem, this, curItem);
                    }
                }
                for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_DYHP; i <= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_DYHP; i++)
                {
                    if (BackPack.GetItemCountByDataId(i) <= 0 &&
                        Singleton <ObjManager> .Instance.MainPlayer.AutoHpID != i &&
                        Singleton <ObjManager> .Instance.MainPlayer.AutoMpID != i)
                    {
                        continue;
                    }
                    Tab_CommonItem curItem = TableManager.GetCommonItemByID(i, 0);
                    if (null != curItem)
                    {
                        AutoDrugItem.CreateItem(ItemParent, resItem, this, curItem);
                    }
                }
            }
            else if (m_curType == 2)
            {
                for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_MP; i <= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_MP; i++)
                {
                    if (BackPack.GetItemCountByDataId(i) <= 0 &&
                        Singleton <ObjManager> .Instance.MainPlayer.AutoHpID != i &&
                        Singleton <ObjManager> .Instance.MainPlayer.AutoMpID != i)
                    {
                        continue;
                    }
                    Tab_CommonItem curItem = TableManager.GetCommonItemByID(i, 0);
                    if (null != curItem)
                    {
                        AutoDrugItem.CreateItem(ItemParent, resItem, this, curItem);
                    }
                }
                for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_DYMP; i <= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_DYMP; i++)
                {
                    if (BackPack.GetItemCountByDataId(i) <= 0 &&
                        Singleton <ObjManager> .Instance.MainPlayer.AutoHpID != i &&
                        Singleton <ObjManager> .Instance.MainPlayer.AutoMpID != i)
                    {
                        continue;
                    }
                    Tab_CommonItem curItem = TableManager.GetCommonItemByID(i, 0);
                    if (null != curItem)
                    {
                        AutoDrugItem.CreateItem(ItemParent, resItem, this, curItem);
                    }
                }
            }
            else if (m_curType == 3)
            {
                GameItemContainer EquipPack  =  GameManager.gameManager.PlayerDataPool.EquipPack;
                if (EquipPack != null)
                {
                    for (int index = 0; index < EquipPack.ContainerSize; index++)
                    {
                        GameItem equip = EquipPack.GetItem(index);
                        if (equip != null && equip.IsValid() && equip.IsBelt() == false)
                        {
                            AutoDrugItem.CreateEquip(ItemParent, resItem, this, equip);
                        }
                    }
                }
            }
        }

//         foreach (List<Tab_CommonItem> curList in TableManager.GetCommonItem().Values)
//         {
//             Tab_CommonItem curItem = curList[0];
//             if (null != curItem)
//             {
//                 if (curItem.ClassID == (int)ItemClass.MEDIC)
//                 {
//                     if ((m_curType == 1 && curItem.SubClassID == (int)MedicSubClass.HP)
//                         || (m_curType == 2 && curItem.SubClassID == (int)MedicSubClass.MP))
//                     {
//
//                         bool IsShow = false;
//                         int ShopId = 3;
//                         Tab_SystemShop curShop = TableManager.GetSystemShopByID(ShopId.ToString(), 0);
//                         if (curShop != null)
//                         {
//                             for (int i = 0; i < curShop.Pnum; i++)
//                             {
//                                 if (curItem.Id == curShop.GetPidbyIndex(i))
//                                 {
//                                     IsShow = true;
//                                     break;
//                                 }
//
//                             }
//                             if (IsShow)
//                             {
//                                 AutoDrugItem.CreateItem(ItemParent,resItem, curItem.Id, curItem.Icon, curItem.Name, this);
//                             }
//                         }
//
//                     }
//                 }
//
//             }
//         }
        ItemParent.GetComponent <UIGrid>().Reposition();
        ItemParent.GetComponent <UITopGrid>().Recenter(true);
    }
Ejemplo n.º 10
0
    private void CalcalateHPMPPlusState()
    {
        GameItemContainer BackPack = GameManager.gameManager.PlayerDataPool.BackPack;
        Obj_MainPlayer    mainobj  = Singleton <ObjManager> .Instance.MainPlayer;

        if (BackPack != null && mainobj != null && mainobj.BaseAttr != null)
        {
            bool hpactive = false;
            for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_HP; i <= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_HP; i++)
            {
                if (BackPack.GetItemCountByDataId(i) > 0)
                {
                    Tab_CommonItem curItem = TableManager.GetCommonItemByID(i, 0);
                    if (null != curItem && curItem.MinLevelRequire <= mainobj.BaseAttr.Level && curItem.MaxLevelRequire >= mainobj.BaseAttr.Level)
                    {
                        hpactive = true;
                        break;
                    }
                }
            }
            if (!hpactive)
            {
                for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_DYHP; i <= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_DYHP; i++)
                {
                    if (BackPack.GetItemCountByDataId(i) > 0)
                    {
                        Tab_CommonItem curItem = TableManager.GetCommonItemByID(i, 0);
                        if (null != curItem && curItem.MinLevelRequire <= mainobj.BaseAttr.Level && curItem.MaxLevelRequire >= mainobj.BaseAttr.Level)
                        {
                            hpactive = true;
                            break;
                        }
                    }
                }
            }
            if (m_HpPSPlusGO != null)
            {
                m_HpPSPlusGO.SetActive(hpactive);
            }
            bool mpactive = false;
            for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_MP; i <= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_MP; i++)
            {
                if (BackPack.GetItemCountByDataId(i) > 0)
                {
                    Tab_CommonItem curItem = TableManager.GetCommonItemByID(i, 0);
                    if (null != curItem && curItem.MinLevelRequire <= mainobj.BaseAttr.Level && curItem.MaxLevelRequire >= mainobj.BaseAttr.Level)
                    {
                        mpactive = true;
                        break;
                    }
                }
            }
            if (!mpactive)
            {
                for (int i = (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_START_DYMP; i <= (int)Games.GlobeDefine.GameDefine_Globe.AUTOCOMBAT_DRUG_ID.AUTO_DRUG_END_DYMP; i++)
                {
                    if (BackPack.GetItemCountByDataId(i) > 0)
                    {
                        Tab_CommonItem curItem = TableManager.GetCommonItemByID(i, 0);
                        if (null != curItem && curItem.MinLevelRequire <= mainobj.BaseAttr.Level && curItem.MaxLevelRequire >= mainobj.BaseAttr.Level)
                        {
                            mpactive = true;
                            break;
                        }
                    }
                }
            }
            if (m_MpPSPlusGO != null)
            {
                m_MpPSPlusGO.SetActive(mpactive);
            }
        }
    }