1212
This commit is contained in:
@@ -22,6 +22,7 @@ public class RandomData
|
||||
public string code { get; set; }
|
||||
public string name { get; set; }
|
||||
public string par { get; set; }
|
||||
public long count { get; set; }
|
||||
public int minCount { get; set; }
|
||||
public int maxCount { get; set; }
|
||||
public double chance { get; set; }
|
||||
}
|
||||
@@ -364,6 +364,7 @@ public static class GameBus
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
double totalWeight = data.Sum(it => it.random);
|
||||
int rnd = _randomInstance.Next(Convert.ToInt32(totalWeight) + 1);
|
||||
double current = 0;
|
||||
@@ -399,7 +400,7 @@ public static class GameBus
|
||||
var onAward = result.FindIndex(it => it.code == item.code && it.parameter == item.par);
|
||||
if (onAward > -1)
|
||||
{
|
||||
result[onAward].count += item.count;
|
||||
result[onAward].count += RandomAssist.GetFormatedNumeric(item.minCount, item.maxCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -408,7 +409,7 @@ public static class GameBus
|
||||
code = item.code,
|
||||
name = item.name,
|
||||
parameter = item.par,
|
||||
count = item.count
|
||||
count = RandomAssist.GetFormatedNumeric(item.minCount, item.maxCount)
|
||||
};
|
||||
result.Add(add);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,15 @@ public class GoodsController : ControllerBase
|
||||
|
||||
string userId = StateHelper.userId;
|
||||
int count = await _goodsService.GetUserGoodsCount(userId, goodsId);
|
||||
int UseState = 0;
|
||||
switch (goodsInfo.code)
|
||||
{
|
||||
case "Pack":
|
||||
UseState = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return PoAction.Ok(new { goods = goodsInfo, count });
|
||||
return PoAction.Ok(new { goods = goodsInfo, count, use = UseState });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user