主角技能
parent
176e86f344
commit
5a35fe0fd1
|
@ -59,9 +59,6 @@ public class UpOrDownTransformationHandler extends BaseHandler<HeroInfoProto.UpO
|
||||||
if (values[index-1] > practiceLevel){
|
if (values[index-1] > practiceLevel){
|
||||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE,"变身卡位置未解锁,修仙境界不足");
|
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE,"变身卡位置未解锁,修仙境界不足");
|
||||||
}
|
}
|
||||||
if (index != changingCard.getPosition()){
|
|
||||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE,"变身卡位置错误");
|
|
||||||
}
|
|
||||||
// 上阵变身卡
|
// 上阵变身卡
|
||||||
for (TransformationInfo value : infoMap.values()) {
|
for (TransformationInfo value : infoMap.values()) {
|
||||||
if (value.getIndex() == index){
|
if (value.getIndex() == index){
|
||||||
|
|
|
@ -115,7 +115,7 @@ public enum ActivityTypeEnum {
|
||||||
ENCHANTER_STORE(ActivityType.ENCHANTER_STORE,DefaultEmptyActivity::new),//寻仙商城
|
ENCHANTER_STORE(ActivityType.ENCHANTER_STORE,DefaultEmptyActivity::new),//寻仙商城
|
||||||
WEEK_CARD(ActivityType.WEEK_CARD,WeekCardActivity::new),//周卡
|
WEEK_CARD(ActivityType.WEEK_CARD,WeekCardActivity::new),//周卡
|
||||||
DRAW_LV_CHEST(ActivityType.DRAW_LV_CHEST,DrawLvChestActivity::new),//抽卡等级宝箱
|
DRAW_LV_CHEST(ActivityType.DRAW_LV_CHEST,DrawLvChestActivity::new),//抽卡等级宝箱
|
||||||
// FABAO_BOOK_REWARD(ActivityType.FABAO_BOOK_REWARD,FabaoBookRewardActivity::new),//法宝图鉴宝箱
|
FABAO_BOOK_REWARD(ActivityType.FABAO_BOOK_REWARD,FabaoBookRewardActivity::new),//法宝图鉴宝箱
|
||||||
|
|
||||||
/****************************************************** bt **********************************************************/
|
/****************************************************** bt **********************************************************/
|
||||||
BRUSH_PRIVILEGE(ActivityType.BRUSH_PRIVILEGE, BrushPrivilegeActivity::new),//刷充特权
|
BRUSH_PRIVILEGE(ActivityType.BRUSH_PRIVILEGE, BrushPrivilegeActivity::new),//刷充特权
|
||||||
|
|
|
@ -5,6 +5,11 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
import com.ljsd.jieling.globals.BIReason;
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
import com.ljsd.jieling.jbean.ActivityMission;
|
import com.ljsd.jieling.jbean.ActivityMission;
|
||||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||||
|
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||||
|
import com.ljsd.jieling.logic.activity.event.EspecialEquipUpEvent;
|
||||||
|
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.UserManager;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
@ -19,13 +24,32 @@ import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hj
|
* @author hj
|
||||||
* 超值基金活动新
|
* 法宝图鉴宝箱
|
||||||
* 2022-1-24
|
* 2022-1-24
|
||||||
*/
|
*/
|
||||||
public class FabaoBookRewardActivity extends AbstractActivity {
|
public class FabaoBookRewardActivity extends AbstractActivity {
|
||||||
|
|
||||||
FabaoBookRewardActivity(int id) {
|
FabaoBookRewardActivity(int id) {
|
||||||
super(id);
|
super(id);
|
||||||
|
Poster.getPoster().listenEvent(this, EspecialEquipUpEvent.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEvent(IEvent event) throws Exception {
|
||||||
|
if (!(event instanceof EspecialEquipUpEvent)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
EspecialEquipUpEvent event1 = (EspecialEquipUpEvent) event;
|
||||||
|
User user = UserManager.getUser(event1.getUid());
|
||||||
|
int star = event1.getStar();
|
||||||
|
// 每10级加一颗星
|
||||||
|
if (star % 10 == 0){
|
||||||
|
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||||
|
mission.setV(mission.getV()+1);
|
||||||
|
}
|
||||||
|
// 客户端推送
|
||||||
|
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||||
|
sendActivityProgress(session, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -40,58 +64,58 @@ public class FabaoBookRewardActivity extends AbstractActivity {
|
||||||
@Override
|
@Override
|
||||||
public List<CommonProto.ActivityInfo.MissionInfo> getAllMissInfo(User user, ActivityMission activityMission, Set<Integer> filter) {
|
public List<CommonProto.ActivityInfo.MissionInfo> getAllMissInfo(User user, ActivityMission activityMission, Set<Integer> filter) {
|
||||||
List<CommonProto.ActivityInfo.MissionInfo> missionInfo = new ArrayList<>();
|
List<CommonProto.ActivityInfo.MissionInfo> missionInfo = new ArrayList<>();
|
||||||
// 验证活动是否开启
|
// // 验证活动是否开启
|
||||||
if (activityMission == null){
|
// if (activityMission == null){
|
||||||
return missionInfo;
|
// return missionInfo;
|
||||||
}
|
// }
|
||||||
Map<Integer, SWishConfig> map = SWishConfig.map;
|
// Map<Integer, SWishConfig> map = SWishConfig.map;
|
||||||
int count = user.getHeroManager().getCountByDraw(1);
|
// int count = user.getHeroManager().getCountByDraw(1);
|
||||||
Map<Integer, ActivityProgressInfo> progressInfoMap = activityMission.getActivityMissionMap();
|
// Map<Integer, ActivityProgressInfo> progressInfoMap = activityMission.getActivityMissionMap();
|
||||||
for (SWishConfig config : map.values()) {
|
// for (SWishConfig config : map.values()) {
|
||||||
int missionId = config.getId();
|
// int missionId = config.getId();
|
||||||
Integer state = Optional.ofNullable(progressInfoMap.get(missionId)).map(ActivityProgressInfo::getState).orElse(0);
|
// Integer state = Optional.ofNullable(progressInfoMap.get(missionId)).map(ActivityProgressInfo::getState).orElse(0);
|
||||||
// 封装proto并返回
|
// // 封装proto并返回
|
||||||
CommonProto.ActivityInfo.MissionInfo build = CommonProto.ActivityInfo.MissionInfo.newBuilder()
|
// CommonProto.ActivityInfo.MissionInfo build = CommonProto.ActivityInfo.MissionInfo.newBuilder()
|
||||||
.setMissionId(missionId)
|
// .setMissionId(missionId)
|
||||||
.setProgress(count)
|
// .setProgress(count)
|
||||||
.setState(state)
|
// .setState(state)
|
||||||
.build();
|
// .build();
|
||||||
missionInfo.add(build);
|
// missionInfo.add(build);
|
||||||
}
|
// }
|
||||||
return missionInfo;
|
return missionInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean takeReward(ISession session, int missionId) throws Exception {
|
public boolean takeReward(ISession session, int missionId) throws Exception {
|
||||||
User user = UserManager.getUser(session.getUid());
|
// User user = UserManager.getUser(session.getUid());
|
||||||
// 开始校验数据正确性
|
// // 开始校验数据正确性
|
||||||
SWishConfig wishConfig = SWishConfig.map.get(missionId);
|
// SWishConfig wishConfig = SWishConfig.map.get(missionId);
|
||||||
if (wishConfig == null) {
|
// if (wishConfig == null) {
|
||||||
String format = MessageFormat.format("抽卡等级宝箱退出,表数据错误,uid:{0},活动id:{1},档位id:{2}", user.getId(), id, missionId);
|
// String format = MessageFormat.format("抽卡等级宝箱退出,表数据错误,uid:{0},活动id:{1},档位id:{2}", user.getId(), id, missionId);
|
||||||
throw new ErrorCodeException(format);
|
// throw new ErrorCodeException(format);
|
||||||
}
|
// }
|
||||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
// ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||||
if (mission == null || mission.getActivityState() != ActivityType.OPEN_STATE){
|
// if (mission == null || mission.getActivityState() != ActivityType.OPEN_STATE){
|
||||||
String format = MessageFormat.format("抽卡等级宝箱退出,活动数据未开启,uid:{0},活动id:{1}", user.getId(), id);
|
// String format = MessageFormat.format("抽卡等级宝箱退出,活动数据未开启,uid:{0},活动id:{1}", user.getId(), id);
|
||||||
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN, format);
|
// throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN, format);
|
||||||
}
|
// }
|
||||||
ActivityProgressInfo progressInfo = mission.getActivityMissionMap().get(missionId);
|
// ActivityProgressInfo progressInfo = mission.getActivityMissionMap().get(missionId);
|
||||||
if (progressInfo != null && progressInfo.getState() == ActivityType.HAD_TAKED) {
|
// if (progressInfo != null && progressInfo.getState() == ActivityType.HAD_TAKED) {
|
||||||
String format = MessageFormat.format("抽卡等级宝箱退出,活动奖励已经领取,uid:{0},活动id:{1},档位id:{2}", user.getId(), id, missionId);
|
// String format = MessageFormat.format("抽卡等级宝箱退出,活动奖励已经领取,uid:{0},活动id:{1},档位id:{2}", user.getId(), id, missionId);
|
||||||
throw new ErrorCodeException(ErrorCode.HAD_TAKE_REWARD, format);
|
// throw new ErrorCodeException(ErrorCode.HAD_TAKE_REWARD, format);
|
||||||
}
|
// }
|
||||||
if (!checkRewardsProcess(user,wishConfig)) {
|
// if (!checkRewardsProcess(user,wishConfig)) {
|
||||||
String format = MessageFormat.format("抽卡等级宝箱退出,未达到领取条件,uid:{0},活动id:{1},档位id:{2}", user.getId(), id, missionId);
|
// String format = MessageFormat.format("抽卡等级宝箱退出,未达到领取条件,uid:{0},活动id:{1},档位id:{2}", user.getId(), id, missionId);
|
||||||
throw new ErrorCodeException(format);
|
// throw new ErrorCodeException(format);
|
||||||
}
|
// }
|
||||||
// reward
|
// // reward
|
||||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, wishConfig.getReward(), BIReason.TAKE_ACTIVITY_REWARD);
|
// CommonProto.Drop.Builder drop = ItemUtil.drop(user, wishConfig.getReward(), BIReason.TAKE_ACTIVITY_REWARD);
|
||||||
PlayerInfoProto.TakeActivityRewardResponse build = PlayerInfoProto.TakeActivityRewardResponse.newBuilder().setDrop(drop).build();
|
// PlayerInfoProto.TakeActivityRewardResponse build = PlayerInfoProto.TakeActivityRewardResponse.newBuilder().setDrop(drop).build();
|
||||||
MessageUtil.sendMessage(session, 1, rewardResponseValue, build, true);
|
// MessageUtil.sendMessage(session, 1, rewardResponseValue, build, true);
|
||||||
// 状态推送
|
// // 状态推送
|
||||||
sendActivityProgress(session, null);
|
// sendActivityProgress(session, null);
|
||||||
// 打点上报
|
// // 打点上报
|
||||||
reportTakeActivityReward(user,wishConfig.getReward(),missionId);
|
// reportTakeActivityReward(user,wishConfig.getReward(),missionId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2470,79 +2470,49 @@ public class HeroLogic {
|
||||||
/**
|
/**
|
||||||
* 主角技能数据
|
* 主角技能数据
|
||||||
*/
|
*/
|
||||||
public void getPracticeSkill(List<CommonProto.FightUnitInfo> infoList,
|
public void getPracticeSkill(User user, List<CommonProto.FightUnitInfo> pokemonList) {
|
||||||
User user,
|
StringBuilder builder = new StringBuilder();
|
||||||
long maxForce,int sex,int userLv,List<Integer> tfInfoList) {
|
HashMap<Integer, Long> attrMap = new HashMap<>();
|
||||||
Map<Integer, Integer> practiceSkillMap =user.getHeroManager().getPracticeSkillMap();
|
|
||||||
StringBuilder skillStr = new StringBuilder();
|
List<TransformationInfo> list = user.getHeroManager().getTransformationList().values().stream().filter(v -> v.getStatus() == 1).collect(Collectors.toList());
|
||||||
// 身外化身技能
|
for (TransformationInfo info : list) {
|
||||||
if (tfInfoList != null){
|
try {
|
||||||
Map<Integer, SChangingCard> cardMap = STableManager.getConfig(SChangingCard.class);
|
// 拼接技能
|
||||||
Map<Integer, TransformationInfo> infoMap = user.getHeroManager().getTransformationList();
|
SChangingCard card = SChangingCard.map.get(info.getCardId());
|
||||||
for (int cardId : tfInfoList) {
|
builder.append(info.getIndex()).append("#").append(card.getSkill()[info.getStar()]).append("|");
|
||||||
SChangingCard card = cardMap.get(cardId);
|
// 获取属性
|
||||||
TransformationInfo info = infoMap.get(cardId);
|
calPlayerAttribute(attrMap, info.getCardId(), info.getStar(), info.getLevel());
|
||||||
if(info == null){
|
}catch (Exception e){
|
||||||
continue;
|
LOGGER.error("获取主角技能报错:{}", e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (card != null){
|
|
||||||
skillStr.append(card.getSkill()[info.getStar()]).append("#");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 修行技能
|
|
||||||
if (practiceSkillMap != null){
|
|
||||||
StringBuilder passivitySkillStr=new StringBuilder();
|
|
||||||
for (Map.Entry<Integer, Integer> entry : practiceSkillMap.entrySet()) {
|
|
||||||
SPlayerSkill playerSkill = SPlayerSkill.GetSPlayerSkill(entry.getKey(), entry.getValue());
|
|
||||||
if (playerSkill != null){
|
|
||||||
///第一个技能是主动技
|
|
||||||
if (playerSkill.getSort()==1){
|
|
||||||
skillStr.append(playerSkill.getId());
|
|
||||||
skillStr.append("|");
|
|
||||||
}else{
|
|
||||||
///第一个技能是被动技能
|
|
||||||
passivitySkillStr.append(playerSkill.getSkillIDList()[0]);
|
|
||||||
passivitySkillStr.append("#");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
skillStr.append(passivitySkillStr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 去除最后一位得#号
|
// 技能
|
||||||
String skill = skillStr.toString();
|
String skill = "";
|
||||||
if (!StringUtil.isEmpty(skill)){
|
if (builder.length() >= 1){
|
||||||
skill = skill.substring(0,skill.length()-1);
|
skill = builder.substring(0, builder.length()-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 玩家本身的主角属性
|
||||||
|
SPlayerLevelConfig playerLevelConfig = SPlayerLevelConfig.sPlayerLevelConfigMap.get(user.getPlayerInfoManager().getLevel());
|
||||||
|
combinedAttribute(playerLevelConfig.getPlayerPropList(), attrMap);
|
||||||
|
|
||||||
|
// 属性
|
||||||
|
String property = getPlayerProperty(attrMap);
|
||||||
|
|
||||||
CommonProto.FightUnitInfo skillInfo = CommonProto.FightUnitInfo
|
CommonProto.FightUnitInfo skillInfo = CommonProto.FightUnitInfo
|
||||||
.newBuilder()
|
.newBuilder()
|
||||||
.setUnitId("0")
|
.setUnitId("0")
|
||||||
.setUnitSkillIds(skill)
|
|
||||||
.setProperty("0")
|
|
||||||
.setPosition(100)
|
.setPosition(100)
|
||||||
.setStar(userLv)
|
.setStar(user.getPlayerInfoManager().getLevel())
|
||||||
.setSkinId(0)
|
.setProperty(property)
|
||||||
.setForceScore(maxForce)
|
.setUnitSkillIds(skill)
|
||||||
.setPlayerSex(sex)
|
|
||||||
.build();
|
.build();
|
||||||
infoList.add(skillInfo);
|
pokemonList.add(skillInfo);
|
||||||
}
|
|
||||||
/**
|
// 修行技能
|
||||||
* 主角技能数据
|
// Map<Integer, Integer> practiceSkillMap =user.getHeroManager().getPracticeSkillMap();
|
||||||
*/
|
|
||||||
// public void getPracticeSkill(List<CommonProto.FightUnitInfo> infoList,
|
|
||||||
// Map<Integer, Integer> practiceSkillMap ,
|
|
||||||
// long maxForce,int sex,int userLv,List<Integer> tfInfoList) {
|
|
||||||
// StringBuilder skillStr = new StringBuilder();
|
|
||||||
// // 身外化身技能
|
|
||||||
// if (tfInfoList != null){
|
|
||||||
// for(int skill:tfInfoList){
|
|
||||||
// skillStr.append(skill).append("#");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// // 修行技能
|
|
||||||
// if (practiceSkillMap != null){
|
// if (practiceSkillMap != null){
|
||||||
// StringBuilder passivitySkillStr=new StringBuilder();
|
// StringBuilder passivitySkillStr=new StringBuilder();
|
||||||
// for (Map.Entry<Integer, Integer> entry : practiceSkillMap.entrySet()) {
|
// for (Map.Entry<Integer, Integer> entry : practiceSkillMap.entrySet()) {
|
||||||
|
@ -2561,26 +2531,10 @@ public class HeroLogic {
|
||||||
// }
|
// }
|
||||||
// skillStr.append(passivitySkillStr);
|
// skillStr.append(passivitySkillStr);
|
||||||
// }
|
// }
|
||||||
//
|
|
||||||
// // 去除最后一位得#号
|
// 去除最后一位得#号
|
||||||
// String skill = skillStr.toString();
|
}
|
||||||
// if (!StringUtil.isEmpty(skill)){
|
|
||||||
// skill = skill.substring(0,skill.length()-1);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// CommonProto.FightUnitInfo skillInfo = CommonProto.FightUnitInfo
|
|
||||||
// .newBuilder()
|
|
||||||
// .setUnitId("0")
|
|
||||||
// .setUnitSkillIds(skill)
|
|
||||||
// .setProperty("0")
|
|
||||||
// .setPosition(100)
|
|
||||||
// .setStar(userLv)
|
|
||||||
// .setSkinId(0)
|
|
||||||
// .setForceScore(maxForce)
|
|
||||||
// .setPlayerSex(sex)
|
|
||||||
// .build();
|
|
||||||
// infoList.add(skillInfo);
|
|
||||||
// }
|
|
||||||
|
|
||||||
public CommonProto.FightTeamInfo combinationFightTeam(User user, int teamId, List<CommonProto.FightUnitInfo> heroFightInfos){
|
public CommonProto.FightTeamInfo combinationFightTeam(User user, int teamId, List<CommonProto.FightUnitInfo> heroFightInfos){
|
||||||
return CommonProto.FightTeamInfo.newBuilder()
|
return CommonProto.FightTeamInfo.newBuilder()
|
||||||
|
@ -2620,14 +2574,9 @@ public class HeroLogic {
|
||||||
.build();
|
.build();
|
||||||
pokemonInfos.add(info);
|
pokemonInfos.add(info);
|
||||||
}
|
}
|
||||||
// 获取已上阵得变身卡
|
|
||||||
List<Integer> list = user.getHeroManager().getTransformationList().values().stream()
|
// 变身卡
|
||||||
.filter(v -> v.getStatus() == 1)
|
getPracticeSkill(user, pokemonInfos);
|
||||||
.mapToInt(TransformationInfo::getCardId)
|
|
||||||
.boxed().collect(Collectors.toList());
|
|
||||||
getPracticeSkill(pokemonInfos, user,
|
|
||||||
user.getPlayerInfoManager().getMaxForce(),user.getPlayerInfoManager().getSex(),
|
|
||||||
user.getPlayerInfoManager().getLevel(),list);
|
|
||||||
return pokemonInfos;
|
return pokemonInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2960,6 +2909,12 @@ public class HeroLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 主角本身给英雄的加成
|
||||||
|
SPlayerLevelConfig playerLevelConfig = SPlayerLevelConfig.sPlayerLevelConfigMap.get(user.getPlayerInfoManager().getLevel());
|
||||||
|
if (playerLevelConfig != null){
|
||||||
|
combinedAttribute(playerLevelConfig.getPropList(), heroAllAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
// 身外化身加成
|
// 身外化身加成
|
||||||
Map<Integer, TransformationInfo> transformationList = heroManager.getTransformationList();
|
Map<Integer, TransformationInfo> transformationList = heroManager.getTransformationList();
|
||||||
Map<Integer, SChangingCard> changingCardMap = STableManager.getConfig(SChangingCard.class);
|
Map<Integer, SChangingCard> changingCardMap = STableManager.getConfig(SChangingCard.class);
|
||||||
|
@ -2983,6 +2938,7 @@ public class HeroLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//化身之力提供的属性
|
//化身之力提供的属性
|
||||||
Map<Integer, SChangingForce> SChangingForce = STableManager.getConfig(SChangingForce.class);
|
Map<Integer, SChangingForce> SChangingForce = STableManager.getConfig(SChangingForce.class);
|
||||||
if(SChangingForce.get(user.getHeroManager().getTransformationForce()) != null){
|
if(SChangingForce.get(user.getHeroManager().getTransformationForce()) != null){
|
||||||
|
@ -4077,6 +4033,25 @@ public class HeroLogic {
|
||||||
return ItemUtil.mapToArray(pokemonAttributeMap);
|
return ItemUtil.mapToArray(pokemonAttributeMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算主角的属性
|
||||||
|
*/
|
||||||
|
public void calPlayerAttribute(Map<Integer, Long> attrMap, int tmpId, int star, int level) {
|
||||||
|
try {
|
||||||
|
SChangingCard card = SChangingCard.map.get(tmpId);
|
||||||
|
// 基础属性
|
||||||
|
combinedAttribute(card.getPlayerPropList(), attrMap);
|
||||||
|
//等级
|
||||||
|
SChangingCardLevel cardLevel = SChangingCardLevel.getConfigByPoolId(card.getLevelUpPool()).get(level);
|
||||||
|
combinedAttribute(cardLevel.getPlayerPropList(), attrMap);
|
||||||
|
//星级
|
||||||
|
SChangingCardStar cardStar = SChangingCardStar.getPoolMap().get(card.getStar()).get(star);
|
||||||
|
combinedAttribute(cardStar.getPlayerPropList(), attrMap);
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算一个灵兽的属性
|
* 计算一个灵兽的属性
|
||||||
*/
|
*/
|
||||||
|
@ -4140,6 +4115,40 @@ public class HeroLogic {
|
||||||
return attributeMap;
|
return attributeMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取主角的属性字符串
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getPlayerProperty(Map<Integer, Long> attrMap) {
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
for (int i = 0; i < 15; i++) {
|
||||||
|
int key = 0;
|
||||||
|
switch (i){
|
||||||
|
case 3:
|
||||||
|
key = 116;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
key = 117;
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
key = 114;
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
key = 115;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
SPropertyConfig propertyConfig = SPropertyConfig.getsPropertyConfigByPID(key);
|
||||||
|
if (propertyConfig != null && propertyConfig.getStyle() == GlobalsDef.PERCENT_TYPE){
|
||||||
|
builder.append(attrMap.getOrDefault(key,0L)/10000d).append("#");
|
||||||
|
}else {
|
||||||
|
builder.append(attrMap.getOrDefault(key,0L)).append("#");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return builder.substring(0, builder.length()-1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取一个灵兽的属性字符串
|
* 获取一个灵兽的属性字符串
|
||||||
*
|
*
|
||||||
|
|
|
@ -775,8 +775,10 @@ public class ItemLogic {
|
||||||
if (sEquipTalismana == null || sEquipTalismana.getRankupBasicMaterial() == null|| sEquipTalismana.getRankupBasicMaterial().length==0) {
|
if (sEquipTalismana == null || sEquipTalismana.getRankupBasicMaterial() == null|| sEquipTalismana.getRankupBasicMaterial().length==0) {
|
||||||
throw new ErrorCodeException(ErrorCode.newDefineCode("法宝已最大等级"));
|
throw new ErrorCodeException(ErrorCode.newDefineCode("法宝已最大等级"));
|
||||||
}
|
}
|
||||||
boolean b = ItemUtil.itemCost(user, sEquipTalismana.getRankupBasicMaterial(), BIReason.ESPECIAL_EQUIP_UP_LEVEL_CONSUME, 1);
|
boolean check = ItemUtil.itemCost(user, sEquipTalismana.getRankupBasicMaterial(), BIReason.ESPECIAL_EQUIP_UP_LEVEL_CONSUME, 1);
|
||||||
if (b) {
|
if (!check){
|
||||||
|
throw new ErrorCodeException(ErrorCode.ITEM_ESPECIAL_EQUIP_UP_ITEM_NOT);
|
||||||
|
}
|
||||||
hero.updateEspecial(hero.getEspecialEquipLevel() + 1);
|
hero.updateEspecial(hero.getEspecialEquipLevel() + 1);
|
||||||
Poster.getPoster().dispatchEvent(new EspecialEquipUpEvent(user.getId(), especialEquipId, hero.getEspecialEquipLevel()));
|
Poster.getPoster().dispatchEvent(new EspecialEquipUpEvent(user.getId(), especialEquipId, hero.getEspecialEquipLevel()));
|
||||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ESPECIAL_EQUIP, hero.getEspecialEquipLevel(), heroId);
|
user.getUserMissionManager().onGameEvent(user, GameEvent.ESPECIAL_EQUIP, hero.getEspecialEquipLevel(), heroId);
|
||||||
|
@ -801,9 +803,6 @@ public class ItemLogic {
|
||||||
Poster.getPoster().dispatchEvent(new SaveHeroForceEvent(user.getId(),heroId));
|
Poster.getPoster().dispatchEvent(new SaveHeroForceEvent(user.getId(),heroId));
|
||||||
//鸿蒙阵
|
//鸿蒙阵
|
||||||
HeroLogic.getInstance().addOrUpdateHongmeng(session);
|
HeroLogic.getInstance().addOrUpdateHongmeng(session);
|
||||||
} else {
|
|
||||||
throw new ErrorCodeException(ErrorCode.ITEM_ESPECIAL_EQUIP_UP_ITEM_NOT);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addItemLog(ItemLog itemLog) {
|
public void addItemLog(ItemLog itemLog) {
|
||||||
|
|
|
@ -329,23 +329,19 @@ public class FightDataUtil {
|
||||||
LuaValue monster = new LuaTable();
|
LuaValue monster = new LuaTable();
|
||||||
///100代表是修行技能
|
///100代表是修行技能
|
||||||
if (unitInfo.getPosition()==100){
|
if (unitInfo.getPosition()==100){
|
||||||
monster.set("id",0);
|
monster.set("id",unitInfo.getUnitId());
|
||||||
monster.set("star",unitInfo.getStar());
|
monster.set("star",unitInfo.getStar());
|
||||||
monster.set("teamDamage",unitInfo.getForceScore());
|
|
||||||
monster.set("camp",camp);
|
monster.set("camp",camp);
|
||||||
monster.set("position",unitInfo.getPosition());
|
monster.set("position",unitInfo.getPosition());
|
||||||
monster.set("property",getProperty(unitInfo.getProperty()));
|
monster.set("property",getProperty(unitInfo.getProperty()));
|
||||||
String[] allSkillIdArr = skillId.split("\\|");
|
|
||||||
String[] skillIdArr = allSkillIdArr[0].split("#");
|
|
||||||
if (allSkillIdArr.length>1){
|
|
||||||
String passivityStr="##"+allSkillIdArr[1];
|
|
||||||
String[]passivitySkillIdArr=passivityStr.split("#");
|
|
||||||
monster.set("passivity", getPassivity(passivitySkillIdArr));
|
|
||||||
}
|
|
||||||
LuaValue skillList= new LuaTable();
|
LuaValue skillList= new LuaTable();
|
||||||
for (int k = 0; k < skillIdArr.length; k++) {
|
String[] oneSkill = skillId.split("\\|");
|
||||||
SPlayerSkill playerSkillConfig = STableManager.getConfig(SPlayerSkill.class).get(Integer.valueOf(skillIdArr[k]));
|
for (int k = 0; k < oneSkill.length; k++) {
|
||||||
LuaValue skill = getLuaSkill(playerSkillConfig.getSkillIDList(), playerSkillConfig.getReleasePoint(),playerSkillConfig.getReleaseLimit(), playerSkillConfig.getWarEffectCount(), playerSkillConfig.getTurnEffectCount());
|
String[] split = oneSkill[k].split("#");
|
||||||
|
SPlayerSkill playerSkill = SPlayerSkill.sPrivilegeTypeConfigMap.get(Integer.parseInt(split[1]));
|
||||||
|
SChangingCardPosition cardPosition = SChangingCardPosition.map.get(Integer.parseInt(split[0]));
|
||||||
|
LuaValue skill = getLuaSkill(playerSkill.getSkillIDList(), cardPosition.getReleasePoint(),cardPosition.getReleaseLimit(), playerSkill.getWarEffectCount(), playerSkill.getTurnEffectCount());
|
||||||
skillList.rawset(k+1,skill);
|
skillList.rawset(k+1,skill);
|
||||||
}
|
}
|
||||||
monster.set("skill",skillList);
|
monster.set("skill",skillList);
|
||||||
|
@ -489,8 +485,11 @@ public class FightDataUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static LuaValue getProperty(String dataList) {
|
private static LuaValue getProperty(String dataList) {
|
||||||
String[] propertyArr = dataList.trim().split("#");
|
|
||||||
LuaValue property = new LuaTable();
|
LuaValue property = new LuaTable();
|
||||||
|
if (dataList.isEmpty()){
|
||||||
|
return property;
|
||||||
|
}
|
||||||
|
String[] propertyArr = dataList.trim().split("#");
|
||||||
for (int i = 1; i <= propertyArr.length; i++) {
|
for (int i = 1; i <= propertyArr.length; i++) {
|
||||||
property.rawset(i, LuaValue.valueOf(Double.parseDouble(propertyArr[i-1])));
|
property.rawset(i, LuaValue.valueOf(Double.parseDouble(propertyArr[i-1])));
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,9 +20,13 @@ public class SChangingCard implements BaseConfig {
|
||||||
private int isOpen;
|
private int isOpen;
|
||||||
private int starMax;
|
private int starMax;
|
||||||
private int levelMax;
|
private int levelMax;
|
||||||
|
private int[][] playerPropList;
|
||||||
|
|
||||||
|
public static Map<Integer, SChangingCard> map;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
|
map = STableManager.getConfig(SChangingCard.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
|
@ -68,4 +72,8 @@ public class SChangingCard implements BaseConfig {
|
||||||
public int getLevelMax() {
|
public int getLevelMax() {
|
||||||
return levelMax;
|
return levelMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int[][] getPlayerPropList() {
|
||||||
|
return playerPropList;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -20,6 +20,7 @@ public class SChangingCardLevel implements BaseConfig {
|
||||||
private int[] exp;
|
private int[] exp;
|
||||||
|
|
||||||
private int[] changingForceExp;
|
private int[] changingForceExp;
|
||||||
|
private int[][] playerPropList;
|
||||||
|
|
||||||
public static Map<Integer, Map<Integer, SChangingCardLevel>> sChallengeConfigs =new HashMap<Integer, Map<Integer, SChangingCardLevel>>();;
|
public static Map<Integer, Map<Integer, SChangingCardLevel>> sChallengeConfigs =new HashMap<Integer, Map<Integer, SChangingCardLevel>>();;
|
||||||
@Override
|
@Override
|
||||||
|
@ -62,10 +63,11 @@ public class SChangingCardLevel implements BaseConfig {
|
||||||
public int[] getExp() {
|
public int[] getExp() {
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getChangingForceExp() {
|
public int[] getChangingForceExp() {
|
||||||
return changingForceExp;
|
return changingForceExp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int[][] getPlayerPropList() {
|
||||||
|
return playerPropList;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package config;
|
||||||
|
|
||||||
|
import manager.STableManager;
|
||||||
|
import manager.Table;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Table(name ="ChangingCardPosition")
|
||||||
|
public class SChangingCardPosition implements BaseConfig {
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
private int[] releasePoint;
|
||||||
|
|
||||||
|
private int[][] releaseLimit;
|
||||||
|
|
||||||
|
public static Map<Integer, SChangingCardPosition> map;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() throws Exception {
|
||||||
|
map = STableManager.getConfig(SChangingCardPosition.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getReleasePoint() {
|
||||||
|
return releasePoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[][] getReleaseLimit() {
|
||||||
|
return releaseLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -21,6 +21,8 @@ public class SChangingCardStar implements BaseConfig {
|
||||||
|
|
||||||
private int[] starUpExp;
|
private int[] starUpExp;
|
||||||
|
|
||||||
|
private int[][] playerPropList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* map《poolid,map《star,object》》
|
* map《poolid,map《star,object》》
|
||||||
*/
|
*/
|
||||||
|
@ -65,5 +67,7 @@ public class SChangingCardStar implements BaseConfig {
|
||||||
return starUpExp;
|
return starUpExp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int[][] getPlayerPropList() {
|
||||||
|
return playerPropList;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -29,6 +29,9 @@ public class SPlayerLevelConfig implements BaseConfig {
|
||||||
|
|
||||||
private int[][] levelUpReward;
|
private int[][] levelUpReward;
|
||||||
|
|
||||||
|
private int[][] propList;
|
||||||
|
|
||||||
|
private int[][] playerPropList;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
|
@ -76,6 +79,14 @@ public class SPlayerLevelConfig implements BaseConfig {
|
||||||
return levelUpReward;
|
return levelUpReward;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int[][] getPropList() {
|
||||||
|
return propList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[][] getPlayerPropList() {
|
||||||
|
return playerPropList;
|
||||||
|
}
|
||||||
|
|
||||||
public static Map<Integer, SPlayerLevelConfig> getsPlayerLevelConfigMap() {
|
public static Map<Integer, SPlayerLevelConfig> getsPlayerLevelConfigMap() {
|
||||||
return sPlayerLevelConfigMap;
|
return sPlayerLevelConfigMap;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,14 +35,14 @@ public class SPlayerSkill implements BaseConfig {
|
||||||
|
|
||||||
private int fight;//技能战斗力加成
|
private int fight;//技能战斗力加成
|
||||||
|
|
||||||
private static Map<Integer, Map<Integer,SPlayerSkill>>mapData;
|
private static Map<Integer, Map<Integer,SPlayerSkill>> mapData;
|
||||||
|
|
||||||
public static Map<Integer,SPlayerSkill> sPrivilegeTypeConfigMap;
|
public static Map<Integer,SPlayerSkill> sPrivilegeTypeConfigMap;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
mapData=new HashMap<>();
|
mapData=new HashMap<>();
|
||||||
sPrivilegeTypeConfigMap= STableManager.getConfig(SPlayerSkill.class);
|
sPrivilegeTypeConfigMap = STableManager.getConfig(SPlayerSkill.class);
|
||||||
for (Map.Entry<Integer, SPlayerSkill> integer : sPrivilegeTypeConfigMap.entrySet()) {
|
for (Map.Entry<Integer, SPlayerSkill> integer : sPrivilegeTypeConfigMap.entrySet()) {
|
||||||
SPlayerSkill skill=integer.getValue();
|
SPlayerSkill skill=integer.getValue();
|
||||||
if (!mapData.containsKey(skill.getSkillID())){
|
if (!mapData.containsKey(skill.getSkillID())){
|
||||||
|
|
Loading…
Reference in New Issue