mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-19 02:15:45 +01:00
Add gachaTimesLimit for beginner banner
Also add some more return codes
This commit is contained in:
@@ -19,12 +19,18 @@ public class PacketDoGachaRsp extends BasePacket {
|
||||
|
||||
ItemParamData costItem = banner.getCost(1);
|
||||
ItemParamData costItem10 = banner.getCost(10);
|
||||
int gachaTimesLimit = banner.getGachaTimesLimit();
|
||||
int leftGachaTimes = switch(gachaTimesLimit) {
|
||||
case Integer.MAX_VALUE -> Integer.MAX_VALUE;
|
||||
default -> Math.max(gachaTimesLimit - gachaInfo.getTotalPulls(), 0);
|
||||
};
|
||||
DoGachaRsp.Builder rsp = DoGachaRsp.newBuilder()
|
||||
.setGachaType(banner.getGachaType())
|
||||
.setGachaScheduleId(banner.getScheduleId())
|
||||
.setGachaTimes(list.size())
|
||||
.setNewGachaRandom(12345)
|
||||
.setLeftGachaTimes(Integer.MAX_VALUE)
|
||||
.setLeftGachaTimes(leftGachaTimes)
|
||||
.setGachaTimesLimit(gachaTimesLimit)
|
||||
.setCostItemId(costItem.getId())
|
||||
.setCostItemNum(costItem.getCount())
|
||||
.setTenCostItemId(costItem10.getId())
|
||||
|
||||
Reference in New Issue
Block a user