forked from Oshima-Studios/OshimaGameModule
修改bug
This commit is contained in:
parent
0c85db384d
commit
3c1cb897af
@ -1680,36 +1680,39 @@ namespace Oshima.Core.Controllers
|
|||||||
|
|
||||||
int originalBreak = character.LevelBreak;
|
int originalBreak = character.LevelBreak;
|
||||||
|
|
||||||
if (FunGameService.LevelBreakNeedyList.TryGetValue(originalBreak, out Dictionary<string, int>? needy) && needy != null && needy.Count > 0)
|
if (FunGameService.LevelBreakNeedyList.TryGetValue(originalBreak + 1, out Dictionary<string, int>? needy) && needy != null && needy.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (string key in needy.Keys)
|
foreach (string key in needy.Keys)
|
||||||
{
|
{
|
||||||
int needCount = needy[key];
|
int needCount = needy[key];
|
||||||
if (key == General.GameplayEquilibriumConstant.InGameMaterial)
|
if (key == General.GameplayEquilibriumConstant.InGameMaterial)
|
||||||
{
|
{
|
||||||
if (user.Inventory.Credits >= needCount)
|
if (user.Inventory.Materials >= needCount)
|
||||||
{
|
{
|
||||||
user.Inventory.Credits -= needCount;
|
user.Inventory.Materials -= needCount;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return NetworkUtility.JsonSerialize($"你的{General.GameplayEquilibriumConstant.InGameCurrency}不足 {needCount} 呢,不满足突破条件!");
|
return NetworkUtility.JsonSerialize($"你的{General.GameplayEquilibriumConstant.InGameMaterial}不足 {needCount} 呢,不满足突破条件!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (needCount > 0)
|
else
|
||||||
{
|
{
|
||||||
IEnumerable<Item> items = user.Inventory.Items.Where(i => i.Name == key);
|
if (needCount > 0)
|
||||||
if (items.Count() >= needCount)
|
|
||||||
{
|
{
|
||||||
items = items.Reverse().Take(needCount);
|
IEnumerable<Item> items = user.Inventory.Items.Where(i => i.Name == key);
|
||||||
foreach (Item item in items)
|
if (items.Count() >= needCount)
|
||||||
{
|
{
|
||||||
user.Inventory.Items.Remove(item);
|
items = items.Reverse().Take(needCount);
|
||||||
|
foreach (Item item in items)
|
||||||
|
{
|
||||||
|
user.Inventory.Items.Remove(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return NetworkUtility.JsonSerialize($"你的物品【{key}】数量不足 {needCount} 呢,不满足突破条件!");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return NetworkUtility.JsonSerialize($"你的物品【{key}】数量不足 {needCount} 呢,不满足突破条件!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user