公会副本排行
parent
1b70b3c73a
commit
41d73df618
|
@ -263,6 +263,8 @@ public class RedisKey {
|
|||
|
||||
public static final String SITUATION_RANK = "SITUATION_RANK";
|
||||
|
||||
public static final String GUILD_CHALLENGE_RANK = "GUILD_CHALLENGE_RANK";
|
||||
|
||||
|
||||
public static final String DEATH_PAHT_TOTAL_CHALLENGE_COUNT = "DEATH_PAHT_TOTAL_CHALLENGE_COUNT";
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ljsd.jieling.logic.family;
|
||||
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||
|
@ -10,6 +11,9 @@ import com.ljsd.jieling.logic.fight.FightDispatcher;
|
|||
import com.ljsd.jieling.logic.fight.GameFightType;
|
||||
import com.ljsd.jieling.logic.fight.PVEFightEvent;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.Family;
|
||||
|
@ -87,6 +91,7 @@ public class GuildChallengeLogic {
|
|||
CommonProto.Drop.Builder drop = null;
|
||||
CommonProto.FightData fightData = null;
|
||||
int kill = 0;
|
||||
long damage = 0;
|
||||
synchronized (lockMap.get(guildId)){
|
||||
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||
if(guildInfo.getCurrBossId()!=bossId||guildInfo.getBossHpRemain()<=0){
|
||||
|
@ -94,33 +99,37 @@ public class GuildChallengeLogic {
|
|||
}else{
|
||||
SGuildCheckpointConfig config = STableManager.getConfig(SGuildCheckpointConfig.class).get(bossId);
|
||||
|
||||
|
||||
if(type==0){
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(uid, 1, 10, "", GameFightType.DailyChallenge, config.getMonsterId(), 3);
|
||||
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
fightData = fightResult.getFightData();
|
||||
int[] checkResult = fightResult.getCheckResult();
|
||||
int damage = checkResult[1];
|
||||
int damageInt = checkResult[1];
|
||||
|
||||
if(checkResult[0]==1){
|
||||
kill = 1;
|
||||
guildInfo.setCurrBossId(guildInfo.getCurrBossId()+1);
|
||||
}
|
||||
user.getGuildMyInfo().setGuildChallengeDamage(damage);
|
||||
user.getGuildMyInfo().setGuildChallengeDamage(damageInt);
|
||||
//记录血量
|
||||
guildInfo.setBossHpRemain(guildInfo.getBossHpRemain()-damage);
|
||||
guildInfo.setBossHpRemain(guildInfo.getBossHpRemain()-damageInt);
|
||||
damage = damageInt;
|
||||
}else{
|
||||
//扫荡
|
||||
guildInfo.setBossHpRemain(guildInfo.getBossHpRemain()-user.getGuildMyInfo().getGuildChallengeDamage());
|
||||
damage = user.getGuildMyInfo().getGuildChallengeDamage();
|
||||
}
|
||||
|
||||
|
||||
|
||||
drop = ItemUtil.drop(user, new int[]{config.getReward()}, 1, 0, 1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//伤害排行
|
||||
AbstractRank rank = RankContext.getRankEnum(RankEnum.GUILD_CHALLENGE_RANK.getType());
|
||||
long score = Double.valueOf(rank.getScoreById(user.getId(), guildId+":"+bossId)).longValue();
|
||||
rank.addRank(uid,guildId+":"+bossId,score==-1?damage:score+damage);
|
||||
|
||||
if(!error.isEmpty()){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public enum RankEnum {
|
|||
EXPERT_RANK(21,RedisKey.EXPERT_RANK,GoldRank::new),//param1:活动进度 param2:无 param3:无
|
||||
FORCE_CURR_RANK(22,RedisKey.FORCE_CURR_RANK,ForceCurrRank::new),//param1:人物战力 param2:无 param3:无
|
||||
SITUATION_RANK(24,RedisKey.SITUATION_RANK,SituationRank::new),//param1:通关次数 param2:无 param3:无
|
||||
|
||||
GUILD_CHALLENGE_RANK(25,RedisKey.GUILD_CHALLENGE_RANK,GuildChallengeRank::new),//param1:伤害 param2:无 param3:无
|
||||
;
|
||||
|
||||
private int type;
|
||||
|
|
Loading…
Reference in New Issue