主角技能
parent
176e86f344
commit
5a35fe0fd1
|
@ -59,9 +59,6 @@ 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){
|
||||
|
|
|
@ -115,7 +115,7 @@ public enum ActivityTypeEnum {
|
|||
ENCHANTER_STORE(ActivityType.ENCHANTER_STORE,DefaultEmptyActivity::new),//寻仙商城
|
||||
WEEK_CARD(ActivityType.WEEK_CARD,WeekCardActivity::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 **********************************************************/
|
||||
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.jbean.ActivityMission;
|
||||
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.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
|
@ -19,13 +24,32 @@ import java.util.*;
|
|||
|
||||
/**
|
||||
* @author hj
|
||||
* 超值基金活动新
|
||||
* 法宝图鉴宝箱
|
||||
* 2022-1-24
|
||||
*/
|
||||
public class FabaoBookRewardActivity extends AbstractActivity {
|
||||
|
||||
FabaoBookRewardActivity(int 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
|
||||
|
@ -40,58 +64,58 @@ public class FabaoBookRewardActivity extends AbstractActivity {
|
|||
@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);
|
||||
}
|
||||
// // 验证活动是否开启
|
||||
// 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);
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -2470,79 +2470,49 @@ public class HeroLogic {
|
|||
/**
|
||||
* 主角技能数据
|
||||
*/
|
||||
public void getPracticeSkill(List<CommonProto.FightUnitInfo> infoList,
|
||||
User user,
|
||||
long maxForce,int sex,int userLv,List<Integer> tfInfoList) {
|
||||
Map<Integer, Integer> practiceSkillMap =user.getHeroManager().getPracticeSkillMap();
|
||||
StringBuilder skillStr = new StringBuilder();
|
||||
// 身外化身技能
|
||||
if (tfInfoList != null){
|
||||
Map<Integer, SChangingCard> cardMap = STableManager.getConfig(SChangingCard.class);
|
||||
Map<Integer, TransformationInfo> infoMap = user.getHeroManager().getTransformationList();
|
||||
for (int cardId : tfInfoList) {
|
||||
SChangingCard card = cardMap.get(cardId);
|
||||
TransformationInfo info = infoMap.get(cardId);
|
||||
if(info == null){
|
||||
continue;
|
||||
}
|
||||
if (card != null){
|
||||
skillStr.append(card.getSkill()[info.getStar()]).append("#");
|
||||
}
|
||||
public void getPracticeSkill(User user, List<CommonProto.FightUnitInfo> pokemonList) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
HashMap<Integer, Long> attrMap = new HashMap<>();
|
||||
|
||||
List<TransformationInfo> list = user.getHeroManager().getTransformationList().values().stream().filter(v -> v.getStatus() == 1).collect(Collectors.toList());
|
||||
for (TransformationInfo info : list) {
|
||||
try {
|
||||
// 拼接技能
|
||||
SChangingCard card = SChangingCard.map.get(info.getCardId());
|
||||
builder.append(info.getIndex()).append("#").append(card.getSkill()[info.getStar()]).append("|");
|
||||
// 获取属性
|
||||
calPlayerAttribute(attrMap, info.getCardId(), info.getStar(), info.getLevel());
|
||||
}catch (Exception e){
|
||||
LOGGER.error("获取主角技能报错:{}", e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
// 修行技能
|
||||
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();
|
||||
if (!StringUtil.isEmpty(skill)){
|
||||
skill = skill.substring(0,skill.length()-1);
|
||||
// 技能
|
||||
String skill = "";
|
||||
if (builder.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
|
||||
.newBuilder()
|
||||
.setUnitId("0")
|
||||
.setUnitSkillIds(skill)
|
||||
.setProperty("0")
|
||||
.setPosition(100)
|
||||
.setStar(userLv)
|
||||
.setSkinId(0)
|
||||
.setForceScore(maxForce)
|
||||
.setPlayerSex(sex)
|
||||
.setStar(user.getPlayerInfoManager().getLevel())
|
||||
.setProperty(property)
|
||||
.setUnitSkillIds(skill)
|
||||
.build();
|
||||
infoList.add(skillInfo);
|
||||
}
|
||||
/**
|
||||
* 主角技能数据
|
||||
*/
|
||||
// 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("#");
|
||||
// }
|
||||
// }
|
||||
// // 修行技能
|
||||
pokemonList.add(skillInfo);
|
||||
|
||||
// 修行技能
|
||||
// Map<Integer, Integer> practiceSkillMap =user.getHeroManager().getPracticeSkillMap();
|
||||
// if (practiceSkillMap != null){
|
||||
// StringBuilder passivitySkillStr=new StringBuilder();
|
||||
// for (Map.Entry<Integer, Integer> entry : practiceSkillMap.entrySet()) {
|
||||
|
@ -2561,26 +2531,10 @@ public class HeroLogic {
|
|||
// }
|
||||
// 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){
|
||||
return CommonProto.FightTeamInfo.newBuilder()
|
||||
|
@ -2620,14 +2574,9 @@ public class HeroLogic {
|
|||
.build();
|
||||
pokemonInfos.add(info);
|
||||
}
|
||||
// 获取已上阵得变身卡
|
||||
List<Integer> list = user.getHeroManager().getTransformationList().values().stream()
|
||||
.filter(v -> v.getStatus() == 1)
|
||||
.mapToInt(TransformationInfo::getCardId)
|
||||
.boxed().collect(Collectors.toList());
|
||||
getPracticeSkill(pokemonInfos, user,
|
||||
user.getPlayerInfoManager().getMaxForce(),user.getPlayerInfoManager().getSex(),
|
||||
user.getPlayerInfoManager().getLevel(),list);
|
||||
|
||||
// 变身卡
|
||||
getPracticeSkill(user, 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, SChangingCard> changingCardMap = STableManager.getConfig(SChangingCard.class);
|
||||
|
@ -2983,6 +2938,7 @@ public class HeroLogic {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//化身之力提供的属性
|
||||
Map<Integer, SChangingForce> SChangingForce = STableManager.getConfig(SChangingForce.class);
|
||||
if(SChangingForce.get(user.getHeroManager().getTransformationForce()) != null){
|
||||
|
@ -4077,6 +4033,25 @@ public class HeroLogic {
|
|||
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
|
||||
*/
|
||||
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,35 +775,34 @@ public class ItemLogic {
|
|||
if (sEquipTalismana == null || sEquipTalismana.getRankupBasicMaterial() == null|| sEquipTalismana.getRankupBasicMaterial().length==0) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("法宝已最大等级"));
|
||||
}
|
||||
boolean b = ItemUtil.itemCost(user, sEquipTalismana.getRankupBasicMaterial(), BIReason.ESPECIAL_EQUIP_UP_LEVEL_CONSUME, 1);
|
||||
if (b) {
|
||||
hero.updateEspecial(hero.getEspecialEquipLevel() + 1);
|
||||
Poster.getPoster().dispatchEvent(new EspecialEquipUpEvent(user.getId(), especialEquipId, hero.getEspecialEquipLevel()));
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ESPECIAL_EQUIP, hero.getEspecialEquipLevel(), heroId);
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE, null, true);
|
||||
int[] value = SSpecialConfig.getOnceArrayValue(SSpecialConfig.lamp_rankup_equiptalisman_content_parm);
|
||||
if (hero.getEspecialEquipLevel() >= value[0]) {
|
||||
SItem sItem = SItem.getsItemMap().get(especialEquipId);
|
||||
if (sItem.getQuantity() < 5) {
|
||||
return;
|
||||
}
|
||||
// 每5级发送一次公告
|
||||
if (hero.getEspecialEquipLevel() % value[1] != 0) {
|
||||
return;
|
||||
}
|
||||
String nameColor = user.getPlayerInfoManager().getNameColor();
|
||||
String message = SErrorCodeEerverConfig.getI18NMessageNeedConvert("lamp_rankup_equiptalisman_content",
|
||||
new Object[]{nameColor, user.getPlayerInfoManager().getNickName(), sItem.getName(), hero.getEspecialEquipLevel()},
|
||||
new int[]{0,0,1,0});
|
||||
ChatLogic.getInstance().sendSysChatMessage(message, Global.DILIGENT, String.valueOf(sItem.getId()), 0, 0, 0, 0, 0);
|
||||
}
|
||||
// 更新战力
|
||||
Poster.getPoster().dispatchEvent(new SaveHeroForceEvent(user.getId(),heroId));
|
||||
//鸿蒙阵
|
||||
HeroLogic.getInstance().addOrUpdateHongmeng(session);
|
||||
} else {
|
||||
boolean check = ItemUtil.itemCost(user, sEquipTalismana.getRankupBasicMaterial(), BIReason.ESPECIAL_EQUIP_UP_LEVEL_CONSUME, 1);
|
||||
if (!check){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_ESPECIAL_EQUIP_UP_ITEM_NOT);
|
||||
}
|
||||
hero.updateEspecial(hero.getEspecialEquipLevel() + 1);
|
||||
Poster.getPoster().dispatchEvent(new EspecialEquipUpEvent(user.getId(), especialEquipId, hero.getEspecialEquipLevel()));
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ESPECIAL_EQUIP, hero.getEspecialEquipLevel(), heroId);
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE, null, true);
|
||||
int[] value = SSpecialConfig.getOnceArrayValue(SSpecialConfig.lamp_rankup_equiptalisman_content_parm);
|
||||
if (hero.getEspecialEquipLevel() >= value[0]) {
|
||||
SItem sItem = SItem.getsItemMap().get(especialEquipId);
|
||||
if (sItem.getQuantity() < 5) {
|
||||
return;
|
||||
}
|
||||
// 每5级发送一次公告
|
||||
if (hero.getEspecialEquipLevel() % value[1] != 0) {
|
||||
return;
|
||||
}
|
||||
String nameColor = user.getPlayerInfoManager().getNameColor();
|
||||
String message = SErrorCodeEerverConfig.getI18NMessageNeedConvert("lamp_rankup_equiptalisman_content",
|
||||
new Object[]{nameColor, user.getPlayerInfoManager().getNickName(), sItem.getName(), hero.getEspecialEquipLevel()},
|
||||
new int[]{0,0,1,0});
|
||||
ChatLogic.getInstance().sendSysChatMessage(message, Global.DILIGENT, String.valueOf(sItem.getId()), 0, 0, 0, 0, 0);
|
||||
}
|
||||
// 更新战力
|
||||
Poster.getPoster().dispatchEvent(new SaveHeroForceEvent(user.getId(),heroId));
|
||||
//鸿蒙阵
|
||||
HeroLogic.getInstance().addOrUpdateHongmeng(session);
|
||||
}
|
||||
|
||||
public void addItemLog(ItemLog itemLog) {
|
||||
|
|
|
@ -329,23 +329,19 @@ public class FightDataUtil {
|
|||
LuaValue monster = new LuaTable();
|
||||
///100代表是修行技能
|
||||
if (unitInfo.getPosition()==100){
|
||||
monster.set("id",0);
|
||||
monster.set("id",unitInfo.getUnitId());
|
||||
monster.set("star",unitInfo.getStar());
|
||||
monster.set("teamDamage",unitInfo.getForceScore());
|
||||
monster.set("camp",camp);
|
||||
monster.set("position",unitInfo.getPosition());
|
||||
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();
|
||||
for (int k = 0; k < skillIdArr.length; k++) {
|
||||
SPlayerSkill playerSkillConfig = STableManager.getConfig(SPlayerSkill.class).get(Integer.valueOf(skillIdArr[k]));
|
||||
LuaValue skill = getLuaSkill(playerSkillConfig.getSkillIDList(), playerSkillConfig.getReleasePoint(),playerSkillConfig.getReleaseLimit(), playerSkillConfig.getWarEffectCount(), playerSkillConfig.getTurnEffectCount());
|
||||
String[] oneSkill = skillId.split("\\|");
|
||||
for (int k = 0; k < oneSkill.length; k++) {
|
||||
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);
|
||||
}
|
||||
monster.set("skill",skillList);
|
||||
|
@ -489,8 +485,11 @@ public class FightDataUtil {
|
|||
}
|
||||
|
||||
private static LuaValue getProperty(String dataList) {
|
||||
String[] propertyArr = dataList.trim().split("#");
|
||||
LuaValue property = new LuaTable();
|
||||
if (dataList.isEmpty()){
|
||||
return property;
|
||||
}
|
||||
String[] propertyArr = dataList.trim().split("#");
|
||||
for (int i = 1; i <= propertyArr.length; i++) {
|
||||
property.rawset(i, LuaValue.valueOf(Double.parseDouble(propertyArr[i-1])));
|
||||
}
|
||||
|
|
|
@ -20,9 +20,13 @@ public class SChangingCard implements BaseConfig {
|
|||
private int isOpen;
|
||||
private int starMax;
|
||||
private int levelMax;
|
||||
private int[][] playerPropList;
|
||||
|
||||
public static Map<Integer, SChangingCard> map;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
map = STableManager.getConfig(SChangingCard.class);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
|
@ -68,4 +72,8 @@ public class SChangingCard implements BaseConfig {
|
|||
public int getLevelMax() {
|
||||
return levelMax;
|
||||
}
|
||||
|
||||
public int[][] getPlayerPropList() {
|
||||
return playerPropList;
|
||||
}
|
||||
}
|
|
@ -20,6 +20,7 @@ public class SChangingCardLevel implements BaseConfig {
|
|||
private int[] exp;
|
||||
|
||||
private int[] changingForceExp;
|
||||
private int[][] playerPropList;
|
||||
|
||||
public static Map<Integer, Map<Integer, SChangingCardLevel>> sChallengeConfigs =new HashMap<Integer, Map<Integer, SChangingCardLevel>>();;
|
||||
@Override
|
||||
|
@ -62,10 +63,11 @@ public class SChangingCardLevel implements BaseConfig {
|
|||
public int[] getExp() {
|
||||
return exp;
|
||||
}
|
||||
|
||||
public int[] getChangingForceExp() {
|
||||
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[][] playerPropList;
|
||||
|
||||
/**
|
||||
* map《poolid,map《star,object》》
|
||||
*/
|
||||
|
@ -65,5 +67,7 @@ public class SChangingCardStar implements BaseConfig {
|
|||
return starUpExp;
|
||||
}
|
||||
|
||||
|
||||
public int[][] getPlayerPropList() {
|
||||
return playerPropList;
|
||||
}
|
||||
}
|
|
@ -29,6 +29,9 @@ public class SPlayerLevelConfig implements BaseConfig {
|
|||
|
||||
private int[][] levelUpReward;
|
||||
|
||||
private int[][] propList;
|
||||
|
||||
private int[][] playerPropList;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
@ -76,6 +79,14 @@ public class SPlayerLevelConfig implements BaseConfig {
|
|||
return levelUpReward;
|
||||
}
|
||||
|
||||
public int[][] getPropList() {
|
||||
return propList;
|
||||
}
|
||||
|
||||
public int[][] getPlayerPropList() {
|
||||
return playerPropList;
|
||||
}
|
||||
|
||||
public static Map<Integer, SPlayerLevelConfig> getsPlayerLevelConfigMap() {
|
||||
return sPlayerLevelConfigMap;
|
||||
}
|
||||
|
|
|
@ -35,14 +35,14 @@ public class SPlayerSkill implements BaseConfig {
|
|||
|
||||
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;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
mapData=new HashMap<>();
|
||||
sPrivilegeTypeConfigMap= STableManager.getConfig(SPlayerSkill.class);
|
||||
sPrivilegeTypeConfigMap = STableManager.getConfig(SPlayerSkill.class);
|
||||
for (Map.Entry<Integer, SPlayerSkill> integer : sPrivilegeTypeConfigMap.entrySet()) {
|
||||
SPlayerSkill skill=integer.getValue();
|
||||
if (!mapData.containsKey(skill.getSkillID())){
|
||||
|
|
Loading…
Reference in New Issue