Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
303749246e
|
@ -34,7 +34,7 @@ public class GetPhoneRewardRequestHandler extends BaseHandler<PlayerInfoProto.Ge
|
|||
rewardIds[0] = reward;
|
||||
int uid = iSession.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user,rewardIds, 1, 1, BIReason.BIND_PHONE);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user,rewardIds, 1, 0, BIReason.BIND_PHONE);
|
||||
if(user.getPlayerInfoManager().getPhoneBindInfo().getState()!=1){
|
||||
throw new ErrorCodeException(ErrorCode.PHONE_GET);
|
||||
}
|
||||
|
|
|
@ -664,8 +664,8 @@ public class ActivityLogic implements IEventHandler{
|
|||
}
|
||||
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(activityId);
|
||||
if(sGlobalActivity.getResetGrade()==0){
|
||||
activityMission.setActivityState(ActivityType.CLOSE_STATE);
|
||||
Poster.getPoster().dispatchEvent(new ActivityStateChangeEvent(uid,activityId,ActivityType.CLOSE_STATE));
|
||||
activityMission.setActivityState(ActivityType.FINISH_STATE);
|
||||
Poster.getPoster().dispatchEvent(new ActivityStateChangeEvent(uid,activityId,ActivityType.FINISH_STATE));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -44,7 +44,7 @@ public class ActivityStateChangeHandler implements IEventHandler {
|
|||
System.out.println("----------------send buy for activity" + sGlobalActivity.getId());
|
||||
System.out.println("----------------send buy for goodsiD" + sGlobalActivity.getCanBuyRechargeId());
|
||||
}
|
||||
}else if(state == ActivityType.CLOSE_STATE){
|
||||
}else if(state == ActivityType.FINISH_STATE){
|
||||
List<SGlobalActivity> sGlobalActivities = SGlobalActivity.sGlobalActivityMapByOpenRules.getOrDefault(3, new ArrayList<>(0));
|
||||
sGlobalActivities.stream().filter(s->s.getOpenRules()[1] == activityId).forEach(s->{
|
||||
ActivityMission activityMissionWillOpen = user.getActivityManager().getActivityMissionMap().get(s.getId());
|
||||
|
|
|
@ -271,6 +271,7 @@ public class CombatLogic {
|
|||
while (timesTemp-->0){
|
||||
ItemUtil.combineReward(user,true,targetMainLevelConfig.getRandomReward(), 1f,randomItemMap,randomCardMap,randomEquipMap,randomRandomMap,BIReason.ADVENTURE_RANDOM_REWARDD);
|
||||
}
|
||||
randomEquipMap = equipAutoCombine(randomEquipMap);
|
||||
ItemUtil.drop(user,baseBuilder,baseItemMap,baseCardMap,baseEquipMap,baseRandomMap,BIReason.ADVENTURE_BASE_REWARD);
|
||||
ItemUtil.drop(user,randomBuilder,randomItemMap,randomCardMap,randomEquipMap,randomRandomMap,BIReason.ADVENTURE_RANDOM_REWARDD);
|
||||
Map<Integer, CommonProto.Drop> result = new HashMap<>(2);
|
||||
|
@ -953,6 +954,8 @@ public class CombatLogic {
|
|||
}
|
||||
ItemUtil.extraAddItem(user,baseItemMap,BIReason.ADVENTURE_BASE_REWARD);
|
||||
ItemUtil.extraAddItem(user,randomItemMap,BIReason.ADVENTURE_RANDOM_REWARDD);
|
||||
//装备合成
|
||||
randomEquipMap = equipAutoCombine(randomEquipMap);
|
||||
if(viewBaseReward){
|
||||
myResult = true;
|
||||
rewardStr = ItemUtil.getReward(baseItemMap, baseCardMap, baseEquipMap, baseRandomMap);
|
||||
|
@ -980,5 +983,48 @@ public class CombatLogic {
|
|||
myResult = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
private static Map<Integer,Integer> equipAutoCombine(Map<Integer,Integer> equipMap){
|
||||
if(equipMap.isEmpty())
|
||||
return equipMap;
|
||||
Map<Integer, SEquipConfig> config = STableManager.getConfig(SEquipConfig.class);
|
||||
Map<Integer,Integer> tempMap = new HashMap<>();
|
||||
for(Map.Entry<Integer,Integer> entry:equipMap.entrySet()) {
|
||||
tempMap.put(entry.getKey(),entry.getValue());
|
||||
}
|
||||
boolean isOver;
|
||||
int count = 0;
|
||||
do {
|
||||
isOver = true;
|
||||
Iterator<Integer> it = equipMap.keySet().iterator();
|
||||
while(it.hasNext()){
|
||||
int key = it.next();
|
||||
int value = equipMap.get(key);
|
||||
SEquipConfig sEquipConfig = config.get(key);
|
||||
if(sEquipConfig==null)
|
||||
continue;
|
||||
int star = sEquipConfig.getStar();
|
||||
SEquipStarsConfig sEquipStarsConfig = STableManager.getConfig(SEquipStarsConfig.class).get(star);
|
||||
int createCount = value / sEquipStarsConfig.getRankupCount();
|
||||
if(createCount==0){
|
||||
continue;
|
||||
}
|
||||
int position = sEquipConfig.getPosition();
|
||||
tempMap.put(key,value%sEquipStarsConfig.getRankupCount());
|
||||
SEquipConfig createConfig = SEquipConfig.positionStarMap.get(position).get(star + 1);
|
||||
|
||||
if(createConfig==null)
|
||||
continue;
|
||||
|
||||
int createId = createConfig.getId();
|
||||
|
||||
tempMap.put(createId,tempMap.getOrDefault(createId,0)+createCount);
|
||||
isOver = false;
|
||||
}
|
||||
equipMap = tempMap;
|
||||
count++;
|
||||
}while(!isOver&&count<5);
|
||||
return equipMap;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,10 +3,7 @@ package config;
|
|||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
@Table(name ="EquipConfig")
|
||||
public class SEquipConfig implements BaseConfig {
|
||||
|
@ -57,10 +54,11 @@ public class SEquipConfig implements BaseConfig {
|
|||
|
||||
private int[] passiveSkill;
|
||||
|
||||
|
||||
public static Map<Integer,Map<Integer,SEquipConfig>> positionStarMap ;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer,Map<Integer,SEquipConfig>> tempMap = new HashMap<>();
|
||||
Map<Integer, SEquipConfig> config = STableManager.getConfig(SEquipConfig.class);
|
||||
config.forEach((k,v)->{
|
||||
if(v.getRange()!=null && v.getRange().length>0 && v.getRange()[0]!=0){
|
||||
|
@ -68,9 +66,12 @@ public class SEquipConfig implements BaseConfig {
|
|||
Arrays.stream(v.getRange()).forEach(e->rangeTemp.add(e));
|
||||
v.setRangeHeroTids(rangeTemp);
|
||||
}
|
||||
|
||||
if(v.getPosition()!=5){
|
||||
tempMap.computeIfAbsent(v.getPosition(),m->new HashMap<>()).put(v.getStar(),v);
|
||||
}
|
||||
|
||||
});
|
||||
positionStarMap = tempMap;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue