Merge branch 'master_test_gn' of http://60.1.1.230/backend/jieling_server into master_test_gn
commit
2518c0821d
|
@ -30,12 +30,9 @@ public class TransformationForceUpHandler extends BaseHandler<HeroInfoProto.Tran
|
|||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.TransformationForceUpRequest proto) throws Exception {
|
||||
int id = proto.getId();
|
||||
User user = UserManager.getUser(iSession.getUid());
|
||||
Map<Integer, SChangingForce> cardMap = STableManager.getConfig(SChangingForce.class);
|
||||
|
||||
id = user.getHeroManager().getTransformationForce()+1;
|
||||
|
||||
int id = user.getHeroManager().getTransformationForce();
|
||||
SChangingForce config = cardMap.get(id);
|
||||
if (config == null) {
|
||||
return;
|
||||
|
|
|
@ -51,7 +51,7 @@ public class ChallengeLogic {
|
|||
return true;
|
||||
}
|
||||
|
||||
public static Map<Integer, Integer> dropMap(SChallengeStage sChallengeConfig, int model, int type, int win, long[] result,PlayerInfoProto.ChallengeResponse.Builder builder) {
|
||||
public static Map<Integer, Integer> dropMap(SChallengeStage sChallengeConfig, int model, int type, int win, long[] result,int bout,PlayerInfoProto.ChallengeResponse.Builder builder) {
|
||||
/*
|
||||
model //1为挑战 2为扫荡
|
||||
win // 1赢 0输
|
||||
|
@ -96,8 +96,8 @@ public class ChallengeLogic {
|
|||
if(type ==1){
|
||||
//回合副本
|
||||
builder.setPercentReward(10000);
|
||||
builder.setLossBloodOrTimes(result[1]);
|
||||
LOGGER.info("win times 回合数:"+result[1]);
|
||||
builder.setLossBloodOrTimes(bout);
|
||||
LOGGER.info("win times 回合数:"+bout);
|
||||
|
||||
}else if(type ==2){
|
||||
//伤害副本
|
||||
|
@ -112,27 +112,29 @@ public class ChallengeLogic {
|
|||
int[][] reward1 = sChallengeConfig.getReward1();
|
||||
int ratio = 0;
|
||||
if (type == 1) {//回合数
|
||||
long times = result[1];
|
||||
long times = bout;
|
||||
for (int[] percent : reward1) {
|
||||
if (percent[0] > times) {
|
||||
break;
|
||||
}
|
||||
ratio = percent[1];
|
||||
LOGGER.info("输了 回合数 percent[0]:"+percent[0]);
|
||||
}
|
||||
builder.setLossBloodOrTimes(times);
|
||||
LOGGER.info("输了 回合数 times :"+times);
|
||||
LOGGER.info("输了 回合数 times :=>{} id=>{}",times,sChallengeConfig.getId());
|
||||
} else if (type == 2) { //血量
|
||||
double bossBlood =SMonsterGroup.getInitHp(sChallengeConfig.getMonsterGroup()); //怪物初始化血量
|
||||
double leaveHp = result[2] + result[3] + result[4]
|
||||
+ result[5] + result[6];
|
||||
double lossBlood = bossBlood - leaveHp;
|
||||
for (int[] percent : reward1) {
|
||||
if (percent[0] > lossBlood) {
|
||||
if (percent[0]/10000 > lossBlood/bossBlood) {
|
||||
break;
|
||||
}
|
||||
ratio = percent[1];
|
||||
LOGGER.info("输了 血量 percent[0]:"+percent[0]);
|
||||
}
|
||||
LOGGER.info("输了 lossBlood:"+lossBlood);
|
||||
LOGGER.info("输了 lossBlood:=>{} id=>{}",lossBlood,sChallengeConfig.getId());
|
||||
builder.setLossBloodOrTimes((long)lossBlood);
|
||||
}
|
||||
LOGGER.info("challengeHandler ====>id:{},ratio:{}", sChallengeConfig.getId(), ratio);
|
||||
|
@ -224,7 +226,7 @@ public class ChallengeLogic {
|
|||
break;
|
||||
}
|
||||
//扫荡 = 保底 +总奖励
|
||||
comDropMap = dropMap(sChallengeConfig, model, type, 1, null,builder);
|
||||
comDropMap = dropMap(sChallengeConfig, model, type, 1, null,0,builder);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, comDropMap.entrySet().stream().map(n ->
|
||||
new int[]{n.getKey(), n.getValue()}).toArray(int[][]::new), BIReason.EXPLORE_MAP_COST_RETURN);
|
||||
builder.setDrop(drop);
|
||||
|
@ -248,7 +250,7 @@ public class ChallengeLogic {
|
|||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), type == 1?TeamEnum.CHALLENGE_ENDLESS_NEWTEAM.getTeamId():TeamEnum.CHALLENGE_TREASURE_TEAM.getTeamId(), 20, "",
|
||||
fightType, sChallengeConfig.getMonsterGroup(), 3);
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
|
||||
int time = fightResult.getCurRound();
|
||||
//首次通关 给 保底 +总奖励 +通关奖励
|
||||
if ((int) fightResult.getCheckResult()[0] == 1) {
|
||||
//赢了
|
||||
|
@ -257,23 +259,23 @@ public class ChallengeLogic {
|
|||
} else if (type == 2) {
|
||||
user.getPlayerInfoManager().setTreasureReplica(id);
|
||||
}
|
||||
comDropMap = dropMap(sChallengeConfig, model, type, 1, fightResult.getCheckResult(),builder);
|
||||
comDropMap = dropMap(sChallengeConfig, model, type, 1, fightResult.getCheckResult(),time,builder);
|
||||
builder.setResult(1);
|
||||
} else {
|
||||
if (type == 1){
|
||||
if((int) fightResult.getCheckResult()[1]>=20){
|
||||
//无尽副本回合数超过20 赢
|
||||
user.getPlayerInfoManager().setEndlessNewReplica(id);
|
||||
comDropMap = dropMap(sChallengeConfig, model, type, 1, fightResult.getCheckResult(),builder);
|
||||
comDropMap = dropMap(sChallengeConfig, model, type, 1, fightResult.getCheckResult(),time,builder);
|
||||
builder.setResult(1);
|
||||
}else{
|
||||
//没打过 //输了 保底+总奖励*奖励百分比
|
||||
comDropMap = dropMap(sChallengeConfig, model, type, 0, fightResult.getCheckResult(),builder);
|
||||
comDropMap = dropMap(sChallengeConfig, model, type, 0, fightResult.getCheckResult(),time,builder);
|
||||
builder.setResult(0);
|
||||
}
|
||||
}else if(type == 2){
|
||||
//没打过 //输了 保底+总奖励*奖励百分比
|
||||
comDropMap = dropMap(sChallengeConfig, model, type, 0, fightResult.getCheckResult(),builder);
|
||||
comDropMap = dropMap(sChallengeConfig, model, type, 0, fightResult.getCheckResult(),time,builder);
|
||||
builder.setResult(0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -368,21 +368,31 @@ public class StoreLogic implements IEventHandler {
|
|||
if(sStoreTypeConfig.getIfManualRefresh()[0]!=0){
|
||||
refreshTimeDelay-=sStoreTypeConfig.getIfManualRefresh()[0]*sStoreTypeConfig.getIfManualRefresh()[1]*TimeUtils.HOUR;
|
||||
}
|
||||
StoreInfo storeInfo = storeManager.getStoreInfoMap().get(sStoreTypeConfig.getId());
|
||||
if(sStoreTypeConfig.getStoreOpenRule() == 8){
|
||||
TimeControllerOfFunction openTimeOfFuntionCacheByType = GlobalDataManaager.getInstance().getOpenTimeOfFuntionCacheByType(FunctionIdEnum.getFunctionIdEnumByType(sStoreTypeConfig.getOpenLevel()[1]));
|
||||
if(openTimeOfFuntionCacheByType!=null ){
|
||||
StoreInfo storeInfo = storeManager.getStoreInfoMap().get(sStoreTypeConfig.getId());
|
||||
if(storeInfo == null || storeInfo.getStartTime()!=openTimeOfFuntionCacheByType.getStartTime()){
|
||||
Map<Integer, Integer> itemNumMap = getStoreItem(sStoreTypeConfig.getId(),sStoreTypeConfig,user);
|
||||
storeManager.newStoreInfo(sStoreTypeConfig.getId(),refreshTimeDelay,openTimeOfFuntionCacheByType.getStartTime(),openTimeOfFuntionCacheByType.getEndTime(),itemNumMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(storeManager.getStoreInfoMap().containsKey(sStoreTypeConfig.getId())){
|
||||
if(storeInfo != null){
|
||||
//根据条件更新商品
|
||||
Map<Integer, Integer> itemNumMap = getStoreItem(sStoreTypeConfig.getId(),sStoreTypeConfig,user);
|
||||
if (!itemNumMap.isEmpty()){
|
||||
Map<Integer, Integer> map = storeInfo.getItemNumMap();
|
||||
for (Integer itemId : itemNumMap.keySet()) {
|
||||
if (storeInfo.getItemNumMap().get(itemId) == null){
|
||||
map.put(itemId,0);
|
||||
}
|
||||
}
|
||||
storeInfo.setItemNumMap(map);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if(sStoreTypeConfig.getStoreOpenRule() == 7){
|
||||
|
||||
long startTime = ToolsUtil.getTimeLong(sStoreTypeConfig.getStartTimeLong(), sStoreTypeConfig.getEndTimeLong(),ActivityType.OPEN_TYPE_SERVER,0, 1);
|
||||
long endTime = ToolsUtil.getTimeLong(sStoreTypeConfig.getStartTimeLong(),sStoreTypeConfig.getEndTimeLong(), ActivityType.OPEN_TYPE_SERVER,0, 2);
|
||||
long now = TimeUtils.now();
|
||||
|
@ -435,9 +445,8 @@ public class StoreLogic implements IEventHandler {
|
|||
int[] openLv = sStoreConfig.getOpenLv();
|
||||
int minLv = openLv[0];
|
||||
int maxLv = openLv[1];
|
||||
if (minLv <= playerInfoManager.getLevel() && maxLv >= playerInfoManager.getLevel()){
|
||||
totalWeight += sStoreConfig.getWeight();
|
||||
randomSstoreConfigList.add(sStoreConfig);
|
||||
if (minLv > playerInfoManager.getLevel() || maxLv < playerInfoManager.getLevel()){
|
||||
continue;
|
||||
}
|
||||
// 额外开启条件
|
||||
int[] openRule = sStoreConfig.getOpenRule();
|
||||
|
@ -445,15 +454,15 @@ public class StoreLogic implements IEventHandler {
|
|||
case 1:
|
||||
// 杀敌数
|
||||
int killNum = playerInfoManager.getExploreKillTotalNum();
|
||||
if (killNum >= openRule[1]){
|
||||
totalWeight += sStoreConfig.getWeight();
|
||||
randomSstoreConfigList.add(sStoreConfig);
|
||||
if (killNum < openRule[1]){
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
totalWeight += sStoreConfig.getWeight();
|
||||
randomSstoreConfigList.add(sStoreConfig);
|
||||
}
|
||||
int weight = 0;
|
||||
int rewardId = 0;
|
||||
|
|
Loading…
Reference in New Issue