宝器 每日副本 代码提交

back_recharge
lvxinran 2020-04-27 15:15:58 +08:00
parent 47d60b8588
commit d4a0550657
25 changed files with 543 additions and 39 deletions

View File

@ -82,6 +82,7 @@ public interface GlobalsDef {
int ARENA_PLAYER_TYPE=1;
//队伍
int FORMATION_NORMAL = 1;//主线编队
int TEAM_ARENA_DEFENSE =101;//竞技场防御编队
int TEAM_ARENA_ATTACH =201;//竞技场进攻编队
int ENDLESS_TEAM = 401;//无尽编队

View File

@ -147,7 +147,10 @@ public enum ErrorCode implements IErrorCode {
ALREADY_LIKE(113,"今天已经给他点过赞了"),
RED_PACKAGE_NOT(114,"该红包已不存在"),
NO_FRIEND_APPLY(115,"暂无可添加好友"),
NO_USE_SAME_HERO(116,"不可上阵重复英雄")
NO_USE_SAME_HERO(116,"不可上阵重复英雄"),
DAILY_ALREADY_PASS(117,"已通关,不可重复挑战"),
DAILY_NO_OPEN(118,"进入副本条件不足")
;

View File

@ -168,6 +168,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
.setVipDaily(playerInfoManager.getHadTakeDailyBoxVip())
.setMissingRefreshCount(vipPrivilageValue)
.addAllMonthinfos(PlayerLogic.getInstance().getMonthCardInfo(user))
.addAllDailyChallengeInfo(playerInfoManager.getDailyPass())
.build();
try {
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_PLAYERINFO_RESPONSE_VALUE, getPlayerInfoResponse, true);

View File

@ -38,6 +38,8 @@ public class UseAndPriceItemHandler extends BaseHandler<PlayerInfoProto.UseAndPr
} else if(type==3){
CommonProto.Drop.Builder baseBuilder =ItemLogic.getInstance().decomposeHero(iSession,heroIdsList,null, MessageTypeProto.MessageType.USER_AND_PRICE_ITEM_RESPONSE_VALUE);
ItemLogic.sendUseAndPriceItemMessage(iSession, MessageTypeProto.MessageType.USER_AND_PRICE_ITEM_RESPONSE_VALUE, baseBuilder);
}else if(type==4){//分解宝器
}
}
}

View File

@ -0,0 +1,27 @@
package com.ljsd.jieling.handler.equip;
import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.logic.item.ItemLogic;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.protocols.PlayerInfoProto;
import org.springframework.stereotype.Component;
/**
* @author lvxinran
* @date 2020/4/26
* @discribe
*/
@Component
public class JewelBuildHandler extends BaseHandler<PlayerInfoProto.JewelBuildRequest> {
@Override
public MessageTypeProto.MessageType getMessageCode() {
return MessageTypeProto.MessageType.JEWEL_BUILD_REQUEST;
}
@Override
public void processWithProto(ISession iSession, PlayerInfoProto.JewelBuildRequest proto) throws Exception {
ItemLogic.getInstance().jewelBuild(iSession,proto.getType(),proto.getId(),proto.getItemList());
}
}

View File

@ -36,6 +36,7 @@ import com.ljsd.jieling.logic.rank.RankContext;
import com.ljsd.jieling.logic.rank.RankEnum;
import com.ljsd.jieling.logic.store.StoreLogic;
import com.ljsd.jieling.logic.store.StoreType;
import com.ljsd.jieling.mission.event.LevelEvent;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.*;
import com.ljsd.jieling.util.*;
@ -2231,6 +2232,7 @@ public class MapLogic {
}
}
user.getUserMissionManager().onGameEvent(user, GameEvent.STORY_FIGHT, fightId,0,1);
// user.getUserMissionManager().gameEvent(user, new LevelEvent(), fightId);
}
public void getMainLevelInfo(ISession session) throws Exception {
@ -3344,4 +3346,76 @@ public class MapLogic {
public Map<Integer, Integer> getDifficultyReward() {
return difficultyReward;
}
public void dailyChallenge(ISession session, int type, int id, MessageTypeProto.MessageType messageType) throws Exception {
User user = UserManager.getUser(session.getUid());
PlayerInfoProto.DailyChallengeResponse.Builder builder= PlayerInfoProto.DailyChallengeResponse.newBuilder();
PlayerManager playerInfoManager = user.getPlayerInfoManager();
//次数校验
SDailyChallengeConfig sDailyChallengeConfig = STableManager.getConfig(SDailyChallengeConfig.class).get(id);
if(sDailyChallengeConfig==null){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
boolean check = PlayerLogic.getInstance().check(user, sDailyChallengeConfig.getPrivilegeId()[1], 1);
if(!check){
throw new ErrorCodeException(ErrorCode.REFRESH_WHEL_TIME_NOT);
}
boolean consumeCount = false;
if(type==1){
if(playerInfoManager.getDailyPass().contains(id)){
throw new ErrorCodeException(ErrorCode.DAILY_ALREADY_PASS);
}
int[][] openRules = sDailyChallengeConfig.getOpenRules();
for(int[] rule:openRules){
boolean open = true;
switch (rule[0]){
case 1:
open = playerInfoManager.getLevel()>=rule[1];
break;
case 2:
open = SMainLevelConfig.biggerThanFight(user.getMainLevelManager().getFightId(),rule[1]);
break;
case 3:
open = playerInfoManager.getMaxForce()>=rule[1];
break;
}
if(!open){
throw new ErrorCodeException(ErrorCode.DAILY_NO_OPEN);
}
}
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), GlobalsDef.FORMATION_NORMAL, 1000, "", GameFightType.DailyChallenge, sDailyChallengeConfig.getMonsterId(), 3);
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
.setFightMaxTime(1000)
.setFightSeed(fightResult.getSeed())
.setHeroFightInfos(fightResult.getFightTeamInfo())
.addAllMonsterList(fightResult.getMonsterTeamList())
.build();
int[] checkResult = fightResult.getCheckResult();
builder.setFightData(fightData);
if(checkResult[0]>0){
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sDailyChallengeConfig.getReward(), 1, 0, 1);
builder.setDrop(drop);
playerInfoManager.addDailyPass(id);
consumeCount = true;
}
}
if(type==2){
if(!playerInfoManager.getDailyPass().contains(id)){
throw new ErrorCodeException(ErrorCode.DAILY_ALREADY_PASS);
}
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sDailyChallengeConfig.getReward(), 1, 0, 1);
builder.setDrop(drop);
consumeCount = true;
}
if(consumeCount){
boolean consume = PlayerLogic.getInstance().checkAndUpdate(user, sDailyChallengeConfig.getPrivilegeId()[1], 1);
if(!consume){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
}
MessageUtil.sendMessage(session,1,messageType.getNumber(),builder.build());
}
}

View File

@ -11,7 +11,7 @@ public class TemporaryItems {
public Map<Integer, Item> items = new HashMap<>();
public Set<Equip> equips = new HashSet<>();
public Set<PropertyItem> equips = new HashSet<>();

View File

@ -0,0 +1,27 @@
package com.ljsd.jieling.handler.map.mapHandler;
import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.handler.map.MapLogic;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.protocols.PlayerInfoProto;
import org.springframework.stereotype.Component;
/**
* @author lvxinran
* @date 2020/4/24
* @discribe
*/
@Component
public class DailyChallengeHandler extends BaseHandler<PlayerInfoProto.DailyChallengeRequest> {
@Override
public MessageTypeProto.MessageType getMessageCode() {
return MessageTypeProto.MessageType.DAILY_CHALLENGE_REQUEST;
}
@Override
public void processWithProto(ISession iSession, PlayerInfoProto.DailyChallengeRequest proto) throws Exception {
MapLogic.getInstance().dailyChallenge(iSession,proto.getType(),proto.getId(), MessageTypeProto.MessageType.DAILY_CHALLENGE_RESPONSE);
}
}

View File

@ -376,9 +376,9 @@ public class ActivityLogic implements IEventHandler{
continue;
}
openNewActivityIds.add(activityId);
for (int shopID : sGlobalActivity.getShopId()) {
checkNeedOpenStore(user,shopID,startTime,endTime);
}
// for (int shopID : sGlobalActivity.getShopId()) {
// checkNeedOpenStore(user,shopID,startTime,endTime);
// }
} else {
long endTime = ToolsUtil.getTimeLong(sGlobalActivity.getStartTimeLong(),sGlobalActivity.getEndTimeLong(),sGlobalActivity.getTime(),userCreateTime, 2);

View File

@ -28,12 +28,12 @@ public class EquipManager extends MongoBase {
this.setRootCollection(User._COLLECTION_NAME);
}
public void addEquip(User user,Equip equip) throws Exception {
public void addEquip(User user,PropertyItem equip) throws Exception {
equip.init(this.getRootId(),getMongoKey() + ".equipMap." + equip.getId());
updateString("equipMap." + equip.getId(), equip);
equipMap.put(equip.getId(),equip);
// addEquipHandBook(equip.getEquipId());
user.getUserMissionManager().onGameEvent(user, GameEvent.GET_EQUIP,equip.getEquipId());
// user.getUserMissionManager().onGameEvent(user, GameEvent.GET_EQUIP,equip.getEquipId());
Poster.getPoster().dispatchEvent(new EquipEvent(user.getId(),equip.getEquipId()));
}

View File

@ -13,8 +13,7 @@ import manager.STableManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
public class Hero extends MongoBase {
@ -46,6 +45,8 @@ public class Hero extends MongoBase {
private int isLock;
private Set<String> jewelInfo;
public Hero(){
//绑定关系
this.setRootCollection(User._COLLECTION_NAME);
@ -73,6 +74,7 @@ public class Hero extends MongoBase {
createTime = (int)(System.currentTimeMillis()/1000);
lastUpdateEnergyTime = createTime;
breakId = 0;
jewelInfo = new HashSet<>(2);
}
@ -221,4 +223,17 @@ public class Hero extends MongoBase {
public int getEspecialEquipLevel() {
return especialEquipLevel;
}
public Set<String> getJewelInfo() {
return jewelInfo;
}
public void addJewel(String jewelId){
jewelInfo.add(jewelId);
updateString("jewelInfo",jewelInfo);
}
public void removeJewel(String jewelId){
jewelInfo.remove(jewelId);
updateString("jewelInfo",jewelInfo);
}
}

View File

@ -1,7 +1,10 @@
package com.ljsd.jieling.logic.dao;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.util.KeyGenUtils;
import com.ljsd.jieling.util.UUIDEnum;
import config.SJewelConfig;
import manager.STableManager;
/**
* @author lvxinran
@ -9,8 +12,31 @@ import com.ljsd.jieling.util.UUIDEnum;
* @discribe
*/
public class Jewel extends PropertyItem {
private int buildLevel;
private int jewelType;
public Jewel(int uid,int jewelId){
super.setId(KeyGenUtils.produceIdByModule(UUIDEnum.EQUIP, uid));
this.setRootCollection(User._COLLECTION_NAME);
super.setId(KeyGenUtils.produceIdByModule(UUIDEnum.JEWEL, uid));
this.setEquipId(jewelId);
this.setJewelType(STableManager.getConfig(SJewelConfig.class).get(jewelId).getLocation());
}
public int getBuildLevel() {
return buildLevel;
}
public void setBuildLevel(int buildLevel) {
this.buildLevel = buildLevel;
}
public int getJewelType() {
return jewelType;
}
public void setJewelType(int jewelType) {
this.jewelType = jewelType;
}
}

View File

@ -99,6 +99,8 @@ public class PlayerManager extends MongoBase {
private Set<Integer> sysMailIds = new CopyOnWriteArraySet<>();
private Set<Integer> dailyPass = new HashSet<>();
public PlayerManager(){
this.setRootCollection(User._COLLECTION_NAME);
}
@ -349,7 +351,14 @@ public class PlayerManager extends MongoBase {
if(config.getContinueTime()!=null){
if(vipInfo.containsKey(privilageId)){
if(config.getContinueTime()[1]==1&&TimeUtils.now()/1000<vipInfo.get(privilageId).getEffectTime()){
return;
if(config.getCondition().length==1&&config.getCondition()[0][0]==0){
return;
}else{
newVipInfo.setEffectTime(vipInfo.get(privilageId).getEffectTime());
vipInfo.put(privilageId,newVipInfo);
updateString("vipInfo", this.vipInfo);
return;
}
}
maxTime = TimeUtils.now()/1000>vipInfo.get(privilageId).getEffectTime()?(TimeUtils.now()/1000):vipInfo.get(privilageId).getEffectTime();
maxTime = maxTime+config.getContinueTime()[0];
@ -632,4 +641,12 @@ public class PlayerManager extends MongoBase {
updateString("monthCardDailyTake",monthCardDailyTake);
}
public Set<Integer> getDailyPass() {
return dailyPass;
}
public void addDailyPass(int passId) {
dailyPass.add(passId);
updateString("dailyPass",dailyPass);
}
}

View File

@ -17,6 +17,7 @@ import com.ljsd.jieling.logic.fight.eventhandler.PVPFightHandler;
* GuildFight(6), // 公会站
* BloodyFight(7), // 血战
* MonterFight(8), // 兽潮
* DailyChallenge(9), //每日挑战
*/
public enum GameFightType {
StoryFight(FightType.StoryFight,new DefaultOfRedisCacheFightHandler(), RedisKey.LEVE_DIFFICULTY_FIGHT),
@ -40,6 +41,7 @@ public enum GameFightType {
GuildFight(FightType.GuildFight,new PVPFightHandler(),null),
GuildBossFight(FightType.GuildBossFight,new DefaultOfRedisCacheFightHandler(),RedisKey.GUILD_MONSTER_FIGHT),
DailyChallenge(FightType.StoryFight,new DefaultWithoutHandFightHandler(),null)
;

View File

@ -126,7 +126,16 @@ public class HeroLogic{
if(type==1){
Map<String, PropertyItem> equipMap = user.getEquipManager().getEquipMap();
for(PropertyItem equipInfo: equipMap.values()){
equipList.add(CBean2Proto.getEquipProto(equipInfo));
if(equipInfo instanceof Equip)
equipList.add(CBean2Proto.getEquipProto(equipInfo));
}
}
//宝器
if(type==4){
Map<String, PropertyItem> equipMap = user.getEquipManager().getEquipMap();
for(PropertyItem equipInfo: equipMap.values()){
if(equipInfo instanceof Jewel)
equipList.add(CBean2Proto.getEquipProto(equipInfo));
}
}
@ -1356,16 +1365,16 @@ public class HeroLogic{
});
//阵营光环加成
if(!isForce){
if(teamId!=0){
int[][] elementEffect = CombatLogic.getInstance().elementEffect(user,teamId);
if (elementEffect!=null&&elementEffect.length>0){
combinedAttribute(elementEffect,heroAllAttribute);
}
if(teamId!=0){
int[][] elementEffect = CombatLogic.getInstance().elementEffect(user,teamId);
if (elementEffect!=null&&elementEffect.length>0){
combinedAttribute(elementEffect,heroAllAttribute);
}
}
//被动技能加成
List<Integer> heroSkillList = CombatLogic.getInstance().passiveskillEffect(user, hero,teamId);
Map<Integer, Integer> heroSkillAdMap = new HashMap<>();
@ -1459,7 +1468,7 @@ public class HeroLogic{
for(Map.Entry<Integer,Integer> item : propertyPercentMap.entrySet()){
Integer propertyId = item.getKey();
Integer propertyValue = heroAllAttribute.get(propertyId);
heroAllAttribute.put(propertyId,BigDecimal.valueOf(propertyValue).multiply(BigDecimal.valueOf(1+item.getValue()/10000f)).intValue());
heroAllAttribute.put(propertyId,BigDecimal.valueOf(propertyValue).multiply(BigDecimal.valueOf(item.getValue()).divide(BigDecimal.valueOf(10000f))).intValue()+propertyValue);
}
Integer maxHp = heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId());
Integer curHp = heroAllAttribute.get(HeroAttributeEnum.CurHP.getPropertyId());
@ -1514,8 +1523,9 @@ public class HeroLogic{
float score = sPropertyConfig.getScore();
result += propertyValue*score;
// LOGGER.info("the propertyId={} the value is ={},propertyValue={},score={}result ={},the value={}",propertyId,propertyValue*score,propertyValue,score,result,propertyValue*score);
LOGGER.info("the propertyId={} the value is ={},propertyValue={},score={}result ={},the value={}",propertyId,propertyValue*score,propertyValue,score,result,propertyValue*score);
}
System.out.println(result);
return (int)result;
}
@ -1578,9 +1588,9 @@ public class HeroLogic{
int uid = session.getUid();
User user = UserManager.getUser(uid);
Hero hero = user.getHeroManager().getHeroMap().get(heroId);
EquipManager equipManager = user.getEquipManager();
if(type==1){
Map<Integer,String> equipInfoTmp = new HashMap<>(6);
EquipManager equipManager = user.getEquipManager();
if(!checkEquipForWear(hero,user.getEquipManager(),equipIds,equipInfoTmp)){
throw new ErrorCodeException(ErrorCode.HERO_EQUIP_ERR);
}
@ -1596,7 +1606,31 @@ public class HeroLogic{
if(equipIds.size()!=1){
throw new ErrorCodeException(ErrorCode.HERO_OPT_ONE);
}else{
checkAllowedOpt(1,user,hero.getStar());
String jId = equipIds.get(0);
Jewel equip =(Jewel)equipManager.getEquipMap().get(jId);
if( null == equip || null == hero ||hero.getJewelInfo().contains(jId)){
throw new ErrorCodeException(ErrorCode.HERO_EQUIP_ERR);
}
String remove = "";
for(String jewelId:hero.getJewelInfo()){
PropertyItem propertyItem = equipManager.getEquipMap().get(jewelId);
if(propertyItem==null){
continue;
}
if(propertyItem instanceof Jewel){
if(equip.getJewelType()==((Jewel) propertyItem).getJewelType()){
remove = propertyItem.getId();
}
}
}
hero.addJewel(jId);
equip.setHeroId(heroId);
if(!StringUtil.isEmpty(remove)){
hero.removeJewel(remove);
}
// checkAllowedOpt(1,user,hero.getStar());
// hero.updateEspecial(equipIds.get(0));
}
}
@ -1619,12 +1653,12 @@ public class HeroLogic{
int uid = session.getUid();
User user = UserManager.getUser(uid);
Hero hero = user.getHeroManager().getHero(heroId);
if( hero == null || equipIds.isEmpty()){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
Map<String, PropertyItem> equipMap = user.getEquipManager().getEquipMap();
if(type==1){
if( hero == null || equipIds.isEmpty()){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
List<Integer> positions = new ArrayList<>();
Map<String, PropertyItem> equipMap = user.getEquipManager().getEquipMap();
for(String equipId : equipIds){
PropertyItem equip = equipMap.get(equipId);
if(null == equip || StringUtil.isEmpty(equip.getHeroId())){
@ -1641,7 +1675,16 @@ public class HeroLogic{
hero.removeEquip(position);
}
}else if(type==2){
// hero.updateEspecial("");
if(equipIds.size()>1){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
String jId = equipIds.get(0);
if(!hero.getJewelInfo().contains(jId)||equipMap.get(jId)==null){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
equipMap.get(jId).setHeroId("");
hero.removeJewel(jId);
}
//发送成功消息

View File

@ -536,4 +536,35 @@ public class ItemLogic {
).forEach(stringEquipEntry -> equiplist.add(stringEquipEntry.getKey()));
return equiplist;
}
public void jewelBuild(ISession iSession,int type,String jId,List<String> items) throws Exception {
User user = UserManager.getUser(iSession.getUid());
PropertyItem propertyItem = user.getEquipManager().getEquipMap().get(jId);
if(propertyItem==null||!(propertyItem instanceof Jewel)){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
Jewel jewel = (Jewel) propertyItem;
int equipId = jewel.getEquipId();
SJewelConfig config = STableManager.getConfig(SJewelConfig.class).get(equipId);
if(config==null){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
if(type==1){//强化
if(jewel.getLevel()>=config.getMax()[0]){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
}else{//精炼
}
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.JEWEL_BUILD_RESPONSE_VALUE,null,true);
}
}

View File

@ -266,6 +266,7 @@ public class PlayerLogic {
User user = UserManager.getUser(uid);
if(user.getTeamPosManager().getTeamPosForHero().containsKey(teamId)){
int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, teamId, false);
System.out.println(teamForce);
if(user.getPlayerInfoManager().getMaxForce() < teamForce){
user.getPlayerInfoManager().setMaxForce(teamForce);
Poster.getPoster().dispatchEvent(new UserForceChangeEvent(uid,teamForce));

View File

@ -107,6 +107,7 @@ public class CBean2Proto {
.setEspecialEquipLevel(hero.getEspecialEquipLevel())
.addAllSoulPos(soulPoss)
.setLockState(hero.getIsLock())
.addAllJewels(hero.getJewelInfo())
.build();
}
@ -154,6 +155,11 @@ public class CBean2Proto {
.setRebuildLevel(tempEquip.getRebuildLevel())
.setSkillId(tempEquip.getSkill());
}
if(equip instanceof Jewel){
Jewel tempEquip =(Jewel)equip;
equipProto.setRebuildLevel(tempEquip.getBuildLevel())
.setExp(tempEquip.getLevel());
}
return equipProto.build();
}
@ -164,7 +170,7 @@ public class CBean2Proto {
for (Item item : temporaryItems.items.values()) {
drop.addItemlist(getItem(item,-1));
}
for (Equip equip : temporaryItems.equips) {
for (PropertyItem equip : temporaryItems.equips) {
drop.addEquipId(getEquipProto(equip));
}

View File

@ -725,7 +725,7 @@ public class ItemUtil {
sendToFront.add(CBean2Proto.getItem(item,-1));
LOGGER.info("the uid={},the curMapId={},add item={},addItemNum={},totalItemNum={}",user.getId(),user.getMapManager().getCurMapId(),entry.getKey(),entry.getValue(),item.getItemNum());
}
Set<Equip> equips = temporaryItems.equips;
Set<PropertyItem> equips = temporaryItems.equips;
for (Map.Entry<Integer, Integer> entry : equipMap.entrySet()) {
SEquipConfig sEquipConfig = STableManager.getConfig(SEquipConfig.class).get(entry.getKey());
@ -761,7 +761,7 @@ public class ItemUtil {
*/
public static void addTemporaryItemToBag(User user, TemporaryItems temporaryItems, boolean isVictory) throws Exception {
Map<Integer, Item> items = temporaryItems.items;
Set<Equip> equips = temporaryItems.equips;
Set<PropertyItem> equips = temporaryItems.equips;
if (items.isEmpty() && equips.isEmpty()) {
return;
}
@ -807,7 +807,7 @@ public class ItemUtil {
if(!sendToFront.isEmpty()){
MessageUtil.sendBagIndication(user.getId(),0,sendToFront);
}
for(Equip equip:equips){
for(PropertyItem equip:equips){
equipsToBag(user,isVictory,equip,rewardStr);
}
@ -840,7 +840,7 @@ public class ItemUtil {
return;
}
if(equip instanceof Equip){
equipManager.addEquip(user,(Equip)equip);
equipManager.addEquip(user,equip);
}
KtEventUtils.onKtEvent(user, ParamEventBean.UserItemEvent,BIReason.TEMPORARY_REWARD,GlobalsDef.addReason,sItem.getId(),1,-1);
@ -951,6 +951,7 @@ public class ItemUtil {
List<Integer> filter = new ArrayList<>();
filter.add(GlobalItemType.EQUIP);
filter.add(GlobalItemType.ESPECIAL_EQUIP);
filter.add(GlobalItemType.JEWEL);
SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting();
int hasEquipNum = user.getEquipManager().getEquipMap().size();
@ -1031,6 +1032,12 @@ public class ItemUtil {
equipList.add(CBean2Proto.getEquipProto(equip));
msgTem="lamp_lottery_equip_content";
}
if(itemType==GlobalItemType.JEWEL){
Jewel equip = new Jewel(user.getId(),equipId);
equipManager.addEquip(user,equip);
equipList.add(CBean2Proto.getEquipProto(equip));
msgTem="lamp_lottery_equip_content";
}
if (item.getQuantity() >= SSpecialConfig.getIntegerValue(msgTem+"_parm")) {
String nickName = user.getPlayerInfoManager().getNickName();
String message = SErrorCodeEerverConfig.getI18NMessage(msgTem, new Object[]{nickName, equipQulityNameMap.get(item.getQuantity()), item.getName()});

View File

@ -10,7 +10,8 @@ public enum UUIDEnum {
ESPECIAL_EQUIP(6),
SOUL_EQUIP(7),//魂印
CDK(8),//cdk
EXPEDITION(9)//圣物
EXPEDITION(9),//圣物
JEWEL(10)
;
private int value;

View File

@ -0,0 +1,53 @@
package config;
import manager.STableManager;
import manager.Table;
import java.util.Map;
@Table(name ="DailyChallengeConfig")
public class SDailyChallengeConfig implements BaseConfig {
private int id;
private int type;
private int[][] openRules;
private int[] reward;
private int monsterId;
private int[] privilegeId;
@Override
public void init() throws Exception {
}
public int getId() {
return id;
}
public int getType() {
return type;
}
public int[][] getOpenRules() {
return openRules;
}
public int[] getReward() {
return reward;
}
public int getMonsterId() {
return monsterId;
}
public int[] getPrivilegeId() {
return privilegeId;
}
}

View File

@ -0,0 +1,61 @@
package config;
import manager.STableManager;
import manager.Table;
import java.util.Map;
@Table(name ="JewelConfig")
public class SJewelConfig implements BaseConfig {
private int id;
private int location;
private int level;
private int race;
private int levelupPool;
private int rankupPool;
private int[] max;
@Override
public void init() throws Exception {
}
public int getId() {
return id;
}
public int getLocation() {
return location;
}
public int getLevel() {
return level;
}
public int getRace() {
return race;
}
public int getLevelupPool() {
return levelupPool;
}
public int getRankupPool() {
return rankupPool;
}
public int[] getMax() {
return max;
}
}

View File

@ -0,0 +1,69 @@
package config;
import manager.STableManager;
import manager.Table;
import java.util.HashMap;
import java.util.Map;
@Table(name ="JewelRankupConfig")
public class SJewelRankupConfig implements BaseConfig {
private int id;
private int type;
private int level;
private int poolID;
private int[][] property;
private int[][] jewelExpend;
private int[][] upExpend;
private static Map<Integer,Map<Integer,Map<Integer,SJewelRankupConfig>>> rankupMap = new HashMap<>();
@Override
public void init() throws Exception {
Map<Integer, SJewelRankupConfig> configMap = STableManager.getConfig(SJewelRankupConfig.class);
for(SJewelRankupConfig config:configMap.values()){
rankupMap.computeIfAbsent(config.getPoolID(), k -> new HashMap<>());
rankupMap.get(config.getPoolID()).computeIfAbsent(config.getType(),k->new HashMap<>());
rankupMap.get(config.getPoolID()).get(config.getType()).put(config.getLevel(),config);
System.out.println();
}
}
public int getId() {
return id;
}
public int getType() {
return type;
}
public int getLevel() {
return level;
}
public int getPoolID() {
return poolID;
}
public int[][] getProperty() {
return property;
}
public int[][] getJewelExpend() {
return jewelExpend;
}
public int[][] getUpExpend() {
return upExpend;
}
}

View File

@ -0,0 +1,43 @@
package config;
import manager.STableManager;
import manager.Table;
import java.util.Map;
@Table(name ="JewelResonanceConfig")
public class SJewelResonanceConfig implements BaseConfig {
private int id;
private int type;
private int level;
private int[][] property;
@Override
public void init() throws Exception {
}
public int getId() {
return id;
}
public int getType() {
return type;
}
public int getLevel() {
return level;
}
public int[][] getProperty() {
return property;
}
}

View File

@ -16,8 +16,6 @@ public class SPrivilegeTypeConfig implements BaseConfig {
private int[] refreshType;
private int maxTimes;
private int ifFloat;
private int unlockType;
@ -68,10 +66,6 @@ public class SPrivilegeTypeConfig implements BaseConfig {
return refreshType;
}
public int getMaxTimes() {
return maxTimes;
}
public int getIfFloat() {
return ifFloat;
}