back_recharge
parent
2cd4efa036
commit
ab1c913e6f
|
@ -59,6 +59,9 @@ public class UpOrDownTransformationHandler extends BaseHandler<HeroInfoProto.UpO
|
|||
if (values[index-1] > practiceLevel){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE,"变身卡位置未解锁,修仙境界不足");
|
||||
}
|
||||
if (index != changingCard.getPosition()){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE,"变身卡位置错误");
|
||||
}
|
||||
// 上阵变身卡
|
||||
for (TransformationInfo value : infoMap.values()) {
|
||||
if (value.getIndex() == index){
|
||||
|
|
|
@ -127,13 +127,12 @@ public interface ActivityType {
|
|||
int JADE_DYNASTY_RARE_SHOP = 20002;//破阵诛仙珍奇宝阁
|
||||
int CHOICE_DRAW_CRAD = 20003;//心愿抽奖(选择抽卡)
|
||||
int LING_LONG_PAVILION = 20005;//玲珑宝阁
|
||||
|
||||
int ENCHANTER_STORE = 20013;//寻仙商城
|
||||
|
||||
int DAILY_SPECIAL = 10004;//每日特惠
|
||||
int WHOLE_LIFE_CARD = 99;//终生卡
|
||||
|
||||
int WEEK_CARD = 102;//月卡
|
||||
int DRAW_LV_CHEST = 117;//抽卡等级宝箱
|
||||
int FABAO_BOOK_REWARD = 118;//法宝图鉴宝箱
|
||||
|
||||
//***************************************bt活动=====================================//
|
||||
|
||||
|
|
|
@ -114,7 +114,10 @@ public enum ActivityTypeEnum {
|
|||
WHOEL_LIFE_ACTIVITY(ActivityType.WHOLE_LIFE_CARD,WholeLifeActivity::new),//终生卡
|
||||
ENCHANTER_STORE(ActivityType.ENCHANTER_STORE,DefaultEmptyActivity::new),//寻仙商城
|
||||
WEEK_CARD(ActivityType.WEEK_CARD,WeekCardActivity::new),//周卡
|
||||
// bt
|
||||
DRAW_LV_CHEST(ActivityType.DRAW_LV_CHEST,DrawLvChestActivity::new),//抽卡等级宝箱
|
||||
// FABAO_BOOK_REWARD(ActivityType.FABAO_BOOK_REWARD,FabaoBookRewardActivity::new),//法宝图鉴宝箱
|
||||
|
||||
/****************************************************** bt **********************************************************/
|
||||
BRUSH_PRIVILEGE(ActivityType.BRUSH_PRIVILEGE, BrushPrivilegeActivity::new),//刷充特权
|
||||
INFINITE_RESOURCES_PAVILION(ActivityType.INFINITE_RESOURCES_PAVILION, InfiniteResourcesPavilionActivity::new),//无限资源阁
|
||||
ALL_PEOPLE_WELFARE(ActivityType.ALL_PEOPLE_WELFARE, AllPeopleWelfareActivity::new),//全民福利
|
||||
|
|
|
@ -0,0 +1,132 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
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.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.activity.activityLogic.WeekCardLogic;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SuperBoxEvent;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.*;
|
||||
import manager.STableManager;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author hj
|
||||
* 超值基金活动新
|
||||
* 2022-1-24
|
||||
*/
|
||||
public class DrawLvChestActivity extends AbstractActivity {
|
||||
|
||||
DrawLvChestActivity(int id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initActivity(User user) throws Exception {
|
||||
ActivityMission mission = new ActivityMission();
|
||||
// 活动信息初始化
|
||||
ActivityLogic.getInstance().initOtherMission(mission, new ArrayList<>());
|
||||
user.getActivityManager().getActivityMissionMap().put(id, mission);
|
||||
LOGGER.info("抽卡等级宝箱...uid={} activityId={}",user.getId(), id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonProto.ActivityInfo.MissionInfo> getAllMissInfo(User user, ActivityMission activityMission, Set<Integer> filter) {
|
||||
List<CommonProto.ActivityInfo.MissionInfo> missionInfo = new ArrayList<>();
|
||||
// 验证活动是否开启
|
||||
if (activityMission == null){
|
||||
return missionInfo;
|
||||
}
|
||||
Map<Integer, SWishConfig> map = SWishConfig.map;
|
||||
int count = user.getHeroManager().getCountByDraw(1);
|
||||
Map<Integer, ActivityProgressInfo> progressInfoMap = activityMission.getActivityMissionMap();
|
||||
for (SWishConfig config : map.values()) {
|
||||
int missionId = config.getId();
|
||||
Integer state = Optional.ofNullable(progressInfoMap.get(missionId)).map(ActivityProgressInfo::getState).orElse(0);
|
||||
// 封装proto并返回
|
||||
CommonProto.ActivityInfo.MissionInfo build = CommonProto.ActivityInfo.MissionInfo.newBuilder()
|
||||
.setMissionId(missionId)
|
||||
.setProgress(count)
|
||||
.setState(state)
|
||||
.build();
|
||||
missionInfo.add(build);
|
||||
}
|
||||
return missionInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean takeReward(ISession session, int missionId) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
// 开始校验数据正确性
|
||||
SWishConfig wishConfig = SWishConfig.map.get(missionId);
|
||||
if (wishConfig == null) {
|
||||
String format = MessageFormat.format("抽卡等级宝箱退出,表数据错误,uid:{0},活动id:{1},档位id:{2}", user.getId(), id, missionId);
|
||||
throw new ErrorCodeException(format);
|
||||
}
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null || mission.getActivityState() != ActivityType.OPEN_STATE){
|
||||
String format = MessageFormat.format("抽卡等级宝箱退出,活动数据未开启,uid:{0},活动id:{1}", user.getId(), id);
|
||||
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN, format);
|
||||
}
|
||||
ActivityProgressInfo progressInfo = mission.getActivityMissionMap().get(missionId);
|
||||
if (progressInfo != null && progressInfo.getState() == ActivityType.HAD_TAKED) {
|
||||
String format = MessageFormat.format("抽卡等级宝箱退出,活动奖励已经领取,uid:{0},活动id:{1},档位id:{2}", user.getId(), id, missionId);
|
||||
throw new ErrorCodeException(ErrorCode.HAD_TAKE_REWARD, format);
|
||||
}
|
||||
if (!checkRewardsProcess(user,wishConfig)) {
|
||||
String format = MessageFormat.format("抽卡等级宝箱退出,未达到领取条件,uid:{0},活动id:{1},档位id:{2}", user.getId(), id, missionId);
|
||||
throw new ErrorCodeException(format);
|
||||
}
|
||||
|
||||
checkAndSetProgress(mission,missionId,ActivityType.HAD_TAKED);
|
||||
// reward
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, wishConfig.getReward(), BIReason.TAKE_ACTIVITY_REWARD);
|
||||
PlayerInfoProto.TakeActivityRewardResponse build = PlayerInfoProto.TakeActivityRewardResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(session, 1, rewardResponseValue, build, true);
|
||||
// 状态推送
|
||||
sendActivityProgress(session, null);
|
||||
// 打点上报
|
||||
reportTakeActivityReward(user,wishConfig.getReward(),missionId);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 领奖后更新奖励进度
|
||||
*/
|
||||
public void checkAndSetProgress(ActivityMission activityMission, int missionId, int state) {
|
||||
ActivityProgressInfo progressInfo = new ActivityProgressInfo();
|
||||
progressInfo.setState(state);
|
||||
activityMission.getActivityMissionMap().put(missionId, progressInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证奖励是否可以领取
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
boolean checkRewardsProcess(User user, SWishConfig config) {
|
||||
int count = user.getHeroManager().getCountByDraw(1);
|
||||
return count >= config.getDrawCardNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkActivityMissionFinishAndTake(int uid, int activityId, ActivityMission activityMission) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SWishConfig;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author hj
|
||||
* 超值基金活动新
|
||||
* 2022-1-24
|
||||
*/
|
||||
public class FabaoBookRewardActivity extends AbstractActivity {
|
||||
|
||||
FabaoBookRewardActivity(int id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initActivity(User user) throws Exception {
|
||||
ActivityMission mission = new ActivityMission();
|
||||
// 活动信息初始化
|
||||
ActivityLogic.getInstance().initOtherMission(mission, new ArrayList<>());
|
||||
user.getActivityManager().getActivityMissionMap().put(id, mission);
|
||||
LOGGER.info("法宝图鉴宝箱...uid={} activityId={}",user.getId(), id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommonProto.ActivityInfo.MissionInfo> getAllMissInfo(User user, ActivityMission activityMission, Set<Integer> filter) {
|
||||
List<CommonProto.ActivityInfo.MissionInfo> missionInfo = new ArrayList<>();
|
||||
// 验证活动是否开启
|
||||
if (activityMission == null){
|
||||
return missionInfo;
|
||||
}
|
||||
Map<Integer, SWishConfig> map = SWishConfig.map;
|
||||
int count = user.getHeroManager().getCountByDraw(1);
|
||||
Map<Integer, ActivityProgressInfo> progressInfoMap = activityMission.getActivityMissionMap();
|
||||
for (SWishConfig config : map.values()) {
|
||||
int missionId = config.getId();
|
||||
Integer state = Optional.ofNullable(progressInfoMap.get(missionId)).map(ActivityProgressInfo::getState).orElse(0);
|
||||
// 封装proto并返回
|
||||
CommonProto.ActivityInfo.MissionInfo build = CommonProto.ActivityInfo.MissionInfo.newBuilder()
|
||||
.setMissionId(missionId)
|
||||
.setProgress(count)
|
||||
.setState(state)
|
||||
.build();
|
||||
missionInfo.add(build);
|
||||
}
|
||||
return missionInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean takeReward(ISession session, int missionId) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
// 开始校验数据正确性
|
||||
SWishConfig wishConfig = SWishConfig.map.get(missionId);
|
||||
if (wishConfig == null) {
|
||||
String format = MessageFormat.format("抽卡等级宝箱退出,表数据错误,uid:{0},活动id:{1},档位id:{2}", user.getId(), id, missionId);
|
||||
throw new ErrorCodeException(format);
|
||||
}
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null || mission.getActivityState() != ActivityType.OPEN_STATE){
|
||||
String format = MessageFormat.format("抽卡等级宝箱退出,活动数据未开启,uid:{0},活动id:{1}", user.getId(), id);
|
||||
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN, format);
|
||||
}
|
||||
ActivityProgressInfo progressInfo = mission.getActivityMissionMap().get(missionId);
|
||||
if (progressInfo != null && progressInfo.getState() == ActivityType.HAD_TAKED) {
|
||||
String format = MessageFormat.format("抽卡等级宝箱退出,活动奖励已经领取,uid:{0},活动id:{1},档位id:{2}", user.getId(), id, missionId);
|
||||
throw new ErrorCodeException(ErrorCode.HAD_TAKE_REWARD, format);
|
||||
}
|
||||
if (!checkRewardsProcess(user,wishConfig)) {
|
||||
String format = MessageFormat.format("抽卡等级宝箱退出,未达到领取条件,uid:{0},活动id:{1},档位id:{2}", user.getId(), id, missionId);
|
||||
throw new ErrorCodeException(format);
|
||||
}
|
||||
// reward
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, wishConfig.getReward(), BIReason.TAKE_ACTIVITY_REWARD);
|
||||
PlayerInfoProto.TakeActivityRewardResponse build = PlayerInfoProto.TakeActivityRewardResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(session, 1, rewardResponseValue, build, true);
|
||||
// 状态推送
|
||||
sendActivityProgress(session, null);
|
||||
// 打点上报
|
||||
reportTakeActivityReward(user,wishConfig.getReward(),missionId);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证奖励是否可以领取
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
boolean checkRewardsProcess(User user, SWishConfig config) {
|
||||
int count = user.getHeroManager().getCountByDraw(1);
|
||||
return count >= config.getDrawCardNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkActivityMissionFinishAndTake(int uid, int activityId, ActivityMission activityMission) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -9,6 +9,7 @@ import com.ljsd.jieling.logic.dao.root.User;
|
|||
import com.ljsd.jieling.logic.hero.HongMengAttributeEnum;
|
||||
import config.SLikeAbilityConfig;
|
||||
import config.SSpecialConfig;
|
||||
import config.SWishConfig;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -246,16 +247,28 @@ public class HeroManager extends MongoBase {
|
|||
return randomCountByType;
|
||||
}
|
||||
|
||||
public void setRandomCountByType(Map<Integer, Integer> randomCountByType) {
|
||||
this.randomCountByType = randomCountByType;
|
||||
updateString("randomCountByType", randomCountByType);
|
||||
}
|
||||
|
||||
public void putRandomType(int type,int value) {
|
||||
randomCountByType.put(type,value);
|
||||
updateString("randomCountByType."+type, value);
|
||||
}
|
||||
|
||||
public int getWeightByDraw(int type){
|
||||
int weight = 0;
|
||||
Map<Integer, SWishConfig> map = SWishConfig.map;
|
||||
Integer count = randomCountByType.getOrDefault(type, 0);
|
||||
for (SWishConfig config : map.values()) {
|
||||
if (count < config.getDrawCardNumber()){
|
||||
break;
|
||||
}
|
||||
weight = config.getWeight();
|
||||
}
|
||||
return weight;
|
||||
}
|
||||
|
||||
public int getCountByDraw(int type){
|
||||
return randomCountByType.getOrDefault(type, 0);
|
||||
}
|
||||
|
||||
public Map<Integer, Map<Integer, Integer>> getWishCountByStar() {
|
||||
return wishCountByStar;
|
||||
}
|
||||
|
|
|
@ -535,54 +535,12 @@ public class HeroLogic {
|
|||
if (scHero == null || scHero.getStar() < 5) {
|
||||
return item;
|
||||
}
|
||||
// 更新抽奖次数, 记录卡池
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
// 获取类型抽奖次数
|
||||
Map<Integer, Integer> randomStar = heroManager.getWishStar(type);
|
||||
// 更新次数
|
||||
int num = heroManager.getWishStar(type).getOrDefault(scHero.getStar(), 0) + 1;
|
||||
randomStar.put(scHero.getStar(), num);
|
||||
heroManager.putWishStar(type, randomStar);
|
||||
/* ======================= 中不中心愿 ======================= */
|
||||
// 获取钻石抽奖抽中五星的次数
|
||||
boolean randomBol = (num - 1) % 5 == 0;
|
||||
LOGGER.info("*************************************是否中心愿;num:{},random:{}", num, randomBol);
|
||||
if (!randomBol) {
|
||||
// 不到次数,不走心愿
|
||||
return item;
|
||||
}
|
||||
/*======================== 中心愿随机奖励 ========================*/
|
||||
// 心愿格子信息
|
||||
HashMap<Integer, WishDrawCardInfo> cardInfoMap = user.getHeroManager().getWishDrawCardInfoMap();
|
||||
// 空格子权重
|
||||
int empty = SSpecialConfig.getIntegerValue(SSpecialConfig.CARDWISHBLOCKRATE);
|
||||
// 计算权重map
|
||||
HashMap<Integer, Integer> map = new HashMap<>();
|
||||
cardInfoMap.forEach((k, v) -> {
|
||||
if (v.getStatus() == 0) {
|
||||
if (v.getHeroTid() == 0) {
|
||||
// 空格子
|
||||
map.put(k, empty);
|
||||
} else {
|
||||
// 英雄格子
|
||||
int heroWeight = Optional.ofNullable(SCHero.getsCHero().get(v.getHeroTid())).map(SCHero::getWeight).orElse(0);
|
||||
map.put(k, heroWeight);
|
||||
}
|
||||
}
|
||||
});
|
||||
// 随机权重
|
||||
int weight = map.values().stream().mapToInt(Integer::intValue).sum();
|
||||
// 全部抽中
|
||||
if (map.isEmpty() || weight <= 0) {
|
||||
return item;
|
||||
}
|
||||
int randomInt = MathUtils.randomInt(weight);
|
||||
LOGGER.error("*************************************心愿抽奖权重,总权重:{},随机值:{},map:{}", weight, randomInt, map);
|
||||
// 遍历权重
|
||||
for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
|
||||
if (randomInt <= entry.getValue()) {
|
||||
|
||||
int weight = user.getHeroManager().getWeightByDraw(type);
|
||||
int randomInt = MathUtils.randomInt(10000);
|
||||
if (randomInt <= weight){
|
||||
// 读取格子信息
|
||||
WishDrawCardInfo cardInfo = cardInfoMap.get(entry.getKey());
|
||||
WishDrawCardInfo cardInfo = user.getHeroManager().getWishDrawCardInfoMap().get(1);
|
||||
// null表示未中心愿, 该格子已锁定, 是空格子
|
||||
if (cardInfo == null || cardInfo.getStatus() == 1 || cardInfo.getHeroTid() == 0) {
|
||||
return item;
|
||||
|
@ -592,17 +550,77 @@ public class HeroLogic {
|
|||
// 赋值物品id和数量
|
||||
result[0] = cardInfo.getHeroTid();
|
||||
result[1] = item[1];
|
||||
// 修改格子信息,入库
|
||||
cardInfo.setStatus(1);
|
||||
user.getHeroManager().putWishDrawCardInfoMap(cardInfo);
|
||||
// 消息推送
|
||||
sendWishCardIndication(user);
|
||||
return result;
|
||||
}
|
||||
// 权重递减
|
||||
randomInt -= entry.getValue();
|
||||
}
|
||||
return item;
|
||||
// 更新抽奖次数, 记录卡池
|
||||
// HeroManager heroManager = user.getHeroManager();
|
||||
// // 获取类型抽奖次数
|
||||
// Map<Integer, Integer> randomStar = heroManager.getWishStar(type);
|
||||
// // 更新次数
|
||||
// int num = heroManager.getWishStar(type).getOrDefault(scHero.getStar(), 0) + 1;
|
||||
// randomStar.put(scHero.getStar(), num);
|
||||
// heroManager.putWishStar(type, randomStar);
|
||||
// /* ======================= 中不中心愿 ======================= */
|
||||
// // 获取钻石抽奖抽中五星的次数
|
||||
// boolean randomBol = (num - 1) % 5 == 0;
|
||||
// LOGGER.info("*************************************是否中心愿;num:{},random:{}", num, randomBol);
|
||||
// if (!randomBol) {
|
||||
// // 不到次数,不走心愿
|
||||
// return item;
|
||||
// }
|
||||
// /*======================== 中心愿随机奖励 ========================*/
|
||||
// // 心愿格子信息
|
||||
// HashMap<Integer, WishDrawCardInfo> cardInfoMap = user.getHeroManager().getWishDrawCardInfoMap();
|
||||
// // 空格子权重
|
||||
// int empty = SSpecialConfig.getIntegerValue(SSpecialConfig.CARDWISHBLOCKRATE);
|
||||
// // 计算权重map
|
||||
// HashMap<Integer, Integer> map = new HashMap<>();
|
||||
// cardInfoMap.forEach((k, v) -> {
|
||||
// if (v.getStatus() == 0) {
|
||||
// if (v.getHeroTid() == 0) {
|
||||
// // 空格子
|
||||
// map.put(k, empty);
|
||||
// } else {
|
||||
// // 英雄格子
|
||||
// int heroWeight = Optional.ofNullable(SCHero.getsCHero().get(v.getHeroTid())).map(SCHero::getWeight).orElse(0);
|
||||
// map.put(k, heroWeight);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// // 随机权重
|
||||
// int weight = map.values().stream().mapToInt(Integer::intValue).sum();
|
||||
// // 全部抽中
|
||||
// if (map.isEmpty() || weight <= 0) {
|
||||
// return item;
|
||||
// }
|
||||
// int randomInt = MathUtils.randomInt(weight);
|
||||
// LOGGER.error("*************************************心愿抽奖权重,总权重:{},随机值:{},map:{}", weight, randomInt, map);
|
||||
// // 遍历权重
|
||||
// for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
|
||||
// if (randomInt <= entry.getValue()) {
|
||||
// // 读取格子信息
|
||||
// WishDrawCardInfo cardInfo = cardInfoMap.get(entry.getKey());
|
||||
// // null表示未中心愿, 该格子已锁定, 是空格子
|
||||
// if (cardInfo == null || cardInfo.getStatus() == 1 || cardInfo.getHeroTid() == 0) {
|
||||
// return item;
|
||||
// }
|
||||
// // new int[]
|
||||
// int[] result = new int[2];
|
||||
// // 赋值物品id和数量
|
||||
// result[0] = cardInfo.getHeroTid();
|
||||
// result[1] = item[1];
|
||||
// // 修改格子信息,入库
|
||||
// cardInfo.setStatus(1);
|
||||
// user.getHeroManager().putWishDrawCardInfoMap(cardInfo);
|
||||
// // 消息推送
|
||||
// sendWishCardIndication(user);
|
||||
// return result;
|
||||
// }
|
||||
// // 权重递减
|
||||
// randomInt -= entry.getValue();
|
||||
// }
|
||||
// return item;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,6 +13,7 @@ public class SChangingCard implements BaseConfig {
|
|||
private int cardId;
|
||||
private int[][] propList;
|
||||
private int star;
|
||||
private int position;
|
||||
private int[] exp;
|
||||
private int levelUpPool;
|
||||
private int[] skill;
|
||||
|
@ -36,6 +37,10 @@ public class SChangingCard implements BaseConfig {
|
|||
return propList;
|
||||
}
|
||||
|
||||
public int getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public int getStar() {
|
||||
return star;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue