|
@@ -23,7 +23,8 @@ namespace GameLogic.Player
|
|
|
//每次进游戏检查是否有新的抽卡
|
|
|
foreach (var openBoxConfig in openBoxConfigs)
|
|
|
{
|
|
|
- if (AccountFileInfo.Instance.playerData.SummonDatas.FirstOrDefault(s => s.id == openBoxConfig.ID) == null)
|
|
|
+ if (AccountFileInfo.Instance.playerData.SummonDatas.FirstOrDefault(s => s.id == openBoxConfig.ID) ==
|
|
|
+ null)
|
|
|
{
|
|
|
AccountFileInfo.SummonData summonData = new AccountFileInfo.SummonData();
|
|
|
summonData.id = openBoxConfig.ID;
|
|
@@ -66,17 +67,20 @@ namespace GameLogic.Player
|
|
|
if (count == 1)
|
|
|
{
|
|
|
//有免费次数,并且让到时间了就免费抽
|
|
|
- if (summonData.oneFreeCount < openBoxConfig.oneConsumeFreePara[1] && PlayerManager.Instance.serverTime >= summonData.nextOneFreeTime)
|
|
|
+ if (summonData.oneFreeCount < openBoxConfig.oneConsumeFreePara[1] &&
|
|
|
+ PlayerManager.Instance.serverTime >= summonData.nextOneFreeTime)
|
|
|
{
|
|
|
allIitem = Summon(summonData, 1);
|
|
|
|
|
|
summonData.oneFreeCount++;
|
|
|
- summonData.nextOneFreeTime = PlayerManager.Instance.serverTime + openBoxConfig.oneConsumeFreePara[0] * 1000;
|
|
|
+ summonData.nextOneFreeTime =
|
|
|
+ PlayerManager.Instance.serverTime + openBoxConfig.oneConsumeFreePara[0] * 1000;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//验证道具是否足够
|
|
|
- if (PlayerManager.Instance.BagController.IsEnough(openBoxConfig.CostItemID, openBoxConfig.oneConsume))
|
|
|
+ if (PlayerManager.Instance.BagController.IsEnough(openBoxConfig.CostItemID,
|
|
|
+ openBoxConfig.oneConsume))
|
|
|
{
|
|
|
PlayerManager.Instance.BagController.DeductCoin(openBoxConfig.oneConsume);
|
|
|
allIitem = Summon(summonData, 1);
|
|
@@ -94,7 +98,8 @@ namespace GameLogic.Player
|
|
|
else if (count == 10)
|
|
|
{
|
|
|
//有免费次数,并且让到时间了就免费抽
|
|
|
- if (summonData.tenFreeCount < openBoxConfig.oneConsumeFreePara_1[1] && PlayerManager.Instance.serverTime >= summonData.nextTenFreeTime)
|
|
|
+ if (summonData.tenFreeCount < openBoxConfig.oneConsumeFreePara_1[1] &&
|
|
|
+ PlayerManager.Instance.serverTime >= summonData.nextTenFreeTime)
|
|
|
{
|
|
|
allIitem = Summon(summonData, 10);
|
|
|
if (summonData.isSummonSocre)
|
|
@@ -106,21 +111,22 @@ namespace GameLogic.Player
|
|
|
drawHistory.Add(itemInfo.itemID);
|
|
|
}
|
|
|
|
|
|
- AccountFileInfo.IntList intList = new AccountFileInfo.IntList();
|
|
|
+ AccountFileInfo.IntList intList = new AccountFileInfo.IntList();
|
|
|
intList.list = drawHistory;
|
|
|
summonData.drawHistory.Add(intList);
|
|
|
CheckAchievements(summonData);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
|
|
|
summonData.tenFreeCount++;
|
|
|
- summonData.nextTenFreeTime = PlayerManager.Instance.serverTime + openBoxConfig.oneConsumeFreePara_1[0] * 1000;
|
|
|
+ summonData.nextTenFreeTime =
|
|
|
+ PlayerManager.Instance.serverTime + openBoxConfig.oneConsumeFreePara_1[0] * 1000;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//验证道具是否足够
|
|
|
- if (PlayerManager.Instance.BagController.IsEnough(openBoxConfig.CostItemID, openBoxConfig.tenConsume))
|
|
|
+ if (PlayerManager.Instance.BagController.IsEnough(openBoxConfig.CostItemID,
|
|
|
+ openBoxConfig.tenConsume))
|
|
|
{
|
|
|
PlayerManager.Instance.BagController.DeductCoin(openBoxConfig.tenConsume);
|
|
|
allIitem = Summon(summonData, 10);
|
|
@@ -132,7 +138,8 @@ namespace GameLogic.Player
|
|
|
{
|
|
|
drawHistory.Add(itemInfo.itemID);
|
|
|
}
|
|
|
- AccountFileInfo.IntList intList = new AccountFileInfo.IntList();
|
|
|
+
|
|
|
+ AccountFileInfo.IntList intList = new AccountFileInfo.IntList();
|
|
|
intList.list = drawHistory;
|
|
|
summonData.drawHistory.Add(intList);
|
|
|
|
|
@@ -165,10 +172,12 @@ namespace GameLogic.Player
|
|
|
DropConfig dropConfig = ConfigComponent.Instance.Get<DropConfig>(openBoxConfig.reward2);
|
|
|
for (var i = 0; i < dropConfig.dropGroupID.Length; i++)
|
|
|
{
|
|
|
- DropGroupConfig dropGroupConfig = ConfigComponent.Instance.Get<DropGroupConfig>(dropConfig.dropGroupID[i]);
|
|
|
+ DropGroupConfig dropGroupConfig =
|
|
|
+ ConfigComponent.Instance.Get<DropGroupConfig>(dropConfig.dropGroupID[i]);
|
|
|
for (var i1 = 0; i1 < dropGroupConfig.dropItemID.Length; i1++)
|
|
|
{
|
|
|
- DropItemConfig dropItemConfig = ConfigComponent.Instance.Get<DropItemConfig>(dropGroupConfig.dropItemID[i1]);
|
|
|
+ DropItemConfig dropItemConfig =
|
|
|
+ ConfigComponent.Instance.Get<DropItemConfig>(dropGroupConfig.dropItemID[i1]);
|
|
|
for (var i2 = 0; i2 < dropItemConfig.itemID.Length; i2++)
|
|
|
{
|
|
|
baodiItems.Add(dropItemConfig.itemID[i2]);
|
|
@@ -217,7 +226,8 @@ namespace GameLogic.Player
|
|
|
List<ItemInfo> addItem2;
|
|
|
if (count == 1)
|
|
|
{
|
|
|
- addItem2 = DropManager.Instance.DropItem(openBoxConfig.reward[Random.Range(0, openBoxConfig.reward.Length)]);
|
|
|
+ addItem2 = DropManager.Instance.DropItem(
|
|
|
+ openBoxConfig.reward[Random.Range(0, openBoxConfig.reward.Length)]);
|
|
|
PlayerManager.Instance.BagController.AddItem(addItem2);
|
|
|
allIitem.AddRange(addItem2);
|
|
|
summonData.baodiCount1++;
|
|
@@ -267,7 +277,9 @@ namespace GameLogic.Player
|
|
|
|
|
|
bool allDrawsSatisfy = true;
|
|
|
// 检查最近 Para0 次十连是否都满足条件
|
|
|
- for (int i = summonData.drawHistory.Count - openBoxScoreRule.para0; i < summonData.drawHistory.Count; i++)
|
|
|
+ for (int i = summonData.drawHistory.Count - openBoxScoreRule.para0;
|
|
|
+ i < summonData.drawHistory.Count;
|
|
|
+ i++)
|
|
|
{
|
|
|
if (!CheckSingleDraw(openBoxScoreRule, summonData.drawHistory[i].list))
|
|
|
{
|
|
@@ -288,7 +300,8 @@ namespace GameLogic.Player
|
|
|
OpenBoxScoreRule openBoxScoreRule = ConfigComponent.Instance.Get<OpenBoxScoreRule>(id);
|
|
|
summonData.score += openBoxScoreRule.score;
|
|
|
|
|
|
- AccountFileInfo.SummonSocreData summonSocreData = summonData.summonSocreData.FirstOrDefault(ss => ss.id == openBoxScoreRule.ID);
|
|
|
+ AccountFileInfo.SummonSocreData summonSocreData =
|
|
|
+ summonData.summonSocreData.FirstOrDefault(ss => ss.id == openBoxScoreRule.ID);
|
|
|
if (summonSocreData == null)
|
|
|
{
|
|
|
summonSocreData = new AccountFileInfo.SummonSocreData();
|
|
@@ -297,7 +310,9 @@ namespace GameLogic.Player
|
|
|
}
|
|
|
|
|
|
summonSocreData.count++;
|
|
|
- LogTool.Log($"达成成就 ID: {openBoxScoreRule.ID}, 分数: {openBoxScoreRule.score}, 描述: 连续{openBoxScoreRule.para0}次十连获得{openBoxScoreRule.para1}个品质{openBoxScoreRule.para3}的道具");
|
|
|
+ summonSocreData.currentCount++;
|
|
|
+ LogTool.Log(
|
|
|
+ $"达成成就 ID: {openBoxScoreRule.ID}, 分数: {openBoxScoreRule.score}, 描述: 连续{openBoxScoreRule.para0}次十连获得{openBoxScoreRule.para1}个品质{openBoxScoreRule.para3}的道具");
|
|
|
}
|
|
|
}
|
|
|
|