예제 #1
0
        public bool CheckAnyWearSymbol(out int posId, out uint symbolId)
        {
            posId    = 0;
            symbolId = 0;
            CUseableContainer useableContainer = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GetUseableContainer(enCONTAINER_TYPE.ITEM);

            int         curUseableCount = useableContainer.GetCurUseableCount();
            CSymbolItem item            = null;
            CSymbolItem item2           = null;
            int         pos             = 0;

            for (int i = 0; i < curUseableCount; i++)
            {
                CUseable useableByIndex = useableContainer.GetUseableByIndex(i);
                if (useableByIndex.m_type == COM_ITEM_TYPE.COM_OBJTYPE_ITEMSYMBOL)
                {
                    item = (CSymbolItem)useableByIndex;
                    if ((((item != null) && (item.m_stackCount > item.GetPageWearCnt(0))) && ((item.GetPageWearCnt(0) < CSymbolSystem.s_maxSameIDSymbolEquipNum) && this.GetWearPos(item, 0, out pos))) && (((item2 == null) || (item.m_SymbolData.bColor < item2.m_SymbolData.bColor)) || ((item.m_SymbolData.bColor == item2.m_SymbolData.bColor) && (item.m_SymbolData.wLevel < item2.m_SymbolData.wLevel))))
                    {
                        item2    = item;
                        posId    = pos;
                        symbolId = item.m_baseID;
                    }
                }
            }
            return(item2 != null);
        }
예제 #2
0
        public int GetSymbolPageMaxLvl(int pageIndex)
        {
            if ((pageIndex < 0) || (pageIndex >= this.m_pageCount))
            {
                return(0);
            }
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                DebugHelper.Assert(false, "role is null");
                return(0);
            }
            int num = 0;
            CUseableContainer useableContainer = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM);
            ulong             objID            = 0L;

            for (int i = 0; i < 30; i++)
            {
                if (this.m_symbolPageArr[pageIndex][i] > 0L)
                {
                    objID = this.m_symbolPageArr[pageIndex][i];
                    CUseable useableByObjID = useableContainer.GetUseableByObjID(objID);
                    if (useableByObjID != null)
                    {
                        CSymbolItem item = (CSymbolItem)useableByObjID;
                        if (item != null)
                        {
                            num += item.m_SymbolData.wLevel;
                        }
                    }
                }
            }
            return(num);
        }
예제 #3
0
        private void ShowRewardForm(CUIEvent uiEvent)
        {
            Singleton <CUIManager> .GetInstance().CloseForm(PATH_STAR);

            if (this.m_SettleData != null)
            {
                if (this.m_SettleData.stReward != null)
                {
                    COMDT_REWARD_DETAIL          stReward = this.m_SettleData.stReward;
                    ListView <COMDT_REWARD_INFO> view     = new ListView <COMDT_REWARD_INFO>();
                    for (int i = 0; i < stReward.bNum; i++)
                    {
                        COMDT_REWARD_INFO comdt_reward_info = stReward.astRewardDetail[i];
                        if (comdt_reward_info.bType == 6)
                        {
                            view.Add(comdt_reward_info);
                        }
                    }
                    if ((view.Count > 0) && (view[0].bType == 6))
                    {
                        CSymbolItem       useable   = (CSymbolItem)CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_ITEMSYMBOL, 0L, view[0].stRewardInfo.stSymbol.dwSymbolID, (int)view[0].stRewardInfo.stSymbol.dwCnt, 0);
                        CUseableContainer container = new CUseableContainer(enCONTAINER_TYPE.ITEM);
                        container.Add(useable);
                        CUICommonSystem.ShowSymbol(container, enUIEventID.Settle_ClickItemDetailEnd);
                        MonoSingleton <NewbieGuideManager> .GetInstance().CheckTriggerTime(NewbieGuideTriggerTimeType.getSymbolReward, new uint[0]);

                        return;
                    }
                }
                this.ShowPveExp();
            }
        }
예제 #4
0
        public bool GetWearPos(CSymbolItem item, int page, out int pos, out enFindSymbolWearPosCode findCode)
        {
            pos      = 0;
            findCode = enFindSymbolWearPosCode.FindNone;
            if ((item == null) || (item.m_SymbolData.wLevel > this.m_pageMaxLvlLimit))
            {
                findCode = enFindSymbolWearPosCode.FindSymbolLevelLimit;
                return(false);
            }
            ulong[]   numArray       = this.m_symbolPageArr[page];
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            int  length = numArray.Length;
            bool flag   = true;

            for (int i = 0; i < length; i++)
            {
                ResSymbolPos symbolPos = GetSymbolPos(i);
                if ((symbolPos.dwSymbolColor & (((int)1) << item.m_SymbolData.bColor)) != 0)
                {
                    flag = flag && (numArray[i] != 0L);
                }
                if (((numArray[i] == 0) && ((masterRoleInfo.PvpLevel >= symbolPos.wOpenLevel) || (this.GridBuyInfo[i].bBuyFlag == 1))) && ((symbolPos.dwSymbolColor & (((int)1) << item.m_SymbolData.bColor)) != 0))
                {
                    pos      = i;
                    findCode = enFindSymbolWearPosCode.FindSuccess;
                    return(true);
                }
            }
            findCode = !flag ? enFindSymbolWearPosCode.FindSymbolNotOpen : enFindSymbolWearPosCode.FindSymbolPosFull;
            return(false);
        }
예제 #5
0
        public bool GetWearPos(CSymbolItem item, int page, out int pos, out enFindSymbolWearPosCode findCode)
        {
            pos      = 0;
            findCode = -1;
            if (item == null || (int)item.m_SymbolData.wLevel > this.m_pageMaxLvlLimit)
            {
                findCode = 3;
                return(false);
            }
            ulong[]   array          = this.m_symbolPageArr[page];
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            int  num  = array.Length;
            bool flag = true;

            for (int i = 0; i < num; i++)
            {
                ResSymbolPos symbolPos = CSymbolInfo.GetSymbolPos(i);
                if (((ulong)symbolPos.dwSymbolColor & (ulong)(1L << (int)(item.m_SymbolData.bColor & 31))) != 0uL)
                {
                    flag = (flag && array[i] != 0uL);
                }
                if (array[i] == 0uL && (masterRoleInfo.PvpLevel >= (uint)symbolPos.wOpenLevel || this.GridBuyInfo[i].bBuyFlag == 1) && ((ulong)symbolPos.dwSymbolColor & (ulong)(1L << (int)(item.m_SymbolData.bColor & 31))) != 0uL)
                {
                    pos      = i;
                    findCode = 0;
                    return(true);
                }
            }
            findCode = ((!flag) ? 2 : 1);
            return(false);
        }
예제 #6
0
        private void OnBreakSymbolClick(CUIEvent uiEvent)
        {
            if (this.m_curTransformSymbol != null)
            {
                CSymbolItem symbolByCfgID = this.GetSymbolByCfgID(this.m_curTransformSymbol.dwID);
                if (symbolByCfgID == null)
                {
                    Singleton <CUIManager> .GetInstance().OpenTips("Symbol__Item_Not_Exist_Tip", true, 1.5f, null, new object[0]);
                }
                else if (symbolByCfgID.m_stackCount > symbolByCfgID.GetMaxWearCnt())
                {
                    string text = Singleton <CTextManager> .GetInstance().GetText("Symbol_Break_Tip");

                    Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(text, enUIEventID.SymbolMake_OnItemBreakConfirm, enUIEventID.None, false);
                }
                else
                {
                    CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                    if (masterRoleInfo != null)
                    {
                        string strContent = string.Format(Singleton <CTextManager> .GetInstance().GetText("Symbol_Break_Item_Wear_Tip"), masterRoleInfo.m_symbolInfo.GetMaxWearSymbolPageName(symbolByCfgID));
                        Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(strContent, enUIEventID.SymbolMake_OnItemBreakConfirm, enUIEventID.None, false);
                    }
                }
            }
        }
예제 #7
0
        public static CUseable CreateUseable(COM_ITEM_TYPE useableType, uint baseID, int bCount = 0)
        {
            CUseable result = null;

            if (useableType == 2)
            {
                result = new CItem(0uL, baseID, bCount, 0);
            }
            else if (useableType == 3)
            {
                result = new CEquip(0uL, baseID, bCount, 0);
            }
            else if (useableType == 4)
            {
                result = new CHeroItem(0uL, baseID, bCount, 0);
            }
            else if (useableType == 5)
            {
                result = new CSymbolItem(0uL, baseID, bCount, 0);
            }
            else if (useableType == 7)
            {
                result = new CHeroSkin(0uL, baseID, bCount, 0);
            }
            else if (useableType == 8)
            {
                result = new CHeadImg(0uL, baseID, 0);
            }
            return(result);
        }
예제 #8
0
        public static CUseable CreateUseable(COM_ITEM_TYPE useableType, uint baseID, int bCount = 0)
        {
            CUseable result = null;

            if (useableType == COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP)
            {
                result = new CItem(0uL, baseID, bCount, 0);
            }
            else if (useableType == COM_ITEM_TYPE.COM_OBJTYPE_ITEMEQUIP)
            {
                result = new CEquip(0uL, baseID, bCount, 0);
            }
            else if (useableType == COM_ITEM_TYPE.COM_OBJTYPE_HERO)
            {
                result = new CHeroItem(0uL, baseID, bCount, 0);
            }
            else if (useableType == COM_ITEM_TYPE.COM_OBJTYPE_ITEMSYMBOL)
            {
                result = new CSymbolItem(0uL, baseID, bCount, 0);
            }
            else if (useableType == COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN)
            {
                result = new CHeroSkin(0uL, baseID, bCount, 0);
            }
            else if (useableType == COM_ITEM_TYPE.COM_OBJTYPE_HEADIMG)
            {
                result = new CHeadImg(0uL, baseID, 0);
            }
            return(result);
        }
예제 #9
0
        public void SetSymbolItemWearCnt(ulong objId, int pageIndex)
        {
            if ((pageIndex >= 0) && (pageIndex < this.m_pageCount))
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                if (masterRoleInfo == null)
                {
                    DebugHelper.Assert(false, "SetSymbolItemWearCnt role is null");
                }
                else
                {
                    CUseableContainer useableContainer = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM);
                    if ((objId > 0L) && (useableContainer != null))
                    {
                        CUseable useableByObjID = useableContainer.GetUseableByObjID(objId);
                        if (useableByObjID != null)
                        {
                            CSymbolItem item = (CSymbolItem)useableByObjID;
                            if (item != null)
                            {
                                item.SetPageWearCnt(pageIndex, this.m_symbolPageArr[pageIndex]);
                            }
                        }
                    }
                }
            }
        }
예제 #10
0
        private void ShowRewardForm(CUIEvent uiEvent)
        {
            Singleton <CUIManager> .GetInstance().CloseForm(PVESettleSys.PATH_STAR);

            if (this.m_SettleData != null)
            {
                if (this.m_SettleData.stReward != null)
                {
                    COMDT_REWARD_DETAIL          stReward = this.m_SettleData.stReward;
                    ListView <COMDT_REWARD_INFO> listView = new ListView <COMDT_REWARD_INFO>();
                    for (int i = 0; i < (int)stReward.bNum; i++)
                    {
                        COMDT_REWARD_INFO cOMDT_REWARD_INFO = stReward.astRewardDetail[i];
                        byte bType = cOMDT_REWARD_INFO.bType;
                        if (bType == 6)
                        {
                            listView.Add(cOMDT_REWARD_INFO);
                        }
                    }
                    if (listView.get_Count() > 0 && listView.get_Item(0).bType == 6)
                    {
                        CSymbolItem       useable           = (CSymbolItem)CUseableManager.CreateUseable(5, 0uL, listView.get_Item(0).stRewardInfo.get_stSymbol().dwSymbolID, (int)listView.get_Item(0).stRewardInfo.get_stSymbol().dwCnt, 0);
                        CUseableContainer cUseableContainer = new CUseableContainer(enCONTAINER_TYPE.ITEM);
                        cUseableContainer.Add(useable);
                        CUICommonSystem.ShowSymbol(cUseableContainer, enUIEventID.Settle_ClickItemDetailEnd);
                        MonoSingleton <NewbieGuideManager> .GetInstance().CheckTriggerTime(NewbieGuideTriggerTimeType.getSymbolReward, new uint[0]);

                        return;
                    }
                }
                this.ShowPveExp();
            }
        }
예제 #11
0
 public bool IsSymbolPosMatchItem(int pageIndex, ResSymbolPos symbolPos, CSymbolItem symbol)
 {
     if (((pageIndex < 0) || (pageIndex >= this.m_pageCount)) || ((symbolPos == null) || (symbol == null)))
     {
         return(false);
     }
     return((CheckSymbolColor(symbolPos, symbol.m_SymbolData.bColor) && (symbol.m_stackCount > symbol.GetPageWearCnt(pageIndex))) && ((symbol.m_SymbolData.wLevel <= this.m_pageMaxLvlLimit) && (symbol.GetPageWearCnt(pageIndex) < CSymbolSystem.s_maxSameIDSymbolEquipNum)));
 }
예제 #12
0
 public static string GetSymbolAttString(CSymbolItem symbol, bool bPvp = true)
 {
     if (bPvp)
     {
         return(CUICommonSystem.GetFuncEftDesc(ref symbol.m_SymbolData.astFuncEftList, true));
     }
     return(CUICommonSystem.GetFuncEftDesc(ref symbol.m_SymbolData.astPveEftList, true));
 }
예제 #13
0
 private void OnBreakSymbolConfirm(CUIEvent uiEvent)
 {
     if (this.m_curTransformSymbol != null)
     {
         CSymbolItem symbolByCfgID = this.GetSymbolByCfgID(this.m_curTransformSymbol.dwID);
         if (symbolByCfgID != null)
         {
             this.OnSendReqSymbolBreak(symbolByCfgID.m_baseID, 1);
         }
     }
 }
예제 #14
0
 public CSymbolItem GetSymbolByObjID(ulong objID)
 {
     for (int i = 0; i < this.m_symbolList.Count; i++)
     {
         CSymbolItem item2 = this.m_symbolList[i];
         if ((item2 != null) && (item2.m_objID == objID))
         {
             return(item2);
         }
     }
     return(null);
 }
예제 #15
0
        private CSymbolItem GetSymbolByCfgID(uint cfgId)
        {
            ListView <CSymbolItem> allSymbolList = this.m_symbolSys.GetAllSymbolList();

            for (int i = 0; i < allSymbolList.Count; i++)
            {
                CSymbolItem item2 = allSymbolList[i];
                if ((item2 != null) && (item2.m_baseID == cfgId))
                {
                    return(item2);
                }
            }
            return(null);
        }
예제 #16
0
 public static void UpdateSymbolItem(CSymbolItem symbol, GameObject element, CUIFormScript form)
 {
     if (((symbol != null) && (element != null)) && (form != null))
     {
         Image component = element.transform.Find("iconImage").GetComponent <Image>();
         Text  text      = element.transform.Find("countText").GetComponent <Text>();
         Text  text2     = element.transform.Find("nameText").GetComponent <Text>();
         Text  text3     = element.transform.Find("descText").GetComponent <Text>();
         component.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, symbol.m_SymbolData.dwIcon), form, true, false, false);
         text.text  = string.Format("x{0}", symbol.m_stackCount.ToString());
         text2.text = symbol.m_SymbolData.szName;
         text3.text = CSymbolSystem.GetSymbolAttString(symbol.m_baseID, true);
     }
 }
예제 #17
0
        public CSymbolItem GetSymbolByObjID(ulong objID)
        {
            CSymbolItem result = null;

            for (int i = 0; i < this.m_symbolList.get_Count(); i++)
            {
                CSymbolItem cSymbolItem = this.m_symbolList.get_Item(i);
                if (cSymbolItem != null && cSymbolItem.m_objID == objID)
                {
                    result = cSymbolItem;
                    break;
                }
            }
            return(result);
        }
예제 #18
0
        public string GetMaxWearSymbolPageName(CSymbolItem symbol)
        {
            if (symbol == null)
            {
                return(string.Empty);
            }
            string str = "\n";

            for (int i = 0; i < symbol.m_pageWearCnt.Length; i++)
            {
                if (symbol.m_stackCount <= symbol.m_pageWearCnt[i])
                {
                    str = str + string.Format("{0}; ", this.GetSymbolPageName(i));
                }
            }
            return(str);
        }
예제 #19
0
        public void OnSymbolChange(int page, int pos, ulong objId, out uint cfgId, out CSymbolInfo.enSymbolOperationType operType)
        {
            cfgId    = 0u;
            operType = CSymbolInfo.enSymbolOperationType.Wear;
            if (page < 0 || page >= this.m_pageCount)
            {
                return;
            }
            CUseableContainer useableContainer = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GetUseableContainer(enCONTAINER_TYPE.ITEM);

            if (this.m_symbolPageArr[page][pos] > 0uL)
            {
                if (objId > 0uL)
                {
                    ulong objId2 = this.m_symbolPageArr[page][pos];
                    this.m_symbolPageArr[page][pos] = objId;
                    this.SetSymbolItemWearCnt(objId2, page);
                    operType = CSymbolInfo.enSymbolOperationType.Replace;
                }
                else
                {
                    objId = this.m_symbolPageArr[page][pos];
                    this.m_symbolPageArr[page][pos] = 0uL;
                    operType = CSymbolInfo.enSymbolOperationType.TakeOff;
                }
            }
            else
            {
                this.m_symbolPageArr[page][pos] = objId;
                operType = CSymbolInfo.enSymbolOperationType.Wear;
            }
            CUseable useableByObjID = useableContainer.GetUseableByObjID(objId);

            if (useableByObjID != null)
            {
                CSymbolItem cSymbolItem = (CSymbolItem)useableByObjID;
                if (cSymbolItem != null)
                {
                    cfgId = cSymbolItem.m_SymbolData.dwID;
                    cSymbolItem.SetPageWearCnt(page, this.m_symbolPageArr[page]);
                }
            }
        }
예제 #20
0
        public void SetSymbolData()
        {
            CUseableContainer useableContainer = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GetUseableContainer(enCONTAINER_TYPE.ITEM);

            int curUseableCount = useableContainer.GetCurUseableCount();

            this.m_symbolList.Clear();
            for (int i = 0; i < curUseableCount; i++)
            {
                CUseable useableByIndex = useableContainer.GetUseableByIndex(i);
                if (useableByIndex.m_type == 5)
                {
                    CSymbolItem cSymbolItem = (CSymbolItem)useableByIndex;
                    if (cSymbolItem != null)
                    {
                        this.m_symbolList.Add(cSymbolItem);
                    }
                }
            }
        }
예제 #21
0
        private void OnMakeSymbolClick(CUIEvent uiEvent)
        {
            if (this.m_curTransformSymbol != null)
            {
                if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().SymbolCoin >= this.m_curTransformSymbol.dwMakeCoin)
                {
                    CSymbolItem symbolByCfgID = this.GetSymbolByCfgID(this.m_curTransformSymbol.dwID);
                    if (symbolByCfgID != null)
                    {
                        if (symbolByCfgID.m_stackCount >= symbolByCfgID.m_SymbolData.iOverLimit)
                        {
                            Singleton <CUIManager> .GetInstance().OpenTips("Symbol_Make_MaxCnt_Limit", true, 1.5f, null, new object[0]);
                        }
                        else if (symbolByCfgID.m_stackCount >= CSymbolWearController.s_maxSameIDSymbolEquipNum)
                        {
                            string text = Singleton <CTextManager> .GetInstance().GetText("Symbol_Make_WearMaxLimit_Tip");

                            Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(text, enUIEventID.SymbolMake_OnItemMakeConfirm, enUIEventID.None, false);
                        }
                        else
                        {
                            this.OnSendReqSymbolMake(this.m_curTransformSymbol.dwID, 1);
                        }
                    }
                    else
                    {
                        this.OnSendReqSymbolMake(this.m_curTransformSymbol.dwID, 1);
                    }
                }
                else if (CSysDynamicBlock.bLobbyEntryBlocked)
                {
                    Singleton <CUIManager> .GetInstance().OpenTips("Symbol_DynamicBlock_Coin_Not_Enough_Tip", true, 1.5f, null, new object[0]);
                }
                else
                {
                    string strContent = Singleton <CTextManager> .GetInstance().GetText("Symbol_Coin_Not_Enough_Tip");

                    Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(strContent, enUIEventID.SymbolMake_CoinNotEnoughGotoSymbolMall, enUIEventID.None, false);
                }
            }
        }
예제 #22
0
        public bool GetWearPos(CSymbolItem item, int page, out int pos)
        {
            pos = 0;
            if ((item != null) && (item.m_SymbolData.wLevel <= this.m_pageMaxLvlLimit))
            {
                ulong[]   numArray       = this.m_symbolPageArr[page];
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                int length = numArray.Length;
                for (int i = 0; i < length; i++)
                {
                    ResSymbolPos symbolPos = GetSymbolPos(i);
                    if (((numArray[i] == 0) && (masterRoleInfo.PvpLevel >= symbolPos.wOpenLevel)) && ((symbolPos.dwSymbolColor & (((int)1) << item.m_SymbolData.bColor)) != 0))
                    {
                        pos = i;
                        return(true);
                    }
                }
            }
            return(false);
        }
예제 #23
0
        public bool CheckAnyWearSymbol(out int posId, out uint symbolId, byte colorType = 0)
        {
            posId    = 0;
            symbolId = 0u;
            CUseableContainer useableContainer = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GetUseableContainer(enCONTAINER_TYPE.ITEM);

            int         curUseableCount = useableContainer.GetCurUseableCount();
            CSymbolItem cSymbolItem     = null;
            int         num             = 0;

            for (int i = 0; i < curUseableCount; i++)
            {
                CUseable useableByIndex = useableContainer.GetUseableByIndex(i);
                if (useableByIndex.m_type == 5)
                {
                    CSymbolItem             cSymbolItem2 = (CSymbolItem)useableByIndex;
                    enFindSymbolWearPosCode enFindSymbolWearPosCode;
                    if (cSymbolItem2 != null && cSymbolItem2.m_stackCount > cSymbolItem2.GetPageWearCnt(0) && cSymbolItem2.GetPageWearCnt(0) < CSymbolWearController.s_maxSameIDSymbolEquipNum && this.GetWearPos(cSymbolItem2, 0, out num, out enFindSymbolWearPosCode))
                    {
                        if (colorType != 0)
                        {
                            if (cSymbolItem2.m_SymbolData.bColor == colorType && (cSymbolItem == null || cSymbolItem2.m_SymbolData.wLevel < cSymbolItem.m_SymbolData.wLevel))
                            {
                                cSymbolItem = cSymbolItem2;
                                posId       = num;
                                symbolId    = cSymbolItem2.m_baseID;
                            }
                        }
                        else if (cSymbolItem == null || cSymbolItem2.m_SymbolData.bColor < cSymbolItem.m_SymbolData.bColor || (cSymbolItem2.m_SymbolData.bColor == cSymbolItem.m_SymbolData.bColor && cSymbolItem2.m_SymbolData.wLevel < cSymbolItem.m_SymbolData.wLevel))
                        {
                            cSymbolItem = cSymbolItem2;
                            posId       = num;
                            symbolId    = cSymbolItem2.m_baseID;
                        }
                    }
                }
            }
            return(cSymbolItem != null);
        }
예제 #24
0
        public int GetSymbolPageEft(int pageIndex)
        {
            ulong[] pageSymbolData = this.GetPageSymbolData(pageIndex);
            if (pageSymbolData == null)
            {
                return(0);
            }
            int num = 0;
            CUseableContainer useableContainer = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GetUseableContainer(enCONTAINER_TYPE.ITEM);

            for (int i = 0; i < pageSymbolData.Length; i++)
            {
                if (pageSymbolData[i] > 0L)
                {
                    CSymbolItem useableByObjID = (CSymbolItem)useableContainer.GetUseableByObjID(pageSymbolData[i]);
                    if (useableByObjID != null)
                    {
                        num += useableByObjID.m_SymbolData.iCombatEft;
                    }
                }
            }
            return(num);
        }
예제 #25
0
        public void SetSymbolData()
        {
            CUseableContainer useableContainer = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GetUseableContainer(enCONTAINER_TYPE.ITEM);

            int      curUseableCount = useableContainer.GetCurUseableCount();
            CUseable useableByIndex  = null;

            this.m_symbolList.Clear();
            int index = 0;

            for (index = 0; index < curUseableCount; index++)
            {
                useableByIndex = useableContainer.GetUseableByIndex(index);
                if (useableByIndex.m_type == COM_ITEM_TYPE.COM_OBJTYPE_ITEMSYMBOL)
                {
                    CSymbolItem item = (CSymbolItem)useableByIndex;
                    if (item != null)
                    {
                        this.m_symbolList.Add(item);
                    }
                }
            }
        }
        public static void UpdateSymbolItem(CSymbolItem symbol, GameObject element, CUIFormScript form)
        {
            if (symbol == null)
            {
                return;
            }
            if (element == null)
            {
                return;
            }
            if (form == null)
            {
                return;
            }
            Image component  = element.transform.Find("iconImage").GetComponent <Image>();
            Text  component2 = element.transform.Find("countText").GetComponent <Text>();
            Text  component3 = element.transform.Find("nameText").GetComponent <Text>();
            Text  component4 = element.transform.Find("descText").GetComponent <Text>();

            component.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, symbol.m_SymbolData.dwIcon), form, true, false, false, false);
            component2.set_text(string.Format("x{0}", symbol.m_stackCount.ToString()));
            component3.set_text(symbol.m_SymbolData.szName);
            component4.set_text(CSymbolSystem.GetSymbolAttString(symbol.m_baseID, true));
        }
예제 #27
0
        public CSymbolBuyPickDialog(ResSymbolInfo symbolInfo, RES_SHOPBUY_COINTYPE coinType, float discount, CSymbolBuyPickDialog.OnConfirmBuyDelegate onConfirm, CSymbolBuyPickDialog.OnConfirmBuyCommonDelegate onConfirmCommon = null, CUIEvent uieventPars = null)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return;
            }
            CUseableContainer useableContainer = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM);

            this._usb = (useableContainer.GetUseableByBaseID(5, symbolInfo.dwID) as CSymbolItem);
            if (this._usb == null)
            {
                this._usb = (CUseableManager.CreateUseable(5, symbolInfo.dwID, 0) as CSymbolItem);
            }
            if (this._usb == null)
            {
                return;
            }
            CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CSymbolBuyPickDialog.s_Form_Path, false, true);

            if (null != cUIFormScript)
            {
                this._root        = cUIFormScript.gameObject;
                this._itemCell    = Utility.FindChild(this._root, "Panel/itemCell");
                this._callContext = symbolInfo;
                this._count       = 1u;
                if ((long)this._usb.m_stackCount >= 10L)
                {
                    this._maxCount = 1u;
                }
                else
                {
                    this._maxCount = (uint)(10 - this._usb.m_stackCount);
                }
                this._onConfirm        = onConfirm;
                this._onConfirmdCommon = onConfirmCommon;
                this._uieventPars      = uieventPars;
                this._coinType         = coinType;
                this._realDiscount     = discount;
                if (this._usb != null)
                {
                    this._countText = Utility.GetComponetInChild <Text>(this._root, "Panel/Count");
                    this._costText  = Utility.GetComponetInChild <Text>(this._root, "Panel/Cost");
                    CUICommonSystem.SetItemCell(cUIFormScript, this._itemCell, this._usb, true, false, false, false);
                    this._descText = Utility.GetComponetInChild <Text>(this._root, "Panel/itemCell/SymbolDesc");
                    if (this._descText != null)
                    {
                        this._descText.text = CSymbolSystem.GetSymbolAttString(symbolInfo.dwID, true);
                    }
                    this._coinUsb = CUseableManager.CreateCoinUseable(coinType, 0);
                    if (this._coinUsb != null)
                    {
                        Utility.GetComponetInChild <Image>(this._root, "Panel/Cost/CoinType").SetSprite(CUIUtility.GetSpritePrefeb(this._coinUsb.GetIconPath(), false, false), false);
                        Utility.GetComponetInChild <Text>(this._root, "Panel/Price").text = this._usb.GetBuyPrice(this._coinType).ToString();
                    }
                }
                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BuyPick_CloseForm, new CUIEventManager.OnUIEventHandler(this.OnCloseForm));

                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BuyPick_Add, new CUIEventManager.OnUIEventHandler(this.OnClickAdd));

                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BuyPick_Dec, new CUIEventManager.OnUIEventHandler(this.OnClickDec));

                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BuyPick_Max, new CUIEventManager.OnUIEventHandler(this.OnClickMax));

                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BuyPick_Confirm, new CUIEventManager.OnUIEventHandler(this.OnClickConfirm));

                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BuyPick_Cancel, new CUIEventManager.OnUIEventHandler(this.OnClickCancel));

                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BuyPick_ConfirmFactoryShopBuy, new CUIEventManager.OnUIEventHandler(this.OnConfirmFactoryShopBuy));

                this.ValidateDynamic();
            }
        }
예제 #28
0
 public bool IsSymbolPosMatchItem(int pageIndex, ResSymbolPos symbolPos, CSymbolItem symbol)
 {
     return(pageIndex >= 0 && pageIndex < this.m_pageCount && symbolPos != null && symbol != null && (CSymbolInfo.CheckSymbolColor(symbolPos, symbol.m_SymbolData.bColor) && symbol.m_stackCount > symbol.GetPageWearCnt(pageIndex) && (int)symbol.m_SymbolData.wLevel <= this.m_pageMaxLvlLimit && symbol.GetPageWearCnt(pageIndex) < CSymbolWearController.s_maxSameIDSymbolEquipNum));
 }
예제 #29
0
        public static void OnRankGodDetailTab(int tabIndex, COMDT_RANKING_LIST_ITEM_EXTRA_MASTER_HERO masterHeroInfo, uint heroId)
        {
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(RankingSystem.s_rankingGodDetailForm);

            if (form != null)
            {
                GameObject widget = form.GetWidget(0);
                if (widget != null)
                {
                    ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId);
                    if (dataByKey != null)
                    {
                        GameObject obj3   = Utility.FindChild(widget, "Panel_EquipInfo");
                        GameObject obj4   = Utility.FindChild(widget, "Panel_SymbolInfo");
                        string     str    = Utility.UTF8Convert(masterHeroInfo.stAcntInfo.szPlayerName);
                        string     szName = dataByKey.szName;
                        obj3.CustomSetActive(false);
                        obj4.CustomSetActive(false);
                        if (tabIndex == 0)
                        {
                            obj3.CustomSetActive(true);
                            CUIListScript componetInChild           = Utility.GetComponetInChild <CUIListScript>(obj3, "List");
                            int           bEquipNum                 = masterHeroInfo.stEquipList.bEquipNum;
                            ushort[]      defaultRecommendEquipInfo = new ushort[6];
                            if (bEquipNum > 0)
                            {
                                for (int j = 0; j < bEquipNum; j++)
                                {
                                    defaultRecommendEquipInfo[j] = (ushort)masterHeroInfo.stEquipList.EquipID[j];
                                }
                            }
                            else
                            {
                                defaultRecommendEquipInfo = Singleton <CEquipSystem> .instance.GetDefaultRecommendEquipInfo(heroId);

                                bEquipNum = defaultRecommendEquipInfo.Length;
                            }
                            componetInChild.SetElementAmount(bEquipNum);
                            for (int i = 0; i < bEquipNum; i++)
                            {
                                GameObject     gameObject = componetInChild.GetElemenet(i).gameObject;
                                CUIEventScript component  = gameObject.GetComponent <CUIEventScript>();
                                ushort         equipID    = defaultRecommendEquipInfo[i];
                                CEquipInfo     equipInfo  = Singleton <CEquipSystem> .instance.GetEquipInfo(equipID);

                                component.m_onClickEventParams.battleEquipPar.equipInfo = Singleton <CEquipSystem> .instance.GetEquipInfo(equipID);

                                component.m_onClickEventParams.tagStr  = str;
                                component.m_onClickEventParams.tagStr1 = szName;
                                CUICommonSystem.SetEquipIcon(equipID, gameObject, form);
                            }
                            if (bEquipNum > 0)
                            {
                                componetInChild.SelectElement(0, true);
                                componetInChild.GetElemenet(0).GetComponent <CUIEventScript>().OnPointerClick(null);
                                CUIEventScript script4 = componetInChild.GetElemenet(0).GetComponent <CUIEventScript>();
                                Singleton <CUIEventManager> .instance.DispatchUIEvent(script4.m_onClickEventID, script4.m_onClickEventParams);
                            }
                            else
                            {
                                componetInChild.SelectElement(-1, true);
                            }
                        }
                        else if (tabIndex == 1)
                        {
                            ListView <CSymbolItem> symbolList = new ListView <CSymbolItem>();
                            for (int k = 0; k < masterHeroInfo.stSymbolPageInfo.bSymbolPosNum; k++)
                            {
                                bool flag = false;
                                for (int n = 0; n < symbolList.Count; n++)
                                {
                                    if (symbolList[n].m_baseID == masterHeroInfo.stSymbolPageInfo.SymbolId[k])
                                    {
                                        CSymbolItem local1 = symbolList[n];
                                        local1.m_stackCount++;
                                        flag = true;
                                        break;
                                    }
                                }
                                if (!flag)
                                {
                                    CSymbolItem item = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_ITEMSYMBOL, masterHeroInfo.stSymbolPageInfo.SymbolId[k], 1) as CSymbolItem;
                                    symbolList.Add(item);
                                }
                            }
                            CSymbolWearController.SortSymbolList(ref symbolList);
                            obj4.CustomSetActive(true);
                            CUIListScript script5 = Utility.GetComponetInChild <CUIListScript>(obj4, "List");
                            script5.SetElementAmount(symbolList.Count);
                            int num7 = 0;
                            for (int m = 0; m < symbolList.Count; m++)
                            {
                                GameObject p = script5.GetElemenet(m).gameObject;
                                Utility.GetComponetInChild <Image>(p, "imgIcon").SetSprite(symbolList[m].GetIconPath(), form, true, false, false);
                                Utility.GetComponetInChild <Text>(p, "SymbolName").text = symbolList[m].m_name;
                                char[] trimChars = new char[] { '\n' };
                                Utility.GetComponetInChild <Text>(p, "SymbolDesc").text   = CSymbolSystem.GetSymbolAttString(symbolList[m], true).TrimEnd(trimChars);
                                Utility.GetComponetInChild <Text>(p, "lblIconCount").text = string.Format("x{0}", symbolList[m].m_stackCount);
                                num7 += symbolList[m].m_SymbolData.wLevel;
                            }
                            Utility.GetComponetInChild <Text>(obj4, "symbolPageLvlText").text = num7.ToString();
                            string[] args = new string[] { str, szName };
                            Utility.GetComponetInChild <Text>(obj4, "heroSymbolText").text = Singleton <CTextManager> .instance.GetText("RankGodHeroSymbolDesc", args);
                        }
                    }
                }
            }
        }
예제 #30
0
 public CBreakSymbolItem(CSymbolItem tempSymbol, bool btempBreak)
 {
     this.symbol       = tempSymbol;
     this.bBreak       = btempBreak;
     this.bBreakToggle = btempBreak;
 }