抽卡显示
parent
66f04a7b46
commit
c49ae44705
|
@ -131,11 +131,6 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
.setState(user.getPlayerInfoManager().getPhoneBindInfo().getState())
|
||||
.build();
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
int alreadyCount =0;
|
||||
for(Integer id : STableManager.getFigureConfig(HeroStaticConfig.class).getRandomHeroIds()){
|
||||
int count = Optional.ofNullable(heroManager.getTotalCount().get(id)).orElse(0);
|
||||
alreadyCount+=count;
|
||||
}
|
||||
// 返利
|
||||
GmActivityLogic.zeroUpdateGmActivity(user);
|
||||
SGameSetting setting = STableManager.getConfig(SGameSetting.class).get(1);
|
||||
|
@ -170,7 +165,15 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
Set<Integer> equipHandBookSet = user.getEquipManager().getEquipHandBook().keySet();
|
||||
int equipPool = user.getEquipManager().getSoulEquipPool();
|
||||
int vipPrivilageValue = user.getPlayerInfoManager().getVipPrivilageValue(SMazeTreasureSetting.sMazeTreasureSetting.getRefreshVIP());
|
||||
int randomCount = SLotterySpecialConfig.getLotteryListByDifferentType(7).iterator().next().getCount()- user.getHeroManager().getRandomPoolByType().getOrDefault(11,new HashMap<>()).getOrDefault(7,0);
|
||||
// 英雄抽卡剩余必中
|
||||
int randomCount = SLotterySpecialConfig.getLotteryListByDifferentType(7)
|
||||
.iterator().next().getCount() -
|
||||
user.getHeroManager().getRandomPoolByType().getOrDefault(11,new HashMap<>()).getOrDefault(7,0);
|
||||
// 法宝抽卡剩余必中
|
||||
int fabaoRandomCount = SLotterySpecialConfig.getLotteryListByDifferentType(151)
|
||||
.iterator().next().getCount() -
|
||||
user.getHeroManager().getRandomPoolByType().getOrDefault(23,new HashMap<>()).getOrDefault(151,0);
|
||||
|
||||
List<CommonProto.SixiangxinfaInfo> sixiangxinfaInfos = getSixiangxinfaInfos(heroManager);
|
||||
List<CommonProto.PracticeSkillInfo> practiceSkillInfos = getPracticeSkillInfos(heroManager);
|
||||
List<CommonProto.FaBaoSoulInfo> faBaoSoulInfos = getFaBaoSoulInfos(heroManager);
|
||||
|
@ -186,7 +189,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
.addAllVipLeveTake(playerInfoManager.getHadTakeLevelBoxVip())
|
||||
.setUserCreateTime((int)(playerInfoManager.getCreateTime()/1000))
|
||||
.addAllRedType(playerInfoManager.getReds())
|
||||
.setRandCount(alreadyCount)
|
||||
.setRandCount(fabaoRandomCount)
|
||||
.addAllHeroHandBook(heroHandBookList).addAllEquipHandBook(equipHandBookSet)
|
||||
.addAllGoodsTypeDuration(goodsTypeDurations)
|
||||
.setHadBuyTreasure(playerInfoManager.getHadBuyTreasure())
|
||||
|
|
|
@ -23,8 +23,11 @@ public class HeroManager extends MongoBase {
|
|||
*/
|
||||
private Map<String, Hero> heroMap= new HashMap<>();
|
||||
|
||||
private Map<Integer, Integer> totalCount= new HashMap<>();
|
||||
|
||||
/**
|
||||
* key:MergePool
|
||||
* key:DifferentType
|
||||
* value:数量
|
||||
*/
|
||||
private Map<Integer, Map<Integer, Integer>> randomPoolByType = new HashMap<>();
|
||||
|
||||
private Map<Integer,Integer> mustRandomCount= new HashMap<>();
|
||||
|
@ -313,12 +316,6 @@ public class HeroManager extends MongoBase {
|
|||
updateString("likableSendTime", _sendTime);
|
||||
}
|
||||
|
||||
|
||||
public void updateRandCount(int type, int count){
|
||||
updateString("totalCount." + type, count);
|
||||
totalCount.put(type,count);
|
||||
}
|
||||
|
||||
public void updateRandomPoolByType(int type,Map<Integer,Integer> map){
|
||||
randomPoolByType.put(type,map);
|
||||
updateString("randomPoolByType." + type, map);
|
||||
|
@ -386,10 +383,6 @@ public class HeroManager extends MongoBase {
|
|||
return heroMap;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getTotalCount() {
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
public void addHeroHandBook(int heroId,int star){
|
||||
if(heroHandBook.containsKey(heroId)&&heroHandBook.get(heroId)>=star){
|
||||
return;
|
||||
|
@ -597,11 +590,6 @@ public class HeroManager extends MongoBase {
|
|||
// return purpleMansionSeal; 2022-4-20 策划需求关闭紫府神印功能
|
||||
}
|
||||
|
||||
public void setPurpleMansionSeal(Map<Integer, PurpleMansionSeal> purpleMansionSeal) {
|
||||
this.purpleMansionSeal = purpleMansionSeal;
|
||||
updateString("purpleMansionSeal", purpleMansionSeal);
|
||||
}
|
||||
|
||||
public void putPurpleMansionSeal(PurpleMansionSeal seal) {
|
||||
purpleMansionSeal.put(seal.getSealId(),seal);
|
||||
updateString("purpleMansionSeal", purpleMansionSeal);
|
||||
|
|
|
@ -255,6 +255,9 @@ public class HeroLogic {
|
|||
throw new ErrorCodeException("已抽取今日最大次数");
|
||||
}
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
if (heroManager == null){
|
||||
throw new ErrorCodeException("玩家信息异常");
|
||||
}
|
||||
if (type == 11 && heroManager.getFirstTenth() == 0) {
|
||||
heroManager.updateFirstTenth();
|
||||
}
|
||||
|
@ -269,7 +272,7 @@ public class HeroLogic {
|
|||
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
|
||||
}
|
||||
}
|
||||
if (heroManager != null && heroManager.getHeroMap() != null) {
|
||||
if (heroManager.getHeroMap() != null) {
|
||||
//只有抽英雄才校验
|
||||
if (sLotterySetting.getGainType() == 1 && heroManager.getHeroMap().size() + perCount > STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getHeroNumlimit()) {
|
||||
throw new ErrorCodeException(ErrorCode.HERO_MAX);
|
||||
|
@ -347,16 +350,23 @@ public class HeroLogic {
|
|||
}
|
||||
|
||||
Poster.getPoster().dispatchEvent(new RandomCardEvent(user.getId(), sLotterySetting.getActivityId(), heroManager.getRandomPoolByType().get(sLotterySetting.getMergePool()), sLotterySetting.getPerCount()));
|
||||
// //1群英招募
|
||||
HeroInfoProto.HeroRandResponse.Builder builder = HeroInfoProto.HeroRandResponse.newBuilder();
|
||||
// 英雄卡池类型
|
||||
if (sLotterySetting.getLotteryType() == 1) {
|
||||
Poster.getPoster().dispatchEvent(new HeroRandomEvent(uid, perCount));
|
||||
List<SLotterySpecialConfig> lotteryListByDifferentType = SLotterySpecialConfig.getLotteryListByDifferentType(7);
|
||||
if (lotteryListByDifferentType.size() == 1) {
|
||||
SLotterySpecialConfig next = lotteryListByDifferentType.iterator().next();
|
||||
builder.setMustCount(next.getCount() - heroManager.getRandomPoolByType().get(sLotterySetting.getMergePool()).getOrDefault(7, 0));
|
||||
}
|
||||
int heroRandomCount = SLotterySpecialConfig.getLotteryListByDifferentType(7)
|
||||
.iterator().next().getCount() -
|
||||
user.getHeroManager().getRandomPoolByType().getOrDefault(11,new HashMap<>()).getOrDefault(7,0);
|
||||
builder.setMustCount(heroRandomCount);
|
||||
}
|
||||
// 法宝卡池类型
|
||||
if (sLotterySetting.getLotteryType() == 4){
|
||||
int fabaoRandomCount = SLotterySpecialConfig.getLotteryListByDifferentType(151)
|
||||
.iterator().next().getCount() -
|
||||
user.getHeroManager().getRandomPoolByType().getOrDefault(23,new HashMap<>()).getOrDefault(151,0);
|
||||
builder.setFabaoMustCount(fabaoRandomCount);
|
||||
}
|
||||
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.RANDOM_HERO, sLotterySetting.getLotteryType(), perCount);
|
||||
if (sLotterySetting.getLotteryType() == 11) {
|
||||
//只记录新将招募次数
|
||||
|
@ -365,7 +375,6 @@ public class HeroLogic {
|
|||
if (sLotterySetting.getActivityId() == 8201) {
|
||||
Poster.getPoster().dispatchEvent(new UserLevelEvent(user.getId(), 0));
|
||||
}
|
||||
heroManager.updateRandCount(type, perCount);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.dropPer(user, resultRandom, BIReason.HERO_RANDOM);
|
||||
fiveStarPushByRandom(user, resultRandom);
|
||||
fiveStarPokemonPushByRandom(user, resultRandom);
|
||||
|
|
Loading…
Reference in New Issue