Merge branch 'master_dev' into master_otnew
commit
b282cd18ec
|
|
@ -23,7 +23,7 @@ public enum GameFightType {
|
||||||
MapEndFight(FightType.MapExploreFight,new DefaultOfRedisCacheFightHandler(),RedisKey.FIGHT),
|
MapEndFight(FightType.MapExploreFight,new DefaultOfRedisCacheFightHandler(),RedisKey.FIGHT),
|
||||||
EndSuddlenlyFight(FightType.MapExploreFight,new DefaultOfRedisCacheFightHandler(),RedisKey.SUDDLENLY_FIGHT),
|
EndSuddlenlyFight(FightType.MapExploreFight,new DefaultOfRedisCacheFightHandler(),RedisKey.SUDDLENLY_FIGHT),
|
||||||
EndMonsterAttackFight(FightType.MonterFight,new MainLineOrInnerDemonFightHandler(),RedisKey.CHALLENGE_MONSTER_ATTACK),
|
EndMonsterAttackFight(FightType.MonterFight,new MainLineOrInnerDemonFightHandler(),RedisKey.CHALLENGE_MONSTER_ATTACK),
|
||||||
MonterFight(FightType.MonterFight,new MainLineOrInnerDemonFightHandler(),null),
|
MonterFight(FightType.MonterFight,new MainLineOrInnerQuickFightHandler(),null),//心魔快速战斗
|
||||||
ArenaPersonFight(FightType.ArenaFight,new PVPFightHandler(),null),
|
ArenaPersonFight(FightType.ArenaFight,new PVPFightHandler(),null),
|
||||||
ArenaRobotFight(FightType.ArenaFight,new PVPFightHandler(),null),
|
ArenaRobotFight(FightType.ArenaFight,new PVPFightHandler(),null),
|
||||||
Expediton(FightType.EXPEDITION,new PVPFightHandler(),null),
|
Expediton(FightType.EXPEDITION,new PVPFightHandler(),null),
|
||||||
|
|
@ -34,7 +34,6 @@ public enum GameFightType {
|
||||||
GuildBossFight(FightType.GuildBossFight,new DefaultOfRedisCacheFightHandler(),RedisKey.GUILD_MONSTER_FIGHT),
|
GuildBossFight(FightType.GuildBossFight,new DefaultOfRedisCacheFightHandler(),RedisKey.GUILD_MONSTER_FIGHT),
|
||||||
DailyChallenge(FightType.StoryFight,new DefaultWithoutHandFightHandler(),null),
|
DailyChallenge(FightType.StoryFight,new DefaultWithoutHandFightHandler(),null),
|
||||||
DeathPathChallenge(FightType.CarBossFight,new DefaultWithoutHandFightHandler(),null),
|
DeathPathChallenge(FightType.CarBossFight,new DefaultWithoutHandFightHandler(),null),
|
||||||
|
|
||||||
CarBossChallenge(FightType.CarBossFight,new DefaultWithoutHandFightHandler(),null),
|
CarBossChallenge(FightType.CarBossFight,new DefaultWithoutHandFightHandler(),null),
|
||||||
CarPersonChallenge(FightType.CarPersonFight,new PVPFightHandler(),null),
|
CarPersonChallenge(FightType.CarPersonFight,new PVPFightHandler(),null),
|
||||||
GuildChallenge(FightType.GuildChallenge,new DefaultWithoutHandFightHandler(),null),
|
GuildChallenge(FightType.GuildChallenge,new DefaultWithoutHandFightHandler(),null),
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@ public class MainLineOrInnerDemonFightHandler implements IFightEventProcesor {
|
||||||
public FightResult process(FightEvent fightEvent) throws Exception {
|
public FightResult process(FightEvent fightEvent) throws Exception {
|
||||||
GameFightType fightType = fightEvent.getFightType();
|
GameFightType fightType = fightEvent.getFightType();
|
||||||
int playerId = fightEvent.getAttackUid();
|
int playerId = fightEvent.getAttackUid();
|
||||||
int fightTime = fightEvent.getMostTime();
|
|
||||||
String key = RedisKey.getKey(fightType.getFightTypeOfRedis(), Integer.toString(playerId));
|
String key = RedisKey.getKey(fightType.getFightTypeOfRedis(), Integer.toString(playerId));
|
||||||
Map<Object, Object> valueMap = RedisUtil.getInstence().hmget(key);
|
Map<Object, Object> valueMap = RedisUtil.getInstence().hmget(key);
|
||||||
if (valueMap == null || valueMap.isEmpty()) {
|
if (valueMap == null || valueMap.isEmpty()) {
|
||||||
|
|
@ -52,6 +51,23 @@ public class MainLineOrInnerDemonFightHandler implements IFightEventProcesor {
|
||||||
JsonFormat.merge((String) valueMap.get(RedisKey.FIGHT_HEROES), builder);
|
JsonFormat.merge((String) valueMap.get(RedisKey.FIGHT_HEROES), builder);
|
||||||
CommonProto.FightTeamInfo fightTeamInfo = builder.build();
|
CommonProto.FightTeamInfo fightTeamInfo = builder.build();
|
||||||
List<CommonProto.FightTeamInfo> monsterTeamList = BehaviorUtil.getFightTeamInfos(valueMap);
|
List<CommonProto.FightTeamInfo> monsterTeamList = BehaviorUtil.getFightTeamInfos(valueMap);
|
||||||
|
|
||||||
|
return returnFightResult(fightEvent, seed, fightTeamInfo, monsterTeamList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回挑战结果
|
||||||
|
* @param fightEvent 战斗类型
|
||||||
|
* @param seed 速度
|
||||||
|
* @param fightTeamInfo 我方队伍
|
||||||
|
* @param monsterTeamList 地方队伍
|
||||||
|
* @return FightResult
|
||||||
|
*/
|
||||||
|
public FightResult returnFightResult(FightEvent fightEvent, int seed, CommonProto.FightTeamInfo fightTeamInfo, List<CommonProto.FightTeamInfo> monsterTeamList){
|
||||||
|
int playerId = fightEvent.getAttackUid();
|
||||||
|
int fightTime = fightEvent.getMostTime();
|
||||||
|
GameFightType fightType = fightEvent.getFightType();
|
||||||
|
|
||||||
LuaValue getFightData = FightDataUtil.getFinalFightData(fightTeamInfo, monsterTeamList);
|
LuaValue getFightData = FightDataUtil.getFinalFightData(fightTeamInfo, monsterTeamList);
|
||||||
LuaValue getOptionData = FightDataUtil.getOptionData(String.valueOf(playerId));
|
LuaValue getOptionData = FightDataUtil.getOptionData(String.valueOf(playerId));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.ljsd.jieling.logic.fight.eventhandler;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
import com.ljsd.jieling.logic.fight.FightEvent;
|
||||||
|
import com.ljsd.jieling.logic.fight.FightUtil;
|
||||||
|
import com.ljsd.jieling.logic.fight.GameFightType;
|
||||||
|
import com.ljsd.jieling.logic.fight.PVEFightEvent;
|
||||||
|
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||||
|
import rpc.protocols.CommonProto;
|
||||||
|
import util.TimeUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主线编队和心魔战斗快速处理方法
|
||||||
|
*/
|
||||||
|
public class MainLineOrInnerQuickFightHandler extends MainLineOrInnerDemonFightHandler {
|
||||||
|
@Override
|
||||||
|
public FightResult process(FightEvent fightEvent) throws Exception {
|
||||||
|
GameFightType fightType = fightEvent.getFightType();
|
||||||
|
int playerId = fightEvent.getAttackUid();
|
||||||
|
int fightSeed = TimeUtils.nowInt();
|
||||||
|
|
||||||
|
PVEFightEvent pveFightEvent = (PVEFightEvent) fightEvent;
|
||||||
|
int groupId = pveFightEvent.getMonsterGroupId();
|
||||||
|
// 玩家队伍信息
|
||||||
|
User user = UserManager.getUserNotCache(playerId);
|
||||||
|
CommonProto.FightTeamInfo fightTeamInfo = FightUtil.makePersonFightData(user, pveFightEvent.getTeamId(), pveFightEvent.getAttackBloodMap(), pveFightEvent.getBuffIds());
|
||||||
|
//怪物队伍信息
|
||||||
|
Map<Integer, List<CommonProto.FightUnitInfo>> monsterByGroup = getMonsterByGroup(playerId, groupId, fightType.getFightType().getType());
|
||||||
|
List<CommonProto.FightTeamInfo> monsterfightTeamInfos = FightUtil.getFightTeamInfos(groupId, pveFightEvent.getNums(), monsterByGroup);
|
||||||
|
|
||||||
|
return returnFightResult(fightEvent, fightSeed, fightTeamInfo, monsterfightTeamInfos);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue