fix arena & fix mainlevel
parent
503217bc43
commit
40611e8205
|
|
@ -226,9 +226,8 @@ public class ArenaLogic {
|
|||
.setFightResult(fightResult)
|
||||
.build();
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ARENA_CHALLENGE,fightResult, myscore + myscoreChange);
|
||||
if(defUser!=null) {
|
||||
// user.getUserMissionManager().onGameEvent(defUser, GameEvent.ARENA_CHALLENGE,fightResult,defScore + defScoreChange);
|
||||
AyyncWorker ayyncWorker = new AyyncWorker(defUser, true, new AynMissionWorker(GameEvent.ARENA_CHALLENGE, fightResult^1, defScore + defScoreChange));
|
||||
if(defUser!=null && defUser.getArenaManager().getCount()>0) {
|
||||
AyyncWorker ayyncWorker = new AyyncWorker(defUser, true, new AynMissionWorker(GameEvent.ARENA_CHALLENGE, -999, defScore + defScoreChange));
|
||||
ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker);
|
||||
}
|
||||
Poster.getPoster().dispatchEvent(new ArenaChallengeEvent(user.getId()));
|
||||
|
|
|
|||
|
|
@ -445,6 +445,10 @@ public class MissionLoigc {
|
|||
if(SMainLevelConfig.config.containsKey(missionSubType[0])){
|
||||
int virtureId = SMainLevelConfig.config.get(missionSubType[0]).getVirtureId();
|
||||
SMainLevelConfig mineMainLevelConfig = SMainLevelConfig.config.get(user.getMainLevelManager().getFightId());
|
||||
if(user.getMainLevelManager().getState() == -1 ){
|
||||
int fightId = user.getMainLevelManager().getFightId();
|
||||
mineMainLevelConfig = SMainLevelConfig.fightPreMap.get(fightId);
|
||||
}
|
||||
if(mineMainLevelConfig!=null){
|
||||
count =virtureId <= mineMainLevelConfig.getVirtureId() ?1:0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,16 @@ public class ArenaChallengeManager implements BaseDataManager{
|
|||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
CumulationData.Result result = null;
|
||||
int fightResult = (int) parm[0];
|
||||
if(missionType == MissionType.ARENA_FIGHTSUCCES_TIMES){
|
||||
if(fightResult==1){
|
||||
data.arenaFightsuccesTimes++;
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
||||
if(fightResult==-999){
|
||||
return result;
|
||||
}
|
||||
if(missionType == MissionType.ARENA_CHALLENEGE_NUMS){
|
||||
data.setArenaFightNums(data.getArenaFightNums()+1);
|
||||
result = new CumulationData.Result(missionType);
|
||||
|
|
@ -16,11 +26,6 @@ public class ArenaChallengeManager implements BaseDataManager{
|
|||
data.setArenaScore(myscore);
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
}else if(missionType == MissionType.ARENA_FIGHTSUCCES_TIMES){
|
||||
if((int)parm[0] == 1){
|
||||
data.arenaFightsuccesTimes++;
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,18 +43,22 @@ public class SMainLevelConfig implements BaseConfig {
|
|||
|
||||
public static Map<Integer, SMainLevelConfig> config;
|
||||
public static Map<Integer, SMainLevelConfig> sMainLevelConfigByVirtureIdMap;
|
||||
public static Map<Integer,SMainLevelConfig> fightPreMap;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer, SMainLevelConfig> configTmp = STableManager.getConfig(SMainLevelConfig.class);
|
||||
Map<Integer, SMainLevelConfig> SMainLevelConfigByVirtureIdMapTmp =new HashMap<>();
|
||||
Map<Integer, SMainLevelConfig> fightPreMapTmp =new HashMap<>();
|
||||
for(SMainLevelConfig sMainLevelConfig : configTmp.values()){
|
||||
int id = sMainLevelConfig.getId();
|
||||
sMainLevelConfig.setVirtureId(10_000_000*(id%10) + id);
|
||||
SMainLevelConfigByVirtureIdMapTmp.put(sMainLevelConfig.getVirtureId(),sMainLevelConfig);
|
||||
fightPreMapTmp.put(sMainLevelConfig.getNextLevel(),sMainLevelConfig);
|
||||
}
|
||||
config=configTmp;
|
||||
sMainLevelConfigByVirtureIdMap=SMainLevelConfigByVirtureIdMapTmp;
|
||||
fightPreMap=fightPreMapTmp;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue