功绩类新添加、图鉴添加

back_recharge
lvxinran 2019-07-16 17:39:34 +08:00
parent eaa9ffcd43
commit bbf6b94cba
8 changed files with 180 additions and 43 deletions

View File

@ -23,6 +23,8 @@ public class SAccomplishmentConfig implements BaseConfig {
private int[] reward;
private static Map<Integer, List<SAccomplishmentConfig>> sAccomplishmentConfigByMapIdMap;
private static Map<Integer,Map<Integer,List<SAccomplishmentConfig>>> sAccomplishmentConfigByMapIdAndLogicMap;

View File

@ -75,6 +75,8 @@ public class SGameSetting implements BaseConfig {
private int[] lotterySecurityReward;
private int[] achievementRefreshType;
private static SGameSetting gameSetting;
@ -208,4 +210,8 @@ public class SGameSetting implements BaseConfig {
public int[] getLotterySecurityReward() {
return lotterySecurityReward;
}
public int[] getAchievementRefreshType() {
return achievementRefreshType;
}
}

View File

@ -10,10 +10,7 @@ import com.ljsd.jieling.logic.GlobalDataManaager;
import com.ljsd.jieling.logic.activity.ActivityLogic;
import com.ljsd.jieling.logic.activity.ActivityType;
import com.ljsd.jieling.logic.arena.ArenaLogic;
import com.ljsd.jieling.logic.dao.PlayerManager;
import com.ljsd.jieling.logic.dao.RechargeInfo;
import com.ljsd.jieling.logic.dao.RoomInfo;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.*;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.player.PlayerLogic;
@ -35,6 +32,7 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Component
public class GetPlayerInfoHandler extends BaseHandler{
@ -96,6 +94,9 @@ public class GetPlayerInfoHandler extends BaseHandler{
alreadyCount+=count;
}
}
//图鉴信息
Set<Integer> heroHandBookSet = user.getHeroManager().getHeroHandBook().keySet();
Set<Integer> equipHandBookSet = user.getEquipManager().getEquipHandBook().keySet();
PlayerInfoProto.GetPlayerInfoResponse getPlayerInfoResponse
= PlayerInfoProto.GetPlayerInfoResponse.newBuilder()
.setPlayer(player)
@ -108,6 +109,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
.setUserCreateTime((int)(playerInfoManager.getCreateTime()/1000))
.addAllRedType(playerInfoManager.getReds())
.setRandCount(alreadyCount)
.addAllHeroHandBook(heroHandBookSet).addAllEquipHandBook(equipHandBookSet)
.build();
try {
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_PLAYERINFO_RESPONSE_VALUE, getPlayerInfoResponse, true);

View File

@ -814,7 +814,7 @@ public class MapLogic {
if(outType == 0||mapManager.getTower()-1==STrialConfig.getHighestTower()){
if(mapManager.getTowerUnusedBuffer()!=null){
mapManager.setTowerUnusedBuffer(new HashMap<>());
};
}
LOGGER.info("退出地图");
if(challengeConfig.getType()==2){
if(mapManager.getTower()>=1){
@ -827,6 +827,7 @@ public class MapLogic {
}
}
}
mapManager.setEssenceValue(0);
mapManager.setCurrTowerTime(0);
boolean result = onlyLevelMap(user, true);
@ -835,9 +836,26 @@ public class MapLogic {
return;
}
}
int time = (int)(mapManager.getCurrTowerTime())/1000;
builder.setUseTime(time);
LOGGER.info("当前层使用时间{}",time);
//精英本功绩清除计数
if(challengeConfig.getType()==3){
int[] achievementRefreshType = SGameSetting.getGameSetting().getAchievementRefreshType();
List<SAccomplishmentConfig> accomplishmentConfig = SAccomplishmentConfig.getsAccomplishmentConfigByMapId(challengeConfig.getMapId());
MapMission mapMission = mapManager.getCopyMissionProgresById(challengeConfig.getMapId());
Map<Integer, Integer> copyMissionProgresById = mapMission.getAllMissionProgress();
for(SAccomplishmentConfig accomplishment:accomplishmentConfig){
for(int i = 0 ; i <achievementRefreshType.length;i++){
if(accomplishment.getLogic()==achievementRefreshType[i]&&copyMissionProgresById.get(accomplishment.getId())!=-1){
copyMissionProgresById.put(accomplishment.getId(),0);
mapMission.setAllMissionProgress(copyMissionProgresById);
mapManager.setCopyMissionProgres(mapMission);
}
}
}
}
MessageUtil.sendMessage(session, 1, messageType.getNumber(), builder.build(), true);
return;
}
@ -1049,7 +1067,7 @@ public class MapLogic {
fastFightResponse.setEssenceValue(mapManager.getEssenceValue());
// LOGGER.info("endFight() uid=>{},nextEventId=>{}", uid, nextEventId);
MapMissionManager.updateMapMission(user, EventType.fightEvent, groupId, groupId);
MapMissionManager.updateMapMission(user, EventType.fightEvent, groupId, checkResult[1]);
// LOGGER.info("endFight() uid=>{} sMonsterGroup.getRewardgroup()=>{} misson=>{} eventDrop=>{}, missionDrop=>{}", uid, sMonsterGroup.getRewardgroup(), fastFightResponse.getMission(), fastFightResponse.getEnventDrop(), fastFightResponse.getMissionDrop());
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fastFightResponse.build(), true);
}
@ -1263,7 +1281,7 @@ public class MapLogic {
fightEndResponse.setEventId(nextEventId);
// LOGGER.info("endFight() uid=>{},nextEventId=>{}", uid, nextEventId);
MapMissionManager.updateMapMission(user, EventType.fightEvent, monsterGroupId, monsterGroupId);
MapMissionManager.updateMapMission(user, EventType.fightEvent, monsterGroupId, checkResult[1]);
// LOGGER.info("endFight() uid=>{} sMonsterGroup.getRewardgroup()=>{} misson=>{} eventDrop=>{}, missionDrop=>{}", uid, sMonsterGroup.getRewardgroup(), fightEndResponse.getMission(), fightEndResponse.getEnventDrop(), fightEndResponse.getMissionDrop());
if (monsterGroupId == mapManager.getSuddenlyBoss()) {
mapManager.findSuddenlyBoss(0, 0);

View File

@ -112,11 +112,15 @@ public class MapMissionManager {
}
int score = sAccomplishmentConfig.getScore();
int[][] values = sAccomplishmentConfig.getValues();
//逻辑类型14
//逻辑类型14-------------正确
if(mapMissionType==MapMissionType.KILL_BOSS_IN_BOSS_EVENT){
if(sChallengeConfig.getDifficultType()!=sAccomplishmentConfig.getValues()[0][0]){
continue;
}
if(eventId!=sAccomplishmentConfig.getValues()[0][1]) {
continue;
}
boolean tempResult = true;
if(sChallengeConfig.getDifficultType()==sAccomplishmentConfig.getValues()[0][0]&&eventId==sAccomplishmentConfig.getValues()[0][1]){
HeroManager heroManager = user.getHeroManager();
Map<Integer, SCHero> scHeroMap = SCHero.getsCHero();
for(Map.Entry entry:mapManager.getHeroAllAttributeMap().entrySet()){
@ -126,27 +130,39 @@ public class MapMissionManager {
break;
}
}
}
if(tempResult){
allMissionProgress.put(missionId,-1);
needUpdate = true;
}
continue;
}
//逻辑类型15
//逻辑类型15------------正确
if(mapMissionType==mapMissionType.KILL_BOSS_INTIME_DIFFICULT_EVENT){
if(sChallengeConfig.getDifficultType()!=sAccomplishmentConfig.getValues()[0][0]){
continue;
}
if(eventId!=sAccomplishmentConfig.getValues()[0][1]){
continue;
}
boolean tempResult = false;
if(sChallengeConfig.getDifficultType()==sAccomplishmentConfig.getValues()[0][0]&&eventId==sAccomplishmentConfig.getValues()[0][1]){
if(time<sAccomplishmentConfig.getValues()[1][0]){
tempResult = true;
}
}
if(tempResult){
allMissionProgress.put(missionId,-1);
needUpdate = true;
}
continue;
}
//逻辑类型16
//逻辑类型16------------正确
if(mapMissionType==mapMissionType.KILL_DIFFICULT_BOSS_WITH_TEAM_HERO_COUNT_EVENT){
if(sChallengeConfig.getDifficultType()!=sAccomplishmentConfig.getValues()[0][0]){
continue;
}
boolean tempResult = false;
if(sChallengeConfig.getDifficultType()==sAccomplishmentConfig.getValues()[0][0]&&eventId==sAccomplishmentConfig.getValues()[0][1]) {
if(eventId!=sAccomplishmentConfig.getValues()[0][1]) {
continue;
}
int alive = 0;
for(Map.Entry entry:mapManager.getHeroAllAttributeMap().entrySet()){
Map<Integer,Integer> value = (Map<Integer,Integer>)entry.getValue();
@ -157,15 +173,42 @@ public class MapMissionManager {
if(alive>=sAccomplishmentConfig.getValues()[1][0]){
tempResult = true;
}
}
if(tempResult){
allMissionProgress.put(missionId,-1);
needUpdate = true;
}
continue;
}
//逻辑类型17-------------------正确
if(mapMissionType==mapMissionType.FINISH_OPTIONS_DIFFICULT_MAP_EVENT){
if(sChallengeConfig.getDifficultType()!=sAccomplishmentConfig.getValues()[1][0]||missionValue==-1){
continue;
}
int[] value = sAccomplishmentConfig.getValues()[0];
for(int i = 0 ; i <value.length;i++){
if(eventId==value[i]){
missionValue = missionValue | (1<<i);
}
}
if(missionValue+1>>value.length==1){
missionValue = -1;
}
allMissionProgress.put(missionId,missionValue);
needUpdate = true;
continue;
}
//逻辑类型19
if(mapMissionType==mapMissionType.KILL_MONSTER_BY_ORDER_DIFFICULT_MAP_EVENT){
if(sChallengeConfig.getDifficultType()!=sAccomplishmentConfig.getValues()[1][0]){
if(sChallengeConfig.getDifficultType()!=sAccomplishmentConfig.getValues()[1][0]||missionValue==-1){
continue;
}
int[] value = sAccomplishmentConfig.getValues()[0];
@ -186,11 +229,13 @@ public class MapMissionManager {
}
}
allMissionProgress.put(missionId,missionValue);
needUpdate = true;
continue;
}
//逻辑类型18
//逻辑类型18---------------------正确
if(mapMissionType==mapMissionType.FINISH_EVENT_BY_ORDER_DIFFICULT_MAP_EVENT){
int[][] configValues = sAccomplishmentConfig.getValues();
if(sChallengeConfig.getDifficultType()!=configValues[configValues.length-1][0]){
if(sChallengeConfig.getDifficultType()!=configValues[configValues.length-1][0]||missionValue==-1){
continue;
}
for(int i = 0 ; i <configValues.length-1;i++){
@ -202,16 +247,49 @@ public class MapMissionManager {
missionValue = 0;
}
}
//确认完成
if(missionValue==configValues.length-1){
missionValue=-1;
}
allMissionProgress.put(missionId,missionValue);
needUpdate = true;
continue;
}
//逻辑类型20------------正确
if(mapMissionType==mapMissionType.NOT_EVENT_FINISH_EVENT_DIFFICULT_MAP_EVENT){
if(missionValue==-1){
continue;
}
int[][] configValues = sAccomplishmentConfig.getValues();
if(sChallengeConfig.getDifficultType()!=configValues[configValues.length-1][0]){
continue;
}
boolean flag = true;
int[] skipEvent = configValues[0];
int[] finishEvent = configValues[1];
for(int i = 0 ; i <skipEvent.length;i++){
if(missionValue==skipEvent[i]){
flag = false;
break;
}
if(eventId==skipEvent[i]){
missionValue = skipEvent[i];
}
}
if(flag){
for(int i = 0 ; i < finishEvent.length;i++){
if(eventId==finishEvent[i]){
missionValue = -1;
}
}
}
allMissionProgress.put(missionId,missionValue);
needUpdate = true;
continue;
}
int targetEventValue = values[1][0];
if(!updateProgress){
for(int targetEventIdTmp : values[0]){

View File

@ -14,16 +14,19 @@ public class EquipManager extends MongoBase {
private Equip unDetermined;
private Map<Integer,Integer> equipHandBook;
public EquipManager() {
this.setRootCollection(User._COLLECTION_NAME);
this.equipHandBook = new HashMap<>();
this.equipMap = new HashMap<>();
}
public void addEquip(User user,Equip equip) throws Exception {
updateString("equipMap." + equip.getId(), equip);
equipMap.put(equip.getId(),equip);
addEquipHandBook(equip.getEquipId());
user.getUserMissionManager().onGameEvent(user, GameEvent.GET_EQUIP,equip.getEquipId());
}
@ -46,4 +49,15 @@ public class EquipManager extends MongoBase {
updateString("unDetermined", unDetermined);
this.unDetermined = unDetermined;
}
public void addEquipHandBook(int equipId){
if(equipHandBook.containsKey(equipId)){
return;
}
equipHandBook.put(equipId,0);
updateString("equipMap." + equipId, 0);
}
public Map<Integer, Integer> getEquipHandBook() {
return equipHandBook;
}
}

View File

@ -13,9 +13,13 @@ public class HeroManager extends MongoBase {
Map<Integer, Integer> totalCount;
Map<Integer,Integer> heroHandBook;
public HeroManager() {
heroMap = new HashMap();
totalCount = new HashMap();
heroHandBook = new HashMap<>();
this.setRootCollection(User._COLLECTION_NAME);
}
@ -37,6 +41,7 @@ public class HeroManager extends MongoBase {
hero.init(this.getRootId(),getMongoKey() + ".heroMap." + hero.getId());
updateString("heroMap." + hero.getId(), hero);
heroMap.put(hero.getId(), hero);
addHeroHandBook(hero.getTemplateId());
}
public Hero getHero(String heroId) {
@ -57,4 +62,16 @@ public class HeroManager extends MongoBase {
public Map<Integer, Integer> getTotalCount() {
return totalCount;
}
public void addHeroHandBook(int heroId){
if(heroHandBook.containsKey(heroId)){
return;
}
heroHandBook.put(heroId,0);
updateString("heroHandBook." + heroId, 0);
}
public Map<Integer, Integer> getHeroHandBook() {
return heroHandBook;
}
}

View File

@ -790,7 +790,7 @@ public class CombatLogic {
return hurt;
}
List<Integer> result =new ArrayList<>(5);
for(int i=1;i<=oldRemainHp.size();i++){
for(int i=2;i<=oldRemainHp.size();i++){
result.add(checkResult[i]);
hurt+=(oldRemainHp.get(i-1)-checkResult[i]);
}