Merge branch 'master_test_gn' into master_test_gn_upStarHeroActiviry

back_recharge
jiahuiwen 2022-01-11 11:09:46 +08:00
commit d352dbb972
2 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,34 @@
package com.ljsd.jieling.kefu;
import com.ljsd.jieling.logic.dao.ArchitectureInfo;
import com.ljsd.jieling.logic.dao.root.User;
import config.SHomeLandLevel;
import manager.STableManager;
import util.TimeUtils;
import java.util.Map;
/**
* @Author hj
* @Date 2021/10/28 17:11:17
* @Description: homelevel id#id#/
* @Version 1.0
*/
public class Cmd_homelevel extends GmRoleAbstract{
@Override
public boolean exec(String[] args) throws Exception {
if (args.length >= 1){
User user = getUser();
int id = Integer.parseInt(args[0]);
Map<Integer, SHomeLandLevel> config = STableManager.getConfig(SHomeLandLevel.class);
SHomeLandLevel landLevel = config.get(id);
if (landLevel == null){
return false;
}
int time = args.length > 2?Integer.parseInt(args[2]):TimeUtils.nowInt();
ArchitectureInfo info = new ArchitectureInfo(landLevel.getId(), time, 0);
user.getPlayerInfoManager().putArchitectureInfo(landLevel.getPoolID(),info);
}
return false;
}
}

View File

@ -480,9 +480,23 @@ public class HeroLogic {
}
int index = list.indexOf(sLotteryRewardConfig);
///保底奖励替换逻辑(偶数为保底卡池)
if (sLotteryRewardConfig.getPool()%2==0) {
index=index%count;
}
if (index >= count) {
return sLotteryRewardConfig.getReward();
}
///天地洪炉默认没选择up道具特殊处理(奇数为普通卡池)
if (sLotteryRewardConfig.getPool()%2==1) {
if (user.getHeroManager().getTrumpSelectItemMap().size()==0){
HashMap<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < count; i++) {
map.put(i+1,list.get(i).getReward()[0]);
}
user.getHeroManager().setTrumpSelectItemMap(map);
}
}
if (!user.getHeroManager().getTrumpSelectItemMap().containsKey(index + 1)) {
return sLotteryRewardConfig.getReward();