车迟斗法修改,处理0伤害

back_recharge
lvxinran 2021-04-15 14:24:04 +08:00
parent 29aa8a6b53
commit fe9e0858e3
1 changed files with 13 additions and 2 deletions

View File

@ -45,6 +45,7 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
User user = UserManager.getUser(uid);
SWorldBossSetting sWorldBossSetting = STableManager.getConfig(SWorldBossSetting.class).get(1);
GuildInfo guildInfo=null;
int privilege;
if(type == 1 || type == 2){
guildInfo = GuilidManager.guildInfoMap.get(user.getPlayerInfoManager().getGuildId());
if(guildInfo == null){
@ -65,8 +66,8 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
}
int privilege = sWorldBossSetting.getPrivilege()[type - 1];
boolean b = PlayerLogic.getInstance().checkAndUpdate(user, privilege, 1);
privilege = sWorldBossSetting.getPrivilege()[type - 1];
boolean b = PlayerLogic.getInstance().check(user, privilege, 1);
if(!b){
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
}
@ -85,6 +86,9 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
int monsterId = STableManager.getConfig(SWorldBossConfig.class).get(GuildFightLogic.carDelayProgressIndication.getBossIndexId()).getMonsterId();
PVEFightEvent pvpFightEvent = new PVEFightEvent(uid,GlobalsDef.CAR_DELAY_TEAM, battleRound,"", GameFightType.CarBossChallenge,monsterId,3);
FightResult fightResult = FightDispatcher.dispatcher(pvpFightEvent);
if(fightResult.getCheckResult()[0]==-1){
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
}
hurt = (int) fightResult.getCheckResult()[1];
fightData = fightResult.getFightData();
gainScore = (int) (hurt*(sWorldBossSetting.getScorePercent()/10000F));
@ -106,6 +110,10 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
PlayerManager playerInfoManager = UserManager.getUser(challeageId).getPlayerInfoManager();
String challengeName = playerInfoManager.getNickName();
if(fight==-1){
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
}
if(fight == 1){
int challenegScore = RedisUtil.getInstence().getZSetScore(RankEnum.CAR_DEALY_RANK.getRedisKey(), "", String.valueOf(challeageId)).intValue();
if(challenegScore !=-1){
@ -142,6 +150,9 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
// 记录战报
FightRecordLogic.getInstance().addRecordMap(user,fightData);
//扣除次数
PlayerLogic.getInstance().check(user, privilege, 1);
guildInfo.addCarFightSb(uid);
user.getGuildMyInfo().setCarPlayTime(TimeUtils.nowInt());
user.getGuildMyInfo().setCarPlayProgress(GuildFightLogic.carDelayProgressIndication.getProgress());