战斗修改补充
(cherry picked from commit 901ab76a3aad4862318a8c76378ea138d21a9095)back_recharge
parent
def246c407
commit
2050067fb1
|
|
@ -90,14 +90,11 @@ public class TasuilingxiaoHandler extends BaseHandler<ActivityProto.Tasuilingxia
|
|||
bossBlood+=monsterConfig.getHp();
|
||||
}
|
||||
}
|
||||
// 战斗结果,{战斗结果,战斗时间,单位1剩余血量......}
|
||||
long[] checkResult = fightResult.getCheckResult();
|
||||
//输
|
||||
double lessBlood;
|
||||
|
||||
if(checkResult[0]==-1){
|
||||
if(fightResult.getResult()==-1){
|
||||
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||
}else if (checkResult[0] == 1){
|
||||
}else if (fightResult.getResult() == 1){
|
||||
lessBlood = bossBlood;
|
||||
}else {
|
||||
// 输 checkResult第三位开始为血量,下标0开始
|
||||
|
|
|
|||
|
|
@ -212,12 +212,14 @@ public class FourChallengeLogic {
|
|||
// 战斗逻辑
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), teamId, 20, "", GameFightType.FourChallenge, sCampTowerConfig.getMonster(), 3);
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
long[] checkResult = fightResult.getCheckResult();
|
||||
response.setFightData(fightResult.getFightData());
|
||||
|
||||
AbstractRank rank = RankContext.getRankEnum(RankEnum.FOUR_CHALLENGE_TIER_RANK.getType());
|
||||
|
||||
if (checkResult[0] == 1) {
|
||||
// 战斗异常
|
||||
if (fightResult.getResult() == -1) {
|
||||
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||
}
|
||||
if (fightResult.getResult() == 1) {
|
||||
// 挑战成功,获得道具,更新层数,更新次数
|
||||
drop = ItemUtil.drop(user, sCampTowerConfig.getFirstReward(), BIReason.FOUR_CHALLENGE_FIRST);
|
||||
user.getPlayerInfoManager().updateFourChallengeByIndex(campId - 1, currentFloor + 1);
|
||||
|
|
|
|||
|
|
@ -214,19 +214,20 @@ public class SevenWorldLogic {
|
|||
|
||||
PlayerInfoProto.SevenWorldChallengeResponse.Builder builder = PlayerInfoProto.SevenWorldChallengeResponse.newBuilder();
|
||||
// 战斗逻辑
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.SEVEN_WORLD_TEAM.getTeamId(), 20, "", GameFightType.SEVENWORLD, stage.getMonsterGroup(), 3);
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.SEVEN_WORLD_TEAM.getTeamId(), 20, "", GameFightType.SevenWorld, stage.getMonsterGroup(), 3);
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
// 战斗返回结果
|
||||
long[] checkResult = fightResult.getCheckResult();
|
||||
|
||||
// 战斗异常
|
||||
if (fightResult.getResult() == -1) {
|
||||
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||
}
|
||||
// 挑战成功,计算奖励
|
||||
if (checkResult[0] == 1){
|
||||
if (fightResult.getResult() == 1){
|
||||
int[][] reward = rewardBuff(user, fightResult, stage);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, reward, BIReason.SEVEN_WORLD_CHALLENGE);
|
||||
builder.setDrop(drop);
|
||||
}
|
||||
// 战斗数据
|
||||
builder.setResult((int)checkResult[0]);
|
||||
builder.setResult(fightResult.getResult());
|
||||
builder.setFightData(fightResult.getFightData());
|
||||
|
||||
return builder.build();
|
||||
|
|
|
|||
Loading…
Reference in New Issue