魂印掉落
parent
4f9b3404dd
commit
5a05c80ef3
|
@ -34,11 +34,13 @@ public class SEquipSign implements BaseConfig {
|
|||
sEquipSignMap = STableManager.getConfig(SEquipSign.class);
|
||||
|
||||
for (Map.Entry<Integer, SEquipSign> entry : sEquipSignMap.entrySet()) {
|
||||
TreeSet<Integer> treeSet = type2List.getOrDefault(entry.getValue().getType(),new TreeSet<>());
|
||||
treeSet.add(entry.getKey());
|
||||
if(!treeSet.contains(entry.getValue().getType())){
|
||||
type2List.put(entry.getValue().getType(),treeSet);
|
||||
TreeSet<Integer> treeSet = type2List.getOrDefault(entry.getKey()/100,null);
|
||||
if(null==treeSet){
|
||||
treeSet= new TreeSet<>();
|
||||
type2List.put(entry.getKey()/100,treeSet);
|
||||
}
|
||||
treeSet.add(entry.getKey());
|
||||
|
||||
}
|
||||
|
||||
for (TreeSet<Integer> list:type2List.values()) {
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ljsd.jieling.handler.map;
|
|||
import com.ljsd.jieling.logic.dao.Equip;
|
||||
import com.ljsd.jieling.logic.dao.EspecialEquip;
|
||||
import com.ljsd.jieling.logic.dao.Item;
|
||||
import com.ljsd.jieling.logic.dao.SoulEquip;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
@ -17,4 +18,6 @@ public class TemporaryItems {
|
|||
|
||||
public Set<EspecialEquip> especialEquips = new HashSet<>();
|
||||
|
||||
public Set<SoulEquip> soulEquips = new HashSet<>();
|
||||
|
||||
}
|
||||
|
|
|
@ -504,6 +504,7 @@ public class ItemUtil {
|
|||
List<CommonProto.Item> itemProtoList = new ArrayList<>();
|
||||
List<CommonProto.Equip> equipProtoList = new ArrayList<>();
|
||||
List<CommonProto.Equip> especialEquip = new ArrayList<>();
|
||||
List<CommonProto.Equip> soulEquip = new ArrayList<>();
|
||||
MapManager mapManager = user.getMapManager();
|
||||
TemporaryItems temporaryItems = mapManager.getTemporaryItems();
|
||||
if (temporaryItems == null) {
|
||||
|
@ -529,6 +530,7 @@ public class ItemUtil {
|
|||
}
|
||||
Set<Equip> equips = temporaryItems.equips;
|
||||
Set<EspecialEquip> especialEquips = temporaryItems.especialEquips;
|
||||
Set<SoulEquip> soulEquips = temporaryItems.soulEquips;
|
||||
for (Map.Entry<Integer, Integer> entry : equipMap.entrySet()) {
|
||||
SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigById(entry.getKey());
|
||||
if (sEquipConfig == null) {
|
||||
|
@ -538,6 +540,7 @@ public class ItemUtil {
|
|||
especialEquip.add(CBean2Proto.getEquipProto(tempEquip));
|
||||
especialEquips.add(tempEquip);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
Equip equip = new Equip(user.getId(), entry.getKey());
|
||||
|
@ -545,11 +548,24 @@ public class ItemUtil {
|
|||
equipProtoList.add(CBean2Proto.getEquipProto(equip));
|
||||
LOGGER.info("the uid={},the curMapId={},add equip={},equipNum={},totalEquipNum={}",user.getId(),user.getMapManager().getCurMapId(),entry.getKey(),1,equips.size());
|
||||
}
|
||||
|
||||
for (Map.Entry<Integer, Integer> entry : equipMap.entrySet()) {
|
||||
SEquipSign sEquipSign = SEquipSign.getsEquipSignMap().get(entry.getKey()*100+1);
|
||||
if (sEquipSign == null) {
|
||||
continue;
|
||||
}
|
||||
SoulEquip soulEquip1 = new SoulEquip(user.getId(), entry.getKey());
|
||||
soulEquips.add(soulEquip1);
|
||||
equipProtoList.add(CBean2Proto.getEquipProto(soulEquip1));
|
||||
LOGGER.info("the uid={},the curMapId={},add equip={},equipNum={},totalEquipNum={}",user.getId(),user.getMapManager().getCurMapId(),entry.getKey(),1,equips.size());
|
||||
}
|
||||
|
||||
mapManager.setTemporaryItems(temporaryItems);
|
||||
if (dropBuilder != null) {
|
||||
dropBuilder.addAllItemlist(itemProtoList);
|
||||
dropBuilder.addAllEquipId(equipProtoList);
|
||||
dropBuilder.addAllEspecialEquipId(especialEquip);
|
||||
dropBuilder.addAllSoulEquip(soulEquip);
|
||||
}
|
||||
|
||||
if(!sendToFront.isEmpty()){
|
||||
|
@ -743,12 +759,17 @@ public class ItemUtil {
|
|||
if (equipMap.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<Integer> filter = new ArrayList<>();
|
||||
filter.add(GlobalItemType.EQUIP);
|
||||
filter.add(GlobalItemType.ESPECIAL_EQUIP);
|
||||
|
||||
SGameSetting gameSetting = SGameSetting.getGameSetting();
|
||||
int hasEquipNum = user.getEquipManager().getEquipMap().size();
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("equip_bag_limit_title");
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("equip_bag_limit_txt");
|
||||
|
||||
if (hasEquipNum >= gameSetting.getEquipNumlimit()){
|
||||
String reward = getLimitReward(equipMap);
|
||||
String reward = getLimitReward(equipMap,filter);
|
||||
int nowTime =(int) (TimeUtils.now()/1000);
|
||||
MailLogic.getInstance().sendMail(user.getId(),title,content,reward,nowTime,Global.MAIL_EFFECTIVE_TIME);
|
||||
return;
|
||||
|
@ -758,7 +779,7 @@ public class ItemUtil {
|
|||
List<CommonProto.Equip> especialEquip = new CopyOnWriteArrayList<>();
|
||||
for (Map.Entry<Integer, Integer> entry : equipMap.entrySet()) {
|
||||
int itemType = SItem.getsItemMap().get(entry.getKey()).getItemType();
|
||||
if(itemType!=GlobalItemType.EQUIP||itemType!=GlobalItemType.ESPECIAL_EQUIP){
|
||||
if(!filter.contains(itemType)){
|
||||
continue;
|
||||
}
|
||||
int count = entry.getValue();
|
||||
|
@ -790,8 +811,17 @@ public class ItemUtil {
|
|||
}
|
||||
List<CommonProto.Equip> especialEquip = new CopyOnWriteArrayList<>();
|
||||
List<CommonProto.Equip> equipList = new CopyOnWriteArrayList<>();
|
||||
|
||||
// EQUIPSIGN_LIMIT
|
||||
List<Integer> filter = new ArrayList<>();
|
||||
filter.add(GlobalItemType.SOUL_MARK);
|
||||
int limit = SSpecialConfig.getIntegerValue(SSpecialConfig.EQUIPSIGN_LIMIT);
|
||||
if (user.getEquipManager().getSoulEquipMap().size() >=limit){
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("EquipSign_bag_limit_title");
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("EquipSign_bag_limit_txt");
|
||||
String reward = getLimitReward(equipMap,filter);
|
||||
int nowTime =(int) (TimeUtils.now()/1000);
|
||||
MailLogic.getInstance().sendMail(user.getId(),title,content,reward,nowTime,Global.MAIL_EFFECTIVE_TIME);
|
||||
return;
|
||||
}
|
||||
|
||||
for (Map.Entry<Integer, Integer> entry : equipMap.entrySet()) {
|
||||
int itemType = SItem.getsItemMap().get(entry.getKey()).getItemType();
|
||||
|
@ -806,9 +836,14 @@ public class ItemUtil {
|
|||
dropBuilder.addAllSoulEquip(equipList);
|
||||
}
|
||||
|
||||
private static String getLimitReward(Map<Integer, Integer> equipMap) {
|
||||
private static String getLimitReward(Map<Integer, Integer> equipMap,List<Integer> filter) {
|
||||
|
||||
StringBuilder reward = new StringBuilder();
|
||||
for (Map.Entry<Integer, Integer> entry :equipMap.entrySet()){
|
||||
int itemType = SItem.getsItemMap().get(entry.getKey()).getItemType();
|
||||
if(null!=filter&&!filter.contains(itemType)){
|
||||
continue;
|
||||
}
|
||||
for (int i = 0; i < entry.getValue(); i++) {
|
||||
if (reward.length() == 0){
|
||||
reward = new StringBuilder(entry.getKey() + "#1");
|
||||
|
@ -861,7 +896,7 @@ public class ItemUtil {
|
|||
String title = SErrorCodeEerverConfig.getI18NMessage("card_bag_limit_title");
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("card_bag_limit_txt");
|
||||
if (hasHeroNum >= gameSetting.getHeroNumlimit()){
|
||||
String reward = getLimitReward(cardMap);
|
||||
String reward = getLimitReward(cardMap,null);
|
||||
int nowTime =(int) (TimeUtils.now()/1000);
|
||||
MailLogic.getInstance().sendMail(user.getId(),title,content,reward,nowTime,Global.MAIL_EFFECTIVE_TIME);
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue