Merge branch 'master_test_hw' of http://60.1.1.230/backend/jieling_server into master_test_hw
commit
d1d38a85a0
|
@ -156,7 +156,7 @@ public interface BIReason {
|
|||
|
||||
int SPECIAL_MONSTER_REWARD = 88;//灵兽涅槃获得
|
||||
int SPECIAL_FREE_PIECE_REWARD = 89;//灵兽放生获得
|
||||
|
||||
int SKIN_USE_REWARD = 90;//激活皮肤获得头像
|
||||
|
||||
int ADVENTURE_UPLEVEL_CONSUME = 1000;//秘境升级
|
||||
int SECRETBOX_CONSUME = 1001;//秘盒抽卡
|
||||
|
@ -290,4 +290,6 @@ public interface BIReason {
|
|||
|
||||
int SPECIAL_FREE_PIECE_CONSUME = 1072;//灵兽放生碎片消耗
|
||||
|
||||
int SKIN_USE_CONSUME = 1073;//激活皮肤消耗
|
||||
|
||||
}
|
|
@ -15,6 +15,7 @@ import com.ljsd.jieling.util.MessageUtil;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
@ -44,7 +45,19 @@ public class GetAllHerosHandler extends BaseHandler{
|
|||
User user = UserManager.getUser(userId);
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
Map<String, Hero> heroMap = heroManager.getHeroMap();
|
||||
int nowTime = TimeUtils.nowInt();
|
||||
for(Hero hero : heroMap.values()){
|
||||
//检测皮肤
|
||||
if(hero.getSkin()!=0){
|
||||
if(!heroManager.getSkinInfo().containsKey(hero.getSkin())){
|
||||
hero.setSkin(0);
|
||||
}else{
|
||||
int skin= heroManager.getSkinInfo().get(hero.getSkin());
|
||||
if(skin!=-1&&skin<nowTime){
|
||||
hero.setSkin(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
heroList.add(CBean2Proto.getHero(hero));
|
||||
}
|
||||
boolean isSendFinish = false;
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package com.ljsd.jieling.handler.hero;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/10/31
|
||||
* @discribe
|
||||
*/
|
||||
@Component
|
||||
public class ChangeHeroSkinHandler extends BaseHandler<HeroInfoProto.ChangeSkinRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.HERO_SKIN_CHANGE_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.ChangeSkinRequest proto) throws Exception {
|
||||
HeroLogic.getInstance().changeSkin(iSession,proto.getHeroId(),proto.getSkinId(), MessageTypeProto.MessageType.HERO_SKIN_CHANGE_RESPONSE);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.ljsd.jieling.handler.hero;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/10/31
|
||||
* @discribe
|
||||
*/
|
||||
@Component
|
||||
public class GetAllSkinHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.HERO_SKIN_GET_ALL_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
HeroLogic.getInstance().getAllSkin(iSession,MessageTypeProto.MessageType.HERO_SKIN_GET_ALL_RESPONSE);
|
||||
}
|
||||
}
|
|
@ -3220,7 +3220,14 @@ public class MapLogic {
|
|||
for(String id:heroIds){
|
||||
Hero hero = heroManager.getHero(id);
|
||||
String heroSkill = HeroLogic.getInstance().getHeroSkills(user,hero,new StringBuilder()).toString();
|
||||
TrailHero trailHero = new TrailHero(hero.getTemplateId(),HeroLogic.getInstance().calHeroNotBufferAttribute(user,hero,false,0),hero.getStar(),heroSkill,hero.getLevel());
|
||||
int skinTime = heroManager.getSkinInfo().getOrDefault(hero.getSkin(), 0);
|
||||
int skinId = hero.getSkin();
|
||||
|
||||
if(skinTime!=-1&&skinTime<TimeUtils.nowInt()){
|
||||
skinId = 0;
|
||||
skinTime = 0;
|
||||
}
|
||||
TrailHero trailHero = new TrailHero(hero.getTemplateId(),HeroLogic.getInstance().calHeroNotBufferAttribute(user,hero,false,0),hero.getStar(),heroSkill,hero.getLevel(),skinId,skinTime);
|
||||
heroInfo.put(id,trailHero);
|
||||
}
|
||||
mapManager.updateTrailHeroInfo(heroInfo);
|
||||
|
|
|
@ -19,6 +19,10 @@ public class TrailHero {
|
|||
|
||||
private int level;
|
||||
|
||||
private int skinId;
|
||||
|
||||
private int skinTime;
|
||||
|
||||
public int getTmpId() {
|
||||
return tmpId;
|
||||
}
|
||||
|
@ -43,12 +47,22 @@ public class TrailHero {
|
|||
this.star = star;
|
||||
}
|
||||
|
||||
public TrailHero(int tmpId, Map<Integer, Integer> property, int star,String heroSkills,int level) {
|
||||
public TrailHero(int tmpId, Map<Integer, Integer> property, int star,String heroSkills,int level,int skinId,int skinTime) {
|
||||
this.tmpId = tmpId;
|
||||
this.property = property;
|
||||
this.star = star;
|
||||
this.heroSkills = heroSkills;
|
||||
this.level = level;
|
||||
this.skinId = skinId;
|
||||
this.skinTime = skinTime;
|
||||
}
|
||||
|
||||
public int getSkinId() {
|
||||
return skinId;
|
||||
}
|
||||
|
||||
public int getSkinTime() {
|
||||
return skinTime;
|
||||
}
|
||||
|
||||
public String getHeroSkills() {
|
||||
|
|
|
@ -30,6 +30,7 @@ import com.ljsd.jieling.util.MessageUtil;
|
|||
import com.ljsd.jieling.util.MonsterUtil;
|
||||
import config.SArenaRobotConfig;
|
||||
import config.SCHero;
|
||||
import jdk.nashorn.internal.ir.debug.ObjectSizeCalculator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import util.TimeUtils;
|
||||
|
@ -241,6 +242,7 @@ public class BehaviorUtil {
|
|||
.setProperty(property.substring(0, property.length()-1))
|
||||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setStar(hero.getStar())
|
||||
.setSkinId(hero.getSkin())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
|
|
|
@ -105,6 +105,7 @@ public class TowerMap extends AbstractMap {
|
|||
.setHeroHp(calHp)
|
||||
.setStar(trailHero.getStar())
|
||||
.setLevel(trailHero.getLevel())
|
||||
.setSkinId(trailHero.getSkinId())
|
||||
.build();
|
||||
mapEnterResponse.addInfos(info);
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@ public class Hero extends MongoBase {
|
|||
private int changeId ;
|
||||
private Set<String> jewelInfo = new HashSet<>();
|
||||
|
||||
private int skin;
|
||||
public Hero(){
|
||||
//绑定关系
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
|
@ -303,4 +304,14 @@ public class Hero extends MongoBase {
|
|||
public int getChangeId() {
|
||||
return changeId;
|
||||
}
|
||||
|
||||
public int getSkin() {
|
||||
return skin;
|
||||
}
|
||||
|
||||
public void setSkin(int skin) {
|
||||
this.skin = skin;
|
||||
updateString("skin",skin);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,8 @@ public class HeroManager extends MongoBase {
|
|||
|
||||
private Map<Integer,Integer> heroHandBook = new HashMap<>();
|
||||
|
||||
private Map<Integer,Integer> skinInfo = new HashMap<>();
|
||||
|
||||
private int firstTenth;
|
||||
|
||||
|
||||
|
@ -115,4 +117,17 @@ public class HeroManager extends MongoBase {
|
|||
this.mustRandomCount = mustRandomCount;
|
||||
updateString("mustRandomCount",mustRandomCount);
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getSkinInfo() {
|
||||
return skinInfo;
|
||||
}
|
||||
public void addSkin(int skinId,int time){
|
||||
skinInfo.put(skinId,time);
|
||||
updateString("skinInfo."+skinId,time);
|
||||
}
|
||||
public void removeSkin(int skinId){
|
||||
skinInfo.remove(skinId);
|
||||
removeString(getMongoKey()+"skinInfo."+skinId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -673,6 +673,7 @@ public class ExpeditionLogic {
|
|||
builder1.setLevel(familyHeroInfo.getLevel());
|
||||
builder1.setStar(familyHeroInfo.getStar());
|
||||
builder1.setRemainHp(heroHP.get(s));
|
||||
builder1.setPosition(familyHeroInfo.getPosition());
|
||||
builders.add(builder1.build());
|
||||
});
|
||||
builder.addAllHero(builders);
|
||||
|
|
|
@ -24,6 +24,7 @@ import com.ljsd.jieling.util.MonsterUtil;
|
|||
import config.SArenaRobotConfig;
|
||||
import config.SCHero;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
@ -253,6 +254,7 @@ public class FightUtil {
|
|||
.setProperty(property.substring(0, property.length()-1))
|
||||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setStar(trailHero.getStar())
|
||||
.setSkinId(trailHero.getSkinId()==0?0:(trailHero.getSkinTime()==-1||trailHero.getSkinTime()> TimeUtils.nowInt()?trailHero.getSkinId():0))
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
|
@ -327,6 +329,7 @@ public class FightUtil {
|
|||
.setUnitSkillIds(heroSkill.substring(0,heroSkill.length()-1))
|
||||
.setProperty(property.substring(0, property.length()-1))
|
||||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setStar(hero.getStar())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
|
|
|
@ -1476,7 +1476,6 @@ public class HeroLogic{
|
|||
}
|
||||
combinedAttribute(pokemonAttr,heroAllAttribute);
|
||||
}
|
||||
//todo 灵兽
|
||||
//灵兽图鉴加成
|
||||
Set<Integer> pokemonBookEnabled = pokemonManager.getPokemonBookEnabled();
|
||||
if(!pokemonBookEnabled.isEmpty()){
|
||||
|
@ -1486,6 +1485,17 @@ public class HeroLogic{
|
|||
combinedAttribute(activePara,heroAllAttribute);
|
||||
}
|
||||
}
|
||||
//英雄皮肤加成 记得判断皮肤过期
|
||||
int skin = hero.getSkin();
|
||||
if(skin!=0){
|
||||
Map<Integer, Integer> skinInfo = user.getHeroManager().getSkinInfo();
|
||||
SHeroSkin sHeroSkin = SHeroSkin.skinMapByType.get(skin);
|
||||
if(sHeroSkin!=null&&sHeroSkin.getMonomerProperty()!=null&&sHeroSkin.getMonomerProperty().length>0){
|
||||
if(skinInfo.containsKey(skin)&&skinInfo.get(skin)>TimeUtils.nowInt()){
|
||||
combinedAttribute(sHeroSkin.getMonomerProperty(),heroAllAttribute);
|
||||
}
|
||||
}
|
||||
}
|
||||
//装备总战力评分
|
||||
int equipForce=0;
|
||||
boolean needRemove = false;
|
||||
|
@ -3252,6 +3262,61 @@ public class HeroLogic{
|
|||
|
||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(session.getUid()));
|
||||
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有皮肤信息
|
||||
* @param session
|
||||
* @param messageType
|
||||
*/
|
||||
public void getAllSkin(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
Map<Integer, Integer> skinInfo = user.getHeroManager().getSkinInfo();
|
||||
HeroInfoProto.GetAllSkinResponse.Builder response = HeroInfoProto.GetAllSkinResponse.newBuilder();
|
||||
Set<Integer> removeId = new HashSet<>(skinInfo.size()+1);
|
||||
|
||||
if(!skinInfo.isEmpty()){
|
||||
for(Map.Entry<Integer,Integer> entry:skinInfo.entrySet()){
|
||||
if(entry.getValue()!=-1&&entry.getValue()<TimeUtils.nowInt()){
|
||||
removeId.add(entry.getKey());
|
||||
}
|
||||
}
|
||||
if(!removeId.isEmpty()){
|
||||
for(int remove :removeId){
|
||||
user.getHeroManager().removeSkin(remove);
|
||||
}
|
||||
}
|
||||
skinInfo.forEach((k,v)->response.addSkinInfo(CommonProto.SkinInfo.newBuilder().setSkinId(k).setOverTime(v).build()));
|
||||
}
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更换皮肤
|
||||
* @param session
|
||||
* @param messageType
|
||||
*/
|
||||
public void changeSkin(ISession session,String heroId,int skinId, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
Map<Integer, Integer> skinInfo = user.getHeroManager().getSkinInfo();
|
||||
Hero hero = user.getHeroManager().getHero(heroId);
|
||||
if(skinId!=0){
|
||||
if(!skinInfo.containsKey(skinId)||(skinInfo.get(skinId)!=-1&&skinInfo.get(skinId)<TimeUtils.nowInt())){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
if(hero==null||hero.getSkin()==skinId){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
SHeroSkin sHeroSkin = SHeroSkin.skinMapByType.get(skinId);
|
||||
if(sHeroSkin==null||sHeroSkin.getHeroId()!=hero.getTemplateId()){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
}
|
||||
|
||||
hero.setSkin(skinId);
|
||||
|
||||
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ 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.globals.GlobalItemType;
|
||||
import com.ljsd.jieling.handler.map.MapManager;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
|
@ -30,6 +31,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
import util.MathUtils;
|
||||
import util.StringUtil;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -140,6 +142,15 @@ public class ItemLogic {
|
|||
if (itemList.size() == 0 ){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
if(itemList.size()==1){
|
||||
CommonProto.Item item = itemList.iterator().next();
|
||||
//如果是使用皮肤
|
||||
if(SItem.getsItemMap().get(item.getItemId()).getItemType()== GlobalItemType.DECORATION){
|
||||
useHeroSkin(iSession,user,item);
|
||||
MessageUtil.sendMessage(iSession, 1,msgId, PlayerInfoProto.UseAndPriceItemResponse.newBuilder().build(), true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
int openBoxLimits = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getOpenBoxLimits();
|
||||
for (CommonProto.Item item :itemList){
|
||||
SItem sItem = SItem.getsItemMap().get(item.getItemId());
|
||||
|
@ -176,6 +187,38 @@ public class ItemLogic {
|
|||
sendUseAndPriceItemMessage(iSession, msgId, drop);
|
||||
}
|
||||
|
||||
private void useHeroSkin(ISession session,User user,CommonProto.Item item) throws Exception {
|
||||
Map<Integer, Integer> skinInfo = user.getHeroManager().getSkinInfo();
|
||||
SHeroSkin sHeroSkin = STableManager.getConfig(SHeroSkin.class).get(item.getItemId());
|
||||
if(sHeroSkin==null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
if(skinInfo.containsKey(sHeroSkin.getType())){
|
||||
if(skinInfo.get(sHeroSkin.getType())==-1||skinInfo.get(sHeroSkin.getType())> TimeUtils.nowInt()){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
}
|
||||
int time;
|
||||
if(sHeroSkin.getTime()==0){
|
||||
time = -1;
|
||||
}else{
|
||||
// time =TimeUtils.nowInt()+120;
|
||||
time =(int)(sHeroSkin.getTime()*TimeUtils.DAY/1000+TimeUtils.nowInt());
|
||||
|
||||
}
|
||||
|
||||
boolean use = ItemUtil.itemCost(user,new int[][]{{item.getItemId(),item.getItemNum()}},BIReason.SKIN_USE_CONSUME,1);
|
||||
if(!use){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
user.getHeroManager().addSkin(sHeroSkin.getType(),time);
|
||||
ItemUtil.drop(user,new int[][]{sHeroSkin.getHeadIcon()},BIReason.SKIN_USE_REWARD);
|
||||
HeroInfoProto.GetSkinIndication indication = HeroInfoProto.GetSkinIndication.newBuilder()
|
||||
.setSkinInfo(CommonProto.SkinInfo.newBuilder().setSkinId(sHeroSkin.getType()).setOverTime(time))
|
||||
.build();
|
||||
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.HERO_SKIN_USE_INDICATION_VALUE,indication,true);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用选择宝箱道具
|
||||
|
|
|
@ -106,6 +106,7 @@ public class CBean2Proto {
|
|||
.addAllJewels(hero.getJewelInfo())
|
||||
.setCreatetype(hero.getCreateType())
|
||||
.setChangeId(hero.getChangeId())
|
||||
.setSkinId(hero.getSkin())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -255,6 +256,7 @@ public class CBean2Proto {
|
|||
monsterBuilder.setProperty(monsterPropertyList.toString());
|
||||
monsterBuilder.setUnitSkillIds(monsterSkillList.toString());
|
||||
monsterBuilder.setUnitId(String.valueOf(sMonsterConfig.getId()));
|
||||
monsterBuilder.setSkinId(sMonsterConfig.getSkinId());
|
||||
return monsterBuilder;
|
||||
}
|
||||
|
||||
|
@ -552,7 +554,7 @@ public class CBean2Proto {
|
|||
|
||||
|
||||
public static CommonProto.TeamSimpleInfo getSimpleTeamInfoByHero(Hero hero,int position){
|
||||
return CommonProto.TeamSimpleInfo.newBuilder().setHeroid(hero.getId()).setHeroTid(hero.getTemplateId()).setLevel(hero.getLevel()).setStar(hero.getStar()).setPosition(position).build();
|
||||
return CommonProto.TeamSimpleInfo.newBuilder().setHeroid(hero.getId()).setHeroTid(hero.getTemplateId()).setLevel(hero.getLevel()).setStar(hero.getStar()).setPosition(position).setSkinId(hero.getSkin()).build();
|
||||
}
|
||||
public static CommonProto.TeamSimpleInfo getSimpleTeamInfoByPokeMon(Pokemon pokemon,int position){
|
||||
return CommonProto.TeamSimpleInfo.newBuilder().setHeroid(pokemon.getId()).setHeroTid(pokemon.getTmpId()).setLevel(pokemon.getLevel()).setStar(pokemon.getStar()).setPosition(position).build();
|
||||
|
|
|
@ -92,17 +92,18 @@ public class FightDataUtil {
|
|||
unitData.set("position",unitInfo.getPosition());
|
||||
unitData.set("quality", sMonster.getQuality());
|
||||
unitData.set("element",sMonster.getPropertyName());
|
||||
unitData.set("skinId",sMonster.getSkinId());
|
||||
if (unitSkill.length==1){
|
||||
unitData.set("skill", getSkill(unitSkill[0]));
|
||||
unitData.set("skill", getSkill(unitSkill[0],sMonster.getSkinId()));
|
||||
unitData.set("superSkill", new LuaTable());
|
||||
unitData.set("passivity", new LuaTable());
|
||||
}else if (unitSkill.length==2){
|
||||
unitData.set("skill", getSkill(unitSkill[0]));
|
||||
unitData.set("superSkill", getSkill(unitSkill[1]));
|
||||
unitData.set("skill", getSkill(unitSkill[0],sMonster.getSkinId()));
|
||||
unitData.set("superSkill", getSkill(unitSkill[1],sMonster.getSkinId()));
|
||||
unitData.set("passivity", new LuaTable());
|
||||
}else {
|
||||
unitData.set("skill", getSkill(unitSkill[0]));
|
||||
unitData.set("superSkill", getSkill(unitSkill[1]));
|
||||
unitData.set("skill", getSkill(unitSkill[0],sMonster.getSkinId()));
|
||||
unitData.set("superSkill", getSkill(unitSkill[1],sMonster.getSkinId()));
|
||||
unitData.set("passivity", getPassivity(unitSkill));
|
||||
}
|
||||
unitData.set("ai", getMonsterAi(sMonster.getMonsterAi()));
|
||||
|
@ -269,7 +270,7 @@ public class FightDataUtil {
|
|||
}else{
|
||||
triggerCondition.rawset(1,LuaValue.valueOf(0));
|
||||
}
|
||||
oneSkill.set("effect",getSkill(String.valueOf(skillIDList[j])));
|
||||
oneSkill.set("effect",getSkill(String.valueOf(skillIDList[j]),0));
|
||||
oneSkill.set("triggerCondition",triggerCondition);
|
||||
|
||||
oneSkill.set("maxCount",sSpiritAnimalSkill.getWarEffectCount()[j]);
|
||||
|
@ -310,14 +311,15 @@ public class FightDataUtil {
|
|||
unitData.set("position", data.getPosition());
|
||||
unitData.set("element", hero.getPropertyName());
|
||||
|
||||
unitData.set("skill", getSkill(skillIds[0]));
|
||||
unitData.set("skill", getSkill(skillIds[0],data.getSkinId()));
|
||||
if(skillIds.length == 1){
|
||||
unitData.set("superSkill", getSkill(null));
|
||||
unitData.set("superSkill", getSkill(null,data.getSkinId()));
|
||||
}else {
|
||||
unitData.set("superSkill", getSkill(skillIds[1]));
|
||||
unitData.set("superSkill", getSkill(skillIds[1],data.getSkinId()));
|
||||
}
|
||||
unitData.set("passivity", getPassivity(skillIds));
|
||||
unitData.set("property", getProperty(property));
|
||||
unitData.set("skinId",data.getSkinId());
|
||||
return unitData;
|
||||
}
|
||||
|
||||
|
@ -330,7 +332,7 @@ public class FightDataUtil {
|
|||
return property;
|
||||
}
|
||||
|
||||
private static LuaValue getSkill(String skillId,String...args) {
|
||||
private static LuaValue getSkill(String skillId,int skinId) {
|
||||
LuaValue skill = new LuaTable();
|
||||
if (StringUtil.isEmpty(skillId)){
|
||||
return skill;
|
||||
|
@ -342,7 +344,14 @@ public class FightDataUtil {
|
|||
// cd+=Integer.parseInt(args[0]);
|
||||
// }
|
||||
skill.rawset(1, LuaValue.valueOf(skillId));
|
||||
int skillDisplay =sSkillLogicVo.getSkillDisplay();
|
||||
int[][] display =sSkillLogicVo.getSkillDisplay();
|
||||
int skillDisplay = display[0][0];
|
||||
for(int[] skillArray:display){
|
||||
if(skillArray[0]==skinId){
|
||||
skillDisplay = skillArray[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
SCombatControl sCombatControl = STableManager.getConfig(SCombatControl.class).get(skillDisplay);
|
||||
int KeyFrame = sCombatControl.getKeyFrame();
|
||||
int SkillDuration = sCombatControl.getSkillDuration();
|
||||
|
|
|
@ -0,0 +1,97 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="HeroSkin")
|
||||
public class SHeroSkin implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int type;
|
||||
|
||||
private int heroId;
|
||||
|
||||
private String readingName;
|
||||
|
||||
private int[][] unlockProperty;
|
||||
|
||||
private int[][] monomerProperty;
|
||||
|
||||
private int time;
|
||||
|
||||
private int isDefault;
|
||||
|
||||
private int order;
|
||||
|
||||
private int[] price;
|
||||
|
||||
private int[] headIcon;
|
||||
|
||||
|
||||
public static Map<Integer,SHeroSkin> skinMapByType;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
Map<Integer, SHeroSkin> config = STableManager.getConfig(SHeroSkin.class);
|
||||
|
||||
Map<Integer,SHeroSkin> skinMapByTypeTemp = new HashMap<>();
|
||||
|
||||
for(Map.Entry<Integer,SHeroSkin> entry:config.entrySet()){
|
||||
|
||||
skinMapByTypeTemp.put(entry.getValue().getType(),entry.getValue());
|
||||
|
||||
}
|
||||
skinMapByType =skinMapByTypeTemp;
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getHeroId() {
|
||||
return heroId;
|
||||
}
|
||||
|
||||
public String getReadingName() {
|
||||
return readingName;
|
||||
}
|
||||
|
||||
public int[][] getUnlockProperty() {
|
||||
return unlockProperty;
|
||||
}
|
||||
|
||||
public int[][] getMonomerProperty() {
|
||||
return monomerProperty;
|
||||
}
|
||||
|
||||
public int getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
|
||||
public int getIsDefault() {
|
||||
return isDefault;
|
||||
}
|
||||
|
||||
public int getOrder() {
|
||||
return order;
|
||||
}
|
||||
|
||||
public int[] getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public int[] getHeadIcon() {
|
||||
return headIcon;
|
||||
}
|
||||
}
|
|
@ -58,6 +58,8 @@ public class SMonsterConfig implements BaseConfig {
|
|||
|
||||
private int[] monsterAi;
|
||||
|
||||
private int skinId;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -177,4 +179,8 @@ public class SMonsterConfig implements BaseConfig {
|
|||
public int[] getMonsterAi() {
|
||||
return monsterAi;
|
||||
}
|
||||
|
||||
public int getSkinId() {
|
||||
return skinId;
|
||||
}
|
||||
}
|
|
@ -24,7 +24,7 @@ public class SSkillLogicConfig implements BaseConfig {
|
|||
|
||||
private float cd;
|
||||
|
||||
private int skillDisplay;
|
||||
private int[][] skillDisplay;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
@ -66,7 +66,7 @@ public class SSkillLogicConfig implements BaseConfig {
|
|||
return cd;
|
||||
}
|
||||
|
||||
public int getSkillDisplay() {
|
||||
public int[][] getSkillDisplay() {
|
||||
return skillDisplay;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ public class SSkillLogicVo{
|
|||
|
||||
private int skillId;
|
||||
|
||||
private int skillDisplay;
|
||||
private int[][] skillDisplay;
|
||||
|
||||
private List<SkillTargetVo> skillTargetVoList;
|
||||
|
||||
|
@ -18,11 +18,11 @@ public class SSkillLogicVo{
|
|||
this.skillId = skillId;
|
||||
}
|
||||
|
||||
public int getSkillDisplay() {
|
||||
public int[][] getSkillDisplay() {
|
||||
return skillDisplay;
|
||||
}
|
||||
|
||||
public void setSkillDisplay(int skillDisplay) {
|
||||
public void setSkillDisplay(int[][] skillDisplay) {
|
||||
this.skillDisplay = skillDisplay;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue