试炼buff提交
parent
f161ac1e08
commit
1e56edce3a
|
@ -135,8 +135,6 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
||||||
Set<Integer> heroHandBookSet = user.getHeroManager().getHeroHandBook().keySet();
|
Set<Integer> heroHandBookSet = user.getHeroManager().getHeroHandBook().keySet();
|
||||||
Set<Integer> equipHandBookSet = user.getEquipManager().getEquipHandBook().keySet();
|
Set<Integer> equipHandBookSet = user.getEquipManager().getEquipHandBook().keySet();
|
||||||
int equipPool = user.getEquipManager().getSoulEquipPool();
|
int equipPool = user.getEquipManager().getSoulEquipPool();
|
||||||
//试炼已领取奖励层数
|
|
||||||
Set<Integer> towerFloorReceivedReward = mapManager.getTowerReceivedReward().keySet();
|
|
||||||
CommonProto.EndlessInfo.Builder endless = CommonProto.EndlessInfo.newBuilder();
|
CommonProto.EndlessInfo.Builder endless = CommonProto.EndlessInfo.newBuilder();
|
||||||
endless.setMapId(MapLogic.getEndlessMapId());
|
endless.setMapId(MapLogic.getEndlessMapId());
|
||||||
endless.setWorldLevel(MongoUtil.getInstence().getMyMongoTemplate().findById(1, ServerConfig.class).getWorldLevel());
|
endless.setWorldLevel(MongoUtil.getInstence().getMyMongoTemplate().findById(1, ServerConfig.class).getWorldLevel());
|
||||||
|
@ -157,7 +155,6 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
||||||
.addAllRedType(playerInfoManager.getReds())
|
.addAllRedType(playerInfoManager.getReds())
|
||||||
.setRandCount(alreadyCount)
|
.setRandCount(alreadyCount)
|
||||||
.addAllHeroHandBook(heroHandBookSet).addAllEquipHandBook(equipHandBookSet)
|
.addAllHeroHandBook(heroHandBookSet).addAllEquipHandBook(equipHandBookSet)
|
||||||
.addAllTowerReceivedReward(towerFloorReceivedReward)
|
|
||||||
.addAllGoodsTypeDuration(goodsTypeDurations)
|
.addAllGoodsTypeDuration(goodsTypeDurations)
|
||||||
.setHadBuyTreasure(playerInfoManager.getHadBuyTreasure())
|
.setHadBuyTreasure(playerInfoManager.getHadBuyTreasure())
|
||||||
.setTreasureLevel(playerInfoManager.getTreasureLevel())
|
.setTreasureLevel(playerInfoManager.getTreasureLevel())
|
||||||
|
|
|
@ -112,6 +112,7 @@ public class EventType {
|
||||||
public static final int fourtyEight = 48;
|
public static final int fourtyEight = 48;
|
||||||
public static final int fourtyNine = 49;
|
public static final int fourtyNine = 49;
|
||||||
public static final int fifty = 50;
|
public static final int fifty = 50;
|
||||||
|
public static final int fiftyone = 51;
|
||||||
|
|
||||||
public static final int updatePonintEvent = 1;
|
public static final int updatePonintEvent = 1;
|
||||||
public static final int fightEvent = 2;
|
public static final int fightEvent = 2;
|
||||||
|
|
|
@ -2865,8 +2865,15 @@ public class MapLogic {
|
||||||
trialInfo.setMapInfo(new HashMap<>());
|
trialInfo.setMapInfo(new HashMap<>());
|
||||||
trialInfo.setQuitMapId(0);
|
trialInfo.setQuitMapId(0);
|
||||||
trialInfo.setEnergy(0);
|
trialInfo.setEnergy(0);
|
||||||
trialInfo.setFloor(trialInfo.getFloor()-7>1?trialInfo.getFloor()-7:1);
|
|
||||||
trialInfo.setTimes(openTimeOfFuntionCacheByType.getTimes());
|
trialInfo.setTimes(openTimeOfFuntionCacheByType.getTimes());
|
||||||
|
List<Integer> initBuff = new ArrayList<>();
|
||||||
|
if(trialInfo.getHighestTower()!=0&&trialInfo.getFloor()<=trialInfo.getHighestTower()){
|
||||||
|
initBuff.add(STrialSetting.sTrialSetting.getBaseBuff());
|
||||||
|
}
|
||||||
|
trialInfo.setBuffIds(initBuff);
|
||||||
|
trialInfo.setFloor(trialInfo.getFloor()-7>1?trialInfo.getFloor()-7:1);
|
||||||
|
trialInfo.setKillCount(0);
|
||||||
|
trialInfo.setTowerReceivedReward(new HashSet<>());
|
||||||
if(mapManager.getCurMapId()!=0){
|
if(mapManager.getCurMapId()!=0){
|
||||||
if(MapLogic.getInstance().getMap(user) instanceof TowerMap){
|
if(MapLogic.getInstance().getMap(user) instanceof TowerMap){
|
||||||
resetMapInfo(user,false);
|
resetMapInfo(user,false);
|
||||||
|
|
|
@ -99,8 +99,6 @@ public class MapManager extends MongoBase {
|
||||||
|
|
||||||
private int mapIntoFlag;
|
private int mapIntoFlag;
|
||||||
|
|
||||||
private Map<Integer,Integer> towerReceivedReward = new HashMap<>();
|
|
||||||
|
|
||||||
private Map<Integer, Map<Integer,Integer>> monsterTempSkill = new HashMap<>();
|
private Map<Integer, Map<Integer,Integer>> monsterTempSkill = new HashMap<>();
|
||||||
//无尽副本信息
|
//无尽副本信息
|
||||||
private EndlessMapInfo endlessMapInfo =new EndlessMapInfo();
|
private EndlessMapInfo endlessMapInfo =new EndlessMapInfo();
|
||||||
|
@ -617,18 +615,6 @@ public class MapManager extends MongoBase {
|
||||||
difficultyOptions.put(fbId,difficultId);
|
difficultyOptions.put(fbId,difficultId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<Integer,Integer> getTowerReceivedReward() {
|
|
||||||
return towerReceivedReward;
|
|
||||||
}
|
|
||||||
public void setTowerReceivedReward(Map<Integer,Integer> towerReceivedReward){
|
|
||||||
updateString("towerReceivedReward",towerReceivedReward);
|
|
||||||
this.towerReceivedReward =towerReceivedReward;
|
|
||||||
}
|
|
||||||
public void addTowerReceivedReward(int tower){
|
|
||||||
updateString("towerReceivedReward."+tower,1);
|
|
||||||
towerReceivedReward.put(tower,1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<Integer, Map<Integer,Integer>> getMonsterTempSkill() {
|
public Map<Integer, Map<Integer,Integer>> getMonsterTempSkill() {
|
||||||
return monsterTempSkill;
|
return monsterTempSkill;
|
||||||
}
|
}
|
||||||
|
@ -821,6 +807,11 @@ public class MapManager extends MongoBase {
|
||||||
trialInfo.setKillCount(count);
|
trialInfo.setKillCount(count);
|
||||||
updateString("trialInfo.killCount",count);
|
updateString("trialInfo.killCount",count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateTrialBuffIds(List<Integer> ids){
|
||||||
|
trialInfo.setBuffIds(ids);
|
||||||
|
updateString("trialInfo.buffIds",ids);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,11 @@
|
||||||
package com.ljsd.jieling.handler.map;
|
package com.ljsd.jieling.handler.map;
|
||||||
|
|
||||||
import com.ljsd.jieling.logic.dao.Hero;
|
import java.util.*;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lvxinran
|
* @author lvxinran
|
||||||
* @date 2020/5/16
|
* @date 2020/5/16
|
||||||
* @discribe
|
* @discribe 试炼信息
|
||||||
*/
|
*/
|
||||||
public class TrialInfo {
|
public class TrialInfo {
|
||||||
//默认一层
|
//默认一层
|
||||||
|
@ -37,6 +31,8 @@ public class TrialInfo {
|
||||||
|
|
||||||
private Set<Integer> towerReceivedReward = new HashSet<>();
|
private Set<Integer> towerReceivedReward = new HashSet<>();
|
||||||
|
|
||||||
|
private List<Integer> buffIds = new ArrayList<>();
|
||||||
|
|
||||||
public Set<Integer> getTowerReceivedReward() {
|
public Set<Integer> getTowerReceivedReward() {
|
||||||
return towerReceivedReward;
|
return towerReceivedReward;
|
||||||
}
|
}
|
||||||
|
@ -124,4 +120,12 @@ public class TrialInfo {
|
||||||
public void setKillCount(int killCount) {
|
public void setKillCount(int killCount) {
|
||||||
this.killCount = killCount;
|
this.killCount = killCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Integer> getBuffIds() {
|
||||||
|
return buffIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuffIds(List<Integer> buffIds) {
|
||||||
|
this.buffIds = buffIds;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.ljsd.jieling.handler.map.behavior;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.handler.map.EventType;
|
||||||
|
import com.ljsd.jieling.handler.map.MapManager;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lvxinran
|
||||||
|
* @date 2020/6/14
|
||||||
|
* @discribe
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class FiftyOneBehavior extends BaseBehavior {
|
||||||
|
@Override
|
||||||
|
public int getBehaviorType() {
|
||||||
|
return EventType.fiftyone;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean process(int optionId, User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
|
||||||
|
MapManager mapManager = user.getMapManager();
|
||||||
|
List<Integer> buffIds = mapManager.getTrialInfo().getBuffIds();
|
||||||
|
for(int[] values:behaviorTypeValues){
|
||||||
|
for(int value:values){
|
||||||
|
buffIds.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mapManager.updateTrialBuffIds(buffIds);
|
||||||
|
BehaviorUtil.destoryCurPoint(user);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
package com.ljsd.jieling.handler.map.behavior;
|
package com.ljsd.jieling.handler.map.behavior;
|
||||||
|
|
||||||
import com.ljsd.jieling.handler.map.Cell;
|
|
||||||
import com.ljsd.jieling.handler.map.EventType;
|
import com.ljsd.jieling.handler.map.EventType;
|
||||||
import com.ljsd.jieling.handler.map.MapManager;
|
import com.ljsd.jieling.handler.map.MapManager;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
@ -19,22 +18,9 @@ public class FourtyThreeBehavior extends BaseBehavior{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean process(int optionId, User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
|
public boolean process(int optionId, User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
|
||||||
LOGGER.info("43协议");
|
|
||||||
MapManager mapManager = user.getMapManager();
|
MapManager mapManager = user.getMapManager();
|
||||||
if(mapManager.getBossXY()!=0&&mapManager.getTriggerXY()!=mapManager.getBossXY()){
|
|
||||||
LOGGER.info("错误");
|
|
||||||
return false;
|
|
||||||
|
|
||||||
};
|
|
||||||
if (mapManager.getBossType()==3){
|
|
||||||
Cell cell = mapManager.getMapInfo().get(mapManager.getBossXY());
|
|
||||||
LOGGER.info("暂存buff层数:{},buff:{},pointId:{}",mapManager.getTrialInfo().getFloor(),cell.getEventId(),cell.getPointId());
|
|
||||||
mapManager.addTowerUnusedBuffer(mapManager.getTrialInfo().getFloor(),cell.getEventId());
|
|
||||||
return true;
|
|
||||||
}else if(mapManager.getBossType()==4){
|
|
||||||
int storeIndex = MathUtils.randomFromWeight(STrialConfig.sTrialConfigMap.get(mapManager.getTrialInfo().getFloor()).getRandomStore());
|
int storeIndex = MathUtils.randomFromWeight(STrialConfig.sTrialConfigMap.get(mapManager.getTrialInfo().getFloor()).getRandomStore());
|
||||||
StoreLogic.initOrUpdateOneStore(user,8,storeIndex);
|
StoreLogic.initOrUpdateOneStore(user,8,storeIndex);
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,6 +139,9 @@ public class TowerMap extends AbstractMap {
|
||||||
mapEnterResponse.setCurHero(teamPosHeroInfos.get(0).getHeroId());
|
mapEnterResponse.setCurHero(teamPosHeroInfos.get(0).getHeroId());
|
||||||
}
|
}
|
||||||
mapEnterResponse.setAddHpCount(trialInfo.getAddHpCount());
|
mapEnterResponse.setAddHpCount(trialInfo.getAddHpCount());
|
||||||
|
for(int id :trialInfo.getBuffIds()){
|
||||||
|
mapEnterResponse.addFoodBuffers(CommonProto.FoodBuffer.newBuilder().setBufferId(id).setLeftStep(-1).build());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -26,6 +26,7 @@ import config.SCHero;
|
||||||
import org.luaj.vm2.LuaValue;
|
import org.luaj.vm2.LuaValue;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -202,6 +203,7 @@ public class FightUtil {
|
||||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||||
Map<String, TrailHero> heroInfo = user.getMapManager().getTrialInfo().getHeroInfo();
|
Map<String, TrailHero> heroInfo = user.getMapManager().getTrialInfo().getHeroInfo();
|
||||||
|
List<Integer> buffIds = user.getMapManager().getTrialInfo().getBuffIds();
|
||||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||||
if (heroInfo.isEmpty()||!heroInfo.containsKey(teamPosHeroInfo.getHeroId())) {
|
if (heroInfo.isEmpty()||!heroInfo.containsKey(teamPosHeroInfo.getHeroId())) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -210,7 +212,19 @@ public class FightUtil {
|
||||||
StringBuilder propertySb = new StringBuilder();
|
StringBuilder propertySb = new StringBuilder();
|
||||||
//存起来
|
//存起来
|
||||||
String heroSkill = trailHero.getHeroSkills();
|
String heroSkill = trailHero.getHeroSkills();
|
||||||
String property = HeroLogic.getInstance().getHeroPropertyBuilder(propertySb,trailHero.getTmpId(),trailHero.getLevel(),trailHero.getProperty()).toString();
|
Map<Integer, Integer> propertyMap = new HashMap<>();
|
||||||
|
//加入buff
|
||||||
|
if(!buffIds.isEmpty()){
|
||||||
|
for(Map.Entry<Integer,Integer> tempProperty:trailHero.getProperty().entrySet()){
|
||||||
|
propertyMap.put(tempProperty.getKey(),tempProperty.getValue());
|
||||||
|
}
|
||||||
|
for(int buffId:buffIds){
|
||||||
|
CombatLogic.getInstance().bufferOneHeroAttrAfterEat(propertyMap,buffId);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
propertyMap = trailHero.getProperty();
|
||||||
|
}
|
||||||
|
String property = HeroLogic.getInstance().getHeroPropertyBuilder(propertySb,trailHero.getTmpId(),trailHero.getLevel(),propertyMap).toString();
|
||||||
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||||
.newBuilder()
|
.newBuilder()
|
||||||
.setUnitId(Integer.toString(trailHero.getTmpId()))
|
.setUnitId(Integer.toString(trailHero.getTmpId()))
|
||||||
|
|
|
@ -45,6 +45,8 @@ public class STrialSetting implements BaseConfig{
|
||||||
//回春散
|
//回春散
|
||||||
private int[] healingId;
|
private int[] healingId;
|
||||||
|
|
||||||
|
private int baseBuff;
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
@ -88,4 +90,8 @@ public class STrialSetting implements BaseConfig{
|
||||||
public int[] getHealingId() {
|
public int[] getHealingId() {
|
||||||
return healingId;
|
return healingId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getBaseBuff() {
|
||||||
|
return baseBuff;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue