幸运转盘保底
parent
53970cef1a
commit
51042972c0
|
@ -89,11 +89,6 @@ public class GetLuckWheelRandHandler extends BaseHandler<PlayerInfoProto.GetLuck
|
||||||
user.getPlayerInfoManager().setLuckAdvanceWheelLimitTime(luckWheelLimitTime+time);
|
user.getPlayerInfoManager().setLuckAdvanceWheelLimitTime(luckWheelLimitTime+time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int luckId;
|
int luckId;
|
||||||
int lastpos=1;
|
int lastpos=1;
|
||||||
Set<Integer> posSet = new HashSet<>();
|
Set<Integer> posSet = new HashSet<>();
|
||||||
|
|
|
@ -68,6 +68,13 @@ public class RefreshLuckWheelRequestHandler extends BaseHandler<PlayerInfoProto.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 保底次数清零
|
||||||
|
if (sGlobalActivity.getType() == 30){
|
||||||
|
user.getPlayerInfoManager().setTurntableBottomNumber(0);
|
||||||
|
}else if (sGlobalActivity.getType() == 31){
|
||||||
|
user.getPlayerInfoManager().setSeniorTurntableBottomNumber(0);
|
||||||
|
}
|
||||||
|
|
||||||
//random
|
//random
|
||||||
((LuckWheelActivity) abstractActivity).randomReward(user);
|
((LuckWheelActivity) abstractActivity).randomReward(user);
|
||||||
PlayerInfoProto.RefreshLuckWheelResponse.Builder builder = PlayerInfoProto.RefreshLuckWheelResponse.newBuilder();
|
PlayerInfoProto.RefreshLuckWheelResponse.Builder builder = PlayerInfoProto.RefreshLuckWheelResponse.newBuilder();
|
||||||
|
|
|
@ -121,17 +121,43 @@ public abstract class LuckWheelActivity extends AbstractActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getNewRewardPool(User user) {
|
public int getNewRewardPool(User user) {
|
||||||
|
// 权重map
|
||||||
Map<Integer, Integer> weightMap = new HashMap<>();
|
Map<Integer, Integer> weightMap = new HashMap<>();
|
||||||
|
// 获取活动
|
||||||
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
||||||
|
// 转盘全部奖励信息
|
||||||
LuckWheelMission luckWheelMission =ActivityLogic.getInstance().getLuckWheel(user.getActivityManager(),sGlobalActivity.getType());
|
LuckWheelMission luckWheelMission =ActivityLogic.getInstance().getLuckWheel(user.getActivityManager(),sGlobalActivity.getType());
|
||||||
|
// 权重总数
|
||||||
int amount = 0;
|
int amount = 0;
|
||||||
|
// 玩家抽奖总次数
|
||||||
|
int total = sGlobalActivity.getType() == 30?user.getPlayerInfoManager().addTurntableBottomNumber():user.getPlayerInfoManager().addSeniorTurntableBottomNumber();
|
||||||
|
|
||||||
for (Map.Entry<Integer, LuckWheelPosInfo> entry : luckWheelMission.getPosInfoMap().entrySet()) {
|
for (Map.Entry<Integer, LuckWheelPosInfo> entry : luckWheelMission.getPosInfoMap().entrySet()) {
|
||||||
int luckId = entry.getValue().getLuckId();
|
int luckId = entry.getValue().getLuckId();
|
||||||
|
// 获取配置表
|
||||||
SDialRewardConfig sDialRewardConfig = SDialRewardConfig.getsDialRewardConfigMap().get(luckId);
|
SDialRewardConfig sDialRewardConfig = SDialRewardConfig.getsDialRewardConfigMap().get(luckId);
|
||||||
|
// 限制次数
|
||||||
int limitNum = sDialRewardConfig.getLimitNum();
|
int limitNum = sDialRewardConfig.getLimitNum();
|
||||||
if (limitNum!=0&&entry.getValue().getProgrss() >= sDialRewardConfig.getLimitNum())
|
if (limitNum!=0&&entry.getValue().getProgrss() >= sDialRewardConfig.getLimitNum()) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 必中次数
|
||||||
|
if (sDialRewardConfig.getMaxGoalCount() != 0 && sDialRewardConfig.getMaxGoalCount() == total){
|
||||||
|
// 权重清零,重新赋值
|
||||||
|
weightMap.clear();
|
||||||
|
weightMap.put(luckId, sDialRewardConfig.getExtractWeight());
|
||||||
|
amount = sDialRewardConfig.getExtractWeight();
|
||||||
|
// 次数清理
|
||||||
|
if (sGlobalActivity.getType() == 30){
|
||||||
|
user.getPlayerInfoManager().setTurntableBottomNumber(0);
|
||||||
|
}else if (sGlobalActivity.getType() == 31){
|
||||||
|
user.getPlayerInfoManager().setSeniorTurntableBottomNumber(0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 权重map赋值
|
||||||
weightMap.put(luckId, sDialRewardConfig.getExtractWeight());
|
weightMap.put(luckId, sDialRewardConfig.getExtractWeight());
|
||||||
amount += sDialRewardConfig.getExtractWeight();
|
amount += sDialRewardConfig.getExtractWeight();
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,6 +115,11 @@ public class PlayerManager extends MongoBase {
|
||||||
private Set<Integer> proudInfo = new HashSet<>();
|
private Set<Integer> proudInfo = new HashSet<>();
|
||||||
|
|
||||||
private int luckWheelLimitTime;
|
private int luckWheelLimitTime;
|
||||||
|
// 转盘保底次数
|
||||||
|
private int turntableBottomNumber;
|
||||||
|
// 高级转盘保底次数
|
||||||
|
private int seniorTurntableBottomNumber;
|
||||||
|
|
||||||
private int luckAdvanceWheelLimitTime;
|
private int luckAdvanceWheelLimitTime;
|
||||||
|
|
||||||
private String platform;
|
private String platform;
|
||||||
|
@ -432,8 +437,9 @@ public class PlayerManager extends MongoBase {
|
||||||
public void refreshVipByType(int privilegeType){
|
public void refreshVipByType(int privilegeType){
|
||||||
List<SPrivilegeTypeConfig> sPrivilegeTypeConfigs = SPrivilegeTypeConfig.privilegeByType.get(privilegeType);
|
List<SPrivilegeTypeConfig> sPrivilegeTypeConfigs = SPrivilegeTypeConfig.privilegeByType.get(privilegeType);
|
||||||
for(SPrivilegeTypeConfig config:sPrivilegeTypeConfigs){
|
for(SPrivilegeTypeConfig config:sPrivilegeTypeConfigs){
|
||||||
if(!vipInfo.containsKey(config.getId()))
|
if(!vipInfo.containsKey(config.getId())) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
vipInfo.get(config.getId()).setCount(0);
|
vipInfo.get(config.getId()).setCount(0);
|
||||||
}
|
}
|
||||||
updateString("vipInfo", this.vipInfo);
|
updateString("vipInfo", this.vipInfo);
|
||||||
|
@ -748,6 +754,35 @@ public class PlayerManager extends MongoBase {
|
||||||
this.luckWheelLimitTime = luckWheelLimitTime;
|
this.luckWheelLimitTime = luckWheelLimitTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getTurntableBottomNumber() {
|
||||||
|
return turntableBottomNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTurntableBottomNumber(int turntableBottomNumber) {
|
||||||
|
this.turntableBottomNumber = turntableBottomNumber;
|
||||||
|
updateString("turntableBottomNumber",turntableBottomNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int addTurntableBottomNumber() {
|
||||||
|
this.turntableBottomNumber += 1;
|
||||||
|
updateString("turntableBottomNumber",turntableBottomNumber);
|
||||||
|
return turntableBottomNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSeniorTurntableBottomNumber() {
|
||||||
|
return seniorTurntableBottomNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeniorTurntableBottomNumber(int seniorTurntableBottomNumber) {
|
||||||
|
this.seniorTurntableBottomNumber = seniorTurntableBottomNumber;
|
||||||
|
updateString("seniorTurntableBottomNumber",seniorTurntableBottomNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int addSeniorTurntableBottomNumber() {
|
||||||
|
this.seniorTurntableBottomNumber += 1;
|
||||||
|
updateString("seniorTurntableBottomNumber",seniorTurntableBottomNumber);
|
||||||
|
return seniorTurntableBottomNumber;
|
||||||
|
}
|
||||||
|
|
||||||
public int getLuckAdvanceWheelLimitTime() {
|
public int getLuckAdvanceWheelLimitTime() {
|
||||||
return luckAdvanceWheelLimitTime;
|
return luckAdvanceWheelLimitTime;
|
||||||
|
|
Loading…
Reference in New Issue