Пример #1
0
    void BuyStamina()
    {
        int nPlayerVIPLevel             = VipData.GetVipLv();
        Tab_StaminaBuyRule tabRightRule = null;

        foreach (KeyValuePair <int, List <Tab_StaminaBuyRule> > pair in TableManager.GetStaminaBuyRule())
        {
            Tab_StaminaBuyRule tabBuyRule = pair.Value[0];
            if (tabBuyRule == null)
            {
                continue;
            }

            if (tabBuyRule.VIPRequire <= nPlayerVIPLevel)
            {
                tabRightRule = tabBuyRule;
            }
        }

        if (tabRightRule == null)
        {
            return;
        }

        // 超出当日购买次数上限
        int nTodayBuyNum = GameManager.gameManager.PlayerDataPool.CommonData.GetCommonData((int)Games.UserCommonData.USER_COMMONDATA.CD_STAMINA_BUYNUM);

        if (nTodayBuyNum >= tabRightRule.BuyNumMax || nTodayBuyNum < 0)
        {
            Singleton <ObjManager> .Instance.MainPlayer.SendNoticMsg(false, "#{2131}");

            return;
        }

        //string strMessage = StrDictionary.GetClientDictionaryString("#{2123}", nTodayBuyNum + 1, GlobeVar.STAMINA_BUYVALUE, tabRightRule.Price);
        MessageBoxLogic.OpenCostBox(
            StrDictionary.GetClientDictionaryString("#{11006}", GlobeVar.STAMINA_BUYVALUE),
            StrDictionary.GetClientDictionaryString("#{11007}", nPlayerVIPLevel, nTodayBuyNum + 1, tabRightRule.BuyNumMax),
            StrDictionary.GetClientDictionaryString("#{11005}"),
            StrDictionary.GetClientDictionaryString("#{11008}"),
            "qian3", "X" + tabRightRule.Price.ToString(), BuyStaminaOK, BuyStaminaCancel);
        //MessageBoxLogic.OpenOKCancelBox(strMessage, "", BuyStaminaOK, BuyStaminaCancel);
    }
Пример #2
0
    public static int GetVipStamina(int nLevel)
    {
        int nFinalCount = 0;

        foreach (KeyValuePair <int, List <Tab_StaminaBuyRule> > pair in TableManager.GetStaminaBuyRule())
        {
            Tab_StaminaBuyRule tabBuyRule = pair.Value[0];
            if (tabBuyRule == null)
            {
                continue;
            }

            if (tabBuyRule.VIPRequire <= nLevel)
            {
                nFinalCount = tabBuyRule.BuyNumMax;
            }
        }
        return(nFinalCount);
    }