魂印过滤及日常刷新
parent
171d86addf
commit
ab8815cfcd
|
@ -15,8 +15,8 @@ public interface Global {
|
|||
int CHANGENAME = 64; // 改名卡
|
||||
int EXP = 17;//经验
|
||||
int TREASURE_SCORE = 68;//孙龙宝藏积分
|
||||
int DAILY_TASK_REMOVE_ITEM = 30;//日常任务道具
|
||||
|
||||
int DAILY_TASK_REMOVE_ITEM = 30;//日常任务道具
|
||||
int MISSING_ROOM_ITEM = 79;
|
||||
int SEND_CARD_COUNT = 20; // 每页发送卡牌个数
|
||||
int SEND_ITEM_COUNT = 200; // 每页发送道具个数
|
||||
|
|
|
@ -80,7 +80,8 @@ public class Hero extends MongoBase {
|
|||
}
|
||||
|
||||
this.equipByPositionMap = new HashMap<>();
|
||||
this.soulEquipByPositionMap = hero.soulEquipByPositionMap;
|
||||
// this.soulEquipByPositionMap = hero.soulEquipByPositionMap;
|
||||
this.soulEquipByPositionMap = new HashMap<>();
|
||||
this.breakId = hero.breakId;
|
||||
this.createTime = (int)(System.currentTimeMillis()/1000);
|
||||
this.speed = hero.speed;
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.ljsd.jieling.db.redis.RedisKey;
|
|||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
|
||||
import com.ljsd.jieling.logic.GlobalDataManaager;
|
||||
|
@ -26,6 +27,7 @@ import com.ljsd.jieling.logic.store.StoreLogic;
|
|||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.Expedition;
|
||||
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.*;
|
||||
import config.*;
|
||||
|
@ -146,7 +148,7 @@ public class ExpeditionLogic {
|
|||
continue;
|
||||
}
|
||||
if(user.getExpeditionManager().getLay()<=entry.getKey()){//条件未达成
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
itemArrs.add(entry.getValue());
|
||||
}
|
||||
|
@ -235,7 +237,7 @@ public class ExpeditionLogic {
|
|||
//移除已经删除的hero
|
||||
Set<String> removeId = heroHP.keySet().stream().filter(k -> {
|
||||
if(heroMap.keySet().contains(k))
|
||||
return heroMap.get(k).getLevel()<20;
|
||||
return heroMap.get(k).getLevel()<20;
|
||||
if(heroMapTemp.keySet().contains(k))
|
||||
return heroMapTemp.get(k).getLevel()<20;
|
||||
return !heroMap.keySet().contains(k) && !heroMapTemp.keySet().contains(k);
|
||||
|
@ -325,21 +327,21 @@ public class ExpeditionLogic {
|
|||
}
|
||||
Set<ZSetOperations.TypedTuple<String>> typedTuples = RedisUtil.getInstence().rangeByScoreWithScores(RedisKey.AREDEF_TEAM_FORCE_RANK, "", 0, randomForce);
|
||||
|
||||
// if (typedTuples.size() == 0) {
|
||||
//战力没有获取到 从机器人中选
|
||||
// if (typedTuples.size() == 0) {
|
||||
//战力没有获取到 从机器人中选
|
||||
// Set<Integer> set = ArenaLogic.randomRobot(SArenaSetting.getSArenaSetting().getScore(), 1);
|
||||
//// if (set.size() == 0) {
|
||||
//// throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
//// }
|
||||
// int robotId = set.iterator().next();
|
||||
//提前战力排序 支持战力查找机器人
|
||||
int robotId= SArenaRobotStaticConfig.getFloorForce2robotId((int)randomForce);
|
||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(robotId);
|
||||
snapOneFightInfo(nodeInfo, sArenaRobotConfig);
|
||||
// } else {
|
||||
// String serarchIdFromRank = typedTuples.iterator().next().getValue();
|
||||
// snapOneFightInfo(user, nodeInfo, Integer.valueOf(serarchIdFromRank));
|
||||
// }
|
||||
//提前战力排序 支持战力查找机器人
|
||||
int robotId= SArenaRobotStaticConfig.getFloorForce2robotId((int)randomForce);
|
||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(robotId);
|
||||
snapOneFightInfo(nodeInfo, sArenaRobotConfig);
|
||||
// } else {
|
||||
// String serarchIdFromRank = typedTuples.iterator().next().getValue();
|
||||
// snapOneFightInfo(user, nodeInfo, Integer.valueOf(serarchIdFromRank));
|
||||
// }
|
||||
}
|
||||
|
||||
if(nodeInfo.getType()==ExpeditionLogic.NODETYPE_GREED||nodeInfo.getType() ==ExpeditionLogic.NODETYPE_TRY){
|
||||
|
@ -836,14 +838,17 @@ public class ExpeditionLogic {
|
|||
finalstar=50;
|
||||
}
|
||||
SCHero hero1 = SCHero.getsCHero().get(tempid);
|
||||
if (null != hero1) {
|
||||
SCHeroRankUpConfig scHeroRankUpConfig = STableManager.getConfig(SCHeroRankUpConfig.class).get(hero1.getStar());
|
||||
if(null !=scHeroRankUpConfig&&finalstar>scHeroRankUpConfig.getOpenLevel()){
|
||||
finalstar=scHeroRankUpConfig.getOpenLevel();
|
||||
}
|
||||
|
||||
if (hero1 == null) {
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
|
||||
SCHeroRankUpConfig scHeroRankUpConfig = STableManager.getConfig(SCHeroRankUpConfig.class).get(hero1.getStar());
|
||||
if (null != scHeroRankUpConfig && finalstar > scHeroRankUpConfig.getOpenLevel()) {
|
||||
finalstar = scHeroRankUpConfig.getOpenLevel();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//random tempid
|
||||
Hero newHero = new Hero(uid,tempid,finalstar,hero);
|
||||
|
||||
|
@ -867,6 +872,14 @@ public class ExpeditionLogic {
|
|||
PropertyItem propertyItem = user.getEquipManager().getEquipMap().get(jewel);
|
||||
if (propertyItem == null)
|
||||
continue;
|
||||
|
||||
SJewelConfig config = STableManager.getConfig(SJewelConfig.class).get(propertyItem.getEquipId());
|
||||
if(config==null){
|
||||
continue;
|
||||
}
|
||||
if(hero1.getPropertyName()!=config.getRace()){
|
||||
continue;
|
||||
}
|
||||
Jewel j = (Jewel) propertyItem;
|
||||
Jewel newequip = new Jewel(user.getId(), j.getEquipId());
|
||||
|
||||
|
@ -877,6 +890,33 @@ public class ExpeditionLogic {
|
|||
// }
|
||||
newHero.addJewel(newequip.getId());
|
||||
}
|
||||
|
||||
|
||||
Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
|
||||
for (Map.Entry<Integer,Integer> entry:soulEquipByPositionMap.entrySet()) {
|
||||
SEquipConfig sEquipConfig = STableManager.getConfig(SEquipConfig.class).get(entry.getValue());
|
||||
if (sEquipConfig == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Set<Integer> cacheIds = new HashSet<>();
|
||||
int equipId = entry.getValue();
|
||||
if (sEquipConfig.getRangeHeroTids() != null && !sEquipConfig.getRangeHeroTids().contains(tempid)) {
|
||||
continue;
|
||||
}
|
||||
if (sEquipConfig.getLimit() == 1) {
|
||||
user.getHeroManager().getHeroMap().values().forEach(itemHero -> {
|
||||
cacheIds.addAll(itemHero.getSoulEquipByPositionMap().values());
|
||||
});
|
||||
if (cacheIds.contains(equipId)) {
|
||||
cacheIds.add(equipId);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
newHero.updateSoulEquipPositionMap(entry.getKey(),entry.getValue());
|
||||
}
|
||||
|
||||
|
||||
if(isTemp){
|
||||
user.getExpeditionManager().addHeroToTemp(newHero,nodeId);
|
||||
}else {
|
||||
|
|
|
@ -488,7 +488,7 @@ public class MissionLoigc {
|
|||
|
||||
if(missionStateChangeInfos!=null && !missionStateChangeInfos.isEmpty()){
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, missionStateChangeInfos.get(0).getRewwardGroups(), BIReason.TAKE_MISSION_REWARD);
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_TASK_TYPE,missionId,user);
|
||||
// user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_TASK_TYPE,missionId,user);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.MISSION_COMPLETE.getType(),String.valueOf(missionId),type);
|
||||
PlayerInfoProto.TakeMissionRewardResponse build = PlayerInfoProto.TakeMissionRewardResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.TAKE_MISSION_REWARD_RESPONSE_VALUE,build,true);
|
||||
|
|
|
@ -19,7 +19,7 @@ public class DailyTaskManager extends AbstractDataManager{
|
|||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
ItemManager itemManager = ((User)parm[1]).getItemManager();
|
||||
Item item = itemManager.getItem(Global.DAILY_TASK_REMOVE_ITEM);
|
||||
data.setDaily_task_remove_item(Math.max(data.getDaily_task_remove_item(),item.getItemNum()));
|
||||
data.setDaily_task_remove_item(data.getDaily_task_remove_item()+(int)parm[0]);
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
|
|
|
@ -624,6 +624,9 @@ public class ItemUtil {
|
|||
} else if (sItem.getItemType() == GlobalItemType.SOUL_MARK) {
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.GOT_SOUL_MARK, sItem.getId(), itemNum);
|
||||
}
|
||||
if(sItem.getId()==Global.DAILY_TASK_REMOVE_ITEM){
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_TASK_TYPE,itemNum,user);
|
||||
}
|
||||
//日志记录
|
||||
ItemLogic.getInstance().addItemLog(new ItemLog(user.getId(),0,user.getPlayerInfoManager().getLevel(),String.valueOf(TimeUtils.now()),reason,sItem.getId(),itemNum,item.getItemNum()));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue