|
@@ -23,21 +23,11 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- public static int currentSelectId
|
|
|
- {
|
|
|
- get
|
|
|
- {
|
|
|
- return _currentSelectId;
|
|
|
- }
|
|
|
- set
|
|
|
- {
|
|
|
- _currentSelectId = value;
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
public static string probShow;
|
|
|
private static List<LuckyBoxBonusData> _showList;
|
|
|
- private static int _dropOutId;
|
|
|
- private static int _dropId;
|
|
|
+ // private static int _dropOutId;
|
|
|
+ // private static int _dropId;
|
|
|
|
|
|
public static int GetOwnedCount()
|
|
|
{
|
|
@@ -60,68 +50,68 @@ namespace GFGGame
|
|
|
return _showList.GetRange(0, _showList.Count);
|
|
|
}
|
|
|
|
|
|
- public static List<ItemData> GetBonusList(int count, bool isGuide = false)
|
|
|
- {
|
|
|
- List<ItemData> bonusList = null;
|
|
|
- if (isGuide)
|
|
|
- {
|
|
|
- int[][] temp = new int[5][];
|
|
|
- temp[0] = new int[] { 10332, 1 };
|
|
|
- temp[1] = new int[] { 10334, 1 };
|
|
|
- temp[2] = new int[] { 10335, 1 };
|
|
|
- temp[3] = new int[] { 10336, 1 };
|
|
|
- temp[4] = new int[] { 10338, 1 };
|
|
|
- List<ItemData> guideBonusList = ItemUtil.CreateItemDataList(temp);
|
|
|
- count = count - guideBonusList.Count;
|
|
|
- bonusList = DropOutDataCache.GetDropItemDatas(_dropOutId, count);
|
|
|
- while (guideBonusList.Count > 1)
|
|
|
- {
|
|
|
- ItemData itemData = guideBonusList[0];
|
|
|
- guideBonusList.RemoveAt(0);
|
|
|
- int index = UnityEngine.Random.Range(0, bonusList.Count);
|
|
|
- bonusList.Insert(index, itemData);
|
|
|
- }
|
|
|
- bonusList.Add(guideBonusList[0]);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- bonusList = DropOutDataCache.GetDropItemDatas(_dropOutId, count);
|
|
|
- }
|
|
|
- int dicIndex = 0;
|
|
|
- LuckyBoxDataManager.Instance.FirstRewardList.Clear();
|
|
|
- foreach (ItemData itemData in bonusList)
|
|
|
- {
|
|
|
+ // public static List<ItemData> GetBonusList(int count, bool isGuide = false)
|
|
|
+ // {
|
|
|
+ // List<ItemData> bonusList = null;
|
|
|
+ // if (isGuide)
|
|
|
+ // {
|
|
|
+ // int[][] temp = new int[5][];
|
|
|
+ // temp[0] = new int[] { 10332, 1 };
|
|
|
+ // temp[1] = new int[] { 10334, 1 };
|
|
|
+ // temp[2] = new int[] { 10335, 1 };
|
|
|
+ // temp[3] = new int[] { 10336, 1 };
|
|
|
+ // temp[4] = new int[] { 10338, 1 };
|
|
|
+ // List<ItemData> guideBonusList = ItemUtil.CreateItemDataList(temp);
|
|
|
+ // count = count - guideBonusList.Count;
|
|
|
+ // bonusList = DropOutDataCache.GetDropItemDatas(_dropOutId, count);
|
|
|
+ // while (guideBonusList.Count > 1)
|
|
|
+ // {
|
|
|
+ // ItemData itemData = guideBonusList[0];
|
|
|
+ // guideBonusList.RemoveAt(0);
|
|
|
+ // int index = UnityEngine.Random.Range(0, bonusList.Count);
|
|
|
+ // bonusList.Insert(index, itemData);
|
|
|
+ // }
|
|
|
+ // bonusList.Add(guideBonusList[0]);
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // bonusList = DropOutDataCache.GetDropItemDatas(_dropOutId, count);
|
|
|
+ // }
|
|
|
+ // int dicIndex = 0;
|
|
|
+ // LuckyBoxDataManager.Instance.FirstRewardList.Clear();
|
|
|
+ // foreach (ItemData itemData in bonusList)
|
|
|
+ // {
|
|
|
|
|
|
- if (ItemDataManager.GetItemNum(itemData.id) == 0)
|
|
|
- {
|
|
|
- LuckyBoxDataManager.Instance.FirstRewardList.Add(dicIndex, itemData);
|
|
|
- }
|
|
|
- ItemDataManager.Add(itemData.id, itemData.num);
|
|
|
- dicIndex++;
|
|
|
- }
|
|
|
- ItemDataManager.Add(_dropId, count);
|
|
|
+ // if (ItemDataManager.GetItemNum(itemData.id) == 0)
|
|
|
+ // {
|
|
|
+ // LuckyBoxDataManager.Instance.FirstRewardList.Add(dicIndex, itemData);
|
|
|
+ // }
|
|
|
+ // ItemDataManager.Add(itemData.id, itemData.num);
|
|
|
+ // dicIndex++;
|
|
|
+ // }
|
|
|
+ // ItemDataManager.Add(_dropId, count);
|
|
|
|
|
|
- //100¸öÐÇм»»1¸öÂäÐÇʯ
|
|
|
- LuckyBoxCfg boxCfg0 = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.luckyBoxIds[0]);
|
|
|
- LuckyBoxCfg boxCfg1 = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.luckyBoxIds[1]);
|
|
|
- int itemCount = ItemDataManager.GetItemNum(boxCfg0.drop);
|
|
|
- if (_dropId == boxCfg0.drop && itemCount >= 100)
|
|
|
- {
|
|
|
- ItemDataManager.Add(boxCfg1.drop, itemCount / 100);
|
|
|
- ItemDataManager.Remove(_dropId, itemCount / 100 * 100);
|
|
|
- }
|
|
|
+ // //100¸öÐÇм»»1¸öÂäÐÇʯ
|
|
|
+ // LuckyBoxCfg boxCfg0 = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.luckyBoxIds[0]);
|
|
|
+ // LuckyBoxCfg boxCfg1 = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.luckyBoxIds[1]);
|
|
|
+ // int itemCount = ItemDataManager.GetItemNum(boxCfg0.drop);
|
|
|
+ // if (_dropId == boxCfg0.drop && itemCount >= 100)
|
|
|
+ // {
|
|
|
+ // ItemDataManager.Add(boxCfg1.drop, itemCount / 100);
|
|
|
+ // ItemDataManager.Remove(_dropId, itemCount / 100 * 100);
|
|
|
+ // }
|
|
|
|
|
|
- GetSuitItemController.TryShow(0);
|
|
|
- return bonusList;
|
|
|
- }
|
|
|
+ // GetSuitItemController.TryShow(0);
|
|
|
+ // return bonusList;
|
|
|
+ // }
|
|
|
|
|
|
private static void InitData(int boxId)
|
|
|
{
|
|
|
LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
|
|
|
probShow = luckyBoxCfg.probShow;
|
|
|
_showList = GetBonusDataList(luckyBoxCfg.bonusShowArr);
|
|
|
- _dropOutId = luckyBoxCfg.bonus;
|
|
|
- _dropId = luckyBoxCfg.drop;
|
|
|
+ // _dropOutId = luckyBoxCfg.bonus;
|
|
|
+ // _dropId = luckyBoxCfg.drop;
|
|
|
}
|
|
|
|
|
|
private static List<LuckyBoxBonusData> GetBonusDataList(int[] idsList)
|
|
@@ -139,35 +129,6 @@ namespace GFGGame
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
- public static void CheckItemEnough(int itemId, int count, int times, Action onSuccess)
|
|
|
- {
|
|
|
- ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
|
|
|
- int hasNum = ItemDataManager.GetItemNum(itemCfg.id);
|
|
|
- if (hasNum >= count)//????
|
|
|
- {
|
|
|
- Alert.Show(string.Format("是否花费{0}个{1}摘星{2}次?", count, itemCfg.name, times)).SetLeftButton(true).SetRightButton(true, "确定", (object data) => { onSuccess(); });
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
|
|
|
- ItemExchangeCfgArray.Instance.GetMoneyIdAndNum(itemId, ItemDataManager.GetItemExchangeTimes(itemId), count, out int costId, out int costNeedNum, out int buyNum);
|
|
|
- int costHasNum = ItemDataManager.GetItemNum(costId);
|
|
|
- if (costHasNum >= costNeedNum)
|
|
|
- {
|
|
|
- if (itemId == ConstItemID.GOLD)
|
|
|
- {
|
|
|
- ItemUtil.ExchangeItemById(itemId, count - hasNum, false, onSuccess);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- BuyTipsController.Show(itemId, count - hasNum, onSuccess);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ItemUtil.ExchangeItemById(costId, costNeedNum - costHasNum, true, null, true, GameConst.MAX_COUNT_TO_BUY_DIAMOND_RED, true);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
}
|