|
|
@@ -1,6 +1,7 @@
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using Excel2Json;
|
|
|
+using Fort23.Core;
|
|
|
using Fort23.UTool;
|
|
|
using GameLogic.Bag;
|
|
|
using UnityEngine;
|
|
|
@@ -58,7 +59,7 @@ namespace GameLogic.Player
|
|
|
AccountFileInfo.Instance.SavePlayerData();
|
|
|
}
|
|
|
|
|
|
- public List<ItemInfo> Summon(int id, int count)
|
|
|
+ public async CTask<List<ItemInfo>> Summon(int id, int count)
|
|
|
{
|
|
|
AccountFileInfo.SummonData summonData = summonDataMap[id];
|
|
|
OpenBoxConfig openBoxConfig = ConfigComponent.Instance.Get<OpenBoxConfig>(summonData.id);
|
|
|
@@ -79,19 +80,42 @@ namespace GameLogic.Player
|
|
|
else
|
|
|
{
|
|
|
//验证道具是否足够
|
|
|
- if (PlayerManager.Instance.BagController.IsEnough(openBoxConfig.CostItemID,
|
|
|
- openBoxConfig.oneConsume))
|
|
|
+ if (openBoxConfig.CostItemID == 1007)
|
|
|
{
|
|
|
- PlayerManager.Instance.BagController.DeductCoin(openBoxConfig.oneConsume);
|
|
|
- allIitem = Summon(summonData, 1);
|
|
|
+#if UNITY_ANDROID && !UNITY_EDITOR&& Taptap
|
|
|
+ if (TakuSDKManager.Instance.IsReady())
|
|
|
+ {
|
|
|
+ bool isOK = await TakuSDKManager.Instance.ShowAutoAd();
|
|
|
+ if (!isOK)
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
|
|
|
- summonData.onePayCount++;
|
|
|
- //summonData.nextOneFreeTime = PlayerManager.Instance.serverTime + openBoxConfig.oneConsumeFreePara[0] * 1000;
|
|
|
+#endif
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- return null;
|
|
|
+ //验证道具是否足够
|
|
|
+ if (PlayerManager.Instance.BagController.IsEnough(openBoxConfig.CostItemID,
|
|
|
+ openBoxConfig.oneConsume) || openBoxConfig.CostItemID == 1007)
|
|
|
+ {
|
|
|
+ PlayerManager.Instance.BagController.DeductCoin(openBoxConfig.oneConsume);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ allIitem = Summon(summonData, 1);
|
|
|
+
|
|
|
+ summonData.onePayCount++;
|
|
|
}
|
|
|
}
|
|
|
//十连抽
|
|
|
@@ -125,35 +149,56 @@ namespace GameLogic.Player
|
|
|
else
|
|
|
{
|
|
|
//验证道具是否足够
|
|
|
- if (PlayerManager.Instance.BagController.IsEnough(openBoxConfig.CostItemID,
|
|
|
- openBoxConfig.tenConsume))
|
|
|
+ if (openBoxConfig.CostItemID == 1007)
|
|
|
{
|
|
|
- PlayerManager.Instance.BagController.DeductCoin(openBoxConfig.tenConsume);
|
|
|
- allIitem = Summon(summonData, 10);
|
|
|
- if (summonData.isSummonSocre)
|
|
|
+#if UNITY_ANDROID && !UNITY_EDITOR&& Taptap
|
|
|
+ if (TakuSDKManager.Instance.IsReady())
|
|
|
{
|
|
|
- //记录抽卡道具 用于成就检测
|
|
|
- List<int> drawHistory = new List<int>();
|
|
|
- foreach (var itemInfo in allIitem)
|
|
|
+ bool isOK = await TakuSDKManager.Instance.ShowAutoAd();
|
|
|
+ if (!isOK)
|
|
|
{
|
|
|
- drawHistory.Add(itemInfo.itemID);
|
|
|
+ return null;
|
|
|
}
|
|
|
-
|
|
|
- AccountFileInfo.IntList intList = new AccountFileInfo.IntList();
|
|
|
- intList.list = drawHistory;
|
|
|
- summonData.drawHistory.Add(intList);
|
|
|
-
|
|
|
-
|
|
|
- CheckAchievements(summonData);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
- summonData.tenPayCount++;
|
|
|
- //summonData.nextTenFreeTime = PlayerManager.Instance.serverTime + openBoxConfig.oneConsumeChargePara[0] * 1000;
|
|
|
+#endif
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- return null;
|
|
|
+ if (PlayerManager.Instance.BagController.IsEnough(openBoxConfig.CostItemID,
|
|
|
+ openBoxConfig.tenConsume) || openBoxConfig.CostItemID == 1007)
|
|
|
+ {
|
|
|
+ PlayerManager.Instance.BagController.DeductCoin(openBoxConfig.tenConsume);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ allIitem = Summon(summonData, 10);
|
|
|
+ if (summonData.isSummonSocre)
|
|
|
+ {
|
|
|
+ //记录抽卡道具 用于成就检测
|
|
|
+ List<int> drawHistory = new List<int>();
|
|
|
+ foreach (var itemInfo in allIitem)
|
|
|
+ {
|
|
|
+ drawHistory.Add(itemInfo.itemID);
|
|
|
+ }
|
|
|
+
|
|
|
+ AccountFileInfo.IntList intList = new AccountFileInfo.IntList();
|
|
|
+ intList.list = drawHistory;
|
|
|
+ summonData.drawHistory.Add(intList);
|
|
|
+
|
|
|
+
|
|
|
+ CheckAchievements(summonData);
|
|
|
}
|
|
|
+
|
|
|
+ summonData.tenPayCount++;
|
|
|
}
|
|
|
}
|
|
|
|