public static string GetCampaignText(this GameWebAPI.RespDataGA_GetGachaInfo.Detail detail)
        {
            string result = string.Empty;

            if (!detail.IsCampaignNullText())
            {
                bool flag = true;
                if (detail.isFirst == 0 && detail.isTodayFirst == 0)
                {
                    if (!detail.IsCampaignAlwaysDisplayType())
                    {
                        flag = false;
                    }
                }
                else if (detail.IsCampaignNotDisplayType())
                {
                    flag = false;
                }
                else if (detail.isFirst == 0 && detail.IsCampaignFirstDisplayType())
                {
                    flag = false;
                }
                if (flag)
                {
                    result = detail.appealText;
                }
            }
            return(result);
        }
        public static int GetOnceRemainingPlayCount(this GameWebAPI.RespDataGA_GetGachaInfo.Detail detail, int assetsNumber)
        {
            int num  = 0;
            int num2 = assetsNumber;

            if (detail.isFirst == 1)
            {
                int num3 = 0;
                if (int.TryParse(detail.priceFirst, out num3) && num3 <= num2)
                {
                    num++;
                    num2 -= num3;
                }
            }
            else if (detail.isTodayFirst == 1 && "1" == detail.dailyResetFirst)
            {
                int num4 = 0;
                if (int.TryParse(detail.priceFirst, out num4) && num4 <= num2)
                {
                    num++;
                    num2 -= num4;
                }
            }
            int num5 = 0;

            if (int.TryParse(detail.price, out num5) && 0 < num5)
            {
                num += num2 / num5;
            }
            return(num);
        }
Ejemplo n.º 3
0
        protected void UpdateUserAssetsInventory(int playCount)
        {
            GameWebAPI.RespDataGA_GetGachaInfo.Detail detail = this.gashaInfo.details.GetDetail(playCount);
            int value = 0;

            if (int.TryParse(detail.GetPrice(), out value))
            {
                UserInventory.CalculateNumber(this.gashaInfo.priceType.GetCostAssetsCategory(), this.gashaInfo.priceType.GetCostAssetsValue(), value);
            }
        }
Ejemplo n.º 4
0
    private int CalcAbleCount()
    {
        int result = 0;
        int numberExceptProtectedAssets = UserInventory.GetNumberExceptProtectedAssets(this.gashaInfo.priceType.GetCostAssetsCategory(), this.gashaInfo.priceType.GetCostAssetsValue());

        GameWebAPI.RespDataGA_GetGachaInfo.Detail detail = this.gashaInfo.details.GetDetail(1);
        if (detail != null)
        {
            result = detail.GetOnceRemainingPlayCount(numberExceptProtectedAssets);
        }
        return(result);
    }
 public void OnPushedOneButton()
 {
     GameWebAPI.RespDataGA_GetGachaInfo.Detail detail = this.gashaInfo.details.GetDetail(1);
     if (detail != null)
     {
         int price = 0;
         if (int.TryParse(detail.GetPrice(), out price))
         {
             this.CheckPayAssetsNumber(price, 1);
         }
     }
 }
Ejemplo n.º 6
0
        private int SortGashaDetail(GameWebAPI.RespDataGA_GetGachaInfo.Detail x, GameWebAPI.RespDataGA_GetGachaInfo.Detail y)
        {
            int num  = int.Parse(x.count);
            int num2 = int.Parse(y.count);

            if (num < num2)
            {
                return(-1);
            }
            if (num > num2)
            {
                return(1);
            }
            return(0);
        }
        public static GameWebAPI.RespDataGA_GetGachaInfo.Detail GetDetail(this GameWebAPI.RespDataGA_GetGachaInfo.Detail[] detailList, int playCount)
        {
            GameWebAPI.RespDataGA_GetGachaInfo.Detail detail = null;
            string b = playCount.ToString();

            for (int i = 0; i < detailList.Length; i++)
            {
                if (detailList[i].count == b)
                {
                    detail = detailList[i];
                    break;
                }
            }
            Debug.Assert(null != detail, "ガシャ実行情報の取得に失敗.");
            return(detail);
        }
        public static string GetPrice(this GameWebAPI.RespDataGA_GetGachaInfo.Detail detail)
        {
            string result;

            if (detail.isFirst == 1)
            {
                result = detail.priceFirst;
            }
            else if (detail.isTodayFirst == 1 && "1" == detail.dailyResetFirst)
            {
                result = detail.priceFirst;
            }
            else
            {
                result = detail.price;
            }
            return(result);
        }
Ejemplo n.º 9
0
 public void SetPopText(GameWebAPI.RespDataGA_GetGachaInfo.Result gashaInfo, GameWebAPI.RespDataGA_GetGachaInfo.Detail gashaDetail, bool isTutorial)
 {
     this.playCount = gashaDetail.count;
     if (!isTutorial)
     {
         string remainingPlayCountText = string.Empty;
         if (gashaInfo.ExistLimitPlayCount())
         {
             int num = 0;
             if (int.TryParse(gashaDetail.count, out num))
             {
                 remainingPlayCountText = gashaInfo.GetRemainingPlayCountText(num);
             }
         }
         this.SetPopText(remainingPlayCountText, gashaDetail.GetCampaignText());
     }
     else
     {
         this.popObject.SetActive(false);
         this.popLabel.text = string.Empty;
     }
 }
 public static bool IsCampaignNullText(this GameWebAPI.RespDataGA_GetGachaInfo.Detail detail)
 {
     return(string.IsNullOrEmpty(detail.appealText) || "null" == detail.appealText);
 }
 public static bool IsCampaignDailyFirstDisplayType(this GameWebAPI.RespDataGA_GetGachaInfo.Detail detail)
 {
     return("3" == detail.appealTextDisplayType);
 }