通关星级替换
parent
0132a2ff2c
commit
c76e2278d1
|
@ -527,12 +527,17 @@ public class MapLogic {
|
||||||
updateMapMission(mapManager,EventType.updateOptionalEvent, optionId,0);
|
updateMapMission(mapManager,EventType.updateOptionalEvent, optionId,0);
|
||||||
int totalWeight = updateMapMission(mapManager,EventType.updatePonintEvent, pointId,0);
|
int totalWeight = updateMapMission(mapManager,EventType.updatePonintEvent, pointId,0);
|
||||||
if (totalWeight >= 100) {
|
if (totalWeight >= 100) {
|
||||||
|
Set<Integer> stars = mapManager.getStars();
|
||||||
|
if (stars == null) {
|
||||||
|
stars = new HashSet<>(3);
|
||||||
|
}
|
||||||
|
stars.add(STAR_3);
|
||||||
|
mapManager.setStars(stars);
|
||||||
CrossInfo crossInfo = mapManager.getCrossInfoMap().get(mapManager.getCurMapId());
|
CrossInfo crossInfo = mapManager.getCrossInfoMap().get(mapManager.getCurMapId());
|
||||||
if (crossInfo == null) {
|
if (crossInfo == null) {
|
||||||
crossInfo = new CrossInfo();
|
crossInfo = new CrossInfo();
|
||||||
|
mapManager.updateCrossInfoMap(mapManager.getCurMapId(), crossInfo);
|
||||||
}
|
}
|
||||||
crossInfo.getStars().add(STAR_3);
|
|
||||||
mapManager.updateCrossInfoMap(mapManager.getCurMapId(), crossInfo);
|
|
||||||
}
|
}
|
||||||
CommonProto.Drop.Builder dropBuilder = null;
|
CommonProto.Drop.Builder dropBuilder = null;
|
||||||
if (sOptionConfig.getReward().length > 0) {
|
if (sOptionConfig.getReward().length > 0) {
|
||||||
|
@ -721,6 +726,14 @@ public class MapLogic {
|
||||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
|
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
CrossInfo crossInfo = mapManager.getCrossInfoMap().get(mapManager.getCurMapId());
|
||||||
|
if (mapManager.getStars() != null && crossInfo != null) {
|
||||||
|
if (mapManager.getStars().size() >= crossInfo.getStars().size()) {
|
||||||
|
crossInfo.getStars().clear();
|
||||||
|
crossInfo.getStars().addAll(mapManager.getStars());
|
||||||
|
mapManager.updateCrossInfoMap(mapManager.getCurMapId(), crossInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
resetMapInfo(user, true);
|
resetMapInfo(user, true);
|
||||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), null, true);
|
MessageUtil.sendMessage(session, 1, messageType.getNumber(), null, true);
|
||||||
}
|
}
|
||||||
|
@ -738,6 +751,7 @@ public class MapLogic {
|
||||||
mapManager.setTriggerXY(0);
|
mapManager.setTriggerXY(0);
|
||||||
mapManager.setDieCount(0);
|
mapManager.setDieCount(0);
|
||||||
mapManager.setCanMoveTime(0);
|
mapManager.setCanMoveTime(0);
|
||||||
|
mapManager.setStars(null);
|
||||||
TemporaryItems temporaryItems = mapManager.getTemporaryItems();
|
TemporaryItems temporaryItems = mapManager.getTemporaryItems();
|
||||||
mapManager.setMission(null);
|
mapManager.setMission(null);
|
||||||
if (temporaryItems != null) {
|
if (temporaryItems != null) {
|
||||||
|
@ -1305,10 +1319,16 @@ public class MapLogic {
|
||||||
if (useTime < crossInfo.getLeastTime()) {
|
if (useTime < crossInfo.getLeastTime()) {
|
||||||
crossInfo.setLeastTime(useTime);
|
crossInfo.setLeastTime(useTime);
|
||||||
}
|
}
|
||||||
crossInfo.getStars().add(STAR_1);
|
Set<Integer> stars = mapManager.getStars();
|
||||||
|
if (stars == null) {
|
||||||
|
stars = new HashSet<>();
|
||||||
|
}
|
||||||
|
stars.add(STAR_1);
|
||||||
|
mapManager.setStars(stars);
|
||||||
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId());
|
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId());
|
||||||
if (useTime > 0 && useTime <= sChallengeConfig.getTime()) {
|
if (useTime > 0 && useTime <= sChallengeConfig.getTime()) {
|
||||||
crossInfo.getStars().add(STAR_2);
|
stars.add(STAR_2);
|
||||||
|
mapManager.setStars(stars);
|
||||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(mapManager.getTeamId());
|
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(mapManager.getTeamId());
|
||||||
int heroForces = 0;
|
int heroForces = 0;
|
||||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||||
|
|
|
@ -59,6 +59,8 @@ public class MapManager extends MongoBase {
|
||||||
|
|
||||||
private int buyFightCount;
|
private int buyFightCount;
|
||||||
|
|
||||||
|
private Set<Integer> stars;
|
||||||
|
|
||||||
public MapManager() {
|
public MapManager() {
|
||||||
this.setRootCollection(User._COLLECTION_NAME);
|
this.setRootCollection(User._COLLECTION_NAME);
|
||||||
}
|
}
|
||||||
|
@ -318,4 +320,13 @@ public class MapManager extends MongoBase {
|
||||||
updateString("heroAllAttributeMap" , heroAllAttributeMap);
|
updateString("heroAllAttributeMap" , heroAllAttributeMap);
|
||||||
this.heroAllAttributeMap = heroAllAttributeMap;
|
this.heroAllAttributeMap = heroAllAttributeMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set<Integer> getStars() {
|
||||||
|
return stars;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStars(Set<Integer> stars) {
|
||||||
|
updateString("stars" , stars);
|
||||||
|
this.stars = stars;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue