挑战副本 身外化身之力
parent
6f069c79a9
commit
e94cef02a9
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue