大闹天宫圣物修改
parent
cf740db4e4
commit
9fe8dd3e5f
|
@ -188,6 +188,8 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
|
|||
return;
|
||||
} else {
|
||||
|
||||
//胜利更新胜利圣物次数
|
||||
user.getExpeditionManager().victory();
|
||||
//节点血量更新
|
||||
nodeInfo.getSnapFightInfo().getHeroAttribute().forEach((s, familyHeroInfo) ->
|
||||
nodeInfo.getBossHP().put(s, 0d)
|
||||
|
|
|
@ -114,6 +114,7 @@ public class HeroNodeGetInfoRequestHandler extends BaseHandler<Expedition.HeroNo
|
|||
inner.setForce(HeroLogic.getInstance().calForce(heroNotBufferAttribute));
|
||||
inner.setHero(CBean2Proto.getHero(hero));
|
||||
builder.addViewHeroInfo(inner);
|
||||
user.getExpeditionManager().getGHeroSet().add(hero.getTemplateId());
|
||||
});
|
||||
|
||||
// nodeInfo.setState(ExpeditionLogic.NODESTATE_HERO);
|
||||
|
|
|
@ -81,6 +81,8 @@ public class ReliveExpeditionHeroRequest extends BaseHandler<Expedition.ReliveEx
|
|||
// }
|
||||
// ids.add(hero.getId());
|
||||
// }
|
||||
//使用判官笔更新圣物次数
|
||||
expeditionManager.useJudgePen();
|
||||
|
||||
expeditionManager.getHeroHPWithChange().clear();
|
||||
expeditionManager.setReliveItemTime(expeditionManager.getReliveItemTime()+1);
|
||||
|
|
|
@ -86,6 +86,10 @@ public class TakeHolyEquipRequest extends BaseHandler<Expedition.TakeHolyEquipRe
|
|||
}
|
||||
}
|
||||
|
||||
//添加专属英雄圣物缓存
|
||||
if(sExpeditionHolyConfig.getHeroId() > 0){
|
||||
expeditionManager.getHeroItems().put(sExpeditionHolyConfig.getHeroId(),sExpeditionHolyConfig);
|
||||
}
|
||||
|
||||
//notify client
|
||||
Expedition.ExpeditionEquipIndication.Builder indication = Expedition.ExpeditionEquipIndication.newBuilder();
|
||||
|
|
|
@ -52,6 +52,10 @@ public class Cmd_addholy extends GmRoleAbstract{
|
|||
effectItems.put(sExpeditionHolyConfig.geteffect(),sExpeditionHolyConfig);
|
||||
}
|
||||
}
|
||||
//添加专属英雄圣物缓存
|
||||
if(sExpeditionHolyConfig.getHeroId() > 0){
|
||||
expeditionManager.getHeroItems().put(sExpeditionHolyConfig.getHeroId(),sExpeditionHolyConfig);
|
||||
}
|
||||
|
||||
//notify client
|
||||
Expedition.ExpeditionEquipIndication.Builder indication = Expedition.ExpeditionEquipIndication.newBuilder();
|
||||
|
|
|
@ -32,6 +32,10 @@ public class ExpeditionItem extends MongoBase {
|
|||
|
||||
private int isLocked;
|
||||
|
||||
private int countVictory;
|
||||
|
||||
private int judgePen;
|
||||
|
||||
public ExpeditionItem(String id, int equipId, int level, String heroId, Map<Integer, Integer> propertyValueByIdMap, Map<Integer, Integer> secondValueByIdMap, int createTime, int skill, int isLocked) {
|
||||
this.id = id;
|
||||
this.equipId = equipId;
|
||||
|
@ -134,8 +138,41 @@ public class ExpeditionItem extends MongoBase {
|
|||
return isLocked;
|
||||
}
|
||||
|
||||
public int getCountVictory() {
|
||||
return countVictory;
|
||||
}
|
||||
|
||||
public void setCountVictory(int countVictory) {
|
||||
this.countVictory = countVictory;
|
||||
}
|
||||
|
||||
public int getJudgePen() {
|
||||
return judgePen;
|
||||
}
|
||||
|
||||
public void setJudgePen(int judgePen) {
|
||||
this.judgePen = judgePen;
|
||||
}
|
||||
|
||||
public void updateIsLocked(int isLocked) {
|
||||
updateString("isLocked", isLocked);
|
||||
this.isLocked = isLocked;
|
||||
}
|
||||
|
||||
public void victory(){
|
||||
if(equipId == 16 || equipId == 17 || equipId == 53 || equipId == 54 ||
|
||||
equipId == 95 || equipId == 96){
|
||||
if(countVictory<5){
|
||||
countVictory++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void usejudgePen(){
|
||||
if(equipId == 79 || equipId == 120){
|
||||
if(judgePen<3){
|
||||
judgePen++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,12 +3,10 @@ package com.ljsd.jieling.logic.dao;
|
|||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import config.SExpeditionHolyConfig;
|
||||
import manager.STableManager;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
|
@ -33,6 +31,8 @@ public class ExpeditionManager extends MongoBase {
|
|||
private int freshTime;//刷新时间
|
||||
@Transient
|
||||
private Map<Integer, SExpeditionHolyConfig> effectItems = new HashMap<>();//圣物叠加 不入库
|
||||
private Map<Integer, SExpeditionHolyConfig> heroItems = new HashMap<>();//英雄专属圣物 不入库
|
||||
private Set<Integer> getHeroSet = new HashSet<>();//招募英雄id组 不入库
|
||||
|
||||
private Map<String, Hero> heroMap = new HashMap<>();
|
||||
private Map<String,PropertyItem> equipMap = new HashMap<>();
|
||||
|
@ -271,4 +271,34 @@ public class ExpeditionManager extends MongoBase {
|
|||
updateString("getHolyTiem" , getHolyTiem);
|
||||
this.getHolyTiem = getHolyTiem;
|
||||
}
|
||||
|
||||
public void victory(){
|
||||
for(ExpeditionItem propertyItem : propertyItems){
|
||||
propertyItem.victory();
|
||||
}
|
||||
}
|
||||
|
||||
public void useJudgePen(){
|
||||
for(ExpeditionItem propertyItem : propertyItems){
|
||||
propertyItem.usejudgePen();
|
||||
}
|
||||
}
|
||||
|
||||
public ExpeditionItem getExpeditionItem(int id){
|
||||
for(ExpeditionItem propertyItem : propertyItems){
|
||||
if(propertyItem.getEquipId() == id){
|
||||
return propertyItem;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Map<Integer, SExpeditionHolyConfig> getHeroItems() {
|
||||
return heroItems;
|
||||
}
|
||||
|
||||
public Set<Integer> getGHeroSet(){
|
||||
return getHeroSet;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -224,21 +224,17 @@ public class BattleNode extends AbstractExpedition {
|
|||
return new HashMap<>();
|
||||
}
|
||||
Map<Integer, Integer> valueMap = new HashMap<>(weight);
|
||||
|
||||
ExpeditionManager expeditionManager = user.getExpeditionManager();
|
||||
// 已拥有的圣物
|
||||
Set<ExpeditionItem> items = user.getExpeditionManager().getPropertyItems();
|
||||
Set<ExpeditionItem> items = expeditionManager.getPropertyItems();
|
||||
Set<Integer> ids = new HashSet<>();
|
||||
items.forEach(id->ids.add(id.getEquipId()));
|
||||
|
||||
// 已拥有英雄
|
||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||
Set<Integer> heroIds = new HashSet<>();
|
||||
heroMap.values().forEach(v->heroIds.add(v.getTemplateId()));
|
||||
|
||||
// 大闹天宫临时英雄
|
||||
Map<String, Hero> expeditonHeroMap = user.getExpeditionManager().getHeroMap();
|
||||
Map<String, Hero> expeditonHeroMap = expeditionManager.getHeroMap();
|
||||
Set<Integer> expeditonHeroIds = new HashSet<>();
|
||||
expeditonHeroMap.values().forEach(v->expeditonHeroIds.add(v.getTemplateId()));
|
||||
expeditionManager.getGHeroSet().forEach(v->expeditonHeroIds.add(v));
|
||||
|
||||
// 已生成得节点圣物信息
|
||||
Set<Integer> nodeHolyInfo = getNodeHolyInfo(user);
|
||||
|
@ -255,7 +251,7 @@ public class BattleNode extends AbstractExpedition {
|
|||
}
|
||||
// 不存在的英雄,专属圣物
|
||||
if (holyConfig.getHeroId() != 0){
|
||||
if (!heroIds.contains(holyConfig.getHeroId()) || !expeditonHeroIds.contains(holyConfig.getHeroId())){
|
||||
if (!expeditonHeroIds.contains(holyConfig.getHeroId())){
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,6 +115,8 @@ public class ExpeditionLogic {
|
|||
manager.clearEquipToTemp();
|
||||
manager.clearEquip();//删除多余装备
|
||||
manager.getEffectItems().clear();
|
||||
manager.getHeroItems().clear();
|
||||
manager.getGHeroSet().clear();
|
||||
manager.setFreshTime((int)(openTimeOfFuntionCacheByType.getStartTime()/1000));
|
||||
SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.Expedition.getFunctionType());
|
||||
|
||||
|
@ -816,6 +818,8 @@ public class ExpeditionLogic {
|
|||
StringBuilder skillSb = new StringBuilder();
|
||||
StringBuilder propertySb = new StringBuilder();
|
||||
HeroLogic.getInstance().getHeroSkills(user,hero,skillSb);
|
||||
//处理圣物英雄技能
|
||||
disposeWithHeroHoly(user,hero,skillSb);
|
||||
|
||||
if(teamId==GlobalsDef.EXPEDITION_TEAM){
|
||||
ExpeditionManager expeditionManager = user.getExpeditionManager();
|
||||
|
@ -889,4 +893,34 @@ public class ExpeditionLogic {
|
|||
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理圣物英雄技能
|
||||
*/
|
||||
private static void disposeWithHeroHoly(User user,Hero hero,StringBuilder skillSb){
|
||||
SExpeditionHolyConfig con = user.getExpeditionManager().getHeroItems().get(hero.getTemplateId());
|
||||
if( con != null ){
|
||||
int[][] skillModify = con.getSkillModify();
|
||||
for(int i = 0 ; i < skillModify.length ; i++){
|
||||
int star = skillModify[i][0];
|
||||
if(hero.getStar() < star){
|
||||
continue;
|
||||
}
|
||||
int oper = skillModify[i][1];
|
||||
if(oper == 1 || oper == 2){
|
||||
String beReplace = skillModify[i][2]+"";
|
||||
String replace = skillModify[i][3]+"";
|
||||
int index = skillSb.indexOf(beReplace);
|
||||
if(index!=-1){
|
||||
skillSb.replace(index,index+beReplace.length(),replace);
|
||||
}
|
||||
}else if(oper == 3){
|
||||
int add = skillModify[i][3];
|
||||
skillSb.append(add).append("#");
|
||||
}else{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,10 @@ import java.util.Set;
|
|||
* 5:神秘药水使用次数
|
||||
*/
|
||||
public class ExpetionSpecialProcessor implements SpecialBuildProcessor{
|
||||
private final int HP_INCREASE = 16;
|
||||
private final int DAMAGE_INCREASE = 17;
|
||||
private final int HOLY_INCREASE = 35;
|
||||
private final int JUDGE_INCREASE = 43;
|
||||
@Override
|
||||
public String getSpecialParm(User user) {
|
||||
Map<Integer, SExpeditionHolyConfig> config = STableManager.getConfig(SExpeditionHolyConfig.class);
|
||||
|
@ -28,36 +32,48 @@ public class ExpetionSpecialProcessor implements SpecialBuildProcessor{
|
|||
ExpeditionManager expeditionManager = user.getExpeditionManager();
|
||||
Set<ExpeditionItem> propertyItems = user.getExpeditionManager().getPropertyItems();
|
||||
propertyItems.forEach(e->{
|
||||
int type = config.get(e.getEquipId()).gettype();
|
||||
//掉落战力品
|
||||
if( type == 2 || type == 3){
|
||||
cache.put(type,cache.getOrDefault(type,0) + 1);
|
||||
}
|
||||
//夜明珠
|
||||
if(e.getEquipId() == 35){
|
||||
if(e.getEquipId() == HOLY_INCREASE){
|
||||
cache.put(e.getEquipId(),cache.getOrDefault(e.getEquipId(),0) + 1);
|
||||
}
|
||||
});
|
||||
result.append("1#");
|
||||
result.append(cache.getOrDefault(35,0));
|
||||
// result.append(expeditionManager.getLay());
|
||||
result.append("|2#");
|
||||
if(expeditionManager.getExpeditionLeve()>3||expeditionManager.getExpeditionLeve()<1){
|
||||
result.append(3);
|
||||
}else {
|
||||
result.append(expeditionManager.getExpeditionLeve());
|
||||
SExpeditionHolyConfig con35 = expeditionManager.getEffectItems().get(HOLY_INCREASE);
|
||||
if(con35 != null){
|
||||
result.append(con35.getPassiveSkillId()+"#");
|
||||
result.append(cache.getOrDefault(HOLY_INCREASE,0));
|
||||
// result.append(expeditionManager.getGetHolyTiem());
|
||||
}
|
||||
//每场战斗胜利增加生命上限
|
||||
SExpeditionHolyConfig con16 = expeditionManager.getEffectItems().get(HP_INCREASE);
|
||||
if(con16 != null){
|
||||
if(result.length()>0){
|
||||
result.append("|");
|
||||
}
|
||||
result.append(con16.getPassiveSkillId()+"#");
|
||||
ExpeditionItem item = expeditionManager.getExpeditionItem(con16.getId());
|
||||
result.append(item==null?0:item.getCountVictory());
|
||||
}
|
||||
//每场战斗胜利增加攻击力
|
||||
SExpeditionHolyConfig con17 = expeditionManager.getEffectItems().get(DAMAGE_INCREASE);
|
||||
if(con17 != null){
|
||||
if(result.length()>0){
|
||||
result.append("|");
|
||||
}
|
||||
result.append(con17.getPassiveSkillId()+"#");
|
||||
ExpeditionItem item = expeditionManager.getExpeditionItem(con17.getId());
|
||||
result.append(item==null?0:item.getCountVictory());
|
||||
}
|
||||
//每使用一次判官笔
|
||||
expeditionManager.getEffectItems().get(JUDGE_INCREASE);
|
||||
SExpeditionHolyConfig con43 = expeditionManager.getEffectItems().get(JUDGE_INCREASE);
|
||||
if(con43 != null){
|
||||
if(result.length()>0){
|
||||
result.append("|");
|
||||
}
|
||||
result.append(con43.getPassiveSkillId()+"#");
|
||||
ExpeditionItem item = expeditionManager.getExpeditionItem(con43.getId());
|
||||
result.append(item==null?0:item.getJudgePen());
|
||||
}
|
||||
result.append("|3#");
|
||||
result.append(cache.getOrDefault(2,0));
|
||||
result.append("|4#");
|
||||
result.append(cache.getOrDefault(3,0));
|
||||
result.append("|5#");
|
||||
//* 5:神秘药水使用次数
|
||||
result.append(expeditionManager.getReliveItemTime());
|
||||
result.append("|6#");
|
||||
//* 6:获得圣物的次数
|
||||
result.append(expeditionManager.getGetHolyTiem());
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1880,7 +1880,9 @@ public class HeroLogic{
|
|||
ExpeditionManager expeditionManager = user.getExpeditionManager();
|
||||
Set<SExpeditionHolyConfig> expeditionHolyConfigs = ExpeditionLogic.getFirstRankHoly(expeditionManager);
|
||||
for (SExpeditionHolyConfig config:expeditionHolyConfigs) {
|
||||
heroSkillList.add(config.getPassiveSkillId());
|
||||
if(config.getPassiveSkillId()>0){
|
||||
heroSkillList.add(config.getPassiveSkillId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1893,7 +1895,6 @@ public class HeroLogic{
|
|||
passiveskillCalEnum.getPassiveSkillProcessor().process(config,hero,heroSkillAdMap);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue