Merge branch 'master_test_gn' into master_test_gn_upStarHeroActiviry
commit
d352dbb972
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue