Merge branch 'master_test_gn' into master_prb_gn
commit
01989a261d
|
@ -9,6 +9,7 @@ import com.ljsd.jieling.globals.BIReason;
|
|||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hardStage.HardStageLogic;
|
||||
import com.ljsd.jieling.logic.mission.*;
|
||||
import com.ljsd.jieling.logic.mission.event.MissionEventDistributor;
|
||||
import com.ljsd.jieling.logic.mission.main.*;
|
||||
|
@ -585,8 +586,19 @@ public class UserMissionManager extends MongoBase {
|
|||
//缥缈之旅
|
||||
if(!mistyTripMissionType.getDoingMissionIds().isEmpty() ){
|
||||
|
||||
Map<Integer, SEndlessTask> endlessConfig = STableManager.getConfig(SEndlessTask.class);
|
||||
if(endlessConfig!=null&&endlessConfig.size()!=0){
|
||||
Map<Integer, SEndlessTask> config = STableManager.getConfig(SEndlessTask.class);
|
||||
if(config!=null&&config.size()!=0){
|
||||
int starSum = HardStageLogic.getHardStageStarsSum(user);
|
||||
if(starSum != 0 && mistyTripCumulationData.getHardstage_stars() == 0){
|
||||
mistyTripCumulationData.setHardstage_stars(starSum);
|
||||
}
|
||||
if(treasureWeekCumulationData.expeditinoTimes!= 0 && mistyTripCumulationData.expeditinoTimes == 0){
|
||||
mistyTripCumulationData.expeditinoTimes = treasureWeekCumulationData.expeditinoTimes;
|
||||
}
|
||||
if(sevenHappyCumulationData.expeditinoTimes!= 0 && sevenHappyCumulationData.expeditinoTimes == 0){
|
||||
mistyTripCumulationData.expeditinoTimes = sevenHappyCumulationData.expeditinoTimes;
|
||||
}
|
||||
|
||||
CumulationData.Result result= mistyTripCumulationData.updateData(missionType, parm);
|
||||
if(result!=null){
|
||||
mistyTripMissionType.calCumulationDataResult(user,result,missionTypeEnumListMap.get(GameMisionType.MISTY_TRIP_MISSION),mistyTripCumulationData);
|
||||
|
|
|
@ -417,6 +417,8 @@ public class HeroLogic{
|
|||
if (scHero.getStar() < 5){
|
||||
return item;
|
||||
}
|
||||
|
||||
/* ======================= 中不中心愿 ======================= */
|
||||
// 随机权重
|
||||
int totalNum = 10000;
|
||||
int anInt = MathUtils.randomInt(totalNum);
|
||||
|
@ -424,24 +426,37 @@ public class HeroLogic{
|
|||
int value = SSpecialConfig.getIntegerValue(SSpecialConfig.CARDWISHBLOCKRATE);
|
||||
// 获取玩家现在的心愿格子信息
|
||||
Map<Integer, WishDrawCardInfo> cardInfoMap = user.getHeroManager().getWishDrawCardInfoMap();
|
||||
// 中将权重值
|
||||
int weight = cardInfoMap.size() * value;
|
||||
// 未中奖
|
||||
if (anInt > weight){
|
||||
return item;
|
||||
}
|
||||
|
||||
/*======================== 中心愿随机奖励 ========================*/
|
||||
|
||||
// 计算权重map
|
||||
HashMap<Integer, Integer> map = new HashMap<>(4);
|
||||
HashMap<Integer, Integer> map = new HashMap<>();
|
||||
for (Integer key : cardInfoMap.keySet()) {
|
||||
if (cardInfoMap.get(key).getStatus() == 1){
|
||||
// 已经抽中得格子去除
|
||||
totalNum-=value;
|
||||
weight-=value;
|
||||
continue;
|
||||
}
|
||||
map.put(key,value);
|
||||
}
|
||||
|
||||
// 全部抽中
|
||||
if (map.isEmpty() || weight == 0){
|
||||
return item;
|
||||
}
|
||||
|
||||
int sum = map.values().stream().mapToInt(Integer::intValue).sum();
|
||||
// 这里添加得是空格子, key随便填,只要不和之前重复既可. 目前用的总权重数负值当key
|
||||
map.put(-totalNum,totalNum-sum);
|
||||
int randomInt = MathUtils.randomInt(sum);
|
||||
|
||||
// 遍历权重
|
||||
for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
|
||||
if (anInt <= entry.getValue()){
|
||||
if (randomInt <= entry.getValue()){
|
||||
// 读取格子信息
|
||||
WishDrawCardInfo cardInfo = cardInfoMap.get(entry.getKey());
|
||||
// null表示未中心愿, 该格子已锁定, 是空格子
|
||||
|
|
Loading…
Reference in New Issue