跑马灯 & 工坊科技树
parent
aeba5f5237
commit
72bbe0d046
File diff suppressed because it is too large
Load Diff
|
@ -15,6 +15,8 @@ public class SDifferDemonsConfig implements BaseConfig {
|
||||||
|
|
||||||
private int[] comonpentList;
|
private int[] comonpentList;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
public static Map<Integer,SDifferDemonsConfig> sDifferDemonsConfigMap;
|
public static Map<Integer,SDifferDemonsConfig> sDifferDemonsConfigMap;
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,5 +41,7 @@ public class SDifferDemonsConfig implements BaseConfig {
|
||||||
return comonpentList;
|
return comonpentList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -25,6 +25,8 @@ public class SItem implements BaseConfig {
|
||||||
private String resolveReward;
|
private String resolveReward;
|
||||||
private int itemNumlimit;
|
private int itemNumlimit;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
sItemMap = STableManager.getConfig(SItem.class);
|
sItemMap = STableManager.getConfig(SItem.class);
|
||||||
|
@ -93,4 +95,8 @@ public class SItem implements BaseConfig {
|
||||||
public int getItemNumlimit() {
|
public int getItemNumlimit() {
|
||||||
return itemNumlimit;
|
return itemNumlimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ public class SRingFireConfig implements BaseConfig {
|
||||||
|
|
||||||
private int ringId;
|
private int ringId;
|
||||||
|
|
||||||
private String ringQuality;
|
private int ringQuality;
|
||||||
|
|
||||||
private int ringLevel;
|
private int ringLevel;
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ public class SRingFireConfig implements BaseConfig {
|
||||||
return ringId;
|
return ringId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRingQuality() {
|
public int getRingQuality() {
|
||||||
return ringQuality;
|
return ringQuality;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.ljsd.jieling.config;
|
||||||
import com.ljsd.jieling.logic.STableManager;
|
import com.ljsd.jieling.logic.STableManager;
|
||||||
import com.ljsd.jieling.logic.Table;
|
import com.ljsd.jieling.logic.Table;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Table(name ="WorkShopTechnology")
|
@Table(name ="WorkShopTechnology")
|
||||||
|
@ -24,14 +25,30 @@ public class SWorkShopTechnology implements BaseConfig {
|
||||||
|
|
||||||
private int[][] consume;
|
private int[][] consume;
|
||||||
|
|
||||||
public static Map<Integer, SWorkShopTechnology> config;
|
private static Map<Integer,Map<Integer,SWorkShopTechnology>> sWorkTechMapByTechIdAndLevel;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
config = STableManager.getConfig(SWorkShopTechnology.class);
|
Map<Integer, SWorkShopTechnology> config = STableManager.getConfig(SWorkShopTechnology.class);
|
||||||
|
Map<Integer,Map<Integer,SWorkShopTechnology>> sWorkTechMapByTechIdAndLevelTmp = new HashMap<>();
|
||||||
|
for(SWorkShopTechnology sWorkShopTechnology : config.values()){
|
||||||
|
int techId = sWorkShopTechnology.getTechId();
|
||||||
|
int level = sWorkShopTechnology.getLevel();
|
||||||
|
if(!sWorkTechMapByTechIdAndLevelTmp.containsKey(techId)){
|
||||||
|
sWorkTechMapByTechIdAndLevelTmp.put(techId,new HashMap<>());
|
||||||
|
}
|
||||||
|
sWorkTechMapByTechIdAndLevelTmp.get(techId).put(level,sWorkShopTechnology);
|
||||||
|
}
|
||||||
|
sWorkTechMapByTechIdAndLevel =sWorkTechMapByTechIdAndLevelTmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static SWorkShopTechnology getsWorkTechMapByTechIdAndLevel(int techId,int level) {
|
||||||
|
if(!sWorkTechMapByTechIdAndLevel.containsKey(techId)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return sWorkTechMapByTechIdAndLevel.get(techId).get(level);
|
||||||
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
|
|
|
@ -12,7 +12,7 @@ import java.util.*;
|
||||||
|
|
||||||
public class WorkShopController extends MongoBase {
|
public class WorkShopController extends MongoBase {
|
||||||
private Map<Integer, List<Integer>> openBlueStateMap;
|
private Map<Integer, List<Integer>> openBlueStateMap;
|
||||||
private Set<Integer> technologyIds = new HashSet<>();
|
private Map<Integer,Integer> technologyMap = new HashMap<>();
|
||||||
private int workShopLevel;
|
private int workShopLevel;
|
||||||
|
|
||||||
private int workShopExp;
|
private int workShopExp;
|
||||||
|
@ -36,6 +36,11 @@ public class WorkShopController extends MongoBase {
|
||||||
updateString("openBlueStateMap." + type, openBlueStateMap.get(type));
|
updateString("openBlueStateMap." + type, openBlueStateMap.get(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateTechLevel(int techId,int level){
|
||||||
|
this.technologyMap.put(techId,level);
|
||||||
|
updateString("technologyMap." + techId,level);
|
||||||
|
}
|
||||||
|
|
||||||
public int getWorkShopLevel() {
|
public int getWorkShopLevel() {
|
||||||
return workShopLevel;
|
return workShopLevel;
|
||||||
}
|
}
|
||||||
|
@ -76,7 +81,7 @@ public class WorkShopController extends MongoBase {
|
||||||
return cookExp;
|
return cookExp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<Integer> getTechnologyIds() {
|
public Map<Integer, Integer> getTechnologyMap() {
|
||||||
return technologyIds;
|
return technologyMap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -562,6 +562,10 @@ public class HeroLogic {
|
||||||
targetHero.setStarBreakId(scHeroRankUpConfig.getId());
|
targetHero.setStarBreakId(scHeroRankUpConfig.getId());
|
||||||
|
|
||||||
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,null,true);
|
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,null,true);
|
||||||
|
if(targetHero.getStar()>=7){
|
||||||
|
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_hero_content", new Object[]{user.getPlayerInfoManager().getNickName(), scHero.getReadingName(),targetHero.getStar()});
|
||||||
|
ChatLogic.getInstance().sendSysChatMessage(message,Global.DILIGENT,targetHero.getTemplateId(),0,0,0,0,0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1124,7 +1128,6 @@ public class HeroLogic {
|
||||||
int msgId = MessageTypeProto.MessageType.HERO_COMPOSE_RESPONSE_VALUE;
|
int msgId = MessageTypeProto.MessageType.HERO_COMPOSE_RESPONSE_VALUE;
|
||||||
int uid = iSession.getUid();
|
int uid = iSession.getUid();
|
||||||
User user = UserManager.getUser(uid);
|
User user = UserManager.getUser(uid);
|
||||||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
|
||||||
int hasHeroNum = user.getHeroManager().getHeroMap().size();
|
int hasHeroNum = user.getHeroManager().getHeroMap().size();
|
||||||
int itemId = item.getItemId();
|
int itemId = item.getItemId();
|
||||||
int itemNum = item.getItemNum();
|
int itemNum = item.getItemNum();
|
||||||
|
@ -1279,7 +1282,17 @@ public class HeroLogic {
|
||||||
|
|
||||||
//发送成功消息
|
//发送成功消息
|
||||||
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.POKEMON_ADVANCED_RESPONSE_VALUE,null,true);
|
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.POKEMON_ADVANCED_RESPONSE_VALUE,null,true);
|
||||||
|
String message=null;
|
||||||
|
if(pokemon.getAllStage()==1){
|
||||||
|
message = SErrorCodeEerverConfig.getI18NMessage("lamp_activate_differ_golden_content", new Object[]{user.getPlayerInfoManager().getNickName(),sDifferDemonsConfig.getName() });
|
||||||
|
|
||||||
|
}else{
|
||||||
|
message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_differ_golden_content", new Object[]{user.getPlayerInfoManager().getNickName(), sDifferDemonsConfig.getName(),pokemon.getAllStage()});
|
||||||
}
|
}
|
||||||
|
ChatLogic.getInstance().sendSysChatMessage(message,Global.DILIGENT,sDifferDemonsConfig.getId(),0,0,0,0,0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,26 +28,24 @@ public class WorkShopLogic {
|
||||||
|
|
||||||
private WorkShopLogic(){}
|
private WorkShopLogic(){}
|
||||||
|
|
||||||
public void workShopTechnogyLevel(ISession iSession, int id) throws Exception {
|
public void workShopTechnogyLevel(ISession iSession, int techId) throws Exception {
|
||||||
int uid = iSession.getUid();
|
int uid = iSession.getUid();
|
||||||
User user = UserManager.getUser(uid);
|
|
||||||
Set<Integer> technologyIds = user.getWorkShopController().getTechnologyIds();
|
|
||||||
SWorkShopTechnology sWorkShopTechnology = SWorkShopTechnology.config.get(id);
|
|
||||||
int msgId = MessageTypeProto.MessageType.WORKSHOP_TECHNOLOGY_RESPONSE_VALUE;
|
int msgId = MessageTypeProto.MessageType.WORKSHOP_TECHNOLOGY_RESPONSE_VALUE;
|
||||||
if(sWorkShopTechnology.getLevel() != 0){
|
User user = UserManager.getUser(uid);
|
||||||
boolean contains = technologyIds.contains(id);
|
WorkShopController workShopController = user.getWorkShopController();
|
||||||
if(!contains){
|
Map<Integer, Integer> technologyMap = workShopController.getTechnologyMap();
|
||||||
MessageUtil.sendErrorResponse(iSession,0,msgId,"parm is wrong");
|
int oldLevl = 0;
|
||||||
return;
|
if(technologyMap.containsKey(techId)){
|
||||||
|
oldLevl = technologyMap.get(techId);
|
||||||
}
|
}
|
||||||
}
|
SWorkShopTechnology sWorkShopTechnology = SWorkShopTechnology.getsWorkTechMapByTechIdAndLevel(techId, oldLevl + 1);
|
||||||
sWorkShopTechnology = SWorkShopTechnology.config.get(id + 1);
|
|
||||||
if(sWorkShopTechnology == null){
|
if(sWorkShopTechnology == null){
|
||||||
MessageUtil.sendErrorResponse(iSession,0,msgId,"parm is wrong");
|
MessageUtil.sendErrorResponse(iSession,0,msgId,"maxLevel");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
workShopController.updateTechLevel(techId,oldLevl + 1);
|
||||||
int[][] consume = sWorkShopTechnology.getConsume();
|
int[][] consume = sWorkShopTechnology.getConsume();
|
||||||
boolean enough = ItemUtil.itemCost(user, consume, BIReason.WORKSHOP_TECHNOLOGY_CONSUME, id + 1);
|
boolean enough = ItemUtil.itemCost(user, consume, BIReason.WORKSHOP_TECHNOLOGY_CONSUME, sWorkShopTechnology.getId());
|
||||||
if(!enough){
|
if(!enough){
|
||||||
MessageUtil.sendErrorResponse(iSession,0,msgId,"道具不足");
|
MessageUtil.sendErrorResponse(iSession,0,msgId,"道具不足");
|
||||||
return;
|
return;
|
||||||
|
@ -245,7 +243,7 @@ public class WorkShopLogic {
|
||||||
CommonProto.Equip equipProto = CBean2Proto.getEquipProto(unDetermined);
|
CommonProto.Equip equipProto = CBean2Proto.getEquipProto(unDetermined);
|
||||||
builder.setUnDetermined(equipProto);
|
builder.setUnDetermined(equipProto);
|
||||||
}
|
}
|
||||||
builder.addAllTechnologyId(workShopController.getTechnologyIds());
|
builder.addAllTechnologyInfo(CBean2Proto.getTechInfo(workShopController.getTechnologyMap()));
|
||||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.GET_WORKSHOP_INFO_RESPONSE_VALUE,builder.build(),true);
|
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.GET_WORKSHOP_INFO_RESPONSE_VALUE,builder.build(),true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -287,4 +287,14 @@ public class CBean2Proto {
|
||||||
public static CommonProto.RingFireInfo getRingFire(Pokemon pokemon) {
|
public static CommonProto.RingFireInfo getRingFire(Pokemon pokemon) {
|
||||||
return CommonProto.RingFireInfo.newBuilder().addAllComonpentId(pokemon.getComonpentsLevelMap().keySet()).setStage(pokemon.getAllStage()).setId(pokemon.getId()).build();
|
return CommonProto.RingFireInfo.newBuilder().addAllComonpentId(pokemon.getComonpentsLevelMap().keySet()).setStage(pokemon.getAllStage()).setId(pokemon.getId()).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<CommonProto.TechnologyInfo> getTechInfo(Map<Integer,Integer> techInfoMap){
|
||||||
|
List<CommonProto.TechnologyInfo> result = new ArrayList<>(techInfoMap.size());
|
||||||
|
for(Map.Entry<Integer,Integer> item : techInfoMap.entrySet()){
|
||||||
|
result.add(CommonProto.TechnologyInfo.newBuilder().setTechId(item.getKey()).setLevle(item.getValue()).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,12 +24,16 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
public class ItemUtil {
|
public class ItemUtil {
|
||||||
private static Map<Integer,String> dropRewardMap = new ConcurrentHashMap<>();
|
private static Map<Integer,String> dropRewardMap = new ConcurrentHashMap<>();
|
||||||
|
private static Map<Integer,String> equipQulityNameMap = new HashMap<>(2);
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(ItemUtil.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(ItemUtil.class);
|
||||||
private static Set<Integer> notDelete = new HashSet<>();
|
private static Set<Integer> notDelete = new HashSet<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
notDelete.add(Global.STAMINA);
|
notDelete.add(Global.STAMINA);
|
||||||
notDelete.add(Global.HEROSTORY_TICKET);
|
notDelete.add(Global.HEROSTORY_TICKET);
|
||||||
notDelete.add(Global.GENERALSTORY_TICKET);
|
notDelete.add(Global.GENERALSTORY_TICKET);
|
||||||
|
equipQulityNameMap.put(5,"传说");
|
||||||
|
equipQulityNameMap.put(6,"史诗");
|
||||||
}
|
}
|
||||||
|
|
||||||
//指定道具掉落(如:邮件,初始化物品)
|
//指定道具掉落(如:邮件,初始化物品)
|
||||||
|
@ -393,6 +397,11 @@ public class ItemUtil {
|
||||||
if (entry.getKey() == Global.STAMINA){
|
if (entry.getKey() == Global.STAMINA){
|
||||||
LOGGER.info("增加的=========num={}, 操作后={}, 时间={}",itemNum,user.getItemManager().getItemMap().get(Global.STAMINA).getItemNum(),user.getItemManager().getItemMap().get(Global.STAMINA).getEndingTime());
|
LOGGER.info("增加的=========num={}, 操作后={}, 时间={}",itemNum,user.getItemManager().getItemMap().get(Global.STAMINA).getItemNum(),user.getItemManager().getItemMap().get(Global.STAMINA).getEndingTime());
|
||||||
}
|
}
|
||||||
|
if(sItem.getItemType() == GlobalItemType.POKENMON_COMONPENT){
|
||||||
|
String nickName = user.getPlayerInfoManager().getNickName();
|
||||||
|
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_differ_content", new Object[]{nickName,sItem.getName()});
|
||||||
|
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,sItem.getId(),0,0,0,0,0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (dropBuilder != null) {
|
if (dropBuilder != null) {
|
||||||
dropBuilder.addAllItemlist(itemProtoList);
|
dropBuilder.addAllItemlist(itemProtoList);
|
||||||
|
@ -651,6 +660,13 @@ public class ItemUtil {
|
||||||
Equip equip = new Equip(user.getId(),equipId);
|
Equip equip = new Equip(user.getId(),equipId);
|
||||||
equipManager.addEquip(user,equip);
|
equipManager.addEquip(user,equip);
|
||||||
equipList.add(CBean2Proto.getEquipProto(equip));
|
equipList.add(CBean2Proto.getEquipProto(equip));
|
||||||
|
SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigById(equipId);
|
||||||
|
if (sEquipConfig.getQuality() >= 5) {
|
||||||
|
String nickName = user.getPlayerInfoManager().getNickName();
|
||||||
|
|
||||||
|
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_equip_content", new Object[]{nickName, equipQulityNameMap.get(sEquipConfig.getQuality()),SItem.getsItemMap().get(equipId).getName()});
|
||||||
|
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,equipId,0,0,0,0,0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue